Skip to content

<net/protocols/nic.h>

Shared memory and doorbell protocol between a NIC driver and netd.

#include <net/protocols/nic.h>

Constants

Name Value Description
NIC_DOORBELL_TX (1u << 0) Doorbell bit, netd to driver: frames queued in the tx ring.
NIC_DOORBELL_RX (1u << 1) Doorbell bit, driver to netd: frames queued in the rx ring.
NIC_STATS_OFFSET Offset of the NicStatsBlock: in the rx ring's pages, just after the ring.

Enumerations

NicStat

Driver statistics counters.

Name Value Description
NIC_STAT_IRQ 0 Interrupts serviced.
NIC_STAT_RX_PACKETS 1 Frames delivered to the rx ring.
NIC_STAT_TX_PACKETS 2 Frames written to the hardware tx FIFO.
NIC_STAT_RX_RING_FULL 3 Frames dropped because the rx ring was full.
NIC_STAT_RX_ERRORS 4 Received frames the NIC flagged as bad.
NIC_STAT_RX_OVERSIZE 5 Received frames dropped for exceeding NIC_FRAME_SIZE.
NIC_STAT_TX_DROPS 6 Frames dropped because the tx FIFO was full.
NIC_STAT_COUNT 7 Number of counters.

Structures

NicStatsBlock

Counters the driver keeps in the shared memory for netd and tools to read.

Field Type Description
stat volatile uint32_t Counters, indexed by NicStat.