add a lot of "censored" parts for wlioctl.h (found in allnet tarball)
[openwrt.git] / package / openwrt / include / wlioctl.h
1 /*
2  * Custom OID/ioctl definitions for
3  * Broadcom 802.11abg Networking Device Driver
4  *
5  * Definitions subject to change without notice.
6  *
7  * Copyright 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.
14  *
15  * $Id$
16  */
17
18 #ifndef _wlioctl_h_
19 #define _wlioctl_h_
20
21 #include <typedefs.h>
22 #include <proto/ethernet.h>
23 #include <proto/802.11.h>
24
25 #if defined(__GNUC__)
26 #define PACKED  __attribute__((packed))
27 #else
28 #define PACKED
29 #endif
30
31 #define WL_NUMRATES             255     /* max # of rates in a rateset */
32
33 typedef struct wl_rateset {
34         uint32  count;                  /* # rates in this set */
35         uint8   rates[WL_NUMRATES];     /* rates in 500kbps units w/hi bit set if basic */
36 } wl_rateset_t;
37
38 #define WL_CHANSPEC_CHAN_MASK   0x0fff
39 #define WL_CHANSPEC_BAND_MASK   0xf000
40 #define WL_CHANSPEC_BAND_SHIFT  12
41 #define WL_CHANSPEC_BAND_A      0x1000
42 #define WL_CHANSPEC_BAND_B      0x2000
43
44 /*
45  * Per-bss information structure.
46  */
47
48 #define WL_LEGACY_BSS_INFO_VERSION      106     /* an older supported version of wl_bss_info struct */
49 #define WL_BSS_INFO_VERSION             107     /* current version of wl_bss_info struct */
50
51 typedef struct wl_bss_info106 {
52         uint            version;        /* version field */
53         struct ether_addr BSSID;
54         uint8           SSID_len;
55         uint8           SSID[32];
56         uint8           Privacy;        /* 0=No WEP, 1=Use WEP */
57         int16           RSSI;           /* receive signal strength (in dBm) */
58         uint16          beacon_period;  /* units are Kusec */
59         uint16          atim_window;    /* units are Kusec */
60         uint8           channel;        /* Channel no. */
61         int8            infra;          /* 0=IBSS, 1=infrastructure, 2=unknown */
62         struct {
63                 uint    count;          /* # rates in this set */
64                 uint8   rates[12];      /* rates in 500kbps units w/hi bit set if basic */
65         } rateset;                      /* supported rates */
66         uint8           dtim_period;    /* DTIM period */
67         int8            phy_noise;      /* noise right after tx (in dBm) */
68         uint16          capability;     /* Capability information */
69         struct dot11_bcn_prb *prb;      /* probe response frame (ioctl na) */
70         uint16          prb_len;        /* probe response frame length (ioctl na) */
71         struct {
72                 uint8 supported;        /* wpa supported */
73                 uint8 multicast;        /* multicast cipher */
74                 uint8 ucount;           /* count of unicast ciphers */
75                 uint8 unicast[4];       /* unicast ciphers */
76                 uint8 acount;           /* count of auth modes */
77                 uint8 auth[4];          /* Authentication modes */
78         } wpa;
79 } wl_bss_info106_t;
80
81 typedef struct wl_bss_info {
82         uint32          version;        /* version field */
83         uint32          length;         /* byte length of data in this record, starting at version and including IEs */
84         struct ether_addr BSSID;
85         uint16          beacon_period;  /* units are Kusec */
86         uint16          capability;     /* Capability information */
87         uint8           SSID_len;
88         uint8           SSID[32];
89         struct {
90                 uint    count;          /* # rates in this set */
91                 uint8   rates[16];      /* rates in 500kbps units w/hi bit set if basic */
92         } rateset;                      /* supported rates */
93         uint8           channel;        /* Channel no. */
94         uint16          atim_window;    /* units are Kusec */
95         uint8           dtim_period;    /* DTIM period */
96         int16           RSSI;           /* receive signal strength (in dBm) */
97         int8            phy_noise;      /* noise (in dBm) */
98         uint32          ie_length;      /* byte length of Information Elements */
99         /* variable length Information Elements */
100 } wl_bss_info_t;
101
102 typedef struct wlc_ssid {
103         uint32          SSID_len;
104         uchar           SSID[32];
105 } wlc_ssid_t;
106
107 typedef struct wl_scan_params {
108         wlc_ssid_t ssid;        /* default is {0, ""} */
109         struct ether_addr bssid;/* default is bcast */
110         int8 bss_type;          /* default is any, DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT */
111         int8 scan_type;         /* -1 use default, DOT11_SCANTYPE_ACTIVE/PASSIVE */
112         int32 nprobes;          /* -1 use default, number of probes per channel */
113         int32 active_time;      /* -1 use default, dwell time per channel for active scanning */
114         int32 passive_time;     /* -1 use default, dwell time per channel for passive scanning */
115         int32 home_time;        /* -1 use default, dwell time for the home channel between channel scans */
116         int32 channel_num;      /* 0 use default (all available channels), count of channels in channel_list */
117         uint16 channel_list[1]; /* list of chanspecs */
118 } wl_scan_params_t;
119 /* size of wl_scan_params not including variable length array */
120 #define WL_SCAN_PARAMS_FIXED_SIZE 64
121
122 typedef struct wl_scan_results {
123         uint32 buflen;
124         uint32 version;
125         uint32 count;
126         wl_bss_info_t bss_info[1];
127 } wl_scan_results_t;
128 /* size of wl_scan_results not including variable length array */
129 #define WL_SCAN_RESULTS_FIXED_SIZE 12
130
131 /* uint32 list */
132 typedef struct wl_uint32_list {
133         /* in - # of elements, out - # of entries */
134         uint32 count;
135         /* variable length uint32 list */
136         uint32 element[1];
137 } wl_uint32_list_t;
138
139 #define WLC_CNTRY_BUF_SZ        4       /* Country string is 3 bytes + NULL */
140
141 typedef struct wl_channels_in_country {
142         uint32 buflen;
143         uint32 band;
144         char country_abbrev[WLC_CNTRY_BUF_SZ];
145         uint32 count;
146         uint32 channel[1];
147 } wl_channels_in_country_t;
148
149 typedef struct wl_country_list {
150         uint32 buflen;
151         uint32 band_set;
152         uint32 band;
153         uint32 count;
154         char country_abbrev[1];
155 } wl_country_list_t;
156
157 #define WL_RM_TYPE_BASIC        1
158 #define WL_RM_TYPE_CCA          2
159 #define WL_RM_TYPE_RPI          3
160
161 #define WL_RM_FLAG_PARALLEL     (1<<0)
162
163 #define WL_RM_FLAG_LATE         (1<<1)
164 #define WL_RM_FLAG_INCAPABLE    (1<<2)
165 #define WL_RM_FLAG_REFUSED      (1<<3)
166
167 typedef struct wl_rm_req_elt {
168         int8    type;
169         int8    flags;
170         uint16  chanspec;
171         uint32  token;          /* token for this measurement */
172         uint32  tsf_h;          /* TSF high 32-bits of Measurement start time */
173         uint32  tsf_l;          /* TSF low 32-bits */
174         uint32  dur;            /* TUs */
175 } wl_rm_req_elt_t;
176
177 typedef struct wl_rm_req {
178         uint32  token;          /* overall measurement set token */
179         uint32  count;          /* number of measurement reqests */
180         wl_rm_req_elt_t req[1]; /* variable length block of requests */
181 } wl_rm_req_t;
182 #define WL_RM_REQ_FIXED_LEN     8
183
184 typedef struct wl_rm_rep_elt {
185         int8    type;
186         int8    flags;
187         uint16  chanspec;
188         uint32  token;          /* token for this measurement */
189         uint32  tsf_h;          /* TSF high 32-bits of Measurement start time */
190         uint32  tsf_l;          /* TSF low 32-bits */
191         uint32  dur;            /* TUs */
192         uint32  len;            /* byte length of data block */
193         uint8   data[1];        /* variable length data block */
194 } wl_rm_rep_elt_t;
195 #define WL_RM_REP_ELT_FIXED_LEN 24      /* length excluding data block */
196
197 #define WL_RPI_REP_BIN_NUM 8
198 typedef struct wl_rm_rpi_rep {
199         uint8   rpi[WL_RPI_REP_BIN_NUM];
200         int8    rpi_max[WL_RPI_REP_BIN_NUM];
201 } wl_rm_rpi_rep_t;
202
203 typedef struct wl_rm_rep {
204         uint32  token;          /* overall measurement set token */
205         uint32  len;            /* length of measurement report block */
206         wl_rm_rep_elt_t rep[1]; /* variable length block of reports */
207 } wl_rm_rep_t;
208 #define WL_RM_REP_FIXED_LEN     8
209
210
211 #define WLC_MAX_KEY_SIZE        32      /* max size of any key */
212 #define WLC_MAX_IV_SIZE         16      /* max size of any IV */
213 #define WLC_EXT_IV_FLAG         (1<<5)  /* flag to indicate IV is > 4 bytes */
214 #define WLC_MAX_DEFAULT_KEYS    4       /* # of default WEP keys */
215 #define WLC_MAX_KEYS            16      /* # of WEP keys */
216 #define WLC_WEP1_KEY_SIZE       5       /* max size of any WEP key */
217 #define WLC_WEP1_KEY_HEX_SIZE   10      /* size of WEP key in hex. */
218 #define WLC_WEP128_KEY_SIZE     13      /* max size of any WEP key */
219 #define WLC_WEP128_KEY_HEX_SIZE 26      /* size of WEP key in hex. */
220 #define WLC_TKIP_MIC_SIZE       8       /* size of TKIP MIC */
221 #define WLC_TKIP_EOM_SIZE       7       /* max size of TKIP EOM */
222 #define WLC_TKIP_EOM_FLAG       0x5a    /* TKIP EOM flag byte */
223 #define WLC_TKIP_KEY_SIZE       32      /* size of any TKIP key */
224 #define WLC_TKIP_MIC_AUTH_TX    16      /* offset to Authenticator MIC TX key */
225 #define WLC_TKIP_MIC_AUTH_RX    24      /* offset to Authenticator MIC RX key */
226 #define WLC_TKIP_MIC_SUP_RX     16      /* offset to Supplicant MIC RX key */
227 #define WLC_TKIP_MIC_SUP_TX     24      /* offset to Supplicant MIC TX key */
228 #define WLC_TKIP_P1_KEY_SIZE    10      /* size of TKHash Phase1 output, in bytes */
229 #define WLC_TKIP_P2_KEY_SIZE    16      /* size of TKHash Phase2 output */
230 #define WLC_AES_KEY_SIZE        16      /* size of AES key */
231
232
233 typedef enum sup_auth_status {
234         WLC_SUP_DISCONNECTED = 0,
235         WLC_SUP_CONNECTING,
236         WLC_SUP_IDREQUIRED,
237         WLC_SUP_AUTHENTICATING,
238         WLC_SUP_AUTHENTICATED,
239         WLC_SUP_KEYXCHANGE,
240         WLC_SUP_KEYED
241 } sup_auth_status_t;
242
243 /* Enumerate crypto algorithms */
244 #define CRYPTO_ALGO_OFF                 0
245 #define CRYPTO_ALGO_WEP1                1
246 #define CRYPTO_ALGO_TKIP                2
247 #define CRYPTO_ALGO_WEP128              3
248 #define CRYPTO_ALGO_AES_CCM             4
249 #define CRYPTO_ALGO_AES_OCB_MSDU        5
250 #define CRYPTO_ALGO_AES_OCB_MPDU        6
251 #define CRYPTO_ALGO_NALG                7
252
253 #define WSEC_GEN_MIC_ERROR      0x0001
254 #define WSEC_GEN_REPLAY         0x0002
255
256 #define WL_SOFT_KEY     (1 << 0)        /* Indicates this key is using soft encrypt */
257 #define WL_PRIMARY_KEY  (1 << 1)        /* Indicates this key is the primary (ie tx) key */
258 #define WL_KF_RES_4     (1 << 4)        /* Reserved for backward compat */
259 #define WL_KF_RES_5     (1 << 5)        /* Reserved for backward compat */
260
261
262 typedef struct wlc_tkip_info {
263         uint16          phase1[WLC_TKIP_P1_KEY_SIZE/sizeof(uint16)];    /* tkhash phase1 result */
264         uint8           phase2[WLC_TKIP_P2_KEY_SIZE];   /* tkhash phase2 result */
265         uint32          micl;
266         uint32          micr;
267 } tkip_info_t;
268
269 typedef struct _wsec_iv {
270         uint32          hi;     /* upper 32 bits of IV */
271         uint16          lo;     /* lower 16 bits of IV */
272 } wsec_iv_t;
273
274 typedef struct wsec_key {
275         uint32          index;          /* key index */
276         uint32          len;            /* key length */
277         uint8           data[WLC_MAX_KEY_SIZE]; /* key data */
278         tkip_info_t     tkip_tx;        /* tkip transmit state */
279         tkip_info_t     tkip_rx;        /* tkip receive state */
280         uint32          algo;           /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
281         uint32          flags;          /* misc flags */
282         uint32          algo_hw;        /* cache for hw register*/
283         uint32          aes_mode;       /* cache for hw register*/
284         int             iv_len;         /* IV length */         
285         int             iv_initialized; /* has IV been initialized already? */          
286         int             icv_len;        /* ICV length */
287         wsec_iv_t       rxiv;           /* Rx IV */
288         wsec_iv_t       txiv;           /* Tx IV */
289         struct ether_addr ea;           /* per station */
290 } wsec_key_t;
291
292
293
294 typedef struct wl_wsec_key {
295         uint32          index;          /* key index */
296         uint32          len;            /* key length */
297         uint8           data[DOT11_MAX_KEY_SIZE];       /* key data */
298         uint32          pad_1[18];
299         uint32          algo;           /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
300         uint32          flags;          /* misc flags */
301         uint32          pad_2[2];
302         int             pad_3;
303         int             iv_initialized; /* has IV been initialized already? */          
304         int             pad_4;
305         /* Rx IV */
306         struct {
307                 uint32  hi;             /* upper 32 bits of IV */
308                 uint16  lo;             /* lower 16 bits of IV */
309         } rxiv;
310         uint32          pad_5[2];
311         struct ether_addr ea;           /* per station */
312 } wl_wsec_key_t;
313
314 /* For use with wlc_wep_key.flags */
315 #define WSEC_PRIMARY_KEY        (1 << 1)        /* Indicates this key is the primary (ie tx) key */
316 #define WSEC_TKIP_ERROR         (1 << 2)        /* Provoke deliberate error */
317
318 #define WSEC_MIN_PSK_LEN        8
319 #define WSEC_MAX_PSK_LEN        64
320
321 /* Flag for key material needing passhash'ing */
322 #define WSEC_PASSPHRASE         (1<<0)
323
324 /* recepticle for WLC_SET_WSEC_PMK parameter */
325 typedef struct {
326         ushort  key_len;                /* octets in key material */
327         ushort  flags;                  /* key handling qualification */
328         uint8   key[WSEC_MAX_PSK_LEN];  /* PMK material */
329 } wsec_pmk_t;
330
331 /* wireless security bitvec */
332 #define WEP_ENABLED             1
333 #define TKIP_ENABLED            2
334 #define AES_ENABLED             4
335 #define WSEC_SWFLAG             8
336
337 #define WSEC_SW(wsec)           ((wsec) & WSEC_SWFLAG)
338 #define WSEC_HW(wsec)           (!WSEC_SW(wsec))
339 #define WSEC_WEP_ENABLED(wsec)  ((wsec) & WEP_ENABLED)
340 #define WSEC_TKIP_ENABLED(wsec) ((wsec) & TKIP_ENABLED)
341 #define WSEC_AES_ENABLED(wsec)  ((wsec) & AES_ENABLED)
342 #define WSEC_ENABLED(wsec)      ((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED))
343
344
345 /* wireless authentication bit vector */
346 #define WPA_ENABLED     1
347 #define PSK_ENABLED     2
348
349 #define WAUTH_WPA_ENABLED(wauth)        ((wauth) & WPA_ENABLED)
350 #define WAUTH_PSK_ENABLED(wauth)        ((wauth) & PSK_ENABLED)
351 #define WAUTH_ENABLED(wauth)            ((wauth) & (WPA_ENABLED | PSK_ENABLED))
352
353 /* group/mcast cipher */
354 #define WPA_MCAST_CIPHER(wsec)  (((wsec) & TKIP_ENABLED) ? WPA_CIPHER_TKIP : \
355                                 ((wsec) & AES_ENABLED) ? WPA_CIPHER_AES_CCM : \
356                                 WPA_CIPHER_NONE)
357
358
359 typedef struct wl_led_info {
360         uint32          index;          /* led index */
361         uint32          behavior;
362         bool            activehi;
363 } wl_led_info_t;
364
365 /*
366  * definitions for driver messages passed from WL to NAS.
367  */
368 /* Use this to recognize wpa and 802.1x driver messages. */
369 static const uint8 wl_wpa_snap_template[] =
370         { 0xaa, 0xaa, 0x03, 0x00, 0x90, 0x4c };
371
372 #define WL_WPA_MSG_IFNAME_MAX   16
373
374 /* WPA driver message */
375 typedef struct wl_wpa_header {
376         struct ether_header eth;
377         struct dot11_llc_snap_header snap;
378         uint8 version;
379         uint8 type;
380         /* version 2 additions */
381         char ifname[WL_WPA_MSG_IFNAME_MAX];
382         /* version specific data */
383         /* uint8 data[1]; */
384 } wl_wpa_header_t PACKED;
385
386 /*
387  * definitions for 802.2 messages passed from WL to NAS.
388  */
389 /* This seems not to be defined outside the kernel on linux. */
390 #ifndef ETH_P_802_2
391 #define ETH_P_802_2             4
392 #endif
393
394 #define WL_WPA_HEADER_LEN       (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN + 2 + WL_WPA_MSG_IFNAME_MAX)
395
396 /* WPA driver message ethertype - private between wlc and nas */
397 #define WL_WPA_ETHER_TYPE       0x9999
398
399 /* WPA driver message current version */
400 #define WL_WPA_MSG_VERSION      2
401
402 /* Type field values for the 802.2 driver messages for WPA. */
403 #define WLC_ASSOC_MSG           1
404 #define WLC_DISASSOC_MSG        2
405 #define WLC_PTK_MIC_MSG         3
406 #define WLC_GTK_MIC_MSG         4
407
408 /* Use this to recognize 802.2 driver messages. */
409 static const uint8 wpa_snap_template[] =
410         { 0xaa, 0xaa, 0x03, 0x00, 0x90, 0x4c };
411
412
413 /* 802.1x driver message */
414 typedef struct wl_eapol_header {
415         struct ether_header eth;
416         struct dot11_llc_snap_header snap;
417         uint8 version;
418         uint8 reserved;
419         char ifname[WL_WPA_MSG_IFNAME_MAX];
420         /* version specific data */
421         /* uint8 802_1x_msg[1]; */
422 } wl_eapol_header_t PACKED;
423
424 #define WL_EAPOL_HEADER_LEN     (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN + 2 + WL_WPA_MSG_IFNAME_MAX)
425
426 /* 802.1x driver message ethertype - private between wlc and nas */
427 #define WL_EAPOL_ETHER_TYPE     0x999A
428
429 /* 802.1x driver message current version */
430 #define WL_EAPOL_MSG_VERSION    1
431
432 /* srom read/write struct passed through ioctl */
433 typedef struct {
434         uint   byteoff;         /* byte offset */
435         uint   nbytes;          /* number of bytes */
436         uint16 buf[1];
437 } srom_rw_t;
438
439 /* R_REG and W_REG struct passed through ioctl */
440 typedef struct {
441         uint32  byteoff;        /* byte offset of the field in d11regs_t */
442         uint32  val;            /* read/write value of the field */
443         uint32  size;           /* sizeof the field */
444 } rw_reg_t;
445
446 /* Structure used by GET/SET_ATTEN ioctls */
447 typedef struct {
448         uint16  auto_ctrl;      /* 1: Automatic control, 0: overriden */
449         uint16  bb;             /* Baseband attenuation */
450         uint16  radio;          /* Radio attenuation */
451         uint16  txctl1;         /* Radio TX_CTL1 value */
452 } atten_t;
453
454 /* Used to get specific STA parameters */ 
455 typedef struct {
456         uint32  val;
457         struct ether_addr ea;
458 } scb_val_t;
459
460 /* Event data type */
461 typedef struct {
462         uint msg;                       /* Message (see below) */
463         struct ether_addr *addr;        /* Station address (if applicable) */
464         uint status;                    /* Status code (see below) */
465         uint reason;                    /* Reason code (if applicable) */
466         uint auth_type;                 /* WLC_E_AUTH */
467         bool link;                      /* WLC_E_LINK */
468         bool group;                     /* WLC_E_MIC_ERROR */
469         bool flush_txq;                 /* WLC_E_MIC_ERROR */
470 } wlc_event_t;
471
472 typedef struct {
473         uint16          ver;    /* version of this struct */
474         uint16          cap;    /* sta's advertized capabilities */
475         uint32          flags;  /* flags defined below */
476         uint32          idle;   /* time since data pkt rx'd from sta */
477         struct ether_addr       ea;     /* Station address */
478         wl_rateset_t    rateset;        /* rateset in use */
479 } sta_info_t;
480
481 #define WL_STA_INFO_LEN 300
482 #define WL_STA_VER      1
483
484 /* flags fields */
485 #define WL_STA_BRCM     0x01
486 #define WL_STA_WME      0x02
487 #define WL_STA_ABCAP    0x04
488 #define WL_STA_AUTHE    0x08 
489 #define WL_STA_ASSOC    0x10 
490 #define WL_STA_AUTHO    0x20 
491
492 /* Event messages */
493 #define WLC_E_SET_SSID          1
494 #define WLC_E_JOIN              2
495 #define WLC_E_START             3
496 #define WLC_E_AUTH              4
497 #define WLC_E_AUTH_IND          5
498 #define WLC_E_DEAUTH            6
499 #define WLC_E_DEAUTH_IND        7
500 #define WLC_E_ASSOC             8
501 #define WLC_E_ASSOC_IND         9
502 #define WLC_E_REASSOC           10
503 #define WLC_E_REASSOC_IND       11
504 #define WLC_E_DISASSOC          12
505 #define WLC_E_DISASSOC_IND      13
506 #define WLC_E_QUIET_START       14      /* 802.11h Quiet period started */
507 #define WLC_E_QUIET_END         15      /* 802.11h Quiet period ended */
508 #define WLC_E_GOT_BEACONS       16      
509 #define WLC_E_LINK              17      /* Link indication */
510 #define WLC_E_MIC_ERROR         18      /* TKIP MIC error occurred */
511 #define WLC_E_NDIS_LINK         19      /* NDIS style link indication */
512 #define WLC_E_ROAM              20
513 #define WLC_E_LAST              21
514
515 /* Event status codes */
516 #define WLC_E_STATUS_SUCCESS            0
517 #define WLC_E_STATUS_FAIL               1
518 #define WLC_E_STATUS_TIMEOUT            2
519 #define WLC_E_STATUS_NO_NETWORKS        3
520 #define WLC_E_STATUS_ABORT              4
521
522 typedef struct wlc_event_cb {
523         uint msg;                               /* Event message or 0 for all */
524         void (*fn)(void *, wlc_event_t *);      /* Callback function */
525         void *context;                          /* Passed to callback function */
526         struct wlc_event_cb *next;              /* Next in the chain */
527 } wlc_event_cb_t;
528
529 /*
530  * Country locale determines which channels are available to us.
531  */
532 typedef enum _wlc_locale {
533         WLC_WW = 0,     /* Worldwide */
534         WLC_THA,        /* Thailand */
535         WLC_ISR,        /* Israel */
536         WLC_JDN,        /* Jordan */
537         WLC_PRC,        /* China */
538         WLC_JPN,        /* Japan */
539         WLC_FCC,        /* USA */
540         WLC_EUR,        /* Europe */
541         WLC_USL,        /* US Low Band only */
542         WLC_JPH,        /* Japan High Band only */
543         WLC_ALL,        /* All the channels in this band */
544         WLC_11D,        /* Represents locale recieved by 11d beacons */
545         WLC_LAST_LOCALE,
546         WLC_UNDEFINED_LOCALE = 0xf
547 } wlc_locale_t;
548
549 /* channel encoding */
550 typedef struct channel_info {
551         int hw_channel;
552         int target_channel;
553         int scan_channel;
554 } channel_info_t;
555
556 /* For ioctls that take a list of MAC addresses */
557 struct maclist {
558         uint count;                     /* number of MAC addresses */
559         struct ether_addr ea[1];        /* variable length array of MAC addresses */
560 };
561
562 /* get pkt count struct passed through ioctl */
563 typedef struct get_pktcnt {
564         uint rx_good_pkt;
565         uint rx_bad_pkt;
566         uint tx_good_pkt;
567         uint tx_bad_pkt;
568 } get_pktcnt_t;
569
570 /* Linux network driver ioctl encoding */
571 typedef struct wl_ioctl {
572         uint cmd;       /* common ioctl definition */
573         void *buf;      /* pointer to user buffer */
574         uint len;       /* length of user buffer */
575         bool set;       /* get or set request (optional) */
576         uint used;      /* bytes read or written (optional) */
577         uint needed;    /* bytes needed (optional) */
578 } wl_ioctl_t;
579
580 /* 
581  * Structure for passing hardware and software 
582  * revision info up from the driver. 
583  */
584 typedef struct wlc_rev_info {
585         uint            vendorid;       /* PCI vendor id */
586         uint            deviceid;       /* device id of chip */
587         uint            radiorev;       /* radio revision */
588         uint            chiprev;        /* chip revision */
589         uint            corerev;        /* core revision */
590         uint            boardid;        /* board identifier (usu. PCI sub-device id) */
591         uint            boardvendor;    /* board vendor (usu. PCI sub-vendor id) */
592         uint            boardrev;       /* board revision */
593         uint            driverrev;      /* driver version */
594         uint            ucoderev;       /* microcode version */
595         uint            bus;            /* bus type */
596         uint        chipnum;    /* chip number */
597 } wlc_rev_info_t;
598
599 /* check this magic number */
600 #define WLC_IOCTL_MAGIC         0x14e46c77
601
602 /* bump this number if you change the ioctl interface */
603 #define WLC_IOCTL_VERSION       1
604
605 /* maximum length buffer required */
606 #define WLC_IOCTL_MAXLEN        8192
607
608 /* common ioctl definitions */
609 #define WLC_GET_MAGIC                           0
610 #define WLC_GET_VERSION                         1
611 #define WLC_UP                                  2
612 #define WLC_DOWN                                3
613 #define WLC_GET_LOOP                            4
614 #define WLC_SET_LOOP                            5
615 #define WLC_DUMP                                6
616 #define WLC_GET_MSGLEVEL                        7
617 #define WLC_SET_MSGLEVEL                        8
618 #define WLC_GET_PROMISC                         9
619 #define WLC_SET_PROMISC                         10
620 #define WLC_OBSOLETE                            11 
621 #define WLC_GET_RATE                            12
622 #define WLC_SET_RATE                            13
623 #define WLC_GET_INSTANCE                        14
624 #define WLC_GET_FRAG                            15
625 #define WLC_SET_FRAG                            16
626 #define WLC_GET_RTS                             17
627 #define WLC_SET_RTS                             18
628 #define WLC_GET_INFRA                           19
629 #define WLC_SET_INFRA                           20
630 #define WLC_GET_AUTH                            21
631 #define WLC_SET_AUTH                            22
632 #define WLC_GET_BSSID                           23
633 #define WLC_SET_BSSID                           24
634 #define WLC_GET_SSID                            25
635 #define WLC_SET_SSID                            26
636 #define WLC_RESTART                             27
637 #define WLC_DUMP_SCB                            28 
638 #define WLC_GET_CHANNEL                         29
639 #define WLC_SET_CHANNEL                         30
640 #define WLC_GET_SRL                             31
641 #define WLC_SET_SRL                             32
642 #define WLC_GET_LRL                             33
643 #define WLC_SET_LRL                             34
644 #define WLC_GET_PLCPHDR                         35
645 #define WLC_SET_PLCPHDR                         36
646 #define WLC_GET_RADIO                           37
647 #define WLC_SET_RADIO                           38
648 #define WLC_GET_PHYTYPE                         39
649 #define WLC_DUMP_RATE                           40
650 #define WLC_SET_RATE_PARAMS                     41
651 #define WLC_GET_WEP                             42
652 #define WLC_SET_WEP                             43
653 #define WLC_GET_KEY                             44
654 #define WLC_SET_KEY                             45
655 #define WLC_GET_REGULATORY                      46
656 #define WLC_SET_REGULATORY                      47
657 #define WLC_GET_PASSIVE                         48      /* added by nbd */
658 #define WLC_SET_PASSIVE                         49      /* added by nbd */
659 #define WLC_SCAN                                50
660 #define WLC_SCAN_RESULTS                        51
661 #define WLC_DISASSOC                            52
662 #define WLC_REASSOC                             53
663 #define WLC_GET_ROAM_TRIGGER                    54
664 #define WLC_SET_ROAM_TRIGGER                    55
665 #define WLC_GET_ROAM_DELTA                      56
666 #define WLC_SET_ROAM_DELTA                      57
667 #define WLC_GET_ROAM_SCAN_PERIOD                58
668 #define WLC_SET_ROAM_SCAN_PERIOD                59
669 #define WLC_EVM                                 60
670 #define WLC_GET_TXANT                           61
671 #define WLC_SET_TXANT                           62
672 #define WLC_GET_ANTDIV                          63
673 #define WLC_SET_ANTDIV                          64
674 #define WLC_GET_TXPWR                           65
675 #define WLC_SET_TXPWR                           66
676 #define WLC_GET_CLOSED                          67
677 #define WLC_SET_CLOSED                          68
678 #define WLC_GET_MACLIST                         69
679 #define WLC_SET_MACLIST                         70
680 #define WLC_GET_RATESET                         71
681 #define WLC_SET_RATESET                         72
682 #define WLC_GET_LOCALE                          73
683 #define WLC_SET_LOCALE                          74
684 #define WLC_GET_BCNPRD                          75
685 #define WLC_SET_BCNPRD                          76
686 #define WLC_GET_DTIMPRD                         77
687 #define WLC_SET_DTIMPRD                         78
688 #define WLC_GET_SROM                            79
689 #define WLC_SET_SROM                            80
690 #define WLC_GET_WEP_RESTRICT                    81
691 #define WLC_SET_WEP_RESTRICT                    82
692 #define WLC_GET_COUNTRY                         83
693 #define WLC_SET_COUNTRY                         84
694 #define WLC_GET_PM                              85
695 #define WLC_SET_PM                              86
696 #define WLC_GET_WAKE                            87
697 #define WLC_SET_WAKE                            88
698 #define WLC_GET_D11CNTS                         89
699 #define WLC_GET_FORCELINK                       90      /* ndis only */
700 #define WLC_SET_FORCELINK                       91      /* ndis only */
701 #define WLC_FREQ_ACCURACY                       92
702 #define WLC_CARRIER_SUPPRESS                    93
703 #define WLC_GET_PHYREG                          94
704 #define WLC_SET_PHYREG                          95
705 #define WLC_GET_RADIOREG                        96
706 #define WLC_SET_RADIOREG                        97
707 #define WLC_GET_REVINFO                         98
708 #define WLC_GET_UCANTDIV                        99
709 #define WLC_SET_UCANTDIV                        100
710 #define WLC_R_REG                               101
711 #define WLC_W_REG                               102
712 #define WLC_DIAG_LOOPBACK                       103
713 #define WLC_RESET_D11CNTS                       104
714 #define WLC_GET_MACMODE                         105
715 #define WLC_SET_MACMODE                         106
716 #define WLC_GET_MONITOR                         107     /* added by nbd */
717 #define WLC_SET_MONITOR                         108     /* added by nbd */
718 #define WLC_GET_GMODE                           109
719 #define WLC_SET_GMODE                           110
720 #define WLC_GET_LEGACY_ERP                      111
721 #define WLC_SET_LEGACY_ERP                      112
722 #define WLC_GET_RX_ANT                          113
723 #define WLC_GET_CURR_RATESET                    114     /* current rateset */
724 #define WLC_GET_SCANSUPPRESS                    115
725 #define WLC_SET_SCANSUPPRESS                    116
726 #define WLC_GET_AP                              117
727 #define WLC_SET_AP                              118
728 #define WLC_GET_EAP_RESTRICT                    119
729 #define WLC_SET_EAP_RESTRICT                    120
730 #define WLC_SCB_AUTHORIZE                       121
731 #define WLC_SCB_DEAUTHORIZE                     122
732 #define WLC_GET_WDSLIST                         123
733 #define WLC_SET_WDSLIST                         124
734 #define WLC_GET_ATIM                            125
735 #define WLC_SET_ATIM                            126
736 #define WLC_GET_RSSI                            127
737 #define WLC_GET_PHYANTDIV                       128
738 #define WLC_SET_PHYANTDIV                       129
739 #define WLC_AP_RX_ONLY                          130
740 #define WLC_GET_TX_PATH_PWR                     131
741 #define WLC_SET_TX_PATH_PWR                     132
742 #define WLC_GET_WSEC                            133
743 #define WLC_SET_WSEC                            134
744 #define WLC_GET_PHY_NOISE                       135
745 #define WLC_GET_BSS_INFO                        136
746 #define WLC_GET_PKTCNTS                         137
747 #define WLC_GET_LAZYWDS                         138
748 #define WLC_SET_LAZYWDS                         139
749 #define WLC_GET_BANDLIST                        140
750 #define WLC_GET_BAND                            141
751 #define WLC_SET_BAND                            142
752 #define WLC_SCB_DEAUTHENTICATE                  143
753 #define WLC_GET_SHORTSLOT                       144
754 #define WLC_GET_SHORTSLOT_OVERRIDE              145
755 #define WLC_SET_SHORTSLOT_OVERRIDE              146
756 #define WLC_GET_SHORTSLOT_RESTRICT              147
757 #define WLC_SET_SHORTSLOT_RESTRICT              148
758 #define WLC_GET_GMODE_PROTECTION                149
759 #define WLC_GET_GMODE_PROTECTION_OVERRIDE       150
760 #define WLC_SET_GMODE_PROTECTION_OVERRIDE       151
761 #define WLC_UPGRADE                             152
762 #define WLC_GET_MRATE                           153
763 #define WLC_SET_MRATE                           154
764 #define WLC_GET_IGNORE_BCNS                     155
765 #define WLC_SET_IGNORE_BCNS                     156
766 #define WLC_GET_SCB_TIMEOUT                     157
767 #define WLC_SET_SCB_TIMEOUT                     158
768 #define WLC_GET_ASSOCLIST                       159
769 #define WLC_GET_CLK                             160
770 #define WLC_SET_CLK                             161
771 #define WLC_GET_UP                              162
772 #define WLC_OUT                                 163
773 #define WLC_GET_WPA_AUTH                        164
774 #define WLC_SET_WPA_AUTH                        165
775 #define WLC_GET_UCFLAGS                         166
776 #define WLC_SET_UCFLAGS                         167
777 #define WLC_GET_PWRIDX                          168
778 #define WLC_SET_PWRIDX                          169
779 #define WLC_GET_TSSI                            170
780 #define WLC_GET_SUP_RATESET_OVERRIDE            171
781 #define WLC_SET_SUP_RATESET_OVERRIDE            172
782 #define WLC_SET_FAST_TIMER                      173
783 #define WLC_GET_FAST_TIMER                      174
784 #define WLC_SET_SLOW_TIMER                      175
785 #define WLC_GET_SLOW_TIMER                      176
786 #define WLC_DUMP_PHYREGS                        177
787 #define WLC_GET_GMODE_PROTECTION_CONTROL        178
788 #define WLC_SET_GMODE_PROTECTION_CONTROL        179
789 #define WLC_GET_PHYLIST                         180
790 #define WLC_ENCRYPT_STRENGTH                    181     /* ndis only */
791 #define WLC_DECRYPT_STATUS                      182     /* ndis only */
792 #define WLC_GET_KEY_SEQ                         183
793 #define WLC_GET_SCAN_CHANNEL_TIME               184
794 #define WLC_SET_SCAN_CHANNEL_TIME               185
795 #define WLC_GET_SCAN_UNASSOC_TIME               186
796 #define WLC_SET_SCAN_UNASSOC_TIME               187
797 #define WLC_GET_SCAN_HOME_TIME                  188
798 #define WLC_SET_SCAN_HOME_TIME                  189
799 #define WLC_GET_SCAN_PASSES                     190
800 #define WLC_SET_SCAN_PASSES                     191
801 #define WLC_GET_PRB_RESP_TIMEOUT                192
802 #define WLC_SET_PRB_RESP_TIMEOUT                193
803 #define WLC_GET_ATTEN                           194
804 #define WLC_SET_ATTEN                           195
805 #define WLC_GET_SHMEM                           196     /* diag */
806 #define WLC_SET_SHMEM                           197     /* diag */
807 #define WLC_GET_GMODE_PROTECTION_CTS            198
808 #define WLC_SET_GMODE_PROTECTION_CTS            199
809 #define WLC_SET_TKIP_MIC_FLAG                   200
810 #define WLC_SCB_DEAUTHENTICATE_FOR_REASON       201
811 #define WLC_TKIP_COUNTERMEASURES                202
812 #define WLC_GET_PIOMODE                         203
813 #define WLC_SET_PIOMODE                         204
814 #define WLC_SET_LED                             209
815 #define WLC_GET_LED                             210
816 #define WLC_GET_INTERFERENCE_MODE               211
817 #define WLC_SET_INTERFERENCE_MODE               212
818 #define WLC_GET_CHANNEL_QA                      213
819 #define WLC_START_CHANNEL_QA                    214
820 #define WLC_GET_CHANNEL_SEL                     215
821 #define WLC_START_CHANNEL_SEL                   216
822 #define WLC_GET_VALID_CHANNELS                  217
823 #define WLC_GET_FAKEFRAG                        218
824 #define WLC_SET_FAKEFRAG                        219
825 #define WLC_GET_PWROUT_PERCENTAGE               220
826 #define WLC_SET_PWROUT_PERCENTAGE               221
827 #define WLC_SET_BAD_FRAME_PREEMPT               222
828 #define WLC_GET_BAD_FRAME_PREEMPT               223
829 #define WLC_SET_LEAP_LIST                       224
830 #define WLC_GET_LEAP_LIST                       225
831 #define WLC_GET_CWMIN                           226
832 #define WLC_SET_CWMIN                           227
833 #define WLC_GET_CWMAX                           228
834 #define WLC_SET_CWMAX                           229
835 #define WLC_GET_WET                             230
836 #define WLC_SET_WET                             231
837 #define WLC_GET_KEY_PRIMARY                     235
838 #define WLC_SET_KEY_PRIMARY                     236
839 #define WLC_WDS_GET_REMOTE_HWADDR               246     /* currently handled in wl_linux.c/wl_vx.c */
840 #define WLC_SET_CS_SCAN_TIMER                   248
841 #define WLC_GET_CS_SCAN_TIMER                   249
842 #define WLC_CURRENT_PWR                         256
843 #define WLC_GET_CHANNELS_IN_COUNTRY             260
844 #define WLC_GET_COUNTRY_LIST                    261
845 #define WLC_GET_VAR                             262     /* get value of named variable */
846 #define WLC_SET_VAR                             263     /* set named variable to value */
847 #define WLC_NVRAM_GET                           264
848 #define WLC_NVRAM_SET                           265
849 #define WLC_SET_WSEC_PMK                        268
850 #define WLC_GET_AUTH_MODE                       269
851 #define WLC_SET_AUTH_MODE                       270
852 #define WLC_LAST                                273     /* do not change - use get_var/set_var */
853
854 /*
855  * Minor kludge alert:
856  * Duplicate a few definitions that irelay requires from epiioctl.h here
857  * so caller doesn't have to include this file and epiioctl.h .
858  * If this grows any more, it would be time to move these irelay-specific
859  * definitions out of the epiioctl.h and into a separate driver common file.
860  */
861 #ifndef EPICTRL_COOKIE
862 #define EPICTRL_COOKIE          0xABADCEDE
863 #endif
864
865 /* vx wlc ioctl's offset */
866 #define CMN_IOCTL_OFF 0x180
867
868 /*
869  * custom OID support
870  *
871  * 0xFF - implementation specific OID
872  * 0xE4 - first byte of Broadcom PCI vendor ID
873  * 0x14 - second byte of Broadcom PCI vendor ID
874  * 0xXX - the custom OID number
875  */
876
877 /* begin 0x1f values beyond the start of the ET driver range. */
878 #define WL_OID_BASE             0xFFE41420
879
880 /* NDIS overrides */
881 #define OID_WL_GETINSTANCE      (WL_OID_BASE + WLC_GET_INSTANCE)
882 #define OID_WL_GET_FORCELINK    (WL_OID_BASE + WLC_GET_FORCELINK)
883 #define OID_WL_SET_FORCELINK    (WL_OID_BASE + WLC_SET_FORCELINK)
884 #define OID_WL_ENCRYPT_STRENGTH (WL_OID_BASE + WLC_ENCRYPT_STRENGTH)
885 #define OID_WL_DECRYPT_STATUS   (WL_OID_BASE + WLC_DECRYPT_STATUS)
886
887 #define WL_DECRYPT_STATUS_SUCCESS       1
888 #define WL_DECRYPT_STATUS_FAILURE       2
889 #define WL_DECRYPT_STATUS_UNKNOWN       3
890
891 /* allows user-mode app to poll the status of USB image upgrade */
892 #define WLC_UPGRADE_SUCCESS                     0
893 #define WLC_UPGRADE_PENDING                     1
894
895 /* Bit masks for radio disabled status - returned by WL_GET_RADIO */
896 #define WL_RADIO_SW_DISABLE     (1<<0)
897 #define WL_RADIO_HW_DISABLE     (1<<1)
898
899 /* Override bit for WLC_SET_TXPWR.  if set, ignore other level limits */
900 #define WL_TXPWR_OVERRIDE       (1<<31)
901
902
903 /* Bus types */
904 #define WL_SB_BUS       0       /* Silicon Backplane */
905 #define WL_PCI_BUS      1       /* PCI target */
906 #define WL_PCMCIA_BUS   2       /* PCMCIA target */
907
908 /* band types */
909 #define WLC_BAND_AUTO           0       /* auto-select */
910 #define WLC_BAND_A              1       /* "a" band (5   Ghz) */
911 #define WLC_BAND_B              2       /* "b" band (2.4 Ghz) */
912
913 /* MAC list modes */
914 #define WLC_MACMODE_DISABLED    0       /* MAC list disabled */
915 #define WLC_MACMODE_DENY        1       /* Deny specified (i.e. allow unspecified) */
916 #define WLC_MACMODE_ALLOW       2       /* Allow specified (i.e. deny unspecified) */   
917
918
919 /* 54g modes (basic bits may still be overridden) */
920 #define GMODE_LEGACY_B          0       /* Rateset: 1b, 2b, 5.5, 11 */
921                                         /* Preamble: Long */
922                                         /* Shortslot: Off */
923 #define GMODE_AUTO              1       /* Rateset: 1b, 2b, 5.5b, 11b, 18, 24, 36, 54 */
924                                         /* Extended Rateset: 6, 9, 12, 48 */
925                                         /* Preamble: Long */
926                                         /* Shortslot: Auto */
927 #define GMODE_ONLY              2       /* Rateset: 1b, 2b, 5.5b, 11b, 18, 24b, 36, 54 */
928                                         /* Extended Rateset: 6b, 9, 12b, 48 */
929                                         /* Preamble: Short required */
930                                         /* Shortslot: Auto */
931 #define GMODE_B_DEFERRED        3       /* Rateset: 1b, 2b, 5.5b, 11b, 18, 24, 36, 54 */
932                                         /* Extended Rateset: 6, 9, 12, 48 */
933                                         /* Preamble: Long */
934                                         /* Shortslot: On */
935 #define GMODE_PERFORMANCE       4       /* Rateset: 1b, 2b, 5.5b, 6b, 9, 11b, 12b, 18, 24b, 36, 48, 54 */
936                                         /* Preamble: Short required */
937                                         /* Shortslot: On and required */
938 #define GMODE_LRS               5       /* Rateset: 1b, 2b, 5.5b, 11b */
939                                         /* Extended Rateset: 6, 9, 12, 18, 24, 36, 48, 54 */
940                                         /* Preamble: Long */
941                                         /* Shortslot: Auto */
942 #define GMODE_MAX               6
943
944
945 /* values for PLCPHdr_override */
946 #define WLC_PLCP_AUTO   -1
947 #define WLC_PLCP_SHORT  0
948 #define WLC_PLCP_LONG   1
949
950 /* values for g_protection_override */
951 #define WLC_G_PROTECTION_AUTO   -1
952 #define WLC_G_PROTECTION_OFF    0
953 #define WLC_G_PROTECTION_ON     1
954
955 /* values for g_protection_control */
956 #define WLC_G_PROTECTION_CTL_OFF        0
957 #define WLC_G_PROTECTION_CTL_LOCAL      1
958 #define WLC_G_PROTECTION_CTL_OVERLAP    2
959
960 /* Values for PM */
961 #define PM_OFF  0
962 #define PM_MAX  1
963 #define PM_FAST 2
964
965 /* interference mitigation options */
966 #define INTERFERE_NONE  0       /* off */
967 #define NON_WLAN        1       /* foreign/non 802.11 interference, no auto detect */
968 #define WLAN_MANUAL     2       /* ACI: no auto detection */
969 #define WLAN_AUTO       3       /* ACI: auto - detact */
970
971 /* Message levels */
972 #define WL_ERROR_VAL            0x0001
973 #define WL_TRACE_VAL            0x0002
974 #define WL_PRHDRS_VAL           0x0004
975 #define WL_PRPKT_VAL            0x0008
976 #define WL_INFORM_VAL           0x0010
977 #define WL_TMP_VAL              0x0020
978 #define WL_OID_VAL              0x0040
979 #define WL_RATE_VAL             0x0080
980 #define WL_ASSOC_VAL            0x0100
981 #define WL_PRUSR_VAL            0x0200
982 #define WL_PS_VAL               0x0400
983 #define WL_TXPWR_VAL            0x0800
984 #define WL_GMODE_VAL            0x1000
985 #define WL_DUAL_VAL             0x2000
986 #define WL_WSEC_VAL             0x4000
987 #define WL_WSEC_DUMP_VAL        0x8000
988 #define WL_LOG_VAL              0x10000
989 #define WL_NRSSI_VAL            0x20000
990 #define WL_LOFT_VAL             0x40000
991 #define WL_REGULATORY_VAL       0x80000
992 #define WL_ACI_VAL              0x100000
993
994
995 /* 802.11h enforcement levels */
996 #define SPECT_MNGMT_OFF         0   /* 11h disabled */
997 #define SPECT_MNGMT_LOOSE       1   /* Allow scan lists to contain non-11h AP */
998                                     /* when 11h is enabled */
999 #define SPECT_MNGMT_STRICT      2   /* Prine out non-11h APs from scan list */
1000
1001
1002
1003 /* max # of leds supported by GPIO (gpio pin# == led index#) */
1004 #define WL_LED_NUMGPIO          16      /* gpio 0-15 */
1005
1006 /* led per-pin behaviors */
1007 #define WL_LED_OFF              0               /* always off */
1008 #define WL_LED_ON               1               /* always on */
1009 #define WL_LED_ACTIVITY         2               /* activity */
1010 #define WL_LED_RADIO            3               /* radio enabled */
1011 #define WL_LED_ARADIO           4               /* 5  Ghz radio enabled */
1012 #define WL_LED_BRADIO           5               /* 2.4Ghz radio enabled */
1013 #define WL_LED_BGMODE           6               /* on if gmode, off if bmode */
1014 #define WL_LED_WI1              7               
1015 #define WL_LED_WI2              8               
1016 #define WL_LED_WI3              9               
1017 #define WL_LED_ASSOC            10              /* associated state indicator */
1018 #define WL_LED_INACTIVE         11              /* null behavior (clears default behavior) */
1019 #define WL_LED_NUMBEHAVIOR      12
1020
1021 /* led behavior numeric value format */
1022 #define WL_LED_BEH_MASK         0x7f            /* behavior mask */
1023 #define WL_LED_AL_MASK          0x80            /* activelow (polarity) bit */
1024
1025
1026 /* maximum channels */
1027 #define WL_NUMCHANNELS  64      /* max # of channels in the band */
1028
1029 /* rate check */
1030 #define WL_RATE_OFDM(r)         (((r) & 0x7f) == 12 || ((r) & 0x7f) == 18 || \
1031                                  ((r) & 0x7f) == 24 || ((r) & 0x7f) == 36 || \
1032                                  ((r) & 0x7f) == 48 || ((r) & 0x7f) == 72 || \
1033                                  ((r) & 0x7f) == 96 || ((r) & 0x7f) == 108)
1034
1035 /* WDS link local endpoint WPA role */
1036 #define WL_WDS_WPA_ROLE_AUTH    0       /* authenticator */
1037 #define WL_WDS_WPA_ROLE_SUP     1       /* supplicant */
1038 #define WL_WDS_WPA_ROLE_AUTO    255     /* auto, based on mac addr value */
1039
1040 /* afterburner_override */
1041 #define ABO_AUTO                -1      /* auto - no override */
1042 #define ABO_OFF                 0       /* force afterburner off */
1043 #define ABO_ON                  1       /* force afterburner on */
1044
1045 #undef PACKED
1046
1047 #endif /* _wlioctl_h_ */