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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? zl5011xinit.c

?? Zalink50114----TDMoIP芯片驅動源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
   par            Pointer to the structure for configuration items. See below:

 Structure inputs:
   enable         ZL5011X_TRUE to enable loopback

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:

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

zlStatusE zl5011xLanLoopbackConfig(zl5011xParamsS *zl5011xParams,
      zl5011xLanLoopbackConfigS *par)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T matchNum;
   zl5011xBooleanE gotDevice = ZL5011X_FALSE;

   /* do some parameter checking */
   status = ZL5011X_CHECK_POINTERS(zl5011xParams, par);

   if (status == ZL5011X_OK)
   {
      status = ZL5011X_CHECK_RUNNING(zl5011xParams);
   }

   if ((status == ZL5011X_OK) && (par->osExclusionEnable == ZL5011X_TRUE))
   {
      /* get access to the device */
      status = zl5011xGetDevice(zl5011xParams, ZL5011X_GET_DEVICE_TIMEOUT_MODE);

      if (status == ZL5011X_OK)
      {
         gotDevice = ZL5011X_TRUE;
      }
   }

   /* main function code starts */

   if(status == ZL5011X_OK)
   {
      ZL5011X_TRACE(ZL5011X_INIT_FN_ID,
            "zl5011xLanLoopbackConfig: enable %d",
            par->enable, 0, 0, 0, 0, 0);

      if (zl5011xParams->packetIf.unmatchedProtocolLoopback != ZL5011X_TRUE)
      {
         status = ZL5011X_PARAMETER_INVALID;
      }
   }

   if (status == ZL5011X_OK)
   {
      /* enable the classification entry for the last protocol match */
      matchNum = ZL5011X_PKC_NUM_CLASSIFY_ENTRIES - 1;

      if (par->enable == ZL5011X_TRUE)
      {
         status = zl5011xPkcClassifyEnableEntry(zl5011xParams, matchNum);
      }
      else
      {
         status = zl5011xPkcClassifyDisableEntry(zl5011xParams, matchNum);
      }
   }

   if (gotDevice == ZL5011X_TRUE)
   {
      if (status == ZL5011X_OK)
      {
         status = zl5011xReleaseDevice(zl5011xParams);
      }
      else
      {
         /* already have an error code, so don't overwrite it */
         (void)zl5011xReleaseDevice(zl5011xParams);
      }
   }

   return status;
}

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

 Function:
   zl5011xCheckAPICompatibility

 Description:
   Verifies that the requested device is supported by this release of the API

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance

 Structure inputs:
   deviceType     The device type requested

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:

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

static zlStatusE zl5011xCheckAPICompatibility(zlDeviceTypeE deviceType)
{
   zlStatusE status = ZL5011X_OK;

   switch (deviceType)
   {
      case ZL_DEVICE_ZL50110:
      case ZL_DEVICE_ZL50111:
      case ZL_DEVICE_ZL50114:
      case ZL_DEVICE_ZL50115:
      case ZL_DEVICE_ZL50116:
      case ZL_DEVICE_ZL50117:
      case ZL_DEVICE_ZL50118:
      case ZL_DEVICE_ZL50119:
      case ZL_DEVICE_ZL50120:
      case ZL_DEVICE_ZL80041:
      case ZL_DEVICE_ZL30300:
      case ZL_DEVICE_ZL30301:
      case ZL_DEVICE_ZL30302:
         /* Device is fully supported by this API */
         break;

      case ZL_DEVICE_ZL50130:
         /* Device not supported by this API */
         status = ZL5011X_API_AND_DEVICE_MISMATCH;
         break;

      default:
         /* Device unknown */
         status = ZL5011X_UNKNOWN_DEVICE_ID;
         break;
   }

   return status;
}

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

 Function:
   zl5011xMemoryCalcAddrGranulesMax

 Description:
   Verifies that the requested device is supported by this release of the API

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance

 Structure inputs:
   deviceType     The device type requested

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:

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

