mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
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:
18 files changed
+435
-117
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user