#include "lwip/opt.h"#include "lwip/def.h"#include "lwip/mem.h"#include "lwip/pbuf.h"#include "netif/etharp.h"#include "lwip/err.h"#include "lwip/timeouts.h"#include "ethernetif.h"#include "lwip.h"#include "hpm_enet_drv.h"#include "board.h"#include "netconf.h"#include <string.h>#include "lwip/netif.h"#include "FreeRTOS.h"#include "semphr.h"Macros | |
| #define | netifMTU (1500) |
| #define | netifINTERFACE_TASK_STACK_SIZE (350) |
| #define | netifINTERFACE_TASK_PRIORITY (configMAX_PRIORITIES - 1) |
| #define | netifGUARD_BLOCK_TIME (250) |
| #define | emacBLOCK_TIME_WAITING_FOR_INPUT ((portTickType)100) |
| #define | IFNAME0 'e' |
| #define | IFNAME1 'n' |
Functions | |
| static void | low_level_init (struct netif *netif) |
| static err_t | low_level_output (struct netif *netif, struct pbuf *p) |
| static struct pbuf * | low_level_input (struct netif *netif) |
| void | ethernetif_input (void *pvParameters) |
| err_t | ethernetif_init (struct netif *netif) |
Variables | |
| static struct netif * | s_pxNetIf = NULL |
| xSemaphoreHandle | s_xSemaphore = NULL |
Ethernet Interface Skeleton
| #define emacBLOCK_TIME_WAITING_FOR_INPUT ((portTickType)100) |
| #define IFNAME0 'e' |
| #define IFNAME1 'n' |
| #define netifGUARD_BLOCK_TIME (250) |
| #define netifINTERFACE_TASK_PRIORITY (configMAX_PRIORITIES - 1) |
| #define netifINTERFACE_TASK_STACK_SIZE (350) |
| #define netifMTU (1500) |
| 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().
| netif | the lwip network interface structure for this ethernetif |
| void ethernetif_input | ( | void * | pvParameters | ) |
This function is the ethernetif_input task, it is processed 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 |
|
static |
In this function, the hardware should be initialized. Called from ethernetif_init().
| netif | the already initialized lwip network interface structure for this ethernetif |
|
static |
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 |
|
static |
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) |
|
static |
| xSemaphoreHandle s_xSemaphore = NULL |