亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? zl5011xutillib.c

?? Zalink50114----TDMoIP芯片驅(qū)動源碼
?? C
字號:
/*******************************************************************************
*
*  File name:              zl5011xUtilLib.c
*
*  Version:                18
*
*  Author:                 MRC
*
*  Date created:           08/02/2002
*
*  Copyright 2002, 2003, 2004, 2005, Zarlink Semiconductor Limited.
*  All rights reserved.
*
*  Module Description:
*
*  This file contains common utility functions for checking parameters and
*  accessing the device.
*
*  Revision History:
*
*  Rev:  Date:       Author:  Comments:
*  1     08/02/2002  MRC      Creation
*  9     27/09/2002  DJA      SOS version updated
*                             File header updated
*  10    27/09/2002  JFE      Added definition for zl5011xSendFunctionReport
*  11    27/09/2002  JFE      Made changes to zl5011xSendFunctionReport
*  11    30/09/2002  JFE      Moved zl5011xSendFunctionReport to debug_src file
*  12    31/10/2002  MRC      Added variants + minor fixes
*  14    09/06/2003  DJA      SOS version updated
*                                         Performed pre-audit actions
*  15    08/08/2003  APL      Version number updated
*  16    11/02/2005  APL      zl5011xCheckStreamRange now allows use of
*                             auxiliary clock if device is non-CES variant
*  17    16/06/2005  APL      Specified initialiser for intDisableKey
*  18    04/07/2005  MRC      Added stream range check for clock only function
*
*******************************************************************************/

/*****************   INCLUDE FILES   ******************************************/

#include "zl5011x.h"
#include "zl5011xUtilLib.h"

/*******************************************************************************

 Function:
    zl5011xUpdateRegisters

 Description:
    This function will update some (or all) of the bits in the device and
    structure registers.

 Inputs:
    zl5011xParams            Pointer to the structure for this device instance
    addr                Device register address to be updated
    structureRegister   Structure register read and then updated
                            NULL may be specified in the situation where the
                        structure registers is not to be read (or updated)
    data                Bits to be updated
    mask                        Mask for bits to be changed. '1' should be written for
                        each bit updated
 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    The function has 2 modes of operation, dependent on structureRegister.
    When this register is not NULL, the function will read the structure
    register, and use the mask and new bit values to update the structure
    and device registers. The structure is only updated after a successful
    write to the device.

    When structureRegister is NULL, the function will assume that newBits
    contains the entire new value of the register and will write it to the
    device. This mode permits the updating of the device alone.

    This function is not intended to be  used directly by the application. It
    is designed to be used by the API functions to reduce code duplication.

    Warning: This function assumes the structure and device are synchronisied.
             It will perform no synchronisation checking.

*******************************************************************************/

zlStatusE zl5011xUpdateRegisters(zl5011xParamsS *zl5011xParams, AddressT addr,
                                Uint32T *structureRegister, Uint32T data, Uint32T mask)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T tmp;

   if (structureRegister != NULL)
   {
      /* Register bits are to be read from structure */
      tmp = (*structureRegister & ~mask) | (data & mask);
   }
   else
   {
      tmp = data;
   }

   status = zl5011xWrite(zl5011xParams, addr, tmp);
   if ((status == ZL5011X_OK) && (structureRegister != NULL))
   {
      *structureRegister =  tmp;
   }

   return (status);
}

/*******************************************************************************

Function:
   zl5011xReadModWrite

Description:
   Performs a Read / Modify / Write sequence to a single hardware register

Inputs:
   zl5011xParams     Pointer to the structure for this device instance
   addr                 Address to be updates
   data                 Value to be written
   mask                 Indicates which bits in the register are to be changed

Ouputs:
   None

Returns:
   zlStatusE

*******************************************************************************/

zlStatusE zl5011xReadModWrite(zl5011xParamsS *zl5011xParams, AddressT addr,
                             Uint32T data, Uint32T mask)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T tmp;

   status = zl5011xRead(zl5011xParams, addr, &tmp);
   if (status == ZL5011X_OK)
   {
       tmp = (tmp & (~mask)) | (data & mask);
       status = zl5011xWrite(zl5011xParams, addr, tmp);
   }
   return (status);
}

/*******************************************************************************

 Function:
    zl5011xCheckClockRange

 Description:
    This function will check that the stream clock number is in range

 Inputs:
    zl5011xParams        Pointer to the structure for this device instance
    streamNumber        Stream number

 Outputs:
    None

 Returns:
    zlStatusE

 Remarks:
    None

*******************************************************************************/

