|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Virtual network peer for ra8_emulator – talks TCP/IP to the firmware. More...
#include <stdint.h>Go to the source code of this file.
Functions | |
| void | board_net_init (bool trace) |
| Reset the virtual network peer to its initial state. | |
| void | board_net_on_tx (const uint8_t *frame, uint32_t len) |
| Hand one frame the firmware transmitted to the peer (ra8_eth_write). | |
| uint32_t | board_net_poll_rx (uint8_t *buf, uint32_t max) |
| Fetch the next frame the peer wants the firmware to receive. | |
| void | board_net_tick (void) |
| Advance the peer's state machine one tick (ARP -> ping -> TCP echo). | |
| void | board_net_report (void) |
| Print the end-of-run network summary (link / ARP / ping / TCP). | |
Virtual network peer for ra8_emulator – talks TCP/IP to the firmware.
ra8_emulator shims the firmware's ra8_eth frame API (ra8_eth_write / ra8_eth_read / ra8_eth_link_status – the same seam the NetX Duo driver uses) and routes the Ethernet frames here. This module is the "other host on the wire": a tiny userspace TCP/IP stack (Ethernet + ARP + IPv4 + ICMP + TCP) that resolves the firmware (192.168.1.42), pings it, and connects to its echo server – so a NetX networking example runs end-to-end with no hardware and no host network setup. main.c marshals guest memory to/from the plain byte buffers here, so this code is portable, AppKit-free C.
Definition in file board_net.h.
| void board_net_init | ( | bool | trace | ) |
Reset the virtual network peer to its initial state.
| [in] | trace | Mirror per-frame activity to injected error sink when true. |
Reset the virtual network peer to its initial state; this step is contained within the board net model and uses bounded caller or module-owned storage.
Definition at line 786 of file board_net.c.
References k_net_init, memset(), s_arp_replies, s_delivered, s_fw_mac, s_fw_mac_known, s_ping_seq, s_pings, s_polls, s_rxq_head, s_rxq_tail, s_state, s_tcp_echoed, s_tcp_estab_wait, s_tcp_match, s_tcp_need_data, s_tcp_our_seq, s_tcp_their_seq, s_trace, s_tx_frames, and s_wait.
Referenced by internal_main_bringup_peripherals(), and warm_reboot().
| void board_net_on_tx | ( | const uint8_t * | frame, |
| uint32_t | len ) |
Hand one frame the firmware transmitted to the peer (ra8_eth_write).
| [in] | frame | Ethernet frame bytes (no FCS). |
| [in] | len | Frame length in bytes. |
Hand one frame the firmware transmitted to the peer (ra8_eth_write); this step is contained within the board net model and uses bounded caller or module-owned storage.
Definition at line 710 of file board_net.c.
References board_console_push(), internal_get16(), internal_net_rx_arp(), internal_net_rx_ipv4(), k_board_console_ch_net, k_eth_arp, k_eth_ethertype_off, k_eth_hdr, k_eth_ipv4, k_net_console_line_cap, priv_emu_io_errf(), s_trace, and s_tx_frames.
Referenced by internal_eth_tx_kick_queue().
| uint32_t board_net_poll_rx | ( | uint8_t * | buf, |
| uint32_t | max ) |
Fetch the next frame the peer wants the firmware to receive.
| [out] | buf | Destination for the frame bytes. |
| [in] | max | Capacity of buf. |
Fetch the next frame the peer wants the firmware to receive; this step is contained within the board net model and uses bounded caller or module-owned storage.
| value | The operation-specific board net poll rx value. |
Definition at line 733 of file board_net.c.
References board_console_push(), k_board_console_ch_net, k_net_console_line_cap, k_net_qdepth, memcpy(), s_delivered, s_polls, s_rxq, s_rxq_head, s_rxq_len, and s_rxq_tail.
Referenced by internal_eth_rx_drain_peer().
| void board_net_report | ( | void | ) |
Print the end-of-run network summary (link / ARP / ping / TCP).
Print the end-of-run network summary (link / arp / ping / tcp); this step is contained within the board net model and uses bounded caller or module-owned storage.
Definition at line 829 of file board_net.c.
References internal_net_echo_state(), k_net_estab, k_net_init, k_net_syn, priv_emu_io_errf(), s_delivered, s_fw_mac_known, s_pings, s_polls, s_state, s_tcp_echoed, and s_tx_frames.
Referenced by internal_run_print_stop_summary().
| void board_net_tick | ( | void | ) |
Advance the peer's state machine one tick (ARP -> ping -> TCP echo).
Advance the peer's state machine one tick (arp -> ping -> tcp echo); this step is contained within the board net model and uses bounded caller or module-owned storage.
< Net data delay.
< Net retry.
Definition at line 753 of file board_net.c.
References internal_net_send_arp_request(), internal_net_send_data(), internal_net_send_ping(), internal_net_send_syn(), k_net_arp, k_net_estab, k_net_init, k_net_ping, k_net_syn, s_state, s_tcp_estab_wait, s_tcp_need_data, and s_wait.
Referenced by internal_run_loop_tick_inputs().