UbixOS  2.0
ethernetif.c File Reference
#include <pci/lnc.h>
#include "net/opt.h"
#include <net/tcpip.h>
#include "net/def.h"
#include "net/mem.h"
#include "net/pbuf.h"
#include "net/stats.h"
#include "net/snmp.h"
#include "net/ethip6.h"
#include "net/etharp.h"
Include dependency graph for ethernetif.c:

Go to the source code of this file.

Data Structures

struct  ethernetif
 

Macros

#define IFNAME0   'e'
 
#define IFNAME1   'n'
 

Functions

err_t ethernetif_init (struct netif *netif)
 
void ethernetif_input (struct netif *netif)
 

Variables

struct nicBuffertmpBuf = 0x0
 

Detailed Description

Ethernet Interface Skeleton

Definition in file ethernetif.c.

Macro Definition Documentation

◆ IFNAME0

#define IFNAME0   'e'

Definition at line 60 of file ethernetif.c.

◆ IFNAME1

#define IFNAME1   'n'

Definition at line 61 of file ethernetif.c.

Function Documentation

◆ ethernetif_init()

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

Definition at line 302 of file ethernetif.c.

References ERR_MEM, IFNAME0, IFNAME1, netif::linkoutput, LWIP_ASSERT, LWIP_DEBUGF, mem_malloc(), netif::name, NETIF_DEBUG, NULL, and netif::state.

Referenced by net_init().

Here is the call graph for this function:

◆ ethernetif_input()

void ethernetif_input ( 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.

Parameters
netifthe lwip network interface structure for this ethernetif

Definition at line 270 of file ethernetif.c.

References netif::state.

Referenced by lnc_thread().

Variable Documentation

◆ tmpBuf

struct nicBuffer* tmpBuf = 0x0

Definition at line 63 of file ethernetif.c.