ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_etha.c File Reference

Per-port Ethernet Agent (ETHA) driver implementation – HUM Ch 32. More...

#include "ra8_etha.h"
#include <stdint.h>
#include "ra8_attributes.h"
#include "ra8_check.h"
#include "ra8_err.h"
#include "ra8_etha_internal.h"
#include "ra8_etha_regs.h"
#include "ra8_ether_regs.h"
#include "ra8_hw_err.h"
#include "ra8_log.h"
#include "ra8_mstp.h"
#include "ra8_mstp_regs.h"
Include dependency graph for ra8_etha.c:

Go to the source code of this file.

Enumerations

enum  etha_field_t : uint32_t { k_etha_vem_mask = 0x7U }
 EAVCC field constants. More...
enum  ra8_etha_local_mask_t : uint32_t {
  k_ra8_etha_local_all_bits_set = 0xFFFFFFFFUL ,
  k_ra8_etha_local_byte_mask = 0xFFU ,
  k_ra8_etha_local_9bit_mask = 0x1FFUL
}
 Local mask helpers used inside this driver. More...

Functions

static bool internal_tc_ok (ra8_etha_tc_t tc)
 Range-check a traffic-class argument.
static bool internal_irq_block_ok (ra8_etha_irq_class_t block)
 Range-check an error-IRQ block index.
ra8_err_t ra8_etha_init (ra8_etha_port_t port, const ra8_etha_config_t *cfg)
 Initialise an ETHA port (MSTP gate + reset registers + initial mode).
ra8_err_t ra8_etha_deinit (ra8_etha_port_t port)
 Tear down an ETHA port (drop into RESET, mask all IRQs).
ra8_err_t ra8_etha_get_status (ra8_etha_port_t port, ra8_etha_status_t *out)
 Read a port's status snapshot (mode + 3x error IRQ status + TAS).
ra8_err_t ra8_etha_clear_status (ra8_etha_port_t port, ra8_etha_irq_class_t block, uint32_t mask)
 Clear bits in EAEIS0 / EAEIS1 / EAEIS2 via EAEIDx.
ra8_err_t ra8_etha_enable_irq (ra8_etha_port_t port, ra8_etha_irq_class_t block, uint32_t mask)
 Atomically enable specific error IRQ bits in one of the three blocks.
ra8_err_t ra8_etha_disable_irq (ra8_etha_port_t port, ra8_etha_irq_class_t block, uint32_t mask)
 Atomically disable specific error IRQ bits in one of the three blocks.
ra8_err_t ra8_etha_attach_handler (ra8_etha_port_t port, ra8_etha_event_fn_t cb, void *ctx)
 Attach a per-port event handler.
void ra8_etha_dispatch (ra8_etha_port_t port)
 Snapshot all three EAEISx, clear them, then fire the per-port handler.
ra8_err_t ra8_etha_enter_stop (ra8_etha_port_t port)
 Drop an ETHA port into low-power stop (DISABLE mode).
ra8_err_t ra8_etha_exit_stop (ra8_etha_port_t port)
 Bring an ETHA port back from low-power stop (OPERATION mode).
ra8_err_t ra8_etha_reset (ra8_etha_port_t port)
 Software-reset the port: drop to RESET, then re-enter CONFIG.
static ra8_err_t internal_etha_wait_for_mode (ra8_etha_port_t port, volatile r_etha_regs_t *reg, ra8_etha_opc_t mode)
 Busy-wait until EAMS.OPS catches up to the requested EAMC.OPC.
ra8_err_t ra8_etha_set_mode (ra8_etha_port_t port, ra8_etha_opc_t mode)
 Issue an explicit EAMC mode-change command.
ra8_err_t ra8_etha_set_queue_arb (ra8_etha_port_t port, ra8_etha_tc_t tc, uint8_t arb)
 Configure the per-traffic-class TX queue arbitration weight.
ra8_err_t ra8_etha_set_queue_depth (ra8_etha_port_t port, ra8_etha_tc_t tc, uint16_t depth)
 Set the TX descriptor queue depth for one traffic class.
ra8_err_t ra8_etha_get_queue_level (ra8_etha_port_t port, ra8_etha_tc_t tc, uint16_t *cur_level, uint16_t *peak)
 Read the current and high-water-mark queue level for one class.
ra8_err_t ra8_etha_set_preemption (ra8_etha_port_t port, uint8_t preempt, uint8_t cut_thru, ra8_etha_afs_t afs)
 Configure 802.3br TX preemption: which classes are pre-emptable.
ra8_err_t ra8_etha_set_max_frame_size (ra8_etha_port_t port, ra8_etha_tc_t tc, uint16_t max_bytes)
 Set the maximum frame size for one traffic class (jumbo OK).
ra8_err_t ra8_etha_set_ipv_remap (ra8_etha_port_t port, const uint8_t *map)
 Programme the IPV (PCP-to-internal-priority) remap table.
ra8_err_t ra8_etha_set_vlan_mode (ra8_etha_port_t port, ra8_etha_vim_t vim, ra8_etha_vem_t vem)
 Configure VLAN tag insertion / extraction for the port.
ra8_err_t ra8_etha_set_vlan_tag (ra8_etha_port_t port, const ra8_etha_vlan_tag_t *c_tag, const ra8_etha_vlan_tag_t *s_tag_in)
 Programme the C-VLAN and S-VLAN tag values used on TX insertion.
ra8_err_t ra8_etha_set_rx_tag_filter (ra8_etha_port_t port, uint32_t mask)
 Configure the RX tag filter (multicast group + VLAN-tag filter).
ra8_err_t ra8_etha_configure_cut_through (ra8_etha_port_t port, uint16_t qd, uint8_t dqd)
 Configure the cut-through TX queue (low-latency forwarding).
ra8_err_t ra8_etha_configure_cbs (ra8_etha_port_t port, ra8_etha_tc_t tc, uint8_t enable, const ra8_etha_cbs_param_t *param)
 Configure the credit-based shaper (CBS) for one traffic class.
ra8_err_t ra8_etha_get_cbs_state (ra8_etha_port_t port, ra8_etha_tc_t tc, uint8_t *enabled, uint8_t *gate_open, ra8_etha_cbs_param_t *oper_param)
 Read the operational CBS gate-state vector + per-class oper params.
