1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## wpa_madwifing_r1722_includes.patch by Kel Modderman <kelrin@tpg.com.au>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Includes for madwifi private ioctl's (madwifi.org svn trunk r1722).
8
diff -Nrup wpa_supplicant.orig/driver_madwifi/include/compat.h wpa_supplicant/driver_madwifi/include/compat.h
9
--- wpa_supplicant.orig/driver_madwifi/include/compat.h 1970-01-01 10:00:00.000000000 +1000
10
+++ wpa_supplicant/driver_madwifi/include/compat.h 2006-07-23 10:03:55.000000000 +1000
13
+ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
14
+ * All rights reserved.
16
+ * Redistribution and use in source and binary forms, with or without
17
+ * modification, are permitted provided that the following conditions
19
+ * 1. Redistributions of source code must retain the above copyright
20
+ * notice, this list of conditions and the following disclaimer,
21
+ * without modification.
22
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
23
+ * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
24
+ * redistribution must be conditioned upon including a substantially
25
+ * similar Disclaimer requirement for further binary redistribution.
26
+ * 3. Neither the names of the above-listed copyright holders nor the names
27
+ * of any contributors may be used to endorse or promote products derived
28
+ * from this software without specific prior written permission.
30
+ * Alternatively, this software may be distributed under the terms of the
31
+ * GNU General Public License ("GPL") version 2 as published by the Free
32
+ * Software Foundation.
35
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
36
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
37
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
38
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
39
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
40
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
41
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
42
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
43
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
44
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
45
+ * THE POSSIBILITY OF SUCH DAMAGES.
47
+ * $Id: compat.h 1692 2006-07-22 17:32:14Z mrenzmann $
49
+#ifndef _ATH_COMPAT_H_
50
+#define _ATH_COMPAT_H_
52
+ * BSD/Linux compatibility shims. These are used mainly to
53
+ * minimize differences when importing necesary BSD code.
55
+#define NBBY 8 /* number of bits/byte */
57
+/* roundup() appears in Linux 2.6.18 */
58
+#include <linux/kernel.h>
60
+#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */
63
+#define howmany(x, y) (((x)+((y)-1))/(y))
65
+/* Bit map related macros. */
66
+#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
67
+#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
68
+#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
69
+#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
71
+#define __packed __attribute__((__packed__))
72
+#define __printflike(_a,_b) \
73
+ __attribute__ ((__format__ (__printf__, _a, _b)))
74
+#define __offsetof(t,m) offsetof(t,m)
76
+#ifndef ALIGNED_POINTER
78
+ * ALIGNED_POINTER is a boolean macro that checks whether an address
79
+ * is valid to fetch data elements of type t from on this architecture.
80
+ * This does not reflect the optimal alignment, just the possibility
81
+ * (within reasonable limits).
84
+#define ALIGNED_POINTER(p,t) 1
88
+#define KASSERT(exp, msg) do { \
89
+ if (unlikely(!(exp))) { \
94
+#endif /* __KERNEL__ */
97
+ * NetBSD/FreeBSD defines for file version.
100
+#define __KERNEL_RCSID(_n,_s)
101
+#endif /* _ATH_COMPAT_H_ */
102
diff -Nrup wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_crypto.h wpa_supplicant/driver_madwifi/net80211/ieee80211_crypto.h
103
--- wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_crypto.h 1970-01-01 10:00:00.000000000 +1000
104
+++ wpa_supplicant/driver_madwifi/net80211/ieee80211_crypto.h 2006-04-12 21:36:10.000000000 +1000
107
+ * Copyright (c) 2001 Atsushi Onoe
108
+ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
109
+ * All rights reserved.
111
+ * Redistribution and use in source and binary forms, with or without
112
+ * modification, are permitted provided that the following conditions
114
+ * 1. Redistributions of source code must retain the above copyright
115
+ * notice, this list of conditions and the following disclaimer.
116
+ * 2. Redistributions in binary form must reproduce the above copyright
117
+ * notice, this list of conditions and the following disclaimer in the
118
+ * documentation and/or other materials provided with the distribution.
119
+ * 3. The name of the author may not be used to endorse or promote products
120
+ * derived from this software without specific prior written permission.
122
+ * Alternatively, this software may be distributed under the terms of the
123
+ * GNU General Public License ("GPL") version 2 as published by the Free
124
+ * Software Foundation.
126
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
127
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
128
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
129
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
130
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
131
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
132
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
133
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
134
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
135
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
137
+ * $Id: ieee80211_crypto.h 1441 2006-02-06 16:03:21Z mrenzmann $
139
+#ifndef _NET80211_IEEE80211_CRYPTO_H_
140
+#define _NET80211_IEEE80211_CRYPTO_H_
143
+ * 802.11 protocol crypto-related definitions.
145
+#define IEEE80211_KEYBUF_SIZE 16
146
+#define IEEE80211_MICBUF_SIZE (8 + 8) /* space for both tx+rx keys */
147
+#define IEEE80211_TID_SIZE 17 /* total number of TIDs */
150
+ * Old WEP-style key. Deprecated.
152
+struct ieee80211_wepkey {
153
+ u_int wk_len; /* key length in bytes */
154
+ u_int8_t wk_key[IEEE80211_KEYBUF_SIZE];
157
+struct ieee80211_cipher;
160
+ * Crypto key state. There is sufficient room for all supported
161
+ * ciphers (see below). The underlying ciphers are handled
162
+ * separately through loadable cipher modules that register with
163
+ * the generic crypto support. A key has a reference to an instance
164
+ * of the cipher; any per-key state is hung off wk_private by the
165
+ * cipher when it is attached. Ciphers are automatically called
166
+ * to detach and cleanup any such state when the key is deleted.
168
+ * The generic crypto support handles encap/decap of cipher-related
169
+ * frame contents for both hardware- and software-based implementations.
170
+ * A key requiring software crypto support is automatically flagged and
171
+ * the cipher is expected to honor this and do the necessary work.
172
+ * Ciphers such as TKIP may also support mixed hardware/software
173
+ * encrypt/decrypt and MIC processing.
175
+/* XXX need key index typedef */
176
+/* XXX pack better? */
177
+/* XXX 48-bit rsc/tsc */
178
+struct ieee80211_key {
179
+ u_int8_t wk_keylen; /* key length in bytes */
181
+#define IEEE80211_KEY_XMIT 0x01 /* key used for xmit */
182
+#define IEEE80211_KEY_RECV 0x02 /* key used for recv */
183
+#define IEEE80211_KEY_GROUP 0x04 /* key used for WPA group operation */
184
+#define IEEE80211_KEY_SWCRYPT 0x10 /* host-based encrypt/decrypt */
185
+#define IEEE80211_KEY_SWMIC 0x20 /* host-based enmic/demic */
186
+ u_int16_t wk_keyix; /* key index */
187
+ u_int8_t wk_key[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
188
+#define wk_txmic wk_key+IEEE80211_KEYBUF_SIZE+0 /* XXX can't () right */
189
+#define wk_rxmic wk_key+IEEE80211_KEYBUF_SIZE+8 /* XXX can't () right */
190
+ u_int64_t wk_keyrsc[IEEE80211_TID_SIZE]; /* key receive sequence counter */
191
+ u_int64_t wk_keytsc; /* key transmit sequence counter */
192
+ const struct ieee80211_cipher *wk_cipher;
193
+ void *wk_private; /* private cipher state */
195
+#define IEEE80211_KEY_COMMON /* common flags passed in by apps */\
196
+ (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV | IEEE80211_KEY_GROUP)
199
+ * NB: these values are ordered carefully; there are lots of
200
+ * of implications in any reordering. In particular beware
201
+ * that 4 is not used to avoid conflicting with IEEE80211_F_PRIVACY.
203
+#define IEEE80211_CIPHER_WEP 0
204
+#define IEEE80211_CIPHER_TKIP 1
205
+#define IEEE80211_CIPHER_AES_OCB 2
206
+#define IEEE80211_CIPHER_AES_CCM 3
207
+#define IEEE80211_CIPHER_CKIP 5
208
+#define IEEE80211_CIPHER_NONE 6 /* pseudo value */
210
+#define IEEE80211_CIPHER_MAX (IEEE80211_CIPHER_NONE+1)
212
+#define IEEE80211_KEYIX_NONE ((u_int16_t) - 1)
214
+#if defined(__KERNEL__) || defined(_KERNEL)
216
+struct ieee80211com;
217
+struct ieee80211vap;
218
+struct ieee80211_node;
221
+void ieee80211_crypto_attach(struct ieee80211com *);
222
+void ieee80211_crypto_detach(struct ieee80211com *);
223
+void ieee80211_crypto_vattach(struct ieee80211vap *);
224
+void ieee80211_crypto_vdetach(struct ieee80211vap *);
225
+int ieee80211_crypto_newkey(struct ieee80211vap *, int, int,
226
+ struct ieee80211_key *);
227
+int ieee80211_crypto_delkey(struct ieee80211vap *, struct ieee80211_key *,
228
+ struct ieee80211_node *);
229
+int ieee80211_crypto_setkey(struct ieee80211vap *, struct ieee80211_key *,
230
+ const u_int8_t macaddr[IEEE80211_ADDR_LEN], struct ieee80211_node *);
231
+void ieee80211_crypto_delglobalkeys(struct ieee80211vap *);
234
+ * Template for a supported cipher. Ciphers register with the
235
+ * crypto code and are typically loaded as separate modules
236
+ * (the null cipher is always present).
237
+ * XXX may need refcnts
239
+struct ieee80211_cipher {
240
+ const char *ic_name; /* printable name */
241
+ u_int ic_cipher; /* IEEE80211_CIPHER_* */
242
+ u_int ic_header; /* size of privacy header (bytes) */
243
+ u_int ic_trailer; /* size of privacy trailer (bytes) */
244
+ u_int ic_miclen; /* size of mic trailer (bytes) */
245
+ void *(*ic_attach)(struct ieee80211vap *, struct ieee80211_key *);
246
+ void (*ic_detach)(struct ieee80211_key *);
247
+ int (*ic_setkey)(struct ieee80211_key *);
248
+ int (*ic_encap)(struct ieee80211_key *, struct sk_buff *, u_int8_t);
249
+ int (*ic_decap)(struct ieee80211_key *, struct sk_buff *, int);
250
+ int (*ic_enmic)(struct ieee80211_key *, struct sk_buff *, int);
251
+ int (*ic_demic)(struct ieee80211_key *, struct sk_buff *, int);
253
+extern const struct ieee80211_cipher ieee80211_cipher_none;
255
+void ieee80211_crypto_register(const struct ieee80211_cipher *);
256
+void ieee80211_crypto_unregister(const struct ieee80211_cipher *);
257
+int ieee80211_crypto_available(u_int);
259
+struct ieee80211_key *ieee80211_crypto_encap(struct ieee80211_node *,
261
+struct ieee80211_key *ieee80211_crypto_decap(struct ieee80211_node *,
262
+ struct sk_buff *, int);
265
+ * Check and remove any MIC.
268
+ieee80211_crypto_demic(struct ieee80211vap *vap, struct ieee80211_key *k,
269
+ struct sk_buff *skb, int hdrlen)
271
+ const struct ieee80211_cipher *cip = k->wk_cipher;
272
+ return (cip->ic_miclen > 0 ? cip->ic_demic(k, skb, hdrlen) : 1);
279
+ieee80211_crypto_enmic(struct ieee80211vap *vap, struct ieee80211_key *k,
280
+ struct sk_buff *skb, int force)
282
+ const struct ieee80211_cipher *cip = k->wk_cipher;
283
+ return (cip->ic_miclen > 0 ? cip->ic_enmic(k, skb, force) : 1);
287
+ * Reset key state to an unused state. The crypto
288
+ * key allocation mechanism ensures other state (e.g.
289
+ * key data) is properly setup before a key is used.
291
+static __inline void
292
+ieee80211_crypto_resetkey(struct ieee80211vap *vap, struct ieee80211_key *k,
295
+ k->wk_cipher = &ieee80211_cipher_none;;
296
+ k->wk_private = k->wk_cipher->ic_attach(vap, k);
298
+ k->wk_flags = IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV;
302
+ * Crypto-related notification methods.
304
+void ieee80211_notify_replay_failure(struct ieee80211vap *,
305
+ const struct ieee80211_frame *, const struct ieee80211_key *,
307
+void ieee80211_notify_michael_failure(struct ieee80211vap *,
308
+ const struct ieee80211_frame *, u_int keyix);
309
+#endif /* defined(__KERNEL__) || defined(_KERNEL) */
310
+#endif /* _NET80211_IEEE80211_CRYPTO_H_ */
311
diff -Nrup wpa_supplicant.orig/driver_madwifi/net80211/_ieee80211.h wpa_supplicant/driver_madwifi/net80211/_ieee80211.h
312
--- wpa_supplicant.orig/driver_madwifi/net80211/_ieee80211.h 1970-01-01 10:00:00.000000000 +1000
313
+++ wpa_supplicant/driver_madwifi/net80211/_ieee80211.h 2006-04-12 21:36:10.000000000 +1000
316
+ * Copyright (c) 2001 Atsushi Onoe
317
+ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
318
+ * All rights reserved.
320
+ * Redistribution and use in source and binary forms, with or without
321
+ * modification, are permitted provided that the following conditions
323
+ * 1. Redistributions of source code must retain the above copyright
324
+ * notice, this list of conditions and the following disclaimer.
325
+ * 2. Redistributions in binary form must reproduce the above copyright
326
+ * notice, this list of conditions and the following disclaimer in the
327
+ * documentation and/or other materials provided with the distribution.
328
+ * 3. The name of the author may not be used to endorse or promote products
329
+ * derived from this software without specific prior written permission.
331
+ * Alternatively, this software may be distributed under the terms of the
332
+ * GNU General Public License ("GPL") version 2 as published by the Free
333
+ * Software Foundation.
335
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
336
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
337
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
338
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
339
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
340
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
341
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
342
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
343
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
344
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
346
+ * $Id: _ieee80211.h 1441 2006-02-06 16:03:21Z mrenzmann $
348
+#ifndef _NET80211__IEEE80211_H_
349
+#define _NET80211__IEEE80211_H_
351
+enum ieee80211_phytype {
352
+ IEEE80211_T_DS, /* direct sequence spread spectrum */
353
+ IEEE80211_T_FH, /* frequency hopping */
354
+ IEEE80211_T_OFDM, /* frequency division multiplexing */
355
+ IEEE80211_T_TURBO, /* high rate OFDM, aka turbo mode */
357
+#define IEEE80211_T_CCK IEEE80211_T_DS /* more common nomenclature */
359
+/* XXX not really a mode; there are really multiple PHY's */
360
+enum ieee80211_phymode {
361
+ IEEE80211_MODE_AUTO = 0, /* autoselect */
362
+ IEEE80211_MODE_11A = 1, /* 5GHz, OFDM */
363
+ IEEE80211_MODE_11B = 2, /* 2GHz, CCK */
364
+ IEEE80211_MODE_11G = 3, /* 2GHz, OFDM */
365
+ IEEE80211_MODE_FH = 4, /* 2GHz, GFSK */
366
+ IEEE80211_MODE_TURBO_A = 5, /* 5GHz, OFDM, 2x clock dynamic turbo */
367
+ IEEE80211_MODE_TURBO_G = 6, /* 2GHz, OFDM, 2x clock dynamic turbo*/
369
+#define IEEE80211_MODE_MAX (IEEE80211_MODE_TURBO_G+1)
371
+enum ieee80211_opmode {
372
+ IEEE80211_M_STA = 1, /* infrastructure station */
373
+ IEEE80211_M_IBSS = 0, /* IBSS (adhoc) station */
374
+ IEEE80211_M_AHDEMO = 3, /* Old lucent compatible adhoc demo */
375
+ IEEE80211_M_HOSTAP = 6, /* Software Access Point */
376
+ IEEE80211_M_MONITOR = 8, /* Monitor mode */
377
+ IEEE80211_M_WDS = 2 /* WDS link */
381
+ * 802.11g protection mode.
383
+enum ieee80211_protmode {
384
+ IEEE80211_PROT_NONE = 0, /* no protection */
385
+ IEEE80211_PROT_CTSONLY = 1, /* CTS to self */
386
+ IEEE80211_PROT_RTSCTS = 2, /* RTS-CTS */
390
+ * Authentication mode.
392
+enum ieee80211_authmode {
393
+ IEEE80211_AUTH_NONE = 0,
394
+ IEEE80211_AUTH_OPEN = 1, /* open */
395
+ IEEE80211_AUTH_SHARED = 2, /* shared-key */
396
+ IEEE80211_AUTH_8021X = 3, /* 802.1x */
397
+ IEEE80211_AUTH_AUTO = 4, /* auto-select/accept */
398
+ /* NB: these are used only for ioctls */
399
+ IEEE80211_AUTH_WPA = 5, /* WPA/RSN w/ 802.1x/PSK */
403
+ * Roaming mode is effectively who controls the operation
404
+ * of the 802.11 state machine when operating as a station.
405
+ * State transitions are controlled either by the driver
406
+ * (typically when management frames are processed by the
407
+ * hardware/firmware), the host (auto/normal operation of
408
+ * the 802.11 layer), or explicitly through ioctl requests
409
+ * when applications like wpa_supplicant want control.
411
+enum ieee80211_roamingmode {
412
+ IEEE80211_ROAMING_DEVICE= 0, /* driver/hardware control */
413
+ IEEE80211_ROAMING_AUTO = 1, /* 802.11 layer control */
414
+ IEEE80211_ROAMING_MANUAL= 2, /* application control */
418
+ * Scanning mode controls station scanning work; this is
419
+ * used only when roaming mode permits the host to select
420
+ * the bss to join/channel to use.
422
+enum ieee80211_scanmode {
423
+ IEEE80211_SCAN_DEVICE = 0, /* driver/hardware control */
424
+ IEEE80211_SCAN_BEST = 1, /* 802.11 layer selects best */
425
+ IEEE80211_SCAN_FIRST = 2, /* take first suitable candidate */
429
+ * Channels are specified by frequency and attributes.
431
+struct ieee80211_channel {
432
+ u_int16_t ic_freq; /* setting in Mhz */
433
+ u_int16_t ic_flags; /* see below */
434
+ u_int8_t ic_ieee; /* IEEE channel number */
435
+ int8_t ic_maxregpower; /* maximum regulatory tx power in dBm */
436
+ int8_t ic_maxpower; /* maximum tx power in dBm */
437
+ int8_t ic_minpower; /* minimum tx power in dBm */
440
+#define IEEE80211_CHAN_MAX 255
441
+#define IEEE80211_CHAN_BYTES 32 /* howmany(IEEE80211_CHAN_MAX, NBBY) */
442
+#define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */
443
+#define IEEE80211_CHAN_ANYC ((struct ieee80211_channel *) IEEE80211_CHAN_ANY)
445
+#define IEEE80211_RADAR_11HCOUNT 1
446
+#define IEEE80211_RADAR_TEST_MUTE_CHAN 36 /* Move to channel 36 for mute test */
448
+/* bits 0-3 are for private use by drivers */
449
+/* channel attributes */
450
+#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */
451
+#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */
452
+#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */
453
+#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */
454
+#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */
455
+#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */
456
+#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */
457
+#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */
458
+#define IEEE80211_CHAN_RADAR 0x1000 /* Radar found on channel */
459
+#define IEEE80211_CHAN_STURBO 0x2000 /* 11a static turbo channel only */
460
+#define IEEE80211_CHAN_HALF 0x4000 /* Half rate channel */
461
+#define IEEE80211_CHAN_QUARTER 0x8000 /* Quarter rate channel */
464
+ * Useful combinations of channel characteristics.
466
+#define IEEE80211_CHAN_FHSS \
467
+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK)
468
+#define IEEE80211_CHAN_A \
469
+ (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM)
470
+#define IEEE80211_CHAN_B \
471
+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK)
472
+#define IEEE80211_CHAN_PUREG \
473
+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM)
474
+#define IEEE80211_CHAN_G \
475
+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN)
476
+#define IEEE80211_CHAN_108A \
477
+ (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
478
+#define IEEE80211_CHAN_108G \
479
+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
480
+#define IEEE80211_CHAN_ST \
481
+ (IEEE80211_CHAN_108A | IEEE80211_CHAN_STURBO)
483
+#define IEEE80211_CHAN_ALL \
484
+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_GFSK | \
485
+ IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN)
486
+#define IEEE80211_CHAN_ALLTURBO \
487
+ (IEEE80211_CHAN_ALL | IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)
489
+#define IEEE80211_IS_CHAN_FHSS(_c) \
490
+ (((_c)->ic_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS)
491
+#define IEEE80211_IS_CHAN_A(_c) \
492
+ (((_c)->ic_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A)
493
+#define IEEE80211_IS_CHAN_B(_c) \
494
+ (((_c)->ic_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B)
495
+#define IEEE80211_IS_CHAN_PUREG(_c) \
496
+ (((_c)->ic_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG)
497
+#define IEEE80211_IS_CHAN_G(_c) \
498
+ (((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G)
499
+#define IEEE80211_IS_CHAN_ANYG(_c) \
500
+ (IEEE80211_IS_CHAN_PUREG(_c) || IEEE80211_IS_CHAN_G(_c))
501
+#define IEEE80211_IS_CHAN_ST(_c) \
502
+ (((_c)->ic_flags & IEEE80211_CHAN_ST) == IEEE80211_CHAN_ST)
503
+#define IEEE80211_IS_CHAN_108A(_c) \
504
+ (((_c)->ic_flags & IEEE80211_CHAN_108A) == IEEE80211_CHAN_108A)
505
+#define IEEE80211_IS_CHAN_108G(_c) \
506
+ (((_c)->ic_flags & IEEE80211_CHAN_108G) == IEEE80211_CHAN_108G)
508
+#define IEEE80211_IS_CHAN_2GHZ(_c) \
509
+ (((_c)->ic_flags & IEEE80211_CHAN_2GHZ) != 0)
510
+#define IEEE80211_IS_CHAN_5GHZ(_c) \
511
+ (((_c)->ic_flags & IEEE80211_CHAN_5GHZ) != 0)
512
+#define IEEE80211_IS_CHAN_OFDM(_c) \
513
+ (((_c)->ic_flags & IEEE80211_CHAN_OFDM) != 0)
514
+#define IEEE80211_IS_CHAN_CCK(_c) \
515
+ (((_c)->ic_flags & IEEE80211_CHAN_CCK) != 0)
516
+#define IEEE80211_IS_CHAN_GFSK(_c) \
517
+ (((_c)->ic_flags & IEEE80211_CHAN_GFSK) != 0)
518
+#define IEEE80211_IS_CHAN_TURBO(_c) \
519
+ (((_c)->ic_flags & IEEE80211_CHAN_TURBO) != 0)
520
+#define IEEE80211_IS_CHAN_STURBO(_c) \
521
+ (((_c)->ic_flags & IEEE80211_CHAN_STURBO) != 0)
522
+#define IEEE80211_IS_CHAN_DTURBO(_c) \
523
+ (((_c)->ic_flags & \
524
+ (IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)) == IEEE80211_CHAN_TURBO)
525
+#define IEEE80211_IS_CHAN_HALF(_c) \
526
+ (((_c)->ic_flags & IEEE80211_CHAN_HALF) != 0)
527
+#define IEEE80211_IS_CHAN_QUARTER(_c) \
528
+ (((_c)->ic_flags & IEEE80211_CHAN_QUARTER) != 0)
530
+/* ni_chan encoding for FH phy */
531
+#define IEEE80211_FH_CHANMOD 80
532
+#define IEEE80211_FH_CHAN(set,pat) (((set) - 1) * IEEE80211_FH_CHANMOD + (pat))
533
+#define IEEE80211_FH_CHANSET(chan) ((chan) / IEEE80211_FH_CHANMOD + 1)
534
+#define IEEE80211_FH_CHANPAT(chan) ((chan) % IEEE80211_FH_CHANMOD)
539
+#define IEEE80211_RATE_SIZE 8 /* 802.11 standard */
540
+#define IEEE80211_RATE_MAXSIZE 15 /* max rates we'll handle */
542
+struct ieee80211_rateset {
543
+ u_int8_t rs_nrates;
544
+ u_int8_t rs_rates[IEEE80211_RATE_MAXSIZE];
547
+struct ieee80211_roam {
548
+ int8_t rssi11a; /* rssi thresh for 11a bss */
549
+ int8_t rssi11b; /* for 11g sta in 11b bss */
550
+ int8_t rssi11bOnly; /* for 11b sta */
552
+ u_int8_t rate11a; /* rate thresh for 11a bss */
553
+ u_int8_t rate11b; /* for 11g sta in 11b bss */
554
+ u_int8_t rate11bOnly; /* for 11b sta */
557
+#endif /* _NET80211__IEEE80211_H_ */
558
diff -Nrup wpa_supplicant.orig/driver_madwifi/net80211/ieee80211.h wpa_supplicant/driver_madwifi/net80211/ieee80211.h
559
--- wpa_supplicant.orig/driver_madwifi/net80211/ieee80211.h 1970-01-01 10:00:00.000000000 +1000
560
+++ wpa_supplicant/driver_madwifi/net80211/ieee80211.h 2006-09-15 11:17:35.000000000 +1000
563
+ * Copyright (c) 2001 Atsushi Onoe
564
+ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
565
+ * All rights reserved.
567
+ * Redistribution and use in source and binary forms, with or without
568
+ * modification, are permitted provided that the following conditions
570
+ * 1. Redistributions of source code must retain the above copyright
571
+ * notice, this list of conditions and the following disclaimer.
572
+ * 2. Redistributions in binary form must reproduce the above copyright
573
+ * notice, this list of conditions and the following disclaimer in the
574
+ * documentation and/or other materials provided with the distribution.
575
+ * 3. The name of the author may not be used to endorse or promote products
576
+ * derived from this software without specific prior written permission.
578
+ * Alternatively, this software may be distributed under the terms of the
579
+ * GNU General Public License ("GPL") version 2 as published by the Free
580
+ * Software Foundation.
582
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
583
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
584
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
585
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
586
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
587
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
588
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
589
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
590
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
591
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
593
+ * $Id: ieee80211.h 1712 2006-09-15 01:13:53Z kelmo $
595
+#ifndef _NET80211_IEEE80211_H_
596
+#define _NET80211_IEEE80211_H_
599
+ * 802.11 protocol definitions.
602
+#define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */
603
+/* is 802.11 address multicast/broadcast? */
604
+#define IEEE80211_IS_MULTICAST(_a) (*(_a) & 0x01)
606
+/* IEEE 802.11 PLCP header */
607
+struct ieee80211_plcp_hdr {
610
+ u_int8_t i_service;
611
+ u_int16_t i_length;
615
+#define IEEE80211_PLCP_SFD 0xF3A0
616
+#define IEEE80211_PLCP_SERVICE 0x00
619
+ * generic definitions for IEEE 802.11 frames
621
+struct ieee80211_frame {
624
+ u_int8_t i_addr1[IEEE80211_ADDR_LEN];
625
+ u_int8_t i_addr2[IEEE80211_ADDR_LEN];
626
+ u_int8_t i_addr3[IEEE80211_ADDR_LEN];
628
+ /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
632
+struct ieee80211_qosframe {
635
+ u_int8_t i_addr1[IEEE80211_ADDR_LEN];
636
+ u_int8_t i_addr2[IEEE80211_ADDR_LEN];
637
+ u_int8_t i_addr3[IEEE80211_ADDR_LEN];
640
+ /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
644
+struct ieee80211_qoscntl {
648
+struct ieee80211_frame_addr4 {
651
+ u_int8_t i_addr1[IEEE80211_ADDR_LEN];
652
+ u_int8_t i_addr2[IEEE80211_ADDR_LEN];
653
+ u_int8_t i_addr3[IEEE80211_ADDR_LEN];
655
+ u_int8_t i_addr4[IEEE80211_ADDR_LEN];
659
+struct ieee80211_qosframe_addr4 {
662
+ u_int8_t i_addr1[IEEE80211_ADDR_LEN];
663
+ u_int8_t i_addr2[IEEE80211_ADDR_LEN];
664
+ u_int8_t i_addr3[IEEE80211_ADDR_LEN];
666
+ u_int8_t i_addr4[IEEE80211_ADDR_LEN];
670
+struct ieee80211_ctlframe_addr2 {
672
+ u_int8_t i_aidordur[2]; /* AID or duration */
673
+ u_int8_t i_addr1[IEEE80211_ADDR_LEN];
674
+ u_int8_t i_addr2[IEEE80211_ADDR_LEN];
677
+#define IEEE80211_FC0_VERSION_MASK 0x03
678
+#define IEEE80211_FC0_VERSION_SHIFT 0
679
+#define IEEE80211_FC0_VERSION_0 0x00
680
+#define IEEE80211_FC0_TYPE_MASK 0x0c
681
+#define IEEE80211_FC0_TYPE_SHIFT 2
682
+#define IEEE80211_FC0_TYPE_MGT 0x00
683
+#define IEEE80211_FC0_TYPE_CTL 0x04
684
+#define IEEE80211_FC0_TYPE_DATA 0x08
686
+#define IEEE80211_FC0_SUBTYPE_MASK 0xf0
687
+#define IEEE80211_FC0_SUBTYPE_SHIFT 4
689
+#define IEEE80211_FC0_SUBTYPE_ASSOC_REQ 0x00
690
+#define IEEE80211_FC0_SUBTYPE_ASSOC_RESP 0x10
691
+#define IEEE80211_FC0_SUBTYPE_REASSOC_REQ 0x20
692
+#define IEEE80211_FC0_SUBTYPE_REASSOC_RESP 0x30
693
+#define IEEE80211_FC0_SUBTYPE_PROBE_REQ 0x40
694
+#define IEEE80211_FC0_SUBTYPE_PROBE_RESP 0x50
695
+#define IEEE80211_FC0_SUBTYPE_BEACON 0x80
696
+#define IEEE80211_FC0_SUBTYPE_ATIM 0x90
697
+#define IEEE80211_FC0_SUBTYPE_DISASSOC 0xa0
698
+#define IEEE80211_FC0_SUBTYPE_AUTH 0xb0
699
+#define IEEE80211_FC0_SUBTYPE_DEAUTH 0xc0
700
+#define IEEE80211_FC0_SUBTYPE_ACTION 0xd0
702
+#define IEEE80211_FC0_SUBTYPE_PS_POLL 0xa0
703
+#define IEEE80211_FC0_SUBTYPE_RTS 0xb0
704
+#define IEEE80211_FC0_SUBTYPE_CTS 0xc0
705
+#define IEEE80211_FC0_SUBTYPE_ACK 0xd0
706
+#define IEEE80211_FC0_SUBTYPE_CF_END 0xe0
707
+#define IEEE80211_FC0_SUBTYPE_CF_END_ACK 0xf0
708
+/* for TYPE_DATA (bit combination) */
709
+#define IEEE80211_FC0_SUBTYPE_DATA 0x00
710
+#define IEEE80211_FC0_SUBTYPE_CF_ACK 0x10
711
+#define IEEE80211_FC0_SUBTYPE_CF_POLL 0x20
712
+#define IEEE80211_FC0_SUBTYPE_CF_ACPL 0x30
713
+#define IEEE80211_FC0_SUBTYPE_NODATA 0x40
714
+#define IEEE80211_FC0_SUBTYPE_CFACK 0x50
715
+#define IEEE80211_FC0_SUBTYPE_CFPOLL 0x60
716
+#define IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK 0x70
717
+#define IEEE80211_FC0_SUBTYPE_QOS 0x80
718
+#define IEEE80211_FC0_SUBTYPE_QOS_NULL 0xc0
720
+#define IEEE80211_FC1_DIR_MASK 0x03
721
+#define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */
722
+#define IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */
723
+#define IEEE80211_FC1_DIR_FROMDS 0x02 /* AP ->STA */
724
+#define IEEE80211_FC1_DIR_DSTODS 0x03 /* AP ->AP */
726
+#define IEEE80211_FC1_MORE_FRAG 0x04
727
+#define IEEE80211_FC1_RETRY 0x08
728
+#define IEEE80211_FC1_PWR_MGT 0x10
729
+#define IEEE80211_FC1_MORE_DATA 0x20
730
+#define IEEE80211_FC1_PROT 0x40
731
+#define IEEE80211_FC1_ORDER 0x80
733
+#define IEEE80211_SEQ_FRAG_MASK 0x000f
734
+#define IEEE80211_SEQ_FRAG_SHIFT 0
735
+#define IEEE80211_SEQ_SEQ_MASK 0xfff0
736
+#define IEEE80211_SEQ_SEQ_SHIFT 4
738
+#define IEEE80211_SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0)
740
+#define IEEE80211_NWID_LEN 32
742
+#define IEEE80211_QOS_TXOP 0x00ff
743
+/* bit 8 is reserved */
744
+#define IEEE80211_QOS_ACKPOLICY 0x60
745
+#define IEEE80211_QOS_ACKPOLICY_S 5
746
+#define IEEE80211_QOS_EOSP 0x10
747
+#define IEEE80211_QOS_EOSP_S 4
748
+#define IEEE80211_QOS_TID 0x0f
751
+ * Country/Region Codes from MS WINNLS.H
752
+ * Numbering from ISO 3166
753
+ * XXX belongs elsewhere
756
+ CTRY_ALBANIA = 8, /* Albania */
757
+ CTRY_ALGERIA = 12, /* Algeria */
758
+ CTRY_ARGENTINA = 32, /* Argentina */
759
+ CTRY_ARMENIA = 51, /* Armenia */
760
+ CTRY_AUSTRALIA = 36, /* Australia */
761
+ CTRY_AUSTRIA = 40, /* Austria */
762
+ CTRY_AZERBAIJAN = 31, /* Azerbaijan */
763
+ CTRY_BAHRAIN = 48, /* Bahrain */
764
+ CTRY_BELARUS = 112, /* Belarus */
765
+ CTRY_BELGIUM = 56, /* Belgium */
766
+ CTRY_BELIZE = 84, /* Belize */
767
+ CTRY_BOLIVIA = 68, /* Bolivia */
768
+ CTRY_BRAZIL = 76, /* Brazil */
769
+ CTRY_BRUNEI_DARUSSALAM = 96, /* Brunei Darussalam */
770
+ CTRY_BULGARIA = 100, /* Bulgaria */
771
+ CTRY_CANADA = 124, /* Canada */
772
+ CTRY_CHILE = 152, /* Chile */
773
+ CTRY_CHINA = 156, /* People's Republic of China */
774
+ CTRY_COLOMBIA = 170, /* Colombia */
775
+ CTRY_COSTA_RICA = 188, /* Costa Rica */
776
+ CTRY_CROATIA = 191, /* Croatia */
778
+ CTRY_CZECH = 203, /* Czech Republic */
779
+ CTRY_DENMARK = 208, /* Denmark */
780
+ CTRY_DOMINICAN_REPUBLIC = 214, /* Dominican Republic */
781
+ CTRY_ECUADOR = 218, /* Ecuador */
782
+ CTRY_EGYPT = 818, /* Egypt */
783
+ CTRY_EL_SALVADOR = 222, /* El Salvador */
784
+ CTRY_ESTONIA = 233, /* Estonia */
785
+ CTRY_FAEROE_ISLANDS = 234, /* Faeroe Islands */
786
+ CTRY_FINLAND = 246, /* Finland */
787
+ CTRY_FRANCE = 250, /* France */
788
+ CTRY_FRANCE2 = 255, /* France2 */
789
+ CTRY_GEORGIA = 268, /* Georgia */
790
+ CTRY_GERMANY = 276, /* Germany */
791
+ CTRY_GREECE = 300, /* Greece */
792
+ CTRY_GUATEMALA = 320, /* Guatemala */
793
+ CTRY_HONDURAS = 340, /* Honduras */
794
+ CTRY_HONG_KONG = 344, /* Hong Kong S.A.R., P.R.C. */
795
+ CTRY_HUNGARY = 348, /* Hungary */
796
+ CTRY_ICELAND = 352, /* Iceland */
797
+ CTRY_INDIA = 356, /* India */
798
+ CTRY_INDONESIA = 360, /* Indonesia */
799
+ CTRY_IRAN = 364, /* Iran */
800
+ CTRY_IRAQ = 368, /* Iraq */
801
+ CTRY_IRELAND = 372, /* Ireland */
802
+ CTRY_ISRAEL = 376, /* Israel */
803
+ CTRY_ITALY = 380, /* Italy */
804
+ CTRY_JAMAICA = 388, /* Jamaica */
805
+ CTRY_JAPAN = 392, /* Japan */
806
+ CTRY_JAPAN1 = 393, /* Japan (JP1) */
807
+ CTRY_JAPAN2 = 394, /* Japan (JP0) */
808
+ CTRY_JAPAN3 = 395, /* Japan (JP1-1) */
809
+ CTRY_JAPAN4 = 396, /* Japan (JE1) */
810
+ CTRY_JAPAN5 = 397, /* Japan (JE2) */
811
+ CTRY_JAPAN6 = 399, /* Japan (JP6) */
812
+ CTRY_JAPAN7 = 900, /* Japan */
813
+ CTRY_JAPAN8 = 901, /* Japan */
814
+ CTRY_JAPAN9 = 902, /* Japan */
815
+ CTRY_JAPAN10 = 903, /* Japan */
816
+ CTRY_JAPAN11 = 904, /* Japan */
817
+ CTRY_JAPAN12 = 905, /* Japan */
818
+ CTRY_JAPAN13 = 906, /* Japan */
819
+ CTRY_JAPAN14 = 907, /* Japan */
820
+ CTRY_JAPAN15 = 908, /* Japan */
821
+ CTRY_JAPAN16 = 909, /* Japan */
822
+ CTRY_JAPAN17 = 910, /* Japan */
823
+ CTRY_JAPAN18 = 911, /* Japan */
824
+ CTRY_JAPAN19 = 912, /* Japan */
825
+ CTRY_JAPAN20 = 913, /* Japan */
826
+ CTRY_JAPAN21 = 914, /* Japan */
827
+ CTRY_JAPAN22 = 915, /* Japan */
828
+ CTRY_JAPAN23 = 916, /* Japan */
829
+ CTRY_JAPAN24 = 917, /* Japan */
830
+ CTRY_JAPAN25 = 918, /* Japan */
831
+ CTRY_JAPAN26 = 919, /* Japan */
832
+ CTRY_JAPAN27 = 920, /* Japan */
833
+ CTRY_JAPAN28 = 921, /* Japan */
834
+ CTRY_JAPAN29 = 922, /* Japan */
835
+ CTRY_JAPAN30 = 923, /* Japan */
836
+ CTRY_JAPAN31 = 924, /* Japan */
837
+ CTRY_JAPAN32 = 925, /* Japan */
838
+ CTRY_JAPAN33 = 926, /* Japan */
839
+ CTRY_JAPAN34 = 927, /* Japan */
840
+ CTRY_JAPAN35 = 928, /* Japan */
841
+ CTRY_JAPAN36 = 929, /* Japan */
842
+ CTRY_JAPAN37 = 930, /* Japan */
843
+ CTRY_JAPAN38 = 931, /* Japan */
844
+ CTRY_JAPAN39 = 932, /* Japan */
845
+ CTRY_JAPAN40 = 933, /* Japan */
846
+ CTRY_JAPAN41 = 934, /* Japan */
847
+ CTRY_JAPAN42 = 935, /* Japan */
848
+ CTRY_JAPAN43 = 936, /* Japan */
849
+ CTRY_JAPAN44 = 937, /* Japan */
850
+ CTRY_JAPAN45 = 938, /* Japan */
851
+ CTRY_JAPAN46 = 939, /* Japan */
852
+ CTRY_JAPAN47 = 940, /* Japan */
853
+ CTRY_JAPAN48 = 941, /* Japan */
854
+ CTRY_JORDAN = 400, /* Jordan */
855
+ CTRY_KAZAKHSTAN = 398, /* Kazakhstan */
856
+ CTRY_KENYA = 404, /* Kenya */
857
+ CTRY_KOREA_NORTH = 408, /* North Korea */
858
+ CTRY_KOREA_ROC = 410, /* South Korea */
859
+ CTRY_KOREA_ROC2 = 411, /* South Korea */
860
+ CTRY_KUWAIT = 414, /* Kuwait */
861
+ CTRY_LATVIA = 428, /* Latvia */
862
+ CTRY_LEBANON = 422, /* Lebanon */
863
+ CTRY_LIBYA = 434, /* Libya */
864
+ CTRY_LIECHTENSTEIN = 438, /* Liechtenstein */
865
+ CTRY_LITHUANIA = 440, /* Lithuania */
866
+ CTRY_LUXEMBOURG = 442, /* Luxembourg */
867
+ CTRY_MACAU = 446, /* Macau */
868
+ CTRY_MACEDONIA = 807, /* the Former Yugoslav Republic of Macedonia */
869
+ CTRY_MALAYSIA = 458, /* Malaysia */
870
+ CTRY_MEXICO = 484, /* Mexico */
871
+ CTRY_MONACO = 492, /* Principality of Monaco */
872
+ CTRY_MOROCCO = 504, /* Morocco */
873
+ CTRY_NETHERLANDS = 528, /* Netherlands */
874
+ CTRY_NEW_ZEALAND = 554, /* New Zealand */
875
+ CTRY_NICARAGUA = 558, /* Nicaragua */
876
+ CTRY_NORWAY = 578, /* Norway */
877
+ CTRY_OMAN = 512, /* Oman */
878
+ CTRY_PAKISTAN = 586, /* Islamic Republic of Pakistan */
879
+ CTRY_PANAMA = 591, /* Panama */
880
+ CTRY_PARAGUAY = 600, /* Paraguay */
881
+ CTRY_PERU = 604, /* Peru */
882
+ CTRY_PHILIPPINES = 608, /* Republic of the Philippines */
883
+ CTRY_POLAND = 616, /* Poland */
884
+ CTRY_PORTUGAL = 620, /* Portugal */
885
+ CTRY_PUERTO_RICO = 630, /* Puerto Rico */
886
+ CTRY_QATAR = 634, /* Qatar */
887
+ CTRY_ROMANIA = 642, /* Romania */
888
+ CTRY_RUSSIA = 643, /* Russia */
889
+ CTRY_SAUDI_ARABIA = 682, /* Saudi Arabia */
890
+ CTRY_SINGAPORE = 702, /* Singapore */
891
+ CTRY_SLOVAKIA = 703, /* Slovak Republic */
892
+ CTRY_SLOVENIA = 705, /* Slovenia */
893
+ CTRY_SOUTH_AFRICA = 710, /* South Africa */
894
+ CTRY_SPAIN = 724, /* Spain */
895
+ CTRY_SWEDEN = 752, /* Sweden */
896
+ CTRY_SWITZERLAND = 756, /* Switzerland */
897
+ CTRY_SYRIA = 760, /* Syria */
898
+ CTRY_TAIWAN = 158, /* Taiwan */
899
+ CTRY_THAILAND = 764, /* Thailand */
900
+ CTRY_TRINIDAD_Y_TOBAGO = 780, /* Trinidad y Tobago */
901
+ CTRY_TUNISIA = 788, /* Tunisia */
902
+ CTRY_TURKEY = 792, /* Turkey */
903
+ CTRY_UAE = 784, /* U.A.E. */
904
+ CTRY_UKRAINE = 804, /* Ukraine */
905
+ CTRY_UNITED_KINGDOM = 826, /* United Kingdom */
906
+ CTRY_UNITED_STATES = 840, /* United States */
907
+ CTRY_UNITED_STATES_FCC49 = 842, /* United States (Public Safety)*/
908
+ CTRY_URUGUAY = 858, /* Uruguay */
909
+ CTRY_UZBEKISTAN = 860, /* Uzbekistan */
910
+ CTRY_VENEZUELA = 862, /* Venezuela */
911
+ CTRY_VIET_NAM = 704, /* Viet Nam */
912
+ CTRY_YEMEN = 887, /* Yemen */
913
+ CTRY_ZIMBABWE = 716 /* Zimbabwe */
917
+ * Country information element.
919
+#define IEEE80211_COUNTRY_MAX_TRIPLETS (83)
920
+struct ieee80211_ie_country {
921
+ u_int8_t country_id;
922
+ u_int8_t country_len;
923
+ u_int8_t country_str[3];
924
+ u_int8_t country_triplet[IEEE80211_COUNTRY_MAX_TRIPLETS * 3];
927
+/* does frame have QoS sequence control data */
928
+#define IEEE80211_QOS_HAS_SEQ(wh) \
929
+ (((wh)->i_fc[0] & \
930
+ (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_QOS)) == \
931
+ (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS))
933
+#define WME_QOSINFO_COUNT 0x0f /* Mask for Param Set Count field */
935
+ * WME/802.11e information element.
937
+struct ieee80211_ie_wme {
938
+ u_int8_t wme_id; /* IEEE80211_ELEMID_VENDOR */
939
+ u_int8_t wme_len; /* length in bytes */
940
+ u_int8_t wme_oui[3]; /* 0x00, 0x50, 0xf2 */
941
+ u_int8_t wme_type; /* OUI type */
942
+ u_int8_t wme_subtype; /* OUI subtype */
943
+ u_int8_t wme_version; /* spec revision */
944
+ u_int8_t wme_info; /* QoS info */
948
+ * WME/802.11e Tspec Element
950
+struct ieee80211_wme_tspec {
953
+ u_int8_t ts_oui[3];
954
+ u_int8_t ts_oui_type;
955
+ u_int8_t ts_oui_subtype;
956
+ u_int8_t ts_version;
957
+ u_int8_t ts_tsinfo[3];
958
+ u_int8_t ts_nom_msdu[2];
959
+ u_int8_t ts_max_msdu[2];
960
+ u_int8_t ts_min_svc[4];
961
+ u_int8_t ts_max_svc[4];
962
+ u_int8_t ts_inactv_intv[4];
963
+ u_int8_t ts_susp_intv[4];
964
+ u_int8_t ts_start_svc[4];
965
+ u_int8_t ts_min_rate[4];
966
+ u_int8_t ts_mean_rate[4];
967
+ u_int8_t ts_max_burst[4];
968
+ u_int8_t ts_min_phy[4];
969
+ u_int8_t ts_peak_rate[4];
970
+ u_int8_t ts_delay[4];
971
+ u_int8_t ts_surplus[2];
972
+ u_int8_t ts_medium_time[2];
976
+ * WME AC parameter field
979
+struct ieee80211_wme_acparams {
980
+ u_int8_t acp_aci_aifsn;
981
+ u_int8_t acp_logcwminmax;
982
+ u_int16_t acp_txop;
985
+#define IEEE80211_WME_PARAM_LEN 24
986
+#define WME_NUM_AC 4 /* 4 AC categories */
988
+#define WME_PARAM_ACI 0x60 /* Mask for ACI field */
989
+#define WME_PARAM_ACI_S 5 /* Shift for ACI field */
990
+#define WME_PARAM_ACM 0x10 /* Mask for ACM bit */
991
+#define WME_PARAM_ACM_S 4 /* Shift for ACM bit */
992
+#define WME_PARAM_AIFSN 0x0f /* Mask for aifsn field */
993
+#define WME_PARAM_AIFSN_S 0 /* Shift for aifsn field */
994
+#define WME_PARAM_LOGCWMIN 0x0f /* Mask for CwMin field (in log) */
995
+#define WME_PARAM_LOGCWMIN_S 0 /* Shift for CwMin field */
996
+#define WME_PARAM_LOGCWMAX 0xf0 /* Mask for CwMax field (in log) */
997
+#define WME_PARAM_LOGCWMAX_S 4 /* Shift for CwMax field */
999
+#define WME_AC_TO_TID(_ac) ( \
1000
+ ((_ac) == WME_AC_VO) ? 6 : \
1001
+ ((_ac) == WME_AC_VI) ? 5 : \
1002
+ ((_ac) == WME_AC_BK) ? 1 : \
1005
+#define TID_TO_WME_AC(_tid) ( \
1006
+ ((_tid) < 1) ? WME_AC_BE : \
1007
+ ((_tid) < 3) ? WME_AC_BK : \
1008
+ ((_tid) < 6) ? WME_AC_VI : \
1012
+ * WME Parameter Element
1015
+struct ieee80211_wme_param {
1016
+ u_int8_t param_id;
1017
+ u_int8_t param_len;
1018
+ u_int8_t param_oui[3];
1019
+ u_int8_t param_oui_type;
1020
+ u_int8_t param_oui_sybtype;
1021
+ u_int8_t param_version;
1022
+ u_int8_t param_qosInfo;
1023
+ u_int8_t param_reserved;
1024
+ struct ieee80211_wme_acparams params_acParams[WME_NUM_AC];
1028
+ * WME U-APSD qos info field defines
1030
+#define WME_CAPINFO_UAPSD_EN 0x00000080
1031
+#define WME_CAPINFO_UAPSD_VO 0x00000001
1032
+#define WME_CAPINFO_UAPSD_VI 0x00000002
1033
+#define WME_CAPINFO_UAPSD_BK 0x00000004
1034
+#define WME_CAPINFO_UAPSD_BE 0x00000008
1035
+#define WME_CAPINFO_UAPSD_ACFLAGS_SHIFT 0
1036
+#define WME_CAPINFO_UAPSD_ACFLAGS_MASK 0xF
1037
+#define WME_CAPINFO_UAPSD_MAXSP_SHIFT 5
1038
+#define WME_CAPINFO_UAPSD_MAXSP_MASK 0x3
1039
+#define WME_CAPINFO_IE_OFFSET 8
1040
+#define WME_UAPSD_MAXSP(_qosinfo) (((_qosinfo) >> WME_CAPINFO_UAPSD_MAXSP_SHIFT) & WME_CAPINFO_UAPSD_MAXSP_MASK)
1041
+#define WME_UAPSD_AC_ENABLED(_ac, _qosinfo) ( (1<<(3 - (_ac))) & \
1042
+ (((_qosinfo) >> WME_CAPINFO_UAPSD_ACFLAGS_SHIFT) & WME_CAPINFO_UAPSD_ACFLAGS_MASK) )
1045
+ * Atheros Advanced Capability information element.
1047
+struct ieee80211_ie_athAdvCap {
1048
+ u_int8_t athAdvCap_id; /* IEEE80211_ELEMID_VENDOR */
1049
+ u_int8_t athAdvCap_len; /* length in bytes */
1050
+ u_int8_t athAdvCap_oui[3]; /* 0x00, 0x03, 0x7f */
1051
+ u_int8_t athAdvCap_type; /* OUI type */
1052
+ u_int8_t athAdvCap_subtype; /* OUI subtype */
1053
+ u_int8_t athAdvCap_version; /* spec revision */
1054
+ u_int8_t athAdvCap_capability; /* Capability info */
1055
+ u_int16_t athAdvCap_defKeyIndex;
1059
+ * Atheros XR information element.
1061
+struct ieee80211_xr_param {
1062
+ u_int8_t param_id;
1063
+ u_int8_t param_len;
1064
+ u_int8_t param_oui[3];
1065
+ u_int8_t param_oui_type;
1066
+ u_int8_t param_oui_sybtype;
1067
+ u_int8_t param_version;
1068
+ u_int8_t param_Info;
1069
+ u_int8_t param_base_bssid[IEEE80211_ADDR_LEN];
1070
+ u_int8_t param_xr_bssid[IEEE80211_ADDR_LEN];
1071
+ u_int16_t param_xr_beacon_interval;
1072
+ u_int8_t param_base_ath_capability;
1073
+ u_int8_t param_xr_ath_capability;
1076
+/* Atheros capabilities */
1077
+#define IEEE80211_ATHC_TURBOP 0x0001 /* Turbo Prime */
1078
+#define IEEE80211_ATHC_COMP 0x0002 /* Compression */
1079
+#define IEEE80211_ATHC_FF 0x0004 /* Fast Frames */
1080
+#define IEEE80211_ATHC_XR 0x0008 /* Xtended Range support */
1081
+#define IEEE80211_ATHC_AR 0x0010 /* Advanced Radar support */
1082
+#define IEEE80211_ATHC_BURST 0x0020 /* Bursting - not negotiated */
1083
+#define IEEE80211_ATHC_WME 0x0040 /* CWMin tuning */
1084
+#define IEEE80211_ATHC_BOOST 0x0080 /* Boost */
1087
+ * Management Notification Frame
1089
+struct ieee80211_mnf {
1090
+ u_int8_t mnf_category;
1091
+ u_int8_t mnf_action;
1092
+ u_int8_t mnf_dialog;
1093
+ u_int8_t mnf_status;
1095
+#define MNF_SETUP_REQ 0
1096
+#define MNF_SETUP_RESP 1
1097
+#define MNF_TEARDOWN 2
1102
+struct ieee80211_frame_min {
1104
+ u_int8_t i_dur[2];
1105
+ u_int8_t i_addr1[IEEE80211_ADDR_LEN];
1106
+ u_int8_t i_addr2[IEEE80211_ADDR_LEN];
1110
+struct ieee80211_frame_rts {
1112
+ u_int8_t i_dur[2];
1113
+ u_int8_t i_ra[IEEE80211_ADDR_LEN];
1114
+ u_int8_t i_ta[IEEE80211_ADDR_LEN];
1118
+struct ieee80211_frame_cts {
1120
+ u_int8_t i_dur[2];
1121
+ u_int8_t i_ra[IEEE80211_ADDR_LEN];
1125
+struct ieee80211_frame_ack {
1127
+ u_int8_t i_dur[2];
1128
+ u_int8_t i_ra[IEEE80211_ADDR_LEN];
1132
+struct ieee80211_frame_pspoll {
1134
+ u_int8_t i_aid[2];
1135
+ u_int8_t i_bssid[IEEE80211_ADDR_LEN];
1136
+ u_int8_t i_ta[IEEE80211_ADDR_LEN];
1140
+struct ieee80211_frame_cfend { /* NB: also CF-End+CF-Ack */
1142
+ u_int8_t i_dur[2]; /* should be zero */
1143
+ u_int8_t i_ra[IEEE80211_ADDR_LEN];
1144
+ u_int8_t i_bssid[IEEE80211_ADDR_LEN];
1149
+ * BEACON management packets
1151
+ * octet timestamp[8]
1152
+ * octet beacon interval[2]
1153
+ * octet capability information[2]
1154
+ * information element
1157
+ * octet information[length]
1160
+typedef u_int8_t *ieee80211_mgt_beacon_t;
1162
+#define IEEE80211_BEACON_INTERVAL(beacon) \
1163
+ ((beacon)[8] | ((beacon)[9] << 8))
1164
+#define IEEE80211_BEACON_CAPABILITY(beacon) \
1165
+ ((beacon)[10] | ((beacon)[11] << 8))
1167
+#define IEEE80211_CAPINFO_ESS 0x0001
1168
+#define IEEE80211_CAPINFO_IBSS 0x0002
1169
+#define IEEE80211_CAPINFO_CF_POLLABLE 0x0004
1170
+#define IEEE80211_CAPINFO_CF_POLLREQ 0x0008
1171
+#define IEEE80211_CAPINFO_PRIVACY 0x0010
1172
+#define IEEE80211_CAPINFO_SHORT_PREAMBLE 0x0020
1173
+#define IEEE80211_CAPINFO_PBCC 0x0040
1174
+#define IEEE80211_CAPINFO_CHNL_AGILITY 0x0080
1175
+/* bits 8-9 are reserved (8 now for specturm management) */
1176
+#define IEEE80211_CAPINFO_SPECTRUM_MGMT 0x0100
1177
+#define IEEE80211_CAPINFO_SHORT_SLOTTIME 0x0400
1178
+#define IEEE80211_CAPINFO_RSN 0x0800
1179
+/* bit 12 is reserved */
1180
+#define IEEE80211_CAPINFO_DSSSOFDM 0x2000
1181
+/* bits 14-15 are reserved */
1184
+ * 802.11i/WPA information element (maximally sized).
1186
+struct ieee80211_ie_wpa {
1187
+ u_int8_t wpa_id; /* IEEE80211_ELEMID_VENDOR */
1188
+ u_int8_t wpa_len; /* length in bytes */
1189
+ u_int8_t wpa_oui[3]; /* 0x00, 0x50, 0xf2 */
1190
+ u_int8_t wpa_type; /* OUI type */
1191
+ u_int16_t wpa_version; /* spec revision */
1192
+ u_int32_t wpa_mcipher[1]; /* multicast/group key cipher */
1193
+ u_int16_t wpa_uciphercnt; /* # pairwise key ciphers */
1194
+ u_int32_t wpa_uciphers[8]; /* ciphers */
1195
+ u_int16_t wpa_authselcnt; /* authentication selector cnt*/
1196
+ u_int32_t wpa_authsels[8]; /* selectors */
1197
+ u_int16_t wpa_caps; /* 802.11i capabilities */
1198
+ u_int16_t wpa_pmkidcnt; /* 802.11i pmkid count */
1199
+ u_int16_t wpa_pmkids[8]; /* 802.11i pmkids */
1203
+ * Management information element payloads.
1207
+ IEEE80211_ELEMID_SSID = 0,
1208
+ IEEE80211_ELEMID_RATES = 1,
1209
+ IEEE80211_ELEMID_FHPARMS = 2,
1210
+ IEEE80211_ELEMID_DSPARMS = 3,
1211
+ IEEE80211_ELEMID_CFPARMS = 4,
1212
+ IEEE80211_ELEMID_TIM = 5,
1213
+ IEEE80211_ELEMID_IBSSPARMS = 6,
1214
+ IEEE80211_ELEMID_COUNTRY = 7,
1215
+ IEEE80211_ELEMID_REQINFO = 10,
1216
+ IEEE80211_ELEMID_CHALLENGE = 16,
1217
+ /* 17-31 reserved for challenge text extension */
1218
+ IEEE80211_ELEMID_PWRCNSTR = 32,
1219
+ IEEE80211_ELEMID_PWRCAP = 33,
1220
+ IEEE80211_ELEMID_TPCREQ = 34,
1221
+ IEEE80211_ELEMID_TPCREP = 35,
1222
+ IEEE80211_ELEMID_SUPPCHAN = 36,
1223
+ IEEE80211_ELEMID_CHANSWITCHANN = 37,
1224
+ IEEE80211_ELEMID_MEASREQ = 38,
1225
+ IEEE80211_ELEMID_MEASREP = 39,
1226
+ IEEE80211_ELEMID_QUIET = 40,
1227
+ IEEE80211_ELEMID_IBSSDFS = 41,
1228
+ IEEE80211_ELEMID_ERP = 42,
1229
+ IEEE80211_ELEMID_RSN = 48,
1230
+ IEEE80211_ELEMID_XRATES = 50,
1231
+ /* 128-129 proprietary elements used by Agere chipsets */
1232
+ IEEE80211_ELEMID_AGERE1 = 128,
1233
+ IEEE80211_ELEMID_AGERE2 = 129,
1234
+ IEEE80211_ELEMID_TPC = 150,
1235
+ IEEE80211_ELEMID_CCKM = 156,
1236
+ IEEE80211_ELEMID_VENDOR = 221, /* vendor private */
1239
+#define IEEE80211_CHANSWITCHANN_BYTES 5
1241
+struct ieee80211_tim_ie {
1242
+ u_int8_t tim_ie; /* IEEE80211_ELEMID_TIM */
1244
+ u_int8_t tim_count; /* DTIM count */
1245
+ u_int8_t tim_period; /* DTIM period */
1246
+ u_int8_t tim_bitctl; /* bitmap control */
1247
+ u_int8_t tim_bitmap[1]; /* variable-length bitmap */
1250
+struct ieee80211_country_ie {
1251
+ u_int8_t ie; /* IEEE80211_ELEMID_COUNTRY */
1253
+ u_int8_t cc[3]; /* ISO CC+(I)ndoor/(O)utdoor */
1255
+ u_int8_t schan; /* starting channel */
1256
+ u_int8_t nchan; /* number channels */
1257
+ u_int8_t maxtxpwr; /* tx power cap */
1258
+ } __packed band[4]; /* up to 4 sub bands */
1261
+#define IEEE80211_CHALLENGE_LEN 128
1263
+#define IEEE80211_SUPPCHAN_LEN 26
1265
+#define IEEE80211_RATE_BASIC 0x80
1266
+#define IEEE80211_RATE_VAL 0x7f
1268
+/* EPR information element flags */
1269
+#define IEEE80211_ERP_NON_ERP_PRESENT 0x01
1270
+#define IEEE80211_ERP_USE_PROTECTION 0x02
1271
+#define IEEE80211_ERP_LONG_PREAMBLE 0x04
1273
+/* Atheros private advanced capabilities info */
1274
+#define ATHEROS_CAP_TURBO_PRIME 0x01
1275
+#define ATHEROS_CAP_COMPRESSION 0x02
1276
+#define ATHEROS_CAP_FAST_FRAME 0x04
1277
+/* bits 3-6 reserved */
1278
+#define ATHEROS_CAP_BOOST 0x80
1280
+#define ATH_OUI 0x7f0300 /* Atheros OUI */
1281
+#define ATH_OUI_TYPE 0x01
1282
+#define ATH_OUI_SUBTYPE 0x01
1283
+#define ATH_OUI_VERSION 0x00
1284
+#define ATH_OUI_TYPE_XR 0x03
1285
+#define ATH_OUI_VER_XR 0x01
1287
+#define WPA_OUI 0xf25000
1288
+#define WPA_OUI_TYPE 0x01
1289
+#define WPA_VERSION 1 /* current supported version */
1291
+#define WPA_CSE_NULL 0x00
1292
+#define WPA_CSE_WEP40 0x01
1293
+#define WPA_CSE_TKIP 0x02
1294
+#define WPA_CSE_CCMP 0x04
1295
+#define WPA_CSE_WEP104 0x05
1297
+#define WPA_ASE_NONE 0x00
1298
+#define WPA_ASE_8021X_UNSPEC 0x01
1299
+#define WPA_ASE_8021X_PSK 0x02
1301
+#define RSN_OUI 0xac0f00
1302
+#define RSN_VERSION 1 /* current supported version */
1304
+#define RSN_CSE_NULL 0x00
1305
+#define RSN_CSE_WEP40 0x01
1306
+#define RSN_CSE_TKIP 0x02
1307
+#define RSN_CSE_WRAP 0x03
1308
+#define RSN_CSE_CCMP 0x04
1309
+#define RSN_CSE_WEP104 0x05
1311
+#define RSN_ASE_NONE 0x00
1312
+#define RSN_ASE_8021X_UNSPEC 0x01
1313
+#define RSN_ASE_8021X_PSK 0x02
1315
+#define RSN_CAP_PREAUTH 0x01
1317
+#define WME_OUI 0xf25000
1318
+#define WME_OUI_TYPE 0x02
1319
+#define WME_INFO_OUI_SUBTYPE 0x00
1320
+#define WME_PARAM_OUI_SUBTYPE 0x01
1321
+#define WME_VERSION 1
1323
+/* WME stream classes */
1324
+#define WME_AC_BE 0 /* best effort */
1325
+#define WME_AC_BK 1 /* background */
1326
+#define WME_AC_VI 2 /* video */
1327
+#define WME_AC_VO 3 /* voice */
1330
+ * AUTH management packets
1336
+ * octet chal.length
1337
+ * octet chal.text[253]
1340
+typedef u_int8_t *ieee80211_mgt_auth_t;
1342
+#define IEEE80211_AUTH_ALGORITHM(auth) \
1343
+ ((auth)[0] | ((auth)[1] << 8))
1344
+#define IEEE80211_AUTH_TRANSACTION(auth) \
1345
+ ((auth)[2] | ((auth)[3] << 8))
1346
+#define IEEE80211_AUTH_STATUS(auth) \
1347
+ ((auth)[4] | ((auth)[5] << 8))
1349
+#define IEEE80211_AUTH_ALG_OPEN 0x0000
1350
+#define IEEE80211_AUTH_ALG_SHARED 0x0001
1351
+#define IEEE80211_AUTH_ALG_LEAP 0x0080
1354
+ IEEE80211_AUTH_OPEN_REQUEST = 1,
1355
+ IEEE80211_AUTH_OPEN_RESPONSE = 2,
1359
+ IEEE80211_AUTH_SHARED_REQUEST = 1,
1360
+ IEEE80211_AUTH_SHARED_CHALLENGE = 2,
1361
+ IEEE80211_AUTH_SHARED_RESPONSE = 3,
1362
+ IEEE80211_AUTH_SHARED_PASS = 4,
1368
+ * Unlisted codes are reserved
1372
+ IEEE80211_REASON_UNSPECIFIED = 1,
1373
+ IEEE80211_REASON_AUTH_EXPIRE = 2,
1374
+ IEEE80211_REASON_AUTH_LEAVE = 3,
1375
+ IEEE80211_REASON_ASSOC_EXPIRE = 4,
1376
+ IEEE80211_REASON_ASSOC_TOOMANY = 5,
1377
+ IEEE80211_REASON_NOT_AUTHED = 6,
1378
+ IEEE80211_REASON_NOT_ASSOCED = 7,
1379
+ IEEE80211_REASON_ASSOC_LEAVE = 8,
1380
+ IEEE80211_REASON_ASSOC_NOT_AUTHED = 9,
1382
+ IEEE80211_REASON_RSN_REQUIRED = 11,
1383
+ IEEE80211_REASON_RSN_INCONSISTENT = 12,
1384
+ IEEE80211_REASON_IE_INVALID = 13,
1385
+ IEEE80211_REASON_MIC_FAILURE = 14,
1387
+ IEEE80211_STATUS_SUCCESS = 0,
1388
+ IEEE80211_STATUS_UNSPECIFIED = 1,
1389
+ IEEE80211_STATUS_CAPINFO = 10,
1390
+ IEEE80211_STATUS_NOT_ASSOCED = 11,
1391
+ IEEE80211_STATUS_OTHER = 12,
1392
+ IEEE80211_STATUS_ALG = 13,
1393
+ IEEE80211_STATUS_SEQUENCE = 14,
1394
+ IEEE80211_STATUS_CHALLENGE = 15,
1395
+ IEEE80211_STATUS_TIMEOUT = 16,
1396
+ IEEE80211_STATUS_TOOMANY = 17,
1397
+ IEEE80211_STATUS_BASIC_RATE = 18,
1398
+ IEEE80211_STATUS_SP_REQUIRED = 19,
1399
+ IEEE80211_STATUS_PBCC_REQUIRED = 20,
1400
+ IEEE80211_STATUS_CA_REQUIRED = 21,
1401
+ IEEE80211_STATUS_TOO_MANY_STATIONS = 22,
1402
+ IEEE80211_STATUS_RATES = 23,
1403
+ IEEE80211_STATUS_SHORTSLOT_REQUIRED = 25,
1404
+ IEEE80211_STATUS_DSSSOFDM_REQUIRED = 26,
1407
+#define IEEE80211_WEP_KEYLEN 5 /* 40bit */
1408
+#define IEEE80211_WEP_IVLEN 3 /* 24bit */
1409
+#define IEEE80211_WEP_KIDLEN 1 /* 1 octet */
1410
+#define IEEE80211_WEP_CRCLEN 4 /* CRC-32 */
1411
+#define IEEE80211_WEP_NKID 4 /* number of key ids */
1414
+ * 802.11i defines an extended IV for use with non-WEP ciphers.
1415
+ * When the EXTIV bit is set in the key id byte an additional
1416
+ * 4 bytes immediately follow the IV for TKIP. For CCMP the
1417
+ * EXTIV bit is likewise set but the 8 bytes represent the
1418
+ * CCMP header rather than IV+extended-IV.
1420
+#define IEEE80211_WEP_EXTIV 0x20
1421
+#define IEEE80211_WEP_EXTIVLEN 4 /* extended IV length */
1422
+#define IEEE80211_WEP_MICLEN 8 /* trailing MIC */
1424
+#define IEEE80211_CRC_LEN 4
1427
+ * Maximum acceptable MTU is:
1428
+ * IEEE80211_MAX_LEN - WEP overhead - CRC -
1429
+ * QoS overhead - RSN/WPA overhead
1430
+ * Min is arbitrarily chosen > IEEE80211_MIN_LEN. The default
1431
+ * mtu is Ethernet-compatible; it's set by ether_ifattach.
1433
+#define IEEE80211_MTU_MAX 2290
1434
+#define IEEE80211_MTU_MIN 32
1436
+#define IEEE80211_MAX_LEN (2300 + IEEE80211_CRC_LEN + \
1437
+ (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN))
1438
+#define IEEE80211_ACK_LEN \
1439
+ (sizeof(struct ieee80211_frame_ack) + IEEE80211_CRC_LEN)
1440
+#define IEEE80211_MIN_LEN \
1441
+ (sizeof(struct ieee80211_frame_min) + IEEE80211_CRC_LEN)
1444
+ * The 802.11 spec says at most 2007 stations may be
1445
+ * associated at once. For most AP's this is way more
1446
+ * than is feasible so we use a default of 128. This
1447
+ * number may be overridden by the driver and/or by
1448
+ * user configuration.
1450
+#define IEEE80211_AID_MAX 2007
1451
+#define IEEE80211_AID_DEF 128
1453
+#define IEEE80211_AID(b) ((b) &~ 0xc000)
1456
+ * RTS frame length parameters. The default is specified in
1457
+ * the 802.11 spec. The max may be wrong for jumbo frames.
1459
+#define IEEE80211_RTS_DEFAULT 512
1460
+#define IEEE80211_RTS_MIN 1
1461
+#define IEEE80211_RTS_MAX 2346
1464
+ * Regulatory extention identifier for country IE.
1466
+#define IEEE80211_REG_EXT_ID 201
1469
+ * IEEE 802.11 timer synchronization function (TSF) timestamp length
1471
+#define IEEE80211_TSF_LEN 8
1473
+#endif /* _NET80211_IEEE80211_H_ */
1474
diff -Nrup wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_ioctl.h wpa_supplicant/driver_madwifi/net80211/ieee80211_ioctl.h
1475
--- wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_ioctl.h 1970-01-01 10:00:00.000000000 +1000
1476
+++ wpa_supplicant/driver_madwifi/net80211/ieee80211_ioctl.h 2006-07-06 17:18:12.000000000 +1000
1479
+ * Copyright (c) 2001 Atsushi Onoe
1480
+ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
1481
+ * All rights reserved.
1483
+ * Redistribution and use in source and binary forms, with or without
1484
+ * modification, are permitted provided that the following conditions
1486
+ * 1. Redistributions of source code must retain the above copyright
1487
+ * notice, this list of conditions and the following disclaimer.
1488
+ * 2. Redistributions in binary form must reproduce the above copyright
1489
+ * notice, this list of conditions and the following disclaimer in the
1490
+ * documentation and/or other materials provided with the distribution.
1491
+ * 3. The name of the author may not be used to endorse or promote products
1492
+ * derived from this software without specific prior written permission.
1494
+ * Alternatively, this software may be distributed under the terms of the
1495
+ * GNU General Public License ("GPL") version 2 as published by the Free
1496
+ * Software Foundation.
1498
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1499
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1500
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1501
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1502
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1503
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1504
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1505
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1506
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1507
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1509
+ * $Id: ieee80211_ioctl.h 1676 2006-07-06 03:23:08Z brian $
1511
+#ifndef _NET80211_IEEE80211_IOCTL_H_
1512
+#define _NET80211_IEEE80211_IOCTL_H_
1515
+ * IEEE 802.11 ioctls.
1517
+#include <net80211/_ieee80211.h>
1518
+#include <net80211/ieee80211.h>
1519
+#include <net80211/ieee80211_crypto.h>
1522
+ * Per/node (station) statistics available when operating as an AP.
1524
+struct ieee80211_nodestats {
1525
+ u_int32_t ns_rx_data; /* rx data frames */
1526
+ u_int32_t ns_rx_mgmt; /* rx management frames */
1527
+ u_int32_t ns_rx_ctrl; /* rx control frames */
1528
+ u_int32_t ns_rx_ucast; /* rx unicast frames */
1529
+ u_int32_t ns_rx_mcast; /* rx multi/broadcast frames */
1530
+ u_int64_t ns_rx_bytes; /* rx data count (bytes) */
1531
+ u_int64_t ns_rx_beacons; /* rx beacon frames */
1532
+ u_int32_t ns_rx_proberesp; /* rx probe response frames */
1534
+ u_int32_t ns_rx_dup; /* rx discard because it's a dup */
1535
+ u_int32_t ns_rx_noprivacy; /* rx w/ wep but privacy off */
1536
+ u_int32_t ns_rx_wepfail; /* rx wep processing failed */
1537
+ u_int32_t ns_rx_demicfail; /* rx demic failed */
1538
+ u_int32_t ns_rx_decap; /* rx decapsulation failed */
1539
+ u_int32_t ns_rx_defrag; /* rx defragmentation failed */
1540
+ u_int32_t ns_rx_disassoc; /* rx disassociation */
1541
+ u_int32_t ns_rx_deauth; /* rx deauthentication */
1542
+ u_int32_t ns_rx_decryptcrc; /* rx decrypt failed on crc */
1543
+ u_int32_t ns_rx_unauth; /* rx on unauthorized port */
1544
+ u_int32_t ns_rx_unencrypted; /* rx unecrypted w/ privacy */
1546
+ u_int32_t ns_tx_data; /* tx data frames */
1547
+ u_int32_t ns_tx_mgmt; /* tx management frames */
1548
+ u_int32_t ns_tx_ucast; /* tx unicast frames */
1549
+ u_int32_t ns_tx_mcast; /* tx multi/broadcast frames */
1550
+ u_int64_t ns_tx_bytes; /* tx data count (bytes) */
1551
+ u_int32_t ns_tx_probereq; /* tx probe request frames */
1552
+ u_int32_t ns_tx_uapsd; /* tx on uapsd queue */
1554
+ u_int32_t ns_tx_novlantag; /* tx discard due to no tag */
1555
+ u_int32_t ns_tx_vlanmismatch; /* tx discard due to of bad tag */
1557
+ u_int32_t ns_tx_eosplost; /* uapsd EOSP retried out */
1559
+ u_int32_t ns_ps_discard; /* ps discard due to of age */
1561
+ u_int32_t ns_uapsd_triggers; /* uapsd triggers */
1563
+ /* MIB-related state */
1564
+ u_int32_t ns_tx_assoc; /* [re]associations */
1565
+ u_int32_t ns_tx_assoc_fail; /* [re]association failures */
1566
+ u_int32_t ns_tx_auth; /* [re]authentications */
1567
+ u_int32_t ns_tx_auth_fail; /* [re]authentication failures*/
1568
+ u_int32_t ns_tx_deauth; /* deauthentications */
1569
+ u_int32_t ns_tx_deauth_code; /* last deauth reason */
1570
+ u_int32_t ns_tx_disassoc; /* disassociations */
1571
+ u_int32_t ns_tx_disassoc_code; /* last disassociation reason */
1572
+ u_int32_t ns_psq_drops; /* power save queue drops */
1576
+ * Summary statistics.
1578
+struct ieee80211_stats {
1579
+ u_int32_t is_rx_badversion; /* rx frame with bad version */
1580
+ u_int32_t is_rx_tooshort; /* rx frame too short */
1581
+ u_int32_t is_rx_wrongbss; /* rx from wrong bssid */
1582
+ u_int32_t is_rx_dup; /* rx discard due to it's a dup */
1583
+ u_int32_t is_rx_wrongdir; /* rx w/ wrong direction */
1584
+ u_int32_t is_rx_mcastecho; /* rx discard due to of mcast echo */
1585
+ u_int32_t is_rx_notassoc; /* rx discard due to sta !assoc */
1586
+ u_int32_t is_rx_noprivacy; /* rx w/ wep but privacy off */
1587
+ u_int32_t is_rx_unencrypted; /* rx w/o wep and privacy on */
1588
+ u_int32_t is_rx_wepfail; /* rx wep processing failed */
1589
+ u_int32_t is_rx_decap; /* rx decapsulation failed */
1590
+ u_int32_t is_rx_mgtdiscard; /* rx discard mgt frames */
1591
+ u_int32_t is_rx_ctl; /* rx discard ctrl frames */
1592
+ u_int32_t is_rx_beacon; /* rx beacon frames */
1593
+ u_int32_t is_rx_rstoobig; /* rx rate set truncated */
1594
+ u_int32_t is_rx_elem_missing; /* rx required element missing*/
1595
+ u_int32_t is_rx_elem_toobig; /* rx element too big */
1596
+ u_int32_t is_rx_elem_toosmall; /* rx element too small */
1597
+ u_int32_t is_rx_elem_unknown; /* rx element unknown */
1598
+ u_int32_t is_rx_badchan; /* rx frame w/ invalid chan */
1599
+ u_int32_t is_rx_chanmismatch; /* rx frame chan mismatch */
1600
+ u_int32_t is_rx_nodealloc; /* rx frame dropped */
1601
+ u_int32_t is_rx_ssidmismatch; /* rx frame ssid mismatch */
1602
+ u_int32_t is_rx_auth_unsupported;/* rx w/ unsupported auth alg */
1603
+ u_int32_t is_rx_auth_fail; /* rx sta auth failure */
1604
+ u_int32_t is_rx_auth_countermeasures;/* rx auth discard due to CM */
1605
+ u_int32_t is_rx_assoc_bss; /* rx assoc from wrong bssid */
1606
+ u_int32_t is_rx_assoc_notauth; /* rx assoc w/o auth */
1607
+ u_int32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */
1608
+ u_int32_t is_rx_assoc_norate; /* rx assoc w/ no rate match */
1609
+ u_int32_t is_rx_assoc_badwpaie; /* rx assoc w/ bad WPA IE */
1610
+ u_int32_t is_rx_deauth; /* rx deauthentication */
1611
+ u_int32_t is_rx_disassoc; /* rx disassociation */
1612
+ u_int32_t is_rx_badsubtype; /* rx frame w/ unknown subtype*/
1613
+ u_int32_t is_rx_nobuf; /* rx failed for lack of buf */
1614
+ u_int32_t is_rx_decryptcrc; /* rx decrypt failed on crc */
1615
+ u_int32_t is_rx_ahdemo_mgt; /* rx discard ahdemo mgt frame*/
1616
+ u_int32_t is_rx_bad_auth; /* rx bad auth request */
1617
+ u_int32_t is_rx_unauth; /* rx on unauthorized port */
1618
+ u_int32_t is_rx_badkeyid; /* rx w/ incorrect keyid */
1619
+ u_int32_t is_rx_ccmpreplay; /* rx seq# violation (CCMP) */
1620
+ u_int32_t is_rx_ccmpformat; /* rx format bad (CCMP) */
1621
+ u_int32_t is_rx_ccmpmic; /* rx MIC check failed (CCMP) */
1622
+ u_int32_t is_rx_tkipreplay; /* rx seq# violation (TKIP) */
1623
+ u_int32_t is_rx_tkipformat; /* rx format bad (TKIP) */
1624
+ u_int32_t is_rx_tkipmic; /* rx MIC check failed (TKIP) */
1625
+ u_int32_t is_rx_tkipicv; /* rx ICV check failed (TKIP) */
1626
+ u_int32_t is_rx_badcipher; /* rx failed due to of key type */
1627
+ u_int32_t is_rx_nocipherctx; /* rx failed due to key !setup */
1628
+ u_int32_t is_rx_acl; /* rx discard due to of acl policy */
1629
+ u_int32_t is_rx_ffcnt; /* rx fast frames */
1630
+ u_int32_t is_rx_badathtnl; /* driver key alloc failed */
1631
+ u_int32_t is_tx_nobuf; /* tx failed for lack of buf */
1632
+ u_int32_t is_tx_nonode; /* tx failed for no node */
1633
+ u_int32_t is_tx_unknownmgt; /* tx of unknown mgt frame */
1634
+ u_int32_t is_tx_badcipher; /* tx failed due to of key type */
1635
+ u_int32_t is_tx_nodefkey; /* tx failed due to no defkey */
1636
+ u_int32_t is_tx_noheadroom; /* tx failed due to no space */
1637
+ u_int32_t is_tx_ffokcnt; /* tx fast frames sent success */
1638
+ u_int32_t is_tx_fferrcnt; /* tx fast frames sent success */
1639
+ u_int32_t is_scan_active; /* active scans started */
1640
+ u_int32_t is_scan_passive; /* passive scans started */
1641
+ u_int32_t is_node_timeout; /* nodes timed out inactivity */
1642
+ u_int32_t is_crypto_nomem; /* no memory for crypto ctx */
1643
+ u_int32_t is_crypto_tkip; /* tkip crypto done in s/w */
1644
+ u_int32_t is_crypto_tkipenmic; /* tkip en-MIC done in s/w */
1645
+ u_int32_t is_crypto_tkipdemic; /* tkip de-MIC done in s/w */
1646
+ u_int32_t is_crypto_tkipcm; /* tkip counter measures */
1647
+ u_int32_t is_crypto_ccmp; /* ccmp crypto done in s/w */
1648
+ u_int32_t is_crypto_wep; /* wep crypto done in s/w */
1649
+ u_int32_t is_crypto_setkey_cipher;/* cipher rejected key */
1650
+ u_int32_t is_crypto_setkey_nokey;/* no key index for setkey */
1651
+ u_int32_t is_crypto_delkey; /* driver key delete failed */
1652
+ u_int32_t is_crypto_badcipher; /* unknown cipher */
1653
+ u_int32_t is_crypto_nocipher; /* cipher not available */
1654
+ u_int32_t is_crypto_attachfail; /* cipher attach failed */
1655
+ u_int32_t is_crypto_swfallback; /* cipher fallback to s/w */
1656
+ u_int32_t is_crypto_keyfail; /* driver key alloc failed */
1657
+ u_int32_t is_crypto_enmicfail; /* en-MIC failed */
1658
+ u_int32_t is_ibss_capmismatch; /* merge failed-cap mismatch */
1659
+ u_int32_t is_ibss_norate; /* merge failed-rate mismatch */
1660
+ u_int32_t is_ps_unassoc; /* ps-poll for unassoc. sta */
1661
+ u_int32_t is_ps_badaid; /* ps-poll w/ incorrect aid */
1662
+ u_int32_t is_ps_qempty; /* ps-poll w/ nothing to send */
1666
+ * Max size of optional information elements. We artificially
1667
+ * constrain this; it's limited only by the max frame size (and
1668
+ * the max parameter size of the wireless extensions).
1670
+#define IEEE80211_MAX_OPT_IE 256
1673
+ * WPA/RSN get/set key request. Specify the key/cipher
1674
+ * type and whether the key is to be used for sending and/or
1675
+ * receiving. The key index should be set only when working
1676
+ * with global keys (use IEEE80211_KEYIX_NONE for ``no index'').
1677
+ * Otherwise a unicast/pairwise key is specified by the bssid
1678
+ * (on a station) or mac address (on an ap). They key length
1679
+ * must include any MIC key data; otherwise it should be no
1680
+ more than IEEE80211_KEYBUF_SIZE.
1682
+struct ieee80211req_key {
1683
+ u_int8_t ik_type; /* key/cipher type */
1685
+ u_int16_t ik_keyix; /* key index */
1686
+ u_int8_t ik_keylen; /* key length in bytes */
1687
+ u_int8_t ik_flags;
1688
+/* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */
1689
+#define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */
1690
+ u_int8_t ik_macaddr[IEEE80211_ADDR_LEN];
1691
+ u_int64_t ik_keyrsc; /* key receive sequence counter */
1692
+ u_int64_t ik_keytsc; /* key transmit sequence counter */
1693
+ u_int8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
1697
+ * Delete a key either by index or address. Set the index
1698
+ * to IEEE80211_KEYIX_NONE when deleting a unicast key.
1700
+struct ieee80211req_del_key {
1701
+ u_int8_t idk_keyix; /* key index */
1702
+ u_int8_t idk_macaddr[IEEE80211_ADDR_LEN];
1706
+ * MLME state manipulation request. IEEE80211_MLME_ASSOC
1707
+ * only makes sense when operating as a station. The other
1708
+ * requests can be used when operating as a station or an
1709
+ * ap (to effect a station).
1711
+struct ieee80211req_mlme {
1712
+ u_int8_t im_op; /* operation to perform */
1713
+#define IEEE80211_MLME_ASSOC 1 /* associate station */
1714
+#define IEEE80211_MLME_DISASSOC 2 /* disassociate station */
1715
+#define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */
1716
+#define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */
1717
+#define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */
1718
+#define IEEE80211_MLME_CLEAR_STATS 6 /* clear station statistic */
1719
+ u_int8_t im_ssid_len; /* length of optional ssid */
1720
+ u_int16_t im_reason; /* 802.11 reason code */
1721
+ u_int8_t im_macaddr[IEEE80211_ADDR_LEN];
1722
+ u_int8_t im_ssid[IEEE80211_NWID_LEN];
1726
+ * MAC ACL operations.
1729
+ IEEE80211_MACCMD_POLICY_OPEN = 0, /* set policy: no ACL's */
1730
+ IEEE80211_MACCMD_POLICY_ALLOW = 1, /* set policy: allow traffic */
1731
+ IEEE80211_MACCMD_POLICY_DENY = 2, /* set policy: deny traffic */
1732
+ IEEE80211_MACCMD_FLUSH = 3, /* flush ACL database */
1733
+ IEEE80211_MACCMD_DETACH = 4, /* detach ACL policy */
1737
+ * Set the active channel list. Note this list is
1738
+ * intersected with the available channel list in
1739
+ * calculating the set of channels actually used in
1742
+struct ieee80211req_chanlist {
1743
+ u_int8_t ic_channels[IEEE80211_CHAN_BYTES];
1747
+ * Get the active channel list info.
1749
+struct ieee80211req_chaninfo {
1751
+ struct ieee80211_channel ic_chans[IEEE80211_CHAN_MAX];
1755
+ * Retrieve the WPA/RSN information element for an associated station.
1757
+struct ieee80211req_wpaie {
1758
+ u_int8_t wpa_macaddr[IEEE80211_ADDR_LEN];
1759
+ u_int8_t wpa_ie[IEEE80211_MAX_OPT_IE];
1760
+ u_int8_t rsn_ie[IEEE80211_MAX_OPT_IE];
1764
+ * Retrieve per-node statistics.
1766
+struct ieee80211req_sta_stats {
1768
+ /* NB: explicitly force 64-bit alignment */
1769
+ u_int8_t macaddr[IEEE80211_ADDR_LEN];
1772
+ struct ieee80211_nodestats is_stats;
1776
+ * Station information block; the mac address is used
1777
+ * to retrieve other data like stats, unicast key, etc.
1779
+struct ieee80211req_sta_info {
1780
+ u_int16_t isi_len; /* length (mult of 4) */
1781
+ u_int16_t isi_freq; /* MHz */
1782
+ u_int16_t isi_flags; /* channel flags */
1783
+ u_int16_t isi_state; /* state flags */
1784
+ u_int8_t isi_authmode; /* authentication algorithm */
1785
+ u_int8_t isi_rssi;
1786
+ u_int16_t isi_capinfo; /* capabilities */
1787
+ u_int8_t isi_athflags; /* Atheros capabilities */
1788
+ u_int8_t isi_erp; /* ERP element */
1789
+ u_int8_t isi_macaddr[IEEE80211_ADDR_LEN];
1790
+ u_int8_t isi_nrates; /* negotiated rates */
1791
+ u_int8_t isi_rates[IEEE80211_RATE_MAXSIZE];
1792
+ u_int8_t isi_txrate; /* index to isi_rates[] */
1793
+ u_int16_t isi_ie_len; /* IE length */
1794
+ u_int16_t isi_associd; /* assoc response */
1795
+ u_int16_t isi_txpower; /* current tx power */
1796
+ u_int16_t isi_vlan; /* vlan tag */
1797
+ u_int16_t isi_txseqs[17]; /* seq to be transmitted */
1798
+ u_int16_t isi_rxseqs[17]; /* seq previous for qos frames*/
1799
+ u_int16_t isi_inact; /* inactivity timer */
1800
+ u_int8_t isi_uapsd; /* UAPSD queues */
1801
+ u_int8_t isi_opmode; /* sta operating mode */
1803
+ /* XXX frag state? */
1804
+ /* variable length IE data */
1808
+ IEEE80211_STA_OPMODE_NORMAL,
1809
+ IEEE80211_STA_OPMODE_XR
1813
+ * Retrieve per-station information; to retrieve all
1814
+ * specify a mac address of ff:ff:ff:ff:ff:ff.
1816
+struct ieee80211req_sta_req {
1818
+ /* NB: explicitly force 64-bit alignment */
1819
+ u_int8_t macaddr[IEEE80211_ADDR_LEN];
1822
+ struct ieee80211req_sta_info info[1]; /* variable length */
1826
+ * Get/set per-station tx power cap.
1828
+struct ieee80211req_sta_txpow {
1829
+ u_int8_t it_macaddr[IEEE80211_ADDR_LEN];
1830
+ u_int8_t it_txpow;
1834
+ * WME parameters are set and return using i_val and i_len.
1835
+ * i_val holds the value itself. i_len specifies the AC
1836
+ * and, as appropriate, then high bit specifies whether the
1837
+ * operation is to be applied to the BSS or ourself.
1839
+#define IEEE80211_WMEPARAM_SELF 0x0000 /* parameter applies to self */
1840
+#define IEEE80211_WMEPARAM_BSS 0x8000 /* parameter applies to BSS */
1841
+#define IEEE80211_WMEPARAM_VAL 0x7fff /* parameter value */
1844
+ * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
1846
+struct ieee80211req_scan_result {
1847
+ u_int16_t isr_len; /* length (mult of 4) */
1848
+ u_int16_t isr_freq; /* MHz */
1849
+ u_int16_t isr_flags; /* channel flags */
1850
+ u_int8_t isr_noise;
1851
+ u_int8_t isr_rssi;
1852
+ u_int8_t isr_intval; /* beacon interval */
1853
+ u_int16_t isr_capinfo; /* capabilities */
1854
+ u_int8_t isr_erp; /* ERP element */
1855
+ u_int8_t isr_bssid[IEEE80211_ADDR_LEN];
1856
+ u_int8_t isr_nrates;
1857
+ u_int8_t isr_rates[IEEE80211_RATE_MAXSIZE];
1858
+ u_int8_t isr_ssid_len; /* SSID length */
1859
+ u_int8_t isr_ie_len; /* IE length */
1860
+ u_int8_t isr_pad[5];
1861
+ /* variable length SSID followed by IE data */
1866
+ * FreeBSD-style ioctls.
1868
+/* the first member must be matched with struct ifreq */
1869
+struct ieee80211req {
1870
+ char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
1871
+ u_int16_t i_type; /* req type */
1872
+ int16_t i_val; /* Index or simple value */
1873
+ int16_t i_len; /* Index or simple value */
1874
+ void *i_data; /* Extra data */
1876
+#define SIOCS80211 _IOW('i', 234, struct ieee80211req)
1877
+#define SIOCG80211 _IOWR('i', 235, struct ieee80211req)
1878
+#define SIOCG80211STATS _IOWR('i', 236, struct ifreq)
1879
+#define SIOC80211IFCREATE _IOWR('i', 237, struct ifreq)
1880
+#define SIOC80211IFDESTROY _IOW('i', 238, struct ifreq)
1882
+#define IEEE80211_IOC_SSID 1
1883
+#define IEEE80211_IOC_NUMSSIDS 2
1884
+#define IEEE80211_IOC_WEP 3
1885
+#define IEEE80211_WEP_NOSUP -1
1886
+#define IEEE80211_WEP_OFF 0
1887
+#define IEEE80211_WEP_ON 1
1888
+#define IEEE80211_WEP_MIXED 2
1889
+#define IEEE80211_IOC_WEPKEY 4
1890
+#define IEEE80211_IOC_NUMWEPKEYS 5
1891
+#define IEEE80211_IOC_WEPTXKEY 6
1892
+#define IEEE80211_IOC_AUTHMODE 7
1893
+#define IEEE80211_IOC_STATIONNAME 8
1894
+#define IEEE80211_IOC_CHANNEL 9
1895
+#define IEEE80211_IOC_POWERSAVE 10
1896
+#define IEEE80211_POWERSAVE_NOSUP -1
1897
+#define IEEE80211_POWERSAVE_OFF 0
1898
+#define IEEE80211_POWERSAVE_CAM 1
1899
+#define IEEE80211_POWERSAVE_PSP 2
1900
+#define IEEE80211_POWERSAVE_PSP_CAM 3
1901
+#define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM
1902
+#define IEEE80211_IOC_POWERSAVESLEEP 11
1903
+#define IEEE80211_IOC_RTSTHRESHOLD 12
1904
+#define IEEE80211_IOC_PROTMODE 13
1905
+#define IEEE80211_PROTMODE_OFF 0
1906
+#define IEEE80211_PROTMODE_CTS 1
1907
+#define IEEE80211_PROTMODE_RTSCTS 2
1908
+#define IEEE80211_IOC_TXPOWER 14 /* global tx power limit */
1909
+#define IEEE80211_IOC_BSSID 15
1910
+#define IEEE80211_IOC_ROAMING 16 /* roaming mode */
1911
+#define IEEE80211_IOC_PRIVACY 17 /* privacy invoked */
1912
+#define IEEE80211_IOC_DROPUNENCRYPTED 18 /* discard unencrypted frames */
1913
+#define IEEE80211_IOC_WPAKEY 19
1914
+#define IEEE80211_IOC_DELKEY 20
1915
+#define IEEE80211_IOC_MLME 21
1916
+#define IEEE80211_IOC_OPTIE 22 /* optional info. element */
1917
+#define IEEE80211_IOC_SCAN_REQ 23
1918
+#define IEEE80211_IOC_SCAN_RESULTS 24
1919
+#define IEEE80211_IOC_COUNTERMEASURES 25 /* WPA/TKIP countermeasures */
1920
+#define IEEE80211_IOC_WPA 26 /* WPA mode (0,1,2) */
1921
+#define IEEE80211_IOC_CHANLIST 27 /* channel list */
1922
+#define IEEE80211_IOC_WME 28 /* WME mode (on, off) */
1923
+#define IEEE80211_IOC_HIDESSID 29 /* hide SSID mode (on, off) */
1924
+#define IEEE80211_IOC_APBRIDGE 30 /* AP inter-sta bridging */
1925
+#define IEEE80211_IOC_MCASTCIPHER 31 /* multicast/default cipher */
1926
+#define IEEE80211_IOC_MCASTKEYLEN 32 /* multicast key length */
1927
+#define IEEE80211_IOC_UCASTCIPHERS 33 /* unicast cipher suites */
1928
+#define IEEE80211_IOC_UCASTCIPHER 34 /* unicast cipher */
1929
+#define IEEE80211_IOC_UCASTKEYLEN 35 /* unicast key length */
1930
+#define IEEE80211_IOC_DRIVER_CAPS 36 /* driver capabilities */
1931
+#define IEEE80211_IOC_KEYMGTALGS 37 /* key management algorithms */
1932
+#define IEEE80211_IOC_RSNCAPS 38 /* RSN capabilities */
1933
+#define IEEE80211_IOC_WPAIE 39 /* WPA information element */
1934
+#define IEEE80211_IOC_STA_STATS 40 /* per-station statistics */
1935
+#define IEEE80211_IOC_MACCMD 41 /* MAC ACL operation */
1936
+#define IEEE80211_IOC_TXPOWMAX 43 /* max tx power for channel */
1937
+#define IEEE80211_IOC_STA_TXPOW 44 /* per-station tx power limit */
1938
+#define IEEE80211_IOC_STA_INFO 45 /* station/neighbor info */
1939
+#define IEEE80211_IOC_WME_CWMIN 46 /* WME: ECWmin */
1940
+#define IEEE80211_IOC_WME_CWMAX 47 /* WME: ECWmax */
1941
+#define IEEE80211_IOC_WME_AIFS 48 /* WME: AIFSN */
1942
+#define IEEE80211_IOC_WME_TXOPLIMIT 49 /* WME: txops limit */
1943
+#define IEEE80211_IOC_WME_ACM 50 /* WME: ACM (bss only) */
1944
+#define IEEE80211_IOC_WME_ACKPOLICY 51 /* WME: ACK policy (!bss only)*/
1945
+#define IEEE80211_IOC_DTIM_PERIOD 52 /* DTIM period (beacons) */
1946
+#define IEEE80211_IOC_BEACON_INTERVAL 53 /* beacon interval (ms) */
1947
+#define IEEE80211_IOC_ADDMAC 54 /* add sta to MAC ACL table */
1948
+#define IEEE80211_IOC_DELMAC 55 /* del sta from MAC ACL table */
1949
+#define IEEE80211_IOC_FF 56 /* ATH fast frames (on, off) */
1950
+#define IEEE80211_IOC_TURBOP 57 /* ATH turbo' (on, off) */
1953
+ * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
1955
+struct ieee80211req_scan_result {
1956
+ u_int16_t isr_len; /* length (mult of 4) */
1957
+ u_int16_t isr_freq; /* MHz */
1958
+ u_int16_t isr_flags; /* channel flags */
1959
+ u_int8_t isr_noise;
1960
+ u_int8_t isr_rssi;
1961
+ u_int8_t isr_intval; /* beacon interval */
1962
+ u_int16_t isr_capinfo; /* capabilities */
1963
+ u_int8_t isr_erp; /* ERP element */
1964
+ u_int8_t isr_bssid[IEEE80211_ADDR_LEN];
1965
+ u_int8_t isr_nrates;
1966
+ u_int8_t isr_rates[IEEE80211_RATE_MAXSIZE];
1967
+ u_int8_t isr_ssid_len; /* SSID length */
1968
+ u_int8_t isr_ie_len; /* IE length */
1969
+ u_int8_t isr_pad[5];
1970
+ /* variable length SSID followed by IE data */
1973
+#endif /* __FreeBSD__ */
1977
+ * Wireless Extensions API, private ioctl interfaces.
1979
+ * NB: Even-numbered ioctl numbers have set semantics and are privileged!
1980
+ * (regardless of the incorrect comment in wireless.h!)
1983
+#include <linux/if.h>
1985
+#define IEEE80211_IOCTL_SETPARAM (SIOCIWFIRSTPRIV+0)
1986
+#define IEEE80211_IOCTL_GETPARAM (SIOCIWFIRSTPRIV+1)
1987
+#define IEEE80211_IOCTL_SETMODE (SIOCIWFIRSTPRIV+2)
1988
+#define IEEE80211_IOCTL_GETMODE (SIOCIWFIRSTPRIV+3)
1989
+#define IEEE80211_IOCTL_SETWMMPARAMS (SIOCIWFIRSTPRIV+4)
1990
+#define IEEE80211_IOCTL_GETWMMPARAMS (SIOCIWFIRSTPRIV+5)
1991
+#define IEEE80211_IOCTL_SETCHANLIST (SIOCIWFIRSTPRIV+6)
1992
+#define IEEE80211_IOCTL_GETCHANLIST (SIOCIWFIRSTPRIV+7)
1993
+#define IEEE80211_IOCTL_CHANSWITCH (SIOCIWFIRSTPRIV+8)
1994
+#define IEEE80211_IOCTL_GETCHANINFO (SIOCIWFIRSTPRIV+13)
1995
+#define IEEE80211_IOCTL_SETOPTIE (SIOCIWFIRSTPRIV+14)
1996
+#define IEEE80211_IOCTL_GETOPTIE (SIOCIWFIRSTPRIV+15)
1997
+#define IEEE80211_IOCTL_SETMLME (SIOCIWFIRSTPRIV+16)
1998
+#define IEEE80211_IOCTL_SETKEY (SIOCIWFIRSTPRIV+18)
1999
+#define IEEE80211_IOCTL_DELKEY (SIOCIWFIRSTPRIV+20)
2000
+#define IEEE80211_IOCTL_ADDMAC (SIOCIWFIRSTPRIV+22)
2001
+#define IEEE80211_IOCTL_DELMAC (SIOCIWFIRSTPRIV+24)
2002
+#define IEEE80211_IOCTL_WDSADDMAC (SIOCIWFIRSTPRIV+26)
2003
+#define IEEE80211_IOCTL_WDSDELMAC (SIOCIWFIRSTPRIV+28)
2004
+#define IEEE80211_IOCTL_KICKMAC (SIOCIWFIRSTPRIV+30)
2006
+ IEEE80211_WMMPARAMS_CWMIN = 1,
2007
+ IEEE80211_WMMPARAMS_CWMAX = 2,
2008
+ IEEE80211_WMMPARAMS_AIFS = 3,
2009
+ IEEE80211_WMMPARAMS_TXOPLIMIT = 4,
2010
+ IEEE80211_WMMPARAMS_ACM = 5,
2011
+ IEEE80211_WMMPARAMS_NOACKPOLICY = 6,
2014
+ IEEE80211_PARAM_TURBO = 1, /* turbo mode */
2015
+ IEEE80211_PARAM_MODE = 2, /* phy mode (11a, 11b, etc.) */
2016
+ IEEE80211_PARAM_AUTHMODE = 3, /* authentication mode */
2017
+ IEEE80211_PARAM_PROTMODE = 4, /* 802.11g protection */
2018
+ IEEE80211_PARAM_MCASTCIPHER = 5, /* multicast/default cipher */
2019
+ IEEE80211_PARAM_MCASTKEYLEN = 6, /* multicast key length */
2020
+ IEEE80211_PARAM_UCASTCIPHERS = 7, /* unicast cipher suites */
2021
+ IEEE80211_PARAM_UCASTCIPHER = 8, /* unicast cipher */
2022
+ IEEE80211_PARAM_UCASTKEYLEN = 9, /* unicast key length */
2023
+ IEEE80211_PARAM_WPA = 10, /* WPA mode (0,1,2) */
2024
+ IEEE80211_PARAM_ROAMING = 12, /* roaming mode */
2025
+ IEEE80211_PARAM_PRIVACY = 13, /* privacy invoked */
2026
+ IEEE80211_PARAM_COUNTERMEASURES = 14, /* WPA/TKIP countermeasures */
2027
+ IEEE80211_PARAM_DROPUNENCRYPTED = 15, /* discard unencrypted frames */
2028
+ IEEE80211_PARAM_DRIVER_CAPS = 16, /* driver capabilities */
2029
+ IEEE80211_PARAM_MACCMD = 17, /* MAC ACL operation */
2030
+ IEEE80211_PARAM_WMM = 18, /* WMM mode (on, off) */
2031
+ IEEE80211_PARAM_HIDESSID = 19, /* hide SSID mode (on, off) */
2032
+ IEEE80211_PARAM_APBRIDGE = 20, /* AP inter-sta bridging */
2033
+ IEEE80211_PARAM_KEYMGTALGS = 21, /* key management algorithms */
2034
+ IEEE80211_PARAM_RSNCAPS = 22, /* RSN capabilities */
2035
+ IEEE80211_PARAM_INACT = 23, /* station inactivity timeout */
2036
+ IEEE80211_PARAM_INACT_AUTH = 24, /* station auth inact timeout */
2037
+ IEEE80211_PARAM_INACT_INIT = 25, /* station init inact timeout */
2038
+ IEEE80211_PARAM_ABOLT = 26, /* Atheros Adv. Capabilities */
2039
+ IEEE80211_PARAM_DTIM_PERIOD = 28, /* DTIM period (beacons) */
2040
+ IEEE80211_PARAM_BEACON_INTERVAL = 29, /* beacon interval (ms) */
2041
+ IEEE80211_PARAM_DOTH = 30, /* 11.h is on/off */
2042
+ IEEE80211_PARAM_PWRTARGET = 31, /* Current Channel Pwr Constraint */
2043
+ IEEE80211_PARAM_GENREASSOC = 32, /* Generate a reassociation request */
2044
+ IEEE80211_PARAM_COMPRESSION = 33, /* compression */
2045
+ IEEE80211_PARAM_FF = 34, /* fast frames support */
2046
+ IEEE80211_PARAM_XR = 35, /* XR support */
2047
+ IEEE80211_PARAM_BURST = 36, /* burst mode */
2048
+ IEEE80211_PARAM_PUREG = 37, /* pure 11g (no 11b stations) */
2049
+ IEEE80211_PARAM_AR = 38, /* AR support */
2050
+ IEEE80211_PARAM_WDS = 39, /* Enable 4 address processing */
2051
+ IEEE80211_PARAM_BGSCAN = 40, /* bg scanning (on, off) */
2052
+ IEEE80211_PARAM_BGSCAN_IDLE = 41, /* bg scan idle threshold */
2053
+ IEEE80211_PARAM_BGSCAN_INTERVAL = 42, /* bg scan interval */
2054
+ IEEE80211_PARAM_MCAST_RATE = 43, /* Multicast Tx Rate */
2055
+ IEEE80211_PARAM_COVERAGE_CLASS = 44, /* coverage class */
2056
+ IEEE80211_PARAM_COUNTRY_IE = 45, /* enable country IE */
2057
+ IEEE80211_PARAM_SCANVALID = 46, /* scan cache valid threshold */
2058
+ IEEE80211_PARAM_ROAM_RSSI_11A = 47, /* rssi threshold in 11a */
2059
+ IEEE80211_PARAM_ROAM_RSSI_11B = 48, /* rssi threshold in 11b */
2060
+ IEEE80211_PARAM_ROAM_RSSI_11G = 49, /* rssi threshold in 11g */
2061
+ IEEE80211_PARAM_ROAM_RATE_11A = 50, /* tx rate threshold in 11a */
2062
+ IEEE80211_PARAM_ROAM_RATE_11B = 51, /* tx rate threshold in 11b */
2063
+ IEEE80211_PARAM_ROAM_RATE_11G = 52, /* tx rate threshold in 11g */
2064
+ IEEE80211_PARAM_UAPSDINFO = 53, /* value for qos info field */
2065
+ IEEE80211_PARAM_SLEEP = 54, /* force sleep/wake */
2066
+ IEEE80211_PARAM_QOSNULL = 55, /* force sleep/wake */
2067
+ IEEE80211_PARAM_PSPOLL = 56, /* force ps-poll generation (sta only) */
2068
+ IEEE80211_PARAM_EOSPDROP = 57, /* force uapsd EOSP drop (ap only) */
2069
+ IEEE80211_PARAM_MARKDFS = 58, /* mark a dfs interference channel when found */
2070
+ IEEE80211_PARAM_REGCLASS = 59, /* enable regclass ids in country IE */
2071
+ IEEE80211_PARAM_DROPUNENC_EAPOL = 60, /* drop unencrypted eapol frames */
2074
+#define SIOCG80211STATS (SIOCDEVPRIVATE+2)
2075
+/* NB: require in+out parameters so cannot use wireless extensions, yech */
2076
+#define IEEE80211_IOCTL_GETKEY (SIOCDEVPRIVATE+3)
2077
+#define IEEE80211_IOCTL_GETWPAIE (SIOCDEVPRIVATE+4)
2078
+#define IEEE80211_IOCTL_STA_STATS (SIOCDEVPRIVATE+5)
2079
+#define IEEE80211_IOCTL_STA_INFO (SIOCDEVPRIVATE+6)
2080
+#define SIOC80211IFCREATE (SIOCDEVPRIVATE+7)
2081
+#define SIOC80211IFDESTROY (SIOCDEVPRIVATE+8)
2082
+#define IEEE80211_IOCTL_SCAN_RESULTS (SIOCDEVPRIVATE+9)
2084
+struct ieee80211_clone_params {
2085
+ char icp_name[IFNAMSIZ]; /* device name */
2086
+ u_int16_t icp_opmode; /* operating mode */
2087
+ u_int16_t icp_flags; /* see below */
2088
+#define IEEE80211_CLONE_BSSID 0x0001 /* allocate unique mac/bssid */
2089
+#define IEEE80211_NO_STABEACONS 0x0002 /* Do not setup the station beacon timers */
2092
+#endif /* __linux__ */
2094
+#endif /* _NET80211_IEEE80211_IOCTL_H_ */