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

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

?? zl5011xinit.c

?? Zalink50114----TDMoIP芯片驅動源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
      zl5011xRun

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   par            Pointer to the structure for configuration items. See below:

 Structure inputs:
   osExclusionEnable ZL5011X_TRUE to enable OS exclusion

 Structure outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None

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

zlStatusE zl5011xRun(zl5011xParamsS *zl5011xParams, zl5011xRunS *par)
{
   zlStatusE status = ZL5011X_OK;
   zl5011xBooleanE gotDevice = ZL5011X_FALSE;

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

   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, "zl5011xRun: ", 0, 0, 0, 0, 0, 0);

      if (zl5011xParams->running == ZL5011X_TRUE)
      {
         status = ZL5011X_MULTIPLE_INIT_ATTEMPT;
      }
   }

   /* check that all of the necessary initialisations have taken place */
   if (status == ZL5011X_OK)
   {
      if (zl5011xParams->initialised == ZL5011X_FALSE)
      {
         status = ZL5011X_NOT_INIT;
      }
   }

   if (status == ZL5011X_OK)
   {
      if (zl5011xParams->memoryInitialised == ZL5011X_FALSE)
      {
         status = ZL5011X_MEMORY_NOT_INIT;
      }
   }

   if (status == ZL5011X_OK)
   {
      if (zl5011xParams->wanInitialised == ZL5011X_FALSE)
      {
         status = ZL5011X_WAN_NOT_INIT;
      }
   }

   if (status == ZL5011X_OK)
   {
      if (zl5011xParams->lanInitialised == ZL5011X_FALSE)
      {
         status = ZL5011X_LAN_NOT_INIT;
      }
   }

   if (status == ZL5011X_OK)
   {
      /* All blocks have been initialised. Clear the Init Done interrupt bit */
      status = zl5011xAdmClearInterruptSource(zl5011xParams, 1 << ZL5011X_ADM_INIT_DONE_INTERRUPT);
   }

   /* at this point, only the GM block has been run. It is now time to enable the
      rest of the blocks except the TIF, which cannot be enabled until the Wan
      configuration has completed (WanConfigureSync or WanConfigureAsync) */
   if (status == ZL5011X_OK)
   {
      status = zl5011xAdmEnableBlocks(zl5011xParams, ZL5011X_ADM_TFM_BIT |
            ZL5011X_ADM_TFQ_BIT | ZL5011X_ADM_PLA_BIT | ZL5011X_ADM_PAC_BIT |
            ZL5011X_ADM_PKI_BIT | ZL5011X_ADM_PKQ_BIT | ZL5011X_ADM_TM_BIT | ZL5011X_ADM_PRX_BIT |
            ZL5011X_ADM_PKC_BIT | ZL5011X_ADM_RTP_BIT);
   }

   if (status == ZL5011X_OK)
   {
      zl5011xParams->running = ZL5011X_TRUE;
   }

   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;
}

/*****************   STATIC FUNCTION DEFINTIONS   *****************************/

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

 Function:
    zl5011xInitBlocks

 Description:
    This function sets the required blocks into initialise, and waits for
    completion. The completion is polled, to give a quicker response time if the
    initialisation is fast.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   mask           bit set in mask to initialise a block.

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    None

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

static zlStatusE zl5011xInitBlocks(zl5011xParamsS *zl5011xParams, Uint32T mask)
{
   Uint32T loop, readValue;
   zlStatusE status = ZL5011X_OK;

   /* set the init bits for the required blocks */
   if (status == ZL5011X_OK)
   {
      status = zl5011xAdmSetInitStatus(zl5011xParams, mask);
   }

   /* use a retry approach, to check whether the blocks have completed
      initialisation, to try and speed up the process */
   for (loop = 0; loop < ZL5011X_BLOCK_INIT_RETRY; loop++)
   {
      if (status != ZL5011X_OK)
         break;

      /* wait for the init to occur */
      OS_TASK_DELAY(ZL5011X_BLOCK_INIT_TIMEOUT_MS);

      status = zl5011xAdmGetInitStatus(zl5011xParams, &readValue);

      if (status == ZL5011X_OK)
      {
         /* if the bits have been reset to 0, then the init has finished */
         if ((readValue & mask) == 0)
            break;
      }
   }

   if (status == ZL5011X_OK)
   {
      /* if the bits have been reset to 0, then the init has finished */
      if (loop == ZL5011X_BLOCK_INIT_RETRY)
      {
         status = ZL5011X_TIMEOUT;
      }
   }

   return status;
}

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

 Function:
    zl5011xPreparePrxGranules

 Description:
   Prepare a granule for each of the GBit Lan ports, for sending, to force
   initialisation.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance

 Outputs:
   grn1           Number of 1st granule to use for PRX init
   grn2           Number of 2nd granule to use for PRX init

 Returns:
   zlStatusE

 Remarks:
    None

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

