]>
Commit | Line | Data |
---|---|---|
00b3ed16 GKH |
1 | /* hfa384x.h |
2 | * | |
3 | * Defines the constants and data structures for the hfa384x | |
4 | * | |
5 | * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. | |
6 | * -------------------------------------------------------------------- | |
7 | * | |
8 | * linux-wlan | |
9 | * | |
10 | * The contents of this file are subject to the Mozilla Public | |
11 | * License Version 1.1 (the "License"); you may not use this file | |
12 | * except in compliance with the License. You may obtain a copy of | |
13 | * the License at http://www.mozilla.org/MPL/ | |
14 | * | |
15 | * Software distributed under the License is distributed on an "AS | |
16 | * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or | |
17 | * implied. See the License for the specific language governing | |
18 | * rights and limitations under the License. | |
19 | * | |
20 | * Alternatively, the contents of this file may be used under the | |
21 | * terms of the GNU Public License version 2 (the "GPL"), in which | |
22 | * case the provisions of the GPL are applicable instead of the | |
23 | * above. If you wish to allow the use of your version of this file | |
24 | * only under the terms of the GPL and not to allow others to use | |
25 | * your version of this file under the MPL, indicate your decision | |
26 | * by deleting the provisions above and replace them with the notice | |
27 | * and other provisions required by the GPL. If you do not delete | |
28 | * the provisions above, a recipient may use your version of this | |
29 | * file under either the MPL or the GPL. | |
30 | * | |
31 | * -------------------------------------------------------------------- | |
32 | * | |
33 | * Inquiries regarding the linux-wlan Open Source project can be | |
34 | * made directly to: | |
35 | * | |
36 | * AbsoluteValue Systems Inc. | |
37 | * info@linux-wlan.com | |
38 | * http://www.linux-wlan.com | |
39 | * | |
40 | * -------------------------------------------------------------------- | |
41 | * | |
42 | * Portions of the development of this software were funded by | |
43 | * Intersil Corporation as part of PRISM(R) chipset product development. | |
44 | * | |
45 | * -------------------------------------------------------------------- | |
46 | * | |
47 | * [Implementation and usage notes] | |
48 | * | |
49 | * [References] | |
50 | * CW10 Programmer's Manual v1.5 | |
51 | * IEEE 802.11 D10.0 | |
52 | * | |
53 | * -------------------------------------------------------------------- | |
54 | */ | |
55 | ||
56 | #ifndef _HFA384x_H | |
57 | #define _HFA384x_H | |
58 | ||
59 | /*=============================================================*/ | |
60 | #define HFA384x_FIRMWARE_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) | |
61 | ||
62 | #define HFA384x_LEVEL_TO_dBm(v) (0x100 + (v) * 100 / 255 - 100) | |
63 | ||
64 | /*------ Constants --------------------------------------------*/ | |
65 | /*--- Mins & Maxs -----------------------------------*/ | |
66 | #define HFA384x_CMD_ALLOC_LEN_MIN ((UINT16)4) | |
67 | #define HFA384x_CMD_ALLOC_LEN_MAX ((UINT16)2400) | |
68 | #define HFA384x_BAP_DATALEN_MAX ((UINT16)4096) | |
69 | #define HFA384x_BAP_OFFSET_MAX ((UINT16)4096) | |
70 | #define HFA384x_PORTID_MAX ((UINT16)7) | |
71 | #define HFA384x_NUMPORTS_MAX ((UINT16)(HFA384x_PORTID_MAX+1)) | |
72 | #define HFA384x_PDR_LEN_MAX ((UINT16)512) /* in bytes, from EK */ | |
73 | #define HFA384x_PDA_RECS_MAX ((UINT16)200) /* a guess */ | |
74 | #define HFA384x_PDA_LEN_MAX ((UINT16)1024) /* in bytes, from EK */ | |
75 | #define HFA384x_SCANRESULT_MAX ((UINT16)31) | |
76 | #define HFA384x_HSCANRESULT_MAX ((UINT16)31) | |
77 | #define HFA384x_CHINFORESULT_MAX ((UINT16)16) | |
78 | #define HFA384x_DRVR_FIDSTACKLEN_MAX (10) | |
79 | #define HFA384x_DRVR_TXBUF_MAX (sizeof(hfa384x_tx_frame_t) + \ | |
80 | WLAN_DATA_MAXLEN - \ | |
81 | WLAN_WEP_IV_LEN - \ | |
82 | WLAN_WEP_ICV_LEN + 2) | |
83 | #define HFA384x_DRVR_MAGIC (0x4a2d) | |
84 | #define HFA384x_INFODATA_MAXLEN (sizeof(hfa384x_infodata_t)) | |
85 | #define HFA384x_INFOFRM_MAXLEN (sizeof(hfa384x_InfFrame_t)) | |
86 | #define HFA384x_RID_GUESSING_MAXLEN 2048 /* I'm not really sure */ | |
87 | #define HFA384x_RIDDATA_MAXLEN HFA384x_RID_GUESSING_MAXLEN | |
88 | #define HFA384x_USB_RWMEM_MAXLEN 2048 | |
89 | ||
90 | /*--- Support Constants -----------------------------*/ | |
91 | #define HFA384x_BAP_PROC ((UINT16)0) | |
92 | #define HFA384x_BAP_INT ((UINT16)1) | |
93 | #define HFA384x_PORTTYPE_IBSS ((UINT16)0) | |
94 | #define HFA384x_PORTTYPE_BSS ((UINT16)1) | |
95 | #define HFA384x_PORTTYPE_WDS ((UINT16)2) | |
96 | #define HFA384x_PORTTYPE_PSUEDOIBSS ((UINT16)3) | |
97 | #define HFA384x_PORTTYPE_HOSTAP ((UINT16)6) | |
98 | #define HFA384x_WEPFLAGS_PRIVINVOKED ((UINT16)BIT0) | |
99 | #define HFA384x_WEPFLAGS_EXCLUDE ((UINT16)BIT1) | |
100 | #define HFA384x_WEPFLAGS_DISABLE_TXCRYPT ((UINT16)BIT4) | |
101 | #define HFA384x_WEPFLAGS_DISABLE_RXCRYPT ((UINT16)BIT7) | |
102 | #define HFA384x_WEPFLAGS_DISALLOW_MIXED ((UINT16)BIT11) | |
103 | #define HFA384x_WEPFLAGS_IV_INTERVAL1 ((UINT16)0) | |
104 | #define HFA384x_WEPFLAGS_IV_INTERVAL10 ((UINT16)BIT5) | |
105 | #define HFA384x_WEPFLAGS_IV_INTERVAL50 ((UINT16)BIT6) | |
106 | #define HFA384x_WEPFLAGS_IV_INTERVAL100 ((UINT16)(BIT5 | BIT6)) | |
107 | #define HFA384x_WEPFLAGS_FIRMWARE_WPA ((UINT16)BIT8) | |
108 | #define HFA384x_WEPFLAGS_HOST_MIC ((UINT16)BIT9) | |
109 | #define HFA384x_ROAMMODE_FWSCAN_FWROAM ((UINT16)1) | |
110 | #define HFA384x_ROAMMODE_FWSCAN_HOSTROAM ((UINT16)2) | |
111 | #define HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM ((UINT16)3) | |
112 | #define HFA384x_PORTSTATUS_DISABLED ((UINT16)1) | |
113 | #define HFA384x_PORTSTATUS_INITSRCH ((UINT16)2) | |
114 | #define HFA384x_PORTSTATUS_CONN_IBSS ((UINT16)3) | |
115 | #define HFA384x_PORTSTATUS_CONN_ESS ((UINT16)4) | |
116 | #define HFA384x_PORTSTATUS_OOR_ESS ((UINT16)5) | |
117 | #define HFA384x_PORTSTATUS_CONN_WDS ((UINT16)6) | |
118 | #define HFA384x_PORTSTATUS_HOSTAP ((UINT16)8) | |
119 | #define HFA384x_RATEBIT_1 ((UINT16)1) | |
120 | #define HFA384x_RATEBIT_2 ((UINT16)2) | |
121 | #define HFA384x_RATEBIT_5dot5 ((UINT16)4) | |
122 | #define HFA384x_RATEBIT_11 ((UINT16)8) | |
123 | ||
124 | /*--- Just some symbolic names for legibility -------*/ | |
125 | #define HFA384x_TXCMD_NORECL ((UINT16)0) | |
126 | #define HFA384x_TXCMD_RECL ((UINT16)1) | |
127 | ||
128 | /*--- MAC Internal memory constants and macros ------*/ | |
129 | /* masks and macros used to manipulate MAC internal memory addresses. */ | |
130 | /* MAC internal memory addresses are 23 bit quantities. The MAC uses | |
131 | * a paged address space where the upper 16 bits are the page number | |
132 | * and the lower 7 bits are the offset. There are various Host API | |
133 | * elements that require two 16-bit quantities to specify a MAC | |
134 | * internal memory address. Unfortunately, some of the API's use a | |
135 | * page/offset format where the offset value is JUST the lower seven | |
136 | * bits and the page is the remaining 16 bits. Some of the API's | |
137 | * assume that the 23 bit address has been split at the 16th bit. We | |
138 | * refer to these two formats as AUX format and CMD format. The | |
139 | * macros below help handle some of this. | |
140 | */ | |
141 | ||
142 | /* Handy constant */ | |
143 | #define HFA384x_ADDR_AUX_OFF_MAX ((UINT16)0x007f) | |
144 | ||
145 | /* Mask bits for discarding unwanted pieces in a flat address */ | |
146 | #define HFA384x_ADDR_FLAT_AUX_PAGE_MASK (0x007fff80) | |
147 | #define HFA384x_ADDR_FLAT_AUX_OFF_MASK (0x0000007f) | |
148 | #define HFA384x_ADDR_FLAT_CMD_PAGE_MASK (0xffff0000) | |
149 | #define HFA384x_ADDR_FLAT_CMD_OFF_MASK (0x0000ffff) | |
150 | ||
151 | /* Mask bits for discarding unwanted pieces in AUX format 16-bit address parts */ | |
152 | #define HFA384x_ADDR_AUX_PAGE_MASK (0xffff) | |
153 | #define HFA384x_ADDR_AUX_OFF_MASK (0x007f) | |
154 | ||
155 | /* Mask bits for discarding unwanted pieces in CMD format 16-bit address parts */ | |
156 | #define HFA384x_ADDR_CMD_PAGE_MASK (0x007f) | |
157 | #define HFA384x_ADDR_CMD_OFF_MASK (0xffff) | |
158 | ||
159 | /* Make a 32-bit flat address from AUX format 16-bit page and offset */ | |
160 | #define HFA384x_ADDR_AUX_MKFLAT(p,o) \ | |
161 | (((UINT32)(((UINT16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) <<7) | \ | |
162 | ((UINT32)(((UINT16)(o))&HFA384x_ADDR_AUX_OFF_MASK)) | |
163 | ||
164 | /* Make a 32-bit flat address from CMD format 16-bit page and offset */ | |
165 | #define HFA384x_ADDR_CMD_MKFLAT(p,o) \ | |
166 | (((UINT32)(((UINT16)(p))&HFA384x_ADDR_CMD_PAGE_MASK)) <<16) | \ | |
167 | ((UINT32)(((UINT16)(o))&HFA384x_ADDR_CMD_OFF_MASK)) | |
168 | ||
169 | /* Make AUX format offset and page from a 32-bit flat address */ | |
170 | #define HFA384x_ADDR_AUX_MKPAGE(f) \ | |
171 | ((UINT16)((((UINT32)(f))&HFA384x_ADDR_FLAT_AUX_PAGE_MASK)>>7)) | |
172 | #define HFA384x_ADDR_AUX_MKOFF(f) \ | |
173 | ((UINT16)(((UINT32)(f))&HFA384x_ADDR_FLAT_AUX_OFF_MASK)) | |
174 | ||
175 | /* Make CMD format offset and page from a 32-bit flat address */ | |
176 | #define HFA384x_ADDR_CMD_MKPAGE(f) \ | |
177 | ((UINT16)((((UINT32)(f))&HFA384x_ADDR_FLAT_CMD_PAGE_MASK)>>16)) | |
178 | #define HFA384x_ADDR_CMD_MKOFF(f) \ | |
179 | ((UINT16)(((UINT32)(f))&HFA384x_ADDR_FLAT_CMD_OFF_MASK)) | |
180 | ||
181 | /*--- Aux register masks/tests ----------------------*/ | |
182 | /* Some of the upper bits of the AUX offset register are used to */ | |
183 | /* select address space. */ | |
184 | #define HFA384x_AUX_CTL_EXTDS (0x00) | |
185 | #define HFA384x_AUX_CTL_NV (0x01) | |
186 | #define HFA384x_AUX_CTL_PHY (0x02) | |
187 | #define HFA384x_AUX_CTL_ICSRAM (0x03) | |
188 | ||
189 | /* Make AUX register offset and page values from a flat address */ | |
190 | #define HFA384x_AUX_MKOFF(f, c) \ | |
191 | (HFA384x_ADDR_AUX_MKOFF(f) | (((UINT16)(c))<<12)) | |
192 | #define HFA384x_AUX_MKPAGE(f) HFA384x_ADDR_AUX_MKPAGE(f) | |
193 | ||
194 | ||
195 | /*--- Controller Memory addresses -------------------*/ | |
196 | #define HFA3842_PDA_BASE (0x007f0000UL) | |
197 | #define HFA3841_PDA_BASE (0x003f0000UL) | |
198 | #define HFA3841_PDA_BOGUS_BASE (0x00390000UL) | |
199 | ||
200 | /*--- Driver Download states -----------------------*/ | |
201 | #define HFA384x_DLSTATE_DISABLED 0 | |
202 | #define HFA384x_DLSTATE_RAMENABLED 1 | |
203 | #define HFA384x_DLSTATE_FLASHENABLED 2 | |
204 | #define HFA384x_DLSTATE_FLASHWRITTEN 3 | |
205 | #define HFA384x_DLSTATE_FLASHWRITEPENDING 4 | |
206 | #define HFA384x_DLSTATE_GENESIS 5 | |
207 | ||
208 | /*--- Register I/O offsets --------------------------*/ | |
209 | #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) | |
210 | ||
211 | #define HFA384x_CMD_OFF (0x00) | |
212 | #define HFA384x_PARAM0_OFF (0x02) | |
213 | #define HFA384x_PARAM1_OFF (0x04) | |
214 | #define HFA384x_PARAM2_OFF (0x06) | |
215 | #define HFA384x_STATUS_OFF (0x08) | |
216 | #define HFA384x_RESP0_OFF (0x0A) | |
217 | #define HFA384x_RESP1_OFF (0x0C) | |
218 | #define HFA384x_RESP2_OFF (0x0E) | |
219 | #define HFA384x_INFOFID_OFF (0x10) | |
220 | #define HFA384x_RXFID_OFF (0x20) | |
221 | #define HFA384x_ALLOCFID_OFF (0x22) | |
222 | #define HFA384x_TXCOMPLFID_OFF (0x24) | |
223 | #define HFA384x_SELECT0_OFF (0x18) | |
224 | #define HFA384x_OFFSET0_OFF (0x1C) | |
225 | #define HFA384x_DATA0_OFF (0x36) | |
226 | #define HFA384x_SELECT1_OFF (0x1A) | |
227 | #define HFA384x_OFFSET1_OFF (0x1E) | |
228 | #define HFA384x_DATA1_OFF (0x38) | |
229 | #define HFA384x_EVSTAT_OFF (0x30) | |
230 | #define HFA384x_INTEN_OFF (0x32) | |
231 | #define HFA384x_EVACK_OFF (0x34) | |
232 | #define HFA384x_CONTROL_OFF (0x14) | |
233 | #define HFA384x_SWSUPPORT0_OFF (0x28) | |
234 | #define HFA384x_SWSUPPORT1_OFF (0x2A) | |
235 | #define HFA384x_SWSUPPORT2_OFF (0x2C) | |
236 | #define HFA384x_AUXPAGE_OFF (0x3A) | |
237 | #define HFA384x_AUXOFFSET_OFF (0x3C) | |
238 | #define HFA384x_AUXDATA_OFF (0x3E) | |
239 | ||
240 | #elif (WLAN_HOSTIF == WLAN_PCI || WLAN_HOSTIF == WLAN_USB) | |
241 | ||
242 | #define HFA384x_CMD_OFF (0x00) | |
243 | #define HFA384x_PARAM0_OFF (0x04) | |
244 | #define HFA384x_PARAM1_OFF (0x08) | |
245 | #define HFA384x_PARAM2_OFF (0x0c) | |
246 | #define HFA384x_STATUS_OFF (0x10) | |
247 | #define HFA384x_RESP0_OFF (0x14) | |
248 | #define HFA384x_RESP1_OFF (0x18) | |
249 | #define HFA384x_RESP2_OFF (0x1c) | |
250 | #define HFA384x_INFOFID_OFF (0x20) | |
251 | #define HFA384x_RXFID_OFF (0x40) | |
252 | #define HFA384x_ALLOCFID_OFF (0x44) | |
253 | #define HFA384x_TXCOMPLFID_OFF (0x48) | |
254 | #define HFA384x_SELECT0_OFF (0x30) | |
255 | #define HFA384x_OFFSET0_OFF (0x38) | |
256 | #define HFA384x_DATA0_OFF (0x6c) | |
257 | #define HFA384x_SELECT1_OFF (0x34) | |
258 | #define HFA384x_OFFSET1_OFF (0x3c) | |
259 | #define HFA384x_DATA1_OFF (0x70) | |
260 | #define HFA384x_EVSTAT_OFF (0x60) | |
261 | #define HFA384x_INTEN_OFF (0x64) | |
262 | #define HFA384x_EVACK_OFF (0x68) | |
263 | #define HFA384x_CONTROL_OFF (0x28) | |
264 | #define HFA384x_SWSUPPORT0_OFF (0x50) | |
265 | #define HFA384x_SWSUPPORT1_OFF (0x54) | |
266 | #define HFA384x_SWSUPPORT2_OFF (0x58) | |
267 | #define HFA384x_AUXPAGE_OFF (0x74) | |
268 | #define HFA384x_AUXOFFSET_OFF (0x78) | |
269 | #define HFA384x_AUXDATA_OFF (0x7c) | |
270 | #define HFA384x_PCICOR_OFF (0x4c) | |
271 | #define HFA384x_PCIHCR_OFF (0x5c) | |
272 | #define HFA384x_PCI_M0_ADDRH_OFF (0x80) | |
273 | #define HFA384x_PCI_M0_ADDRL_OFF (0x84) | |
274 | #define HFA384x_PCI_M0_LEN_OFF (0x88) | |
275 | #define HFA384x_PCI_M0_CTL_OFF (0x8c) | |
276 | #define HFA384x_PCI_STATUS_OFF (0x98) | |
277 | #define HFA384x_PCI_M1_ADDRH_OFF (0xa0) | |
278 | #define HFA384x_PCI_M1_ADDRL_OFF (0xa4) | |
279 | #define HFA384x_PCI_M1_LEN_OFF (0xa8) | |
280 | #define HFA384x_PCI_M1_CTL_OFF (0xac) | |
281 | ||
282 | #endif | |
283 | ||
284 | /*--- Register Field Masks --------------------------*/ | |
285 | #define HFA384x_CMD_BUSY ((UINT16)BIT15) | |
286 | #define HFA384x_CMD_AINFO ((UINT16)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8)) | |
287 | #define HFA384x_CMD_MACPORT ((UINT16)(BIT10 | BIT9 | BIT8)) | |
288 | #define HFA384x_CMD_RECL ((UINT16)BIT8) | |
289 | #define HFA384x_CMD_WRITE ((UINT16)BIT8) | |
290 | #define HFA384x_CMD_PROGMODE ((UINT16)(BIT9 | BIT8)) | |
291 | #define HFA384x_CMD_CMDCODE ((UINT16)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0)) | |
292 | ||
293 | #define HFA384x_STATUS_RESULT ((UINT16)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8)) | |
294 | #define HFA384x_STATUS_CMDCODE ((UINT16)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0)) | |
295 | ||
296 | #define HFA384x_OFFSET_BUSY ((UINT16)BIT15) | |
297 | #define HFA384x_OFFSET_ERR ((UINT16)BIT14) | |
298 | #define HFA384x_OFFSET_DATAOFF ((UINT16)(BIT11 | BIT10 | BIT9 | BIT8 | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1)) | |
299 | ||
300 | #define HFA384x_EVSTAT_TICK ((UINT16)BIT15) | |
301 | #define HFA384x_EVSTAT_WTERR ((UINT16)BIT14) | |
302 | #define HFA384x_EVSTAT_INFDROP ((UINT16)BIT13) | |
303 | #define HFA384x_EVSTAT_INFO ((UINT16)BIT7) | |
304 | #define HFA384x_EVSTAT_DTIM ((UINT16)BIT5) | |
305 | #define HFA384x_EVSTAT_CMD ((UINT16)BIT4) | |
306 | #define HFA384x_EVSTAT_ALLOC ((UINT16)BIT3) | |
307 | #define HFA384x_EVSTAT_TXEXC ((UINT16)BIT2) | |
308 | #define HFA384x_EVSTAT_TX ((UINT16)BIT1) | |
309 | #define HFA384x_EVSTAT_RX ((UINT16)BIT0) | |
310 | ||
311 | #define HFA384x_INT_BAP_OP (HFA384x_EVSTAT_INFO|HFA384x_EVSTAT_RX|HFA384x_EVSTAT_TX|HFA384x_EVSTAT_TXEXC) | |
312 | ||
313 | #define HFA384x_INT_NORMAL (HFA384x_EVSTAT_INFO|HFA384x_EVSTAT_RX|HFA384x_EVSTAT_TX|HFA384x_EVSTAT_TXEXC|HFA384x_EVSTAT_INFDROP|HFA384x_EVSTAT_ALLOC|HFA384x_EVSTAT_DTIM) | |
314 | ||
315 | #define HFA384x_INTEN_TICK ((UINT16)BIT15) | |
316 | #define HFA384x_INTEN_WTERR ((UINT16)BIT14) | |
317 | #define HFA384x_INTEN_INFDROP ((UINT16)BIT13) | |
318 | #define HFA384x_INTEN_INFO ((UINT16)BIT7) | |
319 | #define HFA384x_INTEN_DTIM ((UINT16)BIT5) | |
320 | #define HFA384x_INTEN_CMD ((UINT16)BIT4) | |
321 | #define HFA384x_INTEN_ALLOC ((UINT16)BIT3) | |
322 | #define HFA384x_INTEN_TXEXC ((UINT16)BIT2) | |
323 | #define HFA384x_INTEN_TX ((UINT16)BIT1) | |
324 | #define HFA384x_INTEN_RX ((UINT16)BIT0) | |
325 | ||
326 | #define HFA384x_EVACK_TICK ((UINT16)BIT15) | |
327 | #define HFA384x_EVACK_WTERR ((UINT16)BIT14) | |
328 | #define HFA384x_EVACK_INFDROP ((UINT16)BIT13) | |
329 | #define HFA384x_EVACK_INFO ((UINT16)BIT7) | |
330 | #define HFA384x_EVACK_DTIM ((UINT16)BIT5) | |
331 | #define HFA384x_EVACK_CMD ((UINT16)BIT4) | |
332 | #define HFA384x_EVACK_ALLOC ((UINT16)BIT3) | |
333 | #define HFA384x_EVACK_TXEXC ((UINT16)BIT2) | |
334 | #define HFA384x_EVACK_TX ((UINT16)BIT1) | |
335 | #define HFA384x_EVACK_RX ((UINT16)BIT0) | |
336 | ||
337 | #define HFA384x_CONTROL_AUXEN ((UINT16)(BIT15 | BIT14)) | |
338 | ||
339 | ||
340 | /*--- Command Code Constants --------------------------*/ | |
341 | /*--- Controller Commands --------------------------*/ | |
342 | #define HFA384x_CMDCODE_INIT ((UINT16)0x00) | |
343 | #define HFA384x_CMDCODE_ENABLE ((UINT16)0x01) | |
344 | #define HFA384x_CMDCODE_DISABLE ((UINT16)0x02) | |
345 | #define HFA384x_CMDCODE_DIAG ((UINT16)0x03) | |
346 | ||
347 | /*--- Buffer Mgmt Commands --------------------------*/ | |
348 | #define HFA384x_CMDCODE_ALLOC ((UINT16)0x0A) | |
349 | #define HFA384x_CMDCODE_TX ((UINT16)0x0B) | |
350 | #define HFA384x_CMDCODE_CLRPRST ((UINT16)0x12) | |
351 | ||
352 | /*--- Regulate Commands --------------------------*/ | |
353 | #define HFA384x_CMDCODE_NOTIFY ((UINT16)0x10) | |
354 | #define HFA384x_CMDCODE_INQ ((UINT16)0x11) | |
355 | ||
356 | /*--- Configure Commands --------------------------*/ | |
357 | #define HFA384x_CMDCODE_ACCESS ((UINT16)0x21) | |
358 | #define HFA384x_CMDCODE_DOWNLD ((UINT16)0x22) | |
359 | ||
360 | /*--- Debugging Commands -----------------------------*/ | |
361 | #define HFA384x_CMDCODE_MONITOR ((UINT16)(0x38)) | |
362 | #define HFA384x_MONITOR_ENABLE ((UINT16)(0x0b)) | |
363 | #define HFA384x_MONITOR_DISABLE ((UINT16)(0x0f)) | |
364 | ||
365 | /*--- Result Codes --------------------------*/ | |
366 | #define HFA384x_SUCCESS ((UINT16)(0x00)) | |
367 | #define HFA384x_CARD_FAIL ((UINT16)(0x01)) | |
368 | #define HFA384x_NO_BUFF ((UINT16)(0x05)) | |
369 | #define HFA384x_CMD_ERR ((UINT16)(0x7F)) | |
370 | ||
371 | /*--- Programming Modes -------------------------- | |
372 | MODE 0: Disable programming | |
373 | MODE 1: Enable volatile memory programming | |
374 | MODE 2: Enable non-volatile memory programming | |
375 | MODE 3: Program non-volatile memory section | |
376 | --------------------------------------------------*/ | |
377 | #define HFA384x_PROGMODE_DISABLE ((UINT16)0x00) | |
378 | #define HFA384x_PROGMODE_RAM ((UINT16)0x01) | |
379 | #define HFA384x_PROGMODE_NV ((UINT16)0x02) | |
380 | #define HFA384x_PROGMODE_NVWRITE ((UINT16)0x03) | |
381 | ||
382 | /*--- AUX register enable --------------------------*/ | |
383 | #define HFA384x_AUXPW0 ((UINT16)0xfe01) | |
384 | #define HFA384x_AUXPW1 ((UINT16)0xdc23) | |
385 | #define HFA384x_AUXPW2 ((UINT16)0xba45) | |
386 | ||
387 | #define HFA384x_CONTROL_AUX_ISDISABLED ((UINT16)0x0000) | |
388 | #define HFA384x_CONTROL_AUX_ISENABLED ((UINT16)0xc000) | |
389 | #define HFA384x_CONTROL_AUX_DOENABLE ((UINT16)0x8000) | |
390 | #define HFA384x_CONTROL_AUX_DODISABLE ((UINT16)0x4000) | |
391 | ||
392 | /*--- Record ID Constants --------------------------*/ | |
393 | /*-------------------------------------------------------------------- | |
394 | Configuration RIDs: Network Parameters, Static Configuration Entities | |
395 | --------------------------------------------------------------------*/ | |
396 | #define HFA384x_RID_CNFPORTTYPE ((UINT16)0xFC00) | |
397 | #define HFA384x_RID_CNFOWNMACADDR ((UINT16)0xFC01) | |
398 | #define HFA384x_RID_CNFDESIREDSSID ((UINT16)0xFC02) | |
399 | #define HFA384x_RID_CNFOWNCHANNEL ((UINT16)0xFC03) | |
400 | #define HFA384x_RID_CNFOWNSSID ((UINT16)0xFC04) | |
401 | #define HFA384x_RID_CNFOWNATIMWIN ((UINT16)0xFC05) | |
402 | #define HFA384x_RID_CNFSYSSCALE ((UINT16)0xFC06) | |
403 | #define HFA384x_RID_CNFMAXDATALEN ((UINT16)0xFC07) | |
404 | #define HFA384x_RID_CNFWDSADDR ((UINT16)0xFC08) | |
405 | #define HFA384x_RID_CNFPMENABLED ((UINT16)0xFC09) | |
406 | #define HFA384x_RID_CNFPMEPS ((UINT16)0xFC0A) | |
407 | #define HFA384x_RID_CNFMULTICASTRX ((UINT16)0xFC0B) | |
408 | #define HFA384x_RID_CNFMAXSLEEPDUR ((UINT16)0xFC0C) | |
409 | #define HFA384x_RID_CNFPMHOLDDUR ((UINT16)0xFC0D) | |
410 | #define HFA384x_RID_CNFOWNNAME ((UINT16)0xFC0E) | |
411 | #define HFA384x_RID_CNFOWNDTIMPER ((UINT16)0xFC10) | |
412 | #define HFA384x_RID_CNFWDSADDR1 ((UINT16)0xFC11) | |
413 | #define HFA384x_RID_CNFWDSADDR2 ((UINT16)0xFC12) | |
414 | #define HFA384x_RID_CNFWDSADDR3 ((UINT16)0xFC13) | |
415 | #define HFA384x_RID_CNFWDSADDR4 ((UINT16)0xFC14) | |
416 | #define HFA384x_RID_CNFWDSADDR5 ((UINT16)0xFC15) | |
417 | #define HFA384x_RID_CNFWDSADDR6 ((UINT16)0xFC16) | |
418 | #define HFA384x_RID_CNFMCASTPMBUFF ((UINT16)0xFC17) | |
419 | ||
420 | /*-------------------------------------------------------------------- | |
421 | Configuration RID lengths: Network Params, Static Config Entities | |
422 | This is the length of JUST the DATA part of the RID (does not | |
423 | include the len or code fields) | |
424 | --------------------------------------------------------------------*/ | |
425 | /* TODO: fill in the rest of these */ | |
426 | #define HFA384x_RID_CNFPORTTYPE_LEN ((UINT16)2) | |
427 | #define HFA384x_RID_CNFOWNMACADDR_LEN ((UINT16)6) | |
428 | #define HFA384x_RID_CNFDESIREDSSID_LEN ((UINT16)34) | |
429 | #define HFA384x_RID_CNFOWNCHANNEL_LEN ((UINT16)2) | |
430 | #define HFA384x_RID_CNFOWNSSID_LEN ((UINT16)34) | |
431 | #define HFA384x_RID_CNFOWNATIMWIN_LEN ((UINT16)2) | |
432 | #define HFA384x_RID_CNFSYSSCALE_LEN ((UINT16)0) | |
433 | #define HFA384x_RID_CNFMAXDATALEN_LEN ((UINT16)0) | |
434 | #define HFA384x_RID_CNFWDSADDR_LEN ((UINT16)6) | |
435 | #define HFA384x_RID_CNFPMENABLED_LEN ((UINT16)0) | |
436 | #define HFA384x_RID_CNFPMEPS_LEN ((UINT16)0) | |
437 | #define HFA384x_RID_CNFMULTICASTRX_LEN ((UINT16)0) | |
438 | #define HFA384x_RID_CNFMAXSLEEPDUR_LEN ((UINT16)0) | |
439 | #define HFA384x_RID_CNFPMHOLDDUR_LEN ((UINT16)0) | |
440 | #define HFA384x_RID_CNFOWNNAME_LEN ((UINT16)34) | |
441 | #define HFA384x_RID_CNFOWNDTIMPER_LEN ((UINT16)0) | |
442 | #define HFA384x_RID_CNFWDSADDR1_LEN ((UINT16)6) | |
443 | #define HFA384x_RID_CNFWDSADDR2_LEN ((UINT16)6) | |
444 | #define HFA384x_RID_CNFWDSADDR3_LEN ((UINT16)6) | |
445 | #define HFA384x_RID_CNFWDSADDR4_LEN ((UINT16)6) | |
446 | #define HFA384x_RID_CNFWDSADDR5_LEN ((UINT16)6) | |
447 | #define HFA384x_RID_CNFWDSADDR6_LEN ((UINT16)6) | |
448 | #define HFA384x_RID_CNFMCASTPMBUFF_LEN ((UINT16)0) | |
449 | #define HFA384x_RID_CNFAUTHENTICATION_LEN ((UINT16)sizeof(UINT16)) | |
450 | #define HFA384x_RID_CNFMAXSLEEPDUR_LEN ((UINT16)0) | |
451 | ||
452 | /*-------------------------------------------------------------------- | |
453 | Configuration RIDs: Network Parameters, Dynamic Configuration Entities | |
454 | --------------------------------------------------------------------*/ | |
455 | #define HFA384x_RID_GROUPADDR ((UINT16)0xFC80) | |
456 | #define HFA384x_RID_CREATEIBSS ((UINT16)0xFC81) | |
457 | #define HFA384x_RID_FRAGTHRESH ((UINT16)0xFC82) | |
458 | #define HFA384x_RID_RTSTHRESH ((UINT16)0xFC83) | |
459 | #define HFA384x_RID_TXRATECNTL ((UINT16)0xFC84) | |
460 | #define HFA384x_RID_PROMISCMODE ((UINT16)0xFC85) | |
461 | #define HFA384x_RID_FRAGTHRESH0 ((UINT16)0xFC90) | |
462 | #define HFA384x_RID_FRAGTHRESH1 ((UINT16)0xFC91) | |
463 | #define HFA384x_RID_FRAGTHRESH2 ((UINT16)0xFC92) | |
464 | #define HFA384x_RID_FRAGTHRESH3 ((UINT16)0xFC93) | |
465 | #define HFA384x_RID_FRAGTHRESH4 ((UINT16)0xFC94) | |
466 | #define HFA384x_RID_FRAGTHRESH5 ((UINT16)0xFC95) | |
467 | #define HFA384x_RID_FRAGTHRESH6 ((UINT16)0xFC96) | |
468 | #define HFA384x_RID_RTSTHRESH0 ((UINT16)0xFC97) | |
469 | #define HFA384x_RID_RTSTHRESH1 ((UINT16)0xFC98) | |
470 | #define HFA384x_RID_RTSTHRESH2 ((UINT16)0xFC99) | |
471 | #define HFA384x_RID_RTSTHRESH3 ((UINT16)0xFC9A) | |
472 | #define HFA384x_RID_RTSTHRESH4 ((UINT16)0xFC9B) | |
473 | #define HFA384x_RID_RTSTHRESH5 ((UINT16)0xFC9C) | |
474 | #define HFA384x_RID_RTSTHRESH6 ((UINT16)0xFC9D) | |
475 | #define HFA384x_RID_TXRATECNTL0 ((UINT16)0xFC9E) | |
476 | #define HFA384x_RID_TXRATECNTL1 ((UINT16)0xFC9F) | |
477 | #define HFA384x_RID_TXRATECNTL2 ((UINT16)0xFCA0) | |
478 | #define HFA384x_RID_TXRATECNTL3 ((UINT16)0xFCA1) | |
479 | #define HFA384x_RID_TXRATECNTL4 ((UINT16)0xFCA2) | |
480 | #define HFA384x_RID_TXRATECNTL5 ((UINT16)0xFCA3) | |
481 | #define HFA384x_RID_TXRATECNTL6 ((UINT16)0xFCA4) | |
482 | ||
483 | /*-------------------------------------------------------------------- | |
484 | Configuration RID Lengths: Network Param, Dynamic Config Entities | |
485 | This is the length of JUST the DATA part of the RID (does not | |
486 | include the len or code fields) | |
487 | --------------------------------------------------------------------*/ | |
488 | /* TODO: fill in the rest of these */ | |
489 | #define HFA384x_RID_GROUPADDR_LEN ((UINT16)16 * WLAN_ADDR_LEN) | |
490 | #define HFA384x_RID_CREATEIBSS_LEN ((UINT16)0) | |
491 | #define HFA384x_RID_FRAGTHRESH_LEN ((UINT16)0) | |
492 | #define HFA384x_RID_RTSTHRESH_LEN ((UINT16)0) | |
493 | #define HFA384x_RID_TXRATECNTL_LEN ((UINT16)4) | |
494 | #define HFA384x_RID_PROMISCMODE_LEN ((UINT16)2) | |
495 | #define HFA384x_RID_FRAGTHRESH0_LEN ((UINT16)0) | |
496 | #define HFA384x_RID_FRAGTHRESH1_LEN ((UINT16)0) | |
497 | #define HFA384x_RID_FRAGTHRESH2_LEN ((UINT16)0) | |
498 | #define HFA384x_RID_FRAGTHRESH3_LEN ((UINT16)0) | |
499 | #define HFA384x_RID_FRAGTHRESH4_LEN ((UINT16)0) | |
500 | #define HFA384x_RID_FRAGTHRESH5_LEN ((UINT16)0) | |
501 | #define HFA384x_RID_FRAGTHRESH6_LEN ((UINT16)0) | |
502 | #define HFA384x_RID_RTSTHRESH0_LEN ((UINT16)0) | |
503 | #define HFA384x_RID_RTSTHRESH1_LEN ((UINT16)0) | |
504 | #define HFA384x_RID_RTSTHRESH2_LEN ((UINT16)0) | |
505 | #define HFA384x_RID_RTSTHRESH3_LEN ((UINT16)0) | |
506 | #define HFA384x_RID_RTSTHRESH4_LEN ((UINT16)0) | |
507 | #define HFA384x_RID_RTSTHRESH5_LEN ((UINT16)0) | |
508 | #define HFA384x_RID_RTSTHRESH6_LEN ((UINT16)0) | |
509 | #define HFA384x_RID_TXRATECNTL0_LEN ((UINT16)0) | |
510 | #define HFA384x_RID_TXRATECNTL1_LEN ((UINT16)0) | |
511 | #define HFA384x_RID_TXRATECNTL2_LEN ((UINT16)0) | |
512 | #define HFA384x_RID_TXRATECNTL3_LEN ((UINT16)0) | |
513 | #define HFA384x_RID_TXRATECNTL4_LEN ((UINT16)0) | |
514 | #define HFA384x_RID_TXRATECNTL5_LEN ((UINT16)0) | |
515 | #define HFA384x_RID_TXRATECNTL6_LEN ((UINT16)0) | |
516 | ||
517 | /*-------------------------------------------------------------------- | |
518 | Configuration RIDs: Behavior Parameters | |
519 | --------------------------------------------------------------------*/ | |
520 | #define HFA384x_RID_ITICKTIME ((UINT16)0xFCE0) | |
521 | ||
522 | /*-------------------------------------------------------------------- | |
523 | Configuration RID Lengths: Behavior Parameters | |
524 | This is the length of JUST the DATA part of the RID (does not | |
525 | include the len or code fields) | |
526 | --------------------------------------------------------------------*/ | |
527 | #define HFA384x_RID_ITICKTIME_LEN ((UINT16)2) | |
528 | ||
529 | /*---------------------------------------------------------------------- | |
530 | Information RIDs: NIC Information | |
531 | --------------------------------------------------------------------*/ | |
532 | #define HFA384x_RID_MAXLOADTIME ((UINT16)0xFD00) | |
533 | #define HFA384x_RID_DOWNLOADBUFFER ((UINT16)0xFD01) | |
534 | #define HFA384x_RID_PRIIDENTITY ((UINT16)0xFD02) | |
535 | #define HFA384x_RID_PRISUPRANGE ((UINT16)0xFD03) | |
536 | #define HFA384x_RID_PRI_CFIACTRANGES ((UINT16)0xFD04) | |
537 | #define HFA384x_RID_NICSERIALNUMBER ((UINT16)0xFD0A) | |
538 | #define HFA384x_RID_NICIDENTITY ((UINT16)0xFD0B) | |
539 | #define HFA384x_RID_MFISUPRANGE ((UINT16)0xFD0C) | |
540 | #define HFA384x_RID_CFISUPRANGE ((UINT16)0xFD0D) | |
541 | #define HFA384x_RID_CHANNELLIST ((UINT16)0xFD10) | |
542 | #define HFA384x_RID_REGULATORYDOMAINS ((UINT16)0xFD11) | |
543 | #define HFA384x_RID_TEMPTYPE ((UINT16)0xFD12) | |
544 | #define HFA384x_RID_CIS ((UINT16)0xFD13) | |
545 | #define HFA384x_RID_STAIDENTITY ((UINT16)0xFD20) | |
546 | #define HFA384x_RID_STASUPRANGE ((UINT16)0xFD21) | |
547 | #define HFA384x_RID_STA_MFIACTRANGES ((UINT16)0xFD22) | |
548 | #define HFA384x_RID_STA_CFIACTRANGES ((UINT16)0xFD23) | |
549 | #define HFA384x_RID_BUILDSEQ ((UINT16)0xFFFE) | |
550 | #define HFA384x_RID_FWID ((UINT16)0xFFFF) | |
551 | ||
552 | /*---------------------------------------------------------------------- | |
553 | Information RID Lengths: NIC Information | |
554 | This is the length of JUST the DATA part of the RID (does not | |
555 | include the len or code fields) | |
556 | --------------------------------------------------------------------*/ | |
557 | #define HFA384x_RID_MAXLOADTIME_LEN ((UINT16)0) | |
558 | #define HFA384x_RID_DOWNLOADBUFFER_LEN ((UINT16)sizeof(hfa384x_downloadbuffer_t)) | |
559 | #define HFA384x_RID_PRIIDENTITY_LEN ((UINT16)8) | |
560 | #define HFA384x_RID_PRISUPRANGE_LEN ((UINT16)10) | |
561 | #define HFA384x_RID_CFIACTRANGES_LEN ((UINT16)10) | |
562 | #define HFA384x_RID_NICSERIALNUMBER_LEN ((UINT16)12) | |
563 | #define HFA384x_RID_NICIDENTITY_LEN ((UINT16)8) | |
564 | #define HFA384x_RID_MFISUPRANGE_LEN ((UINT16)10) | |
565 | #define HFA384x_RID_CFISUPRANGE_LEN ((UINT16)10) | |
566 | #define HFA384x_RID_CHANNELLIST_LEN ((UINT16)0) | |
567 | #define HFA384x_RID_REGULATORYDOMAINS_LEN ((UINT16)12) | |
568 | #define HFA384x_RID_TEMPTYPE_LEN ((UINT16)0) | |
569 | #define HFA384x_RID_CIS_LEN ((UINT16)480) | |
570 | #define HFA384x_RID_STAIDENTITY_LEN ((UINT16)8) | |
571 | #define HFA384x_RID_STASUPRANGE_LEN ((UINT16)10) | |
572 | #define HFA384x_RID_MFIACTRANGES_LEN ((UINT16)10) | |
573 | #define HFA384x_RID_CFIACTRANGES2_LEN ((UINT16)10) | |
574 | #define HFA384x_RID_BUILDSEQ_LEN ((UINT16)sizeof(hfa384x_BuildSeq_t)) | |
575 | #define HFA384x_RID_FWID_LEN ((UINT16)sizeof(hfa384x_FWID_t)) | |
576 | ||
577 | /*-------------------------------------------------------------------- | |
578 | Information RIDs: MAC Information | |
579 | --------------------------------------------------------------------*/ | |
580 | #define HFA384x_RID_PORTSTATUS ((UINT16)0xFD40) | |
581 | #define HFA384x_RID_CURRENTSSID ((UINT16)0xFD41) | |
582 | #define HFA384x_RID_CURRENTBSSID ((UINT16)0xFD42) | |
583 | #define HFA384x_RID_COMMSQUALITY ((UINT16)0xFD43) | |
584 | #define HFA384x_RID_CURRENTTXRATE ((UINT16)0xFD44) | |
585 | #define HFA384x_RID_CURRENTBCNINT ((UINT16)0xFD45) | |
586 | #define HFA384x_RID_CURRENTSCALETHRESH ((UINT16)0xFD46) | |
587 | #define HFA384x_RID_PROTOCOLRSPTIME ((UINT16)0xFD47) | |
588 | #define HFA384x_RID_SHORTRETRYLIMIT ((UINT16)0xFD48) | |
589 | #define HFA384x_RID_LONGRETRYLIMIT ((UINT16)0xFD49) | |
590 | #define HFA384x_RID_MAXTXLIFETIME ((UINT16)0xFD4A) | |
591 | #define HFA384x_RID_MAXRXLIFETIME ((UINT16)0xFD4B) | |
592 | #define HFA384x_RID_CFPOLLABLE ((UINT16)0xFD4C) | |
593 | #define HFA384x_RID_AUTHALGORITHMS ((UINT16)0xFD4D) | |
594 | #define HFA384x_RID_PRIVACYOPTIMP ((UINT16)0xFD4F) | |
595 | #define HFA384x_RID_DBMCOMMSQUALITY ((UINT16)0xFD51) | |
596 | #define HFA384x_RID_CURRENTTXRATE1 ((UINT16)0xFD80) | |
597 | #define HFA384x_RID_CURRENTTXRATE2 ((UINT16)0xFD81) | |
598 | #define HFA384x_RID_CURRENTTXRATE3 ((UINT16)0xFD82) | |
599 | #define HFA384x_RID_CURRENTTXRATE4 ((UINT16)0xFD83) | |
600 | #define HFA384x_RID_CURRENTTXRATE5 ((UINT16)0xFD84) | |
601 | #define HFA384x_RID_CURRENTTXRATE6 ((UINT16)0xFD85) | |
602 | #define HFA384x_RID_OWNMACADDRESS ((UINT16)0xFD86) | |
603 | // #define HFA384x_RID_PCFINFO ((UINT16)0xFD87) | |
604 | #define HFA384x_RID_SCANRESULTS ((UINT16)0xFD88) // NEW | |
605 | #define HFA384x_RID_HOSTSCANRESULTS ((UINT16)0xFD89) // NEW | |
606 | #define HFA384x_RID_AUTHENTICATIONUSED ((UINT16)0xFD8A) // NEW | |
607 | #define HFA384x_RID_ASSOCIATEFAILURE ((UINT16)0xFD8D) // 1.8.0 | |
608 | ||
609 | /*-------------------------------------------------------------------- | |
610 | Information RID Lengths: MAC Information | |
611 | This is the length of JUST the DATA part of the RID (does not | |
612 | include the len or code fields) | |
613 | --------------------------------------------------------------------*/ | |
614 | #define HFA384x_RID_PORTSTATUS_LEN ((UINT16)0) | |
615 | #define HFA384x_RID_CURRENTSSID_LEN ((UINT16)34) | |
616 | #define HFA384x_RID_CURRENTBSSID_LEN ((UINT16)WLAN_BSSID_LEN) | |
617 | #define HFA384x_RID_COMMSQUALITY_LEN ((UINT16)sizeof(hfa384x_commsquality_t)) | |
618 | #define HFA384x_RID_DBMCOMMSQUALITY_LEN ((UINT16)sizeof(hfa384x_dbmcommsquality_t)) | |
619 | #define HFA384x_RID_CURRENTTXRATE_LEN ((UINT16)0) | |
620 | #define HFA384x_RID_CURRENTBCNINT_LEN ((UINT16)0) | |
621 | #define HFA384x_RID_STACURSCALETHRESH_LEN ((UINT16)12) | |
622 | #define HFA384x_RID_APCURSCALETHRESH_LEN ((UINT16)6) | |
623 | #define HFA384x_RID_PROTOCOLRSPTIME_LEN ((UINT16)0) | |
624 | #define HFA384x_RID_SHORTRETRYLIMIT_LEN ((UINT16)0) | |
625 | #define HFA384x_RID_LONGRETRYLIMIT_LEN ((UINT16)0) | |
626 | #define HFA384x_RID_MAXTXLIFETIME_LEN ((UINT16)0) | |
627 | #define HFA384x_RID_MAXRXLIFETIME_LEN ((UINT16)0) | |
628 | #define HFA384x_RID_CFPOLLABLE_LEN ((UINT16)0) | |
629 | #define HFA384x_RID_AUTHALGORITHMS_LEN ((UINT16)4) | |
630 | #define HFA384x_RID_PRIVACYOPTIMP_LEN ((UINT16)0) | |
631 | #define HFA384x_RID_CURRENTTXRATE1_LEN ((UINT16)0) | |
632 | #define HFA384x_RID_CURRENTTXRATE2_LEN ((UINT16)0) | |
633 | #define HFA384x_RID_CURRENTTXRATE3_LEN ((UINT16)0) | |
634 | #define HFA384x_RID_CURRENTTXRATE4_LEN ((UINT16)0) | |
635 | #define HFA384x_RID_CURRENTTXRATE5_LEN ((UINT16)0) | |
636 | #define HFA384x_RID_CURRENTTXRATE6_LEN ((UINT16)0) | |
637 | #define HFA384x_RID_OWNMACADDRESS_LEN ((UINT16)6) | |
638 | #define HFA384x_RID_PCFINFO_LEN ((UINT16)6) | |
639 | #define HFA384x_RID_CNFAPPCFINFO_LEN ((UINT16)sizeof(hfa384x_PCFInfo_data_t)) | |
640 | #define HFA384x_RID_SCANREQUEST_LEN ((UINT16)sizeof(hfa384x_ScanRequest_data_t)) | |
641 | #define HFA384x_RID_JOINREQUEST_LEN ((UINT16)sizeof(hfa384x_JoinRequest_data_t)) | |
642 | #define HFA384x_RID_AUTHENTICATESTA_LEN ((UINT16)sizeof(hfa384x_authenticateStation_data_t)) | |
643 | #define HFA384x_RID_CHANNELINFOREQUEST_LEN ((UINT16)sizeof(hfa384x_ChannelInfoRequest_data_t)) | |
644 | /*-------------------------------------------------------------------- | |
645 | Information RIDs: Modem Information | |
646 | --------------------------------------------------------------------*/ | |
647 | #define HFA384x_RID_PHYTYPE ((UINT16)0xFDC0) | |
648 | #define HFA384x_RID_CURRENTCHANNEL ((UINT16)0xFDC1) | |
649 | #define HFA384x_RID_CURRENTPOWERSTATE ((UINT16)0xFDC2) | |
650 | #define HFA384x_RID_CCAMODE ((UINT16)0xFDC3) | |
651 | #define HFA384x_RID_SUPPORTEDDATARATES ((UINT16)0xFDC6) | |
652 | #define HFA384x_RID_LFOSTATUS ((UINT16)0xFDC7) // 1.7.1 | |
653 | ||
654 | /*-------------------------------------------------------------------- | |
655 | Information RID Lengths: Modem Information | |
656 | This is the length of JUST the DATA part of the RID (does not | |
657 | include the len or code fields) | |
658 | --------------------------------------------------------------------*/ | |
659 | #define HFA384x_RID_PHYTYPE_LEN ((UINT16)0) | |
660 | #define HFA384x_RID_CURRENTCHANNEL_LEN ((UINT16)0) | |
661 | #define HFA384x_RID_CURRENTPOWERSTATE_LEN ((UINT16)0) | |
662 | #define HFA384x_RID_CCAMODE_LEN ((UINT16)0) | |
663 | #define HFA384x_RID_SUPPORTEDDATARATES_LEN ((UINT16)10) | |
664 | ||
665 | /*-------------------------------------------------------------------- | |
666 | API ENHANCEMENTS (NOT ALREADY IMPLEMENTED) | |
667 | --------------------------------------------------------------------*/ | |
668 | #define HFA384x_RID_CNFWEPDEFAULTKEYID ((UINT16)0xFC23) | |
669 | #define HFA384x_RID_CNFWEPDEFAULTKEY0 ((UINT16)0xFC24) | |
670 | #define HFA384x_RID_CNFWEPDEFAULTKEY1 ((UINT16)0xFC25) | |
671 | #define HFA384x_RID_CNFWEPDEFAULTKEY2 ((UINT16)0xFC26) | |
672 | #define HFA384x_RID_CNFWEPDEFAULTKEY3 ((UINT16)0xFC27) | |
673 | #define HFA384x_RID_CNFWEPFLAGS ((UINT16)0xFC28) | |
674 | #define HFA384x_RID_CNFWEPKEYMAPTABLE ((UINT16)0xFC29) | |
675 | #define HFA384x_RID_CNFAUTHENTICATION ((UINT16)0xFC2A) | |
676 | #define HFA384x_RID_CNFMAXASSOCSTATIONS ((UINT16)0xFC2B) | |
677 | #define HFA384x_RID_CNFTXCONTROL ((UINT16)0xFC2C) | |
678 | #define HFA384x_RID_CNFROAMINGMODE ((UINT16)0xFC2D) | |
679 | #define HFA384x_RID_CNFHOSTAUTHASSOC ((UINT16)0xFC2E) | |
680 | #define HFA384x_RID_CNFRCVCRCERROR ((UINT16)0xFC30) | |
681 | // #define HFA384x_RID_CNFMMLIFE ((UINT16)0xFC31) | |
682 | #define HFA384x_RID_CNFALTRETRYCNT ((UINT16)0xFC32) | |
683 | #define HFA384x_RID_CNFAPBCNINT ((UINT16)0xFC33) | |
684 | #define HFA384x_RID_CNFAPPCFINFO ((UINT16)0xFC34) | |
685 | #define HFA384x_RID_CNFSTAPCFINFO ((UINT16)0xFC35) | |
686 | #define HFA384x_RID_CNFPRIORITYQUSAGE ((UINT16)0xFC37) | |
687 | #define HFA384x_RID_CNFTIMCTRL ((UINT16)0xFC40) | |
688 | #define HFA384x_RID_CNFTHIRTY2TALLY ((UINT16)0xFC42) | |
689 | #define HFA384x_RID_CNFENHSECURITY ((UINT16)0xFC43) | |
690 | #define HFA384x_RID_CNFDBMADJUST ((UINT16)0xFC46) // NEW | |
691 | #define HFA384x_RID_CNFWPADATA ((UINT16)0xFC48) // 1.7.0 | |
692 | #define HFA384x_RID_CNFPROPOGATIONDELAY ((UINT16)0xFC49) // 1.7.6 | |
693 | #define HFA384x_RID_CNFSHORTPREAMBLE ((UINT16)0xFCB0) | |
694 | #define HFA384x_RID_CNFEXCLONGPREAMBLE ((UINT16)0xFCB1) | |
695 | #define HFA384x_RID_CNFAUTHRSPTIMEOUT ((UINT16)0xFCB2) | |
696 | #define HFA384x_RID_CNFBASICRATES ((UINT16)0xFCB3) | |
697 | #define HFA384x_RID_CNFSUPPRATES ((UINT16)0xFCB4) | |
698 | #define HFA384x_RID_CNFFALLBACKCTRL ((UINT16)0xFCB5) // NEW | |
699 | #define HFA384x_RID_WEPKEYSTATUS ((UINT16)0xFCB6) // NEW | |
700 | #define HFA384x_RID_WEPKEYMAPINDEX ((UINT16)0xFCB7) // NEW | |
701 | #define HFA384x_RID_BROADCASTKEYID ((UINT16)0xFCB8) // NEW | |
702 | #define HFA384x_RID_ENTSECFLAGEYID ((UINT16)0xFCB9) // NEW | |
703 | #define HFA384x_RID_CNFPASSIVESCANCTRL ((UINT16)0xFCBA) // NEW STA | |
704 | #define HFA384x_RID_CNFWPAHANDLING ((UINT16)0xFCBB) // 1.7.0 | |
705 | #define HFA384x_RID_MDCCONTROL ((UINT16)0xFCBC) // 1.7.0/1.4.0 | |
706 | #define HFA384x_RID_MDCCOUNTRY ((UINT16)0xFCBD) // 1.7.0/1.4.0 | |
707 | #define HFA384x_RID_TXPOWERMAX ((UINT16)0xFCBE) // 1.7.0/1.4.0 | |
708 | #define HFA384x_RID_CNFLFOENBLED ((UINT16)0xFCBF) // 1.6.3 | |
709 | #define HFA384x_RID_CAPINFO ((UINT16)0xFCC0) // 1.7.0/1.3.7 | |
710 | #define HFA384x_RID_LISTENINTERVAL ((UINT16)0xFCC1) // 1.7.0/1.3.7 | |
711 | #define HFA384x_RID_DIVERSITYENABLED ((UINT16)0xFCC2) // 1.7.0/1.3.7 | |
712 | #define HFA384x_RID_LED_CONTROL ((UINT16)0xFCC4) // 1.7.6 | |
713 | #define HFA384x_RID_HFO_DELAY ((UINT16)0xFCC5) // 1.7.6 | |
714 | #define HFA384x_RID_DISSALOWEDBSSID ((UINT16)0xFCC6) // 1.8.0 | |
715 | #define HFA384x_RID_SCANREQUEST ((UINT16)0xFCE1) | |
716 | #define HFA384x_RID_JOINREQUEST ((UINT16)0xFCE2) | |
717 | #define HFA384x_RID_AUTHENTICATESTA ((UINT16)0xFCE3) | |
718 | #define HFA384x_RID_CHANNELINFOREQUEST ((UINT16)0xFCE4) | |
719 | #define HFA384x_RID_HOSTSCAN ((UINT16)0xFCE5) // NEW STA | |
720 | #define HFA384x_RID_ASSOCIATESTA ((UINT16)0xFCE6) | |
721 | ||
722 | #define HFA384x_RID_CNFWEPDEFAULTKEY_LEN ((UINT16)6) | |
723 | #define HFA384x_RID_CNFWEP128DEFAULTKEY_LEN ((UINT16)14) | |
724 | #define HFA384x_RID_CNFPRIOQUSAGE_LEN ((UINT16)4) | |
725 | /*-------------------------------------------------------------------- | |
726 | PD Record codes | |
727 | --------------------------------------------------------------------*/ | |
728 | #define HFA384x_PDR_PCB_PARTNUM ((UINT16)0x0001) | |
729 | #define HFA384x_PDR_PDAVER ((UINT16)0x0002) | |
730 | #define HFA384x_PDR_NIC_SERIAL ((UINT16)0x0003) | |
731 | #define HFA384x_PDR_MKK_MEASUREMENTS ((UINT16)0x0004) | |
732 | #define HFA384x_PDR_NIC_RAMSIZE ((UINT16)0x0005) | |
733 | #define HFA384x_PDR_MFISUPRANGE ((UINT16)0x0006) | |
734 | #define HFA384x_PDR_CFISUPRANGE ((UINT16)0x0007) | |
735 | #define HFA384x_PDR_NICID ((UINT16)0x0008) | |
736 | //#define HFA384x_PDR_REFDAC_MEASUREMENTS ((UINT16)0x0010) | |
737 | //#define HFA384x_PDR_VGDAC_MEASUREMENTS ((UINT16)0x0020) | |
738 | //#define HFA384x_PDR_LEVEL_COMP_MEASUREMENTS ((UINT16)0x0030) | |
739 | //#define HFA384x_PDR_MODEM_TRIMDAC_MEASUREMENTS ((UINT16)0x0040) | |
740 | //#define HFA384x_PDR_COREGA_HACK ((UINT16)0x00ff) | |
741 | #define HFA384x_PDR_MAC_ADDRESS ((UINT16)0x0101) | |
742 | //#define HFA384x_PDR_MKK_CALLNAME ((UINT16)0x0102) | |
743 | #define HFA384x_PDR_REGDOMAIN ((UINT16)0x0103) | |
744 | #define HFA384x_PDR_ALLOWED_CHANNEL ((UINT16)0x0104) | |
745 | #define HFA384x_PDR_DEFAULT_CHANNEL ((UINT16)0x0105) | |
746 | //#define HFA384x_PDR_PRIVACY_OPTION ((UINT16)0x0106) | |
747 | #define HFA384x_PDR_TEMPTYPE ((UINT16)0x0107) | |
748 | //#define HFA384x_PDR_REFDAC_SETUP ((UINT16)0x0110) | |
749 | //#define HFA384x_PDR_VGDAC_SETUP ((UINT16)0x0120) | |
750 | //#define HFA384x_PDR_LEVEL_COMP_SETUP ((UINT16)0x0130) | |
751 | //#define HFA384x_PDR_TRIMDAC_SETUP ((UINT16)0x0140) | |
752 | #define HFA384x_PDR_IFR_SETTING ((UINT16)0x0200) | |
753 | #define HFA384x_PDR_RFR_SETTING ((UINT16)0x0201) | |
754 | #define HFA384x_PDR_HFA3861_BASELINE ((UINT16)0x0202) | |
755 | #define HFA384x_PDR_HFA3861_SHADOW ((UINT16)0x0203) | |
756 | #define HFA384x_PDR_HFA3861_IFRF ((UINT16)0x0204) | |
757 | #define HFA384x_PDR_HFA3861_CHCALSP ((UINT16)0x0300) | |
758 | #define HFA384x_PDR_HFA3861_CHCALI ((UINT16)0x0301) | |
759 | #define HFA384x_PDR_MAX_TX_POWER ((UINT16)0x0302) | |
760 | #define HFA384x_PDR_MASTER_CHAN_LIST ((UINT16)0x0303) | |
761 | #define HFA384x_PDR_3842_NIC_CONFIG ((UINT16)0x0400) | |
762 | #define HFA384x_PDR_USB_ID ((UINT16)0x0401) | |
763 | #define HFA384x_PDR_PCI_ID ((UINT16)0x0402) | |
764 | #define HFA384x_PDR_PCI_IFCONF ((UINT16)0x0403) | |
765 | #define HFA384x_PDR_PCI_PMCONF ((UINT16)0x0404) | |
766 | #define HFA384x_PDR_RFENRGY ((UINT16)0x0406) | |
767 | #define HFA384x_PDR_USB_POWER_TYPE ((UINT16)0x0407) | |
768 | //#define HFA384x_PDR_UNKNOWN408 ((UINT16)0x0408) | |
769 | #define HFA384x_PDR_USB_MAX_POWER ((UINT16)0x0409) | |
770 | #define HFA384x_PDR_USB_MANUFACTURER ((UINT16)0x0410) | |
771 | #define HFA384x_PDR_USB_PRODUCT ((UINT16)0x0411) | |
772 | #define HFA384x_PDR_ANT_DIVERSITY ((UINT16)0x0412) | |
773 | #define HFA384x_PDR_HFO_DELAY ((UINT16)0x0413) | |
774 | #define HFA384x_PDR_SCALE_THRESH ((UINT16)0x0414) | |
775 | ||
776 | #define HFA384x_PDR_HFA3861_MANF_TESTSP ((UINT16)0x0900) | |
777 | #define HFA384x_PDR_HFA3861_MANF_TESTI ((UINT16)0x0901) | |
778 | #define HFA384x_PDR_END_OF_PDA ((UINT16)0x0000) | |
779 | ||
780 | ||
781 | /*=============================================================*/ | |
782 | /*------ Macros -----------------------------------------------*/ | |
783 | ||
784 | /*--- Register ID macros ------------------------*/ | |
785 | ||
786 | #define HFA384x_CMD HFA384x_CMD_OFF | |
787 | #define HFA384x_PARAM0 HFA384x_PARAM0_OFF | |
788 | #define HFA384x_PARAM1 HFA384x_PARAM1_OFF | |
789 | #define HFA384x_PARAM2 HFA384x_PARAM2_OFF | |
790 | #define HFA384x_STATUS HFA384x_STATUS_OFF | |
791 | #define HFA384x_RESP0 HFA384x_RESP0_OFF | |
792 | #define HFA384x_RESP1 HFA384x_RESP1_OFF | |
793 | #define HFA384x_RESP2 HFA384x_RESP2_OFF | |
794 | #define HFA384x_INFOFID HFA384x_INFOFID_OFF | |
795 | #define HFA384x_RXFID HFA384x_RXFID_OFF | |
796 | #define HFA384x_ALLOCFID HFA384x_ALLOCFID_OFF | |
797 | #define HFA384x_TXCOMPLFID HFA384x_TXCOMPLFID_OFF | |
798 | #define HFA384x_SELECT0 HFA384x_SELECT0_OFF | |
799 | #define HFA384x_OFFSET0 HFA384x_OFFSET0_OFF | |
800 | #define HFA384x_DATA0 HFA384x_DATA0_OFF | |
801 | #define HFA384x_SELECT1 HFA384x_SELECT1_OFF | |
802 | #define HFA384x_OFFSET1 HFA384x_OFFSET1_OFF | |
803 | #define HFA384x_DATA1 HFA384x_DATA1_OFF | |
804 | #define HFA384x_EVSTAT HFA384x_EVSTAT_OFF | |
805 | #define HFA384x_INTEN HFA384x_INTEN_OFF | |
806 | #define HFA384x_EVACK HFA384x_EVACK_OFF | |
807 | #define HFA384x_CONTROL HFA384x_CONTROL_OFF | |
808 | #define HFA384x_SWSUPPORT0 HFA384x_SWSUPPORT0_OFF | |
809 | #define HFA384x_SWSUPPORT1 HFA384x_SWSUPPORT1_OFF | |
810 | #define HFA384x_SWSUPPORT2 HFA384x_SWSUPPORT2_OFF | |
811 | #define HFA384x_AUXPAGE HFA384x_AUXPAGE_OFF | |
812 | #define HFA384x_AUXOFFSET HFA384x_AUXOFFSET_OFF | |
813 | #define HFA384x_AUXDATA HFA384x_AUXDATA_OFF | |
814 | #define HFA384x_PCICOR HFA384x_PCICOR_OFF | |
815 | #define HFA384x_PCIHCR HFA384x_PCIHCR_OFF | |
816 | ||
817 | ||
818 | /*--- Register Test/Get/Set Field macros ------------------------*/ | |
819 | ||
820 | #define HFA384x_CMD_ISBUSY(value) ((UINT16)(((UINT16)value) & HFA384x_CMD_BUSY)) | |
821 | #define HFA384x_CMD_AINFO_GET(value) ((UINT16)(((UINT16)(value) & HFA384x_CMD_AINFO) >> 8)) | |
822 | #define HFA384x_CMD_AINFO_SET(value) ((UINT16)((UINT16)(value) << 8)) | |
823 | #define HFA384x_CMD_MACPORT_GET(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_MACPORT))) | |
824 | #define HFA384x_CMD_MACPORT_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET(value)) | |
825 | #define HFA384x_CMD_ISRECL(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_RECL))) | |
826 | #define HFA384x_CMD_RECL_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET(value)) | |
827 | #define HFA384x_CMD_QOS_GET(value) ((UINT16((((UINT16)(value))&((UINT16)0x3000)) >> 12)) | |
828 | #define HFA384x_CMD_QOS_SET(value) ((UINT16)((((UINT16)(value)) << 12) & 0x3000)) | |
829 | #define HFA384x_CMD_ISWRITE(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_WRITE))) | |
830 | #define HFA384x_CMD_WRITE_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET((UINT16)value)) | |
831 | #define HFA384x_CMD_PROGMODE_GET(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_PROGMODE))) | |
832 | #define HFA384x_CMD_PROGMODE_SET(value) ((UINT16)HFA384x_CMD_AINFO_SET((UINT16)value)) | |
833 | #define HFA384x_CMD_CMDCODE_GET(value) ((UINT16)(((UINT16)(value)) & HFA384x_CMD_CMDCODE)) | |
834 | #define HFA384x_CMD_CMDCODE_SET(value) ((UINT16)(value)) | |
835 | ||
836 | #define HFA384x_STATUS_RESULT_GET(value) ((UINT16)((((UINT16)(value)) & HFA384x_STATUS_RESULT) >> 8)) | |
837 | #define HFA384x_STATUS_RESULT_SET(value) (((UINT16)(value)) << 8) | |
838 | #define HFA384x_STATUS_CMDCODE_GET(value) (((UINT16)(value)) & HFA384x_STATUS_CMDCODE) | |
839 | #define HFA384x_STATUS_CMDCODE_SET(value) ((UINT16)(value)) | |
840 | ||
841 | #define HFA384x_OFFSET_ISBUSY(value) ((UINT16)(((UINT16)(value)) & HFA384x_OFFSET_BUSY)) | |
842 | #define HFA384x_OFFSET_ISERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_OFFSET_ERR)) | |
843 | #define HFA384x_OFFSET_DATAOFF_GET(value) ((UINT16)(((UINT16)(value)) & HFA384x_OFFSET_DATAOFF)) | |
844 | #define HFA384x_OFFSET_DATAOFF_SET(value) ((UINT16)(value)) | |
845 | ||
846 | #define HFA384x_EVSTAT_ISTICK(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_TICK)) | |
847 | #define HFA384x_EVSTAT_ISWTERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_WTERR)) | |
848 | #define HFA384x_EVSTAT_ISINFDROP(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_INFDROP)) | |
849 | #define HFA384x_EVSTAT_ISINFO(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_INFO)) | |
850 | #define HFA384x_EVSTAT_ISDTIM(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_DTIM)) | |
851 | #define HFA384x_EVSTAT_ISCMD(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_CMD)) | |
852 | #define HFA384x_EVSTAT_ISALLOC(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_ALLOC)) | |
853 | #define HFA384x_EVSTAT_ISTXEXC(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_TXEXC)) | |
854 | #define HFA384x_EVSTAT_ISTX(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_TX)) | |
855 | #define HFA384x_EVSTAT_ISRX(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVSTAT_RX)) | |
856 | ||
857 | #define HFA384x_EVSTAT_ISBAP_OP(value) ((UINT16)(((UINT16)(value)) & HFA384x_INT_BAP_OP)) | |
858 | ||
859 | #define HFA384x_INTEN_ISTICK(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_TICK)) | |
860 | #define HFA384x_INTEN_TICK_SET(value) ((UINT16)(((UINT16)(value)) << 15)) | |
861 | #define HFA384x_INTEN_ISWTERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_WTERR)) | |
862 | #define HFA384x_INTEN_WTERR_SET(value) ((UINT16)(((UINT16)(value)) << 14)) | |
863 | #define HFA384x_INTEN_ISINFDROP(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_INFDROP)) | |
864 | #define HFA384x_INTEN_INFDROP_SET(value) ((UINT16)(((UINT16)(value)) << 13)) | |
865 | #define HFA384x_INTEN_ISINFO(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_INFO)) | |
866 | #define HFA384x_INTEN_INFO_SET(value) ((UINT16)(((UINT16)(value)) << 7)) | |
867 | #define HFA384x_INTEN_ISDTIM(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_DTIM)) | |
868 | #define HFA384x_INTEN_DTIM_SET(value) ((UINT16)(((UINT16)(value)) << 5)) | |
869 | #define HFA384x_INTEN_ISCMD(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_CMD)) | |
870 | #define HFA384x_INTEN_CMD_SET(value) ((UINT16)(((UINT16)(value)) << 4)) | |
871 | #define HFA384x_INTEN_ISALLOC(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_ALLOC)) | |
872 | #define HFA384x_INTEN_ALLOC_SET(value) ((UINT16)(((UINT16)(value)) << 3)) | |
873 | #define HFA384x_INTEN_ISTXEXC(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_TXEXC)) | |
874 | #define HFA384x_INTEN_TXEXC_SET(value) ((UINT16)(((UINT16)(value)) << 2)) | |
875 | #define HFA384x_INTEN_ISTX(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_TX)) | |
876 | #define HFA384x_INTEN_TX_SET(value) ((UINT16)(((UINT16)(value)) << 1)) | |
877 | #define HFA384x_INTEN_ISRX(value) ((UINT16)(((UINT16)(value)) & HFA384x_INTEN_RX)) | |
878 | #define HFA384x_INTEN_RX_SET(value) ((UINT16)(((UINT16)(value)) << 0)) | |
879 | ||
880 | #define HFA384x_EVACK_ISTICK(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_TICK)) | |
881 | #define HFA384x_EVACK_TICK_SET(value) ((UINT16)(((UINT16)(value)) << 15)) | |
882 | #define HFA384x_EVACK_ISWTERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_WTERR)) | |
883 | #define HFA384x_EVACK_WTERR_SET(value) ((UINT16)(((UINT16)(value)) << 14)) | |
884 | #define HFA384x_EVACK_ISINFDROP(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_INFDROP)) | |
885 | #define HFA384x_EVACK_INFDROP_SET(value) ((UINT16)(((UINT16)(value)) << 13)) | |
886 | #define HFA384x_EVACK_ISINFO(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_INFO)) | |
887 | #define HFA384x_EVACK_INFO_SET(value) ((UINT16)(((UINT16)(value)) << 7)) | |
888 | #define HFA384x_EVACK_ISDTIM(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_DTIM)) | |
889 | #define HFA384x_EVACK_DTIM_SET(value) ((UINT16)(((UINT16)(value)) << 5)) | |
890 | #define HFA384x_EVACK_ISCMD(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_CMD)) | |
891 | #define HFA384x_EVACK_CMD_SET(value) ((UINT16)(((UINT16)(value)) << 4)) | |
892 | #define HFA384x_EVACK_ISALLOC(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_ALLOC)) | |
893 | #define HFA384x_EVACK_ALLOC_SET(value) ((UINT16)(((UINT16)(value)) << 3)) | |
894 | #define HFA384x_EVACK_ISTXEXC(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_TXEXC)) | |
895 | #define HFA384x_EVACK_TXEXC_SET(value) ((UINT16)(((UINT16)(value)) << 2)) | |
896 | #define HFA384x_EVACK_ISTX(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_TX)) | |
897 | #define HFA384x_EVACK_TX_SET(value) ((UINT16)(((UINT16)(value)) << 1)) | |
898 | #define HFA384x_EVACK_ISRX(value) ((UINT16)(((UINT16)(value)) & HFA384x_EVACK_RX)) | |
899 | #define HFA384x_EVACK_RX_SET(value) ((UINT16)(((UINT16)(value)) << 0)) | |
900 | ||
901 | #define HFA384x_CONTROL_AUXEN_SET(value) ((UINT16)(((UINT16)(value)) << 14)) | |
902 | #define HFA384x_CONTROL_AUXEN_GET(value) ((UINT16)(((UINT16)(value)) >> 14)) | |
903 | ||
904 | /* Byte Order */ | |
905 | #ifdef __KERNEL__ | |
906 | #define hfa384x2host_16(n) (__le16_to_cpu((UINT16)(n))) | |
907 | #define hfa384x2host_32(n) (__le32_to_cpu((UINT32)(n))) | |
908 | #define host2hfa384x_16(n) (__cpu_to_le16((UINT16)(n))) | |
909 | #define host2hfa384x_32(n) (__cpu_to_le32((UINT32)(n))) | |
910 | #endif | |
911 | ||
912 | /* Host Maintained State Info */ | |
913 | #define HFA384x_STATE_PREINIT 0 | |
914 | #define HFA384x_STATE_INIT 1 | |
915 | #define HFA384x_STATE_RUNNING 2 | |
916 | ||
917 | /*=============================================================*/ | |
918 | /*------ Types and their related constants --------------------*/ | |
919 | ||
920 | #define HFA384x_HOSTAUTHASSOC_HOSTAUTH BIT0 | |
921 | #define HFA384x_HOSTAUTHASSOC_HOSTASSOC BIT1 | |
922 | ||
923 | #define HFA384x_WHAHANDLING_DISABLED 0 | |
924 | #define HFA384x_WHAHANDLING_PASSTHROUGH BIT1 | |
925 | ||
926 | /*-------------------------------------------------------------*/ | |
927 | /* Commonly used basic types */ | |
928 | typedef struct hfa384x_bytestr | |
929 | { | |
930 | UINT16 len; | |
931 | UINT8 data[0]; | |
932 | } __WLAN_ATTRIB_PACK__ hfa384x_bytestr_t; | |
933 | ||
934 | typedef struct hfa384x_bytestr32 | |
935 | { | |
936 | UINT16 len; | |
937 | UINT8 data[32]; | |
938 | } __WLAN_ATTRIB_PACK__ hfa384x_bytestr32_t; | |
939 | ||
940 | /*-------------------------------------------------------------------- | |
941 | Configuration Record Structures: | |
942 | Network Parameters, Static Configuration Entities | |
943 | --------------------------------------------------------------------*/ | |
944 | /* Prototype structure: all configuration record structures start with | |
945 | these members */ | |
946 | ||
947 | typedef struct hfa384x_record | |
948 | { | |
949 | UINT16 reclen; | |
950 | UINT16 rid; | |
951 | } __WLAN_ATTRIB_PACK__ hfa384x_rec_t; | |
952 | ||
953 | typedef struct hfa384x_record16 | |
954 | { | |
955 | UINT16 reclen; | |
956 | UINT16 rid; | |
957 | UINT16 val; | |
958 | } __WLAN_ATTRIB_PACK__ hfa384x_rec16_t; | |
959 | ||
960 | typedef struct hfa384x_record32 | |
961 | { | |
962 | UINT16 reclen; | |
963 | UINT16 rid; | |
964 | UINT32 val; | |
965 | } __WLAN_ATTRIB_PACK__ hfa384x_rec32; | |
966 | ||
967 | /*-- Hardware/Firmware Component Information ----------*/ | |
968 | typedef struct hfa384x_compident | |
969 | { | |
970 | UINT16 id; | |
971 | UINT16 variant; | |
972 | UINT16 major; | |
973 | UINT16 minor; | |
974 | } __WLAN_ATTRIB_PACK__ hfa384x_compident_t; | |
975 | ||
976 | typedef struct hfa384x_caplevel | |
977 | { | |
978 | UINT16 role; | |
979 | UINT16 id; | |
980 | UINT16 variant; | |
981 | UINT16 bottom; | |
982 | UINT16 top; | |
983 | } __WLAN_ATTRIB_PACK__ hfa384x_caplevel_t; | |
984 | ||
985 | /*-- Configuration Record: cnfPortType --*/ | |
986 | typedef struct hfa384x_cnfPortType | |
987 | { | |
988 | UINT16 cnfPortType; | |
989 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfPortType_t; | |
990 | ||
991 | /*-- Configuration Record: cnfOwnMACAddress --*/ | |
992 | typedef struct hfa384x_cnfOwnMACAddress | |
993 | { | |
994 | UINT8 cnfOwnMACAddress[6]; | |
995 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnMACAddress_t; | |
996 | ||
997 | /*-- Configuration Record: cnfDesiredSSID --*/ | |
998 | typedef struct hfa384x_cnfDesiredSSID | |
999 | { | |
1000 | UINT8 cnfDesiredSSID[34]; | |
1001 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfDesiredSSID_t; | |
1002 | ||
1003 | /*-- Configuration Record: cnfOwnChannel --*/ | |
1004 | typedef struct hfa384x_cnfOwnChannel | |
1005 | { | |
1006 | UINT16 cnfOwnChannel; | |
1007 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnChannel_t; | |
1008 | ||
1009 | /*-- Configuration Record: cnfOwnSSID --*/ | |
1010 | typedef struct hfa384x_cnfOwnSSID | |
1011 | { | |
1012 | UINT8 cnfOwnSSID[34]; | |
1013 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnSSID_t; | |
1014 | ||
1015 | /*-- Configuration Record: cnfOwnATIMWindow --*/ | |
1016 | typedef struct hfa384x_cnfOwnATIMWindow | |
1017 | { | |
1018 | UINT16 cnfOwnATIMWindow; | |
1019 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnATIMWindow_t; | |
1020 | ||
1021 | /*-- Configuration Record: cnfSystemScale --*/ | |
1022 | typedef struct hfa384x_cnfSystemScale | |
1023 | { | |
1024 | UINT16 cnfSystemScale; | |
1025 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfSystemScale_t; | |
1026 | ||
1027 | /*-- Configuration Record: cnfMaxDataLength --*/ | |
1028 | typedef struct hfa384x_cnfMaxDataLength | |
1029 | { | |
1030 | UINT16 cnfMaxDataLength; | |
1031 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfMaxDataLength_t; | |
1032 | ||
1033 | /*-- Configuration Record: cnfWDSAddress --*/ | |
1034 | typedef struct hfa384x_cnfWDSAddress | |
1035 | { | |
1036 | UINT8 cnfWDSAddress[6]; | |
1037 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfWDSAddress_t; | |
1038 | ||
1039 | /*-- Configuration Record: cnfPMEnabled --*/ | |
1040 | typedef struct hfa384x_cnfPMEnabled | |
1041 | { | |
1042 | UINT16 cnfPMEnabled; | |
1043 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMEnabled_t; | |
1044 | ||
1045 | /*-- Configuration Record: cnfPMEPS --*/ | |
1046 | typedef struct hfa384x_cnfPMEPS | |
1047 | { | |
1048 | UINT16 cnfPMEPS; | |
1049 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMEPS_t; | |
1050 | ||
1051 | /*-- Configuration Record: cnfMulticastReceive --*/ | |
1052 | typedef struct hfa384x_cnfMulticastReceive | |
1053 | { | |
1054 | UINT16 cnfMulticastReceive; | |
1055 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfMulticastReceive_t; | |
1056 | ||
1057 | /*-- Configuration Record: cnfAuthentication --*/ | |
1058 | #define HFA384x_CNFAUTHENTICATION_OPENSYSTEM 0x0001 | |
1059 | #define HFA384x_CNFAUTHENTICATION_SHAREDKEY 0x0002 | |
1060 | #define HFA384x_CNFAUTHENTICATION_LEAP 0x0004 | |
1061 | ||
1062 | /*-- Configuration Record: cnfMaxSleepDuration --*/ | |
1063 | typedef struct hfa384x_cnfMaxSleepDuration | |
1064 | { | |
1065 | UINT16 cnfMaxSleepDuration; | |
1066 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfMaxSleepDuration_t; | |
1067 | ||
1068 | /*-- Configuration Record: cnfPMHoldoverDuration --*/ | |
1069 | typedef struct hfa384x_cnfPMHoldoverDuration | |
1070 | { | |
1071 | UINT16 cnfPMHoldoverDuration; | |
1072 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfPMHoldoverDuration_t; | |
1073 | ||
1074 | /*-- Configuration Record: cnfOwnName --*/ | |
1075 | typedef struct hfa384x_cnfOwnName | |
1076 | { | |
1077 | UINT8 cnfOwnName[34]; | |
1078 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnName_t; | |
1079 | ||
1080 | /*-- Configuration Record: cnfOwnDTIMPeriod --*/ | |
1081 | typedef struct hfa384x_cnfOwnDTIMPeriod | |
1082 | { | |
1083 | UINT16 cnfOwnDTIMPeriod; | |
1084 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfOwnDTIMPeriod_t; | |
1085 | ||
1086 | /*-- Configuration Record: cnfWDSAddress --*/ | |
1087 | typedef struct hfa384x_cnfWDSAddressN | |
1088 | { | |
1089 | UINT8 cnfWDSAddress[6]; | |
1090 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfWDSAddressN_t; | |
1091 | ||
1092 | /*-- Configuration Record: cnfMulticastPMBuffering --*/ | |
1093 | typedef struct hfa384x_cnfMulticastPMBuffering | |
1094 | { | |
1095 | UINT16 cnfMulticastPMBuffering; | |
1096 | } __WLAN_ATTRIB_PACK__ hfa384x_cnfMulticastPMBuffering_t; | |
1097 | ||
1098 | /*-------------------------------------------------------------------- | |
1099 | Configuration Record Structures: | |
1100 | Network Parameters, Dynamic Configuration Entities | |
1101 | --------------------------------------------------------------------*/ | |
1102 | ||
1103 | /*-- Configuration Record: GroupAddresses --*/ | |
1104 | typedef struct hfa384x_GroupAddresses | |
1105 | { | |
1106 | UINT8 MACAddress[16][6]; | |
1107 | } __WLAN_ATTRIB_PACK__ hfa384x_GroupAddresses_t; | |
1108 | ||
1109 | /*-- Configuration Record: CreateIBSS --*/ | |
1110 | typedef struct hfa384x_CreateIBSS | |
1111 | { | |
1112 | UINT16 CreateIBSS; | |
1113 | } __WLAN_ATTRIB_PACK__ hfa384x_CreateIBSS_t; | |
1114 | ||
1115 | #define HFA384x_CREATEIBSS_JOINCREATEIBSS 0 | |
1116 | #define HFA384x_CREATEIBSS_JOINESS_JOINCREATEIBSS 1 | |
1117 | #define HFA384x_CREATEIBSS_JOINIBSS 2 | |
1118 | #define HFA384x_CREATEIBSS_JOINESS_JOINIBSS 3 | |
1119 | ||
1120 | /*-- Configuration Record: FragmentationThreshold --*/ | |
1121 | typedef struct hfa384x_FragmentationThreshold | |
1122 | { | |
1123 | UINT16 FragmentationThreshold; | |
1124 | } __WLAN_ATTRIB_PACK__ hfa384x_FragmentationThreshold_t; | |
1125 | ||
1126 | /*-- Configuration Record: RTSThreshold --*/ | |
1127 | typedef struct hfa384x_RTSThreshold | |
1128 | { | |
1129 | UINT16 RTSThreshold; | |
1130 | } __WLAN_ATTRIB_PACK__ hfa384x_RTSThreshold_t; | |
1131 | ||
1132 | /*-- Configuration Record: TxRateControl --*/ | |
1133 | typedef struct hfa384x_TxRateControl | |
1134 | { | |
1135 | UINT16 TxRateControl; | |
1136 | } __WLAN_ATTRIB_PACK__ hfa384x_TxRateControl_t; | |
1137 | ||
1138 | /*-- Configuration Record: PromiscuousMode --*/ | |
1139 | typedef struct hfa384x_PromiscuousMode | |
1140 | { | |
1141 | UINT16 PromiscuousMode; | |
1142 | } __WLAN_ATTRIB_PACK__ hfa384x_PromiscuousMode_t; | |
1143 | ||
1144 | /*-- Configuration Record: ScanRequest (data portion only) --*/ | |
1145 | typedef struct hfa384x_ScanRequest_data | |
1146 | { | |
1147 | UINT16 channelList; | |
1148 | UINT16 txRate; | |
1149 | } __WLAN_ATTRIB_PACK__ hfa384x_ScanRequest_data_t; | |
1150 | ||
1151 | /*-- Configuration Record: HostScanRequest (data portion only) --*/ | |
1152 | typedef struct hfa384x_HostScanRequest_data | |
1153 | { | |
1154 | UINT16 channelList; | |
1155 | UINT16 txRate; | |
1156 | hfa384x_bytestr32_t ssid; | |
1157 | } __WLAN_ATTRIB_PACK__ hfa384x_HostScanRequest_data_t; | |
1158 | ||
1159 | /*-- Configuration Record: JoinRequest (data portion only) --*/ | |
1160 | typedef struct hfa384x_JoinRequest_data | |
1161 | { | |
1162 | UINT8 bssid[WLAN_BSSID_LEN]; | |
1163 | UINT16 channel; | |
1164 | } __WLAN_ATTRIB_PACK__ hfa384x_JoinRequest_data_t; | |
1165 | ||
1166 | /*-- Configuration Record: authenticateStation (data portion only) --*/ | |
1167 | typedef struct hfa384x_authenticateStation_data | |
1168 | { | |
1169 | UINT8 address[WLAN_ADDR_LEN]; | |
1170 | UINT16 status; | |
1171 | UINT16 algorithm; | |
1172 | } __WLAN_ATTRIB_PACK__ hfa384x_authenticateStation_data_t; | |
1173 | ||
1174 | /*-- Configuration Record: associateStation (data portion only) --*/ | |
1175 | typedef struct hfa384x_associateStation_data | |
1176 | { | |
1177 | UINT8 address[WLAN_ADDR_LEN]; | |
1178 | UINT16 status; | |
1179 | UINT16 type; | |
1180 | } __WLAN_ATTRIB_PACK__ hfa384x_associateStation_data_t; | |
1181 | ||
1182 | /*-- Configuration Record: ChannelInfoRequest (data portion only) --*/ | |
1183 | typedef struct hfa384x_ChannelInfoRequest_data | |
1184 | { | |
1185 | UINT16 channelList; | |
1186 | UINT16 channelDwellTime; | |
1187 | } __WLAN_ATTRIB_PACK__ hfa384x_ChannelInfoRequest_data_t; | |
1188 | ||
1189 | /*-- Configuration Record: WEPKeyMapping (data portion only) --*/ | |
1190 | typedef struct hfa384x_WEPKeyMapping | |
1191 | { | |
1192 | UINT8 address[WLAN_ADDR_LEN]; | |
1193 | UINT16 key_index; | |
1194 | UINT8 key[16]; | |
1195 | UINT8 mic_transmit_key[4]; | |
1196 | UINT8 mic_receive_key[4]; | |
1197 | } __WLAN_ATTRIB_PACK__ hfa384x_WEPKeyMapping_t; | |
1198 | ||
1199 | /*-- Configuration Record: WPAData (data portion only) --*/ | |
1200 | typedef struct hfa384x_WPAData | |
1201 | { | |
1202 | UINT16 datalen; | |
1203 | UINT8 data[0]; // max 80 | |
1204 | } __WLAN_ATTRIB_PACK__ hfa384x_WPAData_t; | |
1205 | ||
1206 | /*-------------------------------------------------------------------- | |
1207 | Configuration Record Structures: Behavior Parameters | |
1208 | --------------------------------------------------------------------*/ | |
1209 | ||
1210 | /*-- Configuration Record: TickTime --*/ | |
1211 | typedef struct hfa384x_TickTime | |
1212 | { | |
1213 | UINT16 TickTime; | |
1214 | } __WLAN_ATTRIB_PACK__ hfa384x_TickTime_t; | |
1215 | ||
1216 | /*-------------------------------------------------------------------- | |
1217 | Information Record Structures: NIC Information | |
1218 | --------------------------------------------------------------------*/ | |
1219 | ||
1220 | /*-- Information Record: MaxLoadTime --*/ | |
1221 | typedef struct hfa384x_MaxLoadTime | |
1222 | { | |
1223 | UINT16 MaxLoadTime; | |
1224 | } __WLAN_ATTRIB_PACK__ hfa384x_MaxLoadTime_t; | |
1225 | ||
1226 | /*-- Information Record: DownLoadBuffer --*/ | |
1227 | /* NOTE: The page and offset are in AUX format */ | |
1228 | typedef struct hfa384x_downloadbuffer | |
1229 | { | |
1230 | UINT16 page; | |
1231 | UINT16 offset; | |
1232 | UINT16 len; | |
1233 | } __WLAN_ATTRIB_PACK__ hfa384x_downloadbuffer_t; | |
1234 | ||
1235 | /*-- Information Record: PRIIdentity --*/ | |
1236 | typedef struct hfa384x_PRIIdentity | |
1237 | { | |
1238 | UINT16 PRICompID; | |
1239 | UINT16 PRIVariant; | |
1240 | UINT16 PRIMajorVersion; | |
1241 | UINT16 PRIMinorVersion; | |
1242 | } __WLAN_ATTRIB_PACK__ hfa384x_PRIIdentity_t; | |
1243 | ||
1244 | /*-- Information Record: PRISupRange --*/ | |
1245 | typedef struct hfa384x_PRISupRange | |
1246 | { | |
1247 | UINT16 PRIRole; | |
1248 | UINT16 PRIID; | |
1249 | UINT16 PRIVariant; | |
1250 | UINT16 PRIBottom; | |
1251 | UINT16 PRITop; | |
1252 | } __WLAN_ATTRIB_PACK__ hfa384x_PRISupRange_t; | |
1253 | ||
1254 | /*-- Information Record: CFIActRanges --*/ | |
1255 | typedef struct hfa384x_CFIActRanges | |
1256 | { | |
1257 | UINT16 CFIRole; | |
1258 | UINT16 CFIID; | |
1259 | UINT16 CFIVariant; | |
1260 | UINT16 CFIBottom; | |
1261 | UINT16 CFITop; | |
1262 | } __WLAN_ATTRIB_PACK__ hfa384x_CFIActRanges_t; | |
1263 | ||
1264 | /*-- Information Record: NICSerialNumber --*/ | |
1265 | typedef struct hfa384x_NICSerialNumber | |
1266 | { | |
1267 | UINT8 NICSerialNumber[12]; | |
1268 | } __WLAN_ATTRIB_PACK__ hfa384x_NICSerialNumber_t; | |
1269 | ||
1270 | /*-- Information Record: NICIdentity --*/ | |
1271 | typedef struct hfa384x_NICIdentity | |
1272 | { | |
1273 | UINT16 NICCompID; | |
1274 | UINT16 NICVariant; | |
1275 | UINT16 NICMajorVersion; | |
1276 | UINT16 NICMinorVersion; | |
1277 | } __WLAN_ATTRIB_PACK__ hfa384x_NICIdentity_t; | |
1278 | ||
1279 | /*-- Information Record: MFISupRange --*/ | |
1280 | typedef struct hfa384x_MFISupRange | |
1281 | { | |
1282 | UINT16 MFIRole; | |
1283 | UINT16 MFIID; | |
1284 | UINT16 MFIVariant; | |
1285 | UINT16 MFIBottom; | |
1286 | UINT16 MFITop; | |
1287 | } __WLAN_ATTRIB_PACK__ hfa384x_MFISupRange_t; | |
1288 | ||
1289 | /*-- Information Record: CFISupRange --*/ | |
1290 | typedef struct hfa384x_CFISupRange | |
1291 | { | |
1292 | UINT16 CFIRole; | |
1293 | UINT16 CFIID; | |
1294 | UINT16 CFIVariant; | |
1295 | UINT16 CFIBottom; | |
1296 | UINT16 CFITop; | |
1297 | } __WLAN_ATTRIB_PACK__ hfa384x_CFISupRange_t; | |
1298 | ||
1299 | /*-- Information Record: BUILDSEQ:BuildSeq --*/ | |
1300 | typedef struct hfa384x_BuildSeq { | |
1301 | UINT16 primary; | |
1302 | UINT16 secondary; | |
1303 | } __WLAN_ATTRIB_PACK__ hfa384x_BuildSeq_t; | |
1304 | ||
1305 | /*-- Information Record: FWID --*/ | |
1306 | #define HFA384x_FWID_LEN 14 | |
1307 | typedef struct hfa384x_FWID { | |
1308 | UINT8 primary[HFA384x_FWID_LEN]; | |
1309 | UINT8 secondary[HFA384x_FWID_LEN]; | |
1310 | } __WLAN_ATTRIB_PACK__ hfa384x_FWID_t; | |
1311 | ||
1312 | /*-- Information Record: ChannelList --*/ | |
1313 | typedef struct hfa384x_ChannelList | |
1314 | { | |
1315 | UINT16 ChannelList; | |
1316 | } __WLAN_ATTRIB_PACK__ hfa384x_ChannelList_t; | |
1317 | ||
1318 | /*-- Information Record: RegulatoryDomains --*/ | |
1319 | typedef struct hfa384x_RegulatoryDomains | |
1320 | { | |
1321 | UINT8 RegulatoryDomains[12]; | |
1322 | } __WLAN_ATTRIB_PACK__ hfa384x_RegulatoryDomains_t; | |
1323 | ||
1324 | /*-- Information Record: TempType --*/ | |
1325 | typedef struct hfa384x_TempType | |
1326 | { | |
1327 | UINT16 TempType; | |
1328 | } __WLAN_ATTRIB_PACK__ hfa384x_TempType_t; | |
1329 | ||
1330 | /*-- Information Record: CIS --*/ | |
1331 | typedef struct hfa384x_CIS | |
1332 | { | |
1333 | UINT8 CIS[480]; | |
1334 | } __WLAN_ATTRIB_PACK__ hfa384x_CIS_t; | |
1335 | ||
1336 | /*-- Information Record: STAIdentity --*/ | |
1337 | typedef struct hfa384x_STAIdentity | |
1338 | { | |
1339 | UINT16 STACompID; | |
1340 | UINT16 STAVariant; | |
1341 | UINT16 STAMajorVersion; | |
1342 | UINT16 STAMinorVersion; | |
1343 | } __WLAN_ATTRIB_PACK__ hfa384x_STAIdentity_t; | |
1344 | ||
1345 | /*-- Information Record: STASupRange --*/ | |
1346 | typedef struct hfa384x_STASupRange | |
1347 | { | |
1348 | UINT16 STARole; | |
1349 | UINT16 STAID; | |
1350 | UINT16 STAVariant; | |
1351 | UINT16 STABottom; | |
1352 | UINT16 STATop; | |
1353 | } __WLAN_ATTRIB_PACK__ hfa384x_STASupRange_t; | |
1354 | ||
1355 | /*-- Information Record: MFIActRanges --*/ | |
1356 | typedef struct hfa384x_MFIActRanges | |
1357 | { | |
1358 | UINT16 MFIRole; | |
1359 | UINT16 MFIID; | |
1360 | UINT16 MFIVariant; | |
1361 | UINT16 MFIBottom; | |
1362 | UINT16 MFITop; | |
1363 | } __WLAN_ATTRIB_PACK__ hfa384x_MFIActRanges_t; | |
1364 | ||
1365 | /*-------------------------------------------------------------------- | |
1366 | Information Record Structures: NIC Information | |
1367 | --------------------------------------------------------------------*/ | |
1368 | ||
1369 | /*-- Information Record: PortStatus --*/ | |
1370 | typedef struct hfa384x_PortStatus | |
1371 | { | |
1372 | UINT16 PortStatus; | |
1373 | } __WLAN_ATTRIB_PACK__ hfa384x_PortStatus_t; | |
1374 | ||
1375 | #define HFA384x_PSTATUS_DISABLED ((UINT16)1) | |
1376 | #define HFA384x_PSTATUS_SEARCHING ((UINT16)2) | |
1377 | #define HFA384x_PSTATUS_CONN_IBSS ((UINT16)3) | |
1378 | #define HFA384x_PSTATUS_CONN_ESS ((UINT16)4) | |
1379 | #define HFA384x_PSTATUS_OUTOFRANGE ((UINT16)5) | |
1380 | #define HFA384x_PSTATUS_CONN_WDS ((UINT16)6) | |
1381 | ||
1382 | /*-- Information Record: CurrentSSID --*/ | |
1383 | typedef struct hfa384x_CurrentSSID | |
1384 | { | |
1385 | UINT8 CurrentSSID[34]; | |
1386 | } __WLAN_ATTRIB_PACK__ hfa384x_CurrentSSID_t; | |
1387 | ||
1388 | /*-- Information Record: CurrentBSSID --*/ | |
1389 | typedef struct hfa384x_CurrentBSSID | |
1390 | { | |
1391 | UINT8 CurrentBSSID[6]; | |
1392 | } __WLAN_ATTRIB_PACK__ hfa384x_CurrentBSSID_t; | |
1393 | ||
1394 | /*-- Information Record: commsquality --*/ | |
1395 | typedef struct hfa384x_commsquality | |
1396 | { | |
1397 | UINT16 CQ_currBSS; | |
1398 | UINT16 ASL_currBSS; | |
1399 | UINT16 ANL_currFC; | |
1400 | } __WLAN_ATTRIB_PACK__ hfa384x_commsquality_t; | |
1401 | ||
1402 | /*-- Information Record: dmbcommsquality --*/ | |
1403 | typedef struct hfa384x_dbmcommsquality | |
1404 | { | |
1405 | UINT16 CQdbm_currBSS; | |
1406 | UINT16 ASLdbm_currBSS; | |
1407 | UINT16 ANLdbm_currFC; | |
1408 | } __WLAN_ATTRIB_PACK__ hfa384x_dbmcommsquality_t; | |
1409 | ||
1410 | /*-- Information Record: CurrentTxRate --*/ | |
1411 | typedef struct hfa384x_CurrentTxRate | |
1412 | { | |
1413 | UINT16 CurrentTxRate; | |
1414 | } __WLAN_ATTRIB_PACK__ hfa384x_CurrentTxRate_t; | |
1415 | ||
1416 | /*-- Information Record: CurrentBeaconInterval --*/ | |
1417 | typedef struct hfa384x_CurrentBeaconInterval | |
1418 | { | |
1419 | UINT16 CurrentBeaconInterval; | |
1420 | } __WLAN_ATTRIB_PACK__ hfa384x_CurrentBeaconInterval_t; | |
1421 | ||
1422 | /*-- Information Record: CurrentScaleThresholds --*/ | |
1423 | typedef struct hfa384x_CurrentScaleThresholds | |
1424 | { | |
1425 | UINT16 EnergyDetectThreshold; | |
1426 | UINT16 CarrierDetectThreshold; | |
1427 | UINT16 DeferDetectThreshold; | |
1428 | UINT16 CellSearchThreshold; /* Stations only */ | |
1429 | UINT16 DeadSpotThreshold; /* Stations only */ | |
1430 | } __WLAN_ATTRIB_PACK__ hfa384x_CurrentScaleThresholds_t; | |
1431 | ||
1432 | /*-- Information Record: ProtocolRspTime --*/ | |
1433 | typedef struct hfa384x_ProtocolRspTime | |
1434 | { | |
1435 | UINT16 ProtocolRspTime; | |
1436 | } __WLAN_ATTRIB_PACK__ hfa384x_ProtocolRspTime_t; | |
1437 | ||
1438 | /*-- Information Record: ShortRetryLimit --*/ | |
1439 | typedef struct hfa384x_ShortRetryLimit | |
1440 | { | |
1441 | UINT16 ShortRetryLimit; | |
1442 | } __WLAN_ATTRIB_PACK__ hfa384x_ShortRetryLimit_t; | |
1443 | ||
1444 | /*-- Information Record: LongRetryLimit --*/ | |
1445 | typedef struct hfa384x_LongRetryLimit | |
1446 | { | |
1447 | UINT16 LongRetryLimit; | |
1448 | } __WLAN_ATTRIB_PACK__ hfa384x_LongRetryLimit_t; | |
1449 | ||
1450 | /*-- Information Record: MaxTransmitLifetime --*/ | |
1451 | typedef struct hfa384x_MaxTransmitLifetime | |
1452 | { | |
1453 | UINT16 MaxTransmitLifetime; | |
1454 | } __WLAN_ATTRIB_PACK__ hfa384x_MaxTransmitLifetime_t; | |
1455 | ||
1456 | /*-- Information Record: MaxReceiveLifetime --*/ | |
1457 | typedef struct hfa384x_MaxReceiveLifetime | |
1458 | { | |
1459 | UINT16 MaxReceiveLifetime; | |
1460 | } __WLAN_ATTRIB_PACK__ hfa384x_MaxReceiveLifetime_t; | |
1461 | ||
1462 | /*-- Information Record: CFPollable --*/ | |
1463 | typedef struct hfa384x_CFPollable | |
1464 | { | |
1465 | UINT16 CFPollable; | |
1466 | } __WLAN_ATTRIB_PACK__ hfa384x_CFPollable_t; | |
1467 | ||
1468 | /*-- Information Record: AuthenticationAlgorithms --*/ | |
1469 | typedef struct hfa384x_AuthenticationAlgorithms | |
1470 | { | |
1471 | UINT16 AuthenticationType; | |
1472 | UINT16 TypeEnabled; | |
1473 | } __WLAN_ATTRIB_PACK__ hfa384x_AuthenticationAlgorithms_t; | |
1474 | ||
1475 | /*-- Information Record: AuthenticationAlgorithms | |
1476 | (data only --*/ | |
1477 | typedef struct hfa384x_AuthenticationAlgorithms_data | |
1478 | { | |
1479 | UINT16 AuthenticationType; | |
1480 | UINT16 TypeEnabled; | |
1481 | } __WLAN_ATTRIB_PACK__ hfa384x_AuthenticationAlgorithms_data_t; | |
1482 | ||
1483 | /*-- Information Record: PrivacyOptionImplemented --*/ | |
1484 | typedef struct hfa384x_PrivacyOptionImplemented | |
1485 | { | |
1486 | UINT16 PrivacyOptionImplemented; | |
1487 | } __WLAN_ATTRIB_PACK__ hfa384x_PrivacyOptionImplemented_t; | |
1488 | ||
1489 | /*-- Information Record: OwnMACAddress --*/ | |
1490 | typedef struct hfa384x_OwnMACAddress | |
1491 | { | |
1492 | UINT8 OwnMACAddress[6]; | |
1493 | } __WLAN_ATTRIB_PACK__ hfa384x_OwnMACAddress_t; | |
1494 | ||
1495 | /*-- Information Record: PCFInfo --*/ | |
1496 | typedef struct hfa384x_PCFInfo | |
1497 | { | |
1498 | UINT16 MediumOccupancyLimit; | |
1499 | UINT16 CFPPeriod; | |
1500 | UINT16 CFPMaxDuration; | |
1501 | UINT16 CFPFlags; | |
1502 | } __WLAN_ATTRIB_PACK__ hfa384x_PCFInfo_t; | |
1503 | ||
1504 | /*-- Information Record: PCFInfo (data portion only) --*/ | |
1505 | typedef struct hfa384x_PCFInfo_data | |
1506 | { | |
1507 | UINT16 MediumOccupancyLimit; | |
1508 | UINT16 CFPPeriod; | |
1509 | UINT16 CFPMaxDuration; | |
1510 | UINT16 CFPFlags; | |
1511 | } __WLAN_ATTRIB_PACK__ hfa384x_PCFInfo_data_t; | |
1512 | ||
1513 | /*-------------------------------------------------------------------- | |
1514 | Information Record Structures: Modem Information Records | |
1515 | --------------------------------------------------------------------*/ | |
1516 | ||
1517 | /*-- Information Record: PHYType --*/ | |
1518 | typedef struct hfa384x_PHYType | |
1519 | { | |
1520 | UINT16 PHYType; | |
1521 | } __WLAN_ATTRIB_PACK__ hfa384x_PHYType_t; | |
1522 | ||
1523 | /*-- Information Record: CurrentChannel --*/ | |
1524 | typedef struct hfa384x_CurrentChannel | |
1525 | { | |
1526 | UINT16 CurrentChannel; | |
1527 | } __WLAN_ATTRIB_PACK__ hfa384x_CurrentChannel_t; | |
1528 | ||
1529 | /*-- Information Record: CurrentPowerState --*/ | |
1530 | typedef struct hfa384x_CurrentPowerState | |
1531 | { | |
1532 | UINT16 CurrentPowerState; | |
1533 | } __WLAN_ATTRIB_PACK__ hfa384x_CurrentPowerState_t; | |
1534 | ||
1535 | /*-- Information Record: CCAMode --*/ | |
1536 | typedef struct hfa384x_CCAMode | |
1537 | { | |
1538 | UINT16 CCAMode; | |
1539 | } __WLAN_ATTRIB_PACK__ hfa384x_CCAMode_t; | |
1540 | ||
1541 | /*-- Information Record: SupportedDataRates --*/ | |
1542 | typedef struct hfa384x_SupportedDataRates | |
1543 | { | |
1544 | UINT8 SupportedDataRates[10]; | |
1545 | } __WLAN_ATTRIB_PACK__ hfa384x_SupportedDataRates_t; | |
1546 | ||
1547 | /*-- Information Record: LFOStatus --*/ | |
1548 | typedef struct hfa384x_LFOStatus | |
1549 | { | |
1550 | UINT16 TestResults; | |
1551 | UINT16 LFOResult; | |
1552 | UINT16 VRHFOResult; | |
1553 | } __WLAN_ATTRIB_PACK__ hfa384x_LFOStatus_t; | |
1554 | ||
1555 | #define HFA384x_TESTRESULT_ALLPASSED BIT0 | |
1556 | #define HFA384x_TESTRESULT_LFO_FAIL BIT1 | |
1557 | #define HFA384x_TESTRESULT_VR_HF0_FAIL BIT2 | |
1558 | #define HFA384x_HOST_FIRM_COORDINATE BIT7 | |
1559 | #define HFA384x_TESTRESULT_COORDINATE BIT15 | |
1560 | ||
1561 | /*-- Information Record: LEDControl --*/ | |
1562 | typedef struct hfa384x_LEDControl | |
1563 | { | |
1564 | UINT16 searching_on; | |
1565 | UINT16 searching_off; | |
1566 | UINT16 assoc_on; | |
1567 | UINT16 assoc_off; | |
1568 | UINT16 activity; | |
1569 | } __WLAN_ATTRIB_PACK__ hfa384x_LEDControl_t; | |
1570 | ||
1571 | /*-------------------------------------------------------------------- | |
1572 | FRAME DESCRIPTORS AND FRAME STRUCTURES | |
1573 | ||
1574 | FRAME DESCRIPTORS: Offsets | |
1575 | ||
1576 | ---------------------------------------------------------------------- | |
1577 | Control Info (offset 44-51) | |
1578 | --------------------------------------------------------------------*/ | |
1579 | #define HFA384x_FD_STATUS_OFF ((UINT16)0x44) | |
1580 | #define HFA384x_FD_TIME_OFF ((UINT16)0x46) | |
1581 | #define HFA384x_FD_SWSUPPORT_OFF ((UINT16)0x4A) | |
1582 | #define HFA384x_FD_SILENCE_OFF ((UINT16)0x4A) | |
1583 | #define HFA384x_FD_SIGNAL_OFF ((UINT16)0x4B) | |
1584 | #define HFA384x_FD_RATE_OFF ((UINT16)0x4C) | |
1585 | #define HFA384x_FD_RXFLOW_OFF ((UINT16)0x4D) | |
1586 | #define HFA384x_FD_RESERVED_OFF ((UINT16)0x4E) | |
1587 | #define HFA384x_FD_TXCONTROL_OFF ((UINT16)0x50) | |
1588 | /*-------------------------------------------------------------------- | |
1589 | 802.11 Header (offset 52-6B) | |
1590 | --------------------------------------------------------------------*/ | |
1591 | #define HFA384x_FD_FRAMECONTROL_OFF ((UINT16)0x52) | |
1592 | #define HFA384x_FD_DURATIONID_OFF ((UINT16)0x54) | |
1593 | #define HFA384x_FD_ADDRESS1_OFF ((UINT16)0x56) | |
1594 | #define HFA384x_FD_ADDRESS2_OFF ((UINT16)0x5C) | |
1595 | #define HFA384x_FD_ADDRESS3_OFF ((UINT16)0x62) | |
1596 | #define HFA384x_FD_SEQCONTROL_OFF ((UINT16)0x68) | |
1597 | #define HFA384x_FD_ADDRESS4_OFF ((UINT16)0x6A) | |
1598 | #define HFA384x_FD_DATALEN_OFF ((UINT16)0x70) | |
1599 | /*-------------------------------------------------------------------- | |
1600 | 802.3 Header (offset 72-7F) | |
1601 | --------------------------------------------------------------------*/ | |
1602 | #define HFA384x_FD_DESTADDRESS_OFF ((UINT16)0x72) | |
1603 | #define HFA384x_FD_SRCADDRESS_OFF ((UINT16)0x78) | |
1604 | #define HFA384x_FD_DATALENGTH_OFF ((UINT16)0x7E) | |
1605 | ||
1606 | /*-------------------------------------------------------------------- | |
1607 | FRAME STRUCTURES: Communication Frames | |
1608 | ---------------------------------------------------------------------- | |
1609 | Communication Frames: Transmit Frames | |
1610 | --------------------------------------------------------------------*/ | |
1611 | /*-- Communication Frame: Transmit Frame Structure --*/ | |
1612 | typedef struct hfa384x_tx_frame | |
1613 | { | |
1614 | UINT16 status; | |
1615 | UINT16 reserved1; | |
1616 | UINT16 reserved2; | |
1617 | UINT32 sw_support; | |
1618 | UINT8 tx_retrycount; | |
1619 | UINT8 tx_rate; | |
1620 | UINT16 tx_control; | |
1621 | ||
1622 | /*-- 802.11 Header Information --*/ | |
1623 | ||
1624 | UINT16 frame_control; | |
1625 | UINT16 duration_id; | |
1626 | UINT8 address1[6]; | |
1627 | UINT8 address2[6]; | |
1628 | UINT8 address3[6]; | |
1629 | UINT16 sequence_control; | |
1630 | UINT8 address4[6]; | |
1631 | UINT16 data_len; /* little endian format */ | |
1632 | ||
1633 | /*-- 802.3 Header Information --*/ | |
1634 | ||
1635 | UINT8 dest_addr[6]; | |
1636 | UINT8 src_addr[6]; | |
1637 | UINT16 data_length; /* big endian format */ | |
1638 | } __WLAN_ATTRIB_PACK__ hfa384x_tx_frame_t; | |
1639 | /*-------------------------------------------------------------------- | |
1640 | Communication Frames: Field Masks for Transmit Frames | |
1641 | --------------------------------------------------------------------*/ | |
1642 | /*-- Status Field --*/ | |
1643 | #define HFA384x_TXSTATUS_ACKERR ((UINT16)BIT5) | |
1644 | #define HFA384x_TXSTATUS_FORMERR ((UINT16)BIT3) | |
1645 | #define HFA384x_TXSTATUS_DISCON ((UINT16)BIT2) | |
1646 | #define HFA384x_TXSTATUS_AGEDERR ((UINT16)BIT1) | |
1647 | #define HFA384x_TXSTATUS_RETRYERR ((UINT16)BIT0) | |
1648 | /*-- Transmit Control Field --*/ | |
1649 | #define HFA384x_TX_CFPOLL ((UINT16)BIT12) | |
1650 | #define HFA384x_TX_PRST ((UINT16)BIT11) | |
1651 | #define HFA384x_TX_MACPORT ((UINT16)(BIT10 | BIT9 | BIT8)) | |
1652 | #define HFA384x_TX_NOENCRYPT ((UINT16)BIT7) | |
1653 | #define HFA384x_TX_RETRYSTRAT ((UINT16)(BIT6 | BIT5)) | |
1654 | #define HFA384x_TX_STRUCTYPE ((UINT16)(BIT4 | BIT3)) | |
1655 | #define HFA384x_TX_TXEX ((UINT16)BIT2) | |
1656 | #define HFA384x_TX_TXOK ((UINT16)BIT1) | |
1657 | /*-------------------------------------------------------------------- | |
1658 | Communication Frames: Test/Get/Set Field Values for Transmit Frames | |
1659 | --------------------------------------------------------------------*/ | |
1660 | /*-- Status Field --*/ | |
1661 | #define HFA384x_TXSTATUS_ISERROR(v) \ | |
1662 | (((UINT16)(v))&\ | |
1663 | (HFA384x_TXSTATUS_ACKERR|HFA384x_TXSTATUS_FORMERR|\ | |
1664 | HFA384x_TXSTATUS_DISCON|HFA384x_TXSTATUS_AGEDERR|\ | |
1665 | HFA384x_TXSTATUS_RETRYERR)) | |
1666 | ||
1667 | #define HFA384x_TXSTATUS_ISACKERR(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_ACKERR)) | |
1668 | #define HFA384x_TXSTATUS_ISFORMERR(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_FORMERR)) | |
1669 | #define HFA384x_TXSTATUS_ISDISCON(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_DISCON)) | |
1670 | #define HFA384x_TXSTATUS_ISAGEDERR(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_AGEDERR)) | |
1671 | #define HFA384x_TXSTATUS_ISRETRYERR(v) ((UINT16)(((UINT16)(v)) & HFA384x_TXSTATUS_RETRYERR)) | |
1672 | ||
1673 | #define HFA384x_TX_GET(v,m,s) ((((UINT16)(v))&((UINT16)(m)))>>((UINT16)(s))) | |
1674 | #define HFA384x_TX_SET(v,m,s) ((((UINT16)(v))<<((UINT16)(s)))&((UINT16)(m))) | |
1675 | ||
1676 | #define HFA384x_TX_CFPOLL_GET(v) HFA384x_TX_GET(v, HFA384x_TX_CFPOLL,12) | |
1677 | #define HFA384x_TX_CFPOLL_SET(v) HFA384x_TX_SET(v, HFA384x_TX_CFPOLL,12) | |
1678 | #define HFA384x_TX_PRST_GET(v) HFA384x_TX_GET(v, HFA384x_TX_PRST,11) | |
1679 | #define HFA384x_TX_PRST_SET(v) HFA384x_TX_SET(v, HFA384x_TX_PRST,11) | |
1680 | #define HFA384x_TX_MACPORT_GET(v) HFA384x_TX_GET(v, HFA384x_TX_MACPORT, 8) | |
1681 | #define HFA384x_TX_MACPORT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8) | |
1682 | #define HFA384x_TX_NOENCRYPT_GET(v) HFA384x_TX_GET(v, HFA384x_TX_NOENCRYPT, 7) | |
1683 | #define HFA384x_TX_NOENCRYPT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_NOENCRYPT, 7) | |
1684 | #define HFA384x_TX_RETRYSTRAT_GET(v) HFA384x_TX_GET(v, HFA384x_TX_RETRYSTRAT, 5) | |
1685 | #define HFA384x_TX_RETRYSTRAT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_RETRYSTRAT, 5) | |
1686 | #define HFA384x_TX_STRUCTYPE_GET(v) HFA384x_TX_GET(v, HFA384x_TX_STRUCTYPE, 3) | |
1687 | #define HFA384x_TX_STRUCTYPE_SET(v) HFA384x_TX_SET(v, HFA384x_TX_STRUCTYPE, 3) | |
1688 | #define HFA384x_TX_TXEX_GET(v) HFA384x_TX_GET(v, HFA384x_TX_TXEX, 2) | |
1689 | #define HFA384x_TX_TXEX_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2) | |
1690 | #define HFA384x_TX_TXOK_GET(v) HFA384x_TX_GET(v, HFA384x_TX_TXOK, 1) | |
1691 | #define HFA384x_TX_TXOK_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1) | |
1692 | /*-------------------------------------------------------------------- | |
1693 | Communication Frames: Receive Frames | |
1694 | --------------------------------------------------------------------*/ | |
1695 | /*-- Communication Frame: Receive Frame Structure --*/ | |
1696 | typedef struct hfa384x_rx_frame | |
1697 | { | |
1698 | /*-- MAC rx descriptor (hfa384x byte order) --*/ | |
1699 | UINT16 status; | |
1700 | UINT32 time; | |
1701 | UINT8 silence; | |
1702 | UINT8 signal; | |
1703 | UINT8 rate; | |
1704 | UINT8 rx_flow; | |
1705 | UINT16 reserved1; | |
1706 | UINT16 reserved2; | |
1707 | ||
1708 | /*-- 802.11 Header Information (802.11 byte order) --*/ | |
1709 | UINT16 frame_control; | |
1710 | UINT16 duration_id; | |
1711 | UINT8 address1[6]; | |
1712 | UINT8 address2[6]; | |
1713 | UINT8 address3[6]; | |
1714 | UINT16 sequence_control; | |
1715 | UINT8 address4[6]; | |
1716 | UINT16 data_len; /* hfa384x (little endian) format */ | |
1717 | ||
1718 | /*-- 802.3 Header Information --*/ | |
1719 | UINT8 dest_addr[6]; | |
1720 | UINT8 src_addr[6]; | |
1721 | UINT16 data_length; /* IEEE? (big endian) format */ | |
1722 | } __WLAN_ATTRIB_PACK__ hfa384x_rx_frame_t; | |
1723 | /*-------------------------------------------------------------------- | |
1724 | Communication Frames: Field Masks for Receive Frames | |
1725 | --------------------------------------------------------------------*/ | |
1726 | /*-- Offsets --------*/ | |
1727 | #define HFA384x_RX_DATA_LEN_OFF ((UINT16)44) | |
1728 | #define HFA384x_RX_80211HDR_OFF ((UINT16)14) | |
1729 | #define HFA384x_RX_DATA_OFF ((UINT16)60) | |
1730 | ||
1731 | /*-- Status Fields --*/ | |
1732 | #define HFA384x_RXSTATUS_MSGTYPE ((UINT16)(BIT15 | BIT14 | BIT13)) | |
1733 | #define HFA384x_RXSTATUS_MACPORT ((UINT16)(BIT10 | BIT9 | BIT8)) | |
1734 | #define HFA384x_RXSTATUS_UNDECR ((UINT16)BIT1) | |
1735 | #define HFA384x_RXSTATUS_FCSERR ((UINT16)BIT0) | |
1736 | /*-------------------------------------------------------------------- | |
1737 | Communication Frames: Test/Get/Set Field Values for Receive Frames | |
1738 | --------------------------------------------------------------------*/ | |
1739 | #define HFA384x_RXSTATUS_MSGTYPE_GET(value) ((UINT16)((((UINT16)(value)) & HFA384x_RXSTATUS_MSGTYPE) >> 13)) | |
1740 | #define HFA384x_RXSTATUS_MSGTYPE_SET(value) ((UINT16)(((UINT16)(value)) << 13)) | |
1741 | #define HFA384x_RXSTATUS_MACPORT_GET(value) ((UINT16)((((UINT16)(value)) & HFA384x_RXSTATUS_MACPORT) >> 8)) | |
1742 | #define HFA384x_RXSTATUS_MACPORT_SET(value) ((UINT16)(((UINT16)(value)) << 8)) | |
1743 | #define HFA384x_RXSTATUS_ISUNDECR(value) ((UINT16)(((UINT16)(value)) & HFA384x_RXSTATUS_UNDECR)) | |
1744 | #define HFA384x_RXSTATUS_ISFCSERR(value) ((UINT16)(((UINT16)(value)) & HFA384x_RXSTATUS_FCSERR)) | |
1745 | /*-------------------------------------------------------------------- | |
1746 | FRAME STRUCTURES: Information Types and Information Frame Structures | |
1747 | ---------------------------------------------------------------------- | |
1748 | Information Types | |
1749 | --------------------------------------------------------------------*/ | |
1750 | #define HFA384x_IT_HANDOVERADDR ((UINT16)0xF000UL) | |
1751 | #define HFA384x_IT_HANDOVERDEAUTHADDRESS ((UINT16)0xF001UL)//AP 1.3.7 | |
1752 | #define HFA384x_IT_COMMTALLIES ((UINT16)0xF100UL) | |
1753 | #define HFA384x_IT_SCANRESULTS ((UINT16)0xF101UL) | |
1754 | #define HFA384x_IT_CHINFORESULTS ((UINT16)0xF102UL) | |
1755 | #define HFA384x_IT_HOSTSCANRESULTS ((UINT16)0xF103UL) | |
1756 | #define HFA384x_IT_LINKSTATUS ((UINT16)0xF200UL) | |
1757 | #define HFA384x_IT_ASSOCSTATUS ((UINT16)0xF201UL) | |
1758 | #define HFA384x_IT_AUTHREQ ((UINT16)0xF202UL) | |
1759 | #define HFA384x_IT_PSUSERCNT ((UINT16)0xF203UL) | |
1760 | #define HFA384x_IT_KEYIDCHANGED ((UINT16)0xF204UL) | |
1761 | #define HFA384x_IT_ASSOCREQ ((UINT16)0xF205UL) | |
1762 | #define HFA384x_IT_MICFAILURE ((UINT16)0xF206UL) | |
1763 | ||
1764 | /*-------------------------------------------------------------------- | |
1765 | Information Frames Structures | |
1766 | ---------------------------------------------------------------------- | |
1767 | Information Frames: Notification Frame Structures | |
1768 | --------------------------------------------------------------------*/ | |
1769 | /*-- Notification Frame,MAC Mgmt: Handover Address --*/ | |
1770 | typedef struct hfa384x_HandoverAddr | |
1771 | { | |
1772 | UINT16 framelen; | |
1773 | UINT16 infotype; | |
1774 | UINT8 handover_addr[WLAN_BSSID_LEN]; | |
1775 | } __WLAN_ATTRIB_PACK__ hfa384x_HandoverAddr_t; | |
1776 | ||
1777 | /*-- Inquiry Frame, Diagnose: Communication Tallies --*/ | |
1778 | typedef struct hfa384x_CommTallies16 | |
1779 | { | |
1780 | UINT16 txunicastframes; | |
1781 | UINT16 txmulticastframes; | |
1782 | UINT16 txfragments; | |
1783 | UINT16 txunicastoctets; | |
1784 | UINT16 txmulticastoctets; | |
1785 | UINT16 txdeferredtrans; | |
1786 | UINT16 txsingleretryframes; | |
1787 | UINT16 txmultipleretryframes; | |
1788 | UINT16 txretrylimitexceeded; | |
1789 | UINT16 txdiscards; | |
1790 | UINT16 rxunicastframes; | |
1791 | UINT16 rxmulticastframes; | |
1792 | UINT16 rxfragments; | |
1793 | UINT16 rxunicastoctets; | |
1794 | UINT16 rxmulticastoctets; | |
1795 | UINT16 rxfcserrors; | |
1796 | UINT16 rxdiscardsnobuffer; | |
1797 | UINT16 txdiscardswrongsa; | |
1798 | UINT16 rxdiscardswepundecr; | |
1799 | UINT16 rxmsginmsgfrag; | |
1800 | UINT16 rxmsginbadmsgfrag; | |
1801 | } __WLAN_ATTRIB_PACK__ hfa384x_CommTallies16_t; | |
1802 | ||
1803 | typedef struct hfa384x_CommTallies32 | |
1804 | { | |
1805 | UINT32 txunicastframes; | |
1806 | UINT32 txmulticastframes; | |
1807 | UINT32 txfragments; | |
1808 | UINT32 txunicastoctets; | |
1809 | UINT32 txmulticastoctets; | |
1810 | UINT32 txdeferredtrans; | |
1811 | UINT32 txsingleretryframes; | |
1812 | UINT32 txmultipleretryframes; | |
1813 | UINT32 txretrylimitexceeded; | |
1814 | UINT32 txdiscards; | |
1815 | UINT32 rxunicastframes; | |
1816 | UINT32 rxmulticastframes; | |
1817 | UINT32 rxfragments; | |
1818 | UINT32 rxunicastoctets; | |
1819 | UINT32 rxmulticastoctets; | |
1820 | UINT32 rxfcserrors; | |
1821 | UINT32 rxdiscardsnobuffer; | |
1822 | UINT32 txdiscardswrongsa; | |
1823 | UINT32 rxdiscardswepundecr; | |
1824 | UINT32 rxmsginmsgfrag; | |
1825 | UINT32 rxmsginbadmsgfrag; | |
1826 | } __WLAN_ATTRIB_PACK__ hfa384x_CommTallies32_t; | |
1827 | ||
1828 | /*-- Inquiry Frame, Diagnose: Scan Results & Subfields--*/ | |
1829 | typedef struct hfa384x_ScanResultSub | |
1830 | { | |
1831 | UINT16 chid; | |
1832 | UINT16 anl; | |
1833 | UINT16 sl; | |
1834 | UINT8 bssid[WLAN_BSSID_LEN]; | |
1835 | UINT16 bcnint; | |
1836 | UINT16 capinfo; | |
1837 | hfa384x_bytestr32_t ssid; | |
1838 | UINT8 supprates[10]; /* 802.11 info element */ | |
1839 | UINT16 proberesp_rate; | |
1840 | } __WLAN_ATTRIB_PACK__ hfa384x_ScanResultSub_t; | |
1841 | ||
1842 | typedef struct hfa384x_ScanResult | |
1843 | { | |
1844 | UINT16 rsvd; | |
1845 | UINT16 scanreason; | |
1846 | hfa384x_ScanResultSub_t | |
1847 | result[HFA384x_SCANRESULT_MAX]; | |
1848 | } __WLAN_ATTRIB_PACK__ hfa384x_ScanResult_t; | |
1849 | ||
1850 | /*-- Inquiry Frame, Diagnose: ChInfo Results & Subfields--*/ | |
1851 | typedef struct hfa384x_ChInfoResultSub | |
1852 | { | |
1853 | UINT16 chid; | |
1854 | UINT16 anl; | |
1855 | UINT16 pnl; | |
1856 | UINT16 active; | |
1857 | } __WLAN_ATTRIB_PACK__ hfa384x_ChInfoResultSub_t; | |
1858 | ||
1859 | #define HFA384x_CHINFORESULT_BSSACTIVE BIT0 | |
1860 | #define HFA384x_CHINFORESULT_PCFACTIVE BIT1 | |
1861 | ||
1862 | typedef struct hfa384x_ChInfoResult | |
1863 | { | |
1864 | UINT16 scanchannels; | |
1865 | hfa384x_ChInfoResultSub_t | |
1866 | result[HFA384x_CHINFORESULT_MAX]; | |
1867 | } __WLAN_ATTRIB_PACK__ hfa384x_ChInfoResult_t; | |
1868 | ||
1869 | /*-- Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/ | |
1870 | typedef struct hfa384x_HScanResultSub | |
1871 | { | |
1872 | UINT16 chid; | |
1873 | UINT16 anl; | |
1874 | UINT16 sl; | |
1875 | UINT8 bssid[WLAN_BSSID_LEN]; | |
1876 | UINT16 bcnint; | |
1877 | UINT16 capinfo; | |
1878 | hfa384x_bytestr32_t ssid; | |
1879 | UINT8 supprates[10]; /* 802.11 info element */ | |
1880 | UINT16 proberesp_rate; | |
1881 | UINT16 atim; | |
1882 | } __WLAN_ATTRIB_PACK__ hfa384x_HScanResultSub_t; | |
1883 | ||
1884 | typedef struct hfa384x_HScanResult | |
1885 | { | |
1886 | UINT16 nresult; | |
1887 | UINT16 rsvd; | |
1888 | hfa384x_HScanResultSub_t | |
1889 | result[HFA384x_HSCANRESULT_MAX]; | |
1890 | } __WLAN_ATTRIB_PACK__ hfa384x_HScanResult_t; | |
1891 | ||
1892 | /*-- Unsolicited Frame, MAC Mgmt: LinkStatus --*/ | |
1893 | ||
1894 | #define HFA384x_LINK_NOTCONNECTED ((UINT16)0) | |
1895 | #define HFA384x_LINK_CONNECTED ((UINT16)1) | |
1896 | #define HFA384x_LINK_DISCONNECTED ((UINT16)2) | |
1897 | #define HFA384x_LINK_AP_CHANGE ((UINT16)3) | |
1898 | #define HFA384x_LINK_AP_OUTOFRANGE ((UINT16)4) | |
1899 | #define HFA384x_LINK_AP_INRANGE ((UINT16)5) | |
1900 | #define HFA384x_LINK_ASSOCFAIL ((UINT16)6) | |
1901 | ||
1902 | typedef struct hfa384x_LinkStatus | |
1903 | { | |
1904 | UINT16 linkstatus; | |
1905 | } __WLAN_ATTRIB_PACK__ hfa384x_LinkStatus_t; | |
1906 | ||
1907 | ||
1908 | /*-- Unsolicited Frame, MAC Mgmt: AssociationStatus (--*/ | |
1909 | ||
1910 | #define HFA384x_ASSOCSTATUS_STAASSOC ((UINT16)1) | |
1911 | #define HFA384x_ASSOCSTATUS_REASSOC ((UINT16)2) | |
1912 | #define HFA384x_ASSOCSTATUS_DISASSOC ((UINT16)3) | |
1913 | #define HFA384x_ASSOCSTATUS_ASSOCFAIL ((UINT16)4) | |
1914 | #define HFA384x_ASSOCSTATUS_AUTHFAIL ((UINT16)5) | |
1915 | ||
1916 | typedef struct hfa384x_AssocStatus | |
1917 | { | |
1918 | UINT16 assocstatus; | |
1919 | UINT8 sta_addr[WLAN_ADDR_LEN]; | |
1920 | /* old_ap_addr is only valid if assocstatus == 2 */ | |
1921 | UINT8 old_ap_addr[WLAN_ADDR_LEN]; | |
1922 | UINT16 reason; | |
1923 | UINT16 reserved; | |
1924 | } __WLAN_ATTRIB_PACK__ hfa384x_AssocStatus_t; | |
1925 | ||
1926 | /*-- Unsolicited Frame, MAC Mgmt: AuthRequest (AP Only) --*/ | |
1927 | ||
1928 | typedef struct hfa384x_AuthRequest | |
1929 | { | |
1930 | UINT8 sta_addr[WLAN_ADDR_LEN]; | |
1931 | UINT16 algorithm; | |
1932 | } __WLAN_ATTRIB_PACK__ hfa384x_AuthReq_t; | |
1933 | ||
1934 | /*-- Unsolicited Frame, MAC Mgmt: AssocRequest (AP Only) --*/ | |
1935 | ||
1936 | typedef struct hfa384x_AssocRequest | |
1937 | { | |
1938 | UINT8 sta_addr[WLAN_ADDR_LEN]; | |
1939 | UINT16 type; | |
1940 | UINT8 wpa_data[80]; | |
1941 | } __WLAN_ATTRIB_PACK__ hfa384x_AssocReq_t; | |
1942 | ||
1943 | ||
1944 | #define HFA384x_ASSOCREQ_TYPE_ASSOC 0 | |
1945 | #define HFA384x_ASSOCREQ_TYPE_REASSOC 1 | |
1946 | ||
1947 | /*-- Unsolicited Frame, MAC Mgmt: MIC Failure (AP Only) --*/ | |
1948 | ||
1949 | typedef struct hfa384x_MicFailure | |
1950 | { | |
1951 | UINT8 sender[WLAN_ADDR_LEN]; | |
1952 | UINT8 dest[WLAN_ADDR_LEN]; | |
1953 | } __WLAN_ATTRIB_PACK__ hfa384x_MicFailure_t; | |
1954 | ||
1955 | /*-- Unsolicited Frame, MAC Mgmt: PSUserCount (AP Only) --*/ | |
1956 | ||
1957 | typedef struct hfa384x_PSUserCount | |
1958 | { | |
1959 | UINT16 usercnt; | |
1960 | } __WLAN_ATTRIB_PACK__ hfa384x_PSUserCount_t; | |
1961 | ||
1962 | typedef struct hfa384x_KeyIDChanged | |
1963 | { | |
1964 | UINT8 sta_addr[WLAN_ADDR_LEN]; | |
1965 | UINT16 keyid; | |
1966 | } __WLAN_ATTRIB_PACK__ hfa384x_KeyIDChanged_t; | |
1967 | ||
1968 | /*-- Collection of all Inf frames ---------------*/ | |
1969 | typedef union hfa384x_infodata { | |
1970 | hfa384x_CommTallies16_t commtallies16; | |
1971 | hfa384x_CommTallies32_t commtallies32; | |
1972 | hfa384x_ScanResult_t scanresult; | |
1973 | hfa384x_ChInfoResult_t chinforesult; | |
1974 | hfa384x_HScanResult_t hscanresult; | |
1975 | hfa384x_LinkStatus_t linkstatus; | |
1976 | hfa384x_AssocStatus_t assocstatus; | |
1977 | hfa384x_AuthReq_t authreq; | |
1978 | hfa384x_PSUserCount_t psusercnt; | |
1979 | hfa384x_KeyIDChanged_t keyidchanged; | |
1980 | } __WLAN_ATTRIB_PACK__ hfa384x_infodata_t; | |
1981 | ||
1982 | typedef struct hfa384x_InfFrame | |
1983 | { | |
1984 | UINT16 framelen; | |
1985 | UINT16 infotype; | |
1986 | hfa384x_infodata_t info; | |
1987 | } __WLAN_ATTRIB_PACK__ hfa384x_InfFrame_t; | |
1988 | ||
1989 | #if (WLAN_HOSTIF == WLAN_USB) | |
1990 | /*-------------------------------------------------------------------- | |
1991 | USB Packet structures and constants. | |
1992 | --------------------------------------------------------------------*/ | |
1993 | ||
1994 | /* Should be sent to the ctrlout endpoint */ | |
1995 | #define HFA384x_USB_ENBULKIN 6 | |
1996 | ||
1997 | /* Should be sent to the bulkout endpoint */ | |
1998 | #define HFA384x_USB_TXFRM 0 | |
1999 | #define HFA384x_USB_CMDREQ 1 | |
2000 | #define HFA384x_USB_WRIDREQ 2 | |
2001 | #define HFA384x_USB_RRIDREQ 3 | |
2002 | #define HFA384x_USB_WMEMREQ 4 | |
2003 | #define HFA384x_USB_RMEMREQ 5 | |
2004 | ||
2005 | /* Received from the bulkin endpoint */ | |
2006 | #define HFA384x_USB_ISFRM(a) (!((a) & 0x8000)) | |
2007 | #define HFA384x_USB_ISTXFRM(a) (((a) & 0x9000) == 0x1000) | |
2008 | #define HFA384x_USB_ISRXFRM(a) (!((a) & 0x9000)) | |
2009 | #define HFA384x_USB_INFOFRM 0x8000 | |
2010 | #define HFA384x_USB_CMDRESP 0x8001 | |
2011 | #define HFA384x_USB_WRIDRESP 0x8002 | |
2012 | #define HFA384x_USB_RRIDRESP 0x8003 | |
2013 | #define HFA384x_USB_WMEMRESP 0x8004 | |
2014 | #define HFA384x_USB_RMEMRESP 0x8005 | |
2015 | #define HFA384x_USB_BUFAVAIL 0x8006 | |
2016 | #define HFA384x_USB_ERROR 0x8007 | |
2017 | ||
2018 | /*------------------------------------*/ | |
2019 | /* Request (bulk OUT) packet contents */ | |
2020 | ||
2021 | typedef struct hfa384x_usb_txfrm { | |
2022 | hfa384x_tx_frame_t desc; | |
2023 | UINT8 data[WLAN_DATA_MAXLEN]; | |
2024 | } __WLAN_ATTRIB_PACK__ hfa384x_usb_txfrm_t; | |
2025 | ||
2026 | typedef struct hfa384x_usb_cmdreq { | |
2027 | UINT16 type; | |
2028 | UINT16 cmd; | |
2029 | UINT16 parm0; | |
2030 | UINT16 parm1; | |
2031 | UINT16 parm2; | |
2032 | UINT8 pad[54]; | |
2033 | } __WLAN_ATTRIB_PACK__ hfa384x_usb_cmdreq_t; | |
2034 | ||
2035 | typedef struct hfa384x_usb_wridreq { | |
2036 | UINT16 type; | |
2037 | UINT16 frmlen; | |
2038 | UINT16 rid; | |
2039 | UINT8 data[HFA384x_RIDDATA_MAXLEN]; | |
2040 | } __WLAN_ATTRIB_PACK__ hfa384x_usb_wridreq_t; | |
2041 | ||
2042 | typedef struct hfa384x_usb_rridreq { | |
2043 | UINT16 type; | |
2044 | UINT16 frmlen; | |
2045 | UINT16 rid; | |
2046 | UINT8 pad[58]; | |
2047 | } __WLAN_ATTRIB_PACK__ hfa384x_usb_rridreq_t; | |
2048 | ||
2049 | typedef struct hfa384x_usb_wmemreq { | |
2050 | UINT16 type; | |
2051 | UINT16 frmlen; | |
2052 | UINT16 offset; | |
2053 | UINT16 page; | |
2054 | UINT8 data[HFA384x_USB_RWMEM_MAXLEN]; | |
2055 | } __WLAN_ATTRIB_PACK__ hfa384x_usb_wmemreq_t; | |
2056 | ||
2057 | typedef struct hfa384x_usb_rmemreq { | |
2058 | UINT16 type; | |
2059 | UINT16 frmlen; | |
2060 | UINT16 offset; | |
2061 | UINT16 page; | |
2062 | UINT8 pad[56]; | |
2063 | } __WLAN_ATTRIB_PACK__ hfa384x_usb_rmemreq_t; | |
2064 | ||
2065 | /*------------------------------------*/ | |
2066 | /* Response (bulk IN) packet contents */ | |
2067 | ||
2068 | typedef struct hfa384x_usb_rxfrm { | |
2069 | hfa384x_rx_frame_t desc; | |
2070 | UINT8 data[WLAN_DATA_MAXLEN]; | |
2071 | } __WLAN_ATTRIB_PACK__ hfa384x_usb_rxfrm_t; | |
2072 | ||
2073 | typedef struct hfa384x_usb_infofrm { | |
2074 | UINT16 type; | |
2075 | hfa384x_InfFrame_t info; | |
2076 | } __WLAN_ATTRIB_PACK__ hfa384x_usb_infofrm_t; | |
2077 | ||
2078 | typedef struct hfa384x_usb_statusresp { | |
2079 | UINT16 type; | |
2080 | UINT16 status; | |
2081 | UINT16 resp0; | |
2082 | UINT16 resp1; | |
2083 | UINT16 resp2; | |
2084 | } __WLAN_ATTRIB_PACK__ hfa384x_usb_cmdresp_t; | |
2085 | ||
2086 | typedef hfa384x_usb_cmdresp_t hfa384x_usb_wridresp_t; | |
2087 | ||
2088 | typedef struct hfa384x_usb_rridresp { | |
2089 | UINT16 type; | |
2090 | UINT16 frmlen; | |
2091 | UINT16 rid; | |
2092 | UINT8 data[HFA384x_RIDDATA_MAXLEN]; | |
2093 | } __WLAN_ATTRIB_PACK__ hfa384x_usb_rridresp_t; | |
2094 | ||
2095 | typedef hfa384x_usb_cmdresp_t hfa384x_usb_wmemresp_t; | |
2096 | ||
2097 | typedef struct hfa384x_usb_rmemresp { | |
2098 | UINT16 type; | |
2099 | UINT16 frmlen; | |
2100 | UINT8 data[HFA384x_USB_RWMEM_MAXLEN]; | |
2101 | } __WLAN_ATTRIB_PACK__ hfa384x_usb_rmemresp_t; | |
2102 | ||
2103 | typedef struct hfa384x_usb_bufavail { | |
2104 | UINT16 type; | |
2105 | UINT16 frmlen; | |
2106 | } __WLAN_ATTRIB_PACK__ hfa384x_usb_bufavail_t; | |
2107 | ||
2108 | typedef struct hfa384x_usb_error { | |
2109 | UINT16 type; | |
2110 | UINT16 errortype; | |
2111 | } __WLAN_ATTRIB_PACK__ hfa384x_usb_error_t; | |
2112 | ||
2113 | /*----------------------------------------------------------*/ | |
2114 | /* Unions for packaging all the known packet types together */ | |
2115 | ||
2116 | typedef union hfa384x_usbout { | |
2117 | UINT16 type; | |
2118 | hfa384x_usb_txfrm_t txfrm; | |
2119 | hfa384x_usb_cmdreq_t cmdreq; | |
2120 | hfa384x_usb_wridreq_t wridreq; | |
2121 | hfa384x_usb_rridreq_t rridreq; | |
2122 | hfa384x_usb_wmemreq_t wmemreq; | |
2123 | hfa384x_usb_rmemreq_t rmemreq; | |
2124 | } __WLAN_ATTRIB_PACK__ hfa384x_usbout_t; | |
2125 | ||
2126 | typedef union hfa384x_usbin { | |
2127 | UINT16 type; | |
2128 | hfa384x_usb_rxfrm_t rxfrm; | |
2129 | hfa384x_usb_txfrm_t txfrm; | |
2130 | hfa384x_usb_infofrm_t infofrm; | |
2131 | hfa384x_usb_cmdresp_t cmdresp; | |
2132 | hfa384x_usb_wridresp_t wridresp; | |
2133 | hfa384x_usb_rridresp_t rridresp; | |
2134 | hfa384x_usb_wmemresp_t wmemresp; | |
2135 | hfa384x_usb_rmemresp_t rmemresp; | |
2136 | hfa384x_usb_bufavail_t bufavail; | |
2137 | hfa384x_usb_error_t usberror; | |
2138 | UINT8 boguspad[3000]; | |
2139 | } __WLAN_ATTRIB_PACK__ hfa384x_usbin_t; | |
2140 | ||
2141 | #endif /* WLAN_USB */ | |
2142 | ||
2143 | /*-------------------------------------------------------------------- | |
2144 | PD record structures. | |
2145 | --------------------------------------------------------------------*/ | |
2146 | ||
2147 | typedef struct hfa384x_pdr_pcb_partnum | |
2148 | { | |
2149 | UINT8 num[8]; | |
2150 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_pcb_partnum_t; | |
2151 | ||
2152 | typedef struct hfa384x_pdr_pcb_tracenum | |
2153 | { | |
2154 | UINT8 num[8]; | |
2155 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_pcb_tracenum_t; | |
2156 | ||
2157 | typedef struct hfa384x_pdr_nic_serial | |
2158 | { | |
2159 | UINT8 num[12]; | |
2160 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nic_serial_t; | |
2161 | ||
2162 | typedef struct hfa384x_pdr_mkk_measurements | |
2163 | { | |
2164 | double carrier_freq; | |
2165 | double occupied_band; | |
2166 | double power_density; | |
2167 | double tx_spur_f1; | |
2168 | double tx_spur_f2; | |
2169 | double tx_spur_f3; | |
2170 | double tx_spur_f4; | |
2171 | double tx_spur_l1; | |
2172 | double tx_spur_l2; | |
2173 | double tx_spur_l3; | |
2174 | double tx_spur_l4; | |
2175 | double rx_spur_f1; | |
2176 | double rx_spur_f2; | |
2177 | double rx_spur_l1; | |
2178 | double rx_spur_l2; | |
2179 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mkk_measurements_t; | |
2180 | ||
2181 | typedef struct hfa384x_pdr_nic_ramsize | |
2182 | { | |
2183 | UINT8 size[12]; /* units of KB */ | |
2184 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nic_ramsize_t; | |
2185 | ||
2186 | typedef struct hfa384x_pdr_mfisuprange | |
2187 | { | |
2188 | UINT16 id; | |
2189 | UINT16 variant; | |
2190 | UINT16 bottom; | |
2191 | UINT16 top; | |
2192 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mfisuprange_t; | |
2193 | ||
2194 | typedef struct hfa384x_pdr_cfisuprange | |
2195 | { | |
2196 | UINT16 id; | |
2197 | UINT16 variant; | |
2198 | UINT16 bottom; | |
2199 | UINT16 top; | |
2200 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_cfisuprange_t; | |
2201 | ||
2202 | typedef struct hfa384x_pdr_nicid | |
2203 | { | |
2204 | UINT16 id; | |
2205 | UINT16 variant; | |
2206 | UINT16 major; | |
2207 | UINT16 minor; | |
2208 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nicid_t; | |
2209 | ||
2210 | ||
2211 | typedef struct hfa384x_pdr_refdac_measurements | |
2212 | { | |
2213 | UINT16 value[0]; | |
2214 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_refdac_measurements_t; | |
2215 | ||
2216 | typedef struct hfa384x_pdr_vgdac_measurements | |
2217 | { | |
2218 | UINT16 value[0]; | |
2219 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_vgdac_measurements_t; | |
2220 | ||
2221 | typedef struct hfa384x_pdr_level_comp_measurements | |
2222 | { | |
2223 | UINT16 value[0]; | |
2224 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_level_compc_measurements_t; | |
2225 | ||
2226 | typedef struct hfa384x_pdr_mac_address | |
2227 | { | |
2228 | UINT8 addr[6]; | |
2229 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mac_address_t; | |
2230 | ||
2231 | typedef struct hfa384x_pdr_mkk_callname | |
2232 | { | |
2233 | UINT8 callname[8]; | |
2234 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_mkk_callname_t; | |
2235 | ||
2236 | typedef struct hfa384x_pdr_regdomain | |
2237 | { | |
2238 | UINT16 numdomains; | |
2239 | UINT16 domain[5]; | |
2240 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_regdomain_t; | |
2241 | ||
2242 | typedef struct hfa384x_pdr_allowed_channel | |
2243 | { | |
2244 | UINT16 ch_bitmap; | |
2245 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_allowed_channel_t; | |
2246 | ||
2247 | typedef struct hfa384x_pdr_default_channel | |
2248 | { | |
2249 | UINT16 channel; | |
2250 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_default_channel_t; | |
2251 | ||
2252 | typedef struct hfa384x_pdr_privacy_option | |
2253 | { | |
2254 | UINT16 available; | |
2255 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_privacy_option_t; | |
2256 | ||
2257 | typedef struct hfa384x_pdr_temptype | |
2258 | { | |
2259 | UINT16 type; | |
2260 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_temptype_t; | |
2261 | ||
2262 | typedef struct hfa384x_pdr_refdac_setup | |
2263 | { | |
2264 | UINT16 ch_value[14]; | |
2265 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_refdac_setup_t; | |
2266 | ||
2267 | typedef struct hfa384x_pdr_vgdac_setup | |
2268 | { | |
2269 | UINT16 ch_value[14]; | |
2270 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_vgdac_setup_t; | |
2271 | ||
2272 | typedef struct hfa384x_pdr_level_comp_setup | |
2273 | { | |
2274 | UINT16 ch_value[14]; | |
2275 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_level_comp_setup_t; | |
2276 | ||
2277 | typedef struct hfa384x_pdr_trimdac_setup | |
2278 | { | |
2279 | UINT16 trimidac; | |
2280 | UINT16 trimqdac; | |
2281 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_trimdac_setup_t; | |
2282 | ||
2283 | typedef struct hfa384x_pdr_ifr_setting | |
2284 | { | |
2285 | UINT16 value[3]; | |
2286 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_ifr_setting_t; | |
2287 | ||
2288 | typedef struct hfa384x_pdr_rfr_setting | |
2289 | { | |
2290 | UINT16 value[3]; | |
2291 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_rfr_setting_t; | |
2292 | ||
2293 | typedef struct hfa384x_pdr_hfa3861_baseline | |
2294 | { | |
2295 | UINT16 value[50]; | |
2296 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_baseline_t; | |
2297 | ||
2298 | typedef struct hfa384x_pdr_hfa3861_shadow | |
2299 | { | |
2300 | UINT32 value[32]; | |
2301 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_shadow_t; | |
2302 | ||
2303 | typedef struct hfa384x_pdr_hfa3861_ifrf | |
2304 | { | |
2305 | UINT32 value[20]; | |
2306 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_ifrf_t; | |
2307 | ||
2308 | typedef struct hfa384x_pdr_hfa3861_chcalsp | |
2309 | { | |
2310 | UINT16 value[14]; | |
2311 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_chcalsp_t; | |
2312 | ||
2313 | typedef struct hfa384x_pdr_hfa3861_chcali | |
2314 | { | |
2315 | UINT16 value[17]; | |
2316 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_chcali_t; | |
2317 | ||
2318 | typedef struct hfa384x_pdr_hfa3861_nic_config | |
2319 | { | |
2320 | UINT16 config_bitmap; | |
2321 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_nic_config_t; | |
2322 | ||
2323 | typedef struct hfa384x_pdr_hfo_delay | |
2324 | { | |
2325 | UINT8 hfo_delay; | |
2326 | } __WLAN_ATTRIB_PACK__ hfa384x_hfo_delay_t; | |
2327 | ||
2328 | typedef struct hfa384x_pdr_hfa3861_manf_testsp | |
2329 | { | |
2330 | UINT16 value[30]; | |
2331 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_manf_testsp_t; | |
2332 | ||
2333 | typedef struct hfa384x_pdr_hfa3861_manf_testi | |
2334 | { | |
2335 | UINT16 value[30]; | |
2336 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_hfa3861_manf_testi_t; | |
2337 | ||
2338 | typedef struct hfa384x_end_of_pda | |
2339 | { | |
2340 | UINT16 crc; | |
2341 | } __WLAN_ATTRIB_PACK__ hfa384x_pdr_end_of_pda_t; | |
2342 | ||
2343 | typedef struct hfa384x_pdrec | |
2344 | { | |
2345 | UINT16 len; /* in words */ | |
2346 | UINT16 code; | |
2347 | union pdr { | |
2348 | hfa384x_pdr_pcb_partnum_t pcb_partnum; | |
2349 | hfa384x_pdr_pcb_tracenum_t pcb_tracenum; | |
2350 | hfa384x_pdr_nic_serial_t nic_serial; | |
2351 | hfa384x_pdr_mkk_measurements_t mkk_measurements; | |
2352 | hfa384x_pdr_nic_ramsize_t nic_ramsize; | |
2353 | hfa384x_pdr_mfisuprange_t mfisuprange; | |
2354 | hfa384x_pdr_cfisuprange_t cfisuprange; | |
2355 | hfa384x_pdr_nicid_t nicid; | |
2356 | hfa384x_pdr_refdac_measurements_t refdac_measurements; | |
2357 | hfa384x_pdr_vgdac_measurements_t vgdac_measurements; | |
2358 | hfa384x_pdr_level_compc_measurements_t level_compc_measurements; | |
2359 | hfa384x_pdr_mac_address_t mac_address; | |
2360 | hfa384x_pdr_mkk_callname_t mkk_callname; | |
2361 | hfa384x_pdr_regdomain_t regdomain; | |
2362 | hfa384x_pdr_allowed_channel_t allowed_channel; | |
2363 | hfa384x_pdr_default_channel_t default_channel; | |
2364 | hfa384x_pdr_privacy_option_t privacy_option; | |
2365 | hfa384x_pdr_temptype_t temptype; | |
2366 | hfa384x_pdr_refdac_setup_t refdac_setup; | |
2367 | hfa384x_pdr_vgdac_setup_t vgdac_setup; | |
2368 | hfa384x_pdr_level_comp_setup_t level_comp_setup; | |
2369 | hfa384x_pdr_trimdac_setup_t trimdac_setup; | |
2370 | hfa384x_pdr_ifr_setting_t ifr_setting; | |
2371 | hfa384x_pdr_rfr_setting_t rfr_setting; | |
2372 | hfa384x_pdr_hfa3861_baseline_t hfa3861_baseline; | |
2373 | hfa384x_pdr_hfa3861_shadow_t hfa3861_shadow; | |
2374 | hfa384x_pdr_hfa3861_ifrf_t hfa3861_ifrf; | |
2375 | hfa384x_pdr_hfa3861_chcalsp_t hfa3861_chcalsp; | |
2376 | hfa384x_pdr_hfa3861_chcali_t hfa3861_chcali; | |
2377 | hfa384x_pdr_nic_config_t nic_config; | |
2378 | hfa384x_hfo_delay_t hfo_delay; | |
2379 | hfa384x_pdr_hfa3861_manf_testsp_t hfa3861_manf_testsp; | |
2380 | hfa384x_pdr_hfa3861_manf_testi_t hfa3861_manf_testi; | |
2381 | hfa384x_pdr_end_of_pda_t end_of_pda; | |
2382 | ||
2383 | } data; | |
2384 | } __WLAN_ATTRIB_PACK__ hfa384x_pdrec_t; | |
2385 | ||
2386 | ||
2387 | #ifdef __KERNEL__ | |
2388 | /*-------------------------------------------------------------------- | |
2389 | --- MAC state structure, argument to all functions -- | |
2390 | --- Also, a collection of support types -- | |
2391 | --------------------------------------------------------------------*/ | |
2392 | typedef struct hfa384x_statusresult | |
2393 | { | |
2394 | UINT16 status; | |
2395 | UINT16 resp0; | |
2396 | UINT16 resp1; | |
2397 | UINT16 resp2; | |
2398 | } hfa384x_cmdresult_t; | |
2399 | ||
2400 | #if (WLAN_HOSTIF == WLAN_USB) | |
2401 | ||
2402 | /* USB Control Exchange (CTLX): | |
2403 | * A queue of the structure below is maintained for all of the | |
2404 | * Request/Response type USB packets supported by Prism2. | |
2405 | */ | |
2406 | /* The following hfa384x_* structures are arguments to | |
2407 | * the usercb() for the different CTLX types. | |
2408 | */ | |
2409 | typedef hfa384x_cmdresult_t hfa384x_wridresult_t; | |
2410 | typedef hfa384x_cmdresult_t hfa384x_wmemresult_t; | |
2411 | ||
2412 | typedef struct hfa384x_rridresult | |
2413 | { | |
2414 | UINT16 rid; | |
2415 | const void *riddata; | |
2416 | UINT riddata_len; | |
2417 | } hfa384x_rridresult_t; | |
2418 | ||
2419 | enum ctlx_state { | |
2420 | CTLX_START = 0, /* Start state, not queued */ | |
2421 | ||
2422 | CTLX_COMPLETE, /* CTLX successfully completed */ | |
2423 | CTLX_REQ_FAILED, /* OUT URB completed w/ error */ | |
2424 | ||
2425 | CTLX_PENDING, /* Queued, data valid */ | |
2426 | CTLX_REQ_SUBMITTED, /* OUT URB submitted */ | |
2427 | CTLX_REQ_COMPLETE, /* OUT URB complete */ | |
2428 | CTLX_RESP_COMPLETE /* IN URB received */ | |
2429 | }; | |
2430 | typedef enum ctlx_state CTLX_STATE; | |
2431 | ||
2432 | struct hfa384x_usbctlx; | |
2433 | struct hfa384x; | |
2434 | ||
2435 | typedef void (*ctlx_cmdcb_t)( struct hfa384x*, const struct hfa384x_usbctlx* ); | |
2436 | ||
2437 | typedef void (*ctlx_usercb_t)( | |
2438 | struct hfa384x *hw, | |
2439 | void *ctlxresult, | |
2440 | void *usercb_data); | |
2441 | ||
2442 | typedef struct hfa384x_usbctlx | |
2443 | { | |
2444 | struct list_head list; | |
2445 | ||
2446 | size_t outbufsize; | |
2447 | hfa384x_usbout_t outbuf; /* pkt buf for OUT */ | |
2448 | hfa384x_usbin_t inbuf; /* pkt buf for IN(a copy) */ | |
2449 | ||
2450 | CTLX_STATE state; /* Tracks running state */ | |
2451 | ||
2452 | struct completion done; | |
2453 | volatile int reapable; /* Food for the reaper task */ | |
2454 | ||
2455 | ctlx_cmdcb_t cmdcb; /* Async command callback */ | |
2456 | ctlx_usercb_t usercb; /* Async user callback, */ | |
2457 | void *usercb_data; /* at CTLX completion */ | |
2458 | ||
2459 | int variant; /* Identifies cmd variant */ | |
2460 | } hfa384x_usbctlx_t; | |
2461 | ||
2462 | typedef struct hfa384x_usbctlxq | |
2463 | { | |
2464 | spinlock_t lock; | |
2465 | struct list_head pending; | |
2466 | struct list_head active; | |
2467 | struct list_head completing; | |
2468 | struct list_head reapable; | |
2469 | } hfa384x_usbctlxq_t; | |
2470 | #endif | |
2471 | ||
2472 | typedef struct hfa484x_metacmd | |
2473 | { | |
2474 | UINT16 cmd; | |
2475 | ||
2476 | UINT16 parm0; | |
2477 | UINT16 parm1; | |
2478 | UINT16 parm2; | |
2479 | ||
2480 | #if 0 //XXX cmd irq stuff | |
2481 | UINT16 bulkid; /* what RID/FID to copy down. */ | |
2482 | int bulklen; /* how much to copy from BAP */ | |
2483 | char *bulkdata; /* And to where? */ | |
2484 | #endif | |
2485 | ||
2486 | hfa384x_cmdresult_t result; | |
2487 | } hfa384x_metacmd_t; | |
2488 | ||
2489 | #define MAX_PRISM2_GRP_ADDR 16 | |
2490 | #define MAX_GRP_ADDR 32 | |
2491 | #define WLAN_COMMENT_MAX 80 /* Max. length of user comment string. */ | |
2492 | ||
2493 | #define MM_SAT_PCF (BIT14) | |
2494 | #define MM_GCSD_PCF (BIT15) | |
2495 | #define MM_GCSD_PCF_EB (BIT14 | BIT15) | |
2496 | ||
2497 | #define WLAN_STATE_STOPPED 0 /* Network is not active. */ | |
2498 | #define WLAN_STATE_STARTED 1 /* Network has been started. */ | |
2499 | ||
2500 | #define WLAN_AUTH_MAX 60 /* Max. # of authenticated stations. */ | |
2501 | #define WLAN_ACCESS_MAX 60 /* Max. # of stations in an access list. */ | |
2502 | #define WLAN_ACCESS_NONE 0 /* No stations may be authenticated. */ | |
2503 | #define WLAN_ACCESS_ALL 1 /* All stations may be authenticated. */ | |
2504 | #define WLAN_ACCESS_ALLOW 2 /* Authenticate only "allowed" stations. */ | |
2505 | #define WLAN_ACCESS_DENY 3 /* Do not authenticate "denied" stations. */ | |
2506 | ||
2507 | /* XXX These are going away ASAP */ | |
2508 | typedef struct prism2sta_authlist | |
2509 | { | |
2510 | UINT cnt; | |
2511 | UINT8 addr[WLAN_AUTH_MAX][WLAN_ADDR_LEN]; | |
2512 | UINT8 assoc[WLAN_AUTH_MAX]; | |
2513 | } prism2sta_authlist_t; | |
2514 | ||
2515 | typedef struct prism2sta_accesslist | |
2516 | { | |
2517 | UINT modify; | |
2518 | UINT cnt; | |
2519 | UINT8 addr[WLAN_ACCESS_MAX][WLAN_ADDR_LEN]; | |
2520 | UINT cnt1; | |
2521 | UINT8 addr1[WLAN_ACCESS_MAX][WLAN_ADDR_LEN]; | |
2522 | } prism2sta_accesslist_t; | |
2523 | ||
2524 | typedef struct hfa384x | |
2525 | { | |
2526 | #if (WLAN_HOSTIF != WLAN_USB) | |
2527 | /* Resource config */ | |
2528 | UINT32 iobase; | |
2529 | char __iomem *membase; | |
2530 | UINT32 irq; | |
2531 | #else | |
2532 | /* USB support data */ | |
2533 | struct usb_device *usb; | |
2534 | struct urb rx_urb; | |
2535 | struct sk_buff *rx_urb_skb; | |
2536 | struct urb tx_urb; | |
2537 | struct urb ctlx_urb; | |
2538 | hfa384x_usbout_t txbuff; | |
2539 | hfa384x_usbctlxq_t ctlxq; | |
2540 | struct timer_list reqtimer; | |
2541 | struct timer_list resptimer; | |
2542 | ||
2543 | struct timer_list throttle; | |
2544 | ||
2545 | struct tasklet_struct reaper_bh; | |
2546 | struct tasklet_struct completion_bh; | |
2547 | ||
2548 | struct work_struct usb_work; | |
2549 | ||
2550 | unsigned long usb_flags; | |
2551 | #define THROTTLE_RX 0 | |
2552 | #define THROTTLE_TX 1 | |
2553 | #define WORK_RX_HALT 2 | |
2554 | #define WORK_TX_HALT 3 | |
2555 | #define WORK_RX_RESUME 4 | |
2556 | #define WORK_TX_RESUME 5 | |
2557 | ||
2558 | unsigned short req_timer_done:1; | |
2559 | unsigned short resp_timer_done:1; | |
2560 | ||
2561 | int endp_in; | |
2562 | int endp_out; | |
2563 | #endif /* !USB */ | |
2564 | ||
2565 | #if (WLAN_HOSTIF == WLAN_PCMCIA) | |
2566 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) | |
2567 | struct pcmcia_device *pdev; | |
2568 | #else | |
2569 | dev_link_t *link; | |
2570 | #endif | |
2571 | dev_node_t node; | |
2572 | #endif | |
2573 | ||
2574 | int sniff_fcs; | |
2575 | int sniff_channel; | |
2576 | int sniff_truncate; | |
2577 | int sniffhdr; | |
2578 | ||
2579 | wait_queue_head_t cmdq; /* wait queue itself */ | |
2580 | ||
2581 | /* Controller state */ | |
2582 | UINT32 state; | |
2583 | UINT32 isap; | |
2584 | UINT8 port_enabled[HFA384x_NUMPORTS_MAX]; | |
2585 | #if (WLAN_HOSTIF != WLAN_USB) | |
2586 | UINT auxen; | |
2587 | UINT isram16; | |
2588 | #endif /* !USB */ | |
2589 | ||
2590 | /* Download support */ | |
2591 | UINT dlstate; | |
2592 | hfa384x_downloadbuffer_t bufinfo; | |
2593 | UINT16 dltimeout; | |
2594 | ||
2595 | #if (WLAN_HOSTIF != WLAN_USB) | |
2596 | spinlock_t cmdlock; | |
2597 | volatile int cmdflag; /* wait queue flag */ | |
2598 | hfa384x_metacmd_t *cmddata; /* for our async callback */ | |
2599 | ||
2600 | /* BAP support */ | |
2601 | spinlock_t baplock; | |
2602 | struct tasklet_struct bap_tasklet; | |
2603 | ||
2604 | /* MAC buffer ids */ | |
2605 | UINT16 txfid_head; | |
2606 | UINT16 txfid_tail; | |
2607 | UINT txfid_N; | |
2608 | UINT16 txfid_queue[HFA384x_DRVR_FIDSTACKLEN_MAX]; | |
2609 | UINT16 infofid; | |
2610 | struct semaphore infofid_sem; | |
2611 | #endif /* !USB */ | |
2612 | ||
2613 | int scanflag; /* to signal scan comlete */ | |
2614 | int join_ap; /* are we joined to a specific ap */ | |
2615 | int join_retries; /* number of join retries till we fail */ | |
2616 | hfa384x_JoinRequest_data_t joinreq; /* join request saved data */ | |
2617 | ||
2618 | wlandevice_t *wlandev; | |
2619 | /* Timer to allow for the deferred processing of linkstatus messages */ | |
2620 | struct work_struct link_bh; | |
2621 | ||
2622 | struct work_struct commsqual_bh; | |
2623 | hfa384x_commsquality_t qual; | |
2624 | struct timer_list commsqual_timer; | |
2625 | ||
2626 | UINT16 link_status; | |
2627 | UINT16 link_status_new; | |
2628 | struct sk_buff_head authq; | |
2629 | ||
2630 | /* And here we have stuff that used to be in priv */ | |
2631 | ||
2632 | /* State variables */ | |
2633 | UINT presniff_port_type; | |
2634 | UINT16 presniff_wepflags; | |
2635 | UINT32 dot11_desired_bss_type; | |
2636 | int ap; /* AP flag: 0 - Station, 1 - Access Point. */ | |
2637 | ||
2638 | int dbmadjust; | |
2639 | ||
2640 | /* Group Addresses - right now, there are up to a total | |
2641 | of MAX_GRP_ADDR group addresses */ | |
2642 | UINT8 dot11_grp_addr[MAX_GRP_ADDR][WLAN_ADDR_LEN]; | |
2643 | UINT dot11_grpcnt; | |
2644 | ||
2645 | /* Component Identities */ | |
2646 | hfa384x_compident_t ident_nic; | |
2647 | hfa384x_compident_t ident_pri_fw; | |
2648 | hfa384x_compident_t ident_sta_fw; | |
2649 | hfa384x_compident_t ident_ap_fw; | |
2650 | UINT16 mm_mods; | |
2651 | ||
2652 | /* Supplier compatibility ranges */ | |
2653 | hfa384x_caplevel_t cap_sup_mfi; | |
2654 | hfa384x_caplevel_t cap_sup_cfi; | |
2655 | hfa384x_caplevel_t cap_sup_pri; | |
2656 | hfa384x_caplevel_t cap_sup_sta; | |
2657 | hfa384x_caplevel_t cap_sup_ap; | |
2658 | ||
2659 | /* Actor compatibility ranges */ | |
2660 | hfa384x_caplevel_t cap_act_pri_cfi; /* pri f/w to controller interface */ | |
2661 | hfa384x_caplevel_t cap_act_sta_cfi; /* sta f/w to controller interface */ | |
2662 | hfa384x_caplevel_t cap_act_sta_mfi; /* sta f/w to modem interface */ | |
2663 | hfa384x_caplevel_t cap_act_ap_cfi; /* ap f/w to controller interface */ | |
2664 | hfa384x_caplevel_t cap_act_ap_mfi; /* ap f/w to modem interface */ | |
2665 | ||
2666 | UINT32 psusercount; /* Power save user count. */ | |
2667 | hfa384x_CommTallies32_t tallies; /* Communication tallies. */ | |
2668 | UINT8 comment[WLAN_COMMENT_MAX+1]; /* User comment */ | |
2669 | ||
2670 | /* Channel Info request results (AP only) */ | |
2671 | struct { | |
2672 | atomic_t done; | |
2673 | UINT8 count; | |
2674 | hfa384x_ChInfoResult_t results; | |
2675 | } channel_info; | |
2676 | ||
2677 | hfa384x_InfFrame_t *scanresults; | |
2678 | ||
2679 | ||
2680 | prism2sta_authlist_t authlist; /* Authenticated station list. */ | |
2681 | UINT accessmode; /* Access mode. */ | |
2682 | prism2sta_accesslist_t allow; /* Allowed station list. */ | |
2683 | prism2sta_accesslist_t deny; /* Denied station list. */ | |
2684 | ||
2685 | } hfa384x_t; | |
2686 | ||
2687 | /*=============================================================*/ | |
2688 | /*--- Function Declarations -----------------------------------*/ | |
2689 | /*=============================================================*/ | |
2690 | #if (WLAN_HOSTIF == WLAN_USB) | |
2691 | void | |
2692 | hfa384x_create( | |
2693 | hfa384x_t *hw, | |
2694 | struct usb_device *usb); | |
2695 | #else | |
2696 | void | |
2697 | hfa384x_create( | |
2698 | hfa384x_t *hw, | |
2699 | UINT irq, | |
2700 | UINT32 iobase, | |
2701 | UINT8 __iomem *membase); | |
2702 | #endif | |
2703 | ||
2704 | void hfa384x_destroy(hfa384x_t *hw); | |
2705 | ||
2706 | irqreturn_t | |
2707 | hfa384x_interrupt(int irq, void *dev_id PT_REGS); | |
2708 | int | |
2709 | hfa384x_corereset( hfa384x_t *hw, int holdtime, int settletime, int genesis); | |
2710 | int | |
2711 | hfa384x_drvr_chinforesults( hfa384x_t *hw); | |
2712 | int | |
2713 | hfa384x_drvr_commtallies( hfa384x_t *hw); | |
2714 | int | |
2715 | hfa384x_drvr_disable(hfa384x_t *hw, UINT16 macport); | |
2716 | int | |
2717 | hfa384x_drvr_enable(hfa384x_t *hw, UINT16 macport); | |
2718 | int | |
2719 | hfa384x_drvr_flashdl_enable(hfa384x_t *hw); | |
2720 | int | |
2721 | hfa384x_drvr_flashdl_disable(hfa384x_t *hw); | |
2722 | int | |
2723 | hfa384x_drvr_flashdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 len); | |
2724 | int | |
2725 | hfa384x_drvr_getconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len); | |
2726 | int | |
2727 | hfa384x_drvr_handover( hfa384x_t *hw, UINT8 *addr); | |
2728 | int | |
2729 | hfa384x_drvr_hostscanresults( hfa384x_t *hw); | |
2730 | int | |
2731 | hfa384x_drvr_low_level(hfa384x_t *hw, hfa384x_metacmd_t *cmd); | |
2732 | int | |
2733 | hfa384x_drvr_mmi_read(hfa384x_t *hw, UINT32 address, UINT32 *result); | |
2734 | int | |
2735 | hfa384x_drvr_mmi_write(hfa384x_t *hw, UINT32 address, UINT32 data); | |
2736 | int | |
2737 | hfa384x_drvr_ramdl_enable(hfa384x_t *hw, UINT32 exeaddr); | |
2738 | int | |
2739 | hfa384x_drvr_ramdl_disable(hfa384x_t *hw); | |
2740 | int | |
2741 | hfa384x_drvr_ramdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 len); | |
2742 | int | |
2743 | hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, UINT len); | |
2744 | int | |
2745 | hfa384x_drvr_scanresults( hfa384x_t *hw); | |
2746 | ||
2747 | int | |
2748 | hfa384x_drvr_setconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len); | |
2749 | ||
2750 | static inline int | |
2751 | hfa384x_drvr_getconfig16(hfa384x_t *hw, UINT16 rid, void *val) | |
2752 | { | |
2753 | int result = 0; | |
2754 | result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(UINT16)); | |
2755 | if ( result == 0 ) { | |
2756 | *((UINT16*)val) = hfa384x2host_16(*((UINT16*)val)); | |
2757 | } | |
2758 | return result; | |
2759 | } | |
2760 | ||
2761 | static inline int | |
2762 | hfa384x_drvr_getconfig32(hfa384x_t *hw, UINT16 rid, void *val) | |
2763 | { | |
2764 | int result = 0; | |
2765 | ||
2766 | result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(UINT32)); | |
2767 | if ( result == 0 ) { | |
2768 | *((UINT32*)val) = hfa384x2host_32(*((UINT32*)val)); | |
2769 | } | |
2770 | ||
2771 | return result; | |
2772 | } | |
2773 | ||
2774 | static inline int | |
2775 | hfa384x_drvr_setconfig16(hfa384x_t *hw, UINT16 rid, UINT16 val) | |
2776 | { | |
2777 | UINT16 value = host2hfa384x_16(val); | |
2778 | return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value)); | |
2779 | } | |
2780 | ||
2781 | static inline int | |
2782 | hfa384x_drvr_setconfig32(hfa384x_t *hw, UINT16 rid, UINT32 val) | |
2783 | { | |
2784 | UINT32 value = host2hfa384x_32(val); | |
2785 | return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value)); | |
2786 | } | |
2787 | ||
2788 | #if (WLAN_HOSTIF == WLAN_USB) | |
2789 | int | |
2790 | hfa384x_drvr_getconfig_async(hfa384x_t *hw, | |
2791 | UINT16 rid, | |
2792 | ctlx_usercb_t usercb, | |
2793 | void *usercb_data); | |
2794 | ||
2795 | int | |
2796 | hfa384x_drvr_setconfig_async(hfa384x_t *hw, | |
2797 | UINT16 rid, | |
2798 | void *buf, | |
2799 | UINT16 len, | |
2800 | ctlx_usercb_t usercb, | |
2801 | void *usercb_data); | |
2802 | #else | |
2803 | static inline int | |
2804 | hfa384x_drvr_setconfig_async(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len, | |
2805 | void *ptr1, void *ptr2) | |
2806 | { | |
2807 | (void)ptr1; | |
2808 | (void)ptr2; | |
2809 | return hfa384x_drvr_setconfig(hw, rid, buf, len); | |
2810 | } | |
2811 | #endif | |
2812 | ||
2813 | static inline int | |
2814 | hfa384x_drvr_setconfig16_async(hfa384x_t *hw, UINT16 rid, UINT16 val) | |
2815 | { | |
2816 | UINT16 value = host2hfa384x_16(val); | |
2817 | return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value), | |
2818 | NULL , NULL); | |
2819 | } | |
2820 | ||
2821 | static inline int | |
2822 | hfa384x_drvr_setconfig32_async(hfa384x_t *hw, UINT16 rid, UINT32 val) | |
2823 | { | |
2824 | UINT32 value = host2hfa384x_32(val); | |
2825 | return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value), | |
2826 | NULL , NULL); | |
2827 | } | |
2828 | ||
2829 | ||
2830 | int | |
2831 | hfa384x_drvr_start(hfa384x_t *hw); | |
2832 | int | |
2833 | hfa384x_drvr_stop(hfa384x_t *hw); | |
2834 | int | |
2835 | hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep); | |
2836 | void | |
2837 | hfa384x_tx_timeout(wlandevice_t *wlandev); | |
2838 | ||
2839 | int | |
2840 | hfa384x_cmd_initialize(hfa384x_t *hw); | |
2841 | int | |
2842 | hfa384x_cmd_enable(hfa384x_t *hw, UINT16 macport); | |
2843 | int | |
2844 | hfa384x_cmd_disable(hfa384x_t *hw, UINT16 macport); | |
2845 | int | |
2846 | hfa384x_cmd_diagnose(hfa384x_t *hw); | |
2847 | int | |
2848 | hfa384x_cmd_allocate(hfa384x_t *hw, UINT16 len); | |
2849 | int | |
2850 | hfa384x_cmd_transmit(hfa384x_t *hw, UINT16 reclaim, UINT16 qos, UINT16 fid); | |
2851 | int | |
2852 | hfa384x_cmd_clearpersist(hfa384x_t *hw, UINT16 fid); | |
2853 | int | |
2854 | hfa384x_cmd_notify(hfa384x_t *hw, UINT16 reclaim, UINT16 fid, void *buf, UINT16 len); | |
2855 | int | |
2856 | hfa384x_cmd_inquire(hfa384x_t *hw, UINT16 fid); | |
2857 | int | |
2858 | hfa384x_cmd_access(hfa384x_t *hw, UINT16 write, UINT16 rid, void *buf, UINT16 len); | |
2859 | int | |
2860 | hfa384x_cmd_monitor(hfa384x_t *hw, UINT16 enable); | |
2861 | int | |
2862 | hfa384x_cmd_download( | |
2863 | hfa384x_t *hw, | |
2864 | UINT16 mode, | |
2865 | UINT16 lowaddr, | |
2866 | UINT16 highaddr, | |
2867 | UINT16 codelen); | |
2868 | int | |
2869 | hfa384x_cmd_aux_enable(hfa384x_t *hw, int force); | |
2870 | int | |
2871 | hfa384x_cmd_aux_disable(hfa384x_t *hw); | |
2872 | int | |
2873 | hfa384x_copy_from_bap( | |
2874 | hfa384x_t *hw, | |
2875 | UINT16 bap, | |
2876 | UINT16 id, | |
2877 | UINT16 offset, | |
2878 | void *buf, | |
2879 | UINT len); | |
2880 | int | |
2881 | hfa384x_copy_to_bap( | |
2882 | hfa384x_t *hw, | |
2883 | UINT16 bap, | |
2884 | UINT16 id, | |
2885 | UINT16 offset, | |
2886 | void *buf, | |
2887 | UINT len); | |
2888 | void | |
2889 | hfa384x_copy_from_aux( | |
2890 | hfa384x_t *hw, | |
2891 | UINT32 cardaddr, | |
2892 | UINT32 auxctl, | |
2893 | void *buf, | |
2894 | UINT len); | |
2895 | void | |
2896 | hfa384x_copy_to_aux( | |
2897 | hfa384x_t *hw, | |
2898 | UINT32 cardaddr, | |
2899 | UINT32 auxctl, | |
2900 | void *buf, | |
2901 | UINT len); | |
2902 | ||
2903 | #if (WLAN_HOSTIF != WLAN_USB) | |
2904 | ||
2905 | /* | |
2906 | HFA384x is a LITTLE ENDIAN part. | |
2907 | ||
2908 | the get/setreg functions implicitly byte-swap the data to LE. | |
2909 | the _noswap variants do not perform a byte-swap on the data. | |
2910 | */ | |
2911 | ||
2912 | static inline UINT16 | |
2913 | __hfa384x_getreg(hfa384x_t *hw, UINT reg); | |
2914 | ||
2915 | static inline void | |
2916 | __hfa384x_setreg(hfa384x_t *hw, UINT16 val, UINT reg); | |
2917 | ||
2918 | static inline UINT16 | |
2919 | __hfa384x_getreg_noswap(hfa384x_t *hw, UINT reg); | |
2920 | ||
2921 | static inline void | |
2922 | __hfa384x_setreg_noswap(hfa384x_t *hw, UINT16 val, UINT reg); | |
2923 | ||
2924 | #ifdef REVERSE_ENDIAN | |
2925 | #define hfa384x_getreg __hfa384x_getreg_noswap | |
2926 | #define hfa384x_setreg __hfa384x_setreg_noswap | |
2927 | #define hfa384x_getreg_noswap __hfa384x_getreg | |
2928 | #define hfa384x_setreg_noswap __hfa384x_setreg | |
2929 | #else | |
2930 | #define hfa384x_getreg __hfa384x_getreg | |
2931 | #define hfa384x_setreg __hfa384x_setreg | |
2932 | #define hfa384x_getreg_noswap __hfa384x_getreg_noswap | |
2933 | #define hfa384x_setreg_noswap __hfa384x_setreg_noswap | |
2934 | #endif | |
2935 | ||
2936 | /*---------------------------------------------------------------- | |
2937 | * hfa384x_getreg | |
2938 | * | |
2939 | * Retrieve the value of one of the MAC registers. Done here | |
2940 | * because different PRISM2 MAC parts use different buses and such. | |
2941 | * NOTE: This function returns the value in HOST ORDER!!!!!! | |
2942 | * | |
2943 | * Arguments: | |
2944 | * hw MAC part structure | |
2945 | * reg Register identifier (offset for I/O based i/f) | |
2946 | * | |
2947 | * Returns: | |
2948 | * Value from the register in HOST ORDER!!!! | |
2949 | ----------------------------------------------------------------*/ | |
2950 | static inline UINT16 | |
2951 | __hfa384x_getreg(hfa384x_t *hw, UINT reg) | |
2952 | { | |
2953 | /* printk(KERN_DEBUG "Reading from 0x%0x\n", hw->membase + reg); */ | |
2954 | #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) | |
2955 | return wlan_inw_le16_to_cpu(hw->iobase+reg); | |
2956 | #elif (WLAN_HOSTIF == WLAN_PCI) | |
2957 | return __le16_to_cpu(readw(hw->membase + reg)); | |
2958 | #endif | |
2959 | } | |
2960 | ||
2961 | /*---------------------------------------------------------------- | |
2962 | * hfa384x_setreg | |
2963 | * | |
2964 | * Set the value of one of the MAC registers. Done here | |
2965 | * because different PRISM2 MAC parts use different buses and such. | |
2966 | * NOTE: This function assumes the value is in HOST ORDER!!!!!! | |
2967 | * | |
2968 | * Arguments: | |
2969 | * hw MAC part structure | |
2970 | * val Value, in HOST ORDER!!, to put in the register | |
2971 | * reg Register identifier (offset for I/O based i/f) | |
2972 | * | |
2973 | * Returns: | |
2974 | * Nothing | |
2975 | ----------------------------------------------------------------*/ | |
2976 | static inline void | |
2977 | __hfa384x_setreg(hfa384x_t *hw, UINT16 val, UINT reg) | |
2978 | { | |
2979 | #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) | |
2980 | wlan_outw_cpu_to_le16( val, hw->iobase + reg); | |
2981 | return; | |
2982 | #elif (WLAN_HOSTIF == WLAN_PCI) | |
2983 | writew(__cpu_to_le16(val), hw->membase + reg); | |
2984 | return; | |
2985 | #endif | |
2986 | } | |
2987 | ||
2988 | ||
2989 | /*---------------------------------------------------------------- | |
2990 | * hfa384x_getreg_noswap | |
2991 | * | |
2992 | * Retrieve the value of one of the MAC registers. Done here | |
2993 | * because different PRISM2 MAC parts use different buses and such. | |
2994 | * | |
2995 | * Arguments: | |
2996 | * hw MAC part structure | |
2997 | * reg Register identifier (offset for I/O based i/f) | |
2998 | * | |
2999 | * Returns: | |
3000 | * Value from the register. | |
3001 | ----------------------------------------------------------------*/ | |
3002 | static inline UINT16 | |
3003 | __hfa384x_getreg_noswap(hfa384x_t *hw, UINT reg) | |
3004 | { | |
3005 | #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) | |
3006 | return wlan_inw(hw->iobase+reg); | |
3007 | #elif (WLAN_HOSTIF == WLAN_PCI) | |
3008 | return readw(hw->membase + reg); | |
3009 | #endif | |
3010 | } | |
3011 | ||
3012 | ||
3013 | /*---------------------------------------------------------------- | |
3014 | * hfa384x_setreg_noswap | |
3015 | * | |
3016 | * Set the value of one of the MAC registers. Done here | |
3017 | * because different PRISM2 MAC parts use different buses and such. | |
3018 | * | |
3019 | * Arguments: | |
3020 | * hw MAC part structure | |
3021 | * val Value to put in the register | |
3022 | * reg Register identifier (offset for I/O based i/f) | |
3023 | * | |
3024 | * Returns: | |
3025 | * Nothing | |
3026 | ----------------------------------------------------------------*/ | |
3027 | static inline void | |
3028 | __hfa384x_setreg_noswap(hfa384x_t *hw, UINT16 val, UINT reg) | |
3029 | { | |
3030 | #if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) | |
3031 | wlan_outw( val, hw->iobase + reg); | |
3032 | return; | |
3033 | #elif (WLAN_HOSTIF == WLAN_PCI) | |
3034 | writew(val, hw->membase + reg); | |
3035 | return; | |
3036 | #endif | |
3037 | } | |
3038 | ||
3039 | ||
3040 | static inline void hfa384x_events_all(hfa384x_t *hw) | |
3041 | { | |
3042 | hfa384x_setreg(hw, | |
3043 | HFA384x_INT_NORMAL | |
3044 | #ifdef CMD_IRQ | |
3045 | | HFA384x_INTEN_CMD_SET(1) | |
3046 | #endif | |
3047 | , | |
3048 | HFA384x_INTEN); | |
3049 | ||
3050 | } | |
3051 | ||
3052 | static inline void hfa384x_events_nobap(hfa384x_t *hw) | |
3053 | { | |
3054 | hfa384x_setreg(hw, | |
3055 | (HFA384x_INT_NORMAL & ~HFA384x_INT_BAP_OP) | |
3056 | #ifdef CMD_IRQ | |
3057 | | HFA384x_INTEN_CMD_SET(1) | |
3058 | #endif | |
3059 | , | |
3060 | HFA384x_INTEN); | |
3061 | ||
3062 | } | |
3063 | ||
3064 | #endif /* WLAN_HOSTIF != WLAN_USB */ | |
3065 | #endif /* __KERNEL__ */ | |
3066 | ||
3067 | #endif /* _HFA384x_H */ |