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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? zl5011xgm.c

?? Zalink50114----TDMoIP芯片驅(qū)動(dòng)源碼
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*******************************************************************************
*
*  File name:              zl5011xGm.c
*
*  Version:                21
*
*  Author:                 MRC
*
*  Date created:           04/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 Granule Manager block. A granule is a block of memory that the device
*  uses to transfer data between the functional blocks. Each granule has a
*  corresponding descriptor, which is used to link granules into chains.
*
*  Revision History:
*
*  Rev:  Date:       Author:  Comments:
*  1     04/04/2002  MRC      Creation
*  2     04/04/2002  MRC      Last entry in the chain is initialised
*                             differently.
*  3     04/04/2002  MRC      Added comments
*  4     04/04/2002  MRC      Update
*  5     24/04/2002  MRC      Changed the granule chain to start at 1 not 0
*  6     24/04/2002  MRC      The granule chain cannot include granule 0,
*                             renumbering did not work.
*  7     26/04/2002  MRC      Changed some data names in response to comments
*                             from Thomas, regarding the MIB interface.
*  8     07/06/2002  MRC      Added granule check functions
*  9     10/06/2002  LCW      Added extra functions
*  10    13/06/2002  LCW      Fixed the interrupt functions
*  11    04/07/2002  PJE      modified headers to interrupt funcs as per reveiew
*  12    18/07/2002  MRC      Updated GM configure fn
*  13    22/07/2002  MRC      Updated following review
*  14    27/08/2002  MRC      Turned granule 0 into a loop!
*  15    28/08/2002  PJE      First clear the interrupts before enabling.
*  16    01/10/2002  DJA      File header modified
*  17    31/10/2002  MRC      Added variants + minor fixes
*  18    20/11/2002  MRC      Made the last granule in the chain unusable
*  19    21/05/2003  MRC      Changed granule chain initialisation to avoid
*                             RTP statistics memory
*  20    23/07/2004  MRC      Fixed some compiler warnings
*  21    08/06/2005  MRC      Amended memory area checks in GmConfigure
*
*******************************************************************************/

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

#include "zl5011x.h"
#include "zl5011xGm.h"
#include "zl5011xGmMap.h"
#include "zl5011xAdm.h"
#include "zl5011xAdmMap.h"
#include "zl5011xRtpMap.h"
#include "zl5011xUtilLib.h"

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

 Function:
    zl5011xGmInit

 Description:
    This function initialises the GM block and  data structure.

 Inputs:
    zl5011xParams      Pointer to the structure for this device instance

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    None

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

zlStatusE zl5011xGmInit(zl5011xParamsS *zl5011xParams)
{
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmInit:", 0, 0, 0, 0, 0, 0);

   zl5011xParams->packetMemory.granuleHeadIndex = (Uint32T)ZL5011X_NOT_INITIALISED;
   zl5011xParams->packetMemory.granuleTailIndex = (Uint32T)ZL5011X_NOT_INITIALISED;

   return(status);
}

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

 Function:
    zl5011xGmConfigure

 Description:
   This function configures the granule manager. The memory manager must
   already be initialised, since the base addresses for the granules and
   descriptors is used in this function.
   The number of granules is configured, and the granules initialised.
   The head granule is number 1.

 Inputs:
    zl5011xParams      Pointer to the structure for this device instance

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    The number of granules actually available will be numGranules - 2, to
    provide an empty granule at each end of the chain.

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