ra8_err_t ra8_etha_read_stats (ra8_etha_port_t port, ra8_etha_stats_t *out)
 Read the per-port MIB error counters.
ra8_err_t ra8_etha_clear_stats (ra8_etha_port_t port)
 Clear the per-port MIB error counters in hardware.

Variables

static const char * s_tag = "ETHA"
 Logger tag used by every ra8_etha_* call.
volatile uint32_t g_ra8_etha_diag_last_eams [2] = {0U, 0U}
 Last EAMS.OPS value observed during the CONFIG-mode poll.
ra8_etha_slot_t s_etha_slots [k_ra8_etha_port_count]
 Per-port handler table; index = ra8_etha_port_t.

Detailed Description

Per-port Ethernet Agent (ETHA) driver implementation – HUM Ch 32.

Tag
[Ring 3 / HAL] {World: NS}

Round-3 driver for the RA8D2 ETHA block (HUM Ch 32, p 1627-1702). ETHA is the per-port "Ethernet Agent" that bridges the L3 switch fabric (ESWM, ra8_eth.c, HUM Ch 29) and the per-port MAC (RMAC, ra8_rmac.c, HUM Ch 33).

Pipeline: ESWM (top, switch) -> ETHA (per-port agent, this file) -> RMAC (per-port MAC) -> off-chip PHY (bottom).

The shared MSTP gate k_ra8_mstp_eswm is reference-counted by ra8_mstp, so init/deinit interleave safely with the other ethernet sub-drivers.

Coverage in this round:

  • All three error-IRQ blocks (EAEIS0/E/D0, EAEIS1/E/D1, EAEIS2/E/D2) plumbed through one central dispatch path;
  • Per-class TX queues (8 traffic classes, EATPEC/EATDQAC/EATDQDC/EATDQM);
  • 802.3br TX preemption (EATPEC.TTQ + AFS);
  • IPV remap table (EAIRC, 8 entries x 3 bits);
  • 802.1Q VLAN insertion (EAVCC.VIM + EAVTC C-/S-tags) and stripping (EAVCC.VEM modes);
  • RX tag filter (EARTFC) acting as the multicast-group filter;
  • Cut-through queue (EACTQC + EACTDQDC);
  • Credit-based shaper (CBS, EACAEC, EACC, EACAIVC[8], EACAULC[8], EACOEM, EACGSM mirrors);
  • Per-port full statistics (EAUSMFSECN, EATFECN, EAFSECN, EADQOECN, EADQSECN) with read + clear paths;
  • Software reset / lifecycle.

The time-aware shaper (TAS / 802.1Qbv) lives in ra8_etha_tas.c, which follows the manual's multi-step setting, learn and read flows.

Every register access carries a HUM Ch 32 citation naming the register it touches and the page that register is described on.

Definition in file ra8_etha.c.

Enumeration Type Documentation

◆ etha_field_t

enum etha_field_t : uint32_t

EAVCC field constants.

Enumerator
k_etha_vem_mask 

3-bit VLAN egress mode field.

Definition at line 89 of file ra8_etha.c.

◆ ra8_etha_local_mask_t

enum ra8_etha_local_mask_t : uint32_t

Local mask helpers used inside this driver.

Names the wide bit-clear / single-byte / 9-bit-field literal masks used by the ETHA driver. Keeps the source file free of bare magic numbers so clang-tidy is happy.

Enumerator
k_ra8_etha_local_all_bits_set 

W1C-all helper.

k_ra8_etha_local_byte_mask 

8-bit field mask.

k_ra8_etha_local_9bit_mask 

9-bit field mask.

Definition at line 102 of file ra8_etha.c.

Function Documentation

◆ internal_etha_wait_for_mode()

ra8_err_t internal_etha_wait_for_mode ( ra8_etha_port_t port,
volatile r_etha_regs_t * reg,
ra8_etha_opc_t mode )
static

Busy-wait until EAMS.OPS catches up to the requested EAMC.OPC.

HUM Ch 32.3.1.2 "EAMS : Mode Status Register" p 1631 – bench-confirmed that EAMS.OPS lags EAMC.OPC by milliseconds while the state machine settles, and the OPERATION -> DISABLE -> CONFIG sequence inside ra8_eth_open silently drops the CONFIG write if the DISABLE step has not yet landed. Poll EAMS on every transition so each EAMC write commits before the next one is issued. Updates g_ra8_etha_diag_last_eams[port] on each iteration as a bench debug seam; reads are bounded by a 500 ms ms-scale budget.

Parameters
[in]portPort whose ETHA state machine to wait on.
[in]regMMIO pointer to that port's ETHA register window.
[in]modeMode the caller just wrote into EAMC.OPC.
Returns
ra8_err_t Result code.
Return values
k_ra8_okEAMS.OPS reached the requested mode in budget.
k_ra8_err_hw_timeoutEAMS.OPS never caught up; chip is stuck.
Precondition
reg points at a valid ETHA register window.
Caller already wrote mode into reg->EAMC.
Postcondition
Either EAMS.OPS == mode or the chip is stuck.
g_ra8_etha_diag_last_eams[port & 1] reflects the last read.
Note
Not thread-safe.
Since
0.1.0

< Ms budget.

< Inner.

Definition at line 456 of file ra8_etha.c.

References r_etha_regs_t::EAMS, g_ra8_etha_diag_last_eams, k_ra8_err_hw_timeout, k_ra8_etha_mask_ops, k_ra8_etha_opc_config, k_ra8_etha_opc_disable, k_ra8_ok, ra8_log_error, and s_tag.

Referenced by ra8_etha_set_mode().

◆ internal_irq_block_ok()

bool internal_irq_block_ok ( ra8_etha_irq_class_t block)
inlinestatic

Range-check an error-IRQ block index.

Parameters
[in]blockBlock index to validate.
Returns
true if in 0..2.

See the matching header declaration for the full contract; this site adds no behaviour beyond what the public API documents.

