1 #define WAVELAN_ADDR_SIZE 6
2 #define SA_ADDR0 0x08
3 #define SA_ADDR1 0x00
4 #define SA_ADDR2 0x0E
5 #define WAVELAN_MTU 1500
6
7
8
9
10 typedef struct psa_t psa_t;
11 struct psa_t
12 {
13 unsigned char psa_io_base_addr_1;
14 unsigned char psa_io_base_addr_2;
15 unsigned char psa_io_base_addr_3;
16 unsigned char psa_io_base_addr_4;
17 unsigned char psa_rem_boot_addr_1;
18 unsigned char psa_rem_boot_addr_2;
19 unsigned char psa_rem_boot_addr_3;
20 unsigned char psa_holi_params;
21 unsigned char psa_int_req_no;
22 unsigned char psa_unused0[7];
23 unsigned char psa_univ_mac_addr[WAVELAN_ADDR_SIZE];
24 unsigned char psa_local_mac_addr[WAVELAN_ADDR_SIZE];
25 unsigned char psa_univ_local_sel;
26 #define PSA_UNIVERSAL 0
27 #define PSA_LOCAL 1
28 unsigned char psa_comp_number;
29 #define PSA_COMP_PC_AT_915 0
30 #define PSA_COMP_PC_MC_915 1
31 #define PSA_COMP_PC_AT_2400 2
32 #define PSA_COMP_PC_MC_2400 3
33 #define PSA_COMP_PCMCIA_915 4
34 unsigned char psa_thr_pre_set;
35 unsigned char psa_feature_select;
36 #if 0
37 <alias for above>
38 unsigned char psa_decay_prm;
39 #endif
40 unsigned char psa_subband;
41 #define PSA_SUBBAND_915 0
42 #define PSA_SUBBAND_2425 1
43 #define PSA_SUBBAND_2460 2
44 #define PSA_SUBBAND_2484 3
45 #define PSA_SUBBAND_2430_5 4
46 #if 0
47 <alias for above>
48 unsigned char psa_decay_updat_prm;
49 #endif
50 unsigned char psa_quality_thr;
51 unsigned char psa_mod_delay;
52 unsigned char psa_nwid[2];
53 unsigned char psa_undefined;
54 unsigned char psa_encryption_select;
55 unsigned char psa_encryption_key[8];
56 unsigned char psa_databus_width;
57 unsigned char psa_call_code;
58 #if 0
59 <alias for above>
60 unsigned char psa_auto_squelch;
61 #endif
62 unsigned char psa_no_of_retries;
63 unsigned char psa_acr;
64 unsigned char psa_dump_count;
65 unsigned char psa_unused1[4];
66 unsigned char psa_nwid_prefix;
67 unsigned char psa_unused2[3];
68 unsigned char psa_conf_status;
69 unsigned char psa_crc[2];
70 unsigned char psa_crc_status;
71 };
72 #if STRUCT_CHECK == 1
73 #define PSA_SIZE 64
74 #endif
75
76
77
78
79 typedef struct mmw_t mmw_t;
80 struct mmw_t
81 {
82 unsigned char mmw_encr_key[8];
83 unsigned char mmw_encr_enable;
84 unsigned char mmw_unused0[1];
85 unsigned char mmw_des_io_invert;
86 unsigned char mmw_unused1[5];
87 unsigned char mmw_loopt_sel;
88 #define MMW_LOOPT_SEL_UNDEFINED 0x40
89 #define MMW_LOOPT_SEL_INT 0x20
90 #define MMW_LOOPT_SEL_LS 0x10
91 #define MMW_LOOPT_SEL_LT3A 0x08
92 #define MMW_LOOPT_SEL_LT3B 0x04
93 #define MMW_LOOPT_SEL_LT3C 0x02
94 #define MMW_LOOPT_SEL_LT3D 0x01
95 unsigned char mmw_jabber_enable;
96 unsigned char mmw_freeze;
97 unsigned char mmw_anten_sel;
98 #define MMW_ANTEN_SEL_SEL 0x01
99 #define MMW_ANTEN_SEL_ALG_EN 0x02
100 unsigned char mmw_ifs;
101 unsigned char mmw_mod_delay;
102 unsigned char mmw_jam_time;
103 unsigned char mmw_unused2[1];
104 unsigned char mmw_thr_pre_set;
105 unsigned char mmw_decay_prm;
106 unsigned char mmw_decay_updat_prm;
107 unsigned char mmw_quality_thr;
108 unsigned char mmw_netw_id_l;
109 unsigned char mmw_netw_id_h;
110 };
111 #if STRUCT_CHECK == 1
112 #define MMW_SIZE 30
113 #endif
114
115 #define mmwoff(p,f) (unsigned short)((void *)(&((mmw_t *)((void *)0 + (p)))->f) - (void *)0)
116
117
118
119
120 typedef struct mmr_t mmr_t;
121 struct mmr_t
122 {
123 unsigned char mmr_unused0[8];
124 unsigned char mmr_des_status;
125 unsigned char mmr_des_avail;
126 unsigned char mmr_des_io_invert;
127 unsigned char mmr_unused1[5];
128 unsigned char mmr_dce_status;
129 #define MMR_DCE_STATUS_ENERG_DET 0x01
130 #define MMR_DCE_STATUS_LOOPT_IND 0x02
131 #define MMR_DCE_STATUS_XMTITR_IND 0x04
132 #define MMR_DCE_STATUS_JBR_EXPIRED 0x08
133 unsigned char mmr_unused2[3];
134 unsigned char mmr_correct_nwid_l;
135 unsigned char mmr_correct_nwid_h;
136 unsigned char mmr_wrong_nwid_l;
137 unsigned char mmr_wrong_nwid_h;
138 unsigned char mmr_thr_pre_set;
139 unsigned char mmr_signal_lvl;
140 unsigned char mmr_silence_lvl;
141 unsigned char mmr_sgnl_qual;
142 #define MMR_SGNL_QUAL_0 0x01
143 #define MMR_SGNL_QUAL_1 0x02
144 #define MMR_SGNL_QUAL_2 0x04
145 #define MMR_SGNL_QUAL_3 0x08
146 #define MMR_SGNL_QUAL_S_A 0x80
147 unsigned char mmr_netw_id_l;
148 unsigned char mmr_unused3[1];
149 };
150 #if STRUCT_CHECK == 1
151 #define MMR_SIZE 30
152 #endif
153
154 #define MMR_LEVEL_MASK 0x3F
155
156 #define mmroff(p,f) (unsigned short)((void *)(&((mmr_t *)((void *)0 + (p)))->f) - (void *)0)
157
158
159
160
161
162 typedef union hacs_u hacs_u;
163 union hacs_u
164 {
165 unsigned short hu_command;
166 #define HACR_RESET 0x0001
167 #define HACR_CA 0x0002
168 #define HACR_16BITS 0x0004
169 #define HACR_OUT0 0x0008
170
171 #define HACR_OUT1 0x0010
172
173 #define HACR_82586_INT_ENABLE 0x0020
174 #define HACR_MMC_INT_ENABLE 0x0040
175 #define HACR_INTR_CLR_ENABLE 0x0080
176 unsigned short hu_status;
177 #define HASR_82586_INTR 0x0001
178 #define HASR_MMC_INTR 0x0002
179 #define HASR_MMC_BUSY 0x0004
180 #define HASR_PSA_BUSY 0x0008
181 };
182
183 typedef struct ha_t ha_t;
184 struct ha_t
185 {
186 hacs_u ha_cs;
187 #define ha_command ha_cs.hu_command
188 #define ha_status ha_cs.hu_status
189 unsigned short ha_mmcr;
190 unsigned short ha_pior0;
191 unsigned short ha_piop0;
192 unsigned short ha_pior1;
193 unsigned short ha_piop1;
194 unsigned short ha_pior2;
195 unsigned short ha_piop2;
196 };
197 #if STRUCT_CHECK == 1
198 #define HA_SIZE 16
199 #endif
200
201 #define hoff(p,f) (unsigned short)((void *)(&((ha_t *)((void *)0 + (p)))->f) - (void *)0)
202 #define HACR(p) hoff(p, ha_command)
203 #define HASR(p) hoff(p, ha_status)
204 #define MMCR(p) hoff(p, ha_mmcr)
205 #define PIOR0(p) hoff(p, ha_pior0)
206 #define PIOP0(p) hoff(p, ha_piop0)
207 #define PIOR1(p) hoff(p, ha_pior1)
208 #define PIOP1(p) hoff(p, ha_piop1)
209 #define PIOR2(p) hoff(p, ha_pior2)
210 #define PIOP2(p) hoff(p, ha_piop2)
211
212
213
214
215 #define STATIC_PIO 0
216
217 #define AUTOINCR_PIO 1
218
219 #define AUTODECR_PIO 2
220
221 #define PARAM_ACCESS_PIO 3
222
223 #define PIO_MASK 3
224 #define PIOM(cmd,piono) ((u_short)cmd << 10 << (piono * 2))
225
226 #define HACR_DEFAULT (HACR_OUT0 | HACR_OUT1 | HACR_16BITS | PIOM(STATIC_PIO, 0) | PIOM(AUTOINCR_PIO, 1) | PIOM(PARAM_ACCESS_PIO, 2))
227 #define HACR_INTRON (HACR_82586_INT_ENABLE | HACR_MMC_INT_ENABLE | HACR_INTR_CLR_ENABLE)
228
229 #define MAXDATAZ (WAVELAN_ADDR_SIZE + WAVELAN_ADDR_SIZE + 2 + WAVELAN_MTU)
230
231
232
233
234
235 #define OFFSET_RU 0x0000
236 #define OFFSET_CU 0x8000
237 #define OFFSET_SCB (OFFSET_ISCP - sizeof(scb_t))
238 #define OFFSET_ISCP (OFFSET_SCP - sizeof(iscp_t))
239 #define OFFSET_SCP I82586_SCP_ADDR
240
241 #define RXBLOCKZ (sizeof(fd_t) + sizeof(rbd_t) + MAXDATAZ)
242 #define TXBLOCKZ (sizeof(ac_tx_t) + sizeof(ac_nop_t) + sizeof(tbd_t) + MAXDATAZ)
243
244 #define NRXBLOCKS ((OFFSET_CU - OFFSET_RU) / RXBLOCKZ)
245 #define NTXBLOCKS ((OFFSET_SCB - OFFSET_CU) / TXBLOCKZ)
246
247
248
249
250
251
252