static zlStatusE zl5011xPreparePrxGranules(zl5011xParamsS *zl5011xParams, Uint32T *grn1, Uint32T *grn2)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T currPtr, address, readValue;
   Uint32T loop;

   currPtr = zl5011xParams->packetMemory.granuleHeadIndex;

   /* find granules near the end of the chain */
   for (loop = 0; loop < zl5011xParams->packetMemory.granuleCount - 3; loop++)
   {
      address = zl5011xParams->packetMemory.granDescBaseAddr +
            (currPtr * ZL5011X_GRANULE_DESCRIPTOR_SIZE);

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

      currPtr = readValue & 0x3ffff;
   }

   if (status == ZL5011X_OK)
   {
      address = zl5011xParams->packetMemory.granDescBaseAddr +
            (currPtr * ZL5011X_GRANULE_DESCRIPTOR_SIZE);

      *grn1 = currPtr;

      /* initialise the granule descriptor for port 0 */
      (void)zl5011xWrite(zl5011xParams, address +  4, (1 << 24) | (128));
      (void)zl5011xWrite(zl5011xParams, address +  8, (64 <<16) | (3 << 6) | 1);
      (void)zl5011xWrite(zl5011xParams, address + 12, 0);

      address = zl5011xParams->packetMemory.granBaseAddr +
            (currPtr * ZL5011X_GRANULE_DATA_SIZE);

      /* initialise the granule data */
      for (loop = 0; loop < ZL5011X_GRANULE_DATA_SIZE; loop = loop + 4)
      {
         (void)zl5011xWrite(zl5011xParams, address + loop, 0);
      }

      status = zl5011xRead(zl5011xParams, zl5011xParams->packetMemory.granDescBaseAddr +
            (currPtr * ZL5011X_GRANULE_DESCRIPTOR_SIZE), &readValue);

      currPtr = readValue & 0x3ffff;
   }


   if (status == ZL5011X_OK)
   {
      address = zl5011xParams->packetMemory.granDescBaseAddr +
            (currPtr * ZL5011X_GRANULE_DESCRIPTOR_SIZE);

      /* initialise the granule descriptor for port 1 */
      (void)zl5011xWrite(zl5011xParams, address +  4, (1 << 24) | (132));
      (void)zl5011xWrite(zl5011xParams, address +  8, (64 <<16) | (3 << 6) | 1);
      (void)zl5011xWrite(zl5011xParams, address + 12, 0);

      address = zl5011xParams->packetMemory.granBaseAddr +
            (currPtr * ZL5011X_GRANULE_DATA_SIZE);

      *grn2 = currPtr;

      /* initialise the granule data */
      for (loop = 0; loop < ZL5011X_GRANULE_DATA_SIZE; loop = loop + 4)
      {
         (void)zl5011xWrite(zl5011xParams, address + loop, 0);
      }
   }

   return status;
}

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

 Function:
    zl5011xSendPrxPackets

 Description:
   Prepare a granule for each of the GBit Lan ports, for sending, to force
   initialisation.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   grn1           Number of 1st granule to use for PRX init
   grn2           Number of 2nd granule to use for PRX init

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    None

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

