1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## wpa_madwifing_r1794_includes.patch by Kel Modderman <kelmo@kanotixguide.org>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Includes for madwifi private ioctl's (madwifi.org svn trunk r1794).
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-11-07 16:55:15.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 1762 2006-10-23 09:11:21Z 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
+ * Generic information element
919
+struct ieee80211_ie {
926
+ * Country information element.
928
+#define IEEE80211_COUNTRY_MAX_TRIPLETS (83)
929
+struct ieee80211_ie_country {
930
+ u_int8_t country_id;
931
+ u_int8_t country_len;
932
+ u_int8_t country_str[3];
933
+ u_int8_t country_triplet[IEEE80211_COUNTRY_MAX_TRIPLETS * 3];
937
+ * Channel Switch Announcement information element.
939
+struct ieee80211_ie_csa {
940
+ u_int8_t csa_id; /* IEEE80211_ELEMID_CHANSWITCHANN */
941
+ u_int8_t csa_len; /* == 3 */
942
+ u_int8_t csa_mode; /* Channel Switch Mode: 1 == stop transmission until CS */
943
+ u_int8_t csa_chan; /* New Channel Number */
944
+ u_int8_t csa_count; /* TBTTs until Channel Switch happens */
947
+/* minimal Channel Switch Count in the initial announcement */
948
+#define IEEE80211_CSA_PROTECTION_PERIOD 3
950
+/* maximum allowed deviance of measurement of intervals between CSA in Beacons */
951
+#define IEEE80211_CSA_SANITY_THRESHOLD 100
954
+/* does frame have QoS sequence control data */
955
+#define IEEE80211_QOS_HAS_SEQ(wh) \
956
+ (((wh)->i_fc[0] & \
957
+ (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_QOS)) == \
958
+ (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS))
960
+#define WME_QOSINFO_COUNT 0x0f /* Mask for Param Set Count field */
962
+ * WME/802.11e information element.
964
+struct ieee80211_ie_wme {
965
+ u_int8_t wme_id; /* IEEE80211_ELEMID_VENDOR */
966
+ u_int8_t wme_len; /* length in bytes */
967
+ u_int8_t wme_oui[3]; /* 0x00, 0x50, 0xf2 */
968
+ u_int8_t wme_type; /* OUI type */
969
+ u_int8_t wme_subtype; /* OUI subtype */
970
+ u_int8_t wme_version; /* spec revision */
971
+ u_int8_t wme_info; /* QoS info */
975
+ * WME/802.11e Tspec Element
977
+struct ieee80211_wme_tspec {
980
+ u_int8_t ts_oui[3];
981
+ u_int8_t ts_oui_type;
982
+ u_int8_t ts_oui_subtype;
983
+ u_int8_t ts_version;
984
+ u_int8_t ts_tsinfo[3];
985
+ u_int8_t ts_nom_msdu[2];
986
+ u_int8_t ts_max_msdu[2];
987
+ u_int8_t ts_min_svc[4];
988
+ u_int8_t ts_max_svc[4];
989
+ u_int8_t ts_inactv_intv[4];
990
+ u_int8_t ts_susp_intv[4];
991
+ u_int8_t ts_start_svc[4];
992
+ u_int8_t ts_min_rate[4];
993
+ u_int8_t ts_mean_rate[4];
994
+ u_int8_t ts_max_burst[4];
995
+ u_int8_t ts_min_phy[4];
996
+ u_int8_t ts_peak_rate[4];
997
+ u_int8_t ts_delay[4];
998
+ u_int8_t ts_surplus[2];
999
+ u_int8_t ts_medium_time[2];
1003
+ * WME AC parameter field
1006
+struct ieee80211_wme_acparams {
1007
+ u_int8_t acp_aci_aifsn;
1008
+ u_int8_t acp_logcwminmax;
1009
+ u_int16_t acp_txop;
1012
+#define IEEE80211_WME_PARAM_LEN 24
1013
+#define WME_NUM_AC 4 /* 4 AC categories */
1015
+#define WME_PARAM_ACI 0x60 /* Mask for ACI field */
1016
+#define WME_PARAM_ACI_S 5 /* Shift for ACI field */
1017
+#define WME_PARAM_ACM 0x10 /* Mask for ACM bit */
1018
+#define WME_PARAM_ACM_S 4 /* Shift for ACM bit */
1019
+#define WME_PARAM_AIFSN 0x0f /* Mask for aifsn field */
1020
+#define WME_PARAM_AIFSN_S 0 /* Shift for aifsn field */
1021
+#define WME_PARAM_LOGCWMIN 0x0f /* Mask for CwMin field (in log) */
1022
+#define WME_PARAM_LOGCWMIN_S 0 /* Shift for CwMin field */
1023
+#define WME_PARAM_LOGCWMAX 0xf0 /* Mask for CwMax field (in log) */
1024
+#define WME_PARAM_LOGCWMAX_S 4 /* Shift for CwMax field */
1026
+#define WME_AC_TO_TID(_ac) ( \
1027
+ ((_ac) == WME_AC_VO) ? 6 : \
1028
+ ((_ac) == WME_AC_VI) ? 5 : \
1029
+ ((_ac) == WME_AC_BK) ? 1 : \
1032
+#define TID_TO_WME_AC(_tid) ( \
1033
+ ((_tid) < 1) ? WME_AC_BE : \
1034
+ ((_tid) < 3) ? WME_AC_BK : \
1035
+ ((_tid) < 6) ? WME_AC_VI : \
1039
+ * WME Parameter Element
1042
+struct ieee80211_wme_param {
1043
+ u_int8_t param_id;
1044
+ u_int8_t param_len;
1045
+ u_int8_t param_oui[3];
1046
+ u_int8_t param_oui_type;
1047
+ u_int8_t param_oui_sybtype;
1048
+ u_int8_t param_version;
1049
+ u_int8_t param_qosInfo;
1050
+ u_int8_t param_reserved;
1051
+ struct ieee80211_wme_acparams params_acParams[WME_NUM_AC];
1055
+ * WME U-APSD qos info field defines
1057
+#define WME_CAPINFO_UAPSD_EN 0x00000080
1058
+#define WME_CAPINFO_UAPSD_VO 0x00000001
1059
+#define WME_CAPINFO_UAPSD_VI 0x00000002
1060
+#define WME_CAPINFO_UAPSD_BK 0x00000004
1061
+#define WME_CAPINFO_UAPSD_BE 0x00000008
1062
+#define WME_CAPINFO_UAPSD_ACFLAGS_SHIFT 0
1063
+#define WME_CAPINFO_UAPSD_ACFLAGS_MASK 0xF
1064
+#define WME_CAPINFO_UAPSD_MAXSP_SHIFT 5
1065
+#define WME_CAPINFO_UAPSD_MAXSP_MASK 0x3
1066
+#define WME_CAPINFO_IE_OFFSET 8
1067
+#define WME_UAPSD_MAXSP(_qosinfo) (((_qosinfo) >> WME_CAPINFO_UAPSD_MAXSP_SHIFT) & WME_CAPINFO_UAPSD_MAXSP_MASK)
1068
+#define WME_UAPSD_AC_ENABLED(_ac, _qosinfo) ( (1<<(3 - (_ac))) & \
1069
+ (((_qosinfo) >> WME_CAPINFO_UAPSD_ACFLAGS_SHIFT) & WME_CAPINFO_UAPSD_ACFLAGS_MASK) )
1072
+ * Atheros Advanced Capability information element.
1074
+struct ieee80211_ie_athAdvCap {
1075
+ u_int8_t athAdvCap_id; /* IEEE80211_ELEMID_VENDOR */
1076
+ u_int8_t athAdvCap_len; /* length in bytes */
1077
+ u_int8_t athAdvCap_oui[3]; /* 0x00, 0x03, 0x7f */
1078
+ u_int8_t athAdvCap_type; /* OUI type */
1079
+ u_int8_t athAdvCap_subtype; /* OUI subtype */
1080
+ u_int8_t athAdvCap_version; /* spec revision */
1081
+ u_int8_t athAdvCap_capability; /* Capability info */
1082
+ u_int16_t athAdvCap_defKeyIndex;
1086
+ * Atheros XR information element.
1088
+struct ieee80211_xr_param {
1089
+ u_int8_t param_id;
1090
+ u_int8_t param_len;
1091
+ u_int8_t param_oui[3];
1092
+ u_int8_t param_oui_type;
1093
+ u_int8_t param_oui_sybtype;
1094
+ u_int8_t param_version;
1095
+ u_int8_t param_Info;
1096
+ u_int8_t param_base_bssid[IEEE80211_ADDR_LEN];
1097
+ u_int8_t param_xr_bssid[IEEE80211_ADDR_LEN];
1098
+ u_int16_t param_xr_beacon_interval;
1099
+ u_int8_t param_base_ath_capability;
1100
+ u_int8_t param_xr_ath_capability;
1103
+/* Atheros capabilities */
1104
+#define IEEE80211_ATHC_TURBOP 0x0001 /* Turbo Prime */
1105
+#define IEEE80211_ATHC_COMP 0x0002 /* Compression */
1106
+#define IEEE80211_ATHC_FF 0x0004 /* Fast Frames */
1107
+#define IEEE80211_ATHC_XR 0x0008 /* Xtended Range support */
1108
+#define IEEE80211_ATHC_AR 0x0010 /* Advanced Radar support */
1109
+#define IEEE80211_ATHC_BURST 0x0020 /* Bursting - not negotiated */
1110
+#define IEEE80211_ATHC_WME 0x0040 /* CWMin tuning */
1111
+#define IEEE80211_ATHC_BOOST 0x0080 /* Boost */
1114
+ * Management Notification Frame
1116
+struct ieee80211_mnf {
1117
+ u_int8_t mnf_category;
1118
+ u_int8_t mnf_action;
1119
+ u_int8_t mnf_dialog;
1120
+ u_int8_t mnf_status;
1122
+#define MNF_SETUP_REQ 0
1123
+#define MNF_SETUP_RESP 1
1124
+#define MNF_TEARDOWN 2
1129
+struct ieee80211_frame_min {
1131
+ u_int8_t i_dur[2];
1132
+ u_int8_t i_addr1[IEEE80211_ADDR_LEN];
1133
+ u_int8_t i_addr2[IEEE80211_ADDR_LEN];
1137
+struct ieee80211_frame_rts {
1139
+ u_int8_t i_dur[2];
1140
+ u_int8_t i_ra[IEEE80211_ADDR_LEN];
1141
+ u_int8_t i_ta[IEEE80211_ADDR_LEN];
1145
+struct ieee80211_frame_cts {
1147
+ u_int8_t i_dur[2];
1148
+ u_int8_t i_ra[IEEE80211_ADDR_LEN];
1152
+struct ieee80211_frame_ack {
1154
+ u_int8_t i_dur[2];
1155
+ u_int8_t i_ra[IEEE80211_ADDR_LEN];
1159
+struct ieee80211_frame_pspoll {
1161
+ u_int8_t i_aid[2];
1162
+ u_int8_t i_bssid[IEEE80211_ADDR_LEN];
1163
+ u_int8_t i_ta[IEEE80211_ADDR_LEN];
1167
+struct ieee80211_frame_cfend { /* NB: also CF-End+CF-Ack */
1169
+ u_int8_t i_dur[2]; /* should be zero */
1170
+ u_int8_t i_ra[IEEE80211_ADDR_LEN];
1171
+ u_int8_t i_bssid[IEEE80211_ADDR_LEN];
1176
+ * BEACON management packets
1178
+ * octet timestamp[8]
1179
+ * octet beacon interval[2]
1180
+ * octet capability information[2]
1181
+ * information element
1184
+ * octet information[length]
1187
+typedef u_int8_t *ieee80211_mgt_beacon_t;
1189
+#define IEEE80211_BEACON_INTERVAL(beacon) \
1190
+ ((beacon)[8] | ((beacon)[9] << 8))
1191
+#define IEEE80211_BEACON_CAPABILITY(beacon) \
1192
+ ((beacon)[10] | ((beacon)[11] << 8))
1194
+#define IEEE80211_CAPINFO_ESS 0x0001
1195
+#define IEEE80211_CAPINFO_IBSS 0x0002
1196
+#define IEEE80211_CAPINFO_CF_POLLABLE 0x0004
1197
+#define IEEE80211_CAPINFO_CF_POLLREQ 0x0008
1198
+#define IEEE80211_CAPINFO_PRIVACY 0x0010
1199
+#define IEEE80211_CAPINFO_SHORT_PREAMBLE 0x0020
1200
+#define IEEE80211_CAPINFO_PBCC 0x0040
1201
+#define IEEE80211_CAPINFO_CHNL_AGILITY 0x0080
1202
+/* bits 8-9 are reserved (8 now for specturm management) */
1203
+#define IEEE80211_CAPINFO_SPECTRUM_MGMT 0x0100
1204
+#define IEEE80211_CAPINFO_SHORT_SLOTTIME 0x0400
1205
+#define IEEE80211_CAPINFO_RSN 0x0800
1206
+/* bit 12 is reserved */
1207
+#define IEEE80211_CAPINFO_DSSSOFDM 0x2000
1208
+/* bits 14-15 are reserved */
1211
+ * 802.11i/WPA information element (maximally sized).
1213
+struct ieee80211_ie_wpa {
1214
+ u_int8_t wpa_id; /* IEEE80211_ELEMID_VENDOR */
1215
+ u_int8_t wpa_len; /* length in bytes */
1216
+ u_int8_t wpa_oui[3]; /* 0x00, 0x50, 0xf2 */
1217
+ u_int8_t wpa_type; /* OUI type */
1218
+ u_int16_t wpa_version; /* spec revision */
1219
+ u_int32_t wpa_mcipher[1]; /* multicast/group key cipher */
1220
+ u_int16_t wpa_uciphercnt; /* # pairwise key ciphers */
1221
+ u_int32_t wpa_uciphers[8]; /* ciphers */
1222
+ u_int16_t wpa_authselcnt; /* authentication selector cnt*/
1223
+ u_int32_t wpa_authsels[8]; /* selectors */
1224
+ u_int16_t wpa_caps; /* 802.11i capabilities */
1225
+ u_int16_t wpa_pmkidcnt; /* 802.11i pmkid count */
1226
+ u_int16_t wpa_pmkids[8]; /* 802.11i pmkids */
1230
+ * Management information element payloads.
1234
+ IEEE80211_ELEMID_SSID = 0,
1235
+ IEEE80211_ELEMID_RATES = 1,
1236
+ IEEE80211_ELEMID_FHPARMS = 2,
1237
+ IEEE80211_ELEMID_DSPARMS = 3,
1238
+ IEEE80211_ELEMID_CFPARMS = 4,
1239
+ IEEE80211_ELEMID_TIM = 5,
1240
+ IEEE80211_ELEMID_IBSSPARMS = 6,
1241
+ IEEE80211_ELEMID_COUNTRY = 7,
1242
+ IEEE80211_ELEMID_REQINFO = 10,
1243
+ IEEE80211_ELEMID_CHALLENGE = 16,
1244
+ /* 17-31 reserved for challenge text extension */
1245
+ IEEE80211_ELEMID_PWRCNSTR = 32,
1246
+ IEEE80211_ELEMID_PWRCAP = 33,
1247
+ IEEE80211_ELEMID_TPCREQ = 34,
1248
+ IEEE80211_ELEMID_TPCREP = 35,
1249
+ IEEE80211_ELEMID_SUPPCHAN = 36,
1250
+ IEEE80211_ELEMID_CHANSWITCHANN = 37,
1251
+ IEEE80211_ELEMID_MEASREQ = 38,
1252
+ IEEE80211_ELEMID_MEASREP = 39,
1253
+ IEEE80211_ELEMID_QUIET = 40,
1254
+ IEEE80211_ELEMID_IBSSDFS = 41,
1255
+ IEEE80211_ELEMID_ERP = 42,
1256
+ IEEE80211_ELEMID_RSN = 48,
1257
+ IEEE80211_ELEMID_XRATES = 50,
1258
+ /* 128-129 proprietary elements used by Agere chipsets */
1259
+ IEEE80211_ELEMID_AGERE1 = 128,
1260
+ IEEE80211_ELEMID_AGERE2 = 129,
1261
+ IEEE80211_ELEMID_TPC = 150,
1262
+ IEEE80211_ELEMID_CCKM = 156,
1263
+ IEEE80211_ELEMID_VENDOR = 221, /* vendor private */
1266
+#define IEEE80211_CHANSWITCHANN_BYTES 5
1268
+struct ieee80211_tim_ie {
1269
+ u_int8_t tim_ie; /* IEEE80211_ELEMID_TIM */
1271
+ u_int8_t tim_count; /* DTIM count */
1272
+ u_int8_t tim_period; /* DTIM period */
1273
+ u_int8_t tim_bitctl; /* bitmap control */
1274
+ u_int8_t tim_bitmap[1]; /* variable-length bitmap */
1277
+struct ieee80211_country_ie {
1278
+ u_int8_t ie; /* IEEE80211_ELEMID_COUNTRY */
1280
+ u_int8_t cc[3]; /* ISO CC+(I)ndoor/(O)utdoor */
1282
+ u_int8_t schan; /* starting channel */
1283
+ u_int8_t nchan; /* number channels */
1284
+ u_int8_t maxtxpwr; /* tx power cap */
1285
+ } __packed band[4]; /* up to 4 sub bands */
1288
+#define IEEE80211_CHALLENGE_LEN 128
1290
+#define IEEE80211_SUPPCHAN_LEN 26
1292
+#define IEEE80211_RATE_BASIC 0x80
1293
+#define IEEE80211_RATE_VAL 0x7f
1295
+/* EPR information element flags */
1296
+#define IEEE80211_ERP_NON_ERP_PRESENT 0x01
1297
+#define IEEE80211_ERP_USE_PROTECTION 0x02
1298
+#define IEEE80211_ERP_LONG_PREAMBLE 0x04
1300
+/* Atheros private advanced capabilities info */
1301
+#define ATHEROS_CAP_TURBO_PRIME 0x01
1302
+#define ATHEROS_CAP_COMPRESSION 0x02
1303
+#define ATHEROS_CAP_FAST_FRAME 0x04
1304
+/* bits 3-6 reserved */
1305
+#define ATHEROS_CAP_BOOST 0x80
1307
+#define ATH_OUI 0x7f0300 /* Atheros OUI */
1308
+#define ATH_OUI_TYPE 0x01
1309
+#define ATH_OUI_SUBTYPE 0x01
1310
+#define ATH_OUI_VERSION 0x00
1311
+#define ATH_OUI_TYPE_XR 0x03
1312
+#define ATH_OUI_VER_XR 0x01
1314
+#define WPA_OUI 0xf25000
1315
+#define WPA_OUI_TYPE 0x01
1316
+#define WPA_VERSION 1 /* current supported version */
1318
+#define WPA_CSE_NULL 0x00
1319
+#define WPA_CSE_WEP40 0x01
1320
+#define WPA_CSE_TKIP 0x02
1321
+#define WPA_CSE_CCMP 0x04
1322
+#define WPA_CSE_WEP104 0x05
1324
+#define WPA_ASE_NONE 0x00
1325
+#define WPA_ASE_8021X_UNSPEC 0x01
1326
+#define WPA_ASE_8021X_PSK 0x02
1328
+#define RSN_OUI 0xac0f00
1329
+#define RSN_VERSION 1 /* current supported version */
1331
+#define RSN_CSE_NULL 0x00
1332
+#define RSN_CSE_WEP40 0x01
1333
+#define RSN_CSE_TKIP 0x02
1334
+#define RSN_CSE_WRAP 0x03
1335
+#define RSN_CSE_CCMP 0x04
1336
+#define RSN_CSE_WEP104 0x05
1338
+#define RSN_ASE_NONE 0x00
1339
+#define RSN_ASE_8021X_UNSPEC 0x01
1340
+#define RSN_ASE_8021X_PSK 0x02
1342
+#define RSN_CAP_PREAUTH 0x01
1344
+#define WME_OUI 0xf25000
1345
+#define WME_OUI_TYPE 0x02
1346
+#define WME_INFO_OUI_SUBTYPE 0x00
1347
+#define WME_PARAM_OUI_SUBTYPE 0x01
1348
+#define WME_VERSION 1
1350
+/* WME stream classes */
1351
+#define WME_AC_BE 0 /* best effort */
1352
+#define WME_AC_BK 1 /* background */
1353
+#define WME_AC_VI 2 /* video */
1354
+#define WME_AC_VO 3 /* voice */
1357
+ * AUTH management packets
1363
+ * octet chal.length
1364
+ * octet chal.text[253]
1367
+typedef u_int8_t *ieee80211_mgt_auth_t;
1369
+#define IEEE80211_AUTH_ALGORITHM(auth) \
1370
+ ((auth)[0] | ((auth)[1] << 8))
1371
+#define IEEE80211_AUTH_TRANSACTION(auth) \
1372
+ ((auth)[2] | ((auth)[3] << 8))
1373
+#define IEEE80211_AUTH_STATUS(auth) \
1374
+ ((auth)[4] | ((auth)[5] << 8))
1376
+#define IEEE80211_AUTH_ALG_OPEN 0x0000
1377
+#define IEEE80211_AUTH_ALG_SHARED 0x0001
1378
+#define IEEE80211_AUTH_ALG_LEAP 0x0080
1381
+ IEEE80211_AUTH_OPEN_REQUEST = 1,
1382
+ IEEE80211_AUTH_OPEN_RESPONSE = 2,
1386
+ IEEE80211_AUTH_SHARED_REQUEST = 1,
1387
+ IEEE80211_AUTH_SHARED_CHALLENGE = 2,
1388
+ IEEE80211_AUTH_SHARED_RESPONSE = 3,
1389
+ IEEE80211_AUTH_SHARED_PASS = 4,
1395
+ * Unlisted codes are reserved
1399
+ IEEE80211_REASON_UNSPECIFIED = 1,
1400
+ IEEE80211_REASON_AUTH_EXPIRE = 2,
1401
+ IEEE80211_REASON_AUTH_LEAVE = 3,
1402
+ IEEE80211_REASON_ASSOC_EXPIRE = 4,
1403
+ IEEE80211_REASON_ASSOC_TOOMANY = 5,
1404
+ IEEE80211_REASON_NOT_AUTHED = 6,
1405
+ IEEE80211_REASON_NOT_ASSOCED = 7,
1406
+ IEEE80211_REASON_ASSOC_LEAVE = 8,
1407
+ IEEE80211_REASON_ASSOC_NOT_AUTHED = 9,
1409
+ IEEE80211_REASON_RSN_REQUIRED = 11,
1410
+ IEEE80211_REASON_RSN_INCONSISTENT = 12,
1411
+ IEEE80211_REASON_IE_INVALID = 13,
1412
+ IEEE80211_REASON_MIC_FAILURE = 14,
1414
+ IEEE80211_STATUS_SUCCESS = 0,
1415
+ IEEE80211_STATUS_UNSPECIFIED = 1,
1416
+ IEEE80211_STATUS_CAPINFO = 10,
1417
+ IEEE80211_STATUS_NOT_ASSOCED = 11,
1418
+ IEEE80211_STATUS_OTHER = 12,
1419
+ IEEE80211_STATUS_ALG = 13,
1420
+ IEEE80211_STATUS_SEQUENCE = 14,
1421
+ IEEE80211_STATUS_CHALLENGE = 15,
1422
+ IEEE80211_STATUS_TIMEOUT = 16,
1423
+ IEEE80211_STATUS_TOOMANY = 17,
1424
+ IEEE80211_STATUS_BASIC_RATE = 18,
1425
+ IEEE80211_STATUS_SP_REQUIRED = 19,
1426
+ IEEE80211_STATUS_PBCC_REQUIRED = 20,
1427
+ IEEE80211_STATUS_CA_REQUIRED = 21,
1428
+ IEEE80211_STATUS_TOO_MANY_STATIONS = 22,
1429
+ IEEE80211_STATUS_RATES = 23,
1430
+ IEEE80211_STATUS_SHORTSLOT_REQUIRED = 25,
1431
+ IEEE80211_STATUS_DSSSOFDM_REQUIRED = 26,
1434
+#define IEEE80211_WEP_KEYLEN 5 /* 40bit */
1435
+#define IEEE80211_WEP_IVLEN 3 /* 24bit */
1436
+#define IEEE80211_WEP_KIDLEN 1 /* 1 octet */
1437
+#define IEEE80211_WEP_CRCLEN 4 /* CRC-32 */
1438
+#define IEEE80211_WEP_NKID 4 /* number of key ids */
1441
+ * 802.11i defines an extended IV for use with non-WEP ciphers.
1442
+ * When the EXTIV bit is set in the key id byte an additional
1443
+ * 4 bytes immediately follow the IV for TKIP. For CCMP the
1444
+ * EXTIV bit is likewise set but the 8 bytes represent the
1445
+ * CCMP header rather than IV+extended-IV.
1447
+#define IEEE80211_WEP_EXTIV 0x20
1448
+#define IEEE80211_WEP_EXTIVLEN 4 /* extended IV length */
1449
+#define IEEE80211_WEP_MICLEN 8 /* trailing MIC */
1451
+#define IEEE80211_CRC_LEN 4
1454
+ * Maximum acceptable MTU is:
1455
+ * IEEE80211_MAX_LEN - WEP overhead - CRC -
1456
+ * QoS overhead - RSN/WPA overhead
1457
+ * Min is arbitrarily chosen > IEEE80211_MIN_LEN. The default
1458
+ * mtu is Ethernet-compatible; it's set by ether_ifattach.
1460
+#define IEEE80211_MTU_MAX 2290
1461
+#define IEEE80211_MTU_MIN 32
1463
+#define IEEE80211_MAX_LEN (2300 + IEEE80211_CRC_LEN + \
1464
+ (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN))
1465
+#define IEEE80211_ACK_LEN \
1466
+ (sizeof(struct ieee80211_frame_ack) + IEEE80211_CRC_LEN)
1467
+#define IEEE80211_MIN_LEN \
1468
+ (sizeof(struct ieee80211_frame_min) + IEEE80211_CRC_LEN)
1471
+ * The 802.11 spec says at most 2007 stations may be
1472
+ * associated at once. For most AP's this is way more
1473
+ * than is feasible so we use a default of 128. This
1474
+ * number may be overridden by the driver and/or by
1475
+ * user configuration.
1477
+#define IEEE80211_AID_MAX 2007
1478
+#define IEEE80211_AID_DEF 128
1480
+#define IEEE80211_AID(b) ((b) &~ 0xc000)
1483
+ * RTS frame length parameters. The default is specified in
1484
+ * the 802.11 spec. The max may be wrong for jumbo frames.
1486
+#define IEEE80211_RTS_DEFAULT 512
1487
+#define IEEE80211_RTS_MIN 1
1488
+#define IEEE80211_RTS_MAX 2346
1491
+ * Regulatory extention identifier for country IE.
1493
+#define IEEE80211_REG_EXT_ID 201
1496
+ * IEEE 802.11 timer synchronization function (TSF) timestamp length
1498
+#define IEEE80211_TSF_LEN 8
1500
+#endif /* _NET80211_IEEE80211_H_ */
1501
diff -Nrup wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_ioctl.h wpa_supplicant/driver_madwifi/net80211/ieee80211_ioctl.h
1502
--- wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_ioctl.h 1970-01-01 10:00:00.000000000 +1000
1503
+++ wpa_supplicant/driver_madwifi/net80211/ieee80211_ioctl.h 2006-10-20 14:16:14.000000000 +1000
1506
+ * Copyright (c) 2001 Atsushi Onoe
1507
+ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
1508
+ * All rights reserved.
1510
+ * Redistribution and use in source and binary forms, with or without
1511
+ * modification, are permitted provided that the following conditions
1513
+ * 1. Redistributions of source code must retain the above copyright
1514
+ * notice, this list of conditions and the following disclaimer.
1515
+ * 2. Redistributions in binary form must reproduce the above copyright
1516
+ * notice, this list of conditions and the following disclaimer in the
1517
+ * documentation and/or other materials provided with the distribution.
1518
+ * 3. The name of the author may not be used to endorse or promote products
1519
+ * derived from this software without specific prior written permission.
1521
+ * Alternatively, this software may be distributed under the terms of the
1522
+ * GNU General Public License ("GPL") version 2 as published by the Free
1523
+ * Software Foundation.
1525
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1526
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1527
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1528
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1529
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1530
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1531
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1532
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1533
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1534
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1536
+ * $Id: ieee80211_ioctl.h 1756 2006-10-18 11:41:05Z kelmo $
1538
+#ifndef _NET80211_IEEE80211_IOCTL_H_
1539
+#define _NET80211_IEEE80211_IOCTL_H_
1542
+ * IEEE 802.11 ioctls.
1544
+#include <net80211/_ieee80211.h>
1545
+#include <net80211/ieee80211.h>
1546
+#include <net80211/ieee80211_crypto.h>
1549
+ * Per/node (station) statistics available when operating as an AP.
1551
+struct ieee80211_nodestats {
1552
+ u_int32_t ns_rx_data; /* rx data frames */
1553
+ u_int32_t ns_rx_mgmt; /* rx management frames */
1554
+ u_int32_t ns_rx_ctrl; /* rx control frames */
1555
+ u_int32_t ns_rx_ucast; /* rx unicast frames */
1556
+ u_int32_t ns_rx_mcast; /* rx multi/broadcast frames */
1557
+ u_int64_t ns_rx_bytes; /* rx data count (bytes) */
1558
+ u_int64_t ns_rx_beacons; /* rx beacon frames */
1559
+ u_int32_t ns_rx_proberesp; /* rx probe response frames */
1561
+ u_int32_t ns_rx_dup; /* rx discard because it's a dup */
1562
+ u_int32_t ns_rx_noprivacy; /* rx w/ wep but privacy off */
1563
+ u_int32_t ns_rx_wepfail; /* rx wep processing failed */
1564
+ u_int32_t ns_rx_demicfail; /* rx demic failed */
1565
+ u_int32_t ns_rx_decap; /* rx decapsulation failed */
1566
+ u_int32_t ns_rx_defrag; /* rx defragmentation failed */
1567
+ u_int32_t ns_rx_disassoc; /* rx disassociation */
1568
+ u_int32_t ns_rx_deauth; /* rx deauthentication */
1569
+ u_int32_t ns_rx_decryptcrc; /* rx decrypt failed on crc */
1570
+ u_int32_t ns_rx_unauth; /* rx on unauthorized port */
1571
+ u_int32_t ns_rx_unencrypted; /* rx unecrypted w/ privacy */
1573
+ u_int32_t ns_tx_data; /* tx data frames */
1574
+ u_int32_t ns_tx_mgmt; /* tx management frames */
1575
+ u_int32_t ns_tx_ucast; /* tx unicast frames */
1576
+ u_int32_t ns_tx_mcast; /* tx multi/broadcast frames */
1577
+ u_int64_t ns_tx_bytes; /* tx data count (bytes) */
1578
+ u_int32_t ns_tx_probereq; /* tx probe request frames */
1579
+ u_int32_t ns_tx_uapsd; /* tx on uapsd queue */
1581
+ u_int32_t ns_tx_novlantag; /* tx discard due to no tag */
1582
+ u_int32_t ns_tx_vlanmismatch; /* tx discard due to of bad tag */
1584
+ u_int32_t ns_tx_eosplost; /* uapsd EOSP retried out */
1586
+ u_int32_t ns_ps_discard; /* ps discard due to of age */
1588
+ u_int32_t ns_uapsd_triggers; /* uapsd triggers */
1590
+ /* MIB-related state */
1591
+ u_int32_t ns_tx_assoc; /* [re]associations */
1592
+ u_int32_t ns_tx_assoc_fail; /* [re]association failures */
1593
+ u_int32_t ns_tx_auth; /* [re]authentications */
1594
+ u_int32_t ns_tx_auth_fail; /* [re]authentication failures*/
1595
+ u_int32_t ns_tx_deauth; /* deauthentications */
1596
+ u_int32_t ns_tx_deauth_code; /* last deauth reason */
1597
+ u_int32_t ns_tx_disassoc; /* disassociations */
1598
+ u_int32_t ns_tx_disassoc_code; /* last disassociation reason */
1599
+ u_int32_t ns_psq_drops; /* power save queue drops */
1603
+ * Summary statistics.
1605
+struct ieee80211_stats {
1606
+ u_int32_t is_rx_badversion; /* rx frame with bad version */
1607
+ u_int32_t is_rx_tooshort; /* rx frame too short */
1608
+ u_int32_t is_rx_wrongbss; /* rx from wrong bssid */
1609
+ u_int32_t is_rx_dup; /* rx discard due to it's a dup */
1610
+ u_int32_t is_rx_wrongdir; /* rx w/ wrong direction */
1611
+ u_int32_t is_rx_mcastecho; /* rx discard due to of mcast echo */
1612
+ u_int32_t is_rx_notassoc; /* rx discard due to sta !assoc */
1613
+ u_int32_t is_rx_noprivacy; /* rx w/ wep but privacy off */
1614
+ u_int32_t is_rx_unencrypted; /* rx w/o wep and privacy on */
1615
+ u_int32_t is_rx_wepfail; /* rx wep processing failed */
1616
+ u_int32_t is_rx_decap; /* rx decapsulation failed */
1617
+ u_int32_t is_rx_mgtdiscard; /* rx discard mgt frames */
1618
+ u_int32_t is_rx_ctl; /* rx discard ctrl frames */
1619
+ u_int32_t is_rx_beacon; /* rx beacon frames */
1620
+ u_int32_t is_rx_rstoobig; /* rx rate set truncated */
1621
+ u_int32_t is_rx_elem_missing; /* rx required element missing*/
1622
+ u_int32_t is_rx_elem_toobig; /* rx element too big */
1623
+ u_int32_t is_rx_elem_toosmall; /* rx element too small */
1624
+ u_int32_t is_rx_elem_unknown; /* rx element unknown */
1625
+ u_int32_t is_rx_badchan; /* rx frame w/ invalid chan */
1626
+ u_int32_t is_rx_chanmismatch; /* rx frame chan mismatch */
1627
+ u_int32_t is_rx_nodealloc; /* rx frame dropped */
1628
+ u_int32_t is_rx_ssidmismatch; /* rx frame ssid mismatch */
1629
+ u_int32_t is_rx_auth_unsupported;/* rx w/ unsupported auth alg */
1630
+ u_int32_t is_rx_auth_fail; /* rx sta auth failure */
1631
+ u_int32_t is_rx_auth_countermeasures;/* rx auth discard due to CM */
1632
+ u_int32_t is_rx_assoc_bss; /* rx assoc from wrong bssid */
1633
+ u_int32_t is_rx_assoc_notauth; /* rx assoc w/o auth */
1634
+ u_int32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */
1635
+ u_int32_t is_rx_assoc_norate; /* rx assoc w/ no rate match */
1636
+ u_int32_t is_rx_assoc_badwpaie; /* rx assoc w/ bad WPA IE */
1637
+ u_int32_t is_rx_deauth; /* rx deauthentication */
1638
+ u_int32_t is_rx_disassoc; /* rx disassociation */
1639
+ u_int32_t is_rx_badsubtype; /* rx frame w/ unknown subtype*/
1640
+ u_int32_t is_rx_nobuf; /* rx failed for lack of buf */
1641
+ u_int32_t is_rx_decryptcrc; /* rx decrypt failed on crc */
1642
+ u_int32_t is_rx_ahdemo_mgt; /* rx discard ahdemo mgt frame*/
1643
+ u_int32_t is_rx_bad_auth; /* rx bad auth request */
1644
+ u_int32_t is_rx_unauth; /* rx on unauthorized port */
1645
+ u_int32_t is_rx_badkeyid; /* rx w/ incorrect keyid */
1646
+ u_int32_t is_rx_ccmpreplay; /* rx seq# violation (CCMP) */
1647
+ u_int32_t is_rx_ccmpformat; /* rx format bad (CCMP) */
1648
+ u_int32_t is_rx_ccmpmic; /* rx MIC check failed (CCMP) */
1649
+ u_int32_t is_rx_tkipreplay; /* rx seq# violation (TKIP) */
1650
+ u_int32_t is_rx_tkipformat; /* rx format bad (TKIP) */
1651
+ u_int32_t is_rx_tkipmic; /* rx MIC check failed (TKIP) */
1652
+ u_int32_t is_rx_tkipicv; /* rx ICV check failed (TKIP) */
1653
+ u_int32_t is_rx_badcipher; /* rx failed due to of key type */
1654
+ u_int32_t is_rx_nocipherctx; /* rx failed due to key !setup */
1655
+ u_int32_t is_rx_acl; /* rx discard due to of acl policy */
1656
+ u_int32_t is_rx_ffcnt; /* rx fast frames */
1657
+ u_int32_t is_rx_badathtnl; /* driver key alloc failed */
1658
+ u_int32_t is_tx_nobuf; /* tx failed for lack of buf */
1659
+ u_int32_t is_tx_nonode; /* tx failed for no node */
1660
+ u_int32_t is_tx_unknownmgt; /* tx of unknown mgt frame */
1661
+ u_int32_t is_tx_badcipher; /* tx failed due to of key type */
1662
+ u_int32_t is_tx_nodefkey; /* tx failed due to no defkey */
1663
+ u_int32_t is_tx_noheadroom; /* tx failed due to no space */
1664
+ u_int32_t is_tx_ffokcnt; /* tx fast frames sent success */
1665
+ u_int32_t is_tx_fferrcnt; /* tx fast frames sent success */
1666
+ u_int32_t is_scan_active; /* active scans started */
1667
+ u_int32_t is_scan_passive; /* passive scans started */
1668
+ u_int32_t is_node_timeout; /* nodes timed out inactivity */
1669
+ u_int32_t is_crypto_nomem; /* no memory for crypto ctx */
1670
+ u_int32_t is_crypto_tkip; /* tkip crypto done in s/w */
1671
+ u_int32_t is_crypto_tkipenmic; /* tkip en-MIC done in s/w */
1672
+ u_int32_t is_crypto_tkipdemic; /* tkip de-MIC done in s/w */
1673
+ u_int32_t is_crypto_tkipcm; /* tkip counter measures */
1674
+ u_int32_t is_crypto_ccmp; /* ccmp crypto done in s/w */
1675
+ u_int32_t is_crypto_wep; /* wep crypto done in s/w */
1676
+ u_int32_t is_crypto_setkey_cipher;/* cipher rejected key */
1677
+ u_int32_t is_crypto_setkey_nokey;/* no key index for setkey */
1678
+ u_int32_t is_crypto_delkey; /* driver key delete failed */
1679
+ u_int32_t is_crypto_badcipher; /* unknown cipher */
1680
+ u_int32_t is_crypto_nocipher; /* cipher not available */
1681
+ u_int32_t is_crypto_attachfail; /* cipher attach failed */
1682
+ u_int32_t is_crypto_swfallback; /* cipher fallback to s/w */
1683
+ u_int32_t is_crypto_keyfail; /* driver key alloc failed */
1684
+ u_int32_t is_crypto_enmicfail; /* en-MIC failed */
1685
+ u_int32_t is_ibss_capmismatch; /* merge failed-cap mismatch */
1686
+ u_int32_t is_ibss_norate; /* merge failed-rate mismatch */
1687
+ u_int32_t is_ps_unassoc; /* ps-poll for unassoc. sta */
1688
+ u_int32_t is_ps_badaid; /* ps-poll w/ incorrect aid */
1689
+ u_int32_t is_ps_qempty; /* ps-poll w/ nothing to send */
1693
+ * Max size of optional information elements. We artificially
1694
+ * constrain this; it's limited only by the max frame size (and
1695
+ * the max parameter size of the wireless extensions).
1697
+#define IEEE80211_MAX_OPT_IE 256
1700
+ * WPA/RSN get/set key request. Specify the key/cipher
1701
+ * type and whether the key is to be used for sending and/or
1702
+ * receiving. The key index should be set only when working
1703
+ * with global keys (use IEEE80211_KEYIX_NONE for ``no index'').
1704
+ * Otherwise a unicast/pairwise key is specified by the bssid
1705
+ * (on a station) or mac address (on an ap). They key length
1706
+ * must include any MIC key data; otherwise it should be no
1707
+ more than IEEE80211_KEYBUF_SIZE.
1709
+struct ieee80211req_key {
1710
+ u_int8_t ik_type; /* key/cipher type */
1712
+ u_int16_t ik_keyix; /* key index */
1713
+ u_int8_t ik_keylen; /* key length in bytes */
1714
+ u_int8_t ik_flags;
1715
+/* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */
1716
+#define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */
1717
+ u_int8_t ik_macaddr[IEEE80211_ADDR_LEN];
1718
+ u_int64_t ik_keyrsc; /* key receive sequence counter */
1719
+ u_int64_t ik_keytsc; /* key transmit sequence counter */
1720
+ u_int8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
1724
+ * Delete a key either by index or address. Set the index
1725
+ * to IEEE80211_KEYIX_NONE when deleting a unicast key.
1727
+struct ieee80211req_del_key {
1728
+ u_int8_t idk_keyix; /* key index */
1729
+ u_int8_t idk_macaddr[IEEE80211_ADDR_LEN];
1733
+ * MLME state manipulation request. IEEE80211_MLME_ASSOC
1734
+ * only makes sense when operating as a station. The other
1735
+ * requests can be used when operating as a station or an
1736
+ * ap (to effect a station).
1738
+struct ieee80211req_mlme {
1739
+ u_int8_t im_op; /* operation to perform */
1740
+#define IEEE80211_MLME_ASSOC 1 /* associate station */
1741
+#define IEEE80211_MLME_DISASSOC 2 /* disassociate station */
1742
+#define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */
1743
+#define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */
1744
+#define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */
1745
+#define IEEE80211_MLME_CLEAR_STATS 6 /* clear station statistic */
1746
+ u_int8_t im_ssid_len; /* length of optional ssid */
1747
+ u_int16_t im_reason; /* 802.11 reason code */
1748
+ u_int8_t im_macaddr[IEEE80211_ADDR_LEN];
1749
+ u_int8_t im_ssid[IEEE80211_NWID_LEN];
1753
+ * MAC ACL operations.
1756
+ IEEE80211_MACCMD_POLICY_OPEN = 0, /* set policy: no ACL's */
1757
+ IEEE80211_MACCMD_POLICY_ALLOW = 1, /* set policy: allow traffic */
1758
+ IEEE80211_MACCMD_POLICY_DENY = 2, /* set policy: deny traffic */
1759
+ IEEE80211_MACCMD_FLUSH = 3, /* flush ACL database */
1760
+ IEEE80211_MACCMD_DETACH = 4, /* detach ACL policy */
1764
+ * Set the active channel list. Note this list is
1765
+ * intersected with the available channel list in
1766
+ * calculating the set of channels actually used in
1769
+struct ieee80211req_chanlist {
1770
+ u_int8_t ic_channels[IEEE80211_CHAN_BYTES];
1774
+ * Get the active channel list info.
1776
+struct ieee80211req_chaninfo {
1778
+ struct ieee80211_channel ic_chans[IEEE80211_CHAN_MAX];
1782
+ * Retrieve the WPA/RSN information element for an associated station.
1784
+struct ieee80211req_wpaie {
1785
+ u_int8_t wpa_macaddr[IEEE80211_ADDR_LEN];
1786
+ u_int8_t wpa_ie[IEEE80211_MAX_OPT_IE];
1787
+ u_int8_t rsn_ie[IEEE80211_MAX_OPT_IE];
1791
+ * Retrieve per-node statistics.
1793
+struct ieee80211req_sta_stats {
1795
+ /* NB: explicitly force 64-bit alignment */
1796
+ u_int8_t macaddr[IEEE80211_ADDR_LEN];
1799
+ struct ieee80211_nodestats is_stats;
1803
+ * Station information block; the mac address is used
1804
+ * to retrieve other data like stats, unicast key, etc.
1806
+struct ieee80211req_sta_info {
1807
+ u_int16_t isi_len; /* length (mult of 4) */
1808
+ u_int16_t isi_freq; /* MHz */
1809
+ u_int16_t isi_flags; /* channel flags */
1810
+ u_int16_t isi_state; /* state flags */
1811
+ u_int8_t isi_authmode; /* authentication algorithm */
1812
+ u_int8_t isi_rssi;
1813
+ u_int16_t isi_capinfo; /* capabilities */
1814
+ u_int8_t isi_athflags; /* Atheros capabilities */
1815
+ u_int8_t isi_erp; /* ERP element */
1816
+ u_int8_t isi_macaddr[IEEE80211_ADDR_LEN];
1817
+ u_int8_t isi_nrates; /* negotiated rates */
1818
+ u_int8_t isi_rates[IEEE80211_RATE_MAXSIZE];
1819
+ u_int8_t isi_txrate; /* index to isi_rates[] */
1820
+ u_int16_t isi_ie_len; /* IE length */
1821
+ u_int16_t isi_associd; /* assoc response */
1822
+ u_int16_t isi_txpower; /* current tx power */
1823
+ u_int16_t isi_vlan; /* vlan tag */
1824
+ u_int16_t isi_txseqs[17]; /* seq to be transmitted */
1825
+ u_int16_t isi_rxseqs[17]; /* seq previous for qos frames*/
1826
+ u_int16_t isi_inact; /* inactivity timer */
1827
+ u_int8_t isi_uapsd; /* UAPSD queues */
1828
+ u_int8_t isi_opmode; /* sta operating mode */
1830
+ /* XXX frag state? */
1831
+ /* variable length IE data */
1835
+ IEEE80211_STA_OPMODE_NORMAL,
1836
+ IEEE80211_STA_OPMODE_XR
1840
+ * Retrieve per-station information; to retrieve all
1841
+ * specify a mac address of ff:ff:ff:ff:ff:ff.
1843
+struct ieee80211req_sta_req {
1845
+ /* NB: explicitly force 64-bit alignment */
1846
+ u_int8_t macaddr[IEEE80211_ADDR_LEN];
1849
+ struct ieee80211req_sta_info info[1]; /* variable length */
1853
+ * Get/set per-station tx power cap.
1855
+struct ieee80211req_sta_txpow {
1856
+ u_int8_t it_macaddr[IEEE80211_ADDR_LEN];
1857
+ u_int8_t it_txpow;
1861
+ * WME parameters are set and return using i_val and i_len.
1862
+ * i_val holds the value itself. i_len specifies the AC
1863
+ * and, as appropriate, then high bit specifies whether the
1864
+ * operation is to be applied to the BSS or ourself.
1866
+#define IEEE80211_WMEPARAM_SELF 0x0000 /* parameter applies to self */
1867
+#define IEEE80211_WMEPARAM_BSS 0x8000 /* parameter applies to BSS */
1868
+#define IEEE80211_WMEPARAM_VAL 0x7fff /* parameter value */
1871
+ * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
1873
+struct ieee80211req_scan_result {
1874
+ u_int16_t isr_len; /* length (mult of 4) */
1875
+ u_int16_t isr_freq; /* MHz */
1876
+ u_int16_t isr_flags; /* channel flags */
1877
+ u_int8_t isr_noise;
1878
+ u_int8_t isr_rssi;
1879
+ u_int8_t isr_intval; /* beacon interval */
1880
+ u_int16_t isr_capinfo; /* capabilities */
1881
+ u_int8_t isr_erp; /* ERP element */
1882
+ u_int8_t isr_bssid[IEEE80211_ADDR_LEN];
1883
+ u_int8_t isr_nrates;
1884
+ u_int8_t isr_rates[IEEE80211_RATE_MAXSIZE];
1885
+ u_int8_t isr_ssid_len; /* SSID length */
1886
+ u_int8_t isr_ie_len; /* IE length */
1887
+ u_int8_t isr_pad[5];
1888
+ /* variable length SSID followed by IE data */
1893
+ * FreeBSD-style ioctls.
1895
+/* the first member must be matched with struct ifreq */
1896
+struct ieee80211req {
1897
+ char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
1898
+ u_int16_t i_type; /* req type */
1899
+ int16_t i_val; /* Index or simple value */
1900
+ int16_t i_len; /* Index or simple value */
1901
+ void *i_data; /* Extra data */
1903
+#define SIOCS80211 _IOW('i', 234, struct ieee80211req)
1904
+#define SIOCG80211 _IOWR('i', 235, struct ieee80211req)
1905
+#define SIOCG80211STATS _IOWR('i', 236, struct ifreq)
1906
+#define SIOC80211IFCREATE _IOWR('i', 237, struct ifreq)
1907
+#define SIOC80211IFDESTROY _IOW('i', 238, struct ifreq)
1909
+#define IEEE80211_IOC_SSID 1
1910
+#define IEEE80211_IOC_NUMSSIDS 2
1911
+#define IEEE80211_IOC_WEP 3
1912
+#define IEEE80211_WEP_NOSUP -1
1913
+#define IEEE80211_WEP_OFF 0
1914
+#define IEEE80211_WEP_ON 1
1915
+#define IEEE80211_WEP_MIXED 2
1916
+#define IEEE80211_IOC_WEPKEY 4
1917
+#define IEEE80211_IOC_NUMWEPKEYS 5
1918
+#define IEEE80211_IOC_WEPTXKEY 6
1919
+#define IEEE80211_IOC_AUTHMODE 7
1920
+#define IEEE80211_IOC_STATIONNAME 8
1921
+#define IEEE80211_IOC_CHANNEL 9
1922
+#define IEEE80211_IOC_POWERSAVE 10
1923
+#define IEEE80211_POWERSAVE_NOSUP -1
1924
+#define IEEE80211_POWERSAVE_OFF 0
1925
+#define IEEE80211_POWERSAVE_CAM 1
1926
+#define IEEE80211_POWERSAVE_PSP 2
1927
+#define IEEE80211_POWERSAVE_PSP_CAM 3
1928
+#define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM
1929
+#define IEEE80211_IOC_POWERSAVESLEEP 11
1930
+#define IEEE80211_IOC_RTSTHRESHOLD 12
1931
+#define IEEE80211_IOC_PROTMODE 13
1932
+#define IEEE80211_PROTMODE_OFF 0
1933
+#define IEEE80211_PROTMODE_CTS 1
1934
+#define IEEE80211_PROTMODE_RTSCTS 2
1935
+#define IEEE80211_IOC_TXPOWER 14 /* global tx power limit */
1936
+#define IEEE80211_IOC_BSSID 15
1937
+#define IEEE80211_IOC_ROAMING 16 /* roaming mode */
1938
+#define IEEE80211_IOC_PRIVACY 17 /* privacy invoked */
1939
+#define IEEE80211_IOC_DROPUNENCRYPTED 18 /* discard unencrypted frames */
1940
+#define IEEE80211_IOC_WPAKEY 19
1941
+#define IEEE80211_IOC_DELKEY 20
1942
+#define IEEE80211_IOC_MLME 21
1943
+#define IEEE80211_IOC_OPTIE 22 /* optional info. element */
1944
+#define IEEE80211_IOC_SCAN_REQ 23
1945
+#define IEEE80211_IOC_SCAN_RESULTS 24
1946
+#define IEEE80211_IOC_COUNTERMEASURES 25 /* WPA/TKIP countermeasures */
1947
+#define IEEE80211_IOC_WPA 26 /* WPA mode (0,1,2) */
1948
+#define IEEE80211_IOC_CHANLIST 27 /* channel list */
1949
+#define IEEE80211_IOC_WME 28 /* WME mode (on, off) */
1950
+#define IEEE80211_IOC_HIDESSID 29 /* hide SSID mode (on, off) */
1951
+#define IEEE80211_IOC_APBRIDGE 30 /* AP inter-sta bridging */
1952
+#define IEEE80211_IOC_MCASTCIPHER 31 /* multicast/default cipher */
1953
+#define IEEE80211_IOC_MCASTKEYLEN 32 /* multicast key length */
1954
+#define IEEE80211_IOC_UCASTCIPHERS 33 /* unicast cipher suites */
1955
+#define IEEE80211_IOC_UCASTCIPHER 34 /* unicast cipher */
1956
+#define IEEE80211_IOC_UCASTKEYLEN 35 /* unicast key length */
1957
+#define IEEE80211_IOC_DRIVER_CAPS 36 /* driver capabilities */
1958
+#define IEEE80211_IOC_KEYMGTALGS 37 /* key management algorithms */
1959
+#define IEEE80211_IOC_RSNCAPS 38 /* RSN capabilities */
1960
+#define IEEE80211_IOC_WPAIE 39 /* WPA information element */
1961
+#define IEEE80211_IOC_STA_STATS 40 /* per-station statistics */
1962
+#define IEEE80211_IOC_MACCMD 41 /* MAC ACL operation */
1963
+#define IEEE80211_IOC_TXPOWMAX 43 /* max tx power for channel */
1964
+#define IEEE80211_IOC_STA_TXPOW 44 /* per-station tx power limit */
1965
+#define IEEE80211_IOC_STA_INFO 45 /* station/neighbor info */
1966
+#define IEEE80211_IOC_WME_CWMIN 46 /* WME: ECWmin */
1967
+#define IEEE80211_IOC_WME_CWMAX 47 /* WME: ECWmax */
1968
+#define IEEE80211_IOC_WME_AIFS 48 /* WME: AIFSN */
1969
+#define IEEE80211_IOC_WME_TXOPLIMIT 49 /* WME: txops limit */
1970
+#define IEEE80211_IOC_WME_ACM 50 /* WME: ACM (bss only) */
1971
+#define IEEE80211_IOC_WME_ACKPOLICY 51 /* WME: ACK policy (!bss only)*/
1972
+#define IEEE80211_IOC_DTIM_PERIOD 52 /* DTIM period (beacons) */
1973
+#define IEEE80211_IOC_BEACON_INTERVAL 53 /* beacon interval (ms) */
1974
+#define IEEE80211_IOC_ADDMAC 54 /* add sta to MAC ACL table */
1975
+#define IEEE80211_IOC_DELMAC 55 /* del sta from MAC ACL table */
1976
+#define IEEE80211_IOC_FF 56 /* ATH fast frames (on, off) */
1977
+#define IEEE80211_IOC_TURBOP 57 /* ATH turbo' (on, off) */
1978
+#define IEEE80211_IOC_APPIEBUF 58 /* IE in the management frame */
1979
+#define IEEE80211_IOC_FILTERFRAME 59 /* management frame filter */
1982
+ * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
1984
+struct ieee80211req_scan_result {
1985
+ u_int16_t isr_len; /* length (mult of 4) */
1986
+ u_int16_t isr_freq; /* MHz */
1987
+ u_int16_t isr_flags; /* channel flags */
1988
+ u_int8_t isr_noise;
1989
+ u_int8_t isr_rssi;
1990
+ u_int8_t isr_intval; /* beacon interval */
1991
+ u_int16_t isr_capinfo; /* capabilities */
1992
+ u_int8_t isr_erp; /* ERP element */
1993
+ u_int8_t isr_bssid[IEEE80211_ADDR_LEN];
1994
+ u_int8_t isr_nrates;
1995
+ u_int8_t isr_rates[IEEE80211_RATE_MAXSIZE];
1996
+ u_int8_t isr_ssid_len; /* SSID length */
1997
+ u_int8_t isr_ie_len; /* IE length */
1998
+ u_int8_t isr_pad[5];
1999
+ /* variable length SSID followed by IE data */
2002
+#endif /* __FreeBSD__ */
2006
+ * Wireless Extensions API, private ioctl interfaces.
2008
+ * NB: Even-numbered ioctl numbers have set semantics and are privileged!
2009
+ * (regardless of the incorrect comment in wireless.h!)
2012
+#include <linux/if.h>
2014
+#define IEEE80211_IOCTL_SETPARAM (SIOCIWFIRSTPRIV+0)
2015
+#define IEEE80211_IOCTL_GETPARAM (SIOCIWFIRSTPRIV+1)
2016
+#define IEEE80211_IOCTL_SETMODE (SIOCIWFIRSTPRIV+2)
2017
+#define IEEE80211_IOCTL_GETMODE (SIOCIWFIRSTPRIV+3)
2018
+#define IEEE80211_IOCTL_SETWMMPARAMS (SIOCIWFIRSTPRIV+4)
2019
+#define IEEE80211_IOCTL_GETWMMPARAMS (SIOCIWFIRSTPRIV+5)
2020
+#define IEEE80211_IOCTL_SETCHANLIST (SIOCIWFIRSTPRIV+6)
2021
+#define IEEE80211_IOCTL_GETCHANLIST (SIOCIWFIRSTPRIV+7)
2022
+#define IEEE80211_IOCTL_CHANSWITCH (SIOCIWFIRSTPRIV+8)
2023
+#define IEEE80211_IOCTL_GET_APPIEBUF (SIOCIWFIRSTPRIV+9)
2024
+#define IEEE80211_IOCTL_SET_APPIEBUF (SIOCIWFIRSTPRIV+10)
2025
+#define IEEE80211_IOCTL_FILTERFRAME (SIOCIWFIRSTPRIV+12)
2026
+#define IEEE80211_IOCTL_GETCHANINFO (SIOCIWFIRSTPRIV+13)
2027
+#define IEEE80211_IOCTL_SETOPTIE (SIOCIWFIRSTPRIV+14)
2028
+#define IEEE80211_IOCTL_GETOPTIE (SIOCIWFIRSTPRIV+15)
2029
+#define IEEE80211_IOCTL_SETMLME (SIOCIWFIRSTPRIV+16)
2030
+#define IEEE80211_IOCTL_SETKEY (SIOCIWFIRSTPRIV+18)
2031
+#define IEEE80211_IOCTL_DELKEY (SIOCIWFIRSTPRIV+20)
2032
+#define IEEE80211_IOCTL_ADDMAC (SIOCIWFIRSTPRIV+22)
2033
+#define IEEE80211_IOCTL_DELMAC (SIOCIWFIRSTPRIV+24)
2034
+#define IEEE80211_IOCTL_WDSADDMAC (SIOCIWFIRSTPRIV+26)
2035
+#define IEEE80211_IOCTL_WDSDELMAC (SIOCIWFIRSTPRIV+28)
2036
+#define IEEE80211_IOCTL_KICKMAC (SIOCIWFIRSTPRIV+30)
2039
+ IEEE80211_WMMPARAMS_CWMIN = 1,
2040
+ IEEE80211_WMMPARAMS_CWMAX = 2,
2041
+ IEEE80211_WMMPARAMS_AIFS = 3,
2042
+ IEEE80211_WMMPARAMS_TXOPLIMIT = 4,
2043
+ IEEE80211_WMMPARAMS_ACM = 5,
2044
+ IEEE80211_WMMPARAMS_NOACKPOLICY = 6,
2047
+ IEEE80211_PARAM_TURBO = 1, /* turbo mode */
2048
+ IEEE80211_PARAM_MODE = 2, /* phy mode (11a, 11b, etc.) */
2049
+ IEEE80211_PARAM_AUTHMODE = 3, /* authentication mode */
2050
+ IEEE80211_PARAM_PROTMODE = 4, /* 802.11g protection */
2051
+ IEEE80211_PARAM_MCASTCIPHER = 5, /* multicast/default cipher */
2052
+ IEEE80211_PARAM_MCASTKEYLEN = 6, /* multicast key length */
2053
+ IEEE80211_PARAM_UCASTCIPHERS = 7, /* unicast cipher suites */
2054
+ IEEE80211_PARAM_UCASTCIPHER = 8, /* unicast cipher */
2055
+ IEEE80211_PARAM_UCASTKEYLEN = 9, /* unicast key length */
2056
+ IEEE80211_PARAM_WPA = 10, /* WPA mode (0,1,2) */
2057
+ IEEE80211_PARAM_ROAMING = 12, /* roaming mode */
2058
+ IEEE80211_PARAM_PRIVACY = 13, /* privacy invoked */
2059
+ IEEE80211_PARAM_COUNTERMEASURES = 14, /* WPA/TKIP countermeasures */
2060
+ IEEE80211_PARAM_DROPUNENCRYPTED = 15, /* discard unencrypted frames */
2061
+ IEEE80211_PARAM_DRIVER_CAPS = 16, /* driver capabilities */
2062
+ IEEE80211_PARAM_MACCMD = 17, /* MAC ACL operation */
2063
+ IEEE80211_PARAM_WMM = 18, /* WMM mode (on, off) */
2064
+ IEEE80211_PARAM_HIDESSID = 19, /* hide SSID mode (on, off) */
2065
+ IEEE80211_PARAM_APBRIDGE = 20, /* AP inter-sta bridging */
2066
+ IEEE80211_PARAM_KEYMGTALGS = 21, /* key management algorithms */
2067
+ IEEE80211_PARAM_RSNCAPS = 22, /* RSN capabilities */
2068
+ IEEE80211_PARAM_INACT = 23, /* station inactivity timeout */
2069
+ IEEE80211_PARAM_INACT_AUTH = 24, /* station auth inact timeout */
2070
+ IEEE80211_PARAM_INACT_INIT = 25, /* station init inact timeout */
2071
+ IEEE80211_PARAM_ABOLT = 26, /* Atheros Adv. Capabilities */
2072
+ IEEE80211_PARAM_DTIM_PERIOD = 28, /* DTIM period (beacons) */
2073
+ IEEE80211_PARAM_BEACON_INTERVAL = 29, /* beacon interval (ms) */
2074
+ IEEE80211_PARAM_DOTH = 30, /* 11.h is on/off */
2075
+ IEEE80211_PARAM_PWRTARGET = 31, /* Current Channel Pwr Constraint */
2076
+ IEEE80211_PARAM_GENREASSOC = 32, /* Generate a reassociation request */
2077
+ IEEE80211_PARAM_COMPRESSION = 33, /* compression */
2078
+ IEEE80211_PARAM_FF = 34, /* fast frames support */
2079
+ IEEE80211_PARAM_XR = 35, /* XR support */
2080
+ IEEE80211_PARAM_BURST = 36, /* burst mode */
2081
+ IEEE80211_PARAM_PUREG = 37, /* pure 11g (no 11b stations) */
2082
+ IEEE80211_PARAM_AR = 38, /* AR support */
2083
+ IEEE80211_PARAM_WDS = 39, /* Enable 4 address processing */
2084
+ IEEE80211_PARAM_BGSCAN = 40, /* bg scanning (on, off) */
2085
+ IEEE80211_PARAM_BGSCAN_IDLE = 41, /* bg scan idle threshold */
2086
+ IEEE80211_PARAM_BGSCAN_INTERVAL = 42, /* bg scan interval */
2087
+ IEEE80211_PARAM_MCAST_RATE = 43, /* Multicast Tx Rate */
2088
+ IEEE80211_PARAM_COVERAGE_CLASS = 44, /* coverage class */
2089
+ IEEE80211_PARAM_COUNTRY_IE = 45, /* enable country IE */
2090
+ IEEE80211_PARAM_SCANVALID = 46, /* scan cache valid threshold */
2091
+ IEEE80211_PARAM_ROAM_RSSI_11A = 47, /* rssi threshold in 11a */
2092
+ IEEE80211_PARAM_ROAM_RSSI_11B = 48, /* rssi threshold in 11b */
2093
+ IEEE80211_PARAM_ROAM_RSSI_11G = 49, /* rssi threshold in 11g */
2094
+ IEEE80211_PARAM_ROAM_RATE_11A = 50, /* tx rate threshold in 11a */
2095
+ IEEE80211_PARAM_ROAM_RATE_11B = 51, /* tx rate threshold in 11b */
2096
+ IEEE80211_PARAM_ROAM_RATE_11G = 52, /* tx rate threshold in 11g */
2097
+ IEEE80211_PARAM_UAPSDINFO = 53, /* value for qos info field */
2098
+ IEEE80211_PARAM_SLEEP = 54, /* force sleep/wake */
2099
+ IEEE80211_PARAM_QOSNULL = 55, /* force sleep/wake */
2100
+ IEEE80211_PARAM_PSPOLL = 56, /* force ps-poll generation (sta only) */
2101
+ IEEE80211_PARAM_EOSPDROP = 57, /* force uapsd EOSP drop (ap only) */
2102
+ IEEE80211_PARAM_MARKDFS = 58, /* mark a dfs interference channel when found */
2103
+ IEEE80211_PARAM_REGCLASS = 59, /* enable regclass ids in country IE */
2104
+ IEEE80211_PARAM_DROPUNENC_EAPOL = 60, /* drop unencrypted eapol frames */
2107
+#define SIOCG80211STATS (SIOCDEVPRIVATE+2)
2108
+/* NB: require in+out parameters so cannot use wireless extensions, yech */
2109
+#define IEEE80211_IOCTL_GETKEY (SIOCDEVPRIVATE+3)
2110
+#define IEEE80211_IOCTL_GETWPAIE (SIOCDEVPRIVATE+4)
2111
+#define IEEE80211_IOCTL_STA_STATS (SIOCDEVPRIVATE+5)
2112
+#define IEEE80211_IOCTL_STA_INFO (SIOCDEVPRIVATE+6)
2113
+#define SIOC80211IFCREATE (SIOCDEVPRIVATE+7)
2114
+#define SIOC80211IFDESTROY (SIOCDEVPRIVATE+8)
2115
+#define IEEE80211_IOCTL_SCAN_RESULTS (SIOCDEVPRIVATE+9)
2117
+struct ieee80211_clone_params {
2118
+ char icp_name[IFNAMSIZ]; /* device name */
2119
+ u_int16_t icp_opmode; /* operating mode */
2120
+ u_int16_t icp_flags; /* see below */
2121
+#define IEEE80211_CLONE_BSSID 0x0001 /* allocate unique mac/bssid */
2122
+#define IEEE80211_NO_STABEACONS 0x0002 /* Do not setup the station beacon timers */
2125
+/* APPIEBUF related definitions */
2127
+/* Management frame type to which application IE is added */
2129
+ IEEE80211_APPIE_FRAME_BEACON = 0,
2130
+ IEEE80211_APPIE_FRAME_PROBE_REQ = 1,
2131
+ IEEE80211_APPIE_FRAME_PROBE_RESP = 2,
2132
+ IEEE80211_APPIE_FRAME_ASSOC_REQ = 3,
2133
+ IEEE80211_APPIE_FRAME_ASSOC_RESP = 4,
2134
+ IEEE80211_APPIE_NUM_OF_FRAME = 5
2137
+struct ieee80211req_getset_appiebuf {
2138
+ u_int32_t app_frmtype; /* management frame type for which buffer is added */
2139
+ u_int32_t app_buflen; /* application-supplied buffer length */
2140
+ u_int8_t app_buf[]; /* application-supplied IE(s) */
2143
+/* Flags ORed by application to set filter for receiving management frames */
2145
+ IEEE80211_FILTER_TYPE_BEACON = 1<<0,
2146
+ IEEE80211_FILTER_TYPE_PROBE_REQ = 1<<1,
2147
+ IEEE80211_FILTER_TYPE_PROBE_RESP = 1<<2,
2148
+ IEEE80211_FILTER_TYPE_ASSOC_REQ = 1<<3,
2149
+ IEEE80211_FILTER_TYPE_ASSOC_RESP = 1<<4,
2150
+ IEEE80211_FILTER_TYPE_AUTH = 1<<5,
2151
+ IEEE80211_FILTER_TYPE_DEAUTH = 1<<6,
2152
+ IEEE80211_FILTER_TYPE_DISASSOC = 1<<7,
2153
+ IEEE80211_FILTER_TYPE_ALL = 0xFF /* used to check the valid filter bits */
2156
+struct ieee80211req_set_filter {
2157
+ u_int32_t app_filterype; /* management frame filter type */
2161
+#endif /* __linux__ */
2163
+#endif /* _NET80211_IEEE80211_IOCTL_H_ */