Return values
k_ra8_okSuccess path.
k_ra8_err_invalid_argCaller violated a precondition.
Precondition
Driver state has been initialized by the matching *_init.
Caller has validated all pointer parameters.
Postcondition
Side effects are limited to those documented in the header.
No global state is modified on the error path.
Note
Thread safety: see the header declaration.
Since
0.1.0

Definition at line 162 of file ra8_etha.c.

References k_ra8_etha_irq_class_count.

Referenced by ra8_etha_clear_status(), ra8_etha_disable_irq(), and ra8_etha_enable_irq().

◆ internal_tc_ok()

bool internal_tc_ok ( ra8_etha_tc_t tc)
inlinestatic

Range-check a traffic-class argument.

Parameters
[in]tcTraffic class to validate.
Returns
true if tc is one of ra8_etha_tc_t.

See the matching header declaration for the full contract; this site adds no behaviour beyond what the public API documents.

Return values
k_ra8_okSuccess path.
k_ra8_err_invalid_argCaller violated a precondition.
Precondition
Driver state has been initialized by the matching *_init.
Caller has validated all pointer parameters.
Postcondition
Side effects are limited to those documented in the header.
No global state is modified on the error path.
Note
Thread safety: see the header declaration.
Since
0.1.0

Definition at line 138 of file ra8_etha.c.

References k_ra8_etha_tc_count.

Referenced by ra8_etha_configure_cbs(), ra8_etha_get_cbs_state(), ra8_etha_get_queue_level(), ra8_etha_set_max_frame_size(), ra8_etha_set_queue_arb(), and ra8_etha_set_queue_depth().

◆ ra8_etha_attach_handler()

ra8_err_t ra8_etha_attach_handler ( ra8_etha_port_t port,
ra8_etha_event_fn_t cb,
void * ctx )
nodiscard

Attach a per-port event handler.

Parameters
[in]portPort identifier.
[in]cbCallback to fire from::ra8_etha_dispatch (may be nullptr to detach).
[in]ctxOpaque cookie passed back to cb.
Returns
ra8_err_t Error code.
Return values
k_ra8_okHandler attached / detached.
k_ra8_err_invalid_argport out of range.
Precondition
Port previously brought up via ra8_etha_init.
Caller owns the lifetime of ctx.
Postcondition
Subsequent dispatches for this port invoke cb (or nothing if cb == nullptr).
Previous handler for this port is no longer reachable.
Note
Not thread-safe; install handlers during init / before IRQ unmask.
See also
ra8_etha_dispatch
Since
0.1.0

Definition at line 343 of file ra8_etha.c.

References internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_ok, ra8_log_error, s_etha_slots, and s_tag.

◆ ra8_etha_clear_stats()

ra8_err_t ra8_etha_clear_stats ( ra8_etha_port_t port)
nodiscard

Clear the per-port MIB error counters in hardware.

Parameters
[in]portPort identifier.
Returns
ra8_err_t Error code.
Return values
k_ra8_okAll five counters zeroed.
k_ra8_err_invalid_argport out of range.
Precondition
Port previously brought up via ra8_etha_init.
Caller has snapshotted via ra8_etha_read_stats first if deltas matter.
Postcondition
EAUSMFSECN = EATFECN = EAFSECN = EADQOECN = EADQSECN = 0.
No state outside the five counter registers is touched.
Note
Provided so applications can reset the MIB at any time.
See also
ra8_etha_read_stats
Since
0.1.0

Definition at line 767 of file ra8_etha.c.

References r_etha_regs_t::EADQOECN, r_etha_regs_t::EADQSECN, r_etha_regs_t::EAFSECN, r_etha_regs_t::EATFECN, r_etha_regs_t::EAUSMFSECN, internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_ok, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_clear_status()

ra8_err_t ra8_etha_clear_status ( ra8_etha_port_t port,
ra8_etha_irq_class_t block,
uint32_t mask )
nodiscard

Clear bits in EAEIS0 / EAEIS1 / EAEIS2 via EAEIDx.

Parameters
[in]portPort identifier.
[in]blockWhich error-interrupt block (0/1/2).
[in]maskBit mask to write to EAEIDx.
Returns
ra8_err_t Error code.
Return values
k_ra8_okBits cleared.
k_ra8_err_invalid_argport or block out of range.
Precondition
Port previously brought up via ra8_etha_init.
Caller has read the corresponding EAEISx via::ra8_etha_get_status.
Postcondition
Bits in mask are cleared in EAEISx.
EAEISx read-back excludes the cleared bits.
Note
IRQ-safe; the underlying write is atomic on Cortex-M85.
See also
ra8_etha_get_status
Since
0.1.0

Definition at line 255 of file ra8_etha.c.

References r_etha_regs_t::EAEID0, r_etha_regs_t::EAEID1, r_etha_regs_t::EAEID2, r_etha_regs_t::EAEIS0, r_etha_regs_t::EAEIS1, r_etha_regs_t::EAEIS2, internal_irq_block_ok(), internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_irq_class_0, k_ra8_etha_irq_class_1, k_ra8_etha_irq_class_2, k_ra8_etha_irq_class_count, k_ra8_ok, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_configure_cbs()

ra8_err_t ra8_etha_configure_cbs ( ra8_etha_port_t port,
ra8_etha_tc_t tc,
uint8_t enable,
const ra8_etha_cbs_param_t * param )
nodiscard

Configure the credit-based shaper (CBS) for one traffic class.

Parameters
[in]portPort identifier.
[in]tcTraffic class (0..7).
[in]enableNon-zero -> set EACAEC.CEtc and EACC.CCtc.
[in]paramPointer to CBS parameters (increment + upper-limit).
Returns
ra8_err_t Error code.
Return values
k_ra8_okCBS programmed.
k_ra8_err_null_ptrparam is nullptr (when enable != 0).
k_ra8_err_invalid_argport, tc, or values out of range.
Precondition
Port is in CONFIG mode.
param->increment fits in 20 bits, upper_lim in 31 bits.
Postcondition
EACAIVC[tc] = increment; EACAULC[tc] = upper_lim.
EACAEC.CEtc = enable!=0; EACC.CCtc = enable!=0.
Note
CBS is the AVB credit shaper (802.1Qav).
See also
ra8_etha_get_cbs_state
Since
0.1.0