zlStatusE zl5011xGmConfigure(zl5011xParamsS *zl5011xParams, Uint32T numGranules)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T loop, statsAddress, headGranule, prevGranule[2], granuleCount;
   Uint32T endInternal, endExternal;
   zl5011xBooleanE descInternal, dataInternal;

   ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmConfigure: num granules %d",
         numGranules, 0, 0, 0, 0, 0);

   /* work out where the RTP stats are going to be in the memory map */
   statsAddress = ZL5011X_RTP_STATS_BASE;
   statsAddress &= (zl5011xParams->packetMemory.extMemSizeBytes - 1);

   /* use variables to hold the end address of the internal and external memory areas */
   endInternal = ZL5011X_INT_MEM_BASE + ZL5011X_INT_MEMORY_SIZE_IN_BYTES;
   endExternal = ZL5011X_EXT_MEM_BASE + zl5011xParams->packetMemory.extMemSizeBytes;

   /* determine whether the descriptors are in internal or external memory */
   if (zl5011xParams->packetMemory.granDescBaseAddr >= ZL5011X_INT_MEM_BASE)
   {
      descInternal = ZL5011X_TRUE;
   }
   else
   {
      descInternal = ZL5011X_FALSE;
   }

   /* determine whether the granules are in internal or external memory */
   if (zl5011xParams->packetMemory.granBaseAddr >= ZL5011X_INT_MEM_BASE)
   {
      dataInternal = ZL5011X_TRUE;
   }
   else
   {
      dataInternal = ZL5011X_FALSE;
   }

   /* determine whether the heap is in internal or external memory and then
      update the relevant end address */
   if (zl5011xParams->packetMemory.heapStartAddress >= ZL5011X_INT_MEM_BASE)
   {
      endInternal = zl5011xParams->packetMemory.heapStartAddress;
   }
   else
   {
      endExternal = zl5011xParams->packetMemory.heapStartAddress;
   }

   /* Option 1 : Granules INTERNAL, Descriptors INTERNAL */
   if ((dataInternal == ZL5011X_TRUE) && (descInternal == ZL5011X_TRUE))
   {
      /* Do the memory check, assuming that the granules will be at a
         lower address than the granule descriptors */
      if ((zl5011xParams->packetMemory.granDescBaseAddr +
         (numGranules * ZL5011X_GRANULE_DESCRIPTOR_SIZE)) > endInternal)
      {
         status = ZL5011X_PARAMETER_INVALID;
      }
      else
      {
         if ((zl5011xParams->packetMemory.granBaseAddr +
            (numGranules * ZL5011X_GRANULE_DATA_SIZE)) > zl5011xParams->packetMemory.granDescBaseAddr)
         {
            status = ZL5011X_PARAMETER_INVALID;
         }
      }
   }

   /* Option 2 : Granules EXTERNAL, Descriptors INTERNAL */
   if ((dataInternal == ZL5011X_FALSE) && (descInternal == ZL5011X_TRUE))
   {
      /* check that the memory sizes do not exceed the memory available */
      if ((zl5011xParams->packetMemory.granDescBaseAddr +
         (numGranules * ZL5011X_GRANULE_DESCRIPTOR_SIZE)) > endInternal)
      {
         status = ZL5011X_PARAMETER_INVALID;
      }
      else
      {
         if ((zl5011xParams->packetMemory.granBaseAddr +
            (numGranules * ZL5011X_GRANULE_DATA_SIZE)) > endExternal)
         {
            status = ZL5011X_PARAMETER_INVALID;
         }
      }
   }

   /* Option 3 : Granules EXTERNAL, Descriptors EXTERNAL */
   if ((dataInternal == ZL5011X_FALSE) && (descInternal == ZL5011X_FALSE))
   {
      /* Do the memory check, assuming that the granules will be at a
         lower address than the granule descriptors */
      if ((zl5011xParams->packetMemory.granDescBaseAddr +
         (numGranules * ZL5011X_GRANULE_DESCRIPTOR_SIZE)) > endExternal)
      {
         status = ZL5011X_PARAMETER_INVALID;
      }
      else
      {
         if ((zl5011xParams->packetMemory.granBaseAddr +
            (numGranules * ZL5011X_GRANULE_DATA_SIZE)) > zl5011xParams->packetMemory.granDescBaseAddr)
         {
            status = ZL5011X_PARAMETER_INVALID;
         }
      }
   }

   /* Option 4 : Granules INTERNAL, Descriptors EXTERNAL
                 bad choice, but included for completeness */
   if ((dataInternal == ZL5011X_TRUE) && (descInternal == ZL5011X_FALSE))
   {
      /* check that the memory sizes do not exceed the memory available */
      if ((zl5011xParams->packetMemory.granDescBaseAddr +
         (numGranules * ZL5011X_GRANULE_DESCRIPTOR_SIZE)) > endExternal)
      {
         status = ZL5011X_PARAMETER_INVALID;
      }
      else
      {
         if ((zl5011xParams->packetMemory.granBaseAddr +
            (numGranules * ZL5011X_GRANULE_DATA_SIZE)) > endInternal)
         {
            status = ZL5011X_PARAMETER_INVALID;
         }
      }
   }

   /* initialise the granule chain */
   granuleCount = 0;
   headGranule = (Uint32T)-1;
   prevGranule[0] = 1;

   /* granule 0 is not included in the granule chain, and is a special case,
      since the next granule is set to 0 i.e. a loop. */
   if (status == ZL5011X_OK)
   {
      status = zl5011xWrite(zl5011xParams,
         zl5011xParams->packetMemory.granDescBaseAddr,
         0);
   }

   for (loop = 1; loop < numGranules - 1; loop++)
   {
      /* if a failure has occured, or occurs during the initialisation
         then bomb out */
      if (status != ZL5011X_OK)
      {
         break;
      }

      if ((((zl5011xParams->packetMemory.granDescBaseAddr + (loop * ZL5011X_GRANULE_DESCRIPTOR_SIZE)) < statsAddress) ||
         ((zl5011xParams->packetMemory.granDescBaseAddr + (loop * ZL5011X_GRANULE_DESCRIPTOR_SIZE)) >= (statsAddress + ZL5011X_RTP_STATS_MEM_SIZE))) &&
         (((zl5011xParams->packetMemory.granBaseAddr + (loop * ZL5011X_GRANULE_DATA_SIZE)) < statsAddress) ||
         ((zl5011xParams->packetMemory.granBaseAddr + (loop * ZL5011X_GRANULE_DATA_SIZE)) >= (statsAddress + ZL5011X_RTP_STATS_MEM_SIZE))))
      {
         /* not in the region used for RTP statistics, so okay to define a
            granule and descriptor */
         if (headGranule == (Uint32T)-1)
         {
            /* if not already seen a valid granule then mark this as the
               head of the chain */
            headGranule = loop;
         }

         /* setup the granule descriptor for the previous granule, now that we
            know the next one on in the chain */
         status = zl5011xWrite(zl5011xParams,
               zl5011xParams->packetMemory.granDescBaseAddr + (prevGranule[0] * ZL5011X_GRANULE_DESCRIPTOR_SIZE),
               (loop & ZL5011X_GRANULE_NEXT_GRN_MASK) << ZL5011X_GRANULE_NEXT_GRN_BITS);

         prevGranule[1] = prevGranule[0];
         prevGranule[0] = loop;
         granuleCount++;
      }
   }

   if (status == ZL5011X_OK)
   {
      /* for the last granule descriptor in the chain, set the NEXT_GRN to 0 */
      status = zl5011xWrite(zl5011xParams,
            zl5011xParams->packetMemory.granDescBaseAddr + (prevGranule[0] * ZL5011X_GRANULE_DESCRIPTOR_SIZE),
            0);
   }

   /* set the head granule */
   if (status == ZL5011X_OK)
   {
      status = zl5011xGmSetHeadGranule(zl5011xParams, headGranule);
   }

   /* set the tail granule to be the 2nd granule from the end of the chain */
   if (status == ZL5011X_OK)
   {
      status = zl5011xGmSetTailGranule(zl5011xParams, prevGranule[1]);
   }

   /* set the number of free granules */
   if (status == ZL5011X_OK)
   {
      status = zl5011xGmSetNumFreeGranules(zl5011xParams, granuleCount - 1);
   }

   /* by default, set the threshold to the maximum number of granules */
   if (status == ZL5011X_OK)
   {
      status = zl5011xGmSetGranuleThreshold(zl5011xParams, granuleCount - 1);
   }

   return(status);
}

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

 Function:
    zl5011xGmSetHeadGranule

 Description:
    Sets the index number of the head granule.

 Inputs:
   zl5011xParams      Pointer to the structure for this device instance
   index             sets the index number of the head granule

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    None

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

