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

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

?? zl5011xdma.c

?? Zalink50114----TDMoIP芯片驅動源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
      /* enable the DMA interrupt */
      status = zl5011xIsrEnableInterruptSourceStructInit(zl5011xParams, &isrSource);

      isrSource.interruptSource = ZL5011X_HOST_DMA_RX_INTERRUPT;

      if (status == ZL5011X_OK)
      {
         status = zl5011xIsrEnableInterruptSource(zl5011xParams, &isrSource);
      }
   }

   return status;
}

/*******************************************************************************
 Function:
    zl5011xHostTxInitialiseStructInit

 Description:
    Set up default parameters for the HostTxInitialise function

 Inputs:
   zl5011xParams    Pointer to the structure for this device instance.
                   (Unused in this function)
   par             Pointer to the structure for configuration items.

 Outputs:
    None

 Returns:
    zlStatusE

 Remarks:
*******************************************************************************/

zlStatusE zl5011xHostTxInitialiseStructInit(zl5011xParamsS *zl5011xParams, zl5011xHostTxInitialiseS *par)
{
   zlStatusE status = ZL5011X_OK;

   status = ZL5011X_CHECK_POINTERS(zl5011xParams, par);

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

   if (status == ZL5011X_OK)
   {
      ZL5011X_TRACE(ZL5011X_DMA_FN_ID,
            "zl5011xHostTxInitialiseStructInit:", 0, 0, 0, 0, 0, 0);

      par->dmaChannel = 0; /* ZARLINK evaluation board uses DMA channel 0 for
        packet transmission from CPU, and 1 for reception                     */
      par->numberOfBuffers = 128;/* Default number of buffers to use            */
      par->bufferSize = ZL5011X_MAXIMUM_PACKET_SIZE;
      par->ethernetSrcAddressFromMac = ZL5011X_TRUE; /* Overwrite the packet source MAC address by default */
   }

   return status;
}


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

 Function:
   zl5011xHostTxInitialise

 Description:
   Configures a DMA channel for transmission and initialises the device to
   provide the required handshaking

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

 Structure inputs:
   dmaChannel      DMA channel to configure
   numberOfBuffers Size of buffer chain
   bufferSize      Size of data buffer to create for each descriptor

 Structure outputs:
   None

 Returns:
   zlStatusE

 Remarks:
*******************************************************************************/

