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 /*=============================================================*/
6000b3ed16SGreg Kroah-Hartman #define HFA384x_FIRMWARE_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
6100b3ed16SGreg Kroah-Hartman 
6200b3ed16SGreg Kroah-Hartman #define HFA384x_LEVEL_TO_dBm(v)   (0x100 + (v) * 100 / 255 - 100)
6300b3ed16SGreg Kroah-Hartman 
6428b17a4bSMoritz Muehlenhoff #include <linux/if_ether.h>
6528b17a4bSMoritz Muehlenhoff 
6600b3ed16SGreg Kroah-Hartman /*------ Constants --------------------------------------------*/
6700b3ed16SGreg Kroah-Hartman /*--- Mins & Maxs -----------------------------------*/
68aaad4303SSolomon Peachy #define		HFA384x_CMD_ALLOC_LEN_MIN	((u16)4)
69aaad4303SSolomon Peachy #define		HFA384x_CMD_ALLOC_LEN_MAX	((u16)2400)
70aaad4303SSolomon Peachy #define		HFA384x_BAP_DATALEN_MAX		((u16)4096)
71aaad4303SSolomon Peachy #define		HFA384x_BAP_OFFSET_MAX		((u16)4096)
72aaad4303SSolomon Peachy #define		HFA384x_PORTID_MAX		((u16)7)
73aaad4303SSolomon Peachy #define		HFA384x_NUMPORTS_MAX		((u16)(HFA384x_PORTID_MAX+1))
74aaad4303SSolomon Peachy #define		HFA384x_PDR_LEN_MAX		((u16)512)	/* in bytes, from EK */
75aaad4303SSolomon Peachy #define		HFA384x_PDA_RECS_MAX		((u16)200)	/* a guess */
76aaad4303SSolomon Peachy #define		HFA384x_PDA_LEN_MAX		((u16)1024)	/* in bytes, from EK */
77aaad4303SSolomon Peachy #define		HFA384x_SCANRESULT_MAX		((u16)31)
78aaad4303SSolomon Peachy #define		HFA384x_HSCANRESULT_MAX		((u16)31)
79aaad4303SSolomon Peachy #define		HFA384x_CHINFORESULT_MAX	((u16)16)
8000b3ed16SGreg Kroah-Hartman #define		HFA384x_DRVR_FIDSTACKLEN_MAX	(10)
8100b3ed16SGreg Kroah-Hartman #define		HFA384x_DRVR_TXBUF_MAX		(sizeof(hfa384x_tx_frame_t) + \
8200b3ed16SGreg Kroah-Hartman 						WLAN_DATA_MAXLEN - \
8300b3ed16SGreg Kroah-Hartman 						WLAN_WEP_IV_LEN - \
8400b3ed16SGreg Kroah-Hartman 						WLAN_WEP_ICV_LEN + 2)
8500b3ed16SGreg Kroah-Hartman #define		HFA384x_DRVR_MAGIC		(0x4a2d)
8600b3ed16SGreg Kroah-Hartman #define		HFA384x_INFODATA_MAXLEN		(sizeof(hfa384x_infodata_t))
8700b3ed16SGreg Kroah-Hartman #define		HFA384x_INFOFRM_MAXLEN		(sizeof(hfa384x_InfFrame_t))
8800b3ed16SGreg Kroah-Hartman #define		HFA384x_RID_GUESSING_MAXLEN	2048  /* I'm not really sure */
8900b3ed16SGreg Kroah-Hartman #define		HFA384x_RIDDATA_MAXLEN		HFA384x_RID_GUESSING_MAXLEN
9000b3ed16SGreg Kroah-Hartman #define		HFA384x_USB_RWMEM_MAXLEN	2048
9100b3ed16SGreg Kroah-Hartman 
9200b3ed16SGreg Kroah-Hartman /*--- Support Constants -----------------------------*/
93aaad4303SSolomon Peachy #define		HFA384x_BAP_PROC			((u16)0)
94aaad4303SSolomon Peachy #define		HFA384x_BAP_int				((u16)1)
95aaad4303SSolomon Peachy #define		HFA384x_PORTTYPE_IBSS			((u16)0)
96aaad4303SSolomon Peachy #define		HFA384x_PORTTYPE_BSS			((u16)1)
97aaad4303SSolomon Peachy #define		HFA384x_PORTTYPE_WDS			((u16)2)
98aaad4303SSolomon Peachy #define		HFA384x_PORTTYPE_PSUEDOIBSS		((u16)3)
99aaad4303SSolomon Peachy #define		HFA384x_PORTTYPE_HOSTAP    		((u16)6)
100aaad4303SSolomon Peachy #define		HFA384x_WEPFLAGS_PRIVINVOKED		((u16)BIT0)
101aaad4303SSolomon Peachy #define		HFA384x_WEPFLAGS_EXCLUDE		((u16)BIT1)
102aaad4303SSolomon Peachy #define		HFA384x_WEPFLAGS_DISABLE_TXCRYPT	((u16)BIT4)
103aaad4303SSolomon Peachy #define		HFA384x_WEPFLAGS_DISABLE_RXCRYPT	((u16)BIT7)
104aaad4303SSolomon Peachy #define		HFA384x_WEPFLAGS_DISALLOW_MIXED 	((u16)BIT11)
105aaad4303SSolomon Peachy #define		HFA384x_WEPFLAGS_IV_intERVAL1		((u16)0)
106aaad4303SSolomon Peachy #define		HFA384x_WEPFLAGS_IV_intERVAL10		((u16)BIT5)
107aaad4303SSolomon Peachy #define		HFA384x_WEPFLAGS_IV_intERVAL50		((u16)BIT6)
108aaad4303SSolomon Peachy #define		HFA384x_WEPFLAGS_IV_intERVAL100		((u16)(BIT5 | BIT6))
109aaad4303SSolomon Peachy #define		HFA384x_WEPFLAGS_FIRMWARE_WPA  		((u16)BIT8)
110aaad4303SSolomon Peachy #define		HFA384x_WEPFLAGS_HOST_MIC      		((u16)BIT9)
111aaad4303SSolomon Peachy #define 	HFA384x_ROAMMODE_FWSCAN_FWROAM		((u16)1)
112aaad4303SSolomon Peachy #define 	HFA384x_ROAMMODE_FWSCAN_HOSTROAM	((u16)2)
113aaad4303SSolomon Peachy #define 	HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM	((u16)3)
114aaad4303SSolomon Peachy #define 	HFA384x_PORTSTATUS_DISABLED		((u16)1)
115aaad4303SSolomon Peachy #define 	HFA384x_PORTSTATUS_INITSRCH		((u16)2)
116aaad4303SSolomon Peachy #define 	HFA384x_PORTSTATUS_CONN_IBSS		((u16)3)
117aaad4303SSolomon Peachy #define 	HFA384x_PORTSTATUS_CONN_ESS		((u16)4)
118aaad4303SSolomon Peachy #define 	HFA384x_PORTSTATUS_OOR_ESS		((u16)5)
119aaad4303SSolomon Peachy #define 	HFA384x_PORTSTATUS_CONN_WDS		((u16)6)
120aaad4303SSolomon Peachy #define 	HFA384x_PORTSTATUS_HOSTAP		((u16)8)
121aaad4303SSolomon Peachy #define		HFA384x_RATEBIT_1			((u16)1)
122aaad4303SSolomon Peachy #define		HFA384x_RATEBIT_2			((u16)2)
123aaad4303SSolomon Peachy #define		HFA384x_RATEBIT_5dot5			((u16)4)
124aaad4303SSolomon Peachy #define		HFA384x_RATEBIT_11			((u16)8)
12500b3ed16SGreg Kroah-Hartman 
12600b3ed16SGreg Kroah-Hartman /*--- Just some symbolic names for legibility -------*/
127aaad4303SSolomon Peachy #define		HFA384x_TXCMD_NORECL		((u16)0)
128aaad4303SSolomon Peachy #define		HFA384x_TXCMD_RECL		((u16)1)
12900b3ed16SGreg Kroah-Hartman 
13000b3ed16SGreg Kroah-Hartman /*--- MAC Internal memory constants and macros ------*/
13100b3ed16SGreg Kroah-Hartman /* masks and macros used to manipulate MAC internal memory addresses. */
13200b3ed16SGreg Kroah-Hartman /* MAC internal memory addresses are 23 bit quantities.  The MAC uses
13300b3ed16SGreg Kroah-Hartman  * a paged address space where the upper 16 bits are the page number
13400b3ed16SGreg Kroah-Hartman  * and the lower 7 bits are the offset.  There are various Host API
13500b3ed16SGreg Kroah-Hartman  * elements that require two 16-bit quantities to specify a MAC
13600b3ed16SGreg Kroah-Hartman  * internal memory address.  Unfortunately, some of the API's use a
13700b3ed16SGreg Kroah-Hartman  * page/offset format where the offset value is JUST the lower seven
13800b3ed16SGreg Kroah-Hartman  * bits and the page is  the remaining 16 bits.  Some of the API's
13900b3ed16SGreg Kroah-Hartman  * assume that the 23 bit address has been split at the 16th bit.  We
14000b3ed16SGreg Kroah-Hartman  * refer to these two formats as AUX format and CMD format.  The
14100b3ed16SGreg Kroah-Hartman  * macros below help handle some of this.
14200b3ed16SGreg Kroah-Hartman  */
14300b3ed16SGreg Kroah-Hartman 
14400b3ed16SGreg Kroah-Hartman /* Handy constant */
145aaad4303SSolomon Peachy #define		HFA384x_ADDR_AUX_OFF_MAX	((u16)0x007f)
14600b3ed16SGreg Kroah-Hartman 
14700b3ed16SGreg Kroah-Hartman /* Mask bits for discarding unwanted pieces in a flat address */
14800b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_FLAT_AUX_PAGE_MASK	(0x007fff80)
14900b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_FLAT_AUX_OFF_MASK	(0x0000007f)
15000b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_FLAT_CMD_PAGE_MASK	(0xffff0000)
15100b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_FLAT_CMD_OFF_MASK	(0x0000ffff)
15200b3ed16SGreg Kroah-Hartman 
15300b3ed16SGreg Kroah-Hartman /* Mask bits for discarding unwanted pieces in AUX format 16-bit address parts */
15400b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_AUX_PAGE_MASK	(0xffff)
15500b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_AUX_OFF_MASK	(0x007f)
15600b3ed16SGreg Kroah-Hartman 
15700b3ed16SGreg Kroah-Hartman /* Mask bits for discarding unwanted pieces in CMD format 16-bit address parts */
15800b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_CMD_PAGE_MASK	(0x007f)
15900b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_CMD_OFF_MASK	(0xffff)
16000b3ed16SGreg Kroah-Hartman 
16100b3ed16SGreg Kroah-Hartman /* Make a 32-bit flat address from AUX format 16-bit page and offset */
16200b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_AUX_MKFLAT(p,o)	\
163aaad4303SSolomon Peachy 		(((u32)(((u16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) <<7) | \
164aaad4303SSolomon Peachy 		((u32)(((u16)(o))&HFA384x_ADDR_AUX_OFF_MASK))
16500b3ed16SGreg Kroah-Hartman 
16600b3ed16SGreg Kroah-Hartman /* Make a 32-bit flat address from CMD format 16-bit page and offset */
16700b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_CMD_MKFLAT(p,o)	\
168aaad4303SSolomon Peachy 		(((u32)(((u16)(p))&HFA384x_ADDR_CMD_PAGE_MASK)) <<16) | \
169aaad4303SSolomon Peachy 		((u32)(((u16)(o))&HFA384x_ADDR_CMD_OFF_MASK))
17000b3ed16SGreg Kroah-Hartman 
17100b3ed16SGreg Kroah-Hartman /* Make AUX format offset and page from a 32-bit flat address */
17200b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_AUX_MKPAGE(f) \
173aaad4303SSolomon Peachy 		((u16)((((u32)(f))&HFA384x_ADDR_FLAT_AUX_PAGE_MASK)>>7))
17400b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_AUX_MKOFF(f) \
175aaad4303SSolomon Peachy 		((u16)(((u32)(f))&HFA384x_ADDR_FLAT_AUX_OFF_MASK))
17600b3ed16SGreg Kroah-Hartman 
17700b3ed16SGreg Kroah-Hartman /* Make CMD format offset and page from a 32-bit flat address */
17800b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_CMD_MKPAGE(f) \
179aaad4303SSolomon Peachy 		((u16)((((u32)(f))&HFA384x_ADDR_FLAT_CMD_PAGE_MASK)>>16))
18000b3ed16SGreg Kroah-Hartman #define		HFA384x_ADDR_CMD_MKOFF(f) \
181aaad4303SSolomon Peachy 		((u16)(((u32)(f))&HFA384x_ADDR_FLAT_CMD_OFF_MASK))
18200b3ed16SGreg Kroah-Hartman 
18300b3ed16SGreg Kroah-Hartman /*--- Aux register masks/tests ----------------------*/
18400b3ed16SGreg Kroah-Hartman /* Some of the upper bits of the AUX offset register are used to */
18500b3ed16SGreg Kroah-Hartman /*  select address space. */
18600b3ed16SGreg Kroah-Hartman #define		HFA384x_AUX_CTL_EXTDS	(0x00)
18700b3ed16SGreg Kroah-Hartman #define		HFA384x_AUX_CTL_NV	(0x01)
18800b3ed16SGreg Kroah-Hartman #define		HFA384x_AUX_CTL_PHY	(0x02)
18900b3ed16SGreg Kroah-Hartman #define		HFA384x_AUX_CTL_ICSRAM	(0x03)
19000b3ed16SGreg Kroah-Hartman 
19100b3ed16SGreg Kroah-Hartman /* Make AUX register offset and page values from a flat address */
19200b3ed16SGreg Kroah-Hartman #define		HFA384x_AUX_MKOFF(f, c) \
193aaad4303SSolomon Peachy 	(HFA384x_ADDR_AUX_MKOFF(f) | (((u16)(c))<<12))
19400b3ed16SGreg Kroah-Hartman #define		HFA384x_AUX_MKPAGE(f)	HFA384x_ADDR_AUX_MKPAGE(f)
19500b3ed16SGreg Kroah-Hartman 
19600b3ed16SGreg Kroah-Hartman 
19700b3ed16SGreg Kroah-Hartman /*--- Controller Memory addresses -------------------*/
19800b3ed16SGreg Kroah-Hartman #define		HFA3842_PDA_BASE	(0x007f0000UL)
19900b3ed16SGreg Kroah-Hartman #define		HFA3841_PDA_BASE	(0x003f0000UL)
20000b3ed16SGreg Kroah-Hartman #define		HFA3841_PDA_BOGUS_BASE	(0x00390000UL)
20100b3ed16SGreg Kroah-Hartman 
20200b3ed16SGreg Kroah-Hartman /*--- Driver Download states  -----------------------*/
20300b3ed16SGreg Kroah-Hartman #define		HFA384x_DLSTATE_DISABLED		0
20400b3ed16SGreg Kroah-Hartman #define		HFA384x_DLSTATE_RAMENABLED		1
20500b3ed16SGreg Kroah-Hartman #define		HFA384x_DLSTATE_FLASHENABLED		2
20600b3ed16SGreg Kroah-Hartman #define		HFA384x_DLSTATE_FLASHWRITTEN		3
20700b3ed16SGreg Kroah-Hartman #define		HFA384x_DLSTATE_FLASHWRITEPENDING	4
20800b3ed16SGreg Kroah-Hartman #define		HFA384x_DLSTATE_GENESIS 		5
20900b3ed16SGreg Kroah-Hartman 
21000b3ed16SGreg Kroah-Hartman #define		HFA384x_CMD_OFF			(0x00)
21100b3ed16SGreg Kroah-Hartman #define		HFA384x_PARAM0_OFF		(0x04)
21200b3ed16SGreg Kroah-Hartman #define		HFA384x_PARAM1_OFF		(0x08)
21300b3ed16SGreg Kroah-Hartman #define		HFA384x_PARAM2_OFF		(0x0c)
21400b3ed16SGreg Kroah-Hartman #define		HFA384x_STATUS_OFF		(0x10)
21500b3ed16SGreg Kroah-Hartman #define		HFA384x_RESP0_OFF		(0x14)
21600b3ed16SGreg Kroah-Hartman #define		HFA384x_RESP1_OFF		(0x18)
21700b3ed16SGreg Kroah-Hartman #define		HFA384x_RESP2_OFF		(0x1c)
21800b3ed16SGreg Kroah-Hartman #define		HFA384x_INFOFID_OFF		(0x20)
21900b3ed16SGreg Kroah-Hartman #define		HFA384x_RXFID_OFF		(0x40)
22000b3ed16SGreg Kroah-Hartman #define		HFA384x_ALLOCFID_OFF		(0x44)
22100b3ed16SGreg Kroah-Hartman #define		HFA384x_TXCOMPLFID_OFF		(0x48)
22200b3ed16SGreg Kroah-Hartman #define		HFA384x_SELECT0_OFF		(0x30)
22300b3ed16SGreg Kroah-Hartman #define		HFA384x_OFFSET0_OFF		(0x38)
22400b3ed16SGreg Kroah-Hartman #define		HFA384x_DATA0_OFF		(0x6c)
22500b3ed16SGreg Kroah-Hartman #define		HFA384x_SELECT1_OFF		(0x34)
22600b3ed16SGreg Kroah-Hartman #define		HFA384x_OFFSET1_OFF		(0x3c)
22700b3ed16SGreg Kroah-Hartman #define		HFA384x_DATA1_OFF		(0x70)
22800b3ed16SGreg Kroah-Hartman #define		HFA384x_EVSTAT_OFF		(0x60)
229aaad4303SSolomon Peachy #define		HFA384x_intEN_OFF		(0x64)
23000b3ed16SGreg Kroah-Hartman #define		HFA384x_EVACK_OFF		(0x68)
23100b3ed16SGreg Kroah-Hartman #define		HFA384x_CONTROL_OFF		(0x28)
23200b3ed16SGreg Kroah-Hartman #define		HFA384x_SWSUPPORT0_OFF		(0x50)
23300b3ed16SGreg Kroah-Hartman #define		HFA384x_SWSUPPORT1_OFF		(0x54)
23400b3ed16SGreg Kroah-Hartman #define		HFA384x_SWSUPPORT2_OFF		(0x58)
23500b3ed16SGreg Kroah-Hartman #define		HFA384x_AUXPAGE_OFF		(0x74)
23600b3ed16SGreg Kroah-Hartman #define		HFA384x_AUXOFFSET_OFF		(0x78)
23700b3ed16SGreg Kroah-Hartman #define		HFA384x_AUXDATA_OFF		(0x7c)
23800b3ed16SGreg Kroah-Hartman #define		HFA384x_PCICOR_OFF		(0x4c)
23900b3ed16SGreg Kroah-Hartman #define		HFA384x_PCIHCR_OFF		(0x5c)
24000b3ed16SGreg Kroah-Hartman #define		HFA384x_PCI_M0_ADDRH_OFF	(0x80)
24100b3ed16SGreg Kroah-Hartman #define		HFA384x_PCI_M0_ADDRL_OFF	(0x84)
24200b3ed16SGreg Kroah-Hartman #define		HFA384x_PCI_M0_LEN_OFF		(0x88)
24300b3ed16SGreg Kroah-Hartman #define		HFA384x_PCI_M0_CTL_OFF		(0x8c)
24400b3ed16SGreg Kroah-Hartman #define		HFA384x_PCI_STATUS_OFF		(0x98)
24500b3ed16SGreg Kroah-Hartman #define		HFA384x_PCI_M1_ADDRH_OFF	(0xa0)
24600b3ed16SGreg Kroah-Hartman #define		HFA384x_PCI_M1_ADDRL_OFF	(0xa4)
24700b3ed16SGreg Kroah-Hartman #define		HFA384x_PCI_M1_LEN_OFF		(0xa8)
24800b3ed16SGreg Kroah-Hartman #define		HFA384x_PCI_M1_CTL_OFF		(0xac)
24900b3ed16SGreg Kroah-Hartman 
25000b3ed16SGreg Kroah-Hartman /*--- Register Field Masks --------------------------*/
251aaad4303SSolomon Peachy #define		HFA384x_CMD_BUSY		((u16)BIT15)
252aaad4303SSolomon Peachy #define		HFA384x_CMD_AINFO		((u16)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8))
253aaad4303SSolomon Peachy #define		HFA384x_CMD_MACPORT		((u16)(BIT10 | BIT9 | BIT8))
254aaad4303SSolomon Peachy #define		HFA384x_CMD_RECL		((u16)BIT8)
255aaad4303SSolomon Peachy #define		HFA384x_CMD_WRITE		((u16)BIT8)
256aaad4303SSolomon Peachy #define		HFA384x_CMD_PROGMODE		((u16)(BIT9 | BIT8))
257aaad4303SSolomon Peachy #define		HFA384x_CMD_CMDCODE		((u16)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0))
25800b3ed16SGreg Kroah-Hartman 
259aaad4303SSolomon Peachy #define		HFA384x_STATUS_RESULT		((u16)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8))
260aaad4303SSolomon Peachy #define		HFA384x_STATUS_CMDCODE		((u16)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0))
26100b3ed16SGreg Kroah-Hartman 
262aaad4303SSolomon Peachy #define		HFA384x_OFFSET_BUSY		((u16)BIT15)
263aaad4303SSolomon Peachy #define		HFA384x_OFFSET_ERR		((u16)BIT14)
264aaad4303SSolomon Peachy #define		HFA384x_OFFSET_DATAOFF		((u16)(BIT11 | BIT10 | BIT9 | BIT8 | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1))
26500b3ed16SGreg Kroah-Hartman 
266aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_TICK		((u16)BIT15)
267aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_WTERR		((u16)BIT14)
268aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_INFDROP		((u16)BIT13)
269aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_INFO		((u16)BIT7)
270aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_DTIM		((u16)BIT5)
271aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_CMD		((u16)BIT4)
272aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_ALLOC		((u16)BIT3)
273aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_TXEXC		((u16)BIT2)
274aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_TX		((u16)BIT1)
275aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_RX		((u16)BIT0)
27600b3ed16SGreg Kroah-Hartman 
277aaad4303SSolomon Peachy #define         HFA384x_int_BAP_OP           (HFA384x_EVSTAT_INFO|HFA384x_EVSTAT_RX|HFA384x_EVSTAT_TX|HFA384x_EVSTAT_TXEXC)
27800b3ed16SGreg Kroah-Hartman 
279aaad4303SSolomon Peachy #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)
28000b3ed16SGreg Kroah-Hartman 
281aaad4303SSolomon Peachy #define		HFA384x_intEN_TICK		((u16)BIT15)
282aaad4303SSolomon Peachy #define		HFA384x_intEN_WTERR		((u16)BIT14)
283aaad4303SSolomon Peachy #define		HFA384x_intEN_INFDROP		((u16)BIT13)
284aaad4303SSolomon Peachy #define		HFA384x_intEN_INFO		((u16)BIT7)
285aaad4303SSolomon Peachy #define		HFA384x_intEN_DTIM		((u16)BIT5)
286aaad4303SSolomon Peachy #define		HFA384x_intEN_CMD		((u16)BIT4)
287aaad4303SSolomon Peachy #define		HFA384x_intEN_ALLOC		((u16)BIT3)
288aaad4303SSolomon Peachy #define		HFA384x_intEN_TXEXC		((u16)BIT2)
289aaad4303SSolomon Peachy #define		HFA384x_intEN_TX		((u16)BIT1)
290aaad4303SSolomon Peachy #define		HFA384x_intEN_RX		((u16)BIT0)
29100b3ed16SGreg Kroah-Hartman 
292aaad4303SSolomon Peachy #define		HFA384x_EVACK_TICK		((u16)BIT15)
293aaad4303SSolomon Peachy #define		HFA384x_EVACK_WTERR		((u16)BIT14)
294aaad4303SSolomon Peachy #define		HFA384x_EVACK_INFDROP		((u16)BIT13)
295aaad4303SSolomon Peachy #define		HFA384x_EVACK_INFO		((u16)BIT7)
296aaad4303SSolomon Peachy #define		HFA384x_EVACK_DTIM		((u16)BIT5)
297aaad4303SSolomon Peachy #define		HFA384x_EVACK_CMD		((u16)BIT4)
298aaad4303SSolomon Peachy #define		HFA384x_EVACK_ALLOC		((u16)BIT3)
299aaad4303SSolomon Peachy #define		HFA384x_EVACK_TXEXC		((u16)BIT2)
300aaad4303SSolomon Peachy #define		HFA384x_EVACK_TX		((u16)BIT1)
301aaad4303SSolomon Peachy #define		HFA384x_EVACK_RX		((u16)BIT0)
30200b3ed16SGreg Kroah-Hartman 
303aaad4303SSolomon Peachy #define		HFA384x_CONTROL_AUXEN		((u16)(BIT15 | BIT14))
30400b3ed16SGreg Kroah-Hartman 
30500b3ed16SGreg Kroah-Hartman 
30600b3ed16SGreg Kroah-Hartman /*--- Command Code Constants --------------------------*/
30700b3ed16SGreg Kroah-Hartman /*--- Controller Commands --------------------------*/
308aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_INIT		((u16)0x00)
309aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_ENABLE		((u16)0x01)
310aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_DISABLE		((u16)0x02)
311aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_DIAG		((u16)0x03)
31200b3ed16SGreg Kroah-Hartman 
31300b3ed16SGreg Kroah-Hartman /*--- Buffer Mgmt Commands --------------------------*/
314aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_ALLOC		((u16)0x0A)
315aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_TX		((u16)0x0B)
316aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_CLRPRST		((u16)0x12)
31700b3ed16SGreg Kroah-Hartman 
31800b3ed16SGreg Kroah-Hartman /*--- Regulate Commands --------------------------*/
319aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_NOTIFY		((u16)0x10)
320aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_INQ		((u16)0x11)
32100b3ed16SGreg Kroah-Hartman 
32200b3ed16SGreg Kroah-Hartman /*--- Configure Commands --------------------------*/
323aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_ACCESS		((u16)0x21)
324aaad4303SSolomon Peachy #define		HFA384x_CMDCODE_DOWNLD		((u16)0x22)
32500b3ed16SGreg Kroah-Hartman 
32600b3ed16SGreg Kroah-Hartman /*--- Debugging Commands -----------------------------*/
327aaad4303SSolomon Peachy #define 	HFA384x_CMDCODE_MONITOR		((u16)(0x38))
328aaad4303SSolomon Peachy #define		HFA384x_MONITOR_ENABLE		((u16)(0x0b))
329aaad4303SSolomon Peachy #define		HFA384x_MONITOR_DISABLE		((u16)(0x0f))
33000b3ed16SGreg Kroah-Hartman 
33100b3ed16SGreg Kroah-Hartman /*--- Result Codes --------------------------*/
332aaad4303SSolomon Peachy #define		HFA384x_SUCCESS			((u16)(0x00))
333aaad4303SSolomon Peachy #define		HFA384x_CARD_FAIL		((u16)(0x01))
334aaad4303SSolomon Peachy #define		HFA384x_NO_BUFF			((u16)(0x05))
335aaad4303SSolomon Peachy #define		HFA384x_CMD_ERR			((u16)(0x7F))
33600b3ed16SGreg Kroah-Hartman 
33700b3ed16SGreg Kroah-Hartman /*--- Programming Modes --------------------------
33800b3ed16SGreg Kroah-Hartman 	MODE 0: Disable programming
33900b3ed16SGreg Kroah-Hartman 	MODE 1: Enable volatile memory programming
34000b3ed16SGreg Kroah-Hartman 	MODE 2: Enable non-volatile memory programming
34100b3ed16SGreg Kroah-Hartman 	MODE 3: Program non-volatile memory section
34200b3ed16SGreg Kroah-Hartman --------------------------------------------------*/
343aaad4303SSolomon Peachy #define		HFA384x_PROGMODE_DISABLE	((u16)0x00)
344aaad4303SSolomon Peachy #define		HFA384x_PROGMODE_RAM		((u16)0x01)
345aaad4303SSolomon Peachy #define		HFA384x_PROGMODE_NV		((u16)0x02)
346aaad4303SSolomon Peachy #define		HFA384x_PROGMODE_NVWRITE	((u16)0x03)
34700b3ed16SGreg Kroah-Hartman 
34800b3ed16SGreg Kroah-Hartman /*--- AUX register enable --------------------------*/
349aaad4303SSolomon Peachy #define		HFA384x_AUXPW0			((u16)0xfe01)
350aaad4303SSolomon Peachy #define		HFA384x_AUXPW1			((u16)0xdc23)
351aaad4303SSolomon Peachy #define		HFA384x_AUXPW2			((u16)0xba45)
35200b3ed16SGreg Kroah-Hartman 
353aaad4303SSolomon Peachy #define		HFA384x_CONTROL_AUX_ISDISABLED	((u16)0x0000)
354aaad4303SSolomon Peachy #define		HFA384x_CONTROL_AUX_ISENABLED	((u16)0xc000)
355aaad4303SSolomon Peachy #define		HFA384x_CONTROL_AUX_DOENABLE	((u16)0x8000)
356aaad4303SSolomon Peachy #define		HFA384x_CONTROL_AUX_DODISABLE	((u16)0x4000)
35700b3ed16SGreg Kroah-Hartman 
35800b3ed16SGreg Kroah-Hartman /*--- Record ID Constants --------------------------*/
35900b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
36000b3ed16SGreg Kroah-Hartman Configuration RIDs: Network Parameters, Static Configuration Entities
36100b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
362aaad4303SSolomon Peachy #define		HFA384x_RID_CNFPORTTYPE		((u16)0xFC00)
363aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNMACADDR	((u16)0xFC01)
364aaad4303SSolomon Peachy #define		HFA384x_RID_CNFDESIREDSSID	((u16)0xFC02)
365aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNCHANNEL	((u16)0xFC03)
366aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNSSID		((u16)0xFC04)
367aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNATIMWIN	((u16)0xFC05)
368aaad4303SSolomon Peachy #define		HFA384x_RID_CNFSYSSCALE		((u16)0xFC06)
369aaad4303SSolomon Peachy #define		HFA384x_RID_CNFMAXDATALEN	((u16)0xFC07)
370aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWDSADDR		((u16)0xFC08)
371aaad4303SSolomon Peachy #define		HFA384x_RID_CNFPMENABLED	((u16)0xFC09)
372aaad4303SSolomon Peachy #define		HFA384x_RID_CNFPMEPS		((u16)0xFC0A)
373aaad4303SSolomon Peachy #define		HFA384x_RID_CNFMULTICASTRX	((u16)0xFC0B)
374aaad4303SSolomon Peachy #define		HFA384x_RID_CNFMAXSLEEPDUR	((u16)0xFC0C)
375aaad4303SSolomon Peachy #define		HFA384x_RID_CNFPMHOLDDUR	((u16)0xFC0D)
376aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNNAME		((u16)0xFC0E)
377aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNDTIMPER	((u16)0xFC10)
378aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWDSADDR1		((u16)0xFC11)
379aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWDSADDR2		((u16)0xFC12)
380aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWDSADDR3		((u16)0xFC13)
381aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWDSADDR4		((u16)0xFC14)
382aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWDSADDR5		((u16)0xFC15)
383aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWDSADDR6		((u16)0xFC16)
384aaad4303SSolomon Peachy #define		HFA384x_RID_CNFMCASTPMBUFF	((u16)0xFC17)
38500b3ed16SGreg Kroah-Hartman 
38600b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
38700b3ed16SGreg Kroah-Hartman Configuration RID lengths: Network Params, Static Config Entities
38800b3ed16SGreg Kroah-Hartman   This is the length of JUST the DATA part of the RID (does not
38900b3ed16SGreg Kroah-Hartman   include the len or code fields)
39000b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
39100b3ed16SGreg Kroah-Hartman /* TODO: fill in the rest of these */
392aaad4303SSolomon Peachy #define		HFA384x_RID_CNFPORTTYPE_LEN	((u16)2)
393aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNMACADDR_LEN	((u16)6)
394aaad4303SSolomon Peachy #define		HFA384x_RID_CNFDESIREDSSID_LEN	((u16)34)
395aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNCHANNEL_LEN	((u16)2)
396aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNSSID_LEN	((u16)34)
397aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNATIMWIN_LEN	((u16)2)
398aaad4303SSolomon Peachy #define		HFA384x_RID_CNFSYSSCALE_LEN	((u16)0)
399aaad4303SSolomon Peachy #define		HFA384x_RID_CNFMAXDATALEN_LEN	((u16)0)
400aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWDSADDR_LEN	((u16)6)
401aaad4303SSolomon Peachy #define		HFA384x_RID_CNFPMENABLED_LEN	((u16)0)
402aaad4303SSolomon Peachy #define		HFA384x_RID_CNFPMEPS_LEN	((u16)0)
403aaad4303SSolomon Peachy #define		HFA384x_RID_CNFMULTICASTRX_LEN	((u16)0)
404aaad4303SSolomon Peachy #define		HFA384x_RID_CNFMAXSLEEPDUR_LEN	((u16)0)
405aaad4303SSolomon Peachy #define		HFA384x_RID_CNFPMHOLDDUR_LEN	((u16)0)
406aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNNAME_LEN	((u16)34)
407aaad4303SSolomon Peachy #define		HFA384x_RID_CNFOWNDTIMPER_LEN	((u16)0)
408aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWDSADDR1_LEN	((u16)6)
409aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWDSADDR2_LEN	((u16)6)
410aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWDSADDR3_LEN	((u16)6)
411aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWDSADDR4_LEN	((u16)6)
412aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWDSADDR5_LEN	((u16)6)
413aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWDSADDR6_LEN	((u16)6)
414aaad4303SSolomon Peachy #define		HFA384x_RID_CNFMCASTPMBUFF_LEN	((u16)0)
415aaad4303SSolomon Peachy #define		HFA384x_RID_CNFAUTHENTICATION_LEN ((u16)sizeof(u16))
416aaad4303SSolomon Peachy #define		HFA384x_RID_CNFMAXSLEEPDUR_LEN	((u16)0)
41700b3ed16SGreg Kroah-Hartman 
41800b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
41900b3ed16SGreg Kroah-Hartman Configuration RIDs: Network Parameters, Dynamic Configuration Entities
42000b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
421aaad4303SSolomon Peachy #define		HFA384x_RID_GROUPADDR		((u16)0xFC80)
422aaad4303SSolomon Peachy #define		HFA384x_RID_CREATEIBSS		((u16)0xFC81)
423aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH		((u16)0xFC82)
424aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH		((u16)0xFC83)
425aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL		((u16)0xFC84)
426aaad4303SSolomon Peachy #define		HFA384x_RID_PROMISCMODE		((u16)0xFC85)
427aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH0		((u16)0xFC90)
428aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH1		((u16)0xFC91)
429aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH2		((u16)0xFC92)
430aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH3		((u16)0xFC93)
431aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH4		((u16)0xFC94)
432aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH5		((u16)0xFC95)
433aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH6		((u16)0xFC96)
434aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH0		((u16)0xFC97)
435aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH1		((u16)0xFC98)
436aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH2		((u16)0xFC99)
437aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH3		((u16)0xFC9A)
438aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH4		((u16)0xFC9B)
439aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH5		((u16)0xFC9C)
440aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH6		((u16)0xFC9D)
441aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL0		((u16)0xFC9E)
442aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL1		((u16)0xFC9F)
443aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL2		((u16)0xFCA0)
444aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL3		((u16)0xFCA1)
445aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL4		((u16)0xFCA2)
446aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL5		((u16)0xFCA3)
447aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL6		((u16)0xFCA4)
44800b3ed16SGreg Kroah-Hartman 
44900b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
45000b3ed16SGreg Kroah-Hartman Configuration RID Lengths: Network Param, Dynamic Config Entities
45100b3ed16SGreg Kroah-Hartman   This is the length of JUST the DATA part of the RID (does not
45200b3ed16SGreg Kroah-Hartman   include the len or code fields)
45300b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
45400b3ed16SGreg Kroah-Hartman /* TODO: fill in the rest of these */
45528b17a4bSMoritz Muehlenhoff #define		HFA384x_RID_GROUPADDR_LEN	((u16)16 * ETH_ALEN)
456aaad4303SSolomon Peachy #define		HFA384x_RID_CREATEIBSS_LEN	((u16)0)
457aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH_LEN	((u16)0)
458aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH_LEN	((u16)0)
459aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL_LEN	((u16)4)
460aaad4303SSolomon Peachy #define		HFA384x_RID_PROMISCMODE_LEN	((u16)2)
461aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH0_LEN	((u16)0)
462aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH1_LEN	((u16)0)
463aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH2_LEN	((u16)0)
464aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH3_LEN	((u16)0)
465aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH4_LEN	((u16)0)
466aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH5_LEN	((u16)0)
467aaad4303SSolomon Peachy #define		HFA384x_RID_FRAGTHRESH6_LEN	((u16)0)
468aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH0_LEN	((u16)0)
469aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH1_LEN	((u16)0)
470aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH2_LEN	((u16)0)
471aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH3_LEN	((u16)0)
472aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH4_LEN	((u16)0)
473aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH5_LEN	((u16)0)
474aaad4303SSolomon Peachy #define		HFA384x_RID_RTSTHRESH6_LEN	((u16)0)
475aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL0_LEN	((u16)0)
476aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL1_LEN	((u16)0)
477aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL2_LEN	((u16)0)
478aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL3_LEN	((u16)0)
479aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL4_LEN	((u16)0)
480aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL5_LEN	((u16)0)
481aaad4303SSolomon Peachy #define		HFA384x_RID_TXRATECNTL6_LEN	((u16)0)
48200b3ed16SGreg Kroah-Hartman 
48300b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
48400b3ed16SGreg Kroah-Hartman Configuration RIDs: Behavior Parameters
48500b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
486aaad4303SSolomon Peachy #define		HFA384x_RID_ITICKTIME		((u16)0xFCE0)
48700b3ed16SGreg Kroah-Hartman 
48800b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
48900b3ed16SGreg Kroah-Hartman Configuration RID Lengths: Behavior Parameters
49000b3ed16SGreg Kroah-Hartman   This is the length of JUST the DATA part of the RID (does not
49100b3ed16SGreg Kroah-Hartman   include the len or code fields)
49200b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
493aaad4303SSolomon Peachy #define		HFA384x_RID_ITICKTIME_LEN	((u16)2)
49400b3ed16SGreg Kroah-Hartman 
49500b3ed16SGreg Kroah-Hartman /*----------------------------------------------------------------------
49600b3ed16SGreg Kroah-Hartman Information RIDs: NIC Information
49700b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
498aaad4303SSolomon Peachy #define		HFA384x_RID_MAXLOADTIME		((u16)0xFD00)
499aaad4303SSolomon Peachy #define		HFA384x_RID_DOWNLOADBUFFER	((u16)0xFD01)
500aaad4303SSolomon Peachy #define		HFA384x_RID_PRIIDENTITY		((u16)0xFD02)
501aaad4303SSolomon Peachy #define		HFA384x_RID_PRISUPRANGE		((u16)0xFD03)
502aaad4303SSolomon Peachy #define		HFA384x_RID_PRI_CFIACTRANGES	((u16)0xFD04)
503aaad4303SSolomon Peachy #define		HFA384x_RID_NICSERIALNUMBER	((u16)0xFD0A)
504aaad4303SSolomon Peachy #define		HFA384x_RID_NICIDENTITY		((u16)0xFD0B)
505aaad4303SSolomon Peachy #define		HFA384x_RID_MFISUPRANGE		((u16)0xFD0C)
506aaad4303SSolomon Peachy #define		HFA384x_RID_CFISUPRANGE		((u16)0xFD0D)
507aaad4303SSolomon Peachy #define		HFA384x_RID_CHANNELLIST		((u16)0xFD10)
508aaad4303SSolomon Peachy #define		HFA384x_RID_REGULATORYDOMAINS	((u16)0xFD11)
509aaad4303SSolomon Peachy #define		HFA384x_RID_TEMPTYPE		((u16)0xFD12)
510aaad4303SSolomon Peachy #define		HFA384x_RID_CIS			((u16)0xFD13)
511aaad4303SSolomon Peachy #define		HFA384x_RID_STAIDENTITY		((u16)0xFD20)
512aaad4303SSolomon Peachy #define		HFA384x_RID_STASUPRANGE		((u16)0xFD21)
513aaad4303SSolomon Peachy #define		HFA384x_RID_STA_MFIACTRANGES	((u16)0xFD22)
514aaad4303SSolomon Peachy #define		HFA384x_RID_STA_CFIACTRANGES	((u16)0xFD23)
515aaad4303SSolomon Peachy #define		HFA384x_RID_BUILDSEQ		((u16)0xFFFE)
516aaad4303SSolomon Peachy #define		HFA384x_RID_FWID		((u16)0xFFFF)
51700b3ed16SGreg Kroah-Hartman 
51800b3ed16SGreg Kroah-Hartman /*----------------------------------------------------------------------
51900b3ed16SGreg Kroah-Hartman Information RID Lengths: NIC Information
52000b3ed16SGreg Kroah-Hartman   This is the length of JUST the DATA part of the RID (does not
52100b3ed16SGreg Kroah-Hartman   include the len or code fields)
52200b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
523aaad4303SSolomon Peachy #define		HFA384x_RID_MAXLOADTIME_LEN		((u16)0)
524aaad4303SSolomon Peachy #define		HFA384x_RID_DOWNLOADBUFFER_LEN		((u16)sizeof(hfa384x_downloadbuffer_t))
525aaad4303SSolomon Peachy #define		HFA384x_RID_PRIIDENTITY_LEN		((u16)8)
526aaad4303SSolomon Peachy #define		HFA384x_RID_PRISUPRANGE_LEN		((u16)10)
527aaad4303SSolomon Peachy #define		HFA384x_RID_CFIACTRANGES_LEN		((u16)10)
528aaad4303SSolomon Peachy #define		HFA384x_RID_NICSERIALNUMBER_LEN		((u16)12)
529aaad4303SSolomon Peachy #define		HFA384x_RID_NICIDENTITY_LEN		((u16)8)
530aaad4303SSolomon Peachy #define		HFA384x_RID_MFISUPRANGE_LEN		((u16)10)
531aaad4303SSolomon Peachy #define		HFA384x_RID_CFISUPRANGE_LEN		((u16)10)
532aaad4303SSolomon Peachy #define		HFA384x_RID_CHANNELLIST_LEN		((u16)0)
533aaad4303SSolomon Peachy #define		HFA384x_RID_REGULATORYDOMAINS_LEN	((u16)12)
534aaad4303SSolomon Peachy #define		HFA384x_RID_TEMPTYPE_LEN		((u16)0)
535aaad4303SSolomon Peachy #define		HFA384x_RID_CIS_LEN			((u16)480)
536aaad4303SSolomon Peachy #define		HFA384x_RID_STAIDENTITY_LEN		((u16)8)
537aaad4303SSolomon Peachy #define		HFA384x_RID_STASUPRANGE_LEN		((u16)10)
538aaad4303SSolomon Peachy #define		HFA384x_RID_MFIACTRANGES_LEN		((u16)10)
539aaad4303SSolomon Peachy #define		HFA384x_RID_CFIACTRANGES2_LEN		((u16)10)
540aaad4303SSolomon Peachy #define		HFA384x_RID_BUILDSEQ_LEN		((u16)sizeof(hfa384x_BuildSeq_t))
541aaad4303SSolomon Peachy #define		HFA384x_RID_FWID_LEN			((u16)sizeof(hfa384x_FWID_t))
54200b3ed16SGreg Kroah-Hartman 
54300b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
54400b3ed16SGreg Kroah-Hartman Information RIDs:  MAC Information
54500b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
546aaad4303SSolomon Peachy #define		HFA384x_RID_PORTSTATUS		((u16)0xFD40)
547aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTSSID		((u16)0xFD41)
548aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTBSSID	((u16)0xFD42)
549aaad4303SSolomon Peachy #define		HFA384x_RID_COMMSQUALITY	((u16)0xFD43)
550aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE	((u16)0xFD44)
551aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTBCNint	((u16)0xFD45)
552aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTSCALETHRESH	((u16)0xFD46)
553aaad4303SSolomon Peachy #define		HFA384x_RID_PROTOCOLRSPTIME	((u16)0xFD47)
554aaad4303SSolomon Peachy #define		HFA384x_RID_SHORTRETRYLIMIT	((u16)0xFD48)
555aaad4303SSolomon Peachy #define		HFA384x_RID_LONGRETRYLIMIT	((u16)0xFD49)
556aaad4303SSolomon Peachy #define		HFA384x_RID_MAXTXLIFETIME	((u16)0xFD4A)
557aaad4303SSolomon Peachy #define		HFA384x_RID_MAXRXLIFETIME	((u16)0xFD4B)
558aaad4303SSolomon Peachy #define		HFA384x_RID_CFPOLLABLE		((u16)0xFD4C)
559aaad4303SSolomon Peachy #define		HFA384x_RID_AUTHALGORITHMS	((u16)0xFD4D)
560aaad4303SSolomon Peachy #define		HFA384x_RID_PRIVACYOPTIMP	((u16)0xFD4F)
561aaad4303SSolomon Peachy #define		HFA384x_RID_DBMCOMMSQUALITY	((u16)0xFD51)
562aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE1	((u16)0xFD80)
563aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE2	((u16)0xFD81)
564aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE3	((u16)0xFD82)
565aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE4	((u16)0xFD83)
566aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE5	((u16)0xFD84)
567aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE6	((u16)0xFD85)
568aaad4303SSolomon Peachy #define		HFA384x_RID_OWNMACADDRESS	((u16)0xFD86)
569aaad4303SSolomon Peachy // #define	HFA384x_RID_PCFINFO		((u16)0xFD87)
570aaad4303SSolomon Peachy #define		HFA384x_RID_SCANRESULTS       	((u16)0xFD88) // NEW
571aaad4303SSolomon Peachy #define		HFA384x_RID_HOSTSCANRESULTS   	((u16)0xFD89) // NEW
572aaad4303SSolomon Peachy #define		HFA384x_RID_AUTHENTICATIONUSED	((u16)0xFD8A) // NEW
573aaad4303SSolomon Peachy #define		HFA384x_RID_ASSOCIATEFAILURE  	((u16)0xFD8D) // 1.8.0
57400b3ed16SGreg Kroah-Hartman 
57500b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
57600b3ed16SGreg Kroah-Hartman Information RID Lengths:  MAC Information
57700b3ed16SGreg Kroah-Hartman   This is the length of JUST the DATA part of the RID (does not
57800b3ed16SGreg Kroah-Hartman   include the len or code fields)
57900b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
580aaad4303SSolomon Peachy #define		HFA384x_RID_PORTSTATUS_LEN		((u16)0)
581aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTSSID_LEN		((u16)34)
582aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTBSSID_LEN		((u16)WLAN_BSSID_LEN)
583aaad4303SSolomon Peachy #define		HFA384x_RID_COMMSQUALITY_LEN		((u16)sizeof(hfa384x_commsquality_t))
584aaad4303SSolomon Peachy #define		HFA384x_RID_DBMCOMMSQUALITY_LEN		((u16)sizeof(hfa384x_dbmcommsquality_t))
585aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE_LEN		((u16)0)
586aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTBCNint_LEN		((u16)0)
587aaad4303SSolomon Peachy #define		HFA384x_RID_STACURSCALETHRESH_LEN	((u16)12)
588aaad4303SSolomon Peachy #define		HFA384x_RID_APCURSCALETHRESH_LEN	((u16)6)
589aaad4303SSolomon Peachy #define		HFA384x_RID_PROTOCOLRSPTIME_LEN		((u16)0)
590aaad4303SSolomon Peachy #define		HFA384x_RID_SHORTRETRYLIMIT_LEN		((u16)0)
591aaad4303SSolomon Peachy #define		HFA384x_RID_LONGRETRYLIMIT_LEN		((u16)0)
592aaad4303SSolomon Peachy #define		HFA384x_RID_MAXTXLIFETIME_LEN		((u16)0)
593aaad4303SSolomon Peachy #define		HFA384x_RID_MAXRXLIFETIME_LEN		((u16)0)
594aaad4303SSolomon Peachy #define		HFA384x_RID_CFPOLLABLE_LEN		((u16)0)
595aaad4303SSolomon Peachy #define		HFA384x_RID_AUTHALGORITHMS_LEN		((u16)4)
596aaad4303SSolomon Peachy #define		HFA384x_RID_PRIVACYOPTIMP_LEN		((u16)0)
597aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE1_LEN		((u16)0)
598aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE2_LEN		((u16)0)
599aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE3_LEN		((u16)0)
600aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE4_LEN		((u16)0)
601aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE5_LEN		((u16)0)
602aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTTXRATE6_LEN		((u16)0)
603aaad4303SSolomon Peachy #define		HFA384x_RID_OWNMACADDRESS_LEN		((u16)6)
604aaad4303SSolomon Peachy #define		HFA384x_RID_PCFINFO_LEN			((u16)6)
605aaad4303SSolomon Peachy #define		HFA384x_RID_CNFAPPCFINFO_LEN		((u16)sizeof(hfa384x_PCFInfo_data_t))
606aaad4303SSolomon Peachy #define		HFA384x_RID_SCANREQUEST_LEN		((u16)sizeof(hfa384x_ScanRequest_data_t))
607aaad4303SSolomon Peachy #define		HFA384x_RID_JOINREQUEST_LEN		((u16)sizeof(hfa384x_JoinRequest_data_t))
608aaad4303SSolomon Peachy #define		HFA384x_RID_AUTHENTICATESTA_LEN		((u16)sizeof(hfa384x_authenticateStation_data_t))
609aaad4303SSolomon Peachy #define		HFA384x_RID_CHANNELINFOREQUEST_LEN	((u16)sizeof(hfa384x_ChannelInfoRequest_data_t))
61000b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
61100b3ed16SGreg Kroah-Hartman Information RIDs:  Modem Information
61200b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
613aaad4303SSolomon Peachy #define		HFA384x_RID_PHYTYPE		((u16)0xFDC0)
614aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTCHANNEL	((u16)0xFDC1)
615aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTPOWERSTATE	((u16)0xFDC2)
616aaad4303SSolomon Peachy #define		HFA384x_RID_CCAMODE		((u16)0xFDC3)
617aaad4303SSolomon Peachy #define		HFA384x_RID_SUPPORTEDDATARATES	((u16)0xFDC6)
618aaad4303SSolomon Peachy #define		HFA384x_RID_LFOSTATUS           ((u16)0xFDC7) // 1.7.1
61900b3ed16SGreg Kroah-Hartman 
62000b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
62100b3ed16SGreg Kroah-Hartman Information RID Lengths:  Modem Information
62200b3ed16SGreg Kroah-Hartman   This is the length of JUST the DATA part of the RID (does not
62300b3ed16SGreg Kroah-Hartman   include the len or code fields)
62400b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
625aaad4303SSolomon Peachy #define		HFA384x_RID_PHYTYPE_LEN			((u16)0)
626aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTCHANNEL_LEN		((u16)0)
627aaad4303SSolomon Peachy #define		HFA384x_RID_CURRENTPOWERSTATE_LEN	((u16)0)
628aaad4303SSolomon Peachy #define		HFA384x_RID_CCAMODE_LEN			((u16)0)
629aaad4303SSolomon Peachy #define		HFA384x_RID_SUPPORTEDDATARATES_LEN	((u16)10)
63000b3ed16SGreg Kroah-Hartman 
63100b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
63200b3ed16SGreg Kroah-Hartman API ENHANCEMENTS (NOT ALREADY IMPLEMENTED)
63300b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
634aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPDEFAULTKEYID	((u16)0xFC23)
635aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPDEFAULTKEY0	((u16)0xFC24)
636aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPDEFAULTKEY1	((u16)0xFC25)
637aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPDEFAULTKEY2	((u16)0xFC26)
638aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPDEFAULTKEY3	((u16)0xFC27)
639aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPFLAGS		((u16)0xFC28)
640aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPKEYMAPTABLE	((u16)0xFC29)
641aaad4303SSolomon Peachy #define		HFA384x_RID_CNFAUTHENTICATION	((u16)0xFC2A)
642aaad4303SSolomon Peachy #define		HFA384x_RID_CNFMAXASSOCSTATIONS	((u16)0xFC2B)
643aaad4303SSolomon Peachy #define		HFA384x_RID_CNFTXCONTROL	((u16)0xFC2C)
644aaad4303SSolomon Peachy #define		HFA384x_RID_CNFROAMINGMODE	((u16)0xFC2D)
645aaad4303SSolomon Peachy #define		HFA384x_RID_CNFHOSTAUTHASSOC	((u16)0xFC2E)
646aaad4303SSolomon Peachy #define		HFA384x_RID_CNFRCVCRCERROR	((u16)0xFC30)
647aaad4303SSolomon Peachy // #define		HFA384x_RID_CNFMMLIFE		((u16)0xFC31)
648aaad4303SSolomon Peachy #define		HFA384x_RID_CNFALTRETRYCNT	((u16)0xFC32)
649aaad4303SSolomon Peachy #define		HFA384x_RID_CNFAPBCNint		((u16)0xFC33)
650aaad4303SSolomon Peachy #define		HFA384x_RID_CNFAPPCFINFO	((u16)0xFC34)
651aaad4303SSolomon Peachy #define		HFA384x_RID_CNFSTAPCFINFO	((u16)0xFC35)
652aaad4303SSolomon Peachy #define		HFA384x_RID_CNFPRIORITYQUSAGE	((u16)0xFC37)
653aaad4303SSolomon Peachy #define		HFA384x_RID_CNFTIMCTRL		((u16)0xFC40)
654aaad4303SSolomon Peachy #define		HFA384x_RID_CNFTHIRTY2TALLY	((u16)0xFC42)
655aaad4303SSolomon Peachy #define		HFA384x_RID_CNFENHSECURITY	((u16)0xFC43)
656aaad4303SSolomon Peachy #define		HFA384x_RID_CNFDBMADJUST  	((u16)0xFC46) // NEW
657aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWPADATA       	((u16)0xFC48) // 1.7.0
658aaad4303SSolomon Peachy #define		HFA384x_RID_CNFPROPOGATIONDELAY	((u16)0xFC49) // 1.7.6
659aaad4303SSolomon Peachy #define		HFA384x_RID_CNFSHORTPREAMBLE	((u16)0xFCB0)
660aaad4303SSolomon Peachy #define		HFA384x_RID_CNFEXCLONGPREAMBLE	((u16)0xFCB1)
661aaad4303SSolomon Peachy #define		HFA384x_RID_CNFAUTHRSPTIMEOUT	((u16)0xFCB2)
662aaad4303SSolomon Peachy #define		HFA384x_RID_CNFBASICRATES	((u16)0xFCB3)
663aaad4303SSolomon Peachy #define		HFA384x_RID_CNFSUPPRATES	((u16)0xFCB4)
664aaad4303SSolomon Peachy #define		HFA384x_RID_CNFFALLBACKCTRL	((u16)0xFCB5) // NEW
665aaad4303SSolomon Peachy #define		HFA384x_RID_WEPKEYSTATUS   	((u16)0xFCB6) // NEW
666aaad4303SSolomon Peachy #define		HFA384x_RID_WEPKEYMAPINDEX 	((u16)0xFCB7) // NEW
667aaad4303SSolomon Peachy #define		HFA384x_RID_BROADCASTKEYID 	((u16)0xFCB8) // NEW
668aaad4303SSolomon Peachy #define		HFA384x_RID_ENTSECFLAGEYID 	((u16)0xFCB9) // NEW
669aaad4303SSolomon Peachy #define		HFA384x_RID_CNFPASSIVESCANCTRL	((u16)0xFCBA) // NEW STA
670aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWPAHANDLING	((u16)0xFCBB) // 1.7.0
671aaad4303SSolomon Peachy #define		HFA384x_RID_MDCCONTROL        	((u16)0xFCBC) // 1.7.0/1.4.0
672aaad4303SSolomon Peachy #define		HFA384x_RID_MDCCOUNTRY        	((u16)0xFCBD) // 1.7.0/1.4.0
673aaad4303SSolomon Peachy #define		HFA384x_RID_TXPOWERMAX        	((u16)0xFCBE) // 1.7.0/1.4.0
674aaad4303SSolomon Peachy #define		HFA384x_RID_CNFLFOENBLED      	((u16)0xFCBF) // 1.6.3
675aaad4303SSolomon Peachy #define         HFA384x_RID_CAPINFO             ((u16)0xFCC0) // 1.7.0/1.3.7
676aaad4303SSolomon Peachy #define         HFA384x_RID_LISTENintERVAL      ((u16)0xFCC1) // 1.7.0/1.3.7
677aaad4303SSolomon Peachy #define         HFA384x_RID_DIVERSITYENABLED    ((u16)0xFCC2) // 1.7.0/1.3.7
678aaad4303SSolomon Peachy #define         HFA384x_RID_LED_CONTROL         ((u16)0xFCC4) // 1.7.6
679aaad4303SSolomon Peachy #define         HFA384x_RID_HFO_DELAY           ((u16)0xFCC5) // 1.7.6
680aaad4303SSolomon Peachy #define         HFA384x_RID_DISSALOWEDBSSID     ((u16)0xFCC6) // 1.8.0
681aaad4303SSolomon Peachy #define		HFA384x_RID_SCANREQUEST		((u16)0xFCE1)
682aaad4303SSolomon Peachy #define		HFA384x_RID_JOINREQUEST		((u16)0xFCE2)
683aaad4303SSolomon Peachy #define		HFA384x_RID_AUTHENTICATESTA	((u16)0xFCE3)
684aaad4303SSolomon Peachy #define		HFA384x_RID_CHANNELINFOREQUEST	((u16)0xFCE4)
685aaad4303SSolomon Peachy #define		HFA384x_RID_HOSTSCAN          	((u16)0xFCE5) // NEW STA
686aaad4303SSolomon Peachy #define		HFA384x_RID_ASSOCIATESTA	((u16)0xFCE6)
68700b3ed16SGreg Kroah-Hartman 
688aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEPDEFAULTKEY_LEN	((u16)6)
689aaad4303SSolomon Peachy #define		HFA384x_RID_CNFWEP128DEFAULTKEY_LEN	((u16)14)
690aaad4303SSolomon Peachy #define		HFA384x_RID_CNFPRIOQUSAGE_LEN		((u16)4)
69100b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
69200b3ed16SGreg Kroah-Hartman PD Record codes
69300b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
694aaad4303SSolomon Peachy #define HFA384x_PDR_PCB_PARTNUM		((u16)0x0001)
695aaad4303SSolomon Peachy #define HFA384x_PDR_PDAVER		((u16)0x0002)
696aaad4303SSolomon Peachy #define HFA384x_PDR_NIC_SERIAL		((u16)0x0003)
697aaad4303SSolomon Peachy #define HFA384x_PDR_MKK_MEASUREMENTS	((u16)0x0004)
698aaad4303SSolomon Peachy #define HFA384x_PDR_NIC_RAMSIZE		((u16)0x0005)
699aaad4303SSolomon Peachy #define HFA384x_PDR_MFISUPRANGE		((u16)0x0006)
700aaad4303SSolomon Peachy #define HFA384x_PDR_CFISUPRANGE		((u16)0x0007)
701aaad4303SSolomon Peachy #define HFA384x_PDR_NICID		((u16)0x0008)
702aaad4303SSolomon Peachy //#define HFA384x_PDR_REFDAC_MEASUREMENTS	((u16)0x0010)
703aaad4303SSolomon Peachy //#define HFA384x_PDR_VGDAC_MEASUREMENTS	((u16)0x0020)
704aaad4303SSolomon Peachy //#define HFA384x_PDR_LEVEL_COMP_MEASUREMENTS	((u16)0x0030)
705aaad4303SSolomon Peachy //#define HFA384x_PDR_MODEM_TRIMDAC_MEASUREMENTS	((u16)0x0040)
706aaad4303SSolomon Peachy //#define HFA384x_PDR_COREGA_HACK		((u16)0x00ff)
707aaad4303SSolomon Peachy #define HFA384x_PDR_MAC_ADDRESS		((u16)0x0101)
708aaad4303SSolomon Peachy //#define HFA384x_PDR_MKK_CALLNAME	((u16)0x0102)
709aaad4303SSolomon Peachy #define HFA384x_PDR_REGDOMAIN		((u16)0x0103)
710aaad4303SSolomon Peachy #define HFA384x_PDR_ALLOWED_CHANNEL	((u16)0x0104)
711aaad4303SSolomon Peachy #define HFA384x_PDR_DEFAULT_CHANNEL	((u16)0x0105)
712aaad4303SSolomon Peachy //#define HFA384x_PDR_PRIVACY_OPTION	((u16)0x0106)
713aaad4303SSolomon Peachy #define HFA384x_PDR_TEMPTYPE		((u16)0x0107)
714aaad4303SSolomon Peachy //#define HFA384x_PDR_REFDAC_SETUP	((u16)0x0110)
715aaad4303SSolomon Peachy //#define HFA384x_PDR_VGDAC_SETUP		((u16)0x0120)
716aaad4303SSolomon Peachy //#define HFA384x_PDR_LEVEL_COMP_SETUP	((u16)0x0130)
717aaad4303SSolomon Peachy //#define HFA384x_PDR_TRIMDAC_SETUP	((u16)0x0140)
718aaad4303SSolomon Peachy #define HFA384x_PDR_IFR_SETTING		((u16)0x0200)
719aaad4303SSolomon Peachy #define HFA384x_PDR_RFR_SETTING		((u16)0x0201)
720aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_BASELINE	((u16)0x0202)
721aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_SHADOW	((u16)0x0203)
722aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_IFRF	((u16)0x0204)
723aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_CHCALSP	((u16)0x0300)
724aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_CHCALI	((u16)0x0301)
725aaad4303SSolomon Peachy #define HFA384x_PDR_MAX_TX_POWER  	((u16)0x0302)
726aaad4303SSolomon Peachy #define HFA384x_PDR_MASTER_CHAN_LIST	((u16)0x0303)
727aaad4303SSolomon Peachy #define HFA384x_PDR_3842_NIC_CONFIG	((u16)0x0400)
728aaad4303SSolomon Peachy #define HFA384x_PDR_USB_ID		((u16)0x0401)
729aaad4303SSolomon Peachy #define HFA384x_PDR_PCI_ID		((u16)0x0402)
730aaad4303SSolomon Peachy #define HFA384x_PDR_PCI_IFCONF		((u16)0x0403)
731aaad4303SSolomon Peachy #define HFA384x_PDR_PCI_PMCONF		((u16)0x0404)
732aaad4303SSolomon Peachy #define HFA384x_PDR_RFENRGY		((u16)0x0406)
733aaad4303SSolomon Peachy #define HFA384x_PDR_USB_POWER_TYPE      ((u16)0x0407)
734aaad4303SSolomon Peachy //#define HFA384x_PDR_UNKNOWN408		((u16)0x0408)
735aaad4303SSolomon Peachy #define HFA384x_PDR_USB_MAX_POWER	((u16)0x0409)
736aaad4303SSolomon Peachy #define HFA384x_PDR_USB_MANUFACTURER	((u16)0x0410)
737aaad4303SSolomon Peachy #define HFA384x_PDR_USB_PRODUCT  	((u16)0x0411)
738aaad4303SSolomon Peachy #define HFA384x_PDR_ANT_DIVERSITY   	((u16)0x0412)
739aaad4303SSolomon Peachy #define HFA384x_PDR_HFO_DELAY       	((u16)0x0413)
740aaad4303SSolomon Peachy #define HFA384x_PDR_SCALE_THRESH 	((u16)0x0414)
74100b3ed16SGreg Kroah-Hartman 
742aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_MANF_TESTSP	((u16)0x0900)
743aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_MANF_TESTI	((u16)0x0901)
744aaad4303SSolomon Peachy #define HFA384x_PDR_END_OF_PDA		((u16)0x0000)
74500b3ed16SGreg Kroah-Hartman 
74600b3ed16SGreg Kroah-Hartman 
74700b3ed16SGreg Kroah-Hartman /*=============================================================*/
74800b3ed16SGreg Kroah-Hartman /*------ Macros -----------------------------------------------*/
74900b3ed16SGreg Kroah-Hartman 
75000b3ed16SGreg Kroah-Hartman /*--- Register ID macros ------------------------*/
75100b3ed16SGreg Kroah-Hartman 
75200b3ed16SGreg Kroah-Hartman #define		HFA384x_CMD		HFA384x_CMD_OFF
75300b3ed16SGreg Kroah-Hartman #define		HFA384x_PARAM0		HFA384x_PARAM0_OFF
75400b3ed16SGreg Kroah-Hartman #define		HFA384x_PARAM1		HFA384x_PARAM1_OFF
75500b3ed16SGreg Kroah-Hartman #define		HFA384x_PARAM2		HFA384x_PARAM2_OFF
75600b3ed16SGreg Kroah-Hartman #define		HFA384x_STATUS		HFA384x_STATUS_OFF
75700b3ed16SGreg Kroah-Hartman #define		HFA384x_RESP0		HFA384x_RESP0_OFF
75800b3ed16SGreg Kroah-Hartman #define		HFA384x_RESP1		HFA384x_RESP1_OFF
75900b3ed16SGreg Kroah-Hartman #define		HFA384x_RESP2		HFA384x_RESP2_OFF
76000b3ed16SGreg Kroah-Hartman #define		HFA384x_INFOFID		HFA384x_INFOFID_OFF
76100b3ed16SGreg Kroah-Hartman #define		HFA384x_RXFID		HFA384x_RXFID_OFF
76200b3ed16SGreg Kroah-Hartman #define		HFA384x_ALLOCFID	HFA384x_ALLOCFID_OFF
76300b3ed16SGreg Kroah-Hartman #define		HFA384x_TXCOMPLFID	HFA384x_TXCOMPLFID_OFF
76400b3ed16SGreg Kroah-Hartman #define		HFA384x_SELECT0		HFA384x_SELECT0_OFF
76500b3ed16SGreg Kroah-Hartman #define		HFA384x_OFFSET0		HFA384x_OFFSET0_OFF
76600b3ed16SGreg Kroah-Hartman #define		HFA384x_DATA0		HFA384x_DATA0_OFF
76700b3ed16SGreg Kroah-Hartman #define		HFA384x_SELECT1		HFA384x_SELECT1_OFF
76800b3ed16SGreg Kroah-Hartman #define		HFA384x_OFFSET1		HFA384x_OFFSET1_OFF
76900b3ed16SGreg Kroah-Hartman #define		HFA384x_DATA1		HFA384x_DATA1_OFF
77000b3ed16SGreg Kroah-Hartman #define		HFA384x_EVSTAT		HFA384x_EVSTAT_OFF
771aaad4303SSolomon Peachy #define		HFA384x_intEN		HFA384x_INTEN_OFF
77200b3ed16SGreg Kroah-Hartman #define		HFA384x_EVACK		HFA384x_EVACK_OFF
77300b3ed16SGreg Kroah-Hartman #define		HFA384x_CONTROL		HFA384x_CONTROL_OFF
77400b3ed16SGreg Kroah-Hartman #define		HFA384x_SWSUPPORT0	HFA384x_SWSUPPORT0_OFF
77500b3ed16SGreg Kroah-Hartman #define		HFA384x_SWSUPPORT1	HFA384x_SWSUPPORT1_OFF
77600b3ed16SGreg Kroah-Hartman #define		HFA384x_SWSUPPORT2	HFA384x_SWSUPPORT2_OFF
77700b3ed16SGreg Kroah-Hartman #define		HFA384x_AUXPAGE		HFA384x_AUXPAGE_OFF
77800b3ed16SGreg Kroah-Hartman #define		HFA384x_AUXOFFSET	HFA384x_AUXOFFSET_OFF
77900b3ed16SGreg Kroah-Hartman #define		HFA384x_AUXDATA		HFA384x_AUXDATA_OFF
78000b3ed16SGreg Kroah-Hartman #define		HFA384x_PCICOR		HFA384x_PCICOR_OFF
78100b3ed16SGreg Kroah-Hartman #define		HFA384x_PCIHCR		HFA384x_PCIHCR_OFF
78200b3ed16SGreg Kroah-Hartman 
78300b3ed16SGreg Kroah-Hartman 
78400b3ed16SGreg Kroah-Hartman /*--- Register Test/Get/Set Field macros ------------------------*/
78500b3ed16SGreg Kroah-Hartman 
786aaad4303SSolomon Peachy #define		HFA384x_CMD_ISBUSY(value)		((u16)(((u16)value) & HFA384x_CMD_BUSY))
787aaad4303SSolomon Peachy #define		HFA384x_CMD_AINFO_GET(value)		((u16)(((u16)(value) & HFA384x_CMD_AINFO) >> 8))
788aaad4303SSolomon Peachy #define		HFA384x_CMD_AINFO_SET(value)		((u16)((u16)(value) << 8))
789aaad4303SSolomon Peachy #define		HFA384x_CMD_MACPORT_GET(value)		((u16)(HFA384x_CMD_AINFO_GET((u16)(value) & HFA384x_CMD_MACPORT)))
790aaad4303SSolomon Peachy #define		HFA384x_CMD_MACPORT_SET(value)		((u16)HFA384x_CMD_AINFO_SET(value))
791aaad4303SSolomon Peachy #define		HFA384x_CMD_ISRECL(value)		((u16)(HFA384x_CMD_AINFO_GET((u16)(value) & HFA384x_CMD_RECL)))
792aaad4303SSolomon Peachy #define		HFA384x_CMD_RECL_SET(value)		((u16)HFA384x_CMD_AINFO_SET(value))
793aaad4303SSolomon Peachy #define		HFA384x_CMD_QOS_GET(value)		((u16)((((u16)(value))&((u16)0x3000)) >> 12))
794aaad4303SSolomon Peachy #define		HFA384x_CMD_QOS_SET(value)		((u16)((((u16)(value)) << 12) & 0x3000))
795aaad4303SSolomon Peachy #define		HFA384x_CMD_ISWRITE(value)		((u16)(HFA384x_CMD_AINFO_GET((u16)(value) & HFA384x_CMD_WRITE)))
796aaad4303SSolomon Peachy #define		HFA384x_CMD_WRITE_SET(value)		((u16)HFA384x_CMD_AINFO_SET((u16)value))
797aaad4303SSolomon Peachy #define		HFA384x_CMD_PROGMODE_GET(value)		((u16)(HFA384x_CMD_AINFO_GET((u16)(value) & HFA384x_CMD_PROGMODE)))
798aaad4303SSolomon Peachy #define		HFA384x_CMD_PROGMODE_SET(value)		((u16)HFA384x_CMD_AINFO_SET((u16)value))
799aaad4303SSolomon Peachy #define		HFA384x_CMD_CMDCODE_GET(value)		((u16)(((u16)(value)) & HFA384x_CMD_CMDCODE))
800aaad4303SSolomon Peachy #define		HFA384x_CMD_CMDCODE_SET(value)		((u16)(value))
80100b3ed16SGreg Kroah-Hartman 
802aaad4303SSolomon Peachy #define		HFA384x_STATUS_RESULT_GET(value)	((u16)((((u16)(value)) & HFA384x_STATUS_RESULT) >> 8))
803aaad4303SSolomon Peachy #define		HFA384x_STATUS_RESULT_SET(value)	(((u16)(value)) << 8)
804aaad4303SSolomon Peachy #define		HFA384x_STATUS_CMDCODE_GET(value)	(((u16)(value)) & HFA384x_STATUS_CMDCODE)
805aaad4303SSolomon Peachy #define		HFA384x_STATUS_CMDCODE_SET(value)	((u16)(value))
80600b3ed16SGreg Kroah-Hartman 
807aaad4303SSolomon Peachy #define		HFA384x_OFFSET_ISBUSY(value)		((u16)(((u16)(value)) & HFA384x_OFFSET_BUSY))
808aaad4303SSolomon Peachy #define		HFA384x_OFFSET_ISERR(value)		((u16)(((u16)(value)) & HFA384x_OFFSET_ERR))
809aaad4303SSolomon Peachy #define		HFA384x_OFFSET_DATAOFF_GET(value)	((u16)(((u16)(value)) & HFA384x_OFFSET_DATAOFF))
810aaad4303SSolomon Peachy #define		HFA384x_OFFSET_DATAOFF_SET(value)	((u16)(value))
81100b3ed16SGreg Kroah-Hartman 
812aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_ISTICK(value)		((u16)(((u16)(value)) & HFA384x_EVSTAT_TICK))
813aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_ISWTERR(value)		((u16)(((u16)(value)) & HFA384x_EVSTAT_WTERR))
814aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_ISINFDROP(value)		((u16)(((u16)(value)) & HFA384x_EVSTAT_INFDROP))
815aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_ISINFO(value)		((u16)(((u16)(value)) & HFA384x_EVSTAT_INFO))
816aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_ISDTIM(value)		((u16)(((u16)(value)) & HFA384x_EVSTAT_DTIM))
817aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_ISCMD(value)		((u16)(((u16)(value)) & HFA384x_EVSTAT_CMD))
818aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_ISALLOC(value)		((u16)(((u16)(value)) & HFA384x_EVSTAT_ALLOC))
819aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_ISTXEXC(value)		((u16)(((u16)(value)) & HFA384x_EVSTAT_TXEXC))
820aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_ISTX(value)		((u16)(((u16)(value)) & HFA384x_EVSTAT_TX))
821aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_ISRX(value)		((u16)(((u16)(value)) & HFA384x_EVSTAT_RX))
82200b3ed16SGreg Kroah-Hartman 
823aaad4303SSolomon Peachy #define		HFA384x_EVSTAT_ISBAP_OP(value)		((u16)(((u16)(value)) & HFA384x_int_BAP_OP))
82400b3ed16SGreg Kroah-Hartman 
825aaad4303SSolomon Peachy #define		HFA384x_intEN_ISTICK(value)		((u16)(((u16)(value)) & HFA384x_INTEN_TICK))
826aaad4303SSolomon Peachy #define		HFA384x_intEN_TICK_SET(value)		((u16)(((u16)(value)) << 15))
827aaad4303SSolomon Peachy #define		HFA384x_intEN_ISWTERR(value)		((u16)(((u16)(value)) & HFA384x_INTEN_WTERR))
828aaad4303SSolomon Peachy #define		HFA384x_intEN_WTERR_SET(value)		((u16)(((u16)(value)) << 14))
829aaad4303SSolomon Peachy #define		HFA384x_intEN_ISINFDROP(value)		((u16)(((u16)(value)) & HFA384x_INTEN_INFDROP))
830aaad4303SSolomon Peachy #define		HFA384x_intEN_INFDROP_SET(value)	((u16)(((u16)(value)) << 13))
831aaad4303SSolomon Peachy #define		HFA384x_intEN_ISINFO(value)		((u16)(((u16)(value)) & HFA384x_INTEN_INFO))
832aaad4303SSolomon Peachy #define		HFA384x_intEN_INFO_SET(value)		((u16)(((u16)(value)) << 7))
833aaad4303SSolomon Peachy #define		HFA384x_intEN_ISDTIM(value)		((u16)(((u16)(value)) & HFA384x_INTEN_DTIM))
834aaad4303SSolomon Peachy #define		HFA384x_intEN_DTIM_SET(value)		((u16)(((u16)(value)) << 5))
835aaad4303SSolomon Peachy #define		HFA384x_intEN_ISCMD(value)		((u16)(((u16)(value)) & HFA384x_INTEN_CMD))
836aaad4303SSolomon Peachy #define		HFA384x_intEN_CMD_SET(value)		((u16)(((u16)(value)) << 4))
837aaad4303SSolomon Peachy #define		HFA384x_intEN_ISALLOC(value)		((u16)(((u16)(value)) & HFA384x_INTEN_ALLOC))
838aaad4303SSolomon Peachy #define		HFA384x_intEN_ALLOC_SET(value)		((u16)(((u16)(value)) << 3))
839aaad4303SSolomon Peachy #define		HFA384x_intEN_ISTXEXC(value)		((u16)(((u16)(value)) & HFA384x_INTEN_TXEXC))
840aaad4303SSolomon Peachy #define		HFA384x_intEN_TXEXC_SET(value)		((u16)(((u16)(value)) << 2))
841aaad4303SSolomon Peachy #define		HFA384x_intEN_ISTX(value)		((u16)(((u16)(value)) & HFA384x_INTEN_TX))
842aaad4303SSolomon Peachy #define		HFA384x_intEN_TX_SET(value)		((u16)(((u16)(value)) << 1))
843aaad4303SSolomon Peachy #define		HFA384x_intEN_ISRX(value)		((u16)(((u16)(value)) & HFA384x_INTEN_RX))
844aaad4303SSolomon Peachy #define		HFA384x_intEN_RX_SET(value)		((u16)(((u16)(value)) << 0))
84500b3ed16SGreg Kroah-Hartman 
846aaad4303SSolomon Peachy #define		HFA384x_EVACK_ISTICK(value)		((u16)(((u16)(value)) & HFA384x_EVACK_TICK))
847aaad4303SSolomon Peachy #define		HFA384x_EVACK_TICK_SET(value)		((u16)(((u16)(value)) << 15))
848aaad4303SSolomon Peachy #define		HFA384x_EVACK_ISWTERR(value)		((u16)(((u16)(value)) & HFA384x_EVACK_WTERR))
849aaad4303SSolomon Peachy #define		HFA384x_EVACK_WTERR_SET(value)		((u16)(((u16)(value)) << 14))
850aaad4303SSolomon Peachy #define		HFA384x_EVACK_ISINFDROP(value)		((u16)(((u16)(value)) & HFA384x_EVACK_INFDROP))
851aaad4303SSolomon Peachy #define		HFA384x_EVACK_INFDROP_SET(value)	((u16)(((u16)(value)) << 13))
852aaad4303SSolomon Peachy #define		HFA384x_EVACK_ISINFO(value)		((u16)(((u16)(value)) & HFA384x_EVACK_INFO))
853aaad4303SSolomon Peachy #define		HFA384x_EVACK_INFO_SET(value)		((u16)(((u16)(value)) << 7))
854aaad4303SSolomon Peachy #define		HFA384x_EVACK_ISDTIM(value)		((u16)(((u16)(value)) & HFA384x_EVACK_DTIM))
855aaad4303SSolomon Peachy #define		HFA384x_EVACK_DTIM_SET(value)		((u16)(((u16)(value)) << 5))
856aaad4303SSolomon Peachy #define		HFA384x_EVACK_ISCMD(value)		((u16)(((u16)(value)) & HFA384x_EVACK_CMD))
857aaad4303SSolomon Peachy #define		HFA384x_EVACK_CMD_SET(value)		((u16)(((u16)(value)) << 4))
858aaad4303SSolomon Peachy #define		HFA384x_EVACK_ISALLOC(value)		((u16)(((u16)(value)) & HFA384x_EVACK_ALLOC))
859aaad4303SSolomon Peachy #define		HFA384x_EVACK_ALLOC_SET(value)		((u16)(((u16)(value)) << 3))
860aaad4303SSolomon Peachy #define		HFA384x_EVACK_ISTXEXC(value)		((u16)(((u16)(value)) & HFA384x_EVACK_TXEXC))
861aaad4303SSolomon Peachy #define		HFA384x_EVACK_TXEXC_SET(value)		((u16)(((u16)(value)) << 2))
862aaad4303SSolomon Peachy #define		HFA384x_EVACK_ISTX(value)		((u16)(((u16)(value)) & HFA384x_EVACK_TX))
863aaad4303SSolomon Peachy #define		HFA384x_EVACK_TX_SET(value)		((u16)(((u16)(value)) << 1))
864aaad4303SSolomon Peachy #define		HFA384x_EVACK_ISRX(value)		((u16)(((u16)(value)) & HFA384x_EVACK_RX))
865aaad4303SSolomon Peachy #define		HFA384x_EVACK_RX_SET(value)		((u16)(((u16)(value)) << 0))
86600b3ed16SGreg Kroah-Hartman 
867aaad4303SSolomon Peachy #define		HFA384x_CONTROL_AUXEN_SET(value)	((u16)(((u16)(value)) << 14))
868aaad4303SSolomon Peachy #define		HFA384x_CONTROL_AUXEN_GET(value)	((u16)(((u16)(value)) >> 14))
86900b3ed16SGreg Kroah-Hartman 
87000b3ed16SGreg Kroah-Hartman /* Byte Order */
87100b3ed16SGreg Kroah-Hartman #ifdef __KERNEL__
872aaad4303SSolomon Peachy #define hfa384x2host_16(n)	(__le16_to_cpu((u16)(n)))
873aaad4303SSolomon Peachy #define hfa384x2host_32(n)	(__le32_to_cpu((u32)(n)))
874aaad4303SSolomon Peachy #define host2hfa384x_16(n)	(__cpu_to_le16((u16)(n)))
875aaad4303SSolomon Peachy #define host2hfa384x_32(n)	(__cpu_to_le32((u32)(n)))
87600b3ed16SGreg Kroah-Hartman #endif
87700b3ed16SGreg Kroah-Hartman 
87800b3ed16SGreg Kroah-Hartman /* Host Maintained State Info */
87900b3ed16SGreg Kroah-Hartman #define HFA384x_STATE_PREINIT	0
88000b3ed16SGreg Kroah-Hartman #define HFA384x_STATE_INIT	1
88100b3ed16SGreg Kroah-Hartman #define HFA384x_STATE_RUNNING	2
88200b3ed16SGreg Kroah-Hartman 
88300b3ed16SGreg Kroah-Hartman /*=============================================================*/
88400b3ed16SGreg Kroah-Hartman /*------ Types and their related constants --------------------*/
88500b3ed16SGreg Kroah-Hartman 
88600b3ed16SGreg Kroah-Hartman #define HFA384x_HOSTAUTHASSOC_HOSTAUTH   BIT0
88700b3ed16SGreg Kroah-Hartman #define HFA384x_HOSTAUTHASSOC_HOSTASSOC  BIT1
88800b3ed16SGreg Kroah-Hartman 
88900b3ed16SGreg Kroah-Hartman #define HFA384x_WHAHANDLING_DISABLED     0
89000b3ed16SGreg Kroah-Hartman #define HFA384x_WHAHANDLING_PASSTHROUGH  BIT1
89100b3ed16SGreg Kroah-Hartman 
89200b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------*/
89300b3ed16SGreg Kroah-Hartman /* Commonly used basic types */
89400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_bytestr
89500b3ed16SGreg Kroah-Hartman {
896aaad4303SSolomon Peachy 	u16	len;
897aaad4303SSolomon Peachy 	u8	data[0];
8989cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_bytestr_t;
89900b3ed16SGreg Kroah-Hartman 
90000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_bytestr32
90100b3ed16SGreg Kroah-Hartman {
902aaad4303SSolomon Peachy 	u16	len;
903aaad4303SSolomon Peachy 	u8	data[32];
9049cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_bytestr32_t;
90500b3ed16SGreg Kroah-Hartman 
90600b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
90700b3ed16SGreg Kroah-Hartman Configuration Record Structures:
90800b3ed16SGreg Kroah-Hartman 	Network Parameters, Static Configuration Entities
90900b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
91000b3ed16SGreg Kroah-Hartman /* Prototype structure: all configuration record structures start with
91100b3ed16SGreg Kroah-Hartman these members */
91200b3ed16SGreg Kroah-Hartman 
91300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_record
91400b3ed16SGreg Kroah-Hartman {
915aaad4303SSolomon Peachy 	u16	reclen;
916aaad4303SSolomon Peachy 	u16	rid;
9179cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_rec_t;
91800b3ed16SGreg Kroah-Hartman 
91900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_record16
92000b3ed16SGreg Kroah-Hartman {
921aaad4303SSolomon Peachy 	u16	reclen;
922aaad4303SSolomon Peachy 	u16	rid;
923aaad4303SSolomon Peachy 	u16	val;
9249cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_rec16_t;
92500b3ed16SGreg Kroah-Hartman 
92600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_record32
92700b3ed16SGreg Kroah-Hartman {
928aaad4303SSolomon Peachy 	u16	reclen;
929aaad4303SSolomon Peachy 	u16	rid;
930aaad4303SSolomon Peachy 	u32	val;
9319cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_rec32;
93200b3ed16SGreg Kroah-Hartman 
93300b3ed16SGreg Kroah-Hartman /*-- Hardware/Firmware Component Information ----------*/
93400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_compident
93500b3ed16SGreg Kroah-Hartman {
936aaad4303SSolomon Peachy 	u16	id;
937aaad4303SSolomon Peachy 	u16	variant;
938aaad4303SSolomon Peachy 	u16	major;
939aaad4303SSolomon Peachy 	u16	minor;
9409cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_compident_t;
94100b3ed16SGreg Kroah-Hartman 
94200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_caplevel
94300b3ed16SGreg Kroah-Hartman {
944aaad4303SSolomon Peachy 	u16	role;
945aaad4303SSolomon Peachy 	u16	id;
946aaad4303SSolomon Peachy 	u16	variant;
947aaad4303SSolomon Peachy 	u16	bottom;
948aaad4303SSolomon Peachy 	u16	top;
9499cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_caplevel_t;
95000b3ed16SGreg Kroah-Hartman 
95100b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfPortType --*/
95200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfPortType
95300b3ed16SGreg Kroah-Hartman {
954aaad4303SSolomon Peachy 	u16	cnfPortType;
9559cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfPortType_t;
95600b3ed16SGreg Kroah-Hartman 
95700b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfOwnMACAddress --*/
95800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfOwnMACAddress
95900b3ed16SGreg Kroah-Hartman {
960aaad4303SSolomon Peachy 	u8	cnfOwnMACAddress[6];
9619cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfOwnMACAddress_t;
96200b3ed16SGreg Kroah-Hartman 
96300b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfDesiredSSID --*/
96400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfDesiredSSID
96500b3ed16SGreg Kroah-Hartman {
966aaad4303SSolomon Peachy 	u8	cnfDesiredSSID[34];
9679cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfDesiredSSID_t;
96800b3ed16SGreg Kroah-Hartman 
96900b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfOwnChannel --*/
97000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfOwnChannel
97100b3ed16SGreg Kroah-Hartman {
972aaad4303SSolomon Peachy 	u16	cnfOwnChannel;
9739cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfOwnChannel_t;
97400b3ed16SGreg Kroah-Hartman 
97500b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfOwnSSID --*/
97600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfOwnSSID
97700b3ed16SGreg Kroah-Hartman {
978aaad4303SSolomon Peachy 	u8	cnfOwnSSID[34];
9799cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfOwnSSID_t;
98000b3ed16SGreg Kroah-Hartman 
98100b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfOwnATIMWindow --*/
98200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfOwnATIMWindow
98300b3ed16SGreg Kroah-Hartman {
984aaad4303SSolomon Peachy 	u16	cnfOwnATIMWindow;
9859cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfOwnATIMWindow_t;
98600b3ed16SGreg Kroah-Hartman 
98700b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfSystemScale --*/
98800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfSystemScale
98900b3ed16SGreg Kroah-Hartman {
990aaad4303SSolomon Peachy 	u16	cnfSystemScale;
9919cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfSystemScale_t;
99200b3ed16SGreg Kroah-Hartman 
99300b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfMaxDataLength --*/
99400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfMaxDataLength
99500b3ed16SGreg Kroah-Hartman {
996aaad4303SSolomon Peachy 	u16	cnfMaxDataLength;
9979cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfMaxDataLength_t;
99800b3ed16SGreg Kroah-Hartman 
99900b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfWDSAddress --*/
100000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfWDSAddress
100100b3ed16SGreg Kroah-Hartman {
1002aaad4303SSolomon Peachy 	u8	cnfWDSAddress[6];
10039cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfWDSAddress_t;
100400b3ed16SGreg Kroah-Hartman 
100500b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfPMEnabled --*/
100600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfPMEnabled
100700b3ed16SGreg Kroah-Hartman {
1008aaad4303SSolomon Peachy 	u16	cnfPMEnabled;
10099cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfPMEnabled_t;
101000b3ed16SGreg Kroah-Hartman 
101100b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfPMEPS --*/
101200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfPMEPS
101300b3ed16SGreg Kroah-Hartman {
1014aaad4303SSolomon Peachy 	u16	cnfPMEPS;
10159cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfPMEPS_t;
101600b3ed16SGreg Kroah-Hartman 
101700b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfMulticastReceive --*/
101800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfMulticastReceive
101900b3ed16SGreg Kroah-Hartman {
1020aaad4303SSolomon Peachy 	u16	cnfMulticastReceive;
10219cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfMulticastReceive_t;
102200b3ed16SGreg Kroah-Hartman 
102300b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfAuthentication --*/
102400b3ed16SGreg Kroah-Hartman #define HFA384x_CNFAUTHENTICATION_OPENSYSTEM	0x0001
102500b3ed16SGreg Kroah-Hartman #define HFA384x_CNFAUTHENTICATION_SHAREDKEY	0x0002
102600b3ed16SGreg Kroah-Hartman #define HFA384x_CNFAUTHENTICATION_LEAP     	0x0004
102700b3ed16SGreg Kroah-Hartman 
102800b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfMaxSleepDuration --*/
102900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfMaxSleepDuration
103000b3ed16SGreg Kroah-Hartman {
1031aaad4303SSolomon Peachy 	u16	cnfMaxSleepDuration;
10329cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfMaxSleepDuration_t;
103300b3ed16SGreg Kroah-Hartman 
103400b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfPMHoldoverDuration --*/
103500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfPMHoldoverDuration
103600b3ed16SGreg Kroah-Hartman {
1037aaad4303SSolomon Peachy 	u16	cnfPMHoldoverDuration;
10389cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfPMHoldoverDuration_t;
103900b3ed16SGreg Kroah-Hartman 
104000b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfOwnName --*/
104100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfOwnName
104200b3ed16SGreg Kroah-Hartman {
1043aaad4303SSolomon Peachy 	u8	cnfOwnName[34];
10449cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfOwnName_t;
104500b3ed16SGreg Kroah-Hartman 
104600b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfOwnDTIMPeriod --*/
104700b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfOwnDTIMPeriod
104800b3ed16SGreg Kroah-Hartman {
1049aaad4303SSolomon Peachy 	u16	cnfOwnDTIMPeriod;
10509cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfOwnDTIMPeriod_t;
105100b3ed16SGreg Kroah-Hartman 
105200b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfWDSAddress --*/
105300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfWDSAddressN
105400b3ed16SGreg Kroah-Hartman {
1055aaad4303SSolomon Peachy 	u8	cnfWDSAddress[6];
10569cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfWDSAddressN_t;
105700b3ed16SGreg Kroah-Hartman 
105800b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfMulticastPMBuffering --*/
105900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_cnfMulticastPMBuffering
106000b3ed16SGreg Kroah-Hartman {
1061aaad4303SSolomon Peachy 	u16	cnfMulticastPMBuffering;
10629cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_cnfMulticastPMBuffering_t;
106300b3ed16SGreg Kroah-Hartman 
106400b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
106500b3ed16SGreg Kroah-Hartman Configuration Record Structures:
106600b3ed16SGreg Kroah-Hartman 	Network Parameters, Dynamic Configuration Entities
106700b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
106800b3ed16SGreg Kroah-Hartman 
106900b3ed16SGreg Kroah-Hartman /*-- Configuration Record: GroupAddresses --*/
107000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_GroupAddresses
107100b3ed16SGreg Kroah-Hartman {
1072aaad4303SSolomon Peachy 	u8	MACAddress[16][6];
10739cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_GroupAddresses_t;
107400b3ed16SGreg Kroah-Hartman 
107500b3ed16SGreg Kroah-Hartman /*-- Configuration Record: CreateIBSS --*/
107600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CreateIBSS
107700b3ed16SGreg Kroah-Hartman {
1078aaad4303SSolomon Peachy 	u16	CreateIBSS;
10799cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CreateIBSS_t;
108000b3ed16SGreg Kroah-Hartman 
108100b3ed16SGreg Kroah-Hartman #define HFA384x_CREATEIBSS_JOINCREATEIBSS          0
108200b3ed16SGreg Kroah-Hartman #define HFA384x_CREATEIBSS_JOINESS_JOINCREATEIBSS  1
108300b3ed16SGreg Kroah-Hartman #define HFA384x_CREATEIBSS_JOINIBSS                2
108400b3ed16SGreg Kroah-Hartman #define HFA384x_CREATEIBSS_JOINESS_JOINIBSS        3
108500b3ed16SGreg Kroah-Hartman 
108600b3ed16SGreg Kroah-Hartman /*-- Configuration Record: FragmentationThreshold --*/
108700b3ed16SGreg Kroah-Hartman typedef struct hfa384x_FragmentationThreshold
108800b3ed16SGreg Kroah-Hartman {
1089aaad4303SSolomon Peachy 	u16	FragmentationThreshold;
10909cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_FragmentationThreshold_t;
109100b3ed16SGreg Kroah-Hartman 
109200b3ed16SGreg Kroah-Hartman /*-- Configuration Record: RTSThreshold --*/
109300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_RTSThreshold
109400b3ed16SGreg Kroah-Hartman {
1095aaad4303SSolomon Peachy 	u16	RTSThreshold;
10969cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_RTSThreshold_t;
109700b3ed16SGreg Kroah-Hartman 
109800b3ed16SGreg Kroah-Hartman /*-- Configuration Record: TxRateControl --*/
109900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_TxRateControl
110000b3ed16SGreg Kroah-Hartman {
1101aaad4303SSolomon Peachy 	u16	TxRateControl;
11029cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_TxRateControl_t;
110300b3ed16SGreg Kroah-Hartman 
110400b3ed16SGreg Kroah-Hartman /*-- Configuration Record: PromiscuousMode --*/
110500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_PromiscuousMode
110600b3ed16SGreg Kroah-Hartman {
1107aaad4303SSolomon Peachy 	u16	PromiscuousMode;
11089cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_PromiscuousMode_t;
110900b3ed16SGreg Kroah-Hartman 
111000b3ed16SGreg Kroah-Hartman /*-- Configuration Record: ScanRequest (data portion only) --*/
111100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_ScanRequest_data
111200b3ed16SGreg Kroah-Hartman {
1113aaad4303SSolomon Peachy 	u16	channelList;
1114aaad4303SSolomon Peachy 	u16	txRate;
11159cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_ScanRequest_data_t;
111600b3ed16SGreg Kroah-Hartman 
111700b3ed16SGreg Kroah-Hartman /*-- Configuration Record: HostScanRequest (data portion only) --*/
111800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_HostScanRequest_data
111900b3ed16SGreg Kroah-Hartman {
1120aaad4303SSolomon Peachy 	u16	channelList;
1121aaad4303SSolomon Peachy 	u16	txRate;
112200b3ed16SGreg Kroah-Hartman 	hfa384x_bytestr32_t ssid;
11239cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_HostScanRequest_data_t;
112400b3ed16SGreg Kroah-Hartman 
112500b3ed16SGreg Kroah-Hartman /*-- Configuration Record: JoinRequest (data portion only) --*/
112600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_JoinRequest_data
112700b3ed16SGreg Kroah-Hartman {
1128aaad4303SSolomon Peachy 	u8	bssid[WLAN_BSSID_LEN];
1129aaad4303SSolomon Peachy 	u16	channel;
11309cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_JoinRequest_data_t;
113100b3ed16SGreg Kroah-Hartman 
113200b3ed16SGreg Kroah-Hartman /*-- Configuration Record: authenticateStation (data portion only) --*/
113300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_authenticateStation_data
113400b3ed16SGreg Kroah-Hartman {
113528b17a4bSMoritz Muehlenhoff 	u8	address[ETH_ALEN];
1136aaad4303SSolomon Peachy 	u16	status;
1137aaad4303SSolomon Peachy 	u16	algorithm;
11389cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_authenticateStation_data_t;
113900b3ed16SGreg Kroah-Hartman 
114000b3ed16SGreg Kroah-Hartman /*-- Configuration Record: associateStation (data portion only) --*/
114100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_associateStation_data
114200b3ed16SGreg Kroah-Hartman {
114328b17a4bSMoritz Muehlenhoff 	u8	address[ETH_ALEN];
1144aaad4303SSolomon Peachy 	u16	status;
1145aaad4303SSolomon Peachy 	u16	type;
11469cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_associateStation_data_t;
114700b3ed16SGreg Kroah-Hartman 
114800b3ed16SGreg Kroah-Hartman /*-- Configuration Record: ChannelInfoRequest (data portion only) --*/
114900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_ChannelInfoRequest_data
115000b3ed16SGreg Kroah-Hartman {
1151aaad4303SSolomon Peachy 	u16	channelList;
1152aaad4303SSolomon Peachy 	u16	channelDwellTime;
11539cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_ChannelInfoRequest_data_t;
115400b3ed16SGreg Kroah-Hartman 
115500b3ed16SGreg Kroah-Hartman /*-- Configuration Record: WEPKeyMapping (data portion only) --*/
115600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_WEPKeyMapping
115700b3ed16SGreg Kroah-Hartman {
115828b17a4bSMoritz Muehlenhoff 	u8	address[ETH_ALEN];
1159aaad4303SSolomon Peachy 	u16	key_index;
1160aaad4303SSolomon Peachy 	u8 	key[16];
1161aaad4303SSolomon Peachy 	u8 	mic_transmit_key[4];
1162aaad4303SSolomon Peachy 	u8 	mic_receive_key[4];
11639cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_WEPKeyMapping_t;
116400b3ed16SGreg Kroah-Hartman 
116500b3ed16SGreg Kroah-Hartman /*-- Configuration Record: WPAData       (data portion only) --*/
116600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_WPAData
116700b3ed16SGreg Kroah-Hartman {
1168aaad4303SSolomon Peachy 	u16	datalen;
1169aaad4303SSolomon Peachy         u8 	data[0]; // max 80
11709cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_WPAData_t;
117100b3ed16SGreg Kroah-Hartman 
117200b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
117300b3ed16SGreg Kroah-Hartman Configuration Record Structures: Behavior Parameters
117400b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
117500b3ed16SGreg Kroah-Hartman 
117600b3ed16SGreg Kroah-Hartman /*-- Configuration Record: TickTime --*/
117700b3ed16SGreg Kroah-Hartman typedef struct hfa384x_TickTime
117800b3ed16SGreg Kroah-Hartman {
1179aaad4303SSolomon Peachy 	u16	TickTime;
11809cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_TickTime_t;
118100b3ed16SGreg Kroah-Hartman 
118200b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
118300b3ed16SGreg Kroah-Hartman Information Record Structures: NIC Information
118400b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
118500b3ed16SGreg Kroah-Hartman 
118600b3ed16SGreg Kroah-Hartman /*-- Information Record: MaxLoadTime --*/
118700b3ed16SGreg Kroah-Hartman typedef struct hfa384x_MaxLoadTime
118800b3ed16SGreg Kroah-Hartman {
1189aaad4303SSolomon Peachy 	u16	MaxLoadTime;
11909cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_MaxLoadTime_t;
119100b3ed16SGreg Kroah-Hartman 
119200b3ed16SGreg Kroah-Hartman /*-- Information Record: DownLoadBuffer --*/
119300b3ed16SGreg Kroah-Hartman /* NOTE: The page and offset are in AUX format */
119400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_downloadbuffer
119500b3ed16SGreg Kroah-Hartman {
1196aaad4303SSolomon Peachy 	u16	page;
1197aaad4303SSolomon Peachy 	u16	offset;
1198aaad4303SSolomon Peachy 	u16	len;
11999cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_downloadbuffer_t;
120000b3ed16SGreg Kroah-Hartman 
120100b3ed16SGreg Kroah-Hartman /*-- Information Record: PRIIdentity --*/
120200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_PRIIdentity
120300b3ed16SGreg Kroah-Hartman {
1204aaad4303SSolomon Peachy 	u16	PRICompID;
1205aaad4303SSolomon Peachy 	u16	PRIVariant;
1206aaad4303SSolomon Peachy 	u16	PRIMajorVersion;
1207aaad4303SSolomon Peachy 	u16	PRIMinorVersion;
12089cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_PRIIdentity_t;
120900b3ed16SGreg Kroah-Hartman 
121000b3ed16SGreg Kroah-Hartman /*-- Information Record: PRISupRange --*/
121100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_PRISupRange
121200b3ed16SGreg Kroah-Hartman {
1213aaad4303SSolomon Peachy 	u16	PRIRole;
1214aaad4303SSolomon Peachy 	u16	PRIID;
1215aaad4303SSolomon Peachy 	u16	PRIVariant;
1216aaad4303SSolomon Peachy 	u16	PRIBottom;
1217aaad4303SSolomon Peachy 	u16	PRITop;
12189cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_PRISupRange_t;
121900b3ed16SGreg Kroah-Hartman 
122000b3ed16SGreg Kroah-Hartman /*-- Information Record: CFIActRanges --*/
122100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CFIActRanges
122200b3ed16SGreg Kroah-Hartman {
1223aaad4303SSolomon Peachy 	u16	CFIRole;
1224aaad4303SSolomon Peachy 	u16	CFIID;
1225aaad4303SSolomon Peachy 	u16	CFIVariant;
1226aaad4303SSolomon Peachy 	u16	CFIBottom;
1227aaad4303SSolomon Peachy 	u16	CFITop;
12289cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CFIActRanges_t;
122900b3ed16SGreg Kroah-Hartman 
123000b3ed16SGreg Kroah-Hartman /*-- Information Record: NICSerialNumber --*/
123100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_NICSerialNumber
123200b3ed16SGreg Kroah-Hartman {
1233aaad4303SSolomon Peachy 	u8	NICSerialNumber[12];
12349cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_NICSerialNumber_t;
123500b3ed16SGreg Kroah-Hartman 
123600b3ed16SGreg Kroah-Hartman /*-- Information Record: NICIdentity --*/
123700b3ed16SGreg Kroah-Hartman typedef struct hfa384x_NICIdentity
123800b3ed16SGreg Kroah-Hartman {
1239aaad4303SSolomon Peachy 	u16	NICCompID;
1240aaad4303SSolomon Peachy 	u16	NICVariant;
1241aaad4303SSolomon Peachy 	u16	NICMajorVersion;
1242aaad4303SSolomon Peachy 	u16	NICMinorVersion;
12439cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_NICIdentity_t;
124400b3ed16SGreg Kroah-Hartman 
124500b3ed16SGreg Kroah-Hartman /*-- Information Record: MFISupRange --*/
124600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_MFISupRange
124700b3ed16SGreg Kroah-Hartman {
1248aaad4303SSolomon Peachy 	u16	MFIRole;
1249aaad4303SSolomon Peachy 	u16	MFIID;
1250aaad4303SSolomon Peachy 	u16	MFIVariant;
1251aaad4303SSolomon Peachy 	u16	MFIBottom;
1252aaad4303SSolomon Peachy 	u16	MFITop;
12539cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_MFISupRange_t;
125400b3ed16SGreg Kroah-Hartman 
125500b3ed16SGreg Kroah-Hartman /*-- Information Record: CFISupRange --*/
125600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CFISupRange
125700b3ed16SGreg Kroah-Hartman {
1258aaad4303SSolomon Peachy 	u16	CFIRole;
1259aaad4303SSolomon Peachy 	u16	CFIID;
1260aaad4303SSolomon Peachy 	u16	CFIVariant;
1261aaad4303SSolomon Peachy 	u16	CFIBottom;
1262aaad4303SSolomon Peachy 	u16	CFITop;
12639cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CFISupRange_t;
126400b3ed16SGreg Kroah-Hartman 
126500b3ed16SGreg Kroah-Hartman /*-- Information Record: BUILDSEQ:BuildSeq --*/
126600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_BuildSeq {
1267aaad4303SSolomon Peachy 	u16	primary;
1268aaad4303SSolomon Peachy 	u16	secondary;
12699cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_BuildSeq_t;
127000b3ed16SGreg Kroah-Hartman 
127100b3ed16SGreg Kroah-Hartman /*-- Information Record: FWID --*/
127200b3ed16SGreg Kroah-Hartman #define HFA384x_FWID_LEN	14
127300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_FWID {
1274aaad4303SSolomon Peachy 	u8	primary[HFA384x_FWID_LEN];
1275aaad4303SSolomon Peachy 	u8	secondary[HFA384x_FWID_LEN];
12769cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_FWID_t;
127700b3ed16SGreg Kroah-Hartman 
127800b3ed16SGreg Kroah-Hartman /*-- Information Record: ChannelList --*/
127900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_ChannelList
128000b3ed16SGreg Kroah-Hartman {
1281aaad4303SSolomon Peachy 	u16	ChannelList;
12829cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_ChannelList_t;
128300b3ed16SGreg Kroah-Hartman 
128400b3ed16SGreg Kroah-Hartman /*-- Information Record: RegulatoryDomains --*/
128500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_RegulatoryDomains
128600b3ed16SGreg Kroah-Hartman {
1287aaad4303SSolomon Peachy 	u8	RegulatoryDomains[12];
12889cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_RegulatoryDomains_t;
128900b3ed16SGreg Kroah-Hartman 
129000b3ed16SGreg Kroah-Hartman /*-- Information Record: TempType --*/
129100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_TempType
129200b3ed16SGreg Kroah-Hartman {
1293aaad4303SSolomon Peachy 	u16	TempType;
12949cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_TempType_t;
129500b3ed16SGreg Kroah-Hartman 
129600b3ed16SGreg Kroah-Hartman /*-- Information Record: CIS --*/
129700b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CIS
129800b3ed16SGreg Kroah-Hartman {
1299aaad4303SSolomon Peachy 	u8	CIS[480];
13009cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CIS_t;
130100b3ed16SGreg Kroah-Hartman 
130200b3ed16SGreg Kroah-Hartman /*-- Information Record: STAIdentity --*/
130300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_STAIdentity
130400b3ed16SGreg Kroah-Hartman {
1305aaad4303SSolomon Peachy 	u16	STACompID;
1306aaad4303SSolomon Peachy 	u16	STAVariant;
1307aaad4303SSolomon Peachy 	u16	STAMajorVersion;
1308aaad4303SSolomon Peachy 	u16	STAMinorVersion;
13099cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_STAIdentity_t;
131000b3ed16SGreg Kroah-Hartman 
131100b3ed16SGreg Kroah-Hartman /*-- Information Record: STASupRange --*/
131200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_STASupRange
131300b3ed16SGreg Kroah-Hartman {
1314aaad4303SSolomon Peachy 	u16	STARole;
1315aaad4303SSolomon Peachy 	u16	STAID;
1316aaad4303SSolomon Peachy 	u16	STAVariant;
1317aaad4303SSolomon Peachy 	u16	STABottom;
1318aaad4303SSolomon Peachy 	u16	STATop;
13199cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_STASupRange_t;
132000b3ed16SGreg Kroah-Hartman 
132100b3ed16SGreg Kroah-Hartman /*-- Information Record: MFIActRanges --*/
132200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_MFIActRanges
132300b3ed16SGreg Kroah-Hartman {
1324aaad4303SSolomon Peachy 	u16	MFIRole;
1325aaad4303SSolomon Peachy 	u16	MFIID;
1326aaad4303SSolomon Peachy 	u16	MFIVariant;
1327aaad4303SSolomon Peachy 	u16	MFIBottom;
1328aaad4303SSolomon Peachy 	u16	MFITop;
13299cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_MFIActRanges_t;
133000b3ed16SGreg Kroah-Hartman 
133100b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
133200b3ed16SGreg Kroah-Hartman Information Record Structures: NIC Information
133300b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
133400b3ed16SGreg Kroah-Hartman 
133500b3ed16SGreg Kroah-Hartman /*-- Information Record: PortStatus --*/
133600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_PortStatus
133700b3ed16SGreg Kroah-Hartman {
1338aaad4303SSolomon Peachy 	u16	PortStatus;
13399cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_PortStatus_t;
134000b3ed16SGreg Kroah-Hartman 
1341aaad4303SSolomon Peachy #define HFA384x_PSTATUS_DISABLED	((u16)1)
1342aaad4303SSolomon Peachy #define HFA384x_PSTATUS_SEARCHING	((u16)2)
1343aaad4303SSolomon Peachy #define HFA384x_PSTATUS_CONN_IBSS	((u16)3)
1344aaad4303SSolomon Peachy #define HFA384x_PSTATUS_CONN_ESS	((u16)4)
1345aaad4303SSolomon Peachy #define HFA384x_PSTATUS_OUTOFRANGE	((u16)5)
1346aaad4303SSolomon Peachy #define HFA384x_PSTATUS_CONN_WDS	((u16)6)
134700b3ed16SGreg Kroah-Hartman 
134800b3ed16SGreg Kroah-Hartman /*-- Information Record: CurrentSSID --*/
134900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CurrentSSID
135000b3ed16SGreg Kroah-Hartman {
1351aaad4303SSolomon Peachy 	u8	CurrentSSID[34];
13529cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CurrentSSID_t;
135300b3ed16SGreg Kroah-Hartman 
135400b3ed16SGreg Kroah-Hartman /*-- Information Record: CurrentBSSID --*/
135500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CurrentBSSID
135600b3ed16SGreg Kroah-Hartman {
1357aaad4303SSolomon Peachy 	u8	CurrentBSSID[6];
13589cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CurrentBSSID_t;
135900b3ed16SGreg Kroah-Hartman 
136000b3ed16SGreg Kroah-Hartman /*-- Information Record: commsquality --*/
136100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_commsquality
136200b3ed16SGreg Kroah-Hartman {
1363aaad4303SSolomon Peachy 	u16	CQ_currBSS;
1364aaad4303SSolomon Peachy 	u16	ASL_currBSS;
1365aaad4303SSolomon Peachy 	u16	ANL_currFC;
13669cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_commsquality_t;
136700b3ed16SGreg Kroah-Hartman 
136800b3ed16SGreg Kroah-Hartman /*-- Information Record: dmbcommsquality --*/
136900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_dbmcommsquality
137000b3ed16SGreg Kroah-Hartman {
1371aaad4303SSolomon Peachy 	u16	CQdbm_currBSS;
1372aaad4303SSolomon Peachy 	u16	ASLdbm_currBSS;
1373aaad4303SSolomon Peachy 	u16	ANLdbm_currFC;
13749cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_dbmcommsquality_t;
137500b3ed16SGreg Kroah-Hartman 
137600b3ed16SGreg Kroah-Hartman /*-- Information Record: CurrentTxRate --*/
137700b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CurrentTxRate
137800b3ed16SGreg Kroah-Hartman {
1379aaad4303SSolomon Peachy 	u16	CurrentTxRate;
13809cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CurrentTxRate_t;
138100b3ed16SGreg Kroah-Hartman 
138200b3ed16SGreg Kroah-Hartman /*-- Information Record: CurrentBeaconInterval --*/
138300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CurrentBeaconInterval
138400b3ed16SGreg Kroah-Hartman {
1385aaad4303SSolomon Peachy 	u16	CurrentBeaconInterval;
13869cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CurrentBeaconInterval_t;
138700b3ed16SGreg Kroah-Hartman 
138800b3ed16SGreg Kroah-Hartman /*-- Information Record: CurrentScaleThresholds --*/
138900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CurrentScaleThresholds
139000b3ed16SGreg Kroah-Hartman {
1391aaad4303SSolomon Peachy 	u16	EnergyDetectThreshold;
1392aaad4303SSolomon Peachy 	u16	CarrierDetectThreshold;
1393aaad4303SSolomon Peachy 	u16	DeferDetectThreshold;
1394aaad4303SSolomon Peachy 	u16	CellSearchThreshold; /* Stations only */
1395aaad4303SSolomon Peachy 	u16	DeadSpotThreshold; /* Stations only */
13969cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CurrentScaleThresholds_t;
139700b3ed16SGreg Kroah-Hartman 
139800b3ed16SGreg Kroah-Hartman /*-- Information Record: ProtocolRspTime --*/
139900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_ProtocolRspTime
140000b3ed16SGreg Kroah-Hartman {
1401aaad4303SSolomon Peachy 	u16	ProtocolRspTime;
14029cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_ProtocolRspTime_t;
140300b3ed16SGreg Kroah-Hartman 
140400b3ed16SGreg Kroah-Hartman /*-- Information Record: ShortRetryLimit --*/
140500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_ShortRetryLimit
140600b3ed16SGreg Kroah-Hartman {
1407aaad4303SSolomon Peachy 	u16	ShortRetryLimit;
14089cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_ShortRetryLimit_t;
140900b3ed16SGreg Kroah-Hartman 
141000b3ed16SGreg Kroah-Hartman /*-- Information Record: LongRetryLimit --*/
141100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_LongRetryLimit
141200b3ed16SGreg Kroah-Hartman {
1413aaad4303SSolomon Peachy 	u16	LongRetryLimit;
14149cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_LongRetryLimit_t;
141500b3ed16SGreg Kroah-Hartman 
141600b3ed16SGreg Kroah-Hartman /*-- Information Record: MaxTransmitLifetime --*/
141700b3ed16SGreg Kroah-Hartman typedef struct hfa384x_MaxTransmitLifetime
141800b3ed16SGreg Kroah-Hartman {
1419aaad4303SSolomon Peachy 	u16	MaxTransmitLifetime;
14209cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_MaxTransmitLifetime_t;
142100b3ed16SGreg Kroah-Hartman 
142200b3ed16SGreg Kroah-Hartman /*-- Information Record: MaxReceiveLifetime --*/
142300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_MaxReceiveLifetime
142400b3ed16SGreg Kroah-Hartman {
1425aaad4303SSolomon Peachy 	u16	MaxReceiveLifetime;
14269cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_MaxReceiveLifetime_t;
142700b3ed16SGreg Kroah-Hartman 
142800b3ed16SGreg Kroah-Hartman /*-- Information Record: CFPollable --*/
142900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CFPollable
143000b3ed16SGreg Kroah-Hartman {
1431aaad4303SSolomon Peachy 	u16	CFPollable;
14329cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CFPollable_t;
143300b3ed16SGreg Kroah-Hartman 
143400b3ed16SGreg Kroah-Hartman /*-- Information Record: AuthenticationAlgorithms --*/
143500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_AuthenticationAlgorithms
143600b3ed16SGreg Kroah-Hartman {
1437aaad4303SSolomon Peachy 	u16	AuthenticationType;
1438aaad4303SSolomon Peachy 	u16	TypeEnabled;
14399cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_AuthenticationAlgorithms_t;
144000b3ed16SGreg Kroah-Hartman 
144100b3ed16SGreg Kroah-Hartman /*-- Information Record: AuthenticationAlgorithms
144200b3ed16SGreg Kroah-Hartman (data only --*/
144300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_AuthenticationAlgorithms_data
144400b3ed16SGreg Kroah-Hartman {
1445aaad4303SSolomon Peachy 	u16	AuthenticationType;
1446aaad4303SSolomon Peachy 	u16	TypeEnabled;
14479cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_AuthenticationAlgorithms_data_t;
144800b3ed16SGreg Kroah-Hartman 
144900b3ed16SGreg Kroah-Hartman /*-- Information Record: PrivacyOptionImplemented --*/
145000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_PrivacyOptionImplemented
145100b3ed16SGreg Kroah-Hartman {
1452aaad4303SSolomon Peachy 	u16	PrivacyOptionImplemented;
14539cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_PrivacyOptionImplemented_t;
145400b3ed16SGreg Kroah-Hartman 
145500b3ed16SGreg Kroah-Hartman /*-- Information Record: OwnMACAddress --*/
145600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_OwnMACAddress
145700b3ed16SGreg Kroah-Hartman {
1458aaad4303SSolomon Peachy 	u8	OwnMACAddress[6];
14599cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_OwnMACAddress_t;
146000b3ed16SGreg Kroah-Hartman 
146100b3ed16SGreg Kroah-Hartman /*-- Information Record: PCFInfo --*/
146200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_PCFInfo
146300b3ed16SGreg Kroah-Hartman {
1464aaad4303SSolomon Peachy 	u16	MediumOccupancyLimit;
1465aaad4303SSolomon Peachy 	u16	CFPPeriod;
1466aaad4303SSolomon Peachy 	u16	CFPMaxDuration;
1467aaad4303SSolomon Peachy 	u16	CFPFlags;
14689cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_PCFInfo_t;
146900b3ed16SGreg Kroah-Hartman 
147000b3ed16SGreg Kroah-Hartman /*-- Information Record: PCFInfo (data portion only) --*/
147100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_PCFInfo_data
147200b3ed16SGreg Kroah-Hartman {
1473aaad4303SSolomon Peachy 	u16	MediumOccupancyLimit;
1474aaad4303SSolomon Peachy 	u16	CFPPeriod;
1475aaad4303SSolomon Peachy 	u16	CFPMaxDuration;
1476aaad4303SSolomon Peachy 	u16	CFPFlags;
14779cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_PCFInfo_data_t;
147800b3ed16SGreg Kroah-Hartman 
147900b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
148000b3ed16SGreg Kroah-Hartman Information Record Structures: Modem Information Records
148100b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
148200b3ed16SGreg Kroah-Hartman 
148300b3ed16SGreg Kroah-Hartman /*-- Information Record: PHYType --*/
148400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_PHYType
148500b3ed16SGreg Kroah-Hartman {
1486aaad4303SSolomon Peachy 	u16	PHYType;
14879cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_PHYType_t;
148800b3ed16SGreg Kroah-Hartman 
148900b3ed16SGreg Kroah-Hartman /*-- Information Record: CurrentChannel --*/
149000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CurrentChannel
149100b3ed16SGreg Kroah-Hartman {
1492aaad4303SSolomon Peachy 	u16	CurrentChannel;
14939cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CurrentChannel_t;
149400b3ed16SGreg Kroah-Hartman 
149500b3ed16SGreg Kroah-Hartman /*-- Information Record: CurrentPowerState --*/
149600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CurrentPowerState
149700b3ed16SGreg Kroah-Hartman {
1498aaad4303SSolomon Peachy 	u16	CurrentPowerState;
14999cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CurrentPowerState_t;
150000b3ed16SGreg Kroah-Hartman 
150100b3ed16SGreg Kroah-Hartman /*-- Information Record: CCAMode --*/
150200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CCAMode
150300b3ed16SGreg Kroah-Hartman {
1504aaad4303SSolomon Peachy 	u16	CCAMode;
15059cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CCAMode_t;
150600b3ed16SGreg Kroah-Hartman 
150700b3ed16SGreg Kroah-Hartman /*-- Information Record: SupportedDataRates --*/
150800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_SupportedDataRates
150900b3ed16SGreg Kroah-Hartman {
1510aaad4303SSolomon Peachy 	u8	SupportedDataRates[10];
15119cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_SupportedDataRates_t;
151200b3ed16SGreg Kroah-Hartman 
151300b3ed16SGreg Kroah-Hartman /*-- Information Record: LFOStatus --*/
151400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_LFOStatus
151500b3ed16SGreg Kroah-Hartman {
1516aaad4303SSolomon Peachy 	u16  TestResults;
1517aaad4303SSolomon Peachy 	u16  LFOResult;
1518aaad4303SSolomon Peachy 	u16  VRHFOResult;
15199cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_LFOStatus_t;
152000b3ed16SGreg Kroah-Hartman 
152100b3ed16SGreg Kroah-Hartman #define HFA384x_TESTRESULT_ALLPASSED    BIT0
152200b3ed16SGreg Kroah-Hartman #define HFA384x_TESTRESULT_LFO_FAIL     BIT1
152300b3ed16SGreg Kroah-Hartman #define HFA384x_TESTRESULT_VR_HF0_FAIL  BIT2
152400b3ed16SGreg Kroah-Hartman #define HFA384x_HOST_FIRM_COORDINATE    BIT7
152500b3ed16SGreg Kroah-Hartman #define HFA384x_TESTRESULT_COORDINATE   BIT15
152600b3ed16SGreg Kroah-Hartman 
152700b3ed16SGreg Kroah-Hartman /*-- Information Record: LEDControl --*/
152800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_LEDControl
152900b3ed16SGreg Kroah-Hartman {
1530aaad4303SSolomon Peachy 	u16  searching_on;
1531aaad4303SSolomon Peachy 	u16  searching_off;
1532aaad4303SSolomon Peachy 	u16  assoc_on;
1533aaad4303SSolomon Peachy 	u16  assoc_off;
1534aaad4303SSolomon Peachy 	u16  activity;
15359cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_LEDControl_t;
153600b3ed16SGreg Kroah-Hartman 
153700b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
153800b3ed16SGreg Kroah-Hartman                  FRAME DESCRIPTORS AND FRAME STRUCTURES
153900b3ed16SGreg Kroah-Hartman 
154000b3ed16SGreg Kroah-Hartman FRAME DESCRIPTORS: Offsets
154100b3ed16SGreg Kroah-Hartman 
154200b3ed16SGreg Kroah-Hartman ----------------------------------------------------------------------
154300b3ed16SGreg Kroah-Hartman Control Info (offset 44-51)
154400b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
1545aaad4303SSolomon Peachy #define		HFA384x_FD_STATUS_OFF			((u16)0x44)
1546aaad4303SSolomon Peachy #define		HFA384x_FD_TIME_OFF			((u16)0x46)
1547aaad4303SSolomon Peachy #define		HFA384x_FD_SWSUPPORT_OFF		((u16)0x4A)
1548aaad4303SSolomon Peachy #define		HFA384x_FD_SILENCE_OFF			((u16)0x4A)
1549aaad4303SSolomon Peachy #define		HFA384x_FD_SIGNAL_OFF			((u16)0x4B)
1550aaad4303SSolomon Peachy #define		HFA384x_FD_RATE_OFF			((u16)0x4C)
1551aaad4303SSolomon Peachy #define		HFA384x_FD_RXFLOW_OFF			((u16)0x4D)
1552aaad4303SSolomon Peachy #define		HFA384x_FD_RESERVED_OFF			((u16)0x4E)
1553aaad4303SSolomon Peachy #define		HFA384x_FD_TXCONTROL_OFF		((u16)0x50)
155400b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
155500b3ed16SGreg Kroah-Hartman 802.11 Header (offset 52-6B)
155600b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
1557aaad4303SSolomon Peachy #define		HFA384x_FD_FRAMECONTROL_OFF		((u16)0x52)
1558aaad4303SSolomon Peachy #define		HFA384x_FD_DURATIONID_OFF		((u16)0x54)
1559aaad4303SSolomon Peachy #define		HFA384x_FD_ADDRESS1_OFF			((u16)0x56)
1560aaad4303SSolomon Peachy #define		HFA384x_FD_ADDRESS2_OFF			((u16)0x5C)
1561aaad4303SSolomon Peachy #define		HFA384x_FD_ADDRESS3_OFF			((u16)0x62)
1562aaad4303SSolomon Peachy #define		HFA384x_FD_SEQCONTROL_OFF		((u16)0x68)
1563aaad4303SSolomon Peachy #define		HFA384x_FD_ADDRESS4_OFF			((u16)0x6A)
1564aaad4303SSolomon Peachy #define		HFA384x_FD_DATALEN_OFF			((u16)0x70)
156500b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
156600b3ed16SGreg Kroah-Hartman 802.3 Header (offset 72-7F)
156700b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
1568aaad4303SSolomon Peachy #define		HFA384x_FD_DESTADDRESS_OFF		((u16)0x72)
1569aaad4303SSolomon Peachy #define		HFA384x_FD_SRCADDRESS_OFF		((u16)0x78)
1570aaad4303SSolomon Peachy #define		HFA384x_FD_DATALENGTH_OFF		((u16)0x7E)
157100b3ed16SGreg Kroah-Hartman 
157200b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
157300b3ed16SGreg Kroah-Hartman FRAME STRUCTURES: Communication Frames
157400b3ed16SGreg Kroah-Hartman ----------------------------------------------------------------------
157500b3ed16SGreg Kroah-Hartman Communication Frames: Transmit Frames
157600b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
157700b3ed16SGreg Kroah-Hartman /*-- Communication Frame: Transmit Frame Structure --*/
157800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_tx_frame
157900b3ed16SGreg Kroah-Hartman {
1580aaad4303SSolomon Peachy 	u16	status;
1581aaad4303SSolomon Peachy 	u16	reserved1;
1582aaad4303SSolomon Peachy 	u16	reserved2;
1583aaad4303SSolomon Peachy 	u32	sw_support;
1584aaad4303SSolomon Peachy 	u8	tx_retrycount;
1585aaad4303SSolomon Peachy 	u8   tx_rate;
1586aaad4303SSolomon Peachy 	u16	tx_control;
158700b3ed16SGreg Kroah-Hartman 
158800b3ed16SGreg Kroah-Hartman 	/*-- 802.11 Header Information --*/
158900b3ed16SGreg Kroah-Hartman 
1590aaad4303SSolomon Peachy 	u16	frame_control;
1591aaad4303SSolomon Peachy 	u16	duration_id;
1592aaad4303SSolomon Peachy 	u8	address1[6];
1593aaad4303SSolomon Peachy 	u8	address2[6];
1594aaad4303SSolomon Peachy 	u8	address3[6];
1595aaad4303SSolomon Peachy 	u16	sequence_control;
1596aaad4303SSolomon Peachy 	u8	address4[6];
1597aaad4303SSolomon Peachy 	u16	data_len; /* little endian format */
159800b3ed16SGreg Kroah-Hartman 
159900b3ed16SGreg Kroah-Hartman 	/*-- 802.3 Header Information --*/
160000b3ed16SGreg Kroah-Hartman 
1601aaad4303SSolomon Peachy 	u8	dest_addr[6];
1602aaad4303SSolomon Peachy 	u8	src_addr[6];
1603aaad4303SSolomon Peachy 	u16	data_length; /* big endian format */
16049cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_tx_frame_t;
160500b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
160600b3ed16SGreg Kroah-Hartman Communication Frames: Field Masks for Transmit Frames
160700b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
160800b3ed16SGreg Kroah-Hartman /*-- Status Field --*/
1609aaad4303SSolomon Peachy #define		HFA384x_TXSTATUS_ACKERR			((u16)BIT5)
1610aaad4303SSolomon Peachy #define		HFA384x_TXSTATUS_FORMERR		((u16)BIT3)
1611aaad4303SSolomon Peachy #define		HFA384x_TXSTATUS_DISCON			((u16)BIT2)
1612aaad4303SSolomon Peachy #define		HFA384x_TXSTATUS_AGEDERR		((u16)BIT1)
1613aaad4303SSolomon Peachy #define		HFA384x_TXSTATUS_RETRYERR		((u16)BIT0)
161400b3ed16SGreg Kroah-Hartman /*-- Transmit Control Field --*/
1615aaad4303SSolomon Peachy #define		HFA384x_TX_CFPOLL			((u16)BIT12)
1616aaad4303SSolomon Peachy #define		HFA384x_TX_PRST				((u16)BIT11)
1617aaad4303SSolomon Peachy #define		HFA384x_TX_MACPORT			((u16)(BIT10 | BIT9 | BIT8))
1618aaad4303SSolomon Peachy #define		HFA384x_TX_NOENCRYPT			((u16)BIT7)
1619aaad4303SSolomon Peachy #define		HFA384x_TX_RETRYSTRAT			((u16)(BIT6 | BIT5))
1620aaad4303SSolomon Peachy #define		HFA384x_TX_STRUCTYPE			((u16)(BIT4 | BIT3))
1621aaad4303SSolomon Peachy #define		HFA384x_TX_TXEX				((u16)BIT2)
1622aaad4303SSolomon Peachy #define		HFA384x_TX_TXOK				((u16)BIT1)
162300b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
162400b3ed16SGreg Kroah-Hartman Communication Frames: Test/Get/Set Field Values for Transmit Frames
162500b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
162600b3ed16SGreg Kroah-Hartman /*-- Status Field --*/
162700b3ed16SGreg Kroah-Hartman #define HFA384x_TXSTATUS_ISERROR(v)	\
1628aaad4303SSolomon Peachy 	(((u16)(v))&\
162900b3ed16SGreg Kroah-Hartman 	(HFA384x_TXSTATUS_ACKERR|HFA384x_TXSTATUS_FORMERR|\
163000b3ed16SGreg Kroah-Hartman 	HFA384x_TXSTATUS_DISCON|HFA384x_TXSTATUS_AGEDERR|\
163100b3ed16SGreg Kroah-Hartman 	HFA384x_TXSTATUS_RETRYERR))
163200b3ed16SGreg Kroah-Hartman 
1633aaad4303SSolomon Peachy #define	HFA384x_TXSTATUS_ISACKERR(v)	((u16)(((u16)(v)) & HFA384x_TXSTATUS_ACKERR))
1634aaad4303SSolomon Peachy #define	HFA384x_TXSTATUS_ISFORMERR(v)	((u16)(((u16)(v)) & HFA384x_TXSTATUS_FORMERR))
1635aaad4303SSolomon Peachy #define	HFA384x_TXSTATUS_ISDISCON(v)	((u16)(((u16)(v)) & HFA384x_TXSTATUS_DISCON))
1636aaad4303SSolomon Peachy #define	HFA384x_TXSTATUS_ISAGEDERR(v)	((u16)(((u16)(v)) & HFA384x_TXSTATUS_AGEDERR))
1637aaad4303SSolomon Peachy #define	HFA384x_TXSTATUS_ISRETRYERR(v)	((u16)(((u16)(v)) & HFA384x_TXSTATUS_RETRYERR))
163800b3ed16SGreg Kroah-Hartman 
1639aaad4303SSolomon Peachy #define	HFA384x_TX_GET(v,m,s)		((((u16)(v))&((u16)(m)))>>((u16)(s)))
1640aaad4303SSolomon Peachy #define	HFA384x_TX_SET(v,m,s)		((((u16)(v))<<((u16)(s)))&((u16)(m)))
164100b3ed16SGreg Kroah-Hartman 
164200b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_CFPOLL_GET(v)	HFA384x_TX_GET(v, HFA384x_TX_CFPOLL,12)
164300b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_CFPOLL_SET(v)	HFA384x_TX_SET(v, HFA384x_TX_CFPOLL,12)
164400b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_PRST_GET(v)		HFA384x_TX_GET(v, HFA384x_TX_PRST,11)
164500b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_PRST_SET(v)		HFA384x_TX_SET(v, HFA384x_TX_PRST,11)
164600b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_MACPORT_GET(v)	HFA384x_TX_GET(v, HFA384x_TX_MACPORT, 8)
164700b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_MACPORT_SET(v)	HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8)
164800b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_NOENCRYPT_GET(v)	HFA384x_TX_GET(v, HFA384x_TX_NOENCRYPT, 7)
164900b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_NOENCRYPT_SET(v)	HFA384x_TX_SET(v, HFA384x_TX_NOENCRYPT, 7)
165000b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_RETRYSTRAT_GET(v)	HFA384x_TX_GET(v, HFA384x_TX_RETRYSTRAT, 5)
165100b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_RETRYSTRAT_SET(v)	HFA384x_TX_SET(v, HFA384x_TX_RETRYSTRAT, 5)
165200b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_STRUCTYPE_GET(v)	HFA384x_TX_GET(v, HFA384x_TX_STRUCTYPE, 3)
165300b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_STRUCTYPE_SET(v)	HFA384x_TX_SET(v, HFA384x_TX_STRUCTYPE, 3)
165400b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_TXEX_GET(v)		HFA384x_TX_GET(v, HFA384x_TX_TXEX, 2)
165500b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_TXEX_SET(v)		HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2)
165600b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_TXOK_GET(v)		HFA384x_TX_GET(v, HFA384x_TX_TXOK, 1)
165700b3ed16SGreg Kroah-Hartman #define	HFA384x_TX_TXOK_SET(v)		HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1)
165800b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
165900b3ed16SGreg Kroah-Hartman Communication Frames: Receive Frames
166000b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
166100b3ed16SGreg Kroah-Hartman /*-- Communication Frame: Receive Frame Structure --*/
166200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_rx_frame
166300b3ed16SGreg Kroah-Hartman {
166400b3ed16SGreg Kroah-Hartman 	/*-- MAC rx descriptor (hfa384x byte order) --*/
1665aaad4303SSolomon Peachy 	u16	status;
1666aaad4303SSolomon Peachy 	u32	time;
1667aaad4303SSolomon Peachy 	u8	silence;
1668aaad4303SSolomon Peachy 	u8	signal;
1669aaad4303SSolomon Peachy 	u8	rate;
1670aaad4303SSolomon Peachy 	u8	rx_flow;
1671aaad4303SSolomon Peachy 	u16	reserved1;
1672aaad4303SSolomon Peachy 	u16	reserved2;
167300b3ed16SGreg Kroah-Hartman 
167400b3ed16SGreg Kroah-Hartman 	/*-- 802.11 Header Information (802.11 byte order) --*/
1675aaad4303SSolomon Peachy 	u16	frame_control;
1676aaad4303SSolomon Peachy 	u16	duration_id;
1677aaad4303SSolomon Peachy 	u8	address1[6];
1678aaad4303SSolomon Peachy 	u8	address2[6];
1679aaad4303SSolomon Peachy 	u8	address3[6];
1680aaad4303SSolomon Peachy 	u16	sequence_control;
1681aaad4303SSolomon Peachy 	u8	address4[6];
1682aaad4303SSolomon Peachy 	u16	data_len; /* hfa384x (little endian) format */
168300b3ed16SGreg Kroah-Hartman 
168400b3ed16SGreg Kroah-Hartman 	/*-- 802.3 Header Information --*/
1685aaad4303SSolomon Peachy 	u8	dest_addr[6];
1686aaad4303SSolomon Peachy 	u8	src_addr[6];
1687aaad4303SSolomon Peachy 	u16	data_length; /* IEEE? (big endian) format */
16889cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_rx_frame_t;
168900b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
169000b3ed16SGreg Kroah-Hartman Communication Frames: Field Masks for Receive Frames
169100b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
169200b3ed16SGreg Kroah-Hartman /*-- Offsets --------*/
1693aaad4303SSolomon Peachy #define		HFA384x_RX_DATA_LEN_OFF			((u16)44)
1694aaad4303SSolomon Peachy #define		HFA384x_RX_80211HDR_OFF			((u16)14)
1695aaad4303SSolomon Peachy #define		HFA384x_RX_DATA_OFF			((u16)60)
169600b3ed16SGreg Kroah-Hartman 
169700b3ed16SGreg Kroah-Hartman /*-- Status Fields --*/
1698aaad4303SSolomon Peachy #define		HFA384x_RXSTATUS_MSGTYPE		((u16)(BIT15 | BIT14 | BIT13))
1699aaad4303SSolomon Peachy #define		HFA384x_RXSTATUS_MACPORT		((u16)(BIT10 | BIT9 | BIT8))
1700aaad4303SSolomon Peachy #define		HFA384x_RXSTATUS_UNDECR			((u16)BIT1)
1701aaad4303SSolomon Peachy #define		HFA384x_RXSTATUS_FCSERR			((u16)BIT0)
170200b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
170300b3ed16SGreg Kroah-Hartman Communication Frames: Test/Get/Set Field Values for Receive Frames
170400b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
1705aaad4303SSolomon Peachy #define		HFA384x_RXSTATUS_MSGTYPE_GET(value)	((u16)((((u16)(value)) & HFA384x_RXSTATUS_MSGTYPE) >> 13))
1706aaad4303SSolomon Peachy #define		HFA384x_RXSTATUS_MSGTYPE_SET(value)	((u16)(((u16)(value)) << 13))
1707aaad4303SSolomon Peachy #define		HFA384x_RXSTATUS_MACPORT_GET(value)	((u16)((((u16)(value)) & HFA384x_RXSTATUS_MACPORT) >> 8))
1708aaad4303SSolomon Peachy #define		HFA384x_RXSTATUS_MACPORT_SET(value)	((u16)(((u16)(value)) << 8))
1709aaad4303SSolomon Peachy #define		HFA384x_RXSTATUS_ISUNDECR(value)	((u16)(((u16)(value)) & HFA384x_RXSTATUS_UNDECR))
1710aaad4303SSolomon Peachy #define		HFA384x_RXSTATUS_ISFCSERR(value)	((u16)(((u16)(value)) & HFA384x_RXSTATUS_FCSERR))
171100b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
171200b3ed16SGreg Kroah-Hartman  FRAME STRUCTURES: Information Types and Information Frame Structures
171300b3ed16SGreg Kroah-Hartman ----------------------------------------------------------------------
171400b3ed16SGreg Kroah-Hartman Information Types
171500b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
1716aaad4303SSolomon Peachy #define		HFA384x_IT_HANDOVERADDR			((u16)0xF000UL)
1717aaad4303SSolomon Peachy #define		HFA384x_IT_HANDOVERDEAUTHADDRESS	((u16)0xF001UL)//AP 1.3.7
1718aaad4303SSolomon Peachy #define		HFA384x_IT_COMMTALLIES			((u16)0xF100UL)
1719aaad4303SSolomon Peachy #define		HFA384x_IT_SCANRESULTS			((u16)0xF101UL)
1720aaad4303SSolomon Peachy #define		HFA384x_IT_CHINFORESULTS		((u16)0xF102UL)
1721aaad4303SSolomon Peachy #define		HFA384x_IT_HOSTSCANRESULTS		((u16)0xF103UL)
1722aaad4303SSolomon Peachy #define		HFA384x_IT_LINKSTATUS			((u16)0xF200UL)
1723aaad4303SSolomon Peachy #define		HFA384x_IT_ASSOCSTATUS			((u16)0xF201UL)
1724aaad4303SSolomon Peachy #define		HFA384x_IT_AUTHREQ			((u16)0xF202UL)
1725aaad4303SSolomon Peachy #define		HFA384x_IT_PSUSERCNT			((u16)0xF203UL)
1726aaad4303SSolomon Peachy #define		HFA384x_IT_KEYIDCHANGED			((u16)0xF204UL)
1727aaad4303SSolomon Peachy #define		HFA384x_IT_ASSOCREQ    			((u16)0xF205UL)
1728aaad4303SSolomon Peachy #define		HFA384x_IT_MICFAILURE  			((u16)0xF206UL)
172900b3ed16SGreg Kroah-Hartman 
173000b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
173100b3ed16SGreg Kroah-Hartman Information Frames Structures
173200b3ed16SGreg Kroah-Hartman ----------------------------------------------------------------------
173300b3ed16SGreg Kroah-Hartman Information Frames: Notification Frame Structures
173400b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
173500b3ed16SGreg Kroah-Hartman /*--  Notification Frame,MAC Mgmt: Handover Address --*/
173600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_HandoverAddr
173700b3ed16SGreg Kroah-Hartman {
1738aaad4303SSolomon Peachy 	u16	framelen;
1739aaad4303SSolomon Peachy 	u16	infotype;
1740aaad4303SSolomon Peachy 	u8	handover_addr[WLAN_BSSID_LEN];
17419cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_HandoverAddr_t;
174200b3ed16SGreg Kroah-Hartman 
174300b3ed16SGreg Kroah-Hartman /*--  Inquiry Frame, Diagnose: Communication Tallies --*/
174400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CommTallies16
174500b3ed16SGreg Kroah-Hartman {
1746aaad4303SSolomon Peachy 	u16	txunicastframes;
1747aaad4303SSolomon Peachy 	u16	txmulticastframes;
1748aaad4303SSolomon Peachy 	u16	txfragments;
1749aaad4303SSolomon Peachy 	u16	txunicastoctets;
1750aaad4303SSolomon Peachy 	u16	txmulticastoctets;
1751aaad4303SSolomon Peachy 	u16	txdeferredtrans;
1752aaad4303SSolomon Peachy 	u16	txsingleretryframes;
1753aaad4303SSolomon Peachy 	u16	txmultipleretryframes;
1754aaad4303SSolomon Peachy 	u16	txretrylimitexceeded;
1755aaad4303SSolomon Peachy 	u16	txdiscards;
1756aaad4303SSolomon Peachy 	u16	rxunicastframes;
1757aaad4303SSolomon Peachy 	u16	rxmulticastframes;
1758aaad4303SSolomon Peachy 	u16	rxfragments;
1759aaad4303SSolomon Peachy 	u16	rxunicastoctets;
1760aaad4303SSolomon Peachy 	u16	rxmulticastoctets;
1761aaad4303SSolomon Peachy 	u16	rxfcserrors;
1762aaad4303SSolomon Peachy 	u16	rxdiscardsnobuffer;
1763aaad4303SSolomon Peachy 	u16	txdiscardswrongsa;
1764aaad4303SSolomon Peachy 	u16	rxdiscardswepundecr;
1765aaad4303SSolomon Peachy 	u16	rxmsginmsgfrag;
1766aaad4303SSolomon Peachy 	u16	rxmsginbadmsgfrag;
17679cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CommTallies16_t;
176800b3ed16SGreg Kroah-Hartman 
176900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_CommTallies32
177000b3ed16SGreg Kroah-Hartman {
1771aaad4303SSolomon Peachy 	u32	txunicastframes;
1772aaad4303SSolomon Peachy 	u32	txmulticastframes;
1773aaad4303SSolomon Peachy 	u32	txfragments;
1774aaad4303SSolomon Peachy 	u32	txunicastoctets;
1775aaad4303SSolomon Peachy 	u32	txmulticastoctets;
1776aaad4303SSolomon Peachy 	u32	txdeferredtrans;
1777aaad4303SSolomon Peachy 	u32	txsingleretryframes;
1778aaad4303SSolomon Peachy 	u32	txmultipleretryframes;
1779aaad4303SSolomon Peachy 	u32	txretrylimitexceeded;
1780aaad4303SSolomon Peachy 	u32	txdiscards;
1781aaad4303SSolomon Peachy 	u32	rxunicastframes;
1782aaad4303SSolomon Peachy 	u32	rxmulticastframes;
1783aaad4303SSolomon Peachy 	u32	rxfragments;
1784aaad4303SSolomon Peachy 	u32	rxunicastoctets;
1785aaad4303SSolomon Peachy 	u32	rxmulticastoctets;
1786aaad4303SSolomon Peachy 	u32	rxfcserrors;
1787aaad4303SSolomon Peachy 	u32	rxdiscardsnobuffer;
1788aaad4303SSolomon Peachy 	u32	txdiscardswrongsa;
1789aaad4303SSolomon Peachy 	u32	rxdiscardswepundecr;
1790aaad4303SSolomon Peachy 	u32	rxmsginmsgfrag;
1791aaad4303SSolomon Peachy 	u32	rxmsginbadmsgfrag;
17929cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_CommTallies32_t;
179300b3ed16SGreg Kroah-Hartman 
179400b3ed16SGreg Kroah-Hartman /*--  Inquiry Frame, Diagnose: Scan Results & Subfields--*/
179500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_ScanResultSub
179600b3ed16SGreg Kroah-Hartman {
1797aaad4303SSolomon Peachy 	u16	chid;
1798aaad4303SSolomon Peachy 	u16	anl;
1799aaad4303SSolomon Peachy 	u16	sl;
1800aaad4303SSolomon Peachy 	u8	bssid[WLAN_BSSID_LEN];
1801aaad4303SSolomon Peachy 	u16	bcnint;
1802aaad4303SSolomon Peachy 	u16	capinfo;
180300b3ed16SGreg Kroah-Hartman 	hfa384x_bytestr32_t	ssid;
1804aaad4303SSolomon Peachy 	u8	supprates[10]; /* 802.11 info element */
1805aaad4303SSolomon Peachy 	u16	proberesp_rate;
18069cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_ScanResultSub_t;
180700b3ed16SGreg Kroah-Hartman 
180800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_ScanResult
180900b3ed16SGreg Kroah-Hartman {
1810aaad4303SSolomon Peachy 	u16	rsvd;
1811aaad4303SSolomon Peachy 	u16	scanreason;
181200b3ed16SGreg Kroah-Hartman 	hfa384x_ScanResultSub_t
181300b3ed16SGreg Kroah-Hartman 		result[HFA384x_SCANRESULT_MAX];
18149cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_ScanResult_t;
181500b3ed16SGreg Kroah-Hartman 
181600b3ed16SGreg Kroah-Hartman /*--  Inquiry Frame, Diagnose: ChInfo Results & Subfields--*/
181700b3ed16SGreg Kroah-Hartman typedef struct hfa384x_ChInfoResultSub
181800b3ed16SGreg Kroah-Hartman {
1819aaad4303SSolomon Peachy 	u16	chid;
1820aaad4303SSolomon Peachy 	u16	anl;
1821aaad4303SSolomon Peachy 	u16	pnl;
1822aaad4303SSolomon Peachy 	u16	active;
18239cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_ChInfoResultSub_t;
182400b3ed16SGreg Kroah-Hartman 
182500b3ed16SGreg Kroah-Hartman #define HFA384x_CHINFORESULT_BSSACTIVE	BIT0
182600b3ed16SGreg Kroah-Hartman #define HFA384x_CHINFORESULT_PCFACTIVE	BIT1
182700b3ed16SGreg Kroah-Hartman 
182800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_ChInfoResult
182900b3ed16SGreg Kroah-Hartman {
1830aaad4303SSolomon Peachy 	u16	scanchannels;
183100b3ed16SGreg Kroah-Hartman 	hfa384x_ChInfoResultSub_t
183200b3ed16SGreg Kroah-Hartman 		result[HFA384x_CHINFORESULT_MAX];
18339cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_ChInfoResult_t;
183400b3ed16SGreg Kroah-Hartman 
183500b3ed16SGreg Kroah-Hartman /*--  Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/
183600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_HScanResultSub
183700b3ed16SGreg Kroah-Hartman {
1838aaad4303SSolomon Peachy 	u16	chid;
1839aaad4303SSolomon Peachy 	u16	anl;
1840aaad4303SSolomon Peachy 	u16	sl;
1841aaad4303SSolomon Peachy 	u8	bssid[WLAN_BSSID_LEN];
1842aaad4303SSolomon Peachy 	u16	bcnint;
1843aaad4303SSolomon Peachy 	u16	capinfo;
184400b3ed16SGreg Kroah-Hartman 	hfa384x_bytestr32_t	ssid;
1845aaad4303SSolomon Peachy 	u8	supprates[10]; /* 802.11 info element */
1846aaad4303SSolomon Peachy 	u16	proberesp_rate;
1847aaad4303SSolomon Peachy 	u16	atim;
18489cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_HScanResultSub_t;
184900b3ed16SGreg Kroah-Hartman 
185000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_HScanResult
185100b3ed16SGreg Kroah-Hartman {
1852aaad4303SSolomon Peachy 	u16	nresult;
1853aaad4303SSolomon Peachy 	u16	rsvd;
185400b3ed16SGreg Kroah-Hartman 	hfa384x_HScanResultSub_t
185500b3ed16SGreg Kroah-Hartman 		result[HFA384x_HSCANRESULT_MAX];
18569cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_HScanResult_t;
185700b3ed16SGreg Kroah-Hartman 
185800b3ed16SGreg Kroah-Hartman /*--  Unsolicited Frame, MAC Mgmt: LinkStatus --*/
185900b3ed16SGreg Kroah-Hartman 
1860aaad4303SSolomon Peachy #define HFA384x_LINK_NOTCONNECTED	((u16)0)
1861aaad4303SSolomon Peachy #define HFA384x_LINK_CONNECTED		((u16)1)
1862aaad4303SSolomon Peachy #define HFA384x_LINK_DISCONNECTED	((u16)2)
1863aaad4303SSolomon Peachy #define HFA384x_LINK_AP_CHANGE		((u16)3)
1864aaad4303SSolomon Peachy #define HFA384x_LINK_AP_OUTOFRANGE	((u16)4)
1865aaad4303SSolomon Peachy #define HFA384x_LINK_AP_INRANGE		((u16)5)
1866aaad4303SSolomon Peachy #define HFA384x_LINK_ASSOCFAIL		((u16)6)
186700b3ed16SGreg Kroah-Hartman 
186800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_LinkStatus
186900b3ed16SGreg Kroah-Hartman {
1870aaad4303SSolomon Peachy 	u16	linkstatus;
18719cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_LinkStatus_t;
187200b3ed16SGreg Kroah-Hartman 
187300b3ed16SGreg Kroah-Hartman 
187400b3ed16SGreg Kroah-Hartman /*--  Unsolicited Frame, MAC Mgmt: AssociationStatus (--*/
187500b3ed16SGreg Kroah-Hartman 
1876aaad4303SSolomon Peachy #define HFA384x_ASSOCSTATUS_STAASSOC	((u16)1)
1877aaad4303SSolomon Peachy #define HFA384x_ASSOCSTATUS_REASSOC	((u16)2)
1878aaad4303SSolomon Peachy #define HFA384x_ASSOCSTATUS_DISASSOC	((u16)3)
1879aaad4303SSolomon Peachy #define HFA384x_ASSOCSTATUS_ASSOCFAIL	((u16)4)
1880aaad4303SSolomon Peachy #define HFA384x_ASSOCSTATUS_AUTHFAIL	((u16)5)
188100b3ed16SGreg Kroah-Hartman 
188200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_AssocStatus
188300b3ed16SGreg Kroah-Hartman {
1884aaad4303SSolomon Peachy 	u16	assocstatus;
188528b17a4bSMoritz Muehlenhoff 	u8	sta_addr[ETH_ALEN];
188600b3ed16SGreg Kroah-Hartman 	/* old_ap_addr is only valid if assocstatus == 2 */
188728b17a4bSMoritz Muehlenhoff 	u8	old_ap_addr[ETH_ALEN];
1888aaad4303SSolomon Peachy 	u16	reason;
1889aaad4303SSolomon Peachy 	u16	reserved;
18909cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_AssocStatus_t;
189100b3ed16SGreg Kroah-Hartman 
189200b3ed16SGreg Kroah-Hartman /*--  Unsolicited Frame, MAC Mgmt: AuthRequest (AP Only) --*/
189300b3ed16SGreg Kroah-Hartman 
189400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_AuthRequest
189500b3ed16SGreg Kroah-Hartman {
189628b17a4bSMoritz Muehlenhoff 	u8	sta_addr[ETH_ALEN];
1897aaad4303SSolomon Peachy 	u16	algorithm;
18989cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_AuthReq_t;
189900b3ed16SGreg Kroah-Hartman 
190000b3ed16SGreg Kroah-Hartman /*--  Unsolicited Frame, MAC Mgmt: AssocRequest (AP Only) --*/
190100b3ed16SGreg Kroah-Hartman 
190200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_AssocRequest
190300b3ed16SGreg Kroah-Hartman {
190428b17a4bSMoritz Muehlenhoff 	u8	sta_addr[ETH_ALEN];
1905aaad4303SSolomon Peachy 	u16	type;
1906aaad4303SSolomon Peachy 	u8   wpa_data[80];
19079cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_AssocReq_t;
190800b3ed16SGreg Kroah-Hartman 
190900b3ed16SGreg Kroah-Hartman 
191000b3ed16SGreg Kroah-Hartman #define HFA384x_ASSOCREQ_TYPE_ASSOC     0
191100b3ed16SGreg Kroah-Hartman #define HFA384x_ASSOCREQ_TYPE_REASSOC   1
191200b3ed16SGreg Kroah-Hartman 
191300b3ed16SGreg Kroah-Hartman /*--  Unsolicited Frame, MAC Mgmt: MIC Failure  (AP Only) --*/
191400b3ed16SGreg Kroah-Hartman 
191500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_MicFailure
191600b3ed16SGreg Kroah-Hartman {
191728b17a4bSMoritz Muehlenhoff 	u8	sender[ETH_ALEN];
191828b17a4bSMoritz Muehlenhoff 	u8	dest[ETH_ALEN];
19199cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_MicFailure_t;
192000b3ed16SGreg Kroah-Hartman 
192100b3ed16SGreg Kroah-Hartman /*--  Unsolicited Frame, MAC Mgmt: PSUserCount (AP Only) --*/
192200b3ed16SGreg Kroah-Hartman 
192300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_PSUserCount
192400b3ed16SGreg Kroah-Hartman {
1925aaad4303SSolomon Peachy 	u16	usercnt;
19269cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_PSUserCount_t;
192700b3ed16SGreg Kroah-Hartman 
192800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_KeyIDChanged
192900b3ed16SGreg Kroah-Hartman {
193028b17a4bSMoritz Muehlenhoff 	u8	sta_addr[ETH_ALEN];
1931aaad4303SSolomon Peachy 	u16	keyid;
19329cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_KeyIDChanged_t;
193300b3ed16SGreg Kroah-Hartman 
193400b3ed16SGreg Kroah-Hartman /*--  Collection of all Inf frames ---------------*/
193500b3ed16SGreg Kroah-Hartman typedef union hfa384x_infodata {
193600b3ed16SGreg Kroah-Hartman 	hfa384x_CommTallies16_t	commtallies16;
193700b3ed16SGreg Kroah-Hartman 	hfa384x_CommTallies32_t	commtallies32;
193800b3ed16SGreg Kroah-Hartman 	hfa384x_ScanResult_t	scanresult;
193900b3ed16SGreg Kroah-Hartman 	hfa384x_ChInfoResult_t	chinforesult;
194000b3ed16SGreg Kroah-Hartman 	hfa384x_HScanResult_t	hscanresult;
194100b3ed16SGreg Kroah-Hartman 	hfa384x_LinkStatus_t	linkstatus;
194200b3ed16SGreg Kroah-Hartman 	hfa384x_AssocStatus_t	assocstatus;
194300b3ed16SGreg Kroah-Hartman 	hfa384x_AuthReq_t	authreq;
194400b3ed16SGreg Kroah-Hartman 	hfa384x_PSUserCount_t	psusercnt;
194500b3ed16SGreg Kroah-Hartman 	hfa384x_KeyIDChanged_t  keyidchanged;
19469cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_infodata_t;
194700b3ed16SGreg Kroah-Hartman 
194800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_InfFrame
194900b3ed16SGreg Kroah-Hartman {
1950aaad4303SSolomon Peachy 	u16			framelen;
1951aaad4303SSolomon Peachy 	u16			infotype;
195200b3ed16SGreg Kroah-Hartman 	hfa384x_infodata_t	info;
19539cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_InfFrame_t;
195400b3ed16SGreg Kroah-Hartman 
195500b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
195600b3ed16SGreg Kroah-Hartman USB Packet structures and constants.
195700b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
195800b3ed16SGreg Kroah-Hartman 
195900b3ed16SGreg Kroah-Hartman /* Should be sent to the ctrlout endpoint */
196000b3ed16SGreg Kroah-Hartman #define HFA384x_USB_ENBULKIN	6
196100b3ed16SGreg Kroah-Hartman 
196200b3ed16SGreg Kroah-Hartman /* Should be sent to the bulkout endpoint */
196300b3ed16SGreg Kroah-Hartman #define HFA384x_USB_TXFRM	0
196400b3ed16SGreg Kroah-Hartman #define HFA384x_USB_CMDREQ	1
196500b3ed16SGreg Kroah-Hartman #define HFA384x_USB_WRIDREQ	2
196600b3ed16SGreg Kroah-Hartman #define HFA384x_USB_RRIDREQ	3
196700b3ed16SGreg Kroah-Hartman #define HFA384x_USB_WMEMREQ	4
196800b3ed16SGreg Kroah-Hartman #define HFA384x_USB_RMEMREQ	5
196900b3ed16SGreg Kroah-Hartman 
197000b3ed16SGreg Kroah-Hartman /* Received from the bulkin endpoint */
197100b3ed16SGreg Kroah-Hartman #define HFA384x_USB_ISFRM(a)	(!((a) & 0x8000))
197200b3ed16SGreg Kroah-Hartman #define HFA384x_USB_ISTXFRM(a)	(((a) & 0x9000) == 0x1000)
197300b3ed16SGreg Kroah-Hartman #define HFA384x_USB_ISRXFRM(a)	(!((a) & 0x9000))
197400b3ed16SGreg Kroah-Hartman #define HFA384x_USB_INFOFRM	0x8000
197500b3ed16SGreg Kroah-Hartman #define HFA384x_USB_CMDRESP	0x8001
197600b3ed16SGreg Kroah-Hartman #define HFA384x_USB_WRIDRESP	0x8002
197700b3ed16SGreg Kroah-Hartman #define HFA384x_USB_RRIDRESP	0x8003
197800b3ed16SGreg Kroah-Hartman #define HFA384x_USB_WMEMRESP	0x8004
197900b3ed16SGreg Kroah-Hartman #define HFA384x_USB_RMEMRESP	0x8005
198000b3ed16SGreg Kroah-Hartman #define HFA384x_USB_BUFAVAIL	0x8006
198100b3ed16SGreg Kroah-Hartman #define HFA384x_USB_ERROR	0x8007
198200b3ed16SGreg Kroah-Hartman 
198300b3ed16SGreg Kroah-Hartman /*------------------------------------*/
198400b3ed16SGreg Kroah-Hartman /* Request (bulk OUT) packet contents */
198500b3ed16SGreg Kroah-Hartman 
198600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_txfrm {
198700b3ed16SGreg Kroah-Hartman 	hfa384x_tx_frame_t	desc;
1988aaad4303SSolomon Peachy 	u8			data[WLAN_DATA_MAXLEN];
19899cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usb_txfrm_t;
199000b3ed16SGreg Kroah-Hartman 
199100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_cmdreq {
1992aaad4303SSolomon Peachy 	u16		type;
1993aaad4303SSolomon Peachy 	u16		cmd;
1994aaad4303SSolomon Peachy 	u16		parm0;
1995aaad4303SSolomon Peachy 	u16		parm1;
1996aaad4303SSolomon Peachy 	u16		parm2;
1997aaad4303SSolomon Peachy 	u8		pad[54];
19989cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usb_cmdreq_t;
199900b3ed16SGreg Kroah-Hartman 
200000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_wridreq {
2001aaad4303SSolomon Peachy 	u16		type;
2002aaad4303SSolomon Peachy 	u16		frmlen;
2003aaad4303SSolomon Peachy 	u16		rid;
2004aaad4303SSolomon Peachy 	u8		data[HFA384x_RIDDATA_MAXLEN];
20059cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usb_wridreq_t;
200600b3ed16SGreg Kroah-Hartman 
200700b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rridreq {
2008aaad4303SSolomon Peachy 	u16		type;
2009aaad4303SSolomon Peachy 	u16		frmlen;
2010aaad4303SSolomon Peachy 	u16		rid;
2011aaad4303SSolomon Peachy 	u8		pad[58];
20129cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usb_rridreq_t;
201300b3ed16SGreg Kroah-Hartman 
201400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_wmemreq {
2015aaad4303SSolomon Peachy 	u16		type;
2016aaad4303SSolomon Peachy 	u16		frmlen;
2017aaad4303SSolomon Peachy 	u16		offset;
2018aaad4303SSolomon Peachy 	u16		page;
2019aaad4303SSolomon Peachy 	u8		data[HFA384x_USB_RWMEM_MAXLEN];
20209cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usb_wmemreq_t;
202100b3ed16SGreg Kroah-Hartman 
202200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rmemreq {
2023aaad4303SSolomon Peachy 	u16		type;
2024aaad4303SSolomon Peachy 	u16		frmlen;
2025aaad4303SSolomon Peachy 	u16		offset;
2026aaad4303SSolomon Peachy 	u16		page;
2027aaad4303SSolomon Peachy 	u8		pad[56];
20289cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usb_rmemreq_t;
202900b3ed16SGreg Kroah-Hartman 
203000b3ed16SGreg Kroah-Hartman /*------------------------------------*/
203100b3ed16SGreg Kroah-Hartman /* Response (bulk IN) packet contents */
203200b3ed16SGreg Kroah-Hartman 
203300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rxfrm {
203400b3ed16SGreg Kroah-Hartman 	hfa384x_rx_frame_t	desc;
2035aaad4303SSolomon Peachy 	u8			data[WLAN_DATA_MAXLEN];
20369cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usb_rxfrm_t;
203700b3ed16SGreg Kroah-Hartman 
203800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_infofrm {
2039aaad4303SSolomon Peachy 	u16			type;
204000b3ed16SGreg Kroah-Hartman 	hfa384x_InfFrame_t	info;
20419cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usb_infofrm_t;
204200b3ed16SGreg Kroah-Hartman 
204300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_statusresp {
2044aaad4303SSolomon Peachy 	u16		type;
2045aaad4303SSolomon Peachy 	u16		status;
2046aaad4303SSolomon Peachy 	u16		resp0;
2047aaad4303SSolomon Peachy 	u16		resp1;
2048aaad4303SSolomon Peachy 	u16		resp2;
20499cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usb_cmdresp_t;
205000b3ed16SGreg Kroah-Hartman 
205100b3ed16SGreg Kroah-Hartman typedef hfa384x_usb_cmdresp_t hfa384x_usb_wridresp_t;
205200b3ed16SGreg Kroah-Hartman 
205300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rridresp {
2054aaad4303SSolomon Peachy 	u16		type;
2055aaad4303SSolomon Peachy 	u16		frmlen;
2056aaad4303SSolomon Peachy 	u16		rid;
2057aaad4303SSolomon Peachy 	u8		data[HFA384x_RIDDATA_MAXLEN];
20589cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usb_rridresp_t;
205900b3ed16SGreg Kroah-Hartman 
206000b3ed16SGreg Kroah-Hartman typedef hfa384x_usb_cmdresp_t hfa384x_usb_wmemresp_t;
206100b3ed16SGreg Kroah-Hartman 
206200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rmemresp {
2063aaad4303SSolomon Peachy 	u16		type;
2064aaad4303SSolomon Peachy 	u16		frmlen;
2065aaad4303SSolomon Peachy 	u8		data[HFA384x_USB_RWMEM_MAXLEN];
20669cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usb_rmemresp_t;
206700b3ed16SGreg Kroah-Hartman 
206800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_bufavail {
2069aaad4303SSolomon Peachy 	u16		type;
2070aaad4303SSolomon Peachy 	u16		frmlen;
20719cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usb_bufavail_t;
207200b3ed16SGreg Kroah-Hartman 
207300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_error {
2074aaad4303SSolomon Peachy 	u16		type;
2075aaad4303SSolomon Peachy 	u16		errortype;
20769cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usb_error_t;
207700b3ed16SGreg Kroah-Hartman 
207800b3ed16SGreg Kroah-Hartman /*----------------------------------------------------------*/
207900b3ed16SGreg Kroah-Hartman /* Unions for packaging all the known packet types together */
208000b3ed16SGreg Kroah-Hartman 
208100b3ed16SGreg Kroah-Hartman typedef union hfa384x_usbout {
2082aaad4303SSolomon Peachy 	u16			type;
208300b3ed16SGreg Kroah-Hartman 	hfa384x_usb_txfrm_t	txfrm;
208400b3ed16SGreg Kroah-Hartman 	hfa384x_usb_cmdreq_t	cmdreq;
208500b3ed16SGreg Kroah-Hartman 	hfa384x_usb_wridreq_t	wridreq;
208600b3ed16SGreg Kroah-Hartman 	hfa384x_usb_rridreq_t	rridreq;
208700b3ed16SGreg Kroah-Hartman 	hfa384x_usb_wmemreq_t	wmemreq;
208800b3ed16SGreg Kroah-Hartman 	hfa384x_usb_rmemreq_t	rmemreq;
20899cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usbout_t;
209000b3ed16SGreg Kroah-Hartman 
209100b3ed16SGreg Kroah-Hartman typedef union hfa384x_usbin {
2092aaad4303SSolomon Peachy 	u16			type;
209300b3ed16SGreg Kroah-Hartman 	hfa384x_usb_rxfrm_t	rxfrm;
209400b3ed16SGreg Kroah-Hartman 	hfa384x_usb_txfrm_t	txfrm;
209500b3ed16SGreg Kroah-Hartman 	hfa384x_usb_infofrm_t	infofrm;
209600b3ed16SGreg Kroah-Hartman 	hfa384x_usb_cmdresp_t	cmdresp;
209700b3ed16SGreg Kroah-Hartman 	hfa384x_usb_wridresp_t	wridresp;
209800b3ed16SGreg Kroah-Hartman 	hfa384x_usb_rridresp_t	rridresp;
209900b3ed16SGreg Kroah-Hartman 	hfa384x_usb_wmemresp_t	wmemresp;
210000b3ed16SGreg Kroah-Hartman 	hfa384x_usb_rmemresp_t	rmemresp;
210100b3ed16SGreg Kroah-Hartman 	hfa384x_usb_bufavail_t	bufavail;
210200b3ed16SGreg Kroah-Hartman 	hfa384x_usb_error_t	usberror;
2103aaad4303SSolomon Peachy 	u8			boguspad[3000];
21049cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_usbin_t;
210500b3ed16SGreg Kroah-Hartman 
210600b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
210700b3ed16SGreg Kroah-Hartman PD record structures.
210800b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
210900b3ed16SGreg Kroah-Hartman 
211000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_pcb_partnum
211100b3ed16SGreg Kroah-Hartman {
2112aaad4303SSolomon Peachy 	u8	num[8];
21139cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_pcb_partnum_t;
211400b3ed16SGreg Kroah-Hartman 
211500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_pcb_tracenum
211600b3ed16SGreg Kroah-Hartman {
2117aaad4303SSolomon Peachy 	u8	num[8];
21189cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_pcb_tracenum_t;
211900b3ed16SGreg Kroah-Hartman 
212000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_nic_serial
212100b3ed16SGreg Kroah-Hartman {
2122aaad4303SSolomon Peachy 	u8	num[12];
21239cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_nic_serial_t;
212400b3ed16SGreg Kroah-Hartman 
212500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_mkk_measurements
212600b3ed16SGreg Kroah-Hartman {
212700b3ed16SGreg Kroah-Hartman 	double	carrier_freq;
212800b3ed16SGreg Kroah-Hartman 	double	occupied_band;
212900b3ed16SGreg Kroah-Hartman 	double	power_density;
213000b3ed16SGreg Kroah-Hartman 	double	tx_spur_f1;
213100b3ed16SGreg Kroah-Hartman 	double	tx_spur_f2;
213200b3ed16SGreg Kroah-Hartman 	double	tx_spur_f3;
213300b3ed16SGreg Kroah-Hartman 	double	tx_spur_f4;
213400b3ed16SGreg Kroah-Hartman 	double	tx_spur_l1;
213500b3ed16SGreg Kroah-Hartman 	double	tx_spur_l2;
213600b3ed16SGreg Kroah-Hartman 	double	tx_spur_l3;
213700b3ed16SGreg Kroah-Hartman 	double	tx_spur_l4;
213800b3ed16SGreg Kroah-Hartman 	double	rx_spur_f1;
213900b3ed16SGreg Kroah-Hartman 	double	rx_spur_f2;
214000b3ed16SGreg Kroah-Hartman 	double	rx_spur_l1;
214100b3ed16SGreg Kroah-Hartman 	double	rx_spur_l2;
21429cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_mkk_measurements_t;
214300b3ed16SGreg Kroah-Hartman 
214400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_nic_ramsize
214500b3ed16SGreg Kroah-Hartman {
2146aaad4303SSolomon Peachy 	u8	size[12]; /* units of KB */
21479cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_nic_ramsize_t;
214800b3ed16SGreg Kroah-Hartman 
214900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_mfisuprange
215000b3ed16SGreg Kroah-Hartman {
2151aaad4303SSolomon Peachy 	u16	id;
2152aaad4303SSolomon Peachy 	u16	variant;
2153aaad4303SSolomon Peachy 	u16	bottom;
2154aaad4303SSolomon Peachy 	u16	top;
21559cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_mfisuprange_t;
215600b3ed16SGreg Kroah-Hartman 
215700b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_cfisuprange
215800b3ed16SGreg Kroah-Hartman {
2159aaad4303SSolomon Peachy 	u16	id;
2160aaad4303SSolomon Peachy 	u16	variant;
2161aaad4303SSolomon Peachy 	u16	bottom;
2162aaad4303SSolomon Peachy 	u16	top;
21639cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_cfisuprange_t;
216400b3ed16SGreg Kroah-Hartman 
216500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_nicid
216600b3ed16SGreg Kroah-Hartman {
2167aaad4303SSolomon Peachy 	u16	id;
2168aaad4303SSolomon Peachy 	u16	variant;
2169aaad4303SSolomon Peachy 	u16	major;
2170aaad4303SSolomon Peachy 	u16	minor;
21719cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_nicid_t;
217200b3ed16SGreg Kroah-Hartman 
217300b3ed16SGreg Kroah-Hartman 
217400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_refdac_measurements
217500b3ed16SGreg Kroah-Hartman {
2176aaad4303SSolomon Peachy 	u16	value[0];
21779cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_refdac_measurements_t;
217800b3ed16SGreg Kroah-Hartman 
217900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_vgdac_measurements
218000b3ed16SGreg Kroah-Hartman {
2181aaad4303SSolomon Peachy 	u16	value[0];
21829cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_vgdac_measurements_t;
218300b3ed16SGreg Kroah-Hartman 
218400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_level_comp_measurements
218500b3ed16SGreg Kroah-Hartman {
2186aaad4303SSolomon Peachy 	u16	value[0];
21879cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_level_compc_measurements_t;
218800b3ed16SGreg Kroah-Hartman 
218900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_mac_address
219000b3ed16SGreg Kroah-Hartman {
2191aaad4303SSolomon Peachy 	u8	addr[6];
21929cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_mac_address_t;
219300b3ed16SGreg Kroah-Hartman 
219400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_mkk_callname
219500b3ed16SGreg Kroah-Hartman {
2196aaad4303SSolomon Peachy 	u8	callname[8];
21979cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_mkk_callname_t;
219800b3ed16SGreg Kroah-Hartman 
219900b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_regdomain
220000b3ed16SGreg Kroah-Hartman {
2201aaad4303SSolomon Peachy 	u16	numdomains;
2202aaad4303SSolomon Peachy 	u16	domain[5];
22039cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_regdomain_t;
220400b3ed16SGreg Kroah-Hartman 
220500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_allowed_channel
220600b3ed16SGreg Kroah-Hartman {
2207aaad4303SSolomon Peachy 	u16	ch_bitmap;
22089cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_allowed_channel_t;
220900b3ed16SGreg Kroah-Hartman 
221000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_default_channel
221100b3ed16SGreg Kroah-Hartman {
2212aaad4303SSolomon Peachy 	u16	channel;
22139cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_default_channel_t;
221400b3ed16SGreg Kroah-Hartman 
221500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_privacy_option
221600b3ed16SGreg Kroah-Hartman {
2217aaad4303SSolomon Peachy 	u16	available;
22189cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_privacy_option_t;
221900b3ed16SGreg Kroah-Hartman 
222000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_temptype
222100b3ed16SGreg Kroah-Hartman {
2222aaad4303SSolomon Peachy 	u16	type;
22239cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_temptype_t;
222400b3ed16SGreg Kroah-Hartman 
222500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_refdac_setup
222600b3ed16SGreg Kroah-Hartman {
2227aaad4303SSolomon Peachy 	u16	ch_value[14];
22289cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_refdac_setup_t;
222900b3ed16SGreg Kroah-Hartman 
223000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_vgdac_setup
223100b3ed16SGreg Kroah-Hartman {
2232aaad4303SSolomon Peachy 	u16	ch_value[14];
22339cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_vgdac_setup_t;
223400b3ed16SGreg Kroah-Hartman 
223500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_level_comp_setup
223600b3ed16SGreg Kroah-Hartman {
2237aaad4303SSolomon Peachy 	u16	ch_value[14];
22389cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_level_comp_setup_t;
223900b3ed16SGreg Kroah-Hartman 
224000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_trimdac_setup
224100b3ed16SGreg Kroah-Hartman {
2242aaad4303SSolomon Peachy 	u16	trimidac;
2243aaad4303SSolomon Peachy 	u16	trimqdac;
22449cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_trimdac_setup_t;
224500b3ed16SGreg Kroah-Hartman 
224600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_ifr_setting
224700b3ed16SGreg Kroah-Hartman {
2248aaad4303SSolomon Peachy 	u16	value[3];
22499cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_ifr_setting_t;
225000b3ed16SGreg Kroah-Hartman 
225100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_rfr_setting
225200b3ed16SGreg Kroah-Hartman {
2253aaad4303SSolomon Peachy 	u16	value[3];
22549cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_rfr_setting_t;
225500b3ed16SGreg Kroah-Hartman 
225600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_hfa3861_baseline
225700b3ed16SGreg Kroah-Hartman {
2258aaad4303SSolomon Peachy 	u16	value[50];
22599cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_hfa3861_baseline_t;
226000b3ed16SGreg Kroah-Hartman 
226100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_hfa3861_shadow
226200b3ed16SGreg Kroah-Hartman {
2263aaad4303SSolomon Peachy 	u32	value[32];
22649cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_hfa3861_shadow_t;
226500b3ed16SGreg Kroah-Hartman 
226600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_hfa3861_ifrf
226700b3ed16SGreg Kroah-Hartman {
2268aaad4303SSolomon Peachy 	u32	value[20];
22699cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_hfa3861_ifrf_t;
227000b3ed16SGreg Kroah-Hartman 
227100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_hfa3861_chcalsp
227200b3ed16SGreg Kroah-Hartman {
2273aaad4303SSolomon Peachy 	u16	value[14];
22749cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_hfa3861_chcalsp_t;
227500b3ed16SGreg Kroah-Hartman 
227600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_hfa3861_chcali
227700b3ed16SGreg Kroah-Hartman {
2278aaad4303SSolomon Peachy 	u16	value[17];
22799cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_hfa3861_chcali_t;
228000b3ed16SGreg Kroah-Hartman 
228100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_hfa3861_nic_config
228200b3ed16SGreg Kroah-Hartman {
2283aaad4303SSolomon Peachy 	u16	config_bitmap;
22849cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_nic_config_t;
228500b3ed16SGreg Kroah-Hartman 
228600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_hfo_delay
228700b3ed16SGreg Kroah-Hartman {
2288aaad4303SSolomon Peachy 	u8   hfo_delay;
22899cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_hfo_delay_t;
229000b3ed16SGreg Kroah-Hartman 
229100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_hfa3861_manf_testsp
229200b3ed16SGreg Kroah-Hartman {
2293aaad4303SSolomon Peachy 	u16	value[30];
22949cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_hfa3861_manf_testsp_t;
229500b3ed16SGreg Kroah-Hartman 
229600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdr_hfa3861_manf_testi
229700b3ed16SGreg Kroah-Hartman {
2298aaad4303SSolomon Peachy 	u16	value[30];
22999cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_hfa3861_manf_testi_t;
230000b3ed16SGreg Kroah-Hartman 
230100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_end_of_pda
230200b3ed16SGreg Kroah-Hartman {
2303aaad4303SSolomon Peachy 	u16	crc;
23049cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdr_end_of_pda_t;
230500b3ed16SGreg Kroah-Hartman 
230600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_pdrec
230700b3ed16SGreg Kroah-Hartman {
2308aaad4303SSolomon Peachy 	u16	len; /* in words */
2309aaad4303SSolomon Peachy 	u16	code;
231000b3ed16SGreg Kroah-Hartman 	union pdr {
231100b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_pcb_partnum_t	pcb_partnum;
231200b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_pcb_tracenum_t	pcb_tracenum;
231300b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_nic_serial_t	nic_serial;
231400b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_mkk_measurements_t	mkk_measurements;
231500b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_nic_ramsize_t	nic_ramsize;
231600b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_mfisuprange_t	mfisuprange;
231700b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_cfisuprange_t	cfisuprange;
231800b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_nicid_t		nicid;
231900b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_refdac_measurements_t	refdac_measurements;
232000b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_vgdac_measurements_t	vgdac_measurements;
232100b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_level_compc_measurements_t	level_compc_measurements;
232200b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_mac_address_t	mac_address;
232300b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_mkk_callname_t	mkk_callname;
232400b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_regdomain_t		regdomain;
232500b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_allowed_channel_t	allowed_channel;
232600b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_default_channel_t	default_channel;
232700b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_privacy_option_t	privacy_option;
232800b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_temptype_t		temptype;
232900b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_refdac_setup_t	refdac_setup;
233000b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_vgdac_setup_t	vgdac_setup;
233100b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_level_comp_setup_t	level_comp_setup;
233200b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_trimdac_setup_t	trimdac_setup;
233300b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_ifr_setting_t	ifr_setting;
233400b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_rfr_setting_t	rfr_setting;
233500b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_hfa3861_baseline_t	hfa3861_baseline;
233600b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_hfa3861_shadow_t	hfa3861_shadow;
233700b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_hfa3861_ifrf_t	hfa3861_ifrf;
233800b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_hfa3861_chcalsp_t	hfa3861_chcalsp;
233900b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_hfa3861_chcali_t	hfa3861_chcali;
234000b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_nic_config_t	nic_config;
234100b3ed16SGreg Kroah-Hartman 	hfa384x_hfo_delay_t             hfo_delay;
234200b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_hfa3861_manf_testsp_t	hfa3861_manf_testsp;
234300b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_hfa3861_manf_testi_t	hfa3861_manf_testi;
234400b3ed16SGreg Kroah-Hartman 	hfa384x_pdr_end_of_pda_t	end_of_pda;
234500b3ed16SGreg Kroah-Hartman 
234600b3ed16SGreg Kroah-Hartman 	} data;
23479cba46dcSMoritz Muehlenhoff } __attribute__((packed)) hfa384x_pdrec_t;
234800b3ed16SGreg Kroah-Hartman 
234900b3ed16SGreg Kroah-Hartman 
235000b3ed16SGreg Kroah-Hartman #ifdef __KERNEL__
235100b3ed16SGreg Kroah-Hartman /*--------------------------------------------------------------------
235200b3ed16SGreg Kroah-Hartman ---  MAC state structure, argument to all functions --
235300b3ed16SGreg Kroah-Hartman ---  Also, a collection of support types --
235400b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/
235500b3ed16SGreg Kroah-Hartman typedef struct hfa384x_statusresult
235600b3ed16SGreg Kroah-Hartman {
2357aaad4303SSolomon Peachy 	u16	status;
2358aaad4303SSolomon Peachy 	u16	resp0;
2359aaad4303SSolomon Peachy 	u16	resp1;
2360aaad4303SSolomon Peachy 	u16	resp2;
236100b3ed16SGreg Kroah-Hartman } hfa384x_cmdresult_t;
236200b3ed16SGreg Kroah-Hartman 
236300b3ed16SGreg Kroah-Hartman /* USB Control Exchange (CTLX):
236400b3ed16SGreg Kroah-Hartman  *  A queue of the structure below is maintained for all of the
236500b3ed16SGreg Kroah-Hartman  *  Request/Response type USB packets supported by Prism2.
236600b3ed16SGreg Kroah-Hartman  */
236700b3ed16SGreg Kroah-Hartman /* The following hfa384x_* structures are arguments to
236800b3ed16SGreg Kroah-Hartman  * the usercb() for the different CTLX types.
236900b3ed16SGreg Kroah-Hartman  */
237000b3ed16SGreg Kroah-Hartman typedef hfa384x_cmdresult_t hfa384x_wridresult_t;
237100b3ed16SGreg Kroah-Hartman typedef hfa384x_cmdresult_t hfa384x_wmemresult_t;
237200b3ed16SGreg Kroah-Hartman 
237300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_rridresult
237400b3ed16SGreg Kroah-Hartman {
2375aaad4303SSolomon Peachy 	u16		rid;
237600b3ed16SGreg Kroah-Hartman 	const void	*riddata;
2377aaad4303SSolomon Peachy 	unsigned int		riddata_len;
237800b3ed16SGreg Kroah-Hartman } hfa384x_rridresult_t;
237900b3ed16SGreg Kroah-Hartman 
238000b3ed16SGreg Kroah-Hartman enum ctlx_state {
238100b3ed16SGreg Kroah-Hartman 	CTLX_START = 0,	/* Start state, not queued */
238200b3ed16SGreg Kroah-Hartman 
238300b3ed16SGreg Kroah-Hartman 	CTLX_COMPLETE,	/* CTLX successfully completed */
238400b3ed16SGreg Kroah-Hartman 	CTLX_REQ_FAILED,	/* OUT URB completed w/ error */
238500b3ed16SGreg Kroah-Hartman 
238600b3ed16SGreg Kroah-Hartman 	CTLX_PENDING,		/* Queued, data valid */
238700b3ed16SGreg Kroah-Hartman 	CTLX_REQ_SUBMITTED,	/* OUT URB submitted */
238800b3ed16SGreg Kroah-Hartman 	CTLX_REQ_COMPLETE,	/* OUT URB complete */
238900b3ed16SGreg Kroah-Hartman 	CTLX_RESP_COMPLETE	/* IN URB received */
239000b3ed16SGreg Kroah-Hartman };
239100b3ed16SGreg Kroah-Hartman typedef enum ctlx_state  CTLX_STATE;
239200b3ed16SGreg Kroah-Hartman 
239300b3ed16SGreg Kroah-Hartman struct hfa384x_usbctlx;
239400b3ed16SGreg Kroah-Hartman struct hfa384x;
239500b3ed16SGreg Kroah-Hartman 
239600b3ed16SGreg Kroah-Hartman typedef void (*ctlx_cmdcb_t)( struct hfa384x*, const struct hfa384x_usbctlx* );
239700b3ed16SGreg Kroah-Hartman 
239800b3ed16SGreg Kroah-Hartman typedef void (*ctlx_usercb_t)(
239900b3ed16SGreg Kroah-Hartman 	struct hfa384x	*hw,
240000b3ed16SGreg Kroah-Hartman 	void		*ctlxresult,
240100b3ed16SGreg Kroah-Hartman 	void		*usercb_data);
240200b3ed16SGreg Kroah-Hartman 
240300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usbctlx
240400b3ed16SGreg Kroah-Hartman {
240500b3ed16SGreg Kroah-Hartman 	struct list_head	list;
240600b3ed16SGreg Kroah-Hartman 
240700b3ed16SGreg Kroah-Hartman 	size_t			outbufsize;
240800b3ed16SGreg Kroah-Hartman 	hfa384x_usbout_t	outbuf;		/* pkt buf for OUT */
240900b3ed16SGreg Kroah-Hartman 	hfa384x_usbin_t		inbuf;		/* pkt buf for IN(a copy) */
241000b3ed16SGreg Kroah-Hartman 
241100b3ed16SGreg Kroah-Hartman 	CTLX_STATE		state;		/* Tracks running state */
241200b3ed16SGreg Kroah-Hartman 
241300b3ed16SGreg Kroah-Hartman 	struct completion	done;
241400b3ed16SGreg Kroah-Hartman 	volatile int		reapable;	/* Food for the reaper task */
241500b3ed16SGreg Kroah-Hartman 
241600b3ed16SGreg Kroah-Hartman 	ctlx_cmdcb_t		cmdcb;		/* Async command callback */
241700b3ed16SGreg Kroah-Hartman 	ctlx_usercb_t		usercb;		/* Async user callback, */
241800b3ed16SGreg Kroah-Hartman 	void			*usercb_data;	/*  at CTLX completion  */
241900b3ed16SGreg Kroah-Hartman 
242000b3ed16SGreg Kroah-Hartman 	int			variant;	/* Identifies cmd variant */
242100b3ed16SGreg Kroah-Hartman } hfa384x_usbctlx_t;
242200b3ed16SGreg Kroah-Hartman 
242300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usbctlxq
242400b3ed16SGreg Kroah-Hartman {
242500b3ed16SGreg Kroah-Hartman 	spinlock_t		lock;
242600b3ed16SGreg Kroah-Hartman 	struct list_head	pending;
242700b3ed16SGreg Kroah-Hartman 	struct list_head	active;
242800b3ed16SGreg Kroah-Hartman 	struct list_head	completing;
242900b3ed16SGreg Kroah-Hartman 	struct list_head	reapable;
243000b3ed16SGreg Kroah-Hartman } hfa384x_usbctlxq_t;
243100b3ed16SGreg Kroah-Hartman 
243200b3ed16SGreg Kroah-Hartman typedef struct hfa484x_metacmd
243300b3ed16SGreg Kroah-Hartman {
2434aaad4303SSolomon Peachy 	u16		cmd;
243500b3ed16SGreg Kroah-Hartman 
2436aaad4303SSolomon Peachy 	u16          parm0;
2437aaad4303SSolomon Peachy 	u16          parm1;
2438aaad4303SSolomon Peachy 	u16          parm2;
243900b3ed16SGreg Kroah-Hartman 
244000b3ed16SGreg Kroah-Hartman 	hfa384x_cmdresult_t result;
244100b3ed16SGreg Kroah-Hartman } hfa384x_metacmd_t;
244200b3ed16SGreg Kroah-Hartman 
244300b3ed16SGreg Kroah-Hartman #define	MAX_PRISM2_GRP_ADDR	16
244400b3ed16SGreg Kroah-Hartman #define	MAX_GRP_ADDR		32
244500b3ed16SGreg Kroah-Hartman #define WLAN_COMMENT_MAX	80  /* Max. length of user comment string. */
244600b3ed16SGreg Kroah-Hartman 
244700b3ed16SGreg Kroah-Hartman #define MM_SAT_PCF		(BIT14)
244800b3ed16SGreg Kroah-Hartman #define MM_GCSD_PCF		(BIT15)
244900b3ed16SGreg Kroah-Hartman #define MM_GCSD_PCF_EB		(BIT14 | BIT15)
245000b3ed16SGreg Kroah-Hartman 
245100b3ed16SGreg Kroah-Hartman #define WLAN_STATE_STOPPED	0   /* Network is not active. */
245200b3ed16SGreg Kroah-Hartman #define WLAN_STATE_STARTED	1   /* Network has been started. */
245300b3ed16SGreg Kroah-Hartman 
245400b3ed16SGreg Kroah-Hartman #define WLAN_AUTH_MAX           60  /* Max. # of authenticated stations. */
245500b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_MAX		60  /* Max. # of stations in an access list. */
245600b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_NONE	0   /* No stations may be authenticated. */
245700b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_ALL		1   /* All stations may be authenticated. */
245800b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_ALLOW	2   /* Authenticate only "allowed" stations. */
245900b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_DENY	3   /* Do not authenticate "denied" stations. */
246000b3ed16SGreg Kroah-Hartman 
246100b3ed16SGreg Kroah-Hartman /* XXX These are going away ASAP */
246200b3ed16SGreg Kroah-Hartman typedef struct prism2sta_authlist
246300b3ed16SGreg Kroah-Hartman {
2464aaad4303SSolomon Peachy 	unsigned int	cnt;
246528b17a4bSMoritz Muehlenhoff 	u8	addr[WLAN_AUTH_MAX][ETH_ALEN];
2466aaad4303SSolomon Peachy 	u8	assoc[WLAN_AUTH_MAX];
246700b3ed16SGreg Kroah-Hartman } prism2sta_authlist_t;
246800b3ed16SGreg Kroah-Hartman 
246900b3ed16SGreg Kroah-Hartman typedef struct prism2sta_accesslist
247000b3ed16SGreg Kroah-Hartman {
2471aaad4303SSolomon Peachy 	unsigned int	modify;
2472aaad4303SSolomon Peachy 	unsigned int	cnt;
247328b17a4bSMoritz Muehlenhoff 	u8	addr[WLAN_ACCESS_MAX][ETH_ALEN];
2474aaad4303SSolomon Peachy 	unsigned int	cnt1;
247528b17a4bSMoritz Muehlenhoff 	u8	addr1[WLAN_ACCESS_MAX][ETH_ALEN];
247600b3ed16SGreg Kroah-Hartman } prism2sta_accesslist_t;
247700b3ed16SGreg Kroah-Hartman 
247800b3ed16SGreg Kroah-Hartman typedef struct hfa384x
247900b3ed16SGreg Kroah-Hartman {
248000b3ed16SGreg Kroah-Hartman 	/* USB support data */
248100b3ed16SGreg Kroah-Hartman 	struct usb_device	*usb;
248200b3ed16SGreg Kroah-Hartman 	struct urb		rx_urb;
248300b3ed16SGreg Kroah-Hartman 	struct sk_buff		*rx_urb_skb;
248400b3ed16SGreg Kroah-Hartman 	struct urb		tx_urb;
248500b3ed16SGreg Kroah-Hartman 	struct urb		ctlx_urb;
248600b3ed16SGreg Kroah-Hartman 	hfa384x_usbout_t	txbuff;
248700b3ed16SGreg Kroah-Hartman 	hfa384x_usbctlxq_t	ctlxq;
248800b3ed16SGreg Kroah-Hartman 	struct timer_list	reqtimer;
248900b3ed16SGreg Kroah-Hartman 	struct timer_list	resptimer;
249000b3ed16SGreg Kroah-Hartman 
249100b3ed16SGreg Kroah-Hartman 	struct timer_list	throttle;
249200b3ed16SGreg Kroah-Hartman 
249300b3ed16SGreg Kroah-Hartman 	struct tasklet_struct	reaper_bh;
249400b3ed16SGreg Kroah-Hartman 	struct tasklet_struct	completion_bh;
249500b3ed16SGreg Kroah-Hartman 
249600b3ed16SGreg Kroah-Hartman 	struct work_struct	usb_work;
249700b3ed16SGreg Kroah-Hartman 
249800b3ed16SGreg Kroah-Hartman 	unsigned long		usb_flags;
249900b3ed16SGreg Kroah-Hartman #define THROTTLE_RX	0
250000b3ed16SGreg Kroah-Hartman #define THROTTLE_TX	1
250100b3ed16SGreg Kroah-Hartman #define WORK_RX_HALT	2
250200b3ed16SGreg Kroah-Hartman #define WORK_TX_HALT	3
250300b3ed16SGreg Kroah-Hartman #define WORK_RX_RESUME	4
250400b3ed16SGreg Kroah-Hartman #define WORK_TX_RESUME	5
250500b3ed16SGreg Kroah-Hartman 
250600b3ed16SGreg Kroah-Hartman 	unsigned short		req_timer_done:1;
250700b3ed16SGreg Kroah-Hartman 	unsigned short		resp_timer_done:1;
250800b3ed16SGreg Kroah-Hartman 
250900b3ed16SGreg Kroah-Hartman 	int                     endp_in;
251000b3ed16SGreg Kroah-Hartman 	int                     endp_out;
251100b3ed16SGreg Kroah-Hartman 
251200b3ed16SGreg Kroah-Hartman 	int                     sniff_fcs;
251300b3ed16SGreg Kroah-Hartman 	int                     sniff_channel;
251400b3ed16SGreg Kroah-Hartman 	int                     sniff_truncate;
251500b3ed16SGreg Kroah-Hartman 	int                     sniffhdr;
251600b3ed16SGreg Kroah-Hartman 
251700b3ed16SGreg Kroah-Hartman 	wait_queue_head_t cmdq;	        /* wait queue itself */
251800b3ed16SGreg Kroah-Hartman 
251900b3ed16SGreg Kroah-Hartman 	/* Controller state */
2520aaad4303SSolomon Peachy 	u32		state;
2521aaad4303SSolomon Peachy 	u32		isap;
2522aaad4303SSolomon Peachy 	u8		port_enabled[HFA384x_NUMPORTS_MAX];
252300b3ed16SGreg Kroah-Hartman 
252400b3ed16SGreg Kroah-Hartman 	/* Download support */
2525aaad4303SSolomon Peachy 	unsigned int				dlstate;
252600b3ed16SGreg Kroah-Hartman 	hfa384x_downloadbuffer_t	bufinfo;
2527aaad4303SSolomon Peachy 	u16				dltimeout;
252800b3ed16SGreg Kroah-Hartman 
252900b3ed16SGreg Kroah-Hartman 	int                          scanflag;    /* to signal scan comlete */
253000b3ed16SGreg Kroah-Hartman 	int                          join_ap;        /* are we joined to a specific ap */
253100b3ed16SGreg Kroah-Hartman 	int                          join_retries;   /* number of join retries till we fail */
253200b3ed16SGreg Kroah-Hartman 	hfa384x_JoinRequest_data_t   joinreq;        /* join request saved data */
253300b3ed16SGreg Kroah-Hartman 
253400b3ed16SGreg Kroah-Hartman 	wlandevice_t            *wlandev;
253500b3ed16SGreg Kroah-Hartman 	/* Timer to allow for the deferred processing of linkstatus messages */
253600b3ed16SGreg Kroah-Hartman 	struct work_struct 	link_bh;
253700b3ed16SGreg Kroah-Hartman 
253800b3ed16SGreg Kroah-Hartman         struct work_struct      commsqual_bh;
253900b3ed16SGreg Kroah-Hartman 	hfa384x_commsquality_t  qual;
254000b3ed16SGreg Kroah-Hartman 	struct timer_list	commsqual_timer;
254100b3ed16SGreg Kroah-Hartman 
2542aaad4303SSolomon Peachy 	u16 link_status;
2543aaad4303SSolomon Peachy 	u16 link_status_new;
254400b3ed16SGreg Kroah-Hartman 	struct sk_buff_head        authq;
254500b3ed16SGreg Kroah-Hartman 
254600b3ed16SGreg Kroah-Hartman 	/* And here we have stuff that used to be in priv */
254700b3ed16SGreg Kroah-Hartman 
254800b3ed16SGreg Kroah-Hartman 	/* State variables */
2549aaad4303SSolomon Peachy 	unsigned int		presniff_port_type;
2550aaad4303SSolomon Peachy 	u16		presniff_wepflags;
2551aaad4303SSolomon Peachy 	u32		dot11_desired_bss_type;
255200b3ed16SGreg Kroah-Hartman 
255300b3ed16SGreg Kroah-Hartman 	int             dbmadjust;
255400b3ed16SGreg Kroah-Hartman 
255500b3ed16SGreg Kroah-Hartman 	/* Group Addresses - right now, there are up to a total
255600b3ed16SGreg Kroah-Hartman 	of MAX_GRP_ADDR group addresses */
255728b17a4bSMoritz Muehlenhoff 	u8		dot11_grp_addr[MAX_GRP_ADDR][ETH_ALEN];
2558aaad4303SSolomon Peachy 	unsigned int		dot11_grpcnt;
255900b3ed16SGreg Kroah-Hartman 
256000b3ed16SGreg Kroah-Hartman 	/* Component Identities */
256100b3ed16SGreg Kroah-Hartman 	hfa384x_compident_t	ident_nic;
256200b3ed16SGreg Kroah-Hartman 	hfa384x_compident_t	ident_pri_fw;
256300b3ed16SGreg Kroah-Hartman 	hfa384x_compident_t	ident_sta_fw;
256400b3ed16SGreg Kroah-Hartman 	hfa384x_compident_t	ident_ap_fw;
2565aaad4303SSolomon Peachy 	u16			mm_mods;
256600b3ed16SGreg Kroah-Hartman 
256700b3ed16SGreg Kroah-Hartman 	/* Supplier compatibility ranges */
256800b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t	cap_sup_mfi;
256900b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t	cap_sup_cfi;
257000b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t	cap_sup_pri;
257100b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t	cap_sup_sta;
257200b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t	cap_sup_ap;
257300b3ed16SGreg Kroah-Hartman 
257400b3ed16SGreg Kroah-Hartman 	/* Actor compatibility ranges */
257500b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t	cap_act_pri_cfi; /* pri f/w to controller interface */
257600b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t	cap_act_sta_cfi; /* sta f/w to controller interface */
257700b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t	cap_act_sta_mfi; /* sta f/w to modem interface */
257800b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t	cap_act_ap_cfi;  /* ap f/w to controller interface */
257900b3ed16SGreg Kroah-Hartman 	hfa384x_caplevel_t	cap_act_ap_mfi;  /* ap f/w to modem interface */
258000b3ed16SGreg Kroah-Hartman 
2581aaad4303SSolomon Peachy 	u32			psusercount;  /* Power save user count. */
258200b3ed16SGreg Kroah-Hartman 	hfa384x_CommTallies32_t	tallies;      /* Communication tallies. */
2583aaad4303SSolomon Peachy 	u8			comment[WLAN_COMMENT_MAX+1]; /* User comment */
258400b3ed16SGreg Kroah-Hartman 
258500b3ed16SGreg Kroah-Hartman 	/* Channel Info request results (AP only) */
258600b3ed16SGreg Kroah-Hartman 	struct {
258700b3ed16SGreg Kroah-Hartman 		atomic_t		done;
2588aaad4303SSolomon Peachy 		u8			count;
258900b3ed16SGreg Kroah-Hartman 		hfa384x_ChInfoResult_t	results;
259000b3ed16SGreg Kroah-Hartman 	} channel_info;
259100b3ed16SGreg Kroah-Hartman 
259200b3ed16SGreg Kroah-Hartman 	hfa384x_InfFrame_t      *scanresults;
259300b3ed16SGreg Kroah-Hartman 
259400b3ed16SGreg Kroah-Hartman 
259500b3ed16SGreg Kroah-Hartman         prism2sta_authlist_t	authlist;     /* Authenticated station list. */
2596aaad4303SSolomon Peachy 	unsigned int			accessmode;   /* Access mode. */
259700b3ed16SGreg Kroah-Hartman         prism2sta_accesslist_t	allow;        /* Allowed station list. */
259800b3ed16SGreg Kroah-Hartman         prism2sta_accesslist_t	deny;         /* Denied station list. */
259900b3ed16SGreg Kroah-Hartman 
260000b3ed16SGreg Kroah-Hartman } hfa384x_t;
260100b3ed16SGreg Kroah-Hartman 
260200b3ed16SGreg Kroah-Hartman /*=============================================================*/
260300b3ed16SGreg Kroah-Hartman /*--- Function Declarations -----------------------------------*/
260400b3ed16SGreg Kroah-Hartman /*=============================================================*/
260500b3ed16SGreg Kroah-Hartman void
260600b3ed16SGreg Kroah-Hartman hfa384x_create(
260700b3ed16SGreg Kroah-Hartman 	hfa384x_t *hw,
260800b3ed16SGreg Kroah-Hartman 	struct usb_device *usb);
260900b3ed16SGreg Kroah-Hartman 
261000b3ed16SGreg Kroah-Hartman void hfa384x_destroy(hfa384x_t *hw);
261100b3ed16SGreg Kroah-Hartman 
261200b3ed16SGreg Kroah-Hartman int
261300b3ed16SGreg Kroah-Hartman hfa384x_corereset( hfa384x_t *hw, int holdtime, int settletime, int genesis);
261400b3ed16SGreg Kroah-Hartman int
261500b3ed16SGreg Kroah-Hartman hfa384x_drvr_chinforesults( hfa384x_t *hw);
261600b3ed16SGreg Kroah-Hartman int
261700b3ed16SGreg Kroah-Hartman hfa384x_drvr_commtallies( hfa384x_t *hw);
261800b3ed16SGreg Kroah-Hartman int
2619aaad4303SSolomon Peachy hfa384x_drvr_disable(hfa384x_t *hw, u16 macport);
262000b3ed16SGreg Kroah-Hartman int
2621aaad4303SSolomon Peachy hfa384x_drvr_enable(hfa384x_t *hw, u16 macport);
262200b3ed16SGreg Kroah-Hartman int
262300b3ed16SGreg Kroah-Hartman hfa384x_drvr_flashdl_enable(hfa384x_t *hw);
262400b3ed16SGreg Kroah-Hartman int
262500b3ed16SGreg Kroah-Hartman hfa384x_drvr_flashdl_disable(hfa384x_t *hw);
262600b3ed16SGreg Kroah-Hartman int
2627aaad4303SSolomon Peachy hfa384x_drvr_flashdl_write(hfa384x_t *hw, u32 daddr, void* buf, u32 len);
262800b3ed16SGreg Kroah-Hartman int
2629aaad4303SSolomon Peachy hfa384x_drvr_getconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len);
263000b3ed16SGreg Kroah-Hartman int
2631aaad4303SSolomon Peachy hfa384x_drvr_handover( hfa384x_t *hw, u8 *addr);
263200b3ed16SGreg Kroah-Hartman int
263300b3ed16SGreg Kroah-Hartman hfa384x_drvr_hostscanresults( hfa384x_t *hw);
263400b3ed16SGreg Kroah-Hartman int
263500b3ed16SGreg Kroah-Hartman hfa384x_drvr_low_level(hfa384x_t *hw, hfa384x_metacmd_t *cmd);
263600b3ed16SGreg Kroah-Hartman int
2637aaad4303SSolomon Peachy hfa384x_drvr_mmi_read(hfa384x_t *hw, u32 address, u32 *result);
263800b3ed16SGreg Kroah-Hartman int
2639aaad4303SSolomon Peachy hfa384x_drvr_mmi_write(hfa384x_t *hw, u32 address, u32 data);
264000b3ed16SGreg Kroah-Hartman int
2641aaad4303SSolomon Peachy hfa384x_drvr_ramdl_enable(hfa384x_t *hw, u32 exeaddr);
264200b3ed16SGreg Kroah-Hartman int
264300b3ed16SGreg Kroah-Hartman hfa384x_drvr_ramdl_disable(hfa384x_t *hw);
264400b3ed16SGreg Kroah-Hartman int
2645aaad4303SSolomon Peachy hfa384x_drvr_ramdl_write(hfa384x_t *hw, u32 daddr, void* buf, u32 len);
264600b3ed16SGreg Kroah-Hartman int
2647aaad4303SSolomon Peachy hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len);
264800b3ed16SGreg Kroah-Hartman int
264900b3ed16SGreg Kroah-Hartman hfa384x_drvr_scanresults( hfa384x_t *hw);
265000b3ed16SGreg Kroah-Hartman 
265100b3ed16SGreg Kroah-Hartman int
2652aaad4303SSolomon Peachy hfa384x_drvr_setconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len);
265300b3ed16SGreg Kroah-Hartman 
265400b3ed16SGreg Kroah-Hartman static inline int
2655aaad4303SSolomon Peachy hfa384x_drvr_getconfig16(hfa384x_t *hw, u16 rid, void *val)
265600b3ed16SGreg Kroah-Hartman {
265700b3ed16SGreg Kroah-Hartman 	int		result = 0;
2658aaad4303SSolomon Peachy 	result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u16));
265900b3ed16SGreg Kroah-Hartman 	if ( result == 0 ) {
2660aaad4303SSolomon Peachy 		*((u16*)val) = hfa384x2host_16(*((u16*)val));
266100b3ed16SGreg Kroah-Hartman 	}
266200b3ed16SGreg Kroah-Hartman 	return result;
266300b3ed16SGreg Kroah-Hartman }
266400b3ed16SGreg Kroah-Hartman 
266500b3ed16SGreg Kroah-Hartman static inline int
2666aaad4303SSolomon Peachy hfa384x_drvr_getconfig32(hfa384x_t *hw, u16 rid, void *val)
266700b3ed16SGreg Kroah-Hartman {
266800b3ed16SGreg Kroah-Hartman 	int		result = 0;
266900b3ed16SGreg Kroah-Hartman 
2670aaad4303SSolomon Peachy 	result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u32));
267100b3ed16SGreg Kroah-Hartman 	if ( result == 0 ) {
2672aaad4303SSolomon Peachy 		*((u32*)val) = hfa384x2host_32(*((u32*)val));
267300b3ed16SGreg Kroah-Hartman 	}
267400b3ed16SGreg Kroah-Hartman 
267500b3ed16SGreg Kroah-Hartman 	return result;
267600b3ed16SGreg Kroah-Hartman }
267700b3ed16SGreg Kroah-Hartman 
267800b3ed16SGreg Kroah-Hartman static inline int
2679aaad4303SSolomon Peachy hfa384x_drvr_setconfig16(hfa384x_t *hw, u16 rid, u16 val)
268000b3ed16SGreg Kroah-Hartman {
2681aaad4303SSolomon Peachy 	u16 value = host2hfa384x_16(val);
268200b3ed16SGreg Kroah-Hartman 	return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));
268300b3ed16SGreg Kroah-Hartman }
268400b3ed16SGreg Kroah-Hartman 
268500b3ed16SGreg Kroah-Hartman static inline int
2686aaad4303SSolomon Peachy hfa384x_drvr_setconfig32(hfa384x_t *hw, u16 rid, u32 val)
268700b3ed16SGreg Kroah-Hartman {
2688aaad4303SSolomon Peachy 	u32 value = host2hfa384x_32(val);
268900b3ed16SGreg Kroah-Hartman 	return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));
269000b3ed16SGreg Kroah-Hartman }
269100b3ed16SGreg Kroah-Hartman 
269200b3ed16SGreg Kroah-Hartman int
269300b3ed16SGreg Kroah-Hartman hfa384x_drvr_getconfig_async(hfa384x_t     *hw,
2694aaad4303SSolomon Peachy                               u16        rid,
269500b3ed16SGreg Kroah-Hartman                               ctlx_usercb_t usercb,
269600b3ed16SGreg Kroah-Hartman                               void          *usercb_data);
269700b3ed16SGreg Kroah-Hartman 
269800b3ed16SGreg Kroah-Hartman int
269900b3ed16SGreg Kroah-Hartman hfa384x_drvr_setconfig_async(hfa384x_t *hw,
2700aaad4303SSolomon Peachy                               u16 rid,
270100b3ed16SGreg Kroah-Hartman                               void *buf,
2702aaad4303SSolomon Peachy                               u16 len,
270300b3ed16SGreg Kroah-Hartman                               ctlx_usercb_t usercb,
270400b3ed16SGreg Kroah-Hartman                               void *usercb_data);
270500b3ed16SGreg Kroah-Hartman 
270600b3ed16SGreg Kroah-Hartman static inline int
2707aaad4303SSolomon Peachy hfa384x_drvr_setconfig16_async(hfa384x_t *hw, u16 rid, u16 val)
270800b3ed16SGreg Kroah-Hartman {
2709aaad4303SSolomon Peachy 	u16 value = host2hfa384x_16(val);
271000b3ed16SGreg Kroah-Hartman 	return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value),
271100b3ed16SGreg Kroah-Hartman 					    NULL , NULL);
271200b3ed16SGreg Kroah-Hartman }
271300b3ed16SGreg Kroah-Hartman 
271400b3ed16SGreg Kroah-Hartman static inline int
2715aaad4303SSolomon Peachy hfa384x_drvr_setconfig32_async(hfa384x_t *hw, u16 rid, u32 val)
271600b3ed16SGreg Kroah-Hartman {
2717aaad4303SSolomon Peachy 	u32 value = host2hfa384x_32(val);
271800b3ed16SGreg Kroah-Hartman 	return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value),
271900b3ed16SGreg Kroah-Hartman 					    NULL , NULL);
272000b3ed16SGreg Kroah-Hartman }
272100b3ed16SGreg Kroah-Hartman 
272200b3ed16SGreg Kroah-Hartman 
272300b3ed16SGreg Kroah-Hartman int
272400b3ed16SGreg Kroah-Hartman hfa384x_drvr_start(hfa384x_t *hw);
272500b3ed16SGreg Kroah-Hartman int
272600b3ed16SGreg Kroah-Hartman hfa384x_drvr_stop(hfa384x_t *hw);
272700b3ed16SGreg Kroah-Hartman int
272800b3ed16SGreg Kroah-Hartman hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep);
272900b3ed16SGreg Kroah-Hartman void
273000b3ed16SGreg Kroah-Hartman hfa384x_tx_timeout(wlandevice_t *wlandev);
273100b3ed16SGreg Kroah-Hartman 
273200b3ed16SGreg Kroah-Hartman int
273300b3ed16SGreg Kroah-Hartman hfa384x_cmd_initialize(hfa384x_t *hw);
273400b3ed16SGreg Kroah-Hartman int
2735aaad4303SSolomon Peachy hfa384x_cmd_enable(hfa384x_t *hw, u16 macport);
273600b3ed16SGreg Kroah-Hartman int
2737aaad4303SSolomon Peachy hfa384x_cmd_disable(hfa384x_t *hw, u16 macport);
273800b3ed16SGreg Kroah-Hartman int
273900b3ed16SGreg Kroah-Hartman hfa384x_cmd_diagnose(hfa384x_t *hw);
274000b3ed16SGreg Kroah-Hartman int
2741aaad4303SSolomon Peachy hfa384x_cmd_allocate(hfa384x_t *hw, u16 len);
274200b3ed16SGreg Kroah-Hartman int
2743aaad4303SSolomon Peachy hfa384x_cmd_transmit(hfa384x_t *hw, u16 reclaim, u16 qos, u16 fid);
274400b3ed16SGreg Kroah-Hartman int
2745aaad4303SSolomon Peachy hfa384x_cmd_clearpersist(hfa384x_t *hw, u16 fid);
274600b3ed16SGreg Kroah-Hartman int
2747aaad4303SSolomon Peachy hfa384x_cmd_access(hfa384x_t *hw, u16 write, u16 rid, void *buf, u16 len);
274800b3ed16SGreg Kroah-Hartman int
2749aaad4303SSolomon Peachy hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable);
275000b3ed16SGreg Kroah-Hartman int
275100b3ed16SGreg Kroah-Hartman hfa384x_cmd_download(
275200b3ed16SGreg Kroah-Hartman 	hfa384x_t *hw,
2753aaad4303SSolomon Peachy 	u16 mode,
2754aaad4303SSolomon Peachy 	u16 lowaddr,
2755aaad4303SSolomon Peachy 	u16 highaddr,
2756aaad4303SSolomon Peachy 	u16 codelen);
275700b3ed16SGreg Kroah-Hartman int
275800b3ed16SGreg Kroah-Hartman hfa384x_cmd_aux_enable(hfa384x_t *hw, int force);
275900b3ed16SGreg Kroah-Hartman int
276000b3ed16SGreg Kroah-Hartman hfa384x_cmd_aux_disable(hfa384x_t *hw);
276100b3ed16SGreg Kroah-Hartman int
276200b3ed16SGreg Kroah-Hartman hfa384x_copy_from_bap(
276300b3ed16SGreg Kroah-Hartman 	hfa384x_t *hw,
2764aaad4303SSolomon Peachy 	u16	bap,
2765aaad4303SSolomon Peachy 	u16	id,
2766aaad4303SSolomon Peachy 	u16	offset,
276700b3ed16SGreg Kroah-Hartman 	void	*buf,
2768aaad4303SSolomon Peachy 	unsigned int	len);
276900b3ed16SGreg Kroah-Hartman int
277000b3ed16SGreg Kroah-Hartman hfa384x_copy_to_bap(
277100b3ed16SGreg Kroah-Hartman 	hfa384x_t *hw,
2772aaad4303SSolomon Peachy 	u16	bap,
2773aaad4303SSolomon Peachy 	u16	id,
2774aaad4303SSolomon Peachy 	u16	offset,
277500b3ed16SGreg Kroah-Hartman 	void	*buf,
2776aaad4303SSolomon Peachy 	unsigned int	len);
277700b3ed16SGreg Kroah-Hartman void
277800b3ed16SGreg Kroah-Hartman hfa384x_copy_from_aux(
277900b3ed16SGreg Kroah-Hartman 	hfa384x_t *hw,
2780aaad4303SSolomon Peachy 	u32	cardaddr,
2781aaad4303SSolomon Peachy 	u32	auxctl,
278200b3ed16SGreg Kroah-Hartman 	void	*buf,
2783aaad4303SSolomon Peachy 	unsigned int	len);
278400b3ed16SGreg Kroah-Hartman void
278500b3ed16SGreg Kroah-Hartman hfa384x_copy_to_aux(
278600b3ed16SGreg Kroah-Hartman 	hfa384x_t *hw,
2787aaad4303SSolomon Peachy 	u32	cardaddr,
2788aaad4303SSolomon Peachy 	u32	auxctl,
278900b3ed16SGreg Kroah-Hartman 	void	*buf,
2790aaad4303SSolomon Peachy 	unsigned int	len);
279100b3ed16SGreg Kroah-Hartman 
279200b3ed16SGreg Kroah-Hartman #endif /* __KERNEL__ */
279300b3ed16SGreg Kroah-Hartman 
279400b3ed16SGreg Kroah-Hartman #endif  /* _HFA384x_H */
2795