2 * Acess2 PRO/100 Driver
3 * - By John Hodge (thePowersGang)
11 // Want at least 5 TX Buffer slots (for TCP)
12 // - However, bounce buffers are annoying, so double that
13 #define MIN_LOCAL_TXBUFS 5*2
14 // - 16 bytes per TX header, plus 8 per buffer, want 16 byte alignment
15 // - need to round up to multiple of 2
16 #define NUM_LOCAL_TXBUFS ((MIN_LOCAL_TXBUFS+1)&~(2-1))
48 #define STATUS_RUS_MASK 0x3C // Receive Unit Status
49 #define STATUS_CUS_MASK 0xC0 // Comamnd Unit Status
50 #define ISR_FCP 0x01 // Flow Control Pause
51 #define ISR_ER 0x02 // Early Recieve
52 #define ISR_SWI 0x04 // Software Interrupt
53 #define ISR_MDI 0x08 // Management Data Interrupt
54 #define ISR_RNR 0x10 // Receive Not Ready
55 #define ISR_CNA 0x20 // Command Unit not active
56 #define ISR_FR 0x40 // Frame Recieved
57 #define ISR_CX 0x80 // Command Unit executed
59 #define CMD_RUC 0x0007
60 #define CMD_CUC 0x00F0
61 #define CMD_M 0x0100 // Interrupt Mask
62 #define CMD_SI 0x0200 // Software Interrupt
64 #define MDI_IE (1 << 29)
65 #define MDI_RDY (1 << 28)
67 #define EEPROM_CTRL_SK 0x01 //
68 #define EEPROM_CTRL_CS 0x02
69 #define EEPROM_CTRL_DI 0x04
70 #define EEPROM_CTRL_DO 0x08
72 #define EEPROM_OP_READ 0x06
75 PORT_SOFTWARERESET = 0,
77 PORT_SELECTIVERESET = 2,
105 #define CMD_IOC (1 << 13) // Interrupt on completion
106 #define CMD_Suspend (1 << 14) // Suspend upon completion
107 #define CMD_EL (1 << 15) // Stop upon completion
109 #define CU_Status_Complete (1 << 15)
111 typedef struct sCommandUnit tCommandUnit;
117 Uint32 Link; // Relative to base
120 typedef struct sTXDescriptor tTXDescriptor;
121 typedef struct sTXBufDesc tTXBufDesc;
122 typedef struct sTXCommand tTXCommand;
124 // - Core TX Descriptor
135 // - TX Buffer descriptor (pointed to by TBDArrayAddr, or following sTXDescriptor)
143 // - TX Command block (used by static allocation)
147 tTXBufDesc LocalBufs[NUM_LOCAL_TXBUFS];
150 typedef struct sRXBuffer tRXBuffer;
157 Uint32 RXBufAddr; // Unused according to qemu source