cfg80211: keep track of BSSes
[deliverable/linux.git] / net / wireless / scan.c
index 82b33e70848852a6ae897292f484669b98a3c253..925399462a79fb7dd844fb27e60c50ac742cfb78 100644 (file)
@@ -70,6 +70,8 @@ static void bss_release(struct kref *ref)
        if (bss->ies_allocated)
                kfree(bss->pub.information_elements);
 
+       BUG_ON(atomic_read(&bss->hold));
+
        kfree(bss);
 }
 
@@ -92,8 +94,9 @@ void cfg80211_bss_expire(struct cfg80211_registered_device *dev)
        bool expired = false;
 
        list_for_each_entry_safe(bss, tmp, &dev->bss_list, list) {
-               if (bss->hold ||
-                   !time_after(jiffies, bss->ts + IEEE80211_SCAN_RESULT_EXPIRE))
+               if (atomic_read(&bss->hold))
+                       continue;
+               if (!time_after(jiffies, bss->ts + IEEE80211_SCAN_RESULT_EXPIRE))
                        continue;
                list_del(&bss->list);
                rb_erase(&bss->rbn, &dev->bss_tree);
@@ -553,30 +556,6 @@ void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *pub)
 }
 EXPORT_SYMBOL(cfg80211_unlink_bss);
 
-void cfg80211_hold_bss(struct cfg80211_bss *pub)
-{
-       struct cfg80211_internal_bss *bss;
-
-       if (!pub)
-               return;
-
-       bss = container_of(pub, struct cfg80211_internal_bss, pub);
-       bss->hold = true;
-}
-EXPORT_SYMBOL(cfg80211_hold_bss);
-
-void cfg80211_unhold_bss(struct cfg80211_bss *pub)
-{
-       struct cfg80211_internal_bss *bss;
-
-       if (!pub)
-               return;
-
-       bss = container_of(pub, struct cfg80211_internal_bss, pub);
-       bss->hold = false;
-}
-EXPORT_SYMBOL(cfg80211_unhold_bss);
-
 #ifdef CONFIG_WIRELESS_EXT
 int cfg80211_wext_siwscan(struct net_device *dev,
                          struct iw_request_info *info,
This page took 0.063912 seconds and 5 git commands to generate.