Home | History | Annotate | Download | only in include
      1 /*
      2  * Custom OID/ioctl definitions for
      3  * Broadcom 802.11abg Networking Device Driver
      4  *
      5  * Definitions subject to change without notice.
      6  *
      7  * Copyright (C) 1999-2011, Broadcom Corporation
      8  *
      9  * Permission to use, copy, modify, and/or distribute this software for any
     10  * purpose with or without fee is hereby granted, provided that the above
     11  * copyright notice and this permission notice appear in all copies.
     12  *
     13  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     14  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     15  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
     16  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     17  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
     18  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
     19  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     20  *
     21  * $Id: wlioctl.h,v 1.767.2.38 2011-02-01 23:04:28 Exp $
     22  */
     23 
     24 
     25 #ifndef _wlioctl_h_
     26 #define _wlioctl_h_
     27 
     28 #include <typedefs.h>
     29 #include <proto/ethernet.h>
     30 #include <proto/bcmeth.h>
     31 #include <proto/bcmevent.h>
     32 #include <proto/802.11.h>
     33 #include <bcmwifi.h>
     34 
     35 #include <bcmcdc.h>
     36 
     37 #ifndef INTF_NAME_SIZ
     38 #define INTF_NAME_SIZ   16
     39 #endif
     40 
     41 
     42 typedef struct remote_ioctl {
     43 	cdc_ioctl_t     msg;
     44 	uint        data_len;
     45 	char            intf_name[INTF_NAME_SIZ];
     46 } rem_ioctl_t;
     47 #define REMOTE_SIZE sizeof(rem_ioctl_t)
     48 
     49 #define ACTION_FRAME_SIZE 1040
     50 
     51 typedef struct wl_action_frame {
     52 	struct ether_addr   da;
     53 	uint16          len;
     54 	uint32          packetId;
     55 	uint8           data[ACTION_FRAME_SIZE];
     56 } wl_action_frame_t;
     57 
     58 #define WL_WIFI_ACTION_FRAME_SIZE sizeof(struct wl_action_frame)
     59 
     60 typedef struct wl_af_params {
     61 	uint32          channel;
     62 	int32           dwell_time;
     63 	struct ether_addr   BSSID;
     64 	wl_action_frame_t   action_frame;
     65 } wl_af_params_t;
     66 
     67 #define WL_WIFI_AF_PARAMS_SIZE sizeof(struct wl_af_params)
     68 
     69 
     70 #define BWL_DEFAULT_PACKING
     71 #include <packed_section_start.h>
     72 
     73 
     74 
     75 
     76 
     77 #define LEGACY2_WL_BSS_INFO_VERSION 108
     78 
     79 
     80 typedef struct wl_bss_info_108 {
     81 	uint32      version;
     82 	uint32      length;
     83 	struct ether_addr BSSID;
     84 	uint16      beacon_period;
     85 	uint16      capability;
     86 	uint8       SSID_len;
     87 	uint8       SSID[32];
     88 	struct {
     89 		uint    count;
     90 		uint8   rates[16];
     91 	} rateset;
     92 	chanspec_t  chanspec;
     93 	uint16      atim_window;
     94 	uint8       dtim_period;
     95 	int16       RSSI;
     96 	int8        phy_noise;
     97 
     98 	uint8       n_cap;
     99 	uint32      nbss_cap;
    100 	uint8       ctl_ch;
    101 	uint32      reserved32[1];
    102 	uint8       flags;
    103 	uint8       reserved[3];
    104 	uint8       basic_mcs[MCSSET_LEN];
    105 
    106 	uint16      ie_offset;
    107 	uint32      ie_length;
    108 
    109 
    110 } wl_bss_info_108_t;
    111 
    112 #define WL_BSS_INFO_VERSION 109
    113 
    114 
    115 typedef struct wl_bss_info {
    116 	uint32      version;
    117 	uint32      length;
    118 	struct ether_addr BSSID;
    119 	uint16      beacon_period;
    120 	uint16      capability;
    121 	uint8       SSID_len;
    122 	uint8       SSID[32];
    123 	struct {
    124 		uint    count;
    125 		uint8   rates[16];
    126 	} rateset;
    127 	chanspec_t  chanspec;
    128 	uint16      atim_window;
    129 	uint8       dtim_period;
    130 	int16       RSSI;
    131 	int8        phy_noise;
    132 
    133 	uint8       n_cap;
    134 	uint32      nbss_cap;
    135 	uint8       ctl_ch;
    136 	uint32      reserved32[1];
    137 	uint8       flags;
    138 	uint8       reserved[3];
    139 	uint8       basic_mcs[MCSSET_LEN];
    140 
    141 	uint16      ie_offset;
    142 	uint32      ie_length;
    143 	int16       SNR;
    144 
    145 
    146 } wl_bss_info_t;
    147 
    148 typedef struct wl_bsscfg {
    149 	uint32  wsec;
    150 	uint32  WPA_auth;
    151 	uint32  wsec_index;
    152 	uint32  associated;
    153 	uint32  BSS;
    154 	uint32  phytest_on;
    155 	struct ether_addr   prev_BSSID;
    156 	struct ether_addr   BSSID;
    157 } wl_bsscfg_t;
    158 
    159 typedef struct wl_bss_config {
    160 	uint32  atim_window;
    161 	uint32  beacon_period;
    162 	uint32  chanspec;
    163 } wl_bss_config_t;
    164 
    165 
    166 typedef struct wlc_ssid {
    167 	uint32      SSID_len;
    168 	uchar       SSID[32];
    169 } wlc_ssid_t;
    170 
    171 
    172 #define WL_BSSTYPE_INFRA 1
    173 #define WL_BSSTYPE_INDEP 0
    174 #define WL_BSSTYPE_ANY   2
    175 
    176 
    177 #define WL_SCANFLAGS_PASSIVE 0x01
    178 #define WL_SCANFLAGS_RESERVED 0x02
    179 #define WL_SCANFLAGS_PROHIBITED 0x04
    180 
    181 typedef struct wl_scan_params {
    182 	wlc_ssid_t ssid;
    183 	struct ether_addr bssid;
    184 	int8 bss_type;
    185 	uint8 scan_type;
    186 	int32 nprobes;
    187 	int32 active_time;
    188 	int32 passive_time;
    189 	int32 home_time;
    190 	int32 channel_num;
    191 	uint16 channel_list[1];
    192 } wl_scan_params_t;
    193 
    194 
    195 #define WL_SCAN_PARAMS_FIXED_SIZE 64
    196 
    197 
    198 #define WL_SCAN_PARAMS_COUNT_MASK 0x0000ffff
    199 #define WL_SCAN_PARAMS_NSSID_SHIFT 16
    200 
    201 #define WL_SCAN_ACTION_START      1
    202 #define WL_SCAN_ACTION_CONTINUE   2
    203 #define WL_SCAN_ACTION_ABORT      3
    204 
    205 #define ISCAN_REQ_VERSION 1
    206 
    207 
    208 typedef struct wl_iscan_params {
    209 	uint32 version;
    210 	uint16 action;
    211 	uint16 scan_duration;
    212 	wl_scan_params_t params;
    213 } wl_iscan_params_t;
    214 
    215 
    216 #define WL_ISCAN_PARAMS_FIXED_SIZE (OFFSETOF(wl_iscan_params_t, params) + sizeof(wlc_ssid_t))
    217 
    218 typedef struct wl_scan_results {
    219 	uint32 buflen;
    220 	uint32 version;
    221 	uint32 count;
    222 	wl_bss_info_t bss_info[1];
    223 } wl_scan_results_t;
    224 
    225 
    226 #define WL_SCAN_RESULTS_FIXED_SIZE (sizeof(wl_scan_results_t) - sizeof(wl_bss_info_t))
    227 
    228 
    229 #define WL_SCAN_RESULTS_SUCCESS 0
    230 #define WL_SCAN_RESULTS_PARTIAL 1
    231 #define WL_SCAN_RESULTS_PENDING 2
    232 #define WL_SCAN_RESULTS_ABORTED 3
    233 #define WL_SCAN_RESULTS_NO_MEM  4
    234 
    235 
    236 #define DNGL_RXCTXT_SIZE	45
    237 
    238 #if defined(SIMPLE_ISCAN)
    239 #define ISCAN_RETRY_CNT   5
    240 #define ISCAN_STATE_IDLE   0
    241 #define ISCAN_STATE_SCANING 1
    242 #define ISCAN_STATE_PENDING 2
    243 
    244 
    245 #define WLC_IW_ISCAN_MAXLEN   2048
    246 typedef struct iscan_buf {
    247 	struct iscan_buf * next;
    248 	char   iscan_buf[WLC_IW_ISCAN_MAXLEN];
    249 } iscan_buf_t;
    250 #endif
    251 
    252 #define ESCAN_REQ_VERSION 1
    253 
    254 typedef struct wl_escan_params {
    255 	uint32 version;
    256 	uint16 action;
    257 	uint16 sync_id;
    258 	wl_scan_params_t params;
    259 } wl_escan_params_t;
    260 
    261 #define WL_ESCAN_PARAMS_FIXED_SIZE (OFFSETOF(wl_escan_params_t, params) + sizeof(wlc_ssid_t))
    262 
    263 typedef struct wl_escan_result {
    264 	uint32 buflen;
    265 	uint32 version;
    266 	uint16 sync_id;
    267 	uint16 bss_count;
    268 	wl_bss_info_t bss_info[1];
    269 } wl_escan_result_t;
    270 
    271 #define WL_ESCAN_RESULTS_FIXED_SIZE (sizeof(wl_escan_result_t) - sizeof(wl_bss_info_t))
    272 
    273 
    274 typedef struct wl_iscan_results {
    275 	uint32 status;
    276 	wl_scan_results_t results;
    277 } wl_iscan_results_t;
    278 
    279 
    280 #define WL_ISCAN_RESULTS_FIXED_SIZE \
    281 	(WL_SCAN_RESULTS_FIXED_SIZE + OFFSETOF(wl_iscan_results_t, results))
    282 
    283 typedef struct wl_probe_params {
    284 	wlc_ssid_t ssid;
    285 	struct ether_addr bssid;
    286 	struct ether_addr mac;
    287 } wl_probe_params_t;
    288 
    289 #define WL_NUMRATES     16
    290 typedef struct wl_rateset {
    291 	uint32  count;
    292 	uint8   rates[WL_NUMRATES];
    293 } wl_rateset_t;
    294 
    295 typedef struct wl_rateset_args {
    296 	uint32  count;
    297 	uint8   rates[WL_NUMRATES];
    298 	uint8   mcs[MCSSET_LEN];
    299 } wl_rateset_args_t;
    300 
    301 
    302 typedef struct wl_uint32_list {
    303 
    304 	uint32 count;
    305 
    306 	uint32 element[1];
    307 } wl_uint32_list_t;
    308 
    309 
    310 typedef struct wl_assoc_params {
    311 	struct ether_addr bssid;
    312 	uint16 bssid_cnt;
    313 	int32 chanspec_num;
    314 	chanspec_t chanspec_list[1];
    315 } wl_assoc_params_t;
    316 #define WL_ASSOC_PARAMS_FIXED_SIZE  (sizeof(wl_assoc_params_t) - sizeof(chanspec_t))
    317 
    318 
    319 typedef wl_assoc_params_t wl_reassoc_params_t;
    320 #define WL_REASSOC_PARAMS_FIXED_SIZE    WL_ASSOC_PARAMS_FIXED_SIZE
    321 
    322 
    323 typedef wl_assoc_params_t wl_join_assoc_params_t;
    324 #define WL_JOIN_ASSOC_PARAMS_FIXED_SIZE        WL_ASSOC_PARAMS_FIXED_SIZE
    325 
    326 
    327 typedef struct wl_join_params {
    328 	wlc_ssid_t ssid;
    329 	wl_assoc_params_t params;
    330 } wl_join_params_t;
    331 #define WL_JOIN_PARAMS_FIXED_SIZE   (sizeof(wl_join_params_t) - sizeof(chanspec_t))
    332 
    333 
    334 typedef struct wl_join_scan_params {
    335 	uint8 scan_type;
    336 	int32 nprobes;
    337 	int32 active_time;
    338 	int32 passive_time;
    339 	int32 home_time;
    340 } wl_join_scan_params_t;
    341 
    342 
    343 typedef struct wl_extjoin_params {
    344 	wlc_ssid_t ssid;
    345 	wl_join_scan_params_t scan;
    346 	wl_join_assoc_params_t assoc;
    347 } wl_extjoin_params_t;
    348 #define WL_EXTJOIN_PARAMS_FIXED_SIZE    (sizeof(wl_extjoin_params_t) - sizeof(chanspec_t))
    349 
    350 typedef struct {
    351 	uint32 num;
    352 	chanspec_t list[1];
    353 } chanspec_list_t;
    354 
    355 
    356 #define NRATE_MCS_INUSE 0x00000080
    357 #define NRATE_RATE_MASK 0x0000007f
    358 #define NRATE_STF_MASK  0x0000ff00
    359 #define NRATE_STF_SHIFT 8
    360 #define NRATE_OVERRIDE  0x80000000
    361 #define NRATE_OVERRIDE_MCS_ONLY 0x40000000
    362 #define NRATE_SGI_MASK  0x00800000
    363 #define NRATE_SGI_SHIFT 23
    364 #define NRATE_LDPC_CODING 0x00400000
    365 #define NRATE_LDPC_SHIFT 22
    366 
    367 #define NRATE_STF_SISO  0
    368 #define NRATE_STF_CDD   1
    369 #define NRATE_STF_STBC  2
    370 #define NRATE_STF_SDM   3
    371 
    372 #define ANTENNA_NUM_1   1
    373 #define ANTENNA_NUM_2   2
    374 #define ANTENNA_NUM_3   3
    375 #define ANTENNA_NUM_4   4
    376 
    377 #define ANT_SELCFG_AUTO     0x80
    378 #define ANT_SELCFG_MASK     0x33
    379 #define ANT_SELCFG_MAX      4
    380 #define ANT_SELCFG_TX_UNICAST   0
    381 #define ANT_SELCFG_RX_UNICAST   1
    382 #define ANT_SELCFG_TX_DEF   2
    383 #define ANT_SELCFG_RX_DEF   3
    384 
    385 #define MAX_STREAMS_SUPPORTED   4
    386 
    387 typedef struct {
    388 	uint8 ant_config[ANT_SELCFG_MAX];
    389 	uint8 num_antcfg;
    390 } wlc_antselcfg_t;
    391 
    392 #define HIGHEST_SINGLE_STREAM_MCS   7
    393 
    394 #define MAX_CCA_CHANNELS 38
    395 #define MAX_CCA_SECS     60
    396 
    397 #define IBSS_MED        15
    398 #define IBSS_HI         25
    399 #define OBSS_MED        12
    400 #define OBSS_HI         25
    401 #define INTERFER_MED    5
    402 #define INTERFER_HI     10
    403 
    404 #define  CCA_FLAG_2G_ONLY       0x01
    405 #define  CCA_FLAG_5G_ONLY       0x02
    406 #define  CCA_FLAG_IGNORE_DURATION   0x04
    407 #define  CCA_FLAGS_PREFER_1_6_11    0x10
    408 #define  CCA_FLAG_IGNORE_INTERFER   0x20
    409 
    410 #define CCA_ERRNO_BAND      1
    411 #define CCA_ERRNO_DURATION  2
    412 #define CCA_ERRNO_PREF_CHAN 3
    413 #define CCA_ERRNO_INTERFER  4
    414 #define CCA_ERRNO_TOO_FEW   5
    415 
    416 typedef struct {
    417 	uint32 duration;
    418 	uint32 congest_ibss;
    419 
    420 	uint32 congest_obss;
    421 	uint32 interference;
    422 	uint32 timestamp;
    423 } cca_congest_t;
    424 
    425 typedef struct {
    426 	chanspec_t chanspec;
    427 	uint8 num_secs;
    428 	cca_congest_t  secs[1];
    429 } cca_congest_channel_req_t;
    430 
    431 #define WLC_CNTRY_BUF_SZ    4
    432 
    433 typedef struct wl_country {
    434 	char country_abbrev[WLC_CNTRY_BUF_SZ];
    435 	int32 rev;
    436 	char ccode[WLC_CNTRY_BUF_SZ];
    437 } wl_country_t;
    438 
    439 typedef struct wl_channels_in_country {
    440 	uint32 buflen;
    441 	uint32 band;
    442 	char country_abbrev[WLC_CNTRY_BUF_SZ];
    443 	uint32 count;
    444 	uint32 channel[1];
    445 } wl_channels_in_country_t;
    446 
    447 typedef struct wl_country_list {
    448 	uint32 buflen;
    449 	uint32 band_set;
    450 	uint32 band;
    451 	uint32 count;
    452 	char country_abbrev[1];
    453 } wl_country_list_t;
    454 
    455 #define WL_NUM_RPI_BINS     8
    456 #define WL_RM_TYPE_BASIC    1
    457 #define WL_RM_TYPE_CCA      2
    458 #define WL_RM_TYPE_RPI      3
    459 
    460 #define WL_RM_FLAG_PARALLEL (1<<0)
    461 
    462 #define WL_RM_FLAG_LATE     (1<<1)
    463 #define WL_RM_FLAG_INCAPABLE    (1<<2)
    464 #define WL_RM_FLAG_REFUSED  (1<<3)
    465 
    466 typedef struct wl_rm_req_elt {
    467 	int8    type;
    468 	int8    flags;
    469 	chanspec_t  chanspec;
    470 	uint32  token;
    471 	uint32  tsf_h;
    472 	uint32  tsf_l;
    473 	uint32  dur;
    474 } wl_rm_req_elt_t;
    475 
    476 typedef struct wl_rm_req {
    477 	uint32  token;
    478 	uint32  count;
    479 	void    *cb;
    480 	void    *cb_arg;
    481 	wl_rm_req_elt_t req[1];
    482 } wl_rm_req_t;
    483 #define WL_RM_REQ_FIXED_LEN OFFSETOF(wl_rm_req_t, req)
    484 
    485 typedef struct wl_rm_rep_elt {
    486 	int8    type;
    487 	int8    flags;
    488 	chanspec_t  chanspec;
    489 	uint32  token;
    490 	uint32  tsf_h;
    491 	uint32  tsf_l;
    492 	uint32  dur;
    493 	uint32  len;
    494 	uint8   data[1];
    495 } wl_rm_rep_elt_t;
    496 #define WL_RM_REP_ELT_FIXED_LEN 24
    497 
    498 #define WL_RPI_REP_BIN_NUM 8
    499 typedef struct wl_rm_rpi_rep {
    500 	uint8   rpi[WL_RPI_REP_BIN_NUM];
    501 	int8    rpi_max[WL_RPI_REP_BIN_NUM];
    502 } wl_rm_rpi_rep_t;
    503 
    504 typedef struct wl_rm_rep {
    505 	uint32  token;
    506 	uint32  len;
    507 	wl_rm_rep_elt_t rep[1];
    508 } wl_rm_rep_t;
    509 #define WL_RM_REP_FIXED_LEN 8
    510 
    511 
    512 typedef enum sup_auth_status {
    513 
    514 	WLC_SUP_DISCONNECTED = 0,
    515 	WLC_SUP_CONNECTING,
    516 	WLC_SUP_IDREQUIRED,
    517 	WLC_SUP_AUTHENTICATING,
    518 	WLC_SUP_AUTHENTICATED,
    519 	WLC_SUP_KEYXCHANGE,
    520 	WLC_SUP_KEYED,
    521 	WLC_SUP_TIMEOUT,
    522 	WLC_SUP_LAST_BASIC_STATE,
    523 
    524 
    525 
    526 	WLC_SUP_KEYXCHANGE_WAIT_M1 = WLC_SUP_AUTHENTICATED,
    527 
    528 	WLC_SUP_KEYXCHANGE_PREP_M2 = WLC_SUP_KEYXCHANGE,
    529 
    530 	WLC_SUP_KEYXCHANGE_WAIT_M3 = WLC_SUP_LAST_BASIC_STATE,
    531 	WLC_SUP_KEYXCHANGE_PREP_M4,
    532 	WLC_SUP_KEYXCHANGE_WAIT_G1,
    533 	WLC_SUP_KEYXCHANGE_PREP_G2
    534 } sup_auth_status_t;
    535 
    536 
    537 #define CRYPTO_ALGO_OFF         0
    538 #define CRYPTO_ALGO_WEP1        1
    539 #define CRYPTO_ALGO_TKIP        2
    540 #define CRYPTO_ALGO_WEP128      3
    541 #define CRYPTO_ALGO_AES_CCM     4
    542 #define CRYPTO_ALGO_AES_OCB_MSDU    5
    543 #define CRYPTO_ALGO_AES_OCB_MPDU    6
    544 #define CRYPTO_ALGO_NALG        7
    545 
    546 #define WSEC_GEN_MIC_ERROR  0x0001
    547 #define WSEC_GEN_REPLAY     0x0002
    548 #define WSEC_GEN_ICV_ERROR  0x0004
    549 
    550 #define WL_SOFT_KEY (1 << 0)
    551 #define WL_PRIMARY_KEY  (1 << 1)
    552 #define WL_KF_RES_4 (1 << 4)
    553 #define WL_KF_RES_5 (1 << 5)
    554 #define WL_IBSS_PEER_GROUP_KEY  (1 << 6)
    555 
    556 typedef struct wl_wsec_key {
    557 	uint32      index;
    558 	uint32      len;
    559 	uint8       data[DOT11_MAX_KEY_SIZE];
    560 	uint32      pad_1[18];
    561 	uint32      algo;
    562 	uint32      flags;
    563 	uint32      pad_2[2];
    564 	int     pad_3;
    565 	int     iv_initialized;
    566 	int     pad_4;
    567 
    568 	struct {
    569 		uint32  hi;
    570 		uint16  lo;
    571 	} rxiv;
    572 	uint32      pad_5[2];
    573 	struct ether_addr ea;
    574 } wl_wsec_key_t;
    575 
    576 #define WSEC_MIN_PSK_LEN    8
    577 #define WSEC_MAX_PSK_LEN    64
    578 
    579 
    580 #define WSEC_PASSPHRASE     (1<<0)
    581 
    582 
    583 typedef struct {
    584 	ushort  key_len;
    585 	ushort  flags;
    586 	uint8   key[WSEC_MAX_PSK_LEN];
    587 } wsec_pmk_t;
    588 
    589 
    590 #define WEP_ENABLED     0x0001
    591 #define TKIP_ENABLED        0x0002
    592 #define AES_ENABLED     0x0004
    593 #define WSEC_SWFLAG     0x0008
    594 #define SES_OW_ENABLED      0x0040
    595 
    596 
    597 #define WPA_AUTH_DISABLED   0x0000
    598 #define WPA_AUTH_NONE       0x0001
    599 #define WPA_AUTH_UNSPECIFIED    0x0002
    600 #define WPA_AUTH_PSK        0x0004
    601 
    602 #define WPA2_AUTH_UNSPECIFIED   0x0040
    603 #define WPA2_AUTH_PSK       0x0080
    604 #define BRCM_AUTH_PSK           0x0100
    605 #define BRCM_AUTH_DPT       0x0200
    606 
    607 
    608 #define MAXPMKID        16
    609 
    610 typedef struct _pmkid {
    611 	struct ether_addr   BSSID;
    612 	uint8           PMKID[WPA2_PMKID_LEN];
    613 } pmkid_t;
    614 
    615 typedef struct _pmkid_list {
    616 	uint32  npmkid;
    617 	pmkid_t pmkid[1];
    618 } pmkid_list_t;
    619 
    620 typedef struct _pmkid_cand {
    621 	struct ether_addr   BSSID;
    622 	uint8           preauth;
    623 } pmkid_cand_t;
    624 
    625 typedef struct _pmkid_cand_list {
    626 	uint32  npmkid_cand;
    627 	pmkid_cand_t    pmkid_cand[1];
    628 } pmkid_cand_list_t;
    629 
    630 
    631 
    632 
    633 #define WLC_TXFILTER_OVERRIDE_DISABLED  0
    634 #define WLC_TXFILTER_OVERRIDE_ENABLED   1
    635 
    636 
    637 typedef struct {
    638 	uint32  val;
    639 	struct ether_addr ea;
    640 } scb_val_t;
    641 
    642 
    643 typedef struct {
    644 	uint32 code;
    645 	scb_val_t ioctl_args;
    646 } authops_t;
    647 
    648 
    649 typedef struct channel_info {
    650 	int hw_channel;
    651 	int target_channel;
    652 	int scan_channel;
    653 } channel_info_t;
    654 
    655 
    656 struct maclist {
    657 	uint count;
    658 	struct ether_addr ea[1];
    659 };
    660 
    661 
    662 typedef struct get_pktcnt {
    663 	uint rx_good_pkt;
    664 	uint rx_bad_pkt;
    665 	uint tx_good_pkt;
    666 	uint tx_bad_pkt;
    667 	uint rx_ocast_good_pkt;
    668 } get_pktcnt_t;
    669 
    670 #define WL_IOCTL_ACTION_GET				0x0
    671 #define WL_IOCTL_ACTION_SET				0x1
    672 #define WL_IOCTL_ACTION_OVL_IDX_MASK	0x1e
    673 #define WL_IOCTL_ACTION_OVL_RSV			0x20
    674 #define WL_IOCTL_ACTION_OVL				0x40
    675 #define WL_IOCTL_ACTION_MASK			0x7e
    676 #define WL_IOCTL_ACTION_OVL_SHIFT		1
    677 
    678 
    679 typedef struct wl_ioctl {
    680 	uint cmd;
    681 	void *buf;
    682 	uint len;
    683 	uint8 set;
    684 	uint used;
    685 	uint needed;
    686 } wl_ioctl_t;
    687 
    688 
    689 #define ioctl_subtype   set
    690 #define ioctl_pid   used
    691 #define ioctl_status    needed
    692 
    693 
    694 typedef struct wlc_rev_info {
    695 	uint        vendorid;
    696 	uint        deviceid;
    697 	uint        radiorev;
    698 	uint        chiprev;
    699 	uint        corerev;
    700 	uint        boardid;
    701 	uint        boardvendor;
    702 	uint        boardrev;
    703 	uint        driverrev;
    704 	uint        ucoderev;
    705 	uint        bus;
    706 	uint        chipnum;
    707 	uint        phytype;
    708 	uint        phyrev;
    709 	uint        anarev;
    710 	uint        chippkg;
    711 } wlc_rev_info_t;
    712 
    713 #define WL_REV_INFO_LEGACY_LENGTH   48
    714 
    715 #define WL_BRAND_MAX 10
    716 typedef struct wl_instance_info {
    717 	uint instance;
    718 	char brand[WL_BRAND_MAX];
    719 } wl_instance_info_t;
    720 
    721 
    722 typedef struct wl_txfifo_sz {
    723 	uint16  magic;
    724 	uint16  fifo;
    725 	uint16  size;
    726 } wl_txfifo_sz_t;
    727 
    728 #define WL_TXFIFO_SZ_MAGIC  0xa5a5
    729 
    730 
    731 
    732 #define WLC_IOV_NAME_LEN 30
    733 typedef struct wlc_iov_trx_s {
    734 	uint8 module;
    735 	uint8 type;
    736 	char name[WLC_IOV_NAME_LEN];
    737 } wlc_iov_trx_t;
    738 
    739 
    740 #define WLC_IOCTL_MAGIC     0x14e46c77
    741 
    742 
    743 #define WLC_IOCTL_VERSION   1
    744 
    745 #define WLC_IOCTL_MAXLEN        8192
    746 #define WLC_IOCTL_SMLEN         256
    747 #define WLC_IOCTL_MEDLEN        1536
    748 #ifdef WLC_HIGH_ONLY
    749 #define WLC_SAMPLECOLLECT_MAXLEN    1024
    750 #else
    751 #define WLC_SAMPLECOLLECT_MAXLEN    10240
    752 #endif
    753 
    754 
    755 #define WLC_GET_MAGIC               0
    756 #define WLC_GET_VERSION             1
    757 #define WLC_UP                  2
    758 #define WLC_DOWN                3
    759 #define WLC_GET_LOOP                4
    760 #define WLC_SET_LOOP                5
    761 #define WLC_DUMP                6
    762 #define WLC_GET_MSGLEVEL            7
    763 #define WLC_SET_MSGLEVEL            8
    764 #define WLC_GET_PROMISC             9
    765 #define WLC_SET_PROMISC             10
    766 #define WLC_OVERLAY_IOCTL           11
    767 #define WLC_GET_RATE                12
    768 
    769 #define WLC_GET_INSTANCE            14
    770 
    771 
    772 
    773 
    774 #define WLC_GET_INFRA               19
    775 #define WLC_SET_INFRA               20
    776 #define WLC_GET_AUTH                21
    777 #define WLC_SET_AUTH                22
    778 #define WLC_GET_BSSID               23
    779 #define WLC_SET_BSSID               24
    780 #define WLC_GET_SSID                25
    781 #define WLC_SET_SSID                26
    782 #define WLC_RESTART             27
    783 
    784 #define WLC_GET_CHANNEL             29
    785 #define WLC_SET_CHANNEL             30
    786 #define WLC_GET_SRL             31
    787 #define WLC_SET_SRL             32
    788 #define WLC_GET_LRL             33
    789 #define WLC_SET_LRL             34
    790 #define WLC_GET_PLCPHDR             35
    791 #define WLC_SET_PLCPHDR             36
    792 #define WLC_GET_RADIO               37
    793 #define WLC_SET_RADIO               38
    794 #define WLC_GET_PHYTYPE             39
    795 #define WLC_DUMP_RATE               40
    796 #define WLC_SET_RATE_PARAMS         41
    797 #define WLC_GET_FIXRATE             42
    798 #define WLC_SET_FIXRATE             43
    799 
    800 
    801 #define WLC_GET_KEY             44
    802 #define WLC_SET_KEY             45
    803 #define WLC_GET_REGULATORY          46
    804 #define WLC_SET_REGULATORY          47
    805 #define WLC_GET_PASSIVE_SCAN            48
    806 #define WLC_SET_PASSIVE_SCAN            49
    807 #define WLC_SCAN                50
    808 #define WLC_SCAN_RESULTS            51
    809 #define WLC_DISASSOC                52
    810 #define WLC_REASSOC             53
    811 #define WLC_GET_ROAM_TRIGGER            54
    812 #define WLC_SET_ROAM_TRIGGER            55
    813 #define WLC_GET_ROAM_DELTA          56
    814 #define WLC_SET_ROAM_DELTA          57
    815 #define WLC_GET_ROAM_SCAN_PERIOD        58
    816 #define WLC_SET_ROAM_SCAN_PERIOD        59
    817 #define WLC_EVM                 60
    818 #define WLC_GET_TXANT               61
    819 #define WLC_SET_TXANT               62
    820 #define WLC_GET_ANTDIV              63
    821 #define WLC_SET_ANTDIV              64
    822 
    823 
    824 #define WLC_GET_CLOSED              67
    825 #define WLC_SET_CLOSED              68
    826 #define WLC_GET_MACLIST             69
    827 #define WLC_SET_MACLIST             70
    828 #define WLC_GET_RATESET             71
    829 #define WLC_SET_RATESET             72
    830 
    831 #define WLC_LONGTRAIN               74
    832 #define WLC_GET_BCNPRD              75
    833 #define WLC_SET_BCNPRD              76
    834 #define WLC_GET_DTIMPRD             77
    835 #define WLC_SET_DTIMPRD             78
    836 #define WLC_GET_SROM                79
    837 #define WLC_SET_SROM                80
    838 #define WLC_GET_WEP_RESTRICT            81
    839 #define WLC_SET_WEP_RESTRICT            82
    840 #define WLC_GET_COUNTRY             83
    841 #define WLC_SET_COUNTRY             84
    842 #define WLC_GET_PM              85
    843 #define WLC_SET_PM              86
    844 #define WLC_GET_WAKE                87
    845 #define WLC_SET_WAKE                88
    846 
    847 #define WLC_GET_FORCELINK           90
    848 #define WLC_SET_FORCELINK           91
    849 #define WLC_FREQ_ACCURACY           92
    850 #define WLC_CARRIER_SUPPRESS            93
    851 #define WLC_GET_PHYREG              94
    852 #define WLC_SET_PHYREG              95
    853 #define WLC_GET_RADIOREG            96
    854 #define WLC_SET_RADIOREG            97
    855 #define WLC_GET_REVINFO             98
    856 #define WLC_GET_UCANTDIV            99
    857 #define WLC_SET_UCANTDIV            100
    858 #define WLC_R_REG               101
    859 #define WLC_W_REG               102
    860 
    861 
    862 #define WLC_GET_MACMODE             105
    863 #define WLC_SET_MACMODE             106
    864 #define WLC_GET_MONITOR             107
    865 #define WLC_SET_MONITOR             108
    866 #define WLC_GET_GMODE               109
    867 #define WLC_SET_GMODE               110
    868 #define WLC_GET_LEGACY_ERP          111
    869 #define WLC_SET_LEGACY_ERP          112
    870 #define WLC_GET_RX_ANT              113
    871 #define WLC_GET_CURR_RATESET            114
    872 #define WLC_GET_SCANSUPPRESS            115
    873 #define WLC_SET_SCANSUPPRESS            116
    874 #define WLC_GET_AP              117
    875 #define WLC_SET_AP              118
    876 #define WLC_GET_EAP_RESTRICT            119
    877 #define WLC_SET_EAP_RESTRICT            120
    878 #define WLC_SCB_AUTHORIZE           121
    879 #define WLC_SCB_DEAUTHORIZE         122
    880 #define WLC_GET_WDSLIST             123
    881 #define WLC_SET_WDSLIST             124
    882 #define WLC_GET_ATIM                125
    883 #define WLC_SET_ATIM                126
    884 #define WLC_GET_RSSI                127
    885 #define WLC_GET_PHYANTDIV           128
    886 #define WLC_SET_PHYANTDIV           129
    887 #define WLC_AP_RX_ONLY              130
    888 #define WLC_GET_TX_PATH_PWR         131
    889 #define WLC_SET_TX_PATH_PWR         132
    890 #define WLC_GET_WSEC                133
    891 #define WLC_SET_WSEC                134
    892 #define WLC_GET_PHY_NOISE           135
    893 #define WLC_GET_BSS_INFO            136
    894 #define WLC_GET_PKTCNTS             137
    895 #define WLC_GET_LAZYWDS             138
    896 #define WLC_SET_LAZYWDS             139
    897 #define WLC_GET_BANDLIST            140
    898 #define WLC_GET_BAND                141
    899 #define WLC_SET_BAND                142
    900 #define WLC_SCB_DEAUTHENTICATE          143
    901 #define WLC_GET_SHORTSLOT           144
    902 #define WLC_GET_SHORTSLOT_OVERRIDE      145
    903 #define WLC_SET_SHORTSLOT_OVERRIDE      146
    904 #define WLC_GET_SHORTSLOT_RESTRICT      147
    905 #define WLC_SET_SHORTSLOT_RESTRICT      148
    906 #define WLC_GET_GMODE_PROTECTION        149
    907 #define WLC_GET_GMODE_PROTECTION_OVERRIDE   150
    908 #define WLC_SET_GMODE_PROTECTION_OVERRIDE   151
    909 #define WLC_UPGRADE             152
    910 
    911 
    912 #define WLC_GET_IGNORE_BCNS         155
    913 #define WLC_SET_IGNORE_BCNS         156
    914 #define WLC_GET_SCB_TIMEOUT         157
    915 #define WLC_SET_SCB_TIMEOUT         158
    916 #define WLC_GET_ASSOCLIST           159
    917 #define WLC_GET_CLK             160
    918 #define WLC_SET_CLK             161
    919 #define WLC_GET_UP              162
    920 #define WLC_OUT                 163
    921 #define WLC_GET_WPA_AUTH            164
    922 #define WLC_SET_WPA_AUTH            165
    923 #define WLC_GET_UCFLAGS             166
    924 #define WLC_SET_UCFLAGS             167
    925 #define WLC_GET_PWRIDX              168
    926 #define WLC_SET_PWRIDX              169
    927 #define WLC_GET_TSSI                170
    928 #define WLC_GET_SUP_RATESET_OVERRIDE        171
    929 #define WLC_SET_SUP_RATESET_OVERRIDE        172
    930 
    931 
    932 
    933 
    934 
    935 #define WLC_GET_PROTECTION_CONTROL      178
    936 #define WLC_SET_PROTECTION_CONTROL      179
    937 #define WLC_GET_PHYLIST             180
    938 #define WLC_ENCRYPT_STRENGTH            181
    939 #define WLC_DECRYPT_STATUS          182
    940 #define WLC_GET_KEY_SEQ             183
    941 #define WLC_GET_SCAN_CHANNEL_TIME       184
    942 #define WLC_SET_SCAN_CHANNEL_TIME       185
    943 #define WLC_GET_SCAN_UNASSOC_TIME       186
    944 #define WLC_SET_SCAN_UNASSOC_TIME       187
    945 #define WLC_GET_SCAN_HOME_TIME          188
    946 #define WLC_SET_SCAN_HOME_TIME          189
    947 #define WLC_GET_SCAN_NPROBES            190
    948 #define WLC_SET_SCAN_NPROBES            191
    949 #define WLC_GET_PRB_RESP_TIMEOUT        192
    950 #define WLC_SET_PRB_RESP_TIMEOUT        193
    951 #define WLC_GET_ATTEN               194
    952 #define WLC_SET_ATTEN               195
    953 #define WLC_GET_SHMEM               196
    954 #define WLC_SET_SHMEM               197
    955 
    956 
    957 #define WLC_SET_WSEC_TEST           200
    958 #define WLC_SCB_DEAUTHENTICATE_FOR_REASON   201
    959 #define WLC_TKIP_COUNTERMEASURES        202
    960 #define WLC_GET_PIOMODE             203
    961 #define WLC_SET_PIOMODE             204
    962 #define WLC_SET_ASSOC_PREFER            205
    963 #define WLC_GET_ASSOC_PREFER            206
    964 #define WLC_SET_ROAM_PREFER         207
    965 #define WLC_GET_ROAM_PREFER         208
    966 #define WLC_SET_LED             209
    967 #define WLC_GET_LED             210
    968 #define WLC_GET_INTERFERENCE_MODE       211
    969 #define WLC_SET_INTERFERENCE_MODE       212
    970 #define WLC_GET_CHANNEL_QA          213
    971 #define WLC_START_CHANNEL_QA            214
    972 #define WLC_GET_CHANNEL_SEL         215
    973 #define WLC_START_CHANNEL_SEL           216
    974 #define WLC_GET_VALID_CHANNELS          217
    975 #define WLC_GET_FAKEFRAG            218
    976 #define WLC_SET_FAKEFRAG            219
    977 #define WLC_GET_PWROUT_PERCENTAGE       220
    978 #define WLC_SET_PWROUT_PERCENTAGE       221
    979 #define WLC_SET_BAD_FRAME_PREEMPT       222
    980 #define WLC_GET_BAD_FRAME_PREEMPT       223
    981 #define WLC_SET_LEAP_LIST           224
    982 #define WLC_GET_LEAP_LIST           225
    983 #define WLC_GET_CWMIN               226
    984 #define WLC_SET_CWMIN               227
    985 #define WLC_GET_CWMAX               228
    986 #define WLC_SET_CWMAX               229
    987 #define WLC_GET_WET             230
    988 #define WLC_SET_WET             231
    989 #define WLC_GET_PUB             232
    990 
    991 
    992 #define WLC_GET_KEY_PRIMARY         235
    993 #define WLC_SET_KEY_PRIMARY         236
    994 
    995 #define WLC_GET_ACI_ARGS            238
    996 #define WLC_SET_ACI_ARGS            239
    997 #define WLC_UNSET_CALLBACK          240
    998 #define WLC_SET_CALLBACK            241
    999 #define WLC_GET_RADAR               242
   1000 #define WLC_SET_RADAR               243
   1001 #define WLC_SET_SPECT_MANAGMENT         244
   1002 #define WLC_GET_SPECT_MANAGMENT         245
   1003 #define WLC_WDS_GET_REMOTE_HWADDR       246
   1004 #define WLC_WDS_GET_WPA_SUP         247
   1005 #define WLC_SET_CS_SCAN_TIMER           248
   1006 #define WLC_GET_CS_SCAN_TIMER           249
   1007 #define WLC_MEASURE_REQUEST         250
   1008 #define WLC_INIT                251
   1009 #define WLC_SEND_QUIET              252
   1010 #define WLC_KEEPALIVE           253
   1011 #define WLC_SEND_PWR_CONSTRAINT         254
   1012 #define WLC_UPGRADE_STATUS          255
   1013 #define WLC_CURRENT_PWR             256
   1014 #define WLC_GET_SCAN_PASSIVE_TIME       257
   1015 #define WLC_SET_SCAN_PASSIVE_TIME       258
   1016 #define WLC_LEGACY_LINK_BEHAVIOR        259
   1017 #define WLC_GET_CHANNELS_IN_COUNTRY     260
   1018 #define WLC_GET_COUNTRY_LIST            261
   1019 #define WLC_GET_VAR             262
   1020 #define WLC_SET_VAR             263
   1021 #define WLC_NVRAM_GET               264
   1022 #define WLC_NVRAM_SET               265
   1023 #define WLC_NVRAM_DUMP              266
   1024 #define WLC_REBOOT              267
   1025 #define WLC_SET_WSEC_PMK            268
   1026 #define WLC_GET_AUTH_MODE           269
   1027 #define WLC_SET_AUTH_MODE           270
   1028 #define WLC_GET_WAKEENTRY           271
   1029 #define WLC_SET_WAKEENTRY           272
   1030 #define WLC_NDCONFIG_ITEM           273
   1031 #define WLC_NVOTPW              274
   1032 #define WLC_OTPW                275
   1033 #define WLC_IOV_BLOCK_GET           276
   1034 #define WLC_IOV_MODULES_GET         277
   1035 #define WLC_SOFT_RESET              278
   1036 #define WLC_GET_ALLOW_MODE          279
   1037 #define WLC_SET_ALLOW_MODE          280
   1038 #define WLC_GET_DESIRED_BSSID           281
   1039 #define WLC_SET_DESIRED_BSSID           282
   1040 #define WLC_DISASSOC_MYAP           283
   1041 #define WLC_GET_NBANDS              284
   1042 #define WLC_GET_BANDSTATES          285
   1043 #define WLC_GET_WLC_BSS_INFO            286
   1044 #define WLC_GET_ASSOC_INFO          287
   1045 #define WLC_GET_OID_PHY             288
   1046 #define WLC_SET_OID_PHY             289
   1047 #define WLC_SET_ASSOC_TIME          290
   1048 #define WLC_GET_DESIRED_SSID            291
   1049 #define WLC_GET_CHANSPEC            292
   1050 #define WLC_GET_ASSOC_STATE         293
   1051 #define WLC_SET_PHY_STATE           294
   1052 #define WLC_GET_SCAN_PENDING            295
   1053 #define WLC_GET_SCANREQ_PENDING         296
   1054 #define WLC_GET_PREV_ROAM_REASON        297
   1055 #define WLC_SET_PREV_ROAM_REASON        298
   1056 #define WLC_GET_BANDSTATES_PI           299
   1057 #define WLC_GET_PHY_STATE           300
   1058 #define WLC_GET_BSS_WPA_RSN         301
   1059 #define WLC_GET_BSS_WPA2_RSN            302
   1060 #define WLC_GET_BSS_BCN_TS          303
   1061 #define WLC_GET_INT_DISASSOC            304
   1062 #define WLC_SET_NUM_PEERS           305
   1063 #define WLC_GET_NUM_BSS             306
   1064 #define WLC_NPHY_SAMPLE_COLLECT         307
   1065 #define WLC_UM_PRIV             308
   1066 #define WLC_GET_CMD             309
   1067 
   1068 #define WLC_SET_INTERFERENCE_OVERRIDE_MODE  311
   1069 #define WLC_GET_INTERFERENCE_OVERRIDE_MODE  312
   1070 #define WLC_GET_WAI_RESTRICT            313
   1071 #define WLC_SET_WAI_RESTRICT            314
   1072 #define WLC_SET_WAI_REKEY           315
   1073 #define WLC_SET_PEAKRATE            316
   1074 #define WLC_GET_PEAKRATE            317
   1075 #define WLC_LAST                318
   1076 
   1077 #ifndef EPICTRL_COOKIE
   1078 #define EPICTRL_COOKIE      0xABADCEDE
   1079 #endif
   1080 
   1081 
   1082 #define CMN_IOCTL_OFF 0x180
   1083 
   1084 
   1085 
   1086 
   1087 #define WL_OID_BASE     0xFFE41420
   1088 
   1089 
   1090 #define OID_WL_GETINSTANCE  (WL_OID_BASE + WLC_GET_INSTANCE)
   1091 #define OID_WL_GET_FORCELINK    (WL_OID_BASE + WLC_GET_FORCELINK)
   1092 #define OID_WL_SET_FORCELINK    (WL_OID_BASE + WLC_SET_FORCELINK)
   1093 #define OID_WL_ENCRYPT_STRENGTH (WL_OID_BASE + WLC_ENCRYPT_STRENGTH)
   1094 #define OID_WL_DECRYPT_STATUS   (WL_OID_BASE + WLC_DECRYPT_STATUS)
   1095 #define OID_LEGACY_LINK_BEHAVIOR (WL_OID_BASE + WLC_LEGACY_LINK_BEHAVIOR)
   1096 #define OID_WL_NDCONFIG_ITEM    (WL_OID_BASE + WLC_NDCONFIG_ITEM)
   1097 
   1098 
   1099 #define OID_STA_CHANSPEC    (WL_OID_BASE + WLC_GET_CHANSPEC)
   1100 #define OID_STA_NBANDS      (WL_OID_BASE + WLC_GET_NBANDS)
   1101 #define OID_STA_GET_PHY     (WL_OID_BASE + WLC_GET_OID_PHY)
   1102 #define OID_STA_SET_PHY     (WL_OID_BASE + WLC_SET_OID_PHY)
   1103 #define OID_STA_ASSOC_TIME  (WL_OID_BASE + WLC_SET_ASSOC_TIME)
   1104 #define OID_STA_DESIRED_SSID    (WL_OID_BASE + WLC_GET_DESIRED_SSID)
   1105 #define OID_STA_SET_PHY_STATE   (WL_OID_BASE + WLC_SET_PHY_STATE)
   1106 #define OID_STA_SCAN_PENDING    (WL_OID_BASE + WLC_GET_SCAN_PENDING)
   1107 #define OID_STA_SCANREQ_PENDING (WL_OID_BASE + WLC_GET_SCANREQ_PENDING)
   1108 #define OID_STA_GET_ROAM_REASON (WL_OID_BASE + WLC_GET_PREV_ROAM_REASON)
   1109 #define OID_STA_SET_ROAM_REASON (WL_OID_BASE + WLC_SET_PREV_ROAM_REASON)
   1110 #define OID_STA_GET_PHY_STATE   (WL_OID_BASE + WLC_GET_PHY_STATE)
   1111 #define OID_STA_INT_DISASSOC    (WL_OID_BASE + WLC_GET_INT_DISASSOC)
   1112 #define OID_STA_SET_NUM_PEERS   (WL_OID_BASE + WLC_SET_NUM_PEERS)
   1113 #define OID_STA_GET_NUM_BSS (WL_OID_BASE + WLC_GET_NUM_BSS)
   1114 
   1115 #define WL_DECRYPT_STATUS_SUCCESS   1
   1116 #define WL_DECRYPT_STATUS_FAILURE   2
   1117 #define WL_DECRYPT_STATUS_UNKNOWN   3
   1118 
   1119 
   1120 #define WLC_UPGRADE_SUCCESS         0
   1121 #define WLC_UPGRADE_PENDING         1
   1122 
   1123 #ifdef CONFIG_USBRNDIS_RETAIL
   1124 
   1125 typedef struct {
   1126 	char *name;
   1127 	void *param;
   1128 } ndconfig_item_t;
   1129 #endif
   1130 
   1131 
   1132 
   1133 #define WL_AUTH_OPEN_SYSTEM     0
   1134 #define WL_AUTH_SHARED_KEY      1
   1135 #define WL_AUTH_OPEN_SHARED     2
   1136 
   1137 
   1138 #define WL_RADIO_SW_DISABLE     (1<<0)
   1139 #define WL_RADIO_HW_DISABLE     (1<<1)
   1140 #define WL_RADIO_MPC_DISABLE        (1<<2)
   1141 #define WL_RADIO_COUNTRY_DISABLE    (1<<3)
   1142 
   1143 #define WL_SPURAVOID_OFF    0
   1144 #define WL_SPURAVOID_ON1    1
   1145 #define WL_SPURAVOID_ON2    2
   1146 
   1147 
   1148 #define WL_TXPWR_OVERRIDE   (1U<<31)
   1149 #define WL_TXPWR_NEG   (1U<<30)
   1150 
   1151 #define WL_PHY_PAVARS_LEN   6
   1152 
   1153 #define WL_PHY_PAVARS2_NUM	3
   1154 #define WL_PHY_PAVAR_VER	1
   1155 typedef struct wl_pavars2 {
   1156 	uint16 ver;
   1157 	uint16 len;
   1158 	uint16 inuse;
   1159 	uint16 phy_type;
   1160 	uint16 bandrange;
   1161 	uint16 chain;
   1162 	uint16 inpa[WL_PHY_PAVARS2_NUM];
   1163 } wl_pavars2_t;
   1164 
   1165 typedef struct wl_po {
   1166 	uint16  phy_type;
   1167 	uint16  band;
   1168 	uint16  cckpo;
   1169 	uint32  ofdmpo;
   1170 	uint16  mcspo[8];
   1171 } wl_po_t;
   1172 
   1173 
   1174 #define WLC_TXPWR_MAX       (127)
   1175 
   1176 
   1177 #define WL_DIAG_INTERRUPT           1
   1178 #define WL_DIAG_LOOPBACK            2
   1179 #define WL_DIAG_MEMORY              3
   1180 #define WL_DIAG_LED             4
   1181 #define WL_DIAG_REG             5
   1182 #define WL_DIAG_SROM                6
   1183 #define WL_DIAG_DMA             7
   1184 
   1185 #define WL_DIAGERR_SUCCESS          0
   1186 #define WL_DIAGERR_FAIL_TO_RUN          1
   1187 #define WL_DIAGERR_NOT_SUPPORTED        2
   1188 #define WL_DIAGERR_INTERRUPT_FAIL       3
   1189 #define WL_DIAGERR_LOOPBACK_FAIL        4
   1190 #define WL_DIAGERR_SROM_FAIL            5
   1191 #define WL_DIAGERR_SROM_BADCRC          6
   1192 #define WL_DIAGERR_REG_FAIL         7
   1193 #define WL_DIAGERR_MEMORY_FAIL          8
   1194 #define WL_DIAGERR_NOMEM            9
   1195 #define WL_DIAGERR_DMA_FAIL         10
   1196 
   1197 #define WL_DIAGERR_MEMORY_TIMEOUT       11
   1198 #define WL_DIAGERR_MEMORY_BADPATTERN        12
   1199 
   1200 
   1201 #define WLC_BAND_AUTO       0
   1202 #define WLC_BAND_5G     1
   1203 #define WLC_BAND_2G     2
   1204 #define WLC_BAND_ALL        3
   1205 
   1206 
   1207 #define WL_CHAN_FREQ_RANGE_2G      0
   1208 #define WL_CHAN_FREQ_RANGE_5GL     1
   1209 #define WL_CHAN_FREQ_RANGE_5GM     2
   1210 #define WL_CHAN_FREQ_RANGE_5GH     3
   1211 
   1212 #define WL_CHAN_FREQ_RANGE_5GLL_VER2    4
   1213 #define WL_CHAN_FREQ_RANGE_5GLH_VER2    5
   1214 #define WL_CHAN_FREQ_RANGE_5GML_VER2    6
   1215 #define WL_CHAN_FREQ_RANGE_5GMH_VER2    7
   1216 #define WL_CHAN_FREQ_RANGE_5GH_VER2     8
   1217 
   1218 
   1219 #define WLC_PHY_TYPE_A      0
   1220 #define WLC_PHY_TYPE_B      1
   1221 #define WLC_PHY_TYPE_G      2
   1222 #define WLC_PHY_TYPE_N      4
   1223 #define WLC_PHY_TYPE_LP     5
   1224 #define WLC_PHY_TYPE_SSN    6
   1225 #define WLC_PHY_TYPE_HT     7
   1226 #define WLC_PHY_TYPE_LCN    8
   1227 #define WLC_PHY_TYPE_NULL   0xf
   1228 
   1229 
   1230 #define WLC_MACMODE_DISABLED    0
   1231 #define WLC_MACMODE_DENY    1
   1232 #define WLC_MACMODE_ALLOW   2
   1233 
   1234 
   1235 #define GMODE_LEGACY_B      0
   1236 #define GMODE_AUTO      1
   1237 #define GMODE_ONLY      2
   1238 #define GMODE_B_DEFERRED    3
   1239 #define GMODE_PERFORMANCE   4
   1240 #define GMODE_LRS       5
   1241 #define GMODE_MAX       6
   1242 
   1243 
   1244 #define WLC_PLCP_AUTO   -1
   1245 #define WLC_PLCP_SHORT  0
   1246 #define WLC_PLCP_LONG   1
   1247 
   1248 
   1249 #define WLC_PROTECTION_AUTO     -1
   1250 #define WLC_PROTECTION_OFF      0
   1251 #define WLC_PROTECTION_ON       1
   1252 #define WLC_PROTECTION_MMHDR_ONLY   2
   1253 #define WLC_PROTECTION_CTS_ONLY     3
   1254 
   1255 
   1256 #define WLC_PROTECTION_CTL_OFF      0
   1257 #define WLC_PROTECTION_CTL_LOCAL    1
   1258 #define WLC_PROTECTION_CTL_OVERLAP  2
   1259 
   1260 
   1261 #define WLC_N_PROTECTION_OFF        0
   1262 #define WLC_N_PROTECTION_OPTIONAL   1
   1263 #define WLC_N_PROTECTION_20IN40     2
   1264 #define WLC_N_PROTECTION_MIXEDMODE  3
   1265 
   1266 
   1267 #define WLC_N_PREAMBLE_MIXEDMODE    0
   1268 #define WLC_N_PREAMBLE_GF       1
   1269 #define WLC_N_PREAMBLE_GF_BRCM          2
   1270 
   1271 
   1272 #define WLC_N_BW_20ALL          0
   1273 #define WLC_N_BW_40ALL          1
   1274 #define WLC_N_BW_20IN2G_40IN5G      2
   1275 
   1276 
   1277 #define WLC_N_TXRX_CHAIN0       0
   1278 #define WLC_N_TXRX_CHAIN1       1
   1279 
   1280 
   1281 #define WLC_N_SGI_20            0x01
   1282 #define WLC_N_SGI_40            0x02
   1283 
   1284 
   1285 #define PM_OFF  0
   1286 #define PM_MAX  1
   1287 #define PM_FAST 2
   1288 
   1289 #define LISTEN_INTERVAL			20
   1290 
   1291 #define INTERFERE_OVRRIDE_OFF   -1
   1292 #define INTERFERE_NONE  0
   1293 #define NON_WLAN    1
   1294 #define WLAN_MANUAL 2
   1295 #define WLAN_AUTO   3
   1296 #define WLAN_AUTO_W_NOISE   4
   1297 #define AUTO_ACTIVE (1 << 7)
   1298 
   1299 typedef struct wl_aci_args {
   1300 	int enter_aci_thresh;
   1301 	int exit_aci_thresh;
   1302 	int usec_spin;
   1303 	int glitch_delay;
   1304 	uint16 nphy_adcpwr_enter_thresh;
   1305 	uint16 nphy_adcpwr_exit_thresh;
   1306 	uint16 nphy_repeat_ctr;
   1307 	uint16 nphy_num_samples;
   1308 	uint16 nphy_undetect_window_sz;
   1309 	uint16 nphy_b_energy_lo_aci;
   1310 	uint16 nphy_b_energy_md_aci;
   1311 	uint16 nphy_b_energy_hi_aci;
   1312 	uint16 nphy_noise_noassoc_glitch_th_up;
   1313 	uint16 nphy_noise_noassoc_glitch_th_dn;
   1314 	uint16 nphy_noise_assoc_glitch_th_up;
   1315 	uint16 nphy_noise_assoc_glitch_th_dn;
   1316 	uint16 nphy_noise_assoc_aci_glitch_th_up;
   1317 	uint16 nphy_noise_assoc_aci_glitch_th_dn;
   1318 	uint16 nphy_noise_assoc_enter_th;
   1319 	uint16 nphy_noise_noassoc_enter_th;
   1320 	uint16 nphy_noise_assoc_rx_glitch_badplcp_enter_th;
   1321 	uint16 nphy_noise_noassoc_crsidx_incr;
   1322 	uint16 nphy_noise_assoc_crsidx_incr;
   1323 	uint16 nphy_noise_crsidx_decr;
   1324 } wl_aci_args_t;
   1325 
   1326 #define TRIGGER_NOW             0
   1327 #define TRIGGER_CRS             0x01
   1328 #define TRIGGER_CRSDEASSERT         0x02
   1329 #define TRIGGER_GOODFCS             0x04
   1330 #define TRIGGER_BADFCS              0x08
   1331 #define TRIGGER_BADPLCP             0x10
   1332 #define TRIGGER_CRSGLITCH           0x20
   1333 #define WL_ACI_ARGS_LEGACY_LENGTH   16
   1334 #define WL_SAMPLECOLLECT_T_VERSION  1
   1335 typedef struct wl_samplecollect_args {
   1336 
   1337 	uint8 coll_us;
   1338 	int cores;
   1339 
   1340 	uint16 version;
   1341 	uint16 length;
   1342 	uint8 trigger;
   1343 	uint16 timeout;
   1344 	uint16 mode;
   1345 	uint32 pre_dur;
   1346 	uint32 post_dur;
   1347 	uint8 gpio_sel;
   1348 	bool downsamp;
   1349 	bool be_deaf;
   1350 	bool agc;
   1351 	bool filter;
   1352 } wl_samplecollect_args_t;
   1353 
   1354 #define WL_SAMPLEDATA_HEADER_TYPE   1
   1355 #define WL_SAMPLEDATA_HEADER_SIZE   80
   1356 #define WL_SAMPLEDATA_TYPE      2
   1357 #define WL_SAMPLEDATA_SEQ       0xff
   1358 #define WL_SAMPLEDATA_MORE_DATA     0x100
   1359 #define WL_SAMPLEDATA_T_VERSION     1
   1360 
   1361 #define WL_SAMPLEDATA_T_VERSION_SPEC_AN 2
   1362 
   1363 typedef struct wl_sampledata {
   1364 	uint16 version;
   1365 	uint16 size;
   1366 	uint16 tag;
   1367 	uint16 length;
   1368 	uint32 flag;
   1369 } wl_sampledata_t;
   1370 
   1371 
   1372 
   1373 #define WL_ERROR_VAL        0x00000001
   1374 #define WL_TRACE_VAL        0x00000002
   1375 #define WL_PRHDRS_VAL       0x00000004
   1376 #define WL_PRPKT_VAL        0x00000008
   1377 #define WL_INFORM_VAL       0x00000010
   1378 #define WL_TMP_VAL      0x00000020
   1379 #define WL_OID_VAL      0x00000040
   1380 #define WL_RATE_VAL     0x00000080
   1381 #define WL_ASSOC_VAL        0x00000100
   1382 #define WL_PRUSR_VAL        0x00000200
   1383 #define WL_PS_VAL       0x00000400
   1384 #define WL_TXPWR_VAL        0x00000800
   1385 #define WL_PORT_VAL     0x00001000
   1386 #define WL_DUAL_VAL     0x00002000
   1387 #define WL_WSEC_VAL     0x00004000
   1388 #define WL_WSEC_DUMP_VAL    0x00008000
   1389 #define WL_LOG_VAL      0x00010000
   1390 #define WL_NRSSI_VAL        0x00020000
   1391 #define WL_LOFT_VAL     0x00040000
   1392 #define WL_REGULATORY_VAL   0x00080000
   1393 #define WL_PHYCAL_VAL       0x00100000
   1394 #define WL_RADAR_VAL        0x00200000
   1395 #define WL_MPC_VAL      0x00400000
   1396 #define WL_APSTA_VAL        0x00800000
   1397 #define WL_DFS_VAL      0x01000000
   1398 #define WL_BA_VAL       0x02000000
   1399 #define WL_ACI_VAL      0x04000000
   1400 #define WL_MBSS_VAL     0x04000000
   1401 #define WL_CAC_VAL      0x08000000
   1402 #define WL_AMSDU_VAL        0x10000000
   1403 #define WL_AMPDU_VAL        0x20000000
   1404 #define WL_FFPLD_VAL        0x40000000
   1405 
   1406 
   1407 #define WL_DPT_VAL      0x00000001
   1408 #define WL_SCAN_VAL     0x00000002
   1409 #define WL_WOWL_VAL     0x00000004
   1410 #define WL_COEX_VAL     0x00000008
   1411 #define WL_RTDC_VAL     0x00000010
   1412 #define WL_PROTO_VAL        0x00000020
   1413 #define WL_BTA_VAL      0x00000040
   1414 #define WL_CHANINT_VAL      0x00000080
   1415 #define WL_THERMAL_VAL      0x00000100
   1416 #define WL_P2P_VAL      0x00000200
   1417 #define WL_TXRX_VAL		0x00000400
   1418 #define WL_MCHAN_VAL            0x00000800
   1419 
   1420 
   1421 #define WL_LED_NUMGPIO      16
   1422 
   1423 
   1424 #define WL_LED_OFF      0
   1425 #define WL_LED_ON       1
   1426 #define WL_LED_ACTIVITY     2
   1427 #define WL_LED_RADIO        3
   1428 #define WL_LED_ARADIO       4
   1429 #define WL_LED_BRADIO       5
   1430 #define WL_LED_BGMODE       6
   1431 #define WL_LED_WI1      7
   1432 #define WL_LED_WI2      8
   1433 #define WL_LED_WI3      9
   1434 #define WL_LED_ASSOC        10
   1435 #define WL_LED_INACTIVE     11
   1436 #define WL_LED_ASSOCACT     12
   1437 #define WL_LED_WI4      13
   1438 #define WL_LED_WI5      14
   1439 #define WL_LED_BLINKSLOW    15
   1440 #define WL_LED_BLINKMED     16
   1441 #define WL_LED_BLINKFAST    17
   1442 #define WL_LED_BLINKCUSTOM  18
   1443 #define WL_LED_BLINKPERIODIC    19
   1444 #define WL_LED_ASSOC_WITH_SEC   20
   1445 
   1446 #define WL_LED_START_OFF    21
   1447 #define WL_LED_NUMBEHAVIOR  22
   1448 
   1449 
   1450 #define WL_LED_BEH_MASK     0x7f
   1451 #define WL_LED_AL_MASK      0x80
   1452 
   1453 
   1454 #define WL_NUMCHANNELS      64
   1455 #define WL_NUMCHANSPECS     100
   1456 
   1457 
   1458 #define WL_WDS_WPA_ROLE_AUTH    0
   1459 #define WL_WDS_WPA_ROLE_SUP 1
   1460 #define WL_WDS_WPA_ROLE_AUTO    255
   1461 
   1462 
   1463 #define WL_EVENTING_MASK_LEN    16
   1464 
   1465 
   1466 
   1467 
   1468 #define WL_JOIN_PREF_RSSI   1
   1469 #define WL_JOIN_PREF_WPA    2
   1470 #define WL_JOIN_PREF_BAND   3
   1471 #define WL_JOIN_PREF_RSSI_DELTA 4
   1472 
   1473 
   1474 #define WLJP_BAND_ASSOC_PREF    255
   1475 
   1476 
   1477 #define WL_WPA_ACP_MCS_ANY  "\x00\x00\x00\x00"
   1478 
   1479 struct tsinfo_arg {
   1480 	uint8 octets[3];
   1481 };
   1482 
   1483 #define NFIFO           6
   1484 
   1485 #define WL_CNT_T_VERSION    6
   1486 
   1487 typedef struct {
   1488 	uint16  version;
   1489 	uint16  length;
   1490 
   1491 
   1492 	uint32  txframe;
   1493 	uint32  txbyte;
   1494 	uint32  txretrans;
   1495 	uint32  txerror;
   1496 	uint32  txctl;
   1497 	uint32  txprshort;
   1498 	uint32  txserr;
   1499 	uint32  txnobuf;
   1500 	uint32  txnoassoc;
   1501 	uint32  txrunt;
   1502 	uint32  txchit;
   1503 	uint32  txcmiss;
   1504 
   1505 
   1506 	uint32  txuflo;
   1507 	uint32  txphyerr;
   1508 	uint32  txphycrs;
   1509 
   1510 
   1511 	uint32  rxframe;
   1512 	uint32  rxbyte;
   1513 	uint32  rxerror;
   1514 	uint32  rxctl;
   1515 	uint32  rxnobuf;
   1516 	uint32  rxnondata;
   1517 	uint32  rxbadds;
   1518 	uint32  rxbadcm;
   1519 	uint32  rxfragerr;
   1520 	uint32  rxrunt;
   1521 	uint32  rxgiant;
   1522 	uint32  rxnoscb;
   1523 	uint32  rxbadproto;
   1524 	uint32  rxbadsrcmac;
   1525 	uint32  rxbadda;
   1526 	uint32  rxfilter;
   1527 
   1528 
   1529 	uint32  rxoflo;
   1530 	uint32  rxuflo[NFIFO];
   1531 
   1532 	uint32  d11cnt_txrts_off;
   1533 	uint32  d11cnt_rxcrc_off;
   1534 	uint32  d11cnt_txnocts_off;
   1535 
   1536 
   1537 	uint32  dmade;
   1538 	uint32  dmada;
   1539 	uint32  dmape;
   1540 	uint32  reset;
   1541 	uint32  tbtt;
   1542 	uint32  txdmawar;
   1543 	uint32  pkt_callback_reg_fail;
   1544 
   1545 
   1546 	uint32  txallfrm;
   1547 	uint32  txrtsfrm;
   1548 	uint32  txctsfrm;
   1549 	uint32  txackfrm;
   1550 	uint32  txdnlfrm;
   1551 	uint32  txbcnfrm;
   1552 	uint32  txfunfl[8];
   1553 	uint32  txtplunfl;
   1554 	uint32  txphyerror;
   1555 	uint32  rxfrmtoolong;
   1556 	uint32  rxfrmtooshrt;
   1557 	uint32  rxinvmachdr;
   1558 	uint32  rxbadfcs;
   1559 	uint32  rxbadplcp;
   1560 	uint32  rxcrsglitch;
   1561 	uint32  rxstrt;
   1562 	uint32  rxdfrmucastmbss;
   1563 	uint32  rxmfrmucastmbss;
   1564 	uint32  rxcfrmucast;
   1565 	uint32  rxrtsucast;
   1566 	uint32  rxctsucast;
   1567 	uint32  rxackucast;
   1568 	uint32  rxdfrmocast;
   1569 	uint32  rxmfrmocast;
   1570 	uint32  rxcfrmocast;
   1571 	uint32  rxrtsocast;
   1572 	uint32  rxctsocast;
   1573 	uint32  rxdfrmmcast;
   1574 	uint32  rxmfrmmcast;
   1575 	uint32  rxcfrmmcast;
   1576 	uint32  rxbeaconmbss;
   1577 	uint32  rxdfrmucastobss;
   1578 	uint32  rxbeaconobss;
   1579 	uint32  rxrsptmout;
   1580 	uint32  bcntxcancl;
   1581 	uint32  rxf0ovfl;
   1582 	uint32  rxf1ovfl;
   1583 	uint32  rxf2ovfl;
   1584 	uint32  txsfovfl;
   1585 	uint32  pmqovfl;
   1586 	uint32  rxcgprqfrm;
   1587 	uint32  rxcgprsqovfl;
   1588 	uint32  txcgprsfail;
   1589 	uint32  txcgprssuc;
   1590 	uint32  prs_timeout;
   1591 	uint32  rxnack;
   1592 	uint32  frmscons;
   1593 	uint32  txnack;
   1594 	uint32  txglitch_nack;
   1595 	uint32  txburst;
   1596 
   1597 
   1598 	uint32  txfrag;
   1599 	uint32  txmulti;
   1600 	uint32  txfail;
   1601 	uint32  txretry;
   1602 	uint32  txretrie;
   1603 	uint32  rxdup;
   1604 	uint32  txrts;
   1605 	uint32  txnocts;
   1606 	uint32  txnoack;
   1607 	uint32  rxfrag;
   1608 	uint32  rxmulti;
   1609 	uint32  rxcrc;
   1610 	uint32  txfrmsnt;
   1611 	uint32  rxundec;
   1612 
   1613 
   1614 	uint32  tkipmicfaill;
   1615 	uint32  tkipcntrmsr;
   1616 	uint32  tkipreplay;
   1617 	uint32  ccmpfmterr;
   1618 	uint32  ccmpreplay;
   1619 	uint32  ccmpundec;
   1620 	uint32  fourwayfail;
   1621 	uint32  wepundec;
   1622 	uint32  wepicverr;
   1623 	uint32  decsuccess;
   1624 	uint32  tkipicverr;
   1625 	uint32  wepexcluded;
   1626 
   1627 	uint32  rxundec_mcst;
   1628 
   1629 
   1630 	uint32  tkipmicfaill_mcst;
   1631 	uint32  tkipcntrmsr_mcst;
   1632 	uint32  tkipreplay_mcst;
   1633 	uint32  ccmpfmterr_mcst;
   1634 	uint32  ccmpreplay_mcst;
   1635 	uint32  ccmpundec_mcst;
   1636 	uint32  fourwayfail_mcst;
   1637 	uint32  wepundec_mcst;
   1638 	uint32  wepicverr_mcst;
   1639 	uint32  decsuccess_mcst;
   1640 	uint32  tkipicverr_mcst;
   1641 	uint32  wepexcluded_mcst;
   1642 
   1643 	uint32  txchanrej;
   1644 	uint32  txexptime;
   1645 	uint32  psmwds;
   1646 	uint32  phywatchdog;
   1647 
   1648 
   1649 	uint32  prq_entries_handled;
   1650 	uint32  prq_undirected_entries;
   1651 	uint32  prq_bad_entries;
   1652 	uint32  atim_suppress_count;
   1653 	uint32  bcn_template_not_ready;
   1654 	uint32  bcn_template_not_ready_done;
   1655 	uint32  late_tbtt_dpc;
   1656 
   1657 
   1658 	uint32  rx1mbps;
   1659 	uint32  rx2mbps;
   1660 	uint32  rx5mbps5;
   1661 	uint32  rx6mbps;
   1662 	uint32  rx9mbps;
   1663 	uint32  rx11mbps;
   1664 	uint32  rx12mbps;
   1665 	uint32  rx18mbps;
   1666 	uint32  rx24mbps;
   1667 	uint32  rx36mbps;
   1668 	uint32  rx48mbps;
   1669 	uint32  rx54mbps;
   1670 	uint32  rx108mbps;
   1671 	uint32  rx162mbps;
   1672 	uint32  rx216mbps;
   1673 	uint32  rx270mbps;
   1674 	uint32  rx324mbps;
   1675 	uint32  rx378mbps;
   1676 	uint32  rx432mbps;
   1677 	uint32  rx486mbps;
   1678 	uint32  rx540mbps;
   1679 
   1680 
   1681 	uint32  pktengrxducast;
   1682 	uint32  pktengrxdmcast;
   1683 
   1684 	uint32  rfdisable;
   1685 	uint32  bphy_rxcrsglitch;
   1686 
   1687 	uint32  txmpdu_sgi;
   1688 	uint32  rxmpdu_sgi;
   1689 	uint32  txmpdu_stbc;
   1690 	uint32  rxmpdu_stbc;
   1691 } wl_cnt_t;
   1692 
   1693 
   1694 #define WL_WME_CNT_VERSION  1
   1695 
   1696 typedef struct {
   1697 	uint32 packets;
   1698 	uint32 bytes;
   1699 } wl_traffic_stats_t;
   1700 
   1701 typedef struct {
   1702 	uint16  version;
   1703 	uint16  length;
   1704 
   1705 	wl_traffic_stats_t tx[AC_COUNT];
   1706 	wl_traffic_stats_t tx_failed[AC_COUNT];
   1707 	wl_traffic_stats_t rx[AC_COUNT];
   1708 	wl_traffic_stats_t rx_failed[AC_COUNT];
   1709 
   1710 	wl_traffic_stats_t forward[AC_COUNT];
   1711 
   1712 	wl_traffic_stats_t tx_expired[AC_COUNT];
   1713 
   1714 } wl_wme_cnt_t;
   1715 
   1716 struct wl_msglevel2 {
   1717 	uint32 low;
   1718 	uint32 high;
   1719 };
   1720 
   1721 
   1722 
   1723 #define WLC_ROAM_TRIGGER_DEFAULT    0
   1724 #define WLC_ROAM_TRIGGER_BANDWIDTH  1
   1725 #define WLC_ROAM_TRIGGER_DISTANCE   2
   1726 #define WLC_ROAM_TRIGGER_AUTO       3
   1727 #define WLC_ROAM_TRIGGER_MAX_VALUE  3
   1728 
   1729 
   1730 #define WPA_AUTH_PFN_ANY	0xffffffff
   1731 
   1732 enum {
   1733 	PFN_LIST_ORDER,
   1734 	PFN_RSSI
   1735 };
   1736 
   1737 enum {
   1738 	DISABLE,
   1739 	ENABLE
   1740 };
   1741 
   1742 enum {
   1743 	OFF_ADAPT,
   1744 	SMART_ADAPT,
   1745 	STRICT_ADAPT
   1746 };
   1747 
   1748 #define SORT_CRITERIA_BIT		0
   1749 #define AUTO_NET_SWITCH_BIT		1
   1750 #define ENABLE_BKGRD_SCAN_BIT	2
   1751 #define IMMEDIATE_SCAN_BIT		3
   1752 #define	AUTO_CONNECT_BIT		4
   1753 #define	ENABLE_BD_SCAN_BIT		5
   1754 #define ENABLE_ADAPTSCAN_BIT	6
   1755 
   1756 #define SORT_CRITERIA_MASK		0x01
   1757 #define AUTO_NET_SWITCH_MASK	0x02
   1758 #define ENABLE_BKGRD_SCAN_MASK	0x04
   1759 #define IMMEDIATE_SCAN_MASK		0x08
   1760 #define	AUTO_CONNECT_MASK		0x10
   1761 #define ENABLE_BD_SCAN_MASK		0x20
   1762 #define ENABLE_ADAPTSCAN_MASK	0xc0
   1763 
   1764 #define PFN_VERSION				2
   1765 #define PFN_SCANRESULT_VERSION	1
   1766 #define MAX_PFN_LIST_COUNT	16
   1767 
   1768 #define PFN_COMPLETE			1
   1769 #define PFN_INCOMPLETE			0
   1770 
   1771 #define DEFAULT_BESTN			2
   1772 #define DEFAULT_MSCAN			0
   1773 #define DEFAULT_REPEAT			10
   1774 #define DEFAULT_EXP				2
   1775 
   1776 
   1777 typedef struct wl_pfn_subnet_info {
   1778 	struct ether_addr BSSID;
   1779 	uint8	channel;
   1780 	uint8	SSID_len;
   1781 	uint8	SSID[32];
   1782 } wl_pfn_subnet_info_t;
   1783 
   1784 typedef struct wl_pfn_net_info {
   1785 	wl_pfn_subnet_info_t pfnsubnet;
   1786 	int16	RSSI;
   1787 	uint16	timestamp;
   1788 } wl_pfn_net_info_t;
   1789 
   1790 typedef struct wl_pfn_scanresults {
   1791 	uint32 version;
   1792 	uint32 status;
   1793 	uint32 count;
   1794 	wl_pfn_net_info_t netinfo[1];
   1795 } wl_pfn_scanresults_t;
   1796 
   1797 
   1798 typedef struct wl_pfn_param {
   1799 	int32 version;
   1800 	int32 scan_freq;
   1801 	int32 lost_network_timeout;
   1802 	int16 flags;
   1803 	int16 rssi_margin;
   1804 	uint8 bestn;
   1805 	uint8 mscan;
   1806 	uint8 repeat;
   1807 	uint8 exp;
   1808 } wl_pfn_param_t;
   1809 
   1810 typedef struct wl_pfn_bssid {
   1811 	struct ether_addr 	macaddr;
   1812 
   1813 	uint16				flags;
   1814 } wl_pfn_bssid_t;
   1815 #define WL_PFN_SUPPRESSFOUND_MASK	0x08
   1816 #define WL_PFN_SUPPRESSLOST_MASK	0x10
   1817 
   1818 typedef struct wl_pfn_cfg {
   1819 	uint32				reporttype;
   1820 	int32				channel_num;
   1821 	uint16				channel_list[WL_NUMCHANNELS];
   1822 } wl_pfn_cfg_t;
   1823 #define WL_PFN_REPORT_ALLNET 	0
   1824 #define WL_PFN_REPORT_SSIDNET 	1
   1825 #define WL_PFN_REPORT_BSSIDNET 	2
   1826 
   1827 typedef struct wl_pfn {
   1828 	wlc_ssid_t		ssid;
   1829 	int32			flags;
   1830 	int32			infra;
   1831 	int32			auth;
   1832 	int32			wpa_auth;
   1833 	int32			wsec;
   1834 } wl_pfn_t;
   1835 #define WL_PFN_HIDDEN_BIT		2
   1836 #define PNO_SCAN_MAX_FW		508*1000
   1837 #define PNO_SCAN_MAX_FW_SEC	PNO_SCAN_MAX_FW/1000
   1838 #define PNO_SCAN_MIN_FW_SEC	10
   1839 #define WL_PFN_HIDDEN_MASK		0x4
   1840 
   1841 
   1842 #define TOE_TX_CSUM_OL      0x00000001
   1843 #define TOE_RX_CSUM_OL      0x00000002
   1844 
   1845 
   1846 #define TOE_ERRTEST_TX_CSUM 0x00000001
   1847 #define TOE_ERRTEST_RX_CSUM 0x00000002
   1848 #define TOE_ERRTEST_RX_CSUM2    0x00000004
   1849 
   1850 struct toe_ol_stats_t {
   1851 
   1852 	uint32 tx_summed;
   1853 
   1854 
   1855 	uint32 tx_iph_fill;
   1856 	uint32 tx_tcp_fill;
   1857 	uint32 tx_udp_fill;
   1858 	uint32 tx_icmp_fill;
   1859 
   1860 
   1861 	uint32 rx_iph_good;
   1862 	uint32 rx_iph_bad;
   1863 	uint32 rx_tcp_good;
   1864 	uint32 rx_tcp_bad;
   1865 	uint32 rx_udp_good;
   1866 	uint32 rx_udp_bad;
   1867 	uint32 rx_icmp_good;
   1868 	uint32 rx_icmp_bad;
   1869 
   1870 
   1871 	uint32 tx_tcp_errinj;
   1872 	uint32 tx_udp_errinj;
   1873 	uint32 tx_icmp_errinj;
   1874 
   1875 
   1876 	uint32 rx_tcp_errinj;
   1877 	uint32 rx_udp_errinj;
   1878 	uint32 rx_icmp_errinj;
   1879 };
   1880 
   1881 
   1882 #define ARP_OL_AGENT        0x00000001
   1883 #define ARP_OL_SNOOP        0x00000002
   1884 #define ARP_OL_HOST_AUTO_REPLY  0x00000004
   1885 #define ARP_OL_PEER_AUTO_REPLY  0x00000008
   1886 
   1887 
   1888 #define ARP_ERRTEST_REPLY_PEER  0x1
   1889 #define ARP_ERRTEST_REPLY_HOST  0x2
   1890 
   1891 #define ARP_MULTIHOMING_MAX 8
   1892 
   1893 
   1894 struct arp_ol_stats_t {
   1895 	uint32  host_ip_entries;
   1896 	uint32  host_ip_overflow;
   1897 
   1898 	uint32  arp_table_entries;
   1899 	uint32  arp_table_overflow;
   1900 
   1901 	uint32  host_request;
   1902 	uint32  host_reply;
   1903 	uint32  host_service;
   1904 
   1905 	uint32  peer_request;
   1906 	uint32  peer_request_drop;
   1907 	uint32  peer_reply;
   1908 	uint32  peer_reply_drop;
   1909 	uint32  peer_service;
   1910 };
   1911 
   1912 
   1913 
   1914 
   1915 typedef struct wl_keep_alive_pkt {
   1916 	uint32  period_msec;
   1917 	uint16  len_bytes;
   1918 	uint8   data[1];
   1919 } wl_keep_alive_pkt_t;
   1920 
   1921 #define WL_KEEP_ALIVE_FIXED_LEN     OFFSETOF(wl_keep_alive_pkt_t, data)
   1922 
   1923 
   1924 
   1925 
   1926 typedef enum wl_pkt_filter_type {
   1927 	WL_PKT_FILTER_TYPE_PATTERN_MATCH
   1928 } wl_pkt_filter_type_t;
   1929 
   1930 #define WL_PKT_FILTER_TYPE wl_pkt_filter_type_t
   1931 
   1932 
   1933 typedef struct wl_pkt_filter_pattern {
   1934 	uint32  offset;
   1935 	uint32  size_bytes;
   1936 	uint8   mask_and_pattern[1];
   1937 } wl_pkt_filter_pattern_t;
   1938 
   1939 
   1940 typedef struct wl_pkt_filter {
   1941 	uint32  id;
   1942 	uint32  type;
   1943 	uint32  negate_match;
   1944 	union {
   1945 		wl_pkt_filter_pattern_t pattern;
   1946 	} u;
   1947 } wl_pkt_filter_t;
   1948 
   1949 #define WL_PKT_FILTER_FIXED_LEN       OFFSETOF(wl_pkt_filter_t, u)
   1950 #define WL_PKT_FILTER_PATTERN_FIXED_LEN   OFFSETOF(wl_pkt_filter_pattern_t, mask_and_pattern)
   1951 
   1952 
   1953 typedef struct wl_pkt_filter_enable {
   1954 	uint32  id;
   1955 	uint32  enable;
   1956 } wl_pkt_filter_enable_t;
   1957 
   1958 
   1959 typedef struct wl_pkt_filter_list {
   1960 	uint32  num;
   1961 	wl_pkt_filter_t filter[1];
   1962 } wl_pkt_filter_list_t;
   1963 
   1964 #define WL_PKT_FILTER_LIST_FIXED_LEN      OFFSETOF(wl_pkt_filter_list_t, filter)
   1965 
   1966 
   1967 typedef struct wl_pkt_filter_stats {
   1968 	uint32  num_pkts_matched;
   1969 	uint32  num_pkts_forwarded;
   1970 	uint32  num_pkts_discarded;
   1971 } wl_pkt_filter_stats_t;
   1972 
   1973 
   1974 typedef struct wl_seq_cmd_ioctl {
   1975 	uint32 cmd;
   1976 	uint32 len;
   1977 } wl_seq_cmd_ioctl_t;
   1978 
   1979 #define WL_SEQ_CMD_ALIGN_BYTES  4
   1980 
   1981 
   1982 #define WL_SEQ_CMDS_GET_IOCTL_FILTER(cmd) \
   1983 	(((cmd) == WLC_GET_MAGIC) || \
   1984 	 ((cmd) == WLC_GET_VERSION) || \
   1985 	 ((cmd) == WLC_GET_AP) || \
   1986 	 ((cmd) == WLC_GET_INSTANCE))
   1987 
   1988 
   1989 
   1990 #define WL_PKTENG_PER_TX_START          0x01
   1991 #define WL_PKTENG_PER_TX_STOP           0x02
   1992 #define WL_PKTENG_PER_RX_START          0x04
   1993 #define WL_PKTENG_PER_RX_WITH_ACK_START     0x05
   1994 #define WL_PKTENG_PER_TX_WITH_ACK_START     0x06
   1995 #define WL_PKTENG_PER_RX_STOP           0x08
   1996 #define WL_PKTENG_PER_MASK          0xff
   1997 
   1998 #define WL_PKTENG_SYNCHRONOUS           0x100
   1999 
   2000 typedef struct wl_pkteng {
   2001 	uint32 flags;
   2002 	uint32 delay;
   2003 	uint32 nframes;
   2004 	uint32 length;
   2005 	uint8  seqno;
   2006 	struct ether_addr dest;
   2007 	struct ether_addr src;
   2008 } wl_pkteng_t;
   2009 
   2010 #define NUM_80211b_RATES    4
   2011 #define NUM_80211ag_RATES   8
   2012 #define NUM_80211n_RATES    32
   2013 #define NUM_80211_RATES     (NUM_80211b_RATES+NUM_80211ag_RATES+NUM_80211n_RATES)
   2014 typedef struct wl_pkteng_stats {
   2015 	uint32 lostfrmcnt;
   2016 	int32 rssi;
   2017 	int32 snr;
   2018 	uint16 rxpktcnt[NUM_80211_RATES+1];
   2019 } wl_pkteng_stats_t;
   2020 
   2021 
   2022 #define WL_WOWL_MAGIC   (1 << 0)
   2023 #define WL_WOWL_NET (1 << 1)
   2024 #define WL_WOWL_DIS (1 << 2)
   2025 #define WL_WOWL_RETR    (1 << 3)
   2026 #define WL_WOWL_BCN (1 << 4)
   2027 #define WL_WOWL_TST (1 << 5)
   2028 #define WL_WOWL_M1      (1 << 6)
   2029 #define WL_WOWL_EAPID   (1 << 7)
   2030 #define WL_WOWL_KEYROT  (1 << 14)
   2031 #define WL_WOWL_BCAST   (1 << 15)
   2032 
   2033 #define MAGIC_PKT_MINLEN 102
   2034 
   2035 typedef struct {
   2036 	uint masksize;
   2037 	uint offset;
   2038 	uint patternoffset;
   2039 	uint patternsize;
   2040 	ulong id;
   2041 
   2042 
   2043 } wl_wowl_pattern_t;
   2044 
   2045 typedef struct {
   2046 	uint            count;
   2047 	wl_wowl_pattern_t   pattern[1];
   2048 } wl_wowl_pattern_list_t;
   2049 
   2050 typedef struct {
   2051 	uint8   pci_wakeind;
   2052 	uint16  ucode_wakeind;
   2053 } wl_wowl_wakeind_t;
   2054 
   2055 
   2056 typedef struct wl_txrate_class {
   2057 	uint8       init_rate;
   2058 	uint8       min_rate;
   2059 	uint8       max_rate;
   2060 } wl_txrate_class_t;
   2061 
   2062 
   2063 
   2064 
   2065 #define WLC_OBSS_SCAN_PASSIVE_DWELL_DEFAULT     20
   2066 #define WLC_OBSS_SCAN_PASSIVE_DWELL_MIN         5
   2067 #define WLC_OBSS_SCAN_PASSIVE_DWELL_MAX         1000
   2068 #define WLC_OBSS_SCAN_ACTIVE_DWELL_DEFAULT      10
   2069 #define WLC_OBSS_SCAN_ACTIVE_DWELL_MIN          10
   2070 #define WLC_OBSS_SCAN_ACTIVE_DWELL_MAX          1000
   2071 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_DEFAULT    300
   2072 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_MIN        10
   2073 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_MAX        900
   2074 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_DEFAULT  5
   2075 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_MIN  5
   2076 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_MAX  100
   2077 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_DEFAULT 200
   2078 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_MIN 200
   2079 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_MAX 10000
   2080 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_DEFAULT  20
   2081 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_MIN  20
   2082 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_MAX  10000
   2083 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_DEFAULT    25
   2084 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_MIN        0
   2085 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_MAX        100
   2086 
   2087 
   2088 typedef struct wl_obss_scan_arg {
   2089 	int16   passive_dwell;
   2090 	int16   active_dwell;
   2091 	int16   bss_widthscan_interval;
   2092 	int16   passive_total;
   2093 	int16   active_total;
   2094 	int16   chanwidth_transition_delay;
   2095 	int16   activity_threshold;
   2096 } wl_obss_scan_arg_t;
   2097 
   2098 #define WL_OBSS_SCAN_PARAM_LEN  sizeof(wl_obss_scan_arg_t)
   2099 #define WL_MIN_NUM_OBSS_SCAN_ARG 7
   2100 
   2101 #define WL_COEX_INFO_MASK       0x07
   2102 #define WL_COEX_INFO_REQ        0x01
   2103 #define WL_COEX_40MHZ_INTOLERANT    0x02
   2104 #define WL_COEX_WIDTH20         0x04
   2105 
   2106 #define WLC_RSSI_INVALID     0
   2107 
   2108 #define MAX_RSSI_LEVELS 8
   2109 
   2110 
   2111 typedef struct wl_rssi_event {
   2112 	uint32 rate_limit_msec;
   2113 	uint8 num_rssi_levels;
   2114 	int8 rssi_levels[MAX_RSSI_LEVELS];
   2115 } wl_rssi_event_t;
   2116 
   2117 typedef struct wl_action_obss_coex_req {
   2118 	uint8 info;
   2119 	uint8 num;
   2120 	uint8 ch_list[1];
   2121 } wl_action_obss_coex_req_t;
   2122 
   2123 
   2124 #define EXTLOG_CUR_VER      0x0100
   2125 
   2126 #define MAX_ARGSTR_LEN      18
   2127 
   2128 
   2129 #define LOG_MODULE_COMMON   0x0001
   2130 #define LOG_MODULE_ASSOC    0x0002
   2131 #define LOG_MODULE_EVENT    0x0004
   2132 #define LOG_MODULE_MAX      3
   2133 
   2134 
   2135 #define WL_LOG_LEVEL_DISABLE    0
   2136 #define WL_LOG_LEVEL_ERR    1
   2137 #define WL_LOG_LEVEL_WARN   2
   2138 #define WL_LOG_LEVEL_INFO   3
   2139 #define WL_LOG_LEVEL_MAX    WL_LOG_LEVEL_INFO
   2140 
   2141 
   2142 #define LOG_FLAG_EVENT      1
   2143 
   2144 
   2145 #define LOG_ARGTYPE_NULL    0
   2146 #define LOG_ARGTYPE_STR     1
   2147 #define LOG_ARGTYPE_INT     2
   2148 #define LOG_ARGTYPE_INT_STR 3
   2149 #define LOG_ARGTYPE_STR_INT 4
   2150 
   2151 typedef struct wlc_extlog_cfg {
   2152 	int max_number;
   2153 	uint16 module;
   2154 	uint8 level;
   2155 	uint8 flag;
   2156 	uint16 version;
   2157 } wlc_extlog_cfg_t;
   2158 
   2159 typedef struct log_record {
   2160 	uint32 time;
   2161 	uint16 module;
   2162 	uint16 id;
   2163 	uint8 level;
   2164 	uint8 sub_unit;
   2165 	uint8 seq_num;
   2166 	int32 arg;
   2167 	char str[MAX_ARGSTR_LEN];
   2168 } log_record_t;
   2169 
   2170 typedef struct wlc_extlog_req {
   2171 	uint32 from_last;
   2172 	uint32 num;
   2173 } wlc_extlog_req_t;
   2174 
   2175 typedef struct wlc_extlog_results {
   2176 	uint16 version;
   2177 	uint16 record_len;
   2178 	uint32 num;
   2179 	log_record_t logs[1];
   2180 } wlc_extlog_results_t;
   2181 
   2182 typedef struct log_idstr {
   2183 	uint16  id;
   2184 	uint16  flag;
   2185 	uint8   arg_type;
   2186 	const char  *fmt_str;
   2187 } log_idstr_t;
   2188 
   2189 #define FMTSTRF_USER        1
   2190 
   2191 
   2192 typedef enum {
   2193 	FMTSTR_DRIVER_UP_ID = 0,
   2194 	FMTSTR_DRIVER_DOWN_ID = 1,
   2195 	FMTSTR_SUSPEND_MAC_FAIL_ID = 2,
   2196 	FMTSTR_NO_PROGRESS_ID = 3,
   2197 	FMTSTR_RFDISABLE_ID = 4,
   2198 	FMTSTR_REG_PRINT_ID = 5,
   2199 	FMTSTR_EXPTIME_ID = 6,
   2200 	FMTSTR_JOIN_START_ID = 7,
   2201 	FMTSTR_JOIN_COMPLETE_ID = 8,
   2202 	FMTSTR_NO_NETWORKS_ID = 9,
   2203 	FMTSTR_SECURITY_MISMATCH_ID = 10,
   2204 	FMTSTR_RATE_MISMATCH_ID = 11,
   2205 	FMTSTR_AP_PRUNED_ID = 12,
   2206 	FMTSTR_KEY_INSERTED_ID = 13,
   2207 	FMTSTR_DEAUTH_ID = 14,
   2208 	FMTSTR_DISASSOC_ID = 15,
   2209 	FMTSTR_LINK_UP_ID = 16,
   2210 	FMTSTR_LINK_DOWN_ID = 17,
   2211 	FMTSTR_RADIO_HW_OFF_ID = 18,
   2212 	FMTSTR_RADIO_HW_ON_ID = 19,
   2213 	FMTSTR_EVENT_DESC_ID = 20,
   2214 	FMTSTR_PNP_SET_POWER_ID = 21,
   2215 	FMTSTR_RADIO_SW_OFF_ID = 22,
   2216 	FMTSTR_RADIO_SW_ON_ID = 23,
   2217 	FMTSTR_PWD_MISMATCH_ID = 24,
   2218 	FMTSTR_FATAL_ERROR_ID = 25,
   2219 	FMTSTR_AUTH_FAIL_ID = 26,
   2220 	FMTSTR_ASSOC_FAIL_ID = 27,
   2221 	FMTSTR_IBSS_FAIL_ID = 28,
   2222 	FMTSTR_EXTAP_FAIL_ID = 29,
   2223 	FMTSTR_MAX_ID
   2224 } log_fmtstr_id_t;
   2225 
   2226 #ifdef DONGLEOVERLAYS
   2227 typedef struct {
   2228 	uint32 flags_idx;
   2229 	uint32 offset;
   2230 	uint32 len;
   2231 
   2232 } wl_ioctl_overlay_t;
   2233 
   2234 #define OVERLAY_IDX_MASK		0x000000ff
   2235 #define OVERLAY_IDX_SHIFT		0
   2236 #define OVERLAY_FLAGS_MASK		0xffffff00
   2237 #define OVERLAY_FLAGS_SHIFT		8
   2238 
   2239 #define OVERLAY_FLAG_POSTLOAD	0x100
   2240 
   2241 #define OVERLAY_FLAG_DEFER_DL	0x200
   2242 
   2243 #define OVERLAY_FLAG_PRESLEEP	0x400
   2244 
   2245 #define OVERLAY_DOWNLOAD_CHUNKSIZE	1024
   2246 #endif
   2247 
   2248 
   2249 #include <packed_section_end.h>
   2250 
   2251 
   2252 #include <packed_section_start.h>
   2253 
   2254 #define VNDR_IE_CMD_LEN     4
   2255 
   2256 
   2257 #define VNDR_IE_BEACON_FLAG 0x1
   2258 #define VNDR_IE_PRBRSP_FLAG 0x2
   2259 #define VNDR_IE_ASSOCRSP_FLAG   0x4
   2260 #define VNDR_IE_AUTHRSP_FLAG    0x8
   2261 #define VNDR_IE_PRBREQ_FLAG 0x10
   2262 #define VNDR_IE_ASSOCREQ_FLAG   0x20
   2263 #define VNDR_IE_CUSTOM_FLAG 0x100
   2264 
   2265 #define VNDR_IE_INFO_HDR_LEN    (sizeof(uint32))
   2266 
   2267 typedef BWL_PRE_PACKED_STRUCT struct {
   2268 	uint32 pktflag;
   2269 	vndr_ie_t vndr_ie_data;
   2270 } BWL_POST_PACKED_STRUCT vndr_ie_info_t;
   2271 
   2272 typedef BWL_PRE_PACKED_STRUCT struct {
   2273 	int iecount;
   2274 	vndr_ie_info_t vndr_ie_list[1];
   2275 } BWL_POST_PACKED_STRUCT vndr_ie_buf_t;
   2276 
   2277 typedef BWL_PRE_PACKED_STRUCT struct {
   2278 	char cmd[VNDR_IE_CMD_LEN];
   2279 	vndr_ie_buf_t vndr_ie_buffer;
   2280 } BWL_POST_PACKED_STRUCT vndr_ie_setbuf_t;
   2281 
   2282 
   2283 
   2284 typedef BWL_PRE_PACKED_STRUCT struct sta_prbreq_wps_ie_hdr {
   2285 	struct ether_addr staAddr;
   2286 	uint16 ieLen;
   2287 } BWL_POST_PACKED_STRUCT sta_prbreq_wps_ie_hdr_t;
   2288 
   2289 typedef BWL_PRE_PACKED_STRUCT struct sta_prbreq_wps_ie_data {
   2290 	sta_prbreq_wps_ie_hdr_t hdr;
   2291 	uint8 ieData[1];
   2292 } BWL_POST_PACKED_STRUCT sta_prbreq_wps_ie_data_t;
   2293 
   2294 typedef BWL_PRE_PACKED_STRUCT struct sta_prbreq_wps_ie_list {
   2295 	uint32 totLen;
   2296 	uint8 ieDataList[1];
   2297 } BWL_POST_PACKED_STRUCT sta_prbreq_wps_ie_list_t;
   2298 
   2299 
   2300 #ifdef WLMEDIA_TXFAILEVENT
   2301 typedef BWL_PRE_PACKED_STRUCT struct {
   2302 	char   dest[ETHER_ADDR_LEN];
   2303 	uint8  prio;
   2304 	uint8  flags;
   2305 	uint32 tsf_l;
   2306 	uint32 tsf_h;
   2307 	uint16 rates;
   2308 	uint16 txstatus;
   2309 } BWL_POST_PACKED_STRUCT txfailinfo_t;
   2310 #endif
   2311 
   2312 #include <packed_section_end.h>
   2313 
   2314 
   2315 #define ASSERTLOG_CUR_VER   0x0100
   2316 #define MAX_ASSRTSTR_LEN    64
   2317 
   2318 typedef struct assert_record {
   2319 	uint32 time;
   2320 	uint8 seq_num;
   2321 	char str[MAX_ASSRTSTR_LEN];
   2322 } assert_record_t;
   2323 
   2324 typedef struct assertlog_results {
   2325 	uint16 version;
   2326 	uint16 record_len;
   2327 	uint32 num;
   2328 	assert_record_t logs[1];
   2329 } assertlog_results_t;
   2330 
   2331 #define LOGRRC_FIX_LEN  8
   2332 #define IOBUF_ALLOWED_NUM_OF_LOGREC(type, len) ((len - LOGRRC_FIX_LEN)/sizeof(type))
   2333 
   2334 
   2335 
   2336 
   2337 
   2338 #define CHANIM_DISABLE  0
   2339 #define CHANIM_DETECT   1
   2340 #define CHANIM_ACT  2
   2341 #define CHANIM_MODE_MAX 2
   2342 
   2343 
   2344 #define APCS_IOCTL      1
   2345 #define APCS_CHANIM     2
   2346 #define APCS_CSTIMER    3
   2347 #define APCS_BTA        4
   2348 
   2349 
   2350 #define CHANIM_ACS_RECORD           10
   2351 
   2352 
   2353 typedef struct {
   2354 	bool valid;
   2355 	uint8 trigger;
   2356 	chanspec_t selected_chspc;
   2357 	uint32 glitch_cnt;
   2358 	uint8 ccastats;
   2359 	uint timestamp;
   2360 } chanim_acs_record_t;
   2361 
   2362 typedef struct {
   2363 	chanim_acs_record_t acs_record[CHANIM_ACS_RECORD];
   2364 	uint8 count;
   2365 	uint timestamp;
   2366 } wl_acs_record_t;
   2367 
   2368 
   2369 
   2370 #define SMFS_VERSION 1
   2371 
   2372 typedef struct wl_smfs_elem {
   2373 	uint32 count;
   2374 	uint16 code;
   2375 } wl_smfs_elem_t;
   2376 
   2377 typedef struct wl_smf_stats {
   2378 	uint32 version;
   2379 	uint16 length;
   2380 	uint8 type;
   2381 	uint8 codetype;
   2382 	uint32 ignored_cnt;
   2383 	uint32 malformed_cnt;
   2384 	uint32 count_total;
   2385 	wl_smfs_elem_t elem[1];
   2386 } wl_smf_stats_t;
   2387 
   2388 #define WL_SMFSTATS_FIXED_LEN OFFSETOF(wl_smf_stats_t, elem);
   2389 
   2390 enum {
   2391 	SMFS_CODETYPE_SC,
   2392 	SMFS_CODETYPE_RC
   2393 };
   2394 
   2395 
   2396 #define SMFS_CODE_MALFORMED 0xFFFE
   2397 #define SMFS_CODE_IGNORED   0xFFFD
   2398 
   2399 typedef enum smfs_type {
   2400 	SMFS_TYPE_AUTH,
   2401 	SMFS_TYPE_ASSOC,
   2402 	SMFS_TYPE_REASSOC,
   2403 	SMFS_TYPE_DISASSOC_TX,
   2404 	SMFS_TYPE_DISASSOC_RX,
   2405 	SMFS_TYPE_DEAUTH_TX,
   2406 	SMFS_TYPE_DEAUTH_RX,
   2407 	SMFS_TYPE_MAX
   2408 } smfs_type_t;
   2409 
   2410 #ifdef PHYMON
   2411 
   2412 #define PHYMON_VERSION 1
   2413 
   2414 typedef struct wl_phycal_core_state {
   2415 
   2416 	int16 tx_iqlocal_a;
   2417 	int16 tx_iqlocal_b;
   2418 	int8 tx_iqlocal_ci;
   2419 	int8 tx_iqlocal_cq;
   2420 	int8 tx_iqlocal_di;
   2421 	int8 tx_iqlocal_dq;
   2422 	int8 tx_iqlocal_ei;
   2423 	int8 tx_iqlocal_eq;
   2424 	int8 tx_iqlocal_fi;
   2425 	int8 tx_iqlocal_fq;
   2426 
   2427 
   2428 	int16 rx_iqcal_a;
   2429 	int16 rx_iqcal_b;
   2430 
   2431 	uint8 tx_iqlocal_pwridx;
   2432 	uint32 papd_epsilon_table[64];
   2433 	int16 papd_epsilon_offset;
   2434 	uint8 curr_tx_pwrindex;
   2435 	int8 idle_tssi;
   2436 	int8 est_tx_pwr;
   2437 	int8 est_rx_pwr;
   2438 	uint16 rx_gaininfo;
   2439 	uint16 init_gaincode;
   2440 	int8 estirr_tx;
   2441 	int8 estirr_rx;
   2442 
   2443 } wl_phycal_core_state_t;
   2444 
   2445 typedef struct wl_phycal_state {
   2446 	int version;
   2447 	int8 num_phy_cores;
   2448 	int8 curr_temperature;
   2449 	chanspec_t chspec;
   2450 	bool aci_state;
   2451 	uint16 crsminpower;
   2452 	uint16 crsminpowerl;
   2453 	uint16 crsminpoweru;
   2454 	wl_phycal_core_state_t phycal_core[1];
   2455 } wl_phycal_state_t;
   2456 
   2457 #define WL_PHYCAL_STAT_FIXED_LEN OFFSETOF(wl_phycal_state_t, phycal_core)
   2458 #endif
   2459 
   2460 #ifdef WLP2P
   2461 
   2462 typedef struct wl_p2p_disc_st {
   2463 	uint8 state;
   2464 	chanspec_t chspec;
   2465 	uint16 dwell;
   2466 } wl_p2p_disc_st_t;
   2467 
   2468 
   2469 #define WL_P2P_DISC_ST_SCAN 0
   2470 #define WL_P2P_DISC_ST_LISTEN   1
   2471 #define WL_P2P_DISC_ST_SEARCH   2
   2472 
   2473 
   2474 typedef struct wl_p2p_scan {
   2475 	uint8 type;
   2476 	uint8 reserved[3];
   2477 
   2478 } wl_p2p_scan_t;
   2479 
   2480 
   2481 typedef struct wl_p2p_if {
   2482 	struct ether_addr addr;
   2483 	uint8 type;
   2484 	chanspec_t chspec;
   2485 } wl_p2p_if_t;
   2486 
   2487 
   2488 #define WL_P2P_IF_CLIENT    0
   2489 #define WL_P2P_IF_GO        1
   2490 #define WL_P2P_IF_DYNBCN_GO     2
   2491 #define WL_P2P_IF_DEV       3
   2492 
   2493 
   2494 typedef struct wl_p2p_ifq {
   2495 	uint bsscfgidx;
   2496 	char ifname[BCM_MSG_IFNAME_MAX];
   2497 } wl_p2p_ifq_t;
   2498 
   2499 
   2500 typedef struct wl_p2p_ops {
   2501 	uint8 ops;
   2502 	uint8 ctw;
   2503 } wl_p2p_ops_t;
   2504 
   2505 
   2506 typedef struct wl_p2p_sched_desc {
   2507 	uint32 start;
   2508 	uint32 interval;
   2509 	uint32 duration;
   2510 	uint32 count;
   2511 } wl_p2p_sched_desc_t;
   2512 
   2513 
   2514 #define WL_P2P_SCHED_RSVD   0
   2515 #define WL_P2P_SCHED_REPEAT 255
   2516 
   2517 typedef struct wl_p2p_sched {
   2518 	uint8 type;
   2519 	uint8 action;
   2520 	uint8 option;
   2521 	wl_p2p_sched_desc_t desc[1];
   2522 } wl_p2p_sched_t;
   2523 #define WL_P2P_SCHED_FIXED_LEN      3
   2524 
   2525 
   2526 #define WL_P2P_SCHED_TYPE_ABS       0
   2527 #define WL_P2P_SCHED_TYPE_REQ_ABS   1
   2528 
   2529 
   2530 #define WL_P2P_SCHED_ACTION_NONE    0
   2531 #define WL_P2P_SCHED_ACTION_DOZE    1
   2532 
   2533 #define WL_P2P_SCHED_ACTION_GOOFF   2
   2534 
   2535 #define WL_P2P_SCHED_ACTION_RESET   255
   2536 
   2537 
   2538 #define WL_P2P_SCHED_OPTION_NORMAL  0
   2539 #define WL_P2P_SCHED_OPTION_BCNPCT  1
   2540 
   2541 #define WL_P2P_SCHED_OPTION_TSFOFS  2
   2542 
   2543 
   2544 #define WL_P2P_FEAT_GO_CSA      (1 << 0)
   2545 #define WL_P2P_FEAT_GO_NOLEGACY (1 << 1)
   2546 #define WL_P2P_FEAT_RESTRICT_DEV_RESP (1 << 2)
   2547 #endif
   2548 
   2549 
   2550 #define BCM_ACTION_RFAWARE      0x77
   2551 #define BCM_ACTION_RFAWARE_DCS  0x01
   2552 
   2553 
   2554 
   2555 #define WL_11N_2x2          1
   2556 #define WL_11N_3x3          3
   2557 #define WL_11N_4x4          4
   2558 
   2559 
   2560 #define WLFEATURE_DISABLE_11N       0x00000001
   2561 #define WLFEATURE_DISABLE_11N_STBC_TX   0x00000002
   2562 #define WLFEATURE_DISABLE_11N_STBC_RX   0x00000004
   2563 #define WLFEATURE_DISABLE_11N_SGI_TX    0x00000008
   2564 #define WLFEATURE_DISABLE_11N_SGI_RX    0x00000010
   2565 #define WLFEATURE_DISABLE_11N_AMPDU_TX  0x00000020
   2566 #define WLFEATURE_DISABLE_11N_AMPDU_RX  0x00000040
   2567 #define WLFEATURE_DISABLE_11N_GF    0x00000080
   2568 
   2569 
   2570 #define LQ_IDX_LAST             3
   2571 #define MCS_INDEX_SIZE          33
   2572 
   2573 #define LQ_IDX_MIN              0
   2574 #define LQ_IDX_MAX              1
   2575 #define LQ_IDX_AVG              2
   2576 #define LQ_IDX_SUM              2
   2577 #define LQ_IDX_LAST             3
   2578 #define LQ_STOP_MONITOR         0
   2579 #define LQ_START_MONITOR        1
   2580 
   2581 #define LINKQUAL_V1     0x01
   2582 
   2583 struct  wl_lq {
   2584 	int32 enable;
   2585 	int32 rssi[LQ_IDX_LAST];
   2586 	int32 rssicnt;
   2587 	int32 snr[LQ_IDX_LAST];
   2588 	uint32 nsamples;
   2589 	uint8 isvalid;
   2590 	uint8 version;
   2591 };
   2592 
   2593 typedef struct wl_lq wl_lq_t;
   2594 typedef struct wl_lq  wl_lq_stats_t;
   2595 
   2596 typedef struct {
   2597 	struct  ether_addr ea;
   2598 	uint8   ac_cat;
   2599 	uint8   num_pkts;
   2600 } wl_mac_ratehisto_cmd_t;
   2601 
   2602 
   2603 typedef struct {
   2604 	uint32  rate[WLC_MAXRATE + 1];
   2605 	uint32  mcs_index[MCS_INDEX_SIZE];
   2606 	uint32  tsf_timer[2][2];
   2607 } wl_mac_ratehisto_res_t;
   2608 
   2609 #ifdef PROP_TXSTATUS
   2610 
   2611 
   2612 #define WLFC_FLAGS_RSSI_SIGNALS                         1
   2613 
   2614 
   2615 #define WLFC_FLAGS_XONXOFF_SIGNALS                      2
   2616 
   2617 
   2618 #define WLFC_FLAGS_CREDIT_STATUS_SIGNALS        4
   2619 
   2620 #define WLFC_FLAGS_HOST_PROPTXSTATUS_ACTIVE     8
   2621 #define WLFC_FLAGS_PSQ_GENERATIONFSM_ENABLE     16
   2622 #define WLFC_FLAGS_PSQ_ZERO_BUFFER_ENABLE	32
   2623 #endif
   2624 
   2625 #define BTA_STATE_LOG_SZ    64
   2626 
   2627 
   2628 enum {
   2629 	HCIReset = 1,
   2630 	HCIReadLocalAMPInfo,
   2631 	HCIReadLocalAMPASSOC,
   2632 	HCIWriteRemoteAMPASSOC,
   2633 	HCICreatePhysicalLink,
   2634 	HCIAcceptPhysicalLinkRequest,
   2635 	HCIDisconnectPhysicalLink,
   2636 	HCICreateLogicalLink,
   2637 	HCIAcceptLogicalLink,
   2638 	HCIDisconnectLogicalLink,
   2639 	HCILogicalLinkCancel,
   2640 	HCIAmpStateChange,
   2641 	HCIWriteLogicalLinkAcceptTimeout
   2642 };
   2643 
   2644 typedef struct flush_txfifo {
   2645 	uint32 txfifobmp;
   2646 	uint32 hwtxfifoflush;
   2647 	struct ether_addr ea;
   2648 } flush_txfifo_t;
   2649 
   2650 #define CHANNEL_5G_LOW_START    36
   2651 #define CHANNEL_5G_MID_START    52
   2652 #define CHANNEL_5G_HIGH_START   100
   2653 #define CHANNEL_5G_UPPER_START  149
   2654 
   2655 enum {
   2656 	SPATIAL_MODE_2G_IDX = 0,
   2657 	SPATIAL_MODE_5G_LOW_IDX,
   2658 	SPATIAL_MODE_5G_MID_IDX,
   2659 	SPATIAL_MODE_5G_HIGH_IDX,
   2660 	SPATIAL_MODE_5G_UPPER_IDX,
   2661 	SPATIAL_MODE_MAX_IDX
   2662 };
   2663 
   2664 #endif
   2665