diff options
Diffstat (limited to 'drivers/net/wireless/bcmdhd/include/proto')
| -rw-r--r-- | drivers/net/wireless/bcmdhd/include/proto/802.11.h | 1731 | ||||
| -rw-r--r-- | drivers/net/wireless/bcmdhd/include/proto/802.11_bta.h | 45 | ||||
| -rw-r--r-- | drivers/net/wireless/bcmdhd/include/proto/802.11e.h | 131 | ||||
| -rw-r--r-- | drivers/net/wireless/bcmdhd/include/proto/802.1d.h | 49 | ||||
| -rw-r--r-- | drivers/net/wireless/bcmdhd/include/proto/bcmeth.h | 83 | ||||
| -rw-r--r-- | drivers/net/wireless/bcmdhd/include/proto/bcmevent.h | 312 | ||||
| -rw-r--r-- | drivers/net/wireless/bcmdhd/include/proto/bcmip.h | 154 | ||||
| -rw-r--r-- | drivers/net/wireless/bcmdhd/include/proto/bt_amp_hci.h | 442 | ||||
| -rw-r--r-- | drivers/net/wireless/bcmdhd/include/proto/eapol.h | 173 | ||||
| -rw-r--r-- | drivers/net/wireless/bcmdhd/include/proto/ethernet.h | 162 | ||||
| -rw-r--r-- | drivers/net/wireless/bcmdhd/include/proto/p2p.h | 512 | ||||
| -rw-r--r-- | drivers/net/wireless/bcmdhd/include/proto/sdspi.h | 76 | ||||
| -rw-r--r-- | drivers/net/wireless/bcmdhd/include/proto/vlan.h | 70 | ||||
| -rw-r--r-- | drivers/net/wireless/bcmdhd/include/proto/wpa.h | 160 |
14 files changed, 4100 insertions, 0 deletions
diff --git a/drivers/net/wireless/bcmdhd/include/proto/802.11.h b/drivers/net/wireless/bcmdhd/include/proto/802.11.h new file mode 100644 index 00000000000..2342cb38314 --- /dev/null +++ b/drivers/net/wireless/bcmdhd/include/proto/802.11.h | |||
| @@ -0,0 +1,1731 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 1999-2011, Broadcom Corporation | ||
| 3 | * | ||
| 4 | * Unless you and Broadcom execute a separate written software license | ||
| 5 | * agreement governing use of this software, this software is licensed to you | ||
| 6 | * under the terms of the GNU General Public License version 2 (the "GPL"), | ||
| 7 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | ||
| 8 | * following added to such license: | ||
| 9 | * | ||
| 10 | * As a special exception, the copyright holders of this software give you | ||
| 11 | * permission to link this software with independent modules, and to copy and | ||
| 12 | * distribute the resulting executable under terms of your choice, provided that | ||
| 13 | * you also meet, for each linked independent module, the terms and conditions of | ||
| 14 | * the license of that module. An independent module is a module which is not | ||
| 15 | * derived from this software. The special exception does not apply to any | ||
| 16 | * modifications of the software. | ||
| 17 | * | ||
| 18 | * Notwithstanding the above, under no circumstances may you combine this | ||
| 19 | * software in any way with any other Broadcom software provided under a license | ||
| 20 | * other than the GPL, without Broadcom's express prior written consent. | ||
| 21 | * | ||
| 22 | * Fundamental types and constants relating to 802.11 | ||
| 23 | * | ||
| 24 | * $Id: 802.11.h,v 9.260.2.6 2010-12-15 21:41:14 Exp $ | ||
| 25 | */ | ||
| 26 | |||
| 27 | |||
| 28 | #ifndef _802_11_H_ | ||
| 29 | #define _802_11_H_ | ||
| 30 | |||
| 31 | #ifndef _TYPEDEFS_H_ | ||
| 32 | #include <typedefs.h> | ||
| 33 | #endif | ||
| 34 | |||
| 35 | #ifndef _NET_ETHERNET_H_ | ||
| 36 | #include <proto/ethernet.h> | ||
| 37 | #endif | ||
| 38 | |||
| 39 | #include <proto/wpa.h> | ||
| 40 | |||
| 41 | |||
| 42 | #include <packed_section_start.h> | ||
| 43 | |||
| 44 | |||
| 45 | #define DOT11_TU_TO_US 1024 | ||
| 46 | |||
| 47 | |||
| 48 | #define DOT11_A3_HDR_LEN 24 | ||
| 49 | #define DOT11_A4_HDR_LEN 30 | ||
| 50 | #define DOT11_MAC_HDR_LEN DOT11_A3_HDR_LEN | ||
| 51 | #define DOT11_FCS_LEN 4 | ||
| 52 | #define DOT11_ICV_LEN 4 | ||
| 53 | #define DOT11_ICV_AES_LEN 8 | ||
| 54 | #define DOT11_QOS_LEN 2 | ||
| 55 | #define DOT11_HTC_LEN 4 | ||
| 56 | |||
| 57 | #define DOT11_KEY_INDEX_SHIFT 6 | ||
| 58 | #define DOT11_IV_LEN 4 | ||
| 59 | #define DOT11_IV_TKIP_LEN 8 | ||
| 60 | #define DOT11_IV_AES_OCB_LEN 4 | ||
| 61 | #define DOT11_IV_AES_CCM_LEN 8 | ||
| 62 | #define DOT11_IV_MAX_LEN 8 | ||
| 63 | |||
| 64 | |||
| 65 | #define DOT11_MAX_MPDU_BODY_LEN 2304 | ||
| 66 | |||
| 67 | #define DOT11_MAX_MPDU_LEN (DOT11_A4_HDR_LEN + \ | ||
| 68 | DOT11_QOS_LEN + \ | ||
| 69 | DOT11_IV_AES_CCM_LEN + \ | ||
| 70 | DOT11_MAX_MPDU_BODY_LEN + \ | ||
| 71 | DOT11_ICV_LEN + \ | ||
| 72 | DOT11_FCS_LEN) | ||
| 73 | |||
| 74 | #define DOT11_MAX_SSID_LEN 32 | ||
| 75 | |||
| 76 | |||
| 77 | #define DOT11_DEFAULT_RTS_LEN 2347 | ||
| 78 | #define DOT11_MAX_RTS_LEN 2347 | ||
| 79 | |||
| 80 | |||
| 81 | #define DOT11_MIN_FRAG_LEN 256 | ||
| 82 | #define DOT11_MAX_FRAG_LEN 2346 | ||
| 83 | #define DOT11_DEFAULT_FRAG_LEN 2346 | ||
| 84 | |||
| 85 | |||
| 86 | #define DOT11_MIN_BEACON_PERIOD 1 | ||
| 87 | #define DOT11_MAX_BEACON_PERIOD 0xFFFF | ||
| 88 | |||
| 89 | |||
| 90 | #define DOT11_MIN_DTIM_PERIOD 1 | ||
| 91 | #define DOT11_MAX_DTIM_PERIOD 0xFF | ||
| 92 | |||
| 93 | |||
| 94 | #define DOT11_LLC_SNAP_HDR_LEN 8 | ||
| 95 | #define DOT11_OUI_LEN 3 | ||
| 96 | BWL_PRE_PACKED_STRUCT struct dot11_llc_snap_header { | ||
| 97 | uint8 dsap; | ||
| 98 | uint8 ssap; | ||
| 99 | uint8 ctl; | ||
| 100 | uint8 oui[DOT11_OUI_LEN]; | ||
| 101 | uint16 type; | ||
| 102 | } BWL_POST_PACKED_STRUCT; | ||
| 103 | |||
| 104 | |||
| 105 | #define RFC1042_HDR_LEN (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN) | ||
| 106 | |||
| 107 | |||
| 108 | |||
| 109 | BWL_PRE_PACKED_STRUCT struct dot11_header { | ||
| 110 | uint16 fc; | ||
| 111 | uint16 durid; | ||
| 112 | struct ether_addr a1; | ||
| 113 | struct ether_addr a2; | ||
| 114 | struct ether_addr a3; | ||
| 115 | uint16 seq; | ||
| 116 | struct ether_addr a4; | ||
| 117 | } BWL_POST_PACKED_STRUCT; | ||
| 118 | |||
| 119 | |||
| 120 | |||
| 121 | BWL_PRE_PACKED_STRUCT struct dot11_rts_frame { | ||
| 122 | uint16 fc; | ||
| 123 | uint16 durid; | ||
| 124 | struct ether_addr ra; | ||
| 125 | struct ether_addr ta; | ||
| 126 | } BWL_POST_PACKED_STRUCT; | ||
| 127 | #define DOT11_RTS_LEN 16 | ||
| 128 | |||
| 129 | BWL_PRE_PACKED_STRUCT struct dot11_cts_frame { | ||
| 130 | uint16 fc; | ||
| 131 | uint16 durid; | ||
| 132 | struct ether_addr ra; | ||
| 133 | } BWL_POST_PACKED_STRUCT; | ||
| 134 | #define DOT11_CTS_LEN 10 | ||
| 135 | |||
| 136 | BWL_PRE_PACKED_STRUCT struct dot11_ack_frame { | ||
| 137 | uint16 fc; | ||
| 138 | uint16 durid; | ||
| 139 | struct ether_addr ra; | ||
| 140 | } BWL_POST_PACKED_STRUCT; | ||
| 141 | #define DOT11_ACK_LEN 10 | ||
| 142 | |||
| 143 | BWL_PRE_PACKED_STRUCT struct dot11_ps_poll_frame { | ||
| 144 | uint16 fc; | ||
| 145 | uint16 durid; | ||
| 146 | struct ether_addr bssid; | ||
| 147 | struct ether_addr ta; | ||
| 148 | } BWL_POST_PACKED_STRUCT; | ||
| 149 | #define DOT11_PS_POLL_LEN 16 | ||
| 150 | |||
| 151 | BWL_PRE_PACKED_STRUCT struct dot11_cf_end_frame { | ||
| 152 | uint16 fc; | ||
| 153 | uint16 durid; | ||
| 154 | struct ether_addr ra; | ||
| 155 | struct ether_addr bssid; | ||
| 156 | } BWL_POST_PACKED_STRUCT; | ||
| 157 | #define DOT11_CS_END_LEN 16 | ||
| 158 | |||
| 159 | |||
| 160 | BWL_PRE_PACKED_STRUCT struct dot11_action_wifi_vendor_specific { | ||
| 161 | uint8 category; | ||
| 162 | uint8 OUI[3]; | ||
| 163 | uint8 type; | ||
| 164 | uint8 subtype; | ||
| 165 | uint8 data[1040]; | ||
| 166 | } BWL_POST_PACKED_STRUCT; | ||
| 167 | typedef struct dot11_action_wifi_vendor_specific dot11_action_wifi_vendor_specific_t; | ||
| 168 | |||
| 169 | |||
| 170 | BWL_PRE_PACKED_STRUCT struct dot11_action_vs_frmhdr { | ||
| 171 | uint8 category; | ||
| 172 | uint8 OUI[3]; | ||
| 173 | uint8 type; | ||
| 174 | uint8 subtype; | ||
| 175 | uint8 data[1]; | ||
| 176 | } BWL_POST_PACKED_STRUCT; | ||
| 177 | typedef struct dot11_action_vs_frmhdr dot11_action_vs_frmhdr_t; | ||
| 178 | #define DOT11_ACTION_VS_HDR_LEN 6 | ||
| 179 | |||
| 180 | #define BCM_ACTION_OUI_BYTE0 0x00 | ||
| 181 | #define BCM_ACTION_OUI_BYTE1 0x90 | ||
| 182 | #define BCM_ACTION_OUI_BYTE2 0x4c | ||
| 183 | |||
| 184 | |||
| 185 | #define DOT11_BA_CTL_POLICY_NORMAL 0x0000 | ||
| 186 | #define DOT11_BA_CTL_POLICY_NOACK 0x0001 | ||
| 187 | #define DOT11_BA_CTL_POLICY_MASK 0x0001 | ||
| 188 | |||
| 189 | #define DOT11_BA_CTL_MTID 0x0002 | ||
| 190 | #define DOT11_BA_CTL_COMPRESSED 0x0004 | ||
| 191 | |||
| 192 | #define DOT11_BA_CTL_NUMMSDU_MASK 0x0FC0 | ||
| 193 | #define DOT11_BA_CTL_NUMMSDU_SHIFT 6 | ||
| 194 | |||
| 195 | #define DOT11_BA_CTL_TID_MASK 0xF000 | ||
| 196 | #define DOT11_BA_CTL_TID_SHIFT 12 | ||
| 197 | |||
| 198 | |||
| 199 | BWL_PRE_PACKED_STRUCT struct dot11_ctl_header { | ||
| 200 | uint16 fc; | ||
| 201 | uint16 durid; | ||
| 202 | struct ether_addr ra; | ||
| 203 | struct ether_addr ta; | ||
| 204 | } BWL_POST_PACKED_STRUCT; | ||
| 205 | #define DOT11_CTL_HDR_LEN 16 | ||
| 206 | |||
| 207 | |||
| 208 | BWL_PRE_PACKED_STRUCT struct dot11_bar { | ||
| 209 | uint16 bar_control; | ||
| 210 | uint16 seqnum; | ||
| 211 | } BWL_POST_PACKED_STRUCT; | ||
| 212 | #define DOT11_BAR_LEN 4 | ||
| 213 | |||
| 214 | #define DOT11_BA_BITMAP_LEN 128 | ||
| 215 | #define DOT11_BA_CMP_BITMAP_LEN 8 | ||
| 216 | |||
| 217 | BWL_PRE_PACKED_STRUCT struct dot11_ba { | ||
| 218 | uint16 ba_control; | ||
| 219 | uint16 seqnum; | ||
| 220 | uint8 bitmap[DOT11_BA_BITMAP_LEN]; | ||
| 221 | } BWL_POST_PACKED_STRUCT; | ||
| 222 | #define DOT11_BA_LEN 4 | ||
| 223 | |||
| 224 | |||
| 225 | BWL_PRE_PACKED_STRUCT struct dot11_management_header { | ||
| 226 | uint16 fc; | ||
| 227 | uint16 durid; | ||
| 228 | struct ether_addr da; | ||
| 229 | struct ether_addr sa; | ||
| 230 | struct ether_addr bssid; | ||
| 231 | uint16 seq; | ||
| 232 | } BWL_POST_PACKED_STRUCT; | ||
| 233 | #define DOT11_MGMT_HDR_LEN 24 | ||
| 234 | |||
| 235 | |||
| 236 | |||
| 237 | BWL_PRE_PACKED_STRUCT struct dot11_bcn_prb { | ||
| 238 | uint32 timestamp[2]; | ||
| 239 | uint16 beacon_interval; | ||
| 240 | uint16 capability; | ||
| 241 | } BWL_POST_PACKED_STRUCT; | ||
| 242 | #define DOT11_BCN_PRB_LEN 12 | ||
| 243 | #define DOT11_BCN_PRB_FIXED_LEN 12 | ||
| 244 | |||
| 245 | BWL_PRE_PACKED_STRUCT struct dot11_auth { | ||
| 246 | uint16 alg; | ||
| 247 | uint16 seq; | ||
| 248 | uint16 status; | ||
| 249 | } BWL_POST_PACKED_STRUCT; | ||
| 250 | #define DOT11_AUTH_FIXED_LEN 6 | ||
| 251 | |||
| 252 | BWL_PRE_PACKED_STRUCT struct dot11_assoc_req { | ||
| 253 | uint16 capability; | ||
| 254 | uint16 listen; | ||
| 255 | } BWL_POST_PACKED_STRUCT; | ||
| 256 | #define DOT11_ASSOC_REQ_FIXED_LEN 4 | ||
| 257 | |||
| 258 | BWL_PRE_PACKED_STRUCT struct dot11_reassoc_req { | ||
| 259 | uint16 capability; | ||
| 260 | uint16 listen; | ||
| 261 | struct ether_addr ap; | ||
| 262 | } BWL_POST_PACKED_STRUCT; | ||
| 263 | #define DOT11_REASSOC_REQ_FIXED_LEN 10 | ||
| 264 | |||
| 265 | BWL_PRE_PACKED_STRUCT struct dot11_assoc_resp { | ||
| 266 | uint16 capability; | ||
| 267 | uint16 status; | ||
| 268 | uint16 aid; | ||
| 269 | } BWL_POST_PACKED_STRUCT; | ||
| 270 | #define DOT11_ASSOC_RESP_FIXED_LEN 6 | ||
| 271 | |||
| 272 | BWL_PRE_PACKED_STRUCT struct dot11_action_measure { | ||
| 273 | uint8 category; | ||
| 274 | uint8 action; | ||
| 275 | uint8 token; | ||
| 276 | uint8 data[1]; | ||
| 277 | } BWL_POST_PACKED_STRUCT; | ||
| 278 | #define DOT11_ACTION_MEASURE_LEN 3 | ||
| 279 | |||
| 280 | BWL_PRE_PACKED_STRUCT struct dot11_action_ht_ch_width { | ||
| 281 | uint8 category; | ||
| 282 | uint8 action; | ||
| 283 | uint8 ch_width; | ||
| 284 | } BWL_POST_PACKED_STRUCT; | ||
| 285 | |||
| 286 | BWL_PRE_PACKED_STRUCT struct dot11_action_ht_mimops { | ||
| 287 | uint8 category; | ||
| 288 | uint8 action; | ||
| 289 | uint8 control; | ||
| 290 | } BWL_POST_PACKED_STRUCT; | ||
| 291 | |||
| 292 | #define SM_PWRSAVE_ENABLE 1 | ||
| 293 | #define SM_PWRSAVE_MODE 2 | ||
| 294 | |||
| 295 | |||
| 296 | BWL_PRE_PACKED_STRUCT struct dot11_power_cnst { | ||
| 297 | uint8 id; | ||
| 298 | uint8 len; | ||
| 299 | uint8 power; | ||
| 300 | } BWL_POST_PACKED_STRUCT; | ||
| 301 | typedef struct dot11_power_cnst dot11_power_cnst_t; | ||
| 302 | |||
| 303 | BWL_PRE_PACKED_STRUCT struct dot11_power_cap { | ||
| 304 | uint8 min; | ||
| 305 | uint8 max; | ||
| 306 | } BWL_POST_PACKED_STRUCT; | ||
| 307 | typedef struct dot11_power_cap dot11_power_cap_t; | ||
| 308 | |||
| 309 | BWL_PRE_PACKED_STRUCT struct dot11_tpc_rep { | ||
| 310 | uint8 id; | ||
| 311 | uint8 len; | ||
| 312 | uint8 tx_pwr; | ||
| 313 | uint8 margin; | ||
| 314 | } BWL_POST_PACKED_STRUCT; | ||
| 315 | typedef struct dot11_tpc_rep dot11_tpc_rep_t; | ||
| 316 | #define DOT11_MNG_IE_TPC_REPORT_LEN 2 | ||
| 317 | |||
| 318 | BWL_PRE_PACKED_STRUCT struct dot11_supp_channels { | ||
| 319 | uint8 id; | ||
| 320 | uint8 len; | ||
| 321 | uint8 first_channel; | ||
| 322 | uint8 num_channels; | ||
| 323 | } BWL_POST_PACKED_STRUCT; | ||
| 324 | typedef struct dot11_supp_channels dot11_supp_channels_t; | ||
| 325 | |||
| 326 | |||
| 327 | BWL_PRE_PACKED_STRUCT struct dot11_extch { | ||
| 328 | uint8 id; | ||
| 329 | uint8 len; | ||
| 330 | uint8 extch; | ||
| 331 | } BWL_POST_PACKED_STRUCT; | ||
| 332 | typedef struct dot11_extch dot11_extch_ie_t; | ||
| 333 | |||
| 334 | BWL_PRE_PACKED_STRUCT struct dot11_brcm_extch { | ||
| 335 | uint8 id; | ||
| 336 | uint8 len; | ||
| 337 | uint8 oui[3]; | ||
| 338 | uint8 type; | ||
| 339 | uint8 extch; | ||
| 340 | } BWL_POST_PACKED_STRUCT; | ||
| 341 | typedef struct dot11_brcm_extch dot11_brcm_extch_ie_t; | ||
| 342 | |||
| 343 | #define BRCM_EXTCH_IE_LEN 5 | ||
| 344 | #define BRCM_EXTCH_IE_TYPE 53 | ||
| 345 | #define DOT11_EXTCH_IE_LEN 1 | ||
| 346 | #define DOT11_EXT_CH_MASK 0x03 | ||
| 347 | #define DOT11_EXT_CH_UPPER 0x01 | ||
| 348 | #define DOT11_EXT_CH_LOWER 0x03 | ||
| 349 | #define DOT11_EXT_CH_NONE 0x00 | ||
| 350 | |||
| 351 | BWL_PRE_PACKED_STRUCT struct dot11_action_frmhdr { | ||
| 352 | uint8 category; | ||
| 353 | uint8 action; | ||
| 354 | uint8 data[1]; | ||
| 355 | } BWL_POST_PACKED_STRUCT; | ||
| 356 | #define DOT11_ACTION_FRMHDR_LEN 2 | ||
| 357 | |||
| 358 | |||
| 359 | BWL_PRE_PACKED_STRUCT struct dot11_channel_switch { | ||
| 360 | uint8 id; | ||
| 361 | uint8 len; | ||
| 362 | uint8 mode; | ||
| 363 | uint8 channel; | ||
| 364 | uint8 count; | ||
| 365 | } BWL_POST_PACKED_STRUCT; | ||
| 366 | typedef struct dot11_channel_switch dot11_chan_switch_ie_t; | ||
| 367 | |||
| 368 | #define DOT11_SWITCH_IE_LEN 3 | ||
| 369 | |||
| 370 | #define DOT11_CSA_MODE_ADVISORY 0 | ||
| 371 | #define DOT11_CSA_MODE_NO_TX 1 | ||
| 372 | |||
| 373 | BWL_PRE_PACKED_STRUCT struct dot11_action_switch_channel { | ||
| 374 | uint8 category; | ||
| 375 | uint8 action; | ||
| 376 | dot11_chan_switch_ie_t chan_switch_ie; | ||
| 377 | dot11_brcm_extch_ie_t extch_ie; | ||
| 378 | } BWL_POST_PACKED_STRUCT; | ||
| 379 | |||
| 380 | BWL_PRE_PACKED_STRUCT struct dot11_csa_body { | ||
| 381 | uint8 mode; | ||
| 382 | uint8 reg; | ||
| 383 | uint8 channel; | ||
| 384 | uint8 count; | ||
| 385 | } BWL_POST_PACKED_STRUCT; | ||
| 386 | |||
| 387 | |||
| 388 | BWL_PRE_PACKED_STRUCT struct dot11_ext_csa { | ||
| 389 | uint8 id; | ||
| 390 | uint8 len; | ||
| 391 | struct dot11_csa_body b; | ||
| 392 | } BWL_POST_PACKED_STRUCT; | ||
| 393 | typedef struct dot11_ext_csa dot11_ext_csa_ie_t; | ||
| 394 | #define DOT11_EXT_CSA_IE_LEN 4 | ||
| 395 | |||
| 396 | BWL_PRE_PACKED_STRUCT struct dot11_action_ext_csa { | ||
| 397 | uint8 category; | ||
| 398 | uint8 action; | ||
| 399 | dot11_ext_csa_ie_t chan_switch_ie; | ||
| 400 | } BWL_POST_PACKED_STRUCT; | ||
| 401 | |||
| 402 | BWL_PRE_PACKED_STRUCT struct dot11y_action_ext_csa { | ||
| 403 | uint8 category; | ||
| 404 | uint8 action; | ||
| 405 | struct dot11_csa_body b; | ||
| 406 | } BWL_POST_PACKED_STRUCT; | ||
| 407 | |||
| 408 | BWL_PRE_PACKED_STRUCT struct dot11_obss_coex { | ||
| 409 | uint8 id; | ||
| 410 | uint8 len; | ||
| 411 | uint8 info; | ||
| 412 | } BWL_POST_PACKED_STRUCT; | ||
| 413 | typedef struct dot11_obss_coex dot11_obss_coex_t; | ||
| 414 | #define DOT11_OBSS_COEXINFO_LEN 1 | ||
| 415 | |||
| 416 | #define DOT11_OBSS_COEX_INFO_REQ 0x01 | ||
| 417 | #define DOT11_OBSS_COEX_40MHZ_INTOLERANT 0x02 | ||
| 418 | #define DOT11_OBSS_COEX_20MHZ_WIDTH_REQ 0x04 | ||
| 419 | |||
| 420 | BWL_PRE_PACKED_STRUCT struct dot11_obss_chanlist { | ||
| 421 | uint8 id; | ||
| 422 | uint8 len; | ||
| 423 | uint8 regclass; | ||
| 424 | uint8 chanlist[1]; | ||
| 425 | } BWL_POST_PACKED_STRUCT; | ||
| 426 | typedef struct dot11_obss_chanlist dot11_obss_chanlist_t; | ||
| 427 | #define DOT11_OBSS_CHANLIST_FIXED_LEN 1 | ||
| 428 | |||
| 429 | BWL_PRE_PACKED_STRUCT struct dot11_extcap_ie { | ||
| 430 | uint8 id; | ||
| 431 | uint8 len; | ||
| 432 | uint8 cap; | ||
| 433 | } BWL_POST_PACKED_STRUCT; | ||
| 434 | typedef struct dot11_extcap_ie dot11_extcap_ie_t; | ||
| 435 | #define DOT11_EXTCAP_LEN 1 | ||
| 436 | |||
| 437 | |||
| 438 | |||
| 439 | #define DOT11_MEASURE_TYPE_BASIC 0 | ||
| 440 | #define DOT11_MEASURE_TYPE_CCA 1 | ||
| 441 | #define DOT11_MEASURE_TYPE_RPI 2 | ||
| 442 | #define DOT11_MEASURE_TYPE_CHLOAD 3 | ||
| 443 | #define DOT11_MEASURE_TYPE_NOISE 4 | ||
| 444 | #define DOT11_MEASURE_TYPE_BEACON 5 | ||
| 445 | #define DOT11_MEASURE_TYPE_FRAME 6 | ||
| 446 | #define DOT11_MEASURE_TYPE_STATS 7 | ||
| 447 | #define DOT11_MEASURE_TYPE_LCI 8 | ||
| 448 | #define DOT11_MEASURE_TYPE_TXSTREAM 9 | ||
| 449 | #define DOT11_MEASURE_TYPE_PAUSE 255 | ||
| 450 | |||
| 451 | |||
| 452 | #define DOT11_MEASURE_MODE_PARALLEL (1<<0) | ||
| 453 | #define DOT11_MEASURE_MODE_ENABLE (1<<1) | ||
| 454 | #define DOT11_MEASURE_MODE_REQUEST (1<<2) | ||
| 455 | #define DOT11_MEASURE_MODE_REPORT (1<<3) | ||
| 456 | #define DOT11_MEASURE_MODE_DUR (1<<4) | ||
| 457 | |||
| 458 | #define DOT11_MEASURE_MODE_LATE (1<<0) | ||
| 459 | #define DOT11_MEASURE_MODE_INCAPABLE (1<<1) | ||
| 460 | #define DOT11_MEASURE_MODE_REFUSED (1<<2) | ||
| 461 | |||
| 462 | #define DOT11_MEASURE_BASIC_MAP_BSS ((uint8)(1<<0)) | ||
| 463 | #define DOT11_MEASURE_BASIC_MAP_OFDM ((uint8)(1<<1)) | ||
| 464 | #define DOT11_MEASURE_BASIC_MAP_UKNOWN ((uint8)(1<<2)) | ||
| 465 | #define DOT11_MEASURE_BASIC_MAP_RADAR ((uint8)(1<<3)) | ||
| 466 | #define DOT11_MEASURE_BASIC_MAP_UNMEAS ((uint8)(1<<4)) | ||
| 467 | |||
| 468 | BWL_PRE_PACKED_STRUCT struct dot11_meas_req { | ||
| 469 | uint8 id; | ||
| 470 | uint8 len; | ||
| 471 | uint8 token; | ||
| 472 | uint8 mode; | ||
| 473 | uint8 type; | ||
| 474 | uint8 channel; | ||
| 475 | uint8 start_time[8]; | ||
| 476 | uint16 duration; | ||
| 477 | } BWL_POST_PACKED_STRUCT; | ||
| 478 | typedef struct dot11_meas_req dot11_meas_req_t; | ||
| 479 | #define DOT11_MNG_IE_MREQ_LEN 14 | ||
| 480 | |||
| 481 | #define DOT11_MNG_IE_MREQ_FIXED_LEN 3 | ||
| 482 | |||
| 483 | BWL_PRE_PACKED_STRUCT struct dot11_meas_rep { | ||
| 484 | uint8 id; | ||
| 485 | uint8 len; | ||
| 486 | uint8 token; | ||
| 487 | uint8 mode; | ||
| 488 | uint8 type; | ||
| 489 | BWL_PRE_PACKED_STRUCT union | ||
| 490 | { | ||
| 491 | BWL_PRE_PACKED_STRUCT struct { | ||
| 492 | uint8 channel; | ||
| 493 | uint8 start_time[8]; | ||
| 494 | uint16 duration; | ||
| 495 | uint8 map; | ||
| 496 | } BWL_POST_PACKED_STRUCT basic; | ||
| 497 | uint8 data[1]; | ||
| 498 | } BWL_POST_PACKED_STRUCT rep; | ||
| 499 | } BWL_POST_PACKED_STRUCT; | ||
| 500 | typedef struct dot11_meas_rep dot11_meas_rep_t; | ||
| 501 | |||
| 502 | |||
| 503 | #define DOT11_MNG_IE_MREP_FIXED_LEN 3 | ||
| 504 | |||
| 505 | BWL_PRE_PACKED_STRUCT struct dot11_meas_rep_basic { | ||
| 506 | uint8 channel; | ||
| 507 | uint8 start_time[8]; | ||
| 508 | uint16 duration; | ||
| 509 | uint8 map; | ||
| 510 | } BWL_POST_PACKED_STRUCT; | ||
| 511 | typedef struct dot11_meas_rep_basic dot11_meas_rep_basic_t; | ||
| 512 | #define DOT11_MEASURE_BASIC_REP_LEN 12 | ||
| 513 | |||
| 514 | BWL_PRE_PACKED_STRUCT struct dot11_quiet { | ||
| 515 | uint8 id; | ||
| 516 | uint8 len; | ||
| 517 | uint8 count; | ||
| 518 | uint8 period; | ||
| 519 | uint16 duration; | ||
| 520 | uint16 offset; | ||
| 521 | } BWL_POST_PACKED_STRUCT; | ||
| 522 | typedef struct dot11_quiet dot11_quiet_t; | ||
| 523 | |||
| 524 | BWL_PRE_PACKED_STRUCT struct chan_map_tuple { | ||
| 525 | uint8 channel; | ||
| 526 | uint8 map; | ||
| 527 | } BWL_POST_PACKED_STRUCT; | ||
| 528 | typedef struct chan_map_tuple chan_map_tuple_t; | ||
| 529 | |||
| 530 | BWL_PRE_PACKED_STRUCT struct dot11_ibss_dfs { | ||
| 531 | uint8 id; | ||
| 532 | uint8 len; | ||
| 533 | uint8 eaddr[ETHER_ADDR_LEN]; | ||
| 534 | uint8 interval; | ||
| 535 | chan_map_tuple_t map[1]; | ||
| 536 | } BWL_POST_PACKED_STRUCT; | ||
| 537 | typedef struct dot11_ibss_dfs dot11_ibss_dfs_t; | ||
| 538 | |||
| 539 | |||
| 540 | #define WME_OUI "\x00\x50\xf2" | ||
| 541 | #define WME_OUI_LEN 3 | ||
| 542 | #define WME_OUI_TYPE 2 | ||
| 543 | #define WME_VER 1 | ||
| 544 | #define WME_TYPE 2 | ||
| 545 | #define WME_SUBTYPE_IE 0 | ||
| 546 | #define WME_SUBTYPE_PARAM_IE 1 | ||
| 547 | #define WME_SUBTYPE_TSPEC 2 | ||
| 548 | |||
| 549 | |||
| 550 | #define AC_BE 0 | ||
| 551 | #define AC_BK 1 | ||
| 552 | #define AC_VI 2 | ||
| 553 | #define AC_VO 3 | ||
| 554 | #define AC_COUNT 4 | ||
| 555 | |||
| 556 | typedef uint8 ac_bitmap_t; | ||
| 557 | |||
| 558 | #define AC_BITMAP_NONE 0x0 | ||
| 559 | #define AC_BITMAP_ALL 0xf | ||
| 560 | #define AC_BITMAP_TST(ab, ac) (((ab) & (1 << (ac))) != 0) | ||
| 561 | #define AC_BITMAP_SET(ab, ac) (((ab) |= (1 << (ac)))) | ||
| 562 | #define AC_BITMAP_RESET(ab, ac) (((ab) &= ~(1 << (ac)))) | ||
| 563 | |||
| 564 | |||
| 565 | BWL_PRE_PACKED_STRUCT struct wme_ie { | ||
| 566 | uint8 oui[3]; | ||
| 567 | uint8 type; | ||
| 568 | uint8 subtype; | ||
| 569 | uint8 version; | ||
| 570 | uint8 qosinfo; | ||
| 571 | } BWL_POST_PACKED_STRUCT; | ||
| 572 | typedef struct wme_ie wme_ie_t; | ||
| 573 | #define WME_IE_LEN 7 | ||
| 574 | |||
| 575 | BWL_PRE_PACKED_STRUCT struct edcf_acparam { | ||
| 576 | uint8 ACI; | ||
| 577 | uint8 ECW; | ||
| 578 | uint16 TXOP; | ||
| 579 | } BWL_POST_PACKED_STRUCT; | ||
| 580 | typedef struct edcf_acparam edcf_acparam_t; | ||
| 581 | |||
| 582 | |||
| 583 | BWL_PRE_PACKED_STRUCT struct wme_param_ie { | ||
| 584 | uint8 oui[3]; | ||
| 585 | uint8 type; | ||
| 586 | uint8 subtype; | ||
| 587 | uint8 version; | ||
| 588 | uint8 qosinfo; | ||
| 589 | uint8 rsvd; | ||
| 590 | edcf_acparam_t acparam[AC_COUNT]; | ||
| 591 | } BWL_POST_PACKED_STRUCT; | ||
| 592 | typedef struct wme_param_ie wme_param_ie_t; | ||
| 593 | #define WME_PARAM_IE_LEN 24 | ||
| 594 | |||
| 595 | |||
| 596 | #define WME_QI_AP_APSD_MASK 0x80 | ||
| 597 | #define WME_QI_AP_APSD_SHIFT 7 | ||
| 598 | #define WME_QI_AP_COUNT_MASK 0x0f | ||
| 599 | #define WME_QI_AP_COUNT_SHIFT 0 | ||
| 600 | |||
| 601 | |||
| 602 | #define WME_QI_STA_MAXSPLEN_MASK 0x60 | ||
| 603 | #define WME_QI_STA_MAXSPLEN_SHIFT 5 | ||
| 604 | #define WME_QI_STA_APSD_ALL_MASK 0xf | ||
| 605 | #define WME_QI_STA_APSD_ALL_SHIFT 0 | ||
| 606 | #define WME_QI_STA_APSD_BE_MASK 0x8 | ||
| 607 | #define WME_QI_STA_APSD_BE_SHIFT 3 | ||
| 608 | #define WME_QI_STA_APSD_BK_MASK 0x4 | ||
| 609 | #define WME_QI_STA_APSD_BK_SHIFT 2 | ||
| 610 | #define WME_QI_STA_APSD_VI_MASK 0x2 | ||
| 611 | #define WME_QI_STA_APSD_VI_SHIFT 1 | ||
| 612 | #define WME_QI_STA_APSD_VO_MASK 0x1 | ||
| 613 | #define WME_QI_STA_APSD_VO_SHIFT 0 | ||
| 614 | |||
| 615 | |||
| 616 | #define EDCF_AIFSN_MIN 1 | ||
| 617 | #define EDCF_AIFSN_MAX 15 | ||
| 618 | #define EDCF_AIFSN_MASK 0x0f | ||
| 619 | #define EDCF_ACM_MASK 0x10 | ||
| 620 | #define EDCF_ACI_MASK 0x60 | ||
| 621 | #define EDCF_ACI_SHIFT 5 | ||
| 622 | #define EDCF_AIFSN_SHIFT 12 | ||
| 623 | |||
| 624 | |||
| 625 | #define EDCF_ECW_MIN 0 | ||
| 626 | #define EDCF_ECW_MAX 15 | ||
| 627 | #define EDCF_ECW2CW(exp) ((1 << (exp)) - 1) | ||
| 628 | #define EDCF_ECWMIN_MASK 0x0f | ||
| 629 | #define EDCF_ECWMAX_MASK 0xf0 | ||
| 630 | #define EDCF_ECWMAX_SHIFT 4 | ||
| 631 | |||
| 632 | |||
| 633 | #define EDCF_TXOP_MIN 0 | ||
| 634 | #define EDCF_TXOP_MAX 65535 | ||
| 635 | #define EDCF_TXOP2USEC(txop) ((txop) << 5) | ||
| 636 | |||
| 637 | |||
| 638 | #define NON_EDCF_AC_BE_ACI_STA 0x02 | ||
| 639 | |||
| 640 | |||
| 641 | #define EDCF_AC_BE_ACI_STA 0x03 | ||
| 642 | #define EDCF_AC_BE_ECW_STA 0xA4 | ||
| 643 | #define EDCF_AC_BE_TXOP_STA 0x0000 | ||
| 644 | #define EDCF_AC_BK_ACI_STA 0x27 | ||
| 645 | #define EDCF_AC_BK_ECW_STA 0xA4 | ||
| 646 | #define EDCF_AC_BK_TXOP_STA 0x0000 | ||
| 647 | #define EDCF_AC_VI_ACI_STA 0x42 | ||
| 648 | #define EDCF_AC_VI_ECW_STA 0x43 | ||
| 649 | #define EDCF_AC_VI_TXOP_STA 0x005e | ||
| 650 | #define EDCF_AC_VO_ACI_STA 0x62 | ||
| 651 | #define EDCF_AC_VO_ECW_STA 0x32 | ||
| 652 | #define EDCF_AC_VO_TXOP_STA 0x002f | ||
| 653 | |||
| 654 | |||
| 655 | #define EDCF_AC_BE_ACI_AP 0x03 | ||
| 656 | #define EDCF_AC_BE_ECW_AP 0x64 | ||
| 657 | #define EDCF_AC_BE_TXOP_AP 0x0000 | ||
| 658 | #define EDCF_AC_BK_ACI_AP 0x27 | ||
| 659 | #define EDCF_AC_BK_ECW_AP 0xA4 | ||
| 660 | #define EDCF_AC_BK_TXOP_AP 0x0000 | ||
| 661 | #define EDCF_AC_VI_ACI_AP 0x41 | ||
| 662 | #define EDCF_AC_VI_ECW_AP 0x43 | ||
| 663 | #define EDCF_AC_VI_TXOP_AP 0x005e | ||
| 664 | #define EDCF_AC_VO_ACI_AP 0x61 | ||
| 665 | #define EDCF_AC_VO_ECW_AP 0x32 | ||
| 666 | #define EDCF_AC_VO_TXOP_AP 0x002f | ||
| 667 | |||
| 668 | |||
| 669 | BWL_PRE_PACKED_STRUCT struct edca_param_ie { | ||
| 670 | uint8 qosinfo; | ||
| 671 | uint8 rsvd; | ||
| 672 | edcf_acparam_t acparam[AC_COUNT]; | ||
| 673 | } BWL_POST_PACKED_STRUCT; | ||
| 674 | typedef struct edca_param_ie edca_param_ie_t; | ||
| 675 | #define EDCA_PARAM_IE_LEN 18 | ||
| 676 | |||
| 677 | |||
| 678 | BWL_PRE_PACKED_STRUCT struct qos_cap_ie { | ||
| 679 | uint8 qosinfo; | ||
| 680 | } BWL_POST_PACKED_STRUCT; | ||
| 681 | typedef struct qos_cap_ie qos_cap_ie_t; | ||
| 682 | |||
| 683 | BWL_PRE_PACKED_STRUCT struct dot11_qbss_load_ie { | ||
| 684 | uint8 id; | ||
| 685 | uint8 length; | ||
| 686 | uint16 station_count; | ||
| 687 | uint8 channel_utilization; | ||
| 688 | uint16 aac; | ||
| 689 | } BWL_POST_PACKED_STRUCT; | ||
| 690 | typedef struct dot11_qbss_load_ie dot11_qbss_load_ie_t; | ||
| 691 | |||
| 692 | |||
| 693 | #define FIXED_MSDU_SIZE 0x8000 | ||
| 694 | #define MSDU_SIZE_MASK 0x7fff | ||
| 695 | |||
| 696 | |||
| 697 | |||
| 698 | #define INTEGER_SHIFT 13 | ||
| 699 | #define FRACTION_MASK 0x1FFF | ||
| 700 | |||
| 701 | |||
| 702 | BWL_PRE_PACKED_STRUCT struct dot11_management_notification { | ||
| 703 | uint8 category; | ||
| 704 | uint8 action; | ||
| 705 | uint8 token; | ||
| 706 | uint8 status; | ||
| 707 | uint8 data[1]; | ||
| 708 | } BWL_POST_PACKED_STRUCT; | ||
| 709 | #define DOT11_MGMT_NOTIFICATION_LEN 4 | ||
| 710 | |||
| 711 | |||
| 712 | #define WME_ADDTS_REQUEST 0 | ||
| 713 | #define WME_ADDTS_RESPONSE 1 | ||
| 714 | #define WME_DELTS_REQUEST 2 | ||
| 715 | |||
| 716 | |||
| 717 | #define WME_ADMISSION_ACCEPTED 0 | ||
| 718 | #define WME_INVALID_PARAMETERS 1 | ||
| 719 | #define WME_ADMISSION_REFUSED 3 | ||
| 720 | |||
| 721 | |||
| 722 | #define BCN_PRB_SSID(body) ((char*)(body) + DOT11_BCN_PRB_LEN) | ||
| 723 | |||
| 724 | |||
| 725 | #define DOT11_OPEN_SYSTEM 0 | ||
| 726 | #define DOT11_SHARED_KEY 1 | ||
| 727 | #define DOT11_OPEN_SHARED 2 | ||
| 728 | #define DOT11_FAST_BSS 3 | ||
| 729 | #define DOT11_CHALLENGE_LEN 128 | ||
| 730 | |||
| 731 | |||
| 732 | #define FC_PVER_MASK 0x3 | ||
| 733 | #define FC_PVER_SHIFT 0 | ||
| 734 | #define FC_TYPE_MASK 0xC | ||
| 735 | #define FC_TYPE_SHIFT 2 | ||
| 736 | #define FC_SUBTYPE_MASK 0xF0 | ||
| 737 | #define FC_SUBTYPE_SHIFT 4 | ||
| 738 | #define FC_TODS 0x100 | ||
| 739 | #define FC_TODS_SHIFT 8 | ||
| 740 | #define FC_FROMDS 0x200 | ||
| 741 | #define FC_FROMDS_SHIFT 9 | ||
| 742 | #define FC_MOREFRAG 0x400 | ||
| 743 | #define FC_MOREFRAG_SHIFT 10 | ||
| 744 | #define FC_RETRY 0x800 | ||
| 745 | #define FC_RETRY_SHIFT 11 | ||
| 746 | #define FC_PM 0x1000 | ||
| 747 | #define FC_PM_SHIFT 12 | ||
| 748 | #define FC_MOREDATA 0x2000 | ||
| 749 | #define FC_MOREDATA_SHIFT 13 | ||
| 750 | #define FC_WEP 0x4000 | ||
| 751 | #define FC_WEP_SHIFT 14 | ||
| 752 | #define FC_ORDER 0x8000 | ||
| 753 | #define FC_ORDER_SHIFT 15 | ||
| 754 | |||
| 755 | |||
| 756 | #define SEQNUM_SHIFT 4 | ||
| 757 | #define SEQNUM_MAX 0x1000 | ||
| 758 | #define FRAGNUM_MASK 0xF | ||
| 759 | |||
| 760 | |||
| 761 | |||
| 762 | |||
| 763 | #define FC_TYPE_MNG 0 | ||
| 764 | #define FC_TYPE_CTL 1 | ||
| 765 | #define FC_TYPE_DATA 2 | ||
| 766 | |||
| 767 | |||
| 768 | #define FC_SUBTYPE_ASSOC_REQ 0 | ||
| 769 | #define FC_SUBTYPE_ASSOC_RESP 1 | ||
| 770 | #define FC_SUBTYPE_REASSOC_REQ 2 | ||
| 771 | #define FC_SUBTYPE_REASSOC_RESP 3 | ||
| 772 | #define FC_SUBTYPE_PROBE_REQ 4 | ||
| 773 | #define FC_SUBTYPE_PROBE_RESP 5 | ||
| 774 | #define FC_SUBTYPE_BEACON 8 | ||
| 775 | #define FC_SUBTYPE_ATIM 9 | ||
| 776 | #define FC_SUBTYPE_DISASSOC 10 | ||
| 777 | #define FC_SUBTYPE_AUTH 11 | ||
| 778 | #define FC_SUBTYPE_DEAUTH 12 | ||
| 779 | #define FC_SUBTYPE_ACTION 13 | ||
| 780 | #define FC_SUBTYPE_ACTION_NOACK 14 | ||
| 781 | |||
| 782 | |||
| 783 | #define FC_SUBTYPE_CTL_WRAPPER 7 | ||
| 784 | #define FC_SUBTYPE_BLOCKACK_REQ 8 | ||
| 785 | #define FC_SUBTYPE_BLOCKACK 9 | ||
| 786 | #define FC_SUBTYPE_PS_POLL 10 | ||
| 787 | #define FC_SUBTYPE_RTS 11 | ||
| 788 | #define FC_SUBTYPE_CTS 12 | ||
| 789 | #define FC_SUBTYPE_ACK 13 | ||
| 790 | #define FC_SUBTYPE_CF_END 14 | ||
| 791 | #define FC_SUBTYPE_CF_END_ACK 15 | ||
| 792 | |||
| 793 | |||
| 794 | #define FC_SUBTYPE_DATA 0 | ||
| 795 | #define FC_SUBTYPE_DATA_CF_ACK 1 | ||
| 796 | #define FC_SUBTYPE_DATA_CF_POLL 2 | ||
| 797 | #define FC_SUBTYPE_DATA_CF_ACK_POLL 3 | ||
| 798 | #define FC_SUBTYPE_NULL 4 | ||
| 799 | #define FC_SUBTYPE_CF_ACK 5 | ||
| 800 | #define FC_SUBTYPE_CF_POLL 6 | ||
| 801 | #define FC_SUBTYPE_CF_ACK_POLL 7 | ||
| 802 | #define FC_SUBTYPE_QOS_DATA 8 | ||
| 803 | #define FC_SUBTYPE_QOS_DATA_CF_ACK 9 | ||
| 804 | #define FC_SUBTYPE_QOS_DATA_CF_POLL 10 | ||
| 805 | #define FC_SUBTYPE_QOS_DATA_CF_ACK_POLL 11 | ||
| 806 | #define FC_SUBTYPE_QOS_NULL 12 | ||
| 807 | #define FC_SUBTYPE_QOS_CF_POLL 14 | ||
| 808 | #define FC_SUBTYPE_QOS_CF_ACK_POLL 15 | ||
| 809 | |||
| 810 | |||
| 811 | #define FC_SUBTYPE_ANY_QOS(s) (((s) & 8) != 0) | ||
| 812 | #define FC_SUBTYPE_ANY_NULL(s) (((s) & 4) != 0) | ||
| 813 | #define FC_SUBTYPE_ANY_CF_POLL(s) (((s) & 2) != 0) | ||
| 814 | #define FC_SUBTYPE_ANY_CF_ACK(s) (((s) & 1) != 0) | ||
| 815 | |||
| 816 | |||
| 817 | #define FC_KIND_MASK (FC_TYPE_MASK | FC_SUBTYPE_MASK) | ||
| 818 | |||
| 819 | #define FC_KIND(t, s) (((t) << FC_TYPE_SHIFT) | ((s) << FC_SUBTYPE_SHIFT)) | ||
| 820 | |||
| 821 | #define FC_SUBTYPE(fc) (((fc) & FC_SUBTYPE_MASK) >> FC_SUBTYPE_SHIFT) | ||
| 822 | #define FC_TYPE(fc) (((fc) & FC_TYPE_MASK) >> FC_TYPE_SHIFT) | ||
| 823 | |||
| 824 | #define FC_ASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_REQ) | ||
| 825 | #define FC_ASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_RESP) | ||
| 826 | #define FC_REASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_REQ) | ||
| 827 | #define FC_REASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_RESP) | ||
| 828 | #define FC_PROBE_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_REQ) | ||
| 829 | #define FC_PROBE_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_RESP) | ||
| 830 | #define FC_BEACON FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_BEACON) | ||
| 831 | #define FC_DISASSOC FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DISASSOC) | ||
| 832 | #define FC_AUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_AUTH) | ||
| 833 | #define FC_DEAUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DEAUTH) | ||
| 834 | #define FC_ACTION FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION) | ||
| 835 | #define FC_ACTION_NOACK FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION_NOACK) | ||
| 836 | |||
| 837 | #define FC_CTL_WRAPPER FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTL_WRAPPER) | ||
| 838 | #define FC_BLOCKACK_REQ FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_BLOCKACK_REQ) | ||
| 839 | #define FC_BLOCKACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_BLOCKACK) | ||
| 840 | #define FC_PS_POLL FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_PS_POLL) | ||
| 841 | #define FC_RTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_RTS) | ||
| 842 | #define FC_CTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTS) | ||
| 843 | #define FC_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_ACK) | ||
| 844 | #define FC_CF_END FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END) | ||
| 845 | #define FC_CF_END_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END_ACK) | ||
| 846 | |||
| 847 | #define FC_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA) | ||
| 848 | #define FC_NULL_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_NULL) | ||
| 849 | #define FC_DATA_CF_ACK FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA_CF_ACK) | ||
| 850 | #define FC_QOS_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_DATA) | ||
| 851 | #define FC_QOS_NULL FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_NULL) | ||
| 852 | |||
| 853 | |||
| 854 | |||
| 855 | |||
| 856 | #define QOS_PRIO_SHIFT 0 | ||
| 857 | #define QOS_PRIO_MASK 0x0007 | ||
| 858 | #define QOS_PRIO(qos) (((qos) & QOS_PRIO_MASK) >> QOS_PRIO_SHIFT) | ||
| 859 | |||
| 860 | |||
| 861 | #define QOS_TID_SHIFT 0 | ||
| 862 | #define QOS_TID_MASK 0x000f | ||
| 863 | #define QOS_TID(qos) (((qos) & QOS_TID_MASK) >> QOS_TID_SHIFT) | ||
| 864 | |||
| 865 | |||
| 866 | #define QOS_EOSP_SHIFT 4 | ||
| 867 | #define QOS_EOSP_MASK 0x0010 | ||
| 868 | #define QOS_EOSP(qos) (((qos) & QOS_EOSP_MASK) >> QOS_EOSP_SHIFT) | ||
| 869 | |||
| 870 | |||
| 871 | #define QOS_ACK_NORMAL_ACK 0 | ||
| 872 | #define QOS_ACK_NO_ACK 1 | ||
| 873 | #define QOS_ACK_NO_EXP_ACK 2 | ||
| 874 | #define QOS_ACK_BLOCK_ACK 3 | ||
| 875 | #define QOS_ACK_SHIFT 5 | ||
| 876 | #define QOS_ACK_MASK 0x0060 | ||
| 877 | #define QOS_ACK(qos) (((qos) & QOS_ACK_MASK) >> QOS_ACK_SHIFT) | ||
| 878 | |||
| 879 | |||
| 880 | #define QOS_AMSDU_SHIFT 7 | ||
| 881 | #define QOS_AMSDU_MASK 0x0080 | ||
| 882 | |||
| 883 | |||
| 884 | |||
| 885 | |||
| 886 | |||
| 887 | |||
| 888 | #define DOT11_MNG_AUTH_ALGO_LEN 2 | ||
| 889 | #define DOT11_MNG_AUTH_SEQ_LEN 2 | ||
| 890 | #define DOT11_MNG_BEACON_INT_LEN 2 | ||
| 891 | #define DOT11_MNG_CAP_LEN 2 | ||
| 892 | #define DOT11_MNG_AP_ADDR_LEN 6 | ||
| 893 | #define DOT11_MNG_LISTEN_INT_LEN 2 | ||
| 894 | #define DOT11_MNG_REASON_LEN 2 | ||
| 895 | #define DOT11_MNG_AID_LEN 2 | ||
| 896 | #define DOT11_MNG_STATUS_LEN 2 | ||
| 897 | #define DOT11_MNG_TIMESTAMP_LEN 8 | ||
| 898 | |||
| 899 | |||
| 900 | #define DOT11_AID_MASK 0x3fff | ||
| 901 | |||
| 902 | |||
| 903 | #define DOT11_RC_RESERVED 0 | ||
| 904 | #define DOT11_RC_UNSPECIFIED 1 | ||
| 905 | #define DOT11_RC_AUTH_INVAL 2 | ||
| 906 | #define DOT11_RC_DEAUTH_LEAVING 3 | ||
| 907 | #define DOT11_RC_INACTIVITY 4 | ||
| 908 | #define DOT11_RC_BUSY 5 | ||
| 909 | #define DOT11_RC_INVAL_CLASS_2 6 | ||
| 910 | #define DOT11_RC_INVAL_CLASS_3 7 | ||
| 911 | #define DOT11_RC_DISASSOC_LEAVING 8 | ||
| 912 | #define DOT11_RC_NOT_AUTH 9 | ||
| 913 | #define DOT11_RC_BAD_PC 10 | ||
| 914 | #define DOT11_RC_BAD_CHANNELS 11 | ||
| 915 | |||
| 916 | |||
| 917 | |||
| 918 | #define DOT11_RC_UNSPECIFIED_QOS 32 | ||
| 919 | #define DOT11_RC_INSUFFCIENT_BW 33 | ||
| 920 | #define DOT11_RC_EXCESSIVE_FRAMES 34 | ||
| 921 | #define DOT11_RC_TX_OUTSIDE_TXOP 35 | ||
| 922 | #define DOT11_RC_LEAVING_QBSS 36 | ||
| 923 | #define DOT11_RC_BAD_MECHANISM 37 | ||
| 924 | #define DOT11_RC_SETUP_NEEDED 38 | ||
| 925 | #define DOT11_RC_TIMEOUT 39 | ||
| 926 | |||
| 927 | #define DOT11_RC_MAX 23 | ||
| 928 | |||
| 929 | |||
| 930 | #define DOT11_SC_SUCCESS 0 | ||
| 931 | #define DOT11_SC_FAILURE 1 | ||
| 932 | #define DOT11_SC_CAP_MISMATCH 10 | ||
| 933 | #define DOT11_SC_REASSOC_FAIL 11 | ||
| 934 | #define DOT11_SC_ASSOC_FAIL 12 | ||
| 935 | #define DOT11_SC_AUTH_MISMATCH 13 | ||
| 936 | #define DOT11_SC_AUTH_SEQ 14 | ||
| 937 | #define DOT11_SC_AUTH_CHALLENGE_FAIL 15 | ||
| 938 | #define DOT11_SC_AUTH_TIMEOUT 16 | ||
| 939 | #define DOT11_SC_ASSOC_BUSY_FAIL 17 | ||
| 940 | #define DOT11_SC_ASSOC_RATE_MISMATCH 18 | ||
| 941 | #define DOT11_SC_ASSOC_SHORT_REQUIRED 19 | ||
| 942 | #define DOT11_SC_ASSOC_PBCC_REQUIRED 20 | ||
| 943 | #define DOT11_SC_ASSOC_AGILITY_REQUIRED 21 | ||
| 944 | #define DOT11_SC_ASSOC_SPECTRUM_REQUIRED 22 | ||
| 945 | #define DOT11_SC_ASSOC_BAD_POWER_CAP 23 | ||
| 946 | #define DOT11_SC_ASSOC_BAD_SUP_CHANNELS 24 | ||
| 947 | #define DOT11_SC_ASSOC_SHORTSLOT_REQUIRED 25 | ||
| 948 | #define DOT11_SC_ASSOC_ERPBCC_REQUIRED 26 | ||
| 949 | #define DOT11_SC_ASSOC_DSSOFDM_REQUIRED 27 | ||
| 950 | |||
| 951 | #define DOT11_SC_DECLINED 37 | ||
| 952 | #define DOT11_SC_INVALID_PARAMS 38 | ||
| 953 | #define DOT11_SC_INVALID_AKMP 43 | ||
| 954 | #define DOT11_SC_INVALID_MDID 54 | ||
| 955 | #define DOT11_SC_INVALID_FTIE 55 | ||
| 956 | |||
| 957 | |||
| 958 | #define DOT11_MNG_DS_PARAM_LEN 1 | ||
| 959 | #define DOT11_MNG_IBSS_PARAM_LEN 2 | ||
| 960 | |||
| 961 | |||
| 962 | #define DOT11_MNG_TIM_FIXED_LEN 3 | ||
| 963 | #define DOT11_MNG_TIM_DTIM_COUNT 0 | ||
| 964 | #define DOT11_MNG_TIM_DTIM_PERIOD 1 | ||
| 965 | #define DOT11_MNG_TIM_BITMAP_CTL 2 | ||
| 966 | #define DOT11_MNG_TIM_PVB 3 | ||
| 967 | |||
| 968 | |||
| 969 | #define TLV_TAG_OFF 0 | ||
| 970 | #define TLV_LEN_OFF 1 | ||
| 971 | #define TLV_HDR_LEN 2 | ||
| 972 | #define TLV_BODY_OFF 2 | ||
| 973 | |||
| 974 | |||
| 975 | #define DOT11_MNG_SSID_ID 0 | ||
| 976 | #define DOT11_MNG_RATES_ID 1 | ||
| 977 | #define DOT11_MNG_FH_PARMS_ID 2 | ||
| 978 | #define DOT11_MNG_DS_PARMS_ID 3 | ||
| 979 | #define DOT11_MNG_CF_PARMS_ID 4 | ||
| 980 | #define DOT11_MNG_TIM_ID 5 | ||
| 981 | #define DOT11_MNG_IBSS_PARMS_ID 6 | ||
| 982 | #define DOT11_MNG_COUNTRY_ID 7 | ||
| 983 | #define DOT11_MNG_HOPPING_PARMS_ID 8 | ||
| 984 | #define DOT11_MNG_HOPPING_TABLE_ID 9 | ||
| 985 | #define DOT11_MNG_REQUEST_ID 10 | ||
| 986 | #define DOT11_MNG_QBSS_LOAD_ID 11 | ||
| 987 | #define DOT11_MNG_EDCA_PARAM_ID 12 | ||
| 988 | #define DOT11_MNG_CHALLENGE_ID 16 | ||
| 989 | #define DOT11_MNG_PWR_CONSTRAINT_ID 32 | ||
| 990 | #define DOT11_MNG_PWR_CAP_ID 33 | ||
| 991 | #define DOT11_MNG_TPC_REQUEST_ID 34 | ||
| 992 | #define DOT11_MNG_TPC_REPORT_ID 35 | ||
| 993 | #define DOT11_MNG_SUPP_CHANNELS_ID 36 | ||
| 994 | #define DOT11_MNG_CHANNEL_SWITCH_ID 37 | ||
| 995 | #define DOT11_MNG_MEASURE_REQUEST_ID 38 | ||
| 996 | #define DOT11_MNG_MEASURE_REPORT_ID 39 | ||
| 997 | #define DOT11_MNG_QUIET_ID 40 | ||
| 998 | #define DOT11_MNG_IBSS_DFS_ID 41 | ||
| 999 | #define DOT11_MNG_ERP_ID 42 | ||
| 1000 | #define DOT11_MNG_TS_DELAY_ID 43 | ||
| 1001 | #define DOT11_MNG_HT_CAP 45 | ||
| 1002 | #define DOT11_MNG_QOS_CAP_ID 46 | ||
| 1003 | #define DOT11_MNG_NONERP_ID 47 | ||
| 1004 | #define DOT11_MNG_RSN_ID 48 | ||
| 1005 | #define DOT11_MNG_EXT_RATES_ID 50 | ||
| 1006 | #define DOT11_MNG_AP_CHREP_ID 51 | ||
| 1007 | #define DOT11_MNG_NBR_REP_ID 52 | ||
| 1008 | #define DOT11_MNG_MDIE_ID 54 | ||
| 1009 | #define DOT11_MNG_FTIE_ID 55 | ||
| 1010 | #define DOT11_MNG_FT_TI_ID 56 | ||
| 1011 | #define DOT11_MNG_REGCLASS_ID 59 | ||
| 1012 | #define DOT11_MNG_EXT_CSA_ID 60 | ||
| 1013 | #define DOT11_MNG_HT_ADD 61 | ||
| 1014 | #define DOT11_MNG_EXT_CHANNEL_OFFSET 62 | ||
| 1015 | |||
| 1016 | |||
| 1017 | #define DOT11_MNG_RRM_CAP_ID 70 | ||
| 1018 | #define DOT11_MNG_HT_BSS_COEXINFO_ID 72 | ||
| 1019 | #define DOT11_MNG_HT_BSS_CHANNEL_REPORT_ID 73 | ||
| 1020 | #define DOT11_MNG_HT_OBSS_ID 74 | ||
| 1021 | #define DOT11_MNG_EXT_CAP 127 | ||
| 1022 | #define DOT11_MNG_WPA_ID 221 | ||
| 1023 | #define DOT11_MNG_PROPR_ID 221 | ||
| 1024 | |||
| 1025 | #define DOT11_MNG_VS_ID 221 | ||
| 1026 | |||
| 1027 | |||
| 1028 | #define DOT11_RATE_BASIC 0x80 | ||
| 1029 | #define DOT11_RATE_MASK 0x7F | ||
| 1030 | |||
| 1031 | |||
| 1032 | #define DOT11_MNG_ERP_LEN 1 | ||
| 1033 | #define DOT11_MNG_NONERP_PRESENT 0x01 | ||
| 1034 | #define DOT11_MNG_USE_PROTECTION 0x02 | ||
| 1035 | #define DOT11_MNG_BARKER_PREAMBLE 0x04 | ||
| 1036 | |||
| 1037 | #define DOT11_MGN_TS_DELAY_LEN 4 | ||
| 1038 | #define TS_DELAY_FIELD_SIZE 4 | ||
| 1039 | |||
| 1040 | |||
| 1041 | #define DOT11_CAP_ESS 0x0001 | ||
| 1042 | #define DOT11_CAP_IBSS 0x0002 | ||
| 1043 | #define DOT11_CAP_POLLABLE 0x0004 | ||
| 1044 | #define DOT11_CAP_POLL_RQ 0x0008 | ||
| 1045 | #define DOT11_CAP_PRIVACY 0x0010 | ||
| 1046 | #define DOT11_CAP_SHORT 0x0020 | ||
| 1047 | #define DOT11_CAP_PBCC 0x0040 | ||
| 1048 | #define DOT11_CAP_AGILITY 0x0080 | ||
| 1049 | #define DOT11_CAP_SPECTRUM 0x0100 | ||
| 1050 | #define DOT11_CAP_SHORTSLOT 0x0400 | ||
| 1051 | #define DOT11_CAP_RRM 0x1000 | ||
| 1052 | #define DOT11_CAP_CCK_OFDM 0x2000 | ||
| 1053 | |||
| 1054 | |||
| 1055 | #define DOT11_OBSS_COEX_MNG_SUPPORT 0x01 | ||
| 1056 | |||
| 1057 | |||
| 1058 | #define DOT11_ACTION_HDR_LEN 2 | ||
| 1059 | #define DOT11_ACTION_CAT_OFF 0 | ||
| 1060 | #define DOT11_ACTION_ACT_OFF 1 | ||
| 1061 | |||
| 1062 | |||
| 1063 | #define DOT11_ACTION_CAT_ERR_MASK 0x80 | ||
| 1064 | #define DOT11_ACTION_CAT_MASK 0x7F | ||
| 1065 | #define DOT11_ACTION_CAT_SPECT_MNG 0 | ||
| 1066 | #define DOT11_ACTION_CAT_QOS 1 | ||
| 1067 | #define DOT11_ACTION_CAT_DLS 2 | ||
| 1068 | #define DOT11_ACTION_CAT_BLOCKACK 3 | ||
| 1069 | #define DOT11_ACTION_CAT_PUBLIC 4 | ||
| 1070 | #define DOT11_ACTION_CAT_RRM 5 | ||
| 1071 | #define DOT11_ACTION_CAT_FBT 6 | ||
| 1072 | #define DOT11_ACTION_CAT_HT 7 | ||
| 1073 | #define DOT11_ACTION_CAT_BSSMGMT 10 | ||
| 1074 | #define DOT11_ACTION_NOTIFICATION 17 | ||
| 1075 | #define DOT11_ACTION_CAT_VS 127 | ||
| 1076 | |||
| 1077 | |||
| 1078 | #define DOT11_SM_ACTION_M_REQ 0 | ||
| 1079 | #define DOT11_SM_ACTION_M_REP 1 | ||
| 1080 | #define DOT11_SM_ACTION_TPC_REQ 2 | ||
| 1081 | #define DOT11_SM_ACTION_TPC_REP 3 | ||
| 1082 | #define DOT11_SM_ACTION_CHANNEL_SWITCH 4 | ||
| 1083 | #define DOT11_SM_ACTION_EXT_CSA 5 | ||
| 1084 | |||
| 1085 | |||
| 1086 | #define DOT11_ACTION_ID_HT_CH_WIDTH 0 | ||
| 1087 | #define DOT11_ACTION_ID_HT_MIMO_PS 1 | ||
| 1088 | |||
| 1089 | |||
| 1090 | #define DOT11_PUB_ACTION_BSS_COEX_MNG 0 | ||
| 1091 | #define DOT11_PUB_ACTION_CHANNEL_SWITCH 4 | ||
| 1092 | |||
| 1093 | |||
| 1094 | #define DOT11_BA_ACTION_ADDBA_REQ 0 | ||
| 1095 | #define DOT11_BA_ACTION_ADDBA_RESP 1 | ||
| 1096 | #define DOT11_BA_ACTION_DELBA 2 | ||
| 1097 | |||
| 1098 | |||
| 1099 | #define DOT11_ADDBA_PARAM_AMSDU_SUP 0x0001 | ||
| 1100 | #define DOT11_ADDBA_PARAM_POLICY_MASK 0x0002 | ||
| 1101 | #define DOT11_ADDBA_PARAM_POLICY_SHIFT 1 | ||
| 1102 | #define DOT11_ADDBA_PARAM_TID_MASK 0x003c | ||
| 1103 | #define DOT11_ADDBA_PARAM_TID_SHIFT 2 | ||
| 1104 | #define DOT11_ADDBA_PARAM_BSIZE_MASK 0xffc0 | ||
| 1105 | #define DOT11_ADDBA_PARAM_BSIZE_SHIFT 6 | ||
| 1106 | |||
| 1107 | #define DOT11_ADDBA_POLICY_DELAYED 0 | ||
| 1108 | #define DOT11_ADDBA_POLICY_IMMEDIATE 1 | ||
| 1109 | |||
| 1110 | BWL_PRE_PACKED_STRUCT struct dot11_addba_req { | ||
| 1111 | uint8 category; | ||
| 1112 | uint8 action; | ||
| 1113 | uint8 token; | ||
| 1114 | uint16 addba_param_set; | ||
| 1115 | uint16 timeout; | ||
| 1116 | uint16 start_seqnum; | ||
| 1117 | } BWL_POST_PACKED_STRUCT; | ||
| 1118 | typedef struct dot11_addba_req dot11_addba_req_t; | ||
| 1119 | #define DOT11_ADDBA_REQ_LEN 9 | ||
| 1120 | |||
| 1121 | BWL_PRE_PACKED_STRUCT struct dot11_addba_resp { | ||
| 1122 | uint8 category; | ||
| 1123 | uint8 action; | ||
| 1124 | uint8 token; | ||
| 1125 | uint16 status; | ||
| 1126 | uint16 addba_param_set; | ||
| 1127 | uint16 timeout; | ||
| 1128 | } BWL_POST_PACKED_STRUCT; | ||
| 1129 | typedef struct dot11_addba_resp dot11_addba_resp_t; | ||
| 1130 | #define DOT11_ADDBA_RESP_LEN 9 | ||
| 1131 | |||
| 1132 | |||
| 1133 | #define DOT11_DELBA_PARAM_INIT_MASK 0x0800 | ||
| 1134 | #define DOT11_DELBA_PARAM_INIT_SHIFT 11 | ||
| 1135 | #define DOT11_DELBA_PARAM_TID_MASK 0xf000 | ||
| 1136 | #define DOT11_DELBA_PARAM_TID_SHIFT 12 | ||
| 1137 | |||
| 1138 | BWL_PRE_PACKED_STRUCT struct dot11_delba { | ||
| 1139 | uint8 category; | ||
| 1140 | uint8 action; | ||
| 1141 | uint16 delba_param_set; | ||
| 1142 | uint16 reason; | ||
| 1143 | } BWL_POST_PACKED_STRUCT; | ||
| 1144 | typedef struct dot11_delba dot11_delba_t; | ||
| 1145 | #define DOT11_DELBA_LEN 6 | ||
| 1146 | |||
| 1147 | |||
| 1148 | |||
| 1149 | |||
| 1150 | |||
| 1151 | #define DOT11_RRM_CAP_LEN 5 | ||
| 1152 | BWL_PRE_PACKED_STRUCT struct dot11_rrm_cap_ie { | ||
| 1153 | uint8 cap[DOT11_RRM_CAP_LEN]; | ||
| 1154 | } BWL_POST_PACKED_STRUCT; | ||
| 1155 | typedef struct dot11_rrm_cap_ie dot11_rrm_cap_ie_t; | ||
| 1156 | |||
| 1157 | |||
| 1158 | #define DOT11_RRM_CAP_LINK 0 | ||
| 1159 | #define DOT11_RRM_CAP_NEIGHBOR_REPORT 1 | ||
| 1160 | #define DOT11_RRM_CAP_PARALLEL 2 | ||
| 1161 | #define DOT11_RRM_CAP_REPEATED 3 | ||
| 1162 | #define DOT11_RRM_CAP_BCN_PASSIVE 4 | ||
| 1163 | #define DOT11_RRM_CAP_BCN_ACTIVE 5 | ||
| 1164 | #define DOT11_RRM_CAP_BCN_TABLE 6 | ||
| 1165 | #define DOT11_RRM_CAP_BCN_REP_COND 7 | ||
| 1166 | #define DOT11_RRM_CAP_AP_CHANREP 16 | ||
| 1167 | |||
| 1168 | |||
| 1169 | #define DOT11_RM_ACTION_RM_REQ 0 | ||
| 1170 | #define DOT11_RM_ACTION_RM_REP 1 | ||
| 1171 | #define DOT11_RM_ACTION_LM_REQ 2 | ||
| 1172 | #define DOT11_RM_ACTION_LM_REP 3 | ||
| 1173 | #define DOT11_RM_ACTION_NR_REQ 4 | ||
| 1174 | #define DOT11_RM_ACTION_NR_REP 5 | ||
| 1175 | |||
| 1176 | |||
| 1177 | BWL_PRE_PACKED_STRUCT struct dot11_rm_action { | ||
| 1178 | uint8 category; | ||
| 1179 | uint8 action; | ||
| 1180 | uint8 token; | ||
| 1181 | uint8 data[1]; | ||
| 1182 | } BWL_POST_PACKED_STRUCT; | ||
| 1183 | typedef struct dot11_rm_action dot11_rm_action_t; | ||
| 1184 | #define DOT11_RM_ACTION_LEN 3 | ||
| 1185 | |||
| 1186 | BWL_PRE_PACKED_STRUCT struct dot11_rmreq { | ||
| 1187 | uint8 category; | ||
| 1188 | uint8 action; | ||
| 1189 | uint8 token; | ||
| 1190 | uint16 reps; | ||
| 1191 | } BWL_POST_PACKED_STRUCT; | ||
| 1192 | typedef struct dot11_rmreq dot11_rmreq_t; | ||
| 1193 | #define DOT11_RMREQ_LEN 5 | ||
| 1194 | |||
| 1195 | BWL_PRE_PACKED_STRUCT struct dot11_rm_ie { | ||
| 1196 | uint8 id; | ||
| 1197 | uint8 len; | ||
| 1198 | uint8 token; | ||
| 1199 | uint8 mode; | ||
| 1200 | uint8 type; | ||
| 1201 | } BWL_POST_PACKED_STRUCT; | ||
| 1202 | typedef struct dot11_rm_ie dot11_rm_ie_t; | ||
| 1203 | #define DOT11_RM_IE_LEN 5 | ||
| 1204 | |||
| 1205 | |||
| 1206 | #define DOT11_RMREQ_MODE_PARALLEL 1 | ||
| 1207 | #define DOT11_RMREQ_MODE_ENABLE 2 | ||
| 1208 | #define DOT11_RMREQ_MODE_REQUEST 4 | ||
| 1209 | #define DOT11_RMREQ_MODE_REPORT 8 | ||
| 1210 | #define DOT11_RMREQ_MODE_DURMAND 0x10 | ||
| 1211 | |||
| 1212 | |||
| 1213 | #define DOT11_RMREP_MODE_LATE 1 | ||
| 1214 | #define DOT11_RMREP_MODE_INCAPABLE 2 | ||
| 1215 | #define DOT11_RMREP_MODE_REFUSED 4 | ||
| 1216 | |||
| 1217 | BWL_PRE_PACKED_STRUCT struct dot11_rmreq_bcn { | ||
| 1218 | uint8 id; | ||
| 1219 | uint8 len; | ||
| 1220 | uint8 token; | ||
| 1221 | uint8 mode; | ||
| 1222 | uint8 type; | ||
| 1223 | uint8 reg; | ||
| 1224 | uint8 channel; | ||
| 1225 | uint16 interval; | ||
| 1226 | uint16 duration; | ||
| 1227 | uint8 bcn_mode; | ||
| 1228 | struct ether_addr bssid; | ||
| 1229 | } BWL_POST_PACKED_STRUCT; | ||
| 1230 | typedef struct dot11_rmreq_bcn dot11_rmreq_bcn_t; | ||
| 1231 | #define DOT11_RMREQ_BCN_LEN 18 | ||
| 1232 | |||
| 1233 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_bcn { | ||
| 1234 | uint8 reg; | ||
| 1235 | uint8 channel; | ||
| 1236 | uint32 starttime[2]; | ||
| 1237 | uint16 duration; | ||
| 1238 | uint8 frame_info; | ||
| 1239 | uint8 rcpi; | ||
| 1240 | uint8 rsni; | ||
| 1241 | struct ether_addr bssid; | ||
| 1242 | uint8 antenna_id; | ||
| 1243 | uint32 parent_tsf; | ||
| 1244 | } BWL_POST_PACKED_STRUCT; | ||
| 1245 | typedef struct dot11_rmrep_bcn dot11_rmrep_bcn_t; | ||
| 1246 | #define DOT11_RMREP_BCN_LEN 26 | ||
| 1247 | |||
| 1248 | |||
| 1249 | #define DOT11_RMREQ_BCN_PASSIVE 0 | ||
| 1250 | #define DOT11_RMREQ_BCN_ACTIVE 1 | ||
| 1251 | #define DOT11_RMREQ_BCN_TABLE 2 | ||
| 1252 | |||
| 1253 | |||
| 1254 | #define DOT11_RMREQ_BCN_SSID_ID 0 | ||
| 1255 | #define DOT11_RMREQ_BCN_REPINFO_ID 1 | ||
| 1256 | #define DOT11_RMREQ_BCN_REPDET_ID 2 | ||
| 1257 | #define DOT11_RMREQ_BCN_REQUEST_ID 10 | ||
| 1258 | #define DOT11_RMREQ_BCN_APCHREP_ID 51 | ||
| 1259 | |||
| 1260 | |||
| 1261 | #define DOT11_RMREQ_BCN_REPDET_FIXED 0 | ||
| 1262 | #define DOT11_RMREQ_BCN_REPDET_REQUEST 1 | ||
| 1263 | #define DOT11_RMREQ_BCN_REPDET_ALL 2 | ||
| 1264 | |||
| 1265 | |||
| 1266 | #define DOT11_RMREP_BCN_FRM_BODY 1 | ||
| 1267 | |||
| 1268 | |||
| 1269 | BWL_PRE_PACKED_STRUCT struct dot11_rmrep_nbr { | ||
| 1270 | struct ether_addr bssid; | ||
| 1271 | uint32 bssid_info; | ||
| 1272 | uint8 reg; | ||
| 1273 | uint8 channel; | ||
| 1274 | uint8 phytype; | ||
| 1275 | } BWL_POST_PACKED_STRUCT; | ||
| 1276 | typedef struct dot11_rmrep_nbr dot11_rmrep_nbr_t; | ||
| 1277 | #define DOT11_RMREP_NBR_LEN 13 | ||
| 1278 | |||
| 1279 | |||
| 1280 | #define DOT11_BSSTYPE_INFRASTRUCTURE 0 | ||
| 1281 | #define DOT11_BSSTYPE_INDEPENDENT 1 | ||
| 1282 | #define DOT11_BSSTYPE_ANY 2 | ||
| 1283 | #define DOT11_SCANTYPE_ACTIVE 0 | ||
| 1284 | #define DOT11_SCANTYPE_PASSIVE 1 | ||
| 1285 | |||
| 1286 | |||
| 1287 | BWL_PRE_PACKED_STRUCT struct dot11_lmreq { | ||
| 1288 | uint8 category; | ||
| 1289 | uint8 action; | ||
| 1290 | uint8 token; | ||
| 1291 | uint8 txpwr; | ||
| 1292 | uint8 maxtxpwr; | ||
| 1293 | } BWL_POST_PACKED_STRUCT; | ||
| 1294 | typedef struct dot11_lmreq dot11_lmreq_t; | ||
| 1295 | #define DOT11_LMREQ_LEN 5 | ||
| 1296 | |||
| 1297 | BWL_PRE_PACKED_STRUCT struct dot11_lmrep { | ||
| 1298 | uint8 category; | ||
| 1299 | uint8 action; | ||
| 1300 | uint8 token; | ||
| 1301 | dot11_tpc_rep_t tpc; | ||
| 1302 | uint8 rxant; | ||
| 1303 | uint8 txant; | ||
| 1304 | uint8 rcpi; | ||
| 1305 | uint8 rsni; | ||
| 1306 | } BWL_POST_PACKED_STRUCT; | ||
| 1307 | typedef struct dot11_lmrep dot11_lmrep_t; | ||
| 1308 | #define DOT11_LMREP_LEN 11 | ||
| 1309 | |||
| 1310 | |||
| 1311 | #define PREN_PREAMBLE 24 | ||
| 1312 | #define PREN_MM_EXT 12 | ||
| 1313 | #define PREN_PREAMBLE_EXT 4 | ||
| 1314 | |||
| 1315 | |||
| 1316 | #define RIFS_11N_TIME 2 | ||
| 1317 | |||
| 1318 | |||
| 1319 | |||
| 1320 | #define HT_SIG1_MCS_MASK 0x00007F | ||
| 1321 | #define HT_SIG1_CBW 0x000080 | ||
| 1322 | #define HT_SIG1_HT_LENGTH 0xFFFF00 | ||
| 1323 | |||
| 1324 | |||
| 1325 | #define HT_SIG2_SMOOTHING 0x000001 | ||
| 1326 | #define HT_SIG2_NOT_SOUNDING 0x000002 | ||
| 1327 | #define HT_SIG2_RESERVED 0x000004 | ||
| 1328 | #define HT_SIG2_AGGREGATION 0x000008 | ||
| 1329 | #define HT_SIG2_STBC_MASK 0x000030 | ||
| 1330 | #define HT_SIG2_STBC_SHIFT 4 | ||
| 1331 | #define HT_SIG2_FEC_CODING 0x000040 | ||
| 1332 | #define HT_SIG2_SHORT_GI 0x000080 | ||
| 1333 | #define HT_SIG2_ESS_MASK 0x000300 | ||
| 1334 | #define HT_SIG2_ESS_SHIFT 8 | ||
| 1335 | #define HT_SIG2_CRC 0x03FC00 | ||
| 1336 | #define HT_SIG2_TAIL 0x1C0000 | ||
| 1337 | |||
| 1338 | |||
| 1339 | #define APHY_SLOT_TIME 9 | ||
| 1340 | #define APHY_SIFS_TIME 16 | ||
| 1341 | #define APHY_DIFS_TIME (APHY_SIFS_TIME + (2 * APHY_SLOT_TIME)) | ||
| 1342 | #define APHY_PREAMBLE_TIME 16 | ||
| 1343 | #define APHY_SIGNAL_TIME 4 | ||
| 1344 | #define APHY_SYMBOL_TIME 4 | ||
| 1345 | #define APHY_SERVICE_NBITS 16 | ||
| 1346 | #define APHY_TAIL_NBITS 6 | ||
| 1347 | #define APHY_CWMIN 15 | ||
| 1348 | |||
| 1349 | |||
| 1350 | #define BPHY_SLOT_TIME 20 | ||
| 1351 | #define BPHY_SIFS_TIME 10 | ||
| 1352 | #define BPHY_DIFS_TIME 50 | ||
| 1353 | #define BPHY_PLCP_TIME 192 | ||
| 1354 | #define BPHY_PLCP_SHORT_TIME 96 | ||
| 1355 | #define BPHY_CWMIN 31 | ||
| 1356 | |||
| 1357 | |||
| 1358 | #define DOT11_OFDM_SIGNAL_EXTENSION 6 | ||
| 1359 | |||
| 1360 | #define PHY_CWMAX 1023 | ||
| 1361 | |||
| 1362 | #define DOT11_MAXNUMFRAGS 16 | ||
| 1363 | |||
| 1364 | |||
| 1365 | typedef struct d11cnt { | ||
| 1366 | uint32 txfrag; | ||
| 1367 | uint32 txmulti; | ||
| 1368 | uint32 txfail; | ||
| 1369 | uint32 txretry; | ||
| 1370 | uint32 txretrie; | ||
| 1371 | uint32 rxdup; | ||
| 1372 | uint32 txrts; | ||
| 1373 | uint32 txnocts; | ||
| 1374 | uint32 txnoack; | ||
| 1375 | uint32 rxfrag; | ||
| 1376 | uint32 rxmulti; | ||
| 1377 | uint32 rxcrc; | ||
| 1378 | uint32 txfrmsnt; | ||
| 1379 | uint32 rxundec; | ||
| 1380 | } d11cnt_t; | ||
| 1381 | |||
| 1382 | |||
| 1383 | #define BRCM_PROP_OUI "\x00\x90\x4C" | ||
| 1384 | |||
| 1385 | |||
| 1386 | |||
| 1387 | #define BRCM_OUI "\x00\x10\x18" | ||
| 1388 | |||
| 1389 | |||
| 1390 | BWL_PRE_PACKED_STRUCT struct brcm_ie { | ||
| 1391 | uint8 id; | ||
| 1392 | uint8 len; | ||
| 1393 | uint8 oui[3]; | ||
| 1394 | uint8 ver; | ||
| 1395 | uint8 assoc; | ||
| 1396 | uint8 flags; | ||
| 1397 | uint8 flags1; | ||
| 1398 | uint16 amsdu_mtu_pref; | ||
| 1399 | } BWL_POST_PACKED_STRUCT; | ||
| 1400 | typedef struct brcm_ie brcm_ie_t; | ||
| 1401 | #define BRCM_IE_LEN 11 | ||
| 1402 | #define BRCM_IE_VER 2 | ||
| 1403 | #define BRCM_IE_LEGACY_AES_VER 1 | ||
| 1404 | |||
| 1405 | |||
| 1406 | #ifdef WLAFTERBURNER | ||
| 1407 | #define BRF_ABCAP 0x1 | ||
| 1408 | #define BRF_ABRQRD 0x2 | ||
| 1409 | #define BRF_ABCOUNTER_MASK 0xf0 | ||
| 1410 | #define BRF_ABCOUNTER_SHIFT 4 | ||
| 1411 | #endif | ||
| 1412 | #define BRF_LZWDS 0x4 | ||
| 1413 | #define BRF_BLOCKACK 0x8 | ||
| 1414 | |||
| 1415 | |||
| 1416 | #define BRF1_AMSDU 0x1 | ||
| 1417 | #define BRF1_WMEPS 0x4 | ||
| 1418 | #define BRF1_PSOFIX 0x8 | ||
| 1419 | #define BRF1_RX_LARGE_AGG 0x10 | ||
| 1420 | #define BRF1_SOFTAP 0x40 | ||
| 1421 | |||
| 1422 | #ifdef WLAFTERBURNER | ||
| 1423 | #define AB_WDS_TIMEOUT_MAX 15 | ||
| 1424 | #define AB_WDS_TIMEOUT_MIN 1 | ||
| 1425 | #endif | ||
| 1426 | |||
| 1427 | #define AB_GUARDCOUNT 10 | ||
| 1428 | |||
| 1429 | |||
| 1430 | BWL_PRE_PACKED_STRUCT struct vndr_ie { | ||
| 1431 | uchar id; | ||
| 1432 | uchar len; | ||
| 1433 | uchar oui [3]; | ||
| 1434 | uchar data [1]; | ||
| 1435 | } BWL_POST_PACKED_STRUCT; | ||
| 1436 | typedef struct vndr_ie vndr_ie_t; | ||
| 1437 | |||
| 1438 | #define VNDR_IE_HDR_LEN 2 | ||
| 1439 | #define VNDR_IE_MIN_LEN 3 | ||
| 1440 | #define VNDR_IE_MAX_LEN 256 | ||
| 1441 | |||
| 1442 | |||
| 1443 | #define MCSSET_LEN 16 | ||
| 1444 | #define MAX_MCS_NUM (128) | ||
| 1445 | |||
| 1446 | BWL_PRE_PACKED_STRUCT struct ht_cap_ie { | ||
| 1447 | uint16 cap; | ||
| 1448 | uint8 params; | ||
| 1449 | uint8 supp_mcs[MCSSET_LEN]; | ||
| 1450 | uint16 ext_htcap; | ||
| 1451 | uint32 txbf_cap; | ||
| 1452 | uint8 as_cap; | ||
| 1453 | } BWL_POST_PACKED_STRUCT; | ||
| 1454 | typedef struct ht_cap_ie ht_cap_ie_t; | ||
| 1455 | |||
| 1456 | |||
| 1457 | |||
| 1458 | BWL_PRE_PACKED_STRUCT struct ht_prop_cap_ie { | ||
| 1459 | uint8 id; | ||
| 1460 | uint8 len; | ||
| 1461 | uint8 oui[3]; | ||
| 1462 | uint8 type; | ||
| 1463 | ht_cap_ie_t cap_ie; | ||
| 1464 | } BWL_POST_PACKED_STRUCT; | ||
| 1465 | typedef struct ht_prop_cap_ie ht_prop_cap_ie_t; | ||
| 1466 | |||
| 1467 | #define HT_PROP_IE_OVERHEAD 4 | ||
| 1468 | #define HT_CAP_IE_LEN 26 | ||
| 1469 | #define HT_CAP_IE_TYPE 51 | ||
| 1470 | |||
| 1471 | #define HT_CAP_LDPC_CODING 0x0001 | ||
| 1472 | #define HT_CAP_40MHZ 0x0002 | ||
| 1473 | #define HT_CAP_MIMO_PS_MASK 0x000C | ||
| 1474 | #define HT_CAP_MIMO_PS_SHIFT 0x0002 | ||
| 1475 | #define HT_CAP_MIMO_PS_OFF 0x0003 | ||
| 1476 | #define HT_CAP_MIMO_PS_RTS 0x0001 | ||
| 1477 | #define HT_CAP_MIMO_PS_ON 0x0000 | ||
| 1478 | #define HT_CAP_GF 0x0010 | ||
| 1479 | #define HT_CAP_SHORT_GI_20 0x0020 | ||
| 1480 | #define HT_CAP_SHORT_GI_40 0x0040 | ||
| 1481 | #define HT_CAP_TX_STBC 0x0080 | ||
| 1482 | #define HT_CAP_RX_STBC_MASK 0x0300 | ||
| 1483 | #define HT_CAP_RX_STBC_SHIFT 8 | ||
| 1484 | #define HT_CAP_DELAYED_BA 0x0400 | ||
| 1485 | #define HT_CAP_MAX_AMSDU 0x0800 | ||
| 1486 | #define HT_CAP_DSSS_CCK 0x1000 | ||
| 1487 | #define HT_CAP_PSMP 0x2000 | ||
| 1488 | #define HT_CAP_40MHZ_INTOLERANT 0x4000 | ||
| 1489 | #define HT_CAP_LSIG_TXOP 0x8000 | ||
| 1490 | |||
| 1491 | #define HT_CAP_RX_STBC_NO 0x0 | ||
| 1492 | #define HT_CAP_RX_STBC_ONE_STREAM 0x1 | ||
| 1493 | #define HT_CAP_RX_STBC_TWO_STREAM 0x2 | ||
| 1494 | #define HT_CAP_RX_STBC_THREE_STREAM 0x3 | ||
| 1495 | |||
| 1496 | #define HT_MAX_AMSDU 7935 | ||
| 1497 | #define HT_MIN_AMSDU 3835 | ||
| 1498 | |||
| 1499 | #define HT_PARAMS_RX_FACTOR_MASK 0x03 | ||
| 1500 | #define HT_PARAMS_DENSITY_MASK 0x1C | ||
| 1501 | #define HT_PARAMS_DENSITY_SHIFT 2 | ||
| 1502 | |||
| 1503 | |||
| 1504 | #define AMPDU_MAX_MPDU_DENSITY 7 | ||
| 1505 | #define AMPDU_RX_FACTOR_8K 0 | ||
| 1506 | #define AMPDU_RX_FACTOR_16K 1 | ||
| 1507 | #define AMPDU_RX_FACTOR_32K 2 | ||
| 1508 | #define AMPDU_RX_FACTOR_64K 3 | ||
| 1509 | #define AMPDU_RX_FACTOR_BASE 8*1024 | ||
| 1510 | |||
| 1511 | #define AMPDU_DELIMITER_LEN 4 | ||
| 1512 | #define AMPDU_DELIMITER_LEN_MAX 63 | ||
| 1513 | |||
| 1514 | BWL_PRE_PACKED_STRUCT struct ht_add_ie { | ||
| 1515 | uint8 ctl_ch; | ||
| 1516 | uint8 byte1; | ||
| 1517 | uint16 opmode; | ||
| 1518 | uint16 misc_bits; | ||
| 1519 | uint8 basic_mcs[MCSSET_LEN]; | ||
| 1520 | } BWL_POST_PACKED_STRUCT; | ||
| 1521 | typedef struct ht_add_ie ht_add_ie_t; | ||
| 1522 | |||
| 1523 | |||
| 1524 | |||
| 1525 | BWL_PRE_PACKED_STRUCT struct ht_prop_add_ie { | ||
| 1526 | uint8 id; | ||
| 1527 | uint8 len; | ||
| 1528 | uint8 oui[3]; | ||
| 1529 | uint8 type; | ||
| 1530 | ht_add_ie_t add_ie; | ||
| 1531 | } BWL_POST_PACKED_STRUCT; | ||
| 1532 | typedef struct ht_prop_add_ie ht_prop_add_ie_t; | ||
| 1533 | |||
| 1534 | #define HT_ADD_IE_LEN 22 | ||
| 1535 | #define HT_ADD_IE_TYPE 52 | ||
| 1536 | |||
| 1537 | |||
| 1538 | #define HT_BW_ANY 0x04 | ||
| 1539 | #define HT_RIFS_PERMITTED 0x08 | ||
| 1540 | |||
| 1541 | |||
| 1542 | #define HT_OPMODE_MASK 0x0003 | ||
| 1543 | #define HT_OPMODE_SHIFT 0 | ||
| 1544 | #define HT_OPMODE_PURE 0x0000 | ||
| 1545 | #define HT_OPMODE_OPTIONAL 0x0001 | ||
| 1546 | #define HT_OPMODE_HT20IN40 0x0002 | ||
| 1547 | #define HT_OPMODE_MIXED 0x0003 | ||
| 1548 | #define HT_OPMODE_NONGF 0x0004 | ||
| 1549 | #define DOT11N_TXBURST 0x0008 | ||
| 1550 | #define DOT11N_OBSS_NONHT 0x0010 | ||
| 1551 | |||
| 1552 | |||
| 1553 | #define HT_BASIC_STBC_MCS 0x007f | ||
| 1554 | #define HT_DUAL_STBC_PROT 0x0080 | ||
| 1555 | #define HT_SECOND_BCN 0x0100 | ||
| 1556 | #define HT_LSIG_TXOP 0x0200 | ||
| 1557 | #define HT_PCO_ACTIVE 0x0400 | ||
| 1558 | #define HT_PCO_PHASE 0x0800 | ||
| 1559 | |||
| 1560 | |||
| 1561 | #define DOT11N_2G_TXBURST_LIMIT 6160 | ||
| 1562 | #define DOT11N_5G_TXBURST_LIMIT 3080 | ||
| 1563 | |||
| 1564 | |||
| 1565 | #define GET_HT_OPMODE(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ | ||
| 1566 | >> HT_OPMODE_SHIFT) | ||
| 1567 | #define HT_MIXEDMODE_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ | ||
| 1568 | == HT_OPMODE_MIXED) | ||
| 1569 | #define HT_HT20_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ | ||
| 1570 | == HT_OPMODE_HT20IN40) | ||
| 1571 | #define HT_OPTIONAL_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \ | ||
| 1572 | == HT_OPMODE_OPTIONAL) | ||
| 1573 | #define HT_USE_PROTECTION(add_ie) (HT_HT20_PRESENT((add_ie)) || \ | ||
| 1574 | HT_MIXEDMODE_PRESENT((add_ie))) | ||
| 1575 | #define HT_NONGF_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_NONGF) \ | ||
| 1576 | == HT_OPMODE_NONGF) | ||
| 1577 | #define DOT11N_TXBURST_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & DOT11N_TXBURST) \ | ||
| 1578 | == DOT11N_TXBURST) | ||
| 1579 | #define DOT11N_OBSS_NONHT_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & DOT11N_OBSS_NONHT) \ | ||
| 1580 | == DOT11N_OBSS_NONHT) | ||
| 1581 | |||
| 1582 | BWL_PRE_PACKED_STRUCT struct obss_params { | ||
| 1583 | uint16 passive_dwell; | ||
| 1584 | uint16 active_dwell; | ||
| 1585 | uint16 bss_widthscan_interval; | ||
| 1586 | uint16 passive_total; | ||
| 1587 | uint16 active_total; | ||
| 1588 | uint16 chanwidth_transition_dly; | ||
| 1589 | uint16 activity_threshold; | ||
| 1590 | } BWL_POST_PACKED_STRUCT; | ||
| 1591 | typedef struct obss_params obss_params_t; | ||
| 1592 | |||
| 1593 | BWL_PRE_PACKED_STRUCT struct dot11_obss_ie { | ||
| 1594 | uint8 id; | ||
| 1595 | uint8 len; | ||
| 1596 | obss_params_t obss_params; | ||
| 1597 | } BWL_POST_PACKED_STRUCT; | ||
| 1598 | typedef struct dot11_obss_ie dot11_obss_ie_t; | ||
| 1599 | #define DOT11_OBSS_SCAN_IE_LEN sizeof(obss_params_t) | ||
| 1600 | |||
| 1601 | |||
| 1602 | #define HT_CTRL_LA_TRQ 0x00000002 | ||
| 1603 | #define HT_CTRL_LA_MAI 0x0000003C | ||
| 1604 | #define HT_CTRL_LA_MAI_SHIFT 2 | ||
| 1605 | #define HT_CTRL_LA_MAI_MRQ 0x00000004 | ||
| 1606 | #define HT_CTRL_LA_MAI_MSI 0x00000038 | ||
| 1607 | #define HT_CTRL_LA_MFSI 0x000001C0 | ||
| 1608 | #define HT_CTRL_LA_MFSI_SHIFT 6 | ||
| 1609 | #define HT_CTRL_LA_MFB_ASELC 0x0000FE00 | ||
| 1610 | #define HT_CTRL_LA_MFB_ASELC_SH 9 | ||
| 1611 | #define HT_CTRL_LA_ASELC_CMD 0x00000C00 | ||
| 1612 | #define HT_CTRL_LA_ASELC_DATA 0x0000F000 | ||
| 1613 | #define HT_CTRL_CAL_POS 0x00030000 | ||
| 1614 | #define HT_CTRL_CAL_SEQ 0x000C0000 | ||
| 1615 | #define HT_CTRL_CSI_STEERING 0x00C00000 | ||
| 1616 | #define HT_CTRL_CSI_STEER_SHIFT 22 | ||
| 1617 | #define HT_CTRL_CSI_STEER_NFB 0 | ||
| 1618 | #define HT_CTRL_CSI_STEER_CSI 1 | ||
| 1619 | #define HT_CTRL_CSI_STEER_NCOM 2 | ||
| 1620 | #define HT_CTRL_CSI_STEER_COM 3 | ||
| 1621 | #define HT_CTRL_NDP_ANNOUNCE 0x01000000 | ||
| 1622 | #define HT_CTRL_AC_CONSTRAINT 0x40000000 | ||
| 1623 | #define HT_CTRL_RDG_MOREPPDU 0x80000000 | ||
| 1624 | |||
| 1625 | #define HT_OPMODE_OPTIONAL 0x0001 | ||
| 1626 | #define HT_OPMODE_HT20IN40 0x0002 | ||
| 1627 | #define HT_OPMODE_MIXED 0x0003 | ||
| 1628 | #define HT_OPMODE_NONGF 0x0004 | ||
| 1629 | #define DOT11N_TXBURST 0x0008 | ||
| 1630 | #define DOT11N_OBSS_NONHT 0x0010 | ||
| 1631 | |||
| 1632 | |||
| 1633 | |||
| 1634 | #define WPA_OUI "\x00\x50\xF2" | ||
| 1635 | #define WPA_OUI_LEN 3 | ||
| 1636 | #define WPA_OUI_TYPE 1 | ||
| 1637 | #define WPA_VERSION 1 | ||
| 1638 | #define WPA2_OUI "\x00\x0F\xAC" | ||
| 1639 | #define WPA2_OUI_LEN 3 | ||
| 1640 | #define WPA2_VERSION 1 | ||
| 1641 | #define WPA2_VERSION_LEN 2 | ||
| 1642 | |||
| 1643 | |||
| 1644 | #define WPS_OUI "\x00\x50\xF2" | ||
| 1645 | #define WPS_OUI_LEN 3 | ||
| 1646 | #define WPS_OUI_TYPE 4 | ||
| 1647 | |||
| 1648 | |||
| 1649 | #define WFA_OUI "\x50\x6F\x9A" | ||
| 1650 | #define WFA_OUI_LEN 3 | ||
| 1651 | |||
| 1652 | #define WFA_OUI_TYPE_WPA 1 | ||
| 1653 | #define WFA_OUI_TYPE_WPS 4 | ||
| 1654 | #define WFA_OUI_TYPE_TPC 8 | ||
| 1655 | #define WFA_OUI_TYPE_P2P 9 | ||
| 1656 | |||
| 1657 | |||
| 1658 | #define RSN_AKM_NONE 0 | ||
| 1659 | #define RSN_AKM_UNSPECIFIED 1 | ||
| 1660 | #define RSN_AKM_PSK 2 | ||
| 1661 | #define RSN_AKM_FBT_1X 3 | ||
| 1662 | #define RSN_AKM_FBT_PSK 4 | ||
| 1663 | |||
| 1664 | |||
| 1665 | #define DOT11_MAX_DEFAULT_KEYS 4 | ||
| 1666 | #define DOT11_MAX_KEY_SIZE 32 | ||
| 1667 | #define DOT11_MAX_IV_SIZE 16 | ||
| 1668 | #define DOT11_EXT_IV_FLAG (1<<5) | ||
| 1669 | #define DOT11_WPA_KEY_RSC_LEN 8 | ||
| 1670 | |||
| 1671 | #define WEP1_KEY_SIZE 5 | ||
| 1672 | #define WEP1_KEY_HEX_SIZE 10 | ||
| 1673 | #define WEP128_KEY_SIZE 13 | ||
| 1674 | #define WEP128_KEY_HEX_SIZE 26 | ||
| 1675 | #define TKIP_MIC_SIZE 8 | ||
| 1676 | #define TKIP_EOM_SIZE 7 | ||
| 1677 | #define TKIP_EOM_FLAG 0x5a | ||
| 1678 | #define TKIP_KEY_SIZE 32 | ||
| 1679 | #define TKIP_MIC_AUTH_TX 16 | ||
| 1680 | #define TKIP_MIC_AUTH_RX 24 | ||
| 1681 | #define TKIP_MIC_SUP_RX TKIP_MIC_AUTH_TX | ||
| 1682 | #define TKIP_MIC_SUP_TX TKIP_MIC_AUTH_RX | ||
| 1683 | #define AES_KEY_SIZE 16 | ||
| 1684 | #define AES_MIC_SIZE 8 | ||
| 1685 | |||
| 1686 | |||
| 1687 | #define WCN_OUI "\x00\x50\xf2" | ||
| 1688 | #define WCN_TYPE 4 | ||
| 1689 | |||
| 1690 | |||
| 1691 | |||
| 1692 | |||
| 1693 | |||
| 1694 | BWL_PRE_PACKED_STRUCT struct dot11_mdid_ie { | ||
| 1695 | uint8 id; | ||
| 1696 | uint8 len; | ||
| 1697 | uint16 mdid; | ||
| 1698 | uint8 cap; | ||
| 1699 | } BWL_POST_PACKED_STRUCT; | ||
| 1700 | typedef struct dot11_mdid_ie dot11_mdid_ie_t; | ||
| 1701 | |||
| 1702 | #define FBT_MDID_CAP_OVERDS 0x01 | ||
| 1703 | #define FBT_MDID_CAP_RRP 0x02 | ||
| 1704 | |||
| 1705 | |||
| 1706 | BWL_PRE_PACKED_STRUCT struct dot11_ft_ie { | ||
| 1707 | uint8 id; | ||
| 1708 | uint8 len; | ||
| 1709 | uint16 mic_control; | ||
| 1710 | uint8 mic[16]; | ||
| 1711 | uint8 anonce[32]; | ||
| 1712 | uint8 snonce[32]; | ||
| 1713 | } BWL_POST_PACKED_STRUCT; | ||
| 1714 | typedef struct dot11_ft_ie dot11_ft_ie_t; | ||
| 1715 | |||
| 1716 | |||
| 1717 | BWL_PRE_PACKED_STRUCT struct dot11_gtk_ie { | ||
| 1718 | uint8 id; | ||
| 1719 | uint8 len; | ||
| 1720 | uint16 key_info; | ||
| 1721 | uint8 key_len; | ||
| 1722 | uint8 rsc[8]; | ||
| 1723 | uint8 data[1]; | ||
| 1724 | } BWL_POST_PACKED_STRUCT; | ||
| 1725 | typedef struct dot11_gtk_ie dot11_gtk_ie_t; | ||
| 1726 | |||
| 1727 | |||
| 1728 | |||
| 1729 | #include <packed_section_end.h> | ||
| 1730 | |||
| 1731 | #endif | ||
diff --git a/drivers/net/wireless/bcmdhd/include/proto/802.11_bta.h b/drivers/net/wireless/bcmdhd/include/proto/802.11_bta.h new file mode 100644 index 00000000000..4ccfab02056 --- /dev/null +++ b/drivers/net/wireless/bcmdhd/include/proto/802.11_bta.h | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | /* | ||
| 2 | * BT-AMP (BlueTooth Alternate Mac and Phy) 802.11 PAL (Protocol Adaptation Layer) | ||
| 3 | * | ||
| 4 | * Copyright (C) 1999-2011, Broadcom Corporation | ||
| 5 | * | ||
| 6 | * Unless you and Broadcom execute a separate written software license | ||
| 7 | * agreement governing use of this software, this software is licensed to you | ||
| 8 | * under the terms of the GNU General Public License version 2 (the "GPL"), | ||
| 9 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | ||
| 10 | * following added to such license: | ||
| 11 | * | ||
| 12 | * As a special exception, the copyright holders of this software give you | ||
| 13 | * permission to link this software with independent modules, and to copy and | ||
| 14 | * distribute the resulting executable under terms of your choice, provided that | ||
| 15 | * you also meet, for each linked independent module, the terms and conditions of | ||
| 16 | * the license of that module. An independent module is a module which is not | ||
| 17 | * derived from this software. The special exception does not apply to any | ||
| 18 | * modifications of the software. | ||
| 19 | * | ||
| 20 | * Notwithstanding the above, under no circumstances may you combine this | ||
| 21 | * software in any way with any other Broadcom software provided under a license | ||
| 22 | * other than the GPL, without Broadcom's express prior written consent. | ||
| 23 | * | ||
| 24 | * $Id: 802.11_bta.h,v 9.2 2008-10-28 23:27:13 Exp $ | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef _802_11_BTA_H_ | ||
| 28 | #define _802_11_BTA_H_ | ||
| 29 | |||
| 30 | #define BT_SIG_SNAP_MPROT "\xAA\xAA\x03\x00\x19\x58" | ||
| 31 | |||
| 32 | /* BT-AMP 802.11 PAL Protocols */ | ||
| 33 | #define BTA_PROT_L2CAP 1 | ||
| 34 | #define BTA_PROT_ACTIVITY_REPORT 2 | ||
| 35 | #define BTA_PROT_SECURITY 3 | ||
| 36 | #define BTA_PROT_LINK_SUPERVISION_REQUEST 4 | ||
| 37 | #define BTA_PROT_LINK_SUPERVISION_REPLY 5 | ||
| 38 | |||
| 39 | /* BT-AMP 802.11 PAL AMP_ASSOC Type IDs */ | ||
| 40 | #define BTA_TYPE_ID_MAC_ADDRESS 1 | ||
| 41 | #define BTA_TYPE_ID_PREFERRED_CHANNELS 2 | ||
| 42 | #define BTA_TYPE_ID_CONNECTED_CHANNELS 3 | ||
| 43 | #define BTA_TYPE_ID_CAPABILITIES 4 | ||
| 44 | #define BTA_TYPE_ID_VERSION 5 | ||
| 45 | #endif /* _802_11_bta_h_ */ | ||
diff --git a/drivers/net/wireless/bcmdhd/include/proto/802.11e.h b/drivers/net/wireless/bcmdhd/include/proto/802.11e.h new file mode 100644 index 00000000000..ce8ad083f28 --- /dev/null +++ b/drivers/net/wireless/bcmdhd/include/proto/802.11e.h | |||
| @@ -0,0 +1,131 @@ | |||
| 1 | /* | ||
| 2 | * 802.11e protocol header file | ||
| 3 | * | ||
| 4 | * Copyright (C) 1999-2011, Broadcom Corporation | ||
| 5 | * | ||
| 6 | * Unless you and Broadcom execute a separate written software license | ||
| 7 | * agreement governing use of this software, this software is licensed to you | ||
| 8 | * under the terms of the GNU General Public License version 2 (the "GPL"), | ||
| 9 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | ||
| 10 | * following added to such license: | ||
| 11 | * | ||
| 12 | * As a special exception, the copyright holders of this software give you | ||
| 13 | * permission to link this software with independent modules, and to copy and | ||
| 14 | * distribute the resulting executable under terms of your choice, provided that | ||
| 15 | * you also meet, for each linked independent module, the terms and conditions of | ||
| 16 | * the license of that module. An independent module is a module which is not | ||
| 17 | * derived from this software. The special exception does not apply to any | ||
| 18 | * modifications of the software. | ||
| 19 | * | ||
| 20 | * Notwithstanding the above, under no circumstances may you combine this | ||
| 21 | * software in any way with any other Broadcom software provided under a license | ||
| 22 | * other than the GPL, without Broadcom's express prior written consent. | ||
| 23 | * | ||
| 24 | * $Id: 802.11e.h,v 1.6 2008-12-01 22:55:11 Exp $ | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef _802_11e_H_ | ||
| 28 | #define _802_11e_H_ | ||
| 29 | |||
| 30 | #ifndef _TYPEDEFS_H_ | ||
| 31 | #include <typedefs.h> | ||
| 32 | #endif | ||
| 33 | |||
| 34 | /* This marks the start of a packed structure section. */ | ||
| 35 | #include <packed_section_start.h> | ||
| 36 | |||
| 37 | |||
| 38 | /* WME Traffic Specification (TSPEC) element */ | ||
| 39 | #define WME_TSPEC_HDR_LEN 2 /* WME TSPEC header length */ | ||
| 40 | #define WME_TSPEC_BODY_OFF 2 /* WME TSPEC body offset */ | ||
| 41 | |||
| 42 | #define WME_CATEGORY_CODE_OFFSET 0 /* WME Category code offset */ | ||
| 43 | #define WME_ACTION_CODE_OFFSET 1 /* WME Action code offset */ | ||
| 44 | #define WME_TOKEN_CODE_OFFSET 2 /* WME Token code offset */ | ||
| 45 | #define WME_STATUS_CODE_OFFSET 3 /* WME Status code offset */ | ||
| 46 | |||
| 47 | BWL_PRE_PACKED_STRUCT struct tsinfo { | ||
| 48 | uint8 octets[3]; | ||
| 49 | } BWL_POST_PACKED_STRUCT; | ||
| 50 | |||
| 51 | typedef struct tsinfo tsinfo_t; | ||
| 52 | |||
| 53 | /* 802.11e TSPEC IE */ | ||
| 54 | typedef BWL_PRE_PACKED_STRUCT struct tspec { | ||
| 55 | uint8 oui[DOT11_OUI_LEN]; /* WME_OUI */ | ||
| 56 | uint8 type; /* WME_TYPE */ | ||
| 57 | uint8 subtype; /* WME_SUBTYPE_TSPEC */ | ||
| 58 | uint8 version; /* WME_VERSION */ | ||
| 59 | tsinfo_t tsinfo; /* TS Info bit field */ | ||
| 60 | uint16 nom_msdu_size; /* (Nominal or fixed) MSDU Size (bytes) */ | ||
| 61 | uint16 max_msdu_size; /* Maximum MSDU Size (bytes) */ | ||
| 62 | uint32 min_srv_interval; /* Minimum Service Interval (us) */ | ||
| 63 | uint32 max_srv_interval; /* Maximum Service Interval (us) */ | ||
| 64 | uint32 inactivity_interval; /* Inactivity Interval (us) */ | ||
| 65 | uint32 suspension_interval; /* Suspension Interval (us) */ | ||
| 66 | uint32 srv_start_time; /* Service Start Time (us) */ | ||
| 67 | uint32 min_data_rate; /* Minimum Data Rate (bps) */ | ||
| 68 | uint32 mean_data_rate; /* Mean Data Rate (bps) */ | ||
| 69 | uint32 peak_data_rate; /* Peak Data Rate (bps) */ | ||
| 70 | uint32 max_burst_size; /* Maximum Burst Size (bytes) */ | ||
| 71 | uint32 delay_bound; /* Delay Bound (us) */ | ||
| 72 | uint32 min_phy_rate; /* Minimum PHY Rate (bps) */ | ||
| 73 | uint16 surplus_bw; /* Surplus Bandwidth Allowance (range 1.0-8.0) */ | ||
| 74 | uint16 medium_time; /* Medium Time (32 us/s periods) */ | ||
| 75 | } BWL_POST_PACKED_STRUCT tspec_t; | ||
| 76 | |||
| 77 | #define WME_TSPEC_LEN (sizeof(tspec_t)) /* not including 2-bytes of header */ | ||
| 78 | |||
| 79 | /* ts_info */ | ||
| 80 | /* 802.1D priority is duplicated - bits 13-11 AND bits 3-1 */ | ||
| 81 | #define TS_INFO_TID_SHIFT 1 /* TS info. TID shift */ | ||
| 82 | #define TS_INFO_TID_MASK (0xf << TS_INFO_TID_SHIFT) /* TS info. TID mask */ | ||
| 83 | #define TS_INFO_CONTENTION_SHIFT 7 /* TS info. contention shift */ | ||
| 84 | #define TS_INFO_CONTENTION_MASK (0x1 << TS_INFO_CONTENTION_SHIFT) /* TS info. contention mask */ | ||
| 85 | #define TS_INFO_DIRECTION_SHIFT 5 /* TS info. direction shift */ | ||
| 86 | #define TS_INFO_DIRECTION_MASK (0x3 << TS_INFO_DIRECTION_SHIFT) /* TS info. direction mask */ | ||
| 87 | #define TS_INFO_PSB_SHIFT 2 /* TS info. PSB bit Shift */ | ||
| 88 | #define TS_INFO_PSB_MASK (1 << TS_INFO_PSB_SHIFT) /* TS info. PSB mask */ | ||
| 89 | #define TS_INFO_UPLINK (0 << TS_INFO_DIRECTION_SHIFT) /* TS info. uplink */ | ||
| 90 | #define TS_INFO_DOWNLINK (1 << TS_INFO_DIRECTION_SHIFT) /* TS info. downlink */ | ||
| 91 | #define TS_INFO_BIDIRECTIONAL (3 << TS_INFO_DIRECTION_SHIFT) /* TS info. bidirectional */ | ||
| 92 | #define TS_INFO_USER_PRIO_SHIFT 3 /* TS info. user priority shift */ | ||
| 93 | /* TS info. user priority mask */ | ||
| 94 | #define TS_INFO_USER_PRIO_MASK (0x7 << TS_INFO_USER_PRIO_SHIFT) | ||
| 95 | |||
| 96 | /* Macro to get/set bit(s) field in TSINFO */ | ||
| 97 | #define WLC_CAC_GET_TID(pt) ((((pt).octets[0]) & TS_INFO_TID_MASK) >> TS_INFO_TID_SHIFT) | ||
| 98 | #define WLC_CAC_GET_DIR(pt) ((((pt).octets[0]) & \ | ||
| 99 | TS_INFO_DIRECTION_MASK) >> TS_INFO_DIRECTION_SHIFT) | ||
| 100 | #define WLC_CAC_GET_PSB(pt) ((((pt).octets[1]) & TS_INFO_PSB_MASK) >> TS_INFO_PSB_SHIFT) | ||
| 101 | #define WLC_CAC_GET_USER_PRIO(pt) ((((pt).octets[1]) & \ | ||
| 102 | TS_INFO_USER_PRIO_MASK) >> TS_INFO_USER_PRIO_SHIFT) | ||
| 103 | |||
| 104 | #define WLC_CAC_SET_TID(pt, id) ((((pt).octets[0]) & (~TS_INFO_TID_MASK)) | \ | ||
| 105 | ((id) << TS_INFO_TID_SHIFT)) | ||
| 106 | #define WLC_CAC_SET_USER_PRIO(pt, prio) ((((pt).octets[0]) & (~TS_INFO_USER_PRIO_MASK)) | \ | ||
| 107 | ((prio) << TS_INFO_USER_PRIO_SHIFT)) | ||
| 108 | |||
| 109 | /* 802.11e QBSS Load IE */ | ||
| 110 | #define QBSS_LOAD_IE_LEN 5 /* QBSS Load IE length */ | ||
| 111 | #define QBSS_LOAD_AAC_OFF 3 /* AAC offset in IE */ | ||
| 112 | |||
| 113 | #define CAC_ADDTS_RESP_TIMEOUT 300 /* default ADDTS response timeout in ms */ | ||
| 114 | |||
| 115 | /* 802.11e ADDTS status code */ | ||
| 116 | #define DOT11E_STATUS_ADMISSION_ACCEPTED 0 /* TSPEC Admission accepted status */ | ||
| 117 | #define DOT11E_STATUS_ADDTS_INVALID_PARAM 1 /* TSPEC invalid parameter status */ | ||
| 118 | #define DOT11E_STATUS_ADDTS_REFUSED_NSBW 3 /* ADDTS refused (non-sufficient BW) */ | ||
| 119 | #define DOT11E_STATUS_ADDTS_REFUSED_AWHILE 47 /* ADDTS refused but could retry later */ | ||
| 120 | |||
| 121 | /* 802.11e DELTS status code */ | ||
| 122 | #define DOT11E_STATUS_QSTA_LEAVE_QBSS 36 /* STA leave QBSS */ | ||
| 123 | #define DOT11E_STATUS_END_TS 37 /* END TS */ | ||
| 124 | #define DOT11E_STATUS_UNKNOWN_TS 38 /* UNKNOWN TS */ | ||
| 125 | #define DOT11E_STATUS_QSTA_REQ_TIMEOUT 39 /* STA ADDTS request timeout */ | ||
| 126 | |||
| 127 | |||
| 128 | /* This marks the end of a packed structure section. */ | ||
| 129 | #include <packed_section_end.h> | ||
| 130 | |||
| 131 | #endif /* _802_11e_CAC_H_ */ | ||
diff --git a/drivers/net/wireless/bcmdhd/include/proto/802.1d.h b/drivers/net/wireless/bcmdhd/include/proto/802.1d.h new file mode 100644 index 00000000000..cf206250246 --- /dev/null +++ b/drivers/net/wireless/bcmdhd/include/proto/802.1d.h | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 1999-2011, Broadcom Corporation | ||
| 3 | * | ||
| 4 | * Unless you and Broadcom execute a separate written software license | ||
| 5 | * agreement governing use of this software, this software is licensed to you | ||
| 6 | * under the terms of the GNU General Public License version 2 (the "GPL"), | ||
| 7 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | ||
| 8 | * following added to such license: | ||
| 9 | * | ||
| 10 | * As a special exception, the copyright holders of this software give you | ||
| 11 | * permission to link this software with independent modules, and to copy and | ||
| 12 | * distribute the resulting executable under terms of your choice, provided that | ||
| 13 | * you also meet, for each linked independent module, the terms and conditions of | ||
| 14 | * the license of that module. An independent module is a module which is not | ||
| 15 | * derived from this software. The special exception does not apply to any | ||
| 16 | * modifications of the software. | ||
| 17 | * | ||
| 18 | * Notwithstanding the above, under no circumstances may you combine this | ||
| 19 | * software in any way with any other Broadcom software provided under a license | ||
| 20 | * other than the GPL, without Broadcom's express prior written consent. | ||
| 21 | * | ||
| 22 | * Fundamental types and constants relating to 802.1D | ||
| 23 | * | ||
| 24 | * $Id: 802.1d.h,v 9.3 2007-04-10 21:33:06 Exp $ | ||
| 25 | */ | ||
| 26 | |||
| 27 | |||
| 28 | #ifndef _802_1_D_ | ||
| 29 | #define _802_1_D_ | ||
| 30 | |||
| 31 | |||
| 32 | #define PRIO_8021D_NONE 2 | ||
| 33 | #define PRIO_8021D_BK 1 | ||
| 34 | #define PRIO_8021D_BE 0 | ||
| 35 | #define PRIO_8021D_EE 3 | ||
| 36 | #define PRIO_8021D_CL 4 | ||
| 37 | #define PRIO_8021D_VI 5 | ||
| 38 | #define PRIO_8021D_VO 6 | ||
| 39 | #define PRIO_8021D_NC 7 | ||
| 40 | #define MAXPRIO 7 | ||
| 41 | #define NUMPRIO (MAXPRIO + 1) | ||
| 42 | |||
| 43 | #define ALLPRIO -1 | ||
| 44 | |||
| 45 | |||
| 46 | #define PRIO2PREC(prio) \ | ||
| 47 | (((prio) == PRIO_8021D_NONE || (prio) == PRIO_8021D_BE) ? ((prio^2)) : (prio)) | ||
| 48 | |||
| 49 | #endif | ||
diff --git a/drivers/net/wireless/bcmdhd/include/proto/bcmeth.h b/drivers/net/wireless/bcmdhd/include/proto/bcmeth.h new file mode 100644 index 00000000000..46fa4c9f89e --- /dev/null +++ b/drivers/net/wireless/bcmdhd/include/proto/bcmeth.h | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | /* | ||
| 2 | * Broadcom Ethernettype protocol definitions | ||
| 3 | * | ||
| 4 | * Copyright (C) 1999-2011, Broadcom Corporation | ||
| 5 | * | ||
| 6 | * Unless you and Broadcom execute a separate written software license | ||
| 7 | * agreement governing use of this software, this software is licensed to you | ||
| 8 | * under the terms of the GNU General Public License version 2 (the "GPL"), | ||
| 9 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | ||
| 10 | * following added to such license: | ||
| 11 | * | ||
| 12 | * As a special exception, the copyright holders of this software give you | ||
| 13 | * permission to link this software with independent modules, and to copy and | ||
| 14 | * distribute the resulting executable under terms of your choice, provided that | ||
| 15 | * you also meet, for each linked independent module, the terms and conditions of | ||
| 16 | * the license of that module. An independent module is a module which is not | ||
| 17 | * derived from this software. The special exception does not apply to any | ||
| 18 | * modifications of the software. | ||
| 19 | * | ||
| 20 | * Notwithstanding the above, under no circumstances may you combine this | ||
| 21 | * software in any way with any other Broadcom software provided under a license | ||
| 22 | * other than the GPL, without Broadcom's express prior written consent. | ||
| 23 | * | ||
| 24 | * $Id: bcmeth.h,v 9.12 2009-12-29 19:57:18 Exp $ | ||
| 25 | */ | ||
| 26 | |||
| 27 | |||
| 28 | |||
| 29 | |||
| 30 | #ifndef _BCMETH_H_ | ||
| 31 | #define _BCMETH_H_ | ||
| 32 | |||
| 33 | #ifndef _TYPEDEFS_H_ | ||
| 34 | #include <typedefs.h> | ||
| 35 | #endif | ||
| 36 | |||
| 37 | |||
| 38 | #include <packed_section_start.h> | ||
| 39 | |||
| 40 | |||
| 41 | |||
| 42 | |||
| 43 | |||
| 44 | |||
| 45 | |||
| 46 | #define BCMILCP_SUBTYPE_RATE 1 | ||
| 47 | #define BCMILCP_SUBTYPE_LINK 2 | ||
| 48 | #define BCMILCP_SUBTYPE_CSA 3 | ||
| 49 | #define BCMILCP_SUBTYPE_LARQ 4 | ||
| 50 | #define BCMILCP_SUBTYPE_VENDOR 5 | ||
| 51 | #define BCMILCP_SUBTYPE_FLH 17 | ||
| 52 | |||
| 53 | #define BCMILCP_SUBTYPE_VENDOR_LONG 32769 | ||
| 54 | #define BCMILCP_SUBTYPE_CERT 32770 | ||
| 55 | #define BCMILCP_SUBTYPE_SES 32771 | ||
| 56 | |||
| 57 | |||
| 58 | #define BCMILCP_BCM_SUBTYPE_RESERVED 0 | ||
| 59 | #define BCMILCP_BCM_SUBTYPE_EVENT 1 | ||
| 60 | #define BCMILCP_BCM_SUBTYPE_SES 2 | ||
| 61 | |||
| 62 | |||
| 63 | #define BCMILCP_BCM_SUBTYPE_DPT 4 | ||
| 64 | |||
| 65 | #define BCMILCP_BCM_SUBTYPEHDR_MINLENGTH 8 | ||
| 66 | #define BCMILCP_BCM_SUBTYPEHDR_VERSION 0 | ||
| 67 | |||
| 68 | |||
| 69 | typedef BWL_PRE_PACKED_STRUCT struct bcmeth_hdr | ||
| 70 | { | ||
| 71 | uint16 subtype; | ||
| 72 | uint16 length; | ||
| 73 | uint8 version; | ||
| 74 | uint8 oui[3]; | ||
| 75 | |||
| 76 | uint16 usr_subtype; | ||
| 77 | } BWL_POST_PACKED_STRUCT bcmeth_hdr_t; | ||
| 78 | |||
| 79 | |||
| 80 | |||
| 81 | #include <packed_section_end.h> | ||
| 82 | |||
| 83 | #endif | ||
diff --git a/drivers/net/wireless/bcmdhd/include/proto/bcmevent.h b/drivers/net/wireless/bcmdhd/include/proto/bcmevent.h new file mode 100644 index 00000000000..30ec848c40a --- /dev/null +++ b/drivers/net/wireless/bcmdhd/include/proto/bcmevent.h | |||
| @@ -0,0 +1,312 @@ | |||
| 1 | /* | ||
| 2 | * Broadcom Event protocol definitions | ||
| 3 | * | ||
| 4 | * Copyright (C) 1999-2011, Broadcom Corporation | ||
| 5 | * | ||
| 6 | * Unless you and Broadcom execute a separate written software license | ||
| 7 | * agreement governing use of this software, this software is licensed to you | ||
| 8 | * under the terms of the GNU General Public License version 2 (the "GPL"), | ||
| 9 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | ||
| 10 | * following added to such license: | ||
| 11 | * | ||
| 12 | * As a special exception, the copyright holders of this software give you | ||
| 13 | * permission to link this software with independent modules, and to copy and | ||
| 14 | * distribute the resulting executable under terms of your choice, provided that | ||
| 15 | * you also meet, for each linked independent module, the terms and conditions of | ||
| 16 | * the license of that module. An independent module is a module which is not | ||
| 17 | * derived from this software. The special exception does not apply to any | ||
| 18 | * modifications of the software. | ||
| 19 | * | ||
| 20 | * Notwithstanding the above, under no circumstances may you combine this | ||
| 21 | * software in any way with any other Broadcom software provided under a license | ||
| 22 | * other than the GPL, without Broadcom's express prior written consent. | ||
| 23 | * | ||
| 24 | * Dependencies: proto/bcmeth.h | ||
| 25 | * | ||
| 26 | * $Id: bcmevent.h,v 9.64.2.9 2011-02-01 06:24:21 Exp $ | ||
| 27 | * | ||
| 28 | */ | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | |||
| 33 | #ifndef _BCMEVENT_H_ | ||
| 34 | #define _BCMEVENT_H_ | ||
| 35 | |||
| 36 | #ifndef _TYPEDEFS_H_ | ||
| 37 | #include <typedefs.h> | ||
| 38 | #endif | ||
| 39 | |||
| 40 | |||
| 41 | #include <packed_section_start.h> | ||
| 42 | |||
| 43 | #define BCM_EVENT_MSG_VERSION 2 | ||
| 44 | #define BCM_MSG_IFNAME_MAX 16 | ||
| 45 | |||
| 46 | |||
| 47 | #define WLC_EVENT_MSG_LINK 0x01 | ||
| 48 | #define WLC_EVENT_MSG_FLUSHTXQ 0x02 | ||
| 49 | #define WLC_EVENT_MSG_GROUP 0x04 | ||
| 50 | #define WLC_EVENT_MSG_UNKBSS 0x08 | ||
| 51 | #define WLC_EVENT_MSG_UNKIF 0x10 | ||
| 52 | |||
| 53 | |||
| 54 | |||
| 55 | |||
| 56 | typedef BWL_PRE_PACKED_STRUCT struct | ||
| 57 | { | ||
| 58 | uint16 version; | ||
| 59 | uint16 flags; | ||
| 60 | uint32 event_type; | ||
| 61 | uint32 status; | ||
| 62 | uint32 reason; | ||
| 63 | uint32 auth_type; | ||
| 64 | uint32 datalen; | ||
| 65 | struct ether_addr addr; | ||
| 66 | char ifname[BCM_MSG_IFNAME_MAX]; | ||
| 67 | } BWL_POST_PACKED_STRUCT wl_event_msg_v1_t; | ||
| 68 | |||
| 69 | |||
| 70 | typedef BWL_PRE_PACKED_STRUCT struct | ||
| 71 | { | ||
| 72 | uint16 version; | ||
| 73 | uint16 flags; | ||
| 74 | uint32 event_type; | ||
| 75 | uint32 status; | ||
| 76 | uint32 reason; | ||
| 77 | uint32 auth_type; | ||
| 78 | uint32 datalen; | ||
| 79 | struct ether_addr addr; | ||
| 80 | char ifname[BCM_MSG_IFNAME_MAX]; | ||
| 81 | uint8 ifidx; | ||
| 82 | uint8 bsscfgidx; | ||
| 83 | } BWL_POST_PACKED_STRUCT wl_event_msg_t; | ||
| 84 | |||
| 85 | |||
| 86 | typedef BWL_PRE_PACKED_STRUCT struct bcm_event { | ||
| 87 | struct ether_header eth; | ||
| 88 | bcmeth_hdr_t bcm_hdr; | ||
| 89 | wl_event_msg_t event; | ||
| 90 | |||
| 91 | } BWL_POST_PACKED_STRUCT bcm_event_t; | ||
| 92 | |||
| 93 | #define BCM_MSG_LEN (sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - sizeof(struct ether_header)) | ||
| 94 | |||
| 95 | |||
| 96 | #define WLC_E_SET_SSID 0 | ||
| 97 | #define WLC_E_JOIN 1 | ||
| 98 | #define WLC_E_START 2 | ||
| 99 | #define WLC_E_AUTH 3 | ||
| 100 | #define WLC_E_AUTH_IND 4 | ||
| 101 | #define WLC_E_DEAUTH 5 | ||
| 102 | #define WLC_E_DEAUTH_IND 6 | ||
| 103 | #define WLC_E_ASSOC 7 | ||
| 104 | #define WLC_E_ASSOC_IND 8 | ||
| 105 | #define WLC_E_REASSOC 9 | ||
| 106 | #define WLC_E_REASSOC_IND 10 | ||
| 107 | #define WLC_E_DISASSOC 11 | ||
| 108 | #define WLC_E_DISASSOC_IND 12 | ||
| 109 | #define WLC_E_QUIET_START 13 | ||
| 110 | #define WLC_E_QUIET_END 14 | ||
| 111 | #define WLC_E_BEACON_RX 15 | ||
| 112 | #define WLC_E_LINK 16 | ||
| 113 | #define WLC_E_MIC_ERROR 17 | ||
| 114 | #define WLC_E_NDIS_LINK 18 | ||
| 115 | #define WLC_E_ROAM 19 | ||
| 116 | #define WLC_E_TXFAIL 20 | ||
| 117 | #define WLC_E_PMKID_CACHE 21 | ||
| 118 | #define WLC_E_RETROGRADE_TSF 22 | ||
| 119 | #define WLC_E_PRUNE 23 | ||
| 120 | #define WLC_E_AUTOAUTH 24 | ||
| 121 | #define WLC_E_EAPOL_MSG 25 | ||
| 122 | #define WLC_E_SCAN_COMPLETE 26 | ||
| 123 | #define WLC_E_ADDTS_IND 27 | ||
| 124 | #define WLC_E_DELTS_IND 28 | ||
| 125 | #define WLC_E_BCNSENT_IND 29 | ||
| 126 | #define WLC_E_BCNRX_MSG 30 | ||
| 127 | #define WLC_E_BCNLOST_MSG 31 | ||
| 128 | #define WLC_E_ROAM_PREP 32 | ||
| 129 | #define WLC_E_PFN_NET_FOUND 33 | ||
| 130 | #define WLC_E_PFN_NET_LOST 34 | ||
| 131 | #define WLC_E_RESET_COMPLETE 35 | ||
| 132 | #define WLC_E_JOIN_START 36 | ||
| 133 | #define WLC_E_ROAM_START 37 | ||
| 134 | #define WLC_E_ASSOC_START 38 | ||
| 135 | #define WLC_E_IBSS_ASSOC 39 | ||
| 136 | #define WLC_E_RADIO 40 | ||
| 137 | #define WLC_E_PSM_WATCHDOG 41 | ||
| 138 | #define WLC_E_PROBREQ_MSG 44 | ||
| 139 | #define WLC_E_SCAN_CONFIRM_IND 45 | ||
| 140 | #define WLC_E_PSK_SUP 46 | ||
| 141 | #define WLC_E_COUNTRY_CODE_CHANGED 47 | ||
| 142 | #define WLC_E_EXCEEDED_MEDIUM_TIME 48 | ||
| 143 | #define WLC_E_ICV_ERROR 49 | ||
| 144 | #define WLC_E_UNICAST_DECODE_ERROR 50 | ||
| 145 | #define WLC_E_MULTICAST_DECODE_ERROR 51 | ||
| 146 | #define WLC_E_TRACE 52 | ||
| 147 | #define WLC_E_BTA_HCI_EVENT 53 | ||
| 148 | #define WLC_E_IF 54 | ||
| 149 | #ifdef WLP2P | ||
| 150 | #define WLC_E_P2P_DISC_LISTEN_COMPLETE 55 | ||
| 151 | #endif | ||
| 152 | #define WLC_E_RSSI 56 | ||
| 153 | #define WLC_E_PFN_SCAN_COMPLETE 57 | ||
| 154 | #define WLC_E_EXTLOG_MSG 58 | ||
| 155 | #define WLC_E_ACTION_FRAME 59 | ||
| 156 | #define WLC_E_ACTION_FRAME_COMPLETE 60 | ||
| 157 | #define WLC_E_PRE_ASSOC_IND 61 | ||
| 158 | #define WLC_E_PRE_REASSOC_IND 62 | ||
| 159 | #define WLC_E_CHANNEL_ADOPTED 63 | ||
| 160 | #define WLC_E_AP_STARTED 64 | ||
| 161 | #define WLC_E_DFS_AP_STOP 65 | ||
| 162 | #define WLC_E_DFS_AP_RESUME 66 | ||
| 163 | #define WLC_E_WAI_STA_EVENT 67 | ||
| 164 | #define WLC_E_WAI_MSG 68 | ||
| 165 | #define WLC_E_ESCAN_RESULT 69 | ||
| 166 | #define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE 70 | ||
| 167 | #if defined(WLP2P) | ||
| 168 | #define WLC_E_PROBRESP_MSG 71 | ||
| 169 | #define WLC_E_P2P_PROBREQ_MSG 72 | ||
| 170 | #endif | ||
| 171 | #define WLC_E_DCS_REQUEST 73 | ||
| 172 | |||
| 173 | #define WLC_E_FIFO_CREDIT_MAP 74 | ||
| 174 | |||
| 175 | #define WLC_E_ACTION_FRAME_RX 75 | ||
| 176 | #define WLC_E_WAKE_EVENT 76 | ||
| 177 | #define WLC_E_RM_COMPLETE 77 | ||
| 178 | #define WLC_E_HTSFSYNC 78 | ||
| 179 | #define WLC_E_OVERLAY_REQ 79 | ||
| 180 | #define WLC_E_CSA_COMPLETE_IND 80 | ||
| 181 | #define WLC_E_EXCESS_PM_WAKE_EVENT 81 | ||
| 182 | #define WLC_E_PFN_SCAN_NONE 82 | ||
| 183 | #define WLC_E_PFN_SCAN_ALLGONE 83 | ||
| 184 | #define WLC_E_GTK_PLUMBED 84 | ||
| 185 | #define WLC_E_LAST 85 | ||
| 186 | |||
| 187 | |||
| 188 | typedef struct { | ||
| 189 | uint event; | ||
| 190 | const char *name; | ||
| 191 | } bcmevent_name_t; | ||
| 192 | |||
| 193 | extern const bcmevent_name_t bcmevent_names[]; | ||
| 194 | extern const int bcmevent_names_size; | ||
| 195 | |||
| 196 | |||
| 197 | #define WLC_E_STATUS_SUCCESS 0 | ||
| 198 | #define WLC_E_STATUS_FAIL 1 | ||
| 199 | #define WLC_E_STATUS_TIMEOUT 2 | ||
| 200 | #define WLC_E_STATUS_NO_NETWORKS 3 | ||
| 201 | #define WLC_E_STATUS_ABORT 4 | ||
| 202 | #define WLC_E_STATUS_NO_ACK 5 | ||
| 203 | #define WLC_E_STATUS_UNSOLICITED 6 | ||
| 204 | #define WLC_E_STATUS_ATTEMPT 7 | ||
| 205 | #define WLC_E_STATUS_PARTIAL 8 | ||
| 206 | #define WLC_E_STATUS_NEWSCAN 9 | ||
| 207 | #define WLC_E_STATUS_NEWASSOC 10 | ||
| 208 | #define WLC_E_STATUS_11HQUIET 11 | ||
| 209 | #define WLC_E_STATUS_SUPPRESS 12 | ||
| 210 | #define WLC_E_STATUS_NOCHANS 13 | ||
| 211 | #define WLC_E_STATUS_CS_ABORT 15 | ||
| 212 | #define WLC_E_STATUS_ERROR 16 | ||
| 213 | |||
| 214 | |||
| 215 | #define WLC_E_REASON_INITIAL_ASSOC 0 | ||
| 216 | #define WLC_E_REASON_LOW_RSSI 1 | ||
| 217 | #define WLC_E_REASON_DEAUTH 2 | ||
| 218 | #define WLC_E_REASON_DISASSOC 3 | ||
| 219 | #define WLC_E_REASON_BCNS_LOST 4 | ||
| 220 | #define WLC_E_REASON_MINTXRATE 9 | ||
| 221 | #define WLC_E_REASON_TXFAIL 10 | ||
| 222 | |||
| 223 | |||
| 224 | #define WLC_E_REASON_FAST_ROAM_FAILED 5 | ||
| 225 | #define WLC_E_REASON_DIRECTED_ROAM 6 | ||
| 226 | #define WLC_E_REASON_TSPEC_REJECTED 7 | ||
| 227 | #define WLC_E_REASON_BETTER_AP 8 | ||
| 228 | |||
| 229 | |||
| 230 | #define WLC_E_PRUNE_ENCR_MISMATCH 1 | ||
| 231 | #define WLC_E_PRUNE_BCAST_BSSID 2 | ||
| 232 | #define WLC_E_PRUNE_MAC_DENY 3 | ||
| 233 | #define WLC_E_PRUNE_MAC_NA 4 | ||
| 234 | #define WLC_E_PRUNE_REG_PASSV 5 | ||
| 235 | #define WLC_E_PRUNE_SPCT_MGMT 6 | ||
| 236 | #define WLC_E_PRUNE_RADAR 7 | ||
| 237 | #define WLC_E_RSN_MISMATCH 8 | ||
| 238 | #define WLC_E_PRUNE_NO_COMMON_RATES 9 | ||
| 239 | #define WLC_E_PRUNE_BASIC_RATES 10 | ||
| 240 | #define WLC_E_PRUNE_CIPHER_NA 12 | ||
| 241 | #define WLC_E_PRUNE_KNOWN_STA 13 | ||
| 242 | #define WLC_E_PRUNE_WDS_PEER 15 | ||
| 243 | #define WLC_E_PRUNE_QBSS_LOAD 16 | ||
| 244 | #define WLC_E_PRUNE_HOME_AP 17 | ||
| 245 | |||
| 246 | |||
| 247 | #define WLC_E_SUP_OTHER 0 | ||
| 248 | #define WLC_E_SUP_DECRYPT_KEY_DATA 1 | ||
| 249 | #define WLC_E_SUP_BAD_UCAST_WEP128 2 | ||
| 250 | #define WLC_E_SUP_BAD_UCAST_WEP40 3 | ||
| 251 | #define WLC_E_SUP_UNSUP_KEY_LEN 4 | ||
| 252 | #define WLC_E_SUP_PW_KEY_CIPHER 5 | ||
| 253 | #define WLC_E_SUP_MSG3_TOO_MANY_IE 6 | ||
| 254 | #define WLC_E_SUP_MSG3_IE_MISMATCH 7 | ||
| 255 | #define WLC_E_SUP_NO_INSTALL_FLAG 8 | ||
| 256 | #define WLC_E_SUP_MSG3_NO_GTK 9 | ||
| 257 | #define WLC_E_SUP_GRP_KEY_CIPHER 10 | ||
| 258 | #define WLC_E_SUP_GRP_MSG1_NO_GTK 11 | ||
| 259 | #define WLC_E_SUP_GTK_DECRYPT_FAIL 12 | ||
| 260 | #define WLC_E_SUP_SEND_FAIL 13 | ||
| 261 | #define WLC_E_SUP_DEAUTH 14 | ||
| 262 | #define WLC_E_SUP_WPA_PSK_TMO 15 | ||
| 263 | |||
| 264 | |||
| 265 | |||
| 266 | typedef BWL_PRE_PACKED_STRUCT struct wl_event_rx_frame_data { | ||
| 267 | uint16 version; | ||
| 268 | uint16 channel; | ||
| 269 | int32 rssi; | ||
| 270 | uint32 mactime; | ||
| 271 | uint32 rate; | ||
| 272 | } BWL_POST_PACKED_STRUCT wl_event_rx_frame_data_t; | ||
| 273 | |||
| 274 | #define BCM_RX_FRAME_DATA_VERSION 1 | ||
| 275 | |||
| 276 | |||
| 277 | typedef struct wl_event_data_if { | ||
| 278 | uint8 ifidx; | ||
| 279 | uint8 opcode; | ||
| 280 | uint8 reserved; | ||
| 281 | uint8 bssidx; | ||
| 282 | uint8 role; | ||
| 283 | } wl_event_data_if_t; | ||
| 284 | |||
| 285 | |||
| 286 | #define WLC_E_IF_ADD 1 | ||
| 287 | #define WLC_E_IF_DEL 2 | ||
| 288 | #define WLC_E_IF_CHANGE 3 | ||
| 289 | |||
| 290 | |||
| 291 | #define WLC_E_IF_ROLE_STA 0 | ||
| 292 | #define WLC_E_IF_ROLE_AP 1 | ||
| 293 | #define WLC_E_IF_ROLE_WDS 2 | ||
| 294 | #define WLC_E_IF_ROLE_P2P_GO 3 | ||
| 295 | #define WLC_E_IF_ROLE_P2P_CLIENT 4 | ||
| 296 | #define WLC_E_IF_ROLE_BTA_CREATOR 5 | ||
| 297 | #define WLC_E_IF_ROLE_BTA_ACCEPTOR 6 | ||
| 298 | |||
| 299 | |||
| 300 | #define WLC_E_LINK_BCN_LOSS 1 | ||
| 301 | #define WLC_E_LINK_DISASSOC 2 | ||
| 302 | #define WLC_E_LINK_ASSOC_REC 3 | ||
| 303 | #define WLC_E_LINK_BSSCFG_DIS 4 | ||
| 304 | |||
| 305 | |||
| 306 | #define WLC_E_OVL_DOWNLOAD 0 | ||
| 307 | #define WLC_E_OVL_UPDATE_IND 1 | ||
| 308 | |||
| 309 | |||
| 310 | #include <packed_section_end.h> | ||
| 311 | |||
| 312 | #endif | ||
diff --git a/drivers/net/wireless/bcmdhd/include/proto/bcmip.h b/drivers/net/wireless/bcmdhd/include/proto/bcmip.h new file mode 100644 index 00000000000..8a8f3146d56 --- /dev/null +++ b/drivers/net/wireless/bcmdhd/include/proto/bcmip.h | |||
| @@ -0,0 +1,154 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 1999-2011, Broadcom Corporation | ||
| 3 | * | ||
| 4 | * Unless you and Broadcom execute a separate written software license | ||
| 5 | * agreement governing use of this software, this software is licensed to you | ||
| 6 | * under the terms of the GNU General Public License version 2 (the "GPL"), | ||
| 7 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | ||
| 8 | * following added to such license: | ||
| 9 | * | ||
| 10 | * As a special exception, the copyright holders of this software give you | ||
| 11 | * permission to link this software with independent modules, and to copy and | ||
| 12 | * distribute the resulting executable under terms of your choice, provided that | ||
| 13 | * you also meet, for each linked independent module, the terms and conditions of | ||
| 14 | * the license of that module. An independent module is a module which is not | ||
| 15 | * derived from this software. The special exception does not apply to any | ||
| 16 | * modifications of the software. | ||
| 17 | * | ||
| 18 | * Notwithstanding the above, under no circumstances may you combine this | ||
| 19 | * software in any way with any other Broadcom software provided under a license | ||
| 20 | * other than the GPL, without Broadcom's express prior written consent. | ||
| 21 | * | ||
| 22 | * Fundamental constants relating to IP Protocol | ||
| 23 | * | ||
| 24 | * $Id: bcmip.h,v 9.19 2009-11-10 20:08:33 Exp $ | ||
| 25 | */ | ||
| 26 | |||
| 27 | |||
| 28 | #ifndef _bcmip_h_ | ||
| 29 | #define _bcmip_h_ | ||
| 30 | |||
| 31 | #ifndef _TYPEDEFS_H_ | ||
| 32 | #include <typedefs.h> | ||
| 33 | #endif | ||
| 34 | |||
| 35 | |||
| 36 | #include <packed_section_start.h> | ||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | #define IP_VER_OFFSET 0x0 | ||
| 41 | #define IP_VER_MASK 0xf0 | ||
| 42 | #define IP_VER_SHIFT 4 | ||
| 43 | #define IP_VER_4 4 | ||
| 44 | #define IP_VER_6 6 | ||
| 45 | |||
| 46 | #define IP_VER(ip_body) \ | ||
| 47 | ((((uint8 *)(ip_body))[IP_VER_OFFSET] & IP_VER_MASK) >> IP_VER_SHIFT) | ||
| 48 | |||
| 49 | #define IP_PROT_ICMP 0x1 | ||
| 50 | #define IP_PROT_TCP 0x6 | ||
| 51 | #define IP_PROT_UDP 0x11 | ||
| 52 | |||
| 53 | |||
| 54 | #define IPV4_VER_HL_OFFSET 0 | ||
| 55 | #define IPV4_TOS_OFFSET 1 | ||
| 56 | #define IPV4_PKTLEN_OFFSET 2 | ||
| 57 | #define IPV4_PKTFLAG_OFFSET 6 | ||
| 58 | #define IPV4_PROT_OFFSET 9 | ||
| 59 | #define IPV4_CHKSUM_OFFSET 10 | ||
| 60 | #define IPV4_SRC_IP_OFFSET 12 | ||
| 61 | #define IPV4_DEST_IP_OFFSET 16 | ||
| 62 | #define IPV4_OPTIONS_OFFSET 20 | ||
| 63 | |||
| 64 | |||
| 65 | #define IPV4_VER_MASK 0xf0 | ||
| 66 | #define IPV4_VER_SHIFT 4 | ||
| 67 | |||
| 68 | #define IPV4_HLEN_MASK 0x0f | ||
| 69 | #define IPV4_HLEN(ipv4_body) (4 * (((uint8 *)(ipv4_body))[IPV4_VER_HL_OFFSET] & IPV4_HLEN_MASK)) | ||
| 70 | |||
| 71 | #define IPV4_ADDR_LEN 4 | ||
| 72 | |||
| 73 | #define IPV4_ADDR_NULL(a) ((((uint8 *)(a))[0] | ((uint8 *)(a))[1] | \ | ||
| 74 | ((uint8 *)(a))[2] | ((uint8 *)(a))[3]) == 0) | ||
| 75 | |||
| 76 | #define IPV4_ADDR_BCAST(a) ((((uint8 *)(a))[0] & ((uint8 *)(a))[1] & \ | ||
| 77 | ((uint8 *)(a))[2] & ((uint8 *)(a))[3]) == 0xff) | ||
| 78 | |||
| 79 | #define IPV4_TOS_DSCP_MASK 0xfc | ||
| 80 | #define IPV4_TOS_DSCP_SHIFT 2 | ||
| 81 | |||
| 82 | #define IPV4_TOS(ipv4_body) (((uint8 *)(ipv4_body))[IPV4_TOS_OFFSET]) | ||
| 83 | |||
| 84 | #define IPV4_TOS_PREC_MASK 0xe0 | ||
| 85 | #define IPV4_TOS_PREC_SHIFT 5 | ||
| 86 | |||
| 87 | #define IPV4_TOS_LOWDELAY 0x10 | ||
| 88 | #define IPV4_TOS_THROUGHPUT 0x8 | ||
| 89 | #define IPV4_TOS_RELIABILITY 0x4 | ||
| 90 | |||
| 91 | #define IPV4_PROT(ipv4_body) (((uint8 *)(ipv4_body))[IPV4_PROT_OFFSET]) | ||
| 92 | |||
| 93 | #define IPV4_FRAG_RESV 0x8000 | ||
| 94 | #define IPV4_FRAG_DONT 0x4000 | ||
| 95 | #define IPV4_FRAG_MORE 0x2000 | ||
| 96 | #define IPV4_FRAG_OFFSET_MASK 0x1fff | ||
| 97 | |||
| 98 | #define IPV4_ADDR_STR_LEN 16 | ||
| 99 | |||
| 100 | |||
| 101 | BWL_PRE_PACKED_STRUCT struct ipv4_addr { | ||
| 102 | uint8 addr[IPV4_ADDR_LEN]; | ||
| 103 | } BWL_POST_PACKED_STRUCT; | ||
| 104 | |||
| 105 | BWL_PRE_PACKED_STRUCT struct ipv4_hdr { | ||
| 106 | uint8 version_ihl; | ||
| 107 | uint8 tos; | ||
| 108 | uint16 tot_len; | ||
| 109 | uint16 id; | ||
| 110 | uint16 frag; | ||
| 111 | uint8 ttl; | ||
| 112 | uint8 prot; | ||
| 113 | uint16 hdr_chksum; | ||
| 114 | uint8 src_ip[IPV4_ADDR_LEN]; | ||
| 115 | uint8 dst_ip[IPV4_ADDR_LEN]; | ||
| 116 | } BWL_POST_PACKED_STRUCT; | ||
| 117 | |||
| 118 | |||
| 119 | #define IPV6_PAYLOAD_LEN_OFFSET 4 | ||
| 120 | #define IPV6_NEXT_HDR_OFFSET 6 | ||
| 121 | #define IPV6_HOP_LIMIT_OFFSET 7 | ||
| 122 | #define IPV6_SRC_IP_OFFSET 8 | ||
| 123 | #define IPV6_DEST_IP_OFFSET 24 | ||
| 124 | |||
| 125 | |||
| 126 | #define IPV6_TRAFFIC_CLASS(ipv6_body) \ | ||
| 127 | (((((uint8 *)(ipv6_body))[0] & 0x0f) << 4) | \ | ||
| 128 | ((((uint8 *)(ipv6_body))[1] & 0xf0) >> 4)) | ||
| 129 | |||
| 130 | #define IPV6_FLOW_LABEL(ipv6_body) \ | ||
| 131 | (((((uint8 *)(ipv6_body))[1] & 0x0f) << 16) | \ | ||
| 132 | (((uint8 *)(ipv6_body))[2] << 8) | \ | ||
| 133 | (((uint8 *)(ipv6_body))[3])) | ||
| 134 | |||
| 135 | #define IPV6_PAYLOAD_LEN(ipv6_body) \ | ||
| 136 | ((((uint8 *)(ipv6_body))[IPV6_PAYLOAD_LEN_OFFSET + 0] << 8) | \ | ||
| 137 | ((uint8 *)(ipv6_body))[IPV6_PAYLOAD_LEN_OFFSET + 1]) | ||
| 138 | |||
| 139 | #define IPV6_NEXT_HDR(ipv6_body) \ | ||
| 140 | (((uint8 *)(ipv6_body))[IPV6_NEXT_HDR_OFFSET]) | ||
| 141 | |||
| 142 | #define IPV6_PROT(ipv6_body) IPV6_NEXT_HDR(ipv6_body) | ||
| 143 | |||
| 144 | #define IPV6_ADDR_LEN 16 | ||
| 145 | |||
| 146 | |||
| 147 | #define IP_TOS46(ip_body) \ | ||
| 148 | (IP_VER(ip_body) == IP_VER_4 ? IPV4_TOS(ip_body) : \ | ||
| 149 | IP_VER(ip_body) == IP_VER_6 ? IPV6_TRAFFIC_CLASS(ip_body) : 0) | ||
| 150 | |||
| 151 | |||
| 152 | #include <packed_section_end.h> | ||
| 153 | |||
| 154 | #endif | ||
diff --git a/drivers/net/wireless/bcmdhd/include/proto/bt_amp_hci.h b/drivers/net/wireless/bcmdhd/include/proto/bt_amp_hci.h new file mode 100644 index 00000000000..89c11817915 --- /dev/null +++ b/drivers/net/wireless/bcmdhd/include/proto/bt_amp_hci.h | |||
| @@ -0,0 +1,442 @@ | |||
| 1 | /* | ||
| 2 | * BT-AMP (BlueTooth Alternate Mac and Phy) HCI (Host/Controller Interface) | ||
| 3 | * | ||
| 4 | * Copyright (C) 1999-2011, Broadcom Corporation | ||
| 5 | * | ||
| 6 | * Unless you and Broadcom execute a separate written software license | ||
| 7 | * agreement governing use of this software, this software is licensed to you | ||
| 8 | * under the terms of the GNU General Public License version 2 (the "GPL"), | ||
| 9 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | ||
| 10 | * following added to such license: | ||
| 11 | * | ||
| 12 | * As a special exception, the copyright holders of this software give you | ||
| 13 | * permission to link this software with independent modules, and to copy and | ||
| 14 | * distribute the resulting executable under terms of your choice, provided that | ||
| 15 | * you also meet, for each linked independent module, the terms and conditions of | ||
| 16 | * the license of that module. An independent module is a module which is not | ||
| 17 | * derived from this software. The special exception does not apply to any | ||
| 18 | * modifications of the software. | ||
| 19 | * | ||
| 20 | * Notwithstanding the above, under no circumstances may you combine this | ||
| 21 | * software in any way with any other Broadcom software provided under a license | ||
| 22 | * other than the GPL, without Broadcom's express prior written consent. | ||
| 23 | * | ||
| 24 | * $Id: bt_amp_hci.h,v 9.14.8.2 2010-09-10 18:37:47 Exp $ | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef _bt_amp_hci_h | ||
| 28 | #define _bt_amp_hci_h | ||
| 29 | |||
| 30 | /* This marks the start of a packed structure section. */ | ||
| 31 | #include <packed_section_start.h> | ||
| 32 | |||
| 33 | |||
| 34 | /* AMP HCI CMD packet format */ | ||
| 35 | typedef BWL_PRE_PACKED_STRUCT struct amp_hci_cmd { | ||
| 36 | uint16 opcode; | ||
| 37 | uint8 plen; | ||
| 38 | uint8 parms[1]; | ||
| 39 | } BWL_POST_PACKED_STRUCT amp_hci_cmd_t; | ||
| 40 | |||
| 41 | #define HCI_CMD_PREAMBLE_SIZE OFFSETOF(amp_hci_cmd_t, parms) | ||
| 42 | #define HCI_CMD_DATA_SIZE 255 | ||
| 43 | |||
| 44 | /* AMP HCI CMD opcode layout */ | ||
| 45 | #define HCI_CMD_OPCODE(ogf, ocf) ((((ogf) & 0x3F) << 10) | ((ocf) & 0x03FF)) | ||
| 46 | #define HCI_CMD_OGF(opcode) ((uint8)(((opcode) >> 10) & 0x3F)) | ||
| 47 | #define HCI_CMD_OCF(opcode) ((opcode) & 0x03FF) | ||
| 48 | |||
| 49 | /* AMP HCI command opcodes */ | ||
| 50 | #define HCI_Read_Failed_Contact_Counter HCI_CMD_OPCODE(0x05, 0x0001) | ||
| 51 | #define HCI_Reset_Failed_Contact_Counter HCI_CMD_OPCODE(0x05, 0x0002) | ||
| 52 | #define HCI_Read_Link_Quality HCI_CMD_OPCODE(0x05, 0x0003) | ||
| 53 | #define HCI_Read_Local_AMP_Info HCI_CMD_OPCODE(0x05, 0x0009) | ||
| 54 | #define HCI_Read_Local_AMP_ASSOC HCI_CMD_OPCODE(0x05, 0x000A) | ||
| 55 | #define HCI_Write_Remote_AMP_ASSOC HCI_CMD_OPCODE(0x05, 0x000B) | ||
| 56 | #define HCI_Create_Physical_Link HCI_CMD_OPCODE(0x01, 0x0035) | ||
| 57 | #define HCI_Accept_Physical_Link_Request HCI_CMD_OPCODE(0x01, 0x0036) | ||
| 58 | #define HCI_Disconnect_Physical_Link HCI_CMD_OPCODE(0x01, 0x0037) | ||
| 59 | #define HCI_Create_Logical_Link HCI_CMD_OPCODE(0x01, 0x0038) | ||
| 60 | #define HCI_Accept_Logical_Link HCI_CMD_OPCODE(0x01, 0x0039) | ||
| 61 | #define HCI_Disconnect_Logical_Link HCI_CMD_OPCODE(0x01, 0x003A) | ||
| 62 | #define HCI_Logical_Link_Cancel HCI_CMD_OPCODE(0x01, 0x003B) | ||
| 63 | #define HCI_Flow_Spec_Modify HCI_CMD_OPCODE(0x01, 0x003C) | ||
| 64 | #define HCI_Write_Flow_Control_Mode HCI_CMD_OPCODE(0x01, 0x0067) | ||
| 65 | #define HCI_Read_Best_Effort_Flush_Timeout HCI_CMD_OPCODE(0x01, 0x0069) | ||
| 66 | #define HCI_Write_Best_Effort_Flush_Timeout HCI_CMD_OPCODE(0x01, 0x006A) | ||
| 67 | #define HCI_Short_Range_Mode HCI_CMD_OPCODE(0x01, 0x006B) | ||
| 68 | #define HCI_Reset HCI_CMD_OPCODE(0x03, 0x0003) | ||
| 69 | #define HCI_Read_Connection_Accept_Timeout HCI_CMD_OPCODE(0x03, 0x0015) | ||
| 70 | #define HCI_Write_Connection_Accept_Timeout HCI_CMD_OPCODE(0x03, 0x0016) | ||
| 71 | #define HCI_Read_Link_Supervision_Timeout HCI_CMD_OPCODE(0x03, 0x0036) | ||
| 72 | #define HCI_Write_Link_Supervision_Timeout HCI_CMD_OPCODE(0x03, 0x0037) | ||
| 73 | #define HCI_Enhanced_Flush HCI_CMD_OPCODE(0x03, 0x005F) | ||
| 74 | #define HCI_Read_Logical_Link_Accept_Timeout HCI_CMD_OPCODE(0x03, 0x0061) | ||
| 75 | #define HCI_Write_Logical_Link_Accept_Timeout HCI_CMD_OPCODE(0x03, 0x0062) | ||
| 76 | #define HCI_Set_Event_Mask_Page_2 HCI_CMD_OPCODE(0x03, 0x0063) | ||
| 77 | #define HCI_Read_Location_Data_Command HCI_CMD_OPCODE(0x03, 0x0064) | ||
| 78 | #define HCI_Write_Location_Data_Command HCI_CMD_OPCODE(0x03, 0x0065) | ||
| 79 | #define HCI_Read_Local_Version_Info HCI_CMD_OPCODE(0x04, 0x0001) | ||
| 80 | #define HCI_Read_Local_Supported_Commands HCI_CMD_OPCODE(0x04, 0x0002) | ||
| 81 | #define HCI_Read_Buffer_Size HCI_CMD_OPCODE(0x04, 0x0005) | ||
| 82 | #define HCI_Read_Data_Block_Size HCI_CMD_OPCODE(0x04, 0x000A) | ||
| 83 | |||
| 84 | /* AMP HCI command parameters */ | ||
| 85 | typedef BWL_PRE_PACKED_STRUCT struct read_local_cmd_parms { | ||
| 86 | uint8 plh; | ||
| 87 | uint8 offset[2]; /* length so far */ | ||
| 88 | uint8 max_remote[2]; | ||
| 89 | } BWL_POST_PACKED_STRUCT read_local_cmd_parms_t; | ||
| 90 | |||
| 91 | typedef BWL_PRE_PACKED_STRUCT struct write_remote_cmd_parms { | ||
| 92 | uint8 plh; | ||
| 93 | uint8 offset[2]; | ||
| 94 | uint8 len[2]; | ||
| 95 | uint8 frag[1]; | ||
| 96 | } BWL_POST_PACKED_STRUCT write_remote_cmd_parms_t; | ||
| 97 | |||
| 98 | typedef BWL_PRE_PACKED_STRUCT struct phy_link_cmd_parms { | ||
| 99 | uint8 plh; | ||
| 100 | uint8 key_length; | ||
| 101 | uint8 key_type; | ||
| 102 | uint8 key[1]; | ||
| 103 | } BWL_POST_PACKED_STRUCT phy_link_cmd_parms_t; | ||
| 104 | |||
| 105 | typedef BWL_PRE_PACKED_STRUCT struct dis_phy_link_cmd_parms { | ||
| 106 | uint8 plh; | ||
| 107 | uint8 reason; | ||
| 108 | } BWL_POST_PACKED_STRUCT dis_phy_link_cmd_parms_t; | ||
| 109 | |||
| 110 | typedef BWL_PRE_PACKED_STRUCT struct log_link_cmd_parms { | ||
| 111 | uint8 plh; | ||
| 112 | uint8 txflow[16]; | ||
| 113 | uint8 rxflow[16]; | ||
| 114 | } BWL_POST_PACKED_STRUCT log_link_cmd_parms_t; | ||
| 115 | |||
| 116 | typedef BWL_PRE_PACKED_STRUCT struct ext_flow_spec { | ||
| 117 | uint8 id; | ||
| 118 | uint8 service_type; | ||
| 119 | uint8 max_sdu[2]; | ||
| 120 | uint8 sdu_ia_time[4]; | ||
| 121 | uint8 access_latency[4]; | ||
| 122 | uint8 flush_timeout[4]; | ||
| 123 | } BWL_POST_PACKED_STRUCT ext_flow_spec_t; | ||
| 124 | |||
| 125 | typedef BWL_PRE_PACKED_STRUCT struct log_link_cancel_cmd_parms { | ||
| 126 | uint8 plh; | ||
| 127 | uint8 tx_fs_ID; | ||
| 128 | } BWL_POST_PACKED_STRUCT log_link_cancel_cmd_parms_t; | ||
| 129 | |||
| 130 | typedef BWL_PRE_PACKED_STRUCT struct flow_spec_mod_cmd_parms { | ||
| 131 | uint8 llh[2]; | ||
| 132 | uint8 txflow[16]; | ||
| 133 | uint8 rxflow[16]; | ||
| 134 | } BWL_POST_PACKED_STRUCT flow_spec_mod_cmd_parms_t; | ||
| 135 | |||
| 136 | typedef BWL_PRE_PACKED_STRUCT struct plh_pad { | ||
| 137 | uint8 plh; | ||
| 138 | uint8 pad; | ||
| 139 | } BWL_POST_PACKED_STRUCT plh_pad_t; | ||
| 140 | |||
| 141 | typedef BWL_PRE_PACKED_STRUCT union hci_handle { | ||
| 142 | uint16 bredr; | ||
| 143 | plh_pad_t amp; | ||
| 144 | } BWL_POST_PACKED_STRUCT hci_handle_t; | ||
| 145 | |||
| 146 | typedef BWL_PRE_PACKED_STRUCT struct ls_to_cmd_parms { | ||
| 147 | hci_handle_t handle; | ||
| 148 | uint8 timeout[2]; | ||
| 149 | } BWL_POST_PACKED_STRUCT ls_to_cmd_parms_t; | ||
| 150 | |||
| 151 | typedef BWL_PRE_PACKED_STRUCT struct befto_cmd_parms { | ||
| 152 | uint8 llh[2]; | ||
| 153 | uint8 befto[4]; | ||
| 154 | } BWL_POST_PACKED_STRUCT befto_cmd_parms_t; | ||
| 155 | |||
| 156 | typedef BWL_PRE_PACKED_STRUCT struct srm_cmd_parms { | ||
| 157 | uint8 plh; | ||
| 158 | uint8 srm; | ||
| 159 | } BWL_POST_PACKED_STRUCT srm_cmd_parms_t; | ||
| 160 | |||
| 161 | typedef BWL_PRE_PACKED_STRUCT struct ld_cmd_parms { | ||
| 162 | uint8 ld_aware; | ||
| 163 | uint8 ld[2]; | ||
| 164 | uint8 ld_opts; | ||
| 165 | uint8 l_opts; | ||
| 166 | } BWL_POST_PACKED_STRUCT ld_cmd_parms_t; | ||
| 167 | |||
| 168 | typedef BWL_PRE_PACKED_STRUCT struct eflush_cmd_parms { | ||
| 169 | uint8 llh[2]; | ||
| 170 | uint8 packet_type; | ||
| 171 | } BWL_POST_PACKED_STRUCT eflush_cmd_parms_t; | ||
| 172 | |||
| 173 | /* Generic AMP extended flow spec service types */ | ||
| 174 | #define EFS_SVCTYPE_NO_TRAFFIC 0 | ||
| 175 | #define EFS_SVCTYPE_BEST_EFFORT 1 | ||
| 176 | #define EFS_SVCTYPE_GUARANTEED 2 | ||
| 177 | |||
| 178 | /* AMP HCI event packet format */ | ||
| 179 | typedef BWL_PRE_PACKED_STRUCT struct amp_hci_event { | ||
| 180 | uint8 ecode; | ||
| 181 | uint8 plen; | ||
| 182 | uint8 parms[1]; | ||
| 183 | } BWL_POST_PACKED_STRUCT amp_hci_event_t; | ||
| 184 | |||
| 185 | #define HCI_EVT_PREAMBLE_SIZE OFFSETOF(amp_hci_event_t, parms) | ||
| 186 | |||
| 187 | /* AMP HCI event codes */ | ||
| 188 | #define HCI_Command_Complete 0x0E | ||
| 189 | #define HCI_Command_Status 0x0F | ||
| 190 | #define HCI_Flush_Occurred 0x11 | ||
| 191 | #define HCI_Enhanced_Flush_Complete 0x39 | ||
| 192 | #define HCI_Physical_Link_Complete 0x40 | ||
| 193 | #define HCI_Channel_Select 0x41 | ||
| 194 | #define HCI_Disconnect_Physical_Link_Complete 0x42 | ||
| 195 | #define HCI_Logical_Link_Complete 0x45 | ||
| 196 | #define HCI_Disconnect_Logical_Link_Complete 0x46 | ||
| 197 | #define HCI_Flow_Spec_Modify_Complete 0x47 | ||
| 198 | #define HCI_Number_of_Completed_Data_Blocks 0x48 | ||
| 199 | #define HCI_Short_Range_Mode_Change_Complete 0x4C | ||
| 200 | #define HCI_Status_Change_Event 0x4D | ||
| 201 | #define HCI_Vendor_Specific 0xFF | ||
| 202 | |||
| 203 | /* AMP HCI event mask bit positions */ | ||
| 204 | #define HCI_Physical_Link_Complete_Event_Mask 0x0001 | ||
| 205 | #define HCI_Channel_Select_Event_Mask 0x0002 | ||
| 206 | #define HCI_Disconnect_Physical_Link_Complete_Event_Mask 0x0004 | ||
| 207 | #define HCI_Logical_Link_Complete_Event_Mask 0x0020 | ||
| 208 | #define HCI_Disconnect_Logical_Link_Complete_Event_Mask 0x0040 | ||
| 209 | #define HCI_Flow_Spec_Modify_Complete_Event_Mask 0x0080 | ||
| 210 | #define HCI_Number_of_Completed_Data_Blocks_Event_Mask 0x0100 | ||
| 211 | #define HCI_Short_Range_Mode_Change_Complete_Event_Mask 0x1000 | ||
| 212 | #define HCI_Status_Change_Event_Mask 0x2000 | ||
| 213 | #define HCI_All_Event_Mask 0x31e7 | ||
| 214 | |||
| 215 | /* AMP HCI event parameters */ | ||
| 216 | typedef BWL_PRE_PACKED_STRUCT struct cmd_status_parms { | ||
| 217 | uint8 status; | ||
| 218 | uint8 cmdpkts; | ||
| 219 | uint16 opcode; | ||
| 220 | } BWL_POST_PACKED_STRUCT cmd_status_parms_t; | ||
| 221 | |||
| 222 | typedef BWL_PRE_PACKED_STRUCT struct cmd_complete_parms { | ||
| 223 | uint8 cmdpkts; | ||
| 224 | uint16 opcode; | ||
| 225 | uint8 parms[1]; | ||
| 226 | } BWL_POST_PACKED_STRUCT cmd_complete_parms_t; | ||
| 227 | |||
| 228 | typedef BWL_PRE_PACKED_STRUCT struct flush_occurred_evt_parms { | ||
| 229 | uint16 handle; | ||
| 230 | } BWL_POST_PACKED_STRUCT flush_occurred_evt_parms_t; | ||
| 231 | |||
| 232 | typedef BWL_PRE_PACKED_STRUCT struct write_remote_evt_parms { | ||
| 233 | uint8 status; | ||
| 234 | uint8 plh; | ||
| 235 | } BWL_POST_PACKED_STRUCT write_remote_evt_parms_t; | ||
| 236 | |||
| 237 | typedef BWL_PRE_PACKED_STRUCT struct read_local_evt_parms { | ||
| 238 | uint8 status; | ||
| 239 | uint8 plh; | ||
| 240 | uint16 len; | ||
| 241 | uint8 frag[1]; | ||
| 242 | } BWL_POST_PACKED_STRUCT read_local_evt_parms_t; | ||
| 243 | |||
| 244 | typedef BWL_PRE_PACKED_STRUCT struct read_local_info_evt_parms { | ||
| 245 | uint8 status; | ||
| 246 | uint8 AMP_status; | ||
| 247 | uint32 bandwidth; | ||
| 248 | uint32 gbandwidth; | ||
| 249 | uint32 latency; | ||
| 250 | uint32 PDU_size; | ||
| 251 | uint8 ctrl_type; | ||
| 252 | uint16 PAL_cap; | ||
| 253 | uint16 AMP_ASSOC_len; | ||
| 254 | uint32 max_flush_timeout; | ||
| 255 | uint32 be_flush_timeout; | ||
| 256 | } BWL_POST_PACKED_STRUCT read_local_info_evt_parms_t; | ||
| 257 | |||
| 258 | typedef BWL_PRE_PACKED_STRUCT struct log_link_evt_parms { | ||
| 259 | uint8 status; | ||
| 260 | uint16 llh; | ||
| 261 | uint8 plh; | ||
| 262 | uint8 tx_fs_ID; | ||
| 263 | } BWL_POST_PACKED_STRUCT log_link_evt_parms_t; | ||
| 264 | |||
| 265 | typedef BWL_PRE_PACKED_STRUCT struct disc_log_link_evt_parms { | ||
| 266 | uint8 status; | ||
| 267 | uint16 llh; | ||
| 268 | uint8 reason; | ||
| 269 | } BWL_POST_PACKED_STRUCT disc_log_link_evt_parms_t; | ||
| 270 | |||
| 271 | typedef BWL_PRE_PACKED_STRUCT struct log_link_cancel_evt_parms { | ||
| 272 | uint8 status; | ||
| 273 | uint8 plh; | ||
| 274 | uint8 tx_fs_ID; | ||
| 275 | } BWL_POST_PACKED_STRUCT log_link_cancel_evt_parms_t; | ||
| 276 | |||
| 277 | typedef BWL_PRE_PACKED_STRUCT struct flow_spec_mod_evt_parms { | ||
| 278 | uint8 status; | ||
| 279 | uint16 llh; | ||
| 280 | } BWL_POST_PACKED_STRUCT flow_spec_mod_evt_parms_t; | ||
| 281 | |||
| 282 | typedef BWL_PRE_PACKED_STRUCT struct phy_link_evt_parms { | ||
| 283 | uint8 status; | ||
| 284 | uint8 plh; | ||
| 285 | } BWL_POST_PACKED_STRUCT phy_link_evt_parms_t; | ||
| 286 | |||
| 287 | typedef BWL_PRE_PACKED_STRUCT struct dis_phy_link_evt_parms { | ||
| 288 | uint8 status; | ||
| 289 | uint8 plh; | ||
| 290 | uint8 reason; | ||
| 291 | } BWL_POST_PACKED_STRUCT dis_phy_link_evt_parms_t; | ||
| 292 | |||
| 293 | typedef BWL_PRE_PACKED_STRUCT struct read_ls_to_evt_parms { | ||
| 294 | uint8 status; | ||
| 295 | hci_handle_t handle; | ||
| 296 | uint16 timeout; | ||
| 297 | } BWL_POST_PACKED_STRUCT read_ls_to_evt_parms_t; | ||
| 298 | |||
| 299 | typedef BWL_PRE_PACKED_STRUCT struct read_lla_ca_to_evt_parms { | ||
| 300 | uint8 status; | ||
| 301 | uint16 timeout; | ||
| 302 | } BWL_POST_PACKED_STRUCT read_lla_ca_to_evt_parms_t; | ||
| 303 | |||
| 304 | typedef BWL_PRE_PACKED_STRUCT struct read_data_block_size_evt_parms { | ||
| 305 | uint8 status; | ||
| 306 | uint16 ACL_pkt_len; | ||
| 307 | uint16 data_block_len; | ||
| 308 | uint16 data_block_num; | ||
| 309 | } BWL_POST_PACKED_STRUCT read_data_block_size_evt_parms_t; | ||
| 310 | |||
| 311 | typedef BWL_PRE_PACKED_STRUCT struct data_blocks { | ||
| 312 | uint16 handle; | ||
| 313 | uint16 pkts; | ||
| 314 | uint16 blocks; | ||
| 315 | } BWL_POST_PACKED_STRUCT data_blocks_t; | ||
| 316 | |||
| 317 | typedef BWL_PRE_PACKED_STRUCT struct num_completed_data_blocks_evt_parms { | ||
| 318 | uint16 num_blocks; | ||
| 319 | uint8 num_handles; | ||
| 320 | data_blocks_t completed[1]; | ||
| 321 | } BWL_POST_PACKED_STRUCT num_completed_data_blocks_evt_parms_t; | ||
| 322 | |||
| 323 | typedef BWL_PRE_PACKED_STRUCT struct befto_evt_parms { | ||
| 324 | uint8 status; | ||
| 325 | uint32 befto; | ||
| 326 | } BWL_POST_PACKED_STRUCT befto_evt_parms_t; | ||
| 327 | |||
| 328 | typedef BWL_PRE_PACKED_STRUCT struct srm_evt_parms { | ||
| 329 | uint8 status; | ||
| 330 | uint8 plh; | ||
| 331 | uint8 srm; | ||
| 332 | } BWL_POST_PACKED_STRUCT srm_evt_parms_t; | ||
| 333 | |||
| 334 | typedef BWL_PRE_PACKED_STRUCT struct contact_counter_evt_parms { | ||
| 335 | uint8 status; | ||
| 336 | uint8 llh[2]; | ||
| 337 | uint16 counter; | ||
| 338 | } BWL_POST_PACKED_STRUCT contact_counter_evt_parms_t; | ||
| 339 | |||
| 340 | typedef BWL_PRE_PACKED_STRUCT struct contact_counter_reset_evt_parms { | ||
| 341 | uint8 status; | ||
| 342 | uint8 llh[2]; | ||
| 343 | } BWL_POST_PACKED_STRUCT contact_counter_reset_evt_parms_t; | ||
| 344 | |||
| 345 | typedef BWL_PRE_PACKED_STRUCT struct read_linkq_evt_parms { | ||
| 346 | uint8 status; | ||
| 347 | hci_handle_t handle; | ||
| 348 | uint8 link_quality; | ||
| 349 | } BWL_POST_PACKED_STRUCT read_linkq_evt_parms_t; | ||
| 350 | |||
| 351 | typedef BWL_PRE_PACKED_STRUCT struct ld_evt_parms { | ||
| 352 | uint8 status; | ||
| 353 | uint8 ld_aware; | ||
| 354 | uint8 ld[2]; | ||
| 355 | uint8 ld_opts; | ||
| 356 | uint8 l_opts; | ||
| 357 | } BWL_POST_PACKED_STRUCT ld_evt_parms_t; | ||
| 358 | |||
| 359 | typedef BWL_PRE_PACKED_STRUCT struct eflush_complete_evt_parms { | ||
| 360 | uint16 handle; | ||
| 361 | } BWL_POST_PACKED_STRUCT eflush_complete_evt_parms_t; | ||
| 362 | |||
| 363 | typedef BWL_PRE_PACKED_STRUCT struct vendor_specific_evt_parms { | ||
| 364 | uint8 len; | ||
| 365 | uint8 parms[1]; | ||
| 366 | } BWL_POST_PACKED_STRUCT vendor_specific_evt_parms_t; | ||
| 367 | |||
| 368 | typedef BWL_PRE_PACKED_STRUCT struct local_version_info_evt_parms { | ||
| 369 | uint8 status; | ||
| 370 | uint8 hci_version; | ||
| 371 | uint16 hci_revision; | ||
| 372 | uint8 pal_version; | ||
| 373 | uint16 mfg_name; | ||
| 374 | uint16 pal_subversion; | ||
| 375 | } BWL_POST_PACKED_STRUCT local_version_info_evt_parms_t; | ||
| 376 | |||
| 377 | #define MAX_SUPPORTED_CMD_BYTE 64 | ||
| 378 | typedef BWL_PRE_PACKED_STRUCT struct local_supported_cmd_evt_parms { | ||
| 379 | uint8 status; | ||
| 380 | uint8 cmd[MAX_SUPPORTED_CMD_BYTE]; | ||
| 381 | } BWL_POST_PACKED_STRUCT local_supported_cmd_evt_parms_t; | ||
| 382 | |||
| 383 | typedef BWL_PRE_PACKED_STRUCT struct status_change_evt_parms { | ||
| 384 | uint8 status; | ||
| 385 | uint8 amp_status; | ||
| 386 | } BWL_POST_PACKED_STRUCT status_change_evt_parms_t; | ||
| 387 | |||
| 388 | /* AMP HCI error codes */ | ||
| 389 | #define HCI_SUCCESS 0x00 | ||
| 390 | #define HCI_ERR_ILLEGAL_COMMAND 0x01 | ||
| 391 | #define HCI_ERR_NO_CONNECTION 0x02 | ||
| 392 | #define HCI_ERR_MEMORY_FULL 0x07 | ||
| 393 | #define HCI_ERR_CONNECTION_TIMEOUT 0x08 | ||
| 394 | #define HCI_ERR_MAX_NUM_OF_CONNECTIONS 0x09 | ||
| 395 | #define HCI_ERR_CONNECTION_EXISTS 0x0B | ||
| 396 | #define HCI_ERR_CONNECTION_DISALLOWED 0x0C | ||
| 397 | #define HCI_ERR_CONNECTION_ACCEPT_TIMEOUT 0x10 | ||
| 398 | #define HCI_ERR_UNSUPPORTED_VALUE 0x11 | ||
| 399 | #define HCI_ERR_ILLEGAL_PARAMETER_FMT 0x12 | ||
| 400 | #define HCI_ERR_CONN_TERM_BY_LOCAL_HOST 0x16 | ||
| 401 | #define HCI_ERR_UNSPECIFIED 0x1F | ||
| 402 | #define HCI_ERR_UNIT_KEY_USED 0x26 | ||
| 403 | #define HCI_ERR_QOS_REJECTED 0x2D | ||
| 404 | #define HCI_ERR_PARAM_OUT_OF_RANGE 0x30 | ||
| 405 | #define HCI_ERR_NO_SUITABLE_CHANNEL 0x39 | ||
| 406 | #define HCI_ERR_CHANNEL_MOVE 0xFF | ||
| 407 | |||
| 408 | /* AMP HCI ACL Data packet format */ | ||
| 409 | typedef BWL_PRE_PACKED_STRUCT struct amp_hci_ACL_data { | ||
| 410 | uint16 handle; /* 12-bit connection handle + 2-bit PB and 2-bit BC flags */ | ||
| 411 | uint16 dlen; /* data total length */ | ||
| 412 | uint8 data[1]; | ||
| 413 | } BWL_POST_PACKED_STRUCT amp_hci_ACL_data_t; | ||
| 414 | |||
| 415 | #define HCI_ACL_DATA_PREAMBLE_SIZE OFFSETOF(amp_hci_ACL_data_t, data) | ||
| 416 | |||
| 417 | #define HCI_ACL_DATA_BC_FLAGS (0x0 << 14) | ||
| 418 | #define HCI_ACL_DATA_PB_FLAGS (0x3 << 12) | ||
| 419 | |||
| 420 | #define HCI_ACL_DATA_HANDLE(handle) ((handle) & 0x0fff) | ||
| 421 | #define HCI_ACL_DATA_FLAGS(handle) ((handle) >> 12) | ||
| 422 | |||
| 423 | /* AMP Activity Report packet formats */ | ||
| 424 | typedef BWL_PRE_PACKED_STRUCT struct amp_hci_activity_report { | ||
| 425 | uint8 ScheduleKnown; | ||
| 426 | uint8 NumReports; | ||
| 427 | uint8 data[1]; | ||
| 428 | } BWL_POST_PACKED_STRUCT amp_hci_activity_report_t; | ||
| 429 | |||
| 430 | typedef BWL_PRE_PACKED_STRUCT struct amp_hci_activity_report_triple { | ||
| 431 | uint32 StartTime; | ||
| 432 | uint32 Duration; | ||
| 433 | uint32 Periodicity; | ||
| 434 | } BWL_POST_PACKED_STRUCT amp_hci_activity_report_triple_t; | ||
| 435 | |||
| 436 | #define HCI_AR_SCHEDULE_KNOWN 0x01 | ||
| 437 | |||
| 438 | |||
| 439 | /* This marks the end of a packed structure section. */ | ||
| 440 | #include <packed_section_end.h> | ||
| 441 | |||
| 442 | #endif /* _bt_amp_hci_h_ */ | ||
diff --git a/drivers/net/wireless/bcmdhd/include/proto/eapol.h b/drivers/net/wireless/bcmdhd/include/proto/eapol.h new file mode 100644 index 00000000000..5781d1312e3 --- /dev/null +++ b/drivers/net/wireless/bcmdhd/include/proto/eapol.h | |||
| @@ -0,0 +1,173 @@ | |||
| 1 | /* | ||
| 2 | * 802.1x EAPOL definitions | ||
| 3 | * | ||
| 4 | * See | ||
| 5 | * IEEE Std 802.1X-2001 | ||
| 6 | * IEEE 802.1X RADIUS Usage Guidelines | ||
| 7 | * | ||
| 8 | * Copyright (C) 2002 Broadcom Corporation | ||
| 9 | * | ||
| 10 | * $Id: eapol.h,v 9.23.86.1 2010-09-02 18:09:39 Exp $ | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef _eapol_h_ | ||
| 14 | #define _eapol_h_ | ||
| 15 | |||
| 16 | #ifndef _TYPEDEFS_H_ | ||
| 17 | #include <typedefs.h> | ||
| 18 | #endif | ||
| 19 | |||
| 20 | /* This marks the start of a packed structure section. */ | ||
| 21 | #include <packed_section_start.h> | ||
| 22 | |||
| 23 | #include <bcmcrypto/aeskeywrap.h> | ||
| 24 | |||
| 25 | /* EAPOL for 802.3/Ethernet */ | ||
| 26 | typedef struct { | ||
| 27 | struct ether_header eth; /* 802.3/Ethernet header */ | ||
| 28 | unsigned char version; /* EAPOL protocol version */ | ||
| 29 | unsigned char type; /* EAPOL type */ | ||
| 30 | unsigned short length; /* Length of body */ | ||
| 31 | unsigned char body[1]; /* Body (optional) */ | ||
| 32 | } eapol_header_t; | ||
| 33 | |||
| 34 | #define EAPOL_HEADER_LEN 18 | ||
| 35 | |||
| 36 | /* EAPOL version */ | ||
| 37 | #define WPA2_EAPOL_VERSION 2 | ||
| 38 | #define WPA_EAPOL_VERSION 1 | ||
| 39 | #define LEAP_EAPOL_VERSION 1 | ||
| 40 | #define SES_EAPOL_VERSION 1 | ||
| 41 | |||
| 42 | /* EAPOL types */ | ||
| 43 | #define EAP_PACKET 0 | ||
| 44 | #define EAPOL_START 1 | ||
| 45 | #define EAPOL_LOGOFF 2 | ||
| 46 | #define EAPOL_KEY 3 | ||
| 47 | #define EAPOL_ASF 4 | ||
| 48 | |||
| 49 | /* EAPOL-Key types */ | ||
| 50 | #define EAPOL_RC4_KEY 1 | ||
| 51 | #define EAPOL_WPA2_KEY 2 /* 802.11i/WPA2 */ | ||
| 52 | #define EAPOL_WPA_KEY 254 /* WPA */ | ||
| 53 | |||
| 54 | /* RC4 EAPOL-Key header field sizes */ | ||
| 55 | #define EAPOL_KEY_REPLAY_LEN 8 | ||
| 56 | #define EAPOL_KEY_IV_LEN 16 | ||
| 57 | #define EAPOL_KEY_SIG_LEN 16 | ||
| 58 | |||
| 59 | /* RC4 EAPOL-Key */ | ||
| 60 | typedef BWL_PRE_PACKED_STRUCT struct { | ||
| 61 | unsigned char type; /* Key Descriptor Type */ | ||
| 62 | unsigned short length; /* Key Length (unaligned) */ | ||
| 63 | unsigned char replay[EAPOL_KEY_REPLAY_LEN]; /* Replay Counter */ | ||
| 64 | unsigned char iv[EAPOL_KEY_IV_LEN]; /* Key IV */ | ||
| 65 | unsigned char index; /* Key Flags & Index */ | ||
| 66 | unsigned char signature[EAPOL_KEY_SIG_LEN]; /* Key Signature */ | ||
| 67 | unsigned char key[1]; /* Key (optional) */ | ||
| 68 | } BWL_POST_PACKED_STRUCT eapol_key_header_t; | ||
| 69 | |||
| 70 | #define EAPOL_KEY_HEADER_LEN 44 | ||
| 71 | |||
| 72 | /* RC4 EAPOL-Key flags */ | ||
| 73 | #define EAPOL_KEY_FLAGS_MASK 0x80 | ||
| 74 | #define EAPOL_KEY_BROADCAST 0 | ||
| 75 | #define EAPOL_KEY_UNICAST 0x80 | ||
| 76 | |||
| 77 | /* RC4 EAPOL-Key index */ | ||
| 78 | #define EAPOL_KEY_INDEX_MASK 0x7f | ||
| 79 | |||
| 80 | /* WPA/802.11i/WPA2 EAPOL-Key header field sizes */ | ||
| 81 | #define EAPOL_WPA_KEY_REPLAY_LEN 8 | ||
| 82 | #define EAPOL_WPA_KEY_NONCE_LEN 32 | ||
| 83 | #define EAPOL_WPA_KEY_IV_LEN 16 | ||
| 84 | #define EAPOL_WPA_KEY_RSC_LEN 8 | ||
| 85 | #define EAPOL_WPA_KEY_ID_LEN 8 | ||
| 86 | #define EAPOL_WPA_KEY_MIC_LEN 16 | ||
| 87 | #define EAPOL_WPA_KEY_DATA_LEN (EAPOL_WPA_MAX_KEY_SIZE + AKW_BLOCK_LEN) | ||
| 88 | #define EAPOL_WPA_MAX_KEY_SIZE 32 | ||
| 89 | |||
| 90 | /* WPA EAPOL-Key */ | ||
| 91 | typedef BWL_PRE_PACKED_STRUCT struct { | ||
| 92 | unsigned char type; /* Key Descriptor Type */ | ||
| 93 | unsigned short key_info; /* Key Information (unaligned) */ | ||
| 94 | unsigned short key_len; /* Key Length (unaligned) */ | ||
| 95 | unsigned char replay[EAPOL_WPA_KEY_REPLAY_LEN]; /* Replay Counter */ | ||
| 96 | unsigned char nonce[EAPOL_WPA_KEY_NONCE_LEN]; /* Nonce */ | ||
| 97 | unsigned char iv[EAPOL_WPA_KEY_IV_LEN]; /* Key IV */ | ||
| 98 | unsigned char rsc[EAPOL_WPA_KEY_RSC_LEN]; /* Key RSC */ | ||
| 99 | unsigned char id[EAPOL_WPA_KEY_ID_LEN]; /* WPA:Key ID, 802.11i/WPA2: Reserved */ | ||
| 100 | unsigned char mic[EAPOL_WPA_KEY_MIC_LEN]; /* Key MIC */ | ||
| 101 | unsigned short data_len; /* Key Data Length */ | ||
| 102 | unsigned char data[EAPOL_WPA_KEY_DATA_LEN]; /* Key data */ | ||
| 103 | } BWL_POST_PACKED_STRUCT eapol_wpa_key_header_t; | ||
| 104 | |||
| 105 | #define EAPOL_WPA_KEY_LEN 95 | ||
| 106 | |||
| 107 | /* WPA/802.11i/WPA2 KEY KEY_INFO bits */ | ||
| 108 | #define WPA_KEY_DESC_V1 0x01 | ||
| 109 | #define WPA_KEY_DESC_V2 0x02 | ||
| 110 | #define WPA_KEY_DESC_V3 0x03 | ||
| 111 | #define WPA_KEY_PAIRWISE 0x08 | ||
| 112 | #define WPA_KEY_INSTALL 0x40 | ||
| 113 | #define WPA_KEY_ACK 0x80 | ||
| 114 | #define WPA_KEY_MIC 0x100 | ||
| 115 | #define WPA_KEY_SECURE 0x200 | ||
| 116 | #define WPA_KEY_ERROR 0x400 | ||
| 117 | #define WPA_KEY_REQ 0x800 | ||
| 118 | |||
| 119 | /* WPA-only KEY KEY_INFO bits */ | ||
| 120 | #define WPA_KEY_INDEX_0 0x00 | ||
| 121 | #define WPA_KEY_INDEX_1 0x10 | ||
| 122 | #define WPA_KEY_INDEX_2 0x20 | ||
| 123 | #define WPA_KEY_INDEX_3 0x30 | ||
| 124 | #define WPA_KEY_INDEX_MASK 0x30 | ||
| 125 | #define WPA_KEY_INDEX_SHIFT 0x04 | ||
| 126 | |||
| 127 | /* 802.11i/WPA2-only KEY KEY_INFO bits */ | ||
| 128 | #define WPA_KEY_ENCRYPTED_DATA 0x1000 | ||
| 129 | |||
| 130 | /* Key Data encapsulation */ | ||
| 131 | typedef BWL_PRE_PACKED_STRUCT struct { | ||
| 132 | uint8 type; | ||
| 133 | uint8 length; | ||
| 134 | uint8 oui[3]; | ||
| 135 | uint8 subtype; | ||
| 136 | uint8 data[1]; | ||
| 137 | } BWL_POST_PACKED_STRUCT eapol_wpa2_encap_data_t; | ||
| 138 | |||
| 139 | #define EAPOL_WPA2_ENCAP_DATA_HDR_LEN 6 | ||
| 140 | |||
| 141 | #define WPA2_KEY_DATA_SUBTYPE_GTK 1 | ||
| 142 | #define WPA2_KEY_DATA_SUBTYPE_STAKEY 2 | ||
| 143 | #define WPA2_KEY_DATA_SUBTYPE_MAC 3 | ||
| 144 | #define WPA2_KEY_DATA_SUBTYPE_PMKID 4 | ||
| 145 | |||
| 146 | /* GTK encapsulation */ | ||
| 147 | typedef BWL_PRE_PACKED_STRUCT struct { | ||
| 148 | uint8 flags; | ||
| 149 | uint8 reserved; | ||
| 150 | uint8 gtk[EAPOL_WPA_MAX_KEY_SIZE]; | ||
| 151 | } BWL_POST_PACKED_STRUCT eapol_wpa2_key_gtk_encap_t; | ||
| 152 | |||
| 153 | #define EAPOL_WPA2_KEY_GTK_ENCAP_HDR_LEN 2 | ||
| 154 | |||
| 155 | #define WPA2_GTK_INDEX_MASK 0x03 | ||
| 156 | #define WPA2_GTK_INDEX_SHIFT 0x00 | ||
| 157 | |||
| 158 | #define WPA2_GTK_TRANSMIT 0x04 | ||
| 159 | |||
| 160 | /* STAKey encapsulation */ | ||
| 161 | typedef BWL_PRE_PACKED_STRUCT struct { | ||
| 162 | uint8 reserved[2]; | ||
| 163 | uint8 mac[ETHER_ADDR_LEN]; | ||
| 164 | uint8 stakey[EAPOL_WPA_MAX_KEY_SIZE]; | ||
| 165 | } BWL_POST_PACKED_STRUCT eapol_wpa2_key_stakey_encap_t; | ||
| 166 | |||
| 167 | #define WPA2_KEY_DATA_PAD 0xdd | ||
| 168 | |||
| 169 | |||
| 170 | /* This marks the end of a packed structure section. */ | ||
| 171 | #include <packed_section_end.h> | ||
| 172 | |||
| 173 | #endif /* _eapol_h_ */ | ||
diff --git a/drivers/net/wireless/bcmdhd/include/proto/ethernet.h b/drivers/net/wireless/bcmdhd/include/proto/ethernet.h new file mode 100644 index 00000000000..6a6dd14c1bb --- /dev/null +++ b/drivers/net/wireless/bcmdhd/include/proto/ethernet.h | |||
| @@ -0,0 +1,162 @@ | |||
| 1 | /* | ||
| 2 | * From FreeBSD 2.2.7: Fundamental constants relating to ethernet. | ||
| 3 | * | ||
| 4 | * Copyright (C) 1999-2011, Broadcom Corporation | ||
| 5 | * | ||
| 6 | * Unless you and Broadcom execute a separate written software license | ||
| 7 | * agreement governing use of this software, this software is licensed to you | ||
| 8 | * under the terms of the GNU General Public License version 2 (the "GPL"), | ||
| 9 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | ||
| 10 | * following added to such license: | ||
| 11 | * | ||
| 12 | * As a special exception, the copyright holders of this software give you | ||
| 13 | * permission to link this software with independent modules, and to copy and | ||
| 14 | * distribute the resulting executable under terms of your choice, provided that | ||
| 15 | * you also meet, for each linked independent module, the terms and conditions of | ||
| 16 | * the license of that module. An independent module is a module which is not | ||
| 17 | * derived from this software. The special exception does not apply to any | ||
| 18 | * modifications of the software. | ||
| 19 | * | ||
| 20 | * Notwithstanding the above, under no circumstances may you combine this | ||
| 21 | * software in any way with any other Broadcom software provided under a license | ||
| 22 | * other than the GPL, without Broadcom's express prior written consent. | ||
| 23 | * | ||
| 24 | * $Id: ethernet.h,v 9.56 2009-10-15 22:54:58 Exp $ | ||
| 25 | */ | ||
| 26 | |||
| 27 | |||
| 28 | #ifndef _NET_ETHERNET_H_ | ||
| 29 | #define _NET_ETHERNET_H_ | ||
| 30 | |||
| 31 | #ifndef _TYPEDEFS_H_ | ||
| 32 | #include "typedefs.h" | ||
| 33 | #endif | ||
| 34 | |||
| 35 | |||
| 36 | #include <packed_section_start.h> | ||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | #define ETHER_ADDR_LEN 6 | ||
| 41 | |||
| 42 | |||
| 43 | #define ETHER_TYPE_LEN 2 | ||
| 44 | |||
| 45 | |||
| 46 | #define ETHER_CRC_LEN 4 | ||
| 47 | |||
| 48 | |||
| 49 | #define ETHER_HDR_LEN (ETHER_ADDR_LEN * 2 + ETHER_TYPE_LEN) | ||
| 50 | |||
| 51 | |||
| 52 | #define ETHER_MIN_LEN 64 | ||
| 53 | |||
| 54 | |||
| 55 | #define ETHER_MIN_DATA 46 | ||
| 56 | |||
| 57 | |||
| 58 | #define ETHER_MAX_LEN 1518 | ||
| 59 | |||
| 60 | |||
| 61 | #define ETHER_MAX_DATA 1500 | ||
| 62 | |||
| 63 | |||
| 64 | #define ETHER_TYPE_MIN 0x0600 | ||
| 65 | #define ETHER_TYPE_IP 0x0800 | ||
| 66 | #define ETHER_TYPE_ARP 0x0806 | ||
| 67 | #define ETHER_TYPE_8021Q 0x8100 | ||
| 68 | #define ETHER_TYPE_BRCM 0x886c | ||
| 69 | #define ETHER_TYPE_802_1X 0x888e | ||
| 70 | #define ETHER_TYPE_802_1X_PREAUTH 0x88c7 | ||
| 71 | #define ETHER_TYPE_WAI 0x88b4 | ||
| 72 | |||
| 73 | |||
| 74 | |||
| 75 | #define ETHER_BRCM_SUBTYPE_LEN 4 | ||
| 76 | #define ETHER_BRCM_CRAM 1 | ||
| 77 | |||
| 78 | |||
| 79 | #define ETHER_DEST_OFFSET (0 * ETHER_ADDR_LEN) | ||
| 80 | #define ETHER_SRC_OFFSET (1 * ETHER_ADDR_LEN) | ||
| 81 | #define ETHER_TYPE_OFFSET (2 * ETHER_ADDR_LEN) | ||
| 82 | |||
| 83 | |||
| 84 | #define ETHER_IS_VALID_LEN(foo) \ | ||
| 85 | ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN) | ||
| 86 | |||
| 87 | #define ETHER_FILL_MCAST_ADDR_FROM_IP(ea, mgrp_ip) { \ | ||
| 88 | ((uint8 *)ea)[0] = 0x01; \ | ||
| 89 | ((uint8 *)ea)[1] = 0x00; \ | ||
| 90 | ((uint8 *)ea)[2] = 0x5e; \ | ||
| 91 | ((uint8 *)ea)[3] = ((mgrp_ip) >> 16) & 0x7f; \ | ||
| 92 | ((uint8 *)ea)[4] = ((mgrp_ip) >> 8) & 0xff; \ | ||
| 93 | ((uint8 *)ea)[5] = ((mgrp_ip) >> 0) & 0xff; \ | ||
| 94 | } | ||
| 95 | |||
| 96 | #ifndef __INCif_etherh | ||
| 97 | |||
| 98 | BWL_PRE_PACKED_STRUCT struct ether_header { | ||
| 99 | uint8 ether_dhost[ETHER_ADDR_LEN]; | ||
| 100 | uint8 ether_shost[ETHER_ADDR_LEN]; | ||
| 101 | uint16 ether_type; | ||
| 102 | } BWL_POST_PACKED_STRUCT; | ||
| 103 | |||
| 104 | |||
| 105 | BWL_PRE_PACKED_STRUCT struct ether_addr { | ||
| 106 | uint8 octet[ETHER_ADDR_LEN]; | ||
| 107 | } BWL_POST_PACKED_STRUCT; | ||
| 108 | #endif | ||
| 109 | |||
| 110 | |||
| 111 | #define ETHER_SET_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] | 2)) | ||
| 112 | #define ETHER_IS_LOCALADDR(ea) (((uint8 *)(ea))[0] & 2) | ||
| 113 | #define ETHER_CLR_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] & 0xd)) | ||
| 114 | #define ETHER_TOGGLE_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] ^ 2)) | ||
| 115 | |||
| 116 | |||
| 117 | #define ETHER_SET_UNICAST(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] & ~1)) | ||
| 118 | |||
| 119 | |||
| 120 | #define ETHER_ISMULTI(ea) (((const uint8 *)(ea))[0] & 1) | ||
| 121 | |||
| 122 | |||
| 123 | |||
| 124 | #define ether_cmp(a, b) (!(((short*)a)[0] == ((short*)b)[0]) | \ | ||
| 125 | !(((short*)a)[1] == ((short*)b)[1]) | \ | ||
| 126 | !(((short*)a)[2] == ((short*)b)[2])) | ||
| 127 | |||
| 128 | |||
| 129 | #define ether_copy(s, d) { \ | ||
| 130 | ((short*)d)[0] = ((short*)s)[0]; \ | ||
| 131 | ((short*)d)[1] = ((short*)s)[1]; \ | ||
| 132 | ((short*)d)[2] = ((short*)s)[2]; } | ||
| 133 | |||
| 134 | |||
| 135 | static const struct ether_addr ether_bcast = {{255, 255, 255, 255, 255, 255}}; | ||
| 136 | static const struct ether_addr ether_null = {{0, 0, 0, 0, 0, 0}}; | ||
| 137 | |||
| 138 | #define ETHER_ISBCAST(ea) ((((uint8 *)(ea))[0] & \ | ||
| 139 | ((uint8 *)(ea))[1] & \ | ||
| 140 | ((uint8 *)(ea))[2] & \ | ||
| 141 | ((uint8 *)(ea))[3] & \ | ||
| 142 | ((uint8 *)(ea))[4] & \ | ||
| 143 | ((uint8 *)(ea))[5]) == 0xff) | ||
| 144 | #define ETHER_ISNULLADDR(ea) ((((uint8 *)(ea))[0] | \ | ||
| 145 | ((uint8 *)(ea))[1] | \ | ||
| 146 | ((uint8 *)(ea))[2] | \ | ||
| 147 | ((uint8 *)(ea))[3] | \ | ||
| 148 | ((uint8 *)(ea))[4] | \ | ||
| 149 | ((uint8 *)(ea))[5]) == 0) | ||
| 150 | |||
| 151 | |||
| 152 | #define ETHER_MOVE_HDR(d, s) \ | ||
| 153 | do { \ | ||
| 154 | struct ether_header t; \ | ||
| 155 | t = *(struct ether_header *)(s); \ | ||
| 156 | *(struct ether_header *)(d) = t; \ | ||
| 157 | } while (0) | ||
| 158 | |||
| 159 | |||
| 160 | #include <packed_section_end.h> | ||
| 161 | |||
| 162 | #endif | ||
diff --git a/drivers/net/wireless/bcmdhd/include/proto/p2p.h b/drivers/net/wireless/bcmdhd/include/proto/p2p.h new file mode 100644 index 00000000000..4a0c9d1ddc3 --- /dev/null +++ b/drivers/net/wireless/bcmdhd/include/proto/p2p.h | |||
| @@ -0,0 +1,512 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 1999-2011, Broadcom Corporation | ||
| 3 | * | ||
| 4 | * Unless you and Broadcom execute a separate written software license | ||
| 5 | * agreement governing use of this software, this software is licensed to you | ||
| 6 | * under the terms of the GNU General Public License version 2 (the "GPL"), | ||
| 7 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | ||
| 8 | * following added to such license: | ||
| 9 | * | ||
| 10 | * As a special exception, the copyright holders of this software give you | ||
| 11 | * permission to link this software with independent modules, and to copy and | ||
| 12 | * distribute the resulting executable under terms of your choice, provided that | ||
| 13 | * you also meet, for each linked independent module, the terms and conditions of | ||
| 14 | * the license of that module. An independent module is a module which is not | ||
| 15 | * derived from this software. The special exception does not apply to any | ||
| 16 | * modifications of the software. | ||
| 17 | * | ||
| 18 | * Notwithstanding the above, under no circumstances may you combine this | ||
| 19 | * software in any way with any other Broadcom software provided under a license | ||
| 20 | * other than the GPL, without Broadcom's express prior written consent. | ||
| 21 | * | ||
| 22 | * Fundamental types and constants relating to WFA P2P (aka WiFi Direct) | ||
| 23 | * | ||
| 24 | * $Id: p2p.h,v 9.17.2.4 2010-12-15 21:41:21 Exp $ | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef _P2P_H_ | ||
| 28 | #define _P2P_H_ | ||
| 29 | |||
| 30 | #ifndef _TYPEDEFS_H_ | ||
| 31 | #include <typedefs.h> | ||
| 32 | #endif | ||
| 33 | #include <wlioctl.h> | ||
| 34 | #include <proto/802.11.h> | ||
| 35 | |||
| 36 | /* This marks the start of a packed structure section. */ | ||
| 37 | #include <packed_section_start.h> | ||
| 38 | |||
| 39 | |||
| 40 | /* WiFi P2P OUI values */ | ||
| 41 | #define P2P_OUI WFA_OUI /* WiFi P2P OUI */ | ||
| 42 | #define P2P_VER WFA_OUI_TYPE_P2P /* P2P version: 9=WiFi P2P v1.0 */ | ||
| 43 | |||
| 44 | #define P2P_IE_ID 0xdd /* P2P IE element ID */ | ||
| 45 | |||
| 46 | /* WiFi P2P IE */ | ||
| 47 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_ie { | ||
| 48 | uint8 id; /* IE ID: 0xDD */ | ||
| 49 | uint8 len; /* IE length */ | ||
| 50 | uint8 OUI[3]; /* WiFi P2P specific OUI: P2P_OUI */ | ||
| 51 | uint8 oui_type; /* Identifies P2P version: P2P_VER */ | ||
| 52 | uint8 subelts[1]; /* variable length subelements */ | ||
| 53 | } BWL_POST_PACKED_STRUCT; | ||
| 54 | typedef struct wifi_p2p_ie wifi_p2p_ie_t; | ||
| 55 | |||
| 56 | #define P2P_IE_FIXED_LEN 6 | ||
| 57 | |||
| 58 | #define P2P_ATTR_ID_OFF 0 | ||
| 59 | #define P2P_ATTR_LEN_OFF 1 | ||
| 60 | #define P2P_ATTR_DATA_OFF 3 | ||
| 61 | |||
| 62 | #define P2P_ATTR_HDR_LEN 3 /* ID + 2-byte length field spec 1.02 */ | ||
| 63 | |||
| 64 | /* P2P IE Subelement IDs from WiFi P2P Technical Spec 1.00 */ | ||
| 65 | #define P2P_SEID_STATUS 0 /* Status */ | ||
| 66 | #define P2P_SEID_MINOR_RC 1 /* Minor Reason Code */ | ||
| 67 | #define P2P_SEID_P2P_INFO 2 /* P2P Capability (capabilities info) */ | ||
| 68 | #define P2P_SEID_DEV_ID 3 /* P2P Device ID */ | ||
| 69 | #define P2P_SEID_INTENT 4 /* Group Owner Intent */ | ||
| 70 | #define P2P_SEID_CFG_TIMEOUT 5 /* Configuration Timeout */ | ||
| 71 | #define P2P_SEID_CHANNEL 6 /* Channel */ | ||
| 72 | #define P2P_SEID_GRP_BSSID 7 /* P2P Group BSSID */ | ||
| 73 | #define P2P_SEID_XT_TIMING 8 /* Extended Listen Timing */ | ||
| 74 | #define P2P_SEID_INTINTADDR 9 /* Intended P2P Interface Address */ | ||
| 75 | #define P2P_SEID_P2P_MGBTY 10 /* P2P Manageability */ | ||
| 76 | #define P2P_SEID_CHAN_LIST 11 /* Channel List */ | ||
| 77 | #define P2P_SEID_ABSENCE 12 /* Notice of Absence */ | ||
| 78 | #define P2P_SEID_DEV_INFO 13 /* Device Info */ | ||
| 79 | #define P2P_SEID_GROUP_INFO 14 /* Group Info */ | ||
| 80 | #define P2P_SEID_GROUP_ID 15 /* Group ID */ | ||
| 81 | #define P2P_SEID_P2P_IF 16 /* P2P Interface */ | ||
| 82 | #define P2P_SEID_VNDR 221 /* Vendor-specific subelement */ | ||
| 83 | |||
| 84 | #define P2P_SE_VS_ID_SERVICES 0x1b /* BRCM proprietary subel: L2 Services */ | ||
| 85 | |||
| 86 | |||
| 87 | /* WiFi P2P IE subelement: P2P Capability (capabilities info) */ | ||
| 88 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_info_se_s { | ||
| 89 | uint8 eltId; /* SE ID: P2P_SEID_P2P_INFO */ | ||
| 90 | uint8 len[2]; /* SE length not including eltId, len fields */ | ||
| 91 | uint8 dev; /* Device Capability Bitmap */ | ||
| 92 | uint8 group; /* Group Capability Bitmap */ | ||
| 93 | } BWL_POST_PACKED_STRUCT; | ||
| 94 | typedef struct wifi_p2p_info_se_s wifi_p2p_info_se_t; | ||
| 95 | |||
| 96 | /* P2P Capability subelement's Device Capability Bitmap bit values */ | ||
| 97 | #define P2P_CAPSE_DEV_SERVICE_DIS 0x1 /* Service Discovery */ | ||
| 98 | #define P2P_CAPSE_DEV_CLIENT_DIS 0x2 /* Client Discoverability */ | ||
| 99 | #define P2P_CAPSE_DEV_CONCURRENT 0x4 /* Concurrent Operation */ | ||
| 100 | #define P2P_CAPSE_DEV_INFRA_MAN 0x8 /* P2P Infrastructure Managed */ | ||
| 101 | #define P2P_CAPSE_DEV_LIMIT 0x10 /* P2P Device Limit */ | ||
| 102 | #define P2P_CAPSE_INVITE_PROC 0x20 /* P2P Invitation Procedure */ | ||
| 103 | |||
| 104 | /* P2P Capability subelement's Group Capability Bitmap bit values */ | ||
| 105 | #define P2P_CAPSE_GRP_OWNER 0x1 /* P2P Group Owner */ | ||
| 106 | #define P2P_CAPSE_PERSIST_GRP 0x2 /* Persistent P2P Group */ | ||
| 107 | #define P2P_CAPSE_GRP_LIMIT 0x4 /* P2P Group Limit */ | ||
| 108 | #define P2P_CAPSE_GRP_INTRA_BSS 0x8 /* Intra-BSS Distribution */ | ||
| 109 | #define P2P_CAPSE_GRP_X_CONNECT 0x10 /* Cross Connection */ | ||
| 110 | #define P2P_CAPSE_GRP_PERSISTENT 0x20 /* Persistent Reconnect */ | ||
| 111 | #define P2P_CAPSE_GRP_FORMATION 0x40 /* Group Formation */ | ||
| 112 | |||
| 113 | |||
| 114 | /* WiFi P2P IE subelement: Group Owner Intent */ | ||
| 115 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_intent_se_s { | ||
| 116 | uint8 eltId; /* SE ID: P2P_SEID_INTENT */ | ||
| 117 | uint8 len[2]; /* SE length not including eltId, len fields */ | ||
| 118 | uint8 intent; /* Intent Value 0...15 (0=legacy 15=master only) */ | ||
| 119 | } BWL_POST_PACKED_STRUCT; | ||
| 120 | typedef struct wifi_p2p_intent_se_s wifi_p2p_intent_se_t; | ||
| 121 | |||
| 122 | /* WiFi P2P IE subelement: Configuration Timeout */ | ||
| 123 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_cfg_tmo_se_s { | ||
| 124 | uint8 eltId; /* SE ID: P2P_SEID_CFG_TIMEOUT */ | ||
| 125 | uint8 len[2]; /* SE length not including eltId, len fields */ | ||
| 126 | uint8 go_tmo; /* GO config timeout in units of 10 ms */ | ||
| 127 | uint8 client_tmo; /* Client config timeout in units of 10 ms */ | ||
| 128 | } BWL_POST_PACKED_STRUCT; | ||
| 129 | typedef struct wifi_p2p_cfg_tmo_se_s wifi_p2p_cfg_tmo_se_t; | ||
| 130 | |||
| 131 | |||
| 132 | /* WiFi P2P IE subelement: Status */ | ||
| 133 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_status_se_s { | ||
| 134 | uint8 eltId; /* SE ID: P2P_SEID_STATUS */ | ||
| 135 | uint8 len[2]; /* SE length not including eltId, len fields */ | ||
| 136 | uint8 status; /* Status Code: P2P_STATSE_* */ | ||
| 137 | } BWL_POST_PACKED_STRUCT; | ||
| 138 | typedef struct wifi_p2p_status_se_s wifi_p2p_status_se_t; | ||
| 139 | |||
| 140 | /* Status subelement Status Code definitions */ | ||
| 141 | #define P2P_STATSE_SUCCESS 0 | ||
| 142 | /* Success */ | ||
| 143 | #define P2P_STATSE_FAIL_INFO_CURR_UNAVAIL 1 | ||
| 144 | /* Failed, information currently unavailable */ | ||
| 145 | #define P2P_STATSE_PASSED_UP P2P_STATSE_FAIL_INFO_CURR_UNAVAIL | ||
| 146 | /* Old name for above in P2P spec 1.08 and older */ | ||
| 147 | #define P2P_STATSE_FAIL_INCOMPAT_PARAMS 2 | ||
| 148 | /* Failed, incompatible parameters */ | ||
| 149 | #define P2P_STATSE_FAIL_LIMIT_REACHED 3 | ||
| 150 | /* Failed, limit reached */ | ||
| 151 | #define P2P_STATSE_FAIL_INVALID_PARAMS 4 | ||
| 152 | /* Failed, invalid parameters */ | ||
| 153 | #define P2P_STATSE_FAIL_UNABLE_TO_ACCOM 5 | ||
| 154 | /* Failed, unable to accomodate request */ | ||
| 155 | #define P2P_STATSE_FAIL_PROTO_ERROR 6 | ||
| 156 | /* Failed, previous protocol error or disruptive behaviour */ | ||
| 157 | #define P2P_STATSE_FAIL_NO_COMMON_CHAN 7 | ||
| 158 | /* Failed, no common channels */ | ||
| 159 | #define P2P_STATSE_FAIL_UNKNOWN_GROUP 8 | ||
| 160 | /* Failed, unknown P2P Group */ | ||
| 161 | #define P2P_STATSE_FAIL_INTENT 9 | ||
| 162 | /* Failed, both peers indicated Intent 15 in GO Negotiation */ | ||
| 163 | #define P2P_STATSE_FAIL_INCOMPAT_PROVIS 10 | ||
| 164 | /* Failed, incompatible provisioning method */ | ||
| 165 | #define P2P_STATSE_FAIL_USER_REJECT 11 | ||
| 166 | /* Failed, rejected by user */ | ||
| 167 | |||
| 168 | /* WiFi P2P IE attribute: Extended Listen Timing */ | ||
| 169 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_ext_se_s { | ||
| 170 | uint8 eltId; /* ID: P2P_SEID_EXT_TIMING */ | ||
| 171 | uint8 len[2]; /* length not including eltId, len fields */ | ||
| 172 | uint8 avail[2]; /* availibility period */ | ||
| 173 | uint8 interval[2]; /* availibility interval */ | ||
| 174 | } BWL_POST_PACKED_STRUCT; | ||
| 175 | typedef struct wifi_p2p_ext_se_s wifi_p2p_ext_se_t; | ||
| 176 | |||
| 177 | #define P2P_EXT_MIN 10 /* minimum 10ms */ | ||
| 178 | |||
| 179 | /* WiFi P2P IE subelement: Intended P2P Interface Address */ | ||
| 180 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_intintad_se_s { | ||
| 181 | uint8 eltId; /* SE ID: P2P_SEID_INTINTADDR */ | ||
| 182 | uint8 len[2]; /* SE length not including eltId, len fields */ | ||
| 183 | uint8 mac[6]; /* intended P2P interface MAC address */ | ||
| 184 | } BWL_POST_PACKED_STRUCT; | ||
| 185 | typedef struct wifi_p2p_intintad_se_s wifi_p2p_intintad_se_t; | ||
| 186 | |||
| 187 | /* WiFi P2P IE subelement: Channel */ | ||
| 188 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_channel_se_s { | ||
| 189 | uint8 eltId; /* SE ID: P2P_SEID_STATUS */ | ||
| 190 | uint8 len[2]; /* SE length not including eltId, len fields */ | ||
| 191 | uint8 band; /* Regulatory Class (band) */ | ||
| 192 | uint8 channel; /* Channel */ | ||
| 193 | } BWL_POST_PACKED_STRUCT; | ||
| 194 | typedef struct wifi_p2p_channel_se_s wifi_p2p_channel_se_t; | ||
| 195 | |||
| 196 | |||
| 197 | /* Channel Entry structure within the Channel List SE */ | ||
| 198 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_chanlist_entry_s { | ||
| 199 | uint8 band; /* Regulatory Class (band) */ | ||
| 200 | uint8 num_channels; /* # of channels in the channel list */ | ||
| 201 | uint8 channels[WL_NUMCHANNELS]; /* Channel List */ | ||
| 202 | } BWL_POST_PACKED_STRUCT; | ||
| 203 | typedef struct wifi_p2p_chanlist_entry_s wifi_p2p_chanlist_entry_t; | ||
| 204 | #define WIFI_P2P_CHANLIST_SE_MAX_ENTRIES 2 | ||
| 205 | |||
| 206 | /* WiFi P2P IE subelement: Channel List */ | ||
| 207 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_chanlist_se_s { | ||
| 208 | uint8 eltId; /* SE ID: P2P_SEID_STATUS */ | ||
| 209 | uint8 len[2]; /* SE length not including eltId, len fields */ | ||
| 210 | uint8 country[3]; /* Country String */ | ||
| 211 | uint8 num_entries; /* # of channel entries */ | ||
| 212 | wifi_p2p_chanlist_entry_t entries[WIFI_P2P_CHANLIST_SE_MAX_ENTRIES]; | ||
| 213 | /* Channel Entry List */ | ||
| 214 | } BWL_POST_PACKED_STRUCT; | ||
| 215 | typedef struct wifi_p2p_chanlist_se_s wifi_p2p_chanlist_se_t; | ||
| 216 | |||
| 217 | /* WiFi P2P IE's Device Info subelement */ | ||
| 218 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_devinfo_se_s { | ||
| 219 | uint8 eltId; /* SE ID: P2P_SEID_DEVINFO */ | ||
| 220 | uint8 len[2]; /* SE length not including eltId, len fields */ | ||
| 221 | uint8 mac[6]; /* P2P Device MAC address */ | ||
| 222 | uint16 wps_cfg_meths; /* Config Methods: reg_prototlv.h WPS_CONFMET_* */ | ||
| 223 | uint8 pri_devtype[8]; /* Primary Device Type */ | ||
| 224 | } BWL_POST_PACKED_STRUCT; | ||
| 225 | typedef struct wifi_p2p_devinfo_se_s wifi_p2p_devinfo_se_t; | ||
| 226 | |||
| 227 | #define P2P_DEV_TYPE_LEN 8 | ||
| 228 | |||
| 229 | /* WiFi P2P IE's Group Info subelement Client Info Descriptor */ | ||
| 230 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_cid_fixed_s { | ||
| 231 | uint8 len; | ||
| 232 | uint8 devaddr[ETHER_ADDR_LEN]; /* P2P Device Address */ | ||
| 233 | uint8 ifaddr[ETHER_ADDR_LEN]; /* P2P Interface Address */ | ||
| 234 | uint8 devcap; /* Device Capability */ | ||
| 235 | uint8 cfg_meths[2]; /* Config Methods: reg_prototlv.h WPS_CONFMET_* */ | ||
| 236 | uint8 pridt[P2P_DEV_TYPE_LEN]; /* Primary Device Type */ | ||
| 237 | uint8 secdts; /* Number of Secondary Device Types */ | ||
| 238 | } BWL_POST_PACKED_STRUCT; | ||
| 239 | typedef struct wifi_p2p_cid_fixed_s wifi_p2p_cid_fixed_t; | ||
| 240 | |||
| 241 | /* WiFi P2P IE's Device ID subelement */ | ||
| 242 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_devid_se_s { | ||
| 243 | uint8 eltId; | ||
| 244 | uint8 len[2]; | ||
| 245 | struct ether_addr addr; /* P2P Device MAC address */ | ||
| 246 | } BWL_POST_PACKED_STRUCT; | ||
| 247 | typedef struct wifi_p2p_devid_se_s wifi_p2p_devid_se_t; | ||
| 248 | |||
| 249 | /* WiFi P2P IE subelement: P2P Manageability */ | ||
| 250 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_mgbt_se_s { | ||
| 251 | uint8 eltId; /* SE ID: P2P_SEID_P2P_MGBTY */ | ||
| 252 | uint8 len[2]; /* SE length not including eltId, len fields */ | ||
| 253 | uint8 mg_bitmap; /* manageability bitmap */ | ||
| 254 | } BWL_POST_PACKED_STRUCT; | ||
| 255 | typedef struct wifi_p2p_mgbt_se_s wifi_p2p_mgbt_se_t; | ||
| 256 | /* mg_bitmap field bit values */ | ||
| 257 | #define P2P_MGBTSE_P2PDEVMGMT_FLAG 0x1 /* AP supports Managed P2P Device */ | ||
| 258 | |||
| 259 | /* WiFi P2P IE subelement: Group Info */ | ||
| 260 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_grpinfo_se_s { | ||
| 261 | uint8 eltId; /* SE ID: P2P_SEID_GROUP_INFO */ | ||
| 262 | uint8 len[2]; /* SE length not including eltId, len fields */ | ||
| 263 | } BWL_POST_PACKED_STRUCT; | ||
| 264 | typedef struct wifi_p2p_grpinfo_se_s wifi_p2p_grpinfo_se_t; | ||
| 265 | |||
| 266 | |||
| 267 | /* WiFi P2P Action Frame */ | ||
| 268 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_action_frame { | ||
| 269 | uint8 category; /* P2P_AF_CATEGORY */ | ||
| 270 | uint8 OUI[3]; /* OUI - P2P_OUI */ | ||
| 271 | uint8 type; /* OUI Type - P2P_VER */ | ||
| 272 | uint8 subtype; /* OUI Subtype - P2P_AF_* */ | ||
| 273 | uint8 dialog_token; /* nonzero, identifies req/resp tranaction */ | ||
| 274 | uint8 elts[1]; /* Variable length information elements. Max size = | ||
| 275 | * ACTION_FRAME_SIZE - sizeof(this structure) - 1 | ||
| 276 | */ | ||
| 277 | } BWL_POST_PACKED_STRUCT; | ||
| 278 | typedef struct wifi_p2p_action_frame wifi_p2p_action_frame_t; | ||
| 279 | #define P2P_AF_CATEGORY 0x7f | ||
| 280 | |||
| 281 | #define P2P_AF_FIXED_LEN 7 | ||
| 282 | |||
| 283 | /* WiFi P2P Action Frame OUI Subtypes */ | ||
| 284 | #define P2P_AF_NOTICE_OF_ABSENCE 0 /* Notice of Absence */ | ||
| 285 | #define P2P_AF_PRESENCE_REQ 1 /* P2P Presence Request */ | ||
| 286 | #define P2P_AF_PRESENCE_RSP 2 /* P2P Presence Response */ | ||
| 287 | #define P2P_AF_GO_DISC_REQ 3 /* GO Discoverability Request */ | ||
| 288 | |||
| 289 | |||
| 290 | /* WiFi P2P Public Action Frame */ | ||
| 291 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_pub_act_frame { | ||
| 292 | uint8 category; /* P2P_PUB_AF_CATEGORY */ | ||
| 293 | uint8 action; /* P2P_PUB_AF_ACTION */ | ||
| 294 | uint8 oui[3]; /* P2P_OUI */ | ||
| 295 | uint8 oui_type; /* OUI type - P2P_VER */ | ||
| 296 | uint8 subtype; /* OUI subtype - P2P_TYPE_* */ | ||
| 297 | uint8 dialog_token; /* nonzero, identifies req/rsp transaction */ | ||
| 298 | uint8 elts[1]; /* Variable length information elements. Max size = | ||
| 299 | * ACTION_FRAME_SIZE - sizeof(this structure) - 1 | ||
| 300 | */ | ||
| 301 | } BWL_POST_PACKED_STRUCT; | ||
| 302 | typedef struct wifi_p2p_pub_act_frame wifi_p2p_pub_act_frame_t; | ||
| 303 | #define P2P_PUB_AF_FIXED_LEN 8 | ||
| 304 | #define P2P_PUB_AF_CATEGORY 0x04 | ||
| 305 | #define P2P_PUB_AF_ACTION 0x09 | ||
| 306 | |||
| 307 | /* WiFi P2P Public Action Frame OUI Subtypes */ | ||
| 308 | #define P2P_PAF_GON_REQ 0 /* Group Owner Negotiation Req */ | ||
| 309 | #define P2P_PAF_GON_RSP 1 /* Group Owner Negotiation Rsp */ | ||
| 310 | #define P2P_PAF_GON_CONF 2 /* Group Owner Negotiation Confirm */ | ||
| 311 | #define P2P_PAF_INVITE_REQ 3 /* P2P Invitation Request */ | ||
| 312 | #define P2P_PAF_INVITE_RSP 4 /* P2P Invitation Response */ | ||
| 313 | #define P2P_PAF_DEVDIS_REQ 5 /* Device Discoverability Request */ | ||
| 314 | #define P2P_PAF_DEVDIS_RSP 6 /* Device Discoverability Response */ | ||
| 315 | #define P2P_PAF_PROVDIS_REQ 7 /* Provision Discovery Request */ | ||
| 316 | #define P2P_PAF_PROVDIS_RSP 8 /* Provision Discovery Request */ | ||
| 317 | |||
| 318 | /* TODO: Stop using these obsolete aliases for P2P_PAF_GON_* */ | ||
| 319 | #define P2P_TYPE_MNREQ P2P_PAF_GON_REQ | ||
| 320 | #define P2P_TYPE_MNRSP P2P_PAF_GON_RSP | ||
| 321 | #define P2P_TYPE_MNCONF P2P_PAF_GON_CONF | ||
| 322 | |||
| 323 | /* WiFi P2P IE subelement: Notice of Absence */ | ||
| 324 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_noa_desc { | ||
| 325 | uint8 cnt_type; /* Count/Type */ | ||
| 326 | uint32 duration; /* Duration */ | ||
| 327 | uint32 interval; /* Interval */ | ||
| 328 | uint32 start; /* Start Time */ | ||
| 329 | } BWL_POST_PACKED_STRUCT; | ||
| 330 | typedef struct wifi_p2p_noa_desc wifi_p2p_noa_desc_t; | ||
| 331 | |||
| 332 | BWL_PRE_PACKED_STRUCT struct wifi_p2p_noa_se { | ||
| 333 | uint8 eltId; /* Subelement ID */ | ||
| 334 | uint8 len[2]; /* Length */ | ||
| 335 | uint8 index; /* Index */ | ||
| 336 | uint8 ops_ctw_parms; /* CTWindow and OppPS Parameters */ | ||
| 337 | wifi_p2p_noa_desc_t desc[1]; /* Notice of Absence Descriptor(s) */ | ||
| 338 | } BWL_POST_PACKED_STRUCT; | ||
| 339 | typedef struct wifi_p2p_noa_se wifi_p2p_noa_se_t; | ||
| 340 | |||
| 341 | #define P2P_NOA_SE_FIXED_LEN 5 | ||
| 342 | |||
| 343 | /* cnt_type field values */ | ||
| 344 | #define P2P_NOA_DESC_CNT_RESERVED 0 /* reserved and should not be used */ | ||
| 345 | #define P2P_NOA_DESC_CNT_REPEAT 255 /* continuous schedule */ | ||
| 346 | #define P2P_NOA_DESC_TYPE_PREFERRED 1 /* preferred values */ | ||
| 347 | #define P2P_NOA_DESC_TYPE_ACCEPTABLE 2 /* acceptable limits */ | ||
| 348 | |||
| 349 | /* ctw_ops_parms field values */ | ||
| 350 | #define P2P_NOA_CTW_MASK 0x7f | ||
| 351 | #define P2P_NOA_OPS_MASK 0x80 | ||
| 352 | #define P2P_NOA_OPS_SHIFT 7 | ||
| 353 | |||
| 354 | #define P2P_CTW_MIN 10 /* minimum 10TU */ | ||
| 355 | |||
| 356 | /* | ||
| 357 | * P2P Service Discovery related | ||
| 358 | */ | ||
| 359 | #define P2PSD_ACTION_CATEGORY 0x04 | ||
| 360 | /* Public action frame */ | ||
| 361 | #define P2PSD_ACTION_ID_GAS_IREQ 0x0a | ||
| 362 | /* Action value for GAS Initial Request AF */ | ||
| 363 | #define P2PSD_ACTION_ID_GAS_IRESP 0x0b | ||
| 364 | /* Action value for GAS Initial Response AF */ | ||
| 365 | #define P2PSD_ACTION_ID_GAS_CREQ 0x0c | ||
| 366 | /* Action value for GAS Comback Request AF */ | ||
| 367 | #define P2PSD_ACTION_ID_GAS_CRESP 0x0d | ||
| 368 | /* Action value for GAS Comback Response AF */ | ||
| 369 | #define P2PSD_AD_EID 0x6c | ||
| 370 | /* Advertisement Protocol IE ID */ | ||
| 371 | #define P2PSD_ADP_TUPLE_QLMT_PAMEBI 0x00 | ||
| 372 | /* Query Response Length Limit 7 bits plus PAME-BI 1 bit */ | ||
| 373 | #define P2PSD_ADP_PROTO_ID 0x00 | ||
| 374 | /* Advertisement Protocol ID. Always 0 for P2P SD */ | ||
| 375 | #define P2PSD_GAS_OUI P2P_OUI | ||
| 376 | /* WFA OUI */ | ||
| 377 | #define P2PSD_GAS_OUI_SUBTYPE P2P_VER | ||
| 378 | /* OUI Subtype for GAS IE */ | ||
| 379 | #define P2PSD_GAS_NQP_INFOID 0xDDDD | ||
| 380 | /* NQP Query Info ID: 56797 */ | ||
| 381 | #define P2PSD_GAS_COMEBACKDEALY 0x00 | ||
| 382 | /* Not used in the Native GAS protocol */ | ||
| 383 | |||
| 384 | /* Service Protocol Type */ | ||
| 385 | typedef enum p2psd_svc_protype { | ||
| 386 | SVC_RPOTYPE_ALL = 0, | ||
| 387 | SVC_RPOTYPE_BONJOUR = 1, | ||
| 388 | SVC_RPOTYPE_UPNP = 2, | ||
| 389 | SVC_RPOTYPE_WSD = 3, | ||
| 390 | SVC_RPOTYPE_VENDOR = 255 | ||
| 391 | } p2psd_svc_protype_t; | ||
| 392 | |||
| 393 | /* Service Discovery response status code */ | ||
| 394 | typedef enum { | ||
| 395 | P2PSD_RESP_STATUS_SUCCESS = 0, | ||
| 396 | P2PSD_RESP_STATUS_PROTYPE_NA = 1, | ||
| 397 | P2PSD_RESP_STATUS_DATA_NA = 2, | ||
| 398 | P2PSD_RESP_STATUS_BAD_REQUEST = 3 | ||
| 399 | } p2psd_resp_status_t; | ||
| 400 | |||
| 401 | /* Advertisement Protocol IE tuple field */ | ||
| 402 | BWL_PRE_PACKED_STRUCT struct wifi_p2psd_adp_tpl { | ||
| 403 | uint8 llm_pamebi; /* Query Response Length Limit bit 0-6, set to 0 plus | ||
| 404 | * Pre-Associated Message Exchange BSSID Independent bit 7, set to 0 | ||
| 405 | */ | ||
| 406 | uint8 adp_id; /* Advertisement Protocol ID: 0 for NQP Native Query Protocol */ | ||
| 407 | } BWL_POST_PACKED_STRUCT; | ||
| 408 | typedef struct wifi_p2psd_adp_tpl wifi_p2psd_adp_tpl_t; | ||
| 409 | |||
| 410 | /* Advertisement Protocol IE */ | ||
| 411 | BWL_PRE_PACKED_STRUCT struct wifi_p2psd_adp_ie { | ||
| 412 | uint8 id; /* IE ID: 0x6c - 108 */ | ||
| 413 | uint8 len; /* IE length */ | ||
| 414 | wifi_p2psd_adp_tpl_t adp_tpl; /* Advertisement Protocol Tuple field. Only one | ||
| 415 | * tuple is defined for P2P Service Discovery | ||
| 416 | */ | ||
| 417 | } BWL_POST_PACKED_STRUCT; | ||
| 418 | typedef struct wifi_p2psd_adp_ie wifi_p2psd_adp_ie_t; | ||
| 419 | |||
| 420 | /* NQP Vendor-specific Content */ | ||
| 421 | BWL_PRE_PACKED_STRUCT struct wifi_p2psd_nqp_query_vsc { | ||
| 422 | uint8 oui_subtype; /* OUI Subtype: 0x09 */ | ||
| 423 | uint16 svc_updi; /* Service Update Indicator */ | ||
| 424 | uint8 svc_tlvs[1]; /* wifi_p2psd_qreq_tlv_t type for service request, | ||
| 425 | * wifi_p2psd_qresp_tlv_t type for service response | ||
| 426 | */ | ||
| 427 | } BWL_POST_PACKED_STRUCT; | ||
| 428 | typedef struct wifi_p2psd_nqp_query_vsc wifi_p2psd_nqp_query_vsc_t; | ||
| 429 | |||
| 430 | /* Service Request TLV */ | ||
| 431 | BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qreq_tlv { | ||
| 432 | uint16 len; /* Length: 5 plus size of Query Data */ | ||
| 433 | uint8 svc_prot; /* Service Protocol Type */ | ||
| 434 | uint8 svc_tscid; /* Service Transaction ID */ | ||
| 435 | uint8 query_data[1]; /* Query Data, passed in from above Layer 2 */ | ||
| 436 | } BWL_POST_PACKED_STRUCT; | ||
| 437 | typedef struct wifi_p2psd_qreq_tlv wifi_p2psd_qreq_tlv_t; | ||
| 438 | |||
| 439 | /* Query Request Frame, defined in generic format, instead of NQP specific */ | ||
| 440 | BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qreq_frame { | ||
| 441 | uint16 info_id; /* Info ID: 0xDDDD */ | ||
| 442 | uint16 len; /* Length of service request TLV, 5 plus the size of request data */ | ||
| 443 | uint8 oui[3]; /* WFA OUI: 0x0050F2 */ | ||
| 444 | uint8 qreq_vsc[1]; /* Vendor-specific Content: wifi_p2psd_nqp_query_vsc_t type for NQP */ | ||
| 445 | |||
| 446 | } BWL_POST_PACKED_STRUCT; | ||
| 447 | typedef struct wifi_p2psd_qreq_frame wifi_p2psd_qreq_frame_t; | ||
| 448 | |||
| 449 | /* GAS Initial Request AF body, "elts" in wifi_p2p_pub_act_frame */ | ||
| 450 | BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_ireq_frame { | ||
| 451 | wifi_p2psd_adp_ie_t adp_ie; /* Advertisement Protocol IE */ | ||
| 452 | uint16 qreq_len; /* Query Request Length */ | ||
| 453 | uint8 qreq_frm[1]; /* Query Request Frame wifi_p2psd_qreq_frame_t */ | ||
| 454 | } BWL_POST_PACKED_STRUCT; | ||
| 455 | typedef struct wifi_p2psd_gas_ireq_frame wifi_p2psd_gas_ireq_frame_t; | ||
| 456 | |||
| 457 | /* Service Response TLV */ | ||
| 458 | BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qresp_tlv { | ||
| 459 | uint16 len; /* Length: 5 plus size of Query Data */ | ||
| 460 | uint8 svc_prot; /* Service Protocol Type */ | ||
| 461 | uint8 svc_tscid; /* Service Transaction ID */ | ||
| 462 | uint8 status; /* Value defined in Table 57 of P2P spec. */ | ||
| 463 | uint8 query_data[1]; /* Response Data, passed in from above Layer 2 */ | ||
| 464 | } BWL_POST_PACKED_STRUCT; | ||
| 465 | typedef struct wifi_p2psd_qresp_tlv wifi_p2psd_qresp_tlv_t; | ||
| 466 | |||
| 467 | /* Query Response Frame, defined in generic format, instead of NQP specific */ | ||
| 468 | BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qresp_frame { | ||
| 469 | uint16 info_id; /* Info ID: 0xDDDD */ | ||
| 470 | uint16 len; /* Lenth of service response TLV, 6 plus the size of resp data */ | ||
| 471 | uint8 oui[3]; /* WFA OUI: 0x0050F2 */ | ||
| 472 | uint8 qresp_vsc[1]; /* Vendor-specific Content: wifi_p2psd_qresp_tlv_t type for NQP */ | ||
| 473 | |||
| 474 | } BWL_POST_PACKED_STRUCT; | ||
| 475 | typedef struct wifi_p2psd_qresp_frame wifi_p2psd_qresp_frame_t; | ||
| 476 | |||
| 477 | /* GAS Initial Response AF body, "elts" in wifi_p2p_pub_act_frame */ | ||
| 478 | BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_iresp_frame { | ||
| 479 | uint16 status; /* Value defined in Table 7-23 of IEEE P802.11u */ | ||
| 480 | uint16 cb_delay; /* GAS Comeback Delay */ | ||
| 481 | wifi_p2psd_adp_ie_t adp_ie; /* Advertisement Protocol IE */ | ||
| 482 | uint16 qresp_len; /* Query Response Length */ | ||
| 483 | uint8 qresp_frm[1]; /* Query Response Frame wifi_p2psd_qresp_frame_t */ | ||
| 484 | } BWL_POST_PACKED_STRUCT; | ||
| 485 | typedef struct wifi_p2psd_gas_iresp_frame wifi_p2psd_gas_iresp_frame_t; | ||
| 486 | |||
| 487 | /* GAS Comeback Response AF body, "elts" in wifi_p2p_pub_act_frame */ | ||
| 488 | BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_cresp_frame { | ||
| 489 | uint16 status; /* Value defined in Table 7-23 of IEEE P802.11u */ | ||
| 490 | uint8 fragment_id; /* Fragmentation ID */ | ||
| 491 | uint16 cb_delay; /* GAS Comeback Delay */ | ||
| 492 | wifi_p2psd_adp_ie_t adp_ie; /* Advertisement Protocol IE */ | ||
| 493 | uint16 qresp_len; /* Query Response Length */ | ||
| 494 | uint8 qresp_frm[1]; /* Query Response Frame wifi_p2psd_qresp_frame_t */ | ||
| 495 | } BWL_POST_PACKED_STRUCT; | ||
| 496 | typedef struct wifi_p2psd_gas_cresp_frame wifi_p2psd_gas_cresp_frame_t; | ||
| 497 | |||
| 498 | /* Wi-Fi GAS Public Action Frame */ | ||
| 499 | BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_pub_act_frame { | ||
| 500 | uint8 category; /* 0x04 Public Action Frame */ | ||
| 501 | uint8 action; /* 0x6c Advertisement Protocol */ | ||
| 502 | uint8 dialog_token; /* nonzero, identifies req/rsp transaction */ | ||
| 503 | uint8 query_data[1]; /* Query Data. wifi_p2psd_gas_ireq_frame_t | ||
| 504 | * or wifi_p2psd_gas_iresp_frame_t format | ||
| 505 | */ | ||
| 506 | } BWL_POST_PACKED_STRUCT; | ||
| 507 | typedef struct wifi_p2psd_gas_pub_act_frame wifi_p2psd_gas_pub_act_frame_t; | ||
| 508 | |||
| 509 | /* This marks the end of a packed structure section. */ | ||
| 510 | #include <packed_section_end.h> | ||
| 511 | |||
| 512 | #endif /* _P2P_H_ */ | ||
diff --git a/drivers/net/wireless/bcmdhd/include/proto/sdspi.h b/drivers/net/wireless/bcmdhd/include/proto/sdspi.h new file mode 100644 index 00000000000..7fe4fbce310 --- /dev/null +++ b/drivers/net/wireless/bcmdhd/include/proto/sdspi.h | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | /* | ||
| 2 | * SD-SPI Protocol Standard | ||
| 3 | * | ||
| 4 | * Copyright (C) 1999-2011, Broadcom Corporation | ||
| 5 | * | ||
| 6 | * Unless you and Broadcom execute a separate written software license | ||
| 7 | * agreement governing use of this software, this software is licensed to you | ||
| 8 | * under the terms of the GNU General Public License version 2 (the "GPL"), | ||
| 9 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | ||
| 10 | * following added to such license: | ||
| 11 | * | ||
| 12 | * As a special exception, the copyright holders of this software give you | ||
| 13 | * permission to link this software with independent modules, and to copy and | ||
| 14 | * distribute the resulting executable under terms of your choice, provided that | ||
| 15 | * you also meet, for each linked independent module, the terms and conditions of | ||
| 16 | * the license of that module. An independent module is a module which is not | ||
| 17 | * derived from this software. The special exception does not apply to any | ||
| 18 | * modifications of the software. | ||
| 19 | * | ||
| 20 | * Notwithstanding the above, under no circumstances may you combine this | ||
| 21 | * software in any way with any other Broadcom software provided under a license | ||
| 22 | * other than the GPL, without Broadcom's express prior written consent. | ||
| 23 | * | ||
| 24 | * $Id: sdspi.h,v 9.2.120.1 2010-11-15 17:56:25 Exp $ | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef _SD_SPI_H | ||
| 28 | #define _SD_SPI_H | ||
| 29 | |||
| 30 | #define SPI_START_M BITFIELD_MASK(1) /* Bit [31] - Start Bit */ | ||
| 31 | #define SPI_START_S 31 | ||
| 32 | #define SPI_DIR_M BITFIELD_MASK(1) /* Bit [30] - Direction */ | ||
| 33 | #define SPI_DIR_S 30 | ||
| 34 | #define SPI_CMD_INDEX_M BITFIELD_MASK(6) /* Bits [29:24] - Command number */ | ||
| 35 | #define SPI_CMD_INDEX_S 24 | ||
| 36 | #define SPI_RW_M BITFIELD_MASK(1) /* Bit [23] - Read=0, Write=1 */ | ||
| 37 | #define SPI_RW_S 23 | ||
| 38 | #define SPI_FUNC_M BITFIELD_MASK(3) /* Bits [22:20] - Function Number */ | ||
| 39 | #define SPI_FUNC_S 20 | ||
| 40 | #define SPI_RAW_M BITFIELD_MASK(1) /* Bit [19] - Read After Wr */ | ||
| 41 | #define SPI_RAW_S 19 | ||
| 42 | #define SPI_STUFF_M BITFIELD_MASK(1) /* Bit [18] - Stuff bit */ | ||
| 43 | #define SPI_STUFF_S 18 | ||
| 44 | #define SPI_BLKMODE_M BITFIELD_MASK(1) /* Bit [19] - Blockmode 1=blk */ | ||
| 45 | #define SPI_BLKMODE_S 19 | ||
| 46 | #define SPI_OPCODE_M BITFIELD_MASK(1) /* Bit [18] - OP Code */ | ||
| 47 | #define SPI_OPCODE_S 18 | ||
| 48 | #define SPI_ADDR_M BITFIELD_MASK(17) /* Bits [17:1] - Address */ | ||
| 49 | #define SPI_ADDR_S 1 | ||
| 50 | #define SPI_STUFF0_M BITFIELD_MASK(1) /* Bit [0] - Stuff bit */ | ||
| 51 | #define SPI_STUFF0_S 0 | ||
| 52 | |||
| 53 | #define SPI_RSP_START_M BITFIELD_MASK(1) /* Bit [7] - Start Bit (always 0) */ | ||
| 54 | #define SPI_RSP_START_S 7 | ||
| 55 | #define SPI_RSP_PARAM_ERR_M BITFIELD_MASK(1) /* Bit [6] - Parameter Error */ | ||
| 56 | #define SPI_RSP_PARAM_ERR_S 6 | ||
| 57 | #define SPI_RSP_RFU5_M BITFIELD_MASK(1) /* Bit [5] - RFU (Always 0) */ | ||
| 58 | #define SPI_RSP_RFU5_S 5 | ||
| 59 | #define SPI_RSP_FUNC_ERR_M BITFIELD_MASK(1) /* Bit [4] - Function number error */ | ||
| 60 | #define SPI_RSP_FUNC_ERR_S 4 | ||
| 61 | #define SPI_RSP_CRC_ERR_M BITFIELD_MASK(1) /* Bit [3] - COM CRC Error */ | ||
| 62 | #define SPI_RSP_CRC_ERR_S 3 | ||
| 63 | #define SPI_RSP_ILL_CMD_M BITFIELD_MASK(1) /* Bit [2] - Illegal Command error */ | ||
| 64 | #define SPI_RSP_ILL_CMD_S 2 | ||
| 65 | #define SPI_RSP_RFU1_M BITFIELD_MASK(1) /* Bit [1] - RFU (Always 0) */ | ||
| 66 | #define SPI_RSP_RFU1_S 1 | ||
| 67 | #define SPI_RSP_IDLE_M BITFIELD_MASK(1) /* Bit [0] - In idle state */ | ||
| 68 | #define SPI_RSP_IDLE_S 0 | ||
| 69 | |||
| 70 | /* SD-SPI Protocol Definitions */ | ||
| 71 | #define SDSPI_COMMAND_LEN 6 /* Number of bytes in an SD command */ | ||
| 72 | #define SDSPI_START_BLOCK 0xFE /* SD Start Block Token */ | ||
| 73 | #define SDSPI_IDLE_PAD 0xFF /* SD-SPI idle value for MOSI */ | ||
| 74 | #define SDSPI_START_BIT_MASK 0x80 | ||
| 75 | |||
| 76 | #endif /* _SD_SPI_H */ | ||
diff --git a/drivers/net/wireless/bcmdhd/include/proto/vlan.h b/drivers/net/wireless/bcmdhd/include/proto/vlan.h new file mode 100644 index 00000000000..07fa7e499c2 --- /dev/null +++ b/drivers/net/wireless/bcmdhd/include/proto/vlan.h | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | /* | ||
| 2 | * 802.1Q VLAN protocol definitions | ||
| 3 | * | ||
| 4 | * Copyright (C) 1999-2011, Broadcom Corporation | ||
| 5 | * | ||
| 6 | * Unless you and Broadcom execute a separate written software license | ||
| 7 | * agreement governing use of this software, this software is licensed to you | ||
| 8 | * under the terms of the GNU General Public License version 2 (the "GPL"), | ||
| 9 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | ||
| 10 | * following added to such license: | ||
| 11 | * | ||
| 12 | * As a special exception, the copyright holders of this software give you | ||
| 13 | * permission to link this software with independent modules, and to copy and | ||
| 14 | * distribute the resulting executable under terms of your choice, provided that | ||
| 15 | * you also meet, for each linked independent module, the terms and conditions of | ||
| 16 | * the license of that module. An independent module is a module which is not | ||
| 17 | * derived from this software. The special exception does not apply to any | ||
| 18 | * modifications of the software. | ||
| 19 | * | ||
| 20 | * Notwithstanding the above, under no circumstances may you combine this | ||
| 21 | * software in any way with any other Broadcom software provided under a license | ||
| 22 | * other than the GPL, without Broadcom's express prior written consent. | ||
| 23 | * | ||
| 24 | * $Id: vlan.h,v 9.7 2009-03-13 01:11:50 Exp $ | ||
| 25 | */ | ||
| 26 | |||
| 27 | |||
| 28 | #ifndef _vlan_h_ | ||
| 29 | #define _vlan_h_ | ||
| 30 | |||
| 31 | #ifndef _TYPEDEFS_H_ | ||
| 32 | #include <typedefs.h> | ||
| 33 | #endif | ||
| 34 | |||
| 35 | |||
| 36 | #include <packed_section_start.h> | ||
| 37 | |||
| 38 | #define VLAN_VID_MASK 0xfff | ||
| 39 | #define VLAN_CFI_SHIFT 12 | ||
| 40 | #define VLAN_PRI_SHIFT 13 | ||
| 41 | |||
| 42 | #define VLAN_PRI_MASK 7 | ||
| 43 | |||
| 44 | #define VLAN_TAG_LEN 4 | ||
| 45 | #define VLAN_TAG_OFFSET (2 * ETHER_ADDR_LEN) | ||
| 46 | |||
| 47 | #define VLAN_TPID 0x8100 | ||
| 48 | |||
| 49 | struct ethervlan_header { | ||
| 50 | uint8 ether_dhost[ETHER_ADDR_LEN]; | ||
| 51 | uint8 ether_shost[ETHER_ADDR_LEN]; | ||
| 52 | uint16 vlan_type; | ||
| 53 | uint16 vlan_tag; | ||
| 54 | uint16 ether_type; | ||
| 55 | }; | ||
| 56 | |||
| 57 | #define ETHERVLAN_HDR_LEN (ETHER_HDR_LEN + VLAN_TAG_LEN) | ||
| 58 | |||
| 59 | |||
| 60 | |||
| 61 | #include <packed_section_end.h> | ||
| 62 | |||
| 63 | #define ETHERVLAN_MOVE_HDR(d, s) \ | ||
| 64 | do { \ | ||
| 65 | struct ethervlan_header t; \ | ||
| 66 | t = *(struct ethervlan_header *)(s); \ | ||
| 67 | *(struct ethervlan_header *)(d) = t; \ | ||
| 68 | } while (0) | ||
| 69 | |||
| 70 | #endif | ||
diff --git a/drivers/net/wireless/bcmdhd/include/proto/wpa.h b/drivers/net/wireless/bcmdhd/include/proto/wpa.h new file mode 100644 index 00000000000..1ff06dc7942 --- /dev/null +++ b/drivers/net/wireless/bcmdhd/include/proto/wpa.h | |||
| @@ -0,0 +1,160 @@ | |||
| 1 | /* | ||
| 2 | * Fundamental types and constants relating to WPA | ||
| 3 | * | ||
| 4 | * Copyright (C) 1999-2011, Broadcom Corporation | ||
| 5 | * | ||
| 6 | * Unless you and Broadcom execute a separate written software license | ||
| 7 | * agreement governing use of this software, this software is licensed to you | ||
| 8 | * under the terms of the GNU General Public License version 2 (the "GPL"), | ||
| 9 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | ||
| 10 | * following added to such license: | ||
| 11 | * | ||
| 12 | * As a special exception, the copyright holders of this software give you | ||
| 13 | * permission to link this software with independent modules, and to copy and | ||
| 14 | * distribute the resulting executable under terms of your choice, provided that | ||
| 15 | * you also meet, for each linked independent module, the terms and conditions of | ||
| 16 | * the license of that module. An independent module is a module which is not | ||
| 17 | * derived from this software. The special exception does not apply to any | ||
| 18 | * modifications of the software. | ||
| 19 | * | ||
| 20 | * Notwithstanding the above, under no circumstances may you combine this | ||
| 21 | * software in any way with any other Broadcom software provided under a license | ||
| 22 | * other than the GPL, without Broadcom's express prior written consent. | ||
| 23 | * | ||
| 24 | * $Id: wpa.h,v 1.19 2009-07-13 08:29:58 Exp $ | ||
| 25 | */ | ||
| 26 | |||
| 27 | |||
| 28 | #ifndef _proto_wpa_h_ | ||
| 29 | #define _proto_wpa_h_ | ||
| 30 | |||
| 31 | #include <typedefs.h> | ||
| 32 | #include <proto/ethernet.h> | ||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | #include <packed_section_start.h> | ||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | |||
| 41 | #define DOT11_RC_INVALID_WPA_IE 13 | ||
| 42 | #define DOT11_RC_MIC_FAILURE 14 | ||
| 43 | #define DOT11_RC_4WH_TIMEOUT 15 | ||
| 44 | #define DOT11_RC_GTK_UPDATE_TIMEOUT 16 | ||
| 45 | #define DOT11_RC_WPA_IE_MISMATCH 17 | ||
| 46 | #define DOT11_RC_INVALID_MC_CIPHER 18 | ||
| 47 | #define DOT11_RC_INVALID_UC_CIPHER 19 | ||
| 48 | #define DOT11_RC_INVALID_AKMP 20 | ||
| 49 | #define DOT11_RC_BAD_WPA_VERSION 21 | ||
| 50 | #define DOT11_RC_INVALID_WPA_CAP 22 | ||
| 51 | #define DOT11_RC_8021X_AUTH_FAIL 23 | ||
| 52 | |||
| 53 | #define WPA2_PMKID_LEN 16 | ||
| 54 | |||
| 55 | |||
| 56 | typedef BWL_PRE_PACKED_STRUCT struct | ||
| 57 | { | ||
| 58 | uint8 tag; | ||
| 59 | uint8 length; | ||
| 60 | uint8 oui[3]; | ||
| 61 | uint8 oui_type; | ||
| 62 | BWL_PRE_PACKED_STRUCT struct { | ||
| 63 | uint8 low; | ||
| 64 | uint8 high; | ||
| 65 | } BWL_POST_PACKED_STRUCT version; | ||
| 66 | } BWL_POST_PACKED_STRUCT wpa_ie_fixed_t; | ||
| 67 | #define WPA_IE_OUITYPE_LEN 4 | ||
| 68 | #define WPA_IE_FIXED_LEN 8 | ||
| 69 | #define WPA_IE_TAG_FIXED_LEN 6 | ||
| 70 | |||
| 71 | typedef BWL_PRE_PACKED_STRUCT struct { | ||
| 72 | uint8 tag; | ||
| 73 | uint8 length; | ||
| 74 | BWL_PRE_PACKED_STRUCT struct { | ||
| 75 | uint8 low; | ||
| 76 | uint8 high; | ||
| 77 | } BWL_POST_PACKED_STRUCT version; | ||
| 78 | } BWL_POST_PACKED_STRUCT wpa_rsn_ie_fixed_t; | ||
| 79 | #define WPA_RSN_IE_FIXED_LEN 4 | ||
| 80 | #define WPA_RSN_IE_TAG_FIXED_LEN 2 | ||
| 81 | typedef uint8 wpa_pmkid_t[WPA2_PMKID_LEN]; | ||
| 82 | |||
| 83 | |||
| 84 | typedef BWL_PRE_PACKED_STRUCT struct | ||
| 85 | { | ||
| 86 | uint8 oui[3]; | ||
| 87 | uint8 type; | ||
| 88 | } BWL_POST_PACKED_STRUCT wpa_suite_t, wpa_suite_mcast_t; | ||
| 89 | #define WPA_SUITE_LEN 4 | ||
| 90 | |||
| 91 | |||
| 92 | typedef BWL_PRE_PACKED_STRUCT struct | ||
| 93 | { | ||
| 94 | BWL_PRE_PACKED_STRUCT struct { | ||
| 95 | uint8 low; | ||
| 96 | uint8 high; | ||
| 97 | } BWL_POST_PACKED_STRUCT count; | ||
| 98 | wpa_suite_t list[1]; | ||
| 99 | } BWL_POST_PACKED_STRUCT wpa_suite_ucast_t, wpa_suite_auth_key_mgmt_t; | ||
| 100 | #define WPA_IE_SUITE_COUNT_LEN 2 | ||
| 101 | typedef BWL_PRE_PACKED_STRUCT struct | ||
| 102 | { | ||
| 103 | BWL_PRE_PACKED_STRUCT struct { | ||
| 104 | uint8 low; | ||
| 105 | uint8 high; | ||
| 106 | } BWL_POST_PACKED_STRUCT count; | ||
| 107 | wpa_pmkid_t list[1]; | ||
| 108 | } BWL_POST_PACKED_STRUCT wpa_pmkid_list_t; | ||
| 109 | |||
| 110 | |||
| 111 | #define WPA_CIPHER_NONE 0 | ||
| 112 | #define WPA_CIPHER_WEP_40 1 | ||
| 113 | #define WPA_CIPHER_TKIP 2 | ||
| 114 | #define WPA_CIPHER_AES_OCB 3 | ||
| 115 | #define WPA_CIPHER_AES_CCM 4 | ||
| 116 | #define WPA_CIPHER_WEP_104 5 | ||
| 117 | |||
| 118 | |||
| 119 | #define IS_WPA_CIPHER(cipher) ((cipher) == WPA_CIPHER_NONE || \ | ||
| 120 | (cipher) == WPA_CIPHER_WEP_40 || \ | ||
| 121 | (cipher) == WPA_CIPHER_WEP_104 || \ | ||
| 122 | (cipher) == WPA_CIPHER_TKIP || \ | ||
| 123 | (cipher) == WPA_CIPHER_AES_OCB || \ | ||
| 124 | (cipher) == WPA_CIPHER_AES_CCM) | ||
| 125 | |||
| 126 | |||
| 127 | #define WPA_TKIP_CM_DETECT 60 | ||
| 128 | #define WPA_TKIP_CM_BLOCK 60 | ||
| 129 | |||
| 130 | |||
| 131 | #define RSN_CAP_LEN 2 | ||
| 132 | |||
| 133 | |||
| 134 | #define RSN_CAP_PREAUTH 0x0001 | ||
| 135 | #define RSN_CAP_NOPAIRWISE 0x0002 | ||
| 136 | #define RSN_CAP_PTK_REPLAY_CNTR_MASK 0x000C | ||
| 137 | #define RSN_CAP_PTK_REPLAY_CNTR_SHIFT 2 | ||
| 138 | #define RSN_CAP_GTK_REPLAY_CNTR_MASK 0x0030 | ||
| 139 | #define RSN_CAP_GTK_REPLAY_CNTR_SHIFT 4 | ||
| 140 | #define RSN_CAP_1_REPLAY_CNTR 0 | ||
| 141 | #define RSN_CAP_2_REPLAY_CNTRS 1 | ||
| 142 | #define RSN_CAP_4_REPLAY_CNTRS 2 | ||
| 143 | #define RSN_CAP_16_REPLAY_CNTRS 3 | ||
| 144 | |||
| 145 | |||
| 146 | #define WPA_CAP_4_REPLAY_CNTRS RSN_CAP_4_REPLAY_CNTRS | ||
| 147 | #define WPA_CAP_16_REPLAY_CNTRS RSN_CAP_16_REPLAY_CNTRS | ||
| 148 | #define WPA_CAP_REPLAY_CNTR_SHIFT RSN_CAP_PTK_REPLAY_CNTR_SHIFT | ||
| 149 | #define WPA_CAP_REPLAY_CNTR_MASK RSN_CAP_PTK_REPLAY_CNTR_MASK | ||
| 150 | |||
| 151 | |||
| 152 | #define WPA_CAP_LEN RSN_CAP_LEN | ||
| 153 | |||
| 154 | #define WPA_CAP_WPA2_PREAUTH RSN_CAP_PREAUTH | ||
| 155 | |||
| 156 | |||
| 157 | |||
| 158 | #include <packed_section_end.h> | ||
| 159 | |||
| 160 | #endif | ||
