1
2
3
4
5
6
7
8
9
10 #define PORT_COMMAND 0x00
11 #define PORT_STATUS 0x02
12 #define PORT_AUXDMA 0x02
13 #define PORT_DATA 0x04
14 #define PORT_CONTROL 0x06
15
16 #define ELP_IO_EXTENT 0x10
17
18
19
20
21 #define ATTN 0x80
22 #define FLSH 0x40
23 #define DMAE 0x20
24 #define DIR 0x10
25 #define TCEN 0x08
26 #define CMDE 0x04
27 #define HSF2 0x02
28 #define HSF1 0x01
29
30
31
32
33 #define HSF_PCB_ACK HSF1
34 #define HSF_PCB_NAK HSF2
35 #define HSF_PCB_END (HSF2|HSF1)
36 #define HSF_PCB_MASK (HSF2|HSF1)
37
38
39
40
41 #define HRDY 0x80
42 #define HCRE 0x40
43 #define ACRF 0x20
44
45 #define DONE 0x08
46 #define ASF3 0x04
47 #define ASF2 0x02
48 #define ASF1 0x01
49
50
51
52
53 #define ASF_PCB_ACK ASF1
54 #define ASF_PCB_NAK ASF2
55 #define ASF_PCB_END (ASF2|ASF1)
56 #define ASF_PCB_MASK (ASF2|ASF1)
57
58
59
60
61 #define DMA_BRST 0x01
62
63
64
65
66 #define MAX_PCB_DATA 62
67
68
69
70
71
72
73
74
75
76
77 #define TIMEOUT 300
78
79
80
81
82
83
84
85 enum {
86
87
88
89 CMD_CONFIGURE_ADAPTER_MEMORY = 0x01,
90 CMD_CONFIGURE_82586 = 0x02,
91 CMD_STATION_ADDRESS = 0x03,
92 CMD_DMA_DOWNLOAD = 0x04,
93 CMD_DMA_UPLOAD = 0x05,
94 CMD_PIO_DOWNLOAD = 0x06,
95 CMD_PIO_UPLOAD = 0x07,
96 CMD_RECEIVE_PACKET = 0x08,
97 CMD_TRANSMIT_PACKET = 0x09,
98 CMD_NETWORK_STATISTICS = 0x0a,
99 CMD_LOAD_MULTICAST_LIST = 0x0b,
100 CMD_CLEAR_PROGRAM = 0x0c,
101 CMD_DOWNLOAD_PROGRAM = 0x0d,
102 CMD_EXECUTE_PROGRAM = 0x0e,
103 CMD_SELF_TEST = 0x0f,
104 CMD_SET_STATION_ADDRESS = 0x10,
105 CMD_ADAPTER_INFO = 0x11,
106 NUM_TRANSMIT_CMDS,
107
108
109
110
111 CMD_CONFIGURE_ADAPTER_RESPONSE = 0x31,
112 CMD_CONFIGURE_82586_RESPONSE = 0x32,
113 CMD_ADDRESS_RESPONSE = 0x33,
114 CMD_DOWNLOAD_DATA_REQUEST = 0x34,
115 CMD_UPLOAD_DATA_REQUEST = 0x35,
116 CMD_RECEIVE_PACKET_COMPLETE = 0x38,
117 CMD_TRANSMIT_PACKET_COMPLETE = 0x39,
118 CMD_NETWORK_STATISTICS_RESPONSE = 0x3a,
119 CMD_LOAD_MULTICAST_RESPONSE = 0x3b,
120 CMD_CLEAR_PROGRAM_RESPONSE = 0x3c,
121 CMD_DOWNLOAD_PROGRAM_RESPONSE = 0x3d,
122 CMD_EXECUTE_RESPONSE = 0x3e,
123 CMD_SELF_TEST_RESPONSE = 0x3f,
124 CMD_SET_ADDRESS_RESPONSE = 0x40,
125 CMD_ADAPTER_INFO_RESPONSE = 0x41
126 };
127
128
129
130
131 typedef unsigned char byte;
132 typedef unsigned short int word;
133 typedef unsigned long int dword;
134
135
136 struct Memconf {
137 word cmd_q,
138 rcv_q,
139 mcast,
140 frame,
141 rcv_b,
142 progs;
143 };
144
145 struct Rcv_pkt {
146 word buf_ofs,
147 buf_seg,
148 buf_len,
149 timeout;
150 };
151
152 struct Xmit_pkt {
153 word buf_ofs,
154 buf_seg,
155 pkt_len;
156 };
157
158 struct Rcv_resp {
159 word buf_ofs,
160 buf_seg,
161 buf_len,
162 pkt_len,
163 timeout,
164 status;
165 dword timetag;
166 };
167
168 struct Xmit_resp {
169 word buf_ofs,
170 buf_seg,
171 c_stat,
172 status;
173 };
174
175
176 struct Netstat {
177 dword tot_recv,
178 tot_xmit;
179 word err_CRC,
180 err_align,
181 err_res,
182 err_ovrrun;
183 };
184
185
186 struct Selftest {
187 word error;
188 union {
189 word ROM_cksum;
190 struct {
191 word ofs, seg;
192 } RAM;
193 word i82586;
194 } failure;
195 };
196
197 struct Info {
198 byte minor_vers,
199 major_vers;
200 word ROM_cksum,
201 RAM_sz,
202 free_ofs,
203 free_seg;
204 };
205
206 struct Memdump {
207 word size,
208 off,
209 seg;
210 };
211
212
213
214
215
216
217 typedef struct {
218 byte command;
219 byte length;
220 union {
221 struct Memconf memconf;
222 word configure;
223 struct Rcv_pkt rcv_pkt;
224 struct Xmit_pkt xmit_pkt;
225 byte multicast[10][6];
226 byte eth_addr[6];
227 byte failed;
228 struct Rcv_resp rcv_resp;
229 struct Xmit_resp xmit_resp;
230 struct Netstat netstat;
231 struct Selftest selftest;
232 struct Info info;
233 struct Memdump memdump;
234 byte raw[62];
235 } data;
236 } pcb_struct;
237
238
239 #define RECV_STATION 0x00
240 #define RECV_BROAD 0x01
241 #define RECV_MULTI 0x02
242 #define RECV_PROMISC 0x04
243 #define NO_LOOPBACK 0x00
244 #define INT_LOOPBACK 0x08
245 #define EXT_LOOPBACK 0x10