mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
De-magic NIC rx and tx registers, cleanup
This commit is contained in:
+15
-11
@@ -36,8 +36,21 @@
|
||||
// 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
|
||||
struct rtl_tag {
|
||||
uint16_t tag; // This is 0x8899 for the RTL837X
|
||||
uint8_t version; // Version is 4
|
||||
uint8_t reason;
|
||||
uint16_t flags;
|
||||
uint16_t pmask; // A bit mask for a TX pkt, 4-bit port-number for RX
|
||||
};
|
||||
|
||||
struct vlan_tag {
|
||||
uint16_t svlan; // Service VLAN
|
||||
uint16_t vlan;
|
||||
};
|
||||
|
||||
#define RTL_TAG_SIZE (sizeof (struct rtl_tag))
|
||||
#define VLAN_TAG_SIZE (sizeof (struct vlan_tag))
|
||||
#define RTL_FRAME_TAG_ID 0x8899
|
||||
|
||||
// For RX and TX, an 8 byte header describing the frame to be moved to the Asic
|
||||
@@ -70,15 +83,6 @@ struct flash_region_t {
|
||||
|
||||
extern __xdata uint8_t uip_buf[UIP_CONF_BUFFER_SIZE+2];
|
||||
|
||||
// 8899 04 0000 20 0004
|
||||
struct rtl_tag {
|
||||
uint16_t tag;
|
||||
uint8_t version;
|
||||
uint8_t reason;
|
||||
uint16_t flags;
|
||||
uint16_t pmask; // A bit mask for a TX pkt, 4-bit port-number for RX
|
||||
};
|
||||
|
||||
// Headers for calls in the common code area (HOME/BANK0)
|
||||
void print_string(__code char *p);
|
||||
void print_long(__xdata uint32_t a);
|
||||
|
||||
Reference in New Issue
Block a user