100b3ed16SGreg Kroah-Hartman /* hfa384x.h 200b3ed16SGreg Kroah-Hartman * 300b3ed16SGreg Kroah-Hartman * Defines the constants and data structures for the hfa384x 400b3ed16SGreg Kroah-Hartman * 500b3ed16SGreg Kroah-Hartman * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. 600b3ed16SGreg Kroah-Hartman * -------------------------------------------------------------------- 700b3ed16SGreg Kroah-Hartman * 800b3ed16SGreg Kroah-Hartman * linux-wlan 900b3ed16SGreg Kroah-Hartman * 1000b3ed16SGreg Kroah-Hartman * The contents of this file are subject to the Mozilla Public 1100b3ed16SGreg Kroah-Hartman * License Version 1.1 (the "License"); you may not use this file 1200b3ed16SGreg Kroah-Hartman * except in compliance with the License. You may obtain a copy of 1300b3ed16SGreg Kroah-Hartman * the License at http://www.mozilla.org/MPL/ 1400b3ed16SGreg Kroah-Hartman * 1500b3ed16SGreg Kroah-Hartman * Software distributed under the License is distributed on an "AS 1600b3ed16SGreg Kroah-Hartman * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 1700b3ed16SGreg Kroah-Hartman * implied. See the License for the specific language governing 1800b3ed16SGreg Kroah-Hartman * rights and limitations under the License. 1900b3ed16SGreg Kroah-Hartman * 2000b3ed16SGreg Kroah-Hartman * Alternatively, the contents of this file may be used under the 2100b3ed16SGreg Kroah-Hartman * terms of the GNU Public License version 2 (the "GPL"), in which 2200b3ed16SGreg Kroah-Hartman * case the provisions of the GPL are applicable instead of the 2300b3ed16SGreg Kroah-Hartman * above. If you wish to allow the use of your version of this file 2400b3ed16SGreg Kroah-Hartman * only under the terms of the GPL and not to allow others to use 2500b3ed16SGreg Kroah-Hartman * your version of this file under the MPL, indicate your decision 2600b3ed16SGreg Kroah-Hartman * by deleting the provisions above and replace them with the notice 2700b3ed16SGreg Kroah-Hartman * and other provisions required by the GPL. If you do not delete 2800b3ed16SGreg Kroah-Hartman * the provisions above, a recipient may use your version of this 2900b3ed16SGreg Kroah-Hartman * file under either the MPL or the GPL. 3000b3ed16SGreg Kroah-Hartman * 3100b3ed16SGreg Kroah-Hartman * -------------------------------------------------------------------- 3200b3ed16SGreg Kroah-Hartman * 3300b3ed16SGreg Kroah-Hartman * Inquiries regarding the linux-wlan Open Source project can be 3400b3ed16SGreg Kroah-Hartman * made directly to: 3500b3ed16SGreg Kroah-Hartman * 3600b3ed16SGreg Kroah-Hartman * AbsoluteValue Systems Inc. 3700b3ed16SGreg Kroah-Hartman * info@linux-wlan.com 3800b3ed16SGreg Kroah-Hartman * http://www.linux-wlan.com 3900b3ed16SGreg Kroah-Hartman * 4000b3ed16SGreg Kroah-Hartman * -------------------------------------------------------------------- 4100b3ed16SGreg Kroah-Hartman * 4200b3ed16SGreg Kroah-Hartman * Portions of the development of this software were funded by 4300b3ed16SGreg Kroah-Hartman * Intersil Corporation as part of PRISM(R) chipset product development. 4400b3ed16SGreg Kroah-Hartman * 4500b3ed16SGreg Kroah-Hartman * -------------------------------------------------------------------- 4600b3ed16SGreg Kroah-Hartman * 4700b3ed16SGreg Kroah-Hartman * [Implementation and usage notes] 4800b3ed16SGreg Kroah-Hartman * 4900b3ed16SGreg Kroah-Hartman * [References] 5000b3ed16SGreg Kroah-Hartman * CW10 Programmer's Manual v1.5 5100b3ed16SGreg Kroah-Hartman * IEEE 802.11 D10.0 5200b3ed16SGreg Kroah-Hartman * 5300b3ed16SGreg Kroah-Hartman * -------------------------------------------------------------------- 5400b3ed16SGreg Kroah-Hartman */ 5500b3ed16SGreg Kroah-Hartman 5600b3ed16SGreg Kroah-Hartman #ifndef _HFA384x_H 5700b3ed16SGreg Kroah-Hartman #define _HFA384x_H 5800b3ed16SGreg Kroah-Hartman 5900b3ed16SGreg Kroah-Hartman #define HFA384x_FIRMWARE_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c)) 6000b3ed16SGreg Kroah-Hartman 6128b17a4bSMoritz Muehlenhoff #include <linux/if_ether.h> 622e380275SKumar Amit Mehta #include <linux/usb.h> 6328b17a4bSMoritz Muehlenhoff 6400b3ed16SGreg Kroah-Hartman /*--- Mins & Maxs -----------------------------------*/ 65aaad4303SSolomon Peachy #define HFA384x_PORTID_MAX ((u16)7) 66aaad4303SSolomon Peachy #define HFA384x_NUMPORTS_MAX ((u16)(HFA384x_PORTID_MAX+1)) 67aaad4303SSolomon Peachy #define HFA384x_PDR_LEN_MAX ((u16)512) /* in bytes, from EK */ 6876e3e7c4SKarl Relton #define HFA384x_PDA_RECS_MAX ((u16)200) /* a guess */ 69aaad4303SSolomon Peachy #define HFA384x_PDA_LEN_MAX ((u16)1024) /* in bytes, from EK*/ 70aaad4303SSolomon Peachy #define HFA384x_SCANRESULT_MAX ((u16)31) 71aaad4303SSolomon Peachy #define HFA384x_HSCANRESULT_MAX ((u16)31) 72aaad4303SSolomon Peachy #define HFA384x_CHINFORESULT_MAX ((u16)16) 7300b3ed16SGreg Kroah-Hartman #define HFA384x_RID_GUESSING_MAXLEN 2048 /* I'm not really sure */ 7400b3ed16SGreg Kroah-Hartman #define HFA384x_RIDDATA_MAXLEN HFA384x_RID_GUESSING_MAXLEN 7500b3ed16SGreg Kroah-Hartman #define HFA384x_USB_RWMEM_MAXLEN 2048 7600b3ed16SGreg Kroah-Hartman 7700b3ed16SGreg Kroah-Hartman /*--- Support Constants -----------------------------*/ 78aaad4303SSolomon Peachy #define HFA384x_PORTTYPE_IBSS ((u16)0) 79aaad4303SSolomon Peachy #define HFA384x_PORTTYPE_BSS ((u16)1) 80aaad4303SSolomon Peachy #define HFA384x_PORTTYPE_PSUEDOIBSS ((u16)3) 817f6e0e44SMoritz Muehlenhoff #define HFA384x_WEPFLAGS_PRIVINVOKED ((u16)BIT(0)) 827f6e0e44SMoritz Muehlenhoff #define HFA384x_WEPFLAGS_EXCLUDE ((u16)BIT(1)) 837f6e0e44SMoritz Muehlenhoff #define HFA384x_WEPFLAGS_DISABLE_TXCRYPT ((u16)BIT(4)) 847f6e0e44SMoritz Muehlenhoff #define HFA384x_WEPFLAGS_DISABLE_RXCRYPT ((u16)BIT(7)) 85aaad4303SSolomon Peachy #define HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM ((u16)3) 86aaad4303SSolomon Peachy #define HFA384x_PORTSTATUS_DISABLED ((u16)1) 87aaad4303SSolomon Peachy #define HFA384x_RATEBIT_1 ((u16)1) 88aaad4303SSolomon Peachy #define HFA384x_RATEBIT_2 ((u16)2) 89aaad4303SSolomon Peachy #define HFA384x_RATEBIT_5dot5 ((u16)4) 90aaad4303SSolomon Peachy #define HFA384x_RATEBIT_11 ((u16)8) 9100b3ed16SGreg Kroah-Hartman 9200b3ed16SGreg Kroah-Hartman /*--- MAC Internal memory constants and macros ------*/ 9300b3ed16SGreg Kroah-Hartman /* masks and macros used to manipulate MAC internal memory addresses. */ 9400b3ed16SGreg Kroah-Hartman /* MAC internal memory addresses are 23 bit quantities. The MAC uses 9500b3ed16SGreg Kroah-Hartman * a paged address space where the upper 16 bits are the page number 9600b3ed16SGreg Kroah-Hartman * and the lower 7 bits are the offset. There are various Host API 9700b3ed16SGreg Kroah-Hartman * elements that require two 16-bit quantities to specify a MAC 9800b3ed16SGreg Kroah-Hartman * internal memory address. Unfortunately, some of the API's use a 9900b3ed16SGreg Kroah-Hartman * page/offset format where the offset value is JUST the lower seven 10000b3ed16SGreg Kroah-Hartman * bits and the page is the remaining 16 bits. Some of the API's 10100b3ed16SGreg Kroah-Hartman * assume that the 23 bit address has been split at the 16th bit. We 10200b3ed16SGreg Kroah-Hartman * refer to these two formats as AUX format and CMD format. The 10300b3ed16SGreg Kroah-Hartman * macros below help handle some of this. 10400b3ed16SGreg Kroah-Hartman */ 10500b3ed16SGreg Kroah-Hartman 10600b3ed16SGreg Kroah-Hartman /* Mask bits for discarding unwanted pieces in a flat address */ 10700b3ed16SGreg Kroah-Hartman #define HFA384x_ADDR_FLAT_AUX_PAGE_MASK (0x007fff80) 10800b3ed16SGreg Kroah-Hartman #define HFA384x_ADDR_FLAT_AUX_OFF_MASK (0x0000007f) 10900b3ed16SGreg Kroah-Hartman #define HFA384x_ADDR_FLAT_CMD_PAGE_MASK (0xffff0000) 11000b3ed16SGreg Kroah-Hartman #define HFA384x_ADDR_FLAT_CMD_OFF_MASK (0x0000ffff) 11100b3ed16SGreg Kroah-Hartman 112e573aaa4SMoritz Muehlenhoff /* Mask bits for discarding unwanted pieces in AUX format 113e573aaa4SMoritz Muehlenhoff 16-bit address parts */ 11400b3ed16SGreg Kroah-Hartman #define HFA384x_ADDR_AUX_PAGE_MASK (0xffff) 11500b3ed16SGreg Kroah-Hartman #define HFA384x_ADDR_AUX_OFF_MASK (0x007f) 11600b3ed16SGreg Kroah-Hartman 11700b3ed16SGreg Kroah-Hartman /* Make a 32-bit flat address from AUX format 16-bit page and offset */ 11800b3ed16SGreg Kroah-Hartman #define HFA384x_ADDR_AUX_MKFLAT(p, o) \ 1195dd8acc8SSvenne Krap ((((u32)(((u16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) << 7) | \ 1205dd8acc8SSvenne Krap ((u32)(((u16)(o))&HFA384x_ADDR_AUX_OFF_MASK))) 12100b3ed16SGreg Kroah-Hartman 12200b3ed16SGreg Kroah-Hartman /* Make CMD format offset and page from a 32-bit flat address */ 12300b3ed16SGreg Kroah-Hartman #define HFA384x_ADDR_CMD_MKPAGE(f) \ 124aaad4303SSolomon Peachy ((u16)((((u32)(f))&HFA384x_ADDR_FLAT_CMD_PAGE_MASK)>>16)) 12500b3ed16SGreg Kroah-Hartman #define HFA384x_ADDR_CMD_MKOFF(f) \ 126aaad4303SSolomon Peachy ((u16)(((u32)(f))&HFA384x_ADDR_FLAT_CMD_OFF_MASK)) 12700b3ed16SGreg Kroah-Hartman 12800b3ed16SGreg Kroah-Hartman /*--- Controller Memory addresses -------------------*/ 12900b3ed16SGreg Kroah-Hartman #define HFA3842_PDA_BASE (0x007f0000UL) 13000b3ed16SGreg Kroah-Hartman #define HFA3841_PDA_BASE (0x003f0000UL) 13100b3ed16SGreg Kroah-Hartman #define HFA3841_PDA_BOGUS_BASE (0x00390000UL) 13200b3ed16SGreg Kroah-Hartman 13300b3ed16SGreg Kroah-Hartman /*--- Driver Download states -----------------------*/ 13400b3ed16SGreg Kroah-Hartman #define HFA384x_DLSTATE_DISABLED 0 13500b3ed16SGreg Kroah-Hartman #define HFA384x_DLSTATE_RAMENABLED 1 13600b3ed16SGreg Kroah-Hartman #define HFA384x_DLSTATE_FLASHENABLED 2 13700b3ed16SGreg Kroah-Hartman 13800b3ed16SGreg Kroah-Hartman /*--- Register Field Masks --------------------------*/ 13971508ee4SAlessandro Ghedini #define HFA384x_CMD_AINFO ((u16)(BIT(14) | BIT(13) \ 14071508ee4SAlessandro Ghedini | BIT(12) | BIT(11) \ 14171508ee4SAlessandro Ghedini | BIT(10) | BIT(9) \ 14271508ee4SAlessandro Ghedini | BIT(8))) 14371508ee4SAlessandro Ghedini #define HFA384x_CMD_MACPORT ((u16)(BIT(10) | BIT(9) | \ 14471508ee4SAlessandro Ghedini BIT(8))) 1457f6e0e44SMoritz Muehlenhoff #define HFA384x_CMD_PROGMODE ((u16)(BIT(9) | BIT(8))) 14671508ee4SAlessandro Ghedini #define HFA384x_CMD_CMDCODE ((u16)(BIT(5) | BIT(4) | \ 14771508ee4SAlessandro Ghedini BIT(3) | BIT(2) | \ 14871508ee4SAlessandro Ghedini BIT(1) | BIT(0))) 14900b3ed16SGreg Kroah-Hartman 15071508ee4SAlessandro Ghedini #define HFA384x_STATUS_RESULT ((u16)(BIT(14) | BIT(13) \ 15171508ee4SAlessandro Ghedini | BIT(12) | BIT(11) \ 15271508ee4SAlessandro Ghedini | BIT(10) | BIT(9) \ 15371508ee4SAlessandro Ghedini | BIT(8))) 15400b3ed16SGreg Kroah-Hartman 15500b3ed16SGreg Kroah-Hartman /*--- Command Code Constants --------------------------*/ 15600b3ed16SGreg Kroah-Hartman /*--- Controller Commands --------------------------*/ 157aaad4303SSolomon Peachy #define HFA384x_CMDCODE_INIT ((u16)0x00) 158aaad4303SSolomon Peachy #define HFA384x_CMDCODE_ENABLE ((u16)0x01) 159aaad4303SSolomon Peachy #define HFA384x_CMDCODE_DISABLE ((u16)0x02) 16000b3ed16SGreg Kroah-Hartman 16100b3ed16SGreg Kroah-Hartman /*--- Regulate Commands --------------------------*/ 162aaad4303SSolomon Peachy #define HFA384x_CMDCODE_INQ ((u16)0x11) 16300b3ed16SGreg Kroah-Hartman 16400b3ed16SGreg Kroah-Hartman /*--- Configure Commands --------------------------*/ 165aaad4303SSolomon Peachy #define HFA384x_CMDCODE_DOWNLD ((u16)0x22) 16600b3ed16SGreg Kroah-Hartman 16700b3ed16SGreg Kroah-Hartman /*--- Debugging Commands -----------------------------*/ 168aaad4303SSolomon Peachy #define HFA384x_CMDCODE_MONITOR ((u16)(0x38)) 169aaad4303SSolomon Peachy #define HFA384x_MONITOR_ENABLE ((u16)(0x0b)) 170aaad4303SSolomon Peachy #define HFA384x_MONITOR_DISABLE ((u16)(0x0f)) 17100b3ed16SGreg Kroah-Hartman 17200b3ed16SGreg Kroah-Hartman /*--- Result Codes --------------------------*/ 173aaad4303SSolomon Peachy #define HFA384x_CMD_ERR ((u16)(0x7F)) 17400b3ed16SGreg Kroah-Hartman 17500b3ed16SGreg Kroah-Hartman /*--- Programming Modes -------------------------- 17600b3ed16SGreg Kroah-Hartman MODE 0: Disable programming 17700b3ed16SGreg Kroah-Hartman MODE 1: Enable volatile memory programming 17800b3ed16SGreg Kroah-Hartman MODE 2: Enable non-volatile memory programming 17900b3ed16SGreg Kroah-Hartman MODE 3: Program non-volatile memory section 18000b3ed16SGreg Kroah-Hartman --------------------------------------------------*/ 181aaad4303SSolomon Peachy #define HFA384x_PROGMODE_DISABLE ((u16)0x00) 182aaad4303SSolomon Peachy #define HFA384x_PROGMODE_RAM ((u16)0x01) 183aaad4303SSolomon Peachy #define HFA384x_PROGMODE_NV ((u16)0x02) 184aaad4303SSolomon Peachy #define HFA384x_PROGMODE_NVWRITE ((u16)0x03) 18500b3ed16SGreg Kroah-Hartman 18600b3ed16SGreg Kroah-Hartman /*--- Record ID Constants --------------------------*/ 18700b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 18800b3ed16SGreg Kroah-Hartman Configuration RIDs: Network Parameters, Static Configuration Entities 18900b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 190aaad4303SSolomon Peachy #define HFA384x_RID_CNFPORTTYPE ((u16)0xFC00) 191aaad4303SSolomon Peachy #define HFA384x_RID_CNFOWNMACADDR ((u16)0xFC01) 192aaad4303SSolomon Peachy #define HFA384x_RID_CNFDESIREDSSID ((u16)0xFC02) 193aaad4303SSolomon Peachy #define HFA384x_RID_CNFOWNCHANNEL ((u16)0xFC03) 194aaad4303SSolomon Peachy #define HFA384x_RID_CNFOWNSSID ((u16)0xFC04) 195aaad4303SSolomon Peachy #define HFA384x_RID_CNFMAXDATALEN ((u16)0xFC07) 19600b3ed16SGreg Kroah-Hartman 19700b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 19800b3ed16SGreg Kroah-Hartman Configuration RID lengths: Network Params, Static Config Entities 19900b3ed16SGreg Kroah-Hartman This is the length of JUST the DATA part of the RID (does not 20000b3ed16SGreg Kroah-Hartman include the len or code fields) 20100b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 202aaad4303SSolomon Peachy #define HFA384x_RID_CNFOWNMACADDR_LEN ((u16)6) 203aaad4303SSolomon Peachy #define HFA384x_RID_CNFDESIREDSSID_LEN ((u16)34) 204aaad4303SSolomon Peachy #define HFA384x_RID_CNFOWNSSID_LEN ((u16)34) 20500b3ed16SGreg Kroah-Hartman 20600b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 20700b3ed16SGreg Kroah-Hartman Configuration RIDs: Network Parameters, Dynamic Configuration Entities 20800b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 209aaad4303SSolomon Peachy #define HFA384x_RID_CREATEIBSS ((u16)0xFC81) 210aaad4303SSolomon Peachy #define HFA384x_RID_FRAGTHRESH ((u16)0xFC82) 211aaad4303SSolomon Peachy #define HFA384x_RID_RTSTHRESH ((u16)0xFC83) 212aaad4303SSolomon Peachy #define HFA384x_RID_TXRATECNTL ((u16)0xFC84) 213aaad4303SSolomon Peachy #define HFA384x_RID_PROMISCMODE ((u16)0xFC85) 21400b3ed16SGreg Kroah-Hartman 21500b3ed16SGreg Kroah-Hartman /*---------------------------------------------------------------------- 21600b3ed16SGreg Kroah-Hartman Information RIDs: NIC Information 21700b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 218aaad4303SSolomon Peachy #define HFA384x_RID_MAXLOADTIME ((u16)0xFD00) 219aaad4303SSolomon Peachy #define HFA384x_RID_DOWNLOADBUFFER ((u16)0xFD01) 220aaad4303SSolomon Peachy #define HFA384x_RID_PRIIDENTITY ((u16)0xFD02) 221aaad4303SSolomon Peachy #define HFA384x_RID_PRISUPRANGE ((u16)0xFD03) 222aaad4303SSolomon Peachy #define HFA384x_RID_PRI_CFIACTRANGES ((u16)0xFD04) 223aaad4303SSolomon Peachy #define HFA384x_RID_NICSERIALNUMBER ((u16)0xFD0A) 224aaad4303SSolomon Peachy #define HFA384x_RID_NICIDENTITY ((u16)0xFD0B) 225aaad4303SSolomon Peachy #define HFA384x_RID_MFISUPRANGE ((u16)0xFD0C) 226aaad4303SSolomon Peachy #define HFA384x_RID_CFISUPRANGE ((u16)0xFD0D) 227aaad4303SSolomon Peachy #define HFA384x_RID_STAIDENTITY ((u16)0xFD20) 228aaad4303SSolomon Peachy #define HFA384x_RID_STASUPRANGE ((u16)0xFD21) 229aaad4303SSolomon Peachy #define HFA384x_RID_STA_MFIACTRANGES ((u16)0xFD22) 230aaad4303SSolomon Peachy #define HFA384x_RID_STA_CFIACTRANGES ((u16)0xFD23) 23100b3ed16SGreg Kroah-Hartman 23200b3ed16SGreg Kroah-Hartman /*---------------------------------------------------------------------- 23300b3ed16SGreg Kroah-Hartman Information RID Lengths: NIC Information 23400b3ed16SGreg Kroah-Hartman This is the length of JUST the DATA part of the RID (does not 23500b3ed16SGreg Kroah-Hartman include the len or code fields) 23600b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 237aaad4303SSolomon Peachy #define HFA384x_RID_NICSERIALNUMBER_LEN ((u16)12) 23800b3ed16SGreg Kroah-Hartman 23900b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 24000b3ed16SGreg Kroah-Hartman Information RIDs: MAC Information 24100b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 242aaad4303SSolomon Peachy #define HFA384x_RID_PORTSTATUS ((u16)0xFD40) 243aaad4303SSolomon Peachy #define HFA384x_RID_CURRENTSSID ((u16)0xFD41) 244aaad4303SSolomon Peachy #define HFA384x_RID_CURRENTBSSID ((u16)0xFD42) 245aaad4303SSolomon Peachy #define HFA384x_RID_CURRENTTXRATE ((u16)0xFD44) 246aaad4303SSolomon Peachy #define HFA384x_RID_SHORTRETRYLIMIT ((u16)0xFD48) 247aaad4303SSolomon Peachy #define HFA384x_RID_LONGRETRYLIMIT ((u16)0xFD49) 248aaad4303SSolomon Peachy #define HFA384x_RID_MAXTXLIFETIME ((u16)0xFD4A) 249aaad4303SSolomon Peachy #define HFA384x_RID_PRIVACYOPTIMP ((u16)0xFD4F) 250aaad4303SSolomon Peachy #define HFA384x_RID_DBMCOMMSQUALITY ((u16)0xFD51) 25100b3ed16SGreg Kroah-Hartman 25200b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 25300b3ed16SGreg Kroah-Hartman Information RID Lengths: MAC Information 25400b3ed16SGreg Kroah-Hartman This is the length of JUST the DATA part of the RID (does not 25500b3ed16SGreg Kroah-Hartman include the len or code fields) 25600b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 25771508ee4SAlessandro Ghedini #define HFA384x_RID_DBMCOMMSQUALITY_LEN \ 25871508ee4SAlessandro Ghedini ((u16) sizeof(hfa384x_dbmcommsquality_t)) 25971508ee4SAlessandro Ghedini #define HFA384x_RID_JOINREQUEST_LEN \ 26071508ee4SAlessandro Ghedini ((u16)sizeof(hfa384x_JoinRequest_data_t)) 26140a67411SMoritz Muehlenhoff 26200b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 26300b3ed16SGreg Kroah-Hartman Information RIDs: Modem Information 26400b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 265aaad4303SSolomon Peachy #define HFA384x_RID_CURRENTCHANNEL ((u16)0xFDC1) 26600b3ed16SGreg Kroah-Hartman 26700b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 26800b3ed16SGreg Kroah-Hartman API ENHANCEMENTS (NOT ALREADY IMPLEMENTED) 26900b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 270aaad4303SSolomon Peachy #define HFA384x_RID_CNFWEPDEFAULTKEYID ((u16)0xFC23) 271aaad4303SSolomon Peachy #define HFA384x_RID_CNFWEPDEFAULTKEY0 ((u16)0xFC24) 272aaad4303SSolomon Peachy #define HFA384x_RID_CNFWEPDEFAULTKEY1 ((u16)0xFC25) 273aaad4303SSolomon Peachy #define HFA384x_RID_CNFWEPDEFAULTKEY2 ((u16)0xFC26) 274aaad4303SSolomon Peachy #define HFA384x_RID_CNFWEPDEFAULTKEY3 ((u16)0xFC27) 275aaad4303SSolomon Peachy #define HFA384x_RID_CNFWEPFLAGS ((u16)0xFC28) 276aaad4303SSolomon Peachy #define HFA384x_RID_CNFAUTHENTICATION ((u16)0xFC2A) 277aaad4303SSolomon Peachy #define HFA384x_RID_CNFROAMINGMODE ((u16)0xFC2D) 278aaad4303SSolomon Peachy #define HFA384x_RID_CNFAPBCNint ((u16)0xFC33) 279e573aaa4SMoritz Muehlenhoff #define HFA384x_RID_CNFDBMADJUST ((u16)0xFC46) 280e573aaa4SMoritz Muehlenhoff #define HFA384x_RID_CNFWPADATA ((u16)0xFC48) 281aaad4303SSolomon Peachy #define HFA384x_RID_CNFBASICRATES ((u16)0xFCB3) 282aaad4303SSolomon Peachy #define HFA384x_RID_CNFSUPPRATES ((u16)0xFCB4) 283e573aaa4SMoritz Muehlenhoff #define HFA384x_RID_CNFPASSIVESCANCTRL ((u16)0xFCBA) 284e573aaa4SMoritz Muehlenhoff #define HFA384x_RID_TXPOWERMAX ((u16)0xFCBE) 285aaad4303SSolomon Peachy #define HFA384x_RID_JOINREQUEST ((u16)0xFCE2) 286aaad4303SSolomon Peachy #define HFA384x_RID_AUTHENTICATESTA ((u16)0xFCE3) 287e573aaa4SMoritz Muehlenhoff #define HFA384x_RID_HOSTSCAN ((u16)0xFCE5) 28800b3ed16SGreg Kroah-Hartman 289aaad4303SSolomon Peachy #define HFA384x_RID_CNFWEPDEFAULTKEY_LEN ((u16)6) 290aaad4303SSolomon Peachy #define HFA384x_RID_CNFWEP128DEFAULTKEY_LEN ((u16)14) 29140a67411SMoritz Muehlenhoff 29200b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 29300b3ed16SGreg Kroah-Hartman PD Record codes 29400b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 295aaad4303SSolomon Peachy #define HFA384x_PDR_PCB_PARTNUM ((u16)0x0001) 296aaad4303SSolomon Peachy #define HFA384x_PDR_PDAVER ((u16)0x0002) 297aaad4303SSolomon Peachy #define HFA384x_PDR_NIC_SERIAL ((u16)0x0003) 298aaad4303SSolomon Peachy #define HFA384x_PDR_MKK_MEASUREMENTS ((u16)0x0004) 299aaad4303SSolomon Peachy #define HFA384x_PDR_NIC_RAMSIZE ((u16)0x0005) 300aaad4303SSolomon Peachy #define HFA384x_PDR_MFISUPRANGE ((u16)0x0006) 301aaad4303SSolomon Peachy #define HFA384x_PDR_CFISUPRANGE ((u16)0x0007) 302aaad4303SSolomon Peachy #define HFA384x_PDR_NICID ((u16)0x0008) 303aaad4303SSolomon Peachy #define HFA384x_PDR_MAC_ADDRESS ((u16)0x0101) 304aaad4303SSolomon Peachy #define HFA384x_PDR_REGDOMAIN ((u16)0x0103) 305aaad4303SSolomon Peachy #define HFA384x_PDR_ALLOWED_CHANNEL ((u16)0x0104) 306aaad4303SSolomon Peachy #define HFA384x_PDR_DEFAULT_CHANNEL ((u16)0x0105) 307aaad4303SSolomon Peachy #define HFA384x_PDR_TEMPTYPE ((u16)0x0107) 308aaad4303SSolomon Peachy #define HFA384x_PDR_IFR_SETTING ((u16)0x0200) 309aaad4303SSolomon Peachy #define HFA384x_PDR_RFR_SETTING ((u16)0x0201) 310aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_BASELINE ((u16)0x0202) 311aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_SHADOW ((u16)0x0203) 312aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_IFRF ((u16)0x0204) 313aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_CHCALSP ((u16)0x0300) 314aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_CHCALI ((u16)0x0301) 315aaad4303SSolomon Peachy #define HFA384x_PDR_MAX_TX_POWER ((u16)0x0302) 316aaad4303SSolomon Peachy #define HFA384x_PDR_MASTER_CHAN_LIST ((u16)0x0303) 317aaad4303SSolomon Peachy #define HFA384x_PDR_3842_NIC_CONFIG ((u16)0x0400) 318aaad4303SSolomon Peachy #define HFA384x_PDR_USB_ID ((u16)0x0401) 319aaad4303SSolomon Peachy #define HFA384x_PDR_PCI_ID ((u16)0x0402) 320aaad4303SSolomon Peachy #define HFA384x_PDR_PCI_IFCONF ((u16)0x0403) 321aaad4303SSolomon Peachy #define HFA384x_PDR_PCI_PMCONF ((u16)0x0404) 322aaad4303SSolomon Peachy #define HFA384x_PDR_RFENRGY ((u16)0x0406) 323aaad4303SSolomon Peachy #define HFA384x_PDR_USB_POWER_TYPE ((u16)0x0407) 324aaad4303SSolomon Peachy #define HFA384x_PDR_USB_MAX_POWER ((u16)0x0409) 325aaad4303SSolomon Peachy #define HFA384x_PDR_USB_MANUFACTURER ((u16)0x0410) 326aaad4303SSolomon Peachy #define HFA384x_PDR_USB_PRODUCT ((u16)0x0411) 327aaad4303SSolomon Peachy #define HFA384x_PDR_ANT_DIVERSITY ((u16)0x0412) 328aaad4303SSolomon Peachy #define HFA384x_PDR_HFO_DELAY ((u16)0x0413) 329aaad4303SSolomon Peachy #define HFA384x_PDR_SCALE_THRESH ((u16)0x0414) 33000b3ed16SGreg Kroah-Hartman 331aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_MANF_TESTSP ((u16)0x0900) 332aaad4303SSolomon Peachy #define HFA384x_PDR_HFA3861_MANF_TESTI ((u16)0x0901) 333aaad4303SSolomon Peachy #define HFA384x_PDR_END_OF_PDA ((u16)0x0000) 33400b3ed16SGreg Kroah-Hartman 33500b3ed16SGreg Kroah-Hartman /*--- Register Test/Get/Set Field macros ------------------------*/ 33600b3ed16SGreg Kroah-Hartman 337aaad4303SSolomon Peachy #define HFA384x_CMD_AINFO_SET(value) ((u16)((u16)(value) << 8)) 33871508ee4SAlessandro Ghedini #define HFA384x_CMD_MACPORT_SET(value) \ 33971508ee4SAlessandro Ghedini ((u16)HFA384x_CMD_AINFO_SET(value)) 34071508ee4SAlessandro Ghedini #define HFA384x_CMD_PROGMODE_SET(value) \ 34171508ee4SAlessandro Ghedini ((u16)HFA384x_CMD_AINFO_SET((u16)value)) 342aaad4303SSolomon Peachy #define HFA384x_CMD_CMDCODE_SET(value) ((u16)(value)) 34300b3ed16SGreg Kroah-Hartman 344aaad4303SSolomon Peachy #define HFA384x_STATUS_RESULT_SET(value) (((u16)(value)) << 8) 34500b3ed16SGreg Kroah-Hartman 34600b3ed16SGreg Kroah-Hartman /* Host Maintained State Info */ 34700b3ed16SGreg Kroah-Hartman #define HFA384x_STATE_PREINIT 0 34800b3ed16SGreg Kroah-Hartman #define HFA384x_STATE_INIT 1 34900b3ed16SGreg Kroah-Hartman #define HFA384x_STATE_RUNNING 2 35000b3ed16SGreg Kroah-Hartman 35100b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------*/ 35200b3ed16SGreg Kroah-Hartman /* Commonly used basic types */ 353b2119911SHimangi Saraogi struct hfa384x_bytestr { 354aaad4303SSolomon Peachy u16 len; 355aaad4303SSolomon Peachy u8 data[0]; 356b2119911SHimangi Saraogi } __packed; 35700b3ed16SGreg Kroah-Hartman 358e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_bytestr32 { 359aaad4303SSolomon Peachy u16 len; 360aaad4303SSolomon Peachy u8 data[32]; 3617d3864d1SBas van den Berg } __packed hfa384x_bytestr32_t; 36200b3ed16SGreg Kroah-Hartman 36300b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 36400b3ed16SGreg Kroah-Hartman Configuration Record Structures: 36500b3ed16SGreg Kroah-Hartman Network Parameters, Static Configuration Entities 36600b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 36700b3ed16SGreg Kroah-Hartman 36800b3ed16SGreg Kroah-Hartman /*-- Hardware/Firmware Component Information ----------*/ 369e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_compident { 370aaad4303SSolomon Peachy u16 id; 371aaad4303SSolomon Peachy u16 variant; 372aaad4303SSolomon Peachy u16 major; 373aaad4303SSolomon Peachy u16 minor; 3747d3864d1SBas van den Berg } __packed hfa384x_compident_t; 37500b3ed16SGreg Kroah-Hartman 376e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_caplevel { 377aaad4303SSolomon Peachy u16 role; 378aaad4303SSolomon Peachy u16 id; 379aaad4303SSolomon Peachy u16 variant; 380aaad4303SSolomon Peachy u16 bottom; 381aaad4303SSolomon Peachy u16 top; 3827d3864d1SBas van den Berg } __packed hfa384x_caplevel_t; 38300b3ed16SGreg Kroah-Hartman 38400b3ed16SGreg Kroah-Hartman /*-- Configuration Record: cnfAuthentication --*/ 38500b3ed16SGreg Kroah-Hartman #define HFA384x_CNFAUTHENTICATION_OPENSYSTEM 0x0001 38600b3ed16SGreg Kroah-Hartman #define HFA384x_CNFAUTHENTICATION_SHAREDKEY 0x0002 38700b3ed16SGreg Kroah-Hartman #define HFA384x_CNFAUTHENTICATION_LEAP 0x0004 38800b3ed16SGreg Kroah-Hartman 38900b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 39000b3ed16SGreg Kroah-Hartman Configuration Record Structures: 39100b3ed16SGreg Kroah-Hartman Network Parameters, Dynamic Configuration Entities 39200b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 39300b3ed16SGreg Kroah-Hartman 39400b3ed16SGreg Kroah-Hartman #define HFA384x_CREATEIBSS_JOINCREATEIBSS 0 39500b3ed16SGreg Kroah-Hartman 39600b3ed16SGreg Kroah-Hartman /*-- Configuration Record: HostScanRequest (data portion only) --*/ 397e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_HostScanRequest_data { 398aaad4303SSolomon Peachy u16 channelList; 399aaad4303SSolomon Peachy u16 txRate; 40000b3ed16SGreg Kroah-Hartman hfa384x_bytestr32_t ssid; 4017d3864d1SBas van den Berg } __packed hfa384x_HostScanRequest_data_t; 40200b3ed16SGreg Kroah-Hartman 40300b3ed16SGreg Kroah-Hartman /*-- Configuration Record: JoinRequest (data portion only) --*/ 404e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_JoinRequest_data { 405aaad4303SSolomon Peachy u8 bssid[WLAN_BSSID_LEN]; 406aaad4303SSolomon Peachy u16 channel; 4077d3864d1SBas van den Berg } __packed hfa384x_JoinRequest_data_t; 40800b3ed16SGreg Kroah-Hartman 40900b3ed16SGreg Kroah-Hartman /*-- Configuration Record: authenticateStation (data portion only) --*/ 410e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_authenticateStation_data { 41128b17a4bSMoritz Muehlenhoff u8 address[ETH_ALEN]; 412aaad4303SSolomon Peachy u16 status; 413aaad4303SSolomon Peachy u16 algorithm; 4147d3864d1SBas van den Berg } __packed hfa384x_authenticateStation_data_t; 41500b3ed16SGreg Kroah-Hartman 41600b3ed16SGreg Kroah-Hartman /*-- Configuration Record: WPAData (data portion only) --*/ 417e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_WPAData { 418aaad4303SSolomon Peachy u16 datalen; 4195dd8acc8SSvenne Krap u8 data[0]; /* max 80 */ 4207d3864d1SBas van den Berg } __packed hfa384x_WPAData_t; 42100b3ed16SGreg Kroah-Hartman 42200b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 42300b3ed16SGreg Kroah-Hartman Information Record Structures: NIC Information 42400b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 42500b3ed16SGreg Kroah-Hartman 42600b3ed16SGreg Kroah-Hartman /*-- Information Record: DownLoadBuffer --*/ 42700b3ed16SGreg Kroah-Hartman /* NOTE: The page and offset are in AUX format */ 428e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_downloadbuffer { 429aaad4303SSolomon Peachy u16 page; 430aaad4303SSolomon Peachy u16 offset; 431aaad4303SSolomon Peachy u16 len; 4327d3864d1SBas van den Berg } __packed hfa384x_downloadbuffer_t; 43300b3ed16SGreg Kroah-Hartman 43400b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 43500b3ed16SGreg Kroah-Hartman Information Record Structures: NIC Information 43600b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 43700b3ed16SGreg Kroah-Hartman 438aaad4303SSolomon Peachy #define HFA384x_PSTATUS_CONN_IBSS ((u16)3) 43900b3ed16SGreg Kroah-Hartman 44000b3ed16SGreg Kroah-Hartman /*-- Information Record: commsquality --*/ 441e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_commsquality { 442aaad4303SSolomon Peachy u16 CQ_currBSS; 443aaad4303SSolomon Peachy u16 ASL_currBSS; 444aaad4303SSolomon Peachy u16 ANL_currFC; 4457d3864d1SBas van den Berg } __packed hfa384x_commsquality_t; 44600b3ed16SGreg Kroah-Hartman 44700b3ed16SGreg Kroah-Hartman /*-- Information Record: dmbcommsquality --*/ 448e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_dbmcommsquality { 449aaad4303SSolomon Peachy u16 CQdbm_currBSS; 450aaad4303SSolomon Peachy u16 ASLdbm_currBSS; 451aaad4303SSolomon Peachy u16 ANLdbm_currFC; 4527d3864d1SBas van den Berg } __packed hfa384x_dbmcommsquality_t; 45300b3ed16SGreg Kroah-Hartman 45400b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 45500b3ed16SGreg Kroah-Hartman FRAME STRUCTURES: Communication Frames 45600b3ed16SGreg Kroah-Hartman ---------------------------------------------------------------------- 45700b3ed16SGreg Kroah-Hartman Communication Frames: Transmit Frames 45800b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 45900b3ed16SGreg Kroah-Hartman /*-- Communication Frame: Transmit Frame Structure --*/ 460e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_tx_frame { 461aaad4303SSolomon Peachy u16 status; 462aaad4303SSolomon Peachy u16 reserved1; 463aaad4303SSolomon Peachy u16 reserved2; 464aaad4303SSolomon Peachy u32 sw_support; 465aaad4303SSolomon Peachy u8 tx_retrycount; 466aaad4303SSolomon Peachy u8 tx_rate; 467aaad4303SSolomon Peachy u16 tx_control; 46800b3ed16SGreg Kroah-Hartman 46900b3ed16SGreg Kroah-Hartman /*-- 802.11 Header Information --*/ 47000b3ed16SGreg Kroah-Hartman 471aaad4303SSolomon Peachy u16 frame_control; 472aaad4303SSolomon Peachy u16 duration_id; 473aaad4303SSolomon Peachy u8 address1[6]; 474aaad4303SSolomon Peachy u8 address2[6]; 475aaad4303SSolomon Peachy u8 address3[6]; 476aaad4303SSolomon Peachy u16 sequence_control; 477aaad4303SSolomon Peachy u8 address4[6]; 478aaad4303SSolomon Peachy u16 data_len; /* little endian format */ 47900b3ed16SGreg Kroah-Hartman 48000b3ed16SGreg Kroah-Hartman /*-- 802.3 Header Information --*/ 48100b3ed16SGreg Kroah-Hartman 482aaad4303SSolomon Peachy u8 dest_addr[6]; 483aaad4303SSolomon Peachy u8 src_addr[6]; 484aaad4303SSolomon Peachy u16 data_length; /* big endian format */ 4857d3864d1SBas van den Berg } __packed hfa384x_tx_frame_t; 48600b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 48700b3ed16SGreg Kroah-Hartman Communication Frames: Field Masks for Transmit Frames 48800b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 48900b3ed16SGreg Kroah-Hartman /*-- Status Field --*/ 4907f6e0e44SMoritz Muehlenhoff #define HFA384x_TXSTATUS_ACKERR ((u16)BIT(5)) 4917f6e0e44SMoritz Muehlenhoff #define HFA384x_TXSTATUS_FORMERR ((u16)BIT(3)) 4927f6e0e44SMoritz Muehlenhoff #define HFA384x_TXSTATUS_DISCON ((u16)BIT(2)) 4937f6e0e44SMoritz Muehlenhoff #define HFA384x_TXSTATUS_AGEDERR ((u16)BIT(1)) 4947f6e0e44SMoritz Muehlenhoff #define HFA384x_TXSTATUS_RETRYERR ((u16)BIT(0)) 49500b3ed16SGreg Kroah-Hartman /*-- Transmit Control Field --*/ 49671508ee4SAlessandro Ghedini #define HFA384x_TX_MACPORT ((u16)(BIT(10) | \ 49771508ee4SAlessandro Ghedini BIT(9) | BIT(8))) 4987f6e0e44SMoritz Muehlenhoff #define HFA384x_TX_STRUCTYPE ((u16)(BIT(4) | BIT(3))) 4997f6e0e44SMoritz Muehlenhoff #define HFA384x_TX_TXEX ((u16)BIT(2)) 5007f6e0e44SMoritz Muehlenhoff #define HFA384x_TX_TXOK ((u16)BIT(1)) 50100b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 50200b3ed16SGreg Kroah-Hartman Communication Frames: Test/Get/Set Field Values for Transmit Frames 50300b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 50400b3ed16SGreg Kroah-Hartman /*-- Status Field --*/ 50500b3ed16SGreg Kroah-Hartman #define HFA384x_TXSTATUS_ISERROR(v) \ 506aaad4303SSolomon Peachy (((u16)(v))&\ 50700b3ed16SGreg Kroah-Hartman (HFA384x_TXSTATUS_ACKERR|HFA384x_TXSTATUS_FORMERR|\ 50800b3ed16SGreg Kroah-Hartman HFA384x_TXSTATUS_DISCON|HFA384x_TXSTATUS_AGEDERR|\ 50900b3ed16SGreg Kroah-Hartman HFA384x_TXSTATUS_RETRYERR)) 51000b3ed16SGreg Kroah-Hartman 511aaad4303SSolomon Peachy #define HFA384x_TX_SET(v, m, s) ((((u16)(v))<<((u16)(s)))&((u16)(m))) 51200b3ed16SGreg Kroah-Hartman 51300b3ed16SGreg Kroah-Hartman #define HFA384x_TX_MACPORT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8) 51471508ee4SAlessandro Ghedini #define HFA384x_TX_STRUCTYPE_SET(v) HFA384x_TX_SET(v, \ 51571508ee4SAlessandro Ghedini HFA384x_TX_STRUCTYPE, 3) 51600b3ed16SGreg Kroah-Hartman #define HFA384x_TX_TXEX_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2) 51700b3ed16SGreg Kroah-Hartman #define HFA384x_TX_TXOK_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1) 51800b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 51900b3ed16SGreg Kroah-Hartman Communication Frames: Receive Frames 52000b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 52100b3ed16SGreg Kroah-Hartman /*-- Communication Frame: Receive Frame Structure --*/ 522e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_rx_frame { 52300b3ed16SGreg Kroah-Hartman /*-- MAC rx descriptor (hfa384x byte order) --*/ 524aaad4303SSolomon Peachy u16 status; 525aaad4303SSolomon Peachy u32 time; 526aaad4303SSolomon Peachy u8 silence; 527aaad4303SSolomon Peachy u8 signal; 528aaad4303SSolomon Peachy u8 rate; 529aaad4303SSolomon Peachy u8 rx_flow; 530aaad4303SSolomon Peachy u16 reserved1; 531aaad4303SSolomon Peachy u16 reserved2; 53200b3ed16SGreg Kroah-Hartman 53300b3ed16SGreg Kroah-Hartman /*-- 802.11 Header Information (802.11 byte order) --*/ 5348cbe56e0SHimangi Saraogi __le16 frame_control; 535aaad4303SSolomon Peachy u16 duration_id; 536aaad4303SSolomon Peachy u8 address1[6]; 537aaad4303SSolomon Peachy u8 address2[6]; 538aaad4303SSolomon Peachy u8 address3[6]; 539aaad4303SSolomon Peachy u16 sequence_control; 540aaad4303SSolomon Peachy u8 address4[6]; 5418cbe56e0SHimangi Saraogi __le16 data_len; /* hfa384x (little endian) format */ 54200b3ed16SGreg Kroah-Hartman 54300b3ed16SGreg Kroah-Hartman /*-- 802.3 Header Information --*/ 544aaad4303SSolomon Peachy u8 dest_addr[6]; 545aaad4303SSolomon Peachy u8 src_addr[6]; 546aaad4303SSolomon Peachy u16 data_length; /* IEEE? (big endian) format */ 5477d3864d1SBas van den Berg } __packed hfa384x_rx_frame_t; 54800b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 54900b3ed16SGreg Kroah-Hartman Communication Frames: Field Masks for Receive Frames 55000b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 55100b3ed16SGreg Kroah-Hartman 55200b3ed16SGreg Kroah-Hartman /*-- Status Fields --*/ 55371508ee4SAlessandro Ghedini #define HFA384x_RXSTATUS_MACPORT ((u16)(BIT(10) | \ 55471508ee4SAlessandro Ghedini BIT(9) | \ 55571508ee4SAlessandro Ghedini BIT(8))) 5567f6e0e44SMoritz Muehlenhoff #define HFA384x_RXSTATUS_FCSERR ((u16)BIT(0)) 55700b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 55800b3ed16SGreg Kroah-Hartman Communication Frames: Test/Get/Set Field Values for Receive Frames 55900b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 56071508ee4SAlessandro Ghedini #define HFA384x_RXSTATUS_MACPORT_GET(value) ((u16)((((u16)(value)) \ 56171508ee4SAlessandro Ghedini & HFA384x_RXSTATUS_MACPORT) >> 8)) 56271508ee4SAlessandro Ghedini #define HFA384x_RXSTATUS_ISFCSERR(value) ((u16)(((u16)(value)) \ 56371508ee4SAlessandro Ghedini & HFA384x_RXSTATUS_FCSERR)) 56400b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 56500b3ed16SGreg Kroah-Hartman FRAME STRUCTURES: Information Types and Information Frame Structures 56600b3ed16SGreg Kroah-Hartman ---------------------------------------------------------------------- 56700b3ed16SGreg Kroah-Hartman Information Types 56800b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 569aaad4303SSolomon Peachy #define HFA384x_IT_HANDOVERADDR ((u16)0xF000UL) 570aaad4303SSolomon Peachy #define HFA384x_IT_COMMTALLIES ((u16)0xF100UL) 571aaad4303SSolomon Peachy #define HFA384x_IT_SCANRESULTS ((u16)0xF101UL) 572aaad4303SSolomon Peachy #define HFA384x_IT_CHINFORESULTS ((u16)0xF102UL) 573aaad4303SSolomon Peachy #define HFA384x_IT_HOSTSCANRESULTS ((u16)0xF103UL) 574aaad4303SSolomon Peachy #define HFA384x_IT_LINKSTATUS ((u16)0xF200UL) 575aaad4303SSolomon Peachy #define HFA384x_IT_ASSOCSTATUS ((u16)0xF201UL) 576aaad4303SSolomon Peachy #define HFA384x_IT_AUTHREQ ((u16)0xF202UL) 577aaad4303SSolomon Peachy #define HFA384x_IT_PSUSERCNT ((u16)0xF203UL) 578aaad4303SSolomon Peachy #define HFA384x_IT_KEYIDCHANGED ((u16)0xF204UL) 579aaad4303SSolomon Peachy #define HFA384x_IT_ASSOCREQ ((u16)0xF205UL) 580aaad4303SSolomon Peachy #define HFA384x_IT_MICFAILURE ((u16)0xF206UL) 58100b3ed16SGreg Kroah-Hartman 58200b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 58300b3ed16SGreg Kroah-Hartman Information Frames Structures 58400b3ed16SGreg Kroah-Hartman ---------------------------------------------------------------------- 58500b3ed16SGreg Kroah-Hartman Information Frames: Notification Frame Structures 58600b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 58700b3ed16SGreg Kroah-Hartman 58800b3ed16SGreg Kroah-Hartman /*-- Inquiry Frame, Diagnose: Communication Tallies --*/ 589e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_CommTallies16 { 590aaad4303SSolomon Peachy u16 txunicastframes; 591aaad4303SSolomon Peachy u16 txmulticastframes; 592aaad4303SSolomon Peachy u16 txfragments; 593aaad4303SSolomon Peachy u16 txunicastoctets; 594aaad4303SSolomon Peachy u16 txmulticastoctets; 595aaad4303SSolomon Peachy u16 txdeferredtrans; 596aaad4303SSolomon Peachy u16 txsingleretryframes; 597aaad4303SSolomon Peachy u16 txmultipleretryframes; 598aaad4303SSolomon Peachy u16 txretrylimitexceeded; 599aaad4303SSolomon Peachy u16 txdiscards; 600aaad4303SSolomon Peachy u16 rxunicastframes; 601aaad4303SSolomon Peachy u16 rxmulticastframes; 602aaad4303SSolomon Peachy u16 rxfragments; 603aaad4303SSolomon Peachy u16 rxunicastoctets; 604aaad4303SSolomon Peachy u16 rxmulticastoctets; 605aaad4303SSolomon Peachy u16 rxfcserrors; 606aaad4303SSolomon Peachy u16 rxdiscardsnobuffer; 607aaad4303SSolomon Peachy u16 txdiscardswrongsa; 608aaad4303SSolomon Peachy u16 rxdiscardswepundecr; 609aaad4303SSolomon Peachy u16 rxmsginmsgfrag; 610aaad4303SSolomon Peachy u16 rxmsginbadmsgfrag; 6117d3864d1SBas van den Berg } __packed hfa384x_CommTallies16_t; 61200b3ed16SGreg Kroah-Hartman 613e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_CommTallies32 { 614aaad4303SSolomon Peachy u32 txunicastframes; 615aaad4303SSolomon Peachy u32 txmulticastframes; 616aaad4303SSolomon Peachy u32 txfragments; 617aaad4303SSolomon Peachy u32 txunicastoctets; 618aaad4303SSolomon Peachy u32 txmulticastoctets; 619aaad4303SSolomon Peachy u32 txdeferredtrans; 620aaad4303SSolomon Peachy u32 txsingleretryframes; 621aaad4303SSolomon Peachy u32 txmultipleretryframes; 622aaad4303SSolomon Peachy u32 txretrylimitexceeded; 623aaad4303SSolomon Peachy u32 txdiscards; 624aaad4303SSolomon Peachy u32 rxunicastframes; 625aaad4303SSolomon Peachy u32 rxmulticastframes; 626aaad4303SSolomon Peachy u32 rxfragments; 627aaad4303SSolomon Peachy u32 rxunicastoctets; 628aaad4303SSolomon Peachy u32 rxmulticastoctets; 629aaad4303SSolomon Peachy u32 rxfcserrors; 630aaad4303SSolomon Peachy u32 rxdiscardsnobuffer; 631aaad4303SSolomon Peachy u32 txdiscardswrongsa; 632aaad4303SSolomon Peachy u32 rxdiscardswepundecr; 633aaad4303SSolomon Peachy u32 rxmsginmsgfrag; 634aaad4303SSolomon Peachy u32 rxmsginbadmsgfrag; 6357d3864d1SBas van den Berg } __packed hfa384x_CommTallies32_t; 63600b3ed16SGreg Kroah-Hartman 63700b3ed16SGreg Kroah-Hartman /*-- Inquiry Frame, Diagnose: Scan Results & Subfields--*/ 638e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_ScanResultSub { 639aaad4303SSolomon Peachy u16 chid; 640aaad4303SSolomon Peachy u16 anl; 641aaad4303SSolomon Peachy u16 sl; 642aaad4303SSolomon Peachy u8 bssid[WLAN_BSSID_LEN]; 643aaad4303SSolomon Peachy u16 bcnint; 644aaad4303SSolomon Peachy u16 capinfo; 64500b3ed16SGreg Kroah-Hartman hfa384x_bytestr32_t ssid; 646aaad4303SSolomon Peachy u8 supprates[10]; /* 802.11 info element */ 647aaad4303SSolomon Peachy u16 proberesp_rate; 6487d3864d1SBas van den Berg } __packed hfa384x_ScanResultSub_t; 64900b3ed16SGreg Kroah-Hartman 650e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_ScanResult { 651aaad4303SSolomon Peachy u16 rsvd; 652aaad4303SSolomon Peachy u16 scanreason; 653e573aaa4SMoritz Muehlenhoff hfa384x_ScanResultSub_t result[HFA384x_SCANRESULT_MAX]; 6547d3864d1SBas van den Berg } __packed hfa384x_ScanResult_t; 65500b3ed16SGreg Kroah-Hartman 65600b3ed16SGreg Kroah-Hartman /*-- Inquiry Frame, Diagnose: ChInfo Results & Subfields--*/ 657e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_ChInfoResultSub { 658aaad4303SSolomon Peachy u16 chid; 659aaad4303SSolomon Peachy u16 anl; 660aaad4303SSolomon Peachy u16 pnl; 661aaad4303SSolomon Peachy u16 active; 6627d3864d1SBas van den Berg } __packed hfa384x_ChInfoResultSub_t; 66300b3ed16SGreg Kroah-Hartman 6647f6e0e44SMoritz Muehlenhoff #define HFA384x_CHINFORESULT_BSSACTIVE BIT(0) 6657f6e0e44SMoritz Muehlenhoff #define HFA384x_CHINFORESULT_PCFACTIVE BIT(1) 66600b3ed16SGreg Kroah-Hartman 667e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_ChInfoResult { 668aaad4303SSolomon Peachy u16 scanchannels; 669e573aaa4SMoritz Muehlenhoff hfa384x_ChInfoResultSub_t result[HFA384x_CHINFORESULT_MAX]; 6707d3864d1SBas van den Berg } __packed hfa384x_ChInfoResult_t; 67100b3ed16SGreg Kroah-Hartman 67200b3ed16SGreg Kroah-Hartman /*-- Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/ 673e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_HScanResultSub { 674aaad4303SSolomon Peachy u16 chid; 675aaad4303SSolomon Peachy u16 anl; 676aaad4303SSolomon Peachy u16 sl; 677aaad4303SSolomon Peachy u8 bssid[WLAN_BSSID_LEN]; 678aaad4303SSolomon Peachy u16 bcnint; 679aaad4303SSolomon Peachy u16 capinfo; 68000b3ed16SGreg Kroah-Hartman hfa384x_bytestr32_t ssid; 681aaad4303SSolomon Peachy u8 supprates[10]; /* 802.11 info element */ 682aaad4303SSolomon Peachy u16 proberesp_rate; 683aaad4303SSolomon Peachy u16 atim; 6847d3864d1SBas van den Berg } __packed hfa384x_HScanResultSub_t; 68500b3ed16SGreg Kroah-Hartman 686e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_HScanResult { 687aaad4303SSolomon Peachy u16 nresult; 688aaad4303SSolomon Peachy u16 rsvd; 689e573aaa4SMoritz Muehlenhoff hfa384x_HScanResultSub_t result[HFA384x_HSCANRESULT_MAX]; 6907d3864d1SBas van den Berg } __packed hfa384x_HScanResult_t; 69100b3ed16SGreg Kroah-Hartman 69200b3ed16SGreg Kroah-Hartman /*-- Unsolicited Frame, MAC Mgmt: LinkStatus --*/ 69300b3ed16SGreg Kroah-Hartman 694aaad4303SSolomon Peachy #define HFA384x_LINK_NOTCONNECTED ((u16)0) 695aaad4303SSolomon Peachy #define HFA384x_LINK_CONNECTED ((u16)1) 696aaad4303SSolomon Peachy #define HFA384x_LINK_DISCONNECTED ((u16)2) 697aaad4303SSolomon Peachy #define HFA384x_LINK_AP_CHANGE ((u16)3) 698aaad4303SSolomon Peachy #define HFA384x_LINK_AP_OUTOFRANGE ((u16)4) 699aaad4303SSolomon Peachy #define HFA384x_LINK_AP_INRANGE ((u16)5) 700aaad4303SSolomon Peachy #define HFA384x_LINK_ASSOCFAIL ((u16)6) 70100b3ed16SGreg Kroah-Hartman 702e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_LinkStatus { 703aaad4303SSolomon Peachy u16 linkstatus; 7047d3864d1SBas van den Berg } __packed hfa384x_LinkStatus_t; 70500b3ed16SGreg Kroah-Hartman 70600b3ed16SGreg Kroah-Hartman /*-- Unsolicited Frame, MAC Mgmt: AssociationStatus (--*/ 70700b3ed16SGreg Kroah-Hartman 708aaad4303SSolomon Peachy #define HFA384x_ASSOCSTATUS_STAASSOC ((u16)1) 709aaad4303SSolomon Peachy #define HFA384x_ASSOCSTATUS_REASSOC ((u16)2) 710aaad4303SSolomon Peachy #define HFA384x_ASSOCSTATUS_AUTHFAIL ((u16)5) 71100b3ed16SGreg Kroah-Hartman 712e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_AssocStatus { 713aaad4303SSolomon Peachy u16 assocstatus; 71428b17a4bSMoritz Muehlenhoff u8 sta_addr[ETH_ALEN]; 71500b3ed16SGreg Kroah-Hartman /* old_ap_addr is only valid if assocstatus == 2 */ 71628b17a4bSMoritz Muehlenhoff u8 old_ap_addr[ETH_ALEN]; 717aaad4303SSolomon Peachy u16 reason; 718aaad4303SSolomon Peachy u16 reserved; 7197d3864d1SBas van den Berg } __packed hfa384x_AssocStatus_t; 72000b3ed16SGreg Kroah-Hartman 72100b3ed16SGreg Kroah-Hartman /*-- Unsolicited Frame, MAC Mgmt: AuthRequest (AP Only) --*/ 72200b3ed16SGreg Kroah-Hartman 723e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_AuthRequest { 72428b17a4bSMoritz Muehlenhoff u8 sta_addr[ETH_ALEN]; 725aaad4303SSolomon Peachy u16 algorithm; 7267d3864d1SBas van den Berg } __packed hfa384x_AuthReq_t; 72700b3ed16SGreg Kroah-Hartman 72800b3ed16SGreg Kroah-Hartman /*-- Unsolicited Frame, MAC Mgmt: PSUserCount (AP Only) --*/ 72900b3ed16SGreg Kroah-Hartman 730e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_PSUserCount { 731aaad4303SSolomon Peachy u16 usercnt; 7327d3864d1SBas van den Berg } __packed hfa384x_PSUserCount_t; 73300b3ed16SGreg Kroah-Hartman 734e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_KeyIDChanged { 73528b17a4bSMoritz Muehlenhoff u8 sta_addr[ETH_ALEN]; 736aaad4303SSolomon Peachy u16 keyid; 7377d3864d1SBas van den Berg } __packed hfa384x_KeyIDChanged_t; 73800b3ed16SGreg Kroah-Hartman 73900b3ed16SGreg Kroah-Hartman /*-- Collection of all Inf frames ---------------*/ 74000b3ed16SGreg Kroah-Hartman typedef union hfa384x_infodata { 74100b3ed16SGreg Kroah-Hartman hfa384x_CommTallies16_t commtallies16; 74200b3ed16SGreg Kroah-Hartman hfa384x_CommTallies32_t commtallies32; 74300b3ed16SGreg Kroah-Hartman hfa384x_ScanResult_t scanresult; 74400b3ed16SGreg Kroah-Hartman hfa384x_ChInfoResult_t chinforesult; 74500b3ed16SGreg Kroah-Hartman hfa384x_HScanResult_t hscanresult; 74600b3ed16SGreg Kroah-Hartman hfa384x_LinkStatus_t linkstatus; 74700b3ed16SGreg Kroah-Hartman hfa384x_AssocStatus_t assocstatus; 74800b3ed16SGreg Kroah-Hartman hfa384x_AuthReq_t authreq; 74900b3ed16SGreg Kroah-Hartman hfa384x_PSUserCount_t psusercnt; 75000b3ed16SGreg Kroah-Hartman hfa384x_KeyIDChanged_t keyidchanged; 7517d3864d1SBas van den Berg } __packed hfa384x_infodata_t; 75200b3ed16SGreg Kroah-Hartman 753e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_InfFrame { 754aaad4303SSolomon Peachy u16 framelen; 755aaad4303SSolomon Peachy u16 infotype; 75600b3ed16SGreg Kroah-Hartman hfa384x_infodata_t info; 7577d3864d1SBas van den Berg } __packed hfa384x_InfFrame_t; 75800b3ed16SGreg Kroah-Hartman 75900b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 76000b3ed16SGreg Kroah-Hartman USB Packet structures and constants. 76100b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 76200b3ed16SGreg Kroah-Hartman 76300b3ed16SGreg Kroah-Hartman /* Should be sent to the bulkout endpoint */ 76400b3ed16SGreg Kroah-Hartman #define HFA384x_USB_TXFRM 0 76500b3ed16SGreg Kroah-Hartman #define HFA384x_USB_CMDREQ 1 76600b3ed16SGreg Kroah-Hartman #define HFA384x_USB_WRIDREQ 2 76700b3ed16SGreg Kroah-Hartman #define HFA384x_USB_RRIDREQ 3 76800b3ed16SGreg Kroah-Hartman #define HFA384x_USB_WMEMREQ 4 76900b3ed16SGreg Kroah-Hartman #define HFA384x_USB_RMEMREQ 5 77000b3ed16SGreg Kroah-Hartman 77100b3ed16SGreg Kroah-Hartman /* Received from the bulkin endpoint */ 77200b3ed16SGreg Kroah-Hartman #define HFA384x_USB_ISTXFRM(a) (((a) & 0x9000) == 0x1000) 77300b3ed16SGreg Kroah-Hartman #define HFA384x_USB_ISRXFRM(a) (!((a) & 0x9000)) 77400b3ed16SGreg Kroah-Hartman #define HFA384x_USB_INFOFRM 0x8000 77500b3ed16SGreg Kroah-Hartman #define HFA384x_USB_CMDRESP 0x8001 77600b3ed16SGreg Kroah-Hartman #define HFA384x_USB_WRIDRESP 0x8002 77700b3ed16SGreg Kroah-Hartman #define HFA384x_USB_RRIDRESP 0x8003 77800b3ed16SGreg Kroah-Hartman #define HFA384x_USB_WMEMRESP 0x8004 77900b3ed16SGreg Kroah-Hartman #define HFA384x_USB_RMEMRESP 0x8005 78000b3ed16SGreg Kroah-Hartman #define HFA384x_USB_BUFAVAIL 0x8006 78100b3ed16SGreg Kroah-Hartman #define HFA384x_USB_ERROR 0x8007 78200b3ed16SGreg Kroah-Hartman 78300b3ed16SGreg Kroah-Hartman /*------------------------------------*/ 78400b3ed16SGreg Kroah-Hartman /* Request (bulk OUT) packet contents */ 78500b3ed16SGreg Kroah-Hartman 78600b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_txfrm { 78700b3ed16SGreg Kroah-Hartman hfa384x_tx_frame_t desc; 788aaad4303SSolomon Peachy u8 data[WLAN_DATA_MAXLEN]; 7897d3864d1SBas van den Berg } __packed hfa384x_usb_txfrm_t; 79000b3ed16SGreg Kroah-Hartman 79100b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_cmdreq { 792aaad4303SSolomon Peachy u16 type; 793aaad4303SSolomon Peachy u16 cmd; 794aaad4303SSolomon Peachy u16 parm0; 795aaad4303SSolomon Peachy u16 parm1; 796aaad4303SSolomon Peachy u16 parm2; 797aaad4303SSolomon Peachy u8 pad[54]; 7987d3864d1SBas van den Berg } __packed hfa384x_usb_cmdreq_t; 79900b3ed16SGreg Kroah-Hartman 80000b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_wridreq { 801aaad4303SSolomon Peachy u16 type; 802aaad4303SSolomon Peachy u16 frmlen; 803aaad4303SSolomon Peachy u16 rid; 804aaad4303SSolomon Peachy u8 data[HFA384x_RIDDATA_MAXLEN]; 8057d3864d1SBas van den Berg } __packed hfa384x_usb_wridreq_t; 80600b3ed16SGreg Kroah-Hartman 80700b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rridreq { 808aaad4303SSolomon Peachy u16 type; 809aaad4303SSolomon Peachy u16 frmlen; 810aaad4303SSolomon Peachy u16 rid; 811aaad4303SSolomon Peachy u8 pad[58]; 8127d3864d1SBas van den Berg } __packed hfa384x_usb_rridreq_t; 81300b3ed16SGreg Kroah-Hartman 81400b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_wmemreq { 815aaad4303SSolomon Peachy u16 type; 816aaad4303SSolomon Peachy u16 frmlen; 817aaad4303SSolomon Peachy u16 offset; 818aaad4303SSolomon Peachy u16 page; 819aaad4303SSolomon Peachy u8 data[HFA384x_USB_RWMEM_MAXLEN]; 8207d3864d1SBas van den Berg } __packed hfa384x_usb_wmemreq_t; 82100b3ed16SGreg Kroah-Hartman 82200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rmemreq { 823aaad4303SSolomon Peachy u16 type; 824aaad4303SSolomon Peachy u16 frmlen; 825aaad4303SSolomon Peachy u16 offset; 826aaad4303SSolomon Peachy u16 page; 827aaad4303SSolomon Peachy u8 pad[56]; 8287d3864d1SBas van den Berg } __packed hfa384x_usb_rmemreq_t; 82900b3ed16SGreg Kroah-Hartman 83000b3ed16SGreg Kroah-Hartman /*------------------------------------*/ 83100b3ed16SGreg Kroah-Hartman /* Response (bulk IN) packet contents */ 83200b3ed16SGreg Kroah-Hartman 83300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rxfrm { 83400b3ed16SGreg Kroah-Hartman hfa384x_rx_frame_t desc; 835aaad4303SSolomon Peachy u8 data[WLAN_DATA_MAXLEN]; 8367d3864d1SBas van den Berg } __packed hfa384x_usb_rxfrm_t; 83700b3ed16SGreg Kroah-Hartman 83800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_infofrm { 839aaad4303SSolomon Peachy u16 type; 84000b3ed16SGreg Kroah-Hartman hfa384x_InfFrame_t info; 8417d3864d1SBas van den Berg } __packed hfa384x_usb_infofrm_t; 84200b3ed16SGreg Kroah-Hartman 84300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_statusresp { 844aaad4303SSolomon Peachy u16 type; 845aaad4303SSolomon Peachy u16 status; 846aaad4303SSolomon Peachy u16 resp0; 847aaad4303SSolomon Peachy u16 resp1; 848aaad4303SSolomon Peachy u16 resp2; 8497d3864d1SBas van den Berg } __packed hfa384x_usb_cmdresp_t; 85000b3ed16SGreg Kroah-Hartman 85100b3ed16SGreg Kroah-Hartman typedef hfa384x_usb_cmdresp_t hfa384x_usb_wridresp_t; 85200b3ed16SGreg Kroah-Hartman 85300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rridresp { 854aaad4303SSolomon Peachy u16 type; 855aaad4303SSolomon Peachy u16 frmlen; 856aaad4303SSolomon Peachy u16 rid; 857aaad4303SSolomon Peachy u8 data[HFA384x_RIDDATA_MAXLEN]; 8587d3864d1SBas van den Berg } __packed hfa384x_usb_rridresp_t; 85900b3ed16SGreg Kroah-Hartman 86000b3ed16SGreg Kroah-Hartman typedef hfa384x_usb_cmdresp_t hfa384x_usb_wmemresp_t; 86100b3ed16SGreg Kroah-Hartman 86200b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_rmemresp { 863aaad4303SSolomon Peachy u16 type; 864aaad4303SSolomon Peachy u16 frmlen; 865aaad4303SSolomon Peachy u8 data[HFA384x_USB_RWMEM_MAXLEN]; 8667d3864d1SBas van den Berg } __packed hfa384x_usb_rmemresp_t; 86700b3ed16SGreg Kroah-Hartman 86800b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_bufavail { 869aaad4303SSolomon Peachy u16 type; 870aaad4303SSolomon Peachy u16 frmlen; 8717d3864d1SBas van den Berg } __packed hfa384x_usb_bufavail_t; 87200b3ed16SGreg Kroah-Hartman 87300b3ed16SGreg Kroah-Hartman typedef struct hfa384x_usb_error { 874aaad4303SSolomon Peachy u16 type; 875aaad4303SSolomon Peachy u16 errortype; 8767d3864d1SBas van den Berg } __packed hfa384x_usb_error_t; 87700b3ed16SGreg Kroah-Hartman 87800b3ed16SGreg Kroah-Hartman /*----------------------------------------------------------*/ 87900b3ed16SGreg Kroah-Hartman /* Unions for packaging all the known packet types together */ 88000b3ed16SGreg Kroah-Hartman 88100b3ed16SGreg Kroah-Hartman typedef union hfa384x_usbout { 882a78d1312SAsaf Vertz __le16 type; 88300b3ed16SGreg Kroah-Hartman hfa384x_usb_txfrm_t txfrm; 88400b3ed16SGreg Kroah-Hartman hfa384x_usb_cmdreq_t cmdreq; 88500b3ed16SGreg Kroah-Hartman hfa384x_usb_wridreq_t wridreq; 88600b3ed16SGreg Kroah-Hartman hfa384x_usb_rridreq_t rridreq; 88700b3ed16SGreg Kroah-Hartman hfa384x_usb_wmemreq_t wmemreq; 88800b3ed16SGreg Kroah-Hartman hfa384x_usb_rmemreq_t rmemreq; 8897d3864d1SBas van den Berg } __packed hfa384x_usbout_t; 89000b3ed16SGreg Kroah-Hartman 89100b3ed16SGreg Kroah-Hartman typedef union hfa384x_usbin { 892a78d1312SAsaf Vertz __le16 type; 89300b3ed16SGreg Kroah-Hartman hfa384x_usb_rxfrm_t rxfrm; 89400b3ed16SGreg Kroah-Hartman hfa384x_usb_txfrm_t txfrm; 89500b3ed16SGreg Kroah-Hartman hfa384x_usb_infofrm_t infofrm; 89600b3ed16SGreg Kroah-Hartman hfa384x_usb_cmdresp_t cmdresp; 89700b3ed16SGreg Kroah-Hartman hfa384x_usb_wridresp_t wridresp; 89800b3ed16SGreg Kroah-Hartman hfa384x_usb_rridresp_t rridresp; 89900b3ed16SGreg Kroah-Hartman hfa384x_usb_wmemresp_t wmemresp; 90000b3ed16SGreg Kroah-Hartman hfa384x_usb_rmemresp_t rmemresp; 90100b3ed16SGreg Kroah-Hartman hfa384x_usb_bufavail_t bufavail; 90200b3ed16SGreg Kroah-Hartman hfa384x_usb_error_t usberror; 903aaad4303SSolomon Peachy u8 boguspad[3000]; 9047d3864d1SBas van den Berg } __packed hfa384x_usbin_t; 90500b3ed16SGreg Kroah-Hartman 90676e3e7c4SKarl Relton /*-------------------------------------------------------------------- 90776e3e7c4SKarl Relton PD record structures. 90876e3e7c4SKarl Relton --------------------------------------------------------------------*/ 90976e3e7c4SKarl Relton 91075f49e07SMithlesh Thukral typedef struct hfa384x_pdr_pcb_partnum { 91176e3e7c4SKarl Relton u8 num[8]; 9127d3864d1SBas van den Berg } __packed hfa384x_pdr_pcb_partnum_t; 91376e3e7c4SKarl Relton 91475f49e07SMithlesh Thukral typedef struct hfa384x_pdr_pcb_tracenum { 91576e3e7c4SKarl Relton u8 num[8]; 9167d3864d1SBas van den Berg } __packed hfa384x_pdr_pcb_tracenum_t; 91776e3e7c4SKarl Relton 91875f49e07SMithlesh Thukral typedef struct hfa384x_pdr_nic_serial { 91976e3e7c4SKarl Relton u8 num[12]; 9207d3864d1SBas van den Berg } __packed hfa384x_pdr_nic_serial_t; 92176e3e7c4SKarl Relton 92275f49e07SMithlesh Thukral typedef struct hfa384x_pdr_mkk_measurements { 92376e3e7c4SKarl Relton double carrier_freq; 92476e3e7c4SKarl Relton double occupied_band; 92576e3e7c4SKarl Relton double power_density; 92676e3e7c4SKarl Relton double tx_spur_f1; 92776e3e7c4SKarl Relton double tx_spur_f2; 92876e3e7c4SKarl Relton double tx_spur_f3; 92976e3e7c4SKarl Relton double tx_spur_f4; 93076e3e7c4SKarl Relton double tx_spur_l1; 93176e3e7c4SKarl Relton double tx_spur_l2; 93276e3e7c4SKarl Relton double tx_spur_l3; 93376e3e7c4SKarl Relton double tx_spur_l4; 93476e3e7c4SKarl Relton double rx_spur_f1; 93576e3e7c4SKarl Relton double rx_spur_f2; 93676e3e7c4SKarl Relton double rx_spur_l1; 93776e3e7c4SKarl Relton double rx_spur_l2; 9387d3864d1SBas van den Berg } __packed hfa384x_pdr_mkk_measurements_t; 93976e3e7c4SKarl Relton 94075f49e07SMithlesh Thukral typedef struct hfa384x_pdr_nic_ramsize { 94176e3e7c4SKarl Relton u8 size[12]; /* units of KB */ 9427d3864d1SBas van den Berg } __packed hfa384x_pdr_nic_ramsize_t; 94376e3e7c4SKarl Relton 94475f49e07SMithlesh Thukral typedef struct hfa384x_pdr_mfisuprange { 94576e3e7c4SKarl Relton u16 id; 94676e3e7c4SKarl Relton u16 variant; 94776e3e7c4SKarl Relton u16 bottom; 94876e3e7c4SKarl Relton u16 top; 9497d3864d1SBas van den Berg } __packed hfa384x_pdr_mfisuprange_t; 95076e3e7c4SKarl Relton 95175f49e07SMithlesh Thukral typedef struct hfa384x_pdr_cfisuprange { 95276e3e7c4SKarl Relton u16 id; 95376e3e7c4SKarl Relton u16 variant; 95476e3e7c4SKarl Relton u16 bottom; 95576e3e7c4SKarl Relton u16 top; 9567d3864d1SBas van den Berg } __packed hfa384x_pdr_cfisuprange_t; 95776e3e7c4SKarl Relton 95875f49e07SMithlesh Thukral typedef struct hfa384x_pdr_nicid { 95976e3e7c4SKarl Relton u16 id; 96076e3e7c4SKarl Relton u16 variant; 96176e3e7c4SKarl Relton u16 major; 96276e3e7c4SKarl Relton u16 minor; 9637d3864d1SBas van den Berg } __packed hfa384x_pdr_nicid_t; 96476e3e7c4SKarl Relton 96575f49e07SMithlesh Thukral typedef struct hfa384x_pdr_refdac_measurements { 96676e3e7c4SKarl Relton u16 value[0]; 9677d3864d1SBas van den Berg } __packed hfa384x_pdr_refdac_measurements_t; 96876e3e7c4SKarl Relton 96975f49e07SMithlesh Thukral typedef struct hfa384x_pdr_vgdac_measurements { 97076e3e7c4SKarl Relton u16 value[0]; 9717d3864d1SBas van den Berg } __packed hfa384x_pdr_vgdac_measurements_t; 97276e3e7c4SKarl Relton 97375f49e07SMithlesh Thukral typedef struct hfa384x_pdr_level_comp_measurements { 97476e3e7c4SKarl Relton u16 value[0]; 9757d3864d1SBas van den Berg } __packed hfa384x_pdr_level_compc_measurements_t; 97676e3e7c4SKarl Relton 97775f49e07SMithlesh Thukral typedef struct hfa384x_pdr_mac_address { 97876e3e7c4SKarl Relton u8 addr[6]; 9797d3864d1SBas van den Berg } __packed hfa384x_pdr_mac_address_t; 98076e3e7c4SKarl Relton 98175f49e07SMithlesh Thukral typedef struct hfa384x_pdr_mkk_callname { 98276e3e7c4SKarl Relton u8 callname[8]; 9837d3864d1SBas van den Berg } __packed hfa384x_pdr_mkk_callname_t; 98476e3e7c4SKarl Relton 98575f49e07SMithlesh Thukral typedef struct hfa384x_pdr_regdomain { 98676e3e7c4SKarl Relton u16 numdomains; 98776e3e7c4SKarl Relton u16 domain[5]; 9887d3864d1SBas van den Berg } __packed hfa384x_pdr_regdomain_t; 98976e3e7c4SKarl Relton 99075f49e07SMithlesh Thukral typedef struct hfa384x_pdr_allowed_channel { 99176e3e7c4SKarl Relton u16 ch_bitmap; 9927d3864d1SBas van den Berg } __packed hfa384x_pdr_allowed_channel_t; 99376e3e7c4SKarl Relton 99475f49e07SMithlesh Thukral typedef struct hfa384x_pdr_default_channel { 99576e3e7c4SKarl Relton u16 channel; 9967d3864d1SBas van den Berg } __packed hfa384x_pdr_default_channel_t; 99776e3e7c4SKarl Relton 99875f49e07SMithlesh Thukral typedef struct hfa384x_pdr_privacy_option { 99976e3e7c4SKarl Relton u16 available; 10007d3864d1SBas van den Berg } __packed hfa384x_pdr_privacy_option_t; 100176e3e7c4SKarl Relton 100275f49e07SMithlesh Thukral typedef struct hfa384x_pdr_temptype { 100376e3e7c4SKarl Relton u16 type; 10047d3864d1SBas van den Berg } __packed hfa384x_pdr_temptype_t; 100576e3e7c4SKarl Relton 100675f49e07SMithlesh Thukral typedef struct hfa384x_pdr_refdac_setup { 100776e3e7c4SKarl Relton u16 ch_value[14]; 10087d3864d1SBas van den Berg } __packed hfa384x_pdr_refdac_setup_t; 100976e3e7c4SKarl Relton 101075f49e07SMithlesh Thukral typedef struct hfa384x_pdr_vgdac_setup { 101176e3e7c4SKarl Relton u16 ch_value[14]; 10127d3864d1SBas van den Berg } __packed hfa384x_pdr_vgdac_setup_t; 101376e3e7c4SKarl Relton 101475f49e07SMithlesh Thukral typedef struct hfa384x_pdr_level_comp_setup { 101576e3e7c4SKarl Relton u16 ch_value[14]; 10167d3864d1SBas van den Berg } __packed hfa384x_pdr_level_comp_setup_t; 101776e3e7c4SKarl Relton 101875f49e07SMithlesh Thukral typedef struct hfa384x_pdr_trimdac_setup { 101976e3e7c4SKarl Relton u16 trimidac; 102076e3e7c4SKarl Relton u16 trimqdac; 10217d3864d1SBas van den Berg } __packed hfa384x_pdr_trimdac_setup_t; 102276e3e7c4SKarl Relton 102375f49e07SMithlesh Thukral typedef struct hfa384x_pdr_ifr_setting { 102476e3e7c4SKarl Relton u16 value[3]; 10257d3864d1SBas van den Berg } __packed hfa384x_pdr_ifr_setting_t; 102676e3e7c4SKarl Relton 102775f49e07SMithlesh Thukral typedef struct hfa384x_pdr_rfr_setting { 102876e3e7c4SKarl Relton u16 value[3]; 10297d3864d1SBas van den Berg } __packed hfa384x_pdr_rfr_setting_t; 103076e3e7c4SKarl Relton 103175f49e07SMithlesh Thukral typedef struct hfa384x_pdr_hfa3861_baseline { 103276e3e7c4SKarl Relton u16 value[50]; 10337d3864d1SBas van den Berg } __packed hfa384x_pdr_hfa3861_baseline_t; 103476e3e7c4SKarl Relton 103575f49e07SMithlesh Thukral typedef struct hfa384x_pdr_hfa3861_shadow { 103676e3e7c4SKarl Relton u32 value[32]; 10377d3864d1SBas van den Berg } __packed hfa384x_pdr_hfa3861_shadow_t; 103876e3e7c4SKarl Relton 103975f49e07SMithlesh Thukral typedef struct hfa384x_pdr_hfa3861_ifrf { 104076e3e7c4SKarl Relton u32 value[20]; 10417d3864d1SBas van den Berg } __packed hfa384x_pdr_hfa3861_ifrf_t; 104276e3e7c4SKarl Relton 104375f49e07SMithlesh Thukral typedef struct hfa384x_pdr_hfa3861_chcalsp { 104476e3e7c4SKarl Relton u16 value[14]; 10457d3864d1SBas van den Berg } __packed hfa384x_pdr_hfa3861_chcalsp_t; 104676e3e7c4SKarl Relton 104775f49e07SMithlesh Thukral typedef struct hfa384x_pdr_hfa3861_chcali { 104876e3e7c4SKarl Relton u16 value[17]; 10497d3864d1SBas van den Berg } __packed hfa384x_pdr_hfa3861_chcali_t; 105076e3e7c4SKarl Relton 105175f49e07SMithlesh Thukral typedef struct hfa384x_pdr_hfa3861_nic_config { 105276e3e7c4SKarl Relton u16 config_bitmap; 10537d3864d1SBas van den Berg } __packed hfa384x_pdr_nic_config_t; 105476e3e7c4SKarl Relton 105575f49e07SMithlesh Thukral typedef struct hfa384x_pdr_hfo_delay { 105676e3e7c4SKarl Relton u8 hfo_delay; 10577d3864d1SBas van den Berg } __packed hfa384x_hfo_delay_t; 105876e3e7c4SKarl Relton 105975f49e07SMithlesh Thukral typedef struct hfa384x_pdr_hfa3861_manf_testsp { 106076e3e7c4SKarl Relton u16 value[30]; 10617d3864d1SBas van den Berg } __packed hfa384x_pdr_hfa3861_manf_testsp_t; 106276e3e7c4SKarl Relton 106375f49e07SMithlesh Thukral typedef struct hfa384x_pdr_hfa3861_manf_testi { 106476e3e7c4SKarl Relton u16 value[30]; 10657d3864d1SBas van den Berg } __packed hfa384x_pdr_hfa3861_manf_testi_t; 106676e3e7c4SKarl Relton 106775f49e07SMithlesh Thukral typedef struct hfa384x_end_of_pda { 106876e3e7c4SKarl Relton u16 crc; 10697d3864d1SBas van den Berg } __packed hfa384x_pdr_end_of_pda_t; 107076e3e7c4SKarl Relton 107175f49e07SMithlesh Thukral typedef struct hfa384x_pdrec { 107276e3e7c4SKarl Relton u16 len; /* in words */ 107376e3e7c4SKarl Relton u16 code; 107476e3e7c4SKarl Relton union pdr { 107576e3e7c4SKarl Relton hfa384x_pdr_pcb_partnum_t pcb_partnum; 107676e3e7c4SKarl Relton hfa384x_pdr_pcb_tracenum_t pcb_tracenum; 107776e3e7c4SKarl Relton hfa384x_pdr_nic_serial_t nic_serial; 107876e3e7c4SKarl Relton hfa384x_pdr_mkk_measurements_t mkk_measurements; 107976e3e7c4SKarl Relton hfa384x_pdr_nic_ramsize_t nic_ramsize; 108076e3e7c4SKarl Relton hfa384x_pdr_mfisuprange_t mfisuprange; 108176e3e7c4SKarl Relton hfa384x_pdr_cfisuprange_t cfisuprange; 108276e3e7c4SKarl Relton hfa384x_pdr_nicid_t nicid; 108376e3e7c4SKarl Relton hfa384x_pdr_refdac_measurements_t refdac_measurements; 108476e3e7c4SKarl Relton hfa384x_pdr_vgdac_measurements_t vgdac_measurements; 108576e3e7c4SKarl Relton hfa384x_pdr_level_compc_measurements_t level_compc_measurements; 108676e3e7c4SKarl Relton hfa384x_pdr_mac_address_t mac_address; 108776e3e7c4SKarl Relton hfa384x_pdr_mkk_callname_t mkk_callname; 108876e3e7c4SKarl Relton hfa384x_pdr_regdomain_t regdomain; 108976e3e7c4SKarl Relton hfa384x_pdr_allowed_channel_t allowed_channel; 109076e3e7c4SKarl Relton hfa384x_pdr_default_channel_t default_channel; 109176e3e7c4SKarl Relton hfa384x_pdr_privacy_option_t privacy_option; 109276e3e7c4SKarl Relton hfa384x_pdr_temptype_t temptype; 109376e3e7c4SKarl Relton hfa384x_pdr_refdac_setup_t refdac_setup; 109476e3e7c4SKarl Relton hfa384x_pdr_vgdac_setup_t vgdac_setup; 109576e3e7c4SKarl Relton hfa384x_pdr_level_comp_setup_t level_comp_setup; 109676e3e7c4SKarl Relton hfa384x_pdr_trimdac_setup_t trimdac_setup; 109776e3e7c4SKarl Relton hfa384x_pdr_ifr_setting_t ifr_setting; 109876e3e7c4SKarl Relton hfa384x_pdr_rfr_setting_t rfr_setting; 109976e3e7c4SKarl Relton hfa384x_pdr_hfa3861_baseline_t hfa3861_baseline; 110076e3e7c4SKarl Relton hfa384x_pdr_hfa3861_shadow_t hfa3861_shadow; 110176e3e7c4SKarl Relton hfa384x_pdr_hfa3861_ifrf_t hfa3861_ifrf; 110276e3e7c4SKarl Relton hfa384x_pdr_hfa3861_chcalsp_t hfa3861_chcalsp; 110376e3e7c4SKarl Relton hfa384x_pdr_hfa3861_chcali_t hfa3861_chcali; 110476e3e7c4SKarl Relton hfa384x_pdr_nic_config_t nic_config; 110576e3e7c4SKarl Relton hfa384x_hfo_delay_t hfo_delay; 110676e3e7c4SKarl Relton hfa384x_pdr_hfa3861_manf_testsp_t hfa3861_manf_testsp; 110776e3e7c4SKarl Relton hfa384x_pdr_hfa3861_manf_testi_t hfa3861_manf_testi; 110876e3e7c4SKarl Relton hfa384x_pdr_end_of_pda_t end_of_pda; 110976e3e7c4SKarl Relton 111076e3e7c4SKarl Relton } data; 11117d3864d1SBas van den Berg } __packed hfa384x_pdrec_t; 111276e3e7c4SKarl Relton 111300b3ed16SGreg Kroah-Hartman #ifdef __KERNEL__ 111400b3ed16SGreg Kroah-Hartman /*-------------------------------------------------------------------- 111500b3ed16SGreg Kroah-Hartman --- MAC state structure, argument to all functions -- 111600b3ed16SGreg Kroah-Hartman --- Also, a collection of support types -- 111700b3ed16SGreg Kroah-Hartman --------------------------------------------------------------------*/ 1118e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_statusresult { 1119aaad4303SSolomon Peachy u16 status; 1120aaad4303SSolomon Peachy u16 resp0; 1121aaad4303SSolomon Peachy u16 resp1; 1122aaad4303SSolomon Peachy u16 resp2; 112300b3ed16SGreg Kroah-Hartman } hfa384x_cmdresult_t; 112400b3ed16SGreg Kroah-Hartman 112500b3ed16SGreg Kroah-Hartman /* USB Control Exchange (CTLX): 112600b3ed16SGreg Kroah-Hartman * A queue of the structure below is maintained for all of the 112700b3ed16SGreg Kroah-Hartman * Request/Response type USB packets supported by Prism2. 112800b3ed16SGreg Kroah-Hartman */ 112900b3ed16SGreg Kroah-Hartman /* The following hfa384x_* structures are arguments to 113000b3ed16SGreg Kroah-Hartman * the usercb() for the different CTLX types. 113100b3ed16SGreg Kroah-Hartman */ 1132e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_rridresult { 1133aaad4303SSolomon Peachy u16 rid; 113400b3ed16SGreg Kroah-Hartman const void *riddata; 1135aaad4303SSolomon Peachy unsigned int riddata_len; 113600b3ed16SGreg Kroah-Hartman } hfa384x_rridresult_t; 113700b3ed16SGreg Kroah-Hartman 113800b3ed16SGreg Kroah-Hartman enum ctlx_state { 113900b3ed16SGreg Kroah-Hartman CTLX_START = 0, /* Start state, not queued */ 114000b3ed16SGreg Kroah-Hartman 114100b3ed16SGreg Kroah-Hartman CTLX_COMPLETE, /* CTLX successfully completed */ 114200b3ed16SGreg Kroah-Hartman CTLX_REQ_FAILED, /* OUT URB completed w/ error */ 114300b3ed16SGreg Kroah-Hartman 114400b3ed16SGreg Kroah-Hartman CTLX_PENDING, /* Queued, data valid */ 114500b3ed16SGreg Kroah-Hartman CTLX_REQ_SUBMITTED, /* OUT URB submitted */ 114600b3ed16SGreg Kroah-Hartman CTLX_REQ_COMPLETE, /* OUT URB complete */ 114700b3ed16SGreg Kroah-Hartman CTLX_RESP_COMPLETE /* IN URB received */ 114800b3ed16SGreg Kroah-Hartman }; 114900b3ed16SGreg Kroah-Hartman typedef enum ctlx_state CTLX_STATE; 115000b3ed16SGreg Kroah-Hartman 115100b3ed16SGreg Kroah-Hartman struct hfa384x_usbctlx; 115200b3ed16SGreg Kroah-Hartman struct hfa384x; 115300b3ed16SGreg Kroah-Hartman 115400b3ed16SGreg Kroah-Hartman typedef void (*ctlx_cmdcb_t) (struct hfa384x *, const struct hfa384x_usbctlx *); 115500b3ed16SGreg Kroah-Hartman 1156e573aaa4SMoritz Muehlenhoff typedef void (*ctlx_usercb_t) (struct hfa384x *hw, 1157e573aaa4SMoritz Muehlenhoff void *ctlxresult, void *usercb_data); 115800b3ed16SGreg Kroah-Hartman 1159e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_usbctlx { 116000b3ed16SGreg Kroah-Hartman struct list_head list; 116100b3ed16SGreg Kroah-Hartman 116200b3ed16SGreg Kroah-Hartman size_t outbufsize; 116300b3ed16SGreg Kroah-Hartman hfa384x_usbout_t outbuf; /* pkt buf for OUT */ 116400b3ed16SGreg Kroah-Hartman hfa384x_usbin_t inbuf; /* pkt buf for IN(a copy) */ 116500b3ed16SGreg Kroah-Hartman 116600b3ed16SGreg Kroah-Hartman CTLX_STATE state; /* Tracks running state */ 116700b3ed16SGreg Kroah-Hartman 116800b3ed16SGreg Kroah-Hartman struct completion done; 116900b3ed16SGreg Kroah-Hartman volatile int reapable; /* Food for the reaper task */ 117000b3ed16SGreg Kroah-Hartman 117100b3ed16SGreg Kroah-Hartman ctlx_cmdcb_t cmdcb; /* Async command callback */ 117200b3ed16SGreg Kroah-Hartman ctlx_usercb_t usercb; /* Async user callback, */ 117300b3ed16SGreg Kroah-Hartman void *usercb_data; /* at CTLX completion */ 117400b3ed16SGreg Kroah-Hartman 117500b3ed16SGreg Kroah-Hartman int variant; /* Identifies cmd variant */ 117600b3ed16SGreg Kroah-Hartman } hfa384x_usbctlx_t; 117700b3ed16SGreg Kroah-Hartman 1178e573aaa4SMoritz Muehlenhoff typedef struct hfa384x_usbctlxq { 117900b3ed16SGreg Kroah-Hartman spinlock_t lock; 118000b3ed16SGreg Kroah-Hartman struct list_head pending; 118100b3ed16SGreg Kroah-Hartman struct list_head active; 118200b3ed16SGreg Kroah-Hartman struct list_head completing; 118300b3ed16SGreg Kroah-Hartman struct list_head reapable; 118400b3ed16SGreg Kroah-Hartman } hfa384x_usbctlxq_t; 118500b3ed16SGreg Kroah-Hartman 1186e573aaa4SMoritz Muehlenhoff typedef struct hfa484x_metacmd { 1187aaad4303SSolomon Peachy u16 cmd; 118800b3ed16SGreg Kroah-Hartman 1189aaad4303SSolomon Peachy u16 parm0; 1190aaad4303SSolomon Peachy u16 parm1; 1191aaad4303SSolomon Peachy u16 parm2; 119200b3ed16SGreg Kroah-Hartman 119300b3ed16SGreg Kroah-Hartman hfa384x_cmdresult_t result; 119400b3ed16SGreg Kroah-Hartman } hfa384x_metacmd_t; 119500b3ed16SGreg Kroah-Hartman 119600b3ed16SGreg Kroah-Hartman #define MAX_GRP_ADDR 32 119700b3ed16SGreg Kroah-Hartman #define WLAN_COMMENT_MAX 80 /* Max. length of user comment string. */ 119800b3ed16SGreg Kroah-Hartman 119900b3ed16SGreg Kroah-Hartman #define WLAN_AUTH_MAX 60 /* Max. # of authenticated stations. */ 120000b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_MAX 60 /* Max. # of stations in an access list. */ 120100b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_NONE 0 /* No stations may be authenticated. */ 120200b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_ALL 1 /* All stations may be authenticated. */ 120300b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_ALLOW 2 /* Authenticate only "allowed" stations. */ 120400b3ed16SGreg Kroah-Hartman #define WLAN_ACCESS_DENY 3 /* Do not authenticate "denied" stations. */ 120500b3ed16SGreg Kroah-Hartman 120600b3ed16SGreg Kroah-Hartman /* XXX These are going away ASAP */ 1207c84b528cSVatika Harlalka struct prism2sta_authlist { 1208aaad4303SSolomon Peachy unsigned int cnt; 120928b17a4bSMoritz Muehlenhoff u8 addr[WLAN_AUTH_MAX][ETH_ALEN]; 1210aaad4303SSolomon Peachy u8 assoc[WLAN_AUTH_MAX]; 1211c84b528cSVatika Harlalka }; 121200b3ed16SGreg Kroah-Hartman 1213e573aaa4SMoritz Muehlenhoff typedef struct prism2sta_accesslist { 1214aaad4303SSolomon Peachy unsigned int modify; 1215aaad4303SSolomon Peachy unsigned int cnt; 121628b17a4bSMoritz Muehlenhoff u8 addr[WLAN_ACCESS_MAX][ETH_ALEN]; 1217aaad4303SSolomon Peachy unsigned int cnt1; 121828b17a4bSMoritz Muehlenhoff u8 addr1[WLAN_ACCESS_MAX][ETH_ALEN]; 121900b3ed16SGreg Kroah-Hartman } prism2sta_accesslist_t; 122000b3ed16SGreg Kroah-Hartman 1221e573aaa4SMoritz Muehlenhoff typedef struct hfa384x { 122200b3ed16SGreg Kroah-Hartman /* USB support data */ 122300b3ed16SGreg Kroah-Hartman struct usb_device *usb; 122400b3ed16SGreg Kroah-Hartman struct urb rx_urb; 122500b3ed16SGreg Kroah-Hartman struct sk_buff *rx_urb_skb; 122600b3ed16SGreg Kroah-Hartman struct urb tx_urb; 122700b3ed16SGreg Kroah-Hartman struct urb ctlx_urb; 122800b3ed16SGreg Kroah-Hartman hfa384x_usbout_t txbuff; 122900b3ed16SGreg Kroah-Hartman hfa384x_usbctlxq_t ctlxq; 123000b3ed16SGreg Kroah-Hartman struct timer_list reqtimer; 123100b3ed16SGreg Kroah-Hartman struct timer_list resptimer; 123200b3ed16SGreg Kroah-Hartman 123300b3ed16SGreg Kroah-Hartman struct timer_list throttle; 123400b3ed16SGreg Kroah-Hartman 123500b3ed16SGreg Kroah-Hartman struct tasklet_struct reaper_bh; 123600b3ed16SGreg Kroah-Hartman struct tasklet_struct completion_bh; 123700b3ed16SGreg Kroah-Hartman 123800b3ed16SGreg Kroah-Hartman struct work_struct usb_work; 123900b3ed16SGreg Kroah-Hartman 124000b3ed16SGreg Kroah-Hartman unsigned long usb_flags; 124100b3ed16SGreg Kroah-Hartman #define THROTTLE_RX 0 124200b3ed16SGreg Kroah-Hartman #define THROTTLE_TX 1 124300b3ed16SGreg Kroah-Hartman #define WORK_RX_HALT 2 124400b3ed16SGreg Kroah-Hartman #define WORK_TX_HALT 3 124500b3ed16SGreg Kroah-Hartman #define WORK_RX_RESUME 4 124600b3ed16SGreg Kroah-Hartman #define WORK_TX_RESUME 5 124700b3ed16SGreg Kroah-Hartman 124800b3ed16SGreg Kroah-Hartman unsigned short req_timer_done:1; 124900b3ed16SGreg Kroah-Hartman unsigned short resp_timer_done:1; 125000b3ed16SGreg Kroah-Hartman 125100b3ed16SGreg Kroah-Hartman int endp_in; 125200b3ed16SGreg Kroah-Hartman int endp_out; 125300b3ed16SGreg Kroah-Hartman 125400b3ed16SGreg Kroah-Hartman int sniff_fcs; 125500b3ed16SGreg Kroah-Hartman int sniff_channel; 125600b3ed16SGreg Kroah-Hartman int sniff_truncate; 125700b3ed16SGreg Kroah-Hartman int sniffhdr; 125800b3ed16SGreg Kroah-Hartman 125900b3ed16SGreg Kroah-Hartman wait_queue_head_t cmdq; /* wait queue itself */ 126000b3ed16SGreg Kroah-Hartman 126100b3ed16SGreg Kroah-Hartman /* Controller state */ 1262aaad4303SSolomon Peachy u32 state; 1263aaad4303SSolomon Peachy u32 isap; 1264aaad4303SSolomon Peachy u8 port_enabled[HFA384x_NUMPORTS_MAX]; 126500b3ed16SGreg Kroah-Hartman 126600b3ed16SGreg Kroah-Hartman /* Download support */ 1267aaad4303SSolomon Peachy unsigned int dlstate; 126800b3ed16SGreg Kroah-Hartman hfa384x_downloadbuffer_t bufinfo; 1269aaad4303SSolomon Peachy u16 dltimeout; 127000b3ed16SGreg Kroah-Hartman 12711a6dfce7SMasanari Iida int scanflag; /* to signal scan complete */ 127200b3ed16SGreg Kroah-Hartman int join_ap; /* are we joined to a specific ap */ 127300b3ed16SGreg Kroah-Hartman int join_retries; /* number of join retries till we fail */ 127400b3ed16SGreg Kroah-Hartman hfa384x_JoinRequest_data_t joinreq; /* join request saved data */ 127500b3ed16SGreg Kroah-Hartman 127600b3ed16SGreg Kroah-Hartman wlandevice_t *wlandev; 127700b3ed16SGreg Kroah-Hartman /* Timer to allow for the deferred processing of linkstatus messages */ 127800b3ed16SGreg Kroah-Hartman struct work_struct link_bh; 127900b3ed16SGreg Kroah-Hartman 128000b3ed16SGreg Kroah-Hartman struct work_struct commsqual_bh; 128100b3ed16SGreg Kroah-Hartman hfa384x_commsquality_t qual; 128200b3ed16SGreg Kroah-Hartman struct timer_list commsqual_timer; 128300b3ed16SGreg Kroah-Hartman 1284aaad4303SSolomon Peachy u16 link_status; 1285aaad4303SSolomon Peachy u16 link_status_new; 128600b3ed16SGreg Kroah-Hartman struct sk_buff_head authq; 128700b3ed16SGreg Kroah-Hartman 1288cb3126e6SKarl Relton u32 txrate; 1289cb3126e6SKarl Relton 129000b3ed16SGreg Kroah-Hartman /* And here we have stuff that used to be in priv */ 129100b3ed16SGreg Kroah-Hartman 129200b3ed16SGreg Kroah-Hartman /* State variables */ 1293aaad4303SSolomon Peachy unsigned int presniff_port_type; 1294aaad4303SSolomon Peachy u16 presniff_wepflags; 1295aaad4303SSolomon Peachy u32 dot11_desired_bss_type; 129600b3ed16SGreg Kroah-Hartman 129700b3ed16SGreg Kroah-Hartman int dbmadjust; 129800b3ed16SGreg Kroah-Hartman 129900b3ed16SGreg Kroah-Hartman /* Group Addresses - right now, there are up to a total 130000b3ed16SGreg Kroah-Hartman of MAX_GRP_ADDR group addresses */ 130128b17a4bSMoritz Muehlenhoff u8 dot11_grp_addr[MAX_GRP_ADDR][ETH_ALEN]; 1302aaad4303SSolomon Peachy unsigned int dot11_grpcnt; 130300b3ed16SGreg Kroah-Hartman 130400b3ed16SGreg Kroah-Hartman /* Component Identities */ 130500b3ed16SGreg Kroah-Hartman hfa384x_compident_t ident_nic; 130600b3ed16SGreg Kroah-Hartman hfa384x_compident_t ident_pri_fw; 130700b3ed16SGreg Kroah-Hartman hfa384x_compident_t ident_sta_fw; 130800b3ed16SGreg Kroah-Hartman hfa384x_compident_t ident_ap_fw; 1309aaad4303SSolomon Peachy u16 mm_mods; 131000b3ed16SGreg Kroah-Hartman 131100b3ed16SGreg Kroah-Hartman /* Supplier compatibility ranges */ 131200b3ed16SGreg Kroah-Hartman hfa384x_caplevel_t cap_sup_mfi; 131300b3ed16SGreg Kroah-Hartman hfa384x_caplevel_t cap_sup_cfi; 131400b3ed16SGreg Kroah-Hartman hfa384x_caplevel_t cap_sup_pri; 131500b3ed16SGreg Kroah-Hartman hfa384x_caplevel_t cap_sup_sta; 131600b3ed16SGreg Kroah-Hartman hfa384x_caplevel_t cap_sup_ap; 131700b3ed16SGreg Kroah-Hartman 131800b3ed16SGreg Kroah-Hartman /* Actor compatibility ranges */ 131971508ee4SAlessandro Ghedini hfa384x_caplevel_t cap_act_pri_cfi; /* 132071508ee4SAlessandro Ghedini * pri f/w to controller 132171508ee4SAlessandro Ghedini * interface 132271508ee4SAlessandro Ghedini */ 132371508ee4SAlessandro Ghedini 132471508ee4SAlessandro Ghedini hfa384x_caplevel_t cap_act_sta_cfi; /* 132571508ee4SAlessandro Ghedini * sta f/w to controller 132671508ee4SAlessandro Ghedini * interface 132771508ee4SAlessandro Ghedini */ 132871508ee4SAlessandro Ghedini 132900b3ed16SGreg Kroah-Hartman hfa384x_caplevel_t cap_act_sta_mfi; /* sta f/w to modem interface */ 133071508ee4SAlessandro Ghedini 133171508ee4SAlessandro Ghedini hfa384x_caplevel_t cap_act_ap_cfi; /* 133271508ee4SAlessandro Ghedini * ap f/w to controller 133371508ee4SAlessandro Ghedini * interface 133471508ee4SAlessandro Ghedini */ 133571508ee4SAlessandro Ghedini 133600b3ed16SGreg Kroah-Hartman hfa384x_caplevel_t cap_act_ap_mfi; /* ap f/w to modem interface */ 133700b3ed16SGreg Kroah-Hartman 1338aaad4303SSolomon Peachy u32 psusercount; /* Power save user count. */ 133900b3ed16SGreg Kroah-Hartman hfa384x_CommTallies32_t tallies; /* Communication tallies. */ 1340aaad4303SSolomon Peachy u8 comment[WLAN_COMMENT_MAX + 1]; /* User comment */ 134100b3ed16SGreg Kroah-Hartman 134200b3ed16SGreg Kroah-Hartman /* Channel Info request results (AP only) */ 134300b3ed16SGreg Kroah-Hartman struct { 134400b3ed16SGreg Kroah-Hartman atomic_t done; 1345aaad4303SSolomon Peachy u8 count; 134600b3ed16SGreg Kroah-Hartman hfa384x_ChInfoResult_t results; 134700b3ed16SGreg Kroah-Hartman } channel_info; 134800b3ed16SGreg Kroah-Hartman 134900b3ed16SGreg Kroah-Hartman hfa384x_InfFrame_t *scanresults; 135000b3ed16SGreg Kroah-Hartman 1351c84b528cSVatika Harlalka struct prism2sta_authlist authlist; /* Authenticated station list. */ 1352aaad4303SSolomon Peachy unsigned int accessmode; /* Access mode. */ 135300b3ed16SGreg Kroah-Hartman prism2sta_accesslist_t allow; /* Allowed station list. */ 135400b3ed16SGreg Kroah-Hartman prism2sta_accesslist_t deny; /* Denied station list. */ 135500b3ed16SGreg Kroah-Hartman 135600b3ed16SGreg Kroah-Hartman } hfa384x_t; 135700b3ed16SGreg Kroah-Hartman 1358e573aaa4SMoritz Muehlenhoff void hfa384x_create(hfa384x_t *hw, struct usb_device *usb); 135900b3ed16SGreg Kroah-Hartman void hfa384x_destroy(hfa384x_t *hw); 136000b3ed16SGreg Kroah-Hartman 136100b3ed16SGreg Kroah-Hartman int 136200b3ed16SGreg Kroah-Hartman hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis); 1363e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_commtallies(hfa384x_t *hw); 1364e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_disable(hfa384x_t *hw, u16 macport); 1365e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_enable(hfa384x_t *hw, u16 macport); 1366e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_flashdl_enable(hfa384x_t *hw); 1367e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_flashdl_disable(hfa384x_t *hw); 1368e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_flashdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len); 1369e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_getconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len); 1370e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, u32 exeaddr); 1371e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_ramdl_disable(hfa384x_t *hw); 1372e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_ramdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len); 1373e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len); 1374e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_setconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len); 137500b3ed16SGreg Kroah-Hartman 1376e573aaa4SMoritz Muehlenhoff static inline int hfa384x_drvr_getconfig16(hfa384x_t *hw, u16 rid, void *val) 137700b3ed16SGreg Kroah-Hartman { 137800b3ed16SGreg Kroah-Hartman int result = 0; 13797489df36SVeronika Kabatova 1380aaad4303SSolomon Peachy result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u16)); 1381e573aaa4SMoritz Muehlenhoff if (result == 0) 138218c7f792SMoritz Muehlenhoff *((u16 *) val) = le16_to_cpu(*((u16 *) val)); 138300b3ed16SGreg Kroah-Hartman return result; 138400b3ed16SGreg Kroah-Hartman } 138500b3ed16SGreg Kroah-Hartman 1386e573aaa4SMoritz Muehlenhoff static inline int hfa384x_drvr_setconfig16(hfa384x_t *hw, u16 rid, u16 val) 138700b3ed16SGreg Kroah-Hartman { 138818c7f792SMoritz Muehlenhoff u16 value = cpu_to_le16(val); 13897489df36SVeronika Kabatova 139000b3ed16SGreg Kroah-Hartman return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value)); 139100b3ed16SGreg Kroah-Hartman } 139200b3ed16SGreg Kroah-Hartman 139300b3ed16SGreg Kroah-Hartman int 139400b3ed16SGreg Kroah-Hartman hfa384x_drvr_getconfig_async(hfa384x_t *hw, 1395e573aaa4SMoritz Muehlenhoff u16 rid, ctlx_usercb_t usercb, void *usercb_data); 139600b3ed16SGreg Kroah-Hartman 139700b3ed16SGreg Kroah-Hartman int 139800b3ed16SGreg Kroah-Hartman hfa384x_drvr_setconfig_async(hfa384x_t *hw, 1399aaad4303SSolomon Peachy u16 rid, 140000b3ed16SGreg Kroah-Hartman void *buf, 1401e573aaa4SMoritz Muehlenhoff u16 len, ctlx_usercb_t usercb, void *usercb_data); 140200b3ed16SGreg Kroah-Hartman 140300b3ed16SGreg Kroah-Hartman static inline int 1404aaad4303SSolomon Peachy hfa384x_drvr_setconfig16_async(hfa384x_t *hw, u16 rid, u16 val) 140500b3ed16SGreg Kroah-Hartman { 140618c7f792SMoritz Muehlenhoff u16 value = cpu_to_le16(val); 14077489df36SVeronika Kabatova 140800b3ed16SGreg Kroah-Hartman return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value), 140900b3ed16SGreg Kroah-Hartman NULL, NULL); 141000b3ed16SGreg Kroah-Hartman } 141100b3ed16SGreg Kroah-Hartman 1412e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_start(hfa384x_t *hw); 1413e573aaa4SMoritz Muehlenhoff int hfa384x_drvr_stop(hfa384x_t *hw); 141400b3ed16SGreg Kroah-Hartman int 1415e573aaa4SMoritz Muehlenhoff hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, 1416f6b43c2eSSven Dziadek union p80211_hdr *p80211_hdr, 1417f6b43c2eSSven Dziadek struct p80211_metawep *p80211_wep); 1418e573aaa4SMoritz Muehlenhoff void hfa384x_tx_timeout(wlandevice_t *wlandev); 141900b3ed16SGreg Kroah-Hartman 1420e573aaa4SMoritz Muehlenhoff int hfa384x_cmd_initialize(hfa384x_t *hw); 1421e573aaa4SMoritz Muehlenhoff int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport); 1422e573aaa4SMoritz Muehlenhoff int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport); 1423e573aaa4SMoritz Muehlenhoff int hfa384x_cmd_allocate(hfa384x_t *hw, u16 len); 1424e573aaa4SMoritz Muehlenhoff int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable); 142500b3ed16SGreg Kroah-Hartman int 1426e573aaa4SMoritz Muehlenhoff hfa384x_cmd_download(hfa384x_t *hw, 1427e573aaa4SMoritz Muehlenhoff u16 mode, u16 lowaddr, u16 highaddr, u16 codelen); 142800b3ed16SGreg Kroah-Hartman 142900b3ed16SGreg Kroah-Hartman #endif /*__KERNEL__ */ 143000b3ed16SGreg Kroah-Hartman 143100b3ed16SGreg Kroah-Hartman #endif /*_HFA384x_H */ 1432