static zlStatusE zl5011xSendPrxPackets(zl5011xParamsS *zl5011xParams, Uint32T grn1, Uint32T grn2)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T readValue;

   /* Setup internal loopback for PKI port 0 */
   (void)zl5011xPkiSetPacketFiltering(zl5011xParams, 0, ZL5011X_FALSE, ZL5011X_FALSE, ZL5011X_FALSE);
   (void)zl5011xPkiSetInterfaceType(zl5011xParams, 0, ZL5011X_MAC_TYPE_GMII);
   (void)zl5011xPkiEnablePort(zl5011xParams, 0, ZL5011X_TRUE);

   (void)zl5011xRead(zl5011xParams, ZL5011X_PKI_BASE, &readValue);
   readValue |= 0x00000200;
   (void)zl5011xWrite(zl5011xParams, ZL5011X_PKI_BASE, readValue);

   /* Setup internal loopback for PKI port 1 */
   (void)zl5011xPkiSetPacketFiltering(zl5011xParams, 1, ZL5011X_FALSE, ZL5011X_FALSE, ZL5011X_FALSE);
   (void)zl5011xPkiSetInterfaceType(zl5011xParams, 1, ZL5011X_MAC_TYPE_GMII);
   (void)zl5011xPkiEnablePort(zl5011xParams, 1, ZL5011X_TRUE);

   (void)zl5011xRead(zl5011xParams, ZL5011X_PKI_BASE + 4, &readValue);
   readValue |= 0x00000200;
   (void)zl5011xWrite(zl5011xParams, ZL5011X_PKI_BASE + 4, readValue);

   /* construct TM message */
   (void)zl5011xWrite(zl5011xParams, ZL5011X_CPU_BASE + 0x14, (ZL5011X_FLOW_CPU_PKT << 27) | (64 << 16) | (128));
   (void)zl5011xWrite(zl5011xParams, ZL5011X_CPU_BASE + 0x18, grn1);
   (void)zl5011xWrite(zl5011xParams, ZL5011X_CPU_BASE + 0x1c, (1 << 18) | grn1);
   (void)zl5011xWrite(zl5011xParams, ZL5011X_CPU_BASE + 0x20, 0);

   (void)zl5011xWrite(zl5011xParams, ZL5011X_CPU_BASE + 0x24, 1);

   OS_TASK_DELAY(20);

   /* construct TM message */
   (void)zl5011xWrite(zl5011xParams, ZL5011X_CPU_BASE + 0x14, (ZL5011X_FLOW_CPU_PKT << 27) | (64 << 16) | (132));
   (void)zl5011xWrite(zl5011xParams, ZL5011X_CPU_BASE + 0x18, grn2);
   (void)zl5011xWrite(zl5011xParams, ZL5011X_CPU_BASE + 0x1c, (1 << 18) | grn2);
   (void)zl5011xWrite(zl5011xParams, ZL5011X_CPU_BASE + 0x20, 0);

   (void)zl5011xWrite(zl5011xParams, ZL5011X_CPU_BASE + 0x24, 1);

   OS_TASK_DELAY(100);

   return status;
}

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

 Function:
   zl5011xLanLoopbackConfigStructInit

 Description:
   Initialises structure used by zl5011xLanLoopbackConfig function.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   par            Pointer to the structure for configuration items.
                  See main function

 Returns:
  zlStatusE

 Remarks:
   None

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