zlStatusE zl5011xCheckClockRange(zl5011xParamsS *zl5011xParams, Uint8T streamNumber)
{
   zlStatusE status = ZL5011X_OK;

   /* the number of E1 streams gives the maximum available clock pins for this device */
   if (streamNumber >= zl5011xParams->devLimits.wanNumStreamsE1)
   {
      if (zl5011xParams->devLimits.cesAvailable == ZL5011X_FALSE)
      {
         /* non CES part, so auxiliary clock is a valid option */
         if (streamNumber != zl5011xParams->devLimits.wanAuxClockNum)
         {
            status = ZL5011X_STREAM_RANGE;
         }
      }
      else
      {  /* CES capable part, so stream must be less than number of device streams */
         status = ZL5011X_STREAM_RANGE;
      }
   }

   return status;
}

/*******************************************************************************

 Function:
    zl5011xCheckStreamRange

 Description:
    This function will check that the stream number is in range

 Inputs:
    zl5011xParams        Pointer to the structure for this device instance
    streamNumber        Stream number

 Outputs:
    None

 Returns:
    zlStatusE

 Remarks:
    None

*******************************************************************************/

zlStatusE zl5011xCheckStreamRange(zl5011xParamsS *zl5011xParams, Uint8T streamNumber)
{
   zlStatusE status = ZL5011X_OK;

   if (streamNumber >= zl5011xParams->wanIf.wanNumStreams)
   {
      if (zl5011xParams->devLimits.cesAvailable == ZL5011X_FALSE)
      {
         /* non CES part, so auxiliary clock is a valid option */
         if (streamNumber != zl5011xParams->devLimits.wanAuxClockNum)
         {
            status = ZL5011X_STREAM_RANGE;
         }
      }
      else
      {  /* CES capable part, so stream must be less than number of device streams */
         status = ZL5011X_STREAM_RANGE;
      }
   }

   return status;
}

/*******************************************************************************

 Function:
    zl5011xCheckChannelRange

 Description:
    This function will check that the channel number is in range

 Inputs:
    zl5011xParams        Pointer to the structure for this device instance
    channelNumber    Channel number

 Outputs:
    None

 Returns:
    zlStatusE

 Remarks:
    None

*******************************************************************************/

zlStatusE zl5011xCheckChannelRange(zl5011xParamsS *zl5011xParams, Uint8T channelNumber)
{
   if (channelNumber >= zl5011xParams->wanIf.wanNumChannels)
   {
      return(ZL5011X_CHANNEL_RANGE);
   }

   return (ZL5011X_OK);
}


/*****************************************************************************

Function:
   zl5011xCalcChanIndex

Description:
   This function calculates the index for the channel into the channel array.

Inputs:
   zl5011xParams Pointer to the structure for this device instance
   tdm              stream + channel

Outputs:
   tdmIndex         The index into the lookup tables for this slot

Returns:
   zlStatusE

*****************************************************************************/

zlStatusE zl5011xCalcChanIndex(zl5011xParamsS *zl5011xParams, zl5011xWanChannelS tdm,
                              Uint32T* tdmIndex)
{
   if (zl5011xParams->wanIf.wanNumChannels <= 32)
   {
      *tdmIndex = (tdm.stream << 5) + tdm.channel;
   }
   else
   {
      *tdmIndex = (tdm.stream << 7) + tdm.channel;
   }

   return (ZL5011X_OK);
}


/*****************************************************************************

Function:
   zl5011xCheckTdm

Description:
   This function checks that the stream and channel parameters have valid values
   and then calculates lutIndex and tdmSlot. lutIndex is the value used to
   index the lookup tables in the device hardware and the API structure. tdmSlot
   is a number that indicates the time that this slot will be accessed by the
   WAN interface.

Inputs:
   zl5011xParams     Pointer to the structure for this device instance
   tdm                  stream + channel

Outputs:
   tdmIndex             The index into the lookup tables for this slot

Returns:
   zlStatusE

*****************************************************************************/

zlStatusE zl5011xCheckTdm(zl5011xParamsS *zl5011xParams, zl5011xWanChannelS tdm,
                         Uint32T* tdmIndex)
{
   zlStatusE status = ZL5011X_OK;

   /* check if valid stream and channel and context */
   if (zl5011xCheckChannelRange(zl5011xParams, tdm.channel) != ZL5011X_OK)
   {
    return ZL5011X_CHANNEL_RANGE;
    }

   if (zl5011xCheckStreamRange(zl5011xParams, tdm.stream) != ZL5011X_OK)
   {
    return ZL5011X_STREAM_RANGE;
    }

   status = zl5011xCalcChanIndex(zl5011xParams, tdm, tdmIndex);

   return(status);
}


