summaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-02-10 21:25:58 +0100
committerJohn W. Linville <linville@tuxdriver.com>2009-02-13 13:45:54 -0500
commitd491af19db3adcc1eb1653e60a427fb4df36f361 (patch)
tree7116bcc9f6de56d181d16463252c4aabab77b20e /net/wireless
parent78c1c7e109f1f14e7c18f290c4ebc58da220c7ba (diff)
cfg80211: allow users to request removing a BSS
This patch introduces cfg80211_unlink_bss, a function to allow a driver to remove a BSS from the internal list and make it not show up in scan results any more -- this is to be used when the driver detects that the BSS is no longer available. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/scan.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index ec148f68a62..aacccc9ab6c 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -432,6 +432,27 @@ void cfg80211_put_bss(struct cfg80211_bss *pub)
}
EXPORT_SYMBOL(cfg80211_put_bss);
+void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *pub)
+{
+ struct cfg80211_registered_device *dev = wiphy_to_dev(wiphy);
+ struct cfg80211_internal_bss *bss;
+
+ if (WARN_ON(!pub))
+ return;
+
+ bss = container_of(pub, struct cfg80211_internal_bss, pub);
+
+ spin_lock_bh(&dev->bss_lock);
+
+ list_del(&bss->list);
+ rb_erase(&bss->rbn, &dev->bss_tree);
+
+ spin_unlock_bh(&dev->bss_lock);
+
+ kref_put(&bss->ref, bss_release);
+}
+EXPORT_SYMBOL(cfg80211_unlink_bss);
+
#ifdef CONFIG_WIRELESS_EXT
int cfg80211_wext_siwscan(struct net_device *dev,
struct iw_request_info *info,