zlStatusE zl5011xGmSetHeadGranule(zl5011xParamsS *zl5011xParams, Uint32T index)
{
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmSetHeadGranule: index %d",
         index, 0, 0, 0, 0, 0);

   if ((index & ~ZL5011X_GM_GRANULE_INDEX_MASK) != 0)
   {
      status = ZL5011X_PARAMETER_INVALID;
   }

   if (status == ZL5011X_OK)
   {
      status = zl5011xWrite(zl5011xParams, ZL5011X_GM_GRANULE_HEAD,
            index << ZL5011X_GM_GRANULE_HEAD_BITS);

      zl5011xParams->packetMemory.granuleHeadIndex = index;
   }

   return(status);
}

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

 Function:
   zl5011xGmGetHeadGranule

 Description:
   Gets the index number of the head granule.

 Inputs:
   zl5011xParams      Pointer to the structure for this device instance

 Outputs:
   index             gets the index number of the head granule

 Returns:
   zlStatusE

 Remarks:
   None

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

zlStatusE zl5011xGmGetHeadGranule(zl5011xParamsS *zl5011xParams, Uint32T *index)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T readValue;

   ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmGetHeadGranule:", 0, 0, 0, 0, 0, 0);

   status = zl5011xRead(zl5011xParams, ZL5011X_GM_GRANULE_HEAD,
         &readValue);

   if (status == ZL5011X_OK)
   {
      *index = (readValue >> ZL5011X_GM_GRANULE_HEAD_BITS) & ZL5011X_GM_GRANULE_INDEX_MASK;

      ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmGetHeadGranule: index %d", *index, 0, 0, 0, 0, 0);
   }

   return(status);
}

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

 Function:
    zl5011xGmSetTailGranule

 Description:
   Sets the index number of the tail granule. This function will be called during
   initialisation of the granule chain, so the granules will have been sequentially
   assigned. The tail granule is therefore the last granule.

 Inputs:
   zl5011xParams      Pointer to the structure for this device instance
   index             sets the index number of the tail granule

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    None

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

