#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/mem.h"
#include "lwip/pbuf.h"
#include "lwip/sys.h"
#include <lwip/stats.h>
#include <lwip/snmp.h>
#include "netif/etharp.h"
#include "netif/ppp_oe.h"
#include "conf_eth.h"
#include "macb.h"
Data Structures | |
struct | ethernetif |
Helper struct to hold private data used to operate your ethernet interface. More... | |
Macros | |
#define | IFNAME0 'e' |
#define | IFNAME1 'n' |
#define | netifGUARD_BLOCK_NBTICKS ( 250 ) |
Functions | |
err_t | ethernetif_init (struct netif *netif) |
Should be called at the beginning of the program to set up the network interface. More... | |
static void | ethernetif_input (void *pvParameters) |
This function should be called when a packet is ready to be read from the interface. More... | |
static void | low_level_init (struct netif *netif) |
In this function, the hardware should be initialized. More... | |
static struct pbuf * | low_level_input (struct netif *netif) |
Should allocate a pbuf and transfer the bytes of the incoming packet from the interface into the pbuf. More... | |
static err_t | low_level_output (struct netif *netif, struct pbuf *p) |
This function should do the actual transmission of the packet. More... | |
Variables | |
unsigned char | cMACAddress [6] |
#define IFNAME0 'e' |
Referenced by ethernetif_init().
#define IFNAME1 'n' |
Referenced by ethernetif_init().
#define netifGUARD_BLOCK_NBTICKS ( 250 ) |
Referenced by low_level_input(), and low_level_output().
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().
netif | the lwip network interface structure for this ethernetif |
References ERR_OK, etharp_output(), IFNAME0, IFNAME1, netif::linkoutput, low_level_init(), low_level_output(), LWIP_ASSERT, netif::name, NETIF_INIT_SNMP, NULL, netif::output, snmp_ifType_ethernet_csmacd, and netif::state.
Referenced by prvEthernetConfigureInterface().
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.
netif | the lwip network interface structure for this ethernetif |
References ERR_OK, netif::input, low_level_input(), NULL, pbuf_free(), and vMACBWaitForInput().
Referenced by low_level_init().
In this function, the hardware should be initialized.
Called from ethernetif_init().
netif | the already initialized lwip network interface structure for this ethernetif |
References cMACAddress, ETHARP_HWADDR_LEN, ethernetif_input(), netif::flags, netif::hwaddr, netif::hwaddr_len, netif::mtu, NETIF_FLAG_BROADCAST, NETIF_FLAG_DHCP, NETIF_FLAG_ETHARP, netifINTERFACE_TASK_PRIORITY, netifINTERFACE_TASK_STACK_SIZE, NULL, sys_thread_new(), tskIDLE_PRIORITY, uxTaskPriorityGet(), vTaskPrioritySet(), and xMACBInit().
Referenced by ethernetif_init().
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 |
References ETH_PAD_SIZE, pbuf::len, LINK_STATS_INC, netifGUARD_BLOCK_NBTICKS, pbuf::next, NULL, pbuf::payload, pbuf_alloc(), pbuf_header(), PBUF_POOL, PBUF_RAW, ulMACBInputLength(), vMACBRead(), void, vSemaphoreCreateBinary, xSemaphoreGive, and xSemaphoreTake.
Referenced by ethernetif_input().
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) |
References ERR_OK, ETH_PAD_SIZE, pbuf::len, LINK_STATS_INC, lMACBSend(), netifGUARD_BLOCK_NBTICKS, pbuf::next, NULL, pbuf::payload, pbuf_header(), void, vSemaphoreCreateBinary, xSemaphoreGive, and xSemaphoreTake.
Referenced by ethernetif_init().
unsigned char cMACAddress[6] |
Referenced by low_level_init().