libipw.h 29.7 KB
Newer Older
J
Jeff Garzik 已提交
1 2 3 4 5 6 7 8
/*
 * Merged with mainline ieee80211.h in Aug 2004.  Original ieee802_11
 * remains copyright by the original authors
 *
 * Portions of the merged code are based on Host AP (software wireless
 * LAN access point) driver for Intersil Prism2/2.5/3.
 *
 * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen
9 10
 * <j@w1.fi>
 * Copyright (c) 2002-2003, Jouni Malinen <j@w1.fi>
J
Jeff Garzik 已提交
11 12 13
 *
 * Adaption to a generic IEEE 802.11 stack by James Ketrenos
 * <jketreno@linux.intel.com>
14
 * Copyright (c) 2004-2005, Intel Corporation
J
Jeff Garzik 已提交
15 16 17 18 19
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation. See README and COPYING for
 * more details.
20 21 22
 *
 * API Version History
 * 1.0.x -- Initial version
23
 * 1.1.x -- Added radiotap, QoS, TIM, libipw_geo APIs,
24
 *          various structure changes, and crypto API init method
J
Jeff Garzik 已提交
25
 */
26 27
#ifndef LIBIPW_H
#define LIBIPW_H
28 29
#include <linux/if_ether.h>	/* ETH_ALEN */
#include <linux/kernel.h>	/* ARRAY_SIZE */
30
#include <linux/wireless.h>
31
#include <linux/ieee80211.h>
J
Jeff Garzik 已提交
32

33
#include <net/lib80211.h>
34
#include <net/cfg80211.h>
35

36
#define LIBIPW_VERSION "git-1.1.13"
37

38
#define LIBIPW_DATA_LEN		2304
J
Jeff Garzik 已提交
39 40 41 42 43 44 45 46
/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
   6.2.1.1.2.

   The figure in section 7.1.2 suggests a body size of up to 2312
   bytes is allowed, which is a bit confusing, I suspect this
   represents the 2304 bytes of real data, plus a possible 8 bytes of
   WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */

47 48 49 50 51 52 53
#define LIBIPW_1ADDR_LEN 10
#define LIBIPW_2ADDR_LEN 16
#define LIBIPW_3ADDR_LEN 24
#define LIBIPW_4ADDR_LEN 30
#define LIBIPW_FCS_LEN    4
#define LIBIPW_HLEN			(LIBIPW_4ADDR_LEN)
#define LIBIPW_FRAME_LEN		(LIBIPW_DATA_LEN + LIBIPW_HLEN)
J
Jeff Garzik 已提交
54 55 56 57

#define MIN_FRAG_THRESHOLD     256U
#define	MAX_FRAG_THRESHOLD     2346U

58
/* QOS control */
59
#define LIBIPW_QCTL_TID		0x000F
60

J
Jeff Garzik 已提交
61 62
/* debug macros */