Definition at line 680 of file ra8_etha.c.

References r_etha_regs_t::EACAEC, r_etha_regs_t::EACAIVC, r_etha_regs_t::EACAULC, r_etha_regs_t::EACC, ra8_etha_cbs_param_t::increment, internal_port_ok(), internal_tc_ok(), k_ra8_err_invalid_arg, k_ra8_etha_mask_civ, k_ra8_etha_mask_cul, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_etha(), ra8_log_error, s_tag, and ra8_etha_cbs_param_t::upper_lim.

Referenced by tsn_program_cbs().

◆ ra8_etha_configure_cut_through()

ra8_err_t ra8_etha_configure_cut_through ( ra8_etha_port_t port,
uint16_t qd,
uint8_t dqd )
nodiscard

Configure the cut-through TX queue (low-latency forwarding).

Parameters
[in]portPort identifier.
[in]qd16-bit cut-through queue depth in bytes (CTQD).
[in]dqd4-bit cut-through descriptor queue depth (CTDQD).
Returns
ra8_err_t Error code.
Return values
k_ra8_okEACTQC + EACTDQDC updated.
k_ra8_err_invalid_argport out of range.
Precondition
Port is in CONFIG mode.
dqd <= 15.
Postcondition
EACTQC.CTQD = qd; EACTDQDC.CTDQD = dqd.
Cut-through path may begin forwarding short frames sooner.
Note
CTDQD = 0 effectively disables the cut-through path.
Since
0.1.0

Definition at line 666 of file ra8_etha.c.

References r_etha_regs_t::EACTDQDC, r_etha_regs_t::EACTQC, internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_mask_ctdqd, k_ra8_etha_mask_ctqd, k_ra8_ok, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_deinit()

ra8_err_t ra8_etha_deinit ( ra8_etha_port_t port)
nodiscard

Tear down an ETHA port (drop into RESET, mask all IRQs).

Parameters
[in]portPort identifier.
Returns
ra8_err_t Error code.
Return values
k_ra8_okPort returned to RESET mode.
k_ra8_err_invalid_argport out of range.
Precondition
Port previously brought up via ra8_etha_init.
No outstanding DMA on this port.
Postcondition
EAMC =k_ra8_etha_opc_reset.
EAEIE0 = EAEIE1 = EAEIE2 = 0.
Note
See ra8_eth_deinit for the shared MSTP gate.
See also
ra8_etha_init
Since
0.1.0

Definition at line 203 of file ra8_etha.c.

References r_etha_regs_t::EAEIE0, r_etha_regs_t::EAEIE1, r_etha_regs_t::EAEIE2, r_etha_regs_t::EAMC, internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_opc_reset, k_ra8_ok, ra8_etha(), ra8_log_error, s_etha_slots, and s_tag.

Referenced by main().

◆ ra8_etha_disable_irq()

ra8_err_t ra8_etha_disable_irq ( ra8_etha_port_t port,
ra8_etha_irq_class_t block,
uint32_t mask )
nodiscard

Atomically disable specific error IRQ bits in one of the three blocks.

Parameters
[in]portPort identifier.
[in]blockWhich IRQ block.
[in]maskBits to OR into the corresponding EAEIDx.
Returns
ra8_err_t Error code.
Return values
k_ra8_okIRQ bits disabled.
k_ra8_err_invalid_argport or block out of range.
Precondition
Port previously brought up via ra8_etha_init.
IRQ at the NVIC is masked or this caller can tolerate a missed event.
Postcondition
Bits in mask are cleared in EAEIEx.
Other bits in EAEIEx are unchanged.
Note
Hardware uses a separate "clear" register so this is atomic.
See also
ra8_etha_enable_irq
Since
0.1.0

Definition at line 316 of file ra8_etha.c.

References r_etha_regs_t::EAEIE0, r_etha_regs_t::EAEIE1, r_etha_regs_t::EAEIE2, internal_irq_block_ok(), internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_irq_class_0, k_ra8_etha_irq_class_1, k_ra8_etha_irq_class_2, k_ra8_etha_irq_class_count, k_ra8_ok, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_dispatch()

void ra8_etha_dispatch ( ra8_etha_port_t port)

Snapshot all three EAEISx, clear them, then fire the per-port handler.

Reads the three Ethernet-A error/event status registers EAEIS0/1/2 (HUM Ch 32 "ETHA error / event status registers EAEISn", p ~1408) for the given port, atomically writes back the captured bits to acknowledge them, then invokes the handler installed via ra8_etha_attach_handler() with the snapshot mask. Out-of-range ports and missing handlers are silently ignored.

Parameters
[in]portPort identifier. Out-of-range silently ignored.
Precondition
Port previously brought up via ra8_etha_init for the call to do work.
Caller has masked the ETHA IRQ at the NVIC if reentrancy is undesirable.
Postcondition
All three EAEISx are cleared (matching what was passed to the handler).
Per-port callback (if any) has been invoked exactly once.
Note
IRQ-context safe; performs no allocation, no locks.
See also
ra8_etha_attach_handler
Since
0.1.0

Definition at line 355 of file ra8_etha.c.

References r_etha_regs_t::EAEID0, r_etha_regs_t::EAEID1, r_etha_regs_t::EAEID2, r_etha_regs_t::EAEIS0, r_etha_regs_t::EAEIS1, r_etha_regs_t::EAEIS2, internal_port_ok(), ra8_etha(), and s_etha_slots.

◆ ra8_etha_enable_irq()

ra8_err_t ra8_etha_enable_irq ( ra8_etha_port_t port,
ra8_etha_irq_class_t block,
uint32_t mask )
nodiscard

Atomically enable specific error IRQ bits in one of the three blocks.

Parameters
[in]portPort identifier.
[in]blockWhich IRQ block.
[in]maskBits to OR into the corresponding EAEIEx.
Returns
ra8_err_t Error code.
Return values
k_ra8_okIRQ bits enabled.
k_ra8_err_invalid_argport or block out of range.
Precondition
Port previously brought up via ra8_etha_init.
IRQ at the NVIC is disabled while this is called if reentrancy is undesirable.
Postcondition
Bits in mask are set in EAEIEx.
Other bits in EAEIEx are unchanged.
Note
Hardware uses a separate "set" register so this is atomic.
See also
ra8_etha_disable_irq
Since
0.1.0

