Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[safe/jmp/linux-2.6] / include / net / ieee80211.h
index 220a9e3..adb7cf3 100644 (file)
@@ -6,8 +6,8 @@
  * LAN access point) driver for Intersil Prism2/2.5/3.
  *
  * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen
- * <jkmaline@cc.hut.fi>
- * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
+ * <j@w1.fi>
+ * Copyright (c) 2002-2003, Jouni Malinen <j@w1.fi>
  *
  * Adaption to a generic IEEE 802.11 stack by James Ketrenos
  * <jketreno@linux.intel.com>
 #include <linux/if_ether.h>    /* ETH_ALEN */
 #include <linux/kernel.h>      /* ARRAY_SIZE */
 #include <linux/wireless.h>
+#include <linux/ieee80211.h>
 
-#define IEEE80211_VERSION "git-1.1.5"
+#include <net/lib80211.h>
+
+#define IEEE80211_VERSION "git-1.1.13"
 
 #define IEEE80211_DATA_LEN             2304
 /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
 #define IEEE80211_SCTL_FRAG            0x000F
 #define IEEE80211_SCTL_SEQ             0xFFF0
 
+/* QOS control */
+#define IEEE80211_QCTL_TID             0x000F
+
 /* debug macros */
 
 #ifdef CONFIG_IEEE80211_DEBUG
