block: elevator quiescing helpers
[safe/jmp/linux-2.6] / net / mac80211 / ht.c
index 869ea5f..4e3c72f 100644 (file)
@@ -17,6 +17,7 @@
 #include <net/wireless.h>
 #include <net/mac80211.h>
 #include "ieee80211_i.h"
+#include "rate.h"
 
 void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_supported_band *sband,
                                       struct ieee80211_ht_cap *ht_cap_ie,
@@ -93,7 +94,9 @@ u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata,
 {
        struct ieee80211_local *local = sdata->local;
        struct ieee80211_supported_band *sband;
+       struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
        struct ieee80211_bss_ht_conf ht;
+       struct sta_info *sta;
        u32 changed = 0;
        bool enable_ht = true, ht_changed;
        enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT;
@@ -136,6 +139,16 @@ u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata,
        if (ht_changed) {
                 /* channel_type change automatically detected */
                ieee80211_hw_config(local, 0);
+
+               rcu_read_lock();
+
+               sta = sta_info_get(local, ifmgd->bssid);
+               if (sta)
+                       rate_control_rate_update(local, sband, sta,
+                                                IEEE80211_RC_HT_CHANGED);
+
+               rcu_read_unlock();
+
         }
 
        /* disable HT */
@@ -153,17 +166,14 @@ u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata,
        return changed;
 }
 
-void ieee80211_sta_tear_down_BA_sessions(struct ieee80211_sub_if_data *sdata, u8 *addr)
+void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta)
 {
-       struct ieee80211_local *local = sdata->local;
        int i;
 
        for (i = 0; i <  STA_TID_NUM; i++) {
-               ieee80211_stop_tx_ba_session(&local->hw, addr, i,
-                                            WLAN_BACK_INITIATOR);
-               ieee80211_sta_stop_rx_ba_session(sdata, addr, i,
-                                                WLAN_BACK_RECIPIENT,
-                                                WLAN_REASON_QSTA_LEAVE_QBSS);
+               __ieee80211_stop_tx_ba_session(sta, i, WLAN_BACK_INITIATOR);
+               __ieee80211_stop_rx_ba_session(sta, i, WLAN_BACK_RECIPIENT,
+                                              WLAN_REASON_QSTA_LEAVE_QBSS);
        }
 }
 
@@ -172,7 +182,6 @@ void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
                          u16 initiator, u16 reason_code)
 {
        struct ieee80211_local *local = sdata->local;
-       struct ieee80211_if_sta *ifsta = &sdata->u.sta;
        struct sk_buff *skb;
        struct ieee80211_mgmt *mgmt;
        u16 params;
@@ -190,10 +199,12 @@ void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
        memset(mgmt, 0, 24);
        memcpy(mgmt->da, da, ETH_ALEN);
        memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN);
-       if (sdata->vif.type == NL80211_IFTYPE_AP)
+       if (sdata->vif.type == NL80211_IFTYPE_AP ||
+           sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
                memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN);
-       else
-               memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN);
+       else if (sdata->vif.type == NL80211_IFTYPE_STATION)
+               memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
+
        mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
                                          IEEE80211_STYPE_ACTION);