LWIP接收逐级跳转过程:
1.硬件中断ETH_IRQHandler
ETH_IRQHandler里调用 lwip_pkt_handle();
2.lwip_pkt_handle()
lwip_pkt_handle里面调用 ethernetif_input(&lwip_netif);
3.ethernetif_input(&lwip_netif)
ethernetif_input里调用ethernet_input
ethernetif_input(&lwip_netif);里面执行netif结构体类型变量lwip_netif的成员函数input():
err=netif->input(p, netif);
注册input回调函数:
netif结构体类型变量lwip_netif的成员函数input()=ethernet_input()
Netif_Init_Flag=netif_add(&lwip_netif,&ipaddr,&netmask,&gw,NULL,ðernetif_init,ðernet_input);
4.ethernet_input
ethernet_input(struct pbuf *p, struct netif *netif)里调用
ip_input(struct pbuf *p, struct netif *inp)
5.ip_input
ip_input(struct pbuf *p, struct netif *inp)里调用 tcp_input(struct pbuf *p, struct netif *inp)里调用
6.tcp_input
tcp_input(struct pbuf *p

本文详细介绍了LWIP数据接收的过程,从硬件中断ETH_IRQHandler开始,经过lwip_pkt_handle、ethernetif_input、ethernet_input、ip_input、tcp_input,最终到达TCP_EVENT_RECV,触发tcp_server_recv回调函数进行数据处理。
9511

被折叠的 条评论
为什么被折叠?