H
Helmut Schaa 已提交
63
#ifdef CONFIG_LIBIPW_DEBUG
64 65 66
extern u32 libipw_debug_level;
#define LIBIPW_DEBUG(level, fmt, args...) \
do { if (libipw_debug_level & (level)) \
67
  printk(KERN_DEBUG "libipw: %c %s " fmt, \
68
         in_interrupt() ? 'I' : 'U', __func__ , ## args); } while (0)
69
static inline bool libipw_ratelimit_debug(u32 level)
70
{
71
	return (libipw_debug_level & level) && net_ratelimit();
72
}
J
Jeff Garzik 已提交
73
#else
74 75
#define LIBIPW_DEBUG(level, fmt, args...) do {} while (0)
static inline bool libipw_ratelimit_debug(u32 level)
76 77 78
{
	return false;
}
H
Helmut Schaa 已提交
79
#endif				/* CONFIG_LIBIPW_DEBUG */
80

J
Jeff Garzik 已提交
81
/*
82
 * To use the debug system:
J
Jeff Garzik 已提交
83 84 85 86
 *
 * If you are defining a new debug classification, simply add it to the #define
 * list here in the form of:
 *
87
 * #define LIBIPW_DL_xxxx VALUE
J
Jeff Garzik 已提交
88 89 90 91
 *
 * shifting value to the left one bit from the previous entry.  xxxx should be
 * the name of the classification (for example, WEP)
 *
92 93
 * You then need to either add a LIBIPW_xxxx_DEBUG() macro definition for your
 * classification, or use LIBIPW_DEBUG(LIBIPW_DL_xxxx, ...) whenever you want
J
Jeff Garzik 已提交
94 95 96 97
 * to send output to that classification.
 *
 * To add your debug level to the list of levels seen when you perform
 *
98
 * % cat /proc/net/ieee80211/debug_level
J
Jeff Garzik 已提交
99
 *
100
 * you simply need to add your entry to the libipw_debug_level array.
J
Jeff Garzik 已提交
101
 *
102
 * If you do not see debug_level in /proc/net/ieee80211 then you do not have
H
Helmut Schaa 已提交
103
 * CONFIG_LIBIPW_DEBUG defined in your kernel configuration
J
Jeff Garzik 已提交
104 105 106
 *
 */

107 108 109 110 111 112 113 114 115 116 117 118
#define LIBIPW_DL_INFO          (1<<0)
#define LIBIPW_DL_WX            (1<<1)
#define LIBIPW_DL_SCAN          (1<<2)
#define LIBIPW_DL_STATE         (1<<3)
#define LIBIPW_DL_MGMT          (1<<4)
#define LIBIPW_DL_FRAG          (1<<5)
#define LIBIPW_DL_DROP          (1<<7)

#define LIBIPW_DL_TX            (1<<8)
#define LIBIPW_DL_RX            (1<<9)
#define LIBIPW_DL_QOS           (1<<31)

119 120
#define LIBIPW_ERROR(f, a...) printk(KERN_ERR "libipw: " f, ## a)
#define LIBIPW_WARNING(f, a...) printk(KERN_WARNING "libipw: " f, ## a)
121 122 123 124 125 126 127 128 129 130 131
#define LIBIPW_DEBUG_INFO(f, a...)   LIBIPW_DEBUG(LIBIPW_DL_INFO, f, ## a)

#define LIBIPW_DEBUG_WX(f, a...)     LIBIPW_DEBUG(LIBIPW_DL_WX, f, ## a)
#define LIBIPW_DEBUG_SCAN(f, a...)   LIBIPW_DEBUG(LIBIPW_DL_SCAN, f, ## a)
#define LIBIPW_DEBUG_STATE(f, a...)  LIBIPW_DEBUG(LIBIPW_DL_STATE, f, ## a)
#define LIBIPW_DEBUG_MGMT(f, a...)  LIBIPW_DEBUG(LIBIPW_DL_MGMT, f, ## a)
#define LIBIPW_DEBUG_FRAG(f, a...)  LIBIPW_DEBUG(LIBIPW_DL_FRAG, f, ## a)
#define LIBIPW_DEBUG_DROP(f, a...)  LIBIPW_DEBUG(LIBIPW_DL_DROP, f, ## a)
#define LIBIPW_DEBUG_TX(f, a...)  LIBIPW_DEBUG(LIBIPW_DL_TX, f, ## a)
#define LIBIPW_DEBUG_RX(f, a...)  LIBIPW_DEBUG(LIBIPW_DL_RX, f, ## a)
#define LIBIPW_DEBUG_QOS(f, a...)  LIBIPW_DEBUG(LIBIPW_DL_QOS, f, ## a)
J
Jeff Garzik 已提交
132
#include <linux/netdevice.h>
133
#include <linux/if_arp.h>	/* ARPHRD_ETHER */
J
Jeff Garzik 已提交
134 135

#ifndef WIRELESS_SPY
J
Jiri Benc 已提交
136
#define WIRELESS_SPY		/* enable iwspy support */
J
Jeff Garzik 已提交
137
#endif
J
Jiri Benc 已提交
138
#include <net/iw_handler.h>	/* new driver API */
J
Jeff Garzik 已提交
139

140
#define ETH_P_PREAUTH 0x88C7	/* IEEE 802.11i pre-authentication */
J
Jeff Garzik 已提交
141 142 143 144 145 146 147 148 149

#ifndef ETH_P_80211_RAW
#define ETH_P_80211_RAW (ETH_P_ECONET + 1)
#endif

/* IEEE 802.11 defines */

#define P80211_OUI_LEN 3

150
struct libipw_snap_hdr {
J
Jeff Garzik 已提交
151

152 153 154 155
	u8 dsap;		/* always 0xAA */
	u8 ssap;		/* always 0xAA */
	u8 ctrl;		/* always 0x03 */
	u8 oui[P80211_OUI_LEN];	/* organizational universal id */
J
Jeff Garzik 已提交
156 157 158

} __attribute__ ((packed));

159
#define SNAP_SIZE sizeof(struct libipw_snap_hdr)
J
Jeff Garzik 已提交
160

161
#define WLAN_FC_GET_VERS(fc) ((fc) & IEEE80211_FCTL_VERS)
J
Jeff Garzik 已提交
162 163 164 165
#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE)
#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE)

#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG)
166
#define WLAN_GET_SEQ_SEQ(seq)  (((seq) & IEEE80211_SCTL_SEQ) >> 4)
J
Jeff Garzik 已提交
167

168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
#define LIBIPW_STATMASK_SIGNAL (1<<0)
#define LIBIPW_STATMASK_RSSI (1<<1)
#define LIBIPW_STATMASK_NOISE (1<<2)
#define LIBIPW_STATMASK_RATE (1<<3)
#define LIBIPW_STATMASK_WEMASK 0x7

#define LIBIPW_CCK_MODULATION    (1<<0)
#define LIBIPW_OFDM_MODULATION   (1<<1)

#define LIBIPW_24GHZ_BAND     (1<<0)
#define LIBIPW_52GHZ_BAND     (1<<1)

#define LIBIPW_CCK_RATE_1MB		        0x02
#define LIBIPW_CCK_RATE_2MB		        0x04
#define LIBIPW_CCK_RATE_5MB		        0x0B
#define LIBIPW_CCK_RATE_11MB		        0x16
#define LIBIPW_OFDM_RATE_6MB		        0x0C
#define LIBIPW_OFDM_RATE_9MB		        0x12
#define LIBIPW_OFDM_RATE_12MB		0x18
#define LIBIPW_OFDM_RATE_18MB		0x24
#define LIBIPW_OFDM_RATE_24MB		0x30
#define LIBIPW_OFDM_RATE_36MB		0x48
#define LIBIPW_OFDM_RATE_48MB		0x60
#define LIBIPW_OFDM_RATE_54MB		0x6C
#define LIBIPW_BASIC_RATE_MASK		0x80

#define LIBIPW_CCK_RATE_1MB_MASK		(1<<0)
#define LIBIPW_CCK_RATE_2MB_MASK		(1<<1)
#define LIBIPW_CCK_RATE_5MB_MASK		(1<<2)
#define LIBIPW_CCK_RATE_11MB_MASK		(1<<3)
#define LIBIPW_OFDM_RATE_6MB_MASK		(1<<4)
#define LIBIPW_OFDM_RATE_9MB_MASK		(1<<5)
#define LIBIPW_OFDM_RATE_12MB_MASK		(1<<6)
#define LIBIPW_OFDM_RATE_18MB_MASK		(1<<7)
#define LIBIPW_OFDM_RATE_24MB_MASK		(1<<8)
#define LIBIPW_OFDM_RATE_36MB_MASK		(1<<9)
#define LIBIPW_OFDM_RATE_48MB_MASK		(1<<10)
#define LIBIPW_OFDM_RATE_54MB_MASK		(1<<11)

#define LIBIPW_CCK_RATES_MASK	        0x0000000F
#define LIBIPW_CCK_BASIC_RATES_MASK	(LIBIPW_CCK_RATE_1MB_MASK | \
	LIBIPW_CCK_RATE_2MB_MASK)
#define LIBIPW_CCK_DEFAULT_RATES_MASK	(LIBIPW_CCK_BASIC_RATES_MASK | \
        LIBIPW_CCK_RATE_5MB_MASK | \
        LIBIPW_CCK_RATE_11MB_MASK)

#define LIBIPW_OFDM_RATES_MASK		0x00000FF0
#define LIBIPW_OFDM_BASIC_RATES_MASK	(LIBIPW_OFDM_RATE_6MB_MASK | \
	LIBIPW_OFDM_RATE_12MB_MASK | \
	LIBIPW_OFDM_RATE_24MB_MASK)