static zlStatusE zl5011xMemoryCalcAddrGranulesMax(zl5011xParamsS *zl5011xParams, zl5011xConfigureMemoryS *par,
      Uint32T *descBase, Uint32T *dataBase, Uint32T *heapStartAddress, Uint32T *heapEndAddress, Uint32T *numGranules)
{
   Uint32T freeIntMemory;
   Uint32T freeExtMemory;
   Uint32T temp, temp1, temp2;
   zl5011xBooleanE descInternal = ZL5011X_TRUE;
   zlStatusE status = ZL5011X_OK;

   *dataBase = 0;

   /* work out the best configuration for the memory */
   if (status == ZL5011X_OK)
   {
      freeIntMemory = ZL5011X_INT_MEMORY_SIZE_IN_BYTES;
      freeExtMemory = zl5011xParams->packetMemory.extMemSizeBytes;

      temp = par->maxWanQueueSizeInkBytes * 1024;

      /* reserve internal memory space for the Wan queues */
      if (temp <= freeIntMemory)
      {
         freeIntMemory -= temp;
         *heapStartAddress = ZL5011X_INT_MEM_BASE + ZL5011X_INT_MEMORY_SIZE_IN_BYTES - temp;
         *heapEndAddress = ZL5011X_INT_MEM_BASE + ZL5011X_INT_MEMORY_SIZE_IN_BYTES - 1;
      }
      else
      {
         status = ZL5011X_PARAMETER_INVALID;
      }
   }

   if (status == ZL5011X_OK)
   {
      /* calculate whether more granules could be used by putting the descriptors into
         external memory */
      temp1 = freeIntMemory / ZL5011X_GRANULE_DESCRIPTOR_SIZE;
      temp2 = freeExtMemory / (ZL5011X_GRANULE_DATA_SIZE + ZL5011X_GRANULE_DESCRIPTOR_SIZE);

      if (temp1 < temp2)
      {
         /* put the descriptors in external memory */
         descInternal = ZL5011X_FALSE;
      }
   }

   if (status == ZL5011X_OK)
   {
      if (((freeExtMemory > 0) && (descInternal == ZL5011X_FALSE)) || (freeExtMemory == 0))
      {
         /* descriptors and granules are in the same memory area */
         Uint32T memSize;

         if (freeExtMemory > 0)
         {
            memSize = freeExtMemory;

            /* set the base address for the granules and descriptors */
            *dataBase = 0;
            *descBase = 0;
         }
         else
         {
            memSize = freeIntMemory;

            /* set the base address for the granules and descriptors */
            *dataBase = ZL5011X_INT_MEM_BASE;
            *descBase = ZL5011X_INT_MEM_BASE;
         }

         temp = memSize / (ZL5011X_GRANULE_DATA_SIZE + ZL5011X_GRANULE_DESCRIPTOR_SIZE);

         *numGranules = temp;

         /* round down the number of granules to match the alignment boundary */
         temp1 = *numGranules * ZL5011X_GRANULE_DATA_SIZE;
         temp1 &= ~ZL5011X_MEMORY_GRANULARITY_MASK;

         /* add in the offset for the descriptors, which are placed after the granules */
         *descBase += temp1;

         /* recalculate the number of granules based on the rounded down memory size */
         *numGranules = temp1 / ZL5011X_GRANULE_DATA_SIZE;

         if (descInternal == ZL5011X_TRUE)
         {
            /* recalculate the heap start address - this allows for any wasted space
               to potentially be put to use */
            *heapStartAddress = *descBase + (*numGranules * ZL5011X_GRANULE_DESCRIPTOR_SIZE);
         }
      }
      else
      {
         /* descriptors and granules are in different memory areas */
         *dataBase = 0;
         *descBase = ZL5011X_INT_MEM_BASE;

         /* calculate how many granules and descriptors can be supported in the available memory */
         temp1 = freeIntMemory / ZL5011X_GRANULE_DESCRIPTOR_SIZE;
         temp2 = freeExtMemory / ZL5011X_GRANULE_DATA_SIZE;

         /* set the number of granules to the least of these calculations */
         if (temp1 > temp2)
         {
            *numGranules = temp2;
         }
         else
         {
            *numGranules = temp1;
         }
      }
   }

   return status;
}

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

 Function:
   zl5011xMemoryCalcAddrGranules

 Description:
   Verifies that the requested device is supported by this release of the API

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance

 Structure inputs:
   deviceType     The device type requested

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:

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

