Should be called at the beginning of the program to set up the network interface.
low_level_init() It calls the functionto do the actual setup of the hardware. This function should be passed as a parameter to netif_add(). netif the lwip network interface structure for this ethernetif ERR_OK if the loopif is initialized ERR_MEM if private data couldn't be allocated any other err_t on error
This function should be called when a packet is ready to be read from the interface.
low_level_input() It uses the functionthat should handle the actual reception of bytes from the network interface. Then the type of the received packet is determined and the appropriate input function is called. netif the lwip network interface structure for this ethernetif
In this function, the hardware should be initialized.
ethernetif_init() Called from. netif the already initialized lwip network interface structure for this ethernetif
Should allocate a pbuf and transfer the bytes of the incoming packet from the interface into the pbuf.
netif the lwip network interface structure for this ethernetif a pbuf filled with the received packet (including MAC header) NULL on memory error
This function should do the actual transmission of the packet.
The packet is contained in the pbuf that is passed to the function. This pbuf might be chained. netif the lwip network interface structure for this ethernetif p the MAC packet to send (e.g. IP packet including MAC addresses and type) ERR_OK if the packet could be sent an err_t value if the packet couldn't be sent Returning ERR_MEM here if a DMA queue of your MAC is full can lead to strange results. You might consider waiting for space in the DMA queue to become available since the stack doesn't retry to send a packet dropped because of memory failure (except for the TCP timers).
ethernetif.c ethernetif.c File Name :Description : This file provides code for the configuration of theMiddleWare.
Copyright (c) 2026 STMicroelectronics. All rights reserved. This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.