100b3ed16SGreg Kroah-Hartman /* hfa384x.h
200b3ed16SGreg Kroah-Hartman *
300b3ed16SGreg Kroah-Hartman * Defines the constants and data structures for the hfa384x
400b3ed16SGreg Kroah-Hartman *
500b3ed16SGreg Kroah-Hartman * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
600b3ed16SGreg Kroah-Hartman * --------------------------------------------------------------------
700b3ed16SGreg Kroah-Hartman *
800b3ed16SGreg Kroah-Hartman * linux-wlan
900b3ed16SGreg Kroah-Hartman *
1000b3ed16SGreg Kroah-Hartman *   The contents of this file are subject to the Mozilla Public
1100b3ed16SGreg Kroah-Hartman *   License Version 1.1 (the "License"); you may not use this file
1200b3ed16SGreg Kroah-Hartman *   except in compliance with the License. You may obtain a copy of
1300b3ed16SGreg Kroah-Hartman *   the License at http://www.mozilla.org/MPL/
1400b3ed16SGreg Kroah-Hartman *
1500b3ed16SGreg Kroah-Hartman *   Software distributed under the License is distributed on an "AS
1600b3ed16SGreg Kroah-Hartman *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
1700b3ed16SGreg Kroah-Hartman *   implied. See the License for the specific language governing
1800b3ed16SGreg Kroah-Hartman *   rights and limitations under the License.
1900b3ed16SGreg Kroah-Hartman *
2000b3ed16SGreg Kroah-Hartman *   Alternatively, the contents of this file may be used under the
2100b3ed16SGreg Kroah-Hartman *   terms of the GNU Public License version 2 (the "GPL"), in which
2200b3ed16SGreg Kroah-Hartman *   case the provisions of the GPL are applicable instead of the
2300b3ed16SGreg Kroah-Hartman *   above.  If you wish to allow the use of your version of this file
2400b3ed16SGreg Kroah-Hartman *   only under the terms of the GPL and not to allow others to use
2500b3ed16SGreg Kroah-Hartman *   your version of this file under the MPL, indicate your decision
2600b3ed16SGreg Kroah-Hartman *   by deleting the provisions above and replace them with the notice
2700b3ed16SGreg Kroah-Hartman *   and other provisions required by the GPL.  If you do not delete
2800b3ed16SGreg Kroah-Hartman *   the provisions above, a recipient may use your version of this
2900b3ed16SGreg Kroah-Hartman *   file under either the MPL or the GPL.
3000b3ed16SGreg Kroah-Hartman *
3100b3ed16SGreg Kroah-Hartman * --------------------------------------------------------------------
3200b3ed16SGreg Kroah-Hartman *
3300b3ed16SGreg Kroah-Hartman * Inquiries regarding the linux-wlan Open Source project can be
3400b3ed16SGreg Kroah-Hartman * made directly to:
3500b3ed16SGreg Kroah-Hartman *
3600b3ed16SGreg Kroah-Hartman * AbsoluteValue Systems Inc.
3700b3ed16SGreg Kroah-Hartman * info@linux-wlan.com
3800b3ed16SGreg Kroah-Hartman * http://www.linux-wlan.com
3900b3ed16SGreg Kroah-Hartman *
4000b3ed16SGreg Kroah-Hartman * --------------------------------------------------------------------
4100b3ed16SGreg Kroah-Hartman *
4200b3ed16SGreg Kroah-Hartman * Portions of the development of this software were funded by
4300b3ed16SGreg Kroah-Hartman * Intersil Corporation as part of PRISM(R) chipset product development.
4400b3ed16SGreg Kroah-Hartman *
4500b3ed16SGreg Kroah-Hartman * --------------------------------------------------------------------
4600b3ed16SGreg Kroah-Hartman *
4700b3ed16SGreg Kroah-Hartman *   [Implementation and usage notes]
4800b3ed16SGreg Kroah-Hartman *
4900b3ed16SGreg Kroah-Hartman *   [References]
5000b3ed16SGreg Kroah-Hartman *	CW10 Programmer's Manual v1.5
5100b3ed16SGreg Kroah-Hartman *	IEEE 802.11 D10.0
5200b3ed16SGreg Kroah-Hartman *
5300b3ed16SGreg Kroah-Hartman * --------------------------------------------------------------------
5400b3ed16SGreg Kroah-Hartman */
5500b3ed16SGreg Kroah-Hartman 
5600b3ed16SGreg Kroah-Hartman #ifndef _HFA384x_H
5700b3ed16SGreg Kroah-Hartman #define _HFA384x_H
5800b3ed16SGreg Kroah-Hartman 
5900b3ed16SGreg Kroah-Hartman #define HFA384x_FIRMWARE_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
6000b3ed16SGreg Kroah-Hartman 
6128b17a4bSMoritz Muehlenhoff #include <linux/if_ether.h>
6228b17a4bSMoritz Muehlenhoff 
6300b3ed16SGreg Kroah-Hartman /*--- Mins & Maxs -----------------------------------*/
64aaad4303SSolomon Peachy #define		HFA384x_PORTID_MAX		((u16)7)
65aaad4303SSolomon Peachy #define		HFA384x_NUMPORTS_MAX		((u16)(HFA384x_PORTID_MAX+1))
66aaad4303SSolomon Peachy #define		HFA384x_PDR_LEN_MAX		((u16)512) /* in bytes, from EK */
67aaad4303SSolomon Peachy #define		HFA384x_PDA_LEN_MAX		((u16)1024) /* in bytes, from EK */
68aaad4303SSolomon Peachy #define		HFA384x_SCANRESULT_MAX		((u16)31)
69aaad4303SSolomon Peachy #define		HFA384x_HSCANRESULT_MAX		((u16)31)
70aaad4303SSolomon Peachy #define		HFA384x_CHINFORESULT_MAX	((u16)16)
7100b3ed16SGreg Kroah-Hartman #define		HFA384x_RID_GUESSING_MAXLEN	2048	/* I'm not really sure */
7200b3ed16SGreg Kroah-Hartman #define		HFA384x_RIDDATA_MAXLEN		HFA384x_RID_GUESSING_MAXLEN
7300b3ed16SGreg Kroah-Hartman #define		HFA384x_USB_RWMEM_MAXLEN	2048
7400b3ed16SGreg Kroah-Hartman 
7500b3ed16SGreg Kroah-Hartman /*--- Support Constants -----------------------------*/
76aaad4303SSolomon Peachy #define		HFA384x_PORTTYPE_IBSS			((u16)0)
77aaad4303SSolomon Peachy #define		HFA384x_PORTTYPE_BSS			((u16)1)
78aaad4303SSolomon Peachy #define		HFA384x_PORTTYPE_PSUEDOIBSS		((u16)3)
797f6e0e44SMoritz Muehlenhoff #define		HFA384x_WEPFLAGS_PRIVINVOKED		((u16)BIT(0))
807f6e0e44SMoritz Muehlenhoff #define		HFA384x_WEPFLAGS_EXCLUDE		((u16)BIT(1))
817f6e0e44SMoritz Muehlenhoff #define		HFA384x_WEPFLAGS_DISABLE_TXCRYPT	((u16)BIT(4))
827f6e0e44SMoritz Muehlenhoff #define		HFA384x_WEPFLAGS_DISABLE_RXCRYPT	((u16)BIT(7))
83aaad4303SSolomon Peachy #define 	HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM	((u16)3)
84aaad4303SSolomon Peachy #define 	HFA384x_PORTSTATUS_DISABLED		((u16)1)
85aaad4303SSolomon Peachy #define		HFA384x_RATEBIT_1			((u16)1)
86aaad4303SSolomon Peachy #define		HFA384x_RATEBIT_2			((u16)2)
87aaad4303SSolomon Peachy #define		HFA384x_RATEBIT_5dot5			((u16)4)
88aaad4303SSolomon Peachy #define		HFA384x_RATEBIT_11			((u16)8)
8900b3ed16SGreg Kroah-Hartman 
9000b3ed16SGreg Kroah-Hartman /*--- MAC Internal memory constants and macros ------*/
9100b3ed16SGreg Kroah-Hartman /* masks and macros used to manipulate MAC internal memory addresses. */
9200b3ed16SGreg Kroah-Hartman /* MAC internal memory addresses are 23 bit quantities.  The MAC uses
9300b3ed16SGreg Kroah-Hartman  * a paged address space where the upper 16 bits are the page number
9400b3ed16SGreg Kroah-Hartman  * and the lower 7 bits are the offset.  There are various Host API
9500b3ed16SGreg Kroah-Hartman  * elements that require two 16-bit quantities to specify a MAC
9600b3ed16SGreg Kroah-Hartman  * internal memory address.  Unfortunately, some of the API's use a
9700b3ed16SGreg Kroah-Hartman  * page/offset format where the offset value is JUST the lower seven
9800b3ed16SGreg Kroah-Hartman  * bits and the page is  the remaining 16 bits.  Some of the API's
9900b3ed16SGreg Kroah-Hartman  * assume that the 23 bit address has been split at the 16th bit.  We
10000b3ed16SGreg Kroah-Hartman  * refer to these two formats as AUX format and CMD format.  The
10100b3ed16SGreg Kroah-Hartman  * macros below help handle some of this.
10200b3ed16SGreg Kroah-Hartman  */
10300b3ed16SGreg Kroah-Hartman 
10400b3ed16SGreg Kroah-Hartman /* Mask bits for discarding unwanted pieces in a flat address */
10500b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_FLAT_AUX_PAGE_MASK	(0x007fff80)
10600b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_FLAT_AUX_OFF_MASK	(0x0000007f)
10700b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_FLAT_CMD_PAGE_MASK	(0xffff0000)
10800b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_FLAT_CMD_OFF_MASK	(0x0000ffff)
10900b3ed16SGreg Kroah-Hartman 
110e573aaa4SMoritz Muehlenhoff /* Mask bits for discarding unwanted pieces in AUX format
111e573aaa4SMoritz Muehlenhoff    16-bit address parts */
11200b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_AUX_PAGE_MASK	(0xffff)
11300b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_AUX_OFF_MASK	(0x007f)
11400b3ed16SGreg Kroah-Hartman 
11500b3ed16SGreg Kroah-Hartman /* Make a 32-bit flat address from AUX format 16-bit page and offset */
11600b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_AUX_MKFLAT(p, o)	\
117aaad4303SSolomon Peachy 		(((u32)(((u16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) << 7) | \
118aaad4303SSolomon Peachy 		((u32)(((u16)(o))&HFA384x_ADDR_AUX_OFF_MASK))
11900b3ed16SGreg Kroah-Hartman 
12000b3ed16SGreg Kroah-Hartman /* Make CMD format offset and page from a 32-bit flat address */
12100b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_CMD_MKPAGE(f) \
122aaad4303SSolomon Peachy 		((u16)((((u32)(f))&HFA384x_ADDR_FLAT_CMD_PAGE_MASK)>>16))
12300b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_CMD_MKOFF(f) \
124aaad4303SSolomon Peachy 		((u16)(((u32)(f))&HFA384x_ADDR_FLAT_CMD_OFF_MASK))
12500b3ed16SGreg Kroah-Hartman 
12600b3ed16SGreg Kroah-Hartman /*--- Controller Memory addresses -------------------*/
12700b3ed16SGreg Kroah-Hartman #define		HFA3842_PDA_BASE	(0x007f0000UL)
12800b3ed16SGreg Kroah-Hartman #define		HFA3841_PDA_BASE	(0x003f0000UL)
12900b3ed16SGreg Kroah-Hartman #define		HFA3841_PDA_BOGUS_BASE	(0x00390000UL)
13000b3ed16SGreg Kroah-Hartman 
13100b3ed16SGreg Kroah-Hartman /*--- Driver Download states  -----------------------*/
13200b3ed16SGreg Kroah-Hartman #define		HFA384x_DLSTATE_DISABLED		0
13300b3ed16SGreg Kroah-Hartman #define		HFA384x_DLSTATE_RAMENABLED		1
13400b3ed16SGreg Kroah-Hartman #define		HFA384x_DLSTATE_FLASHENABLED		2
13500b3ed16SGreg Kroah-Hartman 
13600b3ed16SGreg Kroah-Hartman /*--- Register Field Masks --------------------------*/
1377f6e0e44SMoritz Muehlenhoff #define		HFA384x_CMD_AINFO		((u16)(BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10) | BIT(9) | BIT(8)))
1387f6e0e44SMoritz Muehlenhoff #define		HFA384x_CMD_MACPORT		((u16)(BIT(10) | BIT(9) | BIT(8)))
1397f6e0e44SMoritz Muehlenhoff #define		HFA384x_CMD_PROGMODE		((u16)(BIT(9) | BIT(8)))
1407f6e0e44SMoritz Muehlenhoff #define		HFA384x_CMD_CMDCODE		((u16)(BIT(5) | BIT(4) | BIT(3) | BIT(2) | BIT(1) | BIT(0)))
14100b3ed16SGreg Kroah-Hartman 
1427f6e0e44SMoritz Muehlenhoff #define		HFA384x_STATUS_RESULT		((u16)(BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10) | BIT(9) | BIT(8)))
14300b3ed16SGreg Kroah-Hartman 
14400b3ed16SGreg Kroah-Hartman /*--- Command Code Constants --------------------------*/
14500b3ed16SGreg Kroah-Hartman /*--- Controller Commands --------------------------*/
146aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_INIT		((u16)0x00)
147aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_ENABLE		((u16)0x01)
148aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_DISABLE		((u16)0x02)
14900b3ed16SGreg Kroah-Hartman 
15000b3ed16SGreg Kroah-Hartman /*--- Regulate Commands --------------------------*/
151aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_INQ		((u16)0x11)
15200b3ed16SGreg Kroah-Hartman 
15300b3ed16SGreg Kroah-Hartman /*--- Configure Commands --------------------------*/
154aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_DOWNLD		((u16)0x22)
15500b3ed16SGreg Kroah-Hartman 
15600b3ed16SGreg Kroah-Hartman /*--- Debugging Commands -----------------------------*/
157aaad4303SSolomon Peachy #define 	HFA384x_CMDCODE_MONITOR		((u16)(0x38))
158aaad4303SSolomon Peachy #define		HFA384x_MONITOR_ENABLE		((u16)(0x0b))
159aaad4303SSolomon Peachy #define		HFA384x_MONITOR_DISABLE		((u16)(0x0f))
16000b3ed16SGreg Kroah-Hartman 
16100b3ed16SGreg Kroah-Hartman /*--- Result Codes --------------------------*/
162aaad4303SSolomon Peachy #define		HFA384x_CMD_ERR			((u16)(0x7F))
16300b3ed16SGreg Kroah-Hartman 
16400b3ed16SGreg Kroah-Hartman /*--- Programming Modes --------------------------
16500b3ed16SGreg Kroah-Hartman 	MODE 0: Disable programming
16600b3ed16SGreg Kroah-Hartman 	MODE 1: Enable volatile memory programming
16700b3ed16SGreg Kroah-Hartman 	MODE 2: Enable non-volatile memory programming
16800b3ed16SGreg Kroah-Hartman 	MODE 3: Program non-volatile memory section
16900b3ed16SGreg Kroah-Hartman --------------------------------------------------*/
170aaad4303SSolomon Peachy #define		HFA384x_PROGMODE_DISABLE	((u16)0x00)
171aaad4303SSolomon Peachy #define		HFA384x_PROGMODE_RAM		((u16)0x01)
172aaad4303SSolomon Peachy #define		HFA384x_PROGMODE_NV		((u16)0x02)
173aaad4303SSolomon Peachy #define		HFA384x_PROGMODE_NVWRITE	((u16)0x03)
17400b3ed16SGreg Kroah-Hartman 
17500b3ed16SGreg Kroah-Hartman /*--- Record ID Constants --------------------------*/
17600b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
17700b3ed16SGreg Kroah-Hartman Configuration RIDs: Network Parameters, Static Configuration Entities
17800b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
179aaad4303SSolomon Peachy #define		HFA384x_RID_CNFPORTTYPE		((u16)0xFC00)
180aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNMACADDR	((u16)0xFC01)
181aaad4303SSolomon Peachy #define		HFA384x_RID_CNFDESIREDSSID	((u16)0xFC02)
182aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNCHANNEL	((u16)0xFC03)
183aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNSSID		((u16)0xFC04)
184aaad4303SSolomon Peachy #define		HFA384x_RID_CNFMAXDATALEN	((u16)0xFC07)
18500b3ed16SGreg Kroah-Hartman 
18600b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
18700b3ed16SGreg Kroah-Hartman Configuration RID lengths: Network Params, Static Config Entities
18800b3ed16SGreg Kroah-Hartman   This is the length of JUST the DATA part of the RID (does not
18900b3ed16SGreg Kroah-Hartman   include the len or code fields)
19000b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
191aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNMACADDR_LEN	((u16)6)
192aaad4303SSolomon Peachy #define		HFA384x_RID_CNFDESIREDSSID_LEN	((u16)34)
193aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNSSID_LEN	((u16)34)
19400b3ed16SGreg Kroah-Hartman 
19500b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
19600b3ed16SGreg Kroah-Hartman Configuration RIDs: Network Parameters, Dynamic Configuration Entities
19700b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
198aaad4303SSolomon Peachy #define		HFA384x_RID_CREATEIBSS		((u16)0xFC81)
199aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH		((u16)0xFC82)
200aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH		((u16)0xFC83)
201aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL		((u16)0xFC84)
202aaad4303SSolomon Peachy #define		HFA384x_RID_PROMISCMODE		((u16)0xFC85)
20300b3ed16SGreg Kroah-Hartman 
20400b3ed16SGreg Kroah-Hartman /*----------------------------------------------------------------------
20500b3ed16SGreg Kroah-Hartman Information RIDs: NIC Information
20600b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
207aaad4303SSolomon Peachy #define		HFA384x_RID_MAXLOADTIME		((u16)0xFD00)
208aaad4303SSolomon Peachy #define		HFA384x_RID_DOWNLOADBUFFER	((u16)0xFD01)
209aaad4303SSolomon Peachy #define		HFA384x_RID_PRIIDENTITY		((u16)0xFD02)
210aaad4303SSolomon Peachy #define		HFA384x_RID_PRISUPRANGE		((u16)0xFD03)
211aaad4303SSolomon Peachy #define		HFA384x_RID_PRI_CFIACTRANGES	((u16)0xFD04)
212aaad4303SSolomon Peachy #define		HFA384x_RID_NICSERIALNUMBER	((u16)0xFD0A)
213aaad4303SSolomon Peachy #define		HFA384x_RID_NICIDENTITY		((u16)0xFD0B)
214aaad4303SSolomon Peachy #define		HFA384x_RID_MFISUPRANGE		((u16)0xFD0C)
215aaad4303SSolomon Peachy #define		HFA384x_RID_CFISUPRANGE		((u16)0xFD0D)
216aaad4303SSolomon Peachy #define		HFA384x_RID_STAIDENTITY		((u16)0xFD20)
217aaad4303SSolomon Peachy #define		HFA384x_RID_STASUPRANGE		((u16)0xFD21)
218aaad4303SSolomon Peachy #define		HFA384x_RID_STA_MFIACTRANGES	((u16)0xFD22)
219aaad4303SSolomon Peachy #define		HFA384x_RID_STA_CFIACTRANGES	((u16)0xFD23)
22000b3ed16SGreg Kroah-Hartman 
22100b3ed16SGreg Kroah-Hartman /*----------------------------------------------------------------------
22200b3ed16SGreg Kroah-Hartman Information RID Lengths: NIC Information
22300b3ed16SGreg Kroah-Hartman   This is the length of JUST the DATA part of the RID (does not
22400b3ed16SGreg Kroah-Hartman   include the len or code fields)
22500b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
226aaad4303SSolomon Peachy #define		HFA384x_RID_NICSERIALNUMBER_LEN		((u16)12)
22700b3ed16SGreg Kroah-Hartman 
22800b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
22900b3ed16SGreg Kroah-Hartman Information RIDs:  MAC Information
23000b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
231aaad4303SSolomon Peachy #define		HFA384x_RID_PORTSTATUS		((u16)0xFD40)
232aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTSSID		((u16)0xFD41)
233aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTBSSID	((u16)0xFD42)
234aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE	((u16)0xFD44)
235aaad4303SSolomon Peachy #define		HFA384x_RID_SHORTRETRYLIMIT	((u16)0xFD48)
236aaad4303SSolomon Peachy #define		HFA384x_RID_LONGRETRYLIMIT	((u16)0xFD49)
237aaad4303SSolomon Peachy #define		HFA384x_RID_MAXTXLIFETIME	((u16)0xFD4A)
238aaad4303SSolomon Peachy #define		HFA384x_RID_PRIVACYOPTIMP	((u16)0xFD4F)
239aaad4303SSolomon Peachy #define		HFA384x_RID_DBMCOMMSQUALITY	((u16)0xFD51)
24000b3ed16SGreg Kroah-Hartman 
24100b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
24200b3ed16SGreg Kroah-Hartman Information RID Lengths:  MAC Information
24300b3ed16SGreg Kroah-Hartman   This is the length of JUST the DATA part of the RID (does not
24400b3ed16SGreg Kroah-Hartman   include the len or code fields)
24500b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
246aaad4303SSolomon Peachy #define		HFA384x_RID_DBMCOMMSQUALITY_LEN		((u16)sizeof(hfa384x_dbmcommsquality_t))
247aaad4303SSolomon Peachy #define		HFA384x_RID_JOINREQUEST_LEN		((u16)sizeof(hfa384x_JoinRequest_data_t))
24840a67411SMoritz Muehlenhoff 
24900b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
25000b3ed16SGreg Kroah-Hartman Information RIDs:  Modem Information
25100b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
252aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTCHANNEL	((u16)0xFDC1)
25300b3ed16SGreg Kroah-Hartman 
25400b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
25500b3ed16SGreg Kroah-Hartman API ENHANCEMENTS (NOT ALREADY IMPLEMENTED)
25600b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
257aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPDEFAULTKEYID	((u16)0xFC23)
258aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPDEFAULTKEY0	((u16)0xFC24)
259aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPDEFAULTKEY1	((u16)0xFC25)
260aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPDEFAULTKEY2	((u16)0xFC26)
261aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPDEFAULTKEY3	((u16)0xFC27)
262aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPFLAGS		((u16)0xFC28)
263aaad4303SSolomon Peachy #define		HFA384x_RID_CNFAUTHENTICATION	((u16)0xFC2A)
264aaad4303SSolomon Peachy #define		HFA384x_RID_CNFROAMINGMODE	((u16)0xFC2D)
265aaad4303SSolomon Peachy #define		HFA384x_RID_CNFAPBCNint		((u16)0xFC33)
266e573aaa4SMoritz Muehlenhoff #define		HFA384x_RID_CNFDBMADJUST  	((u16)0xFC46)
267e573aaa4SMoritz Muehlenhoff #define		HFA384x_RID_CNFWPADATA       	((u16)0xFC48)
268aaad4303SSolomon Peachy #define		HFA384x_RID_CNFBASICRATES	((u16)0xFCB3)
269aaad4303SSolomon Peachy #define		HFA384x_RID_CNFSUPPRATES	((u16)0xFCB4)
270e573aaa4SMoritz Muehlenhoff #define		HFA384x_RID_CNFPASSIVESCANCTRL	((u16)0xFCBA)
271e573aaa4SMoritz Muehlenhoff #define		HFA384x_RID_TXPOWERMAX        	((u16)0xFCBE)
272aaad4303SSolomon Peachy #define		HFA384x_RID_JOINREQUEST		((u16)0xFCE2)
273aaad4303SSolomon Peachy #define		HFA384x_RID_AUTHENTICATESTA	((u16)0xFCE3)
274e573aaa4SMoritz Muehlenhoff #define		HFA384x_RID_HOSTSCAN          	((u16)0xFCE5)
27500b3ed16SGreg Kroah-Hartman 
276aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPDEFAULTKEY_LEN	((u16)6)
277aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEP128DEFAULTKEY_LEN	((u16)14)
27840a67411SMoritz Muehlenhoff 
27900b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
28000b3ed16SGreg Kroah-Hartman PD Record codes
28100b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
282aaad4303SSolomon Peachy #define HFA384x_PDR_PCB_PARTNUM		((u16)0x0001)
283aaad4303SSolomon Peachy #define HFA384x_PDR_PDAVER		((u16)0x0002)
284aaad4303SSolomon Peachy #define HFA384x_PDR_NIC_SERIAL		((u16)0x0003)
285aaad4303SSolomon Peachy #define HFA384x_PDR_MKK_MEASUREMENTS	((u16)0x0004)
286aaad4303SSolomon Peachy #define HFA384x_PDR_NIC_RAMSIZE		((u16)0x0005)
287aaad4303SSolomon Peachy #define HFA384x_PDR_MFISUPRANGE		((u16)0x0006)
288aaad4303SSolomon Peachy #define HFA384x_PDR_CFISUPRANGE		((u16)0x0007)
289aaad4303SSolomon Peachy #define HFA384x_PDR_NICID		((u16)0x0008)
290aaad4303SSolomon Peachy #define HFA384x_PDR_MAC_ADDRESS		((u16)0x0101)
291aaad4303SSolomon Peachy #define HFA384x_PDR_REGDOMAIN		((u16)0x0103)
292aaad4303SSolomon Peachy #define HFA384x_PDR_ALLOWED_CHANNEL	((u16)0x0104)
293aaad4303SSolomon Peachy #define HFA384x_PDR_DEFAULT_CHANNEL	((u16)0x0105)
294aaad4303SSolomon Peachy #define HFA384x_PDR_TEMPTYPE		((u16)0x0107)
295aaad4303SSolomon Peachy #define HFA384x_PDR_IFR_SETTING		((u16)0x0200)
296aaad4303SSolomon Peachy #define HFA384x_PDR_RFR_SETTING		((u16)0x0201)
297aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_BASELINE	((u16)0x0202)
298aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_SHADOW	((u16)0x0203)
299aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_IFRF	((u16)0x0204)
300aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_CHCALSP	((u16)0x0300)
301aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_CHCALI	((u16)0x0301)
302aaad4303SSolomon Peachy #define HFA384x_PDR_MAX_TX_POWER  	((u16)0x0302)
303aaad4303SSolomon Peachy #define HFA384x_PDR_MASTER_CHAN_LIST	((u16)0x0303)
304aaad4303SSolomon Peachy #define HFA384x_PDR_3842_NIC_CONFIG	((u16)0x0400)
305aaad4303SSolomon Peachy #define HFA384x_PDR_USB_ID		((u16)0x0401)
306aaad4303SSolomon Peachy #define HFA384x_PDR_PCI_ID		((u16)0x0402)
307aaad4303SSolomon Peachy #define HFA384x_PDR_PCI_IFCONF		((u16)0x0403)
308aaad4303SSolomon Peachy #define HFA384x_PDR_PCI_PMCONF		((u16)0x0404)
309aaad4303SSolomon Peachy #define HFA384x_PDR_RFENRGY		((u16)0x0406)
310aaad4303SSolomon Peachy #define HFA384x_PDR_USB_POWER_TYPE      ((u16)0x0407)
311aaad4303SSolomon Peachy #define HFA384x_PDR_USB_MAX_POWER	((u16)0x0409)
312aaad4303SSolomon Peachy #define HFA384x_PDR_USB_MANUFACTURER	((u16)0x0410)
313aaad4303SSolomon Peachy #define HFA384x_PDR_USB_PRODUCT  	((u16)0x0411)
314aaad4303SSolomon Peachy #define HFA384x_PDR_ANT_DIVERSITY   	((u16)0x0412)
315aaad4303SSolomon Peachy #define HFA384x_PDR_HFO_DELAY       	((u16)0x0413)
316aaad4303SSolomon Peachy #define HFA384x_PDR_SCALE_THRESH 	((u16)0x0414)
31700b3ed16SGreg Kroah-Hartman 
318aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_MANF_TESTSP	((u16)0x0900)
319aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_MANF_TESTI	((u16)0x0901)
320aaad4303SSolomon Peachy #define HFA384x_PDR_END_OF_PDA		((u16)0x0000)
32100b3ed16SGreg Kroah-Hartman 
32200b3ed16SGreg Kroah-Hartman /*--- Register Test/Get/Set Field macros ------------------------*/
32300b3ed16SGreg Kroah-Hartman 
324aaad4303SSolomon Peachy #define		HFA384x_CMD_AINFO_SET(value)		((u16)((u16)(value) << 8))
325aaad4303SSolomon Peachy #define		HFA384x_CMD_MACPORT_SET(value)		((u16)HFA384x_CMD_AINFO_SET(value))
326aaad4303SSolomon Peachy #define		HFA384x_CMD_PROGMODE_SET(value)		((u16)HFA384x_CMD_AINFO_SET((u16)value))
327aaad4303SSolomon Peachy #define		HFA384x_CMD_CMDCODE_SET(value)		((u16)(value))
32800b3ed16SGreg Kroah-Hartman 
329aaad4303SSolomon Peachy #define		HFA384x_STATUS_RESULT_SET(value)	(((u16)(value)) << 8)
33000b3ed16SGreg Kroah-Hartman 
33100b3ed16SGreg Kroah-Hartman /* Host Maintained State Info */
33200b3ed16SGreg Kroah-Hartman #define HFA384x_STATE_PREINIT	0
33300b3ed16SGreg Kroah-Hartman #define HFA384x_STATE_INIT	1
33400b3ed16SGreg Kroah-Hartman #define HFA384x_STATE_RUNNING	2
33500b3ed16SGreg Kroah-Hartman 
33600b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------*/
33700b3ed16SGreg Kroah-Hartman /* Commonly used basic types */
338e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_bytestr {
339aaad4303SSolomon Peachy 	u16 len;
340aaad4303SSolomon Peachy 	u8 data[0];
3419cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_bytestr_t;
34200b3ed16SGreg Kroah-Hartman 
343e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_bytestr32 {
344aaad4303SSolomon Peachy 	u16 len;
345aaad4303SSolomon Peachy 	u8 data[32];
3469cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_bytestr32_t;
34700b3ed16SGreg Kroah-Hartman 
34800b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
34900b3ed16SGreg Kroah-Hartman Configuration Record Structures:
35000b3ed16SGreg Kroah-Hartman 	Network Parameters, Static Configuration Entities
35100b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
35200b3ed16SGreg Kroah-Hartman 
35300b3ed16SGreg Kroah-Hartman /*-- Hardware/Firmware Component Information ----------*/
354e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_compident {
355aaad4303SSolomon Peachy 	u16 id;
356aaad4303SSolomon Peachy 	u16 variant;
357aaad4303SSolomon Peachy 	u16 major;
358aaad4303SSolomon Peachy 	u16 minor;
3599cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_compident_t;
36000b3ed16SGreg Kroah-Hartman 
361e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_caplevel {
362aaad4303SSolomon Peachy 	u16 role;
363aaad4303SSolomon Peachy 	u16 id;
364aaad4303SSolomon Peachy 	u16 variant;
365aaad4303SSolomon Peachy 	u16 bottom;
366aaad4303SSolomon Peachy 	u16 top;
3679cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_caplevel_t;
36800b3ed16SGreg Kroah-Hartman 
36900b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfAuthentication --*/
37000b3ed16SGreg Kroah-Hartman #define HFA384x_CNFAUTHENTICATION_OPENSYSTEM	0x0001
37100b3ed16SGreg Kroah-Hartman #define HFA384x_CNFAUTHENTICATION_SHAREDKEY	0x0002
37200b3ed16SGreg Kroah-Hartman #define HFA384x_CNFAUTHENTICATION_LEAP     	0x0004
37300b3ed16SGreg Kroah-Hartman 
37400b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
37500b3ed16SGreg Kroah-Hartman Configuration Record Structures:
37600b3ed16SGreg Kroah-Hartman 	Network Parameters, Dynamic Configuration Entities
37700b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
37800b3ed16SGreg Kroah-Hartman 
37900b3ed16SGreg Kroah-Hartman #define HFA384x_CREATEIBSS_JOINCREATEIBSS          0
38000b3ed16SGreg Kroah-Hartman 
38100b3ed16SGreg Kroah-Hartman /*-- Configuration Record: HostScanRequest (data portion only) --*/
382e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_HostScanRequest_data {
383aaad4303SSolomon Peachy 	u16 channelList;
384aaad4303SSolomon Peachy 	u16 txRate;
38500b3ed16SGreg Kroah-Hartman 	hfa384x_bytestr32_t ssid;
3869cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_HostScanRequest_data_t;
38700b3ed16SGreg Kroah-Hartman 
38800b3ed16SGreg Kroah-Hartman /*-- Configuration Record: JoinRequest (data portion only) --*/
389e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_JoinRequest_data {
390aaad4303SSolomon Peachy 	u8 bssid[WLAN_BSSID_LEN];
391aaad4303SSolomon Peachy 	u16 channel;
3929cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_JoinRequest_data_t;
39300b3ed16SGreg Kroah-Hartman 
39400b3ed16SGreg Kroah-Hartman /*-- Configuration Record: authenticateStation (data portion only) --*/
395e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_authenticateStation_data {
39628b17a4bSMoritz Muehlenhoff 	u8 address[ETH_ALEN];
397aaad4303SSolomon Peachy 	u16 status;
398aaad4303SSolomon Peachy 	u16 algorithm;
3999cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_authenticateStation_data_t;
40000b3ed16SGreg Kroah-Hartman 
40100b3ed16SGreg Kroah-Hartman /*-- Configuration Record: WPAData       (data portion only) --*/
402e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_WPAData {
403aaad4303SSolomon Peachy 	u16 datalen;
404aaad4303SSolomon Peachy 	u8 data[0];		// max 80
4059cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_WPAData_t;
40600b3ed16SGreg Kroah-Hartman 
40700b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
40800b3ed16SGreg Kroah-Hartman Information Record Structures: NIC Information
40900b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
41000b3ed16SGreg Kroah-Hartman 
41100b3ed16SGreg Kroah-Hartman /*-- Information Record: DownLoadBuffer --*/
41200b3ed16SGreg Kroah-Hartman /* NOTE: The page and offset are in AUX format */
413e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_downloadbuffer {
414aaad4303SSolomon Peachy 	u16 page;
415aaad4303SSolomon Peachy 	u16 offset;
416aaad4303SSolomon Peachy 	u16 len;
4179cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_downloadbuffer_t;
41800b3ed16SGreg Kroah-Hartman 
41900b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
42000b3ed16SGreg Kroah-Hartman Information Record Structures: NIC Information
42100b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
42200b3ed16SGreg Kroah-Hartman 
423aaad4303SSolomon Peachy #define HFA384x_PSTATUS_CONN_IBSS	((u16)3)
42400b3ed16SGreg Kroah-Hartman 
42500b3ed16SGreg Kroah-Hartman /*-- Information Record: commsquality --*/
426e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_commsquality {
427aaad4303SSolomon Peachy 	u16 CQ_currBSS;
428aaad4303SSolomon Peachy 	u16 ASL_currBSS;
429aaad4303SSolomon Peachy 	u16 ANL_currFC;
4309cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_commsquality_t;
43100b3ed16SGreg Kroah-Hartman 
43200b3ed16SGreg Kroah-Hartman /*-- Information Record: dmbcommsquality --*/
433e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_dbmcommsquality {
434aaad4303SSolomon Peachy 	u16 CQdbm_currBSS;
435aaad4303SSolomon Peachy 	u16 ASLdbm_currBSS;
436aaad4303SSolomon Peachy 	u16 ANLdbm_currFC;
4379cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_dbmcommsquality_t;
43800b3ed16SGreg Kroah-Hartman 
43900b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
44000b3ed16SGreg Kroah-Hartman FRAME STRUCTURES: Communication Frames
44100b3ed16SGreg Kroah-Hartman ----------------------------------------------------------------------
44200b3ed16SGreg Kroah-Hartman Communication Frames: Transmit Frames
44300b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
44400b3ed16SGreg Kroah-Hartman /*-- Communication Frame: Transmit Frame Structure --*/
445e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_tx_frame {
446aaad4303SSolomon Peachy 	u16 status;
447aaad4303SSolomon Peachy 	u16 reserved1;
448aaad4303SSolomon Peachy 	u16 reserved2;
449aaad4303SSolomon Peachy 	u32 sw_support;
450aaad4303SSolomon Peachy 	u8 tx_retrycount;
451aaad4303SSolomon Peachy 	u8 tx_rate;
452aaad4303SSolomon Peachy 	u16 tx_control;
45300b3ed16SGreg Kroah-Hartman 
45400b3ed16SGreg Kroah-Hartman 	/*-- 802.11 Header Information --*/
45500b3ed16SGreg Kroah-Hartman 
456aaad4303SSolomon Peachy 	u16 frame_control;
457aaad4303SSolomon Peachy 	u16 duration_id;
458aaad4303SSolomon Peachy 	u8 address1[6];
459aaad4303SSolomon Peachy 	u8 address2[6];
460aaad4303SSolomon Peachy 	u8 address3[6];
461aaad4303SSolomon Peachy 	u16 sequence_control;
462aaad4303SSolomon Peachy 	u8 address4[6];
463aaad4303SSolomon Peachy 	u16 data_len;		/* little endian format */
46400b3ed16SGreg Kroah-Hartman 
46500b3ed16SGreg Kroah-Hartman 	/*-- 802.3 Header Information --*/
46600b3ed16SGreg Kroah-Hartman 
467aaad4303SSolomon Peachy 	u8 dest_addr[6];
468aaad4303SSolomon Peachy 	u8 src_addr[6];
469aaad4303SSolomon Peachy 	u16 data_length;	/* big endian format */
4709cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_tx_frame_t;
47100b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
47200b3ed16SGreg Kroah-Hartman Communication Frames: Field Masks for Transmit Frames
47300b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
47400b3ed16SGreg Kroah-Hartman /*-- Status Field --*/
4757f6e0e44SMoritz Muehlenhoff #define		HFA384x_TXSTATUS_ACKERR			((u16)BIT(5))
4767f6e0e44SMoritz Muehlenhoff #define		HFA384x_TXSTATUS_FORMERR		((u16)BIT(3))
4777f6e0e44SMoritz Muehlenhoff #define		HFA384x_TXSTATUS_DISCON			((u16)BIT(2))
4787f6e0e44SMoritz Muehlenhoff #define		HFA384x_TXSTATUS_AGEDERR		((u16)BIT(1))
4797f6e0e44SMoritz Muehlenhoff #define		HFA384x_TXSTATUS_RETRYERR		((u16)BIT(0))
48000b3ed16SGreg Kroah-Hartman /*-- Transmit Control Field --*/
4817f6e0e44SMoritz Muehlenhoff #define		HFA384x_TX_MACPORT			((u16)(BIT(10) | BIT(9) | BIT(8)))
4827f6e0e44SMoritz Muehlenhoff #define		HFA384x_TX_STRUCTYPE			((u16)(BIT(4) | BIT(3)))
4837f6e0e44SMoritz Muehlenhoff #define		HFA384x_TX_TXEX				((u16)BIT(2))
4847f6e0e44SMoritz Muehlenhoff #define		HFA384x_TX_TXOK				((u16)BIT(1))
48500b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
48600b3ed16SGreg Kroah-Hartman Communication Frames: Test/Get/Set Field Values for Transmit Frames
48700b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
48800b3ed16SGreg Kroah-Hartman /*-- Status Field --*/
48900b3ed16SGreg Kroah-Hartman #define HFA384x_TXSTATUS_ISERROR(v)	\
490aaad4303SSolomon Peachy 	(((u16)(v))&\
49100b3ed16SGreg Kroah-Hartman 	(HFA384x_TXSTATUS_ACKERR|HFA384x_TXSTATUS_FORMERR|\
49200b3ed16SGreg Kroah-Hartman 	HFA384x_TXSTATUS_DISCON|HFA384x_TXSTATUS_AGEDERR|\
49300b3ed16SGreg Kroah-Hartman 	HFA384x_TXSTATUS_RETRYERR))
49400b3ed16SGreg Kroah-Hartman 
495aaad4303SSolomon Peachy #define	HFA384x_TX_SET(v, m, s)		((((u16)(v))<<((u16)(s)))&((u16)(m)))
49600b3ed16SGreg Kroah-Hartman 
49700b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_MACPORT_SET(v)	HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8)
49800b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_STRUCTYPE_SET(v)	HFA384x_TX_SET(v, HFA384x_TX_STRUCTYPE, 3)
49900b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_TXEX_SET(v)		HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2)
50000b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_TXOK_SET(v)		HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1)
50100b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
50200b3ed16SGreg Kroah-Hartman Communication Frames: Receive Frames
50300b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
50400b3ed16SGreg Kroah-Hartman /*-- Communication Frame: Receive Frame Structure --*/
505e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_rx_frame {
50600b3ed16SGreg Kroah-Hartman 	/*-- MAC rx descriptor (hfa384x byte order) --*/
507aaad4303SSolomon Peachy 	u16 status;
508aaad4303SSolomon Peachy 	u32 time;
509aaad4303SSolomon Peachy 	u8 silence;
510aaad4303SSolomon Peachy 	u8 signal;
511aaad4303SSolomon Peachy 	u8 rate;
512aaad4303SSolomon Peachy 	u8 rx_flow;
513aaad4303SSolomon Peachy 	u16 reserved1;
514aaad4303SSolomon Peachy 	u16 reserved2;
51500b3ed16SGreg Kroah-Hartman 
51600b3ed16SGreg Kroah-Hartman 	/*-- 802.11 Header Information (802.11 byte order) --*/
517aaad4303SSolomon Peachy 	u16 frame_control;
518aaad4303SSolomon Peachy 	u16 duration_id;
519aaad4303SSolomon Peachy 	u8 address1[6];
520aaad4303SSolomon Peachy 	u8 address2[6];
521aaad4303SSolomon Peachy 	u8 address3[6];
522aaad4303SSolomon Peachy 	u16 sequence_control;
523aaad4303SSolomon Peachy 	u8 address4[6];
524aaad4303SSolomon Peachy 	u16 data_len;		/* hfa384x (little endian) format */
52500b3ed16SGreg Kroah-Hartman 
52600b3ed16SGreg Kroah-Hartman 	/*-- 802.3 Header Information --*/
527aaad4303SSolomon Peachy 	u8 dest_addr[6];
528aaad4303SSolomon Peachy 	u8 src_addr[6];
529aaad4303SSolomon Peachy 	u16 data_length;	/* IEEE? (big endian) format */
5309cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_rx_frame_t;
53100b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
53200b3ed16SGreg Kroah-Hartman Communication Frames: Field Masks for Receive Frames
53300b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
53400b3ed16SGreg Kroah-Hartman 
53500b3ed16SGreg Kroah-Hartman /*-- Status Fields --*/
5367f6e0e44SMoritz Muehlenhoff #define		HFA384x_RXSTATUS_MACPORT		((u16)(BIT(10) | BIT(9) | BIT(8)))
5377f6e0e44SMoritz Muehlenhoff #define		HFA384x_RXSTATUS_FCSERR			((u16)BIT(0))
53800b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
53900b3ed16SGreg Kroah-Hartman Communication Frames: Test/Get/Set Field Values for Receive Frames
54000b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
541aaad4303SSolomon Peachy #define		HFA384x_RXSTATUS_MACPORT_GET(value)	((u16)((((u16)(value)) & HFA384x_RXSTATUS_MACPORT) >> 8))
542aaad4303SSolomon Peachy #define		HFA384x_RXSTATUS_ISFCSERR(value)	((u16)(((u16)(value)) & HFA384x_RXSTATUS_FCSERR))
54300b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
54400b3ed16SGreg Kroah-Hartman  FRAME STRUCTURES: Information Types and Information Frame Structures
54500b3ed16SGreg Kroah-Hartman ----------------------------------------------------------------------
54600b3ed16SGreg Kroah-Hartman Information Types
54700b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
548aaad4303SSolomon Peachy #define		HFA384x_IT_HANDOVERADDR			((u16)0xF000UL)
549aaad4303SSolomon Peachy #define		HFA384x_IT_COMMTALLIES			((u16)0xF100UL)
550aaad4303SSolomon Peachy #define		HFA384x_IT_SCANRESULTS			((u16)0xF101UL)
551aaad4303SSolomon Peachy #define		HFA384x_IT_CHINFORESULTS		((u16)0xF102UL)
552aaad4303SSolomon Peachy #define		HFA384x_IT_HOSTSCANRESULTS		((u16)0xF103UL)
553aaad4303SSolomon Peachy #define		HFA384x_IT_LINKSTATUS			((u16)0xF200UL)
554aaad4303SSolomon Peachy #define		HFA384x_IT_ASSOCSTATUS			((u16)0xF201UL)
555aaad4303SSolomon Peachy #define		HFA384x_IT_AUTHREQ			((u16)0xF202UL)
556aaad4303SSolomon Peachy #define		HFA384x_IT_PSUSERCNT			((u16)0xF203UL)
557aaad4303SSolomon Peachy #define		HFA384x_IT_KEYIDCHANGED			((u16)0xF204UL)
558aaad4303SSolomon Peachy #define		HFA384x_IT_ASSOCREQ    			((u16)0xF205UL)
559aaad4303SSolomon Peachy #define		HFA384x_IT_MICFAILURE  			((u16)0xF206UL)
56000b3ed16SGreg Kroah-Hartman 
56100b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
56200b3ed16SGreg Kroah-Hartman Information Frames Structures
56300b3ed16SGreg Kroah-Hartman ----------------------------------------------------------------------
56400b3ed16SGreg Kroah-Hartman Information Frames: Notification Frame Structures
56500b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
56600b3ed16SGreg Kroah-Hartman 
56700b3ed16SGreg Kroah-Hartman /*--  Inquiry Frame, Diagnose: Communication Tallies --*/
568e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_CommTallies16 {
569aaad4303SSolomon Peachy 	u16 txunicastframes;
570aaad4303SSolomon Peachy 	u16 txmulticastframes;
571aaad4303SSolomon Peachy 	u16 txfragments;
572aaad4303SSolomon Peachy 	u16 txunicastoctets;
573aaad4303SSolomon Peachy 	u16 txmulticastoctets;
574aaad4303SSolomon Peachy 	u16 txdeferredtrans;
575aaad4303SSolomon Peachy 	u16 txsingleretryframes;
576aaad4303SSolomon Peachy 	u16 txmultipleretryframes;
577aaad4303SSolomon Peachy 	u16 txretrylimitexceeded;
578aaad4303SSolomon Peachy 	u16 txdiscards;
579aaad4303SSolomon Peachy 	u16 rxunicastframes;
580aaad4303SSolomon Peachy 	u16 rxmulticastframes;
581aaad4303SSolomon Peachy 	u16 rxfragments;
582aaad4303SSolomon Peachy 	u16 rxunicastoctets;
583aaad4303SSolomon Peachy 	u16 rxmulticastoctets;
584aaad4303SSolomon Peachy 	u16 rxfcserrors;
585aaad4303SSolomon Peachy 	u16 rxdiscardsnobuffer;
586aaad4303SSolomon Peachy 	u16 txdiscardswrongsa;
587aaad4303SSolomon Peachy 	u16 rxdiscardswepundecr;
588aaad4303SSolomon Peachy 	u16 rxmsginmsgfrag;
589aaad4303SSolomon Peachy 	u16 rxmsginbadmsgfrag;
5909cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_CommTallies16_t;
59100b3ed16SGreg Kroah-Hartman 
592e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_CommTallies32 {
593aaad4303SSolomon Peachy 	u32 txunicastframes;
594aaad4303SSolomon Peachy 	u32 txmulticastframes;
595aaad4303SSolomon Peachy 	u32 txfragments;
596aaad4303SSolomon Peachy 	u32 txunicastoctets;
597aaad4303SSolomon Peachy 	u32 txmulticastoctets;
598aaad4303SSolomon Peachy 	u32 txdeferredtrans;
599aaad4303SSolomon Peachy 	u32 txsingleretryframes;
600aaad4303SSolomon Peachy 	u32 txmultipleretryframes;
601aaad4303SSolomon Peachy 	u32 txretrylimitexceeded;
602aaad4303SSolomon Peachy 	u32 txdiscards;
603aaad4303SSolomon Peachy 	u32 rxunicastframes;
604aaad4303SSolomon Peachy 	u32 rxmulticastframes;
605aaad4303SSolomon Peachy 	u32 rxfragments;
606aaad4303SSolomon Peachy 	u32 rxunicastoctets;
607aaad4303SSolomon Peachy 	u32 rxmulticastoctets;
608aaad4303SSolomon Peachy 	u32 rxfcserrors;
609aaad4303SSolomon Peachy 	u32 rxdiscardsnobuffer;
610aaad4303SSolomon Peachy 	u32 txdiscardswrongsa;
611aaad4303SSolomon Peachy 	u32 rxdiscardswepundecr;
612aaad4303SSolomon Peachy 	u32 rxmsginmsgfrag;
613aaad4303SSolomon Peachy 	u32 rxmsginbadmsgfrag;
6149cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_CommTallies32_t;
61500b3ed16SGreg Kroah-Hartman 
61600b3ed16SGreg Kroah-Hartman /*--  Inquiry Frame, Diagnose: Scan Results & Subfields--*/
617e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_ScanResultSub {
618aaad4303SSolomon Peachy 	u16 chid;
619aaad4303SSolomon Peachy 	u16 anl;
620aaad4303SSolomon Peachy 	u16 sl;
621aaad4303SSolomon Peachy 	u8 bssid[WLAN_BSSID_LEN];
622aaad4303SSolomon Peachy 	u16 bcnint;
623aaad4303SSolomon Peachy 	u16 capinfo;
62400b3ed16SGreg Kroah-Hartman 	hfa384x_bytestr32_t ssid;
625aaad4303SSolomon Peachy 	u8 supprates[10];	/* 802.11 info element */
626aaad4303SSolomon Peachy 	u16 proberesp_rate;
6279cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_ScanResultSub_t;
62800b3ed16SGreg Kroah-Hartman 
629e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_ScanResult {
630aaad4303SSolomon Peachy 	u16 rsvd;
631aaad4303SSolomon Peachy 	u16 scanreason;
632e573aaa4SMoritz Muehlenhoff 	 hfa384x_ScanResultSub_t result[HFA384x_SCANRESULT_MAX];
6339cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_ScanResult_t;
63400b3ed16SGreg Kroah-Hartman 
63500b3ed16SGreg Kroah-Hartman /*--  Inquiry Frame, Diagnose: ChInfo Results & Subfields--*/
636e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_ChInfoResultSub {
637aaad4303SSolomon Peachy 	u16 chid;
638aaad4303SSolomon Peachy 	u16 anl;
639aaad4303SSolomon Peachy 	u16 pnl;
640aaad4303SSolomon Peachy 	u16 active;
6419cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_ChInfoResultSub_t;
64200b3ed16SGreg Kroah-Hartman 
6437f6e0e44SMoritz Muehlenhoff #define HFA384x_CHINFORESULT_BSSACTIVE	BIT(0)
6447f6e0e44SMoritz Muehlenhoff #define HFA384x_CHINFORESULT_PCFACTIVE	BIT(1)
64500b3ed16SGreg Kroah-Hartman 
646e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_ChInfoResult {
647aaad4303SSolomon Peachy 	u16 scanchannels;
648e573aaa4SMoritz Muehlenhoff 	 hfa384x_ChInfoResultSub_t result[HFA384x_CHINFORESULT_MAX];
6499cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_ChInfoResult_t;
65000b3ed16SGreg Kroah-Hartman 
65100b3ed16SGreg Kroah-Hartman /*--  Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/
652e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_HScanResultSub {
653aaad4303SSolomon Peachy 	u16 chid;
654aaad4303SSolomon Peachy 	u16 anl;
655aaad4303SSolomon Peachy 	u16 sl;
656aaad4303SSolomon Peachy 	u8 bssid[WLAN_BSSID_LEN];
657aaad4303SSolomon Peachy 	u16 bcnint;
658aaad4303SSolomon Peachy 	u16 capinfo;
65900b3ed16SGreg Kroah-Hartman 	hfa384x_bytestr32_t ssid;
660aaad4303SSolomon Peachy 	u8 supprates[10];	/* 802.11 info element */
661aaad4303SSolomon Peachy 	u16 proberesp_rate;
662aaad4303SSolomon Peachy 	u16 atim;
6639cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_HScanResultSub_t;
66400b3ed16SGreg Kroah-Hartman 
665e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_HScanResult {
666aaad4303SSolomon Peachy 	u16 nresult;
667aaad4303SSolomon Peachy 	u16 rsvd;
668e573aaa4SMoritz Muehlenhoff 	 hfa384x_HScanResultSub_t result[HFA384x_HSCANRESULT_MAX];
6699cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_HScanResult_t;
67000b3ed16SGreg Kroah-Hartman 
67100b3ed16SGreg Kroah-Hartman /*--  Unsolicited Frame, MAC Mgmt: LinkStatus --*/
67200b3ed16SGreg Kroah-Hartman 
673aaad4303SSolomon Peachy #define HFA384x_LINK_NOTCONNECTED	((u16)0)
674aaad4303SSolomon Peachy #define HFA384x_LINK_CONNECTED		((u16)1)
675aaad4303SSolomon Peachy #define HFA384x_LINK_DISCONNECTED	((u16)2)
676aaad4303SSolomon Peachy #define HFA384x_LINK_AP_CHANGE		((u16)3)
677aaad4303SSolomon Peachy #define HFA384x_LINK_AP_OUTOFRANGE	((u16)4)
678aaad4303SSolomon Peachy #define HFA384x_LINK_AP_INRANGE		((u16)5)
679aaad4303SSolomon Peachy #define HFA384x_LINK_ASSOCFAIL		((u16)6)
68000b3ed16SGreg Kroah-Hartman 
681e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_LinkStatus {
682aaad4303SSolomon Peachy 	u16 linkstatus;
6839cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_LinkStatus_t;
68400b3ed16SGreg Kroah-Hartman 
68500b3ed16SGreg Kroah-Hartman /*--  Unsolicited Frame, MAC Mgmt: AssociationStatus (--*/
68600b3ed16SGreg Kroah-Hartman 
687aaad4303SSolomon Peachy #define HFA384x_ASSOCSTATUS_STAASSOC	((u16)1)
688aaad4303SSolomon Peachy #define HFA384x_ASSOCSTATUS_REASSOC	((u16)2)
689aaad4303SSolomon Peachy #define HFA384x_ASSOCSTATUS_AUTHFAIL	((u16)5)
69000b3ed16SGreg Kroah-Hartman 
691e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_AssocStatus {
692aaad4303SSolomon Peachy 	u16 assocstatus;
69328b17a4bSMoritz Muehlenhoff 	u8 sta_addr[ETH_ALEN];
69400b3ed16SGreg Kroah-Hartman 	/* old_ap_addr is only valid if assocstatus == 2 */
69528b17a4bSMoritz Muehlenhoff 	u8 old_ap_addr[ETH_ALEN];
696aaad4303SSolomon Peachy 	u16 reason;
697aaad4303SSolomon Peachy 	u16 reserved;
6989cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_AssocStatus_t;
69900b3ed16SGreg Kroah-Hartman 
70000b3ed16SGreg Kroah-Hartman /*--  Unsolicited Frame, MAC Mgmt: AuthRequest (AP Only) --*/
70100b3ed16SGreg Kroah-Hartman 
702e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_AuthRequest {
70328b17a4bSMoritz Muehlenhoff 	u8 sta_addr[ETH_ALEN];
704aaad4303SSolomon Peachy 	u16 algorithm;
7059cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_AuthReq_t;
70600b3ed16SGreg Kroah-Hartman 
70700b3ed16SGreg Kroah-Hartman /*--  Unsolicited Frame, MAC Mgmt: PSUserCount (AP Only) --*/
70800b3ed16SGreg Kroah-Hartman 
709e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_PSUserCount {
710aaad4303SSolomon Peachy 	u16 usercnt;
7119cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_PSUserCount_t;
71200b3ed16SGreg Kroah-Hartman 
713e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_KeyIDChanged {
71428b17a4bSMoritz Muehlenhoff 	u8 sta_addr[ETH_ALEN];
715aaad4303SSolomon Peachy 	u16 keyid;
7169cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_KeyIDChanged_t;
71700b3ed16SGreg Kroah-Hartman 
71800b3ed16SGreg Kroah-Hartman /*--  Collection of all Inf frames ---------------*/
71900b3ed16SGreg Kroah-Hartman typedef union hfa384x_infodata {
72000b3ed16SGreg Kroah-Hartman 	hfa384x_CommTallies16_t commtallies16;
72100b3ed16SGreg Kroah-Hartman 	hfa384x_CommTallies32_t commtallies32;
72200b3ed16SGreg Kroah-Hartman 	hfa384x_ScanResult_t scanresult;
72300b3ed16SGreg Kroah-Hartman 	hfa384x_ChInfoResult_t chinforesult;
72400b3ed16SGreg Kroah-Hartman 	hfa384x_HScanResult_t hscanresult;
72500b3ed16SGreg Kroah-Hartman 	hfa384x_LinkStatus_t linkstatus;
72600b3ed16SGreg Kroah-Hartman 	hfa384x_AssocStatus_t assocstatus;
72700b3ed16SGreg Kroah-Hartman 	hfa384x_AuthReq_t authreq;
72800b3ed16SGreg Kroah-Hartman 	hfa384x_PSUserCount_t psusercnt;
72900b3ed16SGreg Kroah-Hartman 	hfa384x_KeyIDChanged_t keyidchanged;
7309cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_infodata_t;
73100b3ed16SGreg Kroah-Hartman 
732e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_InfFrame {
733aaad4303SSolomon Peachy 	u16 framelen;
734aaad4303SSolomon Peachy 	u16 infotype;
73500b3ed16SGreg Kroah-Hartman 	hfa384x_infodata_t info;
7369cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_InfFrame_t;
73700b3ed16SGreg Kroah-Hartman 
73800b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
73900b3ed16SGreg Kroah-Hartman USB Packet structures and constants.
74000b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
74100b3ed16SGreg Kroah-Hartman 
74200b3ed16SGreg Kroah-Hartman /* Should be sent to the bulkout endpoint */
74300b3ed16SGreg Kroah-Hartman #define HFA384x_USB_TXFRM	0
74400b3ed16SGreg Kroah-Hartman #define HFA384x_USB_CMDREQ	1
74500b3ed16SGreg Kroah-Hartman #define HFA384x_USB_WRIDREQ	2
74600b3ed16SGreg Kroah-Hartman #define HFA384x_USB_RRIDREQ	3
74700b3ed16SGreg Kroah-Hartman #define HFA384x_USB_WMEMREQ	4
74800b3ed16SGreg Kroah-Hartman #define HFA384x_USB_RMEMREQ	5
74900b3ed16SGreg Kroah-Hartman 
75000b3ed16SGreg Kroah-Hartman /* Received from the bulkin endpoint */
75100b3ed16SGreg Kroah-Hartman #define HFA384x_USB_ISTXFRM(a)	(((a) & 0x9000) == 0x1000)
75200b3ed16SGreg Kroah-Hartman #define HFA384x_USB_ISRXFRM(a)	(!((a) & 0x9000))
75300b3ed16SGreg Kroah-Hartman #define HFA384x_USB_INFOFRM	0x8000
75400b3ed16SGreg Kroah-Hartman #define HFA384x_USB_CMDRESP	0x8001
75500b3ed16SGreg Kroah-Hartman #define HFA384x_USB_WRIDRESP	0x8002
75600b3ed16SGreg Kroah-Hartman #define HFA384x_USB_RRIDRESP	0x8003
75700b3ed16SGreg Kroah-Hartman #define HFA384x_USB_WMEMRESP	0x8004
75800b3ed16SGreg Kroah-Hartman #define HFA384x_USB_RMEMRESP	0x8005
75900b3ed16SGreg Kroah-Hartman #define HFA384x_USB_BUFAVAIL	0x8006
76000b3ed16SGreg Kroah-Hartman #define HFA384x_USB_ERROR	0x8007
76100b3ed16SGreg Kroah-Hartman 
76200b3ed16SGreg Kroah-Hartman /*------------------------------------*/
76300b3ed16SGreg Kroah-Hartman /* Request (bulk OUT) packet contents */
76400b3ed16SGreg Kroah-Hartman 
76500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_txfrm {
76600b3ed16SGreg Kroah-Hartman 	hfa384x_tx_frame_t desc;
767aaad4303SSolomon Peachy 	u8 data[WLAN_DATA_MAXLEN];
7689cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usb_txfrm_t;
76900b3ed16SGreg Kroah-Hartman 
77000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_cmdreq {
771aaad4303SSolomon Peachy 	u16 type;
772aaad4303SSolomon Peachy 	u16 cmd;
773aaad4303SSolomon Peachy 	u16 parm0;
774aaad4303SSolomon Peachy 	u16 parm1;
775aaad4303SSolomon Peachy 	u16 parm2;
776aaad4303SSolomon Peachy 	u8 pad[54];
7779cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usb_cmdreq_t;
77800b3ed16SGreg Kroah-Hartman 
77900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_wridreq {
780aaad4303SSolomon Peachy 	u16 type;
781aaad4303SSolomon Peachy 	u16 frmlen;
782aaad4303SSolomon Peachy 	u16 rid;
783aaad4303SSolomon Peachy 	u8 data[HFA384x_RIDDATA_MAXLEN];
7849cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usb_wridreq_t;
78500b3ed16SGreg Kroah-Hartman 
78600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rridreq {
787aaad4303SSolomon Peachy 	u16 type;
788aaad4303SSolomon Peachy 	u16 frmlen;
789aaad4303SSolomon Peachy 	u16 rid;
790aaad4303SSolomon Peachy 	u8 pad[58];
7919cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usb_rridreq_t;
79200b3ed16SGreg Kroah-Hartman 
79300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_wmemreq {
794aaad4303SSolomon Peachy 	u16 type;
795aaad4303SSolomon Peachy 	u16 frmlen;
796aaad4303SSolomon Peachy 	u16 offset;
797aaad4303SSolomon Peachy 	u16 page;
798aaad4303SSolomon Peachy 	u8 data[HFA384x_USB_RWMEM_MAXLEN];
7999cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usb_wmemreq_t;
80000b3ed16SGreg Kroah-Hartman 
80100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rmemreq {
802aaad4303SSolomon Peachy 	u16 type;
803aaad4303SSolomon Peachy 	u16 frmlen;
804aaad4303SSolomon Peachy 	u16 offset;
805aaad4303SSolomon Peachy 	u16 page;
806aaad4303SSolomon Peachy 	u8 pad[56];
8079cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usb_rmemreq_t;
80800b3ed16SGreg Kroah-Hartman 
80900b3ed16SGreg Kroah-Hartman /*------------------------------------*/
81000b3ed16SGreg Kroah-Hartman /* Response (bulk IN) packet contents */
81100b3ed16SGreg Kroah-Hartman 
81200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rxfrm {
81300b3ed16SGreg Kroah-Hartman 	hfa384x_rx_frame_t desc;
814aaad4303SSolomon Peachy 	u8 data[WLAN_DATA_MAXLEN];
8159cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usb_rxfrm_t;
81600b3ed16SGreg Kroah-Hartman 
81700b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_infofrm {
818aaad4303SSolomon Peachy 	u16 type;
81900b3ed16SGreg Kroah-Hartman 	hfa384x_InfFrame_t info;
8209cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usb_infofrm_t;
82100b3ed16SGreg Kroah-Hartman 
82200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_statusresp {
823aaad4303SSolomon Peachy 	u16 type;
824aaad4303SSolomon Peachy 	u16 status;
825aaad4303SSolomon Peachy 	u16 resp0;
826aaad4303SSolomon Peachy 	u16 resp1;
827aaad4303SSolomon Peachy 	u16 resp2;
8289cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usb_cmdresp_t;
82900b3ed16SGreg Kroah-Hartman 
83000b3ed16SGreg Kroah-Hartman typedef hfa384x_usb_cmdresp_t hfa384x_usb_wridresp_t;
83100b3ed16SGreg Kroah-Hartman 
83200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rridresp {
833aaad4303SSolomon Peachy 	u16 type;
834aaad4303SSolomon Peachy 	u16 frmlen;
835aaad4303SSolomon Peachy 	u16 rid;
836aaad4303SSolomon Peachy 	u8 data[HFA384x_RIDDATA_MAXLEN];
8379cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usb_rridresp_t;
83800b3ed16SGreg Kroah-Hartman 
83900b3ed16SGreg Kroah-Hartman typedef hfa384x_usb_cmdresp_t hfa384x_usb_wmemresp_t;
84000b3ed16SGreg Kroah-Hartman 
84100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rmemresp {
842aaad4303SSolomon Peachy 	u16 type;
843aaad4303SSolomon Peachy 	u16 frmlen;
844aaad4303SSolomon Peachy 	u8 data[HFA384x_USB_RWMEM_MAXLEN];
8459cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usb_rmemresp_t;
84600b3ed16SGreg Kroah-Hartman 
84700b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_bufavail {
848aaad4303SSolomon Peachy 	u16 type;
849aaad4303SSolomon Peachy 	u16 frmlen;
8509cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usb_bufavail_t;
85100b3ed16SGreg Kroah-Hartman 
85200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_error {
853aaad4303SSolomon Peachy 	u16 type;
854aaad4303SSolomon Peachy 	u16 errortype;
8559cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usb_error_t;
85600b3ed16SGreg Kroah-Hartman 
85700b3ed16SGreg Kroah-Hartman /*----------------------------------------------------------*/
85800b3ed16SGreg Kroah-Hartman /* Unions for packaging all the known packet types together */
85900b3ed16SGreg Kroah-Hartman 
86000b3ed16SGreg Kroah-Hartman typedef union hfa384x_usbout {
861aaad4303SSolomon Peachy 	u16 type;
86200b3ed16SGreg Kroah-Hartman 	hfa384x_usb_txfrm_t txfrm;
86300b3ed16SGreg Kroah-Hartman 	hfa384x_usb_cmdreq_t cmdreq;
86400b3ed16SGreg Kroah-Hartman 	hfa384x_usb_wridreq_t wridreq;
86500b3ed16SGreg Kroah-Hartman 	hfa384x_usb_rridreq_t rridreq;
86600b3ed16SGreg Kroah-Hartman 	hfa384x_usb_wmemreq_t wmemreq;
86700b3ed16SGreg Kroah-Hartman 	hfa384x_usb_rmemreq_t rmemreq;
8689cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usbout_t;
86900b3ed16SGreg Kroah-Hartman 
87000b3ed16SGreg Kroah-Hartman typedef union hfa384x_usbin {
871aaad4303SSolomon Peachy 	u16 type;
87200b3ed16SGreg Kroah-Hartman 	hfa384x_usb_rxfrm_t rxfrm;
87300b3ed16SGreg Kroah-Hartman 	hfa384x_usb_txfrm_t txfrm;
87400b3ed16SGreg Kroah-Hartman 	hfa384x_usb_infofrm_t infofrm;
87500b3ed16SGreg Kroah-Hartman 	hfa384x_usb_cmdresp_t cmdresp;
87600b3ed16SGreg Kroah-Hartman 	hfa384x_usb_wridresp_t wridresp;
87700b3ed16SGreg Kroah-Hartman 	hfa384x_usb_rridresp_t rridresp;
87800b3ed16SGreg Kroah-Hartman 	hfa384x_usb_wmemresp_t wmemresp;
87900b3ed16SGreg Kroah-Hartman 	hfa384x_usb_rmemresp_t rmemresp;
88000b3ed16SGreg Kroah-Hartman 	hfa384x_usb_bufavail_t bufavail;
88100b3ed16SGreg Kroah-Hartman 	hfa384x_usb_error_t usberror;
882aaad4303SSolomon Peachy 	u8 boguspad[3000];
8839cba46dcSMoritz Muehlenhoff } __attribute__ ((packed)) hfa384x_usbin_t;
88400b3ed16SGreg Kroah-Hartman 
88500b3ed16SGreg Kroah-Hartman #ifdef __KERNEL__
88600b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
88700b3ed16SGreg Kroah-Hartman ---  MAC state structure, argument to all functions --
88800b3ed16SGreg Kroah-Hartman ---  Also, a collection of support types --
88900b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
890e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_statusresult {
891aaad4303SSolomon Peachy 	u16 status;
892aaad4303SSolomon Peachy 	u16 resp0;
893aaad4303SSolomon Peachy 	u16 resp1;
894aaad4303SSolomon Peachy 	u16 resp2;
89500b3ed16SGreg Kroah-Hartman } hfa384x_cmdresult_t;
89600b3ed16SGreg Kroah-Hartman 
89700b3ed16SGreg Kroah-Hartman /* USB Control Exchange (CTLX):
89800b3ed16SGreg Kroah-Hartman  *  A queue of the structure below is maintained for all of the
89900b3ed16SGreg Kroah-Hartman  *  Request/Response type USB packets supported by Prism2.
90000b3ed16SGreg Kroah-Hartman  */
90100b3ed16SGreg Kroah-Hartman /* The following hfa384x_* structures are arguments to
90200b3ed16SGreg Kroah-Hartman  * the usercb() for the different CTLX types.
90300b3ed16SGreg Kroah-Hartman  */
904e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_rridresult {
905aaad4303SSolomon Peachy 	u16 rid;
90600b3ed16SGreg Kroah-Hartman 	const void *riddata;
907aaad4303SSolomon Peachy 	unsigned int riddata_len;
90800b3ed16SGreg Kroah-Hartman } hfa384x_rridresult_t;
90900b3ed16SGreg Kroah-Hartman 
91000b3ed16SGreg Kroah-Hartman enum ctlx_state {
91100b3ed16SGreg Kroah-Hartman 	CTLX_START = 0,		/* Start state, not queued */
91200b3ed16SGreg Kroah-Hartman 
91300b3ed16SGreg Kroah-Hartman 	CTLX_COMPLETE,		/* CTLX successfully completed */
91400b3ed16SGreg Kroah-Hartman 	CTLX_REQ_FAILED,	/* OUT URB completed w/ error */
91500b3ed16SGreg Kroah-Hartman 
91600b3ed16SGreg Kroah-Hartman 	CTLX_PENDING,		/* Queued, data valid */
91700b3ed16SGreg Kroah-Hartman 	CTLX_REQ_SUBMITTED,	/* OUT URB submitted */
91800b3ed16SGreg Kroah-Hartman 	CTLX_REQ_COMPLETE,	/* OUT URB complete */
91900b3ed16SGreg Kroah-Hartman 	CTLX_RESP_COMPLETE	/* IN URB received */
92000b3ed16SGreg Kroah-Hartman };
92100b3ed16SGreg Kroah-Hartman typedef enum ctlx_state CTLX_STATE;
92200b3ed16SGreg Kroah-Hartman 
92300b3ed16SGreg Kroah-Hartman struct hfa384x_usbctlx;
92400b3ed16SGreg Kroah-Hartman struct hfa384x;
92500b3ed16SGreg Kroah-Hartman 
92600b3ed16SGreg Kroah-Hartman typedef void (*ctlx_cmdcb_t) (struct hfa384x *, const struct hfa384x_usbctlx *);
92700b3ed16SGreg Kroah-Hartman 
928e573aaa4SMoritz Muehlenhoff typedef void (*ctlx_usercb_t) (struct hfa384x *hw,
929e573aaa4SMoritz Muehlenhoff 			       void *ctlxresult, void *usercb_data);
93000b3ed16SGreg Kroah-Hartman 
931e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_usbctlx {
93200b3ed16SGreg Kroah-Hartman 	struct list_head list;
93300b3ed16SGreg Kroah-Hartman 
93400b3ed16SGreg Kroah-Hartman 	size_t outbufsize;
93500b3ed16SGreg Kroah-Hartman 	hfa384x_usbout_t outbuf;	/* pkt buf for OUT */
93600b3ed16SGreg Kroah-Hartman 	hfa384x_usbin_t inbuf;	/* pkt buf for IN(a copy) */
93700b3ed16SGreg Kroah-Hartman 
93800b3ed16SGreg Kroah-Hartman 	CTLX_STATE state;	/* Tracks running state */
93900b3ed16SGreg Kroah-Hartman 
94000b3ed16SGreg Kroah-Hartman 	struct completion done;
94100b3ed16SGreg Kroah-Hartman 	volatile int reapable;	/* Food for the reaper task */
94200b3ed16SGreg Kroah-Hartman 
94300b3ed16SGreg Kroah-Hartman 	ctlx_cmdcb_t cmdcb;	/* Async command callback */
94400b3ed16SGreg Kroah-Hartman 	ctlx_usercb_t usercb;	/* Async user callback, */
94500b3ed16SGreg Kroah-Hartman 	void *usercb_data;	/*  at CTLX completion  */
94600b3ed16SGreg Kroah-Hartman 
94700b3ed16SGreg Kroah-Hartman 	int variant;		/* Identifies cmd variant */
94800b3ed16SGreg Kroah-Hartman } hfa384x_usbctlx_t;
94900b3ed16SGreg Kroah-Hartman 
950e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_usbctlxq {
95100b3ed16SGreg Kroah-Hartman 	spinlock_t lock;
95200b3ed16SGreg Kroah-Hartman 	struct list_head pending;
95300b3ed16SGreg Kroah-Hartman 	struct list_head active;
95400b3ed16SGreg Kroah-Hartman 	struct list_head completing;
95500b3ed16SGreg Kroah-Hartman 	struct list_head reapable;
95600b3ed16SGreg Kroah-Hartman } hfa384x_usbctlxq_t;
95700b3ed16SGreg Kroah-Hartman 
958e573aaa4SMoritz Muehlenhoff typedef struct hfa484x_metacmd {
959aaad4303SSolomon Peachy 	u16 cmd;
96000b3ed16SGreg Kroah-Hartman 
961aaad4303SSolomon Peachy 	u16 parm0;
962aaad4303SSolomon Peachy 	u16 parm1;
963aaad4303SSolomon Peachy 	u16 parm2;
96400b3ed16SGreg Kroah-Hartman 
96500b3ed16SGreg Kroah-Hartman 	hfa384x_cmdresult_t result;
96600b3ed16SGreg Kroah-Hartman } hfa384x_metacmd_t;
96700b3ed16SGreg Kroah-Hartman 
96800b3ed16SGreg Kroah-Hartman #define	MAX_GRP_ADDR		32
96900b3ed16SGreg Kroah-Hartman #define WLAN_COMMENT_MAX	80	/* Max. length of user comment string. */
97000b3ed16SGreg Kroah-Hartman 
97100b3ed16SGreg Kroah-Hartman #define WLAN_AUTH_MAX           60	/* Max. # of authenticated stations. */
97200b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_MAX		60	/* Max. # of stations in an access list. */
97300b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_NONE	0	/* No stations may be authenticated. */
97400b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_ALL		1	/* All stations may be authenticated. */
97500b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_ALLOW	2	/* Authenticate only "allowed" stations. */
97600b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_DENY	3	/* Do not authenticate "denied" stations. */
97700b3ed16SGreg Kroah-Hartman 
97800b3ed16SGreg Kroah-Hartman /* XXX These are going away ASAP */
979e573aaa4SMoritz Muehlenhoff typedef struct prism2sta_authlist {
980aaad4303SSolomon Peachy 	unsigned int cnt;
98128b17a4bSMoritz Muehlenhoff 	u8 addr[WLAN_AUTH_MAX][ETH_ALEN];
982aaad4303SSolomon Peachy 	u8 assoc[WLAN_AUTH_MAX];
98300b3ed16SGreg Kroah-Hartman } prism2sta_authlist_t;
98400b3ed16SGreg Kroah-Hartman 
985e573aaa4SMoritz Muehlenhoff typedef struct prism2sta_accesslist {
986aaad4303SSolomon Peachy 	unsigned int modify;
987aaad4303SSolomon Peachy 	unsigned int cnt;
98828b17a4bSMoritz Muehlenhoff 	u8 addr[WLAN_ACCESS_MAX][ETH_ALEN];
989aaad4303SSolomon Peachy 	unsigned int cnt1;
99028b17a4bSMoritz Muehlenhoff 	u8 addr1[WLAN_ACCESS_MAX][ETH_ALEN];
99100b3ed16SGreg Kroah-Hartman } prism2sta_accesslist_t;
99200b3ed16SGreg Kroah-Hartman 
993e573aaa4SMoritz Muehlenhoff typedef struct hfa384x {
99400b3ed16SGreg Kroah-Hartman 	/* USB support data */
99500b3ed16SGreg Kroah-Hartman 	struct usb_device *usb;
99600b3ed16SGreg Kroah-Hartman 	struct urb rx_urb;
99700b3ed16SGreg Kroah-Hartman 	struct sk_buff *rx_urb_skb;
99800b3ed16SGreg Kroah-Hartman 	struct urb tx_urb;
99900b3ed16SGreg Kroah-Hartman 	struct urb ctlx_urb;
100000b3ed16SGreg Kroah-Hartman 	hfa384x_usbout_t txbuff;
100100b3ed16SGreg Kroah-Hartman 	hfa384x_usbctlxq_t ctlxq;
100200b3ed16SGreg Kroah-Hartman 	struct timer_list reqtimer;
100300b3ed16SGreg Kroah-Hartman 	struct timer_list resptimer;
100400b3ed16SGreg Kroah-Hartman 
100500b3ed16SGreg Kroah-Hartman 	struct timer_list throttle;
100600b3ed16SGreg Kroah-Hartman 
100700b3ed16SGreg Kroah-Hartman 	struct tasklet_struct reaper_bh;
100800b3ed16SGreg Kroah-Hartman 	struct tasklet_struct completion_bh;
100900b3ed16SGreg Kroah-Hartman 
101000b3ed16SGreg Kroah-Hartman 	struct work_struct usb_work;
101100b3ed16SGreg Kroah-Hartman 
101200b3ed16SGreg Kroah-Hartman 	unsigned long usb_flags;
101300b3ed16SGreg Kroah-Hartman #define THROTTLE_RX	0
101400b3ed16SGreg Kroah-Hartman #define THROTTLE_TX	1
101500b3ed16SGreg Kroah-Hartman #define WORK_RX_HALT	2
101600b3ed16SGreg Kroah-Hartman #define WORK_TX_HALT	3
101700b3ed16SGreg Kroah-Hartman #define WORK_RX_RESUME	4
101800b3ed16SGreg Kroah-Hartman #define WORK_TX_RESUME	5
101900b3ed16SGreg Kroah-Hartman 
102000b3ed16SGreg Kroah-Hartman 	unsigned short req_timer_done:1;
102100b3ed16SGreg Kroah-Hartman 	unsigned short resp_timer_done:1;
102200b3ed16SGreg Kroah-Hartman 
102300b3ed16SGreg Kroah-Hartman 	int endp_in;
102400b3ed16SGreg Kroah-Hartman 	int endp_out;
102500b3ed16SGreg Kroah-Hartman 
102600b3ed16SGreg Kroah-Hartman 	int sniff_fcs;
102700b3ed16SGreg Kroah-Hartman 	int sniff_channel;
102800b3ed16SGreg Kroah-Hartman 	int sniff_truncate;
102900b3ed16SGreg Kroah-Hartman 	int sniffhdr;
103000b3ed16SGreg Kroah-Hartman 
103100b3ed16SGreg Kroah-Hartman 	wait_queue_head_t cmdq;	/* wait queue itself */
103200b3ed16SGreg Kroah-Hartman 
103300b3ed16SGreg Kroah-Hartman 	/* Controller state */
1034aaad4303SSolomon Peachy 	u32 state;
1035aaad4303SSolomon Peachy 	u32 isap;
1036aaad4303SSolomon Peachy 	u8 port_enabled[HFA384x_NUMPORTS_MAX];
103700b3ed16SGreg Kroah-Hartman 
103800b3ed16SGreg Kroah-Hartman 	/* Download support */
1039aaad4303SSolomon Peachy 	unsigned int dlstate;
104000b3ed16SGreg Kroah-Hartman 	hfa384x_downloadbuffer_t bufinfo;
1041aaad4303SSolomon Peachy 	u16 dltimeout;
104200b3ed16SGreg Kroah-Hartman 
104300b3ed16SGreg Kroah-Hartman 	int scanflag;		/* to signal scan comlete */
104400b3ed16SGreg Kroah-Hartman 	int join_ap;		/* are we joined to a specific ap */
104500b3ed16SGreg Kroah-Hartman 	int join_retries;	/* number of join retries till we fail */
104600b3ed16SGreg Kroah-Hartman 	hfa384x_JoinRequest_data_t joinreq;	/* join request saved data */
104700b3ed16SGreg Kroah-Hartman 
104800b3ed16SGreg Kroah-Hartman 	wlandevice_t *wlandev;
104900b3ed16SGreg Kroah-Hartman 	/* Timer to allow for the deferred processing of linkstatus messages */
105000b3ed16SGreg Kroah-Hartman 	struct work_struct link_bh;
105100b3ed16SGreg Kroah-Hartman 
105200b3ed16SGreg Kroah-Hartman 	struct work_struct commsqual_bh;
105300b3ed16SGreg Kroah-Hartman 	hfa384x_commsquality_t qual;
105400b3ed16SGreg Kroah-Hartman 	struct timer_list commsqual_timer;
105500b3ed16SGreg Kroah-Hartman 
1056aaad4303SSolomon Peachy 	u16 link_status;
1057aaad4303SSolomon Peachy 	u16 link_status_new;
105800b3ed16SGreg Kroah-Hartman 	struct sk_buff_head authq;
105900b3ed16SGreg Kroah-Hartman 
106000b3ed16SGreg Kroah-Hartman 	/* And here we have stuff that used to be in priv */
106100b3ed16SGreg Kroah-Hartman 
106200b3ed16SGreg Kroah-Hartman 	/* State variables */
1063aaad4303SSolomon Peachy 	unsigned int presniff_port_type;
1064aaad4303SSolomon Peachy 	u16 presniff_wepflags;
1065aaad4303SSolomon Peachy 	u32 dot11_desired_bss_type;
106600b3ed16SGreg Kroah-Hartman 
106700b3ed16SGreg Kroah-Hartman 	int dbmadjust;
106800b3ed16SGreg Kroah-Hartman 
106900b3ed16SGreg Kroah-Hartman 	/* Group Addresses - right now, there are up to a total
107000b3ed16SGreg Kroah-Hartman 	   of MAX_GRP_ADDR group addresses */
107128b17a4bSMoritz Muehlenhoff 	u8 dot11_grp_addr[MAX_GRP_ADDR][ETH_ALEN];
1072aaad4303SSolomon Peachy 	unsigned int dot11_grpcnt;
107300b3ed16SGreg Kroah-Hartman 
107400b3ed16SGreg Kroah-Hartman 	/* Component Identities */
107500b3ed16SGreg Kroah-Hartman 	hfa384x_compident_t ident_nic;
107600b3ed16SGreg Kroah-Hartman 	hfa384x_compident_t ident_pri_fw;
107700b3ed16SGreg Kroah-Hartman 	hfa384x_compident_t ident_sta_fw;
107800b3ed16SGreg Kroah-Hartman 	hfa384x_compident_t ident_ap_fw;
1079aaad4303SSolomon Peachy 	u16 mm_mods;
108000b3ed16SGreg Kroah-Hartman 
108100b3ed16SGreg Kroah-Hartman 	/* Supplier compatibility ranges */
108200b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t cap_sup_mfi;
108300b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t cap_sup_cfi;
108400b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t cap_sup_pri;
108500b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t cap_sup_sta;
108600b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t cap_sup_ap;
108700b3ed16SGreg Kroah-Hartman 
108800b3ed16SGreg Kroah-Hartman 	/* Actor compatibility ranges */
108900b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t cap_act_pri_cfi;	/* pri f/w to controller interface */
109000b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t cap_act_sta_cfi;	/* sta f/w to controller interface */
109100b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t cap_act_sta_mfi;	/* sta f/w to modem interface */
109200b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t cap_act_ap_cfi;	/* ap f/w to controller interface */
109300b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t cap_act_ap_mfi;	/* ap f/w to modem interface */
109400b3ed16SGreg Kroah-Hartman 
1095aaad4303SSolomon Peachy 	u32 psusercount;	/* Power save user count. */
109600b3ed16SGreg Kroah-Hartman 	hfa384x_CommTallies32_t tallies;	/* Communication tallies. */
1097aaad4303SSolomon Peachy 	u8 comment[WLAN_COMMENT_MAX + 1];	/* User comment */
109800b3ed16SGreg Kroah-Hartman 
109900b3ed16SGreg Kroah-Hartman 	/* Channel Info request results (AP only) */
110000b3ed16SGreg Kroah-Hartman 	struct {
110100b3ed16SGreg Kroah-Hartman 		atomic_t done;
1102aaad4303SSolomon Peachy 		u8 count;
110300b3ed16SGreg Kroah-Hartman 		hfa384x_ChInfoResult_t results;
110400b3ed16SGreg Kroah-Hartman 	} channel_info;
110500b3ed16SGreg Kroah-Hartman 
110600b3ed16SGreg Kroah-Hartman 	hfa384x_InfFrame_t *scanresults;
110700b3ed16SGreg Kroah-Hartman 
110800b3ed16SGreg Kroah-Hartman 	prism2sta_authlist_t authlist;	/* Authenticated station list. */
1109aaad4303SSolomon Peachy 	unsigned int accessmode;	/* Access mode. */
111000b3ed16SGreg Kroah-Hartman 	prism2sta_accesslist_t allow;	/* Allowed station list. */
111100b3ed16SGreg Kroah-Hartman 	prism2sta_accesslist_t deny;	/* Denied station list. */
111200b3ed16SGreg Kroah-Hartman 
111300b3ed16SGreg Kroah-Hartman } hfa384x_t;
111400b3ed16SGreg Kroah-Hartman 
1115e573aaa4SMoritz Muehlenhoff void hfa384x_create(hfa384x_t *hw, struct usb_device *usb);
111600b3ed16SGreg Kroah-Hartman void hfa384x_destroy(hfa384x_t *hw);
111700b3ed16SGreg Kroah-Hartman 
111800b3ed16SGreg Kroah-Hartman int
111900b3ed16SGreg Kroah-Hartman hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis);
1120e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_commtallies(hfa384x_t *hw);
1121e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_disable(hfa384x_t *hw, u16 macport);
1122e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_enable(hfa384x_t *hw, u16 macport);
1123e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_flashdl_enable(hfa384x_t *hw);
1124e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_flashdl_disable(hfa384x_t *hw);
1125e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_flashdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len);
1126e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_getconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len);
1127e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, u32 exeaddr);
1128e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_ramdl_disable(hfa384x_t *hw);
1129e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_ramdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len);
1130e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len);
1131e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_setconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len);
113200b3ed16SGreg Kroah-Hartman 
1133e573aaa4SMoritz Muehlenhoff static inline int hfa384x_drvr_getconfig16(hfa384x_t *hw, u16 rid, void *val)
113400b3ed16SGreg Kroah-Hartman {
113500b3ed16SGreg Kroah-Hartman 	int result = 0;
1136aaad4303SSolomon Peachy 	result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u16));
1137e573aaa4SMoritz Muehlenhoff 	if (result == 0)
113818c7f792SMoritz Muehlenhoff 		*((u16 *) val) = le16_to_cpu(*((u16 *) val));
113900b3ed16SGreg Kroah-Hartman 	return result;
114000b3ed16SGreg Kroah-Hartman }
114100b3ed16SGreg Kroah-Hartman 
1142e573aaa4SMoritz Muehlenhoff static inline int hfa384x_drvr_setconfig16(hfa384x_t *hw, u16 rid, u16 val)
114300b3ed16SGreg Kroah-Hartman {
114418c7f792SMoritz Muehlenhoff 	u16 value = cpu_to_le16(val);
114500b3ed16SGreg Kroah-Hartman 	return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));
114600b3ed16SGreg Kroah-Hartman }
114700b3ed16SGreg Kroah-Hartman 
114800b3ed16SGreg Kroah-Hartman int
114900b3ed16SGreg Kroah-Hartman hfa384x_drvr_getconfig_async(hfa384x_t *hw,
1150e573aaa4SMoritz Muehlenhoff 			     u16 rid, ctlx_usercb_t usercb, void *usercb_data);
115100b3ed16SGreg Kroah-Hartman 
115200b3ed16SGreg Kroah-Hartman int
115300b3ed16SGreg Kroah-Hartman hfa384x_drvr_setconfig_async(hfa384x_t *hw,
1154aaad4303SSolomon Peachy 			     u16 rid,
115500b3ed16SGreg Kroah-Hartman 			     void *buf,
1156e573aaa4SMoritz Muehlenhoff 			     u16 len, ctlx_usercb_t usercb, void *usercb_data);
115700b3ed16SGreg Kroah-Hartman 
115800b3ed16SGreg Kroah-Hartman static inline int
1159aaad4303SSolomon Peachy hfa384x_drvr_setconfig16_async(hfa384x_t *hw, u16 rid, u16 val)
116000b3ed16SGreg Kroah-Hartman {
116118c7f792SMoritz Muehlenhoff 	u16 value = cpu_to_le16(val);
116200b3ed16SGreg Kroah-Hartman 	return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value),
116300b3ed16SGreg Kroah-Hartman 					    NULL, NULL);
116400b3ed16SGreg Kroah-Hartman }
116500b3ed16SGreg Kroah-Hartman 
1166e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_start(hfa384x_t *hw);
1167e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_stop(hfa384x_t *hw);
116800b3ed16SGreg Kroah-Hartman int
1169e573aaa4SMoritz Muehlenhoff hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb,
1170e573aaa4SMoritz Muehlenhoff 		     p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep);
1171e573aaa4SMoritz Muehlenhoff void hfa384x_tx_timeout(wlandevice_t *wlandev);
117200b3ed16SGreg Kroah-Hartman 
1173e573aaa4SMoritz Muehlenhoff int hfa384x_cmd_initialize(hfa384x_t *hw);
1174e573aaa4SMoritz Muehlenhoff int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport);
1175e573aaa4SMoritz Muehlenhoff int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport);
1176e573aaa4SMoritz Muehlenhoff int hfa384x_cmd_allocate(hfa384x_t *hw, u16 len);
1177e573aaa4SMoritz Muehlenhoff int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable);
117800b3ed16SGreg Kroah-Hartman int
1179e573aaa4SMoritz Muehlenhoff hfa384x_cmd_download(hfa384x_t *hw,
1180e573aaa4SMoritz Muehlenhoff 		     u16 mode, u16 lowaddr, u16 highaddr, u16 codelen);
118100b3ed16SGreg Kroah-Hartman 
118200b3ed16SGreg Kroah-Hartman #endif /* __KERNEL__ */
118300b3ed16SGreg Kroah-Hartman 
118400b3ed16SGreg Kroah-Hartman #endif /* _HFA384x_H */
1185