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