ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_etha_shaper.h
Go to the documentation of this file.
1
25
26#pragma once
27
28#include <stdint.h>
29
30#include "ra8_err.h"
31#include "ra8_etha_regs.h"
32#include "ra8_etha_types.h"
33#include "ra8_rmac.h"
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
59[[nodiscard]] ra8_err_t
61
84 const ra8_etha_vlan_tag_t* c_tag,
85 const ra8_etha_vlan_tag_t* s_tag_in);
86
107[[nodiscard]] ra8_err_t ra8_etha_set_rx_tag_filter(ra8_etha_port_t port, uint32_t mask);
108
128[[nodiscard]] ra8_err_t
129ra8_etha_configure_cut_through(ra8_etha_port_t port, uint16_t qd, uint8_t dqd);
130
154 ra8_etha_tc_t tc,
155 uint8_t enable,
156 const ra8_etha_cbs_param_t* param);
157
182 ra8_etha_tc_t tc,
183 uint8_t* enabled,
184 uint8_t* gate_open,
185 ra8_etha_cbs_param_t* oper_param);
186
284 const ra8_etha_tas_queue_t* queues,
285 uint8_t initial_gate_states,
286 uint32_t cycle_time_ns,
287 uint64_t start_time);
288
316
349[[nodiscard]] ra8_err_t
351
371[[nodiscard]] ra8_err_t ra8_etha_enable_tas(ra8_etha_port_t port, uint8_t enable);
372
394
414
437 uint16_t num_tx,
438 uint16_t num_rx,
439 uint16_t buffer_size);
440
460[[nodiscard]] ra8_err_t ra8_etha_get_stats(ra8_etha_port_t channel,
461 ra8_etha_port_stats_t* out_stats);
462
486 uint32_t tx_ok,
487 uint32_t tx_err,
488 uint32_t rx_ok,
489 uint32_t rx_err,
490 uint32_t rx_drop);
491
524[[nodiscard]] ra8_err_t ra8_etha_open(ra8_etha_port_t channel,
525 const ra8_etha_phy_open_t* phy,
526 ra8_rmac_phy_link_t* out_link);
527
528#ifdef __cplusplus
529}
530#endif
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Ethernet Agent (ETHA) per-port register layout for the RA8D2.
ra8_etha_port_t
ETHA port index (m = 0, 1).
ra8_etha_tc_t
Traffic-class index (q = 0..7) used by every per-class array.
ra8_etha_vim_t
EAVCC.VIM VLAN insertion mode for TX.
ra8_etha_vem_t
EAVCC.VEM[2:0] VLAN extraction mode.
ra8_err_t ra8_etha_read_stats(ra8_etha_port_t port, ra8_etha_stats_t *out)
Read the per-port MIB error counters.
Definition ra8_etha.c:745
ra8_err_t ra8_etha_account_traffic(ra8_etha_port_t channel, uint32_t tx_ok, uint32_t tx_err, uint32_t rx_ok, uint32_t rx_err, uint32_t rx_drop)
Increment the per-port TX OK / TX err / RX OK / RX err / drop counters.
ra8_err_t ra8_etha_clear_stats(ra8_etha_port_t port)
Clear the per-port MIB error counters in hardware.
Definition ra8_etha.c:767
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.
Definition ra8_etha.c:609
ra8_err_t ra8_etha_enable_tas(ra8_etha_port_t port, uint8_t enable)
Enable or disable the TAS scheduler (main switch).
ra8_err_t ra8_etha_open(ra8_etha_port_t channel, const ra8_etha_phy_open_t *phy, ra8_rmac_phy_link_t *out_link)
Bring an ETHA port + its off-chip PHY up to OPERATION mode.
ra8_err_t ra8_etha_tas_ram_reset(ra8_etha_port_t port)
Reset the TAS RAM and wait for it to report ready.
ra8_err_t ra8_etha_descriptor_ring_init(ra8_etha_port_t channel, uint16_t num_tx, uint16_t num_rx, uint16_t buffer_size)
Configure the per-port descriptor-ring sizing.
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).
Definition ra8_etha.c:655
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).
Definition ra8_etha.c:666
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.
Definition ra8_etha.c:680
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.
Definition ra8_etha.c:718
ra8_err_t ra8_etha_set_tas_schedule(ra8_etha_port_t port, const ra8_etha_tas_queue_t *queues, uint8_t initial_gate_states, uint32_t cycle_time_ns, uint64_t start_time)
Programme the time-aware shaper (TAS / 802.1Qbv) gate lists.
ra8_err_t ra8_etha_read_tas_entry(ra8_etha_port_t port, uint8_t address, ra8_etha_tas_entry_t *out)
Read one TAS RAM entry back out of hardware.
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.
Definition ra8_etha.c:623
ra8_err_t ra8_etha_get_stats(ra8_etha_port_t channel, ra8_etha_port_stats_t *out_stats)
Snapshot the per-port software-maintained traffic counters.
Per-port Ethernet Agent (ETHA) data types – HUM Ch 32 (p 1627-1702).
Per-port Ethernet MAC (RMAC) driver – HUM Ch 33.
Credit-based shaper parameters per traffic class.
PHY auto-negotiation parameters for ra8_etha_open.
Per-port runtime traffic counters maintained by ra8_etha.
Per-port MIB counter snapshot.
One TAS (802.1Qbv) RAM entry, exactly as HUM Table 32.6 defines it.
The gate-control list of one descriptor queue.
802.1Q VLAN tag descriptor (used by::ra8_etha_set_vlan_tag).