#define LIBIPW_OFDM_DEFAULT_RATES_MASK	(LIBIPW_OFDM_BASIC_RATES_MASK | \
	LIBIPW_OFDM_RATE_9MB_MASK  | \
	LIBIPW_OFDM_RATE_18MB_MASK | \
	LIBIPW_OFDM_RATE_36MB_MASK | \
	LIBIPW_OFDM_RATE_48MB_MASK | \
	LIBIPW_OFDM_RATE_54MB_MASK)
#define LIBIPW_DEFAULT_RATES_MASK (LIBIPW_OFDM_DEFAULT_RATES_MASK | \
                                LIBIPW_CCK_DEFAULT_RATES_MASK)

#define LIBIPW_NUM_OFDM_RATES	    8
#define LIBIPW_NUM_CCK_RATES	            4
#define LIBIPW_OFDM_SHIFT_MASK_A         4
J
Jeff Garzik 已提交
230 231

/* NOTE: This data is for statistical purposes; not all hardware provides this
232
 *       information for frames received.
233
 *       For libipw_rx_mgt, you need to set at least the 'len' parameter.
234
 */
235
struct libipw_rx_stats {
J
Jeff Garzik 已提交
236 237 238 239
	u32 mac_time;
	s8 rssi;
	u8 signal;
	u8 noise;
240
	u16 rate;		/* in 100 kbps */
J
Jeff Garzik 已提交
241 242 243 244 245
	u8 received_channel;
	u8 control;
	u8 mask;
	u8 freq;
	u16 len;
246 247
	u64 tsf;
	u32 beacon_time;
J
Jeff Garzik 已提交
248 249 250 251 252 253
};

/* IEEE 802.11 requires that STA supports concurrent reception of at least
 * three fragmented frames. This define can be increased to support more
 * concurrent frames, but it should be noted that each entry can consume about
 * 2 kB of RAM and increasing cache size will slow down frame reassembly. */
254
#define LIBIPW_FRAG_CACHE_LEN 4
J
Jeff Garzik 已提交
255

256
struct libipw_frag_entry {
J
Jeff Garzik 已提交
257 258 259 260 261 262 263 264
	unsigned long first_frag_time;
	unsigned int seq;
	unsigned int last_frag;
	struct sk_buff *skb;
	u8 src_addr[ETH_ALEN];
	u8 dst_addr[ETH_ALEN];
};

265
struct libipw_stats {
J
Jeff Garzik 已提交
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
	unsigned int tx_unicast_frames;
	unsigned int tx_multicast_frames;
	unsigned int tx_fragments;
	unsigned int tx_unicast_octets;
	unsigned int tx_multicast_octets;
	unsigned int tx_deferred_transmissions;
	unsigned int tx_single_retry_frames;
	unsigned int tx_multiple_retry_frames;
	unsigned int tx_retry_limit_exceeded;
	unsigned int tx_discards;
	unsigned int rx_unicast_frames;
	unsigned int rx_multicast_frames;
	unsigned int rx_fragments;
	unsigned int rx_unicast_octets;
	unsigned int rx_multicast_octets;
	unsigned int rx_fcs_errors;
	unsigned int rx_discards_no_buffer;
	unsigned int tx_discards_wrong_sa;
	unsigned int rx_discards_undecryptable;
	unsigned int rx_message_in_msg_fragments;
	unsigned int rx_message_in_bad_msg_fragments;
};

289
struct libipw_device;
J
Jeff Garzik 已提交
290

291 292 293 294 295 296 297 298 299
#define SEC_KEY_1		(1<<0)
#define SEC_KEY_2		(1<<1)
#define SEC_KEY_3		(1<<2)
#define SEC_KEY_4		(1<<3)
#define SEC_ACTIVE_KEY		(1<<4)
#define SEC_AUTH_MODE		(1<<5)
#define SEC_UNICAST_GROUP	(1<<6)
#define SEC_LEVEL		(1<<7)
#define SEC_ENABLED		(1<<8)
300
#define SEC_ENCRYPT		(1<<9)
301 302 303 304 305 306 307

#define SEC_LEVEL_0		0	/* None */
#define SEC_LEVEL_1		1	/* WEP 40 and 104 bit */
#define SEC_LEVEL_2		2	/* Level 1 + TKIP */
#define SEC_LEVEL_2_CKIP	3	/* Level 1 + CKIP */
#define SEC_LEVEL_3		4	/* Level 2 + CCMP */

308 309 310 311 312
#define SEC_ALG_NONE		0
#define SEC_ALG_WEP		1
#define SEC_ALG_TKIP		2
#define SEC_ALG_CCMP		3

313 314 315 316
#define WEP_KEYS		4
#define WEP_KEY_LEN		13
#define SCM_KEY_LEN		32
#define SCM_TEMPORAL_KEY_LENGTH	16
J
Jeff Garzik 已提交
317

318
struct libipw_security {
319 320
	u16 active_key:2, enabled:1, unicast_uses_group:1, encrypt:1;
	u8 auth_mode;
321
	u8 encode_alg[WEP_KEYS];
J
Jeff Garzik 已提交
322
	u8 key_sizes[WEP_KEYS];
323
	u8 keys[WEP_KEYS][SCM_KEY_LEN];
J
Jeff Garzik 已提交
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
	u8 level;
	u16 flags;
} __attribute__ ((packed));

/*

 802.11 data frame from AP

      ,-------------------------------------------------------------------.
Bytes |  2   |  2   |    6    |    6    |    6    |  2   | 0..2312 |   4  |
      |------|------|---------|---------|---------|------|---------|------|
Desc. | ctrl | dura |  DA/RA  |   TA    |    SA   | Sequ |  frame  |  fcs |
      |      | tion | (BSSID) |         |         | ence |  data   |      |
      `-------------------------------------------------------------------'

Total: 28-2340 bytes

*/

#define BEACON_PROBE_SSID_ID_POSITION 12

345
struct libipw_hdr_1addr {
346 347
	__le16 frame_ctl;
	__le16 duration_id;
348 349 350 351
	u8 addr1[ETH_ALEN];
	u8 payload[0];
} __attribute__ ((packed));

