CPU: Wrong CPU Load %.
[tomato.git] / release / src / include / wlioctl.h
blob6576a6754dcd0697aa40536d7fad28a81e61e85d
1 /*
2 * Custom OID/ioctl definitions for
3 * Broadcom 802.11abg Networking Device Driver
5 * Definitions subject to change without notice.
7 * Copyright 2004, 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$
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 /* require default structure packing */
34 #if !defined(__GNUC__)
35 #pragma pack(push, 8)
36 #endif
38 /* Legacy structure to help keep backward compatible wl tool and tray app */
40 #define LEGACY_WL_BSS_INFO_VERSION 107 /* older version of wl_bss_info struct */
42 typedef struct wl_bss_info_107 {
43 uint32 version; /* version field */
44 uint32 length; /* byte length of data in this record,
45 * starting at version and including IEs
47 struct ether_addr BSSID;
48 uint16 beacon_period; /* units are Kusec */
49 uint16 capability; /* Capability information */
50 uint8 SSID_len;
51 uint8 SSID[32];
52 struct {
53 uint count; /* # rates in this set */
54 uint8 rates[16]; /* rates in 500kbps units w/hi bit set if basic */
55 } rateset; /* supported rates */
56 uint8 channel; /* Channel no. */
57 uint16 atim_window; /* units are Kusec */
58 uint8 dtim_period; /* DTIM period */
59 int16 RSSI; /* receive signal strength (in dBm) */
60 int8 phy_noise; /* noise (in dBm) */
61 uint32 ie_length; /* byte length of Information Elements */
62 /* variable length Information Elements */
63 } wl_bss_info_107_t;
66 * Per-bss information structure.
69 #define WL_BSS_INFO_VERSION 108 /* current version of wl_bss_info struct */
71 /* BSS info structure
72 * Applications MUST CHECK ie_offset field and length field to access IEs and
73 * next bss_info structure in a vector (in wl_scan_results_t)
75 typedef struct wl_bss_info {
76 uint32 version; /* version field */
77 uint32 length; /* byte length of data in this record,
78 * starting at version and including IEs
80 struct ether_addr BSSID;
81 uint16 beacon_period; /* units are Kusec */
82 uint16 capability; /* Capability information */
83 uint8 SSID_len;
84 uint8 SSID[32];
85 struct {
86 uint count; /* # rates in this set */
87 uint8 rates[16]; /* rates in 500kbps units w/hi bit set if basic */
88 } rateset; /* supported rates */
89 chanspec_t chanspec; /* chanspec for bss */
90 uint16 atim_window; /* units are Kusec */
91 uint8 dtim_period; /* DTIM period */
92 int16 RSSI; /* receive signal strength (in dBm) */
93 int8 phy_noise; /* noise (in dBm) */
95 bool n_cap; /* BSS is 802.11N Capable */
96 uint32 nbss_cap; /* 802.11N BSS Capabilities (based on EWC_CAP_*) */
97 uint8 ctl_ch; /* 802.11N BSS control channel number */
98 uint32 reserved[2]; /* Reserved for expansion of BSS properties */
99 uint8 basic_mcs[MCSSET_LEN]; /* 802.11N BSS required MCS set */
101 uint16 ie_offset; /* offset at which IEs start, from beginning */
102 uint32 ie_length; /* byte length of Information Elements */
103 /* Add new fields here */
104 /* variable length Information Elements */
105 } wl_bss_info_t;
107 typedef struct wlc_ssid {
108 uint32 SSID_len;
109 uchar SSID[32];
110 } wlc_ssid_t;
112 typedef struct chan_scandata {
113 uint8 txpower;
114 uint8 pad;
115 chanspec_t channel; /* Channel num, bw, ctrl_sb and band */
116 uint32 channel_mintime;
117 uint32 channel_maxtime;
118 } chan_scandata_t;
120 typedef enum wl_scan_type {
121 EXTDSCAN_BACKGROUND_SCAN,
122 EXTDSCAN_FOREGROUND_SCAN,
123 EXTDSCAN_FORCEDBACKGROUND_SCAN
124 }wl_scan_type_t;
126 #define WLC_EXTDSCAN_MAX_SSID 5
127 #define WL_EXTDSCAN_PARAMS_FIXED_SIZE 200
129 typedef struct wl_extdscan_params {
130 int8 nprobes; /* 0, passive, otherwise active */
131 wl_scan_type_t scan_type; /* enum */
132 int8 split_scan; /* split scan */
133 int8 band; /* band */
134 wlc_ssid_t ssid[WLC_EXTDSCAN_MAX_SSID]; /* ssid list */
135 int32 channel_num;
136 chan_scandata_t channel_list[1]; /* list of chandata structs */
137 } wl_extdscan_params_t;
139 typedef struct wl_scan_params {
140 wlc_ssid_t ssid; /* default: {0, ""} */
141 struct ether_addr bssid; /* default: bcast */
142 int8 bss_type; /* default: any,
143 * DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT
145 int8 scan_type; /* -1 use default, DOT11_SCANTYPE_ACTIVE/PASSIVE */
146 int32 nprobes; /* -1 use default, number of probes per channel */
147 int32 active_time; /* -1 use default, dwell time per channel for
148 * active scanning
150 int32 passive_time; /* -1 use default, dwell time per channel
151 * for passive scanning
153 int32 home_time; /* -1 use default, dwell time for the home channel
154 * between channel scans
156 int32 channel_num; /* 0 use default (all available channels), count of
157 * channels in channel_list
159 uint16 channel_list[1]; /* list of chanspecs */
160 } wl_scan_params_t;
161 /* size of wl_scan_params not including variable length array */
162 #define WL_SCAN_PARAMS_FIXED_SIZE 64
164 #define WL_SCAN_ACTION_START 1
165 #define WL_SCAN_ACTION_CONTINUE 2
167 #define ISCAN_REQ_VERSION 1
169 /* incremental scan struct */
170 typedef struct wl_iscan_params {
171 uint32 version;
172 uint16 action;
173 uint16 scan_duration;
174 wl_scan_params_t params;
175 } wl_iscan_params_t;
176 /* 3 fields + size of wl_scan_params, not including variable length array */
177 #define WL_ISCAN_PARAMS_FIXED_SIZE (OFFSETOF(wl_iscan_params_t, params) + sizeof(wlc_ssid_t))
179 typedef struct wl_scan_results {
180 uint32 buflen;
181 uint32 version;
182 uint32 count;
183 wl_bss_info_t bss_info[1];
184 } wl_scan_results_t;
185 /* size of wl_scan_results not including variable length array */
186 #define WL_SCAN_RESULTS_FIXED_SIZE 12
188 /* wl_iscan_results status values */
189 #define WL_SCAN_RESULTS_SUCCESS 0
190 #define WL_SCAN_RESULTS_PARTIAL 1
191 #define WL_SCAN_RESULTS_PENDING 2
192 #define WL_SCAN_RESULTS_ABORTED 3
194 /* incremental scan results struct */
195 typedef struct wl_iscan_results {
196 uint32 status;
197 wl_scan_results_t results;
198 } wl_iscan_results_t;
199 /* size of wl_iscan_results not including variable length array */
200 #define WL_ISCAN_RESULTS_FIXED_SIZE \
201 (WL_SCAN_RESULTS_FIXED_SIZE + OFFSETOF(wl_iscan_results_t, results))
203 #define WL_NUMRATES 255 /* max # of rates in a rateset */
204 typedef struct wl_rateset {
205 uint32 count; /* # rates in this set */
206 uint8 rates[WL_NUMRATES]; /* rates in 500kbps units w/hi bit set if basic */
207 } wl_rateset_t;
209 /* uint32 list */
210 typedef struct wl_uint32_list {
211 /* in - # of elements, out - # of entries */
212 uint32 count;
213 /* variable length uint32 list */
214 uint32 element[1];
215 } wl_uint32_list_t;
217 #define WLC_CNTRY_BUF_SZ 4 /* Country string is 3 bytes + NULL */
219 /* defines used by the nrate iovar */
220 #define NRATE_MCS_INUSE 0x00000080 /* MSC in use,indicates b0-6 holds an mcs */
221 #define NRATE_RATE_MASK 0x0000007f /* rate/mcs value */
222 #define NRATE_STF_MASK 0x0000ff00 /* stf mode mask: siso, cdd, stbc, sdm */
223 #define NRATE_STF_SHIFT 8 /* stf mode shift */
224 #define NRATE_OVERRIDE 0x80000000 /* bit indicate override both rate & mode */
226 #define NRATE_STF_SISO 0 /* stf mode SISO */
227 #define NRATE_STF_CDD 1 /* stf mode CDD */
228 #define NRATE_STF_STBC 2 /* stf mode STBC */
229 #define NRATE_STF_SDM 3 /* stf mode SDM */
231 #define ANTENNA_NUM_1 1 /* total number of antennas to be used */
232 #define ANTENNA_NUM_2 2
233 #define ANTENNA_NUM_3 3
234 #define ANTENNA_NUM_4 4
236 #define WL_ANTCFG_AUTO 0x80 /* bit indicate antenna sel AUTO */
237 #define ANTSEL_CONFIG_MASK 0x33 /* antenna configuration mask */
238 #define MAX_NUM_ANT_CFG 4 /* max number of antenna configuration */
239 #define UNICAST_TXANT_CFG 0 /* unicast tx antenna configuration */
240 #define UNICAST_RXANT_CFG 1 /* unicast rx antenna configuration */
241 #define DEFAULT_TXANT_CFG 2 /* default tx antenna configuration */
242 #define DEFAULT_RXANT_CFG 3 /* default rx antenna configuration */
244 typedef struct {
245 uint8 ant_config[MAX_NUM_ANT_CFG]; /* antenna configuration */
246 uint8 num_antcfg; /* number of available antenna configurations */
247 } wlc_antselcfg_t;
249 #define HIGHEST_SINGLE_STREAM_MCS 7 /* MCS values greater than this enable multiple streams */
251 typedef struct wl_channels_in_country {
252 uint32 buflen;
253 uint32 band;
254 char country_abbrev[WLC_CNTRY_BUF_SZ];
255 uint32 count;
256 uint32 channel[1];
257 } wl_channels_in_country_t;
259 typedef struct wl_country_list {
260 uint32 buflen;
261 uint32 band_set;
262 uint32 band;
263 uint32 count;
264 char country_abbrev[1];
265 } wl_country_list_t;
267 #define WL_NUM_RPI_BINS 8
268 #define WL_RM_TYPE_BASIC 1
269 #define WL_RM_TYPE_CCA 2
270 #define WL_RM_TYPE_RPI 3
272 #define WL_RM_FLAG_PARALLEL (1<<0)
274 #define WL_RM_FLAG_LATE (1<<1)
275 #define WL_RM_FLAG_INCAPABLE (1<<2)
276 #define WL_RM_FLAG_REFUSED (1<<3)
278 typedef struct wl_rm_req_elt {
279 int8 type;
280 int8 flags;
281 chanspec_t chanspec;
282 uint32 token; /* token for this measurement */
283 uint32 tsf_h; /* TSF high 32-bits of Measurement start time */
284 uint32 tsf_l; /* TSF low 32-bits */
285 uint32 dur; /* TUs */
286 } wl_rm_req_elt_t;
288 typedef struct wl_rm_req {
289 uint32 token; /* overall measurement set token */
290 uint32 count; /* number of measurement requests */
291 void * cb; /* completion callback function: may be NULL */
292 void * cb_arg; /* arg to completion callback function */
293 wl_rm_req_elt_t req[1]; /* variable length block of requests */
294 } wl_rm_req_t;
295 #define WL_RM_REQ_FIXED_LEN OFFSETOF(wl_rm_req_t, req)
297 typedef struct wl_rm_rep_elt {
298 int8 type;
299 int8 flags;
300 chanspec_t chanspec;
301 uint32 token; /* token for this measurement */
302 uint32 tsf_h; /* TSF high 32-bits of Measurement start time */
303 uint32 tsf_l; /* TSF low 32-bits */
304 uint32 dur; /* TUs */
305 uint32 len; /* byte length of data block */
306 uint8 data[1]; /* variable length data block */
307 } wl_rm_rep_elt_t;
308 #define WL_RM_REP_ELT_FIXED_LEN 24 /* length excluding data block */
310 #define WL_RPI_REP_BIN_NUM 8
311 typedef struct wl_rm_rpi_rep {
312 uint8 rpi[WL_RPI_REP_BIN_NUM];
313 int8 rpi_max[WL_RPI_REP_BIN_NUM];
314 } wl_rm_rpi_rep_t;
316 typedef struct wl_rm_rep {
317 uint32 token; /* overall measurement set token */
318 uint32 len; /* length of measurement report block */
319 wl_rm_rep_elt_t rep[1]; /* variable length block of reports */
320 } wl_rm_rep_t;
321 #define WL_RM_REP_FIXED_LEN 8
324 #if defined(BCMSUP_PSK)
325 typedef enum sup_auth_status {
326 WLC_SUP_DISCONNECTED = 0,
327 WLC_SUP_CONNECTING,
328 WLC_SUP_IDREQUIRED,
329 WLC_SUP_AUTHENTICATING,
330 WLC_SUP_AUTHENTICATED,
331 WLC_SUP_KEYXCHANGE,
332 WLC_SUP_KEYED,
333 WLC_SUP_TIMEOUT
334 } sup_auth_status_t;
335 #endif
337 /* Enumerate crypto algorithms */
338 #define CRYPTO_ALGO_OFF 0
339 #define CRYPTO_ALGO_WEP1 1
340 #define CRYPTO_ALGO_TKIP 2
341 #define CRYPTO_ALGO_WEP128 3
342 #define CRYPTO_ALGO_AES_CCM 4
343 #define CRYPTO_ALGO_AES_OCB_MSDU 5
344 #define CRYPTO_ALGO_AES_OCB_MPDU 6
345 #define CRYPTO_ALGO_NALG 7
347 #define WSEC_GEN_MIC_ERROR 0x0001
348 #define WSEC_GEN_REPLAY 0x0002
350 #define WL_SOFT_KEY (1 << 0) /* Indicates this key is using soft encrypt */
351 #define WL_PRIMARY_KEY (1 << 1) /* Indicates this key is the primary (ie tx) key */
352 #define WL_KF_RES_4 (1 << 4) /* Reserved for backward compat */
353 #define WL_KF_RES_5 (1 << 5) /* Reserved for backward compat */
354 #define WL_IBSS_PEER_GROUP_KEY (1 << 6) /* Indicates a group key for a IBSS PEER */
356 typedef struct wl_wsec_key {
357 uint32 index; /* key index */
358 uint32 len; /* key length */
359 uint8 data[DOT11_MAX_KEY_SIZE]; /* key data */
360 uint32 pad_1[18];
361 uint32 algo; /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
362 uint32 flags; /* misc flags */
363 uint32 pad_2[2];
364 int pad_3;
365 int iv_initialized; /* has IV been initialized already? */
366 int pad_4;
367 /* Rx IV */
368 struct {
369 uint32 hi; /* upper 32 bits of IV */
370 uint16 lo; /* lower 16 bits of IV */
371 } rxiv;
372 uint32 pad_5[2];
373 struct ether_addr ea; /* per station */
374 } wl_wsec_key_t;
377 #define WSEC_MIN_PSK_LEN 8
378 #define WSEC_MAX_PSK_LEN 64
380 /* Flag for key material needing passhash'ing */
381 #define WSEC_PASSPHRASE (1<<0)
383 /* receptacle for WLC_SET_WSEC_PMK parameter */
384 typedef struct {
385 ushort key_len; /* octets in key material */
386 ushort flags; /* key handling qualification */
387 uint8 key[WSEC_MAX_PSK_LEN]; /* PMK material */
388 } wsec_pmk_t;
390 /* wireless security bitvec */
391 #define WEP_ENABLED 0x0001
392 #define TKIP_ENABLED 0x0002
393 #define AES_ENABLED 0x0004
394 #define WSEC_SWFLAG 0x0008
395 #define SES_OW_ENABLED 0x0040 /* to go into transition mode without setting wep */
396 #define FIPS_ENABLED 0x0080
398 /* WPA authentication mode bitvec */
399 #define WPA_AUTH_DISABLED 0x0000 /* Legacy (i.e., non-WPA) */
400 #define WPA_AUTH_NONE 0x0001 /* none (IBSS) */
401 #define WPA_AUTH_UNSPECIFIED 0x0002 /* over 802.1x */
402 #define WPA_AUTH_PSK 0x0004 /* Pre-shared key */
403 /* #define WPA_AUTH_8021X 0x0020 */ /* 802.1x, reserved */
404 #ifdef BCMWPA2
405 #define WPA2_AUTH_UNSPECIFIED 0x0040 /* over 802.1x */
406 #define WPA2_AUTH_PSK 0x0080 /* Pre-shared key */
407 #define BRCM_AUTH_PSK 0x0100 /* BRCM specific PSK */
408 #endif /* BCMWPA2 */
410 #ifdef BCMWPA2
411 /* pmkid */
412 #define MAXPMKID 16
414 typedef struct _pmkid
416 struct ether_addr BSSID;
417 uint8 PMKID[WPA2_PMKID_LEN];
418 } pmkid_t;
420 typedef struct _pmkid_list
422 uint32 npmkid;
423 pmkid_t pmkid[1];
424 } pmkid_list_t;
426 typedef struct _pmkid_cand {
427 struct ether_addr BSSID;
428 uint8 preauth;
429 } pmkid_cand_t;
431 typedef struct _pmkid_cand_list {
432 uint32 npmkid_cand;
433 pmkid_cand_t pmkid_cand[1];
434 } pmkid_cand_list_t;
435 #endif /* BCMWPA2 */
437 typedef struct wl_led_info {
438 uint32 index; /* led index */
439 uint32 behavior;
440 bool activehi;
441 } wl_led_info_t;
443 typedef struct wlc_assoc_info {
444 uint32 req_len;
445 uint32 resp_len;
446 uint32 flags;
447 struct dot11_assoc_req req;
448 struct ether_addr reassoc_bssid; /* used in reassoc's */
449 struct dot11_assoc_resp resp;
450 } wl_assoc_info_t;
451 /* flags */
452 #define WLC_ASSOC_REQ_IS_REASSOC 0x01 /* assoc req was actually a reassoc */
453 /* srom read/write struct passed through ioctl */
454 typedef struct {
455 uint byteoff; /* byte offset */
456 uint nbytes; /* number of bytes */
457 uint16 buf[1];
458 } srom_rw_t;
460 /* R_REG and W_REG struct passed through ioctl */
461 typedef struct {
462 uint32 byteoff; /* byte offset of the field in d11regs_t */
463 uint32 val; /* read/write value of the field */
464 uint32 size; /* sizeof the field */
465 uint band; /* band (optional) */
466 } rw_reg_t;
468 /* Structure used by GET/SET_ATTEN ioctls - it controls power in b/g-band */
469 /* PCL - Power Control Loop */
470 /* current gain setting is replaced by user input */
471 #define WL_ATTEN_APP_INPUT_PCL_OFF 0 /* turn off PCL, apply supplied input */
472 #define WL_ATTEN_PCL_ON 1 /* turn on PCL */
473 /* current gain setting is maintained */
474 #define WL_ATTEN_PCL_OFF 2 /* turn off PCL. */
475 typedef struct {
476 uint16 auto_ctrl; /* WL_ATTEN_XX */
477 uint16 bb; /* Baseband attenuation */
478 uint16 radio; /* Radio attenuation */
479 uint16 txctl1; /* Radio TX_CTL1 value */
480 } atten_t;
482 /* Per-AC retry parameters */
483 struct wme_tx_params_s {
484 uint8 short_retry;
485 uint8 short_fallback;
486 uint8 long_retry;
487 uint8 long_fallback;
488 uint16 max_rate; /* In units of 512 Kbps */
490 typedef struct wme_tx_params_s wme_tx_params_t;
491 #define WL_WME_TX_PARAMS_IO_BYTES (sizeof(wme_tx_params_t) * AC_COUNT)
493 /* defines used by poweridx iovar - it controls power in a-band */
494 /* current gain setting is maintained */
495 #define WL_PWRIDX_PCL_OFF -2 /* turn off PCL. */
496 #define WL_PWRIDX_PCL_ON -1 /* turn on PCL */
497 #define WL_PWRIDX_LOWER_LIMIT -2 /* lower limit */
498 #define WL_PWRIDX_UPPER_LIMIT 63 /* upper limit */
499 /* value >= 0 causes
500 * - input to be set to that value
501 * - PCL to be off
504 /* Used to get specific STA parameters */
505 typedef struct {
506 uint32 val;
507 struct ether_addr ea;
508 } scb_val_t;
510 #define BCM_MAC_STATUS_INDICATION (0x40010200L)
512 /* Please update the following when modifying this structure:
513 * StaInfo Twiki page flags section - description of the sta_info_t struct
514 * src/wl/exe/wlu.c - print of sta_info_t
515 * Pay attention to version if structure changes.
517 typedef struct {
518 uint16 ver; /* version of this struct */
519 uint16 len; /* length in bytes of this structure */
520 uint16 cap; /* sta's advertised capabilities */
521 uint32 flags; /* flags defined below */
522 uint32 idle; /* time since data pkt rx'd from sta */
523 struct ether_addr ea; /* Station address */
524 wl_rateset_t rateset; /* rateset in use */
525 uint32 in; /* seconds elapsed since associated */
526 uint32 listen_interval_inms; /* Min Listen interval in ms for this STA */
527 uint32 tx_pkts; /* # of packets transmitted */
528 uint32 tx_failures; /* # of packets failed */
529 uint32 rx_ucast_pkts; /* # of unicast packets received */
530 uint32 rx_mcast_pkts; /* # of multicast packets received */
531 uint32 tx_rate; /* Rate of last successful tx frame */
532 uint32 rx_rate; /* Rate of last successful rx frame */
533 } sta_info_t;
535 #define WL_OLD_STAINFO_SIZE OFFSETOF(sta_info_t, tx_pkts)
537 #define WL_STA_VER 2
539 /* Flags for sta_info_t indicating properties of STA */
540 #define WL_STA_BRCM 0x1 /* Running a Broadcom driver */
541 #define WL_STA_WME 0x2 /* WMM association */
542 #define WL_STA_ABCAP 0x4 /* Afterburner-capable */
543 #define WL_STA_AUTHE 0x8 /* Authenticated */
544 #define WL_STA_ASSOC 0x10 /* Associated */
545 #define WL_STA_AUTHO 0x20 /* Authorized */
546 #define WL_STA_WDS 0x40 /* Wireless Distribution System */
547 #define WL_STA_WDS_LINKUP 0x80 /* WDS traffic/probes flowing properly */
548 #define WL_STA_PS 0x100 /* STA is in power save mode from AP's viewpoint */
549 #define WL_STA_APSD_BE 0x200 /* APSD delv/trigger for AC_BE is default enabled */
550 #define WL_STA_APSD_BK 0x400 /* APSD delv/trigger for AC_BK is default enabled */
551 #define WL_STA_APSD_VI 0x800 /* APSD delv/trigger for AC_VI is default enabled */
552 #define WL_STA_APSD_VO 0x1000 /* APSD delv/trigger for AC_VO is default enabled */
553 #define WL_STA_N_CAP 0x2000 /* STA 802.11n capable */
554 #define WL_STA_SCBSTATS 0x4000 /* Per STA debug stats */
556 #define WL_WDS_LINKUP WL_STA_WDS_LINKUP /* deprecated */
558 /* channel encoding */
559 typedef struct channel_info {
560 int hw_channel;
561 int target_channel;
562 int scan_channel;
563 } channel_info_t;
565 /* For ioctls that take a list of MAC addresses */
566 struct maclist {
567 uint count; /* number of MAC addresses */
568 struct ether_addr ea[1]; /* variable length array of MAC addresses */
571 /* get pkt count struct passed through ioctl */
572 typedef struct get_pktcnt {
573 uint rx_good_pkt;
574 uint rx_bad_pkt;
575 uint tx_good_pkt;
576 uint tx_bad_pkt;
577 uint rx_ocast_good_pkt; /* unicast packets destined for others */
578 } get_pktcnt_t;
580 /* Linux network driver ioctl encoding */
581 typedef struct wl_ioctl {
582 uint cmd; /* common ioctl definition */
583 void *buf; /* pointer to user buffer */
584 uint len; /* length of user buffer */
585 bool set; /* get or set request (optional) */
586 uint used; /* bytes read or written (optional) */
587 uint needed; /* bytes needed (optional) */
588 } wl_ioctl_t;
591 * Structure for passing hardware and software
592 * revision info up from the driver.
594 typedef struct wlc_rev_info {
595 uint vendorid; /* PCI vendor id */
596 uint deviceid; /* device id of chip */
597 uint radiorev; /* radio revision */
598 uint chiprev; /* chip revision */
599 uint corerev; /* core revision */
600 uint boardid; /* board identifier (usu. PCI sub-device id) */
601 uint boardvendor; /* board vendor (usu. PCI sub-vendor id) */
602 uint boardrev; /* board revision */
603 uint driverrev; /* driver version */
604 uint ucoderev; /* microcode version */
605 uint bus; /* bus type */
606 uint chipnum; /* chip number */
607 } wlc_rev_info_t;
609 #define WL_BRAND_MAX 10
610 typedef struct wl_instance_info {
611 uint instance;
612 char brand[WL_BRAND_MAX];
613 } wl_instance_info_t;
615 /* structure to change size of tx fifo */
616 typedef struct wl_txfifo_sz {
617 uint8 fifo;
618 uint8 size;
619 } wl_txfifo_sz_t;
621 /* Transfer info about an IOVar from the driver */
622 /* Max supported IOV name size in bytes, + 1 for null termination */
623 #define WLC_IOV_NAME_LEN 30
624 typedef struct wlc_iov_trx_s {
625 uint8 module;
626 uint8 type;
627 char name[WLC_IOV_NAME_LEN];
628 } wlc_iov_trx_t;
630 /* check this magic number */
631 #define WLC_IOCTL_MAGIC 0x14e46c77
633 /* bump this number if you change the ioctl interface */
634 #define WLC_IOCTL_VERSION 1
636 #define WLC_IOCTL_MAXLEN 8192 /* max length ioctl buffer required */
637 #define WLC_IOCTL_SMLEN 256 /* "small" length ioctl buffer required */
639 /* common ioctl definitions */
640 #define WLC_GET_MAGIC 0
641 #define WLC_GET_VERSION 1
642 #define WLC_UP 2
643 #define WLC_DOWN 3
644 #define WLC_DUMP 6
645 #define WLC_GET_MSGLEVEL 7
646 #define WLC_SET_MSGLEVEL 8
647 #define WLC_GET_PROMISC 9
648 #define WLC_SET_PROMISC 10
649 #define WLC_GET_RATE 12
650 /* #define WLC_SET_RATE 13 */ /* no longer supported */
651 #define WLC_GET_INSTANCE 14
652 /* #define WLC_GET_FRAG 15 */ /* no longer supported */
653 /* #define WLC_SET_FRAG 16 */ /* no longer supported */
654 /* #define WLC_GET_RTS 17 */ /* no longer supported */
655 /* #define WLC_SET_RTS 18 */ /* no longer supported */
656 #define WLC_GET_INFRA 19
657 #define WLC_SET_INFRA 20
658 #define WLC_GET_AUTH 21
659 #define WLC_SET_AUTH 22
660 #define WLC_GET_BSSID 23
661 #define WLC_SET_BSSID 24
662 #define WLC_GET_SSID 25
663 #define WLC_SET_SSID 26
664 #define WLC_RESTART 27
665 #define WLC_GET_CHANNEL 29
666 #define WLC_SET_CHANNEL 30
667 #define WLC_GET_SRL 31
668 #define WLC_SET_SRL 32
669 #define WLC_GET_LRL 33
670 #define WLC_SET_LRL 34
671 #define WLC_GET_PLCPHDR 35
672 #define WLC_SET_PLCPHDR 36
673 #define WLC_GET_RADIO 37
674 #define WLC_SET_RADIO 38
675 #define WLC_GET_PHYTYPE 39
676 /* #define WLC_GET_WEP 42 */ /* no longer supported */
677 /* #define WLC_SET_WEP 43 */ /* no longer supported */
678 #define WLC_GET_KEY 44
679 #define WLC_SET_KEY 45
680 #define WLC_GET_REGULATORY 46
681 #define WLC_SET_REGULATORY 47
682 #define WLC_SCAN 50
683 #define WLC_SCAN_RESULTS 51
684 #define WLC_DISASSOC 52
685 #define WLC_REASSOC 53
686 #define WLC_GET_ROAM_TRIGGER 54
687 #define WLC_SET_ROAM_TRIGGER 55
688 #define WLC_GET_TXANT 61
689 #define WLC_SET_TXANT 62
690 #define WLC_GET_ANTDIV 63
691 #define WLC_SET_ANTDIV 64
692 /* #define WLC_GET_TXPWR 65 */ /* no longer supported */
693 /* #define WLC_SET_TXPWR 66 */ /* no longer supported */
694 #define WLC_GET_CLOSED 67
695 #define WLC_SET_CLOSED 68
696 #define WLC_GET_MACLIST 69
697 #define WLC_SET_MACLIST 70
698 #define WLC_GET_RATESET 71
699 #define WLC_SET_RATESET 72
700 /* #define WLC_GET_LOCALE 73 */ /* no longer supported */
701 #define WLC_LONGTRAIN 74
702 #define WLC_GET_BCNPRD 75
703 #define WLC_SET_BCNPRD 76
704 #define WLC_GET_DTIMPRD 77
705 #define WLC_SET_DTIMPRD 78
706 #define WLC_GET_SROM 79
707 #define WLC_SET_SROM 80
708 #define WLC_GET_WEP_RESTRICT 81
709 #define WLC_SET_WEP_RESTRICT 82
710 #define WLC_GET_COUNTRY 83
711 #define WLC_SET_COUNTRY 84
712 #define WLC_GET_REVINFO 98
713 #define WLC_GET_MACMODE 105
714 #define WLC_SET_MACMODE 106
715 #define WLC_GET_GMODE 109
716 #define WLC_SET_GMODE 110
717 #define WLC_GET_CURR_RATESET 114 /* current rateset */
718 #define WLC_GET_SCANSUPPRESS 115
719 #define WLC_SET_SCANSUPPRESS 116
720 #define WLC_GET_AP 117
721 #define WLC_SET_AP 118
722 #define WLC_GET_EAP_RESTRICT 119
723 #define WLC_SET_EAP_RESTRICT 120
724 #define WLC_GET_WDSLIST 123
725 #define WLC_SET_WDSLIST 124
726 #define WLC_GET_RSSI 127
727 #define WLC_GET_WSEC 133
728 #define WLC_SET_WSEC 134
729 #define WLC_GET_BSS_INFO 136
730 #define WLC_GET_LAZYWDS 138
731 #define WLC_SET_LAZYWDS 139
732 #define WLC_GET_BANDLIST 140
733 #define WLC_GET_BAND 141
734 #define WLC_SET_BAND 142
735 #define WLC_GET_SHORTSLOT 144
736 #define WLC_GET_SHORTSLOT_OVERRIDE 145
737 #define WLC_SET_SHORTSLOT_OVERRIDE 146
738 #define WLC_GET_SHORTSLOT_RESTRICT 147
739 #define WLC_SET_SHORTSLOT_RESTRICT 148
740 #define WLC_GET_GMODE_PROTECTION 149
741 #define WLC_GET_GMODE_PROTECTION_OVERRIDE 150
742 #define WLC_SET_GMODE_PROTECTION_OVERRIDE 151
743 #define WLC_UPGRADE 152
744 /* #define WLC_GET_MRATE 153 */ /* no longer supported */
745 /* #define WLC_SET_MRATE 154 */ /* no longer supported */
746 #define WLC_GET_ASSOCLIST 159
747 #define WLC_GET_CLK 160
748 #define WLC_SET_CLK 161
749 #define WLC_GET_UP 162
750 #define WLC_OUT 163
751 #define WLC_GET_WPA_AUTH 164
752 #define WLC_SET_WPA_AUTH 165
753 #define WLC_GET_PROTECTION_CONTROL 178
754 #define WLC_SET_PROTECTION_CONTROL 179
755 #define WLC_GET_PHYLIST 180
756 #define WLC_GET_KEY_SEQ 183
757 /* #define WLC_GET_GMODE_PROTECTION_CTS 198 */ /* no longer supported */
758 /* #define WLC_SET_GMODE_PROTECTION_CTS 199 */ /* no longer supported */
759 #define WLC_GET_PIOMODE 203
760 #define WLC_SET_PIOMODE 204
761 #define WLC_SET_LED 209
762 #define WLC_GET_LED 210
763 #define WLC_GET_CHANNEL_SEL 215
764 #define WLC_START_CHANNEL_SEL 216
765 #define WLC_GET_VALID_CHANNELS 217
766 #define WLC_GET_FAKEFRAG 218
767 #define WLC_SET_FAKEFRAG 219
768 #define WLC_GET_WET 230
769 #define WLC_SET_WET 231
770 #define WLC_GET_KEY_PRIMARY 235
771 #define WLC_SET_KEY_PRIMARY 236
772 #define WLC_GET_RADAR 242
773 #define WLC_SET_RADAR 243
774 #define WLC_SET_SPECT_MANAGMENT 244
775 #define WLC_GET_SPECT_MANAGMENT 245
776 #define WLC_WDS_GET_REMOTE_HWADDR 246 /* handled in wl_linux.c/wl_vx.c */
777 #define WLC_SET_CS_SCAN_TIMER 248
778 #define WLC_GET_CS_SCAN_TIMER 249
779 #define WLC_SEND_PWR_CONSTRAINT 254
780 #define WLC_CURRENT_PWR 256
781 #define WLC_GET_CHANNELS_IN_COUNTRY 260
782 #define WLC_GET_COUNTRY_LIST 261
783 #define WLC_GET_VAR 262 /* get value of named variable */
784 #define WLC_SET_VAR 263 /* set named variable to value */
785 #define WLC_NVRAM_GET 264 /* deprecated */
786 #define WLC_NVRAM_SET 265
787 #define WLC_SET_WSEC_PMK 268
788 #define WLC_GET_AUTH_MODE 269
789 #define WLC_SET_AUTH_MODE 270
790 #define WLC_NDCONFIG_ITEM 273 /* currently handled in wl_oid.c */
791 #define WLC_NVOTPW 274
792 #define WLC_OTPW 275
793 #define WLC_IOV_BLOCK_GET 276
794 #define WLC_IOV_MODULES_GET 277
795 #define WLC_SOFT_RESET 278
796 #define WLC_GET_ALLOW_MODE 279
797 #define WLC_SET_ALLOW_MODE 280
798 #define WLC_GET_DESIRED_BSSID 281
799 #define WLC_SET_DESIRED_BSSID 282
800 #define WLC_DISASSOC_MYAP 283
801 #define WLC_LAST 284 /* do not change - use get_var/set_var */
804 * Minor kludge alert:
805 * Duplicate a few definitions that irelay requires from epiioctl.h here
806 * so caller doesn't have to include this file and epiioctl.h .
807 * If this grows any more, it would be time to move these irelay-specific
808 * definitions out of the epiioctl.h and into a separate driver common file.
810 #ifndef EPICTRL_COOKIE
811 #define EPICTRL_COOKIE 0xABADCEDE
812 #endif
814 /* vx wlc ioctl's offset */
815 #define CMN_IOCTL_OFF 0x180
818 * custom OID support
820 * 0xFF - implementation specific OID
821 * 0xE4 - first byte of Broadcom PCI vendor ID
822 * 0x14 - second byte of Broadcom PCI vendor ID
823 * 0xXX - the custom OID number
826 /* begin 0x1f values beyond the start of the ET driver range. */
827 #define WL_OID_BASE 0xFFE41420
829 /* NDIS overrides */
830 #define OID_WL_GETINSTANCE (WL_OID_BASE + WLC_GET_INSTANCE)
831 #define OID_WL_NDCONFIG_ITEM (WL_OID_BASE + WLC_NDCONFIG_ITEM)
833 #define WL_DECRYPT_STATUS_SUCCESS 1
834 #define WL_DECRYPT_STATUS_FAILURE 2
835 #define WL_DECRYPT_STATUS_UNKNOWN 3
837 /* allows user-mode app to poll the status of USB image upgrade */
838 #define WLC_UPGRADE_SUCCESS 0
839 #define WLC_UPGRADE_PENDING 1
841 #ifdef CONFIG_USBRNDIS_RETAIL
842 /* struct passed in for WLC_NDCONFIG_ITEM */
843 typedef struct {
844 char *name;
845 void *param;
846 } ndconfig_item_t;
847 #endif
849 /* Bit masks for radio disabled status - returned by WL_GET_RADIO */
850 #define WL_RADIO_SW_DISABLE (1<<0)
851 #define WL_RADIO_HW_DISABLE (1<<1)
852 #define WL_RADIO_MPC_DISABLE (1<<2)
853 #define WL_RADIO_COUNTRY_DISABLE (1<<3) /* some countries don't support any channel */
855 /* Override bit for WLC_SET_TXPWR. if set, ignore other level limits */
856 #define WL_TXPWR_OVERRIDE (1<<31)
858 /* "diag" iovar argument and error code */
859 #define WL_DIAG_INTERRUPT 1 /* d11 loopback interrupt test */
860 #define WL_DIAG_MEMORY 3 /* d11 memory test */
861 #define WL_DIAG_LED 4 /* LED test */
862 #define WL_DIAG_REG 5 /* d11/phy register test */
863 #define WL_DIAG_SROM 6 /* srom read/crc test */
864 #define WL_DIAG_DMA 7 /* DMA test */
866 #define WL_DIAGERR_SUCCESS 0
867 #define WL_DIAGERR_FAIL_TO_RUN 1 /* unable to run requested diag */
868 #define WL_DIAGERR_NOT_SUPPORTED 2 /* diag requested is not supported */
869 #define WL_DIAGERR_INTERRUPT_FAIL 3 /* loopback interrupt test failed */
870 #define WL_DIAGERR_LOOPBACK_FAIL 4 /* loopback data test failed */
871 #define WL_DIAGERR_SROM_FAIL 5 /* srom read failed */
872 #define WL_DIAGERR_SROM_BADCRC 6 /* srom crc failed */
873 #define WL_DIAGERR_REG_FAIL 7 /* d11/phy register test failed */
874 #define WL_DIAGERR_MEMORY_FAIL 8 /* d11 memory test failed */
875 #define WL_DIAGERR_NOMEM 9 /* diag test failed due to no memory */
876 #define WL_DIAGERR_DMA_FAIL 10 /* DMA test failed */
878 #define WL_DIAGERR_MEMORY_TIMEOUT 11 /* d11 memory test didn't finish in time */
879 #define WL_DIAGERR_MEMORY_BADPATTERN 12 /* d11 memory test result in bad pattern */
881 /* band types */
882 #define WLC_BAND_AUTO 0 /* auto-select */
883 #define WLC_BAND_5G 1 /* 5 Ghz */
884 #define WLC_BAND_2G 2 /* 2.4 Ghz */
885 #define WLC_BAND_ALL 3 /* all bands */
887 /* phy types (returned by WLC_GET_PHYTPE) */
888 #define WLC_PHY_TYPE_A 0
889 #define WLC_PHY_TYPE_B 1
890 #define WLC_PHY_TYPE_G 2
891 #define WLC_PHY_TYPE_N 4
892 #define WLC_PHY_TYPE_LP 5
893 #define WLC_PHY_TYPE_NULL 0xf
895 /* MAC list modes */
896 #define WLC_MACMODE_DISABLED 0 /* MAC list disabled */
897 #define WLC_MACMODE_DENY 1 /* Deny specified (i.e. allow unspecified) */
898 #define WLC_MACMODE_ALLOW 2 /* Allow specified (i.e. deny unspecified) */
903 #define GMODE_LEGACY_B 0
904 #define GMODE_AUTO 1
905 #define GMODE_ONLY 2
906 #define GMODE_B_DEFERRED 3
907 #define GMODE_PERFORMANCE 4
908 #define GMODE_LRS 5
909 #define GMODE_MAX 6
911 /* values for PLCPHdr_override */
912 #define WLC_PLCP_AUTO -1
913 #define WLC_PLCP_SHORT 0
914 #define WLC_PLCP_LONG 1
916 /* values for g_protection_override and n_protection_override */
917 #define WLC_PROTECTION_AUTO -1
918 #define WLC_PROTECTION_OFF 0
919 #define WLC_PROTECTION_ON 1
920 #define WLC_PROTECTION_MMHDR_ONLY 2
921 #define WLC_PROTECTION_CTS_ONLY 3
923 /* values for g_protection_control and n_protection_control */
924 #define WLC_PROTECTION_CTL_OFF 0
925 #define WLC_PROTECTION_CTL_LOCAL 1
926 #define WLC_PROTECTION_CTL_OVERLAP 2
928 /* deprecated const names for g_protection_override */
929 #define WLC_G_PROTECTION_AUTO WLC_PROTECTION_AUTO
930 #define WLC_G_PROTECTION_OFF WLC_PROTECTION_OFF
931 #define WLC_G_PROTECTION_ON WLC_PROTECTION_ON
933 /* deprecated const names for g_protection_control */
934 #define WLC_G_PROTECTION_CTL_OFF WLC_PROTECTION_CTL_OFF
935 #define WLC_G_PROTECTION_CTL_LOCAL WLC_PROTECTION_CTL_LOCAL
936 #define WLC_G_PROTECTION_CTL_OVERLAP WLC_PROTECTION_CTL_OVERLAP
938 /* deprecated const names for get/set g_protection_control */
939 #define WLC_GET_GMODE_PROTECTION_CONTROL WLC_GET_PROTECTION_CONTROL
940 #define WLC_SET_GMODE_PROTECTION_CONTROL WLC_SET_PROTECTION_CONTROL
942 /* values for n_protection */
943 #define WLC_N_PROTECTION_OFF 0
944 #define WLC_N_PROTECTION_OPTIONAL 1
945 #define WLC_N_PROTECTION_20IN40 2
946 #define WLC_N_PROTECTION_MIXEDMODE 3
948 /* values for n_preamble_type */
949 #define WLC_N_PREAMBLE_MIXEDMODE 0
950 #define WLC_N_PREAMBLE_GF 1
952 /* values for band specific 40MHz capabilities */
953 #define WLC_N_BW_20ALL 0
954 #define WLC_N_BW_40ALL 1
955 #define WLC_N_BW_20IN2G_40IN5G 2
957 /* values to force tx/rx chain */
958 #define WLC_N_TXRX_CHAIN0 0
959 #define WLC_N_TXRX_CHAIN1 1
961 /* Values for PM */
962 #define PM_OFF 0
963 #define PM_MAX 1
964 #define PM_FAST 2
968 #define WL_ACI_ARGS_LEGACY_LENGTH 16 /* bytes of pre NPHY aci args */
970 /* Begin: wl_radar_args_t */
971 typedef struct {
972 int npulses; /* required number of pulses at n * t_int */
973 int ncontig; /* required number of pulses at t_int */
974 int min_pw; /* minimum pulse width (20 MHz clocks) */
975 int max_pw; /* maximum pulse width (20 MHz clocks) */
976 uint16 thresh0; /* Radar detection, thresh 0 */
977 uint16 thresh1; /* Radar detection, thresh 1 */
978 uint16 blank; /* Radar detection, blank control */
979 uint16 fmdemodcfg; /* Radar detection, fmdemod config */
980 int npulses_lp; /* Radar detection, minimum long pulses */
981 int min_pw_lp; /* Minimum pulsewidth for long pulses */
982 int max_pw_lp; /* Maximum pulsewidth for long pulses */
983 int min_fm_lp; /* Minimum fm for long pulses */
984 int max_deltat_lp; /* Maximum deltat for long pulses */
985 int min_deltat; /* Minimum spacing between pulses */
986 int max_deltat; /* Maximum spacing between pulses */
987 uint16 autocorr; /* Radar detection, autocorr on or off */
988 uint16 st_level_time; /* Radar detection, start_timing level */
989 uint32 version; /* version */
990 } wl_radar_args_t;
991 /* End: wl_radar_args_t */
992 #define WL_RADAR_ARGS_VERSION 1
994 typedef struct {
995 uint32 version; /* version */
996 uint16 thresh0_20_lo; /* Radar detection, thresh 0 (range 5250-5350MHz) for BW 20MHz */
997 uint16 thresh1_20_lo; /* Radar detection, thresh 1 (range 5250-5350MHz) for BW 20MHz */
998 uint16 thresh0_40_lo; /* Radar detection, thresh 0 (range 5250-5350MHz) for BW 40MHz */
999 uint16 thresh1_40_lo; /* Radar detection, thresh 1 (range 5250-5350MHz) for BW 40MHz */
1000 uint16 thresh0_20_hi; /* Radar detection, thresh 0 (range 5470-5725MHz) for BW 20MHz */
1001 uint16 thresh1_20_hi; /* Radar detection, thresh 1 (range 5470-5725MHz) for BW 20MHz */
1002 uint16 thresh0_40_hi; /* Radar detection, thresh 0 (range 5470-5725MHz) for BW 40MHz */
1003 uint16 thresh1_40_hi; /* Radar detection, thresh 1 (range 5470-5725MHz) for BW 40MHz */
1004 } wl_radar_thr_t;
1005 #define WL_RADAR_THR_VERSION 1
1006 #define WL_THRESHOLD_LO_BAND 70 /* range from 5250MHz - 5350MHz */
1008 /* radar iovar SET defines */
1009 #define WL_RADAR_DETECTOR_OFF 0 /* radar detector off */
1010 #define WL_RADAR_DETECTOR_ON 1 /* radar detector on */
1011 #define WL_RADAR_SIMULATED 2 /* force radar detector to declare
1012 * detection once
1015 #define WL_RSSI_ANT_VERSION 1 /* current version of wl_rssi_ant_t */
1016 #define WL_RSSI_ANT_MAX 4 /* max possible rx antennas */
1018 /* RSSI per antenna */
1019 typedef struct {
1020 uint32 version; /* version field */
1021 uint32 count; /* number of valid antenna rssi */
1022 int8 rssi_ant[WL_RSSI_ANT_MAX]; /* rssi per antenna */
1023 } wl_rssi_ant_t;
1026 /* dfs_status iovar-related defines */
1028 /* cac - channel availability check,
1029 * ism - in-service monitoring
1030 * csa - channel switching announcement
1033 /* cac state values */
1034 #define WL_DFS_CACSTATE_IDLE 0 /* state for operating in non-radar channel */
1035 #define WL_DFS_CACSTATE_PREISM_CAC 1 /* CAC in progress */
1036 #define WL_DFS_CACSTATE_ISM 2 /* ISM in progress */
1037 #define WL_DFS_CACSTATE_CSA 3 /* csa */
1038 #define WL_DFS_CACSTATE_POSTISM_CAC 4 /* ISM CAC */
1039 #define WL_DFS_CACSTATE_PREISM_OOC 5 /* PREISM OOC */
1040 #define WL_DFS_CACSTATE_POSTISM_OOC 6 /* POSTISM OOC */
1041 #define WL_DFS_CACSTATES 7 /* this many states exist */
1043 /* data structure used in 'dfs_status' wl interface, which is used to query dfs status */
1044 typedef struct {
1045 uint state; /* noted by WL_DFS_CACSTATE_XX. */
1046 uint duration; /* time spent in ms in state. */
1047 /* as dfs enters ISM state, it removes the operational channel from quiet channel
1048 * list and notes the channel in channel_cleared. set to 0 if no channel is cleared
1050 chanspec_t chanspec_cleared;
1051 /* chanspec cleared used to be a uint, add another to uint16 to maintain size */
1052 uint16 pad;
1053 } wl_dfs_status_t;
1057 typedef struct tx_inst_power {
1058 uint8 txpwr_est_Pout[2]; /* Latest estimate for 2.4 and 5 Ghz */
1059 uint8 txpwr_est_Pout_gofdm; /* Pwr estimate for 2.4 OFDM */
1060 } tx_inst_power_t;
1063 /* regulatory enforcement levels */
1064 #define SPECT_MNGMT_OFF 0 /* both 11h and 11d disabled */
1065 #define SPECT_MNGMT_LOOSE_11H 1 /* allow non-11h APs in scan lists */
1066 #define SPECT_MNGMT_STRICT_11H 2 /* prune out non-11h APs from scan list */
1067 #define SPECT_MNGMT_STRICT_11D 3 /* switch to 802.11D mode */
1068 /* SPECT_MNGMT_LOOSE_11H_D - same as SPECT_MNGMT_LOOSE with the exception that Country IE
1069 * adoption is done irregardless of capability-spectrum_management
1071 #define SPECT_MNGMT_LOOSE_11H_D 4 /* operation defined above */
1073 #define WL_CHAN_VALID_HW (1 << 0) /* valid with current HW */
1074 #define WL_CHAN_VALID_SW (1 << 1) /* valid with current country setting */
1075 #define WL_CHAN_BAND_5G (1 << 2) /* 5GHz-band channel */
1076 #define WL_CHAN_RADAR (1 << 3) /* radar sensitive channel */
1077 #define WL_CHAN_INACTIVE (1 << 4) /* temporarily inactive due to radar */
1078 #define WL_CHAN_PASSIVE (1 << 5) /* channel is in passive mode */
1079 #define WL_CHAN_RESTRICTED (1 << 6) /* restricted use channel */
1081 /* BTC mode used by "btc_mode" iovar */
1082 #define WL_BTC_DISABLE 0 /* disable BT coexistence */
1083 #define WL_BTC_ENABLE 1 /* enable BT coexistence */
1084 #define WL_BTC_PREMPT 2 /* enable BT coexistence and BT preemption */
1086 #define WL_PHYCAL_VAL 0x00100000
1087 #define WL_MPC_VAL 0x00400000
1088 #define WL_APSTA_VAL 0x00800000
1089 #define WL_DFS_VAL 0x01000000
1090 #define WL_BA_VAL 0x02000000
1091 #define WL_MBSS_VAL 0x04000000
1092 #define WL_CAC_VAL 0x08000000
1093 #define WL_AMSDU_VAL 0x10000000
1094 #define WL_AMPDU_VAL 0x20000000
1095 #define WL_FFPLD_VAL 0x40000000
1097 /* max # of leds supported by GPIO (gpio pin# == led index#) */
1098 #define WL_LED_NUMGPIO 16 /* gpio 0-15 */
1100 /* led per-pin behaviors */
1101 #define WL_LED_OFF 0 /* always off */
1102 #define WL_LED_ON 1 /* always on */
1103 #define WL_LED_ACTIVITY 2 /* activity */
1104 #define WL_LED_RADIO 3 /* radio enabled */
1105 #define WL_LED_ARADIO 4 /* 5 Ghz radio enabled */
1106 #define WL_LED_BRADIO 5 /* 2.4Ghz radio enabled */
1107 #define WL_LED_BGMODE 6 /* on if gmode, off if bmode */
1108 #define WL_LED_WI1 7
1109 #define WL_LED_WI2 8
1110 #define WL_LED_WI3 9
1111 #define WL_LED_ASSOC 10 /* associated state indicator */
1112 #define WL_LED_INACTIVE 11 /* null behavior (clears default behavior) */
1113 #define WL_LED_ASSOCACT 12 /* on when associated; blink fast for activity */
1114 #define WL_LED_NUMBEHAVIOR 13
1116 /* led behavior numeric value format */
1117 #define WL_LED_BEH_MASK 0x7f /* behavior mask */
1118 #define WL_LED_AL_MASK 0x80 /* activelow (polarity) bit */
1120 #define WL_NUMCHANSPECS 100
1122 /* WDS link local endpoint WPA role */
1123 #define WL_WDS_WPA_ROLE_AUTH 0 /* authenticator */
1124 #define WL_WDS_WPA_ROLE_SUP 1 /* supplicant */
1125 #define WL_WDS_WPA_ROLE_AUTO 255 /* auto, based on mac addr value */
1127 /* number of bytes needed to define a 128-bit mask for MAC event reporting */
1128 #define WL_EVENTING_MASK_LEN 16
1130 /* Structures and constants used for "vndr_ie" IOVar interface */
1131 #define VNDR_IE_CMD_LEN 4 /* length of the set command string:
1132 * "add", "del" (+ NULL)
1135 /* 802.11 Mgmt Packet flags */
1136 #define VNDR_IE_BEACON_FLAG 0x1
1137 #define VNDR_IE_PRBRSP_FLAG 0x2
1138 #define VNDR_IE_ASSOCRSP_FLAG 0x4
1139 #define VNDR_IE_AUTHRSP_FLAG 0x8
1140 #define VNDR_IE_PRBREQ_FLAG 0x10
1141 #define VNDR_IE_ASSOCREQ_FLAG 0x20
1143 #define VNDR_IE_INFO_HDR_LEN (sizeof(uint32))
1145 typedef struct {
1146 uint32 pktflag; /* bitmask indicating which packet(s) contain this IE */
1147 vndr_ie_t vndr_ie_data; /* vendor IE data */
1148 } vndr_ie_info_t;
1150 typedef struct {
1151 int iecount; /* number of entries in the vndr_ie_list[] array */
1152 vndr_ie_info_t vndr_ie_list[1]; /* variable size list of vndr_ie_info_t structs */
1153 } vndr_ie_buf_t;
1155 typedef struct {
1156 char cmd[VNDR_IE_CMD_LEN]; /* vndr_ie IOVar set command : "add", "del" + NULL */
1157 vndr_ie_buf_t vndr_ie_buffer; /* buffer containing Vendor IE list information */
1158 } vndr_ie_setbuf_t;
1160 /* join preference iovar value */
1162 * Join preference iovar value is an array of tuples. Each tuple has a one-byte type,
1163 * a one-byte length, and a variable length value. RSSI type tuple must be present
1164 * in the array.
1166 * Types are defined in "join preference types" section.
1168 * Length is the value size in octets. It is reserved for WL_JOIN_PREF_WPA type tuple
1169 * and must be set to zero.
1171 * Values are defined below.
1173 * 1. RSSI - 2 octets
1174 * offset 0: reserved
1175 * offset 1: reserved
1177 * 2. WPA - 2 + 12 * n octets (n is # tuples defined below)
1178 * offset 0: reserved
1179 * offset 1: # of tuples
1180 * offset 2: tuple 1
1181 * offset 14: tuple 2
1182 * ...
1183 * offset 2 + 12 * (n - 1) octets: tuple n
1185 * struct wpa_cfg_tuple {
1186 * uint8 akm[DOT11_OUI_LEN+1]; akm suite
1187 * uint8 ucipher[DOT11_OUI_LEN+1]; unicast cipher suite
1188 * uint8 mcipher[DOT11_OUI_LEN+1]; multicast cipher suite
1189 * };
1191 * multicast cipher suite can be specified as a specific cipher suite or WL_WPA_ACP_MCS_ANY.
1193 * 3. BAND - 2 octets
1194 * offset 0: reserved
1195 * offset 1: see "band preference" and "band types"
1197 /* join preference types */
1198 #define WL_JOIN_PREF_RSSI 1 /* by RSSI */
1199 #define WL_JOIN_PREF_WPA 2 /* by akm and ciphers */
1200 #define WL_JOIN_PREF_BAND 3 /* by 802.11 band */
1202 /* band preference */
1204 /* any multicast cipher suite */
1205 #define WL_WPA_ACP_MCS_ANY "\x00\x00\x00\x00"
1207 struct tsinfo_arg {
1208 uint8 octets[3];
1211 #if !defined(__GNUC__)
1212 #pragma pack(pop)
1213 #endif
1215 #define NFIFO 6 /* # tx/rx fifopairs */
1217 #define WL_CNT_T_VERSION 3 /* current version of wl_cnt_t struct */
1219 typedef struct {
1220 uint16 version; /* see definition of WL_CNT_T_VERSION */
1221 uint16 length; /* length of entire structure */
1223 /* transmit stat counters */
1224 uint32 txframe; /* tx data frames */
1225 uint32 txbyte; /* tx data bytes */
1226 uint32 txretrans; /* tx mac retransmits */
1227 uint32 txerror; /* tx data errors (derived: sum of others) */
1228 uint32 txctl; /* tx management frames */
1229 uint32 txprshort; /* tx short preamble frames */
1230 uint32 txserr; /* tx status errors */
1231 uint32 txnobuf; /* tx out of buffers errors */
1232 uint32 txnoassoc; /* tx discard because we're not associated */
1233 uint32 txrunt; /* tx runt frames */
1234 uint32 txchit; /* tx header cache hit (fastpath) */
1235 uint32 txcmiss; /* tx header cache miss (slowpath) */
1237 /* transmit chip error counters */
1238 uint32 txuflo; /* tx fifo underflows */
1239 uint32 txphyerr; /* tx phy errors (indicated in tx status) */
1240 uint32 txphycrs;
1242 /* receive stat counters */
1243 uint32 rxframe; /* rx data frames */
1244 uint32 rxbyte; /* rx data bytes */
1245 uint32 rxerror; /* rx data errors (derived: sum of others) */
1246 uint32 rxctl; /* rx management frames */
1247 uint32 rxnobuf; /* rx out of buffers errors */
1248 uint32 rxnondata; /* rx non data frames in the data channel errors */
1249 uint32 rxbadds; /* rx bad DS errors */
1250 uint32 rxbadcm; /* rx bad control or management frames */
1251 uint32 rxfragerr; /* rx fragmentation errors */
1252 uint32 rxrunt; /* rx runt frames */
1253 uint32 rxgiant; /* rx giant frames */
1254 uint32 rxnoscb; /* rx no scb error */
1255 uint32 rxbadproto; /* rx invalid frames */
1256 uint32 rxbadsrcmac; /* rx frames with Invalid Src Mac */
1257 uint32 rxbadda; /* rx frames tossed for invalid da */
1258 uint32 rxfilter; /* rx frames filtered out */
1260 /* receive chip error counters */
1261 uint32 rxoflo; /* rx fifo overflow errors */
1262 uint32 rxuflo[NFIFO]; /* rx dma descriptor underflow errors */
1264 uint32 d11cnt_txrts_off; /* d11cnt txrts value when reset d11cnt */
1265 uint32 d11cnt_rxcrc_off; /* d11cnt rxcrc value when reset d11cnt */
1266 uint32 d11cnt_txnocts_off; /* d11cnt txnocts value when reset d11cnt */
1268 /* misc counters */
1269 uint32 dmade; /* tx/rx dma descriptor errors */
1270 uint32 dmada; /* tx/rx dma data errors */
1271 uint32 dmape; /* tx/rx dma descriptor protocol errors */
1272 uint32 reset; /* reset count */
1273 uint32 tbtt; /* cnts the TBTT int's */
1274 uint32 txdmawar;
1275 uint32 pkt_callback_reg_fail; /* callbacks register failure */
1277 /* MAC counters: 32-bit version of d11.h's macstat_t */
1278 uint32 txallfrm; /* total number of frames sent, incl. Data, ACK, RTS, CTS,
1279 * Control Management (includes retransmissions)
1281 uint32 txrtsfrm; /* number of RTS sent out by the MAC */
1282 uint32 txctsfrm; /* number of CTS sent out by the MAC */
1283 uint32 txackfrm; /* number of ACK frames sent out */
1284 uint32 txdnlfrm; /* Not used */
1285 uint32 txbcnfrm; /* beacons transmitted */
1286 uint32 txfunfl[8]; /* per-fifo tx underflows */
1287 uint32 txtplunfl; /* Template underflows (mac was too slow to transmit ACK/CTS
1288 * or BCN)
1290 uint32 txphyerror; /* Transmit phy error, type of error is reported in tx-status for
1291 * driver enqueued frames
1293 uint32 rxfrmtoolong; /* Received frame longer than legal limit (2346 bytes) */
1294 uint32 rxfrmtooshrt; /* Received frame did not contain enough bytes for its frame type */
1295 uint32 rxinvmachdr; /* Either the protocol version != 0 or frame type not
1296 * data/control/management
1298 uint32 rxbadfcs; /* number of frames for which the CRC check failed in the MAC */
1299 uint32 rxbadplcp; /* parity check of the PLCP header failed */
1300 uint32 rxcrsglitch; /* PHY was able to correlate the preamble but not the header */
1301 uint32 rxstrt; /* Number of received frames with a good PLCP
1302 * (i.e. passing parity check)
1304 uint32 rxdfrmucastmbss; /* Number of received DATA frames with good FCS and matching RA */
1305 uint32 rxmfrmucastmbss; /* number of received mgmt frames with good FCS and matching RA */
1306 uint32 rxcfrmucast; /* number of received CNTRL frames with good FCS and matching RA */
1307 uint32 rxrtsucast; /* number of unicast RTS addressed to the MAC (good FCS) */
1308 uint32 rxctsucast; /* number of unicast CTS addressed to the MAC (good FCS) */
1309 uint32 rxackucast; /* number of ucast ACKS received (good FCS) */
1310 uint32 rxdfrmocast; /* number of received DATA frames (good FCS and not matching RA) */
1311 uint32 rxmfrmocast; /* number of received MGMT frames (good FCS and not matching RA) */
1312 uint32 rxcfrmocast; /* number of received CNTRL frame (good FCS and not matching RA) */
1313 uint32 rxrtsocast; /* number of received RTS not addressed to the MAC */
1314 uint32 rxctsocast; /* number of received CTS not addressed to the MAC */
1315 uint32 rxdfrmmcast; /* number of RX Data multicast frames received by the MAC */
1316 uint32 rxmfrmmcast; /* number of RX Management multicast frames received by the MAC */
1317 uint32 rxcfrmmcast; /* number of RX Control multicast frames received by the MAC
1318 * (unlikely to see these)
1320 uint32 rxbeaconmbss; /* beacons received from member of BSS */
1321 uint32 rxdfrmucastobss; /* number of unicast frames addressed to the MAC from
1322 * other BSS (WDS FRAME)
1324 uint32 rxbeaconobss; /* beacons received from other BSS */
1325 uint32 rxrsptmout; /* Number of response timeouts for transmitted frames
1326 * expecting a response
1328 uint32 bcntxcancl; /* transmit beacons canceled due to receipt of beacon (IBSS) */
1329 uint32 rxf0ovfl; /* Number of receive fifo 0 overflows */
1330 uint32 rxf1ovfl; /* Number of receive fifo 1 overflows (obsolete) */
1331 uint32 rxf2ovfl; /* Number of receive fifo 2 overflows (obsolete) */
1332 uint32 txsfovfl; /* Number of transmit status fifo overflows (obsolete) */
1333 uint32 pmqovfl; /* Number of PMQ overflows */
1334 uint32 rxcgprqfrm; /* Number of received Probe requests that made it into
1335 * the PRQ fifo
1337 uint32 rxcgprsqovfl; /* Rx Probe Request Que overflow in the AP */
1338 uint32 txcgprsfail; /* Tx Probe Response Fail. AP sent probe response but did
1339 * not get ACK
1341 uint32 txcgprssuc; /* Tx Probe Response Success (ACK was received) */
1342 uint32 prs_timeout; /* Number of probe requests that were dropped from the PRQ
1343 * fifo because a probe response could not be sent out within
1344 * the time limit defined in M_PRS_MAXTIME
1346 uint32 rxnack; /* Number of NACKS received (Afterburner) */
1347 uint32 frmscons; /* Number of frames completed without transmission because of an
1348 * Afterburner re-queue
1350 uint32 txnack; /* Number of NACKs transmitted (Afterburner) */
1351 uint32 txglitch_nack; /* obsolete */
1352 uint32 txburst; /* obsolete */
1354 /* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
1355 uint32 txfrag; /* dot11TransmittedFragmentCount */
1356 uint32 txmulti; /* dot11MulticastTransmittedFrameCount */
1357 uint32 txfail; /* dot11FailedCount */
1358 uint32 txretry; /* dot11RetryCount */
1359 uint32 txretrie; /* dot11MultipleRetryCount */
1360 uint32 rxdup; /* dot11FrameduplicateCount */
1361 uint32 txrts; /* dot11RTSSuccessCount */
1362 uint32 txnocts; /* dot11RTSFailureCount */
1363 uint32 txnoack; /* dot11ACKFailureCount */
1364 uint32 rxfrag; /* dot11ReceivedFragmentCount */
1365 uint32 rxmulti; /* dot11MulticastReceivedFrameCount */
1366 uint32 rxcrc; /* dot11FCSErrorCount */
1367 uint32 txfrmsnt; /* dot11TransmittedFrameCount (bogus MIB?) */
1368 uint32 rxundec; /* dot11WEPUndecryptableCount */
1370 /* WPA2 counters (see rxundec for DecryptFailureCount) */
1371 uint32 tkipmicfaill; /* TKIPLocalMICFailures */
1372 uint32 tkipcntrmsr; /* TKIPCounterMeasuresInvoked */
1373 uint32 tkipreplay; /* TKIPReplays */
1374 uint32 ccmpfmterr; /* CCMPFormatErrors */
1375 uint32 ccmpreplay; /* CCMPReplays */
1376 uint32 ccmpundec; /* CCMPDecryptErrors */
1377 uint32 fourwayfail; /* FourWayHandshakeFailures */
1378 uint32 wepundec; /* dot11WEPUndecryptableCount */
1379 uint32 wepicverr; /* dot11WEPICVErrorCount */
1380 uint32 decsuccess; /* DecryptSuccessCount */
1381 uint32 tkipicverr; /* TKIPICVErrorCount */
1382 uint32 wepexcluded; /* dot11WEPExcludedCount */
1384 uint32 txchanrej; /* Tx frames suppressed due to channel rejection */
1385 uint32 psmwds; /* Count PSM watchdogs */
1386 uint32 phywatchdog; /* Count Phy watchdogs (triggered by ucode) */
1388 /* MBSS counters, AP only */
1389 uint32 prq_entries_handled; /* PRQ entries read in */
1390 uint32 prq_undirected_entries; /* which were bcast bss & ssid */
1391 uint32 prq_bad_entries; /* which could not be translated to info */
1392 uint32 atim_suppress_count; /* TX suppressions on ATIM fifo */
1393 uint32 bcn_template_not_ready; /* Template marked in use on send bcn ... */
1394 uint32 bcn_template_not_ready_done; /* ...but "DMA done" interrupt rcvd */
1395 uint32 late_tbtt_dpc; /* TBTT DPC did not happen in time */
1396 } wl_cnt_t;
1398 #define WL_WME_CNT_VERSION 1 /* current version of wl_wme_cnt_t */
1400 typedef struct {
1401 uint32 packets;
1402 uint32 bytes;
1403 } wl_traffic_stats_t;
1405 typedef struct {
1406 uint16 version; /* see definition of WL_WME_CNT_VERSION */
1407 uint16 length; /* length of entire structure */
1409 wl_traffic_stats_t tx[AC_COUNT]; /* Packets transmitted */
1410 wl_traffic_stats_t tx_failed[AC_COUNT]; /* Packets dropped or failed to transmit */
1411 wl_traffic_stats_t rx[AC_COUNT]; /* Packets received */
1412 wl_traffic_stats_t rx_failed[AC_COUNT]; /* Packets failed to receive */
1414 wl_traffic_stats_t forward[AC_COUNT]; /* Packets forwarded by AP */
1416 wl_traffic_stats_t tx_expired[AC_COUNT]; /* packets dropped due to lifetime expiry */
1418 } wl_wme_cnt_t;
1420 #ifdef WLBA
1422 #define WLC_BA_CNT_VERSION 1 /* current version of wlc_ba_cnt_t */
1424 /* block ack related stats */
1425 typedef struct wlc_ba_cnt {
1426 uint16 version; /* WLC_BA_CNT_VERSION */
1427 uint16 length; /* length of entire structure */
1429 /* transmit stat counters */
1430 uint32 txpdu; /* pdus sent */
1431 uint32 txsdu; /* sdus sent */
1432 uint32 txfc; /* tx side flow controlled packets */
1433 uint32 txfci; /* tx side flow control initiated */
1434 uint32 txretrans; /* retransmitted pdus */
1435 uint32 txbatimer; /* ba resend due to timer */
1436 uint32 txdrop; /* dropped packets */
1437 uint32 txaddbareq; /* addba req sent */
1438 uint32 txaddbaresp; /* addba resp sent */
1439 uint32 txdelba; /* delba sent */
1440 uint32 txba; /* ba sent */
1441 uint32 txbar; /* bar sent */
1442 uint32 txpad[4]; /* future */
1444 /* receive side counters */
1445 uint32 rxpdu; /* pdus recd */
1446 uint32 rxqed; /* pdus buffered before sending up */
1447 uint32 rxdup; /* duplicate pdus */
1448 uint32 rxnobuf; /* pdus discarded due to no buf */
1449 uint32 rxaddbareq; /* addba req recd */
1450 uint32 rxaddbaresp; /* addba resp recd */
1451 uint32 rxdelba; /* delba recd */
1452 uint32 rxba; /* ba recd */
1453 uint32 rxbar; /* bar recd */
1454 uint32 rxinvba; /* invalid ba recd */
1455 uint32 rxbaholes; /* ba recd with holes */
1456 uint32 rxunexp; /* unexpected packets */
1457 uint32 rxpad[4]; /* future */
1458 } wlc_ba_cnt_t;
1459 #endif /* WLBA */
1461 /* structure for per-tid ampdu control */
1462 struct ampdu_tid_control {
1463 uint8 tid; /* tid */
1464 uint8 enable; /* enable/disable */
1467 /* structure for identifying ea/tid for sending addba/delba */
1468 struct ampdu_ea_tid {
1469 struct ether_addr ea; /* Station address */
1470 uint8 tid; /* tid */
1473 /* Different discovery modes for dpt */
1474 #define DPT_DISCOVERY_MANUAL 0x01 /* manual discovery mode */
1475 #define DPT_DISCOVERY_AUTO 0x02 /* auto discovery mode */
1476 #define DPT_DISCOVERY_SCAN 0x04 /* scan-based discovery mode */
1478 /* different path selection values */
1479 #define DPT_PATHSEL_AUTO 0 /* auto mode for path selection */
1480 #define DPT_PATHSEL_DIRECT 1 /* always use direct DPT path */
1481 #define DPT_PATHSEL_APPATH 2 /* always use AP path */
1483 /* different ops for deny list */
1484 #define DPT_DENY_LIST_ADD 1 /* add to dpt deny list */
1485 #define DPT_DENY_LIST_REMOVE 2 /* remove from dpt deny list */
1487 /* different ops for manual end point */
1488 #define DPT_MANUAL_EP_CREATE 1 /* create manual dpt endpoint */
1489 #define DPT_MANUAL_EP_MODIFY 2 /* modify manual dpt endpoint */
1490 #define DPT_MANUAL_EP_DELETE 3 /* delete manual dpt endpoint */
1492 /* structure for dpt iovars */
1493 typedef struct dpt_iovar {
1494 struct ether_addr ea; /* Station address */
1495 uint8 mode; /* mode: depends on iovar */
1496 uint32 pad; /* future */
1497 } dpt_iovar_t;
1499 /* structure for addts arguments */
1500 /* For ioctls that take a list of TSPEC */
1501 struct tslist {
1502 int count; /* number of tspecs */
1503 struct tsinfo_arg tsinfo[1]; /* variable length array of tsinfo */
1506 /* structure for addts/delts arguments */
1507 typedef struct tspec_arg {
1508 uint16 version; /* see definition of TSPEC_ARG_VERSION */
1509 uint16 length; /* length of entire structure */
1510 uint flag; /* bit field */
1511 /* TSPEC Arguments */
1512 struct tsinfo_arg tsinfo; /* TS Info bit field */
1513 uint16 nom_msdu_size; /* (Nominal or fixed) MSDU Size (bytes) */
1514 uint16 max_msdu_size; /* Maximum MSDU Size (bytes) */
1515 uint min_srv_interval; /* Minimum Service Interval (us) */
1516 uint max_srv_interval; /* Maximum Service Interval (us) */
1517 uint inactivity_interval; /* Inactivity Interval (us) */
1518 uint suspension_interval; /* Suspension Interval (us) */
1519 uint srv_start_time; /* Service Start Time (us) */
1520 uint min_data_rate; /* Minimum Data Rate (bps) */
1521 uint mean_data_rate; /* Mean Data Rate (bps) */
1522 uint peak_data_rate; /* Peak Data Rate (bps) */
1523 uint max_burst_size; /* Maximum Burst Size (bytes) */
1524 uint delay_bound; /* Delay Bound (us) */
1525 uint min_phy_rate; /* Minimum PHY Rate (bps) */
1526 uint16 surplus_bw; /* Surplus Bandwidth Allowance Factor */
1527 uint16 medium_time; /* Medium Time (32 us/s periods) */
1528 } tspec_arg_t;
1530 /* current version of wl_tspec_arg_t struct */
1531 #define TSPEC_ARG_VERSION 1 /* current version of wl_tspec_arg_t struct */
1532 #define TSPEC_ARG_LENGTH 55 /* argment length from tsinfo to medium_time */
1534 /* define for flag */
1535 #define TSPEC_PENDING 0 /* TSPEC pending */
1536 #define TSPEC_ACCEPTED 1 /* TSPEC accepted */
1537 #define TSPEC_REJECTED 2 /* TSPEC rejected */
1538 #define TSPEC_UNKNOWN 3 /* TSPEC unknown */
1539 #define TSPEC_STATUS_MASK 7 /* TSPEC status mask */
1542 /* Software feature flag defines used by wlfeatureflag */
1543 #define WL_SWFL_ABBFL 0x0001 /* Allow Afterburner on systems w/o hardware BFL */
1544 #define WL_SWFL_ABENCORE 0x0002 /* Allow AB on non-4318E chips */
1545 #define WL_SWFL_NOHWRADIO 0x0004 /* Disable HW Radio monitor (e.g., Apple) */
1547 #define WL_LIFETIME_MAX 0xFFFF /* Max value in ms */
1549 /* Packet lifetime configuration per ac */
1550 typedef struct wl_lifetime {
1551 uint32 ac; /* access class */
1552 uint32 lifetime; /* Packet lifetime value in ms */
1553 } wl_lifetime_t;
1556 /* Channel Switch Announcement param */
1557 typedef struct wl_chan_switch {
1558 uint8 mode; /* value 0 or 1 */
1559 uint8 count; /* count # of beacons before switching */
1560 chanspec_t chspec; /* chanspec */
1561 uint8 reg; /* regulatory class */
1562 } wl_chan_switch_t;
1564 /* Roaming trigger definitions for WLC_SET_ROAM_TRIGGER.
1566 * (-100 < value < 0) value is used directly as a roaming trigger in dBm
1567 * (0 <= value) value specifies a logical roaming trigger level from
1568 * the list below
1570 * WLC_GET_ROAM_TRIGGER always returns roaming trigger value in dBm, never
1571 * the logical roam trigger value.
1573 #define WLC_ROAM_TRIGGER_DEFAULT 0 /* default roaming trigger */
1574 #define WLC_ROAM_TRIGGER_BANDWIDTH 1 /* optimize for bandwidth roaming trigger */
1575 #define WLC_ROAM_TRIGGER_DISTANCE 2 /* optimize for distance roaming trigger */
1576 #define WLC_ROAM_TRIGGER_MAX_VALUE 2 /* max. valid value */
1578 /* Preferred Network Offload (PNO, formerly PFN) defines */
1579 enum {
1580 PFN_LIST_ORDER,
1581 PFN_RSSI
1584 enum {
1585 DISABLE,
1586 ENABLE
1589 #define SORT_CRITERIA_BIT 0
1590 #define AUTO_NET_SWITCH_BIT 1
1591 #define ENABLE_BKGRD_SCAN_BIT 2
1593 #define SORT_CRITERIA_MASK 0x01
1594 #define AUTO_NET_SWITCH_MASK 0x02
1595 #define ENABLE_BKGRD_SCAN_MASK 0x04
1597 #define PFN_VERSION 1
1599 /* PFN data structure */
1600 typedef struct wl_pfn_param {
1601 int32 version; /* version field */
1602 int32 scan_freq; /* Scan frequency */
1603 int32 lost_network_timeout; /* Timeout in sec. to declare
1604 * discovered network as lost
1606 int16 flags; /* Bit field to control feature
1607 * of PFN such as sort criteria auto
1608 * enable switch and back ground scan
1610 #if defined(WLPFN_AUTO_CONNECT) || !defined(BCMDRIVER)
1611 int16 rssi_margin; /* Margin to avoid jitter for choosing a
1612 * PFN based on RSSI sort criteria
1614 #else
1615 int16 pad;
1616 #endif
1617 } wl_pfn_param_t;
1619 typedef struct wl_pfn {
1620 wlc_ssid_t ssid; /* ssid name and its length */
1621 int32 bss_type; /* IBSS or infrastructure */
1622 #if defined(WLPFN_AUTO_CONNECT) || !defined(BCMDRIVER)
1623 int32 infra; /* BSS Vs IBSS */
1624 int32 auth; /* Open Vs Closed */
1625 int32 wpa_auth; /* WPA type */
1626 int32 wsec; /* wsec value */
1627 union {
1628 wl_wsec_key_t sec_key; /* Security Settings for WEP */
1629 wsec_pmk_t wpa_sec_key; /* Security setting for WPA */
1630 } pfn_security;
1631 #endif
1632 } wl_pfn_t;
1634 /* TCP Checksum Offload defines */
1635 #define TOE_TX_CSUM_OL 0x00000001
1636 #define TOE_RX_CSUM_OL 0x00000002
1638 /* TCP Checksum Offload error injection for testing (BCMINTERNAL) */
1639 #define TOE_ERRTEST_TX_CSUM 0x00000001
1640 #define TOE_ERRTEST_RX_CSUM 0x00000002
1641 #define TOE_ERRTEST_RX_CSUM2 0x00000004
1643 struct toe_ol_stats_t {
1644 /* Num of tx packets that don't need to be checksummed */
1645 uint32 tx_summed;
1647 /* Num of tx packets where checksum is filled by offload engine */
1648 uint32 tx_iph_fill;
1649 uint32 tx_tcp_fill;
1650 uint32 tx_udp_fill;
1651 uint32 tx_icmp_fill;
1653 /* Num of rx packets where toe finds out if checksum is good or bad */
1654 uint32 rx_iph_good;
1655 uint32 rx_iph_bad;
1656 uint32 rx_tcp_good;
1657 uint32 rx_tcp_bad;
1658 uint32 rx_udp_good;
1659 uint32 rx_udp_bad;
1660 uint32 rx_icmp_good;
1661 uint32 rx_icmp_bad;
1663 /* Num of tx packets in which csum error is injected */
1664 uint32 tx_tcp_errinj;
1665 uint32 tx_udp_errinj;
1666 uint32 tx_icmp_errinj;
1668 /* Num of rx packets in which csum error is injected */
1669 uint32 rx_tcp_errinj;
1670 uint32 rx_udp_errinj;
1671 uint32 rx_icmp_errinj;
1674 /* ARP Offload feature flags for arp_ol iovar */
1675 #define ARP_OL_AGENT 0x00000001
1676 #define ARP_OL_SNOOP 0x00000002
1677 #define ARP_OL_HOST_AUTO_REPLY 0x00000004
1678 #define ARP_OL_PEER_AUTO_REPLY 0x00000008
1680 /* ARP Offload error injection (BCMINTERNAL) */
1681 #define ARP_ERRTEST_REPLY_PEER 0x1
1682 #define ARP_ERRTEST_REPLY_HOST 0x2
1684 #define ARP_MULTIHOMING_MAX 8 /* Maximum local host IP addresses */
1686 /* Arp offload statistic counts */
1687 struct arp_ol_stats_t {
1688 uint32 host_ip_entries; /* Host IP table addresses (more than one if multihomed) */
1689 uint32 host_ip_overflow; /* Host IP table additions skipped due to overflow */
1691 uint32 arp_table_entries; /* ARP table entries */
1692 uint32 arp_table_overflow; /* ARP table additions skipped due to overflow */
1694 uint32 host_request; /* ARP requests from host */
1695 uint32 host_reply; /* ARP replies from host */
1696 uint32 host_service; /* ARP requests from host serviced by ARP Agent */
1698 uint32 peer_request; /* ARP requests received from network */
1699 uint32 peer_request_drop; /* ARP requests from network that were dropped */
1700 uint32 peer_reply; /* ARP replies received from network */
1701 uint32 peer_reply_drop; /* ARP replies from network that were dropped */
1702 uint32 peer_service; /* ARP request from host serviced by ARP Agent */
1705 /* Packet engine interface */
1706 #define WL_PKTENG_PER_TX_START 0x01
1707 #define WL_PKTENG_PER_TX_STOP 0x02
1708 #define WL_PKTENG_PER_RX_START 0x04
1709 #define WL_PKTENG_PER_RX_STOP 0x08
1710 #define WL_PKTENG_CONT_TX_START 0x10
1711 #define WL_PKTENG_CONT_TX_STOP 0x20
1713 typedef struct wl_pkteng {
1714 uint32 flags;
1715 uint32 delay; /* Inter packet delay */
1716 uint32 nframes; /* number of frames */
1717 uint32 length; /* packet length */
1718 bool seqno; /* enable/disable sequence no. */
1719 struct ether_addr dest; /* destination address */
1720 } wl_pkteng_t;
1722 #define WL_WOWL_MAGIC (1 << 0) /* Wakeup on Magic packet */
1723 #define WL_WOWL_NET (1 << 1) /* Wakeup on Netpattern */
1724 #define WL_WOWL_DIS (1 << 2) /* Wakeup on loss-of-link due to Disassoc/Deauth */
1725 #define WL_WOWL_RETR (1 << 3) /* Wakeup on retrograde TSF */
1726 #define WL_WOWL_BCN (1 << 4) /* Wakeup on loss of beacon */
1728 typedef struct {
1729 uint masksize; /* Size of the mask in #of bytes */
1730 uint offset; /* Offset to start looking for the packet in # of bytes */
1731 uint patternoffset; /* Offset of start of pattern in the structure */
1732 uint patternsize; /* Size of the pattern itself in #of bytes */
1733 /* Mask follows the structure above */
1734 /* Pattern follows the mask is at 'patternoffset' from the start */
1735 } wl_wowl_pattern_t;
1737 typedef struct {
1738 uint count;
1739 wl_wowl_pattern_t pattern[1];
1740 } wl_wowl_pattern_list_t;
1742 #if defined(DSLCPE_DELAY)
1743 #define WL_DELAYMODE_DEFER 0 /* defer by scheduler's choice, make this driver default */
1744 #define WL_DELAYMODE_FORCE 1 /* force, this is driver default */
1745 #define WL_DELAYMODE_AUTO 2 /* defer if no sta associated, force if sta associated */
1746 #endif
1748 #endif /* _wlioctl_h_ */