1
2
3
4
5
6
7
8
9
10
11
12
13
14 #define DATAPORT 0x0000
15 #define WRITE_PTR 0x0002
16 #define READ_PTR 0x0004
17 #define SIGNAL_CA 0x0006
18 #define SET_IRQ 0x0007
19 #define SM_PTR 0x0008
20 #define MEM_Ctrl 0x000b
21 #define MEM_Page_Ctrl 0x000c
22 #define Config 0x000d
23 #define EEPROM_Ctrl 0x000e
24 #define ID_PORT 0x000f
25
26
27
28
29
30
31 #define SM_ADDR(x) (0x4000+((x&0x10)<<10)+(x&0xf))
32
33
34 #define SCB_STATUS 0xc008
35 #define SCB_CMD 0xc00a
36 #define SCB_CBL 0xc00c
37 #define SCB_RFA 0xc00e
38
39
40
41
42
43
44
45
46 #define SIRQ_en 0x08
47 #define SIRQ_dis 0x00
48
49
50 #define set_loopback outb(inb(ioaddr+Config)|0x02,ioaddr+Config)
51 #define clear_loopback outb(inb(ioaddr+Config)&0xfd,ioaddr+Config)
52
53
54 #define EC_Clk 0x01
55 #define EC_CS 0x02
56 #define EC_Wr 0x04
57 #define EC_Rd 0x08
58 #define ASIC_RST 0x40
59 #define i586_RST 0x80
60
61 #define eeprom_delay() { int _i = 40; while (--_i>0) { __SLOW_DOWN_IO; }}
62
63
64
65
66
67
68 #define SCP_START 0xfff6
69
70
71
72 #define ISCP_START 0x0000
73
74 #define SCB_START 0x0008
75
76
77
78
79
80
81
82 #define TX_BUF_START 0x0100
83 #define TX_BUF_SIZE ((24+ETH_FRAME_LEN+31)&~0x1f)
84 unsigned short NUM_TX_BUFS=4;
85 unsigned short RX_BUF_START;
86 #define RX_BUF_SIZE ((32+ETH_FRAME_LEN+31)&~0x1f)
87 unsigned short RX_BUF_END=0x7ff6;
88 unsigned short NUM_RX_BUFS = 4;
89
90
91
92
93
94
95
96
97 #define SCB_complete(s) ((s&0x8000)!=0)
98 #define SCB_rxdframe(s) ((s&0x4000)!=0)
99 #define SCB_CUdead(s) ((s&0x2000)!=0)
100 #define SCB_RUdead(s) ((s&0x1000)!=0)
101 #define SCB_ack(s) (s & 0xf000)
102
103
104 #define SCB_CUstat(s) ((s&0x0300)>>8)
105
106
107 #define SCB_RUstat(s) ((s&0x0070)>>4)
108
109
110 #define SCB_CUnop 0x0000
111 #define SCB_CUstart 0x0100
112 #define SCB_CUresume 0x0200
113 #define SCB_CUsuspend 0x0300
114 #define SCB_CUabort 0x0400
115
116
117 #define SCB_resetchip 0x0080
118
119 #define SCB_RUnop 0x0000
120 #define SCB_RUstart 0x0010
121 #define SCB_RUresume 0x0020
122 #define SCB_RUsuspend 0x0030
123 #define SCB_RUabort 0x0040
124
125
126
127
128
129
130 #define Stat_Done(s) ((s&0x8000)!=0)
131 #define Stat_Busy(s) ((s&0x4000)!=0)
132 #define Stat_OK(s) ((s&0x2000)!=0)
133 #define Stat_Abort(s) ((s&0x1000)!=0)
134 #define Stat_STFail ((s&0x0800)!=0)
135 #define Stat_TNoCar(s) ((s&0x0400)!=0)
136 #define Stat_TNoCTS(s) ((s&0x0200)!=0)
137 #define Stat_TNoDMA(s) ((s&0x0100)!=0)
138 #define Stat_TDefer(s) ((s&0x0080)!=0)
139 #define Stat_TColl(s) ((s&0x0040)!=0)
140 #define Stat_TXColl(s) ((s&0x0020)!=0)
141 #define Stat_NoColl(s) (s&0x000f)
142
143
144
145
146
147
148
149 #define Cmd_END 0x8000
150 #define Cmd_SUS 0x4000
151 #define Cmd_INT 0x2000
152
153 #define Cmd_Nop 0x0000
154 #define Cmd_SetAddr 0x0001
155 #define Cmd_Config 0x0002
156 #define Cmd_MCast 0x0003
157 #define Cmd_Xmit 0x0004
158 #define Cmd_TDR 0x0005
159 #define Cmd_Dump 0x0006
160 #define Cmd_Diag 0x0007
161
162
163
164
165
166
167 #define FD_Done(s) ((s&0x8000)!=0)
168 #define FD_Busy(s) ((s&0x4000)!=0)
169 #define FD_OK(s) ((s&0x2000)!=0)
170
171 #define FD_CRC(s) ((s&0x0800)!=0)
172 #define FD_Align(s) ((s&0x0400)!=0)
173 #define FD_Resrc(s) ((s&0x0200)!=0)
174 #define FD_DMA(s) ((s&0x0100)!=0)
175 #define FD_Short(s) ((s&0x0080)!=0)
176 #define FD_NoEOF(s) ((s&0x0040)!=0)