We have completed the LWIP system transplant, then we need to carry out the Ethernet transplant work.
Ethernet transplant work, the main is "fill in the blanks" ETHERNETIF.C process! (PS. Once again, thank Adam Dunkels for his selfless work! and respect for him! )
ETHERNETIF.C location (.. /SRC/NETIF)
First, the transplant hardware
1. Initialization
implementation function: static void Low_level_init (struct netif *netif);
(1) Initializing MAC address
(2) Initializing the NIC
2. Send
Implementation functions: Static err_t low_level_output (struct netif *netif, struct pbuf *p);
(1) Initialize the transfer
(2) Send data
3. Receiving
Implementation function: Static struct pbuf *low_level_input (struct netif *netif);
(1) Read the data in Pbuf
(2) Read the packet
(3) Release Pbuf
(4) Len size
If there is a definition in the NIC driver that can be referenced directly, comment out.
Refer to Document 1. Network Interfaces Management