Definition at line 289 of file ra8_etha.c.

References r_etha_regs_t::EAEIE0, r_etha_regs_t::EAEIE1, r_etha_regs_t::EAEIE2, internal_irq_block_ok(), internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_irq_class_0, k_ra8_etha_irq_class_1, k_ra8_etha_irq_class_2, k_ra8_etha_irq_class_count, k_ra8_ok, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_enter_stop()

ra8_err_t ra8_etha_enter_stop ( ra8_etha_port_t port)
nodiscard

Drop an ETHA port into low-power stop (DISABLE mode).

Parameters
[in]portPort identifier.
Returns
ra8_err_t Error code.
Return values
k_ra8_okPort placed in DISABLE mode.
k_ra8_err_invalid_argport out of range.
Precondition
Port previously brought up via ra8_etha_init.
No outstanding DMA on this port.
Postcondition
EAMC =k_ra8_etha_opc_disable.
Subsequent get_status reports OPS =k_ra8_etha_ops_disable (assuming hardware ack is observed).
Note
The shared ESWM MSTP gate is NOT dropped here.
See also
ra8_etha_exit_stop
Since
0.1.0

Definition at line 390 of file ra8_etha.c.

References r_etha_regs_t::EAMC, internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_opc_disable, k_ra8_ok, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_exit_stop()

ra8_err_t ra8_etha_exit_stop ( ra8_etha_port_t port)
nodiscard

Bring an ETHA port back from low-power stop (OPERATION mode).

Parameters
[in]portPort identifier.
Returns
ra8_err_t Error code.
Return values
k_ra8_okPort returned to OPERATION mode.
k_ra8_err_invalid_argport out of range.
Precondition
Port previously placed in stop via ra8_etha_enter_stop.
Ethernet subsystem MSTP gate is live (ra8_eth_init was called).
Postcondition
EAMC =k_ra8_etha_opc_operation.
Subsequent get_status reports OPS =k_ra8_etha_ops_operation once the hardware ack is observed.
See also
ra8_etha_enter_stop
Since
0.1.0

Definition at line 401 of file ra8_etha.c.

References r_etha_regs_t::EAMC, internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_opc_operation, k_ra8_ok, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_get_cbs_state()

ra8_err_t ra8_etha_get_cbs_state ( ra8_etha_port_t port,
ra8_etha_tc_t tc,
uint8_t * enabled,
uint8_t * gate_open,
ra8_etha_cbs_param_t * oper_param )
nodiscard

Read the operational CBS gate-state vector + per-class oper params.

Parameters
[in]portPort identifier.
[in]tcTraffic class (0..7).
[out]enabledNon-zero if oper-enable mirror bit is set.
[out]gate_openNon-zero if EACGSM gate-state bit is asserted.
[out]oper_paramLive oper-side increment + upper-limit values.
Returns
ra8_err_t Error code.
Return values
k_ra8_okSnapshot returned.
k_ra8_err_null_ptrany out pointer is nullptr.
k_ra8_err_invalid_argport or tc out of range.
Precondition
Port previously brought up via ra8_etha_init.
All output pointers are writable.
Postcondition
*enabled reflects EACOEM.CEtc.
*gate_open reflects EACGSM.CGStc.
Note
The oper-side mirror lags the admin-side until next CBS update.
See also
ra8_etha_configure_cbs
Since
0.1.0

Definition at line 718 of file ra8_etha.c.

References r_etha_regs_t::EACGSM, r_etha_regs_t::EACOEM, r_etha_regs_t::EACOIVM, r_etha_regs_t::EACOULM, ra8_etha_cbs_param_t::increment, internal_port_ok(), internal_tc_ok(), k_ra8_err_invalid_arg, k_ra8_etha_mask_civ, k_ra8_etha_mask_cul, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_etha(), ra8_log_error, s_tag, and ra8_etha_cbs_param_t::upper_lim.

Referenced by tsn_program_cbs().

◆ ra8_etha_get_queue_level()

ra8_err_t ra8_etha_get_queue_level ( ra8_etha_port_t port,
ra8_etha_tc_t tc,
uint16_t * cur_level,
uint16_t * peak )
nodiscard

Read the current and high-water-mark queue level for one class.

Parameters
[in]portPort identifier.
[in]tcTraffic class (0..7).
[out]cur_levelCurrent pending-descriptor count (DNQ).
[out]peakPeak pending-descriptor count since last clear (DMLQ).
Returns
ra8_err_t Error code.
Return values
k_ra8_okSnapshot returned.
k_ra8_err_null_ptrcur_level or peak is nullptr.
k_ra8_err_invalid_argport or tc out of range.
Precondition
Port previously brought up via ra8_etha_init.
cur_level and peak are writable pointers.
Postcondition
*cur_level = EATDQM[tc].DNQ.
*peak = EATDQMLM[tc].DMLQ.
Note
Read-only; does not clear the high-water mark.
See also
ra8_etha_set_queue_depth
Since
0.1.0

Definition at line 534 of file ra8_etha.c.

References r_etha_regs_t::EATDQM, r_etha_regs_t::EATDQMLM, internal_port_ok(), internal_tc_ok(), k_ra8_err_invalid_arg, k_ra8_etha_mask_dnq, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_get_status()

ra8_err_t ra8_etha_get_status ( ra8_etha_port_t port,
ra8_etha_status_t * out )
nodiscard

Read a port's status snapshot (mode + 3x error IRQ status + TAS).

Parameters
[in]portPort identifier.
[out]outDestination for the status snapshot.
Returns
ra8_err_t Error code.
Return values
k_ra8_okSnapshot populated.
k_ra8_err_null_ptrout is nullptr.
k_ra8_err_invalid_argport out of range.
Precondition
Port has been brought up via ra8_etha_init.
out is a writable pointer.
Postcondition
out fields reflect the live registers at the call site.
No register state is mutated.
Note
Reads are non-destructive; status bits are cleared via ra8_etha_clear_status.
See also
ra8_etha_clear_status
Since
0.1.0

