]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/mac80211/sta_info.c
mac80211: use common skb queue
[mv-sheeva.git] / net / mac80211 / sta_info.c
index 3de7a2260d651b33cf28b1591ca864ac6b2e561a..c426c572d98450af118cec5b639bc4aaa39ec9f6 100644 (file)
@@ -648,14 +648,6 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)
 
        if (sta->key) {
                ieee80211_key_free(sta->key);
-               /*
-                * We have only unlinked the key, and actually destroying it
-                * may mean it is removed from hardware which requires that
-                * the key->sta pointer is still valid, so flush the key todo
-                * list here.
-                */
-               ieee80211_key_todo();
-
                WARN_ON(sta->key);
        }
 
@@ -855,8 +847,12 @@ struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw,
        struct sta_info *sta, *nxt;
 
        /* Just return a random station ... first in list ... */
-       for_each_sta_info(hw_to_local(hw), addr, sta, nxt)
+       for_each_sta_info(hw_to_local(hw), addr, sta, nxt) {
+               if (!sta->uploaded)
+                       return NULL;
                return &sta->sta;
+       }
+
        return NULL;
 }
 EXPORT_SYMBOL_GPL(ieee80211_find_sta_by_hw);
@@ -864,14 +860,19 @@ EXPORT_SYMBOL_GPL(ieee80211_find_sta_by_hw);
 struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif,
                                         const u8 *addr)
 {
-       struct ieee80211_sub_if_data *sdata;
+       struct sta_info *sta;
 
        if (!vif)
                return NULL;
 
-       sdata = vif_to_sdata(vif);
+       sta = sta_info_get_bss(vif_to_sdata(vif), addr);
+       if (!sta)
+               return NULL;
+
+       if (!sta->uploaded)
+               return NULL;
 
-       return ieee80211_find_sta_by_hw(&sdata->local->hw, addr);
+       return &sta->sta;
 }
 EXPORT_SYMBOL(ieee80211_find_sta);