352
struct libipw_hdr_2addr {
353 354
	__le16 frame_ctl;
	__le16 duration_id;
355 356 357 358 359
	u8 addr1[ETH_ALEN];
	u8 addr2[ETH_ALEN];
	u8 payload[0];
} __attribute__ ((packed));

360
struct libipw_hdr_3addr {
361 362
	__le16 frame_ctl;
	__le16 duration_id;
363 364 365
	u8 addr1[ETH_ALEN];
	u8 addr2[ETH_ALEN];
	u8 addr3[ETH_ALEN];
366
	__le16 seq_ctl;
367 368 369
	u8 payload[0];
} __attribute__ ((packed));

370
struct libipw_hdr_4addr {
371 372
	__le16 frame_ctl;
	__le16 duration_id;
373 374 375
	u8 addr1[ETH_ALEN];
	u8 addr2[ETH_ALEN];
	u8 addr3[ETH_ALEN];
376
	__le16 seq_ctl;
377 378 379 380
	u8 addr4[ETH_ALEN];
	u8 payload[0];
} __attribute__ ((packed));

381
struct libipw_hdr_3addrqos {
382 383
	__le16 frame_ctl;
	__le16 duration_id;
384 385 386
	u8 addr1[ETH_ALEN];
	u8 addr2[ETH_ALEN];
	u8 addr3[ETH_ALEN];
387
	__le16 seq_ctl;
388
	u8 payload[0];
389
	__le16 qos_ctl;
390 391
} __attribute__ ((packed));

392
struct libipw_info_element {
J
Jeff Garzik 已提交
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
	u8 id;
	u8 len;
	u8 data[0];
} __attribute__ ((packed));

/*
 * These are the data types that can make up management packets
 *
	u16 auth_algorithm;
	u16 auth_sequence;
	u16 beacon_interval;
	u16 capability;
	u8 current_ap[ETH_ALEN];
	u16 listen_interval;
	struct {
		u16 association_id:14, reserved:2;
	} __attribute__ ((packed));
	u32 time_stamp[2];
	u16 reason;
	u16 status;
*/

415 416
struct libipw_auth {
	struct libipw_hdr_3addr header;
J
Jiri Benc 已提交
417 418 419
	__le16 algorithm;
	__le16 transaction;
	__le16 status;
420
	/* challenge */
421
	struct libipw_info_element info_element[0];
J
Jeff Garzik 已提交
422 423
} __attribute__ ((packed));

424
struct libipw_channel_switch {
425 426 427 428 429 430 431
	u8 id;
	u8 len;
	u8 mode;
	u8 channel;
	u8 count;
} __attribute__ ((packed));

432 433
struct libipw_action {
	struct libipw_hdr_3addr header;
434 435 436
	u8 category;
	u8 action;
	union {
437
		struct libipw_action_exchange {
438
			u8 token;
439
			struct libipw_info_element info_element[0];
440
		} exchange;
441
		struct libipw_channel_switch channel_switch;
442 443 444 445

	} format;
} __attribute__ ((packed));

446 447
struct libipw_disassoc {
	struct libipw_hdr_3addr header;
448
	__le16 reason;
449 450
} __attribute__ ((packed));

451
/* Alias deauth for disassoc */
452
#define libipw_deauth libipw_disassoc
453

454 455
struct libipw_probe_request {
	struct libipw_hdr_3addr header;
456
	/* SSID, supported rates */
457
	struct libipw_info_element info_element[0];
458 459
} __attribute__ ((packed));

460 461
struct libipw_probe_response {
	struct libipw_hdr_3addr header;
A
Al Viro 已提交
462
	__le32 time_stamp[2];
J
Jiri Benc 已提交
463 464
	__le16 beacon_interval;
	__le16 capability;
465 466
	/* SSID, supported rates, FH params, DS params,
	 * CF params, IBSS params, TIM (if beacon), RSN */
467
	struct libipw_info_element info_element[0];
J
Jeff Garzik 已提交
468 469
} __attribute__ ((packed));

470
/* Alias beacon for probe_response */
471
#define libipw_beacon libipw_probe_response
472

473 474
struct libipw_assoc_request {
	struct libipw_hdr_3addr header;
475 476
	__le16 capability;
	__le16 listen_interval;
477
	/* SSID, supported rates, RSN */
478
	struct libipw_info_element info_element[0];
479 480
} __attribute__ ((packed));

481 482
struct libipw_reassoc_request {
	struct libipw_hdr_3addr header;
J
Jiri Benc 已提交
483 484
	__le16 capability;
	__le16 listen_interval;
J
Jeff Garzik 已提交
485
	u8 current_ap[ETH_ALEN];
486
	struct libipw_info_element info_element[0];
J
Jeff Garzik 已提交
487 488
} __attribute__ ((packed));

489 490
struct libipw_assoc_response {
	struct libipw_hdr_3addr header;
J
Jiri Benc 已提交
491 492 493
	__le16 capability;
	__le16 status;
	__le16 aid;
494
	/* supported rates */
495
	struct libipw_info_element info_element[0];
J
Jeff Garzik 已提交
496 497
} __attribute__ ((packed));

498
struct libipw_txb {
J
Jeff Garzik 已提交
499 500
	u8 nr_frags;
	u8 encrypted;
501 502
	u8 rts_included;
	u8 reserved;
A
Al Viro 已提交
503 504
	u16 frag_size;
	u16 payload_size;
J
Jeff Garzik 已提交
505 506 507
	struct sk_buff *fragments[0];
};

J
Jiri Benc 已提交
508
/* SWEEP TABLE ENTRIES NUMBER */
J
Jeff Garzik 已提交
509 510 511 512 513 514 515 516 517 518 519 520 521 522
#define MAX_SWEEP_TAB_ENTRIES		  42
#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET  7
/* MAX_RATES_LENGTH needs to be 12.  The spec says 8, and many APs
 * only use 8, and then use extended rates for the remaining supported
 * rates.  Other APs, however, stick all of their supported rates on the
 * main rates information element... */
#define MAX_RATES_LENGTH                  ((u8)12)
#define MAX_RATES_EX_LENGTH               ((u8)16)
#define MAX_NETWORK_COUNT                  128

#define CRC_LENGTH                 4U

#define MAX_WPA_IE_LEN 64

523 524 525 526 527 528
#define NETWORK_HAS_OFDM       (1<<1)
#define NETWORK_HAS_CCK        (1<<2)