zlStatusE zl5011xHostTxInitialise(zl5011xParamsS *zl5011xParams, zl5011xHostTxInitialiseS *par)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T loop;

   status = ZL5011X_CHECK_POINTERS(zl5011xParams, par);

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

   if (status == ZL5011X_OK)
   {
      ZL5011X_TRACE(ZL5011X_DMA_FN_ID,"zl5011xHostTxInitialise:", 0, 0, 0, 0, 0, 0);
   }

   /* Check DMA channel is in range for the micro                             */
   ZL5011X_CHECK_PARAMETER_RANGE(par->dmaChannel,0,
         zl5011xDmaProps.maxNumberOfChannels,ZL5011X_PARAMETER_INVALID)

   /* Now check the number of descriptors is in range for micro               */
   if (status == ZL5011X_OK)
   {
      if (par->numberOfBuffers > zl5011xDmaProps.maxDescriptorChainSize)
      {
         status = ZL5011X_PARAMETER_INVALID;
      }
   }

   /* Check the value of the ethernetSrcAddressFromMac flag */
   if (status == ZL5011X_OK)
   {
      status = ZL5011X_CHECK_BOOLEAN(par->ethernetSrcAddressFromMac);
   }

   /* Check DMA Tx not already initialised */
   if ((status == ZL5011X_OK) && (txQParams != NULL))
   {
      status = ZL5011X_DMA_QUEUE_ALREADY_INIT;
   }

   /* Set the ethernet src address overwrite state for all host headers */
   for (loop = 0; (loop < ZL5011X_PKT_TX_NUM_HOST_HEADERS) && (status == ZL5011X_OK); loop++)
   {
      status = zl5011xPtxEnableSrcMacOverwrite(zl5011xParams,
                  ZL5011X_PKT_TX_NUM_CONTEXT_HEADERS + loop, par->ethernetSrcAddressFromMac);
   }

   /* Now initialise DMA channel and build chain of descriptors               */
   if (status == ZL5011X_OK)
   {
      /* Allocate memory for tx structure. Function also sets polarity of DREQ
         and DACK signals                                                     */
      status = zl5011xDmaAllocateStructure(zl5011xParams,ZL5011X_DMA_TRANSMIT);
      if (status == ZL5011X_OK)
      {
         txQParams->dmaChannel.numberOfBuffers = par->numberOfBuffers;
         txQParams->dmaChannel.channelNumber = par->dmaChannel;

         /* Specify the buffer size as a whole number of words (including the
            PTH), and as a whole number of buffers transfer sizes               */
         txQParams->dmaChannel.bufferSize = (((par->bufferSize
               +ZL5011X_PTH_BYTESIZE -1)/ zl5011xDmaProps.transferBufferSize)+1)
         *ZL5011X_WORDS_PER_TRANSFER;
         txQParams->dmaChannel.devParams = zl5011xParams;
         txQParams->dmaChannel.dmaDirection = ZL5011X_DMA_TRANSMIT;

         /* Initialise the DMA channel                                          */
         status = zl5011xDmaInitialise(&txQParams->dmaChannel);
      }
   }

   if (status == ZL5011X_OK)
   {
      /* Put the DMA into a known state                                        */
      status = zl5011xDmaIssueCommand(&txQParams->dmaChannel,
            ZL5011X_DMA_STOP_COMMAND);
   }

   if (status == ZL5011X_OK)
   {
      /* Initialise  device DMA Tx handshaking                                 */
      status = zl5011xCpuDmaSetTxControl(zl5011xParams,ZL5011X_DMA_ENABLED);
   }

   if (status == ZL5011X_OK)
   {
      txQParams->packetsSent = 0;
      txQParams->packetsSentFail = 0;
      txQParams->cpucpuPackets = 0;

      /* Create the semaphore used for controlling access to txQParams
         structure and also to the tx dma channel                             */
      txQParams->mutex = OS_MUTEX_CREATE(OS_SEM_FULL);
      if (txQParams->mutex == OS_SEM_INVALID)
      {
         status = ZL5011X_RTOS_SEMA4_CREATE_FAIL;
      }
   }

   /* Send a dummy packet into the DMA and check that it is transferred
      correctly */
   if (status == ZL5011X_OK)
   {
      status = zl5011xHostTxSendDMAStartPacket(zl5011xParams);
   }

   if (status == ZL5011X_OK)
   {
      zl5011xParams->osExclusion.dmaTxEnabled = ZL5011X_TRUE;
   }

   return status;
}

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

 Function:
   zl5011xHostTxDisableStructInit

 Description:
   This function will set default parameters for zl5011xHostTxDisable

 Inputs:
   zl5011xParams    Pointer to the structure for this device instance.
                   (Unused in this function)
   par             Pointer to the structure for configuration item.
                   (Unused in this function)

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None

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

zlStatusE zl5011xHostTxDisableStructInit(zl5011xParamsS *zl5011xParams, zl5011xHostTxDisableS *par)
{
   zlStatusE status = ZL5011X_OK;

   status = ZL5011X_CHECK_POINTERS(zl5011xParams, par);

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

   if (status == ZL5011X_OK)
   {
      ZL5011X_TRACE(ZL5011X_DMA_FN_ID,"zl5011xHostTxDisableStructInit:",0,0,0,0,0,0);
   }

   return(status);
}

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

 Function:
   zl5011xHostTxDisable

 Description:
   This function will stop the transmit DMA channel (if active), and disable
   the device from receiving any more packets

 Inputs:
   zl5011xParams    Pointer to the structure for this device instance.
                   (Unused in this function)
   par             Pointer to the structure for configuration items. See below:

 Structure inputs:
   unused          Reserved for future use

 Structure outputs:
   None

   None

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None

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

