Kernel/IPCPipe - Add queue length limit, watch for _ERROR in select
[tpg/acess2.git] / KernelLand / Modules / Network / E1000 / e1000.h
1 /*
2  * Acess2 E1000 Network Driver
3  * - By John Hodge (thePowersGang)
4  *
5  * e1000.h
6  * - Driver core header
7  */
8 #ifndef _E1000_H_
9 #define _E1000_H_
10
11 #include "e1000_hw.h"
12
13 #include <semaphore.h>
14 #include <mutex.h>
15 #include <IPStack/include/buffer.h>
16
17 #define NUM_TX_DESC     (PAGE_SIZE/sizeof(struct sTXDesc))
18 #define NUM_RX_DESC     (PAGE_SIZE/sizeof(struct sRXDesc))
19
20 #define RX_DESC_BSIZE   4096
21 #define RX_DESC_BSIZEHW RCTL_BSIZE_4096
22
23 typedef struct sCard
24 {
25         tPAddr  MMIOBasePhys;
26          int    IRQ;
27         Uint16  IOBase;
28         volatile void   *MMIOBase;
29
30         tMutex  lRXDescs;
31          int    FirstUnseenRXD;
32          int    LastUnseenRXD;
33         void    *RXBuffers[NUM_RX_DESC];
34         volatile tRXDesc        *RXDescs;
35         tSemaphore      AvailPackets;
36         struct sCard    *RXBackHandles[NUM_RX_DESC];    // Pointers to this struct, offset used to select desc
37         
38         tMutex  lTXDescs;
39          int    FirstFreeTXD;
40          int    LastFreeTXD;
41         volatile tTXDesc        *TXDescs;
42         tSemaphore      FreeTxDescs;
43
44         tIPStackBuffer  *TXSrcBuffers[NUM_TX_DESC];
45
46         Uint8   MacAddr[6];
47
48         void    *IPStackHandle;
49 } tCard;
50
51
52 #endif
53

UCC git Repository :: git.ucc.asn.au