Revert "BCM SDK: driver "downgrade" ver. 5.10.142.0: shared sources"
[tomato.git] / release / src-rt / include / wlioctl.h
blob0281bfaa6ab37939d6acbc513b7af169c5f2f0df
1 /*
2 * Custom OID/ioctl definitions for
3 * Broadcom 802.11abg Networking Device Driver
5 * Definitions subject to change without notice.
7 * Copyright (C) 2009, Broadcom Corporation
8 * All Rights Reserved.
9 *
10 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
11 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
12 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
13 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
15 * $Id: wlioctl.h,v 1.620.2.80 2010/01/14 19:34:48 Exp $
18 #ifndef _wlioctl_h_
19 #define _wlioctl_h_
21 #include <typedefs.h>
22 #include <proto/ethernet.h>
23 #include <proto/bcmeth.h>
24 #include <proto/bcmevent.h>
25 #include <proto/802.11.h>
26 #include <bcmwifi.h>
28 #ifdef __NetBSD__
29 /* NetBSD 2.0 does not have SIOCDEVPRIVATE. This is NetBSD 2.0 specific */
30 #define SIOCDEVPRIVATE _IOWR('i', 139, struct ifreq)
31 #endif
33 #ifdef EFI
34 #define BCMWL_IOCTL_GUID \
35 {0xB4910A35, 0x88C5, 0x4328, 0x90, 0x08, 0x9F, 0xB2, 0x00, 0x00, 0x0, 0x0}
36 #endif /* EFI */
39 /* require default structure packing */
40 #if !defined(__GNUC__)
41 #pragma pack(push, 8)
42 #endif
45 #ifndef LINUX_POSTMOGRIFY_REMOVAL
46 /* Legacy structure to help keep backward compatible wl tool and tray app */
48 #define LEGACY_WL_BSS_INFO_VERSION 107 /* older version of wl_bss_info struct */
50 typedef struct wl_bss_info_107 {
51 uint32 version; /* version field */
52 uint32 length; /* byte length of data in this record,
53 * starting at version and including IEs
55 struct ether_addr BSSID;
56 uint16 beacon_period; /* units are Kusec */
57 uint16 capability; /* Capability information */
58 uint8 SSID_len;
59 uint8 SSID[32];
60 struct {
61 uint count; /* # rates in this set */
62 uint8 rates[16]; /* rates in 500kbps units w/hi bit set if basic */
63 } rateset; /* supported rates */
64 uint8 channel; /* Channel no. */
65 uint16 atim_window; /* units are Kusec */
66 uint8 dtim_period; /* DTIM period */
67 int16 RSSI; /* receive signal strength (in dBm) */
68 int8 phy_noise; /* noise (in dBm) */
69 uint32 ie_length; /* byte length of Information Elements */
70 /* variable length Information Elements */
71 } wl_bss_info_107_t;
72 #endif /* LINUX_POSTMOGRIFY_REMOVAL */
75 * Per-bss information structure.
78 #define WL_BSS_INFO_VERSION 108 /* current version of wl_bss_info struct */
80 /* BSS info structure
81 * Applications MUST CHECK ie_offset field and length field to access IEs and
82 * next bss_info structure in a vector (in wl_scan_results_t)
84 typedef struct wl_bss_info {
85 uint32 version; /* version field */
86 uint32 length; /* byte length of data in this record,
87 * starting at version and including IEs
89 struct ether_addr BSSID;
90 uint16 beacon_period; /* units are Kusec */
91 uint16 capability; /* Capability information */
92 uint8 SSID_len;
93 uint8 SSID[32];
94 struct {
95 uint count; /* # rates in this set */
96 uint8 rates[16]; /* rates in 500kbps units w/hi bit set if basic */
97 } rateset; /* supported rates */
98 chanspec_t chanspec; /* chanspec for bss */
99 uint16 atim_window; /* units are Kusec */
100 uint8 dtim_period; /* DTIM period */
101 int16 RSSI; /* receive signal strength (in dBm) */
102 int8 phy_noise; /* noise (in dBm) */
104 uint8 n_cap; /* BSS is 802.11N Capable */
105 uint32 nbss_cap; /* 802.11N BSS Capabilities (based on HT_CAP_*) */
106 uint8 ctl_ch; /* 802.11N BSS control channel number */
107 uint32 reserved32[1]; /* Reserved for expansion of BSS properties */
108 uint8 flags; /* flags */
109 uint8 reserved[3]; /* Reserved for expansion of BSS properties */
110 uint8 basic_mcs[MCSSET_LEN]; /* 802.11N BSS required MCS set */
112 uint16 ie_offset; /* offset at which IEs start, from beginning */
113 uint32 ie_length; /* byte length of Information Elements */
114 /* Add new fields here */
115 /* variable length Information Elements */
116 } wl_bss_info_t;
118 typedef struct wlc_ssid {
119 uint32 SSID_len;
120 uchar SSID[32];
121 } wlc_ssid_t;
123 #ifndef LINUX_POSTMOGRIFY_REMOVAL
124 typedef struct chan_scandata {
125 uint8 txpower;
126 uint8 pad;
127 chanspec_t channel; /* Channel num, bw, ctrl_sb and band */
128 uint32 channel_mintime;
129 uint32 channel_maxtime;
130 } chan_scandata_t;
132 typedef enum wl_scan_type {
133 EXTDSCAN_FOREGROUND_SCAN,
134 EXTDSCAN_BACKGROUND_SCAN,
135 EXTDSCAN_FORCEDBACKGROUND_SCAN
136 } wl_scan_type_t;
138 #define WLC_EXTDSCAN_MAX_SSID 5
140 #define WL_BSS_FLAGS_FROM_BEACON 0x01 /* bss_info derived from beacon */
141 #define WL_BSS_FLAGS_FROM_CACHE 0x02 /* bss_info collected from cache */
143 typedef struct wl_extdscan_params {
144 int8 nprobes; /* 0, passive, otherwise active */
145 int8 split_scan; /* split scan */
146 int8 band; /* band */
147 int8 pad;
148 wlc_ssid_t ssid[WLC_EXTDSCAN_MAX_SSID]; /* ssid list */
149 uint32 tx_rate; /* in 500ksec units */
150 wl_scan_type_t scan_type; /* enum */
151 int32 channel_num;
152 chan_scandata_t channel_list[1]; /* list of chandata structs */
153 } wl_extdscan_params_t;
155 #define WL_EXTDSCAN_PARAMS_FIXED_SIZE (sizeof(wl_extdscan_params_t) - sizeof(chan_scandata_t))
156 #endif /* LINUX_POSTMOGRIFY_REMOVAL */
158 #define WL_BSSTYPE_INFRA 1
159 #define WL_BSSTYPE_INDEP 0
160 #define WL_BSSTYPE_ANY 2
162 #ifndef LINUX_POSTMOGRIFY_REMOVAL
163 typedef struct wl_scan_params {
164 wlc_ssid_t ssid; /* default: {0, ""} */
165 struct ether_addr bssid; /* default: bcast */
166 int8 bss_type; /* default: any,
167 * DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT
169 int8 scan_type; /* -1 use default, DOT11_SCANTYPE_ACTIVE/PASSIVE */
170 int32 nprobes; /* -1 use default, number of probes per channel */
171 int32 active_time; /* -1 use default, dwell time per channel for
172 * active scanning
174 int32 passive_time; /* -1 use default, dwell time per channel
175 * for passive scanning
177 int32 home_time; /* -1 use default, dwell time for the home channel
178 * between channel scans
180 int32 channel_num; /* 0 use default (all available channels), count of
181 * channels in channel_list
183 uint16 channel_list[1]; /* list of chanspecs */
184 } wl_scan_params_t;
185 /* size of wl_scan_params not including variable length array */
186 #define WL_SCAN_PARAMS_FIXED_SIZE 64
188 #define WL_SCAN_ACTION_START 1
189 #define WL_SCAN_ACTION_CONTINUE 2
191 #define ISCAN_REQ_VERSION 1
193 /* incremental scan struct */
194 typedef struct wl_iscan_params {
195 uint32 version;
196 uint16 action;
197 uint16 scan_duration;
198 wl_scan_params_t params;
199 } wl_iscan_params_t;
200 /* 3 fields + size of wl_scan_params, not including variable length array */
201 #define WL_ISCAN_PARAMS_FIXED_SIZE (OFFSETOF(wl_iscan_params_t, params) + sizeof(wlc_ssid_t))
202 #endif /* LINUX_POSTMOGRIFY_REMOVAL */
204 typedef struct wl_scan_results {
205 uint32 buflen;
206 uint32 version;
207 uint32 count;
208 wl_bss_info_t bss_info[1];
209 } wl_scan_results_t;
210 /* size of wl_scan_results not including variable length array */
211 #define WL_SCAN_RESULTS_FIXED_SIZE 12
213 /* wl_iscan_results status values */
214 #define WL_SCAN_RESULTS_SUCCESS 0
215 #define WL_SCAN_RESULTS_PARTIAL 1
216 #define WL_SCAN_RESULTS_PENDING 2
217 #define WL_SCAN_RESULTS_ABORTED 3
219 /* incremental scan results struct */
220 typedef struct wl_iscan_results {
221 uint32 status;
222 wl_scan_results_t results;
223 } wl_iscan_results_t;
224 /* size of wl_iscan_results not including variable length array */
225 #define WL_ISCAN_RESULTS_FIXED_SIZE \
226 (WL_SCAN_RESULTS_FIXED_SIZE + OFFSETOF(wl_iscan_results_t, results))
228 #define WL_NUMRATES 255 /* max # of rates in a rateset */
229 typedef struct wl_rateset {
230 uint32 count; /* # rates in this set */
231 uint8 rates[WL_NUMRATES]; /* rates in 500kbps units w/hi bit set if basic */
232 uint8 mcs[MCSSET_LEN]; /* supported mcs index bit map */
233 } wl_rateset_t;
235 /* uint32 list */
236 typedef struct wl_uint32_list {
237 /* in - # of elements, out - # of entries */
238 uint32 count;
239 /* variable length uint32 list */
240 uint32 element[1];
241 } wl_uint32_list_t;
243 #ifndef LINUX_POSTMOGRIFY_REMOVAL
244 /* used for association with a specific BSSID and chanspec list */
245 typedef struct wl_assoc_params {
246 struct ether_addr bssid; /* 00:00:00:00:00:00: broadcast scan */
247 int32 chanspec_num; /* 0: all available channels,
248 * otherwise count of chanspecs in chanspec_list
250 chanspec_t chanspec_list[1]; /* list of chanspecs */
251 } wl_assoc_params_t;
252 #define WL_ASSOC_PARAMS_FIXED_SIZE (sizeof(wl_assoc_params_t) - sizeof(chanspec_t))
254 /* used for reassociation/roam to a specific BSSID and channel */
255 typedef wl_assoc_params_t wl_reassoc_params_t;
256 #define WL_REASSOC_PARAMS_FIXED_SIZE WL_ASSOC_PARAMS_FIXED_SIZE
258 /* used for join with or without a specific bssid and channel list */
259 typedef struct wl_join_params {
260 wlc_ssid_t ssid;
261 wl_assoc_params_t params; /* optional field, but it must include the fixed portion
262 * of the wl_assoc_params_t struct when it does present.
264 } wl_join_params_t;
265 #define WL_JOIN_PARAMS_FIXED_SIZE (sizeof(wl_join_params_t) - sizeof(chanspec_t))
267 /* defines used by the nrate iovar */
268 #define NRATE_MCS_INUSE 0x00000080 /* MSC in use,indicates b0-6 holds an mcs */
269 #define NRATE_RATE_MASK 0x0000007f /* rate/mcs value */
270 #define NRATE_STF_MASK 0x0000ff00 /* stf mode mask: siso, cdd, stbc, sdm */
271 #define NRATE_STF_SHIFT 8 /* stf mode shift */
272 #define NRATE_OVERRIDE 0x80000000 /* bit indicate override both rate & mode */
273 #define NRATE_OVERRIDE_MCS_ONLY 0x40000000 /* bit indicate to override mcs only */
275 #define NRATE_STF_SISO 0 /* stf mode SISO */
276 #define NRATE_STF_CDD 1 /* stf mode CDD */
277 #define NRATE_STF_STBC 2 /* stf mode STBC */
278 #define NRATE_STF_SDM 3 /* stf mode SDM */
280 #define ANTENNA_NUM_1 1 /* total number of antennas to be used */
281 #define ANTENNA_NUM_2 2
282 #define ANTENNA_NUM_3 3
283 #define ANTENNA_NUM_4 4
285 #define ANT_SELCFG_AUTO 0x80 /* bit indicate antenna sel AUTO */
286 #define ANT_SELCFG_MASK 0x33 /* antenna configuration mask */
287 #define ANT_SELCFG_MAX 4 /* max number of antenna configuration */
288 #define ANT_SELCFG_TX_UNICAST 0 /* unicast tx antenna configuration */
289 #define ANT_SELCFG_RX_UNICAST 1 /* unicast rx antenna configuration */
290 #define ANT_SELCFG_TX_DEF 2 /* default tx antenna configuration */
291 #define ANT_SELCFG_RX_DEF 3 /* default rx antenna configuration */
293 typedef struct {
294 uint8 ant_config[ANT_SELCFG_MAX]; /* antenna configuration */
295 uint8 num_antcfg; /* number of available antenna configurations */
296 } wlc_antselcfg_t;
298 #define HIGHEST_SINGLE_STREAM_MCS 7 /* MCS values greater than this enable multiple streams */
300 #define MAX_CCA_CHANNELS 38 /* Max number of 20 Mhz wide channels */
301 #define MAX_CCA_SECS 60 /* CCA keeps this many seconds history */
303 #define IBSS_MED 15 /* Mediom in-bss congestion percentage */
304 #define IBSS_HI 25 /* Hi in-bss congestion percentage */
305 #define OBSS_MED 12
306 #define OBSS_HI 25
307 #define INTERFER_MED 5
308 #define INTERFER_HI 10
310 #define CCA_FLAG_2G_ONLY 0x01 /* Return a channel from 2.4 Ghz band */
311 #define CCA_FLAG_5G_ONLY 0x02 /* Return a channel from 2.4 Ghz band */
312 #define CCA_FLAG_IGNORE_DURATION 0x04 /* Ignore dwell time for each channel */
313 #define CCA_FLAGS_PREFER_1_6_11 0x10
315 #define CCA_ERRNO_BAND 1 /* After filtering for band pref, no choices left */
316 #define CCA_ERRNO_DURATION 2 /* After filtering for duration, no choices left */
317 #define CCA_ERRNO_PREF_CHAN 3 /* After filtering for chan pref, no choices left */
318 #define CCA_ERRNO_INTERFER 4 /* After filtering for interference, no choices left */
319 #define CCA_ERRNO_TOO_FEW 5 /* Only 1 channel was input */
321 typedef struct {
322 uint32 duration; /* millisecs spent sampling this channel */
323 uint32 congest_ibss; /* millisecs in our bss (presumably this traffic will */
324 /* move if cur bss moves channels) */
325 uint32 congest_obss; /* traffic not in our bss */
326 uint32 interference; /* millisecs detecting a non 802.11 interferer. */
327 uint32 timestamp; /* second timestamp */
328 } cca_congest_t;
330 typedef struct {
331 chanspec_t chanspec; /* Which channel? */
332 uint8 num_secs; /* How many secs worth of data */
333 cca_congest_t secs[1]; /* Data */
334 } cca_congest_channel_req_t;
336 #define WLC_CNTRY_BUF_SZ 4 /* Country string is 3 bytes + NUL */
338 typedef struct wl_country {
339 char country_abbrev[WLC_CNTRY_BUF_SZ]; /* null terminated country code used in
340 * the Country IE
342 int32 rev; /* revision specifier for ccode
343 * on set, -1 indicates unspecified.
344 * on get, rev >= 0
346 char ccode[WLC_CNTRY_BUF_SZ]; /* null terminated built-in country code.
347 * variable length, but fixed size in
348 * struct allows simple allocation for
349 * expected country strings <= 3 chars.
351 } wl_country_t;
353 typedef struct wl_channels_in_country {
354 uint32 buflen;
355 uint32 band;
356 char country_abbrev[WLC_CNTRY_BUF_SZ];
357 uint32 count;
358 uint32 channel[1];
359 } wl_channels_in_country_t;
361 typedef struct wl_country_list {
362 uint32 buflen;
363 uint32 band_set;
364 uint32 band;
365 uint32 count;
366 char country_abbrev[1];
367 } wl_country_list_t;
369 #define WL_NUM_RPI_BINS 8
370 #define WL_RM_TYPE_BASIC 1
371 #define WL_RM_TYPE_CCA 2
372 #define WL_RM_TYPE_RPI 3
374 #define WL_RM_FLAG_PARALLEL (1<<0)
376 #define WL_RM_FLAG_LATE (1<<1)
377 #define WL_RM_FLAG_INCAPABLE (1<<2)
378 #define WL_RM_FLAG_REFUSED (1<<3)
380 typedef struct wl_rm_req_elt {
381 int8 type;
382 int8 flags;
383 chanspec_t chanspec;
384 uint32 token; /* token for this measurement */
385 uint32 tsf_h; /* TSF high 32-bits of Measurement start time */
386 uint32 tsf_l; /* TSF low 32-bits */
387 uint32 dur; /* TUs */
388 } wl_rm_req_elt_t;
390 typedef struct wl_rm_req {
391 uint32 token; /* overall measurement set token */
392 uint32 count; /* number of measurement requests */
393 void * cb; /* completion callback function: may be NULL */
394 void * cb_arg; /* arg to completion callback function */
395 wl_rm_req_elt_t req[1]; /* variable length block of requests */
396 } wl_rm_req_t;
397 #define WL_RM_REQ_FIXED_LEN OFFSETOF(wl_rm_req_t, req)
399 typedef struct wl_rm_rep_elt {
400 int8 type;
401 int8 flags;
402 chanspec_t chanspec;
403 uint32 token; /* token for this measurement */
404 uint32 tsf_h; /* TSF high 32-bits of Measurement start time */
405 uint32 tsf_l; /* TSF low 32-bits */
406 uint32 dur; /* TUs */
407 uint32 len; /* byte length of data block */
408 uint8 data[1]; /* variable length data block */
409 } wl_rm_rep_elt_t;
410 #define WL_RM_REP_ELT_FIXED_LEN 24 /* length excluding data block */
412 #define WL_RPI_REP_BIN_NUM 8
413 typedef struct wl_rm_rpi_rep {
414 uint8 rpi[WL_RPI_REP_BIN_NUM];
415 int8 rpi_max[WL_RPI_REP_BIN_NUM];
416 } wl_rm_rpi_rep_t;
418 typedef struct wl_rm_rep {
419 uint32 token; /* overall measurement set token */
420 uint32 len; /* length of measurement report block */
421 wl_rm_rep_elt_t rep[1]; /* variable length block of reports */
422 } wl_rm_rep_t;
423 #define WL_RM_REP_FIXED_LEN 8
424 #endif /* LINUX_POSTMOGRIFY_REMOVAL */
427 #if defined(BCMSUP_PSK)
428 typedef enum sup_auth_status {
429 /* Basic supplicant authentication states */
430 WLC_SUP_DISCONNECTED = 0,
431 WLC_SUP_CONNECTING,
432 WLC_SUP_IDREQUIRED,
433 WLC_SUP_AUTHENTICATING,
434 WLC_SUP_AUTHENTICATED,
435 WLC_SUP_KEYXCHANGE,
436 WLC_SUP_KEYED,
437 WLC_SUP_TIMEOUT,
438 WLC_SUP_LAST_BASIC_STATE,
440 /* Extended supplicant authentication states */
441 WLC_SUP_KEYXCHANGE_WAIT_M1 = WLC_SUP_AUTHENTICATED,
442 /* Waiting to receive handshake msg M1 */
443 WLC_SUP_KEYXCHANGE_PREP_M2 = WLC_SUP_KEYXCHANGE,
444 /* Preparing to send handshake msg M2 */
445 WLC_SUP_KEYXCHANGE_WAIT_M3 = WLC_SUP_LAST_BASIC_STATE,
446 /* Waiting to receive handshake msg M3 */
447 WLC_SUP_KEYXCHANGE_PREP_M4, /* Preparing to send handshake msg M4 */
448 WLC_SUP_KEYXCHANGE_WAIT_G1, /* Waiting to receive handshake msg G1 */
449 WLC_SUP_KEYXCHANGE_PREP_G2 /* Preparing to send handshake msg G2 */
450 } sup_auth_status_t;
451 #endif
453 /* Enumerate crypto algorithms */
454 #define CRYPTO_ALGO_OFF 0
455 #define CRYPTO_ALGO_WEP1 1
456 #define CRYPTO_ALGO_TKIP 2
457 #define CRYPTO_ALGO_WEP128 3
458 #define CRYPTO_ALGO_AES_CCM 4
459 #define CRYPTO_ALGO_AES_OCB_MSDU 5
460 #define CRYPTO_ALGO_AES_OCB_MPDU 6
461 #define CRYPTO_ALGO_NALG 7
462 #ifdef BCMWAPI_WPI
463 #define CRYPTO_ALGO_SMS4 11
464 #endif /* BCMWAPI_WPI */
466 #define WSEC_GEN_MIC_ERROR 0x0001
467 #define WSEC_GEN_REPLAY 0x0002
468 #define WSEC_GEN_ICV_ERROR 0x0004
470 #define WL_SOFT_KEY (1 << 0) /* Indicates this key is using soft encrypt */
471 #define WL_PRIMARY_KEY (1 << 1) /* Indicates this key is the primary (ie tx) key */
472 #define WL_KF_RES_4 (1 << 4) /* Reserved for backward compat */
473 #define WL_KF_RES_5 (1 << 5) /* Reserved for backward compat */
474 #define WL_IBSS_PEER_GROUP_KEY (1 << 6) /* Indicates a group key for a IBSS PEER */
476 typedef struct wl_wsec_key {
477 uint32 index; /* key index */
478 uint32 len; /* key length */
479 uint8 data[DOT11_MAX_KEY_SIZE]; /* key data */
480 uint32 pad_1[18];
481 uint32 algo; /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
482 uint32 flags; /* misc flags */
483 uint32 pad_2[2];
484 int pad_3;
485 int iv_initialized; /* has IV been initialized already? */
486 int pad_4;
487 /* Rx IV */
488 struct {
489 uint32 hi; /* upper 32 bits of IV */
490 uint16 lo; /* lower 16 bits of IV */
491 } rxiv;
492 uint32 pad_5[2];
493 struct ether_addr ea; /* per station */
494 } wl_wsec_key_t;
496 #define WSEC_MIN_PSK_LEN 8
497 #define WSEC_MAX_PSK_LEN 64
499 /* Flag for key material needing passhash'ing */
500 #define WSEC_PASSPHRASE (1<<0)
502 /* receptacle for WLC_SET_WSEC_PMK parameter */
503 typedef struct {
504 ushort key_len; /* octets in key material */
505 ushort flags; /* key handling qualification */
506 uint8 key[WSEC_MAX_PSK_LEN]; /* PMK material */
507 } wsec_pmk_t;
509 /* wireless security bitvec */
510 #define WEP_ENABLED 0x0001
511 #define TKIP_ENABLED 0x0002
512 #define AES_ENABLED 0x0004
513 #define WSEC_SWFLAG 0x0008
514 #define SES_OW_ENABLED 0x0040 /* to go into transition mode without setting wep */
515 #ifdef BCMWAPI_WPI
516 #define SMS4_ENABLED 0x0100
517 #endif /* BCMWAPI_WPI */
519 /* WPA authentication mode bitvec */
520 #define WPA_AUTH_DISABLED 0x0000 /* Legacy (i.e., non-WPA) */
521 #define WPA_AUTH_NONE 0x0001 /* none (IBSS) */
522 #define WPA_AUTH_UNSPECIFIED 0x0002 /* over 802.1x */
523 #define WPA_AUTH_PSK 0x0004 /* Pre-shared key */
524 /* #define WPA_AUTH_8021X 0x0020 */ /* 802.1x, reserved */
525 #ifdef BCMWPA2
526 #define WPA2_AUTH_UNSPECIFIED 0x0040 /* over 802.1x */
527 #define WPA2_AUTH_PSK 0x0080 /* Pre-shared key */
528 #ifndef LINUX_POSTMOGRIFY_REMOVAL
529 #define BRCM_AUTH_PSK 0x0100 /* BRCM specific PSK */
530 #define BRCM_AUTH_DPT 0x0200 /* DPT PSK without group keys */
531 #endif /* LINUX_POSTMOGRIFY_REMOVAL */
532 #endif /* BCMWPA2 */
534 #ifdef BCMWPA2
535 /* pmkid */
536 #define MAXPMKID 16
538 typedef struct _pmkid
540 struct ether_addr BSSID;
541 uint8 PMKID[WPA2_PMKID_LEN];
542 } pmkid_t;
544 typedef struct _pmkid_list
546 uint32 npmkid;
547 pmkid_t pmkid[1];
548 } pmkid_list_t;
550 typedef struct _pmkid_cand {
551 struct ether_addr BSSID;
552 uint8 preauth;
553 } pmkid_cand_t;
555 typedef struct _pmkid_cand_list {
556 uint32 npmkid_cand;
557 pmkid_cand_t pmkid_cand[1];
558 } pmkid_cand_list_t;
559 #endif /* BCMWPA2 */
561 #ifndef LINUX_POSTMOGRIFY_REMOVAL
562 typedef struct wl_led_info {
563 uint32 index; /* led index */
564 uint32 behavior;
565 uint8 activehi;
566 } wl_led_info_t;
568 typedef struct wl_assoc_info {
569 uint32 req_len;
570 uint32 resp_len;
571 uint32 flags;
572 struct dot11_assoc_req req;
573 struct ether_addr reassoc_bssid; /* used in reassoc's */
574 struct dot11_assoc_resp resp;
575 } wl_assoc_info_t;
576 /* flags */
577 #define WLC_ASSOC_REQ_IS_REASSOC 0x01 /* assoc req was actually a reassoc */
578 /* srom read/write struct passed through ioctl */
579 typedef struct {
580 uint byteoff; /* byte offset */
581 uint nbytes; /* number of bytes */
582 uint16 buf[1];
583 } srom_rw_t;
585 /* similar cis (srom or otp) struct [iovar: may not be aligned] */
586 typedef struct {
587 uint32 source; /* cis source */
588 uint32 byteoff; /* byte offset */
589 uint32 nbytes; /* number of bytes */
590 /* data follows here */
591 } cis_rw_t;
593 #define WLC_CIS_DEFAULT 0 /* built-in default */
594 #define WLC_CIS_SROM 1 /* source is sprom */
595 #define WLC_CIS_OTP 2 /* source is otp */
597 /* R_REG and W_REG struct passed through ioctl */
598 typedef struct {
599 uint32 byteoff; /* byte offset of the field in d11regs_t */
600 uint32 val; /* read/write value of the field */
601 uint32 size; /* sizeof the field */
602 uint band; /* band (optional) */
603 } rw_reg_t;
605 /* Structure used by GET/SET_ATTEN ioctls - it controls power in b/g-band */
606 /* PCL - Power Control Loop */
607 /* current gain setting is replaced by user input */
608 #define WL_ATTEN_APP_INPUT_PCL_OFF 0 /* turn off PCL, apply supplied input */
609 #define WL_ATTEN_PCL_ON 1 /* turn on PCL */
610 /* current gain setting is maintained */
611 #define WL_ATTEN_PCL_OFF 2 /* turn off PCL. */
612 typedef struct {
613 uint16 auto_ctrl; /* WL_ATTEN_XX */
614 uint16 bb; /* Baseband attenuation */
615 uint16 radio; /* Radio attenuation */
616 uint16 txctl1; /* Radio TX_CTL1 value */
617 } atten_t;
619 /* Per-AC retry parameters */
620 struct wme_tx_params_s {
621 uint8 short_retry;
622 uint8 short_fallback;
623 uint8 long_retry;
624 uint8 long_fallback;
625 uint16 max_rate; /* In units of 512 Kbps */
627 typedef struct wme_tx_params_s wme_tx_params_t;
628 #define WL_WME_TX_PARAMS_IO_BYTES (sizeof(wme_tx_params_t) * AC_COUNT)
630 /* defines used by poweridx iovar - it controls power in a-band */
631 /* current gain setting is maintained */
632 #define WL_PWRIDX_PCL_OFF -2 /* turn off PCL. */
633 #define WL_PWRIDX_PCL_ON -1 /* turn on PCL */
634 #define WL_PWRIDX_LOWER_LIMIT -2 /* lower limit */
635 #define WL_PWRIDX_UPPER_LIMIT 63 /* upper limit */
636 /* value >= 0 causes
637 * - input to be set to that value
638 * - PCL to be off
641 #define BCM_MAC_STATUS_INDICATION (0x40010200L)
643 /* Please update the following when modifying this structure:
644 * StaInfo Twiki page flags section - description of the sta_info_t struct
645 * src/wl/exe/wlu.c - print of sta_info_t
646 * Pay attention to version if structure changes.
648 typedef struct {
649 uint16 ver; /* version of this struct */
650 uint16 len; /* length in bytes of this structure */
651 uint16 cap; /* sta's advertised capabilities */
652 uint32 flags; /* flags defined below */
653 uint32 idle; /* time since data pkt rx'd from sta */
654 struct ether_addr ea; /* Station address */
655 wl_rateset_t rateset; /* rateset in use */
656 uint32 in; /* seconds elapsed since associated */
657 uint32 listen_interval_inms; /* Min Listen interval in ms for this STA */
658 uint32 tx_pkts; /* # of packets transmitted */
659 uint32 tx_failures; /* # of packets failed */
660 uint32 rx_ucast_pkts; /* # of unicast packets received */
661 uint32 rx_mcast_pkts; /* # of multicast packets received */
662 uint32 tx_rate; /* Rate of last successful tx frame */
663 uint32 rx_rate; /* Rate of last successful rx frame */
664 } sta_info_t;
666 #define WL_OLD_STAINFO_SIZE OFFSETOF(sta_info_t, tx_pkts)
668 #define WL_STA_VER 2
670 /* Flags for sta_info_t indicating properties of STA */
671 #define WL_STA_BRCM 0x1 /* Running a Broadcom driver */
672 #define WL_STA_WME 0x2 /* WMM association */
673 #define WL_STA_ABCAP 0x4
674 #define WL_STA_AUTHE 0x8 /* Authenticated */
675 #define WL_STA_ASSOC 0x10 /* Associated */
676 #define WL_STA_AUTHO 0x20 /* Authorized */
677 #define WL_STA_WDS 0x40 /* Wireless Distribution System */
678 #define WL_STA_WDS_LINKUP 0x80 /* WDS traffic/probes flowing properly */
679 #define WL_STA_PS 0x100 /* STA is in power save mode from AP's viewpoint */
680 #define WL_STA_APSD_BE 0x200 /* APSD delv/trigger for AC_BE is default enabled */
681 #define WL_STA_APSD_BK 0x400 /* APSD delv/trigger for AC_BK is default enabled */
682 #define WL_STA_APSD_VI 0x800 /* APSD delv/trigger for AC_VI is default enabled */
683 #define WL_STA_APSD_VO 0x1000 /* APSD delv/trigger for AC_VO is default enabled */
684 #define WL_STA_N_CAP 0x2000 /* STA 802.11n capable */
685 #define WL_STA_SCBSTATS 0x4000 /* Per STA debug stats */
687 #define WL_WDS_LINKUP WL_STA_WDS_LINKUP /* deprecated */
688 #endif /* LINUX_POSTMOGRIFY_REMOVAL */
690 /* channel encoding */
691 typedef struct channel_info {
692 int hw_channel;
693 int target_channel;
694 int scan_channel;
695 } channel_info_t;
697 /* For ioctls that take a list of MAC addresses */
698 struct maclist {
699 uint count; /* number of MAC addresses */
700 struct ether_addr ea[1]; /* variable length array of MAC addresses */
703 /* Used to get specific STA parameters */
704 typedef struct {
705 uint32 val;
706 struct ether_addr ea;
707 } scb_val_t;
709 /* Used to get specific link/ac parameters */
710 typedef struct {
711 int ac;
712 uint8 val;
713 struct ether_addr ea;
714 } link_val_t;
716 /* Linux network driver ioctl encoding */
717 typedef struct wl_ioctl {
718 uint cmd; /* common ioctl definition */
719 void *buf; /* pointer to user buffer */
720 uint len; /* length of user buffer */
721 uint8 set; /* get or set request (optional) */
722 uint used; /* bytes read or written (optional) */
723 uint needed; /* bytes needed (optional) */
724 } wl_ioctl_t;
725 /* reference to wl_ioctl_t struct used by usermode driver */
726 #define ioctl_subtype set /* subtype param */
727 #define ioctl_pid used /* pid param */
728 #define ioctl_status needed /* status param */
730 #ifndef LINUX_POSTMOGRIFY_REMOVAL
731 /* get pkt count struct passed through ioctl */
732 typedef struct get_pktcnt {
733 uint rx_good_pkt;
734 uint rx_bad_pkt;
735 uint tx_good_pkt;
736 uint tx_bad_pkt;
737 uint rx_ocast_good_pkt; /* unicast packets destined for others */
738 } get_pktcnt_t;
741 * Structure for passing hardware and software
742 * revision info up from the driver.
744 typedef struct wlc_rev_info {
745 uint vendorid; /* PCI vendor id */
746 uint deviceid; /* device id of chip */
747 uint radiorev; /* radio revision */
748 uint chiprev; /* chip revision */
749 uint corerev; /* core revision */
750 uint boardid; /* board identifier (usu. PCI sub-device id) */
751 uint boardvendor; /* board vendor (usu. PCI sub-vendor id) */
752 uint boardrev; /* board revision */
753 uint driverrev; /* driver version */
754 uint ucoderev; /* microcode version */
755 uint bus; /* bus type */
756 uint chipnum; /* chip number */
757 uint phytype; /* phy type */
758 uint phyrev; /* phy revision */
759 uint anarev; /* anacore rev */
760 } wlc_rev_info_t;
762 #define WL_REV_INFO_LEGACY_LENGTH 48
764 #define WL_BRAND_MAX 10
765 typedef struct wl_instance_info {
766 uint instance;
767 char brand[WL_BRAND_MAX];
768 } wl_instance_info_t;
770 /* structure to change size of tx fifo */
771 typedef struct wl_txfifo_sz {
772 uint8 fifo;
773 uint8 size;
774 } wl_txfifo_sz_t;
776 /* Transfer info about an IOVar from the driver */
777 /* Max supported IOV name size in bytes, + 1 for null termination */
778 #define WLC_IOV_NAME_LEN 30
779 typedef struct wlc_iov_trx_s {
780 uint8 module;
781 uint8 type;
782 char name[WLC_IOV_NAME_LEN];
783 } wlc_iov_trx_t;
785 #endif /* LINUX_POSTMOGRIFY_REMOVAL */
786 /* check this magic number */
787 #define WLC_IOCTL_MAGIC 0x14e46c77
789 /* bump this number if you change the ioctl interface */
790 #define WLC_IOCTL_VERSION 1
792 #define WLC_IOCTL_MAXLEN 8192 /* max length ioctl buffer required */
793 #define WLC_IOCTL_SMLEN 256 /* "small" length ioctl buffer required */
794 #define WLC_SAMPLECOLLECT_MAXLEN 10240 /* Max Sample Collect buffer for two cores */
796 /* common ioctl definitions */
797 #define WLC_GET_MAGIC 0
798 #define WLC_GET_VERSION 1
799 #define WLC_UP 2
800 #define WLC_DOWN 3
801 #define WLC_GET_LOOP 4
802 #define WLC_SET_LOOP 5
803 #define WLC_DUMP 6
804 #define WLC_GET_MSGLEVEL 7
805 #define WLC_SET_MSGLEVEL 8
806 #define WLC_GET_PROMISC 9
807 #define WLC_SET_PROMISC 10
808 /* #define WLC_DUMP_RSSI 11 */ /* no longer supported */
809 #define WLC_GET_RATE 12
810 /* #define WLC_SET_RATE 13 */ /* no longer supported */
811 #define WLC_GET_INSTANCE 14
812 /* #define WLC_GET_FRAG 15 */ /* no longer supported */
813 /* #define WLC_SET_FRAG 16 */ /* no longer supported */
814 /* #define WLC_GET_RTS 17 */ /* no longer supported */
815 /* #define WLC_SET_RTS 18 */ /* no longer supported */
816 #define WLC_GET_INFRA 19
817 #define WLC_SET_INFRA 20
818 #define WLC_GET_AUTH 21
819 #define WLC_SET_AUTH 22
820 #define WLC_GET_BSSID 23
821 #define WLC_SET_BSSID 24
822 #define WLC_GET_SSID 25
823 #define WLC_SET_SSID 26
824 #define WLC_RESTART 27
825 /* #define WLC_DUMP_SCB 28 */ /* no longer supported */
826 #define WLC_GET_CHANNEL 29
827 #define WLC_SET_CHANNEL 30
828 #define WLC_GET_SRL 31
829 #define WLC_SET_SRL 32
830 #define WLC_GET_LRL 33
831 #define WLC_SET_LRL 34
832 #define WLC_GET_PLCPHDR 35
833 #define WLC_SET_PLCPHDR 36
834 #define WLC_GET_RADIO 37
835 #define WLC_SET_RADIO 38
836 #define WLC_GET_PHYTYPE 39
837 #define WLC_DUMP_RATE 40
838 #define WLC_SET_RATE_PARAMS 41
839 #define WLC_GET_FIXRATE 42
840 #define WLC_SET_FIXRATE 43
841 /* #define WLC_GET_WEP 42 */ /* no longer supported */
842 /* #define WLC_SET_WEP 43 */ /* no longer supported */
843 #define WLC_GET_KEY 44
844 #define WLC_SET_KEY 45
845 #define WLC_GET_REGULATORY 46
846 #define WLC_SET_REGULATORY 47
847 #define WLC_GET_PASSIVE_SCAN 48
848 #define WLC_SET_PASSIVE_SCAN 49
849 #define WLC_SCAN 50
850 #define WLC_SCAN_RESULTS 51
851 #define WLC_DISASSOC 52
852 #define WLC_REASSOC 53
853 #define WLC_GET_ROAM_TRIGGER 54
854 #define WLC_SET_ROAM_TRIGGER 55
855 #define WLC_GET_ROAM_DELTA 56
856 #define WLC_SET_ROAM_DELTA 57
857 #define WLC_GET_ROAM_SCAN_PERIOD 58
858 #define WLC_SET_ROAM_SCAN_PERIOD 59
859 #define WLC_EVM 60 /* diag */
860 #define WLC_GET_TXANT 61
861 #define WLC_SET_TXANT 62
862 #define WLC_GET_ANTDIV 63
863 #define WLC_SET_ANTDIV 64
864 /* #define WLC_GET_TXPWR 65 */ /* no longer supported */
865 /* #define WLC_SET_TXPWR 66 */ /* no longer supported */
866 #define WLC_GET_CLOSED 67
867 #define WLC_SET_CLOSED 68
868 #define WLC_GET_MACLIST 69
869 #define WLC_SET_MACLIST 70
870 #define WLC_GET_RATESET 71
871 #define WLC_SET_RATESET 72
872 /* #define WLC_GET_LOCALE 73 */ /* no longer supported */
873 #define WLC_LONGTRAIN 74
874 #define WLC_GET_BCNPRD 75
875 #define WLC_SET_BCNPRD 76
876 #define WLC_GET_DTIMPRD 77
877 #define WLC_SET_DTIMPRD 78
878 #define WLC_GET_SROM 79
879 #define WLC_SET_SROM 80
880 #define WLC_GET_WEP_RESTRICT 81
881 #define WLC_SET_WEP_RESTRICT 82
882 #define WLC_GET_COUNTRY 83
883 #define WLC_SET_COUNTRY 84
884 #define WLC_GET_PM 85
885 #define WLC_SET_PM 86
886 #define WLC_GET_WAKE 87
887 #define WLC_SET_WAKE 88
888 /* #define WLC_GET_D11CNTS 89 */ /* -> "counters" iovar */
889 #define WLC_GET_FORCELINK 90 /* ndis only */
890 #define WLC_SET_FORCELINK 91 /* ndis only */
891 #define WLC_FREQ_ACCURACY 92 /* diag */
892 #define WLC_CARRIER_SUPPRESS 93 /* diag */
893 #define WLC_GET_PHYREG 94
894 #define WLC_SET_PHYREG 95
895 #define WLC_GET_RADIOREG 96
896 #define WLC_SET_RADIOREG 97
897 #define WLC_GET_REVINFO 98
898 #define WLC_GET_UCANTDIV 99
899 #define WLC_SET_UCANTDIV 100
900 #define WLC_R_REG 101
901 #define WLC_W_REG 102
902 /* #define WLC_DIAG_LOOPBACK 103 old tray diag */
903 /* #define WLC_RESET_D11CNTS 104 */ /* -> "reset_d11cnts" iovar */
904 #define WLC_GET_MACMODE 105
905 #define WLC_SET_MACMODE 106
906 #define WLC_GET_MONITOR 107
907 #define WLC_SET_MONITOR 108
908 #define WLC_GET_GMODE 109
909 #define WLC_SET_GMODE 110
910 #define WLC_GET_LEGACY_ERP 111
911 #define WLC_SET_LEGACY_ERP 112
912 #define WLC_GET_RX_ANT 113
913 #define WLC_GET_CURR_RATESET 114 /* current rateset */
914 #define WLC_GET_SCANSUPPRESS 115
915 #define WLC_SET_SCANSUPPRESS 116
916 #define WLC_GET_AP 117
917 #define WLC_SET_AP 118
918 #define WLC_GET_EAP_RESTRICT 119
919 #define WLC_SET_EAP_RESTRICT 120
920 #define WLC_SCB_AUTHORIZE 121
921 #define WLC_SCB_DEAUTHORIZE 122
922 #define WLC_GET_WDSLIST 123
923 #define WLC_SET_WDSLIST 124
924 #define WLC_GET_ATIM 125
925 #define WLC_SET_ATIM 126
926 #define WLC_GET_RSSI 127
927 #define WLC_GET_PHYANTDIV 128
928 #define WLC_SET_PHYANTDIV 129
929 #define WLC_AP_RX_ONLY 130
930 #define WLC_GET_TX_PATH_PWR 131
931 #define WLC_SET_TX_PATH_PWR 132
932 #define WLC_GET_WSEC 133
933 #define WLC_SET_WSEC 134
934 #define WLC_GET_PHY_NOISE 135
935 #define WLC_GET_BSS_INFO 136
936 #define WLC_GET_PKTCNTS 137
937 #define WLC_GET_LAZYWDS 138
938 #define WLC_SET_LAZYWDS 139
939 #define WLC_GET_BANDLIST 140
940 #define WLC_GET_BAND 141
941 #define WLC_SET_BAND 142
942 #define WLC_SCB_DEAUTHENTICATE 143
943 #define WLC_GET_SHORTSLOT 144
944 #define WLC_GET_SHORTSLOT_OVERRIDE 145
945 #define WLC_SET_SHORTSLOT_OVERRIDE 146
946 #define WLC_GET_SHORTSLOT_RESTRICT 147
947 #define WLC_SET_SHORTSLOT_RESTRICT 148
948 #define WLC_GET_GMODE_PROTECTION 149
949 #define WLC_GET_GMODE_PROTECTION_OVERRIDE 150
950 #define WLC_SET_GMODE_PROTECTION_OVERRIDE 151
951 #define WLC_UPGRADE 152
952 /* #define WLC_GET_MRATE 153 */ /* no longer supported */
953 /* #define WLC_SET_MRATE 154 */ /* no longer supported */
954 #define WLC_GET_IGNORE_BCNS 155
955 #define WLC_SET_IGNORE_BCNS 156
956 #define WLC_GET_SCB_TIMEOUT 157
957 #define WLC_SET_SCB_TIMEOUT 158
958 #define WLC_GET_ASSOCLIST 159
959 #define WLC_GET_CLK 160
960 #define WLC_SET_CLK 161
961 #define WLC_GET_UP 162
962 #define WLC_OUT 163
963 #define WLC_GET_WPA_AUTH 164
964 #define WLC_SET_WPA_AUTH 165
965 #define WLC_GET_UCFLAGS 166
966 #define WLC_SET_UCFLAGS 167
967 #define WLC_GET_PWRIDX 168
968 #define WLC_SET_PWRIDX 169
969 #define WLC_GET_TSSI 170
970 #define WLC_GET_SUP_RATESET_OVERRIDE 171
971 #define WLC_SET_SUP_RATESET_OVERRIDE 172
972 /* #define WLC_SET_FAST_TIMER 173 */ /* no longer supported */
973 /* #define WLC_GET_FAST_TIMER 174 */ /* no longer supported */
974 /* #define WLC_SET_SLOW_TIMER 175 */ /* no longer supported */
975 /* #define WLC_GET_SLOW_TIMER 176 */ /* no longer supported */
976 /* #define WLC_DUMP_PHYREGS 177 */ /* no longer supported */
977 #define WLC_GET_PROTECTION_CONTROL 178
978 #define WLC_SET_PROTECTION_CONTROL 179
979 #define WLC_GET_PHYLIST 180
980 #define WLC_ENCRYPT_STRENGTH 181 /* ndis only */
981 #define WLC_DECRYPT_STATUS 182 /* ndis only */
982 #define WLC_GET_KEY_SEQ 183
983 #define WLC_GET_SCAN_CHANNEL_TIME 184
984 #define WLC_SET_SCAN_CHANNEL_TIME 185
985 #define WLC_GET_SCAN_UNASSOC_TIME 186
986 #define WLC_SET_SCAN_UNASSOC_TIME 187
987 #define WLC_GET_SCAN_HOME_TIME 188
988 #define WLC_SET_SCAN_HOME_TIME 189
989 #define WLC_GET_SCAN_NPROBES 190
990 #define WLC_SET_SCAN_NPROBES 191
991 #define WLC_GET_PRB_RESP_TIMEOUT 192
992 #define WLC_SET_PRB_RESP_TIMEOUT 193
993 #define WLC_GET_ATTEN 194
994 #define WLC_SET_ATTEN 195
995 #define WLC_GET_SHMEM 196 /* diag */
996 #define WLC_SET_SHMEM 197 /* diag */
997 /* #define WLC_GET_GMODE_PROTECTION_CTS 198 */ /* no longer supported */
998 /* #define WLC_SET_GMODE_PROTECTION_CTS 199 */ /* no longer supported */
999 #define WLC_SET_WSEC_TEST 200
1000 #define WLC_SCB_DEAUTHENTICATE_FOR_REASON 201
1001 #define WLC_TKIP_COUNTERMEASURES 202
1002 #define WLC_GET_PIOMODE 203
1003 #define WLC_SET_PIOMODE 204
1004 #define WLC_SET_ASSOC_PREFER 205
1005 #define WLC_GET_ASSOC_PREFER 206
1006 #define WLC_SET_ROAM_PREFER 207
1007 #define WLC_GET_ROAM_PREFER 208
1008 #define WLC_SET_LED 209
1009 #define WLC_GET_LED 210
1010 #define WLC_GET_INTERFERENCE_MODE 211
1011 #define WLC_SET_INTERFERENCE_MODE 212
1012 #define WLC_GET_CHANNEL_QA 213
1013 #define WLC_START_CHANNEL_QA 214
1014 #define WLC_GET_CHANNEL_SEL 215
1015 #define WLC_START_CHANNEL_SEL 216
1016 #define WLC_GET_VALID_CHANNELS 217
1017 #define WLC_GET_FAKEFRAG 218
1018 #define WLC_SET_FAKEFRAG 219
1019 #define WLC_GET_PWROUT_PERCENTAGE 220
1020 #define WLC_SET_PWROUT_PERCENTAGE 221
1021 #define WLC_SET_BAD_FRAME_PREEMPT 222
1022 #define WLC_GET_BAD_FRAME_PREEMPT 223
1023 #define WLC_SET_LEAP_LIST 224
1024 #define WLC_GET_LEAP_LIST 225
1025 #define WLC_GET_CWMIN 226
1026 #define WLC_SET_CWMIN 227
1027 #define WLC_GET_CWMAX 228
1028 #define WLC_SET_CWMAX 229
1029 #define WLC_GET_WET 230
1030 #define WLC_SET_WET 231
1031 #define WLC_GET_PUB 232
1032 /* #define WLC_SET_GLACIAL_TIMER 233 */ /* no longer supported */
1033 /* #define WLC_GET_GLACIAL_TIMER 234 */ /* no longer supported */
1034 #define WLC_GET_KEY_PRIMARY 235
1035 #define WLC_SET_KEY_PRIMARY 236
1036 /* #define WLC_DUMP_RADIOREGS 237 */ /* no longer supported */
1037 #define WLC_GET_ACI_ARGS 238
1038 #define WLC_SET_ACI_ARGS 239
1039 #define WLC_UNSET_CALLBACK 240
1040 #define WLC_SET_CALLBACK 241
1041 #define WLC_GET_RADAR 242
1042 #define WLC_SET_RADAR 243
1043 #define WLC_SET_SPECT_MANAGMENT 244
1044 #define WLC_GET_SPECT_MANAGMENT 245
1045 #define WLC_WDS_GET_REMOTE_HWADDR 246 /* handled in wl_linux.c/wl_vx.c */
1046 #define WLC_WDS_GET_WPA_SUP 247
1047 #define WLC_SET_CS_SCAN_TIMER 248
1048 #define WLC_GET_CS_SCAN_TIMER 249
1049 #define WLC_MEASURE_REQUEST 250
1050 #define WLC_INIT 251
1051 #define WLC_SEND_QUIET 252
1052 #define WLC_KEEPALIVE 253
1053 #define WLC_SEND_PWR_CONSTRAINT 254
1054 #define WLC_UPGRADE_STATUS 255
1055 #define WLC_CURRENT_PWR 256
1056 #define WLC_GET_SCAN_PASSIVE_TIME 257
1057 #define WLC_SET_SCAN_PASSIVE_TIME 258
1058 #define WLC_LEGACY_LINK_BEHAVIOR 259
1059 #define WLC_GET_CHANNELS_IN_COUNTRY 260
1060 #define WLC_GET_COUNTRY_LIST 261
1061 #define WLC_GET_VAR 262 /* get value of named variable */
1062 #define WLC_SET_VAR 263 /* set named variable to value */
1063 #define WLC_NVRAM_GET 264 /* deprecated */
1064 #define WLC_NVRAM_SET 265
1065 #define WLC_NVRAM_DUMP 266
1066 #define WLC_REBOOT 267
1067 #define WLC_SET_WSEC_PMK 268
1068 #define WLC_GET_AUTH_MODE 269
1069 #define WLC_SET_AUTH_MODE 270
1070 #define WLC_GET_WAKEENTRY 271
1071 #define WLC_SET_WAKEENTRY 272
1072 #define WLC_NDCONFIG_ITEM 273 /* currently handled in wl_oid.c */
1073 #define WLC_NVOTPW 274
1074 #define WLC_OTPW 275
1075 #define WLC_IOV_BLOCK_GET 276
1076 #define WLC_IOV_MODULES_GET 277
1077 #define WLC_SOFT_RESET 278
1078 #define WLC_GET_ALLOW_MODE 279
1079 #define WLC_SET_ALLOW_MODE 280
1080 #define WLC_GET_DESIRED_BSSID 281
1081 #define WLC_SET_DESIRED_BSSID 282
1082 #define WLC_DISASSOC_MYAP 283
1083 #define WLC_GET_NBANDS 284 /* for Dongle EXT_STA support */
1084 #define WLC_GET_BANDSTATES 285 /* for Dongle EXT_STA support */
1085 #define WLC_GET_WLC_BSS_INFO 286 /* for Dongle EXT_STA support */
1086 #define WLC_GET_ASSOC_INFO 287 /* for Dongle EXT_STA support */
1087 #define WLC_GET_OID_PHY 288 /* for Dongle EXT_STA support */
1088 #define WLC_SET_OID_PHY 289 /* for Dongle EXT_STA support */
1089 #define WLC_SET_ASSOC_TIME 290 /* for Dongle EXT_STA support */
1090 #define WLC_GET_DESIRED_SSID 291 /* for Dongle EXT_STA support */
1091 #define WLC_GET_CHANSPEC 292 /* for Dongle EXT_STA support */
1092 #define WLC_GET_ASSOC_STATE 293 /* for Dongle EXT_STA support */
1093 #define WLC_SET_PHY_STATE 294 /* for Dongle EXT_STA support */
1094 #define WLC_GET_SCAN_PENDING 295 /* for Dongle EXT_STA support */
1095 #define WLC_GET_SCANREQ_PENDING 296 /* for Dongle EXT_STA support */
1096 #define WLC_GET_PREV_ROAM_REASON 297 /* for Dongle EXT_STA support */
1097 #define WLC_SET_PREV_ROAM_REASON 298 /* for Dongle EXT_STA support */
1098 #define WLC_GET_BANDSTATES_PI 299 /* for Dongle EXT_STA support */
1099 #define WLC_GET_PHY_STATE 300 /* for Dongle EXT_STA support */
1100 #define WLC_GET_BSS_WPA_RSN 301 /* for Dongle EXT_STA support */
1101 #define WLC_GET_BSS_WPA2_RSN 302 /* for Dongle EXT_STA support */
1102 #define WLC_GET_BSS_BCN_TS 303 /* for Dongle EXT_STA support */
1103 #define WLC_GET_INT_DISASSOC 304 /* for Dongle EXT_STA support */
1104 #define WLC_SET_NUM_PEERS 305 /* for Dongle EXT_STA support */
1105 #define WLC_GET_NUM_BSS 306 /* for Dongle EXT_STA support */
1106 #define WLC_NPHY_SAMPLE_COLLECT 307 /* Nphy sample collect mode */
1107 #define WLC_UM_PRIV 308 /* for usermode driver private ioctl */
1108 #define WLC_GET_CMD 309
1109 /* #define WLC_LAST 310 */ /* Never used - can reuse */
1110 #define WLC_SET_INTERFERENCE_OVERRIDE_MODE 311 /* set inter mode override */
1111 #define WLC_GET_INTERFERENCE_OVERRIDE_MODE 312 /* get inter mode override */
1112 #define WLC_GET_WAI_RESTRICT 313 /* for WAPI */
1113 #define WLC_SET_WAI_RESTRICT 314 /* for WAPI */
1114 #define WLC_SET_WAI_REKEY 315 /* for WAPI */
1115 #define WLC_LAST 316 /* do not change - use get_var/set_var */
1117 #ifndef LINUX_POSTMOGRIFY_REMOVAL
1119 * Minor kludge alert:
1120 * Duplicate a few definitions that irelay requires from epiioctl.h here
1121 * so caller doesn't have to include this file and epiioctl.h .
1122 * If this grows any more, it would be time to move these irelay-specific
1123 * definitions out of the epiioctl.h and into a separate driver common file.
1125 #ifndef EPICTRL_COOKIE
1126 #define EPICTRL_COOKIE 0xABADCEDE
1127 #endif
1129 /* vx wlc ioctl's offset */
1130 #define CMN_IOCTL_OFF 0x180
1133 * custom OID support
1135 * 0xFF - implementation specific OID
1136 * 0xE4 - first byte of Broadcom PCI vendor ID
1137 * 0x14 - second byte of Broadcom PCI vendor ID
1138 * 0xXX - the custom OID number
1141 /* begin 0x1f values beyond the start of the ET driver range. */
1142 #define WL_OID_BASE 0xFFE41420
1144 /* NDIS overrides */
1145 #define OID_WL_GETINSTANCE (WL_OID_BASE + WLC_GET_INSTANCE)
1146 #define OID_WL_GET_FORCELINK (WL_OID_BASE + WLC_GET_FORCELINK)
1147 #define OID_WL_SET_FORCELINK (WL_OID_BASE + WLC_SET_FORCELINK)
1148 #define OID_WL_ENCRYPT_STRENGTH (WL_OID_BASE + WLC_ENCRYPT_STRENGTH)
1149 #define OID_WL_DECRYPT_STATUS (WL_OID_BASE + WLC_DECRYPT_STATUS)
1150 #define OID_LEGACY_LINK_BEHAVIOR (WL_OID_BASE + WLC_LEGACY_LINK_BEHAVIOR)
1151 #define OID_WL_NDCONFIG_ITEM (WL_OID_BASE + WLC_NDCONFIG_ITEM)
1153 /* EXT_STA Dongle suuport */
1154 #define OID_STA_CHANSPEC (WL_OID_BASE + WLC_GET_CHANSPEC)
1155 #define OID_STA_NBANDS (WL_OID_BASE + WLC_GET_NBANDS)
1156 #define OID_STA_GET_PHY (WL_OID_BASE + WLC_GET_OID_PHY)
1157 #define OID_STA_SET_PHY (WL_OID_BASE + WLC_SET_OID_PHY)
1158 #define OID_STA_ASSOC_TIME (WL_OID_BASE + WLC_SET_ASSOC_TIME)
1159 #define OID_STA_DESIRED_SSID (WL_OID_BASE + WLC_GET_DESIRED_SSID)
1160 #define OID_STA_SET_PHY_STATE (WL_OID_BASE + WLC_SET_PHY_STATE)
1161 #define OID_STA_SCAN_PENDING (WL_OID_BASE + WLC_GET_SCAN_PENDING)
1162 #define OID_STA_SCANREQ_PENDING (WL_OID_BASE + WLC_GET_SCANREQ_PENDING)
1163 #define OID_STA_GET_ROAM_REASON (WL_OID_BASE + WLC_GET_PREV_ROAM_REASON)
1164 #define OID_STA_SET_ROAM_REASON (WL_OID_BASE + WLC_SET_PREV_ROAM_REASON)
1165 #define OID_STA_GET_PHY_STATE (WL_OID_BASE + WLC_GET_PHY_STATE)
1166 #define OID_STA_INT_DISASSOC (WL_OID_BASE + WLC_GET_INT_DISASSOC)
1167 #define OID_STA_SET_NUM_PEERS (WL_OID_BASE + WLC_SET_NUM_PEERS)
1168 #define OID_STA_GET_NUM_BSS (WL_OID_BASE + WLC_GET_NUM_BSS)
1169 #define WL_DECRYPT_STATUS_SUCCESS 1
1170 #define WL_DECRYPT_STATUS_FAILURE 2
1171 #define WL_DECRYPT_STATUS_UNKNOWN 3
1173 /* allows user-mode app to poll the status of USB image upgrade */
1174 #define WLC_UPGRADE_SUCCESS 0
1175 #define WLC_UPGRADE_PENDING 1
1177 #ifdef CONFIG_USBRNDIS_RETAIL
1178 /* struct passed in for WLC_NDCONFIG_ITEM */
1179 typedef struct {
1180 char *name;
1181 void *param;
1182 } ndconfig_item_t;
1183 #endif
1185 #endif /* LINUX_POSTMOGRIFY_REMOVAL */
1187 /* Bit masks for radio disabled status - returned by WL_GET_RADIO */
1188 #define WL_RADIO_SW_DISABLE (1<<0)
1189 #define WL_RADIO_HW_DISABLE (1<<1)
1190 #define WL_RADIO_MPC_DISABLE (1<<2)
1191 #define WL_RADIO_COUNTRY_DISABLE (1<<3) /* some countries don't support any channel */
1193 /* Override bit for WLC_SET_TXPWR. if set, ignore other level limits */
1194 #define WL_TXPWR_OVERRIDE (1<<31)
1196 #define WL_PHY_PAVARS_LEN 6 /* Phy type, Band range, chain, a1, b0, b1 */
1198 typedef struct wl_po {
1199 uint16 phy_type; /* Phy type */
1200 uint16 band;
1201 uint16 cckpo;
1202 uint32 ofdmpo;
1203 uint16 mcspo[8];
1204 } wl_po_t;
1206 /* "diag" iovar argument and error code */
1207 #define WL_DIAG_INTERRUPT 1 /* d11 loopback interrupt test */
1208 #define WL_DIAG_LOOPBACK 2 /* d11 loopback data test */
1209 #define WL_DIAG_MEMORY 3 /* d11 memory test */
1210 #define WL_DIAG_LED 4 /* LED test */
1211 #define WL_DIAG_REG 5 /* d11/phy register test */
1212 #define WL_DIAG_SROM 6 /* srom read/crc test */
1213 #define WL_DIAG_DMA 7 /* DMA test */
1215 #define WL_DIAGERR_SUCCESS 0
1216 #define WL_DIAGERR_FAIL_TO_RUN 1 /* unable to run requested diag */
1217 #define WL_DIAGERR_NOT_SUPPORTED 2 /* diag requested is not supported */
1218 #define WL_DIAGERR_INTERRUPT_FAIL 3 /* loopback interrupt test failed */
1219 #define WL_DIAGERR_LOOPBACK_FAIL 4 /* loopback data test failed */
1220 #define WL_DIAGERR_SROM_FAIL 5 /* srom read failed */
1221 #define WL_DIAGERR_SROM_BADCRC 6 /* srom crc failed */
1222 #define WL_DIAGERR_REG_FAIL 7 /* d11/phy register test failed */
1223 #define WL_DIAGERR_MEMORY_FAIL 8 /* d11 memory test failed */
1224 #define WL_DIAGERR_NOMEM 9 /* diag test failed due to no memory */
1225 #define WL_DIAGERR_DMA_FAIL 10 /* DMA test failed */
1227 #define WL_DIAGERR_MEMORY_TIMEOUT 11 /* d11 memory test didn't finish in time */
1228 #define WL_DIAGERR_MEMORY_BADPATTERN 12 /* d11 memory test result in bad pattern */
1230 /* band types */
1231 #define WLC_BAND_AUTO 0 /* auto-select */
1232 #define WLC_BAND_5G 1 /* 5 Ghz */
1233 #define WLC_BAND_2G 2 /* 2.4 Ghz */
1234 #define WLC_BAND_ALL 3 /* all bands */
1236 /* band range returned by band_range iovar */
1237 #define WL_CHAN_FREQ_RANGE_2G 0
1238 #define WL_CHAN_FREQ_RANGE_5GL 1
1239 #define WL_CHAN_FREQ_RANGE_5GM 2
1240 #define WL_CHAN_FREQ_RANGE_5GH 3
1242 /* phy types (returned by WLC_GET_PHYTPE) */
1243 #define WLC_PHY_TYPE_A 0
1244 #define WLC_PHY_TYPE_B 1
1245 #define WLC_PHY_TYPE_G 2
1246 #define WLC_PHY_TYPE_N 4
1247 #define WLC_PHY_TYPE_LP 5
1248 #define WLC_PHY_TYPE_SSN 6 /* SSLPN-Phy value */
1249 #define WLC_PHY_TYPE_LCN 8
1250 #define WLC_PHY_TYPE_NULL 0xf
1252 /* MAC list modes */
1253 #define WLC_MACMODE_DISABLED 0 /* MAC list disabled */
1254 #define WLC_MACMODE_DENY 1 /* Deny specified (i.e. allow unspecified) */
1255 #define WLC_MACMODE_ALLOW 2 /* Allow specified (i.e. deny unspecified) */
1258 * 54g modes (basic bits may still be overridden)
1260 * GMODE_LEGACY_B Rateset: 1b, 2b, 5.5, 11
1261 * Preamble: Long
1262 * Shortslot: Off
1263 * GMODE_AUTO Rateset: 1b, 2b, 5.5b, 11b, 18, 24, 36, 54
1264 * Extended Rateset: 6, 9, 12, 48
1265 * Preamble: Long
1266 * Shortslot: Auto
1267 * GMODE_ONLY Rateset: 1b, 2b, 5.5b, 11b, 18, 24b, 36, 54
1268 * Extended Rateset: 6b, 9, 12b, 48
1269 * Preamble: Short required
1270 * Shortslot: Auto
1271 * GMODE_B_DEFERRED Rateset: 1b, 2b, 5.5b, 11b, 18, 24, 36, 54
1272 * Extended Rateset: 6, 9, 12, 48
1273 * Preamble: Long
1274 * Shortslot: On
1275 * GMODE_PERFORMANCE Rateset: 1b, 2b, 5.5b, 6b, 9, 11b, 12b, 18, 24b, 36, 48, 54
1276 * Preamble: Short required
1277 * Shortslot: On and required
1278 * GMODE_LRS Rateset: 1b, 2b, 5.5b, 11b
1279 * Extended Rateset: 6, 9, 12, 18, 24, 36, 48, 54
1280 * Preamble: Long
1281 * Shortslot: Auto
1283 #define GMODE_LEGACY_B 0
1284 #define GMODE_AUTO 1
1285 #define GMODE_ONLY 2
1286 #define GMODE_B_DEFERRED 3
1287 #define GMODE_PERFORMANCE 4
1288 #define GMODE_LRS 5
1289 #define GMODE_MAX 6
1291 /* values for PLCPHdr_override */
1292 #define WLC_PLCP_AUTO -1
1293 #define WLC_PLCP_SHORT 0
1294 #define WLC_PLCP_LONG 1
1296 /* values for g_protection_override and n_protection_override */
1297 #define WLC_PROTECTION_AUTO -1
1298 #define WLC_PROTECTION_OFF 0
1299 #define WLC_PROTECTION_ON 1
1300 #define WLC_PROTECTION_MMHDR_ONLY 2
1301 #define WLC_PROTECTION_CTS_ONLY 3
1303 /* values for g_protection_control and n_protection_control */
1304 #define WLC_PROTECTION_CTL_OFF 0
1305 #define WLC_PROTECTION_CTL_LOCAL 1
1306 #define WLC_PROTECTION_CTL_OVERLAP 2
1308 /* values for n_protection */
1309 #define WLC_N_PROTECTION_OFF 0
1310 #define WLC_N_PROTECTION_OPTIONAL 1
1311 #define WLC_N_PROTECTION_20IN40 2
1312 #define WLC_N_PROTECTION_MIXEDMODE 3
1314 /* values for n_preamble_type */
1315 #define WLC_N_PREAMBLE_MIXEDMODE 0
1316 #define WLC_N_PREAMBLE_GF 1
1317 #define WLC_N_PREAMBLE_GF_BRCM 2
1319 /* values for band specific 40MHz capabilities */
1320 #define WLC_N_BW_20ALL 0
1321 #define WLC_N_BW_40ALL 1
1322 #define WLC_N_BW_20IN2G_40IN5G 2
1324 /* values to force tx/rx chain */
1325 #define WLC_N_TXRX_CHAIN0 0
1326 #define WLC_N_TXRX_CHAIN1 1
1328 /* bitflags for SGI support (sgi_rx iovar) */
1329 #define WLC_N_SGI_20 0x01
1330 #define WLC_N_SGI_40 0x02
1332 /* Values for PM */
1333 #define PM_OFF 0
1334 #define PM_MAX 1
1335 #define PM_FAST 2
1337 /* interference mitigation options */
1338 #define INTERFERE_OVRRIDE_OFF -1 /* interference override off */
1339 #define INTERFERE_NONE 0 /* off */
1340 #define NON_WLAN 1 /* foreign/non 802.11 interference, no auto detect */
1341 #define WLAN_MANUAL 2 /* ACI: no auto detection */
1342 #define WLAN_AUTO 3 /* ACI: auto - detact */
1343 #define AUTO_ACTIVE (1 << 7) /* Auto is currently active */
1345 /* Begin: wl_aci_args_t */
1346 typedef struct wl_aci_args {
1347 int enter_aci_thresh; /* Trigger level to start detecting ACI */
1348 int exit_aci_thresh; /* Trigger level to exit ACI mode */
1349 int usec_spin; /* microsecs to delay between rssi samples */
1350 int glitch_delay; /* interval between ACI scans when glitch count is consistently high */
1351 uint16 nphy_adcpwr_enter_thresh; /* ADC power to enter ACI mitigation mode */
1352 uint16 nphy_adcpwr_exit_thresh; /* ADC power to exit ACI mitigation mode */
1353 uint16 nphy_repeat_ctr; /* Number of tries per channel to compute power */
1354 uint16 nphy_num_samples; /* Number of samples to compute power on one channel */
1355 uint16 nphy_undetect_window_sz; /* num of undetects to exit ACI Mitigation mode */
1356 uint16 nphy_b_energy_lo_aci; /* low ACI power energy threshold for bphy */
1357 uint16 nphy_b_energy_md_aci; /* mid ACI power energy threshold for bphy */
1358 uint16 nphy_b_energy_hi_aci; /* high ACI power energy threshold for bphy */
1359 } wl_aci_args_t;
1360 /* End: wl_aci_args_t */
1362 #define WL_ACI_ARGS_LEGACY_LENGTH 16 /* bytes of pre NPHY aci args */
1364 /* Begin: wl_samplecollect_args_t */
1365 typedef struct wl_samplecollect_args {
1366 uint8 coll_us;
1367 int cores;
1368 bool agc;
1369 bool filt;
1370 } wl_samplecollect_args_t;
1372 #ifndef LINUX_POSTMOGRIFY_REMOVAL
1373 /* Begin: wl_radar_args_t */
1374 typedef struct {
1375 int npulses; /* required number of pulses at n * t_int */
1376 int ncontig; /* required number of pulses at t_int */
1377 int min_pw; /* minimum pulse width (20 MHz clocks) */
1378 int max_pw; /* maximum pulse width (20 MHz clocks) */
1379 uint16 thresh0; /* Radar detection, thresh 0 */
1380 uint16 thresh1; /* Radar detection, thresh 1 */
1381 uint16 blank; /* Radar detection, blank control */
1382 uint16 fmdemodcfg; /* Radar detection, fmdemod config */
1383 int npulses_lp; /* Radar detection, minimum long pulses */
1384 int min_pw_lp; /* Minimum pulsewidth for long pulses */
1385 int max_pw_lp; /* Maximum pulsewidth for long pulses */
1386 int min_fm_lp; /* Minimum fm for long pulses */
1387 int max_span_lp; /* Maximum deltat for long pulses */
1388 int min_deltat; /* Minimum spacing between pulses */
1389 int max_deltat; /* Maximum spacing between pulses */
1390 uint16 autocorr; /* Radar detection, autocorr on or off */
1391 uint16 st_level_time; /* Radar detection, start_timing level */
1392 uint16 t2_min; /* minimum clocks needed to remain in state 2 */
1393 uint32 version; /* version */
1394 uint32 fra_pulse_err; /* sample error margin for detecting French radar pulsed */
1395 int npulses_fra; /* Radar detection, minimum French pulses set */
1396 int npulses_stg2; /* Radar detection, minimum staggered-2 pulses set */
1397 int npulses_stg3; /* Radar detection, minimum staggered-3 pulses set */
1398 uint16 percal_mask; /* defines which period cal is masked from radar detection */
1399 int quant; /* quantization resolution to pulse positions */
1400 uint32 min_burst_intv_lp; /* minimum burst to burst interval for bin3 radar */
1401 uint32 max_burst_intv_lp; /* maximum burst to burst interval for bin3 radar */
1402 int nskip_rst_lp; /* number of skipped pulses before resetting lp buffer */
1403 int max_pw_tol; /* maximum tollerance allowed in detected pulse width for radar detection */
1404 uint16 feature_mask; /* 16-bit mask to specify enabled features */
1405 } wl_radar_args_t;
1406 /* End: wl_radar_args_t */
1407 #define WL_RADAR_ARGS_VERSION 2
1409 typedef struct {
1410 uint32 version; /* version */
1411 uint16 thresh0_20_lo; /* Radar detection, thresh 0 (range 5250-5350MHz) for BW 20MHz */
1412 uint16 thresh1_20_lo; /* Radar detection, thresh 1 (range 5250-5350MHz) for BW 20MHz */
1413 uint16 thresh0_40_lo; /* Radar detection, thresh 0 (range 5250-5350MHz) for BW 40MHz */
1414 uint16 thresh1_40_lo; /* Radar detection, thresh 1 (range 5250-5350MHz) for BW 40MHz */
1415 uint16 thresh0_20_hi; /* Radar detection, thresh 0 (range 5470-5725MHz) for BW 20MHz */
1416 uint16 thresh1_20_hi; /* Radar detection, thresh 1 (range 5470-5725MHz) for BW 20MHz */
1417 uint16 thresh0_40_hi; /* Radar detection, thresh 0 (range 5470-5725MHz) for BW 40MHz */
1418 uint16 thresh1_40_hi; /* Radar detection, thresh 1 (range 5470-5725MHz) for BW 40MHz */
1419 } wl_radar_thr_t;
1420 #define WL_RADAR_THR_VERSION 1
1421 #define WL_THRESHOLD_LO_BAND 70 /* range from 5250MHz - 5350MHz */
1423 /* radar iovar SET defines */
1424 #define WL_RADAR_DETECTOR_OFF 0 /* radar detector off */
1425 #define WL_RADAR_DETECTOR_ON 1 /* radar detector on */
1426 #define WL_RADAR_SIMULATED 2 /* force radar detector to declare
1427 * detection once
1429 #define WL_RSSI_ANT_VERSION 1 /* current version of wl_rssi_ant_t */
1430 #define WL_RSSI_ANT_MAX 4 /* max possible rx antennas */
1431 #define ANTENNA_RX_MAX 2 /* max 2 receive antennas */
1432 #define ANTENNA_IDX_1 0 /* antenna index 1 */
1433 #define ANTENNA_IDX_2 1 /* antenna index 2 */
1434 #define RSSI_WINDOW_SZ 16 /* rssi window size */
1436 /* RSSI per antenna */
1437 typedef struct {
1438 uint32 version; /* version field */
1439 uint32 count; /* number of valid antenna rssi */
1440 int8 rssi_ant[WL_RSSI_ANT_MAX]; /* rssi per antenna */
1441 } wl_rssi_ant_t;
1444 /* dfs_status iovar-related defines */
1446 /* cac - channel availability check,
1447 * ism - in-service monitoring
1448 * csa - channel switching announcement
1451 /* cac state values */
1452 #define WL_DFS_CACSTATE_IDLE 0 /* state for operating in non-radar channel */
1453 #define WL_DFS_CACSTATE_PREISM_CAC 1 /* CAC in progress */
1454 #define WL_DFS_CACSTATE_ISM 2 /* ISM in progress */
1455 #define WL_DFS_CACSTATE_CSA 3 /* csa */
1456 #define WL_DFS_CACSTATE_POSTISM_CAC 4 /* ISM CAC */
1457 #define WL_DFS_CACSTATE_PREISM_OOC 5 /* PREISM OOC */
1458 #define WL_DFS_CACSTATE_POSTISM_OOC 6 /* POSTISM OOC */
1459 #define WL_DFS_CACSTATES 7 /* this many states exist */
1461 /* data structure used in 'dfs_status' wl interface, which is used to query dfs status */
1462 typedef struct {
1463 uint state; /* noted by WL_DFS_CACSTATE_XX. */
1464 uint duration; /* time spent in ms in state. */
1465 /* as dfs enters ISM state, it removes the operational channel from quiet channel
1466 * list and notes the channel in channel_cleared. set to 0 if no channel is cleared
1468 chanspec_t chanspec_cleared;
1469 /* chanspec cleared used to be a uint, add another to uint16 to maintain size */
1470 uint16 pad;
1471 } wl_dfs_status_t;
1473 /* Begin: tx_power_legacy_t */
1474 #define NUM_PWRCTRL_RATES 12
1475 typedef struct {
1476 uint8 txpwr_band_max[NUM_PWRCTRL_RATES]; /* User set target */
1477 uint8 txpwr_limit[NUM_PWRCTRL_RATES]; /* reg and local power limit */
1478 uint8 txpwr_local_max; /* local max according to the AP */
1479 uint8 txpwr_local_constraint; /* local constraint according to the AP */
1480 uint8 txpwr_chan_reg_max; /* Regulatory max for this channel */
1481 uint8 txpwr_target[2][NUM_PWRCTRL_RATES]; /* Latest target for 2.4 and 5 Ghz */
1482 uint8 txpwr_est_Pout[2]; /* Latest estimate for 2.4 and 5 Ghz */
1483 uint8 txpwr_opo[NUM_PWRCTRL_RATES]; /* On G phy, OFDM power offset */
1484 uint8 txpwr_bphy_cck_max[NUM_PWRCTRL_RATES]; /* Max CCK power for this band (SROM) */
1485 uint8 txpwr_bphy_ofdm_max; /* Max OFDM power for this band (SROM) */
1486 uint8 txpwr_aphy_max[NUM_PWRCTRL_RATES]; /* Max power for A band (SROM) */
1487 int8 txpwr_antgain[2]; /* Ant gain for each band - from SROM */
1488 uint8 txpwr_est_Pout_gofdm; /* Pwr estimate for 2.4 OFDM */
1489 } tx_power_legacy_t;
1490 /* End: tx_power_legacy_t */
1492 /* Begin: tx_power_t */
1493 #define WL_TX_POWER_RATES 45
1494 #define WL_TX_POWER_CCK_FIRST 0
1495 #define WL_TX_POWER_CCK_NUM 4
1496 #define WL_TX_POWER_OFDM_FIRST 4
1497 #define WL_TX_POWER_OFDM_NUM 8
1498 #define WL_TX_POWER_MCS20_FIRST 12
1499 #define WL_TX_POWER_MCS20_NUM 16
1500 #define WL_TX_POWER_MCS40_FIRST 28
1501 #define WL_TX_POWER_MCS40_NUM 17
1502 typedef struct {
1503 uint32 flags;
1504 chanspec_t chanspec; /* txpwr report for this channel */
1505 chanspec_t local_chanspec; /* channel on which we are associated */
1506 uint8 local_max; /* local max according to the AP */
1507 uint8 local_constraint; /* local constraint according to the AP */
1508 int8 antgain[2]; /* Ant gain for each band - from SROM */
1509 uint8 rf_cores; /* count of RF Cores being reported */
1510 uint8 est_Pout[4]; /* Latest tx power out estimate per RF chain */
1511 uint8 est_Pout_cck; /* Latest CCK tx power out estimate */
1512 uint8 user_limit[WL_TX_POWER_RATES]; /* User limit */
1513 uint8 reg_limit[WL_TX_POWER_RATES]; /* Regulatory power limit */
1514 uint8 board_limit[WL_TX_POWER_RATES]; /* Max power board can support (SROM) */
1515 uint8 target[WL_TX_POWER_RATES]; /* Latest target power */
1516 } tx_power_t;
1518 /* tx_power_t.flags bits */
1519 #define WL_TX_POWER_F_ENABLED 1
1520 #define WL_TX_POWER_F_HW 2
1521 #define WL_TX_POWER_F_MIMO 4
1523 /* End: tx_power_t */
1525 typedef struct tx_inst_power {
1526 uint8 txpwr_est_Pout[2]; /* Latest estimate for 2.4 and 5 Ghz */
1527 uint8 txpwr_est_Pout_gofdm; /* Pwr estimate for 2.4 OFDM */
1528 } tx_inst_power_t;
1530 /* 802.11h measurement types */
1531 #define WLC_MEASURE_TPC 1
1532 #define WLC_MEASURE_CHANNEL_BASIC 2
1533 #define WLC_MEASURE_CHANNEL_CCA 3
1534 #define WLC_MEASURE_CHANNEL_RPI 4
1536 /* regulatory enforcement levels */
1537 #define SPECT_MNGMT_OFF 0 /* both 11h and 11d disabled */
1538 #define SPECT_MNGMT_LOOSE_11H 1 /* allow non-11h APs in scan lists */
1539 #define SPECT_MNGMT_STRICT_11H 2 /* prune out non-11h APs from scan list */
1540 #define SPECT_MNGMT_STRICT_11D 3 /* switch to 802.11D mode */
1541 /* SPECT_MNGMT_LOOSE_11H_D - same as SPECT_MNGMT_LOOSE with the exception that Country IE
1542 * adoption is done irregardless of capability-spectrum_management
1544 #define SPECT_MNGMT_LOOSE_11H_D 4 /* operation defined above */
1546 #define WL_CHAN_VALID_HW (1 << 0) /* valid with current HW */
1547 #define WL_CHAN_VALID_SW (1 << 1) /* valid with current country setting */
1548 #define WL_CHAN_BAND_5G (1 << 2) /* 5GHz-band channel */
1549 #define WL_CHAN_RADAR (1 << 3) /* radar sensitive channel */
1550 #define WL_CHAN_INACTIVE (1 << 4) /* temporarily inactive due to radar */
1551 #define WL_CHAN_PASSIVE (1 << 5) /* channel is in passive mode */
1552 #define WL_CHAN_RESTRICTED (1 << 6) /* restricted use channel */
1554 /* BTC mode used by "btc_mode" iovar */
1555 #define WL_BTC_DISABLE 0 /* disable BT coexistence */
1556 #define WL_BTC_ENABLE (1 << 0) /* enable BT coexistence */
1557 #define WL_BTC_PREMPT (1 << 1) /* enable BT coexistence and BT preemption */
1558 #define WL_BTC_PARTIAL (1 << 2) /* enable partial BT coexistence */
1559 #define WL_BTC_DEFAULT (1 << 3) /* set the default mode for the device */
1560 #define WL_BTC_HYBRID (WL_BTC_ENABLE | WL_BTC_PARTIAL)
1562 /* BTC wire used by "btc_wire" iovar */
1563 #define WL_BTC_DEFWIRE 0 /* use default wire setting */
1564 #define WL_BTC_2WIRE 2 /* use 2-wire BTC */
1565 #define WL_BTC_3WIRE 3 /* use 3-wire BTC */
1566 /* BTC flags: BTC configuration that can be set by host */
1567 #define WL_BTC_FLAG_BT_DEF (1 << 0)
1568 #define WL_BTC_FLAG_PREMPT (1 << 1)
1569 #define WL_BTC_FLAG_ACTIVE_PROT (1 << 2)
1570 #define WL_BTC_FLAG_SIM_RSP (1 << 3)
1571 #define WL_BTC_FLAG_PS_PROTECT (1 << 4)
1572 #define WL_BTC_FLAG_SIM_TX_LP (1 << 5)
1573 #define WL_BTC_FLAG_ECI (1 << 6)
1574 #endif /* LINUX_POSTMOGRIFY_REMOVAL */
1576 /* Message levels */
1577 #define WL_ERROR_VAL 0x00000001
1578 #define WL_TRACE_VAL 0x00000002
1579 #define WL_PRHDRS_VAL 0x00000004
1580 #define WL_PRPKT_VAL 0x00000008
1581 #define WL_INFORM_VAL 0x00000010
1582 #define WL_TMP_VAL 0x00000020
1583 #define WL_OID_VAL 0x00000040
1584 #define WL_RATE_VAL 0x00000080
1585 #define WL_ASSOC_VAL 0x00000100
1586 #define WL_PRUSR_VAL 0x00000200
1587 #define WL_PS_VAL 0x00000400
1588 #define WL_TXPWR_VAL 0x00000800
1589 #define WL_PORT_VAL 0x00001000
1590 #define WL_DUAL_VAL 0x00002000
1591 #define WL_WSEC_VAL 0x00004000
1592 #define WL_WSEC_DUMP_VAL 0x00008000
1593 #define WL_LOG_VAL 0x00010000
1594 #define WL_NRSSI_VAL 0x00020000
1595 #define WL_LOFT_VAL 0x00040000
1596 #define WL_REGULATORY_VAL 0x00080000
1597 #define WL_PHYCAL_VAL 0x00100000
1598 #define WL_RADAR_VAL 0x00200000
1599 #define WL_MPC_VAL 0x00400000
1600 #define WL_APSTA_VAL 0x00800000
1601 #define WL_DFS_VAL 0x01000000
1602 #define WL_BA_VAL 0x02000000
1603 #define WL_MBSS_VAL 0x04000000
1604 #define WL_CAC_VAL 0x08000000
1605 #define WL_AMSDU_VAL 0x10000000
1606 #define WL_AMPDU_VAL 0x20000000
1607 #define WL_FFPLD_VAL 0x40000000
1609 /* wl_msg_level is full. For new bits take the next one and AND with
1610 * wl_msg_level2 in wl_dbg.h
1612 #define WL_DPT_VAL 0x00000001
1613 #define WL_SCAN_VAL 0x00000002
1614 #define WL_WOWL_VAL 0x00000004
1615 #define WL_COEX_VAL 0x00000008
1616 #define WL_RTDC_VAL 0x00000010
1617 #define WL_PHYDBG_VAL 0x00000020
1618 #define WL_CHANINT_VAL 0x00000040
1620 /* max # of leds supported by GPIO (gpio pin# == led index#) */
1621 #define WL_LED_NUMGPIO 16 /* gpio 0-15 */
1623 /* led per-pin behaviors */
1624 #define WL_LED_OFF 0 /* always off */
1625 #define WL_LED_ON 1 /* always on */
1626 #define WL_LED_ACTIVITY 2 /* activity */
1627 #define WL_LED_RADIO 3 /* radio enabled */
1628 #define WL_LED_ARADIO 4 /* 5 Ghz radio enabled */
1629 #define WL_LED_BRADIO 5 /* 2.4Ghz radio enabled */
1630 #define WL_LED_BGMODE 6 /* on if gmode, off if bmode */
1631 #define WL_LED_WI1 7
1632 #define WL_LED_WI2 8
1633 #define WL_LED_WI3 9
1634 #define WL_LED_ASSOC 10 /* associated state indicator */
1635 #define WL_LED_INACTIVE 11 /* null behavior (clears default behavior) */
1636 #define WL_LED_ASSOCACT 12 /* on when associated; blink fast for activity */
1637 #define WL_LED_WI4 13
1638 #define WL_LED_WI5 14
1639 #define WL_LED_BLINKSLOW 15 /* blink slow */
1640 #define WL_LED_BLINKMED 16 /* blink med */
1641 #define WL_LED_BLINKFAST 17 /* blink fast */
1642 #define WL_LED_BLINKCUSTOM 18 /* blink custom */
1643 #define WL_LED_BLINKPERIODIC 19 /* blink periodic (custom 1000ms / off 400ms) */
1644 #define WL_LED_ASSOC_WITH_SEC 20 /* when connected with security */
1645 /* keep on for 300 sec */
1646 #define WL_LED_START_OFF 21 /* off upon boot, could be turned on later */
1647 #define WL_LED_NUMBEHAVIOR 22
1649 /* led behavior numeric value format */
1650 #define WL_LED_BEH_MASK 0x7f /* behavior mask */
1651 #define WL_LED_AL_MASK 0x80 /* activelow (polarity) bit */
1653 /* maximum channels returned by the get valid channels iovar */
1654 #define WL_NUMCHANNELS 64
1655 #define WL_NUMCHANSPECS 100
1657 /* WDS link local endpoint WPA role */
1658 #define WL_WDS_WPA_ROLE_AUTH 0 /* authenticator */
1659 #define WL_WDS_WPA_ROLE_SUP 1 /* supplicant */
1660 #define WL_WDS_WPA_ROLE_AUTO 255 /* auto, based on mac addr value */
1662 /* number of bytes needed to define a 128-bit mask for MAC event reporting */
1663 #define WL_EVENTING_MASK_LEN 16
1665 /* Structures and constants used for "vndr_ie" IOVar interface */
1666 #define VNDR_IE_CMD_LEN 4 /* length of the set command string:
1667 * "add", "del" (+ NULL)
1670 /* 802.11 Mgmt Packet flags */
1671 #define VNDR_IE_BEACON_FLAG 0x1
1672 #define VNDR_IE_PRBRSP_FLAG 0x2
1673 #define VNDR_IE_ASSOCRSP_FLAG 0x4
1674 #define VNDR_IE_AUTHRSP_FLAG 0x8
1675 #define VNDR_IE_PRBREQ_FLAG 0x10
1676 #define VNDR_IE_ASSOCREQ_FLAG 0x20
1677 #define VNDR_IE_CUSTOM_FLAG 0x100 /* allow custom IE id */
1679 #define VNDR_IE_INFO_HDR_LEN (sizeof(uint32))
1681 typedef struct {
1682 uint32 pktflag; /* bitmask indicating which packet(s) contain this IE */
1683 vndr_ie_t vndr_ie_data; /* vendor IE data */
1684 } vndr_ie_info_t;
1686 typedef struct {
1687 int iecount; /* number of entries in the vndr_ie_list[] array */
1688 vndr_ie_info_t vndr_ie_list[1]; /* variable size list of vndr_ie_info_t structs */
1689 } vndr_ie_buf_t;
1691 typedef struct {
1692 char cmd[VNDR_IE_CMD_LEN]; /* vndr_ie IOVar set command : "add", "del" + NULL */
1693 vndr_ie_buf_t vndr_ie_buffer; /* buffer containing Vendor IE list information */
1694 } vndr_ie_setbuf_t;
1696 /* join preference iovar value */
1698 * Join preference iovar value is an array of tuples. Each tuple has a one-byte type,
1699 * a one-byte length, and a variable length value. RSSI type tuple must be present
1700 * in the array.
1702 * Types are defined in "join preference types" section.
1704 * Length is the value size in octets. It is reserved for WL_JOIN_PREF_WPA type tuple
1705 * and must be set to zero.
1707 * Values are defined below.
1709 * 1. RSSI - 2 octets
1710 * offset 0: reserved
1711 * offset 1: reserved
1713 * 2. WPA - 2 + 12 * n octets (n is # tuples defined below)
1714 * offset 0: reserved
1715 * offset 1: # of tuples
1716 * offset 2: tuple 1
1717 * offset 14: tuple 2
1718 * ...
1719 * offset 2 + 12 * (n - 1) octets: tuple n
1721 * struct wpa_cfg_tuple {
1722 * uint8 akm[DOT11_OUI_LEN+1]; akm suite
1723 * uint8 ucipher[DOT11_OUI_LEN+1]; unicast cipher suite
1724 * uint8 mcipher[DOT11_OUI_LEN+1]; multicast cipher suite
1725 * };
1727 * multicast cipher suite can be specified as a specific cipher suite or WL_WPA_ACP_MCS_ANY.
1729 * 3. BAND - 2 octets
1730 * offset 0: reserved
1731 * offset 1: see "band preference" and "band types"
1733 * 4. BAND RSSI - 2 octets
1734 * offset 0: band types
1735 * offset 1: +ve RSSI boost balue in dB
1737 /* join preference types */
1738 #define WL_JOIN_PREF_RSSI 1 /* by RSSI */
1739 #define WL_JOIN_PREF_WPA 2 /* by akm and ciphers */
1740 #define WL_JOIN_PREF_BAND 3 /* by 802.11 band */
1741 #define WL_JOIN_PREF_RSSI_DELTA 4 /* by 802.11 band only if RSSI delta condition matches */
1743 /* band preference */
1744 #define WLJP_BAND_ASSOC_PREF 255 /* use what WLC_SET_ASSOC_PREFER ioctl specifies */
1746 /* any multicast cipher suite */
1747 #define WL_WPA_ACP_MCS_ANY "\x00\x00\x00\x00"
1749 struct tsinfo_arg {
1750 uint8 octets[3];
1753 #if !defined(__GNUC__)
1754 #pragma pack(pop)
1755 #endif
1757 #define NFIFO 6 /* # tx/rx fifopairs */
1759 #define WL_CNT_T_VERSION 6 /* current version of wl_cnt_t struct */
1761 typedef struct {
1762 uint16 version; /* see definition of WL_CNT_T_VERSION */
1763 uint16 length; /* length of entire structure */
1765 /* transmit stat counters */
1766 uint32 txframe; /* tx data frames */
1767 uint32 txbyte; /* tx data bytes */
1768 uint32 txretrans; /* tx mac retransmits */
1769 uint32 txerror; /* tx data errors (derived: sum of others) */
1770 uint32 txctl; /* tx management frames */
1771 uint32 txprshort; /* tx short preamble frames */
1772 uint32 txserr; /* tx status errors */
1773 uint32 txnobuf; /* tx out of buffers errors */
1774 uint32 txnoassoc; /* tx discard because we're not associated */
1775 uint32 txrunt; /* tx runt frames */
1776 uint32 txchit; /* tx header cache hit (fastpath) */
1777 uint32 txcmiss; /* tx header cache miss (slowpath) */
1779 /* transmit chip error counters */
1780 uint32 txuflo; /* tx fifo underflows */
1781 uint32 txphyerr; /* tx phy errors (indicated in tx status) */
1782 uint32 txphycrs;
1784 /* receive stat counters */
1785 uint32 rxframe; /* rx data frames */
1786 uint32 rxbyte; /* rx data bytes */
1787 uint32 rxerror; /* rx data errors (derived: sum of others) */
1788 uint32 rxctl; /* rx management frames */
1789 uint32 rxnobuf; /* rx out of buffers errors */
1790 uint32 rxnondata; /* rx non data frames in the data channel errors */
1791 uint32 rxbadds; /* rx bad DS errors */
1792 uint32 rxbadcm; /* rx bad control or management frames */
1793 uint32 rxfragerr; /* rx fragmentation errors */
1794 uint32 rxrunt; /* rx runt frames */
1795 uint32 rxgiant; /* rx giant frames */
1796 uint32 rxnoscb; /* rx no scb error */
1797 uint32 rxbadproto; /* rx invalid frames */
1798 uint32 rxbadsrcmac; /* rx frames with Invalid Src Mac */
1799 uint32 rxbadda; /* rx frames tossed for invalid da */
1800 uint32 rxfilter; /* rx frames filtered out */
1802 /* receive chip error counters */
1803 uint32 rxoflo; /* rx fifo overflow errors */
1804 uint32 rxuflo[NFIFO]; /* rx dma descriptor underflow errors */
1806 uint32 d11cnt_txrts_off; /* d11cnt txrts value when reset d11cnt */
1807 uint32 d11cnt_rxcrc_off; /* d11cnt rxcrc value when reset d11cnt */
1808 uint32 d11cnt_txnocts_off; /* d11cnt txnocts value when reset d11cnt */
1810 /* misc counters */
1811 uint32 dmade; /* tx/rx dma descriptor errors */
1812 uint32 dmada; /* tx/rx dma data errors */
1813 uint32 dmape; /* tx/rx dma descriptor protocol errors */
1814 uint32 reset; /* reset count */
1815 uint32 tbtt; /* cnts the TBTT int's */
1816 uint32 txdmawar;
1817 uint32 pkt_callback_reg_fail; /* callbacks register failure */
1819 /* MAC counters: 32-bit version of d11.h's macstat_t */
1820 uint32 txallfrm; /* total number of frames sent, incl. Data, ACK, RTS, CTS,
1821 * Control Management (includes retransmissions)
1823 uint32 txrtsfrm; /* number of RTS sent out by the MAC */
1824 uint32 txctsfrm; /* number of CTS sent out by the MAC */
1825 uint32 txackfrm; /* number of ACK frames sent out */
1826 uint32 txdnlfrm; /* Not used */
1827 uint32 txbcnfrm; /* beacons transmitted */
1828 uint32 txfunfl[8]; /* per-fifo tx underflows */
1829 uint32 txtplunfl; /* Template underflows (mac was too slow to transmit ACK/CTS
1830 * or BCN)
1832 uint32 txphyerror; /* Transmit phy error, type of error is reported in tx-status for
1833 * driver enqueued frames
1835 uint32 rxfrmtoolong; /* Received frame longer than legal limit (2346 bytes) */
1836 uint32 rxfrmtooshrt; /* Received frame did not contain enough bytes for its frame type */
1837 uint32 rxinvmachdr; /* Either the protocol version != 0 or frame type not
1838 * data/control/management
1840 uint32 rxbadfcs; /* number of frames for which the CRC check failed in the MAC */
1841 uint32 rxbadplcp; /* parity check of the PLCP header failed */
1842 uint32 rxcrsglitch; /* PHY was able to correlate the preamble but not the header */
1843 uint32 rxstrt; /* Number of received frames with a good PLCP
1844 * (i.e. passing parity check)
1846 uint32 rxdfrmucastmbss; /* Number of received DATA frames with good FCS and matching RA */
1847 uint32 rxmfrmucastmbss; /* number of received mgmt frames with good FCS and matching RA */
1848 uint32 rxcfrmucast; /* number of received CNTRL frames with good FCS and matching RA */
1849 uint32 rxrtsucast; /* number of unicast RTS addressed to the MAC (good FCS) */
1850 uint32 rxctsucast; /* number of unicast CTS addressed to the MAC (good FCS) */
1851 uint32 rxackucast; /* number of ucast ACKS received (good FCS) */
1852 uint32 rxdfrmocast; /* number of received DATA frames (good FCS and not matching RA) */
1853 uint32 rxmfrmocast; /* number of received MGMT frames (good FCS and not matching RA) */
1854 uint32 rxcfrmocast; /* number of received CNTRL frame (good FCS and not matching RA) */
1855 uint32 rxrtsocast; /* number of received RTS not addressed to the MAC */
1856 uint32 rxctsocast; /* number of received CTS not addressed to the MAC */
1857 uint32 rxdfrmmcast; /* number of RX Data multicast frames received by the MAC */
1858 uint32 rxmfrmmcast; /* number of RX Management multicast frames received by the MAC */
1859 uint32 rxcfrmmcast; /* number of RX Control multicast frames received by the MAC
1860 * (unlikely to see these)
1862 uint32 rxbeaconmbss; /* beacons received from member of BSS */
1863 uint32 rxdfrmucastobss; /* number of unicast frames addressed to the MAC from
1864 * other BSS (WDS FRAME)
1866 uint32 rxbeaconobss; /* beacons received from other BSS */
1867 uint32 rxrsptmout; /* Number of response timeouts for transmitted frames
1868 * expecting a response
1870 uint32 bcntxcancl; /* transmit beacons canceled due to receipt of beacon (IBSS) */
1871 uint32 rxf0ovfl; /* Number of receive fifo 0 overflows */
1872 uint32 rxf1ovfl; /* Number of receive fifo 1 overflows (obsolete) */
1873 uint32 rxf2ovfl; /* Number of receive fifo 2 overflows (obsolete) */
1874 uint32 txsfovfl; /* Number of transmit status fifo overflows (obsolete) */
1875 uint32 pmqovfl; /* Number of PMQ overflows */
1876 uint32 rxcgprqfrm; /* Number of received Probe requests that made it into
1877 * the PRQ fifo
1879 uint32 rxcgprsqovfl; /* Rx Probe Request Que overflow in the AP */
1880 uint32 txcgprsfail; /* Tx Probe Response Fail. AP sent probe response but did
1881 * not get ACK
1883 uint32 txcgprssuc; /* Tx Probe Response Success (ACK was received) */
1884 uint32 prs_timeout; /* Number of probe requests that were dropped from the PRQ
1885 * fifo because a probe response could not be sent out within
1886 * the time limit defined in M_PRS_MAXTIME
1888 uint32 rxnack;
1889 uint32 frmscons;
1890 uint32 txnack;
1891 uint32 txglitch_nack; /* obsolete */
1892 uint32 txburst; /* obsolete */
1894 /* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
1895 uint32 txfrag; /* dot11TransmittedFragmentCount */
1896 uint32 txmulti; /* dot11MulticastTransmittedFrameCount */
1897 uint32 txfail; /* dot11FailedCount */
1898 uint32 txretry; /* dot11RetryCount */
1899 uint32 txretrie; /* dot11MultipleRetryCount */
1900 uint32 rxdup; /* dot11FrameduplicateCount */
1901 uint32 txrts; /* dot11RTSSuccessCount */
1902 uint32 txnocts; /* dot11RTSFailureCount */
1903 uint32 txnoack; /* dot11ACKFailureCount */
1904 uint32 rxfrag; /* dot11ReceivedFragmentCount */
1905 uint32 rxmulti; /* dot11MulticastReceivedFrameCount */
1906 uint32 rxcrc; /* dot11FCSErrorCount */
1907 uint32 txfrmsnt; /* dot11TransmittedFrameCount (bogus MIB?) */
1908 uint32 rxundec; /* dot11WEPUndecryptableCount */
1910 /* WPA2 counters (see rxundec for DecryptFailureCount) */
1911 uint32 tkipmicfaill; /* TKIPLocalMICFailures */
1912 uint32 tkipcntrmsr; /* TKIPCounterMeasuresInvoked */
1913 uint32 tkipreplay; /* TKIPReplays */
1914 uint32 ccmpfmterr; /* CCMPFormatErrors */
1915 uint32 ccmpreplay; /* CCMPReplays */
1916 uint32 ccmpundec; /* CCMPDecryptErrors */
1917 uint32 fourwayfail; /* FourWayHandshakeFailures */
1918 uint32 wepundec; /* dot11WEPUndecryptableCount */
1919 uint32 wepicverr; /* dot11WEPICVErrorCount */
1920 uint32 decsuccess; /* DecryptSuccessCount */
1921 uint32 tkipicverr; /* TKIPICVErrorCount */
1922 uint32 wepexcluded; /* dot11WEPExcludedCount */
1924 uint32 txchanrej; /* Tx frames suppressed due to channel rejection */
1925 uint32 txexptime; /* Tx frames suppressed due to timer expiration */
1926 uint32 psmwds; /* Count PSM watchdogs */
1927 uint32 phywatchdog; /* Count Phy watchdogs (triggered by ucode) */
1929 /* MBSS counters, AP only */
1930 uint32 prq_entries_handled; /* PRQ entries read in */
1931 uint32 prq_undirected_entries; /* which were bcast bss & ssid */
1932 uint32 prq_bad_entries; /* which could not be translated to info */
1933 uint32 atim_suppress_count; /* TX suppressions on ATIM fifo */
1934 uint32 bcn_template_not_ready; /* Template marked in use on send bcn ... */
1935 uint32 bcn_template_not_ready_done; /* ...but "DMA done" interrupt rcvd */
1936 uint32 late_tbtt_dpc; /* TBTT DPC did not happen in time */
1938 /* per-rate receive stat counters */
1939 uint32 rx1mbps; /* packets rx at 1Mbps */
1940 uint32 rx2mbps; /* packets rx at 2Mbps */
1941 uint32 rx5mbps5; /* packets rx at 5.5Mbps */
1942 uint32 rx6mbps; /* packets rx at 6Mbps */
1943 uint32 rx9mbps; /* packets rx at 9Mbps */
1944 uint32 rx11mbps; /* packets rx at 11Mbps */
1945 uint32 rx12mbps; /* packets rx at 12Mbps */
1946 uint32 rx18mbps; /* packets rx at 18Mbps */
1947 uint32 rx24mbps; /* packets rx at 24Mbps */
1948 uint32 rx36mbps; /* packets rx at 36Mbps */
1949 uint32 rx48mbps; /* packets rx at 48Mbps */
1950 uint32 rx54mbps; /* packets rx at 54Mbps */
1951 uint32 rx108mbps; /* packets rx at 108mbps */
1952 uint32 rx162mbps; /* packets rx at 162mbps */
1953 uint32 rx216mbps; /* packets rx at 216 mbps */
1954 uint32 rx270mbps; /* packets rx at 270 mbps */
1955 uint32 rx324mbps; /* packets rx at 324 mbps */
1956 uint32 rx378mbps; /* packets rx at 378 mbps */
1957 uint32 rx432mbps; /* packets rx at 432 mbps */
1958 uint32 rx486mbps; /* packets rx at 486 mbps */
1959 uint32 rx540mbps; /* packets rx at 540 mbps */
1961 /* pkteng rx frame stats */
1962 uint32 pktengrxducast; /* unicast frames rxed by the pkteng code */
1963 uint32 pktengrxdmcast; /* multicast frames rxed by the pkteng code */
1965 uint32 rfdisable; /* count of radio disables */
1966 uint32 bphy_rxcrsglitch; /* PHY count of bphy glitches */
1968 uint32 txmpdu_sgi; /* count for sgi transmit */
1969 uint32 rxmpdu_sgi; /* count for sgi received */
1970 uint32 txmpdu_stbc; /* count for stbc transmit */
1971 uint32 rxmpdu_stbc; /* count for stbc received */
1972 } wl_cnt_t;
1974 #ifndef LINUX_POSTMOGRIFY_REMOVAL
1975 #define WL_DELTA_STATS_T_VERSION 1 /* current version of wl_delta_stats_t struct */
1977 typedef struct {
1978 uint16 version; /* see definition of WL_DELTA_STATS_T_VERSION */
1979 uint16 length; /* length of entire structure */
1981 /* transmit stat counters */
1982 uint32 txframe; /* tx data frames */
1983 uint32 txbyte; /* tx data bytes */
1984 uint32 txretrans; /* tx mac retransmits */
1985 uint32 txfail; /* tx failures */
1987 /* receive stat counters */
1988 uint32 rxframe; /* rx data frames */
1989 uint32 rxbyte; /* rx data bytes */
1991 /* per-rate receive stat counters */
1992 uint32 rx1mbps; /* packets rx at 1Mbps */
1993 uint32 rx2mbps; /* packets rx at 2Mbps */
1994 uint32 rx5mbps5; /* packets rx at 5.5Mbps */
1995 uint32 rx6mbps; /* packets rx at 6Mbps */
1996 uint32 rx9mbps; /* packets rx at 9Mbps */
1997 uint32 rx11mbps; /* packets rx at 11Mbps */
1998 uint32 rx12mbps; /* packets rx at 12Mbps */
1999 uint32 rx18mbps; /* packets rx at 18Mbps */
2000 uint32 rx24mbps; /* packets rx at 24Mbps */
2001 uint32 rx36mbps; /* packets rx at 36Mbps */
2002 uint32 rx48mbps; /* packets rx at 48Mbps */
2003 uint32 rx54mbps; /* packets rx at 54Mbps */
2004 uint32 rx108mbps; /* packets rx at 108mbps */
2005 uint32 rx162mbps; /* packets rx at 162mbps */
2006 uint32 rx216mbps; /* packets rx at 216 mbps */
2007 uint32 rx270mbps; /* packets rx at 270 mbps */
2008 uint32 rx324mbps; /* packets rx at 324 mbps */
2009 uint32 rx378mbps; /* packets rx at 378 mbps */
2010 uint32 rx432mbps; /* packets rx at 432 mbps */
2011 uint32 rx486mbps; /* packets rx at 486 mbps */
2012 uint32 rx540mbps; /* packets rx at 540 mbps */
2013 } wl_delta_stats_t;
2014 #endif /* LINUX_POSTMOGRIFY_REMOVAL */
2016 #define WL_WME_CNT_VERSION 1 /* current version of wl_wme_cnt_t */
2018 typedef struct {
2019 uint32 packets;
2020 uint32 bytes;
2021 } wl_traffic_stats_t;
2023 typedef struct {
2024 uint16 version; /* see definition of WL_WME_CNT_VERSION */
2025 uint16 length; /* length of entire structure */
2027 wl_traffic_stats_t tx[AC_COUNT]; /* Packets transmitted */
2028 wl_traffic_stats_t tx_failed[AC_COUNT]; /* Packets dropped or failed to transmit */
2029 wl_traffic_stats_t rx[AC_COUNT]; /* Packets received */
2030 wl_traffic_stats_t rx_failed[AC_COUNT]; /* Packets failed to receive */
2032 wl_traffic_stats_t forward[AC_COUNT]; /* Packets forwarded by AP */
2034 wl_traffic_stats_t tx_expired[AC_COUNT]; /* packets dropped due to lifetime expiry */
2036 } wl_wme_cnt_t;
2038 struct wl_msglevel2 {
2039 uint32 low;
2040 uint32 high;
2043 #ifndef LINUX_POSTMOGRIFY_REMOVAL
2044 #ifdef WLBA
2046 #define WLC_BA_CNT_VERSION 1 /* current version of wlc_ba_cnt_t */
2048 /* block ack related stats */
2049 typedef struct wlc_ba_cnt {
2050 uint16 version; /* WLC_BA_CNT_VERSION */
2051 uint16 length; /* length of entire structure */
2053 /* transmit stat counters */
2054 uint32 txpdu; /* pdus sent */
2055 uint32 txsdu; /* sdus sent */
2056 uint32 txfc; /* tx side flow controlled packets */
2057 uint32 txfci; /* tx side flow control initiated */
2058 uint32 txretrans; /* retransmitted pdus */
2059 uint32 txbatimer; /* ba resend due to timer */
2060 uint32 txdrop; /* dropped packets */
2061 uint32 txaddbareq; /* addba req sent */
2062 uint32 txaddbaresp; /* addba resp sent */
2063 uint32 txdelba; /* delba sent */
2064 uint32 txba; /* ba sent */
2065 uint32 txbar; /* bar sent */
2066 uint32 txpad[4]; /* future */
2068 /* receive side counters */
2069 uint32 rxpdu; /* pdus recd */
2070 uint32 rxqed; /* pdus buffered before sending up */
2071 uint32 rxdup; /* duplicate pdus */
2072 uint32 rxnobuf; /* pdus discarded due to no buf */
2073 uint32 rxaddbareq; /* addba req recd */
2074 uint32 rxaddbaresp; /* addba resp recd */
2075 uint32 rxdelba; /* delba recd */
2076 uint32 rxba; /* ba recd */
2077 uint32 rxbar; /* bar recd */
2078 uint32 rxinvba; /* invalid ba recd */
2079 uint32 rxbaholes; /* ba recd with holes */
2080 uint32 rxunexp; /* unexpected packets */
2081 uint32 rxpad[4]; /* future */
2082 } wlc_ba_cnt_t;
2083 #endif /* WLBA */
2085 /* structure for per-tid ampdu control */
2086 struct ampdu_tid_control {
2087 uint8 tid; /* tid */
2088 uint8 enable; /* enable/disable */
2091 /* structure for identifying ea/tid for sending addba/delba */
2092 struct ampdu_ea_tid {
2093 struct ether_addr ea; /* Station address */
2094 uint8 tid; /* tid */
2097 /* structure for identifying retry/tid for retry_limit_tid/rr_retry_limit_tid */
2098 struct ampdu_retry_tid {
2099 uint8 tid; /* tid */
2100 uint8 retry; /* retry value */
2103 /* Different discovery modes for dpt */
2104 #define DPT_DISCOVERY_MANUAL 0x01 /* manual discovery mode */
2105 #define DPT_DISCOVERY_AUTO 0x02 /* auto discovery mode */
2106 #define DPT_DISCOVERY_SCAN 0x04 /* scan-based discovery mode */
2108 /* different path selection values */
2109 #define DPT_PATHSEL_AUTO 0 /* auto mode for path selection */
2110 #define DPT_PATHSEL_DIRECT 1 /* always use direct DPT path */
2111 #define DPT_PATHSEL_APPATH 2 /* always use AP path */
2113 /* different ops for deny list */
2114 #define DPT_DENY_LIST_ADD 1 /* add to dpt deny list */
2115 #define DPT_DENY_LIST_REMOVE 2 /* remove from dpt deny list */
2117 /* different ops for manual end point */
2118 #define DPT_MANUAL_EP_CREATE 1 /* create manual dpt endpoint */
2119 #define DPT_MANUAL_EP_MODIFY 2 /* modify manual dpt endpoint */
2120 #define DPT_MANUAL_EP_DELETE 3 /* delete manual dpt endpoint */
2122 /* structure for dpt iovars */
2123 typedef struct dpt_iovar {
2124 struct ether_addr ea; /* Station address */
2125 uint8 mode; /* mode: depends on iovar */
2126 uint32 pad; /* future */
2127 } dpt_iovar_t;
2129 /* flags to indicate DPT status */
2130 #define DPT_STATUS_ACTIVE 0x01 /* link active (though may be suspended) */
2131 #define DPT_STATUS_AES 0x02 /* link secured through AES encryption */
2132 #define DPT_STATUS_FAILED 0x04 /* DPT link failed */
2134 #define DPT_FNAME_LEN 48 /* Max length of friendly name */
2136 typedef struct dpt_status {
2137 uint8 status; /* flags to indicate status */
2138 uint8 fnlen; /* length of friendly name */
2139 uchar name[DPT_FNAME_LEN]; /* friendly name */
2140 uint32 rssi; /* RSSI of the link */
2141 sta_info_t sta; /* sta info */
2142 } dpt_status_t;
2144 /* structure for dpt list */
2145 typedef struct dpt_list {
2146 uint32 num; /* number of entries in struct */
2147 dpt_status_t status[1]; /* per station info */
2148 } dpt_list_t;
2150 /* structure for dpt friendly name */
2151 typedef struct dpt_fname {
2152 uint8 len; /* length of friendly name */
2153 uchar name[DPT_FNAME_LEN]; /* friendly name */
2154 } dpt_fname_t;
2156 /* structure for addts arguments */
2157 /* For ioctls that take a list of TSPEC */
2158 struct tslist {
2159 int count; /* number of tspecs */
2160 struct tsinfo_arg tsinfo[1]; /* variable length array of tsinfo */
2163 /* structure for addts/delts arguments */
2164 typedef struct tspec_arg {
2165 uint16 version; /* see definition of TSPEC_ARG_VERSION */
2166 uint16 length; /* length of entire structure */
2167 uint flag; /* bit field */
2168 /* TSPEC Arguments */
2169 struct tsinfo_arg tsinfo; /* TS Info bit field */
2170 uint16 nom_msdu_size; /* (Nominal or fixed) MSDU Size (bytes) */
2171 uint16 max_msdu_size; /* Maximum MSDU Size (bytes) */
2172 uint min_srv_interval; /* Minimum Service Interval (us) */
2173 uint max_srv_interval; /* Maximum Service Interval (us) */
2174 uint inactivity_interval; /* Inactivity Interval (us) */
2175 uint suspension_interval; /* Suspension Interval (us) */
2176 uint srv_start_time; /* Service Start Time (us) */
2177 uint min_data_rate; /* Minimum Data Rate (bps) */
2178 uint mean_data_rate; /* Mean Data Rate (bps) */
2179 uint peak_data_rate; /* Peak Data Rate (bps) */
2180 uint max_burst_size; /* Maximum Burst Size (bytes) */
2181 uint delay_bound; /* Delay Bound (us) */
2182 uint min_phy_rate; /* Minimum PHY Rate (bps) */
2183 uint16 surplus_bw; /* Surplus Bandwidth Allowance (range 1.0 to 8.0) */
2184 uint16 medium_time; /* Medium Time (32 us/s periods) */
2185 uint8 dialog_token; /* dialog token */
2186 } tspec_arg_t;
2188 /* tspec arg for desired station */
2189 typedef struct tspec_per_sta_arg {
2190 struct ether_addr ea;
2191 struct tspec_arg ts;
2192 } tspec_per_sta_arg_t;
2194 /* structure for max bandwidth for each access category */
2195 typedef struct wme_max_bandwidth {
2196 uint32 ac[AC_COUNT]; /* max bandwidth for each access category */
2197 } wme_max_bandwidth_t;
2199 #define WL_WME_MBW_PARAMS_IO_BYTES (sizeof(wme_max_bandwidth_t))
2201 /* current version of wl_tspec_arg_t struct */
2202 #define TSPEC_ARG_VERSION 2 /* current version of wl_tspec_arg_t struct */
2203 #define TSPEC_ARG_LENGTH 55 /* argment length from tsinfo to medium_time */
2204 #define TSPEC_DEFAULT_DIALOG_TOKEN 42 /* default dialog token */
2205 #define TSPEC_DEFAULT_SBW_FACTOR 0x3000 /* default surplus bw */
2208 /* define for flag */
2209 #define TSPEC_PENDING 0 /* TSPEC pending */
2210 #define TSPEC_ACCEPTED 1 /* TSPEC accepted */
2211 #define TSPEC_REJECTED 2 /* TSPEC rejected */
2212 #define TSPEC_UNKNOWN 3 /* TSPEC unknown */
2213 #define TSPEC_STATUS_MASK 7 /* TSPEC status mask */
2216 /* Software feature flag defines used by wlfeatureflag */
2217 #ifdef WLAFTERBURNER
2218 #define WL_SWFL_ABBFL 0x0001 /* Allow Afterburner on systems w/o hardware BFL */
2219 #define WL_SWFL_ABENCORE 0x0002 /* Allow AB on non-4318E chips */
2220 #endif /* WLAFTERBURNER */
2221 #define WL_SWFL_NOHWRADIO 0x0004
2222 #define WL_SWFL_FLOWCONTROL 0x0008 /* Enable backpressure to OS stack */
2223 #define WL_SWFL_WLBSSSORT 0x0010 /* Per-port supports sorting of BSS */
2225 #define WL_LIFETIME_MAX 0xFFFF /* Max value in ms */
2227 /* Packet lifetime configuration per ac */
2228 typedef struct wl_lifetime {
2229 uint32 ac; /* access class */
2230 uint32 lifetime; /* Packet lifetime value in ms */
2231 } wl_lifetime_t;
2234 /* Channel Switch Announcement param */
2235 typedef struct wl_chan_switch {
2236 uint8 mode; /* value 0 or 1 */
2237 uint8 count; /* count # of beacons before switching */
2238 chanspec_t chspec; /* chanspec */
2239 uint8 reg; /* regulatory class */
2240 } wl_chan_switch_t;
2241 #endif /* LINUX_POSTMOGRIFY_REMOVAL */
2243 /* Roaming trigger definitions for WLC_SET_ROAM_TRIGGER.
2245 * (-100 < value < 0) value is used directly as a roaming trigger in dBm
2246 * (0 <= value) value specifies a logical roaming trigger level from
2247 * the list below
2249 * WLC_GET_ROAM_TRIGGER always returns roaming trigger value in dBm, never
2250 * the logical roam trigger value.
2252 #define WLC_ROAM_TRIGGER_DEFAULT 0 /* default roaming trigger */
2253 #define WLC_ROAM_TRIGGER_BANDWIDTH 1 /* optimize for bandwidth roaming trigger */
2254 #define WLC_ROAM_TRIGGER_DISTANCE 2 /* optimize for distance roaming trigger */
2255 #define WLC_ROAM_TRIGGER_AUTO 3 /* auto-detect environment */
2256 #define WLC_ROAM_TRIGGER_MAX_VALUE 3 /* max. valid value */
2258 /* Preferred Network Offload (PNO, formerly PFN) defines */
2259 enum {
2260 PFN_LIST_ORDER,
2261 PFN_RSSI,
2262 PFN_AUTO_CONNECT
2265 enum {
2266 DISABLE,
2267 ENABLE
2270 #define SORT_CRITERIA_BIT 0
2271 #define AUTO_NET_SWITCH_BIT 1
2272 #define ENABLE_BKGRD_SCAN_BIT 2
2273 #define IMMEDIATE_SCAN_BIT 3
2274 #define AUTO_CONNECT_BIT 4
2276 #define SORT_CRITERIA_MASK 0x01
2277 #define AUTO_NET_SWITCH_MASK 0x02
2278 #define ENABLE_BKGRD_SCAN_MASK 0x04
2279 #define IMMEDIATE_SCAN_MASK 0x08
2280 #define AUTO_CONNECT_MASK 0x10
2282 #define PFN_VERSION 1
2284 /* PFN data structure */
2285 typedef struct wl_pfn_param {
2286 int32 version; /* version field */
2287 int32 scan_freq; /* Scan frequency */
2288 int32 lost_network_timeout; /* Timeout in sec. to declare
2289 * discovered network as lost
2291 int16 flags; /* Bit field to control feature
2292 * of PFN such as sort criteria auto
2293 * enable switch and back ground scan
2295 int16 rssi_margin; /* Margin to avoid jitter for choosing a
2296 * PFN based on RSSI sort criteria
2298 } wl_pfn_param_t;
2300 typedef struct wl_pfn {
2301 wlc_ssid_t ssid; /* ssid name and its length */
2302 int32 bss_type; /* IBSS or infrastructure */
2303 int32 infra; /* BSS Vs IBSS */
2304 int32 auth; /* Open Vs Closed */
2305 int32 wpa_auth; /* WPA type */
2306 int32 wsec; /* wsec value */
2307 union {
2308 wl_wsec_key_t sec_key; /* Security Settings for WEP */
2309 wsec_pmk_t wpa_sec_key; /* Security setting for WPA */
2310 } pfn_security;
2311 } wl_pfn_t;
2313 /* TCP Checksum Offload defines */
2314 #define TOE_TX_CSUM_OL 0x00000001
2315 #define TOE_RX_CSUM_OL 0x00000002
2317 /* TCP Checksum Offload error injection for testing */
2318 #define TOE_ERRTEST_TX_CSUM 0x00000001
2319 #define TOE_ERRTEST_RX_CSUM 0x00000002
2320 #define TOE_ERRTEST_RX_CSUM2 0x00000004
2322 struct toe_ol_stats_t {
2323 /* Num of tx packets that don't need to be checksummed */
2324 uint32 tx_summed;
2326 /* Num of tx packets where checksum is filled by offload engine */
2327 uint32 tx_iph_fill;
2328 uint32 tx_tcp_fill;
2329 uint32 tx_udp_fill;
2330 uint32 tx_icmp_fill;
2332 /* Num of rx packets where toe finds out if checksum is good or bad */
2333 uint32 rx_iph_good;
2334 uint32 rx_iph_bad;
2335 uint32 rx_tcp_good;
2336 uint32 rx_tcp_bad;
2337 uint32 rx_udp_good;
2338 uint32 rx_udp_bad;
2339 uint32 rx_icmp_good;
2340 uint32 rx_icmp_bad;
2342 /* Num of tx packets in which csum error is injected */
2343 uint32 tx_tcp_errinj;
2344 uint32 tx_udp_errinj;
2345 uint32 tx_icmp_errinj;
2347 /* Num of rx packets in which csum error is injected */
2348 uint32 rx_tcp_errinj;
2349 uint32 rx_udp_errinj;
2350 uint32 rx_icmp_errinj;
2353 /* ARP Offload feature flags for arp_ol iovar */
2354 #define ARP_OL_AGENT 0x00000001
2355 #define ARP_OL_SNOOP 0x00000002
2356 #define ARP_OL_HOST_AUTO_REPLY 0x00000004
2357 #define ARP_OL_PEER_AUTO_REPLY 0x00000008
2359 /* ARP Offload error injection */
2360 #define ARP_ERRTEST_REPLY_PEER 0x1
2361 #define ARP_ERRTEST_REPLY_HOST 0x2
2363 #define ARP_MULTIHOMING_MAX 8 /* Maximum local host IP addresses */
2365 /* Arp offload statistic counts */
2366 struct arp_ol_stats_t {
2367 uint32 host_ip_entries; /* Host IP table addresses (more than one if multihomed) */
2368 uint32 host_ip_overflow; /* Host IP table additions skipped due to overflow */
2370 uint32 arp_table_entries; /* ARP table entries */
2371 uint32 arp_table_overflow; /* ARP table additions skipped due to overflow */
2373 uint32 host_request; /* ARP requests from host */
2374 uint32 host_reply; /* ARP replies from host */
2375 uint32 host_service; /* ARP requests from host serviced by ARP Agent */
2377 uint32 peer_request; /* ARP requests received from network */
2378 uint32 peer_request_drop; /* ARP requests from network that were dropped */
2379 uint32 peer_reply; /* ARP replies received from network */
2380 uint32 peer_reply_drop; /* ARP replies from network that were dropped */
2381 uint32 peer_service; /* ARP request from host serviced by ARP Agent */
2385 /* --------------------------------------------------------------------------
2386 ** Keep-alive packet offloading.
2389 /* NAT keep-alive packets format. Specifies the re-tranmission period, the packet */
2390 /* length, and packet contents. */
2391 typedef struct wl_keep_alive_pkt {
2393 /* Retransmission period, specified in milli-seconds. Set to 0 to disable
2394 * packet re-transmits.
2396 uint32 period_msec;
2398 /* Size, in bytes, of packet to transmit. Set to 0 to disable packet
2399 * re-transmits.
2401 uint16 len_bytes;
2403 /* Variable length array of packet to transmit. Packet contents should include
2404 * the entire ethernet packet (ethernet header, IP header, UDP header, and UDP
2405 * payload) specified in network byte order.
2407 uint8 data[1];
2409 } wl_keep_alive_pkt_t;
2411 #define WL_KEEP_ALIVE_FIXED_LEN OFFSETOF(wl_keep_alive_pkt_t, data)
2414 /* --------------------------------------------------------------------------
2415 ** Dongle pattern matching filter.
2418 /* Packet filter types. Currently, only pattern matching is supported. */
2419 typedef enum WL_PKT_FILTER_TYPE {
2421 /* Pattern matching filter. */
2422 WL_PKT_FILTER_TYPE_PATTERN_MATCH
2424 /* Add more filters types here... */
2426 } WL_PKT_FILTER_TYPE;
2429 /* Pattern matching filter. Specifies an offset within received packets to
2430 * start matching, the pattern to match, the size of the pattern, and a bitmask
2431 * that indicates which bits within the pattern should be matched.
2433 typedef struct wl_pkt_filter_pattern {
2434 /* Offset, in bytes, within received packet to start pattern matching.
2435 * Offset '0' is the first byte of the ethernet header.
2437 uint32 offset;
2439 /* Size of the pattern in # of bytes. Bitmask must be the same size. */
2440 uint32 size_bytes;
2442 /* Variable length array of mask and pattern data. The mask starts at
2443 * offset 0. Pattern immediately follows the mask.
2445 * If bit i of the mask == 1, then match bit i of the pattern with the payload.
2446 * If bit i of the mask == 0, then do NOT match bit i of the pattern with
2447 * the payload.
2449 uint8 mask_and_pattern[1];
2451 } wl_pkt_filter_pattern_t;
2454 /* IOVAR "pkt_filter_add" parameter. Used to install packet filters. */
2455 typedef struct wl_pkt_filter {
2456 /* Unique filter id, specified by app. */
2457 uint32 id;
2459 /* Filter type (WL_PKT_FILTER_TYPE_xxx). */
2460 uint32 type;
2462 /* Negate the result of filter matches. e.g. Create a UDP packet filter, and
2463 * set this to 1 to create a filter for all non-UDP packets.
2465 uint32 negate_match;
2467 /* Filter definitions. */
2468 union
2470 /* Pattern matching filter. */
2471 wl_pkt_filter_pattern_t pattern;
2473 /* Add more filters types here. */
2474 /* ... */
2475 } u;
2477 /* Do NOT add structure members after the filter definitions, since they
2478 * may include variable length arrays.
2481 } wl_pkt_filter_t;
2484 #define WL_PKT_FILTER_FIXED_LEN OFFSETOF(wl_pkt_filter_t, u)
2486 #define WL_PKT_FILTER_PATTERN_FIXED_LEN OFFSETOF(wl_pkt_filter_pattern_t, mask_and_pattern)
2489 /* IOVAR "pkt_filter_enable" parameter. */
2490 typedef struct wl_pkt_filter_enable {
2491 /* Unique filter id. */
2492 uint32 id;
2494 /* Enable/disable bool. */
2495 uint32 enable;
2497 } wl_pkt_filter_enable_t;
2500 /* IOVAR "pkt_filter_list" parameter. Used to retrieve a list of installed filters. */
2501 typedef struct wl_pkt_filter_list {
2503 /* Number of installed packet filters. */
2504 uint32 num;
2506 /* Variable array of packet filters. */
2507 wl_pkt_filter_t filter[1];
2509 } wl_pkt_filter_list_t;
2512 #define WL_PKT_FILTER_LIST_FIXED_LEN OFFSETOF(wl_pkt_filter_list_t, filter)
2515 /* IOVAR "pkt_filter_stats" parameter. Used to retrieve debug statistics. */
2516 typedef struct wl_pkt_filter_stats {
2518 /* Total number of filter matches for the specified filter id. */
2519 uint32 num_pkts_matched;
2521 /* Total number of packets forwarded from dongle to host for all filters. */
2522 uint32 num_pkts_forwarded;
2524 /* Total number of packets discarded by dongle for all filters. */
2525 uint32 num_pkts_discarded;
2527 } wl_pkt_filter_stats_t;
2530 /* ------------------------------------------------------------------------- */
2532 typedef struct wl_seq_cmd_ioctl {
2533 uint32 cmd; /* common ioctl definition */
2534 uint32 len; /* length of user buffer */
2535 } wl_seq_cmd_ioctl_t;
2537 #define WL_SEQ_CMD_ALIGN_BYTES 4
2540 /* These are the set of get IOCTLs that should be allowed when using
2541 * IOCTL sequence commands. These are issued implicitly by wl.exe each time
2542 * it is invoked. We never want to buffer these, or else wl.exe will stop working.
2544 #define WL_SEQ_CMDS_GET_IOCTL_FILTER(cmd) \
2545 (((cmd) == WLC_GET_MAGIC) || \
2546 ((cmd) == WLC_GET_VERSION) || \
2547 ((cmd) == WLC_GET_AP) || \
2548 ((cmd) == WLC_GET_INSTANCE))
2551 /* ------------------------------------------------------------------------- */
2554 /* Packet engine interface */
2555 #define WL_PKTENG_PER_TX_START 0x01
2556 #define WL_PKTENG_PER_TX_STOP 0x02
2557 #define WL_PKTENG_PER_RX_START 0x04
2558 #define WL_PKTENG_PER_RX_WITH_ACK_START 0x05
2559 #define WL_PKTENG_PER_TX_WITH_ACK_START 0x06
2560 #define WL_PKTENG_PER_RX_STOP 0x08
2562 typedef struct wl_pkteng {
2563 uint32 flags;
2564 uint32 delay; /* Inter packet delay */
2565 uint32 nframes; /* number of frames */
2566 uint32 length; /* packet length */
2567 uint8 seqno; /* enable/disable sequence no. */
2568 struct ether_addr dest; /* destination address */
2569 struct ether_addr src; /* source address */
2570 } wl_pkteng_t;
2572 typedef struct wl_pkteng_stats {
2573 uint32 lostfrmcnt; /* RX PER test: no of frames lost (skip seqno) */
2574 int32 rssi; /* rssi */
2575 int32 snr; /* signal to noise ratio */
2576 } wl_pkteng_stats_t;
2578 #define WL_WOWL_MAGIC (1 << 0) /* Wakeup on Magic packet */
2579 #define WL_WOWL_NET (1 << 1) /* Wakeup on Netpattern */
2580 #define WL_WOWL_DIS (1 << 2) /* Wakeup on loss-of-link due to Disassoc/Deauth */
2581 #define WL_WOWL_RETR (1 << 3) /* Wakeup on retrograde TSF */
2582 #define WL_WOWL_BCN (1 << 4) /* Wakeup on loss of beacon */
2583 #define WL_WOWL_TST (1 << 5) /* Wakeup after test */
2584 #define WL_WOWL_BCAST (1 << 15) /* If the bit is set, frm received was bcast frame */
2586 #define MAGIC_PKT_MINLEN 102 /* Magic pkt min length is 6 * 0xFF + 16 * ETHER_ADDR_LEN */
2588 typedef struct {
2589 uint masksize; /* Size of the mask in #of bytes */
2590 uint offset; /* Offset to start looking for the packet in # of bytes */
2591 uint patternoffset; /* Offset of start of pattern in the structure */
2592 uint patternsize; /* Size of the pattern itself in #of bytes */
2593 /* Mask follows the structure above */
2594 /* Pattern follows the mask is at 'patternoffset' from the start */
2595 } wl_wowl_pattern_t;
2597 typedef struct {
2598 uint count;
2599 wl_wowl_pattern_t pattern[1];
2600 } wl_wowl_pattern_list_t;
2602 typedef struct {
2603 uint8 pci_wakeind; /* Whether PCI PMECSR PMEStatus bit was set */
2604 uint16 ucode_wakeind; /* What wakeup-event indication was set by ucode */
2605 } wl_wowl_wakeind_t;
2607 /* per AC rate control related data structure */
2608 typedef struct wl_txrate_class {
2609 uint8 init_rate;
2610 uint8 min_rate;
2611 uint8 max_rate;
2612 } wl_txrate_class_t;
2615 #if defined(DSLCPE_DELAY)
2616 #define WL_DELAYMODE_DEFER 0 /* defer by scheduler's choice, make this driver default */
2617 #define WL_DELAYMODE_FORCE 1 /* force, this is driver default */
2618 #define WL_DELAYMODE_AUTO 2 /* defer if no sta associated, force if sta associated */
2619 #endif
2621 /* Overlap BSS Scan parameters default, minimum, maximum */
2622 #define WLC_OBSS_SCAN_PASSIVE_DWELL_DEFAULT 20 /* unit TU */
2623 #define WLC_OBSS_SCAN_PASSIVE_DWELL_MIN 5 /* unit TU */
2624 #define WLC_OBSS_SCAN_PASSIVE_DWELL_MAX 1000 /* unit TU */
2625 #define WLC_OBSS_SCAN_ACTIVE_DWELL_DEFAULT 10 /* unit TU */
2626 #define WLC_OBSS_SCAN_ACTIVE_DWELL_MIN 10 /* unit TU */
2627 #define WLC_OBSS_SCAN_ACTIVE_DWELL_MAX 1000 /* unit TU */
2628 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_DEFAULT 300 /* unit Sec */
2629 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_MIN 10 /* unit Sec */
2630 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_MAX 900 /* unit Sec */
2631 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_DEFAULT 5
2632 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_MIN 5
2633 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_MAX 100
2634 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_DEFAULT 200 /* unit TU */
2635 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_MIN 200 /* unit TU */
2636 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_MAX 10000 /* unit TU */
2637 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_DEFAULT 20 /* unit TU */
2638 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_MIN 20 /* unit TU */
2639 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_MAX 10000 /* unit TU */
2640 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_DEFAULT 25 /* unit percent */
2641 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_MIN 0 /* unit percent */
2642 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_MAX 100 /* unit percent */
2644 /* structure for Overlap BSS scan arguments */
2645 typedef struct wl_obss_scan_arg {
2646 int16 passive_dwell;
2647 int16 active_dwell;
2648 int16 bss_widthscan_interval;
2649 int16 passive_total;
2650 int16 active_total;
2651 int16 chanwidth_transition_delay;
2652 int16 activity_threshold;
2653 } wl_obss_scan_arg_t;
2654 #define WL_OBSS_SCAN_PARAM_LEN sizeof(wl_obss_scan_arg_t)
2655 #define WL_MIN_NUM_OBSS_SCAN_ARG 7 /* minimum number of arguments required for OBSS Scan */
2657 #define WL_COEX_INFO_MASK 0x07
2658 #define WL_COEX_INFO_REQ 0x01
2659 #define WL_COEX_40MHZ_INTOLERANT 0x02
2660 #define WL_COEX_WIDTH20 0x04
2662 typedef struct wl_action_obss_coex_req {
2663 uint8 info;
2664 uint8 num;
2665 uint8 ch_list[1];
2666 } wl_action_obss_coex_req_t;
2669 /* **** EXTLOG **** */
2670 #define EXTLOG_CUR_VER 0x0100
2672 #define MAX_ARGSTR_LEN 18 /* At least big enough for storing ETHER_ADDR_STR_LEN */
2674 /* log modules (bitmap) */
2675 #define LOG_MODULE_COMMON 0x0001
2676 #define LOG_MODULE_ASSOC 0x0002
2677 #define LOG_MODULE_EVENT 0x0004
2678 #define MAX_LOG_MODULE 3
2680 /* log levels */
2681 #define WL_LOG_LEVEL_DISABLE 0
2682 #define WL_LOG_LEVEL_ERR 1
2683 #define WL_LOG_LEVEL_WARN 2
2684 #define WL_LOG_LEVEL_INFO 3
2685 #define MAX_WL_LOG_LEVEL (WL_LOG_LEVEL_INFO + 1)
2687 /* flag */
2688 #define LOG_FLAG_EVENT 1
2690 /* log arg_type */
2691 #define LOG_ARGTYPE_NULL 0
2692 #define LOG_ARGTYPE_STR 1 /* %s */
2693 #define LOG_ARGTYPE_INT 2 /* %d */
2694 #define LOG_ARGTYPE_INT_STR 3 /* %d...%s */
2695 #define LOG_ARGTYPE_STR_INT 4 /* %s...%d */
2697 typedef struct wlc_extlog_cfg {
2698 int max_number;
2699 uint16 module; /* bitmap */
2700 uint8 level;
2701 uint8 flag;
2702 uint16 version;
2703 } wlc_extlog_cfg_t;
2705 typedef struct log_record {
2706 uint32 time;
2707 uint16 module;
2708 uint16 id;
2709 uint8 level;
2710 uint8 sub_unit;
2711 uint8 seq_num;
2712 int32 arg;
2713 char str[MAX_ARGSTR_LEN];
2714 } log_record_t;
2716 typedef struct wlc_extlog_req {
2717 uint32 from_last;
2718 uint32 num;
2719 } wlc_extlog_req_t;
2721 typedef struct wlc_extlog_results {
2722 uint16 version;
2723 uint16 record_len;
2724 uint32 num;
2725 log_record_t logs[1];
2726 } wlc_extlog_results_t;
2728 typedef struct log_idstr {
2729 uint16 id;
2730 uint16 flag;
2731 uint8 arg_type;
2732 const char *fmt_str;
2733 } log_idstr_t;
2735 #define FMTSTRF_USER 1
2737 /* flat ID definitions
2738 * New definitions HAVE TO BE ADDED at the end of the table. Otherwise, it will
2739 * affect backward compatibility with pre-existing apps
2741 typedef enum {
2742 FMTSTR_DRIVER_UP_ID = 0,
2743 FMTSTR_DRIVER_DOWN_ID = 1,
2744 FMTSTR_SUSPEND_MAC_FAIL_ID = 2,
2745 FMTSTR_NO_PROGRESS_ID = 3,
2746 FMTSTR_RFDISABLE_ID = 4,
2747 FMTSTR_REG_PRINT_ID = 5,
2748 FMTSTR_EXPTIME_ID = 6,
2749 FMTSTR_JOIN_START_ID = 7,
2750 FMTSTR_JOIN_COMPLETE_ID = 8,
2751 FMTSTR_NO_NETWORKS_ID = 9,
2752 FMTSTR_SECURITY_MISMATCH_ID = 10,
2753 FMTSTR_RATE_MISMATCH_ID = 11,
2754 FMTSTR_AP_PRUNED_ID = 12,
2755 FMTSTR_KEY_INSERTED_ID = 13,
2756 FMTSTR_DEAUTH_ID = 14,
2757 FMTSTR_DISASSOC_ID = 15,
2758 FMTSTR_LINK_UP_ID = 16,
2759 FMTSTR_LINK_DOWN_ID = 17,
2760 FMTSTR_RADIO_HW_OFF_ID = 18,
2761 FMTSTR_RADIO_HW_ON_ID = 19,
2762 FMTSTR_EVENT_DESC_ID = 20,
2763 FMTSTR_PNP_SET_POWER_ID = 21,
2764 FMTSTR_RADIO_SW_OFF_ID = 22,
2765 FMTSTR_RADIO_SW_ON_ID = 23,
2766 FMTSTR_PWD_MISMATCH_ID = 24,
2767 FMTSTR_FATAL_ERROR_ID = 25,
2768 FMTSTR_AUTH_FAIL_ID = 26,
2769 FMTSTR_ASSOC_FAIL_ID = 27,
2770 FMTSTR_MAX_ID
2771 } log_fmtstr_id_t;
2773 /* Global ASSERT Logging */
2774 #define ASSERTLOG_CUR_VER 0x0100
2776 #define MAX_ASSRTSTR_LEN 64
2778 typedef struct assert_record {
2779 uint32 time;
2780 uint8 seq_num;
2781 char str[MAX_ASSRTSTR_LEN];
2782 } assert_record_t;
2784 typedef struct assertlog_results {
2785 uint16 version;
2786 uint16 record_len;
2787 uint32 num;
2788 assert_record_t logs[1];
2789 } assertlog_results_t;
2791 #define LOGRRC_FIX_LEN 8
2792 #define IOBUF_ALLOWED_NUM_OF_LOGREC(type, len) ((len - LOGRRC_FIX_LEN)/sizeof(type))
2795 /* channel interference measurement (chanim) related defines */
2797 /* chanim mode */
2798 #define CHANIM_DISABLE 0 /* disabled */
2799 #define CHANIM_DETECT 1 /* detection only */
2800 #define CHANIM_ACT 2 /* detection and act */
2801 #define CHANIM_MODE_MAX 2
2803 /* define for apcs reason code */
2804 #define APCS_IOCTL 1
2805 #define APCS_CHANIM 2
2806 #define APCS_CSTIMER 3
2808 /* number of ACS record entries */
2809 #define CHANIM_ACS_RECORD 10
2811 /* chanim acs record */
2812 typedef struct {
2813 bool valid;
2814 uint8 trigger;
2815 chanspec_t selected_chspc;
2816 uint32 glitch_cnt;
2817 uint8 ccastats;
2818 uint timestamp;
2819 } chanim_acs_record_t;
2821 typedef struct {
2822 chanim_acs_record_t acs_record[CHANIM_ACS_RECORD];
2823 uint8 count;
2824 uint timestamp;
2825 } wl_acs_record_t;
2827 /* structure/defines for selective mgmt frame (smf) stats support */
2829 #define SMFS_VERSION 1
2830 /* selected mgmt frame (smf) stats element */
2831 typedef struct wl_smfs_elem {
2832 uint32 count;
2833 uint16 code; /* SC or RC code */
2834 } wl_smfs_elem_t;
2836 typedef struct wl_smf_stats {
2837 uint32 version;
2838 uint16 length; /* reserved for future usage */
2839 uint8 type;
2840 uint8 codetype;
2841 uint32 ignored_cnt;
2842 uint32 malformed_cnt;
2843 uint32 count_total; /* count included the interested group */
2844 wl_smfs_elem_t elem[1];
2845 } wl_smf_stats_t;
2847 #define WL_SMFSTATS_FIXED_LEN OFFSETOF(wl_smf_stats_t, elem);
2849 enum {
2850 SMFS_CODETYPE_SC,
2851 SMFS_CODETYPE_RC
2854 /* reuse two number in the sc/rc space */
2855 #define SMFS_CODE_MALFORMED 0xFFFE
2856 #define SMFS_CODE_IGNORED 0xFFFD
2858 typedef enum smfs_type {
2859 SMFS_TYPE_AUTH,
2860 SMFS_TYPE_ASSOC,
2861 SMFS_TYPE_REASSOC,
2862 SMFS_TYPE_DISASSOC_TX,
2863 SMFS_TYPE_DISASSOC_RX,
2864 SMFS_TYPE_DEAUTH_TX,
2865 SMFS_TYPE_DEAUTH_RX,
2866 SMFS_TYPE_MAX
2867 } smfs_type_t;
2869 #ifdef PHYMON
2871 #define PHYMON_VERSION 1
2873 typedef struct wl_phycal_core_state {
2874 /* Tx IQ/LO calibration coeffs */
2875 int16 tx_iqlocal_a;
2876 int16 tx_iqlocal_b;
2877 int8 tx_iqlocal_ci;
2878 int8 tx_iqlocal_cq;
2879 int8 tx_iqlocal_di;
2880 int8 tx_iqlocal_dq;
2881 int8 tx_iqlocal_ei;
2882 int8 tx_iqlocal_eq;
2883 int8 tx_iqlocal_fi;
2884 int8 tx_iqlocal_fq;
2886 /* Rx IQ calibration coeffs */
2887 int16 rx_iqcal_a;
2888 int16 rx_iqcal_b;
2890 uint8 tx_iqlocal_pwridx; /* Tx Power Index for Tx IQ/LO calibration */
2891 uint32 papd_epsilon_table[64]; /* PAPD epsilon table */
2892 int16 papd_epsilon_offset; /* PAPD epsilon offset */
2893 uint8 curr_tx_pwrindex; /* Tx power index */
2894 int8 idle_tssi; /* Idle TSSI */
2895 int8 est_tx_pwr; /* Estimated Tx Power (dB) */
2896 int8 est_rx_pwr; /* Estimated Rx Power (dB) from RSSI */
2897 uint16 rx_gaininfo; /* Rx gain applied on last Rx pkt */
2898 uint16 init_gaincode; /* initgain required for ACI */
2899 int8 estirr_tx;
2900 int8 estirr_rx;
2902 } wl_phycal_core_state_t;
2904 typedef struct wl_phycal_state {
2905 int version;
2906 int8 num_phy_cores; /* number of cores */
2907 int8 curr_temperature; /* on-chip temperature sensor reading */
2908 chanspec_t chspec; /* channspec for this state */
2909 bool aci_state; /* ACI state: ON/OFF */
2910 uint16 crsminpower; /* crsminpower required for ACI */
2911 uint16 crsminpowerl; /* crsminpowerl required for ACI */
2912 uint16 crsminpoweru; /* crsminpoweru required for ACI */
2913 wl_phycal_core_state_t phycal_core[1];
2914 } wl_phycal_state_t;
2916 #define WL_PHYCAL_STAT_FIXED_LEN OFFSETOF(wl_phycal_state_t, phycal_core)
2917 #endif /* PHYMON */
2919 #endif /* _wlioctl_h_ */