X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FNetwork%2FPRO100%2Fpro100.h;h=d61c22b9b156b19f86adb40a3ac9733d2fbe84ad;hb=b6e856e1570c371b7002f1a93a1ea0e978ffdab6;hp=9a14f7c7ab04d132700297ed7ede54c2a882e8c8;hpb=f50dbc2e4980dd0d41d2188bab68bc20d605c1b3;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/Network/PRO100/pro100.h b/KernelLand/Modules/Network/PRO100/pro100.h index 9a14f7c7..d61c22b9 100644 --- a/KernelLand/Modules/Network/PRO100/pro100.h +++ b/KernelLand/Modules/Network/PRO100/pro100.h @@ -1,63 +1,45 @@ /* - + * Acess2 PRO/100 Driver + * - By John Hodge (thePowersGang) + * + * pro100.h + * - Hardware header */ #ifndef _PRO100_H_ #define _PRO100_H_ -struct sCSR -{ - Uint16 Status; - Uint16 Command; - - Uint32 GenPtr; - Uint32 Port; - - Uint16 FlashCtrl; - Uint16 EEPROMCtrl; - - Uint32 MDICtrl; - Uint32 RXDMACount; -}; +#include "pro100_hw.h" -#define STATUS_RUS_MASK 0x003C // Receive Unit Status -#define STATUS_CUS_MASK 0x00C0 // Comamnd Unit Status -#define STATUS_FCP 0x0100 // Flow Control Pause -#define STATUS_ER 0x0200 // Early Recieve -#define STATUS_SWI 0x0400 // Software Interrupt -#define STATUS_MDI 0x0800 // Management Data Interrupt -#define STATUS_RNR 0x1000 // Receive Not Ready -#define STATUS_CNA 0x2000 // Command Unit not active -#define STATUS_FR 0x4000 // Frame Recieved -#define STATUS_CX 0x8000 // Command Unit executed - -#define CMD_RUC 0x0007 -#define CMD_CUC 0x00F0 -#define CMD_M 0x0100 // Interrupt Mask -#define CMD_SI 0x0200 // Software Interrupt - -#define MDI_IE (1 << 29) -#define MDI_RDY (1 << 28) - -#define EEPROM_CTRL_SK 0x01 // -#define EEPROM_CTRL_CS 0x02 -#define EEPROM_CTRL_DI 0x04 -#define EEPROM_CTRL_DO 0x08 - -enum ePortCommands { - PORT_SOFTWARERESET = 0, - PORT_SELFTEST = 1, - PORT_SELECTIVERESET = 2, -}; +#include +#include + +#define NUM_RX 4 +#define RX_BUF_SIZE ((PAGE_SIZE/2)-sizeof(tRXBuffer)) +#define NUM_TX (PAGE_SIZE/sizeof(tTXCommand)) -struct sCommandBuffer +typedef struct sCard tCard; + +struct sCard { - Uint16 Status; - Uint16 Command; - Uint32 Link; + Uint16 IOBase; + struct sCSR *MMIO; - tIPStackBuffer *Buffer; - tCommandBuffer *Next; -} __align__(4); + union { + Uint8 Bytes[6]; + Uint16 Words[3]; // Used to read the MAC from EEPROM + } MAC; + + int CurRXIndex; + tRXBuffer *RXBufs[NUM_RX]; + tSemaphore RXSemaphore; + + tSemaphore TXCommandSem; + tMutex lTXCommands; + int LastTXIndex; + int CurTXIndex; + tTXCommand *TXCommands; + tIPStackBuffer *TXBuffers[NUM_TX]; +}; #endif