|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Layer-3 Ethernet switch driver – placeholder implementation. More...
#include "ra8_layer3_switch.h"#include <stdint.h>#include "ra8_check.h"#include "ra8_err.h"#include "ra8_log.h"Go to the source code of this file.
Data Structures | |
| struct | ra8_layer3_switch_state_t |
Functions | |
| ra8_err_t | ra8_layer3_switch_open (const ra8_layer3_switch_cfg_t *cfg) |
| Open the Layer-3 switch driver. | |
| ra8_err_t | ra8_layer3_switch_route_add (const ra8_layer3_switch_route_t *route) |
| Add a route to the forwarding table. | |
| ra8_err_t | ra8_layer3_switch_route_delete (uint32_t dst_ip, uint32_t mask) |
| Remove a route from the forwarding table. | |
| ra8_err_t | ra8_layer3_switch_status_get (uint8_t *out_open, uint8_t *out_promisc) |
| Snapshot the open / promiscuous flags. | |
| ra8_err_t | ra8_layer3_switch_close (void) |
| Close the Layer-3 switch driver. | |
Variables | |
| static const char * | s_tag = "L3SW" |
| static ra8_layer3_switch_state_t | s_state = {} |
Layer-3 Ethernet switch driver – placeholder implementation.
Host-testable stand-in for the FSP r_layer3_switch driver. The RA8D2 silicon does not include a Layer-3 switch; this TU exists so portable networking code keeps compiling.
Definition in file ra8_layer3_switch.c.
|
nodiscard |
Close the Layer-3 switch driver.
| k_ra8_ok | Released. |
| k_ra8_err_invalid_state | Driver was never opened. |
Definition at line 80 of file ra8_layer3_switch.c.
References k_ra8_err_invalid_state, k_ra8_ok, and s_state.
Referenced by l3_run_facade().
|
nodiscard |
Open the Layer-3 switch driver.
| [in] | cfg | Configuration. Must not be NULL. |
| k_ra8_ok | Driver opened. |
| k_ra8_err_null_ptr | cfg was NULL. |
| k_ra8_err_invalid_arg | port_count zero or mtu_bytes zero. |
| k_ra8_err_exists | Driver already opened. |
Definition at line 34 of file ra8_layer3_switch.c.
References k_ra8_err_exists, k_ra8_err_invalid_arg, k_ra8_ok, ra8_layer3_switch_cfg_t::mtu_bytes, ra8_layer3_switch_cfg_t::port_count, ra8_layer3_switch_cfg_t::promiscuous, RA8_CHECK_NULL_PTR, ra8_log_info_val, s_state, and s_tag.
Referenced by l3_run_facade().
|
nodiscard |
Add a route to the forwarding table.
| [in] | route | Route entry. Must not be NULL. |
| k_ra8_err_null_ptr | route was NULL. |
| k_ra8_err_not_initialized | Driver was never opened. |
| k_ra8_err_not_supported | Placeholder. |
Definition at line 52 of file ra8_layer3_switch.c.
References k_ra8_err_not_initialized, k_ra8_err_not_supported, RA8_CHECK_NULL_PTR, s_state, and s_tag.
Referenced by l3_run_facade().
|
nodiscard |
Remove a route from the forwarding table.
| [in] | dst_ip | Destination IPv4 of the route to drop. |
| [in] | mask | Subnet mask of the route to drop. |
| k_ra8_err_not_initialized | Driver was never opened. |
| k_ra8_err_not_supported | Placeholder. |
Definition at line 61 of file ra8_layer3_switch.c.
References k_ra8_err_not_initialized, k_ra8_err_not_supported, and s_state.
|
nodiscard |
Snapshot the open / promiscuous flags.
| [out] | out_open | Receives 1 if open. |
| [out] | out_promisc | Receives 1 if promiscuous mode is active. |
| k_ra8_ok | Status copied. |
| k_ra8_err_null_ptr | Either pointer NULL. |
Definition at line 71 of file ra8_layer3_switch.c.
References k_ra8_ok, RA8_CHECK_NULL_PTR, s_state, and s_tag.
Referenced by l3_run_facade().
|
static |
Definition at line 32 of file ra8_layer3_switch.c.
|
static |
Definition at line 25 of file ra8_layer3_switch.c.