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