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