|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
NetX Duo network driver shim that bridges onto the ESP32-C6 link. More...
Go to the source code of this file.
Functions | |
| void | nx_ether_driver_c6 (NX_IP_DRIVER *driver_req) |
| NetX Duo link driver entry point for the ESP32-C6 Wi-Fi station. | |
| void | nx_ether_driver_c6_bind (ra8_c6link_t *link) |
| Bind an open C6 link handle to the driver and arm its mutex. | |
| void | nx_ether_driver_c6_set_mac (const uint8_t mac[6]) |
| Tell the driver the station MAC address to stamp on outgoing frames. | |
| void | nx_ether_driver_c6_rx (void *ctx, const uint8_t *frame, uint16_t len) |
| Receive callback the application registers with ra8_c6link_open. | |
NetX Duo network driver shim that bridges onto the ESP32-C6 link.
The twin of nx_ether_driver_ra8_eth for the wireless path: where that driver hands NetX-supplied frames to the on-chip Ethernet MAC, this one hands them to the ESP32-C6 over the ra8_c6link facade – ra8_c6link_eth_send for transmit and the facade's 802.3 receive callback for receive. Above it NetX Duo neither knows nor cares that the wire is a Wi-Fi station rather than a copper port: the interface is Ethernet II framing either way.
Definition in file nx_ether_driver_c6.h.
| void nx_ether_driver_c6 | ( | NX_IP_DRIVER * | driver_req | ) |
NetX Duo link driver entry point for the ESP32-C6 Wi-Fi station.
Pass this symbol as the driver argument to nx_ip_create. NetX Duo calls it for every link command – INITIALIZE, ENABLE, PACKET_SEND, GET_STATUS and the rest – and it dispatches each to the matching handler. The transmit path builds the 14-byte Ethernet header from the destination MAC NetX resolved, the station MAC set by nx_ether_driver_c6_set_mac and the EtherType implied by the command, then forwards the whole frame to ra8_c6link_eth_send.
| [in,out] | driver_req | NetX Duo driver request block; NetX never passes null, but a null is tolerated as a no-op. |
driver_req->nx_ip_driver_status.driver_req->nx_ip_driver_status is set to NX_SUCCESS or an error. Definition at line 770 of file nx_ether_driver_c6.c.
References internal_handle_get_status(), internal_handle_init(), internal_handle_send(), internal_set_link_state(), and s_open.
Referenced by internal_c6_cam_net_create(), priv_net_create_ip(), and priv_net_create_ip().
| void nx_ether_driver_c6_bind | ( | ra8_c6link_t * | link | ) |
Bind an open C6 link handle to the driver and arm its mutex.
The driver reaches the co-processor only through this handle. Call it once, after the link is open and the station is associated, and before nx_ip_create. It also creates the ThreadX mutex that serialises transmit against the RX poll worker, so it must run after the ThreadX kernel is up.
| [in] | link | Open, associated C6 link handle; must be non-null and must outlive every NetX operation on this interface. |
link is open and its receive callback is nx_ether_driver_c6_rx. link. Definition at line 198 of file nx_ether_driver_c6.c.
References s_c6_link, s_c6_mtx, s_c6_mtx_made, tx_mutex_create, and TX_SUCCESS.
Referenced by c6_cam_net_up(), c6_join_net_up(), and wifi_hal_ip_bind().
| void nx_ether_driver_c6_rx | ( | void * | ctx, |
| const uint8_t * | frame, | ||
| uint16_t | len ) |
Receive callback the application registers with ra8_c6link_open.
The facade invokes this for every 802.3 frame the co-processor forwards from the associated AP, synchronously inside ra8_c6link_poll (or inside a transmit pump). It allocates an NX_PACKET from the IP's default pool, copies the frame in, and hands it to NetX Duo's deferred receive path, keyed by EtherType. Before the interface is up (NX_LINK_INITIALIZE has not run) it drops the frame, which is correct: no data frames flow before association and IP bring-up.
| [in] | ctx | Unused context pointer from the link configuration. |
| [in] | frame | Whole Ethernet II frame including the 14-byte header; must be non-null when len is non-zero. |
| [in] | len | Frame length in octets. |
len is at least the 14-byte Ethernet header for delivery. Definition at line 351 of file nx_ether_driver_c6.c.
References internal_dispatch_to_netx(), internal_rx_acceptable(), k_nx_c6_max_frame, k_nx_c6_rx_align, memcpy(), s_nx_c6_diag, s_rx_iface, s_rx_ip, and s_rx_staging.
Referenced by c6_join_open_link(), internal_c6_cam_open_link(), and wifi_hal_make_cfg().
| void nx_ether_driver_c6_set_mac | ( | const uint8_t | mac[6] | ) |
Tell the driver the station MAC address to stamp on outgoing frames.
NetX Duo learns the interface MAC from nx_ip_interface_physical_address_set, but nx_ip_create fires NX_LINK_INITIALIZE before the application can call that, so the driver would otherwise stamp a zero source MAC on the first frames. Read the station address with ra8_c6link_wifi_mac and hand it here before nx_ip_create so INITIALIZE has the real value.
| [in] | mac | Six-octet station MAC; must be non-null. |
mac points at k_ra8_c6link_mac_bytes readable octets. mac as the source MAC on every transmitted frame. Definition at line 189 of file nx_ether_driver_c6.c.
References k_nx_c6_mac_len, memcpy(), s_local_mac, and s_mac_user_set.
Referenced by c6_cam_net_up(), c6_join_net_up(), and wifi_hal_ip_bind().