cfg80211: keep track of BSSes
In order to avoid problems with BSS structs going away while they're in use, I've long wanted to make cfg80211 keep track of them. Without the SME, that wasn't doable but now that we have the SME we can do this too. It can keep track of up to four separate authentications and one association, regardless of whether it's controlled by the cfg80211 SME or the userspace SME. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
517357c685
commit
19957bb399
@@ -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,
|
||||
|
Reference in New Issue
Block a user