42#define RA8_WIFI_C6_TAG "WIFI-C6"
45 "the facade and link MAC widths must agree for a straight copy");
47 "the facade and link SSID capacities must agree for a straight copy");
401 if (self ==
nullptr) {
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
The single integration boundary between this firmware and the ESP32-C6.
@ k_ra8_c6link_announce_transfers
Transactions ra8_c6link_await_ready spends on the announcement before it probes.
ra8_err_t ra8_c6link_close(ra8_c6link_t *link)
Release a link handle.
struct ra8_c6link_mac ra8_c6link_mac_t
@ k_ra8_c6link_event_sta_connected
Event_StaConnected: the station has associated with an AP.
@ k_ra8_c6link_event_sta_disconnected
Event_StaDisconnected: the station has lost or left its AP.
ra8_err_t ra8_c6link_open(ra8_c6link_t *link, const ra8_c6link_cfg_t *cfg)
Bind a transport to a link handle and make it usable.
ra8_err_t ra8_c6link_await_ready(ra8_c6link_t *link, uint16_t max_transactions, ra8_c6link_fw_version_t *out)
Announce this host and prove the co-processor is answering.
struct ra8_c6link_cfg ra8_c6link_cfg_t
@ k_ra8_c6link_mac_bytes
Octets in an IEEE 802 address.
@ k_ra8_c6link_ssid_max
Octets in the longest SSID 802.11 allows.
@ k_ra8_c6link_arena_min
Smallest decode arena ra8_c6link_open accepts.
ra8_err_t ra8_c6link_poll(ra8_c6link_t *link, uint16_t max_transactions, ra8_c6link_stats_t *stats)
Clock transactions, delivering whatever the co-processor sends.
struct ra8_c6link_stats ra8_c6link_stats_t
struct ra8_c6link_event ra8_c6link_event_t
struct ra8_c6link_fw_version ra8_c6link_fw_version_t
Wi-Fi station bring-up and association over the C6 link.
struct ra8_c6link_sta_cfg ra8_c6link_sta_cfg_t
ra8_err_t ra8_c6link_wifi_mac(ra8_c6link_t *link, ra8_c6link_mac_t *out)
Read the station interface's MAC address.
ra8_err_t ra8_c6link_wifi_stop(ra8_c6link_t *link)
Stop the radio and release the co-processor's Wi-Fi resources.
ra8_err_t ra8_c6link_sta_cfg_set(ra8_c6link_sta_cfg_t *cfg, const char *ssid, const char *pass)
Fill a station configuration from an SSID and a passphrase.
ra8_err_t ra8_c6link_wifi_leave(ra8_c6link_t *link)
Disassociate the station from its current network.
ra8_err_t ra8_c6link_wifi_start(ra8_c6link_t *link)
Start the co-processor's Wi-Fi radio in station mode.
struct ra8_c6link_ap_info ra8_c6link_ap_info_t
ra8_err_t ra8_c6link_wifi_ap_info(ra8_c6link_t *link, ra8_c6link_ap_info_t *out)
Read what the co-processor knows about the associated AP.
ra8_err_t ra8_c6link_wifi_join(ra8_c6link_t *link, const ra8_c6link_sta_cfg_t *cfg)
Ask the station to associate with the configured network.
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_invalid_size
Invalid size parameter (too large, too small, or misaligned).
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
void * memcpy(void *dst, const void *src, size_t n)
Copy memory area between non-overlapping regions.
Secure-comparison primitives for the crypto / secure-boot paths.
void ra8_secure_memzero(void *ptr, size_t len)
Securely zero a buffer such that the write cannot be optimised away.
A small, uniform Wi-Fi facade: init, connect, get an IP, disconnect.
@ k_ra8_wifi_mac_bytes
Octets in an IEEE 802 address.
@ k_ra8_wifi_ssid_max
Octets in the longest 802.11 SSID.
struct ra8_wifi_backend ra8_wifi_backend_t
One radio's implementation of the operations this facade dispatches.
struct ra8_wifi_ap ra8_wifi_ap_t
struct ra8_wifi_mac ra8_wifi_mac_t
ra8_wifi_link_t
The instantaneous association state a backend reports.
@ k_ra8_wifi_link_up
Station is associated with an AP.
@ k_ra8_wifi_link_down
Station is not associated.
struct ra8_wifi_cfg ra8_wifi_cfg_t
The radio-operation seam ra8_wifi dispatches through.
static ra8_err_t internal_c6link_op_radio_up(void *ctx)
Start the co-processor's radio in station mode.
ra8_err_t ra8_wifi_c6link_setup(ra8_wifi_c6link_t *self, const ra8_wifi_c6link_cfg_t *cfg, ra8_wifi_cfg_t *out_wcfg)
Wire this backend into the backend half of an ra8_wifi_cfg_t.
static ra8_err_t internal_c6link_op_radio_down(void *ctx)
Stop the radio and release the co-processor's Wi-Fi resources.
#define RA8_WIFI_C6_TAG
Component tag for this backend's log lines.
static void internal_c6link_op_idle(void *ctx, uint16_t ms)
Idle for the requested milliseconds, on the transport's own clock.
static ra8_err_t internal_c6link_op_open(void *ctx)
Bring the link up: open it and prove the co-processor answers.
static ra8_err_t internal_c6link_op_close(void *ctx)
Release the link this backend opened.
static ra8_err_t internal_c6link_op_join(void *ctx, const char *ssid, const char *psk)
Ask the station to associate with a network.
static ra8_err_t internal_c6link_op_get_mac(void *ctx, ra8_wifi_mac_t *out)
Read the station's own MAC address.
static ra8_err_t internal_c6link_op_service(void *ctx, ra8_wifi_link_t *out_link)
Service the link once and report whether the station is associated.
static ra8_err_t internal_c6link_op_get_ap(void *ctx, ra8_wifi_ap_t *out)
Read what the co-processor knows about the associated AP.
static void internal_c6link_on_event(void *ctx, const ra8_c6link_event_t *ev)
Latch a station event so ra8_wifi_c6link_service can report it.
static ra8_err_t internal_c6link_op_leave(void *ctx)
Disassociate the station from its current network.
The ESP32-C6 backend for the ra8_wifi facade, over ra8_c6link.
struct ra8_wifi_c6link_cfg ra8_wifi_c6link_cfg_t
struct ra8_wifi_c6link ra8_wifi_c6link_t
const ra8_wifi_backend_t k_ra8_wifi_backend_c6link
The ESP32-C6 ra8_wifi_backend_t, exported for ra8_wifi_cfg::backend.
ra8_c6link_mac_t bssid
Address of the associated AP.
int32_t authmode
Co-processor wifi_auth_mode_t.
char ssid[k_ra8_c6link_ssid_max+1U]
Its SSID, NUL-terminated.
uint8_t ssid_len
Octets of ssid.
int8_t rssi
Signal level in dBm.
uint8_t channel
Primary channel in use.
ra8_c6link_transport_t transport
The hardware seam; every row required.
uint32_t arena_bytes
Bytes available at arena.
uint8_t * arena
Protobuf decode arena.
void * cb_ctx
Context handed to both callbacks.
ra8_c6link_rx_cb_t rx_cb
802.3 receive sink, or null to count.
ra8_c6link_event_cb_t event_cb
Announcement sink, or null to count.
uint16_t reason
802.11 reason code, sta_disconnected.
ra8_c6link_event_kind_t kind
Which announcement this is.
uint8_t octet[k_ra8_c6link_mac_bytes]
Address octets, first on the wire first.
void(* delay_ms)(void *ctx, uint16_t ms)
Yield for approximately ms milliseconds.
void * ctx
Opaque backend context, handed back to every row above.
int32_t authmode
Backend authentication-mode code.
char ssid[k_ra8_wifi_ssid_max+1U]
Its SSID, NUL-terminated.
ra8_wifi_mac_t bssid
Address of the associated AP.
int8_t rssi
Signal level in dBm.
uint8_t ssid_len
Octets of ssid.
uint8_t channel
Primary channel in use.
ra8_c6link_rx_cb_t rx_cb
IP-stack L2 receive sink, or null.
uint32_t arena_bytes
Bytes available at arena.
ra8_c6link_transport_t transport
Bound hardware (or model) seam.
ra8_c6link_t * link
Caller-allocated link, opened by the backend.
uint8_t * arena
Protobuf decode arena for the link.
ra8_c6link_rx_cb_t rx_cb
IP-stack L2 receive sink, or null.
uint32_t arena_bytes
Bytes available at arena.
uint16_t reason
Last 802.11 disconnect reason code.
volatile bool disconnected
A station-disconnected event has arrived.
volatile bool connected
A station-connected event has arrived.
ra8_c6link_t * link
The link this backend opens and drives.
ra8_c6link_transport_t transport
Bound seam passed to ra8_c6link_open.
uint8_t * arena
Decode arena passed to ra8_c6link_open.
const ra8_wifi_backend_t * backend
Radio operations; every row set.
void * backend_ctx
Opaque state handed to the backend.
uint8_t octet[k_ra8_wifi_mac_bytes]
Address octets, first on the wire first.