aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/dst.h1
-rw-r--r--include/net/ieee80211.h525
-rw-r--r--include/net/ieee80211_crypt.h38
-rw-r--r--include/net/ieee80211_radiotap.h231
-rw-r--r--include/net/sock.h2
-rw-r--r--include/net/syncppp.h1
6 files changed, 659 insertions, 139 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 4a056a682435..6c196a5baf24 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -94,7 +94,6 @@ struct dst_ops
94 struct dst_entry * (*negative_advice)(struct dst_entry *); 94 struct dst_entry * (*negative_advice)(struct dst_entry *);
95 void (*link_failure)(struct sk_buff *); 95 void (*link_failure)(struct sk_buff *);
96 void (*update_pmtu)(struct dst_entry *dst, u32 mtu); 96 void (*update_pmtu)(struct dst_entry *dst, u32 mtu);
97 int (*get_mss)(struct dst_entry *dst, u32 mtu);
98 int entry_size; 97 int entry_size;
99 98
100 atomic_t entries; 99 atomic_t entries;
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index dc36b1be6745..5e38dca1d082 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -11,19 +11,26 @@
11 * 11 *
12 * Adaption to a generic IEEE 802.11 stack by James Ketrenos 12 * Adaption to a generic IEEE 802.11 stack by James Ketrenos
13 * <jketreno@linux.intel.com> 13 * <jketreno@linux.intel.com>
14 * Copyright (c) 2004, Intel Corporation 14 * Copyright (c) 2004-2005, Intel Corporation
15 * 15 *
16 * This program is free software; you can redistribute it and/or modify 16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License version 2 as 17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation. See README and COPYING for 18 * published by the Free Software Foundation. See README and COPYING for
19 * more details. 19 * more details.
20 *
21 * API Version History
22 * 1.0.x -- Initial version
23 * 1.1.x -- Added radiotap, QoS, TIM, ieee80211_geo APIs,
24 * various structure changes, and crypto API init method
20 */ 25 */
21#ifndef IEEE80211_H 26#ifndef IEEE80211_H
22#define IEEE80211_H 27#define IEEE80211_H
23#include <linux/if_ether.h> /* ETH_ALEN */ 28#include <linux/if_ether.h> /* ETH_ALEN */
24#include <linux/kernel.h> /* ARRAY_SIZE */ 29#include <linux/kernel.h> /* ARRAY_SIZE */
25#include <linux/wireless.h> 30#include <linux/wireless.h>
26 31
32#define IEEE80211_VERSION "git-1.1.6"
33
27#define IEEE80211_DATA_LEN 2304 34#define IEEE80211_DATA_LEN 2304
28/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section 35/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
29 6.2.1.1.2. 36 6.2.1.1.2.
@@ -33,34 +40,13 @@
33 represents the 2304 bytes of real data, plus a possible 8 bytes of 40 represents the 2304 bytes of real data, plus a possible 8 bytes of
34 WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ 41 WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */
35 42
36
37#define IEEE80211_HLEN 30
38#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
39
40struct ieee80211_hdr {
41 __le16 frame_ctl;
42 __le16 duration_id;
43 u8 addr1[ETH_ALEN];
44 u8 addr2[ETH_ALEN];
45 u8 addr3[ETH_ALEN];
46 __le16 seq_ctl;
47 u8 addr4[ETH_ALEN];
48} __attribute__ ((packed));
49
50struct ieee80211_hdr_3addr {
51 __le16 frame_ctl;
52 __le16 duration_id;
53 u8 addr1[ETH_ALEN];
54 u8 addr2[ETH_ALEN];
55 u8 addr3[ETH_ALEN];
56 __le16 seq_ctl;
57} __attribute__ ((packed));
58
59#define IEEE80211_1ADDR_LEN 10 43#define IEEE80211_1ADDR_LEN 10
60#define IEEE80211_2ADDR_LEN 16 44#define IEEE80211_2ADDR_LEN 16
61#define IEEE80211_3ADDR_LEN 24 45#define IEEE80211_3ADDR_LEN 24
62#define IEEE80211_4ADDR_LEN 30 46#define IEEE80211_4ADDR_LEN 30
63#define IEEE80211_FCS_LEN 4 47#define IEEE80211_FCS_LEN 4
48#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN)
49#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
64 50
65#define MIN_FRAG_THRESHOLD 256U 51#define MIN_FRAG_THRESHOLD 256U
66#define MAX_FRAG_THRESHOLD 2346U 52#define MAX_FRAG_THRESHOLD 2346U
@@ -113,11 +99,11 @@ struct ieee80211_hdr_3addr {
113#define IEEE80211_STYPE_CFACK 0x0050 99#define IEEE80211_STYPE_CFACK 0x0050
114#define IEEE80211_STYPE_CFPOLL 0x0060 100#define IEEE80211_STYPE_CFPOLL 0x0060
115#define IEEE80211_STYPE_CFACKPOLL 0x0070 101#define IEEE80211_STYPE_CFACKPOLL 0x0070
102#define IEEE80211_STYPE_QOS_DATA 0x0080
116 103
117#define IEEE80211_SCTL_FRAG 0x000F 104#define IEEE80211_SCTL_FRAG 0x000F
118#define IEEE80211_SCTL_SEQ 0xFFF0 105#define IEEE80211_SCTL_SEQ 0xFFF0
119 106
120
121/* debug macros */ 107/* debug macros */
122 108
123#ifdef CONFIG_IEEE80211_DEBUG 109#ifdef CONFIG_IEEE80211_DEBUG
@@ -128,8 +114,7 @@ do { if (ieee80211_debug_level & (level)) \
128 in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) 114 in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
129#else 115#else
130#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0) 116#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
131#endif /* CONFIG_IEEE80211_DEBUG */ 117#endif /* CONFIG_IEEE80211_DEBUG */
132
133 118
134/* debug macros not dependent on CONFIG_IEEE80211_DEBUG */ 119/* debug macros not dependent on CONFIG_IEEE80211_DEBUG */
135 120
@@ -140,7 +125,6 @@ do { if (ieee80211_debug_level & (level)) \
140 * messages. It should never be used for passing essid to user space. */ 125 * messages. It should never be used for passing essid to user space. */
141const char *escape_essid(const char *essid, u8 essid_len); 126const char *escape_essid(const char *essid, u8 essid_len);
142 127
143
144/* 128/*
145 * To use the debug system: 129 * To use the debug system:
146 * 130 *
@@ -177,6 +161,7 @@ const char *escape_essid(const char *essid, u8 essid_len);
177 161
178#define IEEE80211_DL_TX (1<<8) 162#define IEEE80211_DL_TX (1<<8)
179#define IEEE80211_DL_RX (1<<9) 163#define IEEE80211_DL_RX (1<<9)
164#define IEEE80211_DL_QOS (1<<31)
180 165
181#define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a) 166#define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a)
182#define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a) 167#define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a)
@@ -190,9 +175,10 @@ const char *escape_essid(const char *essid, u8 essid_len);
190#define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a) 175#define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a)
191#define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a) 176#define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a)
192#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a) 177#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a)
178#define IEEE80211_DEBUG_QOS(f, a...) IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a)
193#include <linux/netdevice.h> 179#include <linux/netdevice.h>
194#include <linux/wireless.h> 180#include <linux/wireless.h>
195#include <linux/if_arp.h> /* ARPHRD_ETHER */ 181#include <linux/if_arp.h> /* ARPHRD_ETHER */
196 182
197#ifndef WIRELESS_SPY 183#ifndef WIRELESS_SPY
198#define WIRELESS_SPY /* enable iwspy support */ 184#define WIRELESS_SPY /* enable iwspy support */
@@ -200,10 +186,10 @@ const char *escape_essid(const char *essid, u8 essid_len);
200#include <net/iw_handler.h> /* new driver API */ 186#include <net/iw_handler.h> /* new driver API */
201 187
202#ifndef ETH_P_PAE 188#ifndef ETH_P_PAE
203#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ 189#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
204#endif /* ETH_P_PAE */ 190#endif /* ETH_P_PAE */
205 191
206#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */ 192#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */
207 193
208#ifndef ETH_P_80211_RAW 194#ifndef ETH_P_80211_RAW
209#define ETH_P_80211_RAW (ETH_P_ECONET + 1) 195#define ETH_P_80211_RAW (ETH_P_ECONET + 1)
@@ -215,10 +201,10 @@ const char *escape_essid(const char *essid, u8 essid_len);
215 201
216struct ieee80211_snap_hdr { 202struct ieee80211_snap_hdr {
217 203
218 u8 dsap; /* always 0xAA */ 204 u8 dsap; /* always 0xAA */
219 u8 ssap; /* always 0xAA */ 205 u8 ssap; /* always 0xAA */
220 u8 ctrl; /* always 0x03 */ 206 u8 ctrl; /* always 0x03 */
221 u8 oui[P80211_OUI_LEN]; /* organizational universal id */ 207 u8 oui[P80211_OUI_LEN]; /* organizational universal id */
222 208
223} __attribute__ ((packed)); 209} __attribute__ ((packed));
224 210
@@ -246,8 +232,9 @@ struct ieee80211_snap_hdr {
246#define WLAN_CAPABILITY_PBCC (1<<6) 232#define WLAN_CAPABILITY_PBCC (1<<6)
247#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) 233#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
248#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) 234#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
235#define WLAN_CAPABILITY_QOS (1<<9)
249#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) 236#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
250#define WLAN_CAPABILITY_OSSS_OFDM (1<<13) 237#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
251 238
252/* Status codes */ 239/* Status codes */
253enum ieee80211_statuscode { 240enum ieee80211_statuscode {
@@ -312,14 +299,12 @@ enum ieee80211_reasoncode {
312 WLAN_REASON_CIPHER_SUITE_REJECTED = 24, 299 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
313}; 300};
314 301
315
316#define IEEE80211_STATMASK_SIGNAL (1<<0) 302#define IEEE80211_STATMASK_SIGNAL (1<<0)
317#define IEEE80211_STATMASK_RSSI (1<<1) 303#define IEEE80211_STATMASK_RSSI (1<<1)
318#define IEEE80211_STATMASK_NOISE (1<<2) 304#define IEEE80211_STATMASK_NOISE (1<<2)
319#define IEEE80211_STATMASK_RATE (1<<3) 305#define IEEE80211_STATMASK_RATE (1<<3)
320#define IEEE80211_STATMASK_WEMASK 0x7 306#define IEEE80211_STATMASK_WEMASK 0x7
321 307
322
323#define IEEE80211_CCK_MODULATION (1<<0) 308#define IEEE80211_CCK_MODULATION (1<<0)
324#define IEEE80211_OFDM_MODULATION (1<<1) 309#define IEEE80211_OFDM_MODULATION (1<<1)
325 310
@@ -377,9 +362,6 @@ enum ieee80211_reasoncode {
377#define IEEE80211_NUM_CCK_RATES 4 362#define IEEE80211_NUM_CCK_RATES 4
378#define IEEE80211_OFDM_SHIFT_MASK_A 4 363#define IEEE80211_OFDM_SHIFT_MASK_A 4
379 364
380
381
382
383/* NOTE: This data is for statistical purposes; not all hardware provides this 365/* NOTE: This data is for statistical purposes; not all hardware provides this
384 * information for frames received. Not setting these will not cause 366 * information for frames received. Not setting these will not cause
385 * any adverse affects. */ 367 * any adverse affects. */
@@ -388,7 +370,7 @@ struct ieee80211_rx_stats {
388 s8 rssi; 370 s8 rssi;
389 u8 signal; 371 u8 signal;
390 u8 noise; 372 u8 noise;
391 u16 rate; /* in 100 kbps */ 373 u16 rate; /* in 100 kbps */
392 u8 received_channel; 374 u8 received_channel;
393 u8 control; 375 u8 control;
394 u8 mask; 376 u8 mask;
@@ -439,38 +421,44 @@ struct ieee80211_device;
439 421
440#include "ieee80211_crypt.h" 422#include "ieee80211_crypt.h"
441 423
442#define SEC_KEY_1 (1<<0) 424#define SEC_KEY_1 (1<<0)
443#define SEC_KEY_2 (1<<1) 425#define SEC_KEY_2 (1<<1)
444#define SEC_KEY_3 (1<<2) 426#define SEC_KEY_3 (1<<2)
445#define SEC_KEY_4 (1<<3) 427#define SEC_KEY_4 (1<<3)
446#define SEC_ACTIVE_KEY (1<<4) 428#define SEC_ACTIVE_KEY (1<<4)
447#define SEC_AUTH_MODE (1<<5) 429#define SEC_AUTH_MODE (1<<5)
448#define SEC_UNICAST_GROUP (1<<6) 430#define SEC_UNICAST_GROUP (1<<6)
449#define SEC_LEVEL (1<<7) 431#define SEC_LEVEL (1<<7)
450#define SEC_ENABLED (1<<8) 432#define SEC_ENABLED (1<<8)
451 433#define SEC_ENCRYPT (1<<9)
452#define SEC_LEVEL_0 0 /* None */ 434
453#define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */ 435#define SEC_LEVEL_0 0 /* None */
454#define SEC_LEVEL_2 2 /* Level 1 + TKIP */ 436#define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */
455#define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */ 437#define SEC_LEVEL_2 2 /* Level 1 + TKIP */
456#define SEC_LEVEL_3 4 /* Level 2 + CCMP */ 438#define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */
457 439#define SEC_LEVEL_3 4 /* Level 2 + CCMP */
458#define WEP_KEYS 4 440
459#define WEP_KEY_LEN 13 441#define SEC_ALG_NONE 0
442#define SEC_ALG_WEP 1
443#define SEC_ALG_TKIP 2
444#define SEC_ALG_CCMP 3
445
446#define WEP_KEYS 4
447#define WEP_KEY_LEN 13
448#define SCM_KEY_LEN 32
449#define SCM_TEMPORAL_KEY_LENGTH 16
460 450
461struct ieee80211_security { 451struct ieee80211_security {
462 u16 active_key:2, 452 u16 active_key:2,
463 enabled:1, 453 enabled:1,
464 auth_mode:2, 454 auth_mode:2, auth_algo:4, unicast_uses_group:1, encrypt:1;
465 auth_algo:4, 455 u8 encode_alg[WEP_KEYS];
466 unicast_uses_group:1;
467 u8 key_sizes[WEP_KEYS]; 456 u8 key_sizes[WEP_KEYS];
468 u8 keys[WEP_KEYS][WEP_KEY_LEN]; 457 u8 keys[WEP_KEYS][SCM_KEY_LEN];
469 u8 level; 458 u8 level;
470 u16 flags; 459 u16 flags;
471} __attribute__ ((packed)); 460} __attribute__ ((packed));
472 461
473
474/* 462/*
475 463
476 802.11 data frame from AP 464 802.11 data frame from AP
@@ -494,7 +482,7 @@ enum ieee80211_mfie {
494 MFIE_TYPE_RATES = 1, 482 MFIE_TYPE_RATES = 1,
495 MFIE_TYPE_FH_SET = 2, 483 MFIE_TYPE_FH_SET = 2,
496 MFIE_TYPE_DS_SET = 3, 484 MFIE_TYPE_DS_SET = 3,
497 MFIE_TYPE_CF_SET = 4, 485 MFIE_TYPE_CF_SET = 4,
498 MFIE_TYPE_TIM = 5, 486 MFIE_TYPE_TIM = 5,
499 MFIE_TYPE_IBSS_SET = 6, 487 MFIE_TYPE_IBSS_SET = 6,
500 MFIE_TYPE_COUNTRY = 7, 488 MFIE_TYPE_COUNTRY = 7,
@@ -516,11 +504,75 @@ enum ieee80211_mfie {
516 MFIE_TYPE_RSN = 48, 504 MFIE_TYPE_RSN = 48,
517 MFIE_TYPE_RATES_EX = 50, 505 MFIE_TYPE_RATES_EX = 50,
518 MFIE_TYPE_GENERIC = 221, 506 MFIE_TYPE_GENERIC = 221,
507 MFIE_TYPE_QOS_PARAMETER = 222,
519}; 508};
520 509
521struct ieee80211_info_element_hdr { 510/* Minimal header; can be used for passing 802.11 frames with sufficient
522 u8 id; 511 * information to determine what type of underlying data type is actually
523 u8 len; 512 * stored in the data. */
513struct ieee80211_hdr {
514 __le16 frame_ctl;
515 __le16 duration_id;
516 u8 payload[0];
517} __attribute__ ((packed));
518
519struct ieee80211_hdr_1addr {
520 __le16 frame_ctl;
521 __le16 duration_id;
522 u8 addr1[ETH_ALEN];
523 u8 payload[0];
524} __attribute__ ((packed));
525
526struct ieee80211_hdr_2addr {
527 __le16 frame_ctl;
528 __le16 duration_id;
529 u8 addr1[ETH_ALEN];
530 u8 addr2[ETH_ALEN];
531 u8 payload[0];
532} __attribute__ ((packed));
533
534struct ieee80211_hdr_3addr {
535 __le16 frame_ctl;
536 __le16 duration_id;
537 u8 addr1[ETH_ALEN];
538 u8 addr2[ETH_ALEN];
539 u8 addr3[ETH_ALEN];
540 __le16 seq_ctl;
541 u8 payload[0];
542} __attribute__ ((packed));
543
544struct ieee80211_hdr_4addr {
545 __le16 frame_ctl;
546 __le16 duration_id;
547 u8 addr1[ETH_ALEN];
548 u8 addr2[ETH_ALEN];
549 u8 addr3[ETH_ALEN];
550 __le16 seq_ctl;
551 u8 addr4[ETH_ALEN];
552 u8 payload[0];
553} __attribute__ ((packed));
554
555struct ieee80211_hdr_3addrqos {
556 __le16 frame_ctl;
557 __le16 duration_id;
558 u8 addr1[ETH_ALEN];
559 u8 addr2[ETH_ALEN];
560 u8 addr3[ETH_ALEN];
561 __le16 seq_ctl;
562 u8 payload[0];
563 __le16 qos_ctl;
564} __attribute__ ((packed));
565
566struct ieee80211_hdr_4addrqos {
567 __le16 frame_ctl;
568 __le16 duration_id;
569 u8 addr1[ETH_ALEN];
570 u8 addr2[ETH_ALEN];
571 u8 addr3[ETH_ALEN];
572 __le16 seq_ctl;
573 u8 addr4[ETH_ALEN];
574 u8 payload[0];
575 __le16 qos_ctl;
524} __attribute__ ((packed)); 576} __attribute__ ((packed));
525 577
526struct ieee80211_info_element { 578struct ieee80211_info_element {
@@ -546,49 +598,77 @@ struct ieee80211_info_element {
546 u16 status; 598 u16 status;
547*/ 599*/
548 600
549struct ieee80211_authentication { 601struct ieee80211_auth {
550 struct ieee80211_hdr_3addr header; 602 struct ieee80211_hdr_3addr header;
551 __le16 algorithm; 603 __le16 algorithm;
552 __le16 transaction; 604 __le16 transaction;
553 __le16 status; 605 __le16 status;
554 struct ieee80211_info_element info_element; 606 /* challenge */
607 struct ieee80211_info_element info_element[0];
555} __attribute__ ((packed)); 608} __attribute__ ((packed));
556 609
610struct ieee80211_disassoc {
611 struct ieee80211_hdr_3addr header;
612 __le16 reason;
613} __attribute__ ((packed));
614
615/* Alias deauth for disassoc */
616#define ieee80211_deauth ieee80211_disassoc
617
618struct ieee80211_probe_request {
619 struct ieee80211_hdr_3addr header;
620 /* SSID, supported rates */
621 struct ieee80211_info_element info_element[0];
622} __attribute__ ((packed));
557 623
558struct ieee80211_probe_response { 624struct ieee80211_probe_response {
559 struct ieee80211_hdr_3addr header; 625 struct ieee80211_hdr_3addr header;
560 u32 time_stamp[2]; 626 u32 time_stamp[2];
561 __le16 beacon_interval; 627 __le16 beacon_interval;
562 __le16 capability; 628 __le16 capability;
563 struct ieee80211_info_element info_element; 629 /* SSID, supported rates, FH params, DS params,
630 * CF params, IBSS params, TIM (if beacon), RSN */
631 struct ieee80211_info_element info_element[0];
564} __attribute__ ((packed)); 632} __attribute__ ((packed));
565 633
566struct ieee80211_assoc_request_frame { 634/* Alias beacon for probe_response */
635#define ieee80211_beacon ieee80211_probe_response
636
637struct ieee80211_assoc_request {
638 struct ieee80211_hdr_3addr header;
639 __le16 capability;
640 __le16 listen_interval;
641 /* SSID, supported rates, RSN */
642 struct ieee80211_info_element info_element[0];
643} __attribute__ ((packed));
644
645struct ieee80211_reassoc_request {
646 struct ieee80211_hdr_3addr header;
567 __le16 capability; 647 __le16 capability;
568 __le16 listen_interval; 648 __le16 listen_interval;
569 u8 current_ap[ETH_ALEN]; 649 u8 current_ap[ETH_ALEN];
570 struct ieee80211_info_element info_element; 650 struct ieee80211_info_element info_element[0];
571} __attribute__ ((packed)); 651} __attribute__ ((packed));
572 652
573struct ieee80211_assoc_response_frame { 653struct ieee80211_assoc_response {
574 struct ieee80211_hdr_3addr header; 654 struct ieee80211_hdr_3addr header;
575 __le16 capability; 655 __le16 capability;
576 __le16 status; 656 __le16 status;
577 __le16 aid; 657 __le16 aid;
578 struct ieee80211_info_element info_element; /* supported rates */ 658 /* supported rates */
659 struct ieee80211_info_element info_element[0];
579} __attribute__ ((packed)); 660} __attribute__ ((packed));
580 661
581
582struct ieee80211_txb { 662struct ieee80211_txb {
583 u8 nr_frags; 663 u8 nr_frags;
584 u8 encrypted; 664 u8 encrypted;
585 u16 reserved; 665 u8 rts_included;
586 u16 frag_size; 666 u8 reserved;
587 u16 payload_size; 667 __le16 frag_size;
668 __le16 payload_size;
588 struct sk_buff *fragments[0]; 669 struct sk_buff *fragments[0];
589}; 670};
590 671
591
592/* SWEEP TABLE ENTRIES NUMBER */ 672/* SWEEP TABLE ENTRIES NUMBER */
593#define MAX_SWEEP_TAB_ENTRIES 42 673#define MAX_SWEEP_TAB_ENTRIES 42
594#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7 674#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7
@@ -604,9 +684,68 @@ struct ieee80211_txb {
604 684
605#define MAX_WPA_IE_LEN 64 685#define MAX_WPA_IE_LEN 64
606 686
607#define NETWORK_EMPTY_ESSID (1<<0) 687#define NETWORK_EMPTY_ESSID (1<<0)
608#define NETWORK_HAS_OFDM (1<<1) 688#define NETWORK_HAS_OFDM (1<<1)
609#define NETWORK_HAS_CCK (1<<2) 689#define NETWORK_HAS_CCK (1<<2)
690
691/* QoS structure */
692#define NETWORK_HAS_QOS_PARAMETERS (1<<3)
693#define NETWORK_HAS_QOS_INFORMATION (1<<4)
694#define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | NETWORK_HAS_QOS_INFORMATION)
695
696#define QOS_QUEUE_NUM 4
697#define QOS_OUI_LEN 3
698#define QOS_OUI_TYPE 2
699#define QOS_ELEMENT_ID 221
700#define QOS_OUI_INFO_SUB_TYPE 0
701#define QOS_OUI_PARAM_SUB_TYPE 1
702#define QOS_VERSION_1 1
703#define QOS_AIFSN_MIN_VALUE 2
704
705struct ieee80211_qos_information_element {
706 u8 elementID;
707 u8 length;
708 u8 qui[QOS_OUI_LEN];
709 u8 qui_type;
710 u8 qui_subtype;
711 u8 version;
712 u8 ac_info;
713} __attribute__ ((packed));
714
715struct ieee80211_qos_ac_parameter {
716 u8 aci_aifsn;
717 u8 ecw_min_max;
718 __le16 tx_op_limit;
719} __attribute__ ((packed));
720
721struct ieee80211_qos_parameter_info {
722 struct ieee80211_qos_information_element info_element;
723 u8 reserved;
724 struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM];
725} __attribute__ ((packed));
726
727struct ieee80211_qos_parameters {
728 __le16 cw_min[QOS_QUEUE_NUM];
729 __le16 cw_max[QOS_QUEUE_NUM];
730 u8 aifs[QOS_QUEUE_NUM];
731 u8 flag[QOS_QUEUE_NUM];
732 __le16 tx_op_limit[QOS_QUEUE_NUM];
733} __attribute__ ((packed));
734
735struct ieee80211_qos_data {
736 struct ieee80211_qos_parameters parameters;
737 int active;
738 int supported;
739 u8 param_count;
740 u8 old_param_count;
741};
742
743struct ieee80211_tim_parameters {
744 u8 tim_count;
745 u8 tim_period;
746} __attribute__ ((packed));
747
748/*******************************************************/
610 749
611struct ieee80211_network { 750struct ieee80211_network {
612 /* These entries are used to identify a unique network */ 751 /* These entries are used to identify a unique network */
@@ -616,6 +755,8 @@ struct ieee80211_network {
616 u8 ssid[IW_ESSID_MAX_SIZE + 1]; 755 u8 ssid[IW_ESSID_MAX_SIZE + 1];
617 u8 ssid_len; 756 u8 ssid_len;
618 757
758 struct ieee80211_qos_data qos_data;
759
619 /* These are network statistics */ 760 /* These are network statistics */
620 struct ieee80211_rx_stats stats; 761 struct ieee80211_rx_stats stats;
621 u16 capability; 762 u16 capability;
@@ -631,10 +772,12 @@ struct ieee80211_network {
631 u16 beacon_interval; 772 u16 beacon_interval;
632 u16 listen_interval; 773 u16 listen_interval;
633 u16 atim_window; 774 u16 atim_window;
775 u8 erp_value;
634 u8 wpa_ie[MAX_WPA_IE_LEN]; 776 u8 wpa_ie[MAX_WPA_IE_LEN];
635 size_t wpa_ie_len; 777 size_t wpa_ie_len;
636 u8 rsn_ie[MAX_WPA_IE_LEN]; 778 u8 rsn_ie[MAX_WPA_IE_LEN];
637 size_t rsn_ie_len; 779 size_t rsn_ie_len;
780 struct ieee80211_tim_parameters tim;
638 struct list_head list; 781 struct list_head list;
639}; 782};
640 783
@@ -651,17 +794,52 @@ enum ieee80211_state {
651#define DEFAULT_MAX_SCAN_AGE (15 * HZ) 794#define DEFAULT_MAX_SCAN_AGE (15 * HZ)
652#define DEFAULT_FTS 2346 795#define DEFAULT_FTS 2346
653 796
654
655#define CFG_IEEE80211_RESERVE_FCS (1<<0) 797#define CFG_IEEE80211_RESERVE_FCS (1<<0)
656#define CFG_IEEE80211_COMPUTE_FCS (1<<1) 798#define CFG_IEEE80211_COMPUTE_FCS (1<<1)
799#define CFG_IEEE80211_RTS (1<<2)
800
801#define IEEE80211_24GHZ_MIN_CHANNEL 1
802#define IEEE80211_24GHZ_MAX_CHANNEL 14
803#define IEEE80211_24GHZ_CHANNELS 14
804
805#define IEEE80211_52GHZ_MIN_CHANNEL 36
806#define IEEE80211_52GHZ_MAX_CHANNEL 165
807#define IEEE80211_52GHZ_CHANNELS 32
808
809enum {
810 IEEE80211_CH_PASSIVE_ONLY = (1 << 0),
811 IEEE80211_CH_B_ONLY = (1 << 2),
812 IEEE80211_CH_NO_IBSS = (1 << 3),
813 IEEE80211_CH_UNIFORM_SPREADING = (1 << 4),
814 IEEE80211_CH_RADAR_DETECT = (1 << 5),
815 IEEE80211_CH_INVALID = (1 << 6),
816};
817
818struct ieee80211_channel {
819 u32 freq;
820 u8 channel;
821 u8 flags;
822 u8 max_power;
823};
824
825struct ieee80211_geo {
826 u8 name[4];
827 u8 bg_channels;
828 u8 a_channels;
829 struct ieee80211_channel bg[IEEE80211_24GHZ_CHANNELS];
830 struct ieee80211_channel a[IEEE80211_52GHZ_CHANNELS];
831};
657 832
658struct ieee80211_device { 833struct ieee80211_device {
659 struct net_device *dev; 834 struct net_device *dev;
835 struct ieee80211_security sec;
660 836
661 /* Bookkeeping structures */ 837 /* Bookkeeping structures */
662 struct net_device_stats stats; 838 struct net_device_stats stats;
663 struct ieee80211_stats ieee_stats; 839 struct ieee80211_stats ieee_stats;
664 840
841 struct ieee80211_geo geo;
842
665 /* Probe / Beacon management */ 843 /* Probe / Beacon management */
666 struct list_head network_free_list; 844 struct list_head network_free_list;
667 struct list_head network_list; 845 struct list_head network_list;
@@ -669,62 +847,102 @@ struct ieee80211_device {
669 int scans; 847 int scans;
670 int scan_age; 848 int scan_age;
671 849
672 int iw_mode; /* operating mode (IW_MODE_*) */ 850 int iw_mode; /* operating mode (IW_MODE_*) */
851 struct iw_spy_data spy_data; /* iwspy support */
673 852
674 spinlock_t lock; 853 spinlock_t lock;
675 854
676 int tx_headroom; /* Set to size of any additional room needed at front 855 int tx_headroom; /* Set to size of any additional room needed at front
677 * of allocated Tx SKBs */ 856 * of allocated Tx SKBs */
678 u32 config; 857 u32 config;
679 858
680 /* WEP and other encryption related settings at the device level */ 859 /* WEP and other encryption related settings at the device level */
681 int open_wep; /* Set to 1 to allow unencrypted frames */ 860 int open_wep; /* Set to 1 to allow unencrypted frames */
682 861
683 int reset_on_keychange; /* Set to 1 if the HW needs to be reset on 862 int reset_on_keychange; /* Set to 1 if the HW needs to be reset on
684 * WEP key changes */ 863 * WEP key changes */
685 864
686 /* If the host performs {en,de}cryption, then set to 1 */ 865 /* If the host performs {en,de}cryption, then set to 1 */
687 int host_encrypt; 866 int host_encrypt;
867 int host_encrypt_msdu;
688 int host_decrypt; 868 int host_decrypt;
689 int ieee802_1x; /* is IEEE 802.1X used */ 869 /* host performs multicast decryption */
870 int host_mc_decrypt;
871
872 int host_open_frag;
873 int host_build_iv;
874 int ieee802_1x; /* is IEEE 802.1X used */
690 875
691 /* WPA data */ 876 /* WPA data */
692 int wpa_enabled; 877 int wpa_enabled;
693 int drop_unencrypted; 878 int drop_unencrypted;
694 int tkip_countermeasures;
695 int privacy_invoked; 879 int privacy_invoked;
696 size_t wpa_ie_len; 880 size_t wpa_ie_len;
697 u8 *wpa_ie; 881 u8 *wpa_ie;
698 882
699 struct list_head crypt_deinit_list; 883 struct list_head crypt_deinit_list;
700 struct ieee80211_crypt_data *crypt[WEP_KEYS]; 884 struct ieee80211_crypt_data *crypt[WEP_KEYS];
701 int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */ 885 int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */
702 struct timer_list crypt_deinit_timer; 886 struct timer_list crypt_deinit_timer;
887 int crypt_quiesced;
703 888
704 int bcrx_sta_key; /* use individual keys to override default keys even 889 int bcrx_sta_key; /* use individual keys to override default keys even
705 * with RX of broad/multicast frames */ 890 * with RX of broad/multicast frames */
706 891
707 /* Fragmentation structures */ 892 /* Fragmentation structures */
708 struct ieee80211_frag_entry frag_cache[IEEE80211_FRAG_CACHE_LEN]; 893 struct ieee80211_frag_entry frag_cache[IEEE80211_FRAG_CACHE_LEN];
709 unsigned int frag_next_idx; 894 unsigned int frag_next_idx;
710 u16 fts; /* Fragmentation Threshold */ 895 u16 fts; /* Fragmentation Threshold */
896 u16 rts; /* RTS threshold */
711 897
712 /* Association info */ 898 /* Association info */
713 u8 bssid[ETH_ALEN]; 899 u8 bssid[ETH_ALEN];
714 900
715 enum ieee80211_state state; 901 enum ieee80211_state state;
716 902
717 int mode; /* A, B, G */ 903 int mode; /* A, B, G */
718 int modulation; /* CCK, OFDM */ 904 int modulation; /* CCK, OFDM */
719 int freq_band; /* 2.4Ghz, 5.2Ghz, Mixed */ 905 int freq_band; /* 2.4Ghz, 5.2Ghz, Mixed */
720 int abg_ture; /* ABG flag */ 906 int abg_true; /* ABG flag */
907
908 int perfect_rssi;
909 int worst_rssi;
721 910
722 /* Callback functions */ 911 /* Callback functions */
723 void (*set_security)(struct net_device *dev, 912 void (*set_security) (struct net_device * dev,
724 struct ieee80211_security *sec); 913 struct ieee80211_security * sec);
725 int (*hard_start_xmit)(struct ieee80211_txb *txb, 914 int (*hard_start_xmit) (struct ieee80211_txb * txb,
726 struct net_device *dev); 915 struct net_device * dev, int pri);
727 int (*reset_port)(struct net_device *dev); 916 int (*reset_port) (struct net_device * dev);
917 int (*is_queue_full) (struct net_device * dev, int pri);
918
919 int (*handle_management) (struct net_device * dev,
920 struct ieee80211_network * network, u16 type);
921
922 /* Typical STA methods */
923 int (*handle_auth) (struct net_device * dev,
924 struct ieee80211_auth * auth);
925 int (*handle_deauth) (struct net_device * dev,
926 struct ieee80211_auth * auth);
927 int (*handle_disassoc) (struct net_device * dev,
928 struct ieee80211_disassoc * assoc);
929 int (*handle_beacon) (struct net_device * dev,
930 struct ieee80211_beacon * beacon,
931 struct ieee80211_network * network);
932 int (*handle_probe_response) (struct net_device * dev,
933 struct ieee80211_probe_response * resp,
934 struct ieee80211_network * network);
935 int (*handle_probe_request) (struct net_device * dev,
936 struct ieee80211_probe_request * req,
937 struct ieee80211_rx_stats * stats);
938 int (*handle_assoc_response) (struct net_device * dev,
939 struct ieee80211_assoc_response * resp,
940 struct ieee80211_network * network);
941
942 /* Typical AP methods */
943 int (*handle_assoc_request) (struct net_device * dev);
944 int (*handle_reassoc_request) (struct net_device * dev,
945 struct ieee80211_reassoc_request * req);
728 946
729 /* This must be the last item so that it points to the data 947 /* This must be the last item so that it points to the data
730 * allocated beyond this structure by alloc_ieee80211 */ 948 * allocated beyond this structure by alloc_ieee80211 */
@@ -736,12 +954,12 @@ struct ieee80211_device {
736#define IEEE_G (1<<2) 954#define IEEE_G (1<<2)
737#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) 955#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G)
738 956
739extern inline void *ieee80211_priv(struct net_device *dev) 957static inline void *ieee80211_priv(struct net_device *dev)
740{ 958{
741 return ((struct ieee80211_device *)netdev_priv(dev))->priv; 959 return ((struct ieee80211_device *)netdev_priv(dev))->priv;
742} 960}
743 961
744extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) 962static inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
745{ 963{
746 /* Single white space is for Linksys APs */ 964 /* Single white space is for Linksys APs */
747 if (essid_len == 1 && essid[0] == ' ') 965 if (essid_len == 1 && essid[0] == ' ')
@@ -757,7 +975,8 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
757 return 1; 975 return 1;
758} 976}
759 977
760extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode) 978static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee,
979 int mode)
761{ 980{
762 /* 981 /*
763 * It is possible for both access points and our device to support 982 * It is possible for both access points and our device to support
@@ -783,14 +1002,17 @@ extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mod
783 return 0; 1002 return 0;
784} 1003}
785 1004
786extern inline int ieee80211_get_hdrlen(u16 fc) 1005static inline int ieee80211_get_hdrlen(u16 fc)
787{ 1006{
788 int hdrlen = IEEE80211_3ADDR_LEN; 1007 int hdrlen = IEEE80211_3ADDR_LEN;
1008 u16 stype = WLAN_FC_GET_STYPE(fc);
789 1009
790 switch (WLAN_FC_GET_TYPE(fc)) { 1010 switch (WLAN_FC_GET_TYPE(fc)) {
791 case IEEE80211_FTYPE_DATA: 1011 case IEEE80211_FTYPE_DATA:
792 if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) 1012 if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))
793 hdrlen = IEEE80211_4ADDR_LEN; 1013 hdrlen = IEEE80211_4ADDR_LEN;
1014 if (stype & IEEE80211_STYPE_QOS_DATA)
1015 hdrlen += 2;
794 break; 1016 break;
795 case IEEE80211_FTYPE_CTL: 1017 case IEEE80211_FTYPE_CTL:
796 switch (WLAN_FC_GET_STYPE(fc)) { 1018 switch (WLAN_FC_GET_STYPE(fc)) {
@@ -808,7 +1030,48 @@ extern inline int ieee80211_get_hdrlen(u16 fc)
808 return hdrlen; 1030 return hdrlen;
809} 1031}
810 1032
1033static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr)
1034{
1035 switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) {
1036 case IEEE80211_1ADDR_LEN:
1037 return ((struct ieee80211_hdr_1addr *)hdr)->payload;
1038 case IEEE80211_2ADDR_LEN:
1039 return ((struct ieee80211_hdr_2addr *)hdr)->payload;
1040 case IEEE80211_3ADDR_LEN:
1041 return ((struct ieee80211_hdr_3addr *)hdr)->payload;
1042 case IEEE80211_4ADDR_LEN:
1043 return ((struct ieee80211_hdr_4addr *)hdr)->payload;
1044 }
1045
1046}
1047
1048static inline int ieee80211_is_ofdm_rate(u8 rate)
1049{
1050 switch (rate & ~IEEE80211_BASIC_RATE_MASK) {
1051 case IEEE80211_OFDM_RATE_6MB:
1052 case IEEE80211_OFDM_RATE_9MB:
1053 case IEEE80211_OFDM_RATE_12MB:
1054 case IEEE80211_OFDM_RATE_18MB:
1055 case IEEE80211_OFDM_RATE_24MB:
1056 case IEEE80211_OFDM_RATE_36MB:
1057 case IEEE80211_OFDM_RATE_48MB:
1058 case IEEE80211_OFDM_RATE_54MB:
1059 return 1;
1060 }
1061 return 0;
1062}
811 1063
1064static inline int ieee80211_is_cck_rate(u8 rate)
1065{
1066 switch (rate & ~IEEE80211_BASIC_RATE_MASK) {
1067 case IEEE80211_CCK_RATE_1MB:
1068 case IEEE80211_CCK_RATE_2MB:
1069 case IEEE80211_CCK_RATE_5MB:
1070 case IEEE80211_CCK_RATE_11MB:
1071 return 1;
1072 }
1073 return 0;
1074}
812 1075
813/* ieee80211.c */ 1076/* ieee80211.c */
814extern void free_ieee80211(struct net_device *dev); 1077extern void free_ieee80211(struct net_device *dev);
@@ -817,18 +1080,30 @@ extern struct net_device *alloc_ieee80211(int sizeof_priv);
817extern int ieee80211_set_encryption(struct ieee80211_device *ieee); 1080extern int ieee80211_set_encryption(struct ieee80211_device *ieee);
818 1081
819/* ieee80211_tx.c */ 1082/* ieee80211_tx.c */
820extern int ieee80211_xmit(struct sk_buff *skb, 1083extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev);
821 struct net_device *dev);
822extern void ieee80211_txb_free(struct ieee80211_txb *); 1084extern void ieee80211_txb_free(struct ieee80211_txb *);
823 1085extern int ieee80211_tx_frame(struct ieee80211_device *ieee,
1086 struct ieee80211_hdr *frame, int len);
824 1087
825/* ieee80211_rx.c */ 1088/* ieee80211_rx.c */
826extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, 1089extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
827 struct ieee80211_rx_stats *rx_stats); 1090 struct ieee80211_rx_stats *rx_stats);
828extern void ieee80211_rx_mgt(struct ieee80211_device *ieee, 1091extern void ieee80211_rx_mgt(struct ieee80211_device *ieee,
829 struct ieee80211_hdr *header, 1092 struct ieee80211_hdr_4addr *header,
830 struct ieee80211_rx_stats *stats); 1093 struct ieee80211_rx_stats *stats);
831 1094
1095/* ieee80211_geo.c */
1096extern const struct ieee80211_geo *ieee80211_get_geo(struct ieee80211_device
1097 *ieee);
1098extern int ieee80211_set_geo(struct ieee80211_device *ieee,
1099 const struct ieee80211_geo *geo);
1100
1101extern int ieee80211_is_valid_channel(struct ieee80211_device *ieee,
1102 u8 channel);
1103extern int ieee80211_channel_to_index(struct ieee80211_device *ieee,
1104 u8 channel);
1105extern u8 ieee80211_freq_to_channel(struct ieee80211_device *ieee, u32 freq);
1106
832/* ieee80211_wx.c */ 1107/* ieee80211_wx.c */
833extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee, 1108extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
834 struct iw_request_info *info, 1109 struct iw_request_info *info,
@@ -839,17 +1114,21 @@ extern int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
839extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee, 1114extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
840 struct iw_request_info *info, 1115 struct iw_request_info *info,
841 union iwreq_data *wrqu, char *key); 1116 union iwreq_data *wrqu, char *key);
842 1117extern int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
843 1118 struct iw_request_info *info,
844extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee) 1119 union iwreq_data *wrqu, char *extra);
1120extern int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee,
1121 struct iw_request_info *info,
1122 union iwreq_data *wrqu, char *extra);
1123
1124static inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
845{ 1125{
846 ieee->scans++; 1126 ieee->scans++;
847} 1127}
848 1128
849extern inline int ieee80211_get_scans(struct ieee80211_device *ieee) 1129static inline int ieee80211_get_scans(struct ieee80211_device *ieee)
850{ 1130{
851 return ieee->scans; 1131 return ieee->scans;
852} 1132}
853 1133
854 1134#endif /* IEEE80211_H */
855#endif /* IEEE80211_H */
diff --git a/include/net/ieee80211_crypt.h b/include/net/ieee80211_crypt.h
index b58a3bcc0dc0..0a1c2d82ca4b 100644
--- a/include/net/ieee80211_crypt.h
+++ b/include/net/ieee80211_crypt.h
@@ -25,16 +25,22 @@
25 25
26#include <linux/skbuff.h> 26#include <linux/skbuff.h>
27 27
28enum {
29 IEEE80211_CRYPTO_TKIP_COUNTERMEASURES = (1 << 0),
30};
31
28struct ieee80211_crypto_ops { 32struct ieee80211_crypto_ops {
29 const char *name; 33 const char *name;
30 34
31 /* init new crypto context (e.g., allocate private data space, 35 /* init new crypto context (e.g., allocate private data space,
32 * select IV, etc.); returns NULL on failure or pointer to allocated 36 * select IV, etc.); returns NULL on failure or pointer to allocated
33 * private data on success */ 37 * private data on success */
34 void * (*init)(int keyidx); 38 void *(*init) (int keyidx);
35 39
36 /* deinitialize crypto context and free allocated private data */ 40 /* deinitialize crypto context and free allocated private data */
37 void (*deinit)(void *priv); 41 void (*deinit) (void *priv);
42
43 int (*build_iv) (struct sk_buff * skb, int hdr_len, void *priv);
38 44
39 /* encrypt/decrypt return < 0 on error or >= 0 on success. The return 45 /* encrypt/decrypt return < 0 on error or >= 0 on success. The return
40 * value from decrypt_mpdu is passed as the keyidx value for 46 * value from decrypt_mpdu is passed as the keyidx value for
@@ -42,34 +48,39 @@ struct ieee80211_crypto_ops {
42 * encryption; if not, error will be returned; these functions are 48 * encryption; if not, error will be returned; these functions are
43 * called for all MPDUs (i.e., fragments). 49 * called for all MPDUs (i.e., fragments).
44 */ 50 */
45 int (*encrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv); 51 int (*encrypt_mpdu) (struct sk_buff * skb, int hdr_len, void *priv);
46 int (*decrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv); 52 int (*decrypt_mpdu) (struct sk_buff * skb, int hdr_len, void *priv);
47 53
48 /* These functions are called for full MSDUs, i.e. full frames. 54 /* These functions are called for full MSDUs, i.e. full frames.
49 * These can be NULL if full MSDU operations are not needed. */ 55 * These can be NULL if full MSDU operations are not needed. */
50 int (*encrypt_msdu)(struct sk_buff *skb, int hdr_len, void *priv); 56 int (*encrypt_msdu) (struct sk_buff * skb, int hdr_len, void *priv);
51 int (*decrypt_msdu)(struct sk_buff *skb, int keyidx, int hdr_len, 57 int (*decrypt_msdu) (struct sk_buff * skb, int keyidx, int hdr_len,
52 void *priv); 58 void *priv);
53 59
54 int (*set_key)(void *key, int len, u8 *seq, void *priv); 60 int (*set_key) (void *key, int len, u8 * seq, void *priv);
55 int (*get_key)(void *key, int len, u8 *seq, void *priv); 61 int (*get_key) (void *key, int len, u8 * seq, void *priv);
56 62
57 /* procfs handler for printing out key information and possible 63 /* procfs handler for printing out key information and possible
58 * statistics */ 64 * statistics */
59 char * (*print_stats)(char *p, void *priv); 65 char *(*print_stats) (char *p, void *priv);
66
67 /* Crypto specific flag get/set for configuration settings */
68 unsigned long (*get_flags) (void *priv);
69 unsigned long (*set_flags) (unsigned long flags, void *priv);
60 70
61 /* maximum number of bytes added by encryption; encrypt buf is 71 /* maximum number of bytes added by encryption; encrypt buf is
62 * allocated with extra_prefix_len bytes, copy of in_buf, and 72 * allocated with extra_prefix_len bytes, copy of in_buf, and
63 * extra_postfix_len; encrypt need not use all this space, but 73 * extra_postfix_len; encrypt need not use all this space, but
64 * the result must start at the beginning of the buffer and correct 74 * the result must start at the beginning of the buffer and correct
65 * length must be returned */ 75 * length must be returned */
66 int extra_prefix_len, extra_postfix_len; 76 int extra_mpdu_prefix_len, extra_mpdu_postfix_len;
77 int extra_msdu_prefix_len, extra_msdu_postfix_len;
67 78
68 struct module *owner; 79 struct module *owner;
69}; 80};
70 81
71struct ieee80211_crypt_data { 82struct ieee80211_crypt_data {
72 struct list_head list; /* delayed deletion list */ 83 struct list_head list; /* delayed deletion list */
73 struct ieee80211_crypto_ops *ops; 84 struct ieee80211_crypto_ops *ops;
74 void *priv; 85 void *priv;
75 atomic_t refcnt; 86 atomic_t refcnt;
@@ -77,10 +88,11 @@ struct ieee80211_crypt_data {
77 88
78int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops); 89int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops);
79int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops); 90int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops);
80struct ieee80211_crypto_ops * ieee80211_get_crypto_ops(const char *name); 91struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const char *name);
81void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int); 92void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int);
82void ieee80211_crypt_deinit_handler(unsigned long); 93void ieee80211_crypt_deinit_handler(unsigned long);
83void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee, 94void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee,
84 struct ieee80211_crypt_data **crypt); 95 struct ieee80211_crypt_data **crypt);
96void ieee80211_crypt_quiescing(struct ieee80211_device *ieee);
85 97
86#endif 98#endif
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
new file mode 100644
index 000000000000..429b73892a5f
--- /dev/null
+++ b/include/net/ieee80211_radiotap.h
@@ -0,0 +1,231 @@
1/* $FreeBSD: src/sys/net80211/ieee80211_radiotap.h,v 1.5 2005/01/22 20:12:05 sam Exp $ */
2/* $NetBSD: ieee80211_radiotap.h,v 1.11 2005/06/22 06:16:02 dyoung Exp $ */
3
4/*-
5 * Copyright (c) 2003, 2004 David Young. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of David Young may not be used to endorse or promote
16 * products derived from this software without specific prior
17 * written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``AS IS'' AND ANY
20 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID
23 * YOUNG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
25 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
30 * OF SUCH DAMAGE.
31 */
32
33/*
34 * Modifications to fit into the linux IEEE 802.11 stack,
35 * Mike Kershaw (dragorn@kismetwireless.net)
36 */
37
38#ifndef IEEE80211RADIOTAP_H
39#define IEEE80211RADIOTAP_H
40
41#include <linux/if_ether.h>
42#include <linux/kernel.h>
43
44/* Radiotap header version (from official NetBSD feed) */
45#define IEEE80211RADIOTAP_VERSION "1.5"
46/* Base version of the radiotap packet header data */
47#define PKTHDR_RADIOTAP_VERSION 0
48
49/* A generic radio capture format is desirable. There is one for
50 * Linux, but it is neither rigidly defined (there were not even
51 * units given for some fields) nor easily extensible.
52 *
53 * I suggest the following extensible radio capture format. It is
54 * based on a bitmap indicating which fields are present.
55 *
56 * I am trying to describe precisely what the application programmer
57 * should expect in the following, and for that reason I tell the
58 * units and origin of each measurement (where it applies), or else I
59 * use sufficiently weaselly language ("is a monotonically nondecreasing
60 * function of...") that I cannot set false expectations for lawyerly
61 * readers.
62 */
63
64/* XXX tcpdump/libpcap do not tolerate variable-length headers,
65 * yet, so we pad every radiotap header to 64 bytes. Ugh.
66 */
67#define IEEE80211_RADIOTAP_HDRLEN 64
68
69/* The radio capture header precedes the 802.11 header. */
70struct ieee80211_radiotap_header {
71 u8 it_version; /* Version 0. Only increases
72 * for drastic changes,
73 * introduction of compatible
74 * new fields does not count.
75 */
76 u8 it_pad;
77 u16 it_len; /* length of the whole
78 * header in bytes, including
79 * it_version, it_pad,
80 * it_len, and data fields.
81 */
82 u32 it_present; /* A bitmap telling which
83 * fields are present. Set bit 31
84 * (0x80000000) to extend the
85 * bitmap by another 32 bits.
86 * Additional extensions are made
87 * by setting bit 31.
88 */
89};
90
91/* Name Data type Units
92 * ---- --------- -----
93 *
94 * IEEE80211_RADIOTAP_TSFT u64 microseconds
95 *
96 * Value in microseconds of the MAC's 64-bit 802.11 Time
97 * Synchronization Function timer when the first bit of the
98 * MPDU arrived at the MAC. For received frames, only.
99 *
100 * IEEE80211_RADIOTAP_CHANNEL 2 x u16 MHz, bitmap
101 *
102 * Tx/Rx frequency in MHz, followed by flags (see below).
103 *
104 * IEEE80211_RADIOTAP_FHSS u16 see below
105 *
106 * For frequency-hopping radios, the hop set (first byte)
107 * and pattern (second byte).
108 *
109 * IEEE80211_RADIOTAP_RATE u8 500kb/s
110 *
111 * Tx/Rx data rate
112 *
113 * IEEE80211_RADIOTAP_DBM_ANTSIGNAL int8_t decibels from
114 * one milliwatt (dBm)
115 *
116 * RF signal power at the antenna, decibel difference from
117 * one milliwatt.
118 *
119 * IEEE80211_RADIOTAP_DBM_ANTNOISE int8_t decibels from
120 * one milliwatt (dBm)
121 *
122 * RF noise power at the antenna, decibel difference from one
123 * milliwatt.
124 *
125 * IEEE80211_RADIOTAP_DB_ANTSIGNAL u8 decibel (dB)
126 *
127 * RF signal power at the antenna, decibel difference from an
128 * arbitrary, fixed reference.
129 *
130 * IEEE80211_RADIOTAP_DB_ANTNOISE u8 decibel (dB)
131 *
132 * RF noise power at the antenna, decibel difference from an
133 * arbitrary, fixed reference point.
134 *
135 * IEEE80211_RADIOTAP_LOCK_QUALITY u16 unitless
136 *
137 * Quality of Barker code lock. Unitless. Monotonically
138 * nondecreasing with "better" lock strength. Called "Signal
139 * Quality" in datasheets. (Is there a standard way to measure
140 * this?)
141 *
142 * IEEE80211_RADIOTAP_TX_ATTENUATION u16 unitless
143 *
144 * Transmit power expressed as unitless distance from max
145 * power set at factory calibration. 0 is max power.
146 * Monotonically nondecreasing with lower power levels.
147 *
148 * IEEE80211_RADIOTAP_DB_TX_ATTENUATION u16 decibels (dB)
149 *
150 * Transmit power expressed as decibel distance from max power
151 * set at factory calibration. 0 is max power. Monotonically
152 * nondecreasing with lower power levels.
153 *
154 * IEEE80211_RADIOTAP_DBM_TX_POWER int8_t decibels from
155 * one milliwatt (dBm)
156 *
157 * Transmit power expressed as dBm (decibels from a 1 milliwatt
158 * reference). This is the absolute power level measured at
159 * the antenna port.
160 *
161 * IEEE80211_RADIOTAP_FLAGS u8 bitmap
162 *
163 * Properties of transmitted and received frames. See flags
164 * defined below.
165 *
166 * IEEE80211_RADIOTAP_ANTENNA u8 antenna index
167 *
168 * Unitless indication of the Rx/Tx antenna for this packet.
169 * The first antenna is antenna 0.
170 *
171 * IEEE80211_RADIOTAP_FCS u32 data
172 *
173 * FCS from frame in network byte order.
174 */
175enum ieee80211_radiotap_type {
176 IEEE80211_RADIOTAP_TSFT = 0,
177 IEEE80211_RADIOTAP_FLAGS = 1,
178 IEEE80211_RADIOTAP_RATE = 2,
179 IEEE80211_RADIOTAP_CHANNEL = 3,
180 IEEE80211_RADIOTAP_FHSS = 4,
181 IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5,
182 IEEE80211_RADIOTAP_DBM_ANTNOISE = 6,
183 IEEE80211_RADIOTAP_LOCK_QUALITY = 7,
184 IEEE80211_RADIOTAP_TX_ATTENUATION = 8,
185 IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9,
186 IEEE80211_RADIOTAP_DBM_TX_POWER = 10,
187 IEEE80211_RADIOTAP_ANTENNA = 11,
188 IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12,
189 IEEE80211_RADIOTAP_DB_ANTNOISE = 13,
190 IEEE80211_RADIOTAP_EXT = 31,
191};
192
193/* Channel flags. */
194#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */
195#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */
196#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */
197#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */
198#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */
199#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */
200#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */
201#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */
202
203/* For IEEE80211_RADIOTAP_FLAGS */
204#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received
205 * during CFP
206 */
207#define IEEE80211_RADIOTAP_F_SHORTPRE 0x02 /* sent/received
208 * with short
209 * preamble
210 */
211#define IEEE80211_RADIOTAP_F_WEP 0x04 /* sent/received
212 * with WEP encryption
213 */
214#define IEEE80211_RADIOTAP_F_FRAG 0x08 /* sent/received
215 * with fragmentation
216 */
217#define IEEE80211_RADIOTAP_F_FCS 0x10 /* frame includes FCS */
218#define IEEE80211_RADIOTAP_F_DATAPAD 0x20 /* frame has padding between
219 * 802.11 header and payload
220 * (to 32-bit boundary)
221 */
222
223/* Ugly macro to convert literal channel numbers into their mhz equivalents
224 * There are certianly some conditions that will break this (like feeding it '30')
225 * but they shouldn't arise since nothing talks on channel 30. */
226#define ieee80211chan2mhz(x) \
227 (((x) <= 14) ? \
228 (((x) == 14) ? 2484 : ((x) * 5) + 2407) : \
229 ((x) + 1000) * 5)
230
231#endif /* IEEE80211_RADIOTAP_H */
diff --git a/include/net/sock.h b/include/net/sock.h
index ecb75526cba0..e0498bd36004 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -207,7 +207,7 @@ struct sock {
207 struct sk_buff_head sk_write_queue; 207 struct sk_buff_head sk_write_queue;
208 int sk_wmem_queued; 208 int sk_wmem_queued;
209 int sk_forward_alloc; 209 int sk_forward_alloc;
210 unsigned int sk_allocation; 210 gfp_t sk_allocation;
211 int sk_sndbuf; 211 int sk_sndbuf;
212 int sk_route_caps; 212 int sk_route_caps;
213 unsigned long sk_flags; 213 unsigned long sk_flags;
diff --git a/include/net/syncppp.h b/include/net/syncppp.h
index 614cb6ba564e..877efa434700 100644
--- a/include/net/syncppp.h
+++ b/include/net/syncppp.h
@@ -86,7 +86,6 @@ static inline struct sppp *sppp_of(struct net_device *dev)
86 86
87void sppp_attach (struct ppp_device *pd); 87void sppp_attach (struct ppp_device *pd);
88void sppp_detach (struct net_device *dev); 88void sppp_detach (struct net_device *dev);
89void sppp_input (struct net_device *dev, struct sk_buff *m);
90int sppp_do_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd); 89int sppp_do_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd);
91struct sk_buff *sppp_dequeue (struct net_device *dev); 90struct sk_buff *sppp_dequeue (struct net_device *dev);
92int sppp_isempty (struct net_device *dev); 91int sppp_isempty (struct net_device *dev);