The Pedigree Project  0.1
Macros | Functions
slipif.h File Reference
#include "lwip/opt.h"
#include "lwip/netif.h"
+ Include dependency graph for slipif.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SLIP_USE_RX_THREAD   !NO_SYS
 
#define SLIP_RX_FROM_ISR   0
 
#define SLIP_RX_QUEUE   SLIP_RX_FROM_ISR
 

Functions

err_t slipif_init (struct netif *netif)
 
void slipif_poll (struct netif *netif)
 

Detailed Description

SLIP netif API

Definition in file slipif.h.

Macro Definition Documentation

#define SLIP_RX_FROM_ISR   0

Set this to 1 to enable functions to pass in RX bytes from ISR context. If enabled, slipif_received_byte[s]() process incoming bytes and put assembled packets on a queue, which is fed into lwIP from slipif_poll(). If disabled, slipif_poll() polls the serial line (using sio_tryread()).

Definition at line 78 of file slipif.h.

#define SLIP_RX_QUEUE   SLIP_RX_FROM_ISR

Set this to 1 (default for SLIP_RX_FROM_ISR) to queue incoming packets received by slipif_received_byte[s]() as long as PBUF_POOL pbufs are available. If disabled, packets will be dropped if more than one packet is received.

Definition at line 86 of file slipif.h.

#define SLIP_USE_RX_THREAD   !NO_SYS

Set this to 1 to start a thread that blocks reading on the serial line (using sio_read()).

Definition at line 69 of file slipif.h.

Function Documentation

err_t slipif_init ( struct netif netif)

SLIP netif initialization

Call the arch specific sio_open and remember the opened device in the state field of the netif.

Parameters
netifthe lwip network interface structure for this slipif
Returns
ERR_OK if serial line could be opened, ERR_MEM if no memory could be allocated, ERR_IF is serial line couldn't be opened
Note
netif->num must contain the number of the serial port to open (0 by default). If netif->state is != NULL, it is interpreted as an u8_t pointer pointing to the serial port number instead of netif->num.

Definition at line 380 of file slipif.c.

References ERR_IF, ERR_MEM, ERR_OK, LWIP_DEBUGF, mem_free(), mem_malloc(), netif::mtu, netif::name, netif::num, SLIP_DEBUG, SLIP_MAX_SIZE, SLIP_SIO_SPEED, SLIPIF_THREAD_NAME, SLIPIF_THREAD_PRIO, SLIPIF_THREAD_STACKSIZE, netif::state, and sys_thread_new().

void slipif_poll ( struct netif netif)

Polls the serial device and feeds the IP layer with incoming packets.

Parameters
netifThe lwip network interface structure for this slipif

Definition at line 446 of file slipif.c.

References ERR_OK, netif::input, pbuf::len, pbuf::next, pbuf_free(), netif::state, SYS_ARCH_DECL_PROTECT, and pbuf::tot_len.