| 1 | void |
| 2 | eth_mac_irq() |
| 3 | { |
| 4 | /* Service MAC IRQ here */ |
| 5 | |
| 6 | /* Allocate pbuf from pool (avoid using heap in interrupts) */ |
| 7 | struct pbuf* p = pbuf_alloc(PBUF_RAW, eth_data_count, PBUF_POOL); |
| 8 | |
| 9 | if(p != NULL) { |
| 10 | /* Copy ethernet frame into pbuf */ |
| 11 | pbuf_take(p, eth_data, eth_data_count); |
| 12 | |
| 13 | /* Put in a queue which is processed in main loop */ |
| 14 | if(!queue_try_put(&queue, p)) { |
| 15 | /* queue is full -> packet loss */ |
| 16 | pbuf_free(p); |
| 17 | } |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | static err_t |
| 22 | netif_output(struct netif *netif, struct pbuf *p) |
nothing calls this directly
no test coverage detected