/* Sets up the TX descriptor ring buffers. 
This function sets up the descriptor list used for transmit packets. */
static err_t lpc_tx_setup(struct lpc_enetdata *lpc_enetif)
/* Sets up the TX descriptor ring buffers. 
This function sets up the descriptor list used for transmit packets. */
static err_t lpc_tx_setup(struct lpc_enetdata *lpc_enetif)
{
    s32_t idx;
    for (idx = 0; idx < LPC_NUM_BUFF_TXDESCS; idx++) {
        lpc_enetif->ptxd[idx].control = 0;
        lpc_enetif->ptxs[idx].statusinfo = 0xFFFFFFFF;
    }
    LPC_EMAC->TxDescriptor = (u32_t) &lpc_enetif->ptxd[0];
    LPC_EMAC->TxStatus = (u32_t) &lpc_enetif->ptxs[0];
    LPC_EMAC->TxDescriptorNumber = LPC_NUM_BUFF_TXDESCS - 1;
    lpc_enetif->lpc_last_tx_idx = 0;
    return ERR_OK;
}