MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / eth_tx_thread_entry

Function eth_tx_thread_entry

components/net/lwip/port/ethernetif.c:879–906  ·  view source on GitHub ↗

Ethernet Tx Thread */

Source from the content-addressed store, hash-verified

877#ifndef LWIP_NO_TX_THREAD
878/* Ethernet Tx Thread */
879static void eth_tx_thread_entry(void* parameter)
880{
881 struct eth_tx_msg* msg;
882
883 while (1)
884 {
885 if (rt_mb_recv(&eth_tx_thread_mb, (rt_ubase_t *)&msg, RT_WAITING_FOREVER) == RT_EOK)
886 {
887 struct eth_device* enetif;
888
889 RT_ASSERT(msg->netif != RT_NULL);
890 RT_ASSERT(msg->buf != RT_NULL);
891
892 enetif = (struct eth_device*)msg->netif->state;
893 if (enetif != RT_NULL)
894 {
895 /* call driver's interface */
896 if (enetif->eth_tx(&(enetif->parent), msg->buf) != RT_EOK)
897 {
898 /* transmit eth packet failed */
899 }
900 }
901
902 /* send ACK */
903 rt_completion_done(&msg->ack);
904 }
905 }
906}
907#endif
908
909#ifndef LWIP_NO_RX_THREAD

Callers

nothing calls this directly

Calls 2

rt_mb_recvFunction · 0.85
rt_completion_doneFunction · 0.85

Tested by

no test coverage detected