mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Add UIP stack. Still lots of debug output on packets...
This commit is contained in:
+35
-2
@@ -1,12 +1,39 @@
|
||||
#ifndef _RTL837X_STDIO_H_
|
||||
#define _RTL837X_STDIO_H_
|
||||
|
||||
#include "uip/uip-conf.h"
|
||||
|
||||
// Headers for calls in the common code area (HOME/BANK0)
|
||||
|
||||
#define SBUF_SIZE 256
|
||||
|
||||
// For RX data, a propriatary RTL FRAME is inserted. Instead of 0x0800 for IPv4,
|
||||
// the RTL_FRAME_TAG_ID is used as part of an 8-byte tag. When VLAN is activated,
|
||||
// the VLAN tag is inserted after the RTL tag
|
||||
// See here for the RTL tag: https://github.com/torvalds/linux/commit/1521d5adfc2b557e15f97283c8b7ad688c3ebc40
|
||||
#define RTL_TAG_SIZE 8
|
||||
#define VLAN_TAG_SIZE 4
|
||||
#define RTL_FRAME_TAG_ID 0x8899
|
||||
|
||||
// For RX and TX, an 8 byte header describing the frame to be moved to the Asic
|
||||
// and received from the Asic is used
|
||||
#define RTL_FRAME_HEADER_SIZE 8
|
||||
|
||||
// This is the standard size of an Ethernet frame header
|
||||
#define ETHER_HEADER_SIZE 14
|
||||
|
||||
|
||||
/**
|
||||
* Representation of a 48-bit Ethernet address.
|
||||
*/
|
||||
struct uip_eth_addr {
|
||||
uint8_t addr[6];
|
||||
};
|
||||
|
||||
extern __xdata uint8_t uip_buf[UIP_CONF_BUFFER_SIZE+2];
|
||||
|
||||
void print_string(__code char *p);
|
||||
void print_long(uint32_t a);
|
||||
void print_long(__xdata uint32_t a);
|
||||
void print_short(uint16_t a);
|
||||
void print_byte(uint8_t a);
|
||||
void print_sfr_data(void);
|
||||
@@ -25,6 +52,12 @@ uint8_t sfp_read_reg(uint8_t reg);
|
||||
void reg_bit_set(uint16_t reg_addr, char bit);
|
||||
void reg_bit_clear(uint16_t reg_addr, char bit);
|
||||
void reset_chip(void);
|
||||
void memcpy(register __xdata uint8_t *dst, register __xdata uint8_t *src, register uint16_t len);
|
||||
void memcpy(__xdata void * __xdata dst, __xdata const void * __xdata src, uint16_t len);
|
||||
void memcpyc(register __xdata uint8_t *dst, register __code uint8_t *src, register uint16_t len);
|
||||
void memset(register __xdata uint8_t *dst, register __xdata uint8_t v, register uint8_t len);
|
||||
uint16_t strlen(register __code const char *s);
|
||||
uint16_t strlen_x(register __xdata const char *s);
|
||||
void strtox(register __xdata uint8_t *dst, register __code const char *s);
|
||||
void tcpip_output(void);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user