zlStatusE zl5011xLanLoopbackConfigStructInit(zl5011xParamsS *zl5011xParams,
      zl5011xLanLoopbackConfigS *par)
{
   zlStatusE status = ZL5011X_OK;

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

   if(status == ZL5011X_OK)
   {
      ZL5011X_TRACE(ZL5011X_INIT_FN_ID,
            "zl5011xLanLoopbackConfigStructInit:",
            0, 0, 0, 0, 0, 0);

      par->enable = ZL5011X_TRUE;
      par->osExclusionEnable = ZL5011X_TRUE;
   }

   return status;
}

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

 Function:
   zl5011xLanLoopbackConfig

 Description:
   If Lan loopback was setup during initialisation, then the actual loopback
   can be enabled / disabled using this function.
   Note that the loopback is disabled following initialisation.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美视频中文字幕| 日韩三级电影网址| 日韩成人av影视| 国产精品免费观看视频| 欧美电影在线免费观看| www.亚洲在线| 国产一区二区女| 日本不卡在线视频| 一区二区三区四区精品在线视频| 精品毛片乱码1区2区3区| 欧美自拍偷拍午夜视频| 高清不卡在线观看av| 免费在线观看精品| 亚洲国产综合色| 亚洲蜜臀av乱码久久精品| 国产欧美日韩三区| 欧美变态tickling挠脚心| 欧美日韩的一区二区| 91影视在线播放| eeuss鲁一区二区三区| 国产综合色视频| 美女网站在线免费欧美精品| 亚洲成a人片综合在线| 中文字幕一区不卡| 日本一区二区三区国色天香 | 亚洲午夜精品网| 国产精品福利影院| 欧美激情在线一区二区三区| 26uuu亚洲综合色欧美| 91精品啪在线观看国产60岁| 欧美三级视频在线播放| 91福利视频在线| 91久久香蕉国产日韩欧美9色| av一区二区三区四区| 国产精品一区二区免费不卡 | 色婷婷激情久久| 成人av网站在线观看| 成人精品国产免费网站| 成人手机在线视频| 99国产精品国产精品毛片| 成人免费视频app| 99久久精品国产一区二区三区| 丰满少妇在线播放bd日韩电影| 国产成人午夜99999| 成人污污视频在线观看| 高清在线观看日韩| 99精品久久99久久久久| 成人网在线播放| 91视频.com| 欧美日韩久久一区二区| 日韩欧美色综合| 精品日韩在线观看| 国产三级久久久| 国产精品国产三级国产普通话99 | 日韩极品在线观看| 免费的国产精品| 国产电影精品久久禁18| 粉嫩绯色av一区二区在线观看 | 国内精品写真在线观看| 风流少妇一区二区| 色婷婷精品大视频在线蜜桃视频| 欧美性大战久久久久久久蜜臀| 欧美军同video69gay| 日韩欧美视频一区| 国产精品国产自产拍高清av| 一区二区三区四区激情| 蜜臀av亚洲一区中文字幕| 国产成人三级在线观看| 91福利在线观看| 亚洲精品一区二区三区四区高清| 国产欧美一区二区三区鸳鸯浴| 亚洲卡通欧美制服中文| 日本中文一区二区三区| 成人午夜又粗又硬又大| 欧美高清视频一二三区| 久久精品视频免费| 亚洲高清视频在线| 国产成人综合在线| 欧美午夜一区二区三区| 久久久777精品电影网影网| 亚洲免费观看在线视频| 久久99久久精品欧美| 色综合一区二区三区| 欧美电影免费观看高清完整版在线 | 在线观看日韩电影| 欧美mv和日韩mv的网站| 亚洲精品日韩一| 六月丁香婷婷久久| 色综合天天综合在线视频| 日韩欧美激情四射| 一区二区三区精密机械公司| 国产揄拍国内精品对白| 欧美日韩亚洲丝袜制服| 国产精品久久影院| 麻豆成人在线观看| 日本道精品一区二区三区| 久久精品在线观看| 美女视频黄a大片欧美| 日本国产一区二区| 国产精品视频九色porn| 理论片日本一区| 在线这里只有精品| 中文字幕一区二区三区四区| 国产一区二区主播在线| 欧美一区二区三区在线观看视频 | 久久久精品tv| 琪琪久久久久日韩精品| 在线观看日韩精品| 自拍偷拍国产精品| 国产真实乱偷精品视频免| 91精品一区二区三区在线观看| 尤物在线观看一区| 波波电影院一区二区三区| 国产喷白浆一区二区三区| 开心九九激情九九欧美日韩精美视频电影| 色综合天天综合网国产成人综合天| 国产欧美日韩精品一区| 麻豆传媒一区二区三区| 欧美一级日韩一级| 午夜精品一区二区三区电影天堂 | 亚洲在线一区二区三区| 99综合影院在线| 日本一区二区综合亚洲| 国产在线视视频有精品| 久久综合九色综合97婷婷 | 另类中文字幕网| 日韩一区二区三免费高清| 午夜激情一区二区三区| 欧美性猛交xxxxxx富婆| 亚洲一二三区视频在线观看| 91免费观看视频| 亚洲欧美另类久久久精品 | 欧美伦理电影网| 日韩精品午夜视频| 4438x亚洲最大成人网| 日本午夜精品视频在线观看| 91精品福利在线一区二区三区 | 成人国产一区二区三区精品| 久久久久一区二区三区四区| 国产一区二区伦理| 国产精品日韩成人| 99天天综合性| 亚洲高清不卡在线| 717成人午夜免费福利电影| 亚洲18色成人| 日韩欧美一区二区久久婷婷| 久久电影国产免费久久电影| 久久久久久黄色| www.亚洲色图| 亚洲电影第三页| 欧美一级夜夜爽| 国产精品系列在线播放| 国产精品美女久久久久久久 | 国产成人av电影免费在线观看| 国产精品无人区| 91福利在线观看| 日本女优在线视频一区二区| 精品99一区二区三区| 国产大片一区二区| 亚洲免费在线视频| 欧美精品v国产精品v日韩精品 | 国产精品自拍网站| 国产精品久久久久三级| 91成人网在线| 精品中文字幕一区二区| 国产精品家庭影院| 在线电影院国产精品| 激情欧美日韩一区二区| 1000精品久久久久久久久| 欧美色电影在线| 国产一区二区三区免费播放| 国产精品久久久久国产精品日日| 欧美无砖砖区免费| 国产乱妇无码大片在线观看| 亚洲欧美另类小说视频| 日韩精品一区二区三区四区视频| 成人av在线播放网站| 天天综合色天天| 国产精品久久久久天堂| 制服丝袜亚洲色图| 成人国产在线观看| 日韩电影在线看| 亚洲美女少妇撒尿| 欧美mv和日韩mv的网站| 在线免费不卡视频| 国产一区二区导航在线播放| 亚洲一区二区三区四区的| 国产亚洲一区二区三区四区 | 日韩精品一区二区在线| 色综合久久久久网| 国产在线一区二区综合免费视频| 亚洲在线免费播放| 中文字幕欧美日本乱码一线二线| 91精品婷婷国产综合久久竹菊| 99re这里都是精品| 激情综合色播五月| 五月激情综合网| 亚洲女女做受ⅹxx高潮| 久久久久久久久久久99999| 3atv一区二区三区|