static zlStatusE zl5011xMemoryCalcAddrGranules(zl5011xParamsS *zl5011xParams, zl5011xConfigureMemoryS *par,
      Uint32T *descBase, Uint32T *dataBase, Uint32T *heapStartAddress, Uint32T *heapEndAddress)
{
   Uint32T freeIntMemory;
   Uint32T freeExtMemory;
   Uint32T temp;
   zl5011xBooleanE descInternal = ZL5011X_TRUE;
   zlStatusE status = ZL5011X_OK;

   /* work out the best configuration for the memory */
   if (status == ZL5011X_OK)
   {
      freeIntMemory = ZL5011X_INT_MEMORY_SIZE_IN_BYTES;
      freeExtMemory = zl5011xParams->packetMemory.extMemSizeBytes;

      /* check whether the granule descriptors can fit in the internal memory */
      if ((par->numberGranules * ZL5011X_GRANULE_DESCRIPTOR_SIZE) <= freeIntMemory)
      {
         descInternal = ZL5011X_TRUE;
         freeIntMemory -= par->numberGranules * ZL5011X_GRANULE_DESCRIPTOR_SIZE;
         *descBase = ZL5011X_INT_MEM_BASE;
      }
      else
      {
         if ((par->numberGranules * ZL5011X_GRANULE_DESCRIPTOR_SIZE) <= freeExtMemory)
         {
            descInternal = ZL5011X_FALSE;
            freeExtMemory -= par->numberGranules * ZL5011X_GRANULE_DESCRIPTOR_SIZE;
            descBase = ZL5011X_EXT_MEM_BASE;
         }
         else
         {
            status = ZL5011X_PARAMETER_INVALID;
         }
      }
   }

   if (status == ZL5011X_OK)
   {
      temp = par->maxWanQueueSizeInkBytes * 1024;

      /* check whether the Wan queues can fit in the internal memory */
      if (temp <= freeIntMemory)
      {
         freeIntMemory -= temp;
         *heapStartAddress = ZL5011X_INT_MEM_BASE + ZL5011X_INT_MEMORY_SIZE_IN_BYTES - temp;
         *heapEndAddress = ZL5011X_INT_MEM_BASE + ZL5011X_INT_MEMORY_SIZE_IN_BYTES - 1;
      }
      else
      {
         if (temp <= freeExtMemory)
         {
            freeExtMemory -= temp;
            *heapStartAddress = ZL5011X_EXT_MEM_BASE + zl5011xParams->packetMemory.extMemSizeBytes - temp;
            *heapEndAddress = ZL5011X_EXT_MEM_BASE + zl5011xParams->packetMemory.extMemSizeBytes - 1;
         }
         else
         {
            status = ZL5011X_PARAMETER_INVALID;
         }
      }
   }

   if (status == ZL5011X_OK)
   {
      temp = par->numberGranules * ZL5011X_GRANULE_DATA_SIZE;
      if ((temp & ZL5011X_MEMORY_GRANULARITY_MASK) != 0)
      {
         temp = (temp & ~ZL5011X_MEMORY_GRANULARITY_MASK) +
               ZL5011X_MEMORY_GRANULARITY_MASK + 1;
      }

      /* check whether the granules can fit in the internal memory */
      if (temp <= freeIntMemory)
      {
         freeIntMemory -= par->numberGranules * ZL5011X_GRANULE_DATA_SIZE;
         *dataBase = ZL5011X_INT_MEM_BASE;
         *descBase += temp;
      }
      else
      {
         if (((descInternal == ZL5011X_TRUE) && ((par->numberGranules * ZL5011X_GRANULE_DATA_SIZE) <= freeExtMemory)) ||
            ((descInternal == ZL5011X_FALSE) && (temp <= freeExtMemory)))
         {
            *dataBase = ZL5011X_EXT_MEM_BASE;
            freeExtMemory -= par->numberGranules * ZL5011X_GRANULE_DATA_SIZE;

            if (descInternal == ZL5011X_FALSE)
            {
               *descBase += temp;
            }
         }
         else
         {
            status = ZL5011X_PARAMETER_INVALID;
         }
      }
   }

   return status;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人aa大片| 日韩一区二区三区视频| 免费看精品久久片| 日韩美女视频一区二区 | 国产精品每日更新在线播放网址| 色婷婷综合久久久| 国产露脸91国语对白| 亚洲成人第一页| 中文字幕亚洲区| 久久久亚洲午夜电影| 欧美精品亚洲二区| 色综合激情五月| 国产在线精品一区二区| 亚洲超碰精品一区二区| 国产精品拍天天在线| 精品人伦一区二区色婷婷| 欧美日韩国产一级片| 99久久综合99久久综合网站| 丝袜美腿亚洲色图| 一区二区三区在线高清| 日本一区二区三区四区| 国产精品免费av| 精品国产91九色蝌蚪| 欧美日韩一区二区三区免费看| 99国内精品久久| 国产99精品在线观看| 国内精品视频一区二区三区八戒| 视频一区在线视频| 日韩电影免费在线观看网站| 亚洲成人av一区二区三区| 一区二区三区成人在线视频| 国产精品伦理一区二区| 国产精品视频第一区| 国产视频亚洲色图| 久久久噜噜噜久久中文字幕色伊伊| 欧美日韩精品三区| 欧美午夜精品一区| 欧美伊人久久久久久午夜久久久久| av电影一区二区| 成人免费毛片片v| 国产69精品久久久久777| 国产成人综合在线观看| 国产99久久久国产精品潘金网站| 国产一区二区在线免费观看| 国内久久婷婷综合| 国产黄色精品视频| 丁香婷婷综合五月| 色综合视频一区二区三区高清| av电影在线观看完整版一区二区| 99国产精品久| 欧美在线免费播放| 欧美另类久久久品| 精品国精品国产| 久久一区二区三区四区| 欧美国产欧美亚州国产日韩mv天天看完整| 国产婷婷一区二区| 欧美激情一区二区三区蜜桃视频 | 国产专区综合网| 日韩国产在线观看一区| 日韩成人精品在线| 国产美女av一区二区三区| 丁香亚洲综合激情啪啪综合| 欧美精品一区二区不卡| 日韩欧美久久一区| 中文成人av在线| 午夜精品久久久久久久久久久| 午夜精品福利视频网站| 麻豆精品蜜桃视频网站| 成人午夜免费av| 欧美日韩在线精品一区二区三区激情 | 成人免费看黄yyy456| 色婷婷久久99综合精品jk白丝| 精品视频在线免费观看| 久久人人超碰精品| 亚洲六月丁香色婷婷综合久久 | 欧美aaaaa成人免费观看视频| 国产一区二区三区免费观看| 91麻豆123| 日韩女优电影在线观看| 亚洲欧美精品午睡沙发| 天天亚洲美女在线视频| 国产成a人无v码亚洲福利| 欧美日韩五月天| 国产日韩三级在线| 视频一区欧美精品| eeuss影院一区二区三区| 制服丝袜国产精品| 国产精品福利一区| 婷婷综合在线观看| 99re成人精品视频| 日韩欧美美女一区二区三区| 亚洲精品ww久久久久久p站| 久久成人18免费观看| 在线看不卡av| 国产欧美日韩不卡免费| 蜜臀av一区二区| 91久久精品午夜一区二区| 久久久精品tv| 青青青爽久久午夜综合久久午夜| 色先锋资源久久综合| 国产亚洲污的网站| 青青草原综合久久大伊人精品| 91在线免费视频观看| 国产欧美日韩中文久久| 久久99国产精品尤物| 欧美日韩一级片在线观看| 亚洲人妖av一区二区| 国产精品亚洲一区二区三区在线| 欧美久久久久久久久| 一个色在线综合| 成人开心网精品视频| 久久你懂得1024| 蜜臀久久久久久久| 国产精品美女一区二区三区| 奇米影视在线99精品| 欧美性猛片aaaaaaa做受| 亚洲欧美日韩一区二区| 国产91在线观看| 欧美精品一区二区不卡| 美女视频一区在线观看| 欧美二区在线观看| 亚洲午夜日本在线观看| 色综合久久久久久久| 综合av第一页| 不卡的av电影在线观看| 国产偷国产偷亚洲高清人白洁| 蜜臀久久99精品久久久久宅男| 欧美日韩国产区一| 亚洲小说春色综合另类电影| 91福利视频在线| 亚洲综合色噜噜狠狠| 欧美性三三影院| 午夜精品久久久久久不卡8050| 色综合亚洲欧洲| 亚洲欧美日韩国产综合| 91丨九色porny丨蝌蚪| 亚洲少妇最新在线视频| 色综合av在线| 亚洲成人福利片| 欧美电影影音先锋| 视频在线观看一区二区三区| 欧美丰满美乳xxx高潮www| 免费成人在线观看| 欧美一级久久久久久久大片| 精品一区二区三区欧美| 国产调教视频一区| 99vv1com这只有精品| 亚洲黄色小说网站| 777精品伊人久久久久大香线蕉| 亚欧色一区w666天堂| 91精品国产手机| 韩国av一区二区三区在线观看| 欧美高清一级片在线观看| 成人动漫精品一区二区| 亚洲综合图片区| 3d成人动漫网站| 黄色日韩网站视频| 中文字幕一区在线| 欧美色图免费看| 久久精品国产精品亚洲精品| 26uuuu精品一区二区| av电影在线观看一区| 亚洲bdsm女犯bdsm网站| 91精品国产91久久久久久一区二区| 精品一区精品二区高清| 国产精品女上位| 欧美日韩国产色站一区二区三区| 经典三级在线一区| 亚洲欧美日韩小说| 日韩精品一区二区三区视频播放 | 亚洲午夜久久久久久久久电影院| 欧美高清视频在线高清观看mv色露露十八| 欧美一区二区网站| 国产精品小仙女| 欧美国产一区二区在线观看| 欧美午夜宅男影院| 国产美女在线精品| 亚洲精品午夜久久久| 精品国产人成亚洲区| 色偷偷久久人人79超碰人人澡| 日本最新不卡在线| 中文字幕日本乱码精品影院| 欧美酷刑日本凌虐凌虐| 国产黄色精品网站| 日韩电影在线一区二区三区| 国产精品无圣光一区二区| 91精品国产综合久久香蕉麻豆| 国产69精品久久久久777| 蜜桃视频一区二区| 亚洲免费观看高清在线观看| 久久综合色婷婷| 欧美色偷偷大香| 国产福利91精品| 日韩高清在线一区| 一区二区三区在线视频免费观看| 精品国产91洋老外米糕| 欧美天天综合网| 99视频一区二区| 国产精品一区二区在线观看网站 | 激情五月激情综合网|