rt2x00: Fix quality houskeeping for software diversity
[pandora-kernel.git] / drivers / net / wireless / rt2x00 / rt2x00.h
index 7c5cbb1..704e944 100644 (file)
@@ -147,6 +147,7 @@ struct rt2x00_chip {
 #define RT2561         0x0302
 #define RT2661         0x0401
 #define RT2571         0x1300
+#define RT2870         0x1600
 
        u16 rf;
        u32 rev;
@@ -244,14 +245,11 @@ struct link_ant {
        struct antenna_setup active;
 
        /*
-        * RSSI information for the different antenna's.
-        * These statistics are used to determine when
-        * to switch antenna when using software diversity.
-        *
-        *        rssi[0] -> Antenna A RSSI
-        *        rssi[1] -> Antenna B RSSI
+        * RSSI history information for the antenna.
+        * Used to determine when to switch antenna
+        * when using software diversity.
         */
-       int rssi_history[2];
+       int rssi_history;
 
        /*
         * Current RSSI average of the currently active antenna.
@@ -366,6 +364,7 @@ static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)
  *     for @tx_power_a, @tx_power_bg and @channels.
  * @channels: Device/chipset specific channel values (See &struct rf_channel).
  * @channels_info: Additional information for channels (See &struct channel_info).
+ * @ht: Driver HT Capabilities (See &ieee80211_sta_ht_cap).
  */
 struct hw_mode_spec {
        unsigned int supported_bands;
@@ -379,6 +378,8 @@ struct hw_mode_spec {
        unsigned int num_channels;
        const struct rf_channel *channels;
        const struct channel_info *channels_info;
+
+       struct ieee80211_sta_ht_cap ht;
 };
 
 /*
@@ -413,6 +414,8 @@ struct rt2x00lib_erp {
        short pifs;
        short difs;
        short eifs;
+
+       u16 beacon_int;
 };
 
 /*
@@ -588,7 +591,6 @@ enum rt2x00_flags {
        DEVICE_STATE_INITIALIZED,
        DEVICE_STATE_STARTED,
        DEVICE_STATE_ENABLED_RADIO,
-       DEVICE_STATE_DISABLED_RADIO_HW,
 
        /*
         * Driver requirements
@@ -616,6 +618,7 @@ enum rt2x00_flags {
        CONFIG_EXTERNAL_LNA_BG,
        CONFIG_DOUBLE_ANTENNA,
        CONFIG_DISABLE_LINK_TUNING,
+       CONFIG_CHANNEL_HT40,
 };
 
 /*
@@ -627,7 +630,7 @@ struct rt2x00_dev {
         * The structure stored in here depends on the
         * system bus (PCI or USB).
         * When accessing this variable, the rt2x00dev_{pci,usb}
-        * macro's should be used for correct typecasting.
+        * macros should be used for correct typecasting.
         */
        struct device *dev;
 
@@ -643,18 +646,6 @@ struct rt2x00_dev {
        struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS];
        enum ieee80211_band curr_band;
 
-       /*
-        * rfkill structure for RF state switching support.
-        * This will only be compiled in when required.
-        */
-#ifdef CONFIG_RT2X00_LIB_RFKILL
-       unsigned long rfkill_state;
-#define RFKILL_STATE_ALLOCATED         1
-#define RFKILL_STATE_REGISTERED                2
-#define RFKILL_STATE_BLOCKED           3
-       struct input_polled_dev *rfkill_poll_dev;
-#endif /* CONFIG_RT2X00_LIB_RFKILL */
-
        /*
         * If enabled, the debugfs interface structures
         * required for deregistration of debugfs.
@@ -787,6 +778,18 @@ struct rt2x00_dev {
         */
        u8 freq_offset;
 
+       /*
+        * Calibration information (for rt2800usb & rt2800pci).
+        * [0] -> BW20
+        * [1] -> BW40
+        */
+       u8 calibration[2];
+
+       /*
+        * Beacon interval.
+        */
+       u16 beacon_int;
+
        /*
         * Low level statistics which will have
         * to be kept up to date while device is running.
@@ -903,11 +906,10 @@ static inline u32 rt2x00_rev(const struct rt2x00_chip *chipset)
        return chipset->rev;
 }
 
-static inline u16 rt2x00_check_rev(const struct rt2x00_chip *chipset,
-                                  const u32 rev)
+static inline bool rt2x00_check_rev(const struct rt2x00_chip *chipset,
+                                   const u32 mask, const u32 rev)
 {
-       return (((chipset->rev & 0xffff0) == rev) &&
-               !!(chipset->rev & 0x0000f));
+       return ((chipset->rev & mask) == rev);
 }
 
 /**
@@ -957,6 +959,8 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
                                unsigned int changed_flags,
                                unsigned int *total_flags,
                                int mc_count, struct dev_addr_list *mc_list);
+int rt2x00mac_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
+                     bool set);
 #ifdef CONFIG_RT2X00_LIB_CRYPTO
 int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
                      struct ieee80211_vif *vif, struct ieee80211_sta *sta,
@@ -974,6 +978,7 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
                                u32 changes);
 int rt2x00mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
                      const struct ieee80211_tx_queue_params *params);
+void rt2x00mac_rfkill_poll(struct ieee80211_hw *hw);
 
 /*
  * Driver allocation handlers.