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