/* QoS structure */
#define NETWORK_HAS_QOS_PARAMETERS      (1<<3)
#define NETWORK_HAS_QOS_INFORMATION     (1<<4)
529 530 531 532 533 534 535 536 537
#define NETWORK_HAS_QOS_MASK            (NETWORK_HAS_QOS_PARAMETERS | \
					 NETWORK_HAS_QOS_INFORMATION)

/* 802.11h */
#define NETWORK_HAS_POWER_CONSTRAINT    (1<<5)
#define NETWORK_HAS_CSA                 (1<<6)
#define NETWORK_HAS_QUIET               (1<<7)
#define NETWORK_HAS_IBSS_DFS            (1<<8)
#define NETWORK_HAS_TPC_REPORT          (1<<9)
538

539 540
#define NETWORK_HAS_ERP_VALUE           (1<<10)

541 542 543 544 545 546 547 548 549
#define QOS_QUEUE_NUM                   4
#define QOS_OUI_LEN                     3
#define QOS_OUI_TYPE                    2
#define QOS_ELEMENT_ID                  221
#define QOS_OUI_INFO_SUB_TYPE           0
#define QOS_OUI_PARAM_SUB_TYPE          1
#define QOS_VERSION_1                   1
#define QOS_AIFSN_MIN_VALUE             2

550
struct libipw_qos_information_element {
551 552 553 554 555 556 557 558 559
	u8 elementID;
	u8 length;
	u8 qui[QOS_OUI_LEN];
	u8 qui_type;
	u8 qui_subtype;
	u8 version;
	u8 ac_info;
} __attribute__ ((packed));

560
struct libipw_qos_ac_parameter {
561 562
	u8 aci_aifsn;
	u8 ecw_min_max;
563
	__le16 tx_op_limit;
564 565
} __attribute__ ((packed));

566 567
struct libipw_qos_parameter_info {
	struct libipw_qos_information_element info_element;
568
	u8 reserved;
569
	struct libipw_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM];
570 571
} __attribute__ ((packed));

572
struct libipw_qos_parameters {
573 574
	__le16 cw_min[QOS_QUEUE_NUM];
	__le16 cw_max[QOS_QUEUE_NUM];
575 576
	u8 aifs[QOS_QUEUE_NUM];
	u8 flag[QOS_QUEUE_NUM];
577
	__le16 tx_op_limit[QOS_QUEUE_NUM];
578 579
} __attribute__ ((packed));

580 581
struct libipw_qos_data {
	struct libipw_qos_parameters parameters;
582 583 584 585 586 587
	int active;
	int supported;
	u8 param_count;
	u8 old_param_count;
};

588
struct libipw_tim_parameters {
589 590 591 592 593
	u8 tim_count;
	u8 tim_period;
} __attribute__ ((packed));

/*******************************************************/
J
Jeff Garzik 已提交
594

595 596 597 598 599 600
enum {				/* libipw_basic_report.map */
	LIBIPW_BASIC_MAP_BSS = (1 << 0),
	LIBIPW_BASIC_MAP_OFDM = (1 << 1),
	LIBIPW_BASIC_MAP_UNIDENTIFIED = (1 << 2),
	LIBIPW_BASIC_MAP_RADAR = (1 << 3),
	LIBIPW_BASIC_MAP_UNMEASURED = (1 << 4),
601 602 603
	/* Bits 5-7 are reserved */

};
604
struct libipw_basic_report {
605 606 607 608 609 610
	u8 channel;
	__le64 start_time;
	__le16 duration;
	u8 map;
} __attribute__ ((packed));

611
enum {				/* libipw_measurement_request.mode */
612
	/* Bit 0 is reserved */
613 614 615
	LIBIPW_MEASUREMENT_ENABLE = (1 << 1),
	LIBIPW_MEASUREMENT_REQUEST = (1 << 2),
	LIBIPW_MEASUREMENT_REPORT = (1 << 3),
616 617 618 619
	/* Bits 4-7 are reserved */
};

enum {
620 621 622
	LIBIPW_REPORT_BASIC = 0,	/* required */
	LIBIPW_REPORT_CCA = 1,	/* optional */
	LIBIPW_REPORT_RPI = 2,	/* optional */
623 624 625
	/* 3-255 reserved */
};

626
struct libipw_measurement_params {
627 628 629 630 631
	u8 channel;
	__le64 start_time;
	__le16 duration;
} __attribute__ ((packed));

632 633
struct libipw_measurement_request {
	struct libipw_info_element ie;
634 635 636
	u8 token;
	u8 mode;
	u8 type;
637
	struct libipw_measurement_params params[0];
638 639
} __attribute__ ((packed));

640 641
struct libipw_measurement_report {
	struct libipw_info_element ie;
642 643 644 645
	u8 token;
	u8 mode;
	u8 type;
	union {
646
		struct libipw_basic_report basic[0];
647 648 649
	} u;
} __attribute__ ((packed));

650
struct libipw_tpc_report {
651 652 653 654
	u8 transmit_power;
	u8 link_margin;
} __attribute__ ((packed));

655
struct libipw_channel_map {
656 657 658 659
	u8 channel;
	u8 map;
} __attribute__ ((packed));

660 661
struct libipw_ibss_dfs {
	struct libipw_info_element ie;
662 663
	u8 owner[ETH_ALEN];
	u8 recovery_interval;
664
	struct libipw_channel_map channel_map[0];
665 666
};

667
struct libipw_csa {
668 669 670 671 672
	u8 mode;
	u8 channel;
	u8 count;
} __attribute__ ((packed));

673
struct libipw_quiet {
674 675 676 677 678 679
	u8 count;
	u8 period;
	u8 duration;
	u8 offset;
} __attribute__ ((packed));

