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

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

?? zl5011xpla.c

?? Zalink50114----TDMoIP芯片驅(qū)動源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*******************************************************************************
*
*  File name:              zl5011xPla.c
*
*  Version:                32
*
*  Author:                 MRC
*
*  Date created:           09/04/2002
*
*  Copyright 2002, 2003, 2004, 2005, Zarlink Semiconductor Limited.
*  All rights reserved.
*
*  Module Description:
*
*  This file contains all the functions that will initialise and control
*  the PLA block.
*
*  Revision History:
*
*  Rev:  Date:       Author:  Comments:
*  1     27/02/2002  MRC      Creation
*  2     28/02/2002  MRC      Fixed and quick test
*  3     08/03/2002  MRC      Updating
*  4     26/03/2002  MRC      Teardown clears the update bit if set
*  5     09/04/2002  MRC      Clear the valid and first bits when assigning
*                             a new channel
*  6     17/04/2002  MRC      Changed the CHECK_.. macros to ZL5011X_CHECK_..
*  7     18/04/2002  MRC      The calculate MPID function used the flow
*                             rather than the context ID.
*  8     23/04/2002  MRC      Allow a context update from the INIT state.
*  9     07/05/2002  MRC      Check update and teardown now uses the status
*                             to indicate when the change completes.
*  10    08/05/2002  MRC      Set flow type and payload length used bits and
*                             mask to ReadModWrite in the wrong order.
*  11    09/05/2002  MRC      Updated header.
*  12    06/06/2002  PJE      added Enable & DisableInterrupt.
*                             Updated header & ZL5011X_TRACE.
*  13    13/06/2002  MRC      Minor changes
*  14    09/07/2002  MRC      TIF connection mode structure entry changed
*  15    12/07/2002  MRC      The MPID for set flow type is now a parameter
*                             rather than calculated.
*  16    12/07/2002  MRC      Fixed typo in set flow type fn
*  17    18/07/2002  PJE      Added interrupt structure
*  18    29/08/2002  PJE      First clear the interrupts before enabling.
*  19    30/09/2002  MRC      CheckChan didn't check the active buffer when
*                             deciding if the channel was free
*  20    03/10/2002  JFE      Fixed ZL5011X_TRACE's without : after function name.
*  21    21/10/2002  PJE      new PlaEnable/DisableTmiOverflowIntr
*  22    31/10/2002  MRC      Added variants + minor fixes
*  23    18/12/2002  MRC      Mended bit shifting in context memory issue.
*  24    03/04/2003  MRC      Changed interrupt enable to always clear the flags
*                             even if the mask cannot be changed due to update...
*  25    09/06/2003  MRC      Added zl5011xPlaReadModWrite fn
*  26    10/06/2003  MRC      Corrected zl5011xPlaReadModWrite fn
*  27    13/06/2003  PJE      zl5011xPlaGetError mod to overcome bus data problem
*  28    16/02/2004  APL      zl5011xPlaGetError now usable from interrupt context
*  29    23/07/2004  MRC      Fixed some compiler warnings
*  30    19/08/2004  MRC      Fixed comments
*  31    21/01/2005  MRC      Updated first channel function
*  32    14/02/2005  APL      Allow use of AUX_CLK stream to generate packets.
*
*******************************************************************************/

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

#include "zl5011x.h"
#include "zl5011xPla.h"
#include "zl5011xPlaMap.h"
#include "zl5011xUtilLib.h"

/*****************   EXPORTED GLOBAL VARIABLES    *****************************/

/*****************   STATIC GLOBAL VARIABLES      *****************************/

/*****************   STATIC FUNCTION DECLARATIONS *****************************/
   static zlStatusE zl5011xPlaReadModWrite(zl5011xParamsS *zl5011xParams, AddressT addr,
         Uint32T data, Uint32T mask);

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

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

 Function:
    zl5011xPlaInit

 Description:
    This function initialises the PLA data structure. The PLA should have already
    been reset. The operation of the device is represented by two device structures.
      current  - use for tracking modifications
      active   - the state of the device after the last update.

    By tracking both of these, the API has complete history of the PLA.

 Inputs:
    zl5011xParams      Pointer to the structure for this device instance

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    None

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

