]>
Commit | Line | Data |
---|---|---|
00b3ed16 | 1 | /* hfa384x.h |
5f7688dd SP |
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 | */ | |
00b3ed16 GKH |
55 | |
56 | #ifndef _HFA384x_H | |
57 | #define _HFA384x_H | |
58 | ||
e573aaa4 | 59 | #define HFA384x_FIRMWARE_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c)) |
00b3ed16 | 60 | |
28b17a4b | 61 | #include <linux/if_ether.h> |
2e380275 | 62 | #include <linux/usb.h> |
28b17a4b | 63 | |
00b3ed16 | 64 | /*--- Mins & Maxs -----------------------------------*/ |
71508ee4 | 65 | #define HFA384x_PORTID_MAX ((u16)7) |
0548cad1 | 66 | #define HFA384x_NUMPORTS_MAX ((u16)(HFA384x_PORTID_MAX + 1)) |
71508ee4 AG |
67 | #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 | |
00b3ed16 GKH |
76 | |
77 | /*--- Support Constants -----------------------------*/ | |
aaad4303 SP |
78 | #define HFA384x_PORTTYPE_IBSS ((u16)0) |
79 | #define HFA384x_PORTTYPE_BSS ((u16)1) | |
aaad4303 | 80 | #define HFA384x_PORTTYPE_PSUEDOIBSS ((u16)3) |
7f6e0e44 MM |
81 | #define HFA384x_WEPFLAGS_PRIVINVOKED ((u16)BIT(0)) |
82 | #define HFA384x_WEPFLAGS_EXCLUDE ((u16)BIT(1)) | |
83 | #define HFA384x_WEPFLAGS_DISABLE_TXCRYPT ((u16)BIT(4)) | |
84 | #define HFA384x_WEPFLAGS_DISABLE_RXCRYPT ((u16)BIT(7)) | |
eec0d0dc GH |
85 | #define HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM ((u16)3) |
86 | #define HFA384x_PORTSTATUS_DISABLED ((u16)1) | |
aaad4303 SP |
87 | #define HFA384x_RATEBIT_1 ((u16)1) |
88 | #define HFA384x_RATEBIT_2 ((u16)2) | |
89 | #define HFA384x_RATEBIT_5dot5 ((u16)4) | |
90 | #define HFA384x_RATEBIT_11 ((u16)8) | |
00b3ed16 | 91 | |
00b3ed16 GKH |
92 | /*--- MAC Internal memory constants and macros ------*/ |
93 | /* masks and macros used to manipulate MAC internal memory addresses. */ | |
94 | /* MAC internal memory addresses are 23 bit quantities. The MAC uses | |
95 | * a paged address space where the upper 16 bits are the page number | |
96 | * and the lower 7 bits are the offset. There are various Host API | |
97 | * elements that require two 16-bit quantities to specify a MAC | |
98 | * internal memory address. Unfortunately, some of the API's use a | |
99 | * page/offset format where the offset value is JUST the lower seven | |
100 | * bits and the page is the remaining 16 bits. Some of the API's | |
101 | * assume that the 23 bit address has been split at the 16th bit. We | |
102 | * refer to these two formats as AUX format and CMD format. The | |
103 | * macros below help handle some of this. | |
104 | */ | |
105 | ||
00b3ed16 GKH |
106 | /* Mask bits for discarding unwanted pieces in a flat address */ |
107 | #define HFA384x_ADDR_FLAT_AUX_PAGE_MASK (0x007fff80) | |
108 | #define HFA384x_ADDR_FLAT_AUX_OFF_MASK (0x0000007f) | |
109 | #define HFA384x_ADDR_FLAT_CMD_PAGE_MASK (0xffff0000) | |
110 | #define HFA384x_ADDR_FLAT_CMD_OFF_MASK (0x0000ffff) | |
111 | ||
e573aaa4 | 112 | /* Mask bits for discarding unwanted pieces in AUX format |
95842bc9 JR |
113 | * 16-bit address parts |
114 | */ | |
00b3ed16 GKH |
115 | #define HFA384x_ADDR_AUX_PAGE_MASK (0xffff) |
116 | #define HFA384x_ADDR_AUX_OFF_MASK (0x007f) | |
117 | ||
00b3ed16 | 118 | /* Make a 32-bit flat address from AUX format 16-bit page and offset */ |
e573aaa4 | 119 | #define HFA384x_ADDR_AUX_MKFLAT(p, o) \ |
65dbeefd GS |
120 | ((((u32)(((u16)(p)) & HFA384x_ADDR_AUX_PAGE_MASK)) << 7) | \ |
121 | ((u32)(((u16)(o)) & HFA384x_ADDR_AUX_OFF_MASK))) | |
00b3ed16 | 122 | |
00b3ed16 GKH |
123 | /* Make CMD format offset and page from a 32-bit flat address */ |
124 | #define HFA384x_ADDR_CMD_MKPAGE(f) \ | |
061eab5c | 125 | ((u16)((((u32)(f)) & HFA384x_ADDR_FLAT_CMD_PAGE_MASK) >> 16)) |
00b3ed16 | 126 | #define HFA384x_ADDR_CMD_MKOFF(f) \ |
65dbeefd | 127 | ((u16)(((u32)(f)) & HFA384x_ADDR_FLAT_CMD_OFF_MASK)) |
00b3ed16 | 128 | |
00b3ed16 GKH |
129 | /*--- Controller Memory addresses -------------------*/ |
130 | #define HFA3842_PDA_BASE (0x007f0000UL) | |
131 | #define HFA3841_PDA_BASE (0x003f0000UL) | |
132 | #define HFA3841_PDA_BOGUS_BASE (0x00390000UL) | |
133 | ||
134 | /*--- Driver Download states -----------------------*/ | |
135 | #define HFA384x_DLSTATE_DISABLED 0 | |
136 | #define HFA384x_DLSTATE_RAMENABLED 1 | |
137 | #define HFA384x_DLSTATE_FLASHENABLED 2 | |
00b3ed16 | 138 | |
00b3ed16 | 139 | /*--- Register Field Masks --------------------------*/ |
d349883f SP |
140 | #define HFA384x_CMD_AINFO ((u16)GENMASK(14, 8)) |
141 | #define HFA384x_CMD_MACPORT ((u16)GENMASK(10, 8)) | |
142 | #define HFA384x_CMD_PROGMODE ((u16)GENMASK(9, 8)) | |
143 | #define HFA384x_CMD_CMDCODE ((u16)GENMASK(5, 0)) | |
144 | #define HFA384x_STATUS_RESULT ((u16)GENMASK(14, 8)) | |
7f6e0e44 | 145 | |
00b3ed16 GKH |
146 | /*--- Command Code Constants --------------------------*/ |
147 | /*--- Controller Commands --------------------------*/ | |
aaad4303 SP |
148 | #define HFA384x_CMDCODE_INIT ((u16)0x00) |
149 | #define HFA384x_CMDCODE_ENABLE ((u16)0x01) | |
150 | #define HFA384x_CMDCODE_DISABLE ((u16)0x02) | |
00b3ed16 GKH |
151 | |
152 | /*--- Regulate Commands --------------------------*/ | |
aaad4303 | 153 | #define HFA384x_CMDCODE_INQ ((u16)0x11) |
00b3ed16 GKH |
154 | |
155 | /*--- Configure Commands --------------------------*/ | |
aaad4303 | 156 | #define HFA384x_CMDCODE_DOWNLD ((u16)0x22) |
00b3ed16 GKH |
157 | |
158 | /*--- Debugging Commands -----------------------------*/ | |
eec0d0dc | 159 | #define HFA384x_CMDCODE_MONITOR ((u16)(0x38)) |
aaad4303 SP |
160 | #define HFA384x_MONITOR_ENABLE ((u16)(0x0b)) |
161 | #define HFA384x_MONITOR_DISABLE ((u16)(0x0f)) | |
00b3ed16 GKH |
162 | |
163 | /*--- Result Codes --------------------------*/ | |
aaad4303 | 164 | #define HFA384x_CMD_ERR ((u16)(0x7F)) |
00b3ed16 GKH |
165 | |
166 | /*--- Programming Modes -------------------------- | |
3e27dfa2 SP |
167 | * MODE 0: Disable programming |
168 | * MODE 1: Enable volatile memory programming | |
169 | * MODE 2: Enable non-volatile memory programming | |
170 | * MODE 3: Program non-volatile memory section | |
171 | *------------------------------------------------- | |
172 | */ | |
aaad4303 SP |
173 | #define HFA384x_PROGMODE_DISABLE ((u16)0x00) |
174 | #define HFA384x_PROGMODE_RAM ((u16)0x01) | |
175 | #define HFA384x_PROGMODE_NV ((u16)0x02) | |
176 | #define HFA384x_PROGMODE_NVWRITE ((u16)0x03) | |
00b3ed16 | 177 | |
00b3ed16 GKH |
178 | /*--- Record ID Constants --------------------------*/ |
179 | /*-------------------------------------------------------------------- | |
3e27dfa2 SP |
180 | * Configuration RIDs: Network Parameters, Static Configuration Entities |
181 | *-------------------------------------------------------------------- | |
182 | */ | |
aaad4303 SP |
183 | #define HFA384x_RID_CNFPORTTYPE ((u16)0xFC00) |
184 | #define HFA384x_RID_CNFOWNMACADDR ((u16)0xFC01) | |
185 | #define HFA384x_RID_CNFDESIREDSSID ((u16)0xFC02) | |
186 | #define HFA384x_RID_CNFOWNCHANNEL ((u16)0xFC03) | |
187 | #define HFA384x_RID_CNFOWNSSID ((u16)0xFC04) | |
aaad4303 | 188 | #define HFA384x_RID_CNFMAXDATALEN ((u16)0xFC07) |
00b3ed16 GKH |
189 | |
190 | /*-------------------------------------------------------------------- | |
3e27dfa2 SP |
191 | * Configuration RID lengths: Network Params, Static Config Entities |
192 | * This is the length of JUST the DATA part of the RID (does not | |
193 | * include the len or code fields) | |
194 | *-------------------------------------------------------------------- | |
195 | */ | |
aaad4303 SP |
196 | #define HFA384x_RID_CNFOWNMACADDR_LEN ((u16)6) |
197 | #define HFA384x_RID_CNFDESIREDSSID_LEN ((u16)34) | |
aaad4303 | 198 | #define HFA384x_RID_CNFOWNSSID_LEN ((u16)34) |
00b3ed16 GKH |
199 | |
200 | /*-------------------------------------------------------------------- | |
3e27dfa2 SP |
201 | * Configuration RIDs: Network Parameters, Dynamic Configuration Entities |
202 | *-------------------------------------------------------------------- | |
203 | */ | |
aaad4303 SP |
204 | #define HFA384x_RID_CREATEIBSS ((u16)0xFC81) |
205 | #define HFA384x_RID_FRAGTHRESH ((u16)0xFC82) | |
206 | #define HFA384x_RID_RTSTHRESH ((u16)0xFC83) | |
207 | #define HFA384x_RID_TXRATECNTL ((u16)0xFC84) | |
208 | #define HFA384x_RID_PROMISCMODE ((u16)0xFC85) | |
00b3ed16 GKH |
209 | |
210 | /*---------------------------------------------------------------------- | |
3e27dfa2 SP |
211 | * Information RIDs: NIC Information |
212 | *---------------------------------------------------------------------- | |
213 | */ | |
aaad4303 SP |
214 | #define HFA384x_RID_MAXLOADTIME ((u16)0xFD00) |
215 | #define HFA384x_RID_DOWNLOADBUFFER ((u16)0xFD01) | |
216 | #define HFA384x_RID_PRIIDENTITY ((u16)0xFD02) | |
217 | #define HFA384x_RID_PRISUPRANGE ((u16)0xFD03) | |
218 | #define HFA384x_RID_PRI_CFIACTRANGES ((u16)0xFD04) | |
219 | #define HFA384x_RID_NICSERIALNUMBER ((u16)0xFD0A) | |
220 | #define HFA384x_RID_NICIDENTITY ((u16)0xFD0B) | |
221 | #define HFA384x_RID_MFISUPRANGE ((u16)0xFD0C) | |
222 | #define HFA384x_RID_CFISUPRANGE ((u16)0xFD0D) | |
aaad4303 SP |
223 | #define HFA384x_RID_STAIDENTITY ((u16)0xFD20) |
224 | #define HFA384x_RID_STASUPRANGE ((u16)0xFD21) | |
225 | #define HFA384x_RID_STA_MFIACTRANGES ((u16)0xFD22) | |
226 | #define HFA384x_RID_STA_CFIACTRANGES ((u16)0xFD23) | |
00b3ed16 GKH |
227 | |
228 | /*---------------------------------------------------------------------- | |
3e27dfa2 SP |
229 | * Information RID Lengths: NIC Information |
230 | * This is the length of JUST the DATA part of the RID (does not | |
231 | * include the len or code fields) | |
232 | *--------------------------------------------------------------------- | |
233 | */ | |
aaad4303 | 234 | #define HFA384x_RID_NICSERIALNUMBER_LEN ((u16)12) |
00b3ed16 GKH |
235 | |
236 | /*-------------------------------------------------------------------- | |
3e27dfa2 SP |
237 | * Information RIDs: MAC Information |
238 | *-------------------------------------------------------------------- | |
239 | */ | |
aaad4303 SP |
240 | #define HFA384x_RID_PORTSTATUS ((u16)0xFD40) |
241 | #define HFA384x_RID_CURRENTSSID ((u16)0xFD41) | |
242 | #define HFA384x_RID_CURRENTBSSID ((u16)0xFD42) | |
aaad4303 | 243 | #define HFA384x_RID_CURRENTTXRATE ((u16)0xFD44) |
aaad4303 SP |
244 | #define HFA384x_RID_SHORTRETRYLIMIT ((u16)0xFD48) |
245 | #define HFA384x_RID_LONGRETRYLIMIT ((u16)0xFD49) | |
246 | #define HFA384x_RID_MAXTXLIFETIME ((u16)0xFD4A) | |
aaad4303 SP |
247 | #define HFA384x_RID_PRIVACYOPTIMP ((u16)0xFD4F) |
248 | #define HFA384x_RID_DBMCOMMSQUALITY ((u16)0xFD51) | |
00b3ed16 GKH |
249 | |
250 | /*-------------------------------------------------------------------- | |
3e27dfa2 SP |
251 | * Information RID Lengths: MAC Information |
252 | * This is the length of JUST the DATA part of the RID (does not | |
253 | * include the len or code fields) | |
254 | *-------------------------------------------------------------------- | |
255 | */ | |
71508ee4 | 256 | #define HFA384x_RID_DBMCOMMSQUALITY_LEN \ |
62e493c4 | 257 | ((u16)sizeof(struct hfa384x_dbmcommsquality)) |
71508ee4 | 258 | #define HFA384x_RID_JOINREQUEST_LEN \ |
de3dc47c | 259 | ((u16)sizeof(struct hfa384x_join_request_data)) |
40a67411 | 260 | |
00b3ed16 | 261 | /*-------------------------------------------------------------------- |
3e27dfa2 SP |
262 | * Information RIDs: Modem Information |
263 | *-------------------------------------------------------------------- | |
264 | */ | |
aaad4303 | 265 | #define HFA384x_RID_CURRENTCHANNEL ((u16)0xFDC1) |
00b3ed16 GKH |
266 | |
267 | /*-------------------------------------------------------------------- | |
3e27dfa2 SP |
268 | * API ENHANCEMENTS (NOT ALREADY IMPLEMENTED) |
269 | *-------------------------------------------------------------------- | |
270 | */ | |
aaad4303 SP |
271 | #define HFA384x_RID_CNFWEPDEFAULTKEYID ((u16)0xFC23) |
272 | #define HFA384x_RID_CNFWEPDEFAULTKEY0 ((u16)0xFC24) | |
273 | #define HFA384x_RID_CNFWEPDEFAULTKEY1 ((u16)0xFC25) | |
274 | #define HFA384x_RID_CNFWEPDEFAULTKEY2 ((u16)0xFC26) | |
275 | #define HFA384x_RID_CNFWEPDEFAULTKEY3 ((u16)0xFC27) | |
276 | #define HFA384x_RID_CNFWEPFLAGS ((u16)0xFC28) | |
aaad4303 | 277 | #define HFA384x_RID_CNFAUTHENTICATION ((u16)0xFC2A) |
aaad4303 | 278 | #define HFA384x_RID_CNFROAMINGMODE ((u16)0xFC2D) |
b937612f | 279 | #define HFA384x_RID_CNFAPBCNINT ((u16)0xFC33) |
eec0d0dc GH |
280 | #define HFA384x_RID_CNFDBMADJUST ((u16)0xFC46) |
281 | #define HFA384x_RID_CNFWPADATA ((u16)0xFC48) | |
aaad4303 SP |
282 | #define HFA384x_RID_CNFBASICRATES ((u16)0xFCB3) |
283 | #define HFA384x_RID_CNFSUPPRATES ((u16)0xFCB4) | |
e573aaa4 | 284 | #define HFA384x_RID_CNFPASSIVESCANCTRL ((u16)0xFCBA) |
eec0d0dc | 285 | #define HFA384x_RID_TXPOWERMAX ((u16)0xFCBE) |
aaad4303 SP |
286 | #define HFA384x_RID_JOINREQUEST ((u16)0xFCE2) |
287 | #define HFA384x_RID_AUTHENTICATESTA ((u16)0xFCE3) | |
eec0d0dc | 288 | #define HFA384x_RID_HOSTSCAN ((u16)0xFCE5) |
aaad4303 SP |
289 | |
290 | #define HFA384x_RID_CNFWEPDEFAULTKEY_LEN ((u16)6) | |
291 | #define HFA384x_RID_CNFWEP128DEFAULTKEY_LEN ((u16)14) | |
40a67411 | 292 | |
00b3ed16 | 293 | /*-------------------------------------------------------------------- |
3e27dfa2 SP |
294 | * PD Record codes |
295 | *-------------------------------------------------------------------- | |
296 | */ | |
aaad4303 SP |
297 | #define HFA384x_PDR_PCB_PARTNUM ((u16)0x0001) |
298 | #define HFA384x_PDR_PDAVER ((u16)0x0002) | |
299 | #define HFA384x_PDR_NIC_SERIAL ((u16)0x0003) | |
300 | #define HFA384x_PDR_MKK_MEASUREMENTS ((u16)0x0004) | |
301 | #define HFA384x_PDR_NIC_RAMSIZE ((u16)0x0005) | |
302 | #define HFA384x_PDR_MFISUPRANGE ((u16)0x0006) | |
303 | #define HFA384x_PDR_CFISUPRANGE ((u16)0x0007) | |
304 | #define HFA384x_PDR_NICID ((u16)0x0008) | |
aaad4303 | 305 | #define HFA384x_PDR_MAC_ADDRESS ((u16)0x0101) |
aaad4303 SP |
306 | #define HFA384x_PDR_REGDOMAIN ((u16)0x0103) |
307 | #define HFA384x_PDR_ALLOWED_CHANNEL ((u16)0x0104) | |
308 | #define HFA384x_PDR_DEFAULT_CHANNEL ((u16)0x0105) | |
aaad4303 | 309 | #define HFA384x_PDR_TEMPTYPE ((u16)0x0107) |
aaad4303 SP |
310 | #define HFA384x_PDR_IFR_SETTING ((u16)0x0200) |
311 | #define HFA384x_PDR_RFR_SETTING ((u16)0x0201) | |
312 | #define HFA384x_PDR_HFA3861_BASELINE ((u16)0x0202) | |
313 | #define HFA384x_PDR_HFA3861_SHADOW ((u16)0x0203) | |
314 | #define HFA384x_PDR_HFA3861_IFRF ((u16)0x0204) | |
315 | #define HFA384x_PDR_HFA3861_CHCALSP ((u16)0x0300) | |
316 | #define HFA384x_PDR_HFA3861_CHCALI ((u16)0x0301) | |
eec0d0dc | 317 | #define HFA384x_PDR_MAX_TX_POWER ((u16)0x0302) |
aaad4303 SP |
318 | #define HFA384x_PDR_MASTER_CHAN_LIST ((u16)0x0303) |
319 | #define HFA384x_PDR_3842_NIC_CONFIG ((u16)0x0400) | |
320 | #define HFA384x_PDR_USB_ID ((u16)0x0401) | |
321 | #define HFA384x_PDR_PCI_ID ((u16)0x0402) | |
322 | #define HFA384x_PDR_PCI_IFCONF ((u16)0x0403) | |
323 | #define HFA384x_PDR_PCI_PMCONF ((u16)0x0404) | |
324 | #define HFA384x_PDR_RFENRGY ((u16)0x0406) | |
325 | #define HFA384x_PDR_USB_POWER_TYPE ((u16)0x0407) | |
aaad4303 SP |
326 | #define HFA384x_PDR_USB_MAX_POWER ((u16)0x0409) |
327 | #define HFA384x_PDR_USB_MANUFACTURER ((u16)0x0410) | |
eec0d0dc GH |
328 | #define HFA384x_PDR_USB_PRODUCT ((u16)0x0411) |
329 | #define HFA384x_PDR_ANT_DIVERSITY ((u16)0x0412) | |
330 | #define HFA384x_PDR_HFO_DELAY ((u16)0x0413) | |
331 | #define HFA384x_PDR_SCALE_THRESH ((u16)0x0414) | |
aaad4303 SP |
332 | |
333 | #define HFA384x_PDR_HFA3861_MANF_TESTSP ((u16)0x0900) | |
334 | #define HFA384x_PDR_HFA3861_MANF_TESTI ((u16)0x0901) | |
335 | #define HFA384x_PDR_END_OF_PDA ((u16)0x0000) | |
00b3ed16 | 336 | |
00b3ed16 GKH |
337 | /*--- Register Test/Get/Set Field macros ------------------------*/ |
338 | ||
71508ee4 AG |
339 | #define HFA384x_CMD_AINFO_SET(value) ((u16)((u16)(value) << 8)) |
340 | #define HFA384x_CMD_MACPORT_SET(value) \ | |
341 | ((u16)HFA384x_CMD_AINFO_SET(value)) | |
342 | #define HFA384x_CMD_PROGMODE_SET(value) \ | |
343 | ((u16)HFA384x_CMD_AINFO_SET((u16)value)) | |
aaad4303 SP |
344 | #define HFA384x_CMD_CMDCODE_SET(value) ((u16)(value)) |
345 | ||
aaad4303 | 346 | #define HFA384x_STATUS_RESULT_SET(value) (((u16)(value)) << 8) |
acb7e242 | 347 | |
00b3ed16 GKH |
348 | /* Host Maintained State Info */ |
349 | #define HFA384x_STATE_PREINIT 0 | |
350 | #define HFA384x_STATE_INIT 1 | |
351 | #define HFA384x_STATE_RUNNING 2 | |
352 | ||
00b3ed16 GKH |
353 | /*-------------------------------------------------------------*/ |
354 | /* Commonly used basic types */ | |
b2119911 | 355 | struct hfa384x_bytestr { |
0a3bbcbd | 356 | __le16 len; |
e573aaa4 | 357 | u8 data[0]; |
b2119911 | 358 | } __packed; |
00b3ed16 | 359 | |
03c2975b | 360 | struct hfa384x_bytestr32 { |
18cd9021 | 361 | __le16 len; |
e573aaa4 | 362 | u8 data[32]; |
03c2975b | 363 | } __packed; |
00b3ed16 GKH |
364 | |
365 | /*-------------------------------------------------------------------- | |
3e27dfa2 SP |
366 | * Configuration Record Structures: |
367 | * Network Parameters, Static Configuration Entities | |
368 | *-------------------------------------------------------------------- | |
369 | */ | |
00b3ed16 GKH |
370 | |
371 | /*-- Hardware/Firmware Component Information ----------*/ | |
5f046456 | 372 | struct hfa384x_compident { |
e573aaa4 MM |
373 | u16 id; |
374 | u16 variant; | |
375 | u16 major; | |
376 | u16 minor; | |
5f046456 | 377 | } __packed; |
e573aaa4 | 378 | |
65f170c6 | 379 | struct hfa384x_caplevel { |
e573aaa4 MM |
380 | u16 role; |
381 | u16 id; | |
382 | u16 variant; | |
383 | u16 bottom; | |
384 | u16 top; | |
65f170c6 | 385 | } __packed; |
00b3ed16 | 386 | |
00b3ed16 GKH |
387 | /*-- Configuration Record: cnfAuthentication --*/ |
388 | #define HFA384x_CNFAUTHENTICATION_OPENSYSTEM 0x0001 | |
389 | #define HFA384x_CNFAUTHENTICATION_SHAREDKEY 0x0002 | |
eec0d0dc | 390 | #define HFA384x_CNFAUTHENTICATION_LEAP 0x0004 |
00b3ed16 | 391 | |
00b3ed16 | 392 | /*-------------------------------------------------------------------- |
3e27dfa2 SP |
393 | * Configuration Record Structures: |
394 | * Network Parameters, Dynamic Configuration Entities | |
395 | *-------------------------------------------------------------------- | |
396 | */ | |
00b3ed16 | 397 | |
00b3ed16 | 398 | #define HFA384x_CREATEIBSS_JOINCREATEIBSS 0 |
00b3ed16 GKH |
399 | |
400 | /*-- Configuration Record: HostScanRequest (data portion only) --*/ | |
e474b4d4 | 401 | struct hfa384x_host_scan_request_data { |
18cd9021 SM |
402 | __le16 channel_list; |
403 | __le16 tx_rate; | |
03c2975b | 404 | struct hfa384x_bytestr32 ssid; |
935cbfb2 | 405 | } __packed; |
00b3ed16 GKH |
406 | |
407 | /*-- Configuration Record: JoinRequest (data portion only) --*/ | |
de3dc47c | 408 | struct hfa384x_join_request_data { |
e573aaa4 MM |
409 | u8 bssid[WLAN_BSSID_LEN]; |
410 | u16 channel; | |
f0ffa0e2 | 411 | } __packed; |
00b3ed16 GKH |
412 | |
413 | /*-- Configuration Record: authenticateStation (data portion only) --*/ | |
4c976b16 | 414 | struct hfa384x_authenticate_station_data { |
e573aaa4 MM |
415 | u8 address[ETH_ALEN]; |
416 | u16 status; | |
417 | u16 algorithm; | |
17fb19f0 | 418 | } __packed; |
00b3ed16 | 419 | |
00b3ed16 | 420 | /*-- Configuration Record: WPAData (data portion only) --*/ |
162da263 | 421 | struct hfa384x_wpa_data { |
0a3bbcbd | 422 | __le16 datalen; |
5dd8acc8 | 423 | u8 data[0]; /* max 80 */ |
a2a44803 | 424 | } __packed; |
00b3ed16 | 425 | |
00b3ed16 | 426 | /*-------------------------------------------------------------------- |
3e27dfa2 SP |
427 | * Information Record Structures: NIC Information |
428 | *-------------------------------------------------------------------- | |
429 | */ | |
00b3ed16 | 430 | |
00b3ed16 GKH |
431 | /*-- Information Record: DownLoadBuffer --*/ |
432 | /* NOTE: The page and offset are in AUX format */ | |
b71db740 | 433 | struct hfa384x_downloadbuffer { |
e573aaa4 MM |
434 | u16 page; |
435 | u16 offset; | |
436 | u16 len; | |
b71db740 | 437 | } __packed; |
00b3ed16 | 438 | |
00b3ed16 | 439 | /*-------------------------------------------------------------------- |
3e27dfa2 SP |
440 | * Information Record Structures: NIC Information |
441 | *-------------------------------------------------------------------- | |
442 | */ | |
00b3ed16 | 443 | |
aaad4303 | 444 | #define HFA384x_PSTATUS_CONN_IBSS ((u16)3) |
00b3ed16 GKH |
445 | |
446 | /*-- Information Record: commsquality --*/ | |
a1e95045 | 447 | struct hfa384x_commsquality { |
1680202c | 448 | u16 cq_curr_bss; |
0e771659 | 449 | u16 asl_curr_bss; |
6b6f9491 | 450 | u16 anl_curr_fc; |
a1e95045 | 451 | } __packed; |
00b3ed16 GKH |
452 | |
453 | /*-- Information Record: dmbcommsquality --*/ | |
62e493c4 | 454 | struct hfa384x_dbmcommsquality { |
c08510e1 SP |
455 | u16 cq_dbm_curr_bss; |
456 | u16 asl_dbm_curr_bss; | |
457 | u16 anl_dbm_curr_fc; | |
62e493c4 | 458 | } __packed; |
00b3ed16 | 459 | |
00b3ed16 | 460 | /*-------------------------------------------------------------------- |
3e27dfa2 SP |
461 | * FRAME STRUCTURES: Communication Frames |
462 | *-------------------------------------------------------------------- | |
463 | * Communication Frames: Transmit Frames | |
464 | *-------------------------------------------------------------------- | |
465 | */ | |
00b3ed16 | 466 | /*-- Communication Frame: Transmit Frame Structure --*/ |
eb76afc9 | 467 | struct hfa384x_tx_frame { |
e573aaa4 MM |
468 | u16 status; |
469 | u16 reserved1; | |
470 | u16 reserved2; | |
471 | u32 sw_support; | |
472 | u8 tx_retrycount; | |
473 | u8 tx_rate; | |
474 | u16 tx_control; | |
00b3ed16 GKH |
475 | |
476 | /*-- 802.11 Header Information --*/ | |
477 | ||
e573aaa4 MM |
478 | u16 frame_control; |
479 | u16 duration_id; | |
480 | u8 address1[6]; | |
481 | u8 address2[6]; | |
482 | u8 address3[6]; | |
483 | u16 sequence_control; | |
484 | u8 address4[6]; | |
a18ffdf4 | 485 | __le16 data_len; /* little endian format */ |
00b3ed16 GKH |
486 | |
487 | /*-- 802.3 Header Information --*/ | |
488 | ||
e573aaa4 MM |
489 | u8 dest_addr[6]; |
490 | u8 src_addr[6]; | |
491 | u16 data_length; /* big endian format */ | |
eb76afc9 | 492 | } __packed; |
00b3ed16 | 493 | /*-------------------------------------------------------------------- |
3e27dfa2 SP |
494 | * Communication Frames: Field Masks for Transmit Frames |
495 | *-------------------------------------------------------------------- | |
496 | */ | |
00b3ed16 | 497 | /*-- Status Field --*/ |
7f6e0e44 MM |
498 | #define HFA384x_TXSTATUS_ACKERR ((u16)BIT(5)) |
499 | #define HFA384x_TXSTATUS_FORMERR ((u16)BIT(3)) | |
500 | #define HFA384x_TXSTATUS_DISCON ((u16)BIT(2)) | |
501 | #define HFA384x_TXSTATUS_AGEDERR ((u16)BIT(1)) | |
502 | #define HFA384x_TXSTATUS_RETRYERR ((u16)BIT(0)) | |
00b3ed16 | 503 | /*-- Transmit Control Field --*/ |
d349883f SP |
504 | #define HFA384x_TX_MACPORT ((u16)GENMASK(10, 8)) |
505 | #define HFA384x_TX_STRUCTYPE ((u16)GENMASK(4, 3)) | |
7f6e0e44 MM |
506 | #define HFA384x_TX_TXEX ((u16)BIT(2)) |
507 | #define HFA384x_TX_TXOK ((u16)BIT(1)) | |
00b3ed16 | 508 | /*-------------------------------------------------------------------- |
3e27dfa2 SP |
509 | * Communication Frames: Test/Get/Set Field Values for Transmit Frames |
510 | *-------------------------------------------------------------------- | |
511 | */ | |
00b3ed16 GKH |
512 | /*-- Status Field --*/ |
513 | #define HFA384x_TXSTATUS_ISERROR(v) \ | |
65dbeefd | 514 | (((u16)(v)) & \ |
05235ce2 GS |
515 | (HFA384x_TXSTATUS_ACKERR | HFA384x_TXSTATUS_FORMERR | \ |
516 | HFA384x_TXSTATUS_DISCON | HFA384x_TXSTATUS_AGEDERR | \ | |
00b3ed16 GKH |
517 | HFA384x_TXSTATUS_RETRYERR)) |
518 | ||
6e81f6f1 | 519 | #define HFA384x_TX_SET(v, m, s) ((((u16)(v)) << ((u16)(s))) & ((u16)(m))) |
00b3ed16 | 520 | |
00b3ed16 | 521 | #define HFA384x_TX_MACPORT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8) |
71508ee4 AG |
522 | #define HFA384x_TX_STRUCTYPE_SET(v) HFA384x_TX_SET(v, \ |
523 | HFA384x_TX_STRUCTYPE, 3) | |
00b3ed16 | 524 | #define HFA384x_TX_TXEX_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2) |
00b3ed16 GKH |
525 | #define HFA384x_TX_TXOK_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1) |
526 | /*-------------------------------------------------------------------- | |
3e27dfa2 SP |
527 | * Communication Frames: Receive Frames |
528 | *-------------------------------------------------------------------- | |
529 | */ | |
00b3ed16 | 530 | /*-- Communication Frame: Receive Frame Structure --*/ |
70adf509 | 531 | struct hfa384x_rx_frame { |
00b3ed16 | 532 | /*-- MAC rx descriptor (hfa384x byte order) --*/ |
e573aaa4 MM |
533 | u16 status; |
534 | u32 time; | |
535 | u8 silence; | |
536 | u8 signal; | |
537 | u8 rate; | |
538 | u8 rx_flow; | |
539 | u16 reserved1; | |
540 | u16 reserved2; | |
00b3ed16 GKH |
541 | |
542 | /*-- 802.11 Header Information (802.11 byte order) --*/ | |
8cbe56e0 | 543 | __le16 frame_control; |
e573aaa4 MM |
544 | u16 duration_id; |
545 | u8 address1[6]; | |
546 | u8 address2[6]; | |
547 | u8 address3[6]; | |
548 | u16 sequence_control; | |
549 | u8 address4[6]; | |
8cbe56e0 | 550 | __le16 data_len; /* hfa384x (little endian) format */ |
00b3ed16 GKH |
551 | |
552 | /*-- 802.3 Header Information --*/ | |
e573aaa4 MM |
553 | u8 dest_addr[6]; |
554 | u8 src_addr[6]; | |
555 | u16 data_length; /* IEEE? (big endian) format */ | |
70adf509 | 556 | } __packed; |
00b3ed16 | 557 | /*-------------------------------------------------------------------- |
3e27dfa2 SP |
558 | * Communication Frames: Field Masks for Receive Frames |
559 | *-------------------------------------------------------------------- | |
560 | */ | |
00b3ed16 GKH |
561 | |
562 | /*-- Status Fields --*/ | |
d349883f | 563 | #define HFA384x_RXSTATUS_MACPORT ((u16)GENMASK(10, 8)) |
7f6e0e44 | 564 | #define HFA384x_RXSTATUS_FCSERR ((u16)BIT(0)) |
00b3ed16 | 565 | /*-------------------------------------------------------------------- |
3e27dfa2 SP |
566 | * Communication Frames: Test/Get/Set Field Values for Receive Frames |
567 | *-------------------------------------------------------------------- | |
568 | */ | |
71508ee4 AG |
569 | #define HFA384x_RXSTATUS_MACPORT_GET(value) ((u16)((((u16)(value)) \ |
570 | & HFA384x_RXSTATUS_MACPORT) >> 8)) | |
571 | #define HFA384x_RXSTATUS_ISFCSERR(value) ((u16)(((u16)(value)) \ | |
572 | & HFA384x_RXSTATUS_FCSERR)) | |
00b3ed16 | 573 | /*-------------------------------------------------------------------- |
3e27dfa2 SP |
574 | * FRAME STRUCTURES: Information Types and Information Frame Structures |
575 | *-------------------------------------------------------------------- | |
576 | * Information Types | |
577 | *-------------------------------------------------------------------- | |
578 | */ | |
aaad4303 | 579 | #define HFA384x_IT_HANDOVERADDR ((u16)0xF000UL) |
aaad4303 SP |
580 | #define HFA384x_IT_COMMTALLIES ((u16)0xF100UL) |
581 | #define HFA384x_IT_SCANRESULTS ((u16)0xF101UL) | |
582 | #define HFA384x_IT_CHINFORESULTS ((u16)0xF102UL) | |
583 | #define HFA384x_IT_HOSTSCANRESULTS ((u16)0xF103UL) | |
584 | #define HFA384x_IT_LINKSTATUS ((u16)0xF200UL) | |
585 | #define HFA384x_IT_ASSOCSTATUS ((u16)0xF201UL) | |
586 | #define HFA384x_IT_AUTHREQ ((u16)0xF202UL) | |
587 | #define HFA384x_IT_PSUSERCNT ((u16)0xF203UL) | |
588 | #define HFA384x_IT_KEYIDCHANGED ((u16)0xF204UL) | |
eec0d0dc GH |
589 | #define HFA384x_IT_ASSOCREQ ((u16)0xF205UL) |
590 | #define HFA384x_IT_MICFAILURE ((u16)0xF206UL) | |
00b3ed16 GKH |
591 | |
592 | /*-------------------------------------------------------------------- | |
3e27dfa2 SP |
593 | * Information Frames Structures |
594 | *-------------------------------------------------------------------- | |
595 | * Information Frames: Notification Frame Structures | |
596 | *-------------------------------------------------------------------- | |
597 | */ | |
00b3ed16 GKH |
598 | |
599 | /*-- Inquiry Frame, Diagnose: Communication Tallies --*/ | |
4cc454f2 | 600 | struct hfa384x_comm_tallies_16 { |
e573aaa4 MM |
601 | u16 txunicastframes; |
602 | u16 txmulticastframes; | |
603 | u16 txfragments; | |
604 | u16 txunicastoctets; | |
605 | u16 txmulticastoctets; | |
606 | u16 txdeferredtrans; | |
607 | u16 txsingleretryframes; | |
608 | u16 txmultipleretryframes; | |
609 | u16 txretrylimitexceeded; | |
610 | u16 txdiscards; | |
611 | u16 rxunicastframes; | |
612 | u16 rxmulticastframes; | |
613 | u16 rxfragments; | |
614 | u16 rxunicastoctets; | |
615 | u16 rxmulticastoctets; | |
616 | u16 rxfcserrors; | |
617 | u16 rxdiscardsnobuffer; | |
618 | u16 txdiscardswrongsa; | |
619 | u16 rxdiscardswepundecr; | |
620 | u16 rxmsginmsgfrag; | |
621 | u16 rxmsginbadmsgfrag; | |
07e23b67 | 622 | } __packed; |
e573aaa4 | 623 | |
b244edc6 | 624 | struct hfa384x_comm_tallies_32 { |
e573aaa4 MM |
625 | u32 txunicastframes; |
626 | u32 txmulticastframes; | |
627 | u32 txfragments; | |
628 | u32 txunicastoctets; | |
629 | u32 txmulticastoctets; | |
630 | u32 txdeferredtrans; | |
631 | u32 txsingleretryframes; | |
632 | u32 txmultipleretryframes; | |
633 | u32 txretrylimitexceeded; | |
634 | u32 txdiscards; | |
635 | u32 rxunicastframes; | |
636 | u32 rxmulticastframes; | |
637 | u32 rxfragments; | |
638 | u32 rxunicastoctets; | |
639 | u32 rxmulticastoctets; | |
640 | u32 rxfcserrors; | |
641 | u32 rxdiscardsnobuffer; | |
642 | u32 txdiscardswrongsa; | |
643 | u32 rxdiscardswepundecr; | |
644 | u32 rxmsginmsgfrag; | |
645 | u32 rxmsginbadmsgfrag; | |
cfc6cb1f | 646 | } __packed; |
00b3ed16 GKH |
647 | |
648 | /*-- Inquiry Frame, Diagnose: Scan Results & Subfields--*/ | |
b263dd5e | 649 | struct hfa384x_scan_result_sub { |
e573aaa4 MM |
650 | u16 chid; |
651 | u16 anl; | |
652 | u16 sl; | |
653 | u8 bssid[WLAN_BSSID_LEN]; | |
654 | u16 bcnint; | |
655 | u16 capinfo; | |
03c2975b | 656 | struct hfa384x_bytestr32 ssid; |
e573aaa4 MM |
657 | u8 supprates[10]; /* 802.11 info element */ |
658 | u16 proberesp_rate; | |
4400334b | 659 | } __packed; |
e573aaa4 | 660 | |
040a7bd4 | 661 | struct hfa384x_scan_result { |
e573aaa4 MM |
662 | u16 rsvd; |
663 | u16 scanreason; | |
b263dd5e | 664 | struct hfa384x_scan_result_sub result[HFA384x_SCANRESULT_MAX]; |
dc0bb002 | 665 | } __packed; |
00b3ed16 GKH |
666 | |
667 | /*-- Inquiry Frame, Diagnose: ChInfo Results & Subfields--*/ | |
e35baeb0 | 668 | struct hfa384x_ch_info_result_sub { |
e573aaa4 MM |
669 | u16 chid; |
670 | u16 anl; | |
671 | u16 pnl; | |
672 | u16 active; | |
1bc4292a | 673 | } __packed; |
00b3ed16 | 674 | |
7f6e0e44 MM |
675 | #define HFA384x_CHINFORESULT_BSSACTIVE BIT(0) |
676 | #define HFA384x_CHINFORESULT_PCFACTIVE BIT(1) | |
00b3ed16 | 677 | |
c447358a | 678 | struct hfa384x_ch_info_result { |
e573aaa4 | 679 | u16 scanchannels; |
e35baeb0 | 680 | struct hfa384x_ch_info_result_sub result[HFA384x_CHINFORESULT_MAX]; |
0fddae8e | 681 | } __packed; |
00b3ed16 GKH |
682 | |
683 | /*-- Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/ | |
8f8149de | 684 | struct hfa384x_hscan_result_sub { |
18cd9021 SM |
685 | __le16 chid; |
686 | __le16 anl; | |
687 | __le16 sl; | |
e573aaa4 | 688 | u8 bssid[WLAN_BSSID_LEN]; |
18cd9021 SM |
689 | __le16 bcnint; |
690 | __le16 capinfo; | |
03c2975b | 691 | struct hfa384x_bytestr32 ssid; |
e573aaa4 MM |
692 | u8 supprates[10]; /* 802.11 info element */ |
693 | u16 proberesp_rate; | |
18cd9021 | 694 | __le16 atim; |
b353d11a | 695 | } __packed; |
e573aaa4 | 696 | |
0e2ce9ad | 697 | struct hfa384x_hscan_result { |
e573aaa4 MM |
698 | u16 nresult; |
699 | u16 rsvd; | |
8f8149de | 700 | struct hfa384x_hscan_result_sub result[HFA384x_HSCANRESULT_MAX]; |
f8f2821e | 701 | } __packed; |
00b3ed16 GKH |
702 | |
703 | /*-- Unsolicited Frame, MAC Mgmt: LinkStatus --*/ | |
704 | ||
aaad4303 SP |
705 | #define HFA384x_LINK_NOTCONNECTED ((u16)0) |
706 | #define HFA384x_LINK_CONNECTED ((u16)1) | |
707 | #define HFA384x_LINK_DISCONNECTED ((u16)2) | |
708 | #define HFA384x_LINK_AP_CHANGE ((u16)3) | |
709 | #define HFA384x_LINK_AP_OUTOFRANGE ((u16)4) | |
710 | #define HFA384x_LINK_AP_INRANGE ((u16)5) | |
711 | #define HFA384x_LINK_ASSOCFAIL ((u16)6) | |
00b3ed16 | 712 | |
7190f3f1 | 713 | struct hfa384x_link_status { |
e573aaa4 | 714 | u16 linkstatus; |
a8eb5139 | 715 | } __packed; |
00b3ed16 GKH |
716 | |
717 | /*-- Unsolicited Frame, MAC Mgmt: AssociationStatus (--*/ | |
718 | ||
aaad4303 SP |
719 | #define HFA384x_ASSOCSTATUS_STAASSOC ((u16)1) |
720 | #define HFA384x_ASSOCSTATUS_REASSOC ((u16)2) | |
aaad4303 | 721 | #define HFA384x_ASSOCSTATUS_AUTHFAIL ((u16)5) |
00b3ed16 | 722 | |
1889b0db | 723 | struct hfa384x_assoc_status { |
e573aaa4 MM |
724 | u16 assocstatus; |
725 | u8 sta_addr[ETH_ALEN]; | |
00b3ed16 | 726 | /* old_ap_addr is only valid if assocstatus == 2 */ |
e573aaa4 MM |
727 | u8 old_ap_addr[ETH_ALEN]; |
728 | u16 reason; | |
729 | u16 reserved; | |
5383f13e | 730 | } __packed; |
00b3ed16 GKH |
731 | |
732 | /*-- Unsolicited Frame, MAC Mgmt: AuthRequest (AP Only) --*/ | |
733 | ||
b8f55192 | 734 | struct hfa384x_auth_request { |
e573aaa4 MM |
735 | u8 sta_addr[ETH_ALEN]; |
736 | u16 algorithm; | |
b9820e0c | 737 | } __packed; |
00b3ed16 | 738 | |
00b3ed16 GKH |
739 | /*-- Unsolicited Frame, MAC Mgmt: PSUserCount (AP Only) --*/ |
740 | ||
0c3b2bd7 | 741 | struct hfa384x_ps_user_count { |
e573aaa4 | 742 | u16 usercnt; |
013e69eb | 743 | } __packed; |
00b3ed16 | 744 | |
ab42187a | 745 | struct hfa384x_key_id_changed { |
e573aaa4 MM |
746 | u8 sta_addr[ETH_ALEN]; |
747 | u16 keyid; | |
44049d81 | 748 | } __packed; |
00b3ed16 GKH |
749 | |
750 | /*-- Collection of all Inf frames ---------------*/ | |
f745ea61 | 751 | union hfa384x_infodata { |
4cc454f2 | 752 | struct hfa384x_comm_tallies_16 commtallies16; |
b244edc6 | 753 | struct hfa384x_comm_tallies_32 commtallies32; |
040a7bd4 | 754 | struct hfa384x_scan_result scanresult; |
c447358a | 755 | struct hfa384x_ch_info_result chinforesult; |
0e2ce9ad | 756 | struct hfa384x_hscan_result hscanresult; |
7190f3f1 | 757 | struct hfa384x_link_status linkstatus; |
1889b0db | 758 | struct hfa384x_assoc_status assocstatus; |
b8f55192 | 759 | struct hfa384x_auth_request authreq; |
0c3b2bd7 | 760 | struct hfa384x_ps_user_count psusercnt; |
ab42187a | 761 | struct hfa384x_key_id_changed keyidchanged; |
f745ea61 | 762 | } __packed; |
e573aaa4 | 763 | |
60f5f3fb | 764 | struct hfa384x_inf_frame { |
e573aaa4 MM |
765 | u16 framelen; |
766 | u16 infotype; | |
f745ea61 | 767 | union hfa384x_infodata info; |
f69de9e3 | 768 | } __packed; |
00b3ed16 | 769 | |
00b3ed16 | 770 | /*-------------------------------------------------------------------- |
3e27dfa2 SP |
771 | * USB Packet structures and constants. |
772 | *-------------------------------------------------------------------- | |
773 | */ | |
00b3ed16 | 774 | |
00b3ed16 GKH |
775 | /* Should be sent to the bulkout endpoint */ |
776 | #define HFA384x_USB_TXFRM 0 | |
777 | #define HFA384x_USB_CMDREQ 1 | |
778 | #define HFA384x_USB_WRIDREQ 2 | |
779 | #define HFA384x_USB_RRIDREQ 3 | |
780 | #define HFA384x_USB_WMEMREQ 4 | |
781 | #define HFA384x_USB_RMEMREQ 5 | |
782 | ||
783 | /* Received from the bulkin endpoint */ | |
00b3ed16 GKH |
784 | #define HFA384x_USB_ISTXFRM(a) (((a) & 0x9000) == 0x1000) |
785 | #define HFA384x_USB_ISRXFRM(a) (!((a) & 0x9000)) | |
786 | #define HFA384x_USB_INFOFRM 0x8000 | |
787 | #define HFA384x_USB_CMDRESP 0x8001 | |
788 | #define HFA384x_USB_WRIDRESP 0x8002 | |
789 | #define HFA384x_USB_RRIDRESP 0x8003 | |
790 | #define HFA384x_USB_WMEMRESP 0x8004 | |
791 | #define HFA384x_USB_RMEMRESP 0x8005 | |
792 | #define HFA384x_USB_BUFAVAIL 0x8006 | |
793 | #define HFA384x_USB_ERROR 0x8007 | |
794 | ||
795 | /*------------------------------------*/ | |
796 | /* Request (bulk OUT) packet contents */ | |
797 | ||
2f1014f7 | 798 | struct hfa384x_usb_txfrm { |
eb76afc9 | 799 | struct hfa384x_tx_frame desc; |
e573aaa4 | 800 | u8 data[WLAN_DATA_MAXLEN]; |
2f1014f7 | 801 | } __packed; |
00b3ed16 | 802 | |
a6dcbdfe | 803 | struct hfa384x_usb_cmdreq { |
a18ffdf4 AD |
804 | __le16 type; |
805 | __le16 cmd; | |
806 | __le16 parm0; | |
807 | __le16 parm1; | |
808 | __le16 parm2; | |
e573aaa4 | 809 | u8 pad[54]; |
a6dcbdfe | 810 | } __packed; |
00b3ed16 | 811 | |
3bc070f6 | 812 | struct hfa384x_usb_wridreq { |
a18ffdf4 AD |
813 | __le16 type; |
814 | __le16 frmlen; | |
815 | __le16 rid; | |
e573aaa4 | 816 | u8 data[HFA384x_RIDDATA_MAXLEN]; |
3bc070f6 | 817 | } __packed; |
00b3ed16 | 818 | |
5b9f240e | 819 | struct hfa384x_usb_rridreq { |
a18ffdf4 AD |
820 | __le16 type; |
821 | __le16 frmlen; | |
822 | __le16 rid; | |
e573aaa4 | 823 | u8 pad[58]; |
5b9f240e | 824 | } __packed; |
00b3ed16 | 825 | |
f0e15d40 | 826 | struct hfa384x_usb_wmemreq { |
a18ffdf4 AD |
827 | __le16 type; |
828 | __le16 frmlen; | |
829 | __le16 offset; | |
830 | __le16 page; | |
e573aaa4 | 831 | u8 data[HFA384x_USB_RWMEM_MAXLEN]; |
f0e15d40 | 832 | } __packed; |
00b3ed16 | 833 | |
94ec5464 | 834 | struct hfa384x_usb_rmemreq { |
a18ffdf4 AD |
835 | __le16 type; |
836 | __le16 frmlen; | |
837 | __le16 offset; | |
838 | __le16 page; | |
e573aaa4 | 839 | u8 pad[56]; |
94ec5464 | 840 | } __packed; |
00b3ed16 GKH |
841 | |
842 | /*------------------------------------*/ | |
843 | /* Response (bulk IN) packet contents */ | |
844 | ||
684b2e08 | 845 | struct hfa384x_usb_rxfrm { |
70adf509 | 846 | struct hfa384x_rx_frame desc; |
e573aaa4 | 847 | u8 data[WLAN_DATA_MAXLEN]; |
684b2e08 | 848 | } __packed; |
00b3ed16 | 849 | |
e20a7ca1 | 850 | struct hfa384x_usb_infofrm { |
e573aaa4 | 851 | u16 type; |
60f5f3fb | 852 | struct hfa384x_inf_frame info; |
e20a7ca1 | 853 | } __packed; |
00b3ed16 | 854 | |
385a79df | 855 | struct hfa384x_usb_statusresp { |
e573aaa4 | 856 | u16 type; |
a18ffdf4 AD |
857 | __le16 status; |
858 | __le16 resp0; | |
859 | __le16 resp1; | |
860 | __le16 resp2; | |
385a79df | 861 | } __packed; |
00b3ed16 | 862 | |
a988c9f3 | 863 | struct hfa384x_usb_rridresp { |
e573aaa4 | 864 | u16 type; |
a18ffdf4 AD |
865 | __le16 frmlen; |
866 | __le16 rid; | |
e573aaa4 | 867 | u8 data[HFA384x_RIDDATA_MAXLEN]; |
a988c9f3 | 868 | } __packed; |
00b3ed16 | 869 | |
1ed54806 | 870 | struct hfa384x_usb_rmemresp { |
e573aaa4 MM |
871 | u16 type; |
872 | u16 frmlen; | |
873 | u8 data[HFA384x_USB_RWMEM_MAXLEN]; | |
1ed54806 | 874 | } __packed; |
00b3ed16 | 875 | |
c4d8a0a8 | 876 | struct hfa384x_usb_bufavail { |
e573aaa4 MM |
877 | u16 type; |
878 | u16 frmlen; | |
c4d8a0a8 | 879 | } __packed; |
00b3ed16 | 880 | |
d4734c30 | 881 | struct hfa384x_usb_error { |
e573aaa4 MM |
882 | u16 type; |
883 | u16 errortype; | |
d4734c30 | 884 | } __packed; |
00b3ed16 GKH |
885 | |
886 | /*----------------------------------------------------------*/ | |
887 | /* Unions for packaging all the known packet types together */ | |
888 | ||
4012684a | 889 | union hfa384x_usbout { |
a78d1312 | 890 | __le16 type; |
2f1014f7 | 891 | struct hfa384x_usb_txfrm txfrm; |
a6dcbdfe | 892 | struct hfa384x_usb_cmdreq cmdreq; |
3bc070f6 | 893 | struct hfa384x_usb_wridreq wridreq; |
5b9f240e | 894 | struct hfa384x_usb_rridreq rridreq; |
f0e15d40 | 895 | struct hfa384x_usb_wmemreq wmemreq; |
94ec5464 | 896 | struct hfa384x_usb_rmemreq rmemreq; |
4012684a | 897 | } __packed; |
00b3ed16 | 898 | |
3e4180c3 | 899 | union hfa384x_usbin { |
a78d1312 | 900 | __le16 type; |
684b2e08 | 901 | struct hfa384x_usb_rxfrm rxfrm; |
2f1014f7 | 902 | struct hfa384x_usb_txfrm txfrm; |
e20a7ca1 | 903 | struct hfa384x_usb_infofrm infofrm; |
385a79df | 904 | struct hfa384x_usb_statusresp cmdresp; |
2c8079de | 905 | struct hfa384x_usb_statusresp wridresp; |
a988c9f3 | 906 | struct hfa384x_usb_rridresp rridresp; |
499c1cc9 | 907 | struct hfa384x_usb_statusresp wmemresp; |
1ed54806 | 908 | struct hfa384x_usb_rmemresp rmemresp; |
c4d8a0a8 | 909 | struct hfa384x_usb_bufavail bufavail; |
d4734c30 | 910 | struct hfa384x_usb_error usberror; |
e573aaa4 | 911 | u8 boguspad[3000]; |
3e4180c3 | 912 | } __packed; |
00b3ed16 | 913 | |
76e3e7c4 | 914 | /*-------------------------------------------------------------------- |
3e27dfa2 SP |
915 | * PD record structures. |
916 | *-------------------------------------------------------------------- | |
917 | */ | |
76e3e7c4 | 918 | |
e0696aa8 | 919 | struct hfa384x_pdr_pcb_partnum { |
75f49e07 | 920 | u8 num[8]; |
e0696aa8 | 921 | } __packed; |
76e3e7c4 | 922 | |
caeabb80 | 923 | struct hfa384x_pdr_pcb_tracenum { |
75f49e07 | 924 | u8 num[8]; |
caeabb80 | 925 | } __packed; |
76e3e7c4 | 926 | |
66e7bdb6 | 927 | struct hfa384x_pdr_nic_serial { |
75f49e07 | 928 | u8 num[12]; |
66e7bdb6 | 929 | } __packed; |
76e3e7c4 | 930 | |
ee9f7626 | 931 | struct hfa384x_pdr_mkk_measurements { |
75f49e07 MT |
932 | double carrier_freq; |
933 | double occupied_band; | |
934 | double power_density; | |
935 | double tx_spur_f1; | |
936 | double tx_spur_f2; | |
937 | double tx_spur_f3; | |
938 | double tx_spur_f4; | |
939 | double tx_spur_l1; | |
940 | double tx_spur_l2; | |
941 | double tx_spur_l3; | |
942 | double tx_spur_l4; | |
943 | double rx_spur_f1; | |
944 | double rx_spur_f2; | |
945 | double rx_spur_l1; | |
946 | double rx_spur_l2; | |
ee9f7626 | 947 | } __packed; |
76e3e7c4 | 948 | |
02eebae4 | 949 | struct hfa384x_pdr_nic_ramsize { |
75f49e07 | 950 | u8 size[12]; /* units of KB */ |
02eebae4 | 951 | } __packed; |
76e3e7c4 | 952 | |
9127692f | 953 | struct hfa384x_pdr_mfisuprange { |
75f49e07 MT |
954 | u16 id; |
955 | u16 variant; | |
956 | u16 bottom; | |
957 | u16 top; | |
9127692f | 958 | } __packed; |
76e3e7c4 | 959 | |
4ae2996f | 960 | struct hfa384x_pdr_cfisuprange { |
75f49e07 MT |
961 | u16 id; |
962 | u16 variant; | |
963 | u16 bottom; | |
964 | u16 top; | |
4ae2996f | 965 | } __packed; |
76e3e7c4 | 966 | |
e9ee92c7 | 967 | struct hfa384x_pdr_nicid { |
75f49e07 MT |
968 | u16 id; |
969 | u16 variant; | |
970 | u16 major; | |
971 | u16 minor; | |
e9ee92c7 | 972 | } __packed; |
76e3e7c4 | 973 | |
1c0c8eba | 974 | struct hfa384x_pdr_refdac_measurements { |
75f49e07 | 975 | u16 value[0]; |
1c0c8eba | 976 | } __packed; |
76e3e7c4 | 977 | |
de95929c | 978 | struct hfa384x_pdr_vgdac_measurements { |
75f49e07 | 979 | u16 value[0]; |
de95929c | 980 | } __packed; |
76e3e7c4 | 981 | |
dac1445d | 982 | struct hfa384x_pdr_level_comp_measurements { |
75f49e07 | 983 | u16 value[0]; |
dac1445d | 984 | } __packed; |
76e3e7c4 | 985 | |
29f1e44e | 986 | struct hfa384x_pdr_mac_address { |
75f49e07 | 987 | u8 addr[6]; |
29f1e44e | 988 | } __packed; |
76e3e7c4 | 989 | |
f9699553 | 990 | struct hfa384x_pdr_mkk_callname { |
75f49e07 | 991 | u8 callname[8]; |
f9699553 | 992 | } __packed; |
76e3e7c4 | 993 | |
0970a33d | 994 | struct hfa384x_pdr_regdomain { |
75f49e07 MT |
995 | u16 numdomains; |
996 | u16 domain[5]; | |
0970a33d | 997 | } __packed; |
76e3e7c4 | 998 | |
e0322d1b | 999 | struct hfa384x_pdr_allowed_channel { |
75f49e07 | 1000 | u16 ch_bitmap; |
e0322d1b | 1001 | } __packed; |
76e3e7c4 | 1002 | |
892b51ec | 1003 | struct hfa384x_pdr_default_channel { |
75f49e07 | 1004 | u16 channel; |
892b51ec | 1005 | } __packed; |
76e3e7c4 | 1006 | |
2c1759be | 1007 | struct hfa384x_pdr_privacy_option { |
75f49e07 | 1008 | u16 available; |
2c1759be | 1009 | } __packed; |
76e3e7c4 | 1010 | |
0c350461 | 1011 | struct hfa384x_pdr_temptype { |
75f49e07 | 1012 | u16 type; |
0c350461 | 1013 | } __packed; |
76e3e7c4 | 1014 | |
3c92d65d | 1015 | struct hfa384x_pdr_refdac_setup { |
75f49e07 | 1016 | u16 ch_value[14]; |
3c92d65d | 1017 | } __packed; |
76e3e7c4 | 1018 | |
dce6c283 | 1019 | struct hfa384x_pdr_vgdac_setup { |
75f49e07 | 1020 | u16 ch_value[14]; |
dce6c283 | 1021 | } __packed; |
76e3e7c4 | 1022 | |
29aef6bb | 1023 | struct hfa384x_pdr_level_comp_setup { |
75f49e07 | 1024 | u16 ch_value[14]; |
29aef6bb | 1025 | } __packed; |
76e3e7c4 | 1026 | |
a98f8609 | 1027 | struct hfa384x_pdr_trimdac_setup { |
75f49e07 MT |
1028 | u16 trimidac; |
1029 | u16 trimqdac; | |
a98f8609 | 1030 | } __packed; |
76e3e7c4 | 1031 | |
3d235885 | 1032 | struct hfa384x_pdr_ifr_setting { |
75f49e07 | 1033 | u16 value[3]; |
3d235885 | 1034 | } __packed; |
76e3e7c4 | 1035 | |
da79fe4a | 1036 | struct hfa384x_pdr_rfr_setting { |
75f49e07 | 1037 | u16 value[3]; |
da79fe4a | 1038 | } __packed; |
76e3e7c4 | 1039 | |
b4547dc5 | 1040 | struct hfa384x_pdr_hfa3861_baseline { |
75f49e07 | 1041 | u16 value[50]; |
b4547dc5 | 1042 | } __packed; |
76e3e7c4 | 1043 | |
0dbc2e46 | 1044 | struct hfa384x_pdr_hfa3861_shadow { |
75f49e07 | 1045 | u32 value[32]; |
0dbc2e46 | 1046 | } __packed; |
76e3e7c4 | 1047 | |
1755c01b | 1048 | struct hfa384x_pdr_hfa3861_ifrf { |
75f49e07 | 1049 | u32 value[20]; |
1755c01b | 1050 | } __packed; |
76e3e7c4 | 1051 | |
788c9732 | 1052 | struct hfa384x_pdr_hfa3861_chcalsp { |
75f49e07 | 1053 | u16 value[14]; |
788c9732 | 1054 | } __packed; |
76e3e7c4 | 1055 | |
b94425ff | 1056 | struct hfa384x_pdr_hfa3861_chcali { |
75f49e07 | 1057 | u16 value[17]; |
b94425ff | 1058 | } __packed; |
76e3e7c4 | 1059 | |
bd84b588 | 1060 | struct hfa384x_pdr_hfa3861_nic_config { |
75f49e07 | 1061 | u16 config_bitmap; |
bd84b588 | 1062 | } __packed; |
76e3e7c4 | 1063 | |
9408a44c | 1064 | struct hfa384x_pdr_hfo_delay { |
75f49e07 | 1065 | u8 hfo_delay; |
9408a44c | 1066 | } __packed; |
76e3e7c4 | 1067 | |
0960d2e1 | 1068 | struct hfa384x_pdr_hfa3861_manf_testsp { |
75f49e07 | 1069 | u16 value[30]; |
0960d2e1 | 1070 | } __packed; |
76e3e7c4 | 1071 | |
5a4a5823 | 1072 | struct hfa384x_pdr_hfa3861_manf_testi { |
75f49e07 | 1073 | u16 value[30]; |
5a4a5823 | 1074 | } __packed; |
76e3e7c4 | 1075 | |
b26ce5f6 | 1076 | struct hfa384x_pdr_end_of_pda { |
75f49e07 | 1077 | u16 crc; |
b26ce5f6 | 1078 | } __packed; |
76e3e7c4 | 1079 | |
4f026e89 | 1080 | struct hfa384x_pdrec { |
76b4580b MB |
1081 | __le16 len; /* in words */ |
1082 | __le16 code; | |
76e3e7c4 | 1083 | union pdr { |
e0696aa8 | 1084 | struct hfa384x_pdr_pcb_partnum pcb_partnum; |
caeabb80 | 1085 | struct hfa384x_pdr_pcb_tracenum pcb_tracenum; |
66e7bdb6 | 1086 | struct hfa384x_pdr_nic_serial nic_serial; |
ee9f7626 | 1087 | struct hfa384x_pdr_mkk_measurements mkk_measurements; |
02eebae4 | 1088 | struct hfa384x_pdr_nic_ramsize nic_ramsize; |
9127692f | 1089 | struct hfa384x_pdr_mfisuprange mfisuprange; |
4ae2996f | 1090 | struct hfa384x_pdr_cfisuprange cfisuprange; |
e9ee92c7 | 1091 | struct hfa384x_pdr_nicid nicid; |
1c0c8eba | 1092 | struct hfa384x_pdr_refdac_measurements refdac_measurements; |
de95929c | 1093 | struct hfa384x_pdr_vgdac_measurements vgdac_measurements; |
dac1445d | 1094 | struct hfa384x_pdr_level_comp_measurements level_compc_measurements; |
29f1e44e | 1095 | struct hfa384x_pdr_mac_address mac_address; |
f9699553 | 1096 | struct hfa384x_pdr_mkk_callname mkk_callname; |
0970a33d | 1097 | struct hfa384x_pdr_regdomain regdomain; |
e0322d1b | 1098 | struct hfa384x_pdr_allowed_channel allowed_channel; |
892b51ec | 1099 | struct hfa384x_pdr_default_channel default_channel; |
2c1759be | 1100 | struct hfa384x_pdr_privacy_option privacy_option; |
0c350461 | 1101 | struct hfa384x_pdr_temptype temptype; |
3c92d65d | 1102 | struct hfa384x_pdr_refdac_setup refdac_setup; |
dce6c283 | 1103 | struct hfa384x_pdr_vgdac_setup vgdac_setup; |
29aef6bb | 1104 | struct hfa384x_pdr_level_comp_setup level_comp_setup; |
a98f8609 | 1105 | struct hfa384x_pdr_trimdac_setup trimdac_setup; |
3d235885 | 1106 | struct hfa384x_pdr_ifr_setting ifr_setting; |
da79fe4a | 1107 | struct hfa384x_pdr_rfr_setting rfr_setting; |
b4547dc5 | 1108 | struct hfa384x_pdr_hfa3861_baseline hfa3861_baseline; |
0dbc2e46 | 1109 | struct hfa384x_pdr_hfa3861_shadow hfa3861_shadow; |
1755c01b | 1110 | struct hfa384x_pdr_hfa3861_ifrf hfa3861_ifrf; |
788c9732 | 1111 | struct hfa384x_pdr_hfa3861_chcalsp hfa3861_chcalsp; |
b94425ff | 1112 | struct hfa384x_pdr_hfa3861_chcali hfa3861_chcali; |
bd84b588 | 1113 | struct hfa384x_pdr_hfa3861_nic_config nic_config; |
9408a44c | 1114 | struct hfa384x_pdr_hfo_delay hfo_delay; |
0960d2e1 | 1115 | struct hfa384x_pdr_hfa3861_manf_testsp hfa3861_manf_testsp; |
5a4a5823 | 1116 | struct hfa384x_pdr_hfa3861_manf_testi hfa3861_manf_testi; |
b26ce5f6 | 1117 | struct hfa384x_pdr_end_of_pda end_of_pda; |
76e3e7c4 KR |
1118 | |
1119 | } data; | |
4f026e89 | 1120 | } __packed; |
76e3e7c4 | 1121 | |
00b3ed16 GKH |
1122 | #ifdef __KERNEL__ |
1123 | /*-------------------------------------------------------------------- | |
3e27dfa2 SP |
1124 | * --- MAC state structure, argument to all functions -- |
1125 | * --- Also, a collection of support types -- | |
1126 | *-------------------------------------------------------------------- | |
1127 | */ | |
501f5f96 | 1128 | struct hfa384x_cmdresult { |
e573aaa4 MM |
1129 | u16 status; |
1130 | u16 resp0; | |
1131 | u16 resp1; | |
1132 | u16 resp2; | |
501f5f96 | 1133 | }; |
00b3ed16 | 1134 | |
00b3ed16 GKH |
1135 | /* USB Control Exchange (CTLX): |
1136 | * A queue of the structure below is maintained for all of the | |
1137 | * Request/Response type USB packets supported by Prism2. | |
1138 | */ | |
1139 | /* The following hfa384x_* structures are arguments to | |
1140 | * the usercb() for the different CTLX types. | |
1141 | */ | |
b3fd890e | 1142 | struct hfa384x_rridresult { |
e573aaa4 MM |
1143 | u16 rid; |
1144 | const void *riddata; | |
1145 | unsigned int riddata_len; | |
b3fd890e | 1146 | }; |
00b3ed16 GKH |
1147 | |
1148 | enum ctlx_state { | |
e573aaa4 | 1149 | CTLX_START = 0, /* Start state, not queued */ |
00b3ed16 | 1150 | |
e573aaa4 | 1151 | CTLX_COMPLETE, /* CTLX successfully completed */ |
00b3ed16 GKH |
1152 | CTLX_REQ_FAILED, /* OUT URB completed w/ error */ |
1153 | ||
1154 | CTLX_PENDING, /* Queued, data valid */ | |
1155 | CTLX_REQ_SUBMITTED, /* OUT URB submitted */ | |
1156 | CTLX_REQ_COMPLETE, /* OUT URB complete */ | |
1157 | CTLX_RESP_COMPLETE /* IN URB received */ | |
1158 | }; | |
00b3ed16 GKH |
1159 | |
1160 | struct hfa384x_usbctlx; | |
1161 | struct hfa384x; | |
1162 | ||
e573aaa4 | 1163 | typedef void (*ctlx_cmdcb_t) (struct hfa384x *, const struct hfa384x_usbctlx *); |
00b3ed16 | 1164 | |
5dd8acc8 | 1165 | typedef void (*ctlx_usercb_t) (struct hfa384x *hw, |
e573aaa4 | 1166 | void *ctlxresult, void *usercb_data); |
00b3ed16 | 1167 | |
a10d36b0 | 1168 | struct hfa384x_usbctlx { |
e573aaa4 | 1169 | struct list_head list; |
00b3ed16 | 1170 | |
e573aaa4 | 1171 | size_t outbufsize; |
4012684a | 1172 | union hfa384x_usbout outbuf; /* pkt buf for OUT */ |
3e4180c3 | 1173 | union hfa384x_usbin inbuf; /* pkt buf for IN(a copy) */ |
00b3ed16 | 1174 | |
173bf7e3 | 1175 | enum ctlx_state state; /* Tracks running state */ |
00b3ed16 | 1176 | |
e573aaa4 MM |
1177 | struct completion done; |
1178 | volatile int reapable; /* Food for the reaper task */ | |
00b3ed16 | 1179 | |
e573aaa4 MM |
1180 | ctlx_cmdcb_t cmdcb; /* Async command callback */ |
1181 | ctlx_usercb_t usercb; /* Async user callback, */ | |
1182 | void *usercb_data; /* at CTLX completion */ | |
00b3ed16 | 1183 | |
e573aaa4 | 1184 | int variant; /* Identifies cmd variant */ |
a10d36b0 | 1185 | }; |
00b3ed16 | 1186 | |
3df38936 | 1187 | struct hfa384x_usbctlxq { |
e573aaa4 MM |
1188 | spinlock_t lock; |
1189 | struct list_head pending; | |
1190 | struct list_head active; | |
1191 | struct list_head completing; | |
1192 | struct list_head reapable; | |
3df38936 | 1193 | }; |
00b3ed16 | 1194 | |
e2f503c4 | 1195 | struct hfa384x_metacmd { |
e573aaa4 | 1196 | u16 cmd; |
00b3ed16 | 1197 | |
e573aaa4 MM |
1198 | u16 parm0; |
1199 | u16 parm1; | |
1200 | u16 parm2; | |
00b3ed16 | 1201 | |
501f5f96 | 1202 | struct hfa384x_cmdresult result; |
e2f503c4 | 1203 | }; |
00b3ed16 | 1204 | |
00b3ed16 | 1205 | #define MAX_GRP_ADDR 32 |
71508ee4 | 1206 | #define WLAN_COMMENT_MAX 80 /* Max. length of user comment string. */ |
00b3ed16 | 1207 | |
71508ee4 AG |
1208 | #define WLAN_AUTH_MAX 60 /* Max. # of authenticated stations. */ |
1209 | #define WLAN_ACCESS_MAX 60 /* Max. # of stations in an access list. */ | |
1210 | #define WLAN_ACCESS_NONE 0 /* No stations may be authenticated. */ | |
1211 | #define WLAN_ACCESS_ALL 1 /* All stations may be authenticated. */ | |
1212 | #define WLAN_ACCESS_ALLOW 2 /* Authenticate only "allowed" stations. */ | |
1213 | #define WLAN_ACCESS_DENY 3 /* Do not authenticate "denied" stations. */ | |
00b3ed16 GKH |
1214 | |
1215 | /* XXX These are going away ASAP */ | |
c84b528c | 1216 | struct prism2sta_authlist { |
e573aaa4 MM |
1217 | unsigned int cnt; |
1218 | u8 addr[WLAN_AUTH_MAX][ETH_ALEN]; | |
1219 | u8 assoc[WLAN_AUTH_MAX]; | |
c84b528c | 1220 | }; |
00b3ed16 | 1221 | |
4d10ece3 | 1222 | struct prism2sta_accesslist { |
e573aaa4 MM |
1223 | unsigned int modify; |
1224 | unsigned int cnt; | |
1225 | u8 addr[WLAN_ACCESS_MAX][ETH_ALEN]; | |
1226 | unsigned int cnt1; | |
1227 | u8 addr1[WLAN_ACCESS_MAX][ETH_ALEN]; | |
4d10ece3 | 1228 | }; |
00b3ed16 | 1229 | |
5a2214e2 | 1230 | struct hfa384x { |
00b3ed16 | 1231 | /* USB support data */ |
e573aaa4 MM |
1232 | struct usb_device *usb; |
1233 | struct urb rx_urb; | |
1234 | struct sk_buff *rx_urb_skb; | |
1235 | struct urb tx_urb; | |
1236 | struct urb ctlx_urb; | |
4012684a | 1237 | union hfa384x_usbout txbuff; |
3df38936 | 1238 | struct hfa384x_usbctlxq ctlxq; |
e573aaa4 MM |
1239 | struct timer_list reqtimer; |
1240 | struct timer_list resptimer; | |
00b3ed16 | 1241 | |
e573aaa4 | 1242 | struct timer_list throttle; |
00b3ed16 | 1243 | |
e573aaa4 MM |
1244 | struct tasklet_struct reaper_bh; |
1245 | struct tasklet_struct completion_bh; | |
00b3ed16 | 1246 | |
e573aaa4 | 1247 | struct work_struct usb_work; |
00b3ed16 | 1248 | |
e573aaa4 | 1249 | unsigned long usb_flags; |
00b3ed16 GKH |
1250 | #define THROTTLE_RX 0 |
1251 | #define THROTTLE_TX 1 | |
1252 | #define WORK_RX_HALT 2 | |
1253 | #define WORK_TX_HALT 3 | |
1254 | #define WORK_RX_RESUME 4 | |
1255 | #define WORK_TX_RESUME 5 | |
1256 | ||
e573aaa4 MM |
1257 | unsigned short req_timer_done:1; |
1258 | unsigned short resp_timer_done:1; | |
00b3ed16 | 1259 | |
e573aaa4 MM |
1260 | int endp_in; |
1261 | int endp_out; | |
00b3ed16 | 1262 | |
e573aaa4 MM |
1263 | int sniff_fcs; |
1264 | int sniff_channel; | |
1265 | int sniff_truncate; | |
1266 | int sniffhdr; | |
00b3ed16 | 1267 | |
e573aaa4 | 1268 | wait_queue_head_t cmdq; /* wait queue itself */ |
00b3ed16 GKH |
1269 | |
1270 | /* Controller state */ | |
e573aaa4 MM |
1271 | u32 state; |
1272 | u32 isap; | |
1273 | u8 port_enabled[HFA384x_NUMPORTS_MAX]; | |
00b3ed16 GKH |
1274 | |
1275 | /* Download support */ | |
e573aaa4 | 1276 | unsigned int dlstate; |
b71db740 | 1277 | struct hfa384x_downloadbuffer bufinfo; |
e573aaa4 | 1278 | u16 dltimeout; |
00b3ed16 | 1279 | |
1a6dfce7 | 1280 | int scanflag; /* to signal scan complete */ |
e573aaa4 MM |
1281 | int join_ap; /* are we joined to a specific ap */ |
1282 | int join_retries; /* number of join retries till we fail */ | |
de3dc47c | 1283 | struct hfa384x_join_request_data joinreq;/* join request saved data */ |
00b3ed16 | 1284 | |
c9573a8d | 1285 | struct wlandevice *wlandev; |
00b3ed16 | 1286 | /* Timer to allow for the deferred processing of linkstatus messages */ |
e573aaa4 | 1287 | struct work_struct link_bh; |
00b3ed16 | 1288 | |
e573aaa4 | 1289 | struct work_struct commsqual_bh; |
a1e95045 | 1290 | struct hfa384x_commsquality qual; |
e573aaa4 | 1291 | struct timer_list commsqual_timer; |
00b3ed16 | 1292 | |
aaad4303 SP |
1293 | u16 link_status; |
1294 | u16 link_status_new; | |
e573aaa4 | 1295 | struct sk_buff_head authq; |
00b3ed16 | 1296 | |
cb3126e6 KR |
1297 | u32 txrate; |
1298 | ||
00b3ed16 GKH |
1299 | /* And here we have stuff that used to be in priv */ |
1300 | ||
1301 | /* State variables */ | |
e573aaa4 MM |
1302 | unsigned int presniff_port_type; |
1303 | u16 presniff_wepflags; | |
1304 | u32 dot11_desired_bss_type; | |
00b3ed16 | 1305 | |
e573aaa4 | 1306 | int dbmadjust; |
00b3ed16 GKH |
1307 | |
1308 | /* Group Addresses - right now, there are up to a total | |
5f0730fd JR |
1309 | * of MAX_GRP_ADDR group addresses |
1310 | */ | |
e573aaa4 MM |
1311 | u8 dot11_grp_addr[MAX_GRP_ADDR][ETH_ALEN]; |
1312 | unsigned int dot11_grpcnt; | |
00b3ed16 GKH |
1313 | |
1314 | /* Component Identities */ | |
5f046456 SP |
1315 | struct hfa384x_compident ident_nic; |
1316 | struct hfa384x_compident ident_pri_fw; | |
1317 | struct hfa384x_compident ident_sta_fw; | |
1318 | struct hfa384x_compident ident_ap_fw; | |
e573aaa4 | 1319 | u16 mm_mods; |
00b3ed16 GKH |
1320 | |
1321 | /* Supplier compatibility ranges */ | |
65f170c6 SP |
1322 | struct hfa384x_caplevel cap_sup_mfi; |
1323 | struct hfa384x_caplevel cap_sup_cfi; | |
1324 | struct hfa384x_caplevel cap_sup_pri; | |
1325 | struct hfa384x_caplevel cap_sup_sta; | |
1326 | struct hfa384x_caplevel cap_sup_ap; | |
00b3ed16 GKH |
1327 | |
1328 | /* Actor compatibility ranges */ | |
5f7688dd SP |
1329 | struct hfa384x_caplevel cap_act_pri_cfi; /* |
1330 | * pri f/w to controller | |
1331 | * interface | |
1332 | */ | |
71508ee4 | 1333 | |
5f7688dd SP |
1334 | struct hfa384x_caplevel cap_act_sta_cfi; /* |
1335 | * sta f/w to controller | |
1336 | * interface | |
1337 | */ | |
71508ee4 | 1338 | |
5f7688dd | 1339 | struct hfa384x_caplevel cap_act_sta_mfi; /* sta f/w to modem interface */ |
71508ee4 | 1340 | |
65f170c6 | 1341 | struct hfa384x_caplevel cap_act_ap_cfi; /* |
71508ee4 AG |
1342 | * ap f/w to controller |
1343 | * interface | |
1344 | */ | |
1345 | ||
65f170c6 | 1346 | struct hfa384x_caplevel cap_act_ap_mfi; /* ap f/w to modem interface */ |
00b3ed16 | 1347 | |
e573aaa4 | 1348 | u32 psusercount; /* Power save user count. */ |
b244edc6 | 1349 | struct hfa384x_comm_tallies_32 tallies; /* Communication tallies. */ |
e573aaa4 | 1350 | u8 comment[WLAN_COMMENT_MAX + 1]; /* User comment */ |
00b3ed16 GKH |
1351 | |
1352 | /* Channel Info request results (AP only) */ | |
1353 | struct { | |
e573aaa4 MM |
1354 | atomic_t done; |
1355 | u8 count; | |
c447358a | 1356 | struct hfa384x_ch_info_result results; |
00b3ed16 GKH |
1357 | } channel_info; |
1358 | ||
60f5f3fb | 1359 | struct hfa384x_inf_frame *scanresults; |
00b3ed16 | 1360 | |
c84b528c | 1361 | struct prism2sta_authlist authlist; /* Authenticated station list. */ |
4d10ece3 VH |
1362 | unsigned int accessmode; /* Access mode. */ |
1363 | struct prism2sta_accesslist allow; /* Allowed station list. */ | |
1364 | struct prism2sta_accesslist deny; /* Denied station list. */ | |
00b3ed16 | 1365 | |
5a2214e2 | 1366 | }; |
00b3ed16 | 1367 | |
5a2214e2 SP |
1368 | void hfa384x_create(struct hfa384x *hw, struct usb_device *usb); |
1369 | void hfa384x_destroy(struct hfa384x *hw); | |
00b3ed16 | 1370 | |
00b3ed16 | 1371 | int |
5a2214e2 SP |
1372 | hfa384x_corereset(struct hfa384x *hw, int holdtime, int settletime, int genesis); |
1373 | int hfa384x_drvr_disable(struct hfa384x *hw, u16 macport); | |
1374 | int hfa384x_drvr_enable(struct hfa384x *hw, u16 macport); | |
1375 | int hfa384x_drvr_flashdl_enable(struct hfa384x *hw); | |
1376 | int hfa384x_drvr_flashdl_disable(struct hfa384x *hw); | |
1377 | int hfa384x_drvr_flashdl_write(struct hfa384x *hw, u32 daddr, void *buf, u32 len); | |
1378 | int hfa384x_drvr_getconfig(struct hfa384x *hw, u16 rid, void *buf, u16 len); | |
1379 | int hfa384x_drvr_ramdl_enable(struct hfa384x *hw, u32 exeaddr); | |
1380 | int hfa384x_drvr_ramdl_disable(struct hfa384x *hw); | |
1381 | int hfa384x_drvr_ramdl_write(struct hfa384x *hw, u32 daddr, void *buf, u32 len); | |
1382 | int hfa384x_drvr_readpda(struct hfa384x *hw, void *buf, unsigned int len); | |
1383 | int hfa384x_drvr_setconfig(struct hfa384x *hw, u16 rid, void *buf, u16 len); | |
1384 | ||
1385 | static inline int hfa384x_drvr_getconfig16(struct hfa384x *hw, u16 rid, void *val) | |
00b3ed16 | 1386 | { |
e573aaa4 | 1387 | int result = 0; |
7489df36 | 1388 | |
aaad4303 | 1389 | result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u16)); |
e573aaa4 | 1390 | if (result == 0) |
e996024f | 1391 | le16_to_cpus(val); |
00b3ed16 GKH |
1392 | return result; |
1393 | } | |
1394 | ||
5a2214e2 | 1395 | static inline int hfa384x_drvr_setconfig16(struct hfa384x *hw, u16 rid, u16 val) |
00b3ed16 | 1396 | { |
e996024f | 1397 | __le16 value = cpu_to_le16(val); |
7489df36 | 1398 | |
00b3ed16 GKH |
1399 | return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value)); |
1400 | } | |
1401 | ||
00b3ed16 | 1402 | int |
5a2214e2 | 1403 | hfa384x_drvr_setconfig_async(struct hfa384x *hw, |
e573aaa4 MM |
1404 | u16 rid, |
1405 | void *buf, | |
1406 | u16 len, ctlx_usercb_t usercb, void *usercb_data); | |
00b3ed16 GKH |
1407 | |
1408 | static inline int | |
5a2214e2 | 1409 | hfa384x_drvr_setconfig16_async(struct hfa384x *hw, u16 rid, u16 val) |
00b3ed16 | 1410 | { |
a18ffdf4 | 1411 | __le16 value = cpu_to_le16(val); |
7489df36 | 1412 | |
00b3ed16 | 1413 | return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value), |
e573aaa4 | 1414 | NULL, NULL); |
00b3ed16 GKH |
1415 | } |
1416 | ||
5a2214e2 SP |
1417 | int hfa384x_drvr_start(struct hfa384x *hw); |
1418 | int hfa384x_drvr_stop(struct hfa384x *hw); | |
00b3ed16 | 1419 | int |
5a2214e2 | 1420 | hfa384x_drvr_txframe(struct hfa384x *hw, struct sk_buff *skb, |
f6b43c2e SD |
1421 | union p80211_hdr *p80211_hdr, |
1422 | struct p80211_metawep *p80211_wep); | |
c9573a8d | 1423 | void hfa384x_tx_timeout(struct wlandevice *wlandev); |
5dd8acc8 | 1424 | |
5a2214e2 SP |
1425 | int hfa384x_cmd_initialize(struct hfa384x *hw); |
1426 | int hfa384x_cmd_enable(struct hfa384x *hw, u16 macport); | |
1427 | int hfa384x_cmd_disable(struct hfa384x *hw, u16 macport); | |
1428 | int hfa384x_cmd_allocate(struct hfa384x *hw, u16 len); | |
1429 | int hfa384x_cmd_monitor(struct hfa384x *hw, u16 enable); | |
00b3ed16 | 1430 | int |
5a2214e2 | 1431 | hfa384x_cmd_download(struct hfa384x *hw, |
e573aaa4 | 1432 | u16 mode, u16 lowaddr, u16 highaddr, u16 codelen); |
00b3ed16 | 1433 | |
71508ee4 | 1434 | #endif /*__KERNEL__ */ |
00b3ed16 | 1435 | |
71508ee4 | 1436 | #endif /*_HFA384x_H */ |