cfg80211/nl80211: scanning (and mac80211 update to use it)
This patch adds basic scan capability to cfg80211/nl80211 and changes mac80211 to use it. The BSS list that cfg80211 maintains is made driver-accessible with a private area in each BSS struct, but mac80211 doesn't yet use it. That's another large project. 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
849b796781
commit
2a51931192
@ -240,6 +240,8 @@ struct wiphy *wiphy_new(struct cfg80211_ops *ops, int sizeof_priv)
|
||||
mutex_init(&drv->mtx);
|
||||
mutex_init(&drv->devlist_mtx);
|
||||
INIT_LIST_HEAD(&drv->netdev_list);
|
||||
spin_lock_init(&drv->bss_lock);
|
||||
INIT_LIST_HEAD(&drv->bss_list);
|
||||
|
||||
device_initialize(&drv->wiphy.dev);
|
||||
drv->wiphy.dev.class = &ieee80211_class;
|
||||
@ -259,6 +261,9 @@ int wiphy_register(struct wiphy *wiphy)
|
||||
int i;
|
||||
u16 ifmodes = wiphy->interface_modes;
|
||||
|
||||
if (WARN_ON(wiphy->max_scan_ssids < 1))
|
||||
return -EINVAL;
|
||||
|
||||
/* sanity check ifmodes */
|
||||
WARN_ON(!ifmodes);
|
||||
ifmodes &= ((1 << __NL80211_IFTYPE_AFTER_LAST) - 1) & ~1;
|
||||
@ -367,8 +372,11 @@ EXPORT_SYMBOL(wiphy_unregister);
|
||||
|
||||
void cfg80211_dev_free(struct cfg80211_registered_device *drv)
|
||||
{
|
||||
struct cfg80211_internal_bss *scan, *tmp;
|
||||
mutex_destroy(&drv->mtx);
|
||||
mutex_destroy(&drv->devlist_mtx);
|
||||
list_for_each_entry_safe(scan, tmp, &drv->bss_list, list)
|
||||
kfree(scan);
|
||||
kfree(drv);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user