~ubuntu-branches/ubuntu/gutsy/wpasupplicant/gutsy

« back to all changes in this revision

Viewing changes to debian/patches/21_madwifiold_20060207_includes.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler, Alexander Sack
  • Date: 2007-08-26 16:06:57 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20070826160657-2m8pxoweuxe8f93t
Tags: 0.6.0+0.5.8-0ubuntu1
* New upstream release
* remove patch 11_erroneous_manpage_ref, applied upstream
* remove patch 25_wpas_dbus_unregister_iface_fix, applied upstream

[ Alexander Sack ]
* bumping upstream version to replace development version 0.6.0 with
  this package from stable release branch.
* attempt to fix wierd timeout and high latency issues by going
  back to stable upstream version (0.5.9) (LP: #140763,
  LP: #141233).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## madwifiold-20060207-includes.patch by Kel Modderman <kelrin@tpg.com.au>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
##
 
6
## DP: Development includes for supporting madwifi ioctl's. These includes
 
7
## DP: are taken from the madwifi-old branch of madwifi.org svn 
 
8
## DP: (via madwifi-dev). Be aware that the resulting wpasupplicant
 
9
## DP: binaries cannot work with the madwifi-ng driver.
 
10
 
 
11
@DPATCH@
 
12
diff -Nru wpa_supplicant.orig/driver_madwifi/include/compat.h wpa_supplicant/driver_madwifi/include/compat.h
 
13
--- wpa_supplicant.orig/driver_madwifi/include/compat.h 1970-01-01 10:00:00.000000000 +1000
 
14
+++ wpa_supplicant/driver_madwifi/include/compat.h      2005-02-17 02:09:10.000000000 +1000
 
15
@@ -0,0 +1,86 @@
 
16
+/*-
 
17
+ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
 
18
+ * All rights reserved.
 
19
+ *
 
20
+ * Redistribution and use in source and binary forms, with or without
 
21
+ * modification, are permitted provided that the following conditions
 
22
+ * are met:
 
23
+ * 1. Redistributions of source code must retain the above copyright
 
24
+ *    notice, this list of conditions and the following disclaimer,
 
25
+ *    without modification.
 
26
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
 
27
+ *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
 
28
+ *    redistribution must be conditioned upon including a substantially
 
29
+ *    similar Disclaimer requirement for further binary redistribution.
 
30
+ * 3. Neither the names of the above-listed copyright holders nor the names
 
31
+ *    of any contributors may be used to endorse or promote products derived
 
32
+ *    from this software without specific prior written permission.
 
33
+ *
 
34
+ * Alternatively, this software may be distributed under the terms of the
 
35
+ * GNU General Public License ("GPL") version 2 as published by the Free
 
36
+ * Software Foundation.
 
37
+ *
 
38
+ * NO WARRANTY
 
39
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
40
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
41
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
 
42
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
 
43
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
 
44
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 
45
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
46
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
 
47
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
48
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 
49
+ * THE POSSIBILITY OF SUCH DAMAGES.
 
50
+ *
 
51
+ * $Id: compat.h 846 2005-02-16 16:09:10Z samleffler $
 
52
+ */
 
53
+#ifndef _ATH_COMPAT_H_
 
54
+#define _ATH_COMPAT_H_
 
55
+/*
 
56
+ * BSD/Linux compatibility shims.  These are used mainly to
 
57
+ * minimize differences when importing necesary BSD code.
 
58
+ */
 
59
+#define        NBBY    8                       /* number of bits/byte */
 
60
+
 
61
+#define        roundup(x, y)   ((((x)+((y)-1))/(y))*(y))  /* to any y */
 
62
+#define        howmany(x, y)   (((x)+((y)-1))/(y))
 
63
+
 
64
+/* Bit map related macros. */
 
65
+#define        setbit(a,i)     ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
 
66
+#define        clrbit(a,i)     ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
 
67
+#define        isset(a,i)      ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
 
68
+#define        isclr(a,i)      (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
 
69
+
 
70
+#define        __packed        __attribute__((__packed__))
 
71
+#define        __printflike(_a,_b) \
 
72
+       __attribute__ ((__format__ (__printf__, _a, _b)))
 
73
+
 
74
+#ifndef ALIGNED_POINTER
 
75
+/*
 
76
+ * ALIGNED_POINTER is a boolean macro that checks whether an address
 
77
+ * is valid to fetch data elements of type t from on this architecture.
 
78
+ * This does not reflect the optimal alignment, just the possibility
 
79
+ * (within reasonable limits). 
 
80
+ *
 
81
+ */
 
82
+#define ALIGNED_POINTER(p,t)   1
 
83
+#endif
 
84
+
 
85
+#ifdef __KERNEL__
 
86
+#include <asm/page.h>
 
87
+
 
88
+#define        KASSERT(exp, msg) do {                  \
 
89
+       if (unlikely(!(exp))) {                 \
 
90
+               printk msg;                     \
 
91
+               BUG();                          \
 
92
+       }                                       \
 
93
+} while (0)
 
94
+#endif /* __KERNEL__ */
 
95
+
 
96
+/*
 
97
+ * NetBSD/FreeBSD defines for file version.
 
98
+ */
 
99
+#define        __FBSDID(_s)
 
100
+#define        __KERNEL_RCSID(_n,_s)
 
101
+#endif /* _ATH_COMPAT_H_ */
 
102
diff -Nru 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   2005-07-11 23:24:17.000000000 +1000
 
105
@@ -0,0 +1,225 @@
 
106
+/*-
 
107
+ * Copyright (c) 2001 Atsushi Onoe
 
108
+ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
 
109
+ * All rights reserved.
 
110
+ *
 
111
+ * Redistribution and use in source and binary forms, with or without
 
112
+ * modification, are permitted provided that the following conditions
 
113
+ * are met:
 
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.
 
121
+ *
 
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.
 
125
+ *
 
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.
 
136
+ *
 
137
+ * $FreeBSD: src/sys/net80211/ieee80211_crypto.h,v 1.5 2004/12/31 22:44:26 sam Exp $
 
138
+ */
 
139
+#ifndef _NET80211_IEEE80211_CRYPTO_H_
 
140
+#define _NET80211_IEEE80211_CRYPTO_H_
 
141
+
 
142
+/*
 
143
+ * 802.11 protocol crypto-related definitions.
 
144
+ */
 
145
+#define        IEEE80211_KEYBUF_SIZE   16
 
146
+#define        IEEE80211_MICBUF_SIZE   (8+8)   /* space for both tx+rx keys */
 
147
+
 
148
+/*
 
149
+ * Old WEP-style key.  Deprecated.
 
150
+ */
 
151
+struct ieee80211_wepkey {
 
152
+       u_int           wk_len;         /* key length in bytes */
 
153
+       u_int8_t        wk_key[IEEE80211_KEYBUF_SIZE];
 
154
+};
 
155
+
 
156
+struct ieee80211_cipher;
 
157
+
 
158
+/*
 
159
+ * Crypto key state.  There is sufficient room for all supported
 
160
+ * ciphers (see below).  The underlying ciphers are handled
 
161
+ * separately through loadable cipher modules that register with
 
162
+ * the generic crypto support.  A key has a reference to an instance
 
163
+ * of the cipher; any per-key state is hung off wk_private by the
 
164
+ * cipher when it is attached.  Ciphers are automatically called
 
165
+ * to detach and cleanup any such state when the key is deleted.
 
166
+ *
 
167
+ * The generic crypto support handles encap/decap of cipher-related
 
168
+ * frame contents for both hardware- and software-based implementations.
 
169
+ * A key requiring software crypto support is automatically flagged and
 
170
+ * the cipher is expected to honor this and do the necessary work.
 
171
+ * Ciphers such as TKIP may also support mixed hardware/software
 
172
+ * encrypt/decrypt and MIC processing.
 
173
+ */
 
174
+/* XXX need key index typedef */
 
175
+/* XXX pack better? */
 
176
+/* XXX 48-bit rsc/tsc */
 
