Merge /spare/repo/linux-2.6/
[safe/jmp/linux-2.6] / include / net / ieee80211.h
index 372a173..4851756 100644 (file)
  *
  * Adaption to a generic IEEE 802.11 stack by James Ketrenos
  * <jketreno@linux.intel.com>
- * Copyright (c) 2004, Intel Corporation
+ * Copyright (c) 2004-2005, Intel Corporation
  *
  * 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.
+ *
+ * API Version History
+ * 1.0.x -- Initial version
+ * 1.1.x -- Added radiotap, QoS, TIM, ieee80211_geo APIs,
+ *          various structure changes, and crypto API init method
  */
 #ifndef IEEE80211_H
 #define IEEE80211_H
@@ -24,6 +29,8 @@
 #include <linux/kernel.h>      /* ARRAY_SIZE */
 #include <linux/wireless.h>
 
+#define IEEE80211_VERSION "git-1.1.5"
+
 #define IEEE80211_DATA_LEN             2304
 /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
    6.2.1.1.2.
@@ -225,8 +232,9 @@ struct ieee80211_snap_hdr {
 #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_OSSS_OFDM (1<<13)
+#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
 
 /* Status codes */
 enum ieee80211_statuscode {
@@ -595,17 +603,21 @@ struct ieee80211_auth {
        __le16 algorithm;
        __le16 transaction;
        __le16 status;
+       /* challenge */
        struct ieee80211_info_element info_element[0];
 } __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 ieee82011_deauth ieee80211_disassoc
+
 struct ieee80211_probe_request {
        struct ieee80211_hdr_3addr header;
+       /* SSID, supported rates */
        struct ieee80211_info_element info_element[0];
 } __attribute__ ((packed));
 
@@ -614,6 +626,8 @@ struct ieee80211_probe_response {
        u32 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));
 
@@ -624,6 +638,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));
 
@@ -640,7 +655,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 {
@@ -756,6 +772,7 @@ struct ieee80211_network {
        u16 beacon_interval;
        u16 listen_interval;
        u16 atim_window;
+       u8 erp_value;
        u8 wpa_ie[MAX_WPA_IE_LEN];
        size_t wpa_ie_len;
        u8 rsn_ie[MAX_WPA_IE_LEN];
@@ -799,7 +816,7 @@ enum {
 };
 
 struct ieee80211_channel {
-       u16 freq;
+       u32 freq;
        u8 channel;
        u8 flags;
        u8 max_power;
@@ -849,13 +866,16 @@ struct ieee80211_device {
        int host_encrypt;
        int host_encrypt_msdu;
        int host_decrypt;
+       /* host performs multicast decryption */
+       int host_mc_decrypt;
+
        int host_open_frag;
+       int host_build_iv;
        int ieee802_1x;         /* is IEEE 802.1X used */
 
        /* WPA data */
        int wpa_enabled;
        int drop_unencrypted;
-       int tkip_countermeasures;
        int privacy_invoked;
        size_t wpa_ie_len;
        u8 *wpa_ie;
@@ -902,6 +922,8 @@ struct ieee80211_device {
        /* 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);
        int (*handle_disassoc) (struct net_device * dev,
                                struct ieee80211_disassoc * assoc);
        int (*handle_beacon) (struct net_device * dev,
@@ -910,6 +932,9 @@ struct ieee80211_device {
        int (*handle_probe_response) (struct net_device * dev,
                                      struct ieee80211_probe_response * resp,
                                      struct ieee80211_network * network);
+       int (*handle_probe_request) (struct net_device * dev,
+                                    struct ieee80211_probe_request * req,
+                                    struct ieee80211_rx_stats * stats);
        int (*handle_assoc_response) (struct net_device * dev,
                                      struct ieee80211_assoc_response * resp,
                                      struct ieee80211_network * network);
@@ -929,12 +954,12 @@ struct ieee80211_device {
 #define IEEE_G            (1<<2)
 #define IEEE_MODE_MASK    (IEEE_A|IEEE_B|IEEE_G)
 
-extern inline void *ieee80211_priv(struct net_device *dev)
+static inline void *ieee80211_priv(struct net_device *dev)
 {
        return ((struct ieee80211_device *)netdev_priv(dev))->priv;
 }
 
-extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
+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] == ' ')
@@ -950,7 +975,7 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
        return 1;
 }
 
-extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee,
+static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee,
                                          int mode)
 {
        /*
@@ -977,7 +1002,7 @@ extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee,
        return 0;
 }
 
-extern inline int ieee80211_get_hdrlen(u16 fc)
+static inline int ieee80211_get_hdrlen(u16 fc)
 {
        int hdrlen = IEEE80211_3ADDR_LEN;
        u16 stype = WLAN_FC_GET_STYPE(fc);
@@ -1005,7 +1030,7 @@ extern inline int ieee80211_get_hdrlen(u16 fc)
        return hdrlen;
 }
 
-extern inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr)
+static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr)
 {
        switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) {
        case IEEE80211_1ADDR_LEN:
@@ -1061,21 +1086,19 @@ extern int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
 extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
                                   struct iw_request_info *info,
                                   union iwreq_data *wrqu, char *key);
-#if WIRELESS_EXT > 17
 extern int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
                                      struct iw_request_info *info,
                                      union iwreq_data *wrqu, char *extra);
 extern int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee,
                                      struct iw_request_info *info,
                                      union iwreq_data *wrqu, char *extra);
-#endif
 
-extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
+static inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
 {
        ieee->scans++;
 }
 
-extern inline int ieee80211_get_scans(struct ieee80211_device *ieee)
+static inline int ieee80211_get_scans(struct ieee80211_device *ieee)
 {
        return ieee->scans;
 }