/*****************************************************************************
   Interrupt statics.

   intDisableKey        This is a return value from the OS when disabling the interrupt.
                        This value is kept, so that it can be used in subsequent calls to
                        enable the interrupt.

   intDisableLevel  This is used to hold the depth of interrupt disable.
                        i.e. when the level is 0, the interrupt is enabled.

*****************************************************************************/

static Uint32T intDisableKey = 0;
static Uint32T intDisableLevel = 0;

/*****************************************************************************

Function:
   zl5011xHostInterruptDisable

Description:
   Disables the interrupts on the host. This uses a counter to detect when the
   enables and disables are nested. That is, multiple disables may be called,
   then the interrupt will not be enabled until the enable function has been
   called a corresponding number of times.

Inputs:
   None

Outputs:
   None

Returns:
   zlStatusE

*****************************************************************************/

zlStatusE zl5011xHostInterruptDisable(void)
{
   zlStatusE status = ZL5011X_OK;

   if (intDisableLevel == 0)
   {
    intDisableKey = OS_INTERRUPT_LOCK();
    }

   intDisableLevel++;

   return (status);
}


/*****************************************************************************

Function:
   zl5011xHostInterruptEnable

Description:
   Enables the interrupts on the host. This uses a counter to detect when the
   enables and disables are nested. That is, multiple disables may be called,
   then the interrupt will not be enabled until the enable function has been
   called a corresponding number of times.

Inputs:
   None

Outputs:
   None

Returns:
   zlStatusE

*****************************************************************************/

zlStatusE zl5011xHostInterruptEnable(void)
{
   zlStatusE status = ZL5011X_OK;

   /* stop the level from going below 0. */
   if (intDisableLevel != 0)
   {
      intDisableLevel--;

      /* if the level is now 0, then the interrupts need to be enabled. */
      if (intDisableLevel == 0)
      {
        OS_INTERRUPT_UNLOCK(intDisableKey);
        }
   }

   return (status);
}



