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