zlStatusE zl5011xHostTxDisable(zl5011xParamsS *zl5011xParams, zl5011xHostTxDisableS *par)
{
   zlStatusE status = ZL5011X_OK;
   zl5011xDmaControlModeE txMode;
   Uint32T timeout;
   zl5011xBooleanE unused;

   status = ZL5011X_CHECK_POINTERS(zl5011xParams, par);

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

   if (status == ZL5011X_OK)
   {
      ZL5011X_TRACE(ZL5011X_DMA_FN_ID,"zl5011xHostTxDisable:", 0, 0, 0, 0, 0, 0);

      ZL5011X_CHECK_FOR_INVALID_VALUE(txQParams,NULL,ZL5011X_DMA_QUEUE_NOT_INIT)
   }

   /* Take the semaphore before deleting memory to prevent other tasks from
      accessing a structure that is about to be deleted!                      */
   ZL5011X_MUTEX_TAKE(txQParams->mutex)

   if (status == ZL5011X_OK)
   {
      status = zl5011xCpuDmaSetTxControl(txQParams->dmaChannel.devParams,
            ZL5011X_DMA_DISABLED);
   }

   /* Wait for device to complete last packet                                 */
   for (timeout=0;timeout<zl5011xDmaProps.deviceStopTimeout;timeout++)
   {
      status = zl5011xCpuDmaGetTxStatus(txQParams->dmaChannel.devParams,
            &txMode, &unused);
      if ((status != ZL5011X_OK) || (txMode == ZL5011X_DMA_DISABLED))
      {
         break;
      }

      OS_TICK_DELAY(1); /* Wait 1 RTOS tick before checking again              */
   }

   if (status == ZL5011X_OK)
   {
      if (timeout == zl5011xDmaProps.deviceStopTimeout)
      {
         status = ZL5011X_DMA_QUEUE_FAIL;
      }
      else
      {
         /* Stop the DMA if still active (shouldn't be necessary)               */
         (void)zl5011xDmaIssueCommand(&txQParams->dmaChannel,
               ZL5011X_DMA_STOP_COMMAND);
      }
   }

   /* Free memory acquired                                                    */
   if (status == ZL5011X_OK)
   {
      zl5011xDmaDisable(&txQParams->dmaChannel);

      /* Delete the access semaphore                                           */
      if (OS_MUTEX_DELETE(txQParams->mutex) != OS_OK)
      {
         status = ZL5011X_RTOS_SEMA4_DELETE_FAIL;
      }
      txQParams->mutex = OS_SEM_INVALID;

      OS_FREE(txQParams);
      txQParams = NULL;
   }

   if (status == ZL5011X_OK)
   {
      zl5011xParams->osExclusion.dmaTxEnabled = ZL5011X_FALSE;
   }

   return status;
}

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

 Function:
   zl5011xHostTxSendPacketStructInit

 Description:
   Initialise the structure used in function HostTxSendPacket

 Inputs:
   zl5011xParams    Pointer to the structure for this device instance.
                   (Unused in this function)
   par             Pointer to the structure for configuration items.

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None

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

