/* Take ownership of all the rx Descriptors. This function is called when there is fatal error in DMA transmission. When called it takes the ownership of all the tx descriptor in tx descriptor pool/queue from DMA. The function is same for both the ring mode and the chain mode DMA structures.  */
void synopGMAC_take_desc_ownership_tx(synopGMACdevice *gmacdev)
/* Take ownership of all the rx Descriptors. This function is called when there is fatal error in DMA transmission. When called it takes the ownership of all the tx descriptor in tx descriptor pool/queue from DMA. The function is same for both the ring mode and the chain mode DMA structures.  */
void synopGMAC_take_desc_ownership_tx(synopGMACdevice *gmacdev)
{
    s32 i;
    DmaDesc *desc;
    desc = gmacdev->TxDesc;
    for(i = 0; i < gmacdev->TxDescCount; i++){
        if(synopGMAC_is_tx_desc_chained(desc)){
            synopGMAC_take_desc_ownership(desc);
            desc = (DmaDesc *)desc->data2;
        }
        else{
            synopGMAC_take_desc_ownership(desc + i);
        }
    }
}