680
struct libipw_network {
J
Jeff Garzik 已提交
681 682 683 684 685 686 687
	/* These entries are used to identify a unique network */
	u8 bssid[ETH_ALEN];
	u8 channel;
	/* Ensure null-terminated for any debug msgs */
	u8 ssid[IW_ESSID_MAX_SIZE + 1];
	u8 ssid_len;

688
	struct libipw_qos_data qos_data;
689

J
Jeff Garzik 已提交
690
	/* These are network statistics */
691
	struct libipw_rx_stats stats;
J
Jeff Garzik 已提交
692 693 694 695 696 697 698
	u16 capability;
	u8 rates[MAX_RATES_LENGTH];
	u8 rates_len;
	u8 rates_ex[MAX_RATES_EX_LENGTH];
	u8 rates_ex_len;
	unsigned long last_scanned;
	u8 mode;
699
	u32 flags;
J
Jeff Garzik 已提交
700 701 702 703 704
	u32 last_associate;
	u32 time_stamp[2];
	u16 beacon_interval;
	u16 listen_interval;
	u16 atim_window;
705
	u8 erp_value;
J
Jeff Garzik 已提交
706 707 708 709
	u8 wpa_ie[MAX_WPA_IE_LEN];
	size_t wpa_ie_len;
	u8 rsn_ie[MAX_WPA_IE_LEN];
	size_t rsn_ie_len;
710
	struct libipw_tim_parameters tim;
711 712 713 714 715 716 717

	/* 802.11h info */

	/* Power Constraint - mandatory if spctrm mgmt required */
	u8 power_constraint;

	/* TPC Report - mandatory if spctrm mgmt required */
718
	struct libipw_tpc_report tpc_report;
719 720 721

	/* IBSS DFS - mandatory if spctrm mgmt required and IBSS
	 * NOTE: This is variable length and so must be allocated dynamically */
722
	struct libipw_ibss_dfs *ibss_dfs;
723 724

	/* Channel Switch Announcement - optional if spctrm mgmt required */
725
	struct libipw_csa csa;
726 727

	/* Quiet - optional if spctrm mgmt required */
728
	struct libipw_quiet quiet;
729

J
Jeff Garzik 已提交
730 731 732
	struct list_head list;
};

733 734 735 736 737 738 739 740
enum libipw_state {
	LIBIPW_UNINITIALIZED = 0,
	LIBIPW_INITIALIZED,
	LIBIPW_ASSOCIATING,
	LIBIPW_ASSOCIATED,
	LIBIPW_AUTHENTICATING,
	LIBIPW_AUTHENTICATED,
	LIBIPW_SHUTDOWN
J
Jeff Garzik 已提交
741 742 743 744 745
};

#define DEFAULT_MAX_SCAN_AGE (15 * HZ)
#define DEFAULT_FTS 2346

746 747 748
#define CFG_LIBIPW_RESERVE_FCS (1<<0)
#define CFG_LIBIPW_COMPUTE_FCS (1<<1)
#define CFG_LIBIPW_RTS (1<<2)
J
Jeff Garzik 已提交
749

750 751 752 753
#define LIBIPW_24GHZ_MIN_CHANNEL 1
#define LIBIPW_24GHZ_MAX_CHANNEL 14
#define LIBIPW_24GHZ_CHANNELS (LIBIPW_24GHZ_MAX_CHANNEL - \
				  LIBIPW_24GHZ_MIN_CHANNEL + 1)
754

755 756 757 758
#define LIBIPW_52GHZ_MIN_CHANNEL 34
#define LIBIPW_52GHZ_MAX_CHANNEL 165
#define LIBIPW_52GHZ_CHANNELS (LIBIPW_52GHZ_MAX_CHANNEL - \
				  LIBIPW_52GHZ_MIN_CHANNEL + 1)
759 760

enum {
761 762 763 764 765 766 767
	LIBIPW_CH_PASSIVE_ONLY = (1 << 0),
	LIBIPW_CH_80211H_RULES = (1 << 1),
	LIBIPW_CH_B_ONLY = (1 << 2),
	LIBIPW_CH_NO_IBSS = (1 << 3),
	LIBIPW_CH_UNIFORM_SPREADING = (1 << 4),
	LIBIPW_CH_RADAR_DETECT = (1 << 5),
	LIBIPW_CH_INVALID = (1 << 6),
768 769
};

770
struct libipw_channel {
771
	u32 freq;	/* in MHz */
772 773
	u8 channel;
	u8 flags;
774
	u8 max_power;	/* in dBm */
775 776
};

777
struct libipw_geo {
778 779 780
	u8 name[4];
	u8 bg_channels;
	u8 a_channels;
781 782
	struct libipw_channel bg[LIBIPW_24GHZ_CHANNELS];
	struct libipw_channel a[LIBIPW_52GHZ_CHANNELS];
783 784
};

785
struct libipw_device {
J
Jeff Garzik 已提交
786
	struct net_device *dev;
787
	struct wireless_dev wdev;
788
	struct libipw_security sec;
J
Jeff Garzik 已提交
789 790

	/* Bookkeeping structures */
791
	struct libipw_stats ieee_stats;
J
Jeff Garzik 已提交
792

793
	struct libipw_geo geo;
794 795
	struct ieee80211_supported_band bg_band;
	struct ieee80211_supported_band a_band;
796

J
Jeff Garzik 已提交
797 798 799
	/* Probe / Beacon management */
	struct list_head network_free_list;
	struct list_head network_list;
800
	struct libipw_network *networks[MAX_NETWORK_COUNT];
J
Jeff Garzik 已提交
801 802 803
	int scans;
	int scan_age;

804 805
	int iw_mode;		/* operating mode (IW_MODE_*) */
	struct iw_spy_data spy_data;	/* iwspy support */
J
Jeff Garzik 已提交
806 807 808

	spinlock_t lock;

809 810
	int tx_headroom;	/* Set to size of any additional room needed at front
				 * of allocated Tx SKBs */
J
Jeff Garzik 已提交
811 812 813
	u32 config;

	/* WEP and other encryption related settings at the device level */
814
	int open_wep;		/* Set to 1 to allow unencrypted frames */
J
Jeff Garzik 已提交
815

816
	int reset_on_keychange;	/* Set to 1 if the HW needs to be reset on
J
Jeff Garzik 已提交
817 818 819 820
				 * WEP key changes */

	/* If the host performs {en,de}cryption, then set to 1 */
	int host_encrypt;
821
	int host_encrypt_msdu;
J
Jeff Garzik 已提交
822
	int host_decrypt;
823 824 825
	/* host performs multicast decryption */
	int host_mc_decrypt;

826 827 828 829
	/* host should strip IV and ICV from protected frames */
	/* meaningful only when hardware decryption is being used */
	int host_strip_iv_icv;

830
	int host_open_frag;
831
	int host_build_iv;
832
	int ieee802_1x;		/* is IEEE 802.1X used */
J
Jeff Garzik 已提交
833 834 835 836 837 838 839 840