zlStatusE zl5011xGmSetTailGranule(zl5011xParamsS *zl5011xParams, Uint32T index)
{
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmSetTailGranule: index %d", index, 0, 0, 0, 0, 0);

   if ((index & ~ZL5011X_GM_GRANULE_INDEX_MASK) != 0)
   {
      status = ZL5011X_PARAMETER_INVALID;
   }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩—二三区免费观看av| 欧美日本一区二区| 国产麻豆视频精品| 激情文学综合插| 久久爱www久久做| 麻豆精品国产91久久久久久| 免费成人在线影院| 老司机午夜精品99久久| 美腿丝袜亚洲三区| 九九精品视频在线看| 国产一区欧美二区| 国产九色sp调教91| 国产成人精品www牛牛影视| 风流少妇一区二区| www.在线成人| 色94色欧美sute亚洲线路一久| 91日韩精品一区| 欧美中文字幕一二三区视频| 欧美日本韩国一区| 日韩欧美国产麻豆| 国产视频不卡一区| 成人欧美一区二区三区| 亚洲综合自拍偷拍| 青青草原综合久久大伊人精品优势 | 欧美日韩国产在线观看| 欧美精品欧美精品系列| 日韩欧美国产综合在线一区二区三区 | 在线精品视频小说1| 欧美日韩一区在线观看| 精品国产百合女同互慰| 国产欧美一区二区精品忘忧草| 自拍偷自拍亚洲精品播放| 尤物视频一区二区| 青娱乐精品视频| 成年人国产精品| 在线观看亚洲一区| 欧美草草影院在线视频| 国产精品入口麻豆九色| 亚洲一区在线视频观看| 看电视剧不卡顿的网站| 成人免费精品视频| 91精品国产一区二区人妖| 国产欧美视频在线观看| 亚洲一区二区三区小说| 毛片av一区二区| 国产99精品国产| 欧美性xxxxxxxx| 精品sm捆绑视频| 一区二区三区在线观看欧美| 久热成人在线视频| 欧洲国产伦久久久久久久| 精品精品国产高清一毛片一天堂| 亚洲欧洲www| 蜜臀99久久精品久久久久久软件| 成人av电影免费观看| 91精品国产综合久久久蜜臀图片| 国产日韩精品一区二区浪潮av| 亚洲一二三级电影| 国产91在线|亚洲| 欧美日韩aaa| 国产精品成人一区二区艾草 | 精品处破学生在线二十三| 亚洲三级在线看| 精品中文字幕一区二区小辣椒| 91黄色免费观看| 国产亚洲成aⅴ人片在线观看| 亚洲一区二三区| 成人在线视频一区| 日韩一区二区三区高清免费看看| 最近日韩中文字幕| 国产乱码精品1区2区3区| 欧美久久久影院| 亚洲视频免费看| 国产福利一区二区| 日韩午夜在线观看| 亚洲国产精品欧美一二99| av一区二区不卡| 国产偷国产偷亚洲高清人白洁| 日韩av中文字幕一区二区| 色综合久久久久网| 日本一区二区成人| 国产精品原创巨作av| 欧美一级片在线观看| 亚洲成av人片www| 91国内精品野花午夜精品| 国产精品美女久久久久av爽李琼| 国产最新精品精品你懂的| 日韩一区二区精品葵司在线| 午夜精品久久一牛影视| 欧美熟乱第一页| 一个色妞综合视频在线观看| 99精品偷自拍| 日本欧美大码aⅴ在线播放| 欧美网站大全在线观看| 一区二区三区四区在线播放| 91影院在线免费观看| 国产精品久久久久久久第一福利| 高清beeg欧美| 国产精品视频看| 成人的网站免费观看| 国产精品网站导航| 波多野结衣在线aⅴ中文字幕不卡 波多野结衣在线一区 | 欧亚洲嫩模精品一区三区| 亚洲欧美一区二区久久| www.一区二区| 椎名由奈av一区二区三区| av一二三不卡影片| 国产精品久久久久一区| hitomi一区二区三区精品| 国产精品入口麻豆九色| 99久久久无码国产精品| 日韩美女啊v在线免费观看| 色欲综合视频天天天| 亚洲欧美电影一区二区| 在线视频欧美区| 午夜欧美在线一二页| 91精品欧美福利在线观看| 日本系列欧美系列| 2021久久国产精品不只是精品| 国产美女娇喘av呻吟久久| 久久久精品国产99久久精品芒果| 国产成人亚洲综合a∨婷婷图片| 国产精品午夜春色av| 91原创在线视频| 亚洲成人动漫精品| 精品久久免费看| 成人黄色777网| 亚洲亚洲人成综合网络| 欧美一区二区视频在线观看| 精品一二三四在线| 中文字幕av一区 二区| 91在线免费视频观看| 亚洲成人精品在线观看| 91精品国产综合久久久久久久久久 | 国产精一区二区三区| 亚洲手机成人高清视频| 欧美日韩国产a| 国产精品一区二区三区四区| 亚洲精品中文在线影院| 在线播放中文一区| 国产精品一二一区| 亚洲国产欧美在线| 精品少妇一区二区三区在线播放| 国产91精品一区二区麻豆网站| 樱花影视一区二区| 精品日本一线二线三线不卡| 成人三级在线视频| 日日夜夜精品免费视频| 国产色一区二区| 欧美日韩精品三区| 国产成人8x视频一区二区| 亚洲一本大道在线| 国产日韩影视精品| 欧美精品久久一区| 盗摄精品av一区二区三区| 日韩黄色免费网站| 日韩美女视频一区| 欧美精品一区二区三区久久久| 97se亚洲国产综合自在线不卡| 青娱乐精品视频| 亚洲精品一二三四区| 精品日产卡一卡二卡麻豆| 在线观看一区不卡| 成熟亚洲日本毛茸茸凸凹| 日韩激情中文字幕| 亚洲免费色视频| 国产日韩精品一区二区浪潮av| 欧美精品99久久久**| 91丝袜美腿高跟国产极品老师| 久久精品国产亚洲高清剧情介绍| 成人免费在线观看入口| 久久夜色精品一区| 欧美二区在线观看| 91片黄在线观看| 成人综合婷婷国产精品久久蜜臀| 青青草成人在线观看| 亚洲影视在线播放| 日韩一区欧美小说| 国产午夜精品一区二区| 91精品福利在线一区二区三区 | 久久久久久久久免费| 欧美午夜精品久久久久久超碰| 成人免费黄色在线| 国产乱子轮精品视频| 美国欧美日韩国产在线播放| 亚洲bt欧美bt精品777| 亚洲欧美在线视频观看| 日本一区二区三级电影在线观看| 日韩欧美一级二级| 欧美男生操女生| 欧美日韩的一区二区| 欧美亚洲国产一卡| 91美女片黄在线观看| 不卡一区二区中文字幕| 国产伦理精品不卡| 国产精品一品视频| 国产精品资源在线观看| 国产在线麻豆精品观看| 久久99精品网久久| 国产最新精品精品你懂的|