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