* This function will process all transmit descriptors and free pbufs attached * to any that have been transmitted since we last checked. * * This function is called only from the Ethernet interrupt handler. * * @param netif the lwip network interface structure for this ethernetif * @return None. */
| 737 | * @return None. |
| 738 | */ |
| 739 | static void |
| 740 | tivaif_process_transmit(tStellarisIF *pIF) |
| 741 | { |
| 742 | tDescriptorList *pDescList; |
| 743 | uint32_t ui32NumDescs; |
| 744 | |
| 745 | /* Get a pointer to the transmit descriptor list. */ |
| 746 | pDescList = pIF->pTxDescList; |
| 747 | |
| 748 | /* Walk the list until we have checked all descriptors or we reach the |
| 749 | * write pointer or find a descriptor that the hardware is still working |
| 750 | * on. |
| 751 | */ |
| 752 | for(ui32NumDescs = 0; ui32NumDescs < pDescList->ui32NumDescs; ui32NumDescs++) |
| 753 | { |
| 754 | /* Has the buffer attached to this descriptor been transmitted? */ |
| 755 | if(pDescList->pDescriptors[pDescList->ui32Read].Desc.ui32CtrlStatus & |
| 756 | DES0_TX_CTRL_OWN) |
| 757 | { |
| 758 | /* No - we're finished. */ |
| 759 | break; |
| 760 | } |
| 761 | |
| 762 | /* Does this descriptor have a buffer attached to it? */ |
| 763 | if(pDescList->pDescriptors[pDescList->ui32Read].pBuf) |
| 764 | { |
| 765 | /* Yes - free it if it's not marked as an intermediate pbuf */ |
| 766 | if(!((uint32_t)(pDescList->pDescriptors[pDescList->ui32Read].pBuf) & 1)) |
| 767 | { |
| 768 | pbuf_free(pDescList->pDescriptors[pDescList->ui32Read].pBuf); |
| 769 | DRIVER_STATS_INC(TXBufFreedCount); |
| 770 | } |
| 771 | pDescList->pDescriptors[pDescList->ui32Read].pBuf = NULL; |
| 772 | } |
| 773 | else |
| 774 | { |
| 775 | /* If the descriptor has no buffer, we are finished. */ |
| 776 | break; |
| 777 | } |
| 778 | |
| 779 | /* Move on to the next descriptor. */ |
| 780 | pDescList->ui32Read++; |
| 781 | if(pDescList->ui32Read == pDescList->ui32NumDescs) |
| 782 | { |
| 783 | pDescList->ui32Read = 0; |
| 784 | } |
| 785 | } |
| 786 | } |
| 787 | |
| 788 | /** |
| 789 | * This function will process all receive descriptors that contain newly read |
no test coverage detected