* Process tx and rx packets at the low-level interrupt. * * should be called from the Stellaris Ethernet Interrupt Handler. This * function will read packets from the Stellaris Ethernet fifo and place them * into a pbuf queue. If the transmitter is idle and there is at least one packet * on the transmit queue, it will place it in the transmit fifo and start the * transmitter. * */
| 1104 | * |
| 1105 | */ |
| 1106 | void |
| 1107 | tivaif_interrupt(net_device_t dev, uint32_t ui32Status) |
| 1108 | { |
| 1109 | |
| 1110 | /* Update our debug interrupt counters. */ |
| 1111 | if(ui32Status & EMAC_INT_NORMAL_INT) |
| 1112 | { |
| 1113 | g_ui32NormalInts++; |
| 1114 | } |
| 1115 | |
| 1116 | if(ui32Status & EMAC_INT_ABNORMAL_INT) |
| 1117 | { |
| 1118 | g_ui32AbnormalInts++; |
| 1119 | } |
| 1120 | |
| 1121 | /* Is this an interrupt from the PHY? */ |
| 1122 | if(ui32Status & EMAC_INT_PHY) |
| 1123 | { |
| 1124 | tivaif_process_phy_interrupt(dev); |
| 1125 | } |
| 1126 | |
| 1127 | /* Process the transmit DMA list, freeing any buffers that have been |
| 1128 | * transmitted since our last interrupt. |
| 1129 | */ |
| 1130 | if(ui32Status & EMAC_INT_TRANSMIT) |
| 1131 | { |
| 1132 | #if EEE_SUPPORT |
| 1133 | if(g_bEEELinkActive) |
| 1134 | { |
| 1135 | EMACLPIEnter(EMAC0_BASE); |
| 1136 | } |
| 1137 | #endif |
| 1138 | tivaif_process_transmit(dev->dma_if); |
| 1139 | } |
| 1140 | |
| 1141 | /** |
| 1142 | * Process the receive DMA list and pass all successfully received packets |
| 1143 | * up the stack. We also call this function in cases where the receiver has |
| 1144 | * stalled due to missing buffers since the receive function will attempt to |
| 1145 | * allocate new pbufs for descriptor entries which have none. |
| 1146 | */ |
| 1147 | if(ui32Status & (EMAC_INT_RECEIVE | EMAC_INT_RX_NO_BUFFER | |
| 1148 | EMAC_INT_RX_STOPPED)) |
| 1149 | { |
| 1150 | tivaif_receive(dev); |
| 1151 | } |
| 1152 | } |
| 1153 | |
| 1154 | #if NETIF_DEBUG |
| 1155 | /* Print an IP header by using LWIP_DEBUGF |
no test coverage detected