	/* WPA data */
	int wpa_enabled;
	int drop_unencrypted;
	int privacy_invoked;
	size_t wpa_ie_len;
	u8 *wpa_ie;

841
	struct lib80211_crypt_info crypt_info;
J
Jeff Garzik 已提交
842

843 844
	int bcrx_sta_key;	/* use individual keys to override default keys even
				 * with RX of broad/multicast frames */
J
Jeff Garzik 已提交
845 846

	/* Fragmentation structures */
847
	struct libipw_frag_entry frag_cache[LIBIPW_FRAG_CACHE_LEN];
J
Jeff Garzik 已提交
848
	unsigned int frag_next_idx;
849
	u16 fts;		/* Fragmentation Threshold */
850
	u16 rts;		/* RTS threshold */
J
Jeff Garzik 已提交
851 852 853 854

	/* Association info */
	u8 bssid[ETH_ALEN];

855
	enum libipw_state state;
J
Jeff Garzik 已提交
856

857 858 859
	int mode;		/* A, B, G */
	int modulation;		/* CCK, OFDM */
	int freq_band;		/* 2.4Ghz, 5.2Ghz, Mixed */
860
	int abg_true;		/* ABG flag              */
J
Jeff Garzik 已提交
861

862 863 864
	int perfect_rssi;
	int worst_rssi;

865 866
	u16 prev_seq_ctl;	/* used to drop duplicate frames */

J
Jeff Garzik 已提交
867
	/* Callback functions */
868
	void (*set_security) (struct net_device * dev,
869
			      struct libipw_security * sec);
870 871
	netdev_tx_t (*hard_start_xmit) (struct libipw_txb * txb,
					struct net_device * dev, int pri);
872
	int (*reset_port) (struct net_device * dev);
873 874
	int (*is_queue_full) (struct net_device * dev, int pri);

875
	int (*handle_management) (struct net_device * dev,
876
				  struct libipw_network * network, u16 type);
877
	int (*is_qos_active) (struct net_device *dev, struct sk_buff *skb);
878

879 880
	/* Typical STA methods */
	int (*handle_auth) (struct net_device * dev,
881
			    struct libipw_auth * auth);
882
	int (*handle_deauth) (struct net_device * dev,
883
			      struct libipw_deauth * auth);
884
	int (*handle_action) (struct net_device * dev,
885 886
			      struct libipw_action * action,
			      struct libipw_rx_stats * stats);
887
	int (*handle_disassoc) (struct net_device * dev,
888
				struct libipw_disassoc * assoc);
889
	int (*handle_beacon) (struct net_device * dev,
890 891
			      struct libipw_beacon * beacon,
			      struct libipw_network * network);
892
	int (*handle_probe_response) (struct net_device * dev,
893 894
				      struct libipw_probe_response * resp,
				      struct libipw_network * network);
895
	int (*handle_probe_request) (struct net_device * dev,
896 897
				     struct libipw_probe_request * req,
				     struct libipw_rx_stats * stats);
898
	int (*handle_assoc_response) (struct net_device * dev,
899 900
				      struct libipw_assoc_response * resp,
				      struct libipw_network * network);
901 902 903 904

	/* Typical AP methods */
	int (*handle_assoc_request) (struct net_device * dev);
	int (*handle_reassoc_request) (struct net_device * dev,
905
				       struct libipw_reassoc_request * req);
J
Jeff Garzik 已提交
906 907

	/* This must be the last item so that it points to the data
908
	 * allocated beyond this structure by alloc_libipw */
J
Jeff Garzik 已提交
909 910 911 912 913 914 915 916
	u8 priv[0];
};

#define IEEE_A            (1<<0)
#define IEEE_B            (1<<1)
#define IEEE_G            (1<<2)
#define IEEE_MODE_MASK    (IEEE_A|IEEE_B|IEEE_G)

917
static inline void *libipw_priv(struct net_device *dev)
J
Jeff Garzik 已提交
918
{
919
	return ((struct libipw_device *)netdev_priv(dev))->priv;
J
Jeff Garzik 已提交
920 921
}

922
static inline int libipw_is_valid_mode(struct libipw_device *ieee,
923
					  int mode)
J
Jeff Garzik 已提交
924 925 926 927 928 929 930 931
{
	/*
	 * It is possible for both access points and our device to support
	 * combinations of modes, so as long as there is one valid combination
	 * of ap/device supported modes, then return success
	 *
	 */
	if ((mode & IEEE_A) &&
932 933
	    (ieee->modulation & LIBIPW_OFDM_MODULATION) &&
	    (ieee->freq_band & LIBIPW_52GHZ_BAND))
J
Jeff Garzik 已提交
934 935 936
		return 1;

	if ((mode & IEEE_G) &&
937 938
	    (ieee->modulation & LIBIPW_OFDM_MODULATION) &&
	    (ieee->freq_band & LIBIPW_24GHZ_BAND))
J
Jeff Garzik 已提交
939 940 941
		return 1;

	if ((mode & IEEE_B) &&
942 943
	    (ieee->modulation & LIBIPW_CCK_MODULATION) &&
	    (ieee->freq_band & LIBIPW_24GHZ_BAND))
J
Jeff Garzik 已提交
944 945 946 947 948
		return 1;

	return 0;
}

949
static inline int libipw_get_hdrlen(u16 fc)
J
Jeff Garzik 已提交
950
{
951
	int hdrlen = LIBIPW_3ADDR_LEN;
952
	u16 stype = WLAN_FC_GET_STYPE(fc);
J
Jeff Garzik 已提交
953 954 955 956

	switch (WLAN_FC_GET_TYPE(fc)) {
	case IEEE80211_FTYPE_DATA:
		if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))
957
			hdrlen = LIBIPW_4ADDR_LEN;
958 959
		if (stype & IEEE80211_STYPE_QOS_DATA)
			hdrlen += 2;