Definition at line 228 of file ra8_etha.c.

References r_etha_regs_t::EAEIS0, ra8_etha_status_t::eaeis0, r_etha_regs_t::EAEIS1, ra8_etha_status_t::eaeis1, r_etha_regs_t::EAEIS2, ra8_etha_status_t::eaeis2, r_etha_regs_t::EAMS, r_etha_regs_t::EATASCTM, internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_mask_ops, k_ra8_ok, ra8_etha_status_t::ops, RA8_CHECK_NULL_PTR, ra8_etha(), ra8_log_error, s_tag, and ra8_etha_status_t::tas_cycle.

Referenced by tsn_log_status().

◆ ra8_etha_init()

ra8_err_t ra8_etha_init ( ra8_etha_port_t port,
const ra8_etha_config_t * cfg )
nodiscard

Initialise an ETHA port (MSTP gate + reset registers + initial mode).

Parameters
[in]portPort identifier (k_ra8_etha_port_0 or _1).
[in]cfgPer-port configuration. Must not be nullptr.
Returns
ra8_err_t Error code.
Return values
k_ra8_okPort brought up in the requested mode.
k_ra8_err_null_ptrcfg is nullptr.
k_ra8_err_invalid_argport out of range.
Precondition
Caller is single-threaded with respect to this port.
Ethernet subsystem MSTP gate may already be enabled by ra8_eth.
Postcondition
EAMC is loaded with cfg->initial_mode.
EAEIE0/1/2 are loaded with cfg->eaeie0/1/2_mask.
Note
Per-port; safe to call concurrently for distinct ports.
See also
ra8_etha_deinit
Since
0.1.0

Definition at line 167 of file ra8_etha.c.

References r_etha_regs_t::EAEID0, r_etha_regs_t::EAEID1, r_etha_regs_t::EAEID2, r_etha_regs_t::EAEIE0, ra8_etha_config_t::eaeie0_mask, r_etha_regs_t::EAEIE1, ra8_etha_config_t::eaeie1_mask, r_etha_regs_t::EAEIE2, ra8_etha_config_t::eaeie2_mask, r_etha_regs_t::EAMC, ra8_etha_config_t::initial_mode, internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_local_all_bits_set, k_ra8_etha_mask_opc, k_ra8_mstp_eswm, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_etha(), ra8_log_error, ra8_log_info, ra8_mstp_enable(), RA8_RETURN_ON_ERROR, s_etha_slots, and s_tag.

Referenced by internal_eth_loopback_run_once(), priv_ra8_board_eth_etha_to_config(), and tsn_arm().

◆ ra8_etha_read_stats()

ra8_err_t ra8_etha_read_stats ( ra8_etha_port_t port,
ra8_etha_stats_t * out )
nodiscard

Read the per-port MIB error counters.

Parameters
[in]portPort identifier.
[out]outSnapshot of all five counter registers.
Returns
ra8_err_t Error code.
Return values
k_ra8_okSnapshot returned.
k_ra8_err_null_ptrout is nullptr.
k_ra8_err_invalid_argport out of range.
Precondition
Port previously brought up via ra8_etha_init.
out is a writable pointer.
Postcondition
out is populated with the live counter values.
Counters in hardware are NOT cleared; use ra8_etha_clear_stats.
Note
Each counter is 16 bits and saturates rather than wrapping.
See also
ra8_etha_clear_stats
Since
0.1.0

Definition at line 745 of file ra8_etha.c.

References r_etha_regs_t::EADQOECN, r_etha_regs_t::EADQSECN, r_etha_regs_t::EAFSECN, r_etha_regs_t::EATFECN, r_etha_regs_t::EAUSMFSECN, ra8_etha_stats_t::frame_size_err, internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_mask_mfs, k_ra8_ok, ra8_etha_stats_t::queue_overflow_err, ra8_etha_stats_t::queue_security_err, RA8_CHECK_NULL_PTR, ra8_etha(), ra8_log_error, s_tag, ra8_etha_stats_t::switch_min_frame_err, and ra8_etha_stats_t::tag_filter_err.

◆ ra8_etha_reset()

ra8_err_t ra8_etha_reset ( ra8_etha_port_t port)
nodiscard

Software-reset the port: drop to RESET, then re-enter CONFIG.

Parameters
[in]portPort identifier.
Returns
ra8_err_t Error code.
Return values
k_ra8_okReset sequence issued.
k_ra8_err_invalid_argport out of range.
Precondition
Port previously brought up via ra8_etha_init.
Caller is prepared to re-program per-class state after the reset.
Postcondition
EAMC traversed RESET -> CONFIG.
All transient queue / counter state is cleared by hardware.
Note
Used by error-recovery callers; does not touch the MSTP gate.
See also
ra8_etha_set_mode
Since
0.1.0

Definition at line 412 of file ra8_etha.c.

References r_etha_regs_t::EAMC, internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_opc_config, k_ra8_etha_opc_reset, k_ra8_ok, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_set_ipv_remap()

ra8_err_t ra8_etha_set_ipv_remap ( ra8_etha_port_t port,
const uint8_t * map )
nodiscard

Programme the IPV (PCP-to-internal-priority) remap table.

Parameters
[in]portPort identifier.
[in]map8-entry array, each value 0..7. ipv_map[i] is the internal priority for incoming PCP=i.
Returns
ra8_err_t Error code.
Return values
k_ra8_okEAIRC packed and written.
k_ra8_err_null_ptrmap is nullptr.
k_ra8_err_invalid_argport out of range or any map[i] > 7.
Precondition
Port is in CONFIG mode.
map points to 8 valid entries.
Postcondition
EAIRC packs eight 3-bit fields, IPVR0..IPVR7, from map[].
Out-of-range values are rejected without partial writes.
Note
Used to map 802.1p PCP -> RA8D2 internal traffic class.
See also
ra8_etha_set_queue_arb
Since
0.1.0

Definition at line 583 of file ra8_etha.c.

References r_etha_regs_t::EAIRC, internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_mask_ipv, k_ra8_etha_tc_count, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_set_max_frame_size()