zlStatusE zl5011xHostTxSendPacketStructInit(zl5011xParamsS *zl5011xParams, zl5011xHostTxSendPacketS *par)
{
   zlStatusE status = ZL5011X_OK;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久嫩草精品久久久精品一| 91精品国产综合久久久久久| 亚洲午夜免费电影| 欧美不卡视频一区| 欧美唯美清纯偷拍| 国产999精品久久久久久| 香蕉久久夜色精品国产使用方法 | 麻豆精品蜜桃视频网站| 亚洲欧洲精品一区二区精品久久久| 在线成人av影院| 91福利资源站| 波多野结衣精品在线| 国产毛片精品视频| 日韩福利电影在线观看| 一区二区三区欧美亚洲| 国产精品系列在线| 久久久久高清精品| 日韩美一区二区三区| 在线日韩av片| 91蜜桃视频在线| 成熟亚洲日本毛茸茸凸凹| 久久精品久久综合| 日韩不卡在线观看日韩不卡视频| 亚洲女同女同女同女同女同69| 国产精品青草久久| 在线一区二区视频| 黄色日韩三级电影| 亚洲色图视频网| 91精品国产综合久久小美女| 狠狠v欧美v日韩v亚洲ⅴ| 欧美精品一区二区在线播放| 国产一区二区精品久久| 亚洲丝袜制服诱惑| 亚洲精品在线观看网站| 高清久久久久久| 理论电影国产精品| 欧美白人最猛性xxxxx69交| 成人激情校园春色| 福利视频网站一区二区三区| 国内精品久久久久影院色| 九九精品视频在线看| 久久精品国产亚洲aⅴ | 一区二区在线免费| 国产精品网友自拍| 国产精品国产三级国产aⅴ无密码| 国产日韩成人精品| 亚洲欧洲成人精品av97| 成人欧美一区二区三区黑人麻豆 | 亚洲成人av一区二区| 亚洲欧洲一区二区三区| 亚洲精品精品亚洲| 亚洲妇熟xx妇色黄| 日本成人中文字幕| 国产资源精品在线观看| 国产成人午夜视频| 不卡的看片网站| 91美女蜜桃在线| 欧美日韩精品是欧美日韩精品| 欧美精品久久久久久久久老牛影院| 91精品国产一区二区三区蜜臀| 日韩欧美123| 欧美激情一区二区三区全黄| 亚洲精品你懂的| 日韩精品亚洲专区| 国产精品一级二级三级| 99久久国产免费看| 欧美日韩黄色影视| 久久久久国产精品免费免费搜索| 亚洲视频 欧洲视频| 日本网站在线观看一区二区三区 | 国产乱码一区二区三区| 成人白浆超碰人人人人| 欧美日韩一级片在线观看| 精品国产一区二区三区久久影院| 久久精品人人爽人人爽| 樱花草国产18久久久久| 免费在线观看日韩欧美| 成人h动漫精品一区二| 欧美区在线观看| 欧美经典一区二区| 天天av天天翘天天综合网| 国产成人无遮挡在线视频| 欧美特级限制片免费在线观看| 精品嫩草影院久久| 亚洲久草在线视频| 麻豆91精品视频| 色吧成人激情小说| 久久久久久久久久看片| 亚洲国产乱码最新视频| 岛国精品在线播放| 日韩三级精品电影久久久| 中文字幕一区免费在线观看| 久久99精品久久只有精品| 97se亚洲国产综合自在线不卡| 欧美丰满一区二区免费视频| 国产精品免费视频一区| 日本不卡123| 欧美在线视频日韩| 中文字幕av一区二区三区高 | 亚洲欧洲av在线| 激情综合色综合久久| 欧美午夜寂寞影院| 欧美—级在线免费片| 久久不见久久见中文字幕免费| 91国产丝袜在线播放| 国产精品国产三级国产普通话99| 麻豆国产91在线播放| 欧美日精品一区视频| 亚洲欧美日本韩国| 粉嫩aⅴ一区二区三区四区 | 欧美成人免费网站| 无码av免费一区二区三区试看| heyzo一本久久综合| 国产三级欧美三级| 久久精品国产网站| 制服丝袜在线91| 亚洲高清一区二区三区| 日本道在线观看一区二区| 国产精品国产三级国产aⅴ入口 | 欧美日本高清视频在线观看| 国产精品国产成人国产三级 | 亚洲一区二区三区四区不卡| 成人激情综合网站| 亚洲国产精品高清| 成人综合婷婷国产精品久久| 久久久久久99久久久精品网站| 美女看a上一区| 日韩欧美一卡二卡| 亚洲成a人v欧美综合天堂下载 | 国产欧美一区二区在线| 国产在线播精品第三| 精品蜜桃在线看| 精品一区二区三区久久| 欧美成人午夜电影| 国产美女视频一区| 2024国产精品| 国产精品一区二区三区网站| 久久夜色精品国产欧美乱极品| 韩国一区二区三区| 国产日韩欧美精品综合| 成人在线一区二区三区| 国产精品污污网站在线观看 | 欧美视频在线不卡| 亚洲国产综合视频在线观看| 欧美性色黄大片| 午夜精品一区二区三区电影天堂 | 2023国产精品| 国产在线一区观看| 国产三级一区二区三区| av一区二区三区黑人| 一区二区三区四区亚洲| 在线国产亚洲欧美| 婷婷一区二区三区| 欧美一级在线观看| 国产激情精品久久久第一区二区| 国产精品―色哟哟| 91搞黄在线观看| 奇米一区二区三区av| 久久久久国产一区二区三区四区| 波多野结衣亚洲一区| 亚洲午夜三级在线| 精品成人一区二区| 99久久免费精品高清特色大片| 一二三区精品视频| 欧美一区二区成人| 成人精品一区二区三区四区| 亚洲欧美日韩电影| 日韩午夜激情视频| 成人国产一区二区三区精品| 亚洲综合区在线| 2023国产一二三区日本精品2022| 91在线观看视频| 免费的成人av| 国产精品国产三级国产aⅴ无密码| 欧美日韩激情在线| 狠狠久久亚洲欧美| 一区二区三区欧美日| 精品乱人伦小说| 色综合中文字幕国产 | 欧美午夜电影在线播放| 国产一区二区精品久久91| 伊人一区二区三区| 国产亚洲午夜高清国产拍精品| 欧美午夜影院一区| 国产激情一区二区三区四区 | 色综合亚洲欧洲| 青青草国产成人99久久| 亚洲国产精品激情在线观看| 欧美色偷偷大香| 成人网页在线观看| 美日韩黄色大片| 一区二区三区丝袜| 欧美国产97人人爽人人喊| 制服丝袜亚洲色图| 91精品福利在线| 不卡的电影网站| 国产精品18久久久久久久久| 午夜久久久久久久久久一区二区| 国产精品三级电影| 日韩欧美一区二区视频|