Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Header file for initial ne2k driver.
[palacios.git] / palacios / include / geekos / ne2k.h
1 #ifndef GEEKOS_NE2K_H
2 #define GEEKOS_NE2K_H
3
4 //#include <geekos/ktypes.h>
5 #include <geekos/malloc.h>
6
7 #define NE2K_PAGE0      0x00
8 #define NE2K_PAGE1      0x40
9 #define NE2K_PAGE2      0x80
10 #define NE2K_PAGE3      0xc0
11
12 #define NE2K_BASE_ADDR  0xc100          /* Starting address of the card */
13 #define NE2K_CR         NE2K_BASE_ADDR  /* Command register */
14
15 /* Page 0 register offsets */
16 #define NE2K CLDA0      NE2K_CR + 0x01
17 #define NE2K_PSTART     NE2K_CR + 0x01
18 #define NE2K_CLDA1      NE2K_CR + 0x02
19 #define NE2K_PSTOP      NE2K_CR + 0x02
20 #define NE2K_BNRY       NE2K_CR + 0x03
21 #define NE2K_TSR        NE2K_CR + 0x04
22 #define NE2K_TPSR       NE2K_CR + 0x04
23 #define NE2K_NCR        NE2K_CR + 0x05
24 #define NE2K_TBCR0      NE2K_CR + 0x05
25 #define NE2K_FIFO       NE2K_CR + 0x06
26 #define NE2K_TBCR1      NE2K_CR + 0x06
27 #define NE2K_ISR        NE2K_CR + 0x07  /* Interrupt status register */
28 #define NE2K_CRDA0      NE2K_CR + 0x08
29 #define NE2K_RSAR0      NE2K_CR + 0x08  /* Remote start address registers */
30 #define NE2K_CRDA1      NE2K_CR + 0x09
31 #define NE2K_RSAR1      NE2K_CR + 0x09
32 #define NE2K_RBCR0      NE2K_CR + 0x0a  /* Remote byte count registers */
33 #define NE2K_RBCR1      NE2K_CR + 0x0b
34 #define NE2K_RSR        NE2K_CR + 0x0c
35 #define NE2K_RCR        NE2K_CR + 0x0c  /* Receive configuration register */
36 #define NE2K_CNTR0      NE2K_CR + 0x0d
37 #define NE2K_TCR        NE2K_CR + 0x0d  /* Transmit configuration register */
38 #define NE2K_CNTR1      NE2K_CR + 0x0e
39 #define NE2K_DCR        NE2K_CR + 0x0e  /* Data configuration register */
40 #define NE2K_CNTR2      NE2K_CR + 0x0f
41 #define NE2K_IMR        NE2K_CR + 0x0f  /* Interrupt mask register */
42
43 /* Page 1 register offsets */
44 #define NE2K_PAR0       NE2K_CR + 0x01
45 #define NE2K_PAR1       NE2K_CR + 0x02
46 #define NE2K_PAR2       NE2K_CR + 0x03
47 #define NE2K_PAR3       NE2K_CR + 0x04
48 #define NE2K_PAR4       NE2K_CR + 0x05
49 #define NE2K_PAR5       NE2K_CR + 0x06
50 #define NE2K_CURR       NE2K_CR + 0x07
51 #define NE2K_MAR0       NE2K_CR + 0x08
52 #define NE2K_MAR1       NE2K_CR + 0x09
53 #define NE2K_MAR2       NE2K_CR + 0x0a
54 #define NE2K_MAR3       NE2K_CR + 0x0b
55 #define NE2K_MAR4       NE2K_CR + 0x0c
56 #define NE2K_MAR5       NE2K_CR + 0x0d
57 #define NE2K_MAR6       NE2K_CR + 0x0e
58 #define NE2K_MAR7       NE2K_CR + 0x0f
59
60 #define NE2K_IRQ        11              /* Interrupt channel */
61
62 struct NE2K_REGS {
63         struct _CR * cr;
64         struct _ISR * isr;
65         struct _IMR * imr;
66         struct _DCR * dcr;
67         struct _TCR *tcr;
68         struct _TSR *tsr;
69         struct _RCR *rcr;
70         struct _RSR *rsr;
71 };
72
73 int Init_Ne2k();
74 int NE2K_Transmit(struct NE2K_REGS *);
75 int NE2K_Receive();
76
77 #endif  /* GEEKOS_NE2K_H */