ra8_err_t ra8_etha_set_max_frame_size ( ra8_etha_port_t port,
ra8_etha_tc_t tc,
uint16_t max_bytes )
nodiscard

Set the maximum frame size for one traffic class (jumbo OK).

Parameters
[in]portPort identifier.
[in]tcTraffic class (0..7).
[in]max_bytesFrame size limit in bytes (16-bit, 64..16383 typical).
Returns
ra8_err_t Error code.
Return values
k_ra8_okEATMFSC[tc] updated.
k_ra8_err_invalid_argport or tc out of range.
Precondition
Port is in CONFIG mode.
max_bytes >= 64 to satisfy IEEE 802.3 minimum.
Postcondition
EATMFSC[tc].MFS = max_bytes.
Frames larger than max_bytes are counted in EAFSECN.
Note
Jumbo frames (>1500) supported up to a 16-bit limit.
See also
ra8_etha_read_stats
Since
0.1.0

Definition at line 572 of file ra8_etha.c.

References r_etha_regs_t::EATMFSC, internal_port_ok(), internal_tc_ok(), k_ra8_err_invalid_arg, k_ra8_etha_mask_mfs, k_ra8_ok, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_set_mode()

ra8_err_t ra8_etha_set_mode ( ra8_etha_port_t port,
ra8_etha_opc_t mode )
nodiscard

Issue an explicit EAMC mode-change command.

Parameters
[in]portPort identifier.
[in]modeTarget mode (one of::ra8_etha_opc_t).
Returns
ra8_err_t Error code.
Return values
k_ra8_okCommand written.
k_ra8_err_invalid_argport out of range.
Precondition
Port previously brought up via ra8_etha_init.
mode is a legal transition from the current state per HUM Ch 32.2.
Postcondition
EAMC = mode.
Caller must poll get_status until OPS == ops-of-mode for ack.
Note
State machine: RESET -> CONFIG -> OPERATION; OPERATION -> DISABLE.
State Machine
See also
ra8_etha_get_status
Since
0.1.0

Definition at line 494 of file ra8_etha.c.

References r_etha_regs_t::EAMC, internal_etha_wait_for_mode(), internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_mask_opc, ra8_etha(), ra8_log_error, and s_tag.

Referenced by internal_bring_up_rmac(), internal_eth_etha_to_operation(), internal_eth_loopback_run_once(), internal_program_mpic(), and priv_ra8_board_eth_etha_to_config().

◆ ra8_etha_set_preemption()

ra8_err_t ra8_etha_set_preemption ( ra8_etha_port_t port,
uint8_t preempt,
uint8_t cut_thru,
ra8_etha_afs_t afs )
nodiscard

Configure 802.3br TX preemption: which classes are pre-emptable.

Parameters
[in]portPort identifier.
[in]preemptBit-mask of pre-emptable classes (bit q -> class q).
[in]cut_thruNon-zero -> set TTQ8 (cut-through path is pre-emptable).
[in]afsAdditional fragment size policy (ra8_etha_afs_t).
Returns
ra8_err_t Error code.
Return values
k_ra8_okEATPEC updated.
k_ra8_err_invalid_argport out of range.
Precondition
Port is in CONFIG mode.
afs is a valid::ra8_etha_afs_t.
Postcondition
EATPEC.TTQ7..TTQ0 = preempt&0xFF; TTQ8 = cut_thru!=0; AFS = afs.
802.3br express/preemptable selector is live for next frame.
Note
802.3br requires both ends to support preamble preemption.
See also
ra8_etha_set_max_frame_size
Since
0.1.0

Definition at line 555 of file ra8_etha.c.

References r_etha_regs_t::EATPEC, internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_eatpec_afs_pos, k_ra8_etha_local_byte_mask, k_ra8_ok, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_set_queue_arb()

ra8_err_t ra8_etha_set_queue_arb ( ra8_etha_port_t port,
ra8_etha_tc_t tc,
uint8_t arb )
nodiscard

Configure the per-traffic-class TX queue arbitration weight.

Parameters
[in]portPort identifier.
[in]tcTraffic class (0..7).
[in]arbArbitration weight (4-bit field, 0=lowest, 15=highest).
Returns
ra8_err_t Error code.
Return values
k_ra8_okField updated.
k_ra8_err_invalid_argport, tc, or arb out of range.
Precondition
Port is in CONFIG mode (ra8_etha_set_mode k_ra8_etha_opc_config).
arb fits in 4 bits.
Postcondition
EATDQAC.TDQAtc = arb.
Other class weights are unchanged.
Note
Only takes effect after a transition back to OPERATION.
See also
ra8_etha_set_queue_depth
Since
0.1.0

Definition at line 506 of file ra8_etha.c.

References r_etha_regs_t::EATDQAC, internal_port_ok(), internal_tc_ok(), k_ra8_err_invalid_arg, k_ra8_etha_mask_tdqa, k_ra8_ok, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_set_queue_depth()

ra8_err_t ra8_etha_set_queue_depth ( ra8_etha_port_t port,
ra8_etha_tc_t tc,
uint16_t depth )
nodiscard

Set the TX descriptor queue depth for one traffic class.

Parameters
[in]portPort identifier.
[in]tcTraffic class (0..7).
[in]depthQueue depth in descriptors (11-bit field, 1..2047).
Returns
ra8_err_t Error code.
Return values
k_ra8_okEATDQDC[tc] updated.
k_ra8_err_invalid_argport, tc, or depth out of range.
Precondition
Port is in CONFIG mode.
depth <= 2047.
Postcondition
EATDQDC[tc].DQD = depth.
Other classes unchanged.
Note
Backs the per-traffic-class descriptor ring.
See also
ra8_etha_get_queue_level
Since
0.1.0

Definition at line 523 of file ra8_etha.c.

References r_etha_regs_t::EATDQDC, internal_port_ok(), internal_tc_ok(), k_ra8_err_invalid_arg, k_ra8_etha_mask_dqd, k_ra8_ok, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_set_rx_tag_filter()

ra8_err_t ra8_etha_set_rx_tag_filter ( ra8_etha_port_t port,
uint32_t mask )
nodiscard