177
+struct ieee80211_key {
 
178
+       u_int8_t        wk_keylen;      /* key length in bytes */
 
179
+       u_int8_t        wk_flags;
 
180
+#define        IEEE80211_KEY_XMIT      0x01    /* key used for xmit */
 
181
+#define        IEEE80211_KEY_RECV      0x02    /* key used for recv */
 
182
+#define        IEEE80211_KEY_GROUP     0x04    /* key used for WPA group operation */
 
183
+#define        IEEE80211_KEY_SWCRYPT   0x10    /* host-based encrypt/decrypt */
 
184
+#define        IEEE80211_KEY_SWMIC     0x20    /* host-based enmic/demic */
 
185
+       u_int16_t       wk_keyix;       /* key index */
 
186
+       u_int8_t        wk_key[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
 
187
+#define        wk_txmic        wk_key+IEEE80211_KEYBUF_SIZE+0  /* XXX can't () right */
 
188
+#define        wk_rxmic        wk_key+IEEE80211_KEYBUF_SIZE+8  /* XXX can't () right */
 
189
+       u_int64_t       wk_keyrsc;      /* key receive sequence counter */
 
190
+       u_int64_t       wk_keytsc;      /* key transmit sequence counter */
 
191
+       const struct ieee80211_cipher *wk_cipher;
 
192
+       void            *wk_private;    /* private cipher state */
 
193
+};
 
194
+#define        IEEE80211_KEY_COMMON            /* common flags passed in by apps */\
 
195
+       (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV | IEEE80211_KEY_GROUP)
 
196
+
 
197
+/*
 
198
+ * NB: these values are ordered carefully; there are lots of
 
199
+ * of implications in any reordering.  In particular beware
 
200
+ * that 4 is not used to avoid conflicting with IEEE80211_F_PRIVACY.
 
201
+ */
 
202
+#define        IEEE80211_CIPHER_WEP            0
 
203
+#define        IEEE80211_CIPHER_TKIP           1
 
204
+#define        IEEE80211_CIPHER_AES_OCB        2
 
205
+#define        IEEE80211_CIPHER_AES_CCM        3
 
206
+#define        IEEE80211_CIPHER_CKIP           5
 
207
+#define        IEEE80211_CIPHER_NONE           6       /* pseudo value */
 
208
+
 
209
+#define        IEEE80211_CIPHER_MAX            (IEEE80211_CIPHER_NONE+1)
 
210
+
 
211
+#define        IEEE80211_KEYIX_NONE    ((u_int16_t) -1)
 
212
+
 
213
+#if defined(__KERNEL__) || defined(_KERNEL)
 
214
+
 
215
+struct ieee80211com;
 
216
+struct ieee80211_node;
 
217
+struct sk_buff;
 
218
+
 
219
+/*
 
220
+ * Crypto state kept in each ieee80211com.  Some of this
 
221
+ * can/should be shared when virtual AP's are supported.
 
222
+ *
 
223
+ * XXX save reference to ieee80211com to properly encapsulate state.
 
224
+ * XXX split out crypto capabilities from ic_caps
 
225
+ */
 
226
+struct ieee80211_crypto_state {
 
227
+       struct ieee80211_key    cs_nw_keys[IEEE80211_WEP_NKID];
 
228
+       u_int16_t               cs_def_txkey;   /* default/group tx key index */
 
229
+
 
230
+       int                     (*cs_key_alloc)(struct ieee80211com *,
 
231
+                                       const struct ieee80211_key *);
 
232
+       int                     (*cs_key_delete)(struct ieee80211com *, 
 
233
+                                       const struct ieee80211_key *);
 
234
+       int                     (*cs_key_set)(struct ieee80211com *,
 
235
+                                       const struct ieee80211_key *,
 
236
+                                       const u_int8_t mac[IEEE80211_ADDR_LEN]);
 
237
+       void                    (*cs_key_update_begin)(struct ieee80211com *);
 
238
+       void                    (*cs_key_update_end)(struct ieee80211com *);
 
239
+};
 
240
+
 
241
+extern void ieee80211_crypto_attach(struct ieee80211com *);
 
242
+extern void ieee80211_crypto_detach(struct ieee80211com *);
 
243
+extern int ieee80211_crypto_newkey(struct ieee80211com *,
 
244
+               int cipher, int flags, struct ieee80211_key *);
 
245
+extern int ieee80211_crypto_delkey(struct ieee80211com *,
 
246
+               struct ieee80211_key *);
 
247
+extern int ieee80211_crypto_setkey(struct ieee80211com *,
 
248
+               struct ieee80211_key *, const u_int8_t macaddr[IEEE80211_ADDR_LEN]);
 
249
+extern void ieee80211_crypto_delglobalkeys(struct ieee80211com *);
 
250
+
 
251
+/*
 
252
+ * Template for a supported cipher.  Ciphers register with the
 
253
+ * crypto code and are typically loaded as separate modules
 
254
+ * (the null cipher is always present).
 
255
+ * XXX may need refcnts
 
256
+ */
 
257
+struct ieee80211_cipher {
 
258
+       const char *ic_name;            /* printable name */
 
259
+       u_int   ic_cipher;              /* IEEE80211_CIPHER_* */
 
260
+       u_int   ic_header;              /* size of privacy header (bytes) */
 
261
+       u_int   ic_trailer;             /* size of privacy trailer (bytes) */
 
262
+       u_int   ic_miclen;              /* size of mic trailer (bytes) */
 
263
+       void*   (*ic_attach)(struct ieee80211com *, struct ieee80211_key *);
 
264
+       void    (*ic_detach)(struct ieee80211_key *);
 
265
+       int     (*ic_setkey)(struct ieee80211_key *);
 
266
+       int     (*ic_encap)(struct ieee80211_key *, struct sk_buff *,
 
267
+                       u_int8_t keyid);
 
268
+       int     (*ic_decap)(struct ieee80211_key *, struct sk_buff *, int);
 
269
+       int     (*ic_enmic)(struct ieee80211_key *, struct sk_buff *, int);
 
270
+       int     (*ic_demic)(struct ieee80211_key *, struct sk_buff *, int);
 
271
+};
 
272
+extern const struct ieee80211_cipher ieee80211_cipher_none;
 
273
+
 
274
+extern void ieee80211_crypto_register(const struct ieee80211_cipher *);
 
275
+extern void ieee80211_crypto_unregister(const struct ieee80211_cipher *);
 
276
+extern int ieee80211_crypto_available(u_int cipher);
 
277
+
 
278
+extern struct ieee80211_key *ieee80211_crypto_encap(struct ieee80211com *,
 
279
+               struct ieee80211_node *, struct sk_buff *);
 
280
+extern struct ieee80211_key *ieee80211_crypto_decap(struct ieee80211com *,
 
281
+               struct ieee80211_node *, struct sk_buff *, int);
 
282
+
 
283
+/*
 
284
+ * Check and remove any MIC.
 
285
+ */
 
286
+static inline int
 
287
+ieee80211_crypto_demic(struct ieee80211com *ic, struct ieee80211_key *k,
 
288
+       struct sk_buff *skb, int force)
 
289
+{
 
290
+       const struct ieee80211_cipher *cip = k->wk_cipher;
 
291
+       return (cip->ic_miclen > 0 ? (*cip->ic_demic)(k, skb, force) : 1);
 
292
+}
 
293
+
 
294
+/*
 
295
+ * Add any MIC.
 
296
+ */
 
297
+static inline int
 
298
+ieee80211_crypto_enmic(struct ieee80211com *ic,
 
299
+       struct ieee80211_key *k, struct sk_buff *skb, int force)
 
300
+{
 
301
+       const struct ieee80211_cipher *cip = k->wk_cipher;
 
302
+       return (cip->ic_miclen > 0 ? (*cip->ic_enmic)(k, skb, force) : 1);
 
303
+}
 
304
+
 
305
+/* 
 
306
+ * Reset key state to an unused state.  The crypto
 
307
+ * key allocation mechanism insures other state (e.g.
 
308
+ * key data) is properly setup before a key is used.
 
309
+ */
 
310
+static inline void
 
311
+ieee80211_crypto_resetkey(struct ieee80211com *ic,
 
312
+       struct ieee80211_key *k, u_int16_t ix)
 
313
+{
 
314
+       k->wk_cipher = &ieee80211_cipher_none;
 
315
+       k->wk_private = k->wk_cipher->ic_attach(ic, k);
 
316
+       k->wk_keyix = ix;
 
317
+       k->wk_flags = IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV;
 
318
+}
 
319
+
 
320
+/*
 
321
+ * Crypt-related notification methods.
 
322
+ */
 
323
+extern void ieee80211_notify_replay_failure(struct ieee80211com *,
 
324
+               const struct ieee80211_frame *, const struct ieee80211_key *,
 
325
+               u_int64_t rsc);
 
326
+extern void ieee80211_notify_michael_failure(struct ieee80211com *,
 
327
+               const struct ieee80211_frame *, u_int keyix);
 
328
+
 
329
+#endif /* defined(__KERNEL__) || defined(_KERNEL) */
 
330
+#endif /* _NET80211_IEEE80211_CRYPTO_H_ */
 
331
diff -Nru wpa_supplicant.orig/driver_madwifi/net80211/_ieee80211.h wpa_supplicant/driver_madwifi/net80211/_ieee80211.h
 
332
--- wpa_supplicant.orig/driver_madwifi/net80211/_ieee80211.h    1970-01-01 10:00:00.000000000 +1000
 
333
+++ wpa_supplicant/driver_madwifi/net80211/_ieee80211.h 2005-07-11 23:24:17.000000000 +1000
 
334
@@ -0,0 +1,188 @@
 
335
+/*-
 
336
+ * Copyright (c) 2001 Atsushi Onoe
 
337
+ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
 
338
+ * All rights reserved.
 
339
+ *
 
340
+ * Redistribution and use in source and binary forms, with or without
 
341
+ * modification, are permitted provided that the following conditions
 
342
+ * are met:
 
343
+ * 1. Redistributions of source code must retain the above copyright
 
344
+ *    notice, this list of conditions and the following disclaimer.
 
345
+ * 2. Redistributions in binary form must reproduce the above copyright
 
346
+ *    notice, this list of conditions and the following disclaimer in the
 
347
+ *    documentation and/or other materials provided with the distribution.
 
348
+ * 3. The name of the author may not be used to endorse or promote products
 
349
+ *    derived from this software without specific prior written permission.
 
350
+ *
 
351
+ * Alternatively, this software may be distributed under the terms of the
 
352
+ * GNU General Public License ("GPL") version 2 as published by the Free
 
353
+ * Software Foundation.
 
354
+ *
 
355
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 
356
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 
357
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 
358
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 
359
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 
360
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
361
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
362
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
363
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 
364
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
365
+ *
 
366
+ * $FreeBSD: src/sys/net80211/_ieee80211.h,v 1.2 2004/12/31 22:42:38 sam Exp $
 
367
+ */
 
368
+#ifndef _NET80211__IEEE80211_H_
 
369
+#define _NET80211__IEEE80211_H_
 
370
+
 
371
+enum ieee80211_phytype {
 
372
+       IEEE80211_T_DS,                 /* direct sequence spread spectrum */
 
373
+       IEEE80211_T_FH,                 /* frequency hopping */
 
374
+       IEEE80211_T_OFDM,               /* frequency division multiplexing */
 
375
+       IEEE80211_T_TURBO               /* high rate OFDM, aka turbo mode */
 
376
+};
 
377
+#define        IEEE80211_T_CCK IEEE80211_T_DS  /* more common nomenclature */
 
378
+
 
379
+/* XXX not really a mode; there are really multiple PHY's */
 
380
+enum ieee80211_phymode {
 
381
+       IEEE80211_MODE_AUTO     = 0,    /* autoselect */
 
382
+       IEEE80211_MODE_11A      = 1,    /* 5GHz, OFDM */
 
383
+       IEEE80211_MODE_11B      = 2,    /* 2GHz, CCK */
 
384
+       IEEE80211_MODE_11G      = 3,    /* 2GHz, OFDM */
 
385
+       IEEE80211_MODE_FH       = 4,    /* 2GHz, GFSK */
 
386
+       IEEE80211_MODE_TURBO_A  = 5,    /* 5GHz, OFDM, 2x clock */
 
387
+       IEEE80211_MODE_TURBO_G  = 6     /* 2GHz, OFDM, 2x clock */
 
388
+};
 
389
+#define        IEEE80211_MODE_MAX      (IEEE80211_MODE_TURBO_G+1)
 
390
+
 
391
+enum ieee80211_opmode {
 
392
+       IEEE80211_M_STA         = 1,    /* infrastructure station */
 
393
+       IEEE80211_M_IBSS        = 0,    /* IBSS (adhoc) station */
 
394
+       IEEE80211_M_AHDEMO      = 3,    /* Old lucent compatible adhoc demo */
 
395
+       IEEE80211_M_HOSTAP      = 6,    /* Software Access Point */
 
396
+       IEEE80211_M_MONITOR     = 8     /* Monitor mode */
 
397
+};
 
398
+
 
399
+/*
 
400
+ * 802.11g protection mode.
 
401
+ */
 
402
+enum ieee80211_protmode {
 
403
+       IEEE80211_PROT_NONE     = 0,    /* no protection */
 
404
+       IEEE80211_PROT_CTSONLY  = 1,    /* CTS to self */
 
405
+       IEEE80211_PROT_RTSCTS   = 2     /* RTS-CTS */
 
406
+};
 
407
+
 
408
+/*
 
409
+ * Authentication mode.
 
410
+ */
 
411
+enum ieee80211_authmode {
 
412
+       IEEE80211_AUTH_NONE     = 0,
 
413
+       IEEE80211_AUTH_OPEN     = 1,            /* open */
 
414
+       IEEE80211_AUTH_SHARED   = 2,            /* shared-key */
 
415
+       IEEE80211_AUTH_8021X    = 3,            /* 802.1x */
 
416
+       IEEE80211_AUTH_AUTO     = 4,            /* auto-select/accept */
 
417
+       /* NB: these are used only for ioctls */
 
418
+       IEEE80211_AUTH_WPA      = 5             /* WPA/RSN w/ 802.1x/PSK */
 
419
+};
 
420
+
 
421
+/*
 
422
+ * Roaming mode is effectively who controls the operation
 
423
+ * of the 802.11 state machine when operating as a station.
 
424
+ * State transitions are controlled either by the driver
 
425
+ * (typically when management frames are processed by the
 
426
+ * hardware/firmware), the host (auto/normal operation of
 
427
+ * the 802.11 layer), or explicitly through ioctl requests
 
428
+ * when applications like wpa_supplicant want control.
 
429
+ */
 
430
+enum ieee80211_roamingmode {
 
431
+       IEEE80211_ROAMING_DEVICE= 0,    /* driver/hardware control */
 
432
+       IEEE80211_ROAMING_AUTO  = 1,    /* 802.11 layer control */
 
433
+       IEEE80211_ROAMING_MANUAL= 2     /* application control */
 
434
+};
 
435
+
 
436
+/*
 
437
+ * Channels are specified by frequency and attributes.
 
438
+ */
 
439
+struct ieee80211_channel {
 
440
+       u_int16_t       ic_freq;        /* setting in Mhz */
 
441
+       u_int16_t       ic_flags;       /* see below */
 
442
+};
 
443
+
 
444
+#define        IEEE80211_CHAN_MAX      255
 
445
+#define        IEEE80211_CHAN_BYTES    32      /* howmany(IEEE80211_CHAN_MAX, NBBY) */
 
446
+#define        IEEE80211_CHAN_ANY      0xffff  /* token for ``any channel'' */
 
447
+#define        IEEE80211_CHAN_ANYC \
 
448
+       ((struct ieee80211_channel *) IEEE80211_CHAN_ANY)
 
449
+
 
450
+/* bits 0-3 are for private use by drivers */
 
451
+/* channel attributes */
 
452
+#define        IEEE80211_CHAN_TURBO    0x0010  /* Turbo channel */
 
453
+#define        IEEE80211_CHAN_CCK      0x0020  /* CCK channel */
 
454
+#define        IEEE80211_CHAN_OFDM     0x0040  /* OFDM channel */
 
455
+#define        IEEE80211_CHAN_2GHZ     0x0080  /* 2 GHz spectrum channel. */
 
456
+#define        IEEE80211_CHAN_5GHZ     0x0100  /* 5 GHz spectrum channel */
 
457
+#define        IEEE80211_CHAN_PASSIVE  0x0200  /* Only passive scan allowed */
 
458
+#define        IEEE80211_CHAN_DYN      0x0400  /* Dynamic CCK-OFDM channel */
 
459
+#define        IEEE80211_CHAN_GFSK     0x0800  /* GFSK channel (FHSS PHY) */
 
460
+
 
461
+/*
 
462
+ * Useful combinations of channel characteristics.
 
463
+ */
 
464
+#define        IEEE80211_CHAN_FHSS \
 
465
+       (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK)
 
466
+#define        IEEE80211_CHAN_A \
 
467
+       (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM)
 
468
+#define        IEEE80211_CHAN_B \
 
469
+       (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK)
 
470
+#define        IEEE80211_CHAN_PUREG \
 
471
+       (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM)
 
472
+#define        IEEE80211_CHAN_G \
 
473
+       (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN)
 
474
+#define        IEEE80211_CHAN_T \
 
475
+       (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
 
476
+#define        IEEE80211_CHAN_108G \
 
477
+       (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
 
478
+
 
479
+#define        IEEE80211_IS_CHAN_FHSS(_c) \
 
480
+       (((_c)->ic_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS)
 
481
+#define        IEEE80211_IS_CHAN_A(_c) \
 
482
+       (((_c)->ic_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A)
 
483
+#define        IEEE80211_IS_CHAN_B(_c) \
 
484
+       (((_c)->ic_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B)
 
485
+#define        IEEE80211_IS_CHAN_PUREG(_c) \
 
486
+       (((_c)->ic_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG)
 
487
+#define        IEEE80211_IS_CHAN_G(_c) \
 
488
+       (((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G)
 
489
+#define        IEEE80211_IS_CHAN_T(_c) \
 
490
+       (((_c)->ic_flags & IEEE80211_CHAN_T) == IEEE80211_CHAN_T)
 
491
+#define        IEEE80211_IS_CHAN_108G(_c) \
 
492
+       (((_c)->ic_flags & IEEE80211_CHAN_108G) == IEEE80211_CHAN_108G)
 
493
+
 
494
+#define        IEEE80211_IS_CHAN_2GHZ(_c) \
 
495
+       (((_c)->ic_flags & IEEE80211_CHAN_2GHZ) != 0)
 
496
+#define        IEEE80211_IS_CHAN_5GHZ(_c) \
 
497
+       (((_c)->ic_flags & IEEE80211_CHAN_5GHZ) != 0)
 
498
+#define        IEEE80211_IS_CHAN_OFDM(_c) \
 
499
+       (((_c)->ic_flags & IEEE80211_CHAN_OFDM) != 0)
 
500
+#define        IEEE80211_IS_CHAN_CCK(_c) \
 
501
+       (((_c)->ic_flags & IEEE80211_CHAN_CCK) != 0)
 
502
+#define        IEEE80211_IS_CHAN_GFSK(_c) \
 
503
+       (((_c)->ic_flags & IEEE80211_CHAN_GFSK) != 0)
 
504
+
 
505
+/* ni_chan encoding for FH phy */
 
506
+#define        IEEE80211_FH_CHANMOD    80
 
507
+#define        IEEE80211_FH_CHAN(set,pat)      (((set)-1)*IEEE80211_FH_CHANMOD+(pat))
 
508
+#define        IEEE80211_FH_CHANSET(chan)      ((chan)/IEEE80211_FH_CHANMOD+1)
 
509
+#define        IEEE80211_FH_CHANPAT(chan)      ((chan)%IEEE80211_FH_CHANMOD)
 
510
+
 
511
+/*
 
512
+ * 802.11 rate set.
 
513
+ */
 
514
+#define        IEEE80211_RATE_SIZE     8               /* 802.11 standard */
 
515
+#define        IEEE80211_RATE_MAXSIZE  15              /* max rates we'll handle */
 
516
+
 
517
+struct ieee80211_rateset {
 
518
+       u_int8_t                rs_nrates;
 
519
+       u_int8_t                rs_rates[IEEE80211_RATE_MAXSIZE];
 
520
+};
 
521
+
 
522
+#endif /* _NET80211__IEEE80211_H_ */
 
523
diff -Nru wpa_supplicant.orig/driver_madwifi/net80211/ieee80211.h wpa_supplicant/driver_madwifi/net80211/ieee80211.h
 
524
--- wpa_supplicant.orig/driver_madwifi/net80211/ieee80211.h     1970-01-01 10:00:00.000000000 +1000
 
525
+++ wpa_supplicant/driver_madwifi/net80211/ieee80211.h  2005-07-11 23:24:17.000000000 +1000
 
526
@@ -0,0 +1,631 @@
 
527
+/*-
 
528
+ * Copyright (c) 2001 Atsushi Onoe
 
529
+ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
 
530
+ * All rights reserved.
 
531
+ *
 
532
+ * Redistribution and use in source and binary forms, with or without
 
533
+ * modification, are permitted provided that the following conditions
 
534
+ * are met:
 
535
+ * 1. Redistributions of source code must retain the above copyright
 
536
+ *    notice, this list of conditions and the following disclaimer.
 
537
+ * 2. Redistributions in binary form must reproduce the above copyright
 
538
+ *    notice, this list of conditions and the following disclaimer in the
 
539
+ *    documentation and/or other materials provided with the distribution.
 
540
+ * 3. The name of the author may not be used to endorse or promote products
 
541
+ *    derived from this software without specific prior written permission.
 
542
+ *
 
543
+ * Alternatively, this software may be distributed under the terms of the
 
544
+ * GNU General Public License ("GPL") version 2 as published by the Free
 
545
+ * Software Foundation.
 
546
+ *
 
547
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 
548
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 
549
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 
550
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 
551
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 
552
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
553
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
554
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
555
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 
556
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
557
+ *
 
558
+ * $FreeBSD: src/sys/net80211/ieee80211.h,v 1.8 2004/12/31 22:44:26 sam Exp $
 
559
+ */
 
560
+#ifndef _NET80211_IEEE80211_H_
 
561
+#define _NET80211_IEEE80211_H_
 
562
+
 
563
+/*
 
564
+ * 802.11 protocol definitions.
 
565
+ */
 
566
+
 
567
+#define        IEEE80211_ADDR_LEN      6               /* size of 802.11 address */
 
568
+/* is 802.11 address multicast/broadcast? */
 
569
+#define        IEEE80211_IS_MULTICAST(_a)      (*(_a) & 0x01)
 
570
+
 
571
+/* IEEE 802.11 PLCP header */
 
572
+struct ieee80211_plcp_hdr {
 
573
+       u_int16_t       i_sfd;
 
574
+       u_int8_t        i_signal;
 
575
+       u_int8_t        i_service;
 
576
+       u_int16_t       i_length;
 
577
+       u_int16_t       i_crc;
 
578
+} __packed;
 
579
+
 
580
+#define IEEE80211_PLCP_SFD      0xF3A0 
 
581
+#define IEEE80211_PLCP_SERVICE  0x00
 
582
+
 
583
+/*
 
584
+ * generic definitions for IEEE 802.11 frames
 
585
+ */
 
586
+struct ieee80211_frame {
 
587
+       u_int8_t        i_fc[2];
 
588
+       u_int8_t        i_dur[2];
 
589
+       u_int8_t        i_addr1[IEEE80211_ADDR_LEN];
 
590
+       u_int8_t        i_addr2[IEEE80211_ADDR_LEN];
 
591
+       u_int8_t        i_addr3[IEEE80211_ADDR_LEN];
 
592
+       u_int8_t        i_seq[2];
 
593
+       /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
 
594
+       /* see below */
 
595
+} __packed;
 
596
+
 
597
+struct ieee80211_qosframe {
 
598
+       u_int8_t        i_fc[2];
 
599
+       u_int8_t        i_dur[2];
 
600
+       u_int8_t        i_addr1[IEEE80211_ADDR_LEN];
 
601
+       u_int8_t        i_addr2[IEEE80211_ADDR_LEN];
 
602
+       u_int8_t        i_addr3[IEEE80211_ADDR_LEN];
 
603
+       u_int8_t        i_seq[2];
 
604
+       u_int8_t        i_qos[2];
 
605
+       /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
 
606
+       /* see below */
 
607
+} __packed;
 
608
+
 
609
+struct ieee80211_qoscntl {
 
610
+       u_int8_t        i_qos[2];
 
611
+};
 
612
+
 
613
+struct ieee80211_frame_addr4 {
 
614
+       u_int8_t        i_fc[2];
 
615
+       u_int8_t        i_dur[2];
 
616
+       u_int8_t        i_addr1[IEEE80211_ADDR_LEN];
 
617
+       u_int8_t        i_addr2[IEEE80211_ADDR_LEN];
 
618
+       u_int8_t        i_addr3[IEEE80211_ADDR_LEN];
 
619
+       u_int8_t        i_seq[2];
 
620
+       u_int8_t        i_addr4[IEEE80211_ADDR_LEN];
 
621
+} __packed;
 
622
+
 
623
+
 
624
+struct ieee80211_qosframe_addr4 {
 
625
+       u_int8_t        i_fc[2];
 
626
+       u_int8_t        i_dur[2];
 
627
+       u_int8_t        i_addr1[IEEE80211_ADDR_LEN];
 
628
+       u_int8_t        i_addr2[IEEE80211_ADDR_LEN];
 
629
+       u_int8_t        i_addr3[IEEE80211_ADDR_LEN];
 
630
+       u_int8_t        i_seq[2];
 
631
+       u_int8_t        i_addr4[IEEE80211_ADDR_LEN];
 
632
+       u_int8_t        i_qos[2];
 
633
+} __packed;
 
634
+
 
635
+#define        IEEE80211_FC0_VERSION_MASK              0x03
 
636
+#define        IEEE80211_FC0_VERSION_SHIFT             0
 
637
+#define        IEEE80211_FC0_VERSION_0                 0x00
 
638
+#define        IEEE80211_FC0_TYPE_MASK                 0x0c
 
639
+#define        IEEE80211_FC0_TYPE_SHIFT                2
 
640
+#define        IEEE80211_FC0_TYPE_MGT                  0x00
 
641
+#define        IEEE80211_FC0_TYPE_CTL                  0x04
 
642
+#define        IEEE80211_FC0_TYPE_DATA                 0x08
 
643
+
 
644
+#define        IEEE80211_FC0_SUBTYPE_MASK              0xf0
 
645
+#define        IEEE80211_FC0_SUBTYPE_SHIFT             4
 
646
+/* for TYPE_MGT */
 
647
+#define        IEEE80211_FC0_SUBTYPE_ASSOC_REQ         0x00
 
648
+#define        IEEE80211_FC0_SUBTYPE_ASSOC_RESP        0x10
 
649
+#define        IEEE80211_FC0_SUBTYPE_REASSOC_REQ       0x20
 
650
+#define        IEEE80211_FC0_SUBTYPE_REASSOC_RESP      0x30
 
651
+#define        IEEE80211_FC0_SUBTYPE_PROBE_REQ         0x40
 
652
+#define        IEEE80211_FC0_SUBTYPE_PROBE_RESP        0x50
 
653
+#define        IEEE80211_FC0_SUBTYPE_BEACON            0x80
 
654
+#define        IEEE80211_FC0_SUBTYPE_ATIM              0x90
 
655
+#define        IEEE80211_FC0_SUBTYPE_DISASSOC          0xa0
 
656
+#define        IEEE80211_FC0_SUBTYPE_AUTH              0xb0
 
657
+#define        IEEE80211_FC0_SUBTYPE_DEAUTH            0xc0
 
658
+/* for TYPE_CTL */
 
659
+#define        IEEE80211_FC0_SUBTYPE_PS_POLL           0xa0
 
660
+#define        IEEE80211_FC0_SUBTYPE_RTS               0xb0
 
661
+#define        IEEE80211_FC0_SUBTYPE_CTS               0xc0
 
662
+#define        IEEE80211_FC0_SUBTYPE_ACK               0xd0
 
663
+#define        IEEE80211_FC0_SUBTYPE_CF_END            0xe0
 
664
+#define        IEEE80211_FC0_SUBTYPE_CF_END_ACK        0xf0
 
665
+/* for TYPE_DATA (bit combination) */
 
666
+#define        IEEE80211_FC0_SUBTYPE_DATA              0x00
 
667
+#define        IEEE80211_FC0_SUBTYPE_CF_ACK            0x10
 
668
+#define        IEEE80211_FC0_SUBTYPE_CF_POLL           0x20
 
669
+#define        IEEE80211_FC0_SUBTYPE_CF_ACPL           0x30
 
670
+#define        IEEE80211_FC0_SUBTYPE_NODATA            0x40
 
671
+#define        IEEE80211_FC0_SUBTYPE_CFACK             0x50
 
672
+#define        IEEE80211_FC0_SUBTYPE_CFPOLL            0x60
 
673
+#define        IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK     0x70
 
674
+#define        IEEE80211_FC0_SUBTYPE_QOS               0x80
 
675
+#define        IEEE80211_FC0_SUBTYPE_QOS_NULL          0xc0
 
676
+
 
677
+#define        IEEE80211_FC1_DIR_MASK                  0x03
 
678
+#define        IEEE80211_FC1_DIR_NODS                  0x00    /* STA->STA */
 
679
+#define        IEEE80211_FC1_DIR_TODS                  0x01    /* STA->AP  */
 
680
+#define        IEEE80211_FC1_DIR_FROMDS                0x02    /* AP ->STA */
 
681
+#define        IEEE80211_FC1_DIR_DSTODS                0x03    /* AP ->AP  */
 
682
+
 
683
+#define        IEEE80211_FC1_MORE_FRAG                 0x04
 
684
+#define        IEEE80211_FC1_RETRY                     0x08
 
685
+#define        IEEE80211_FC1_PWR_MGT                   0x10
 
686
+#define        IEEE80211_FC1_MORE_DATA                 0x20
 
687
+#define        IEEE80211_FC1_WEP                       0x40
 
688
+#define        IEEE80211_FC1_ORDER                     0x80
 
689
+
 
690
+#define        IEEE80211_SEQ_FRAG_MASK                 0x000f
 
691
+#define        IEEE80211_SEQ_FRAG_SHIFT                0
 
692
+#define        IEEE80211_SEQ_SEQ_MASK                  0xfff0
 
693
+#define        IEEE80211_SEQ_SEQ_SHIFT                 4
 
694
+
 
695
+#define        IEEE80211_NWID_LEN                      32
 
696
+
 
697
+#define        IEEE80211_QOS_TXOP                      0x00ff
 
698
+/* bit 8 is reserved */
 
699
+#define        IEEE80211_QOS_ACKPOLICY                 0x60
 
700
+#define        IEEE80211_QOS_ACKPOLICY_S               5
 
701
+#define        IEEE80211_QOS_ESOP                      0x10
 
702
+#define        IEEE80211_QOS_ESOP_S                    4
 
703
+#define        IEEE80211_QOS_TID                       0x0f
 
704
+
 
705
+/* does frame have QoS sequence control data */
 
706
+#define        IEEE80211_QOS_HAS_SEQ(wh) \
 
707
+       (((wh)->i_fc[0] & \
 
708
+         (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_QOS)) == \
 
709
+         (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS))
 
710
+
 
711
+/*
 
712
+ * WME/802.11e information element.
 
713
+ */
 
714
+struct ieee80211_wme_info {
 
715
+       u_int8_t        wme_id;         /* IEEE80211_ELEMID_VENDOR */
 
716
+       u_int8_t        wme_len;        /* length in bytes */
 
717
+       u_int8_t        wme_oui[3];     /* 0x00, 0x50, 0xf2 */
 
718
+       u_int8_t        wme_type;       /* OUI type */
 
719
+       u_int8_t        wme_subtype;    /* OUI subtype */
 
720
+       u_int8_t        wme_version;    /* spec revision */
 
721
+       u_int8_t        wme_info;       /* QoS info */
 
722
+} __packed;
 
723
+
 
724
+/*
 
725
+ * WME/802.11e Tspec Element
 
726
+ */
 
727
+struct ieee80211_wme_tspec {
 
728
+       u_int8_t        ts_id;
 
729
+       u_int8_t        ts_len;
 
730
+       u_int8_t        ts_oui[3];
 
731
+       u_int8_t        ts_oui_type;
 
732
+       u_int8_t        ts_oui_subtype;
 
733
+       u_int8_t        ts_version;
 
734
+       u_int8_t        ts_tsinfo[3];
 
735
+       u_int8_t        ts_nom_msdu[2];
 
736
+       u_int8_t        ts_max_msdu[2];
 
737
+       u_int8_t        ts_min_svc[4];
 
738
+       u_int8_t        ts_max_svc[4];
 
739
+       u_int8_t        ts_inactv_intv[4];
 
740
+       u_int8_t        ts_susp_intv[4];
 
741
+       u_int8_t        ts_start_svc[4];
 
742
+       u_int8_t        ts_min_rate[4];
 
743
+       u_int8_t        ts_mean_rate[4];
 
744
+       u_int8_t        ts_max_burst[4];
 
745
+       u_int8_t        ts_min_phy[4];
 
746
+       u_int8_t        ts_peak_rate[4];
 
747
+       u_int8_t        ts_delay[4];
 
748
+       u_int8_t        ts_surplus[2];
 
749
+       u_int8_t        ts_medium_time[2];
 
750
+} __packed;
 
751
+
 
752
+/*
 
753
+ * WME AC parameter field
 
754
+ */
 
755
+struct ieee80211_wme_acparams {
 
756
+       u_int8_t        acp_aci_aifsn;
 
757
+       u_int8_t        acp_logcwminmax;
 
758
+       u_int16_t       acp_txop;
 
759
+} __packed;
 
760
+
 
761
+#define WME_NUM_AC             4       /* 4 AC categories */
 
762
+
 
763
+#define WME_PARAM_ACI          0x60    /* Mask for ACI field */
 
764
+#define WME_PARAM_ACI_S                5       /* Shift for ACI field */
 
765
+#define WME_PARAM_ACM          0x10    /* Mask for ACM bit */
 
766
+#define WME_PARAM_ACM_S                4       /* Shift for ACM bit */
 
767
+#define WME_PARAM_AIFSN                0x0f    /* Mask for aifsn field */
 
768
+#define WME_PARAM_AIFSN_S      0       /* Shift for aifsn field */
 
769
+#define WME_PARAM_LOGCWMIN     0x0f    /* Mask for CwMin field (in log) */
 
770
+#define WME_PARAM_LOGCWMIN_S   0       /* Shift for CwMin field */
 
771
+#define WME_PARAM_LOGCWMAX     0xf0    /* Mask for CwMax field (in log) */
 
772
+#define WME_PARAM_LOGCWMAX_S   4       /* Shift for CwMax field */
 
773
+
 
774
+#define WME_AC_TO_TID(_ac) (       \
 
775
+       ((_ac) == WME_AC_VO) ? 6 : \
 
776
+       ((_ac) == WME_AC_VI) ? 5 : \
 
777
+       ((_ac) == WME_AC_BK) ? 1 : \
 
778
+       0)
 
779
+
 
780
+#define TID_TO_WME_AC(_tid) (      \
 
781
+       ((_tid) < 1) ? WME_AC_BE : \
 
782
+       ((_tid) < 3) ? WME_AC_BK : \
 
783
+       ((_tid) < 6) ? WME_AC_VI : \
 
784
+       WME_AC_VO)
 
785
+
 
786
+/*
 
787
+ * WME Parameter Element
 
788
+ */
 
789
+struct ieee80211_wme_param {
 
790
+       u_int8_t        param_id;
 
791
+       u_int8_t        param_len;
 
792
+       u_int8_t        param_oui[3];
 
793
+       u_int8_t        param_oui_type;
 
794
+       u_int8_t        param_oui_sybtype;
 
795
+       u_int8_t        param_version;
 
796
+       u_int8_t        param_qosInfo;
 
797
+#define        WME_QOSINFO_COUNT       0x0f    /* Mask for param count field */
 
798
+       u_int8_t        param_reserved;
 
799
+       struct ieee80211_wme_acparams   params_acParams[WME_NUM_AC];
 
800
+} __packed;
 
801
+
 
802
+/*
 
803
+ * Management Notification Frame
 
804
+ */
 
805
+struct ieee80211_mnf {
 
806
+       u_int8_t        mnf_category;
 
807
+       u_int8_t        mnf_action;
 
808
+       u_int8_t        mnf_dialog;
 
809
+       u_int8_t        mnf_status;
 
810
+} __packed;
 
811
+#define        MNF_SETUP_REQ   0
 
812
+#define        MNF_SETUP_RESP  1
 
813
+#define        MNF_TEARDOWN    2
 
814
+
 
815
+/*
 
816
+ * Control frames.
 
817
+ */
 
818
+struct ieee80211_frame_min {
 
819
+       u_int8_t        i_fc[2];
 
820
+       u_int8_t        i_dur[2];
 
821
+       u_int8_t        i_addr1[IEEE80211_ADDR_LEN];
 
822
+       u_int8_t        i_addr2[IEEE80211_ADDR_LEN];
 
823
+       /* FCS */
 
824
+} __packed;
 
825
+
 
826
+struct ieee80211_frame_rts {
 
827
+       u_int8_t        i_fc[2];
 
828
+       u_int8_t        i_dur[2];
 
829
+       u_int8_t        i_ra[IEEE80211_ADDR_LEN];
 
830
+       u_int8_t        i_ta[IEEE80211_ADDR_LEN];
 
831
+       /* FCS */
 
832
+} __packed;
 
833
+
 
834
+struct ieee80211_frame_cts {
 
835
+       u_int8_t        i_fc[2];
 
836
+       u_int8_t        i_dur[2];
 
837
+       u_int8_t        i_ra[IEEE80211_ADDR_LEN];
 
838
+       /* FCS */
 
839
+} __packed;
 
840
+
 
841
+struct ieee80211_frame_ack {
 
842
+       u_int8_t        i_fc[2];
 
843
+       u_int8_t        i_dur[2];
 
844
+       u_int8_t        i_ra[IEEE80211_ADDR_LEN];
 
845
+       /* FCS */
 
846
+} __packed;
 
847
+
 
848
+struct ieee80211_frame_pspoll {
 
849
+       u_int8_t        i_fc[2];
 
850
+       u_int8_t        i_aid[2];
 
851
+       u_int8_t        i_bssid[IEEE80211_ADDR_LEN];
 
852
+       u_int8_t        i_ta[IEEE80211_ADDR_LEN];
 
853
+       /* FCS */
 
854
+} __packed;
 
855
+
 
856
+struct ieee80211_frame_cfend {         /* NB: also CF-End+CF-Ack */
 
857
+       u_int8_t        i_fc[2];
 
858
+       u_int8_t        i_dur[2];       /* should be zero */
 
859
+       u_int8_t        i_ra[IEEE80211_ADDR_LEN];
 
860
+       u_int8_t        i_bssid[IEEE80211_ADDR_LEN];
 
861
+       /* FCS */
 
862
+} __packed;
 
863
+
 
864
+/*
 
865
+ * BEACON management packets
 
866
+ *
 
867
+ *     octet timestamp[8]
 
868
+ *     octet beacon interval[2]
 
869
+ *     octet capability information[2]
 
870
+ *     information element
 
871
+ *             octet elemid
 
872
+ *             octet length
 
873
+ *             octet information[length]
 
874
+ */
 
875
+
 
876
+typedef u_int8_t *ieee80211_mgt_beacon_t;
 
877
+
 
878
+#define        IEEE80211_BEACON_INTERVAL(beacon) \
 
879
+       ((beacon)[8] | ((beacon)[9] << 8))
 
880
+#define        IEEE80211_BEACON_CAPABILITY(beacon) \
 
881
+       ((beacon)[10] | ((beacon)[11] << 8))
 
882
+
 
883
+#define        IEEE80211_CAPINFO_ESS                   0x0001
 
884
+#define        IEEE80211_CAPINFO_IBSS                  0x0002
 
885
+#define        IEEE80211_CAPINFO_CF_POLLABLE           0x0004
 
886
+#define        IEEE80211_CAPINFO_CF_POLLREQ            0x0008
 
887
+#define        IEEE80211_CAPINFO_PRIVACY               0x0010
 
888
+#define        IEEE80211_CAPINFO_SHORT_PREAMBLE        0x0020
 
889
+#define        IEEE80211_CAPINFO_PBCC                  0x0040
 
890
+#define        IEEE80211_CAPINFO_CHNL_AGILITY          0x0080
 
891
+/* bits 8-9 are reserved */
 
892
+#define        IEEE80211_CAPINFO_SHORT_SLOTTIME        0x0400
 
893
+#define        IEEE80211_CAPINFO_RSN                   0x0800
 
894
+/* bit 12 is reserved */
 
895
+#define        IEEE80211_CAPINFO_DSSSOFDM              0x2000
 
896
+/* bits 14-15 are reserved */
 
897
+
 
898
+/*
 
899
+ * 802.11i/WPA information element (maximally sized).
 
900
+ */
 
901
+struct ieee80211_ie_wpa {
 
902
+       u_int8_t        wpa_id;         /* IEEE80211_ELEMID_VENDOR */
 
903
+       u_int8_t        wpa_len;        /* length in bytes */
 
904
+       u_int8_t        wpa_oui[3];     /* 0x00, 0x50, 0xf2 */
 
905
+       u_int8_t        wpa_type;       /* OUI type */
 
906
+       u_int16_t       wpa_version;    /* spec revision */
 
907
+       u_int32_t       wpa_mcipher[1]; /* multicast/group key cipher */
 
908
+       u_int16_t       wpa_uciphercnt; /* # pairwise key ciphers */
 
909
+       u_int32_t       wpa_uciphers[8];/* ciphers */
 
910
+       u_int16_t       wpa_authselcnt; /* authentication selector cnt*/
 
911
+       u_int32_t       wpa_authsels[8];/* selectors */
 
912
+       u_int16_t       wpa_caps;       /* 802.11i capabilities */
 
913
+       u_int16_t       wpa_pmkidcnt;   /* 802.11i pmkid count */
 
914
+       u_int16_t       wpa_pmkids[8];  /* 802.11i pmkids */
 
915
+} __packed;
 
916
+
 
917
+/*
 
918
+ * Management information element payloads.
 
919
+ */
 
920
+
 
921
+enum {
 
922
+       IEEE80211_ELEMID_SSID           = 0,
 
923
+       IEEE80211_ELEMID_RATES          = 1,
 
924
+       IEEE80211_ELEMID_FHPARMS        = 2,
 
925
+       IEEE80211_ELEMID_DSPARMS        = 3,
 
926
+       IEEE80211_ELEMID_CFPARMS        = 4,
 
927
+       IEEE80211_ELEMID_TIM            = 5,
 
928
+       IEEE80211_ELEMID_IBSSPARMS      = 6,
 
929
+       IEEE80211_ELEMID_COUNTRY        = 7,
 
930
+       IEEE80211_ELEMID_CHALLENGE      = 16,
 
931
+       /* 17-31 reserved for challenge text extension */
 
932
+       IEEE80211_ELEMID_ERP            = 42,
 
933
+       IEEE80211_ELEMID_RSN            = 48,
 
934
+       IEEE80211_ELEMID_XRATES         = 50,
 
935
+       IEEE80211_ELEMID_TPC            = 150,
 
936
+       IEEE80211_ELEMID_CCKM           = 156,
 
937
+       IEEE80211_ELEMID_VENDOR         = 221   /* vendor private */
 
938
+};
 
939
+
 
940
+struct ieee80211_tim_ie {
 
941
+       u_int8_t        tim_ie;                 /* IEEE80211_ELEMID_TIM */
 
942
+       u_int8_t        tim_len;
 
943
+       u_int8_t        tim_count;              /* DTIM count */
 
944
+       u_int8_t        tim_period;             /* DTIM period */
 
945
+       u_int8_t        tim_bitctl;             /* bitmap control */
 
946
+       u_int8_t        tim_bitmap[1];          /* variable-length bitmap */
 
947
+} __packed;
 
948
+
 
949
+struct ieee80211_country_ie {
 
950
+       u_int8_t        ie;                     /* IEEE80211_ELEMID_COUNTRY */
 
951
+       u_int8_t        len;
 
952
+       u_int8_t        cc[3];                  /* ISO CC+(I)ndoor/(O)utdoor */
 
953
+       struct {
 
954
+               u_int8_t schan;                 /* starting channel */
 
955
+               u_int8_t nchan;                 /* number channels */
 
956
+               u_int8_t maxtxpwr;              /* tx power cap */
 
957
+       } band[4] __packed;                     /* up to 4 sub bands */
 
958
+} __packed;
 
959
+
 
960
+#define IEEE80211_CHALLENGE_LEN                128
 
961
+
 
962
+#define        IEEE80211_RATE_BASIC            0x80
 
963
+#define        IEEE80211_RATE_VAL              0x7f
 
964
+
 
965
+/* EPR information element flags */
 
966
+#define        IEEE80211_ERP_NON_ERP_PRESENT   0x01
 
967
+#define        IEEE80211_ERP_USE_PROTECTION    0x02
 
968
+#define        IEEE80211_ERP_LONG_PREAMBLE     0x04
 
969
+
 
970
+/* Atheros private advanced capabilities info */
 
971
+#define        ATHEROS_CAP_TURBO_PRIME         0x01
 
972
+#define        ATHEROS_CAP_COMPRESSION         0x02
 
973
+#define        ATHEROS_CAP_FAST_FRAME          0x04
 
974
+/* bits 3-6 reserved */
 
975
+#define        ATHEROS_CAP_BOOST               0x80
 
976
+
 
977
+#define        ATH_OUI                 0x7f0300                /* Atheros OUI */
 
978
+#define        ATH_OUI_TYPE            0x01
 
979
+#define        ATH_OUI_VERSION         0x01
 
980
+
 
981
+#define        WPA_OUI                 0xf25000
 
982
+#define        WPA_OUI_TYPE            0x01
 
983
+#define        WPA_VERSION             1               /* current supported version */
 
984
+
 
985
+#define        WPA_CSE_NULL            0x00
 
986
+#define        WPA_CSE_WEP40           0x01
 
987
+#define        WPA_CSE_TKIP            0x02
 
988
+#define        WPA_CSE_CCMP            0x04
 
989
+#define        WPA_CSE_WEP104          0x05
 
990
+
 
991
+#define        WPA_ASE_NONE            0x00
 
992
+#define        WPA_ASE_8021X_UNSPEC    0x01
 
993
+#define        WPA_ASE_8021X_PSK       0x02
 
994
+
 
995
+#define        RSN_OUI                 0xac0f00
 
996
+#define        RSN_VERSION             1               /* current supported version */
 
997
+
 
998
+#define        RSN_CSE_NULL            0x00
 
999
+#define        RSN_CSE_WEP40           0x01
 
1000
+#define        RSN_CSE_TKIP            0x02
 
1001
+#define        RSN_CSE_WRAP            0x03
 
1002
+#define        RSN_CSE_CCMP            0x04
 
1003
+#define        RSN_CSE_WEP104          0x05
 
1004
+
 
1005
+#define        RSN_ASE_NONE            0x00
 
1006
+#define        RSN_ASE_8021X_UNSPEC    0x01
 
1007
+#define        RSN_ASE_8021X_PSK       0x02
 
1008
+
 
1009
+#define        RSN_CAP_PREAUTH         0x01
 
1010
+
 
1011
+#define        WME_OUI                 0xf25000
 
1012
+#define        WME_OUI_TYPE            0x02
 
1013
+#define        WME_INFO_OUI_SUBTYPE    0x00
 
1014
+#define        WME_PARAM_OUI_SUBTYPE   0x01
 
1015
+#define        WME_VERSION             1
 
1016
+
 
1017
+/* WME stream classes */
 
1018
+#define        WME_AC_BE       0               /* best effort */
 
1019
+#define        WME_AC_BK       1               /* background */
 
1020
+#define        WME_AC_VI       2               /* video */
 
1021
+#define        WME_AC_VO       3               /* voice */
 
1022
+
 
1023
+/*
 
1024
+ * AUTH management packets
 
1025
+ *
 
1026
+ *     octet algo[2]
 
1027
+ *     octet seq[2]
 
1028
+ *     octet status[2]
 
1029
+ *     octet chal.id
 
1030
+ *     octet chal.length
 
1031
+ *     octet chal.text[253]
 
1032
+ */
 
1033
+
 
1034
+typedef u_int8_t *ieee80211_mgt_auth_t;
 
1035
+
 
1036
+#define        IEEE80211_AUTH_ALGORITHM(auth) \
 
1037
+       ((auth)[0] | ((auth)[1] << 8))
 
1038
+#define        IEEE80211_AUTH_TRANSACTION(auth) \
 
1039
+       ((auth)[2] | ((auth)[3] << 8))
 
1040
+#define        IEEE80211_AUTH_STATUS(auth) \
 
1041
+       ((auth)[4] | ((auth)[5] << 8))
 
1042
+
 
1043
+#define        IEEE80211_AUTH_ALG_OPEN         0x0000
 
1044
+#define        IEEE80211_AUTH_ALG_SHARED       0x0001
 
1045
+#define        IEEE80211_AUTH_ALG_LEAP         0x0080
 
1046
+
 
1047
+enum {
 
1048
+       IEEE80211_AUTH_OPEN_REQUEST             = 1,
 
1049
+       IEEE80211_AUTH_OPEN_RESPONSE            = 2
 
1050
+};
 
1051
+
 
1052
+enum {
 
1053
+       IEEE80211_AUTH_SHARED_REQUEST           = 1,
 
1054
+       IEEE80211_AUTH_SHARED_CHALLENGE         = 2,
 
1055
+       IEEE80211_AUTH_SHARED_RESPONSE          = 3,
 
1056
+       IEEE80211_AUTH_SHARED_PASS              = 4
 
1057
+};
 
1058
+
 
1059
+/*
 
1060
+ * Reason codes
 
1061
+ *
 
1062
+ * Unlisted codes are reserved
 
1063
+ */
 
1064
+
 
1065
+enum {
 
1066
+       IEEE80211_REASON_UNSPECIFIED            = 1,
 
1067
+       IEEE80211_REASON_AUTH_EXPIRE            = 2,
 
1068
+       IEEE80211_REASON_AUTH_LEAVE             = 3,
 
1069
+       IEEE80211_REASON_ASSOC_EXPIRE           = 4,
 
1070
+       IEEE80211_REASON_ASSOC_TOOMANY          = 5,
 
1071
+       IEEE80211_REASON_NOT_AUTHED             = 6,
 
1072
+       IEEE80211_REASON_NOT_ASSOCED            = 7,
 
1073
+       IEEE80211_REASON_ASSOC_LEAVE            = 8,
 
1074
+       IEEE80211_REASON_ASSOC_NOT_AUTHED       = 9,
 
1075
+
 
1076
+       IEEE80211_REASON_RSN_REQUIRED           = 11,
 
1077
+       IEEE80211_REASON_RSN_INCONSISTENT       = 12,
 
1078
+       IEEE80211_REASON_IE_INVALID             = 13,
 
1079
+       IEEE80211_REASON_MIC_FAILURE            = 14,
 
1080
+
 
1081
+       IEEE80211_STATUS_SUCCESS                = 0,
 
1082
+       IEEE80211_STATUS_UNSPECIFIED            = 1,
 
1083
+       IEEE80211_STATUS_CAPINFO                = 10,
 
1084
+       IEEE80211_STATUS_NOT_ASSOCED            = 11,
 
1085
+       IEEE80211_STATUS_OTHER                  = 12,
 
1086
+       IEEE80211_STATUS_ALG                    = 13,
 
1087
+       IEEE80211_STATUS_SEQUENCE               = 14,
 
1088
+       IEEE80211_STATUS_CHALLENGE              = 15,
 
1089
+       IEEE80211_STATUS_TIMEOUT                = 16,
 
1090
+       IEEE80211_STATUS_TOOMANY                = 17,
 
1091
+       IEEE80211_STATUS_BASIC_RATE             = 18,
 
1092
+       IEEE80211_STATUS_SP_REQUIRED            = 19,
 
1093
+       IEEE80211_STATUS_PBCC_REQUIRED          = 20,
 
1094
+       IEEE80211_STATUS_CA_REQUIRED            = 21,
 
1095
+       IEEE80211_STATUS_TOO_MANY_STATIONS      = 22,
 
1096
+       IEEE80211_STATUS_RATES                  = 23,
 
1097
+       IEEE80211_STATUS_SHORTSLOT_REQUIRED     = 25,
 
1098
+       IEEE80211_STATUS_DSSSOFDM_REQUIRED      = 26
 
1099
+};
 
1100
+
 
1101
+#define        IEEE80211_WEP_KEYLEN            5       /* 40bit */
 
1102
+#define        IEEE80211_WEP_IVLEN             3       /* 24bit */
 
1103
+#define        IEEE80211_WEP_KIDLEN            1       /* 1 octet */
 
1104
+#define        IEEE80211_WEP_CRCLEN            4       /* CRC-32 */
 
1105
+#define        IEEE80211_WEP_NKID              4       /* number of key ids */
 
1106
+
 
1107
+/*
 
1108
+ * 802.11i defines an extended IV for use with non-WEP ciphers.
 
1109
+ * When the EXTIV bit is set in the key id byte an additional
 
1110
+ * 4 bytes immediately follow the IV for TKIP.  For CCMP the
 
1111
+ * EXTIV bit is likewise set but the 8 bytes represent the
 
1112
+ * CCMP header rather than IV+extended-IV.
 
1113
+ */
 
1114
+#define        IEEE80211_WEP_EXTIV             0x20
 
1115
+#define        IEEE80211_WEP_EXTIVLEN          4       /* extended IV length */
 
1116
+#define        IEEE80211_WEP_MICLEN            8       /* trailing MIC */
 
1117
+
 
1118
+#define        IEEE80211_CRC_LEN               4
 
1119
+
 
1120
+/*
 
1121
+ * Maximum acceptable MTU is:
 
1122
+ *     IEEE80211_MAX_LEN - WEP overhead - CRC -
 
1123
+ *             QoS overhead - RSN/WPA overhead
 
1124
+ * Min is arbitrarily chosen > IEEE80211_MIN_LEN.  The default
 
1125
+ * mtu is Ethernet-compatible; it's set by ether_ifattach.
 
1126
+ */
 
1127
+#define        IEEE80211_MTU_MAX               2290
 
1128
+#define        IEEE80211_MTU_MIN               32
 
1129
+
 
1130
+#define        IEEE80211_MAX_LEN               (2300 + IEEE80211_CRC_LEN + \
 
1131
+    (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN))
 
1132
+#define        IEEE80211_ACK_LEN \
 
1133
+       (sizeof(struct ieee80211_frame_ack) + IEEE80211_CRC_LEN)
 
1134
+#define        IEEE80211_MIN_LEN \
 
1135
+       (sizeof(struct ieee80211_frame_min) + IEEE80211_CRC_LEN)
 
1136
+
 
1137
+/*
 
1138
+ * The 802.11 spec says at most 2007 stations may be
 
1139
+ * associated at once.  For most AP's this is way more
 
1140
+ * than is feasible so we use a default of 128.  This
 
1141
+ * number may be overridden by the driver and/or by
 
1142
+ * user configuration.
 
1143
+ */
 
1144
+#define        IEEE80211_AID_MAX               2007
 
1145
+#define        IEEE80211_AID_DEF               128
 
1146
+
 
1147
+#define        IEEE80211_AID(b)        ((b) &~ 0xc000)
 
1148
+
 
1149
+/* 
 
1150
+ * RTS frame length parameters.  The default is specified in
 
1151
+ * the 802.11 spec.  The max may be wrong for jumbo frames.
 
1152
+ */
 
1153
+#define        IEEE80211_RTS_DEFAULT           512
 
1154
+#define        IEEE80211_RTS_MIN               1
 
1155
+#define        IEEE80211_RTS_MAX               IEEE80211_MAX_LEN
 
1156
+
 
1157
+#endif /* _NET80211_IEEE80211_H_ */
 
1158
diff -Nru wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_ioctl.h wpa_supplicant/driver_madwifi/net80211/ieee80211_ioctl.h
 
1159
--- wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_ioctl.h       1970-01-01 10:00:00.000000000 +1000
 
1160
+++ wpa_supplicant/driver_madwifi/net80211/ieee80211_ioctl.h    2005-10-20 01:46:20.000000000 +1000
 
1161
@@ -0,0 +1,514 @@
 
1162
+/*     $NetBSD: ieee80211_ioctl.h,v 1.5 2003/10/13 04:16:59 dyoung Exp $       */
 
1163
+/*-
 
1164
+ * Copyright (c) 2001 Atsushi Onoe
 
1165
+ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
 
1166
+ * All rights reserved.
 
1167
+ *
 
1168
+ * Redistribution and use in source and binary forms, with or without
 
1169
+ * modification, are permitted provided that the following conditions
 
1170
+ * are met:
 
1171
+ * 1. Redistributions of source code must retain the above copyright
 
1172
+ *    notice, this list of conditions and the following disclaimer.
 
1173
+ * 2. Redistributions in binary form must reproduce the above copyright
 
1174
+ *    notice, this list of conditions and the following disclaimer in the
 
1175
+ *    documentation and/or other materials provided with the distribution.
 
1176
+ * 3. The name of the author may not be used to endorse or promote products
 
1177
+ *    derived from this software without specific prior written permission.
 
1178
+ *
 
1179
+ * Alternatively, this software may be distributed under the terms of the
 
1180
+ * GNU General Public License ("GPL") version 2 as published by the Free
 
1181
+ * Software Foundation.
 
1182
+ *
 
1183
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 
1184
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 
1185
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 
1186
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 
1187
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 
1188
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
1189
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
1190
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
1191
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 
1192
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
1193
+ *
 
1194
+ * $FreeBSD: src/sys/net80211/ieee80211_ioctl.h,v 1.8 2004/12/31 22:42:38 sam Exp $
 
1195
+ */
 
1196
+#ifndef _NET80211_IEEE80211_IOCTL_H_
 
1197
+#define _NET80211_IEEE80211_IOCTL_H_
 
1198
+
 
1199
+#include <net80211/_ieee80211.h>
 
1200
+
 
1201
+/*
 
1202
+ * IEEE 802.11 ioctls.
 
1203
+ */
 
1204
+
 
1205
+/*
 
1206
+ * Per/node (station) statistics available when operating as an AP.
 
1207
+ */
 
1208
+struct ieee80211_nodestats {
 
1209
+       u_int32_t       ns_rx_data;             /* rx data frames */
 
1210
+       u_int32_t       ns_rx_mgmt;             /* rx management frames */
 
1211
+       u_int32_t       ns_rx_ctrl;             /* rx control frames */
 
1212
+       u_int32_t       ns_rx_ucast;            /* rx unicast frames */
 
1213
+       u_int32_t       ns_rx_mcast;            /* rx multi/broadcast frames */
 
1214
+       u_int64_t       ns_rx_bytes;            /* rx data count (bytes) */
 
1215
+       u_int64_t       ns_rx_beacons;          /* rx beacon frames */
 
1216
+       u_int32_t       ns_rx_proberesp;        /* rx probe response frames */
 
1217
+
 
1218
+       u_int32_t       ns_rx_dup;              /* rx discard 'cuz dup */
 
1219
+       u_int32_t       ns_rx_noprivacy;        /* rx w/ wep but privacy off */
 
1220
+       u_int32_t       ns_rx_wepfail;          /* rx wep processing failed */
 
1221
+       u_int32_t       ns_rx_demicfail;        /* rx demic failed */
 
1222
+       u_int32_t       ns_rx_decap;            /* rx decapsulation failed */
 
1223
+       u_int32_t       ns_rx_defrag;           /* rx defragmentation failed */
 
1224
+       u_int32_t       ns_rx_disassoc;         /* rx disassociation */
 
1225
+       u_int32_t       ns_rx_deauth;           /* rx deauthentication */
 
1226
+       u_int32_t       ns_rx_decryptcrc;       /* rx decrypt failed on crc */
 
1227
+       u_int32_t       ns_rx_unauth;           /* rx on unauthorized port */
 
1228
+       u_int32_t       ns_rx_unencrypted;      /* rx unecrypted w/ privacy */
 
1229
+
 
1230
+       u_int32_t       ns_tx_data;             /* tx data frames */
 
1231
+       u_int32_t       ns_tx_mgmt;             /* tx management frames */
 
1232
+       u_int32_t       ns_tx_ucast;            /* tx unicast frames */
 
1233
+       u_int32_t       ns_tx_mcast;            /* tx multi/broadcast frames */
 
1234
+       u_int64_t       ns_tx_bytes;            /* tx data count (bytes) */
 
1235
+       u_int32_t       ns_tx_probereq;         /* tx probe request frames */
 
1236
+
 
1237
+       u_int32_t       ns_tx_novlantag;        /* tx discard 'cuz no tag */
 
1238
+       u_int32_t       ns_tx_vlanmismatch;     /* tx discard 'cuz bad tag */
 
1239
+
 
1240
+       u_int32_t       ns_ps_discard;          /* ps discard 'cuz of age */
 
1241
+
 
1242
+       /* MIB-related state */
 
1243
+       u_int32_t       ns_tx_assoc;            /* [re]associations */
 
1244
+       u_int32_t       ns_tx_assoc_fail;       /* [re]association failures */
 
1245
+       u_int32_t       ns_tx_auth;             /* [re]authentications */
 
1246
+       u_int32_t       ns_tx_auth_fail;        /* [re]authentication failures*/
 
1247
+       u_int32_t       ns_tx_deauth;           /* deauthentications */
 
1248
+       u_int32_t       ns_tx_deauth_code;      /* last deauth reason */
 
1249
+       u_int32_t       ns_tx_disassoc;         /* disassociations */
 
1250
+       u_int32_t       ns_tx_disassoc_code;    /* last disassociation reason */
 
1251
+};
 
1252
+
 
1253
+/*
 
1254
+ * Summary statistics.
 
1255
+ */
 
1256
+struct ieee80211_stats {
 
1257
+       u_int32_t       is_rx_badversion;       /* rx frame with bad version */
 
1258
+       u_int32_t       is_rx_tooshort;         /* rx frame too short */
 
1259
+       u_int32_t       is_rx_wrongbss;         /* rx from wrong bssid */
 
1260
+       u_int32_t       is_rx_dup;              /* rx discard 'cuz dup */
 
1261
+       u_int32_t       is_rx_wrongdir;         /* rx w/ wrong direction */
 
1262
+       u_int32_t       is_rx_mcastecho;        /* rx discard 'cuz mcast echo */
 
1263
+       u_int32_t       is_rx_notassoc;         /* rx discard 'cuz sta !assoc */
 
1264
+       u_int32_t       is_rx_noprivacy;        /* rx w/ wep but privacy off */
 
1265
+       u_int32_t       is_rx_unencrypted;      /* rx w/o wep and privacy on */
 
1266
+       u_int32_t       is_rx_wepfail;          /* rx wep processing failed */
 
1267
+       u_int32_t       is_rx_decap;            /* rx decapsulation failed */
 
1268
+       u_int32_t       is_rx_mgtdiscard;       /* rx discard mgt frames */
 
1269
+       u_int32_t       is_rx_ctl;              /* rx discard ctrl frames */
 
1270
+       u_int32_t       is_rx_beacon;           /* rx beacon frames */
 
1271
+       u_int32_t       is_rx_rstoobig;         /* rx rate set truncated */
 
1272
+       u_int32_t       is_rx_elem_missing;     /* rx required element missing*/
 
1273
+       u_int32_t       is_rx_elem_toobig;      /* rx element too big */
 
1274
+       u_int32_t       is_rx_elem_toosmall;    /* rx element too small */
 
1275
+       u_int32_t       is_rx_elem_unknown;     /* rx element unknown */
 
1276
+       u_int32_t       is_rx_badchan;          /* rx frame w/ invalid chan */
 
1277
+       u_int32_t       is_rx_chanmismatch;     /* rx frame chan mismatch */
 
1278
+       u_int32_t       is_rx_nodealloc;        /* rx frame dropped */
 
1279
+       u_int32_t       is_rx_ssidmismatch;     /* rx frame ssid mismatch  */
 
1280
+       u_int32_t       is_rx_auth_unsupported; /* rx w/ unsupported auth alg */
 
1281
+       u_int32_t       is_rx_auth_fail;        /* rx sta auth failure */
 
1282
+       u_int32_t       is_rx_auth_countermeasures;/* rx auth discard 'cuz CM */
 
1283
+       u_int32_t       is_rx_assoc_bss;        /* rx assoc from wrong bssid */
 
1284
+       u_int32_t       is_rx_assoc_notauth;    /* rx assoc w/o auth */
 
1285
+       u_int32_t       is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */
 
1286
+       u_int32_t       is_rx_assoc_norate;     /* rx assoc w/ no rate match */
 
1287
+       u_int32_t       is_rx_assoc_badwpaie;   /* rx assoc w/ bad WPA IE */
 
1288
+       u_int32_t       is_rx_deauth;           /* rx deauthentication */
 
1289
+       u_int32_t       is_rx_disassoc;         /* rx disassociation */
 
1290
+       u_int32_t       is_rx_badsubtype;       /* rx frame w/ unknown subtype*/
 
1291
+       u_int32_t       is_rx_nobuf;            /* rx failed for lack of buf */
 
1292
+       u_int32_t       is_rx_decryptcrc;       /* rx decrypt failed on crc */
 
1293
+       u_int32_t       is_rx_ahdemo_mgt;       /* rx discard ahdemo mgt frame*/
 
1294
+       u_int32_t       is_rx_bad_auth;         /* rx bad auth request */
 
1295
+       u_int32_t       is_rx_unauth;           /* rx on unauthorized port */
 
1296
+       u_int32_t       is_rx_badkeyid;         /* rx w/ incorrect keyid */
 
1297
+       u_int32_t       is_rx_ccmpreplay;       /* rx seq# violation (CCMP) */
 
1298
+       u_int32_t       is_rx_ccmpformat;       /* rx format bad (CCMP) */
 
1299
+       u_int32_t       is_rx_ccmpmic;          /* rx MIC check failed (CCMP) */
 
1300
+       u_int32_t       is_rx_tkipreplay;       /* rx seq# violation (TKIP) */
 
1301
+       u_int32_t       is_rx_tkipformat;       /* rx format bad (TKIP) */
 
1302
+       u_int32_t       is_rx_tkipmic;          /* rx MIC check failed (TKIP) */
 
1303
+       u_int32_t       is_rx_tkipicv;          /* rx ICV check failed (TKIP) */
 
1304
+       u_int32_t       is_rx_badcipher;        /* rx failed 'cuz key type */
 
1305
+       u_int32_t       is_rx_nocipherctx;      /* rx failed 'cuz key !setup */
 
1306
+       u_int32_t       is_rx_acl;              /* rx discard 'cuz acl policy */
 
1307
+       u_int32_t       is_tx_nobuf;            /* tx failed for lack of buf */
 
1308
+       u_int32_t       is_tx_nonode;           /* tx failed for no node */
 
1309
+       u_int32_t       is_tx_unknownmgt;       /* tx of unknown mgt frame */
 
1310
+       u_int32_t       is_tx_badcipher;        /* tx failed 'cuz key type */
 
1311
+       u_int32_t       is_tx_nodefkey;         /* tx failed 'cuz no defkey */
 
1312
+       u_int32_t       is_tx_noheadroom;       /* tx failed 'cuz no space */
 
1313
+       u_int32_t       is_scan_active;         /* active scans started */
 
1314
+       u_int32_t       is_scan_passive;        /* passive scans started */
 
1315
+       u_int32_t       is_node_timeout;        /* nodes timed out inactivity */
 
1316
+       u_int32_t       is_crypto_nomem;        /* no memory for crypto ctx */
 
1317
+       u_int32_t       is_crypto_tkip;         /* tkip crypto done in s/w */
 
1318
+       u_int32_t       is_crypto_tkipenmic;    /* tkip en-MIC done in s/w */
 
1319
+       u_int32_t       is_crypto_tkipdemic;    /* tkip de-MIC done in s/w */
 
1320
+       u_int32_t       is_crypto_tkipcm;       /* tkip counter measures */
 
1321
+       u_int32_t       is_crypto_ccmp;         /* ccmp crypto done in s/w */
 
1322
+       u_int32_t       is_crypto_wep;          /* wep crypto done in s/w */
 
1323
+       u_int32_t       is_crypto_setkey_cipher;/* cipher rejected key */
 
1324
+       u_int32_t       is_crypto_setkey_nokey; /* no key index for setkey */
 
1325
+       u_int32_t       is_crypto_delkey;       /* driver key delete failed */
 
1326
+       u_int32_t       is_crypto_badcipher;    /* unknown cipher */
 
1327
+       u_int32_t       is_crypto_nocipher;     /* cipher not available */
 
1328
+       u_int32_t       is_crypto_attachfail;   /* cipher attach failed */
 
1329
+       u_int32_t       is_crypto_swfallback;   /* cipher fallback to s/w */
 
1330
+       u_int32_t       is_crypto_keyfail;      /* driver key alloc failed */
 
1331
+       u_int32_t       is_crypto_enmicfail;    /* en-MIC failed */
 
1332
+       u_int32_t       is_ibss_capmismatch;    /* merge failed-cap mismatch */
 
1333
+       u_int32_t       is_ibss_norate;         /* merge failed-rate mismatch */
 
1334
+       u_int32_t       is_ps_unassoc;          /* ps-poll for unassoc. sta */
 
1335
+       u_int32_t       is_ps_badaid;           /* ps-poll w/ incorrect aid */
 
1336
+       u_int32_t       is_ps_qempty;           /* ps-poll w/ nothing to send */
 
1337
+};
 
1338
+
 
1339
+/*
 
1340
+ * Max size of optional information elements.  We artificially
 
1341
+ * constrain this; it's limited only by the max frame size (and
 
1342
+ * the max parameter size of the wireless extensions).
 
1343
+ */
 
1344
+#define        IEEE80211_MAX_OPT_IE    256
 
1345
+
 
1346
+/*
 
1347
+ * WPA/RSN get/set key request.  Specify the key/cipher
 
1348
+ * type and whether the key is to be used for sending and/or
 
1349
+ * receiving.  The key index should be set only when working
 
1350
+ * with global keys (use IEEE80211_KEYIX_NONE for ``no index'').
 
1351
+ * Otherwise a unicast/pairwise key is specified by the bssid
 
1352
+ * (on a station) or mac address (on an ap).  They key length
 
1353
+ * must include any MIC key data; otherwise it should be no
 
1354
+ more than IEEE80211_KEYBUF_SIZE.
 
1355
+ */
 
1356
+struct ieee80211req_key {
 
1357
+       u_int8_t        ik_type;        /* key/cipher type */
 
1358
+       u_int8_t        ik_pad;
 
1359
+       u_int16_t       ik_keyix;       /* key index */
 
1360
+       u_int8_t        ik_keylen;      /* key length in bytes */
 
1361
+       u_int8_t        ik_flags;
 
1362
+/* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */
 
1363
+#define        IEEE80211_KEY_DEFAULT   0x80    /* default xmit key */
 
1364
+       u_int8_t        ik_macaddr[IEEE80211_ADDR_LEN];
 
1365
+       u_int64_t       ik_keyrsc;      /* key receive sequence counter */
 
1366
+       u_int64_t       ik_keytsc;      /* key transmit sequence counter */
 
1367
+       u_int8_t        ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
 
1368
+};
 
1369
+
 
1370
+/*
 
1371
+ * Delete a key either by index or address.  Set the index
 
1372
+ * to IEEE80211_KEYIX_NONE when deleting a unicast key.
 
1373
+ */
 
1374
+struct ieee80211req_del_key {
 
1375
+       u_int8_t        idk_keyix;      /* key index */
 
1376
+       u_int8_t        idk_macaddr[IEEE80211_ADDR_LEN];
 
1377
+};
 
1378
+
 
1379
+/*
 
1380
+ * MLME state manipulation request.  IEEE80211_MLME_ASSOC
 
1381
+ * only makes sense when operating as a station.  The other
 
1382
+ * requests can be used when operating as a station or an
 
1383
+ * ap (to effect a station).
 
1384
+ */
 
1385
+struct ieee80211req_mlme {
 
1386
+       u_int8_t        im_op;          /* operation to perform */
 
1387
+#define        IEEE80211_MLME_ASSOC            1       /* associate station */
 
1388
+#define        IEEE80211_MLME_DISASSOC         2       /* disassociate station */
 
1389
+#define        IEEE80211_MLME_DEAUTH           3       /* deauthenticate station */
 
1390
+#define        IEEE80211_MLME_AUTHORIZE        4       /* authorize station */
 
1391
+#define        IEEE80211_MLME_UNAUTHORIZE      5       /* unauthorize station */
 
1392
+#define        IEEE80211_MLME_CLEAR_STATS      6       /* clear station statistic */
 
1393
+       u_int8_t        im_ssid_len;    /* length of optional ssid */
 
1394
+       u_int16_t       im_reason;      /* 802.11 reason code */
 
1395
+       u_int8_t        im_macaddr[IEEE80211_ADDR_LEN];
 
1396
+       u_int8_t        im_ssid[IEEE80211_NWID_LEN];
 
1397
+};
 
1398
+
 
1399
+/* 
 
1400
+ * MAC ACL operations.
 
1401
+ */
 
1402
+enum {
 
1403
+       IEEE80211_MACCMD_POLICY_OPEN    = 0,    /* set policy: no ACL's */
 
1404
+       IEEE80211_MACCMD_POLICY_ALLOW   = 1,    /* set policy: allow traffic */
 
1405
+       IEEE80211_MACCMD_POLICY_DENY    = 2,    /* set policy: deny traffic */
 
1406
+       IEEE80211_MACCMD_FLUSH          = 3,    /* flush ACL database */
 
1407
+       IEEE80211_MACCMD_DETACH         = 4     /* detach ACL policy */
 
1408
+};
 
1409
+
 
1410
+/*
 
1411
+ * Set the active channel list.  Note this list is
 
1412
+ * intersected with the available channel list in
 
1413
+ * calculating the set of channels actually used in
 
1414
+ * scanning.
 
1415
+ */
 
1416
+struct ieee80211req_chanlist {
 
1417
+       u_int8_t        ic_channels[IEEE80211_CHAN_BYTES];
 
1418
+};
 
1419
+
 
1420
+/*
 
1421
+ * Get the active channel list info.
 
1422
+ */
 
1423
+struct ieee80211req_chaninfo {
 
1424
+       u_int   ic_nchans;
 
1425
+       struct ieee80211_channel ic_chans[IEEE80211_CHAN_MAX];
 
1426
+};
 
1427
+
 
1428
+/*
 
1429
+ * Retrieve the WPA/RSN information element for an associated station.
 
1430
+ */
 
1431
+struct ieee80211req_wpaie {
 
1432
+       u_int8_t        wpa_macaddr[IEEE80211_ADDR_LEN];
 
1433
+       u_int8_t        wpa_ie[IEEE80211_MAX_OPT_IE];
 
1434
+};
 
1435
+
 
1436
+/*
 
1437
+ * Retrieve per-node statistics.
 
1438
+ */
 
1439
+struct ieee80211req_sta_stats {
 
1440
+       union {
 
1441
+               /* NB: explicitly force 64-bit alignment */
 
1442
+               u_int8_t        macaddr[IEEE80211_ADDR_LEN];
 
1443
+               u_int64_t       pad;
 
1444
+       } is_u;
 
1445
+       struct ieee80211_nodestats is_stats;
 
1446
+};
 
1447
+
 
1448
+/*
 
1449
+ * Station information block; the mac address is used
 
1450
+ * to retrieve other data like stats, unicast key, etc.
 
1451
+ */
 
1452
+struct ieee80211req_sta_info {
 
1453
+       u_int16_t       isi_len;                /* length (mult of 4) */
 
1454
+       u_int16_t       isi_freq;               /* MHz */
 
1455
+       u_int16_t       isi_flags;              /* channel flags */
 
1456
+       u_int16_t       isi_state;              /* state flags */
 
1457
+       u_int8_t        isi_authmode;           /* authentication algorithm */
 
1458
+       u_int8_t        isi_rssi;
 
1459
+       u_int8_t        isi_capinfo;            /* capabilities */
 
1460
+       u_int8_t        isi_erp;                /* ERP element */
 
1461
+       u_int8_t        isi_macaddr[IEEE80211_ADDR_LEN];
 
1462
+       u_int8_t        isi_nrates;
 
1463
+                                               /* negotiated rates */
 
1464
+       u_int8_t        isi_rates[IEEE80211_RATE_MAXSIZE];
 
1465
+       u_int8_t        isi_txrate;             /* index to isi_rates[] */
 
1466
+       u_int16_t       isi_ie_len;             /* IE length */
 
1467
+       u_int16_t       isi_associd;            /* assoc response */
 
1468
+       u_int16_t       isi_txpower;            /* current tx power */
 
1469
+       u_int16_t       isi_vlan;               /* vlan tag */
 
1470
+       u_int16_t       isi_txseqs[17];         /* seq to be transmitted */
 
1471
+       u_int16_t       isi_rxseqs[17];         /* seq previous for qos frames*/
 
1472
+       u_int16_t       isi_inact;              /* inactivity timer */
 
1473
+       /* XXX frag state? */
 
1474
+       /* variable length IE data */
 
1475
+};
 
1476
+
 
1477
+/*
 
1478
+ * Retrieve per-station information; to retrieve all
 
1479
+ * specify a mac address of ff:ff:ff:ff:ff:ff.
 
1480
+ */
 
1481
+struct ieee80211req_sta_req {
 
1482
+       union {
 
1483
+               /* NB: explicitly force 64-bit alignment */
 
1484
+               u_int8_t        macaddr[IEEE80211_ADDR_LEN];
 
1485
+               u_int64_t       pad;
 
1486
+       } is_u;
 
1487
+       struct ieee80211req_sta_info info[1];   /* variable length */
 
1488
+};
 
1489
+
 
1490
+/*
 
1491
+ * Get/set per-station tx power cap.
 
1492
+ */
 
1493
+struct ieee80211req_sta_txpow {
 
1494
+       u_int8_t        it_macaddr[IEEE80211_ADDR_LEN];
 
1495
+       u_int8_t        it_txpow;
 
1496
+};
 
1497
+
 
1498
+/*
 
1499
+ * WME parameters are set and return using i_val and i_len.
 
1500
+ * i_val holds the value itself.  i_len specifies the AC
 
1501
+ * and, as appropriate, then high bit specifies whether the
 
1502
+ * operation is to be applied to the BSS or ourself.
 
1503
+ */
 
1504
+#define        IEEE80211_WMEPARAM_SELF 0x0000          /* parameter applies to self */
 
1505
+#define        IEEE80211_WMEPARAM_BSS  0x8000          /* parameter applies to BSS */
 
1506
+#define        IEEE80211_WMEPARAM_VAL  0x7fff          /* parameter value */
 
1507
+
 
1508
+#ifdef __FreeBSD__
 
1509
+/*
 
1510
+ * FreeBSD-style ioctls.
 
1511
+ */
 
1512
+/* the first member must be matched with struct ifreq */
 
1513
+struct ieee80211req {
 
1514
+       char            i_name[IFNAMSIZ];       /* if_name, e.g. "wi0" */
 
1515
+       u_int16_t       i_type;                 /* req type */
 
1516
+       int16_t         i_val;                  /* Index or simple value */
 
1517
+       int16_t         i_len;                  /* Index or simple value */
 
1518
+       void            *i_data;                /* Extra data */
 
1519
+};
 
1520
+#define        SIOCS80211               _IOW('i', 234, struct ieee80211req)
 
1521
+#define        SIOCG80211              _IOWR('i', 235, struct ieee80211req)
 
1522
+
 
1523
+#define IEEE80211_IOC_SSID             1
 
1524
+#define IEEE80211_IOC_NUMSSIDS         2
 
1525
+#define IEEE80211_IOC_WEP              3
 
1526
+#define        IEEE80211_WEP_NOSUP     -1
 
1527
+#define        IEEE80211_WEP_OFF       0
 
1528
+#define        IEEE80211_WEP_ON        1
 
1529
+#define        IEEE80211_WEP_MIXED     2
 
1530
+#define IEEE80211_IOC_WEPKEY           4
 
1531
+#define IEEE80211_IOC_NUMWEPKEYS       5
 
1532
+#define IEEE80211_IOC_WEPTXKEY         6
 
1533
+#define IEEE80211_IOC_AUTHMODE         7
 
1534
+#define IEEE80211_IOC_STATIONNAME      8
 
1535
+#define IEEE80211_IOC_CHANNEL          9
 
1536
+#define IEEE80211_IOC_POWERSAVE                10
 
1537
+#define        IEEE80211_POWERSAVE_NOSUP       -1
 
1538
+#define        IEEE80211_POWERSAVE_OFF         0
 
1539
+#define        IEEE80211_POWERSAVE_CAM         1
 
1540
+#define        IEEE80211_POWERSAVE_PSP         2
 
1541
+#define        IEEE80211_POWERSAVE_PSP_CAM     3
 
1542
+#define        IEEE80211_POWERSAVE_ON          IEEE80211_POWERSAVE_CAM
 
1543
+#define IEEE80211_IOC_POWERSAVESLEEP   11
 
1544
+#define        IEEE80211_IOC_RTSTHRESHOLD      12
 
1545
+#define IEEE80211_IOC_PROTMODE         13
 
1546
+#define        IEEE80211_PROTMODE_OFF          0
 
1547
+#define        IEEE80211_PROTMODE_CTS          1
 
1548
+#define        IEEE80211_PROTMODE_RTSCTS       2
 
1549
+#define        IEEE80211_IOC_TXPOWER           14      /* global tx power limit */
 
1550
+#define        IEEE80211_IOC_BSSID             15
 
1551
+#define        IEEE80211_IOC_ROAMING           16      /* roaming mode */
 
1552
+#define        IEEE80211_IOC_PRIVACY           17      /* privacy invoked */
 
1553
+#define        IEEE80211_IOC_DROPUNENCRYPTED   18      /* discard unencrypted frames */
 
1554
+#define        IEEE80211_IOC_WPAKEY            19
 
1555
+#define        IEEE80211_IOC_DELKEY            20
 
1556
+#define        IEEE80211_IOC_MLME              21
 
1557
+#define        IEEE80211_IOC_OPTIE             22      /* optional info. element */
 
1558
+#define        IEEE80211_IOC_SCAN_REQ          23
 
1559
+#define        IEEE80211_IOC_SCAN_RESULTS      24
 
1560
+#define        IEEE80211_IOC_COUNTERMEASURES   25      /* WPA/TKIP countermeasures */
 
1561
+#define        IEEE80211_IOC_WPA               26      /* WPA mode (0,1,2) */
 
1562
+#define        IEEE80211_IOC_CHANLIST          27      /* channel list */
 
1563
+#define        IEEE80211_IOC_WME               28      /* WME mode (on, off) */
 
1564
+#define        IEEE80211_IOC_HIDESSID          29      /* hide SSID mode (on, off) */
 
1565
+#define        IEEE80211_IOC_APBRIDGE          30      /* AP inter-sta bridging */
 
1566
+#define        IEEE80211_IOC_MCASTCIPHER       31      /* multicast/default cipher */
 
1567
+#define        IEEE80211_IOC_MCASTKEYLEN       32      /* multicast key length */
 
1568
+#define        IEEE80211_IOC_UCASTCIPHERS      33      /* unicast cipher suites */
 
1569
+#define        IEEE80211_IOC_UCASTCIPHER       34      /* unicast cipher */
 
1570
+#define        IEEE80211_IOC_UCASTKEYLEN       35      /* unicast key length */
 
1571
+#define        IEEE80211_IOC_DRIVER_CAPS       36      /* driver capabilities */
 
1572
+#define        IEEE80211_IOC_KEYMGTALGS        37      /* key management algorithms */
 
1573
+#define        IEEE80211_IOC_RSNCAPS           38      /* RSN capabilities */
 
1574
+#define        IEEE80211_IOC_WPAIE             39      /* WPA information element */
 
1575
+#define        IEEE80211_IOC_STA_STATS         40      /* per-station statistics */
 
1576
+#define        IEEE80211_IOC_MACCMD            41      /* MAC ACL operation */
 
1577
+#define        IEEE80211_IOC_CHANINFO          42      /* channel info list */
 
1578
+#define        IEEE80211_IOC_TXPOWMAX          43      /* max tx power for channel */
 
1579
+#define        IEEE80211_IOC_STA_TXPOW         44      /* per-station tx power limit */
 
1580
+#define        IEEE80211_IOC_STA_INFO          45      /* station/neighbor info */
 
1581
+#define        IEEE80211_IOC_WME_CWMIN         46      /* WME: ECWmin */
 
1582
+#define        IEEE80211_IOC_WME_CWMAX         47      /* WME: ECWmax */
 
1583
+#define        IEEE80211_IOC_WME_AIFS          48      /* WME: AIFSN */
 
1584
+#define        IEEE80211_IOC_WME_TXOPLIMIT     49      /* WME: txops limit */
 
1585
+#define        IEEE80211_IOC_WME_ACM           50      /* WME: ACM (bss only) */
 
1586
+#define        IEEE80211_IOC_WME_ACKPOLICY     51      /* WME: ACK policy (!bss only)*/
 
1587
+#define        IEEE80211_IOC_DTIM_PERIOD       52      /* DTIM period (beacons) */
 
1588
+#define        IEEE80211_IOC_BEACON_INTERVAL   53      /* beacon interval (ms) */
 
1589
+#define        IEEE80211_IOC_ADDMAC            54      /* add sta to MAC ACL table */
 
1590
+#define        IEEE80211_IOC_DELMAC            55      /* del sta from MAC ACL table */
 
1591
+
 
1592
+/*
 
1593
+ * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
 
1594
+ */
 
1595
+struct ieee80211req_scan_result {
 
1596
+       u_int16_t       isr_len;                /* length (mult of 4) */
 
1597
+       u_int16_t       isr_freq;               /* MHz */
 
1598
+       u_int16_t       isr_flags;              /* channel flags */
 
1599
+       u_int8_t        isr_noise;
 
1600
+       u_int8_t        isr_rssi;
 
1601
+       u_int8_t        isr_intval;             /* beacon interval */
 
1602
+       u_int8_t        isr_capinfo;            /* capabilities */
 
1603
+       u_int8_t        isr_erp;                /* ERP element */
 
1604
+       u_int8_t        isr_bssid[IEEE80211_ADDR_LEN];
 
1605
+       u_int8_t        isr_nrates;
 
1606
+       u_int8_t        isr_rates[IEEE80211_RATE_MAXSIZE];
 
1607
+       u_int8_t        isr_ssid_len;           /* SSID length */
 
1608
+       u_int8_t        isr_ie_len;             /* IE length */
 
1609
+       u_int8_t        isr_pad[5];
 
1610
+       /* variable length SSID followed by IE data */
 
1611
+};
 
1612
+
 
1613
+#define        SIOCG80211STATS         _IOWR('i', 236, struct ifreq)
 
1614
+#endif /* __FreeBSD__ */
 
1615
+
 
1616
+#ifdef __linux__
 
1617
+/*
 
1618
+ * Wireless Extensions API, private ioctl interfaces.
 
1619
+ *
 
1620
+ * NB: Even-numbered ioctl numbers have set semantics and are privileged!
 
1621
+ *     (regardless of the incorrect comment in wireless.h!)
 
1622
+ */
 
1623
+#define        IEEE80211_IOCTL_SETPARAM        (SIOCIWFIRSTPRIV+0)
 
1624
+#define        IEEE80211_IOCTL_GETPARAM        (SIOCIWFIRSTPRIV+1)
 
1625
+#define        IEEE80211_IOCTL_SETKEY          (SIOCIWFIRSTPRIV+2)
 
1626
+#define        IEEE80211_IOCTL_DELKEY          (SIOCIWFIRSTPRIV+4)
 
1627
+#define        IEEE80211_IOCTL_SETMLME         (SIOCIWFIRSTPRIV+6)
 
1628
+#define        IEEE80211_IOCTL_SETOPTIE        (SIOCIWFIRSTPRIV+8)
 
1629
+#define        IEEE80211_IOCTL_GETOPTIE        (SIOCIWFIRSTPRIV+9)
 
1630
+#define        IEEE80211_IOCTL_ADDMAC          (SIOCIWFIRSTPRIV+10)
 
1631
+#define        IEEE80211_IOCTL_DELMAC          (SIOCIWFIRSTPRIV+12)
 
1632
+#define        IEEE80211_IOCTL_CHANLIST        (SIOCIWFIRSTPRIV+14)
 
1633
+#define IEEE80211_IOCTL_WDSADD         (SIOCIWFIRSTPRIV+16)
 
1634
+#define IEEE80211_IOCTL_WDSDEL         (SIOCIWFIRSTPRIV+18)
 
1635
+
 
1636
+enum {
 
1637
+       IEEE80211_PARAM_TURBO           = 1,    /* turbo mode */
 
1638
+       IEEE80211_PARAM_MODE            = 2,    /* phy mode (11a, 11b, etc.) */
 
1639
+       IEEE80211_PARAM_AUTHMODE        = 3,    /* authentication mode */
 
1640
+       IEEE80211_PARAM_PROTMODE        = 4,    /* 802.11g protection */
 
1641
+       IEEE80211_PARAM_MCASTCIPHER     = 5,    /* multicast/default cipher */
 
1642
+       IEEE80211_PARAM_MCASTKEYLEN     = 6,    /* multicast key length */
 
1643
+       IEEE80211_PARAM_UCASTCIPHERS    = 7,    /* unicast cipher suites */
 
1644
+       IEEE80211_PARAM_UCASTCIPHER     = 8,    /* unicast cipher */
 
1645
+       IEEE80211_PARAM_UCASTKEYLEN     = 9,    /* unicast key length */
 
1646
+       IEEE80211_PARAM_WPA             = 10,   /* WPA mode (0,1,2) */
 
1647
+       IEEE80211_PARAM_ROAMING         = 12,   /* roaming mode */
 
1648
+       IEEE80211_PARAM_PRIVACY         = 13,   /* privacy invoked */
 
1649
+       IEEE80211_PARAM_COUNTERMEASURES = 14,   /* WPA/TKIP countermeasures */
 
1650
+       IEEE80211_PARAM_DROPUNENCRYPTED = 15,   /* discard unencrypted frames */
 
1651
+       IEEE80211_PARAM_DRIVER_CAPS     = 16,   /* driver capabilities */
 
1652
+       IEEE80211_PARAM_MACCMD          = 17,   /* MAC ACL operation */
 
1653
+       IEEE80211_PARAM_WME             = 18,   /* WME mode (on, off) */
 
1654
+       IEEE80211_PARAM_HIDESSID        = 19,   /* hide SSID mode (on, off) */
 
1655
+       IEEE80211_PARAM_APBRIDGE        = 20,   /* AP inter-sta bridging */
 
1656
+       IEEE80211_PARAM_KEYMGTALGS      = 21,   /* key management algorithms */
 
1657
+       IEEE80211_PARAM_RSNCAPS         = 22,   /* RSN capabilities */
 
1658
+       IEEE80211_PARAM_INACT           = 23,   /* station inactivity timeout */
 
1659
+       IEEE80211_PARAM_INACT_AUTH      = 24,   /* station auth inact timeout */
 
1660
+       IEEE80211_PARAM_INACT_INIT      = 25,   /* station init inact timeout */
 
1661
+       IEEE80211_PARAM_IBSS            = 26,   /* pseudo ad-hoc mode or standard IBSS mode */
 
1662
+       IEEE80211_PARAM_PUREG           = 27,   /* pure or mixed G */
 
1663
+       IEEE80211_PARAM_WDSONLY         = 28,   /* only wds traffic allowed */
 
1664
+       IEEE80211_PARAM_RESET           = 99    /* reset the device */
 
1665
+};
 
1666
+
 
1667
+#define        SIOCG80211STATS         (SIOCDEVPRIVATE+2)
 
1668
+/* NB: require in+out parameters so cannot use wireless extensions, yech */
 
1669
+#define        IEEE80211_IOCTL_GETKEY          (SIOCDEVPRIVATE+3)
 
1670
+#define        IEEE80211_IOCTL_GETWPAIE        (SIOCDEVPRIVATE+4)
 
1671
+#define        IEEE80211_IOCTL_GETSTASTATS     (SIOCDEVPRIVATE+5)
 
1672
+
 
1673
+#endif /* __linux__ */
 
1674
+
 
1675
+#endif /* _NET80211_IEEE80211_IOCTL_H_ */