49 lines
1.4 KiB
C
49 lines
1.4 KiB
C
#ifndef __ETHERNETIF_H
|
|
#define __ETHERNETIF_H
|
|
|
|
#include "lwip/err.h"
|
|
#include "lwip/netif.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* Should be called at the beginning of the program to set up the
|
|
* network interface. It calls the function low_level_init() to do the
|
|
* actual setup of the hardware.
|
|
*
|
|
* This function should be passed as a parameter to netif_add().
|
|
*
|
|
* @param netif the lwip network interface structure for this ethernetif
|
|
* @return ERR_OK if the loopif is initialized
|
|
* ERR_MEM if private data couldn't be allocated
|
|
* any other err_t on error
|
|
*/
|
|
err_t ethernetif_init(struct netif* netif);
|
|
|
|
/**
|
|
* This function should be called when a packet is ready to be read
|
|
* from the interface. It uses the function low_level_input() that
|
|
* 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.
|
|
*
|
|
* @param netif the lwip network interface structure for this ethernetif
|
|
*/
|
|
void ethernetif_input(struct netif* netif);
|
|
|
|
/**
|
|
* This function should be called periodically from the main loop
|
|
* to check the link status and update lwIP accordingly.
|
|
*
|
|
* @param netif the lwip network interface structure for this ethernetif
|
|
*/
|
|
void ethernetif_link_poll(struct netif* netif);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __ETHERNETIF_H */
|