Microchip® Advanced Software Framework

lwip-port-1.4.1/sam/include/netif/ethernetif.h File Reference

Ethernet Interface Skeleton.

Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.

#include "lwip/netif.h"
#include "lwip/ip_addr.h"
#include "lwip/err.h"
#include "netif/etharp.h"

Functions

err_t ethernetif_init (struct netif *netif)
 Should be called at the beginning of the program to set up the network interface. More...
 
void ethernetif_input (void *pv_parameters)
 This function should be called when a packet is ready to be read from the interface. More...
 

err_t ethernetif_init ( struct netif netif)

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().

Parameters
netifthe lwip network interface structure for this ethernetif.
Returns
ERR_OK if the loopif is initialized ERR_MEM if private data couldn't be allocated any other err_t on error.

References ERR_OK, IFNAME0, IFNAME1, netif::linkoutput, low_level_init(), low_level_output(), LWIP_ASSERT, netif::name, NET_LINK_SPEED, NETIF_INIT_SNMP, NULL, netif::output, snmp_ifType_ethernet_csmacd, and netif::state.

Referenced by ethernet_configure_interface().

void ethernetif_input ( void *  pvParameters)

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.

Parameters
pv_parametersthe lwip network interface structure for this ethernetif.

References ERR_OK, netif::input, low_level_input(), NULL, pbuf_free(), and vTaskDelay().

Referenced by ethernet_task(), and low_level_init().