/*****************   END   ****************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久97超碰国产精品超碰| 亚洲少妇最新在线视频| 精品一区二区在线视频| 日韩欧美卡一卡二| 国产毛片一区二区| 亚洲欧洲精品一区二区精品久久久| 成人国产视频在线观看| 亚洲蜜臀av乱码久久精品蜜桃| 欧美午夜精品久久久久久超碰| 日本高清免费不卡视频| 亚洲综合丝袜美腿| 精品久久国产老人久久综合| 国产成人精品免费一区二区| 亚洲激情网站免费观看| 制服丝袜成人动漫| 国产成人在线观看| 一区二区三区国产精华| 日韩一区二区在线播放| 国产精品一卡二卡| 亚洲国产精品久久人人爱蜜臀 | 国产精品成人一区二区艾草| 91在线观看免费视频| 日产精品久久久久久久性色| 久久久久久久久久久久久女国产乱| 99精品视频在线播放观看| 偷拍与自拍一区| 国产日韩欧美高清在线| 日本久久一区二区三区| 国产在线一区二区| 又紧又大又爽精品一区二区| 精品福利视频一区二区三区| 91视频免费播放| 久久99精品国产| 一区二区久久久| 日本一区二区视频在线观看| 欧美高清视频在线高清观看mv色露露十八| 国产真实精品久久二三区| 亚洲国产成人va在线观看天堂| 国产视频一区二区三区在线观看| 欧美日韩在线电影| 97久久精品人人做人人爽| 捆绑紧缚一区二区三区视频| 一区二区三区欧美日韩| 久久精品日韩一区二区三区| 亚洲少妇最新在线视频| 26uuu精品一区二区| 欧美卡1卡2卡| 色狠狠av一区二区三区| 风间由美中文字幕在线看视频国产欧美| 亚洲成在人线在线播放| 国产精品日产欧美久久久久| 精品国产人成亚洲区| 欧美日本一道本| 色欧美88888久久久久久影院| 丁香婷婷综合色啪| 国产一区二区三区av电影| 免费成人在线影院| 五月天网站亚洲| 亚洲一区二区三区四区在线免费观看| 国产精品久久久久久久午夜片| 日韩欧美一区二区三区在线| 欧美日韩一卡二卡三卡| 色偷偷久久一区二区三区| www.成人在线| 波多野结衣欧美| 不卡一区二区在线| 北条麻妃一区二区三区| 国产高清不卡二三区| 国产精品996| 国产一区二区精品在线观看| 国产一区二区三区免费播放 | 国产精品综合av一区二区国产馆| 日韩av中文字幕一区二区| 五月婷婷色综合| 日本欧洲一区二区| 日本免费新一区视频| 日本成人在线看| 美女免费视频一区二区| 精品一区二区三区日韩| 国产精品一卡二| 高清视频一区二区| 91丝袜国产在线播放| 色婷婷精品久久二区二区蜜臂av| 色拍拍在线精品视频8848| 欧美午夜片在线看| 日韩欧美国产wwwww| 久久亚洲影视婷婷| 久久品道一品道久久精品| 国产视频在线观看一区二区三区| 国产精品网站一区| 亚洲精品国产精华液| 天天影视色香欲综合网老头| 九一久久久久久| 国产91丝袜在线播放0| hitomi一区二区三区精品| 色一情一伦一子一伦一区| 欧美性生交片4| 日韩一区二区三区电影在线观看| 精品国产伦一区二区三区观看体验| 久久久美女艺术照精彩视频福利播放| 日本一区二区视频在线| 亚洲精品成人天堂一二三| 日韩国产精品大片| 国产精品99久久久久久久女警 | 风间由美一区二区av101| 成人看片黄a免费看在线| 日本高清不卡在线观看| 日韩欧美在线123| 国产精品毛片大码女人| 亚洲一区中文日韩| 另类欧美日韩国产在线| 懂色中文一区二区在线播放| 欧美在线你懂的| 精品成人免费观看| 亚洲日本免费电影| 麻豆精品蜜桃视频网站| av在线综合网| 日韩一区二区三区视频在线| 国产精品久线在线观看| 美日韩一区二区| 色综合激情五月| 精品99一区二区| 亚洲成人自拍偷拍| 成人综合婷婷国产精品久久| 欧美丰满少妇xxxxx高潮对白| 国产精品色哟哟网站| 秋霞午夜av一区二区三区| 成人18视频在线播放| 制服丝袜亚洲网站| 一区二区三区四区不卡视频| 国产成人综合在线| 日韩三级av在线播放| 亚洲国产一区二区在线播放| 国产成人av影院| 日韩精品影音先锋| 亚洲高清三级视频| 91在线免费播放| 日本一区二区免费在线| 毛片一区二区三区| 欧美巨大另类极品videosbest | 毛片基地黄久久久久久天堂| 在线观看不卡视频| 国产精品久久久久影院色老大| 久久黄色级2电影| 欧美美女一区二区| 亚洲制服丝袜av| 91麻豆精东视频| 最新国产精品久久精品| 成人精品高清在线| 国产欧美一二三区| 极品瑜伽女神91| 日韩精品一区二区三区视频在线观看 | 综合久久给合久久狠狠狠97色 | 国内久久精品视频| 精品国产污污免费网站入口| 蜜桃一区二区三区在线| 7777女厕盗摄久久久| 亚洲午夜视频在线观看| 欧美午夜一区二区| 亚洲a一区二区| 欧美日韩一区精品| 亚洲va韩国va欧美va| 欧美精品在线观看一区二区| 亚洲国产欧美另类丝袜| 欧美日韩在线播放三区四区| 亚洲福利视频导航| 91精品国产综合久久精品| 亚洲电影在线免费观看| 欧美日本高清视频在线观看| 性做久久久久久| 在线播放一区二区三区| 美女视频一区在线观看| 日日摸夜夜添夜夜添国产精品| 欧美日韩精品系列| 日本在线不卡视频| 久久人人爽人人爽| 高清不卡一二三区| 亚洲美女精品一区| 欧美中文字幕一区二区三区 | 91极品美女在线| 亚洲国产毛片aaaaa无费看| 制服视频三区第一页精品| 麻豆一区二区三区| 久久九九影视网| 9l国产精品久久久久麻豆| 亚洲人亚洲人成电影网站色| 在线看国产一区| 久久99精品国产.久久久久| 日本一区二区三区四区| 99re6这里只有精品视频在线观看| 亚洲在线免费播放| 日韩欧美黄色影院| 99久久综合精品| 午夜精品视频在线观看| 26uuu久久天堂性欧美| 99久久精品国产网站| 午夜精品成人在线| 国产视频在线观看一区二区三区 | 99久久久久久| 五月开心婷婷久久|