J
Jeff Garzik 已提交
960 961 962 963 964
		break;
	case IEEE80211_FTYPE_CTL:
		switch (WLAN_FC_GET_STYPE(fc)) {
		case IEEE80211_STYPE_CTS:
		case IEEE80211_STYPE_ACK:
965
			hdrlen = LIBIPW_1ADDR_LEN;
J
Jeff Garzik 已提交
966 967
			break;
		default:
968
			hdrlen = LIBIPW_2ADDR_LEN;
J
Jeff Garzik 已提交
969 970 971 972 973 974 975 976
			break;
		}
		break;
	}

	return hdrlen;
}

977
static inline u8 *libipw_get_payload(struct ieee80211_hdr *hdr)
978
{
979 980 981 982 983 984 985 986 987
	switch (libipw_get_hdrlen(le16_to_cpu(hdr->frame_control))) {
	case LIBIPW_1ADDR_LEN:
		return ((struct libipw_hdr_1addr *)hdr)->payload;
	case LIBIPW_2ADDR_LEN:
		return ((struct libipw_hdr_2addr *)hdr)->payload;
	case LIBIPW_3ADDR_LEN:
		return ((struct libipw_hdr_3addr *)hdr)->payload;
	case LIBIPW_4ADDR_LEN:
		return ((struct libipw_hdr_4addr *)hdr)->payload;
988
	}
989
	return NULL;
990 991
}

992
static inline int libipw_is_ofdm_rate(u8 rate)
993
{
994 995 996 997 998 999 1000 1001 1002
	switch (rate & ~LIBIPW_BASIC_RATE_MASK) {
	case LIBIPW_OFDM_RATE_6MB:
	case LIBIPW_OFDM_RATE_9MB:
	case LIBIPW_OFDM_RATE_12MB:
	case LIBIPW_OFDM_RATE_18MB:
	case LIBIPW_OFDM_RATE_24MB:
	case LIBIPW_OFDM_RATE_36MB:
	case LIBIPW_OFDM_RATE_48MB:
	case LIBIPW_OFDM_RATE_54MB:
1003 1004 1005 1006 1007
		return 1;
	}
	return 0;
}

1008
static inline int libipw_is_cck_rate(u8 rate)
1009
{
1010 1011 1012 1013 1014
	switch (rate & ~LIBIPW_BASIC_RATE_MASK) {
	case LIBIPW_CCK_RATE_1MB:
	case LIBIPW_CCK_RATE_2MB:
	case LIBIPW_CCK_RATE_5MB:
	case LIBIPW_CCK_RATE_11MB:
1015 1016 1017 1018 1019
		return 1;
	}
	return 0;
}

1020 1021 1022
/* libipw.c */
extern void free_libipw(struct net_device *dev, int monitor);
extern struct net_device *alloc_libipw(int sizeof_priv, int monitor);
1023
extern int libipw_change_mtu(struct net_device *dev, int new_mtu);
J
Jeff Garzik 已提交
1024

1025
extern void libipw_networks_age(struct libipw_device *ieee,
1026 1027
				   unsigned long age_secs);

1028
extern int libipw_set_encryption(struct libipw_device *ieee);
J
Jeff Garzik 已提交
1029

1030
/* libipw_tx.c */
1031 1032
extern netdev_tx_t libipw_xmit(struct sk_buff *skb,
			       struct net_device *dev);
1033
extern void libipw_txb_free(struct libipw_txb *);
J
Jeff Garzik 已提交
1034

1035 1036 1037 1038 1039
/* libipw_rx.c */
extern void libipw_rx_any(struct libipw_device *ieee,
		     struct sk_buff *skb, struct libipw_rx_stats *stats);
extern int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
			struct libipw_rx_stats *rx_stats);
1040
/* make sure to set stats->len */
1041 1042 1043 1044
extern void libipw_rx_mgt(struct libipw_device *ieee,
			     struct libipw_hdr_4addr *header,
			     struct libipw_rx_stats *stats);
extern void libipw_network_reset(struct libipw_network *network);
J
Jeff Garzik 已提交
1045

1046 1047
/* libipw_geo.c */
extern const struct libipw_geo *libipw_get_geo(struct libipw_device
1048
						     *ieee);
1049 1050
extern int libipw_set_geo(struct libipw_device *ieee,
			     const struct libipw_geo *geo);
1051

1052
extern int libipw_is_valid_channel(struct libipw_device *ieee,
1053
				      u8 channel);
1054
extern int libipw_channel_to_index(struct libipw_device *ieee,
1055
				      u8 channel);
1056 1057
extern u8 libipw_freq_to_channel(struct libipw_device *ieee, u32 freq);
extern u8 libipw_get_channel_flags(struct libipw_device *ieee,
1058
				      u8 channel);
1059 1060
extern const struct libipw_channel *libipw_get_channel(struct
							     libipw_device
1061
							     *ieee, u8 channel);
1062
extern u32 libipw_channel_to_freq(struct libipw_device * ieee,
1063
				      u8 channel);
1064

1065 1066
/* libipw_wx.c */
extern int libipw_wx_get_scan(struct libipw_device *ieee,
J
Jeff Garzik 已提交
1067 1068
				 struct iw_request_info *info,
				 union iwreq_data *wrqu, char *key);
1069
extern int libipw_wx_set_encode(struct libipw_device *ieee,
J
Jeff Garzik 已提交
1070 1071
				   struct iw_request_info *info,
				   union iwreq_data *wrqu, char *key);
1072
extern int libipw_wx_get_encode(struct libipw_device *ieee,
J
Jeff Garzik 已提交
1073 1074
				   struct iw_request_info *info,
				   union iwreq_data *wrqu, char *key);
1075
extern int libipw_wx_set_encodeext(struct libipw_device *ieee,
1076 1077
				      struct iw_request_info *info,
				      union iwreq_data *wrqu, char *extra);
1078
extern int libipw_wx_get_encodeext(struct libipw_device *ieee,
1079 1080
				      struct iw_request_info *info,
				      union iwreq_data *wrqu, char *extra);
J
Jeff Garzik 已提交
1081

1082
static inline void libipw_increment_scans(struct libipw_device *ieee)
J
Jeff Garzik 已提交
1083 1084 1085 1086
{
	ieee->scans++;
}

1087
static inline int libipw_get_scans(struct libipw_device *ieee)
J
Jeff Garzik 已提交
1088 1089 1090 1091
{
	return ieee->scans;
}

1092
#endif				/* LIBIPW_H */