zlStatusE zl5011xPlaInit(zl5011xParamsS *zl5011xParams)
{
   Uint32T loop;
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE(ZL5011X_PLA_FN_ID, "zl5011xPlaInit:", 0, 0, 0, 0, 0, 0);

   /* reset the context structures */
   for (loop = 0; loop < ZL5011X_MAX_NUMBER_CONTEXTS; loop++)
   {
      /* reset the current context structure - used to track modifications */
      zl5011xParams->wanIf.plaCurrent.context[loop].state = ZL5011X_STATE_NOT_IN_USE;
      zl5011xParams->wanIf.plaCurrent.context[loop].firstChannelIndex = (Uint32T)ZL5011X_INVALID_CHANNEL;
      zl5011xParams->wanIf.plaCurrent.context[loop].numChannels = 0;

      /* reset the active context structure - used to track device operation */
      zl5011xParams->wanIf.plaActive.context[loop].state = ZL5011X_STATE_NOT_IN_USE;
      zl5011xParams->wanIf.plaActive.context[loop].firstChannelIndex = (Uint32T)ZL5011X_INVALID_CHANNEL;
      zl5011xParams->wanIf.plaActive.context[loop].numChannels = 0;
   }

   /* reset the channel mapping structures */
   for (loop = 0; loop < ZL5011X_MAX_NUMBER_CHANNELS; loop++)
   {
      /* reset the current channel structure - used to track modifications */
      zl5011xParams->wanIf.plaCurrent.channel[loop].context = (Uint32T)ZL5011X_INVALID_CONTEXT;

      /* reset the active channel structure - used to track device operation */
      zl5011xParams->wanIf.plaActive.channel[loop].context = (Uint32T)ZL5011X_INVALID_CONTEXT;
   }

   status = zl5011xWrite(zl5011xParams, ZL5011X_PLA_BLOCK_ID,
         ZL5011X_PLA_SOURCE_BLOCK_ID);

   return(status);
}

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

 Function:
    zl5011xPlaAddChan

 Description:
    Add a channel to the required context. Checks to see that the channel
    is not already in use. The first channel is not tracked when adding channels.
    The update of the first channel takes place when the context is updated.

    This function should only be called once in unstructured mode. With the one
    access made when the context is initialised.
    Checking for unstructured accesses is a function of the layer above.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   context     the context to associate the channel with
   tdm         stream and channel to add.

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    None

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

zlStatusE zl5011xPlaAddChan(zl5011xParamsS *zl5011xParams,
      Uint32T context, zl5011xWanChannelS tdm)
{
   Uint32T checkContext, chanIndex;
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE_CONTEXT(ZL5011X_PLA_FN_ID, context,
         "zl5011xPlaAddChan: ctxt %3d, str %2d, ch %3d",
         context, tdm.stream, tdm.channel, 0, 0, 0);

   status = zl5011xCheckTdm(zl5011xParams, tdm, &chanIndex);

   if (status == ZL5011X_OK)
   {
      status = zl5011xPlaCheckChan(zl5011xParams, &checkContext, chanIndex);
   }

   if (status == ZL5011X_OK)
   {
      if ((checkContext != (Uint32T)ZL5011X_INVALID_CONTEXT) && (checkContext != context))
      {
         status = ZL5011X_CHANNEL_IN_USE;
      }
   }

   if (status == ZL5011X_OK)
   {
      if (checkContext != context)
      {
         /* If in unstructured mode, then only one stream can be associated
            with a context */
         if (zl5011xParams->wanIf.wanConnectionMode == ZL5011X_WAN_CONNECTION_UNFRAMED)
         {
            /*  unstructured mode, so check that only one channel is attached */
            if (zl5011xParams->wanIf.plaCurrent.context[context].numChannels >= 1)
            {
               status = ZL5011X_CHANNEL_RANGE;
            }
         }

         if (status == ZL5011X_OK)
         {
            status = zl5011xPlaAssignChan(zl5011xParams, context, chanIndex);
         }
      }
   }

   return(status);
}

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

 Function:
    zl5011xPlaRemoveChan

 Description:
    Removes a channel from the required context, if is already associated with
    this context.The first channel is not tracked when adding channels.
    The update of the first channel takes place when the context is updated.

    This should not be called in unstructured mode, since only one stream is
    allowed. Checking for unstructured accesses is in the layer above.


 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   context     the context to remove the channel from
   tdm         stream and channel to remove.

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    None

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

