nic: Fix incorrect wrap handling of RX circular buffer

nic: move other nic functions into the dedicated nic files
uip: alloc buffer multiple of 8 bytes

Signed-off-by: João Silva <jgc3silva@gmail.com>
This commit is contained in:
João Silva committed 2026-10-19 19:21:47 +01:00
1 parent 138acfadb1
commit 98369c37fe
18 files changed
+435 -117

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
#ifndef RTL837X_NIC_H
#define RTL837X_NIC_H
#include <stdbool.h>
#include <stdint.h>
// #define RXTXDBG 1
bool nic_rx_header(uint16_t ring_ptr) __reentrant;
bool nic_rx_packet(__xdata uint8_t *buffer, uint16_t ring_ptr) __reentrant;
/* buffer starts at the eight-byte NIC descriptor; len excludes that
* descriptor. ring_ptr is the ASIC TX position in eight-byte slots. */
void nic_tx_packet(__xdata uint8_t *buffer, uint16_t len, uint16_t ring_ptr);
/* RX DMA in eight-byte units. ring_ptr must start inside the configured
* RX ring; the hardware wraps transfers that cross its end. */
bool nic_rx_dma(__xdata uint8_t *buffer, uint16_t ring_ptr, uint8_t words) __reentrant;
#endif