CSP Interface

File: csp/csp_interface.h

Description: CSP Interface

Typedefs

typedef int (*nexthop_t)(csp_iface_t*, uint16_t, csp_packet_t*, int)
[source]

Interface Tx function.

Structures

struct csp_iface_s
[source]

This struct is referenced in documentation. Update doc when you change this.

uint16_t addr
[source]

Host address on this subnet

uint32_t autherr
[source]

Authentication errors (packets)

void *driver_data
[source]

Driver data, only known/used by the driver layer, e.g. device/channel references.

uint32_t drop
[source]

Dropped packets

uint32_t frame
[source]

Frame format errors (packets)

void *interface_data
[source]

Interface data, only known/used by the interface layer, e.g. state information.

uint32_t irq
[source]

Interrupts

uint8_t is_default
[source]

Set default IF flag (CSP supports multiple defaults)

const char *name
[source]

Name, max compare length is #CSP_IFLIST_NAME_MAX

uint16_t netmask
[source]

Subnet mask

struct csp_iface_s *next
[source]
nexthop_t nexthop
[source]

Next hop (Tx) function

uint32_t rx
[source]

Successfully received packets

uint32_t rx_error
[source]

Receive errors, e.g. too large message

uint32_t rxbytes
[source]

Received bytes

uint32_t tx
[source]

Successfully transmitted packets

uint32_t tx_error
[source]

Transmit errors (packets)

uint32_t txbytes
[source]

Transmitted bytes

Interface Functions

void csp_qfifo_write(csp_packet_t *packet, csp_iface_t *iface, void *pxTaskWoken)
[source]

Inputs a new packet into the system.

This function can be called from interface drivers (ISR) or tasks, to route and accept packets.

Note

EXTREMELY IMPORTANT: pxTaskWoken must ALWAYS be NULL if called from task, and ALWAYS be NON NULL if called from ISR. If this condition is met, this call is completely thread-safe

This function is fire and forget, it returns void, meaning that the packet will always be either accepted or dropped, so the memory will always be freed.

Parameters:
  • packet – A pointer to the incoming packet

  • iface – A pointer to the incoming interface TX function.

  • pxTaskWoken – Valid reference if called from ISR, otherwise NULL!