zlStatusE zl5011xPlaRemoveChan(zl5011xParamsS *zl5011xParams,
      Uint32T context, zl5011xWanChannelS tdm)
{
   Uint32T checkContext, chanIndex;
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE_CONTEXT(ZL5011X_PLA_FN_ID, context,
         "zl5011xPlaRemoveChan: ctxt %3d, str %2d, ch %3d",
         context, tdm.stream, tdm.channel, 0, 0, 0);

   status = zl5011xCheckTdm(zl5011xParams, tdm, &chanIndex);

   if (status == ZL5011X_OK)
   {
      status = zl5011xPlaCheckChan(zl5011xParams, &checkContext, chanIndex);
   }

   if (status == ZL5011X_OK)
   {
      if ((checkContext != context))
      {
         status = ZL5011X_CHANNEL_NOT_IN_CTXT;
      }
      else
      {
         status = zl5011xPlaFreeChan(zl5011xParams, context, chanIndex);
      }
   }

   return(status);
}

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

 Function:
    zl5011xPlaAssignChan

 Description:
    Adds the channel to the required context. All checks for validity of
    the operation will have been performed outside of this function.
    This function accesses the device and maintains the current structures.

    The first channel bit is reset when adding a channel, and is not tracked.
    The update of the first channel takes place when the context is updated.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   context     the context to associate the channel with
   chanIndex   Index used to represent the channel in a linear array.

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    None

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

zlStatusE zl5011xPlaAssignChan(zl5011xParamsS *zl5011xParams,
      Uint32T context, Uint32T chanIndex)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T bits;

   ZL5011X_TRACE_CONTEXT(ZL5011X_PLA_FN_ID, context,
         "zl5011xPlaAssignChan: ctxt %3d, lkup %4X",
         context, chanIndex, 0, 0, 0, 0);

   zl5011xParams->wanIf.plaCurrent.context[context].numChannels++;

   bits = (ZL5011X_1BIT_MASK << ZL5011X_PLA_NEW_VALID_CHAN_BIT) |
         (context << ZL5011X_PLA_LKUP_CTXT_ID_BITS);

   zl5011xParams->wanIf.plaCurrent.channel[chanIndex].context = context;

   status = zl5011xWrite(zl5011xParams,
         ZL5011X_PLA_CONTEXT_LOOKUP + (chanIndex * ZL5011X_PLA_LKUP_MEM_SIZE),
         bits);

   return(status);
}

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

 Function:
    zl5011xPlaFreeChan

 Description:
   Removes the channel from the required context. Checks that a context has at
   least one channel, but all other checks for validity of the operation will
   have been performed outside of this function.
   This function accesses the device and maintains the current structures.

   The first channel and valid channel bits are cleared when removing a channel.
   The update of the first channel takes place when the context is updated.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   context     the context to remove the channel from
   chanIndex   Index used to represent the channel in a linear array.

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    None

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

zlStatusE zl5011xPlaFreeChan(zl5011xParamsS *zl5011xParams,
      Uint32T context, Uint32T chanIndex)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T bits;
   Uint32T bitMask;

   ZL5011X_TRACE_CONTEXT(ZL5011X_PLA_FN_ID, context,
         "zl5011xPlaFreeChan: ctxt %3d, lkup %4X",
         context, chanIndex, 0, 0, 0, 0);

   if (zl5011xParams->wanIf.plaCurrent.context[context].numChannels <= 1)
   {
      status = ZL5011X_LAST_CHANNEL_IN_CONTEXT;
   }

   if (status == ZL5011X_OK)
   {
      zl5011xParams->wanIf.plaCurrent.context[context].numChannels--;

      bits = 0;

      bitMask = (ZL5011X_1BIT_MASK << ZL5011X_PLA_NEW_FIRST_CHAN_BIT) |
            (ZL5011X_1BIT_MASK << ZL5011X_PLA_NEW_VALID_CHAN_BIT);

      zl5011xParams->wanIf.plaCurrent.channel[chanIndex].context = (Uint32T)ZL5011X_INVALID_CONTEXT;

      if (zl5011xParams->wanIf.plaCurrent.context[context].firstChannelIndex == chanIndex)
      {
         zl5011xParams->wanIf.plaCurrent.context[context].firstChannelIndex = (Uint32T)ZL5011X_INVALID_CHANNEL;
      }

      status = zl5011xPlaReadModWrite(zl5011xParams,
            ZL5011X_PLA_CONTEXT_LOOKUP + (chanIndex * ZL5011X_PLA_LKUP_MEM_SIZE),
            bits, bitMask);
   }

   return(status);
}

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

 Function:
    zl5011xPlaUpdateFirstChan

 Description:
   This called when the context is ready for update. In any add / remove
   channel operations that have taken place, the first channel was not tracked.
   The current structure is now scanned to find the first channel. If it is
   different from the first channel used in the active structure (operating
   mode of the device at the moment), then old channel is set to no longer
   be the first and the new first channel set up.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   context        context to update the first channel for.

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    None

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

