1 /* This header file defines some data structures used by the 3c505 driver */
2
3 /* Data units */
4 typedef unsigned char byte;
5 typedef unsigned short int word;
6 typedef unsigned long int dword;
7
8
9 /* Data structures */
10 struct Memconf {
11 word cmd_q,
12 rcv_q,
13 mcast,
14 frame,
15 rcv_b,
16 progs;
17 };
18
19 struct Rcv_pkt {
20 word buf_ofs,
21 buf_seg,
22 buf_len,
23 timeout;
24 };
25
26 struct Xmit_pkt {
27 word buf_ofs,
28 buf_seg,
29 pkt_len;
30 };
31
32 struct Rcv_resp {
33 word buf_ofs,
34 buf_seg,
35 buf_len,
36 pkt_len,
37 timeout,
38 status;
39 dword timetag;
40 };
41
42 struct Xmit_resp {
43 word buf_ofs,
44 buf_seg,
45 c_stat,
46 status;
47 };
48
49
50 struct Netstat {
51 dword tot_recv,
52 tot_xmit;
53 word err_CRC,
54 err_align,
55 err_res,
56 err_ovrrun;
57 };
58
59
60 struct Selftest {
61 word error;
62 union {
63 word ROM_cksum;
64 struct {
65 word ofs, seg;
66 } RAM;
67 word i82586;
68 } failure;
69 };
70
71 struct Info {
72 byte minor_vers,
73 major_vers;
74 word ROM_cksum,
75 RAM_sz,
76 free_ofs,
77 free_seg;
78 };
79
80 struct Memdump {
81 word size,
82 off,
83 seg;
84 };
85
86 /*
87 Primary Command Block. The most important data structure. All communication
88 between the host and the adapter is done with these. (Except for the ethernet
89 data, which has different packaging.)
90 */
91 typedef struct {
92 byte command;
93 byte length;
94 union {
95 struct Memconf memconf;
96 word configure;
97 struct Rcv_pkt rcv_pkt;
98 struct Xmit_pkt xmit_pkt;
99 byte multicast[10][6];
100 byte eth_addr[6];
101 byte failed;
102 struct Rcv_resp rcv_resp;
103 struct Xmit_resp xmit_resp;
104 struct Netstat netstat;
105 struct Selftest selftest;
106 struct Info info;
107 struct Memdump memdump;
108 byte raw[62];
109 } data;
110 } pcb_struct;
111
112 /* These defines for 'configure' */
113 #define RECV_STATION 0x00
114 #define RECV_BROAD 0x01
115 #define RECV_MULTI 0x02
116 #define RECV_ALL 0x04
117 #define NO_LOOPBACK 0x00
118 #define INT_LOOPBACK 0x08
119 #define EXT_LOOPBACK 0x10