@@ -111,20 +117,19 @@ extern u32 ieee80211_debug_level;
 #define IEEE80211_DEBUG(level, fmt, args...) \
 do { if (ieee80211_debug_level & (level)) \
   printk(KERN_DEBUG "ieee80211: %c %s " fmt, \
-         in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
+         in_interrupt() ? 'I' : 'U', __func__ , ## args); } while (0)
+static inline bool ieee80211_ratelimit_debug(u32 level)
+{
+       return (ieee80211_debug_level & level) && net_ratelimit();
+}
 #else
 #define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
+static inline bool ieee80211_ratelimit_debug(u32 level)
+{
+       return false;
+}
 #endif                         /* CONFIG_IEEE80211_DEBUG */
 
-/* debug macros not dependent on CONFIG_IEEE80211_DEBUG */
-
-#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
-#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
-
-/* escape_essid() is intended to be used in debug (and possibly error)
- * messages. It should never be used for passing essid to user space. */
-const char *escape_essid(const char *essid, u8 essid_len);
-
 /*
  * To use the debug system:
  *
@@ -177,7 +182,6 @@ const char *escape_essid(const char *essid, u8 essid_len);
 #define IEEE80211_DEBUG_RX(f, a...)  IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a)
 #define IEEE80211_DEBUG_QOS(f, a...)  IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a)
 #include <linux/netdevice.h>
-#include <linux/wireless.h>
 #include <linux/if_arp.h>      /* ARPHRD_ETHER */
 
 #ifndef WIRELESS_SPY
@@ -185,10 +189,6 @@ const char *escape_essid(const char *essid, u8 essid_len);
 #endif
 #include <net/iw_handler.h>    /* new driver API */
 
-#ifndef ETH_P_PAE
-#define ETH_P_PAE 0x888E       /* Port Access Entity (IEEE 802.1X) */
-#endif                         /* ETH_P_PAE */
-
 #define ETH_P_PREAUTH 0x88C7   /* IEEE 802.11i pre-authentication */
 
 #ifndef ETH_P_80211_RAW
@@ -215,88 +215,23 @@ struct ieee80211_snap_hdr {
 #define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE)
 
 #define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG)
-#define WLAN_GET_SEQ_SEQ(seq)  ((seq) & IEEE80211_SCTL_SEQ)
-
-/* Authentication algorithms */
-#define WLAN_AUTH_OPEN 0
-#define WLAN_AUTH_SHARED_KEY 1
-
-#define WLAN_AUTH_CHALLENGE_LEN 128
-
-#define WLAN_CAPABILITY_ESS (1<<0)
-#define WLAN_CAPABILITY_IBSS (1<<1)
-#define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
-#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
-#define WLAN_CAPABILITY_PRIVACY (1<<4)
-#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
-#define WLAN_CAPABILITY_PBCC (1<<6)
-#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
-#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
-#define WLAN_CAPABILITY_QOS (1<<9)
-#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
-#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
-
-/* Status codes */
-enum ieee80211_statuscode {
-       WLAN_STATUS_SUCCESS = 0,
-       WLAN_STATUS_UNSPECIFIED_FAILURE = 1,
-       WLAN_STATUS_CAPS_UNSUPPORTED = 10,
-       WLAN_STATUS_REASSOC_NO_ASSOC = 11,
-       WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12,
-       WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13,
-       WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14,
-       WLAN_STATUS_CHALLENGE_FAIL = 15,
-       WLAN_STATUS_AUTH_TIMEOUT = 16,
-       WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17,
-       WLAN_STATUS_ASSOC_DENIED_RATES = 18,
-       /* 802.11b */
-       WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19,
-       WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20,
-       WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21,
-       /* 802.11h */
-       WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22,
-       WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23,
-       WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24,
-       /* 802.11g */
-       WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
-       WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
-       /* 802.11i */
-       WLAN_STATUS_INVALID_IE = 40,
-       WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
-       WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42,
-       WLAN_STATUS_INVALID_AKMP = 43,
-       WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
-       WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
-       WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
+#define WLAN_GET_SEQ_SEQ(seq)  (((seq) & IEEE80211_SCTL_SEQ) >> 4)
+
+/* Action categories - 802.11h */
+enum ieee80211_actioncategories {
+       WLAN_ACTION_SPECTRUM_MGMT = 0,
+       /* Reserved 1-127  */
+       /* Error    128-255 */
 };
 
-/* Reason codes */
-enum ieee80211_reasoncode {
-       WLAN_REASON_UNSPECIFIED = 1,
-       WLAN_REASON_PREV_AUTH_NOT_VALID = 2,
-       WLAN_REASON_DEAUTH_LEAVING = 3,
-       WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4,
-       WLAN_REASON_DISASSOC_AP_BUSY = 5,
-       WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6,
-       WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7,
-       WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8,
-       WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9,
-       /* 802.11h */
-       WLAN_REASON_DISASSOC_BAD_POWER = 10,
-       WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11,
-       /* 802.11i */
-       WLAN_REASON_INVALID_IE = 13,
-       WLAN_REASON_MIC_FAILURE = 14,
-       WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
-       WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16,
-       WLAN_REASON_IE_DIFFERENT = 17,
-       WLAN_REASON_INVALID_GROUP_CIPHER = 18,
-       WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19,
-       WLAN_REASON_INVALID_AKMP = 20,
-       WLAN_REASON_UNSUPP_RSN_VERSION = 21,
-       WLAN_REASON_INVALID_RSN_IE_CAP = 22,
-       WLAN_REASON_IEEE8021X_FAILED = 23,
-       WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
+/* Action details - 802.11h */
+enum ieee80211_actiondetails {
+       WLAN_ACTION_CATEGORY_MEASURE_REQUEST = 0,
+       WLAN_ACTION_CATEGORY_MEASURE_REPORT = 1,
+       WLAN_ACTION_CATEGORY_TPC_REQUEST = 2,
+       WLAN_ACTION_CATEGORY_TPC_REPORT = 3,
+       WLAN_ACTION_CATEGORY_CHANNEL_SWITCH = 4,
+       /* 5 - 255 Reserved */
 };
 
 #define IEEE80211_STATMASK_SIGNAL (1<<0)
@@ -363,8 +298,9 @@ enum ieee80211_reasoncode {
 #define IEEE80211_OFDM_SHIFT_MASK_A         4
 
 /* NOTE: This data is for statistical purposes; not all hardware provides this
- *       information for frames received.  Not setting these will not cause
- *       any adverse affects. */
+ *       information for frames received.
+ *       For ieee80211_rx_mgt, you need to set at least the 'len' parameter.
+ */
 struct ieee80211_rx_stats {
        u32 mac_time;
        s8 rssi;
@@ -376,6 +312,8 @@ struct ieee80211_rx_stats {
        u8 mask;
        u8 freq;
        u16 len;
+       u64 tsf;
+       u32 beacon_time;
 };
 
 /* IEEE 802.11 requires that STA supports concurrent reception of at least
@@ -419,8 +357,6 @@ struct ieee80211_stats {
 
 struct ieee80211_device;
 
-#include "ieee80211_crypt.h"
-
 #define SEC_KEY_1              (1<<0)
 #define SEC_KEY_2              (1<<1)
 #define SEC_KEY_3              (1<<2)
@@ -449,9 +385,8 @@ struct ieee80211_device;
 #define SCM_TEMPORAL_KEY_LENGTH        16
 
 struct ieee80211_security {
-       u16 active_key:2,
-           enabled:1,
-           auth_mode:2, auth_algo:4, unicast_uses_group:1, encrypt:1;
+       u16 active_key:2, enabled:1, unicast_uses_group:1, encrypt:1;
+       u8 auth_mode;
        u8 encode_alg[WEP_KEYS];
        u8 key_sizes[WEP_KEYS];
        u8 keys[WEP_KEYS][SCM_KEY_LEN];
@@ -507,15 +442,6 @@ enum ieee80211_mfie {
        MFIE_TYPE_QOS_PARAMETER = 222,
 };
 
-/* Minimal header; can be used for passing 802.11 frames with sufficient
- * information to determine what type of underlying data type is actually
- * stored in the data. */
-struct ieee80211_hdr {
-       __le16 frame_ctl;
-       __le16 duration_id;
-       u8 payload[0];
-} __attribute__ ((packed));
-
 struct ieee80211_hdr_1addr {
        __le16 frame_ctl;
        __le16 duration_id;
@@ -563,18 +489,6 @@ struct ieee80211_hdr_3addrqos {
        __le16 qos_ctl;
 } __attribute__ ((packed));
 
-struct ieee80211_hdr_4addrqos {
-       __le16 frame_ctl;
-       __le16 duration_id;
-       u8 addr1[ETH_ALEN];
-       u8 addr2[ETH_ALEN];
-       u8 addr3[ETH_ALEN];
-       __le16 seq_ctl;
-       u8 addr4[ETH_ALEN];
-       u8 payload[0];
-       __le16 qos_ctl;
-} __attribute__ ((packed));
-
 struct ieee80211_info_element {
        u8 id;
        u8 len;
@@ -603,25 +517,53 @@ struct ieee80211_auth {
        __le16 algorithm;
        __le16 transaction;
        __le16 status;
+       /* challenge */
        struct ieee80211_info_element info_element[0];
 } __attribute__ ((packed));
 
+struct ieee80211_channel_switch {
+       u8 id;
+       u8 len;
+       u8 mode;
+       u8 channel;
+       u8 count;
+} __attribute__ ((packed));
+
+struct ieee80211_action {
+       struct ieee80211_hdr_3addr header;
+       u8 category;
+       u8 action;
+       union {
+               struct ieee80211_action_exchange {
+                       u8 token;
+                       struct ieee80211_info_element info_element[0];
+               } exchange;
+               struct ieee80211_channel_switch channel_switch;
+
+       } format;
+} __attribute__ ((packed));
+
 struct ieee80211_disassoc {
        struct ieee80211_hdr_3addr header;
-       __le16 reason_code;
-       struct ieee80211_info_element info_element[0];
+       __le16 reason;
 } __attribute__ ((packed));
 
+/* Alias deauth for disassoc */
+#define ieee80211_deauth ieee80211_disassoc
+
 struct ieee80211_probe_request {
        struct ieee80211_hdr_3addr header;
+       /* SSID, supported rates */
        struct ieee80211_info_element info_element[0];
 } __attribute__ ((packed));
 
 struct ieee80211_probe_response {
        struct ieee80211_hdr_3addr header;
-       u32 time_stamp[2];
+       __le32 time_stamp[2];
        __le16 beacon_interval;
        __le16 capability;
+       /* SSID, supported rates, FH params, DS params,
+        * CF params, IBSS params, TIM (if beacon), RSN */
        struct ieee80211_info_element info_element[0];
 } __attribute__ ((packed));
 
@@ -632,6 +574,7 @@ struct ieee80211_assoc_request {
        struct ieee80211_hdr_3addr header;
        __le16 capability;
        __le16 listen_interval;
+       /* SSID, supported rates, RSN */
        struct ieee80211_info_element info_element[0];
 } __attribute__ ((packed));
 
@@ -648,7 +591,8 @@ struct ieee80211_assoc_response {
        __le16 capability;
        __le16 status;
        __le16 aid;
-       struct ieee80211_info_element info_element[0];  /* supported rates */
+       /* supported rates */
+       struct ieee80211_info_element info_element[0];
 } __attribute__ ((packed));
 
 struct ieee80211_txb {
@@ -656,8 +600,8 @@ struct ieee80211_txb {
        u8 encrypted;
        u8 rts_included;
        u8 reserved;
-       __le16 frag_size;
-       __le16 payload_size;
+       u16 frag_size;
+       u16 payload_size;
        struct sk_buff *fragments[0];
 };
 
@@ -676,14 +620,23 @@ struct ieee80211_txb {
 
 #define MAX_WPA_IE_LEN 64
 
-#define NETWORK_EMPTY_ESSID    (1<<0)
 #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)
-#define NETWORK_HAS_QOS_MASK            (NETWORK_HAS_QOS_PARAMETERS | NETWORK_HAS_QOS_INFORMATION)
+#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)
+
+#define NETWORK_HAS_ERP_VALUE           (1<<10)
 
 #define QOS_QUEUE_NUM                   4
 #define QOS_OUI_LEN                     3
@@ -739,6 +692,91 @@ struct ieee80211_tim_parameters {
 
 /*******************************************************/
 
+enum {                         /* ieee80211_basic_report.map */
+       IEEE80211_BASIC_MAP_BSS = (1 << 0),
+       IEEE80211_BASIC_MAP_OFDM = (1 << 1),
+       IEEE80211_BASIC_MAP_UNIDENTIFIED = (1 << 2),
+       IEEE80211_BASIC_MAP_RADAR = (1 << 3),
+       IEEE80211_BASIC_MAP_UNMEASURED = (1 << 4),
+       /* Bits 5-7 are reserved */
+
+};
+struct ieee80211_basic_report {
+       u8 channel;
+       __le64 start_time;
+       __le16 duration;
+       u8 map;
+} __attribute__ ((packed));
+
+enum {                         /* ieee80211_measurement_request.mode */
+       /* Bit 0 is reserved */
+       IEEE80211_MEASUREMENT_ENABLE = (1 << 1),
+       IEEE80211_MEASUREMENT_REQUEST = (1 << 2),
+       IEEE80211_MEASUREMENT_REPORT = (1 << 3),
+       /* Bits 4-7 are reserved */
+};
+
+enum {
+       IEEE80211_REPORT_BASIC = 0,     /* required */
+       IEEE80211_REPORT_CCA = 1,       /* optional */
+       IEEE80211_REPORT_RPI = 2,       /* optional */
+       /* 3-255 reserved */
+};
+
+struct ieee80211_measurement_params {
+       u8 channel;
+       __le64 start_time;
+       __le16 duration;
+} __attribute__ ((packed));
+
+struct ieee80211_measurement_request {
+       struct ieee80211_info_element ie;
+       u8 token;
+       u8 mode;
+       u8 type;
+       struct ieee80211_measurement_params params[0];
+} __attribute__ ((packed));
+
+struct ieee80211_measurement_report {
+       struct ieee80211_info_element ie;
+       u8 token;
+       u8 mode;
+       u8 type;
+       union {
+               struct ieee80211_basic_report basic[0];
+       } u;
+} __attribute__ ((packed));
+
+struct ieee80211_tpc_report {
+       u8 transmit_power;
+       u8 link_margin;
+} __attribute__ ((packed));
+
+struct ieee80211_channel_map {
+       u8 channel;
+       u8 map;
+} __attribute__ ((packed));
+
+struct ieee80211_ibss_dfs {
+       struct ieee80211_info_element ie;
+       u8 owner[ETH_ALEN];
+       u8 recovery_interval;
+       struct ieee80211_channel_map channel_map[0];
+};
+
+struct ieee80211_csa {
+       u8 mode;
+       u8 channel;
+       u8 count;
+} __attribute__ ((packed));
+
+struct ieee80211_quiet {
+       u8 count;
+       u8 period;
+       u8 duration;
+       u8 offset;
+} __attribute__ ((packed));
+
 struct ieee80211_network {
        /* These entries are used to identify a unique network */
        u8 bssid[ETH_ALEN];
@@ -758,7 +796,7 @@ struct ieee80211_network {
        u8 rates_ex_len;
        unsigned long last_scanned;
        u8 mode;
-       u8 flags;
+       u32 flags;
        u32 last_associate;
        u32 time_stamp[2];
        u16 beacon_interval;
@@ -770,6 +808,25 @@ struct ieee80211_network {
        u8 rsn_ie[MAX_WPA_IE_LEN];
        size_t rsn_ie_len;
        struct ieee80211_tim_parameters tim;
+
+       /* 802.11h info */
+
+       /* Power Constraint - mandatory if spctrm mgmt required */
+       u8 power_constraint;
+
+       /* TPC Report - mandatory if spctrm mgmt required */
+       struct ieee80211_tpc_report tpc_report;
+
+       /* IBSS DFS - mandatory if spctrm mgmt required and IBSS
+        * NOTE: This is variable length and so must be allocated dynamically */
+       struct ieee80211_ibss_dfs *ibss_dfs;
+
+       /* Channel Switch Announcement - optional if spctrm mgmt required */
+       struct ieee80211_csa csa;
+
+       /* Quiet - optional if spctrm mgmt required */
+       struct ieee80211_quiet quiet;
+
        struct list_head list;
 };
 
@@ -792,14 +849,17 @@ enum ieee80211_state {
 
 #define IEEE80211_24GHZ_MIN_CHANNEL 1
 #define IEEE80211_24GHZ_MAX_CHANNEL 14
-#define IEEE80211_24GHZ_CHANNELS    14
+#define IEEE80211_24GHZ_CHANNELS (IEEE80211_24GHZ_MAX_CHANNEL - \
+                                 IEEE80211_24GHZ_MIN_CHANNEL + 1)
 
-#define IEEE80211_52GHZ_MIN_CHANNEL 36
+#define IEEE80211_52GHZ_MIN_CHANNEL 34
 #define IEEE80211_52GHZ_MAX_CHANNEL 165
-#define IEEE80211_52GHZ_CHANNELS    32
+#define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \
+                                 IEEE80211_52GHZ_MIN_CHANNEL + 1)
 
 enum {
        IEEE80211_CH_PASSIVE_ONLY = (1 << 0),
+       IEEE80211_CH_80211H_RULES = (1 << 1),
        IEEE80211_CH_B_ONLY = (1 << 2),
        IEEE80211_CH_NO_IBSS = (1 << 3),
        IEEE80211_CH_UNIFORM_SPREADING = (1 << 4),
@@ -808,10 +868,10 @@ enum {
 };
 
 struct ieee80211_channel {
-       u32 freq;
+       u32 freq;       /* in MHz */
        u8 channel;
        u8 flags;
-       u8 max_power;
+       u8 max_power;   /* in dBm */
 };
 
 struct ieee80211_geo {
@@ -861,6 +921,10 @@ struct ieee80211_device {
        /* host performs multicast decryption */
        int host_mc_decrypt;
 
+       /* host should strip IV and ICV from protected frames */
+       /* meaningful only when hardware decryption is being used */
+       int host_strip_iv_icv;
+
        int host_open_frag;
        int host_build_iv;
        int ieee802_1x;         /* is IEEE 802.1X used */
@@ -868,16 +932,11 @@ struct ieee80211_device {
        /* WPA data */
        int wpa_enabled;
        int drop_unencrypted;
-       int tkip_countermeasures;
        int privacy_invoked;
        size_t wpa_ie_len;
        u8 *wpa_ie;
 
-       struct list_head crypt_deinit_list;
-       struct ieee80211_crypt_data *crypt[WEP_KEYS];
-       int tx_keyidx;          /* default TX key index (crypt[tx_keyidx]) */
-       struct timer_list crypt_deinit_timer;
-       int crypt_quiesced;
+       struct lib80211_crypt_info crypt_info;
 
        int bcrx_sta_key;       /* use individual keys to override default keys even
                                 * with RX of broad/multicast frames */
@@ -901,6 +960,8 @@ struct ieee80211_device {
        int perfect_rssi;
        int worst_rssi;
 
+       u16 prev_seq_ctl;       /* used to drop duplicate frames */
+
        /* Callback functions */
        void (*set_security) (struct net_device * dev,
                              struct ieee80211_security * sec);
@@ -911,12 +972,16 @@ struct ieee80211_device {
 
        int (*handle_management) (struct net_device * dev,
                                  struct ieee80211_network * network, u16 type);
+       int (*is_qos_active) (struct net_device *dev, struct sk_buff *skb);
 
        /* Typical STA methods */
        int (*handle_auth) (struct net_device * dev,
                            struct ieee80211_auth * auth);
        int (*handle_deauth) (struct net_device * dev,
-                             struct ieee80211_auth * auth);
+                             struct ieee80211_deauth * auth);
+       int (*handle_action) (struct net_device * dev,
+                             struct ieee80211_action * action,
+                             struct ieee80211_rx_stats * stats);
        int (*handle_disassoc) (struct net_device * dev,
                                struct ieee80211_disassoc * assoc);
        int (*handle_beacon) (struct net_device * dev,
@@ -952,22 +1017,6 @@ static inline void *ieee80211_priv(struct net_device *dev)
        return ((struct ieee80211_device *)netdev_priv(dev))->priv;
 }
 
-static inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
-{
-       /* Single white space is for Linksys APs */
-       if (essid_len == 1 && essid[0] == ' ')
-               return 1;
-
-       /* Otherwise, if the entire essid is 0, we assume it is hidden */
-       while (essid_len) {
-               essid_len--;
-               if (essid[essid_len] != '\0')
-                       return 0;
-       }
-
-       return 1;
-}
-
 static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee,
                                          int mode)
 {
@@ -1025,7 +1074,7 @@ static inline int ieee80211_get_hdrlen(u16 fc)
 
 static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr)
 {
-       switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) {
+       switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control))) {
        case IEEE80211_1ADDR_LEN:
                return ((struct ieee80211_hdr_1addr *)hdr)->payload;
        case IEEE80211_2ADDR_LEN:
@@ -1035,7 +1084,35 @@ static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr)
        case IEEE80211_4ADDR_LEN:
                return ((struct ieee80211_hdr_4addr *)hdr)->payload;
        }
+       return NULL;
+}
 
+static inline int ieee80211_is_ofdm_rate(u8 rate)
+{
+       switch (rate & ~IEEE80211_BASIC_RATE_MASK) {
+       case IEEE80211_OFDM_RATE_6MB:
+       case IEEE80211_OFDM_RATE_9MB:
+       case IEEE80211_OFDM_RATE_12MB:
+       case IEEE80211_OFDM_RATE_18MB:
+       case IEEE80211_OFDM_RATE_24MB:
+       case IEEE80211_OFDM_RATE_36MB:
+       case IEEE80211_OFDM_RATE_48MB:
+       case IEEE80211_OFDM_RATE_54MB:
+               return 1;
+       }
+       return 0;
+}
+
+static inline int ieee80211_is_cck_rate(u8 rate)
+{
+       switch (rate & ~IEEE80211_BASIC_RATE_MASK) {
+       case IEEE80211_CCK_RATE_1MB:
+       case IEEE80211_CCK_RATE_2MB:
+       case IEEE80211_CCK_RATE_5MB:
+       case IEEE80211_CCK_RATE_11MB:
+               return 1;
+       }
+       return 0;
 }
 
 /* ieee80211.c */
@@ -1047,15 +1124,17 @@ extern int ieee80211_set_encryption(struct ieee80211_device *ieee);
 /* ieee80211_tx.c */
 extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev);
 extern void ieee80211_txb_free(struct ieee80211_txb *);
-extern int ieee80211_tx_frame(struct ieee80211_device *ieee,
-                             struct ieee80211_hdr *frame, int len);
 
 /* ieee80211_rx.c */
+extern void ieee80211_rx_any(struct ieee80211_device *ieee,
+                    struct sk_buff *skb, struct ieee80211_rx_stats *stats);
 extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                        struct ieee80211_rx_stats *rx_stats);
+/* make sure to set stats->len */
 extern void ieee80211_rx_mgt(struct ieee80211_device *ieee,
                             struct ieee80211_hdr_4addr *header,
                             struct ieee80211_rx_stats *stats);
+extern void ieee80211_network_reset(struct ieee80211_network *network);
 
 /* ieee80211_geo.c */
 extern const struct ieee80211_geo *ieee80211_get_geo(struct ieee80211_device
@@ -1068,6 +1147,13 @@ extern int ieee80211_is_valid_channel(struct ieee80211_device *ieee,
 extern int ieee80211_channel_to_index(struct ieee80211_device *ieee,
                                      u8 channel);
 extern u8 ieee80211_freq_to_channel(struct ieee80211_device *ieee, u32 freq);
+extern u8 ieee80211_get_channel_flags(struct ieee80211_device *ieee,
+                                     u8 channel);
+extern const struct ieee80211_channel *ieee80211_get_channel(struct
+                                                            ieee80211_device
+                                                            *ieee, u8 channel);
+extern u32 ieee80211_channel_to_freq(struct ieee80211_device * ieee,
+                                     u8 channel);
 
 /* ieee80211_wx.c */
 extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee,