mac80211: tear down of block ack sessions
authorRon Rindjunsky <ron.rindjunsky@intel.com>
Tue, 18 Mar 2008 22:00:32 +0000 (15:00 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 25 Mar 2008 20:41:57 +0000 (16:41 -0400)
This patch adds a clean tear down for all block ack sessions if interface
goes down or if a deauthentication is done.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/ieee80211.c
net/mac80211/ieee80211_i.h
net/mac80211/ieee80211_sta.c

index 55b63712e48ca6bfec4ba06541a92b1ce3ca96e5..616ce10d2a3861a0fc40441bd9d95a711fd42db9 100644 (file)
@@ -386,7 +386,6 @@ static int ieee80211_stop(struct net_device *dev)
        struct ieee80211_local *local = sdata->local;
        struct ieee80211_if_init_conf conf;
        struct sta_info *sta;
-       int i;
 
        /*
         * Stop TX on this interface first.
@@ -400,11 +399,7 @@ static int ieee80211_stop(struct net_device *dev)
 
        list_for_each_entry_rcu(sta, &local->sta_list, list) {
                if (sta->sdata == sdata)
-                       for (i = 0; i <  STA_TID_NUM; i++)
-                               ieee80211_sta_stop_rx_ba_session(sdata->dev,
-                                               sta->addr, i,
-                                               WLAN_BACK_RECIPIENT,
-                                               WLAN_REASON_QSTA_LEAVE_QBSS);
+                       ieee80211_sta_tear_down_BA_sessions(dev, sta->addr);
        }
 
        rcu_read_unlock();
index 7f10ff5d4a0b346700fdd04116009f1262863432..a6485f01b3c867a1e3d20e9c8132b0397e66d07b 100644 (file)
@@ -928,10 +928,12 @@ void ieee80211_send_addba_request(struct net_device *dev, const u8 *da,
                                  u16 agg_size, u16 timeout);
 void ieee80211_send_delba(struct net_device *dev, const u8 *da, u16 tid,
                                u16 initiator, u16 reason_code);
+
 void ieee80211_sta_stop_rx_ba_session(struct net_device *dev, u8 *da,
                                u16 tid, u16 initiator, u16 reason);
 void sta_rx_agg_session_timer_expired(unsigned long data);
 void sta_addba_resp_timer_expired(unsigned long data);
+void ieee80211_sta_tear_down_BA_sessions(struct net_device *dev, u8 *addr);
 u64 ieee80211_sta_get_rates(struct ieee80211_local *local,
                            struct ieee802_11_elems *elems,
                            enum ieee80211_band band);
index 9beedb6558968c46d1dacb2f3db09f191534de64..fc73ca4abc08d22ef42b6a2270ffd54c03005a21 100644 (file)
@@ -467,8 +467,8 @@ static void ieee80211_set_associated(struct net_device *dev,
                memcpy(wrqu.ap_addr.sa_data, sdata->u.sta.bssid, ETH_ALEN);
                ieee80211_sta_send_associnfo(dev, ifsta);
        } else {
+               ieee80211_sta_tear_down_BA_sessions(dev, ifsta->bssid);
                ifsta->flags &= ~IEEE80211_STA_ASSOCIATED;
-
                netif_carrier_off(dev);
                ieee80211_reset_erp_info(dev);
                memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
@@ -1518,6 +1518,19 @@ void sta_rx_agg_session_timer_expired(unsigned long data)
                                         WLAN_REASON_QSTA_TIMEOUT);
 }
 
+void ieee80211_sta_tear_down_BA_sessions(struct net_device *dev, u8 *addr)
+{
+       struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+       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(dev, addr, i,
+                                                WLAN_BACK_RECIPIENT,
+                                                WLAN_REASON_QSTA_LEAVE_QBSS);
+       }
+}
 
 static void ieee80211_rx_mgmt_auth(struct net_device *dev,
                                   struct ieee80211_if_sta *ifsta,