Configure the RX tag filter (multicast group + VLAN-tag filter).

Parameters
[in]portPort identifier.
[in]maskBit mask written verbatim to EARTFC. Bit positions follow HUM Ch 32 EARTFC: NT, RT, CST, CSRT, CT, CRT, SCT, SCRT, UT.
Returns
ra8_err_t Error code.
Return values
k_ra8_okEARTFC = mask.
k_ra8_err_invalid_argport out of range.
Precondition
Port is in CONFIG mode.
Caller has used the EARTFC bit names (NT/RT/CST/...) when building mask.
Postcondition
EARTFC = mask & 0x1FF.
Frames matching the active filter survive; others are dropped.
Note
This is the multicast group filter for tagged traffic.
Since
0.1.0

Definition at line 655 of file ra8_etha.c.

References r_etha_regs_t::EARTFC, internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_local_9bit_mask, k_ra8_ok, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_set_vlan_mode()

ra8_err_t ra8_etha_set_vlan_mode ( ra8_etha_port_t port,
ra8_etha_vim_t vim,
ra8_etha_vem_t vem )
nodiscard

Configure VLAN tag insertion / extraction for the port.

Parameters
[in]portPort identifier.
[in]vimInsertion mode (ra8_etha_vim_t).
[in]vemExtraction mode (ra8_etha_vem_t).
Returns
ra8_err_t Error code.
Return values
k_ra8_okEAVCC updated.
k_ra8_err_invalid_argport out of range.
Precondition
Port is in CONFIG mode.
vem fits in 3 bits.
Postcondition
EAVCC.VIM = vim and EAVCC.VEM = vem.
Subsequent TX frames are tagged or stripped per the new mode.
Note
Tag values to insert come from::ra8_etha_set_vlan_tag.
See also
ra8_etha_set_vlan_tag
Since
0.1.0

Definition at line 609 of file ra8_etha.c.

References r_etha_regs_t::EAVCC, internal_port_ok(), k_etha_vem_mask, k_ra8_err_invalid_arg, k_ra8_etha_eavcc_vem_pos, k_ra8_ok, ra8_etha(), ra8_log_error, and s_tag.

◆ ra8_etha_set_vlan_tag()

ra8_err_t ra8_etha_set_vlan_tag ( ra8_etha_port_t port,
const ra8_etha_vlan_tag_t * c_tag,
const ra8_etha_vlan_tag_t * s_tag_in )
nodiscard

Programme the C-VLAN and S-VLAN tag values used on TX insertion.

Parameters
[in]portPort identifier.
[in]c_tagC-VLAN tag (inner). Pointer to descriptor.
[in]s_tag_inS-VLAN tag (outer). Pointer to descriptor.
Returns
ra8_err_t Error code.
Return values
k_ra8_okEAVTC packed and written.
k_ra8_err_null_ptrc_tag or s_tag is nullptr.
k_ra8_err_invalid_argport out of range or vid/pcp out of range.
Precondition
Port is in CONFIG mode.
c_tag->vid <= 0xFFF and c_tag->pcp <= 7 (same for s_tag).
Postcondition
EAVTC has both tags packed: CTV/CTP/CTD then STV/STP/STD.
No partial write on validation failure.
Note
Only effective when EAVCC.VIM =k_ra8_etha_vim_enabled.
See also
ra8_etha_set_vlan_mode
Since
0.1.0

Definition at line 623 of file ra8_etha.c.

References ra8_etha_vlan_tag_t::dei, r_etha_regs_t::EAVTC, internal_port_ok(), k_ra8_err_invalid_arg, k_ra8_etha_eavtc_ctd_pos, k_ra8_etha_eavtc_ctp_pos, k_ra8_etha_eavtc_ctv_pos, k_ra8_etha_eavtc_std_pos, k_ra8_etha_eavtc_stp_pos, k_ra8_etha_eavtc_stv_pos, k_ra8_etha_mask_vlan_dei, k_ra8_etha_mask_vlan_pcp, k_ra8_etha_mask_vlan_vid, k_ra8_ok, ra8_etha_vlan_tag_t::pcp, RA8_CHECK_NULL_PTR, ra8_etha(), ra8_log_error, s_tag, and ra8_etha_vlan_tag_t::vid.

Variable Documentation

◆ g_ra8_etha_diag_last_eams

volatile uint32_t g_ra8_etha_diag_last_eams[2] = {0U, 0U}

Last EAMS.OPS value observed during the CONFIG-mode poll.

Bench-only debug seam. Indexed by ETHA port (0 / 1). Read via JLink memprobe to confirm what state the chip's ETHA state machine actually reaches when ra8_etha_set_mode polls for CONFIG.

Note
Not part of the public ABI – bench/debug only.
Warning
Not safe to mutate outside the ETHA driver path.
Since
0.1.0

Definition at line 86 of file ra8_etha.c.

Referenced by internal_etha_wait_for_mode().

◆ s_etha_slots

Per-port handler table; index = ra8_etha_port_t.

Defined here and shared with the statistics TU (ra8_etha_stats.c) via the extern declaration in ra8_etha_internal.h.

Warning
Not safe to mutate outside the ETHA driver path.
Since
0.1.0

Backing store for the per-port callback, cookie, and counter state. Defined once in ra8_etha.c and referenced from the split-out statistics TU via this declaration.

Warning
Not safe to mutate outside the ETHA driver path.
Since
0.1.0

Definition at line 117 of file ra8_etha.c.

Referenced by ra8_etha_account_traffic(), ra8_etha_attach_handler(), ra8_etha_deinit(), ra8_etha_descriptor_ring_init(), ra8_etha_dispatch(), ra8_etha_get_stats(), and ra8_etha_init().

◆ s_tag

const char* s_tag = "ETHA"
static

Logger tag used by every ra8_etha_* call.

TU-local read-only logger tag. The statistics TU (ra8_etha_stats.c) keeps its own identical copy; the string is immutable so duplicating it avoids cross-TU external linkage.

Note
Read-only after init; treat as immutable.
Since
0.1.0

Definition at line 72 of file ra8_etha.c.