blob: 5bb8c5848f9d7916b6e0e610f776b8ee4d967ecc [file] [log] [blame]
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001/* hfa384x.h
2*
3* Defines the constants and data structures for the hfa384x
4*
5* Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
6* --------------------------------------------------------------------
7*
8* linux-wlan
9*
10* The contents of this file are subject to the Mozilla Public
11* License Version 1.1 (the "License"); you may not use this file
12* except in compliance with the License. You may obtain a copy of
13* the License at http://www.mozilla.org/MPL/
14*
15* Software distributed under the License is distributed on an "AS
16* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
17* implied. See the License for the specific language governing
18* rights and limitations under the License.
19*
20* Alternatively, the contents of this file may be used under the
21* terms of the GNU Public License version 2 (the "GPL"), in which
22* case the provisions of the GPL are applicable instead of the
23* above. If you wish to allow the use of your version of this file
24* only under the terms of the GPL and not to allow others to use
25* your version of this file under the MPL, indicate your decision
26* by deleting the provisions above and replace them with the notice
27* and other provisions required by the GPL. If you do not delete
28* the provisions above, a recipient may use your version of this
29* file under either the MPL or the GPL.
30*
31* --------------------------------------------------------------------
32*
33* Inquiries regarding the linux-wlan Open Source project can be
34* made directly to:
35*
36* AbsoluteValue Systems Inc.
37* info@linux-wlan.com
38* http://www.linux-wlan.com
39*
40* --------------------------------------------------------------------
41*
42* Portions of the development of this software were funded by
43* Intersil Corporation as part of PRISM(R) chipset product development.
44*
45* --------------------------------------------------------------------
46*
47* [Implementation and usage notes]
48*
49* [References]
50* CW10 Programmer's Manual v1.5
51* IEEE 802.11 D10.0
52*
53* --------------------------------------------------------------------
54*/
55
56#ifndef _HFA384x_H
57#define _HFA384x_H
58
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +010059#define HFA384x_FIRMWARE_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -070060
Moritz Muehlenhoff28b17a42009-01-21 22:00:41 +010061#include <linux/if_ether.h>
Kumar Amit Mehta2e380272013-02-16 05:01:22 -080062#include <linux/usb.h>
Moritz Muehlenhoff28b17a42009-01-21 22:00:41 +010063
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -070064/*--- Mins & Maxs -----------------------------------*/
Alessandro Ghedini71508ee2010-02-15 12:25:22 +010065#define HFA384x_PORTID_MAX ((u16)7)
Gargi Sharma0548cad2016-09-16 08:16:03 +053066#define HFA384x_NUMPORTS_MAX ((u16)(HFA384x_PORTID_MAX + 1))
Alessandro Ghedini71508ee2010-02-15 12:25:22 +010067#define HFA384x_PDR_LEN_MAX ((u16)512) /* in bytes, from EK */
68#define HFA384x_PDA_RECS_MAX ((u16)200) /* a guess */
69#define HFA384x_PDA_LEN_MAX ((u16)1024) /* in bytes, from EK*/
70#define HFA384x_SCANRESULT_MAX ((u16)31)
71#define HFA384x_HSCANRESULT_MAX ((u16)31)
72#define HFA384x_CHINFORESULT_MAX ((u16)16)
73#define HFA384x_RID_GUESSING_MAXLEN 2048 /* I'm not really sure */
74#define HFA384x_RIDDATA_MAXLEN HFA384x_RID_GUESSING_MAXLEN
75#define HFA384x_USB_RWMEM_MAXLEN 2048
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -070076
77/*--- Support Constants -----------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -040078#define HFA384x_PORTTYPE_IBSS ((u16)0)
79#define HFA384x_PORTTYPE_BSS ((u16)1)
Solomon Peachyaaad4302008-10-29 10:42:53 -040080#define HFA384x_PORTTYPE_PSUEDOIBSS ((u16)3)
Moritz Muehlenhoff7f6e0e42009-01-25 21:54:55 +010081#define HFA384x_WEPFLAGS_PRIVINVOKED ((u16)BIT(0))
82#define HFA384x_WEPFLAGS_EXCLUDE ((u16)BIT(1))
83#define HFA384x_WEPFLAGS_DISABLE_TXCRYPT ((u16)BIT(4))
84#define HFA384x_WEPFLAGS_DISABLE_RXCRYPT ((u16)BIT(7))
Garrick Heeec0d0d2013-02-01 01:45:16 -080085#define HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM ((u16)3)
86#define HFA384x_PORTSTATUS_DISABLED ((u16)1)
Solomon Peachyaaad4302008-10-29 10:42:53 -040087#define HFA384x_RATEBIT_1 ((u16)1)
88#define HFA384x_RATEBIT_2 ((u16)2)
89#define HFA384x_RATEBIT_5dot5 ((u16)4)
90#define HFA384x_RATEBIT_11 ((u16)8)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -070091
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -070092/*--- MAC Internal memory constants and macros ------*/
93/* masks and macros used to manipulate MAC internal memory addresses. */
94/* MAC internal memory addresses are 23 bit quantities. The MAC uses
95 * a paged address space where the upper 16 bits are the page number
96 * and the lower 7 bits are the offset. There are various Host API
97 * elements that require two 16-bit quantities to specify a MAC
98 * internal memory address. Unfortunately, some of the API's use a
99 * page/offset format where the offset value is JUST the lower seven
100 * bits and the page is the remaining 16 bits. Some of the API's
101 * assume that the 23 bit address has been split at the 16th bit. We
102 * refer to these two formats as AUX format and CMD format. The
103 * macros below help handle some of this.
104 */
105
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700106/* Mask bits for discarding unwanted pieces in a flat address */
107#define HFA384x_ADDR_FLAT_AUX_PAGE_MASK (0x007fff80)
108#define HFA384x_ADDR_FLAT_AUX_OFF_MASK (0x0000007f)
109#define HFA384x_ADDR_FLAT_CMD_PAGE_MASK (0xffff0000)
110#define HFA384x_ADDR_FLAT_CMD_OFF_MASK (0x0000ffff)
111
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100112/* Mask bits for discarding unwanted pieces in AUX format
113 16-bit address parts */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700114#define HFA384x_ADDR_AUX_PAGE_MASK (0xffff)
115#define HFA384x_ADDR_AUX_OFF_MASK (0x007f)
116
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700117/* Make a 32-bit flat address from AUX format 16-bit page and offset */
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100118#define HFA384x_ADDR_AUX_MKFLAT(p, o) \
Svenne Krap5dd8acc2010-02-14 18:59:00 +0100119 ((((u32)(((u16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) << 7) | \
120 ((u32)(((u16)(o))&HFA384x_ADDR_AUX_OFF_MASK)))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700121
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700122/* Make CMD format offset and page from a 32-bit flat address */
123#define HFA384x_ADDR_CMD_MKPAGE(f) \
Solomon Peachyaaad4302008-10-29 10:42:53 -0400124 ((u16)((((u32)(f))&HFA384x_ADDR_FLAT_CMD_PAGE_MASK)>>16))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700125#define HFA384x_ADDR_CMD_MKOFF(f) \
Solomon Peachyaaad4302008-10-29 10:42:53 -0400126 ((u16)(((u32)(f))&HFA384x_ADDR_FLAT_CMD_OFF_MASK))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700127
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700128/*--- Controller Memory addresses -------------------*/
129#define HFA3842_PDA_BASE (0x007f0000UL)
130#define HFA3841_PDA_BASE (0x003f0000UL)
131#define HFA3841_PDA_BOGUS_BASE (0x00390000UL)
132
133/*--- Driver Download states -----------------------*/
134#define HFA384x_DLSTATE_DISABLED 0
135#define HFA384x_DLSTATE_RAMENABLED 1
136#define HFA384x_DLSTATE_FLASHENABLED 2
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700137
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700138/*--- Register Field Masks --------------------------*/
Alessandro Ghedini71508ee2010-02-15 12:25:22 +0100139#define HFA384x_CMD_AINFO ((u16)(BIT(14) | BIT(13) \
140 | BIT(12) | BIT(11) \
141 | BIT(10) | BIT(9) \
142 | BIT(8)))
143#define HFA384x_CMD_MACPORT ((u16)(BIT(10) | BIT(9) | \
144 BIT(8)))
Moritz Muehlenhoff7f6e0e42009-01-25 21:54:55 +0100145#define HFA384x_CMD_PROGMODE ((u16)(BIT(9) | BIT(8)))
Alessandro Ghedini71508ee2010-02-15 12:25:22 +0100146#define HFA384x_CMD_CMDCODE ((u16)(BIT(5) | BIT(4) | \
147 BIT(3) | BIT(2) | \
148 BIT(1) | BIT(0)))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700149
Alessandro Ghedini71508ee2010-02-15 12:25:22 +0100150#define HFA384x_STATUS_RESULT ((u16)(BIT(14) | BIT(13) \
151 | BIT(12) | BIT(11) \
152 | BIT(10) | BIT(9) \
153 | BIT(8)))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700154
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700155/*--- Command Code Constants --------------------------*/
156/*--- Controller Commands --------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400157#define HFA384x_CMDCODE_INIT ((u16)0x00)
158#define HFA384x_CMDCODE_ENABLE ((u16)0x01)
159#define HFA384x_CMDCODE_DISABLE ((u16)0x02)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700160
161/*--- Regulate Commands --------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400162#define HFA384x_CMDCODE_INQ ((u16)0x11)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700163
164/*--- Configure Commands --------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400165#define HFA384x_CMDCODE_DOWNLD ((u16)0x22)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700166
167/*--- Debugging Commands -----------------------------*/
Garrick Heeec0d0d2013-02-01 01:45:16 -0800168#define HFA384x_CMDCODE_MONITOR ((u16)(0x38))
Solomon Peachyaaad4302008-10-29 10:42:53 -0400169#define HFA384x_MONITOR_ENABLE ((u16)(0x0b))
170#define HFA384x_MONITOR_DISABLE ((u16)(0x0f))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700171
172/*--- Result Codes --------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400173#define HFA384x_CMD_ERR ((u16)(0x7F))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700174
175/*--- Programming Modes --------------------------
176 MODE 0: Disable programming
177 MODE 1: Enable volatile memory programming
178 MODE 2: Enable non-volatile memory programming
179 MODE 3: Program non-volatile memory section
180--------------------------------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400181#define HFA384x_PROGMODE_DISABLE ((u16)0x00)
182#define HFA384x_PROGMODE_RAM ((u16)0x01)
183#define HFA384x_PROGMODE_NV ((u16)0x02)
184#define HFA384x_PROGMODE_NVWRITE ((u16)0x03)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700185
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700186/*--- Record ID Constants --------------------------*/
187/*--------------------------------------------------------------------
188Configuration RIDs: Network Parameters, Static Configuration Entities
189--------------------------------------------------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400190#define HFA384x_RID_CNFPORTTYPE ((u16)0xFC00)
191#define HFA384x_RID_CNFOWNMACADDR ((u16)0xFC01)
192#define HFA384x_RID_CNFDESIREDSSID ((u16)0xFC02)
193#define HFA384x_RID_CNFOWNCHANNEL ((u16)0xFC03)
194#define HFA384x_RID_CNFOWNSSID ((u16)0xFC04)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400195#define HFA384x_RID_CNFMAXDATALEN ((u16)0xFC07)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700196
197/*--------------------------------------------------------------------
198Configuration RID lengths: Network Params, Static Config Entities
199 This is the length of JUST the DATA part of the RID (does not
200 include the len or code fields)
201--------------------------------------------------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400202#define HFA384x_RID_CNFOWNMACADDR_LEN ((u16)6)
203#define HFA384x_RID_CNFDESIREDSSID_LEN ((u16)34)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400204#define HFA384x_RID_CNFOWNSSID_LEN ((u16)34)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700205
206/*--------------------------------------------------------------------
207Configuration RIDs: Network Parameters, Dynamic Configuration Entities
208--------------------------------------------------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400209#define HFA384x_RID_CREATEIBSS ((u16)0xFC81)
210#define HFA384x_RID_FRAGTHRESH ((u16)0xFC82)
211#define HFA384x_RID_RTSTHRESH ((u16)0xFC83)
212#define HFA384x_RID_TXRATECNTL ((u16)0xFC84)
213#define HFA384x_RID_PROMISCMODE ((u16)0xFC85)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700214
215/*----------------------------------------------------------------------
216Information RIDs: NIC Information
217--------------------------------------------------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400218#define HFA384x_RID_MAXLOADTIME ((u16)0xFD00)
219#define HFA384x_RID_DOWNLOADBUFFER ((u16)0xFD01)
220#define HFA384x_RID_PRIIDENTITY ((u16)0xFD02)
221#define HFA384x_RID_PRISUPRANGE ((u16)0xFD03)
222#define HFA384x_RID_PRI_CFIACTRANGES ((u16)0xFD04)
223#define HFA384x_RID_NICSERIALNUMBER ((u16)0xFD0A)
224#define HFA384x_RID_NICIDENTITY ((u16)0xFD0B)
225#define HFA384x_RID_MFISUPRANGE ((u16)0xFD0C)
226#define HFA384x_RID_CFISUPRANGE ((u16)0xFD0D)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400227#define HFA384x_RID_STAIDENTITY ((u16)0xFD20)
228#define HFA384x_RID_STASUPRANGE ((u16)0xFD21)
229#define HFA384x_RID_STA_MFIACTRANGES ((u16)0xFD22)
230#define HFA384x_RID_STA_CFIACTRANGES ((u16)0xFD23)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700231
232/*----------------------------------------------------------------------
233Information RID Lengths: NIC Information
234 This is the length of JUST the DATA part of the RID (does not
235 include the len or code fields)
236--------------------------------------------------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400237#define HFA384x_RID_NICSERIALNUMBER_LEN ((u16)12)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700238
239/*--------------------------------------------------------------------
240Information RIDs: MAC Information
241--------------------------------------------------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400242#define HFA384x_RID_PORTSTATUS ((u16)0xFD40)
243#define HFA384x_RID_CURRENTSSID ((u16)0xFD41)
244#define HFA384x_RID_CURRENTBSSID ((u16)0xFD42)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400245#define HFA384x_RID_CURRENTTXRATE ((u16)0xFD44)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400246#define HFA384x_RID_SHORTRETRYLIMIT ((u16)0xFD48)
247#define HFA384x_RID_LONGRETRYLIMIT ((u16)0xFD49)
248#define HFA384x_RID_MAXTXLIFETIME ((u16)0xFD4A)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400249#define HFA384x_RID_PRIVACYOPTIMP ((u16)0xFD4F)
250#define HFA384x_RID_DBMCOMMSQUALITY ((u16)0xFD51)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700251
252/*--------------------------------------------------------------------
253Information RID Lengths: MAC Information
254 This is the length of JUST the DATA part of the RID (does not
255 include the len or code fields)
256--------------------------------------------------------------------*/
Alessandro Ghedini71508ee2010-02-15 12:25:22 +0100257#define HFA384x_RID_DBMCOMMSQUALITY_LEN \
258 ((u16) sizeof(hfa384x_dbmcommsquality_t))
259#define HFA384x_RID_JOINREQUEST_LEN \
260 ((u16)sizeof(hfa384x_JoinRequest_data_t))
Moritz Muehlenhoff40a67412009-02-01 13:29:08 +0100261
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700262/*--------------------------------------------------------------------
263Information RIDs: Modem Information
264--------------------------------------------------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400265#define HFA384x_RID_CURRENTCHANNEL ((u16)0xFDC1)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700266
267/*--------------------------------------------------------------------
268API ENHANCEMENTS (NOT ALREADY IMPLEMENTED)
269--------------------------------------------------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400270#define HFA384x_RID_CNFWEPDEFAULTKEYID ((u16)0xFC23)
271#define HFA384x_RID_CNFWEPDEFAULTKEY0 ((u16)0xFC24)
272#define HFA384x_RID_CNFWEPDEFAULTKEY1 ((u16)0xFC25)
273#define HFA384x_RID_CNFWEPDEFAULTKEY2 ((u16)0xFC26)
274#define HFA384x_RID_CNFWEPDEFAULTKEY3 ((u16)0xFC27)
275#define HFA384x_RID_CNFWEPFLAGS ((u16)0xFC28)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400276#define HFA384x_RID_CNFAUTHENTICATION ((u16)0xFC2A)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400277#define HFA384x_RID_CNFROAMINGMODE ((u16)0xFC2D)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400278#define HFA384x_RID_CNFAPBCNint ((u16)0xFC33)
Garrick Heeec0d0d2013-02-01 01:45:16 -0800279#define HFA384x_RID_CNFDBMADJUST ((u16)0xFC46)
280#define HFA384x_RID_CNFWPADATA ((u16)0xFC48)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400281#define HFA384x_RID_CNFBASICRATES ((u16)0xFCB3)
282#define HFA384x_RID_CNFSUPPRATES ((u16)0xFCB4)
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100283#define HFA384x_RID_CNFPASSIVESCANCTRL ((u16)0xFCBA)
Garrick Heeec0d0d2013-02-01 01:45:16 -0800284#define HFA384x_RID_TXPOWERMAX ((u16)0xFCBE)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400285#define HFA384x_RID_JOINREQUEST ((u16)0xFCE2)
286#define HFA384x_RID_AUTHENTICATESTA ((u16)0xFCE3)
Garrick Heeec0d0d2013-02-01 01:45:16 -0800287#define HFA384x_RID_HOSTSCAN ((u16)0xFCE5)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700288
Solomon Peachyaaad4302008-10-29 10:42:53 -0400289#define HFA384x_RID_CNFWEPDEFAULTKEY_LEN ((u16)6)
290#define HFA384x_RID_CNFWEP128DEFAULTKEY_LEN ((u16)14)
Moritz Muehlenhoff40a67412009-02-01 13:29:08 +0100291
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700292/*--------------------------------------------------------------------
293PD Record codes
294--------------------------------------------------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400295#define HFA384x_PDR_PCB_PARTNUM ((u16)0x0001)
296#define HFA384x_PDR_PDAVER ((u16)0x0002)
297#define HFA384x_PDR_NIC_SERIAL ((u16)0x0003)
298#define HFA384x_PDR_MKK_MEASUREMENTS ((u16)0x0004)
299#define HFA384x_PDR_NIC_RAMSIZE ((u16)0x0005)
300#define HFA384x_PDR_MFISUPRANGE ((u16)0x0006)
301#define HFA384x_PDR_CFISUPRANGE ((u16)0x0007)
302#define HFA384x_PDR_NICID ((u16)0x0008)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400303#define HFA384x_PDR_MAC_ADDRESS ((u16)0x0101)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400304#define HFA384x_PDR_REGDOMAIN ((u16)0x0103)
305#define HFA384x_PDR_ALLOWED_CHANNEL ((u16)0x0104)
306#define HFA384x_PDR_DEFAULT_CHANNEL ((u16)0x0105)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400307#define HFA384x_PDR_TEMPTYPE ((u16)0x0107)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400308#define HFA384x_PDR_IFR_SETTING ((u16)0x0200)
309#define HFA384x_PDR_RFR_SETTING ((u16)0x0201)
310#define HFA384x_PDR_HFA3861_BASELINE ((u16)0x0202)
311#define HFA384x_PDR_HFA3861_SHADOW ((u16)0x0203)
312#define HFA384x_PDR_HFA3861_IFRF ((u16)0x0204)
313#define HFA384x_PDR_HFA3861_CHCALSP ((u16)0x0300)
314#define HFA384x_PDR_HFA3861_CHCALI ((u16)0x0301)
Garrick Heeec0d0d2013-02-01 01:45:16 -0800315#define HFA384x_PDR_MAX_TX_POWER ((u16)0x0302)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400316#define HFA384x_PDR_MASTER_CHAN_LIST ((u16)0x0303)
317#define HFA384x_PDR_3842_NIC_CONFIG ((u16)0x0400)
318#define HFA384x_PDR_USB_ID ((u16)0x0401)
319#define HFA384x_PDR_PCI_ID ((u16)0x0402)
320#define HFA384x_PDR_PCI_IFCONF ((u16)0x0403)
321#define HFA384x_PDR_PCI_PMCONF ((u16)0x0404)
322#define HFA384x_PDR_RFENRGY ((u16)0x0406)
323#define HFA384x_PDR_USB_POWER_TYPE ((u16)0x0407)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400324#define HFA384x_PDR_USB_MAX_POWER ((u16)0x0409)
325#define HFA384x_PDR_USB_MANUFACTURER ((u16)0x0410)
Garrick Heeec0d0d2013-02-01 01:45:16 -0800326#define HFA384x_PDR_USB_PRODUCT ((u16)0x0411)
327#define HFA384x_PDR_ANT_DIVERSITY ((u16)0x0412)
328#define HFA384x_PDR_HFO_DELAY ((u16)0x0413)
329#define HFA384x_PDR_SCALE_THRESH ((u16)0x0414)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700330
Solomon Peachyaaad4302008-10-29 10:42:53 -0400331#define HFA384x_PDR_HFA3861_MANF_TESTSP ((u16)0x0900)
332#define HFA384x_PDR_HFA3861_MANF_TESTI ((u16)0x0901)
333#define HFA384x_PDR_END_OF_PDA ((u16)0x0000)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700334
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700335/*--- Register Test/Get/Set Field macros ------------------------*/
336
Alessandro Ghedini71508ee2010-02-15 12:25:22 +0100337#define HFA384x_CMD_AINFO_SET(value) ((u16)((u16)(value) << 8))
338#define HFA384x_CMD_MACPORT_SET(value) \
339 ((u16)HFA384x_CMD_AINFO_SET(value))
340#define HFA384x_CMD_PROGMODE_SET(value) \
341 ((u16)HFA384x_CMD_AINFO_SET((u16)value))
Solomon Peachyaaad4302008-10-29 10:42:53 -0400342#define HFA384x_CMD_CMDCODE_SET(value) ((u16)(value))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700343
Solomon Peachyaaad4302008-10-29 10:42:53 -0400344#define HFA384x_STATUS_RESULT_SET(value) (((u16)(value)) << 8)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700345
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700346/* Host Maintained State Info */
347#define HFA384x_STATE_PREINIT 0
348#define HFA384x_STATE_INIT 1
349#define HFA384x_STATE_RUNNING 2
350
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700351/*-------------------------------------------------------------*/
352/* Commonly used basic types */
Himangi Saraogib2119912013-11-02 18:11:44 +0530353struct hfa384x_bytestr {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100354 u16 len;
355 u8 data[0];
Himangi Saraogib2119912013-11-02 18:11:44 +0530356} __packed;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700357
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100358typedef struct hfa384x_bytestr32 {
359 u16 len;
360 u8 data[32];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100361} __packed hfa384x_bytestr32_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700362
363/*--------------------------------------------------------------------
364Configuration Record Structures:
365 Network Parameters, Static Configuration Entities
366--------------------------------------------------------------------*/
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700367
368/*-- Hardware/Firmware Component Information ----------*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100369typedef struct hfa384x_compident {
370 u16 id;
371 u16 variant;
372 u16 major;
373 u16 minor;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100374} __packed hfa384x_compident_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700375
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100376typedef struct hfa384x_caplevel {
377 u16 role;
378 u16 id;
379 u16 variant;
380 u16 bottom;
381 u16 top;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100382} __packed hfa384x_caplevel_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700383
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700384/*-- Configuration Record: cnfAuthentication --*/
385#define HFA384x_CNFAUTHENTICATION_OPENSYSTEM 0x0001
386#define HFA384x_CNFAUTHENTICATION_SHAREDKEY 0x0002
Garrick Heeec0d0d2013-02-01 01:45:16 -0800387#define HFA384x_CNFAUTHENTICATION_LEAP 0x0004
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700388
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700389/*--------------------------------------------------------------------
390Configuration Record Structures:
391 Network Parameters, Dynamic Configuration Entities
392--------------------------------------------------------------------*/
393
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700394#define HFA384x_CREATEIBSS_JOINCREATEIBSS 0
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700395
396/*-- Configuration Record: HostScanRequest (data portion only) --*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100397typedef struct hfa384x_HostScanRequest_data {
398 u16 channelList;
399 u16 txRate;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700400 hfa384x_bytestr32_t ssid;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100401} __packed hfa384x_HostScanRequest_data_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700402
403/*-- Configuration Record: JoinRequest (data portion only) --*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100404typedef struct hfa384x_JoinRequest_data {
405 u8 bssid[WLAN_BSSID_LEN];
406 u16 channel;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100407} __packed hfa384x_JoinRequest_data_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700408
409/*-- Configuration Record: authenticateStation (data portion only) --*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100410typedef struct hfa384x_authenticateStation_data {
411 u8 address[ETH_ALEN];
412 u16 status;
413 u16 algorithm;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100414} __packed hfa384x_authenticateStation_data_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700415
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700416/*-- Configuration Record: WPAData (data portion only) --*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100417typedef struct hfa384x_WPAData {
418 u16 datalen;
Svenne Krap5dd8acc2010-02-14 18:59:00 +0100419 u8 data[0]; /* max 80 */
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100420} __packed hfa384x_WPAData_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700421
422/*--------------------------------------------------------------------
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700423Information Record Structures: NIC Information
424--------------------------------------------------------------------*/
425
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700426/*-- Information Record: DownLoadBuffer --*/
427/* NOTE: The page and offset are in AUX format */
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100428typedef struct hfa384x_downloadbuffer {
429 u16 page;
430 u16 offset;
431 u16 len;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100432} __packed hfa384x_downloadbuffer_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700433
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700434/*--------------------------------------------------------------------
435Information Record Structures: NIC Information
436--------------------------------------------------------------------*/
437
Solomon Peachyaaad4302008-10-29 10:42:53 -0400438#define HFA384x_PSTATUS_CONN_IBSS ((u16)3)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700439
440/*-- Information Record: commsquality --*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100441typedef struct hfa384x_commsquality {
442 u16 CQ_currBSS;
443 u16 ASL_currBSS;
444 u16 ANL_currFC;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100445} __packed hfa384x_commsquality_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700446
447/*-- Information Record: dmbcommsquality --*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100448typedef struct hfa384x_dbmcommsquality {
449 u16 CQdbm_currBSS;
450 u16 ASLdbm_currBSS;
451 u16 ANLdbm_currFC;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100452} __packed hfa384x_dbmcommsquality_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700453
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700454/*--------------------------------------------------------------------
455FRAME STRUCTURES: Communication Frames
456----------------------------------------------------------------------
457Communication Frames: Transmit Frames
458--------------------------------------------------------------------*/
459/*-- Communication Frame: Transmit Frame Structure --*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100460typedef struct hfa384x_tx_frame {
461 u16 status;
462 u16 reserved1;
463 u16 reserved2;
464 u32 sw_support;
465 u8 tx_retrycount;
466 u8 tx_rate;
467 u16 tx_control;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700468
469 /*-- 802.11 Header Information --*/
470
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100471 u16 frame_control;
472 u16 duration_id;
473 u8 address1[6];
474 u8 address2[6];
475 u8 address3[6];
476 u16 sequence_control;
477 u8 address4[6];
478 u16 data_len; /* little endian format */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700479
480 /*-- 802.3 Header Information --*/
481
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100482 u8 dest_addr[6];
483 u8 src_addr[6];
484 u16 data_length; /* big endian format */
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100485} __packed hfa384x_tx_frame_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700486/*--------------------------------------------------------------------
487Communication Frames: Field Masks for Transmit Frames
488--------------------------------------------------------------------*/
489/*-- Status Field --*/
Moritz Muehlenhoff7f6e0e42009-01-25 21:54:55 +0100490#define HFA384x_TXSTATUS_ACKERR ((u16)BIT(5))
491#define HFA384x_TXSTATUS_FORMERR ((u16)BIT(3))
492#define HFA384x_TXSTATUS_DISCON ((u16)BIT(2))
493#define HFA384x_TXSTATUS_AGEDERR ((u16)BIT(1))
494#define HFA384x_TXSTATUS_RETRYERR ((u16)BIT(0))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700495/*-- Transmit Control Field --*/
Alessandro Ghedini71508ee2010-02-15 12:25:22 +0100496#define HFA384x_TX_MACPORT ((u16)(BIT(10) | \
497 BIT(9) | BIT(8)))
Moritz Muehlenhoff7f6e0e42009-01-25 21:54:55 +0100498#define HFA384x_TX_STRUCTYPE ((u16)(BIT(4) | BIT(3)))
499#define HFA384x_TX_TXEX ((u16)BIT(2))
500#define HFA384x_TX_TXOK ((u16)BIT(1))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700501/*--------------------------------------------------------------------
502Communication Frames: Test/Get/Set Field Values for Transmit Frames
503--------------------------------------------------------------------*/
504/*-- Status Field --*/
505#define HFA384x_TXSTATUS_ISERROR(v) \
Solomon Peachyaaad4302008-10-29 10:42:53 -0400506 (((u16)(v))&\
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700507 (HFA384x_TXSTATUS_ACKERR|HFA384x_TXSTATUS_FORMERR|\
508 HFA384x_TXSTATUS_DISCON|HFA384x_TXSTATUS_AGEDERR|\
509 HFA384x_TXSTATUS_RETRYERR))
510
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100511#define HFA384x_TX_SET(v, m, s) ((((u16)(v))<<((u16)(s)))&((u16)(m)))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700512
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700513#define HFA384x_TX_MACPORT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8)
Alessandro Ghedini71508ee2010-02-15 12:25:22 +0100514#define HFA384x_TX_STRUCTYPE_SET(v) HFA384x_TX_SET(v, \
515 HFA384x_TX_STRUCTYPE, 3)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700516#define HFA384x_TX_TXEX_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700517#define HFA384x_TX_TXOK_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1)
518/*--------------------------------------------------------------------
519Communication Frames: Receive Frames
520--------------------------------------------------------------------*/
521/*-- Communication Frame: Receive Frame Structure --*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100522typedef struct hfa384x_rx_frame {
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700523 /*-- MAC rx descriptor (hfa384x byte order) --*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100524 u16 status;
525 u32 time;
526 u8 silence;
527 u8 signal;
528 u8 rate;
529 u8 rx_flow;
530 u16 reserved1;
531 u16 reserved2;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700532
533 /*-- 802.11 Header Information (802.11 byte order) --*/
Himangi Saraogi8cbe56e2014-03-05 21:10:52 +0530534 __le16 frame_control;
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100535 u16 duration_id;
536 u8 address1[6];
537 u8 address2[6];
538 u8 address3[6];
539 u16 sequence_control;
540 u8 address4[6];
Himangi Saraogi8cbe56e2014-03-05 21:10:52 +0530541 __le16 data_len; /* hfa384x (little endian) format */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700542
543 /*-- 802.3 Header Information --*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100544 u8 dest_addr[6];
545 u8 src_addr[6];
546 u16 data_length; /* IEEE? (big endian) format */
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100547} __packed hfa384x_rx_frame_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700548/*--------------------------------------------------------------------
549Communication Frames: Field Masks for Receive Frames
550--------------------------------------------------------------------*/
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700551
552/*-- Status Fields --*/
Alessandro Ghedini71508ee2010-02-15 12:25:22 +0100553#define HFA384x_RXSTATUS_MACPORT ((u16)(BIT(10) | \
554 BIT(9) | \
555 BIT(8)))
Moritz Muehlenhoff7f6e0e42009-01-25 21:54:55 +0100556#define HFA384x_RXSTATUS_FCSERR ((u16)BIT(0))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700557/*--------------------------------------------------------------------
558Communication Frames: Test/Get/Set Field Values for Receive Frames
559--------------------------------------------------------------------*/
Alessandro Ghedini71508ee2010-02-15 12:25:22 +0100560#define HFA384x_RXSTATUS_MACPORT_GET(value) ((u16)((((u16)(value)) \
561 & HFA384x_RXSTATUS_MACPORT) >> 8))
562#define HFA384x_RXSTATUS_ISFCSERR(value) ((u16)(((u16)(value)) \
563 & HFA384x_RXSTATUS_FCSERR))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700564/*--------------------------------------------------------------------
565 FRAME STRUCTURES: Information Types and Information Frame Structures
566----------------------------------------------------------------------
567Information Types
568--------------------------------------------------------------------*/
Solomon Peachyaaad4302008-10-29 10:42:53 -0400569#define HFA384x_IT_HANDOVERADDR ((u16)0xF000UL)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400570#define HFA384x_IT_COMMTALLIES ((u16)0xF100UL)
571#define HFA384x_IT_SCANRESULTS ((u16)0xF101UL)
572#define HFA384x_IT_CHINFORESULTS ((u16)0xF102UL)
573#define HFA384x_IT_HOSTSCANRESULTS ((u16)0xF103UL)
574#define HFA384x_IT_LINKSTATUS ((u16)0xF200UL)
575#define HFA384x_IT_ASSOCSTATUS ((u16)0xF201UL)
576#define HFA384x_IT_AUTHREQ ((u16)0xF202UL)
577#define HFA384x_IT_PSUSERCNT ((u16)0xF203UL)
578#define HFA384x_IT_KEYIDCHANGED ((u16)0xF204UL)
Garrick Heeec0d0d2013-02-01 01:45:16 -0800579#define HFA384x_IT_ASSOCREQ ((u16)0xF205UL)
580#define HFA384x_IT_MICFAILURE ((u16)0xF206UL)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700581
582/*--------------------------------------------------------------------
583Information Frames Structures
584----------------------------------------------------------------------
585Information Frames: Notification Frame Structures
586--------------------------------------------------------------------*/
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700587
588/*-- Inquiry Frame, Diagnose: Communication Tallies --*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100589typedef struct hfa384x_CommTallies16 {
590 u16 txunicastframes;
591 u16 txmulticastframes;
592 u16 txfragments;
593 u16 txunicastoctets;
594 u16 txmulticastoctets;
595 u16 txdeferredtrans;
596 u16 txsingleretryframes;
597 u16 txmultipleretryframes;
598 u16 txretrylimitexceeded;
599 u16 txdiscards;
600 u16 rxunicastframes;
601 u16 rxmulticastframes;
602 u16 rxfragments;
603 u16 rxunicastoctets;
604 u16 rxmulticastoctets;
605 u16 rxfcserrors;
606 u16 rxdiscardsnobuffer;
607 u16 txdiscardswrongsa;
608 u16 rxdiscardswepundecr;
609 u16 rxmsginmsgfrag;
610 u16 rxmsginbadmsgfrag;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100611} __packed hfa384x_CommTallies16_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700612
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100613typedef struct hfa384x_CommTallies32 {
614 u32 txunicastframes;
615 u32 txmulticastframes;
616 u32 txfragments;
617 u32 txunicastoctets;
618 u32 txmulticastoctets;
619 u32 txdeferredtrans;
620 u32 txsingleretryframes;
621 u32 txmultipleretryframes;
622 u32 txretrylimitexceeded;
623 u32 txdiscards;
624 u32 rxunicastframes;
625 u32 rxmulticastframes;
626 u32 rxfragments;
627 u32 rxunicastoctets;
628 u32 rxmulticastoctets;
629 u32 rxfcserrors;
630 u32 rxdiscardsnobuffer;
631 u32 txdiscardswrongsa;
632 u32 rxdiscardswepundecr;
633 u32 rxmsginmsgfrag;
634 u32 rxmsginbadmsgfrag;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100635} __packed hfa384x_CommTallies32_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700636
637/*-- Inquiry Frame, Diagnose: Scan Results & Subfields--*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100638typedef struct hfa384x_ScanResultSub {
639 u16 chid;
640 u16 anl;
641 u16 sl;
642 u8 bssid[WLAN_BSSID_LEN];
643 u16 bcnint;
644 u16 capinfo;
645 hfa384x_bytestr32_t ssid;
646 u8 supprates[10]; /* 802.11 info element */
647 u16 proberesp_rate;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100648} __packed hfa384x_ScanResultSub_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700649
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100650typedef struct hfa384x_ScanResult {
651 u16 rsvd;
652 u16 scanreason;
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530653 hfa384x_ScanResultSub_t result[HFA384x_SCANRESULT_MAX];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100654} __packed hfa384x_ScanResult_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700655
656/*-- Inquiry Frame, Diagnose: ChInfo Results & Subfields--*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100657typedef struct hfa384x_ChInfoResultSub {
658 u16 chid;
659 u16 anl;
660 u16 pnl;
661 u16 active;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100662} __packed hfa384x_ChInfoResultSub_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700663
Moritz Muehlenhoff7f6e0e42009-01-25 21:54:55 +0100664#define HFA384x_CHINFORESULT_BSSACTIVE BIT(0)
665#define HFA384x_CHINFORESULT_PCFACTIVE BIT(1)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700666
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100667typedef struct hfa384x_ChInfoResult {
668 u16 scanchannels;
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530669 hfa384x_ChInfoResultSub_t result[HFA384x_CHINFORESULT_MAX];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100670} __packed hfa384x_ChInfoResult_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700671
672/*-- Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100673typedef struct hfa384x_HScanResultSub {
674 u16 chid;
675 u16 anl;
676 u16 sl;
677 u8 bssid[WLAN_BSSID_LEN];
678 u16 bcnint;
679 u16 capinfo;
680 hfa384x_bytestr32_t ssid;
681 u8 supprates[10]; /* 802.11 info element */
682 u16 proberesp_rate;
683 u16 atim;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100684} __packed hfa384x_HScanResultSub_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700685
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100686typedef struct hfa384x_HScanResult {
687 u16 nresult;
688 u16 rsvd;
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530689 hfa384x_HScanResultSub_t result[HFA384x_HSCANRESULT_MAX];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100690} __packed hfa384x_HScanResult_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700691
692/*-- Unsolicited Frame, MAC Mgmt: LinkStatus --*/
693
Solomon Peachyaaad4302008-10-29 10:42:53 -0400694#define HFA384x_LINK_NOTCONNECTED ((u16)0)
695#define HFA384x_LINK_CONNECTED ((u16)1)
696#define HFA384x_LINK_DISCONNECTED ((u16)2)
697#define HFA384x_LINK_AP_CHANGE ((u16)3)
698#define HFA384x_LINK_AP_OUTOFRANGE ((u16)4)
699#define HFA384x_LINK_AP_INRANGE ((u16)5)
700#define HFA384x_LINK_ASSOCFAIL ((u16)6)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700701
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100702typedef struct hfa384x_LinkStatus {
703 u16 linkstatus;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100704} __packed hfa384x_LinkStatus_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700705
706/*-- Unsolicited Frame, MAC Mgmt: AssociationStatus (--*/
707
Solomon Peachyaaad4302008-10-29 10:42:53 -0400708#define HFA384x_ASSOCSTATUS_STAASSOC ((u16)1)
709#define HFA384x_ASSOCSTATUS_REASSOC ((u16)2)
Solomon Peachyaaad4302008-10-29 10:42:53 -0400710#define HFA384x_ASSOCSTATUS_AUTHFAIL ((u16)5)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700711
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100712typedef struct hfa384x_AssocStatus {
713 u16 assocstatus;
714 u8 sta_addr[ETH_ALEN];
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700715 /* old_ap_addr is only valid if assocstatus == 2 */
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100716 u8 old_ap_addr[ETH_ALEN];
717 u16 reason;
718 u16 reserved;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100719} __packed hfa384x_AssocStatus_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700720
721/*-- Unsolicited Frame, MAC Mgmt: AuthRequest (AP Only) --*/
722
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100723typedef struct hfa384x_AuthRequest {
724 u8 sta_addr[ETH_ALEN];
725 u16 algorithm;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100726} __packed hfa384x_AuthReq_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700727
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700728/*-- Unsolicited Frame, MAC Mgmt: PSUserCount (AP Only) --*/
729
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100730typedef struct hfa384x_PSUserCount {
731 u16 usercnt;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100732} __packed hfa384x_PSUserCount_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700733
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100734typedef struct hfa384x_KeyIDChanged {
735 u8 sta_addr[ETH_ALEN];
736 u16 keyid;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100737} __packed hfa384x_KeyIDChanged_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700738
739/*-- Collection of all Inf frames ---------------*/
740typedef union hfa384x_infodata {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100741 hfa384x_CommTallies16_t commtallies16;
742 hfa384x_CommTallies32_t commtallies32;
743 hfa384x_ScanResult_t scanresult;
744 hfa384x_ChInfoResult_t chinforesult;
745 hfa384x_HScanResult_t hscanresult;
746 hfa384x_LinkStatus_t linkstatus;
747 hfa384x_AssocStatus_t assocstatus;
748 hfa384x_AuthReq_t authreq;
749 hfa384x_PSUserCount_t psusercnt;
750 hfa384x_KeyIDChanged_t keyidchanged;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100751} __packed hfa384x_infodata_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700752
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100753typedef struct hfa384x_InfFrame {
754 u16 framelen;
755 u16 infotype;
756 hfa384x_infodata_t info;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100757} __packed hfa384x_InfFrame_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700758
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700759/*--------------------------------------------------------------------
760USB Packet structures and constants.
761--------------------------------------------------------------------*/
762
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700763/* Should be sent to the bulkout endpoint */
764#define HFA384x_USB_TXFRM 0
765#define HFA384x_USB_CMDREQ 1
766#define HFA384x_USB_WRIDREQ 2
767#define HFA384x_USB_RRIDREQ 3
768#define HFA384x_USB_WMEMREQ 4
769#define HFA384x_USB_RMEMREQ 5
770
771/* Received from the bulkin endpoint */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700772#define HFA384x_USB_ISTXFRM(a) (((a) & 0x9000) == 0x1000)
773#define HFA384x_USB_ISRXFRM(a) (!((a) & 0x9000))
774#define HFA384x_USB_INFOFRM 0x8000
775#define HFA384x_USB_CMDRESP 0x8001
776#define HFA384x_USB_WRIDRESP 0x8002
777#define HFA384x_USB_RRIDRESP 0x8003
778#define HFA384x_USB_WMEMRESP 0x8004
779#define HFA384x_USB_RMEMRESP 0x8005
780#define HFA384x_USB_BUFAVAIL 0x8006
781#define HFA384x_USB_ERROR 0x8007
782
783/*------------------------------------*/
784/* Request (bulk OUT) packet contents */
785
786typedef struct hfa384x_usb_txfrm {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100787 hfa384x_tx_frame_t desc;
788 u8 data[WLAN_DATA_MAXLEN];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100789} __packed hfa384x_usb_txfrm_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700790
791typedef struct hfa384x_usb_cmdreq {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100792 u16 type;
793 u16 cmd;
794 u16 parm0;
795 u16 parm1;
796 u16 parm2;
797 u8 pad[54];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100798} __packed hfa384x_usb_cmdreq_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700799
800typedef struct hfa384x_usb_wridreq {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100801 u16 type;
802 u16 frmlen;
803 u16 rid;
804 u8 data[HFA384x_RIDDATA_MAXLEN];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100805} __packed hfa384x_usb_wridreq_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700806
807typedef struct hfa384x_usb_rridreq {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100808 u16 type;
809 u16 frmlen;
810 u16 rid;
811 u8 pad[58];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100812} __packed hfa384x_usb_rridreq_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700813
814typedef struct hfa384x_usb_wmemreq {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100815 u16 type;
816 u16 frmlen;
817 u16 offset;
818 u16 page;
819 u8 data[HFA384x_USB_RWMEM_MAXLEN];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100820} __packed hfa384x_usb_wmemreq_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700821
822typedef struct hfa384x_usb_rmemreq {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100823 u16 type;
824 u16 frmlen;
825 u16 offset;
826 u16 page;
827 u8 pad[56];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100828} __packed hfa384x_usb_rmemreq_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700829
830/*------------------------------------*/
831/* Response (bulk IN) packet contents */
832
833typedef struct hfa384x_usb_rxfrm {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100834 hfa384x_rx_frame_t desc;
835 u8 data[WLAN_DATA_MAXLEN];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100836} __packed hfa384x_usb_rxfrm_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700837
838typedef struct hfa384x_usb_infofrm {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100839 u16 type;
840 hfa384x_InfFrame_t info;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100841} __packed hfa384x_usb_infofrm_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700842
843typedef struct hfa384x_usb_statusresp {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100844 u16 type;
845 u16 status;
846 u16 resp0;
847 u16 resp1;
848 u16 resp2;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100849} __packed hfa384x_usb_cmdresp_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700850
851typedef hfa384x_usb_cmdresp_t hfa384x_usb_wridresp_t;
852
853typedef struct hfa384x_usb_rridresp {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100854 u16 type;
855 u16 frmlen;
856 u16 rid;
857 u8 data[HFA384x_RIDDATA_MAXLEN];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100858} __packed hfa384x_usb_rridresp_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700859
860typedef hfa384x_usb_cmdresp_t hfa384x_usb_wmemresp_t;
861
862typedef struct hfa384x_usb_rmemresp {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100863 u16 type;
864 u16 frmlen;
865 u8 data[HFA384x_USB_RWMEM_MAXLEN];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100866} __packed hfa384x_usb_rmemresp_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700867
868typedef struct hfa384x_usb_bufavail {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100869 u16 type;
870 u16 frmlen;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100871} __packed hfa384x_usb_bufavail_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700872
873typedef struct hfa384x_usb_error {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100874 u16 type;
875 u16 errortype;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100876} __packed hfa384x_usb_error_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700877
878/*----------------------------------------------------------*/
879/* Unions for packaging all the known packet types together */
880
881typedef union hfa384x_usbout {
Asaf Vertza78d1312015-01-18 09:11:39 +0200882 __le16 type;
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100883 hfa384x_usb_txfrm_t txfrm;
884 hfa384x_usb_cmdreq_t cmdreq;
885 hfa384x_usb_wridreq_t wridreq;
886 hfa384x_usb_rridreq_t rridreq;
887 hfa384x_usb_wmemreq_t wmemreq;
888 hfa384x_usb_rmemreq_t rmemreq;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100889} __packed hfa384x_usbout_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700890
891typedef union hfa384x_usbin {
Asaf Vertza78d1312015-01-18 09:11:39 +0200892 __le16 type;
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +0100893 hfa384x_usb_rxfrm_t rxfrm;
894 hfa384x_usb_txfrm_t txfrm;
895 hfa384x_usb_infofrm_t infofrm;
896 hfa384x_usb_cmdresp_t cmdresp;
897 hfa384x_usb_wridresp_t wridresp;
898 hfa384x_usb_rridresp_t rridresp;
899 hfa384x_usb_wmemresp_t wmemresp;
900 hfa384x_usb_rmemresp_t rmemresp;
901 hfa384x_usb_bufavail_t bufavail;
902 hfa384x_usb_error_t usberror;
903 u8 boguspad[3000];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100904} __packed hfa384x_usbin_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700905
Karl Relton76e3e7c2009-04-17 10:15:34 +0100906/*--------------------------------------------------------------------
907PD record structures.
908--------------------------------------------------------------------*/
909
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530910typedef struct hfa384x_pdr_pcb_partnum {
911 u8 num[8];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100912} __packed hfa384x_pdr_pcb_partnum_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100913
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530914typedef struct hfa384x_pdr_pcb_tracenum {
915 u8 num[8];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100916} __packed hfa384x_pdr_pcb_tracenum_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100917
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530918typedef struct hfa384x_pdr_nic_serial {
919 u8 num[12];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100920} __packed hfa384x_pdr_nic_serial_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100921
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530922typedef struct hfa384x_pdr_mkk_measurements {
923 double carrier_freq;
924 double occupied_band;
925 double power_density;
926 double tx_spur_f1;
927 double tx_spur_f2;
928 double tx_spur_f3;
929 double tx_spur_f4;
930 double tx_spur_l1;
931 double tx_spur_l2;
932 double tx_spur_l3;
933 double tx_spur_l4;
934 double rx_spur_f1;
935 double rx_spur_f2;
936 double rx_spur_l1;
937 double rx_spur_l2;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100938} __packed hfa384x_pdr_mkk_measurements_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100939
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530940typedef struct hfa384x_pdr_nic_ramsize {
941 u8 size[12]; /* units of KB */
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100942} __packed hfa384x_pdr_nic_ramsize_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100943
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530944typedef struct hfa384x_pdr_mfisuprange {
945 u16 id;
946 u16 variant;
947 u16 bottom;
948 u16 top;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100949} __packed hfa384x_pdr_mfisuprange_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100950
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530951typedef struct hfa384x_pdr_cfisuprange {
952 u16 id;
953 u16 variant;
954 u16 bottom;
955 u16 top;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100956} __packed hfa384x_pdr_cfisuprange_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100957
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530958typedef struct hfa384x_pdr_nicid {
959 u16 id;
960 u16 variant;
961 u16 major;
962 u16 minor;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100963} __packed hfa384x_pdr_nicid_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100964
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530965typedef struct hfa384x_pdr_refdac_measurements {
966 u16 value[0];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100967} __packed hfa384x_pdr_refdac_measurements_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100968
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530969typedef struct hfa384x_pdr_vgdac_measurements {
970 u16 value[0];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100971} __packed hfa384x_pdr_vgdac_measurements_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100972
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530973typedef struct hfa384x_pdr_level_comp_measurements {
974 u16 value[0];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100975} __packed hfa384x_pdr_level_compc_measurements_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100976
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530977typedef struct hfa384x_pdr_mac_address {
978 u8 addr[6];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100979} __packed hfa384x_pdr_mac_address_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100980
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530981typedef struct hfa384x_pdr_mkk_callname {
982 u8 callname[8];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100983} __packed hfa384x_pdr_mkk_callname_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100984
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530985typedef struct hfa384x_pdr_regdomain {
986 u16 numdomains;
987 u16 domain[5];
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100988} __packed hfa384x_pdr_regdomain_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100989
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530990typedef struct hfa384x_pdr_allowed_channel {
991 u16 ch_bitmap;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100992} __packed hfa384x_pdr_allowed_channel_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100993
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530994typedef struct hfa384x_pdr_default_channel {
995 u16 channel;
Bas van den Berg7d3864d2011-02-03 21:37:16 +0100996} __packed hfa384x_pdr_default_channel_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +0100997
Mithlesh Thukral75f49e02009-05-25 19:06:16 +0530998typedef struct hfa384x_pdr_privacy_option {
999 u16 available;
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001000} __packed hfa384x_pdr_privacy_option_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001001
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301002typedef struct hfa384x_pdr_temptype {
1003 u16 type;
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001004} __packed hfa384x_pdr_temptype_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001005
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301006typedef struct hfa384x_pdr_refdac_setup {
1007 u16 ch_value[14];
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001008} __packed hfa384x_pdr_refdac_setup_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001009
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301010typedef struct hfa384x_pdr_vgdac_setup {
1011 u16 ch_value[14];
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001012} __packed hfa384x_pdr_vgdac_setup_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001013
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301014typedef struct hfa384x_pdr_level_comp_setup {
1015 u16 ch_value[14];
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001016} __packed hfa384x_pdr_level_comp_setup_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001017
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301018typedef struct hfa384x_pdr_trimdac_setup {
1019 u16 trimidac;
1020 u16 trimqdac;
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001021} __packed hfa384x_pdr_trimdac_setup_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001022
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301023typedef struct hfa384x_pdr_ifr_setting {
1024 u16 value[3];
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001025} __packed hfa384x_pdr_ifr_setting_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001026
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301027typedef struct hfa384x_pdr_rfr_setting {
1028 u16 value[3];
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001029} __packed hfa384x_pdr_rfr_setting_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001030
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301031typedef struct hfa384x_pdr_hfa3861_baseline {
1032 u16 value[50];
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001033} __packed hfa384x_pdr_hfa3861_baseline_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001034
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301035typedef struct hfa384x_pdr_hfa3861_shadow {
1036 u32 value[32];
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001037} __packed hfa384x_pdr_hfa3861_shadow_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001038
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301039typedef struct hfa384x_pdr_hfa3861_ifrf {
1040 u32 value[20];
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001041} __packed hfa384x_pdr_hfa3861_ifrf_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001042
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301043typedef struct hfa384x_pdr_hfa3861_chcalsp {
1044 u16 value[14];
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001045} __packed hfa384x_pdr_hfa3861_chcalsp_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001046
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301047typedef struct hfa384x_pdr_hfa3861_chcali {
1048 u16 value[17];
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001049} __packed hfa384x_pdr_hfa3861_chcali_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001050
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301051typedef struct hfa384x_pdr_hfa3861_nic_config {
1052 u16 config_bitmap;
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001053} __packed hfa384x_pdr_nic_config_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001054
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301055typedef struct hfa384x_pdr_hfo_delay {
1056 u8 hfo_delay;
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001057} __packed hfa384x_hfo_delay_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001058
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301059typedef struct hfa384x_pdr_hfa3861_manf_testsp {
1060 u16 value[30];
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001061} __packed hfa384x_pdr_hfa3861_manf_testsp_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001062
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301063typedef struct hfa384x_pdr_hfa3861_manf_testi {
1064 u16 value[30];
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001065} __packed hfa384x_pdr_hfa3861_manf_testi_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001066
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301067typedef struct hfa384x_end_of_pda {
1068 u16 crc;
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001069} __packed hfa384x_pdr_end_of_pda_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001070
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301071typedef struct hfa384x_pdrec {
1072 u16 len; /* in words */
1073 u16 code;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001074 union pdr {
Mithlesh Thukral75f49e02009-05-25 19:06:16 +05301075 hfa384x_pdr_pcb_partnum_t pcb_partnum;
1076 hfa384x_pdr_pcb_tracenum_t pcb_tracenum;
1077 hfa384x_pdr_nic_serial_t nic_serial;
1078 hfa384x_pdr_mkk_measurements_t mkk_measurements;
1079 hfa384x_pdr_nic_ramsize_t nic_ramsize;
1080 hfa384x_pdr_mfisuprange_t mfisuprange;
1081 hfa384x_pdr_cfisuprange_t cfisuprange;
1082 hfa384x_pdr_nicid_t nicid;
1083 hfa384x_pdr_refdac_measurements_t refdac_measurements;
1084 hfa384x_pdr_vgdac_measurements_t vgdac_measurements;
1085 hfa384x_pdr_level_compc_measurements_t level_compc_measurements;
1086 hfa384x_pdr_mac_address_t mac_address;
1087 hfa384x_pdr_mkk_callname_t mkk_callname;
1088 hfa384x_pdr_regdomain_t regdomain;
1089 hfa384x_pdr_allowed_channel_t allowed_channel;
1090 hfa384x_pdr_default_channel_t default_channel;
1091 hfa384x_pdr_privacy_option_t privacy_option;
1092 hfa384x_pdr_temptype_t temptype;
1093 hfa384x_pdr_refdac_setup_t refdac_setup;
1094 hfa384x_pdr_vgdac_setup_t vgdac_setup;
1095 hfa384x_pdr_level_comp_setup_t level_comp_setup;
1096 hfa384x_pdr_trimdac_setup_t trimdac_setup;
1097 hfa384x_pdr_ifr_setting_t ifr_setting;
1098 hfa384x_pdr_rfr_setting_t rfr_setting;
1099 hfa384x_pdr_hfa3861_baseline_t hfa3861_baseline;
1100 hfa384x_pdr_hfa3861_shadow_t hfa3861_shadow;
1101 hfa384x_pdr_hfa3861_ifrf_t hfa3861_ifrf;
1102 hfa384x_pdr_hfa3861_chcalsp_t hfa3861_chcalsp;
1103 hfa384x_pdr_hfa3861_chcali_t hfa3861_chcali;
1104 hfa384x_pdr_nic_config_t nic_config;
1105 hfa384x_hfo_delay_t hfo_delay;
1106 hfa384x_pdr_hfa3861_manf_testsp_t hfa3861_manf_testsp;
1107 hfa384x_pdr_hfa3861_manf_testi_t hfa3861_manf_testi;
1108 hfa384x_pdr_end_of_pda_t end_of_pda;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001109
1110 } data;
Bas van den Berg7d3864d2011-02-03 21:37:16 +01001111} __packed hfa384x_pdrec_t;
Karl Relton76e3e7c2009-04-17 10:15:34 +01001112
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001113#ifdef __KERNEL__
1114/*--------------------------------------------------------------------
1115--- MAC state structure, argument to all functions --
1116--- Also, a collection of support types --
1117--------------------------------------------------------------------*/
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001118typedef struct hfa384x_statusresult {
1119 u16 status;
1120 u16 resp0;
1121 u16 resp1;
1122 u16 resp2;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001123} hfa384x_cmdresult_t;
1124
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001125/* USB Control Exchange (CTLX):
1126 * A queue of the structure below is maintained for all of the
1127 * Request/Response type USB packets supported by Prism2.
1128 */
1129/* The following hfa384x_* structures are arguments to
1130 * the usercb() for the different CTLX types.
1131 */
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001132typedef struct hfa384x_rridresult {
1133 u16 rid;
1134 const void *riddata;
1135 unsigned int riddata_len;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001136} hfa384x_rridresult_t;
1137
1138enum ctlx_state {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001139 CTLX_START = 0, /* Start state, not queued */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001140
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001141 CTLX_COMPLETE, /* CTLX successfully completed */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001142 CTLX_REQ_FAILED, /* OUT URB completed w/ error */
1143
1144 CTLX_PENDING, /* Queued, data valid */
1145 CTLX_REQ_SUBMITTED, /* OUT URB submitted */
1146 CTLX_REQ_COMPLETE, /* OUT URB complete */
1147 CTLX_RESP_COMPLETE /* IN URB received */
1148};
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001149typedef enum ctlx_state CTLX_STATE;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001150
1151struct hfa384x_usbctlx;
1152struct hfa384x;
1153
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001154typedef void (*ctlx_cmdcb_t) (struct hfa384x *, const struct hfa384x_usbctlx *);
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001155
Svenne Krap5dd8acc2010-02-14 18:59:00 +01001156typedef void (*ctlx_usercb_t) (struct hfa384x *hw,
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001157 void *ctlxresult, void *usercb_data);
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001158
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001159typedef struct hfa384x_usbctlx {
1160 struct list_head list;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001161
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001162 size_t outbufsize;
1163 hfa384x_usbout_t outbuf; /* pkt buf for OUT */
1164 hfa384x_usbin_t inbuf; /* pkt buf for IN(a copy) */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001165
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001166 CTLX_STATE state; /* Tracks running state */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001167
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001168 struct completion done;
1169 volatile int reapable; /* Food for the reaper task */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001170
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001171 ctlx_cmdcb_t cmdcb; /* Async command callback */
1172 ctlx_usercb_t usercb; /* Async user callback, */
1173 void *usercb_data; /* at CTLX completion */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001174
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001175 int variant; /* Identifies cmd variant */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001176} hfa384x_usbctlx_t;
1177
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001178typedef struct hfa384x_usbctlxq {
1179 spinlock_t lock;
1180 struct list_head pending;
1181 struct list_head active;
1182 struct list_head completing;
1183 struct list_head reapable;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001184} hfa384x_usbctlxq_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001185
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001186typedef struct hfa484x_metacmd {
1187 u16 cmd;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001188
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001189 u16 parm0;
1190 u16 parm1;
1191 u16 parm2;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001192
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001193 hfa384x_cmdresult_t result;
1194} hfa384x_metacmd_t;
1195
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001196#define MAX_GRP_ADDR 32
Alessandro Ghedini71508ee2010-02-15 12:25:22 +01001197#define WLAN_COMMENT_MAX 80 /* Max. length of user comment string. */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001198
Alessandro Ghedini71508ee2010-02-15 12:25:22 +01001199#define WLAN_AUTH_MAX 60 /* Max. # of authenticated stations. */
1200#define WLAN_ACCESS_MAX 60 /* Max. # of stations in an access list. */
1201#define WLAN_ACCESS_NONE 0 /* No stations may be authenticated. */
1202#define WLAN_ACCESS_ALL 1 /* All stations may be authenticated. */
1203#define WLAN_ACCESS_ALLOW 2 /* Authenticate only "allowed" stations. */
1204#define WLAN_ACCESS_DENY 3 /* Do not authenticate "denied" stations. */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001205
1206/* XXX These are going away ASAP */
Vatika Harlalkac84b5282015-03-21 12:27:24 +05301207struct prism2sta_authlist {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001208 unsigned int cnt;
1209 u8 addr[WLAN_AUTH_MAX][ETH_ALEN];
1210 u8 assoc[WLAN_AUTH_MAX];
Vatika Harlalkac84b5282015-03-21 12:27:24 +05301211};
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001212
Vatika Harlalka4d10ece2015-03-21 12:27:34 +05301213struct prism2sta_accesslist {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001214 unsigned int modify;
1215 unsigned int cnt;
1216 u8 addr[WLAN_ACCESS_MAX][ETH_ALEN];
1217 unsigned int cnt1;
1218 u8 addr1[WLAN_ACCESS_MAX][ETH_ALEN];
Vatika Harlalka4d10ece2015-03-21 12:27:34 +05301219};
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001220
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001221typedef struct hfa384x {
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001222 /* USB support data */
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001223 struct usb_device *usb;
1224 struct urb rx_urb;
1225 struct sk_buff *rx_urb_skb;
1226 struct urb tx_urb;
1227 struct urb ctlx_urb;
1228 hfa384x_usbout_t txbuff;
1229 hfa384x_usbctlxq_t ctlxq;
1230 struct timer_list reqtimer;
1231 struct timer_list resptimer;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001232
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001233 struct timer_list throttle;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001234
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001235 struct tasklet_struct reaper_bh;
1236 struct tasklet_struct completion_bh;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001237
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001238 struct work_struct usb_work;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001239
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001240 unsigned long usb_flags;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001241#define THROTTLE_RX 0
1242#define THROTTLE_TX 1
1243#define WORK_RX_HALT 2
1244#define WORK_TX_HALT 3
1245#define WORK_RX_RESUME 4
1246#define WORK_TX_RESUME 5
1247
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001248 unsigned short req_timer_done:1;
1249 unsigned short resp_timer_done:1;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001250
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001251 int endp_in;
1252 int endp_out;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001253
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001254 int sniff_fcs;
1255 int sniff_channel;
1256 int sniff_truncate;
1257 int sniffhdr;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001258
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001259 wait_queue_head_t cmdq; /* wait queue itself */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001260
1261 /* Controller state */
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001262 u32 state;
1263 u32 isap;
1264 u8 port_enabled[HFA384x_NUMPORTS_MAX];
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001265
1266 /* Download support */
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001267 unsigned int dlstate;
1268 hfa384x_downloadbuffer_t bufinfo;
1269 u16 dltimeout;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001270
Masanari Iida1a6dfce2014-12-01 00:29:00 +09001271 int scanflag; /* to signal scan complete */
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001272 int join_ap; /* are we joined to a specific ap */
1273 int join_retries; /* number of join retries till we fail */
1274 hfa384x_JoinRequest_data_t joinreq; /* join request saved data */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001275
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001276 wlandevice_t *wlandev;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001277 /* Timer to allow for the deferred processing of linkstatus messages */
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001278 struct work_struct link_bh;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001279
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001280 struct work_struct commsqual_bh;
1281 hfa384x_commsquality_t qual;
1282 struct timer_list commsqual_timer;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001283
Solomon Peachyaaad4302008-10-29 10:42:53 -04001284 u16 link_status;
1285 u16 link_status_new;
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001286 struct sk_buff_head authq;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001287
Karl Reltoncb3126e2010-06-03 23:04:06 +01001288 u32 txrate;
1289
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001290 /* And here we have stuff that used to be in priv */
1291
1292 /* State variables */
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001293 unsigned int presniff_port_type;
1294 u16 presniff_wepflags;
1295 u32 dot11_desired_bss_type;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001296
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001297 int dbmadjust;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001298
1299 /* Group Addresses - right now, there are up to a total
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001300 of MAX_GRP_ADDR group addresses */
1301 u8 dot11_grp_addr[MAX_GRP_ADDR][ETH_ALEN];
1302 unsigned int dot11_grpcnt;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001303
1304 /* Component Identities */
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001305 hfa384x_compident_t ident_nic;
1306 hfa384x_compident_t ident_pri_fw;
1307 hfa384x_compident_t ident_sta_fw;
1308 hfa384x_compident_t ident_ap_fw;
1309 u16 mm_mods;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001310
1311 /* Supplier compatibility ranges */
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001312 hfa384x_caplevel_t cap_sup_mfi;
1313 hfa384x_caplevel_t cap_sup_cfi;
1314 hfa384x_caplevel_t cap_sup_pri;
1315 hfa384x_caplevel_t cap_sup_sta;
1316 hfa384x_caplevel_t cap_sup_ap;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001317
1318 /* Actor compatibility ranges */
Alessandro Ghedini71508ee2010-02-15 12:25:22 +01001319 hfa384x_caplevel_t cap_act_pri_cfi; /*
1320 * pri f/w to controller
1321 * interface
1322 */
1323
1324 hfa384x_caplevel_t cap_act_sta_cfi; /*
1325 * sta f/w to controller
1326 * interface
1327 */
1328
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001329 hfa384x_caplevel_t cap_act_sta_mfi; /* sta f/w to modem interface */
Alessandro Ghedini71508ee2010-02-15 12:25:22 +01001330
1331 hfa384x_caplevel_t cap_act_ap_cfi; /*
1332 * ap f/w to controller
1333 * interface
1334 */
1335
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001336 hfa384x_caplevel_t cap_act_ap_mfi; /* ap f/w to modem interface */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001337
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001338 u32 psusercount; /* Power save user count. */
1339 hfa384x_CommTallies32_t tallies; /* Communication tallies. */
1340 u8 comment[WLAN_COMMENT_MAX + 1]; /* User comment */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001341
1342 /* Channel Info request results (AP only) */
1343 struct {
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001344 atomic_t done;
1345 u8 count;
1346 hfa384x_ChInfoResult_t results;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001347 } channel_info;
1348
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001349 hfa384x_InfFrame_t *scanresults;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001350
Vatika Harlalkac84b5282015-03-21 12:27:24 +05301351 struct prism2sta_authlist authlist; /* Authenticated station list. */
Vatika Harlalka4d10ece2015-03-21 12:27:34 +05301352 unsigned int accessmode; /* Access mode. */
1353 struct prism2sta_accesslist allow; /* Allowed station list. */
1354 struct prism2sta_accesslist deny; /* Denied station list. */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001355
1356} hfa384x_t;
1357
Svenne Krap5dd8acc2010-02-14 18:59:00 +01001358void hfa384x_create(hfa384x_t *hw, struct usb_device *usb);
1359void hfa384x_destroy(hfa384x_t *hw);
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001360
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001361int
Svenne Krap5dd8acc2010-02-14 18:59:00 +01001362hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis);
Svenne Krap5dd8acc2010-02-14 18:59:00 +01001363int hfa384x_drvr_disable(hfa384x_t *hw, u16 macport);
1364int hfa384x_drvr_enable(hfa384x_t *hw, u16 macport);
1365int hfa384x_drvr_flashdl_enable(hfa384x_t *hw);
1366int hfa384x_drvr_flashdl_disable(hfa384x_t *hw);
1367int hfa384x_drvr_flashdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len);
1368int hfa384x_drvr_getconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len);
1369int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, u32 exeaddr);
1370int hfa384x_drvr_ramdl_disable(hfa384x_t *hw);
1371int hfa384x_drvr_ramdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len);
1372int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len);
1373int hfa384x_drvr_setconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len);
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001374
Svenne Krap5dd8acc2010-02-14 18:59:00 +01001375static inline int hfa384x_drvr_getconfig16(hfa384x_t *hw, u16 rid, void *val)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001376{
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001377 int result = 0;
Veronika Kabatova7489df32014-10-05 10:33:56 +02001378
Solomon Peachyaaad4302008-10-29 10:42:53 -04001379 result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u16));
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001380 if (result == 0)
Moritz Muehlenhoff18c7f792009-02-18 19:50:07 +01001381 *((u16 *) val) = le16_to_cpu(*((u16 *) val));
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001382 return result;
1383}
1384
Svenne Krap5dd8acc2010-02-14 18:59:00 +01001385static inline int hfa384x_drvr_setconfig16(hfa384x_t *hw, u16 rid, u16 val)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001386{
Moritz Muehlenhoff18c7f792009-02-18 19:50:07 +01001387 u16 value = cpu_to_le16(val);
Veronika Kabatova7489df32014-10-05 10:33:56 +02001388
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001389 return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));
1390}
1391
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001392int
Svenne Krap5dd8acc2010-02-14 18:59:00 +01001393hfa384x_drvr_setconfig_async(hfa384x_t *hw,
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001394 u16 rid,
1395 void *buf,
1396 u16 len, ctlx_usercb_t usercb, void *usercb_data);
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001397
1398static inline int
Svenne Krap5dd8acc2010-02-14 18:59:00 +01001399hfa384x_drvr_setconfig16_async(hfa384x_t *hw, u16 rid, u16 val)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001400{
Moritz Muehlenhoff18c7f792009-02-18 19:50:07 +01001401 u16 value = cpu_to_le16(val);
Veronika Kabatova7489df32014-10-05 10:33:56 +02001402
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001403 return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value),
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001404 NULL, NULL);
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001405}
1406
Svenne Krap5dd8acc2010-02-14 18:59:00 +01001407int hfa384x_drvr_start(hfa384x_t *hw);
1408int hfa384x_drvr_stop(hfa384x_t *hw);
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001409int
Svenne Krap5dd8acc2010-02-14 18:59:00 +01001410hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb,
Sven Dziadekf6b43c22015-03-19 20:42:48 +01001411 union p80211_hdr *p80211_hdr,
1412 struct p80211_metawep *p80211_wep);
Svenne Krap5dd8acc2010-02-14 18:59:00 +01001413void hfa384x_tx_timeout(wlandevice_t *wlandev);
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001414
Svenne Krap5dd8acc2010-02-14 18:59:00 +01001415int hfa384x_cmd_initialize(hfa384x_t *hw);
1416int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport);
1417int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport);
1418int hfa384x_cmd_allocate(hfa384x_t *hw, u16 len);
1419int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable);
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001420int
Svenne Krap5dd8acc2010-02-14 18:59:00 +01001421hfa384x_cmd_download(hfa384x_t *hw,
Moritz Muehlenhoffe573aaa2009-02-08 02:20:49 +01001422 u16 mode, u16 lowaddr, u16 highaddr, u16 codelen);
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001423
Alessandro Ghedini71508ee2010-02-15 12:25:22 +01001424#endif /*__KERNEL__ */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001425
Alessandro Ghedini71508ee2010-02-15 12:25:22 +01001426#endif /*_HFA384x_H */