]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/net/mac80211.h
[MAC80211]: remove tx info sw_retry_attempt member
[linux-2.6-omap-h63xx.git] / include / net / mac80211.h
index a7f122b79948aca50b8f70b659bf4368bd4948a7..5ff45553a98540279deda3db188b0b86aca4c4b2 100644 (file)
@@ -1,7 +1,9 @@
 /*
- * Low-level hardware driver -- IEEE 802.11 driver (80211.o) interface
+ * mac80211 <-> driver interface
+ *
  * Copyright 2002-2005, Devicescape Software, Inc.
  * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
+ * Copyright 2007      Johannes Berg <johannes@sipsolutions.net>
  *
  * 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
@@ -71,14 +73,13 @@ struct ieee80211_channel {
 #define IEEE80211_RATE_SUPPORTED 0x00000010
 #define IEEE80211_RATE_OFDM 0x00000020
 #define IEEE80211_RATE_CCK 0x00000040
-#define IEEE80211_RATE_TURBO 0x00000080
 #define IEEE80211_RATE_MANDATORY 0x00000100
 
 #define IEEE80211_RATE_CCK_2 (IEEE80211_RATE_CCK | IEEE80211_RATE_PREAMBLE2)
 #define IEEE80211_RATE_MODULATION(f) \
        (f & (IEEE80211_RATE_CCK | IEEE80211_RATE_OFDM))
 
-/* Low-level driver should set PREAMBLE2, OFDM, CCK, and TURBO flags.
+/* Low-level driver should set PREAMBLE2, OFDM and CCK flags.
  * BASIC, SUPPORTED, ERP, and MANDATORY flags are set in 80211.o based on the
  * configuration. */
 struct ieee80211_rate {
@@ -97,44 +98,96 @@ struct ieee80211_rate {
                       * optimizing channel utilization estimates */
 };
 
-/* 802.11g is backwards-compatible with 802.11b, so a wlan card can
- * actually be both in 11b and 11g modes at the same time. */
-enum {
-       MODE_IEEE80211A, /* IEEE 802.11a */
-       MODE_IEEE80211B, /* IEEE 802.11b only */
-       MODE_ATHEROS_TURBO, /* Atheros Turbo mode (2x.11a at 5 GHz) */
-       MODE_IEEE80211G, /* IEEE 802.11g (and 802.11b compatibility) */
-       MODE_ATHEROS_TURBOG, /* Atheros Turbo mode (2x.11g at 2.4 GHz) */
+/**
+ * enum ieee80211_phymode - PHY modes
+ *
+ * @MODE_IEEE80211A: 5GHz as defined by 802.11a/802.11h
+ * @MODE_IEEE80211B: 2.4 GHz as defined by 802.11b
+ * @MODE_IEEE80211G: 2.4 GHz as defined by 802.11g (with OFDM),
+ *     backwards compatible with 11b mode
+ * @NUM_IEEE80211_MODES: internal
+ */
+enum ieee80211_phymode {
+       MODE_IEEE80211A,
+       MODE_IEEE80211B,
+       MODE_IEEE80211G,
 
        /* keep last */
        NUM_IEEE80211_MODES
 };
 
+/**
+ * struct ieee80211_hw_mode - PHY mode definition
+ *
+ * This structure describes the capabilities supported by the device
+ * in a single PHY mode.
+ *
+ * @mode: the PHY mode for this definition
+ * @num_channels: number of supported channels
+ * @channels: pointer to array of supported channels
+ * @num_rates: number of supported bitrates
+ * @rates: pointer to array of supported bitrates
+ * @list: internal
+ */
 struct ieee80211_hw_mode {
-       int mode; /* MODE_IEEE80211... */
-       int num_channels; /* Number of channels (below) */
-       struct ieee80211_channel *channels; /* Array of supported channels */
-       int num_rates; /* Number of rates (below) */
-       struct ieee80211_rate *rates; /* Array of supported rates */
-
-       struct list_head list; /* Internal, don't touch */
+       struct list_head list;
+       struct ieee80211_channel *channels;
+       struct ieee80211_rate *rates;
+       enum ieee80211_phymode mode;
+       int num_channels;
+       int num_rates;
 };
 
+/**
+ * struct ieee80211_tx_queue_params - transmit queue configuration
+ *
+ * The information provided in this structure is required for QoS
+ * transmit queue configuration.
+ *
+ * @aifs: arbitration interface space [0..255, -1: use default]
+ * @cw_min: minimum contention window [will be a value of the form
+ *     2^n-1 in the range 1..1023; 0: use default]
+ * @cw_max: maximum contention window [like @cw_min]
+ * @burst_time: maximum burst time in units of 0.1ms, 0 meaning disabled
+ */
 struct ieee80211_tx_queue_params {
-       int aifs; /* 0 .. 255; -1 = use default */
-       int cw_min; /* 2^n-1: 1, 3, 7, .. , 1023; 0 = use default */
-       int cw_max; /* 2^n-1: 1, 3, 7, .. , 1023; 0 = use default */
-       int burst_time; /* maximum burst time in 0.1 ms (i.e., 10 = 1 ms);
-                        * 0 = disabled */
+       int aifs;
+       int cw_min;
+       int cw_max;
+       int burst_time;
 };
 
+/**
+ * struct ieee80211_tx_queue_stats_data - transmit queue statistics
+ *
+ * @len: number of packets in queue
+ * @limit: queue length limit
+ * @count: number of frames sent
+ */
 struct ieee80211_tx_queue_stats_data {
-       unsigned int len; /* num packets in queue */
-       unsigned int limit; /* queue len (soft) limit */
-       unsigned int count; /* total num frames sent */
+       unsigned int len;
+       unsigned int limit;
+       unsigned int count;
 };
 
-enum {
+/**
+ * enum ieee80211_tx_queue - transmit queue number
+ *
+ * These constants are used with some callbacks that take a
+ * queue number to set parameters for a queue.
+ *
+ * @IEEE80211_TX_QUEUE_DATA0: data queue 0
+ * @IEEE80211_TX_QUEUE_DATA1: data queue 1
+ * @IEEE80211_TX_QUEUE_DATA2: data queue 2
+ * @IEEE80211_TX_QUEUE_DATA3: data queue 3
+ * @IEEE80211_TX_QUEUE_DATA4: data queue 4
+ * @IEEE80211_TX_QUEUE_SVP: ??
+ * @NUM_TX_DATA_QUEUES: number of data queues
+ * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be
+ *     sent after a beacon
+ * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames
+ */
+enum ieee80211_tx_queue {
        IEEE80211_TX_QUEUE_DATA0,
        IEEE80211_TX_QUEUE_DATA1,
        IEEE80211_TX_QUEUE_DATA2,
@@ -165,7 +218,6 @@ struct ieee80211_low_level_stats {
 /* Transmit control fields. This data structure is passed to low-level driver
  * with each TX frame. The low-level driver is responsible for configuring
  * the hardware to use given values (depending on what is supported). */
-#define HW_KEY_IDX_INVALID -1
 
 struct ieee80211_tx_control {
        int tx_rate; /* Transmit rate, given as the hw specific value for the
@@ -191,22 +243,23 @@ struct ieee80211_tx_control {
 #define IEEE80211_TXCTL_REQUEUE                (1<<7)
 #define IEEE80211_TXCTL_FIRST_FRAGMENT (1<<8) /* this is a first fragment of
                                                * the frame */
-#define IEEE80211_TXCTL_TKIP_NEW_PHASE1_KEY (1<<9)
+#define IEEE80211_TXCTL_LONG_RETRY_LIMIT (1<<10) /* this frame should be send
+                                                 * using the through
+                                                 * set_retry_limit configured
+                                                 * long retry value */
        u32 flags;                             /* tx control flags defined
                                                * above */
-       u8 retry_limit;         /* 1 = only first attempt, 2 = one retry, .. */
+       u8 key_idx;             /* keyidx from hw->set_key(), undefined if
+                                * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */
+       u8 retry_limit;         /* 1 = only first attempt, 2 = one retry, ..
+                                * This could be used when set_retry_limit
+                                * is not implemented by the driver */
        u8 power_level;         /* per-packet transmit power level, in dBm */
        u8 antenna_sel_tx;      /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */
-       s8 key_idx;             /* -1 = do not encrypt, >= 0 keyidx from
-                                * hw->set_key() */
        u8 icv_len;             /* length of the ICV/MIC field in octets */
        u8 iv_len;              /* length of the IV field in octets */
-       u8 tkip_key[16];        /* generated phase2/phase1 key for hw TKIP */
        u8 queue;               /* hardware queue to use for this frame;
                                 * 0 = highest, hw->queues-1 = lowest */
-       u8 sw_retry_attempt;    /* number of times hw has tried to
-                                * transmit frame (not incl. hw retries) */
-
        struct ieee80211_rate *rate;            /* internal 80211.o rate */
        struct ieee80211_rate *rts_rate;        /* internal 80211.o rate
                                                 * for RTS/CTS */
@@ -219,44 +272,124 @@ struct ieee80211_tx_control {
        int ifindex;    /* internal */
 };
 
-/* Receive status. The low-level driver should provide this information
- * (the subset supported by hardware) to the 802.11 code with each received
- * frame. */
+
+/**
+ * enum mac80211_rx_flags - receive flags
+ *
+ * These flags are used with the @flag member of &struct ieee80211_rx_status.
+ * @RX_FLAG_MMIC_ERROR: Michael MIC error was reported on this frame.
+ *     Use together with %RX_FLAG_MMIC_STRIPPED.
+ * @RX_FLAG_DECRYPTED: This frame was decrypted in hardware.
+ * @RX_FLAG_RADIOTAP: This frame starts with a radiotap header.
+ * @RX_FLAG_MMIC_STRIPPED: the Michael MIC is stripped off this frame,
+ *     verification has been done by the hardware.
+ * @RX_FLAG_IV_STRIPPED: The IV/ICV are stripped from this frame.
+ *     If this flag is set, the stack cannot do any replay detection
+ *     hence the driver or hardware will have to do that.
+ * @RX_FLAG_FAILED_FCS_CRC: Set this flag if the FCS check failed on
+ *     the frame.
+ * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on
+ *     the frame.
+ */
+enum mac80211_rx_flags {
+       RX_FLAG_MMIC_ERROR      = 1<<0,
+       RX_FLAG_DECRYPTED       = 1<<1,
+       RX_FLAG_RADIOTAP        = 1<<2,
+       RX_FLAG_MMIC_STRIPPED   = 1<<3,
+       RX_FLAG_IV_STRIPPED     = 1<<4,
+       RX_FLAG_FAILED_FCS_CRC  = 1<<5,
+       RX_FLAG_FAILED_PLCP_CRC = 1<<6,
+};
+
+/**
+ * struct ieee80211_rx_status - receive status
+ *
+ * The low-level driver should provide this information (the subset
+ * supported by hardware) to the 802.11 code with each received
+ * frame.
+ * @mactime: MAC timestamp as defined by 802.11
+ * @freq: frequency the radio was tuned to when receiving this frame, in MHz
+ * @channel: channel the radio was tuned to
+ * @phymode: active PHY mode
+ * @ssi: signal strength when receiving this frame
+ * @signal: used as 'qual' in statistics reporting
+ * @noise: PHY noise when receiving this frame
+ * @antenna: antenna used
+ * @rate: data rate
+ * @flag: %RX_FLAG_*
+ */
 struct ieee80211_rx_status {
        u64 mactime;
-       int freq; /* receive frequency in Mhz */
+       int freq;
        int channel;
-       int phymode;
+       enum ieee80211_phymode phymode;
        int ssi;
-       int signal; /* used as qual in statistics reporting */
+       int signal;
        int noise;
        int antenna;
        int rate;
-#define RX_FLAG_MMIC_ERROR     (1<<0)
-#define RX_FLAG_DECRYPTED      (1<<1)
-#define RX_FLAG_RADIOTAP       (1<<2)
        int flag;
 };
 
-/* Transmit status. The low-level driver should provide this information
- * (the subset supported by hardware) to the 802.11 code for each transmit
- * frame. */
+/**
+ * enum ieee80211_tx_status_flags - transmit status flags
+ *
+ * Status flags to indicate various transmit conditions.
+ *
+ * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted
+ *     because the destination STA was in powersave mode.
+ *
+ * @IEEE80211_TX_STATUS_ACK: Frame was acknowledged
+ */
+enum ieee80211_tx_status_flags {
+       IEEE80211_TX_STATUS_TX_FILTERED = 1<<0,
+       IEEE80211_TX_STATUS_ACK         = 1<<1,
+};
+
+/**
+ * struct ieee80211_tx_status - transmit status
+ *
+ * As much information as possible should be provided for each transmitted
+ * frame with ieee80211_tx_status().
+ *
+ * @control: a copy of the &struct ieee80211_tx_control passed to the driver
+ *     in the tx() callback.
+ *
+ * @flags: transmit status flags, defined above
+ *
+ * @ack_signal: signal strength of the ACK frame
+ *
+ * @excessive_retries: set to 1 if the frame was retried many times
+ *     but not acknowledged
+ *
+ * @retry_count: number of retries
+ *
+ * @queue_length: ?? REMOVE
+ * @queue_number: ?? REMOVE
+ */
 struct ieee80211_tx_status {
-       /* copied ieee80211_tx_control structure */
        struct ieee80211_tx_control control;
-
-#define IEEE80211_TX_STATUS_TX_FILTERED        (1<<0)
-#define IEEE80211_TX_STATUS_ACK                (1<<1) /* whether the TX frame was ACKed */
-       u32 flags;              /* tx staus flags defined above */
-
-       int ack_signal; /* measured signal strength of the ACK frame */
-       int excessive_retries;
-       int retry_count;
-
-       int queue_length;      /* information about TX queue */
+       u8 flags;
+       bool excessive_retries;
+       u8 retry_count;
+       int ack_signal;
+       int queue_length;
        int queue_number;
 };
 
+/**
+ * enum ieee80211_conf_flags - configuration flags
+ *
+ * Flags to define PHY configuration options
+ *
+ * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time
+ * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported)
+ *
+ */
+enum ieee80211_conf_flags {
+       IEEE80211_CONF_SHORT_SLOT_TIME  = 1<<0,
+       IEEE80211_CONF_RADIOTAP         = 1<<1,
+};
 
 /**
  * struct ieee80211_conf - configuration of the device
@@ -264,52 +397,39 @@ struct ieee80211_tx_status {
  * This struct indicates how the driver shall configure the hardware.
  *
  * @radio_enabled: when zero, driver is required to switch off the radio.
+ *     TODO make a flag
+ * @channel: IEEE 802.11 channel number
+ * @freq: frequency in MHz
+ * @channel_val: hardware specific channel value for the channel
+ * @phymode: PHY mode to activate (REMOVE)
+ * @chan: channel to switch to, pointer to the channel information
+ * @mode: pointer to mode definition
+ * @regulatory_domain: ??
+ * @beacon_int: beacon interval (TODO make interface config)
+ * @flags: configuration flags defined above
+ * @power_level: transmit power limit for current regulatory domain in dBm
+ * @antenna_max: maximum antenna gain
+ * @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
+ *     1/2: antenna 0/1
+ * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
  */
 struct ieee80211_conf {
        int channel;                    /* IEEE 802.11 channel number */
        int freq;                       /* MHz */
        int channel_val;                /* hw specific value for the channel */
 
-       int phymode;                    /* MODE_IEEE80211A, .. */
+       enum ieee80211_phymode phymode;
        struct ieee80211_channel *chan;
        struct ieee80211_hw_mode *mode;
        unsigned int regulatory_domain;
        int radio_enabled;
 
        int beacon_int;
-
-#define IEEE80211_CONF_SHORT_SLOT_TIME (1<<0) /* use IEEE 802.11g Short Slot
-                                               * Time */
-#define IEEE80211_CONF_SSID_HIDDEN     (1<<1) /* do not broadcast the ssid */
-#define IEEE80211_CONF_RADIOTAP                (1<<2) /* use radiotap if supported
-                                                 check this bit at RX time */
-       u32 flags;                      /* configuration flags defined above */
-
-       u8 power_level;                 /* transmit power limit for current
-                                        * regulatory domain; in dBm */
-       u8 antenna_max;                 /* maximum antenna gain */
-       short tx_power_reduction; /* in 0.1 dBm */
-
-       /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */
+       u32 flags;
+       u8 power_level;
+       u8 antenna_max;
        u8 antenna_sel_tx;
        u8 antenna_sel_rx;
-
-       int antenna_def;
-       int antenna_mode;
-
-       /* Following five fields are used for IEEE 802.11H */
-       unsigned int radar_detect;
-       unsigned int spect_mgmt;
-       /* All following fields are currently unused. */
-       unsigned int quiet_duration; /* duration of quiet period */
-       unsigned int quiet_offset; /* how far into the beacon is the quiet
-                                   * period */
-       unsigned int quiet_period;
-       u8 radar_firpwr_threshold;
-       u8 radar_rssi_threshold;
-       u8 pulse_height_threshold;
-       u8 pulse_rssi_threshold;
-       u8 pulse_inband_threshold;
 };
 
 /**
@@ -347,9 +467,16 @@ enum ieee80211_if_types {
  * @mac_addr: pointer to MAC address of the interface. This pointer is valid
  *     until the interface is removed (i.e. it cannot be used after
  *     remove_interface() callback was called for this interface).
+ *     This pointer will be %NULL for monitor interfaces, be careful.
  *
  * This structure is used in add_interface() and remove_interface()
  * callbacks of &struct ieee80211_hw.
+ *
+ * When you allow multiple interfaces to be added to your PHY, take care
+ * that the hardware can actually handle multiple MAC addresses. However,
+ * also take care that when there's no interface left with mac_addr != %NULL
+ * you remove the MAC address from the device to avoid acknowledging packets
+ * in pure monitor mode.
  */
 struct ieee80211_if_init_conf {
        int if_id;
@@ -395,40 +522,86 @@ struct ieee80211_if_conf {
        struct ieee80211_tx_control *beacon_control;
 };
 
-typedef enum { ALG_NONE, ALG_WEP, ALG_TKIP, ALG_CCMP, ALG_NULL }
-ieee80211_key_alg;
+/**
+ * enum ieee80211_key_alg - key algorithm
+ * @ALG_NONE: Unset key algorithm, will never be passed to the driver
+ * @ALG_WEP: WEP40 or WEP104
+ * @ALG_TKIP: TKIP
+ * @ALG_CCMP: CCMP (AES)
+ */
+typedef enum ieee80211_key_alg {
+       ALG_NONE,
+       ALG_WEP,
+       ALG_TKIP,
+       ALG_CCMP,
+} ieee80211_key_alg;
 
 
-struct ieee80211_key_conf {
+/**
+ * enum ieee80211_key_flags - key flags
+ *
+ * These flags are used for communication about keys between the driver
+ * and mac80211, with the @flags parameter of &struct ieee80211_key_conf.
+ *
+ * @IEEE80211_KEY_FLAG_WMM_STA: Set by mac80211, this flag indicates
+ *     that the STA this key will be used with could be using QoS.
+ * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the
+ *     driver to indicate that it requires IV generation for this
+ *     particular key.
+ * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by
+ *     the driver for a TKIP key if it requires Michael MIC
+ *     generation in software.
+ */
+enum ieee80211_key_flags {
+       IEEE80211_KEY_FLAG_WMM_STA      = 1<<0,
+       IEEE80211_KEY_FLAG_GENERATE_IV  = 1<<1,
+       IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2,
+};
 
-       int hw_key_idx;                 /* filled + used by low-level driver */
+/**
+ * struct ieee80211_key_conf - key information
+ *
+ * This key information is given by mac80211 to the driver by
+ * the set_key() callback in &struct ieee80211_ops.
+ *
+ * @hw_key_idx: To be set by the driver, this is the key index the driver
+ *     wants to be given when a frame is transmitted and needs to be
+ *     encrypted in hardware.
+ * @alg: The key algorithm.
+ * @flags: key flags, see &enum ieee80211_key_flags.
+ * @keyidx: the key index (0-3)
+ * @keylen: key material length
+ * @key: key material
+ */
+struct ieee80211_key_conf {
        ieee80211_key_alg alg;
-       int keylen;
-
-#define IEEE80211_KEY_FORCE_SW_ENCRYPT (1<<0) /* to be cleared by low-level
-                                                driver */
-#define IEEE80211_KEY_DEFAULT_TX_KEY   (1<<1) /* This key is the new default TX
-                                                key (used only for broadcast
-                                                keys). */
-#define IEEE80211_KEY_DEFAULT_WEP_ONLY (1<<2) /* static WEP is the only
-                                                configured security policy;
-                                                this allows some low-level
-                                                drivers to determine when
-                                                hwaccel can be used */
-       u32 flags; /* key configuration flags defined above */
-
-       s8 keyidx;                      /* WEP key index */
+       u8 hw_key_idx;
+       u8 flags;
+       s8 keyidx;
+       u8 keylen;
        u8 key[0];
 };
 
 #define IEEE80211_SEQ_COUNTER_RX       0
 #define IEEE80211_SEQ_COUNTER_TX       1
 
-typedef enum {
-       SET_KEY, DISABLE_KEY, REMOVE_ALL_KEYS,
+/**
+ * enum set_key_cmd - key command
+ *
+ * Used with the set_key() callback in &struct ieee80211_ops, this
+ * indicates whether a key is being removed or added.
+ *
+ * @SET_KEY: a key is set
+ * @DISABLE_KEY: a key must be disabled
+ */
+typedef enum set_key_cmd {
+       SET_KEY, DISABLE_KEY,
 } set_key_cmd;
 
-/* This is driver-visible part of the per-hw state the stack keeps. */
+/**
+ * struct ieee80211_hw - hardware information and state
+ * TODO: move documentation into kernel-doc format
+ */
 struct ieee80211_hw {
        /* points to the cfg80211 wiphy for this piece. Note
         * that you must fill in the perm_addr and dev fields
@@ -450,21 +623,16 @@ struct ieee80211_hw {
 
        /* TODO: frame_type 802.11/802.3, sw_encryption requirements */
 
-       /* Some wireless LAN chipsets generate beacons in the hardware/firmware
-        * and others rely on host generated beacons. This option is used to
-        * configure the upper layer IEEE 802.11 module to generate beacons.
-        * The low-level driver can use ieee80211_beacon_get() to fetch the
-        * next beacon frame. */
-#define IEEE80211_HW_HOST_GEN_BEACON (1<<0)
+/* hole at 0 */
 
-       /* The device needs to be supplied with a beacon template only. */
+       /*
+        * The device only needs to be supplied with a beacon template.
+        * If you need the host to generate each beacon then don't use
+        * this flag and use ieee80211_beacon_get().
+        */
 #define IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE (1<<1)
 
-       /* Some devices handle decryption internally and do not
-        * indicate whether the frame was encrypted (unencrypted frames
-        * will be dropped by the hardware, unless specifically allowed
-        * through) */
-#define IEEE80211_HW_DEVICE_HIDES_WEP (1<<2)
+/* hole at 2 */
 
        /* Whether RX frames passed to ieee80211_rx() include FCS in the end */
 #define IEEE80211_HW_RX_INCLUDES_FCS (1<<3)
@@ -477,21 +645,13 @@ struct ieee80211_hw {
         * can fetch them with ieee80211_get_buffered_bc(). */
 #define IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING (1<<4)
 
-#define IEEE80211_HW_WEP_INCLUDE_IV (1<<5)
+/* hole at 5 */
 
-       /* will data nullfunc frames get proper TX status callback */
-#define IEEE80211_HW_DATA_NULLFUNC_ACK (1<<6)
+/* hole at 6 */
 
-       /* Force software encryption for TKIP packets if WMM is enabled. */
-#define IEEE80211_HW_NO_TKIP_WMM_HWACCEL (1<<7)
+/* hole at 7 */
 
-       /* Some devices handle Michael MIC internally and do not include MIC in
-        * the received packets passed up. device_strips_mic must be set
-        * for such devices. The 'encryption' frame control bit is expected to
-        * be still set in the IEEE 802.11 header with this option unlike with
-        * the device_hides_wep configuration option.
-        */
-#define IEEE80211_HW_DEVICE_STRIPS_MIC (1<<8)
+/* hole at 8 */
 
        /* Device is capable of performing full monitor mode even during
         * normal operation. */
@@ -505,15 +665,6 @@ struct ieee80211_hw {
         * specified in the device's EEPROM */
 #define IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED (1<<11)
 
-       /* calculate Michael MIC for an MSDU when doing hwcrypto */
-#define IEEE80211_HW_TKIP_INCLUDE_MMIC (1<<12)
-       /* Do TKIP phase1 key mixing in stack to support cards only do
-        * phase2 key mixing when doing hwcrypto */
-#define IEEE80211_HW_TKIP_REQ_PHASE1_KEY (1<<13)
-       /* Do TKIP phase1 and phase2 key mixing in stack and send the generated
-        * per-packet RC4 key with each TX frame when doing hwcrypto */
-#define IEEE80211_HW_TKIP_REQ_PHASE2_KEY (1<<14)
-
        u32 flags;                      /* hardware flags defined above */
 
        /* Set to the size of a needed device specific skb headroom for TX skbs. */
@@ -555,9 +706,6 @@ struct ieee80211_ops {
        int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb,
                  struct ieee80211_tx_control *control);
 
-       /* Handler for performing hardware reset. */
-       int (*reset)(struct ieee80211_hw *hw);
-
        /* Handler that is called when any netdevice attached to the hardware
         * device is set UP for the first time. This can be used, e.g., to
         * enable interrupts and beacon sending. */
@@ -574,10 +722,11 @@ struct ieee80211_ops {
         * to returning zero. By returning non-zero addition of the interface
         * is inhibited. Unless monitor_during_oper is set, it is guaranteed
         * that monitor interfaces and normal interfaces are mutually
-        * exclusive. The open() handler is called after add_interface()
-        * if this is the first device added. At least one of the open()
-        * open() and add_interface() callbacks has to be assigned. If
-        * add_interface() is NULL, one STA interface is permitted only. */
+        * exclusive. If assigned, the open() handler is called after
+        * add_interface() if this is the first device added. The
+        * add_interface() callback has to be assigned because it is the only
+        * way to obtain the requested MAC address for any interface.
+        */
        int (*add_interface)(struct ieee80211_hw *hw,
                             struct ieee80211_if_init_conf *conf);
 
@@ -613,22 +762,42 @@ struct ieee80211_ops {
         * Must be atomic. */
        int (*set_tim)(struct ieee80211_hw *hw, int aid, int set);
 
-       /* Set encryption key. IEEE 802.11 module calls this function to set
-        * encryption keys. addr is ff:ff:ff:ff:ff:ff for default keys and
-        * station hwaddr for individual keys. aid of the station is given
-        * to help low-level driver in selecting which key->hw_key_idx to use
-        * for this key. TX control data will use the hw_key_idx selected by
-        * the low-level driver.
-        * Must be atomic. */
+       /*
+        * Set encryption key.
+        *
+        * This is called to enable hardware acceleration of encryption and
+        * decryption. The address will be the broadcast address for default
+        * keys, the other station's hardware address for individual keys or
+        * the zero address for keys that will be used only for transmission.
+        *
+        * The local_address parameter will always be set to our own address,
+        * this is only relevant if you support multiple local addresses.
+        *
+        * When transmitting, the TX control data will use the hw_key_idx
+        * selected by the low-level driver.
+        *
+        * Return 0 if the key is now in use, -EOPNOTSUPP or -ENOSPC if it
+        * couldn't be added; if you return 0 then hw_key_idx must be assigned
+        * to the hardware key index, you are free to use the full u8 range.
+        *
+        * When the cmd is DISABLE_KEY then it must succeed.
+        *
+        * Note that it is permissible to not decrypt a frame even if a key
+        * for it has been uploaded to hardware, the stack will not make any
+        * decision based on whether a key has been uploaded or not but rather
+        * based on the receive flags.
+        *
+        * This callback can sleep, and is only called between add_interface
+        * and remove_interface calls, i.e. while the interface with the
+        * given local_address is enabled.
+        *
+        * The ieee80211_key_conf structure pointed to by the key parameter
+        * is guaranteed to be valid until another call to set_key removes
+        * it, but it can only be used as a cookie to differentiate keys.
+        */
        int (*set_key)(struct ieee80211_hw *hw, set_key_cmd cmd,
-                      u8 *addr, struct ieee80211_key_conf *key, int aid);
-
-       /* Set TX key index for default/broadcast keys. This is needed in cases
-        * where wlan card is doing full WEP/TKIP encapsulation (wep_include_iv
-        * is not set), in other cases, this function pointer can be set to
-        * NULL since the IEEE 802. 11 module takes care of selecting the key
-        * index for each TX frame. */
-       int (*set_key_idx)(struct ieee80211_hw *hw, int idx);
+                      const u8 *local_address, const u8 *address,
+                      struct ieee80211_key_conf *key);
 
        /* Enable/disable IEEE 802.1X. This item requests wlan card to pass
         * unencrypted EAPOL-Key frames even when encryption is configured.
@@ -684,6 +853,14 @@ struct ieee80211_ops {
        void (*sta_table_notification)(struct ieee80211_hw *hw,
                                       int num_sta);
 
+       /* Handle ERP IE change notifications. Must be atomic. */
+       void (*erp_ie_changed)(struct ieee80211_hw *hw, u8 changes,
+                              int cts_protection, int preamble);
+
+       /* Flags for the erp_ie_changed changes parameter */
+#define IEEE80211_ERP_CHANGE_PROTECTION (1<<0) /* protection flag changed */
+#define IEEE80211_ERP_CHANGE_PREAMBLE (1<<1) /* barker preamble mode changed */
+
        /* Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
         * bursting) for a hardware TX queue.
         * queue = IEEE80211_TX_QUEUE_*.
@@ -822,6 +999,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
 /**
  * ieee80211_rts_get - RTS frame generation function
  * @hw: pointer obtained from ieee80211_alloc_hw().
+ * @if_id: interface ID from &struct ieee80211_if_init_conf.
  * @frame: pointer to the frame that is going to be protected by the RTS.
  * @frame_len: the frame length (in octets).
  * @frame_txctl: &struct ieee80211_tx_control of the frame.
@@ -832,7 +1010,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
  * the next RTS frame from the 802.11 code. The low-level is responsible
  * for calling this function before and RTS frame is needed.
  */
-void ieee80211_rts_get(struct ieee80211_hw *hw,
+void ieee80211_rts_get(struct ieee80211_hw *hw, int if_id,
                       const void *frame, size_t frame_len,
                       const struct ieee80211_tx_control *frame_txctl,
                       struct ieee80211_rts *rts);
@@ -840,6 +1018,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw,
 /**
  * ieee80211_rts_duration - Get the duration field for an RTS frame
  * @hw: pointer obtained from ieee80211_alloc_hw().
+ * @if_id: interface ID from &struct ieee80211_if_init_conf.
  * @frame_len: the length of the frame that is going to be protected by the RTS.
  * @frame_txctl: &struct ieee80211_tx_control of the frame.
  *
@@ -847,13 +1026,14 @@ void ieee80211_rts_get(struct ieee80211_hw *hw,
  * the duration field, the low-level driver uses this function to receive
  * the duration field value in little-endian byteorder.
  */
-__le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
+__le16 ieee80211_rts_duration(struct ieee80211_hw *hw, int if_id,
                              size_t frame_len,
                              const struct ieee80211_tx_control *frame_txctl);
 
 /**
  * ieee80211_ctstoself_get - CTS-to-self frame generation function
  * @hw: pointer obtained from ieee80211_alloc_hw().
+ * @if_id: interface ID from &struct ieee80211_if_init_conf.
  * @frame: pointer to the frame that is going to be protected by the CTS-to-self.
  * @frame_len: the frame length (in octets).
  * @frame_txctl: &struct ieee80211_tx_control of the frame.
@@ -864,7 +1044,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
  * the next CTS-to-self frame from the 802.11 code. The low-level is responsible
  * for calling this function before and CTS-to-self frame is needed.
  */
-void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
+void ieee80211_ctstoself_get(struct ieee80211_hw *hw, int if_id,
                             const void *frame, size_t frame_len,
                             const struct ieee80211_tx_control *frame_txctl,
                             struct ieee80211_cts *cts);
@@ -872,6 +1052,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
 /**
  * ieee80211_ctstoself_duration - Get the duration field for a CTS-to-self frame
  * @hw: pointer obtained from ieee80211_alloc_hw().
+ * @if_id: interface ID from &struct ieee80211_if_init_conf.
  * @frame_len: the length of the frame that is going to be protected by the CTS-to-self.
  * @frame_txctl: &struct ieee80211_tx_control of the frame.
  *
@@ -879,20 +1060,21 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
  * the duration field, the low-level driver uses this function to receive
  * the duration field value in little-endian byteorder.
  */
-__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
+__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, int if_id,
                                    size_t frame_len,
                                    const struct ieee80211_tx_control *frame_txctl);
 
 /**
  * ieee80211_generic_frame_duration - Calculate the duration field for a frame
  * @hw: pointer obtained from ieee80211_alloc_hw().
+ * @if_id: interface ID from &struct ieee80211_if_init_conf.
  * @frame_len: the length of the frame.
  * @rate: the rate (in 100kbps) at which the frame is going to be transmitted.
  *
  * Calculate the duration field of some generic frame, given its
  * length and transmission rate (in 100kbps).
  */
-__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
+__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, int if_id,
                                        size_t frame_len,
                                        int rate);
 
@@ -921,12 +1103,6 @@ struct sk_buff *
 ieee80211_get_buffered_bc(struct ieee80211_hw *hw, int if_id,
                          struct ieee80211_tx_control *control);
 
-/* Low level drivers that have their own MLME and MAC indicate
- * the aid for an associating station with this call */
-int ieee80211_set_aid_for_sta(struct ieee80211_hw *hw,
-                             u8 *peer_address, u16 aid);
-
-
 /* Given an sk_buff with a raw 802.11 header at the data pointer this function
  * returns the 802.11 header length in bytes (not including encryption
  * headers). If the data in the sk_buff is too short to contain a valid 802.11
@@ -1000,12 +1176,6 @@ ieee80211_get_mc_list_item(struct ieee80211_hw *hw,
 /* called by driver to notify scan status completed */
 void ieee80211_scan_completed(struct ieee80211_hw *hw);
 
-/* Function to indicate Radar Detection. The low level driver must call this
- * function to indicate the presence of radar in the current channel.
- * Additionally the radar type also could be sent */
-int  ieee80211_radar_status(struct ieee80211_hw *hw, int channel,
-                           int radar, int radar_type);
-
 /* return a pointer to the source address (SA) */
 static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr)
 {
@@ -1038,8 +1208,4 @@ static inline int ieee80211_get_morefrag(struct ieee80211_hdr *hdr)
                IEEE80211_FCTL_MOREFRAGS) != 0;
 }
 
-#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]
-
 #endif /* MAC80211_H */