/* Initializes the DMA Tx descriptors in chain mode.  */
void ETH_ConfigDMATxDescChain(ETH_DMADescConfig_T *DMATxDescTab, uint8_t *txBuff, uint32_t txBuffcount)
/* Initializes the DMA Tx descriptors in chain mode.  */
void ETH_ConfigDMATxDescChain(ETH_DMADescConfig_T *DMATxDescTab, uint8_t *txBuff, uint32_t txBuffcount)
{
    uint32_t i = 0;
    ETH_DMADescConfig_T *DMATxDesc;
    DMATxDescToSet = DMATxDescTab;
    for(i=0; i< txBuffcount; i++)
    {
        DMATxDesc = DMATxDescTab+i;
        DMATxDesc->Status = ETH_DMATXDESC_TXCH;
        DMATxDesc->Buffer1Addr = (uint32_t)(&txBuff[i*ETH_TX_BUF_SIZE]);
        if(i < (txBuffcount-1))
        {
            DMATxDesc->Buffer2NextDescAddr = (uint32_t)(DMATxDescTab+i+1);
        }
        else
        {
            DMATxDesc->Buffer2NextDescAddr = (uint32_t)(DMATxDescTab);
        }
    }
    ETH->DMATXDLADDR = (uint32_t) DMATxDescTab;
}