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