zlStatusE zl5011xPlaUpdateFirstChan(zl5011xParamsS *zl5011xParams,
      Uint32T context)
{
   zlStatusE status = ZL5011X_OK;
   zl5011xBooleanE foundFirst = ZL5011X_FALSE;
   zl5011xWanChannelS tdm;
   Uint32T chanIndex, loop, activeChannels;

   ZL5011X_TRACE_CONTEXT(ZL5011X_PLA_FN_ID, context,
         "zl5011xPlaUpdateFirstChan: context %3d",
         context, 0, 0, 0, 0, 0);

   /* the loops are arranged to represent the order in which the device does
      the search for the first channel -
      i.e.  channel 0 stream 0
            channel 0 stream 1
            channel 0 stream 2 etc. */

   for (tdm.channel = 0; ((tdm.channel < zl5011xParams->wanIf.wanNumChannels ) &&
         (foundFirst == ZL5011X_FALSE)); tdm.channel++)
   {
      /* Iterate around all possible streams. This allows non-contiguous stream numbers to be used */
      for (tdm.stream = 0; ((tdm.stream < ZL5011X_MAX_NUMBER_STREAMS) &&

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀av一区二区| 国产原创一区二区三区| 久久久综合精品| 色婷婷国产精品| 国产乱人伦精品一区二区在线观看| 成人欧美一区二区三区黑人麻豆 | 国产九色sp调教91| 一区二区三区四区不卡在线| 久久综合久久鬼色中文字| 欧美体内she精高潮| 成人av中文字幕| 麻豆成人综合网| 亚洲国产日韩精品| 中文字幕在线视频一区| 久久综合九色综合97婷婷女人| 欧美日韩在线观看一区二区| 北条麻妃国产九九精品视频| 韩国成人福利片在线播放| 水野朝阳av一区二区三区| 亚洲激情中文1区| 国产精品色哟哟网站| 精品久久99ma| 日韩欧美一区二区视频| 7777精品伊人久久久大香线蕉最新版| 色综合久久六月婷婷中文字幕| 国产成人免费在线观看不卡| 老司机免费视频一区二区三区| 婷婷丁香激情综合| 亚洲国产婷婷综合在线精品| 一区二区视频免费在线观看| 日韩美女精品在线| 国产精品免费观看视频| 久久精品视频一区| 久久久久久黄色| 久久综合九色综合97婷婷| 精品国产3级a| 精品国免费一区二区三区| 日韩美女视频在线| www激情久久| 久久久亚洲精品石原莉奈 | 欧美一级欧美三级在线观看| 欧美日本国产一区| 3751色影院一区二区三区| 欧美另类高清zo欧美| 欧美另类高清zo欧美| 91精品在线免费观看| 日韩一区二区三区四区| 日韩欧美在线不卡| 久久亚洲精品国产精品紫薇| 国产午夜精品美女毛片视频| 国产人伦精品一区二区| 国产精品久久久久久久久久久免费看 | 狠狠色丁香久久婷婷综合_中| 日本不卡免费在线视频| 久久av中文字幕片| 国产福利91精品| 99久久国产综合精品色伊| 日本韩国欧美在线| 欧美精品色一区二区三区| 91精品国产91综合久久蜜臀| 欧美v日韩v国产v| 国产午夜亚洲精品不卡| 国产精品系列在线| 亚洲一区二区美女| 九色|91porny| av成人老司机| 7777精品伊人久久久大香线蕉完整版 | 91视频你懂的| 欧美精品一级二级| 久久精品视频一区二区| 一区二区三区美女| 蜜臀av国产精品久久久久| 国产69精品久久久久777| 色激情天天射综合网| 欧美一区二区三区免费视频| 国产清纯白嫩初高生在线观看91| 亚洲三级理论片| 免费观看91视频大全| 99热精品一区二区| 欧美一级一区二区| 亚洲精品视频免费看| 毛片av中文字幕一区二区| 丁香桃色午夜亚洲一区二区三区| 欧美亚洲丝袜传媒另类| 久久影视一区二区| 亚洲综合图片区| 国产河南妇女毛片精品久久久| 欧洲亚洲国产日韩| 久久精品夜夜夜夜久久| 午夜日韩在线电影| 成人av电影在线观看| 欧美一区二区女人| 成人免费视频在线观看| 久久精品噜噜噜成人88aⅴ| 99久久免费视频.com| 日韩精品一区二区三区视频 | 国产欧美1区2区3区| 亚洲综合男人的天堂| 国产精品99精品久久免费| 欧美四级电影网| 中文字幕一区二区三区在线播放| 老汉av免费一区二区三区 | 精品理论电影在线| 一区二区三区四区中文字幕| 粉嫩av一区二区三区| 日韩一级黄色大片| 亚洲国产美女搞黄色| 99天天综合性| 国产日韩视频一区二区三区| 奇米精品一区二区三区在线观看一| 91首页免费视频| 国产精品视频你懂的| 国模冰冰炮一区二区| 91精品国产综合久久国产大片 | 亚洲午夜久久久久久久久久久| 国产99精品视频| 精品电影一区二区三区| 日本美女一区二区三区视频| 欧美日韩精品一区二区三区蜜桃| 亚洲欧美日韩中文字幕一区二区三区 | 亚洲视频狠狠干| 成人免费视频免费观看| 久久久亚洲午夜电影| 精品一区二区三区在线观看国产 | 五月天国产精品| 91久久免费观看| 亚洲精品国久久99热| 波多野结衣中文字幕一区二区三区| 久久综合久久久久88| 极品尤物av久久免费看| 欧美成人免费网站| 久久国产福利国产秒拍| 欧美va亚洲va在线观看蝴蝶网| 强制捆绑调教一区二区| 欧美一区二区三区免费观看视频| 天天综合日日夜夜精品| 在线电影一区二区三区| 男男视频亚洲欧美| 欧美成人精品3d动漫h| 黄色小说综合网站| 国产午夜精品久久| 成人美女在线视频| 亚洲三级久久久| 欧美日韩国产小视频在线观看| 亚洲va天堂va国产va久| 制服.丝袜.亚洲.中文.综合| 免费看日韩a级影片| 欧美成人国产一区二区| 国产美女精品人人做人人爽| 中文字幕欧美区| 91麻豆福利精品推荐| 亚洲一区二区欧美激情| 日韩午夜激情av| 国产风韵犹存在线视精品| 1区2区3区国产精品| 欧美丝袜丝交足nylons| 美女性感视频久久| 国产三级一区二区| 91小视频在线免费看| 日韩国产欧美一区二区三区| 26uuu国产在线精品一区二区| 成人av网站在线观看免费| 亚洲欧美电影一区二区| 91精品国产91久久久久久一区二区| 精品综合久久久久久8888| 欧美激情一二三区| 欧美少妇一区二区| 国产综合久久久久影院| 亚洲视频 欧洲视频| 91精品国产色综合久久ai换脸| 国产美女精品人人做人人爽| 亚洲靠逼com| 欧美一区二区在线播放| 国产成人一区二区精品非洲| 亚洲一区二区视频在线观看| 日韩精品一区二区三区蜜臀| eeuss鲁片一区二区三区| 亚洲福利一二三区| 国产免费成人在线视频| 欧美午夜寂寞影院| 国产精品一区二区你懂的| 亚洲日本青草视频在线怡红院| 7777精品伊人久久久大香线蕉 | 国产精品一卡二| 曰韩精品一区二区| 精品国产一二三区| 欧美性猛片aaaaaaa做受| 国产成人精品免费| 日韩电影在线一区| 亚洲男人天堂av| 国产天堂亚洲国产碰碰| 91精品国产综合久久国产大片 | 色系网站成人免费| 韩国精品主播一区二区在线观看| 亚洲女同ⅹxx女同tv| 国产亚洲精品超碰| 91精品国产综合久久久蜜臀粉嫩| av不卡一区二区三区| 国产精品一区在线| 毛片av中文字幕一区二区|