diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/mlme.c | 14 | ||||
-rw-r--r-- | net/mac80211/util.c | 37 |
2 files changed, 41 insertions, 10 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 4adba09e80ca..e470bf12b765 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -3446,21 +3446,17 @@ static int ieee80211_sta_config_auth(struct net_device *dev, | |||
3446 | struct ieee80211_sta_bss *bss, *selected = NULL; | 3446 | struct ieee80211_sta_bss *bss, *selected = NULL; |
3447 | int top_rssi = 0, freq; | 3447 | int top_rssi = 0, freq; |
3448 | 3448 | ||
3449 | if (!(ifsta->flags & (IEEE80211_STA_AUTO_SSID_SEL | | ||
3450 | IEEE80211_STA_AUTO_BSSID_SEL | IEEE80211_STA_AUTO_CHANNEL_SEL))) { | ||
3451 | ifsta->state = IEEE80211_AUTHENTICATE; | ||
3452 | ieee80211_sta_reset_auth(dev, ifsta); | ||
3453 | return 0; | ||
3454 | } | ||
3455 | |||
3456 | spin_lock_bh(&local->sta_bss_lock); | 3449 | spin_lock_bh(&local->sta_bss_lock); |
3457 | freq = local->oper_channel->center_freq; | 3450 | freq = local->oper_channel->center_freq; |
3458 | list_for_each_entry(bss, &local->sta_bss_list, list) { | 3451 | list_for_each_entry(bss, &local->sta_bss_list, list) { |
3459 | if (!(bss->capability & WLAN_CAPABILITY_ESS)) | 3452 | if (!(bss->capability & WLAN_CAPABILITY_ESS)) |
3460 | continue; | 3453 | continue; |
3461 | 3454 | ||
3462 | if (!!(bss->capability & WLAN_CAPABILITY_PRIVACY) ^ | 3455 | if ((ifsta->flags & (IEEE80211_STA_AUTO_SSID_SEL | |
3463 | !!sdata->default_key) | 3456 | IEEE80211_STA_AUTO_BSSID_SEL | |
3457 | IEEE80211_STA_AUTO_CHANNEL_SEL)) && | ||
3458 | (!!(bss->capability & WLAN_CAPABILITY_PRIVACY) ^ | ||
3459 | !!sdata->default_key)) | ||
3464 | continue; | 3460 | continue; |
3465 | 3461 | ||
3466 | if (!(ifsta->flags & IEEE80211_STA_AUTO_CHANNEL_SEL) && | 3462 | if (!(ifsta->flags & IEEE80211_STA_AUTO_CHANNEL_SEL) && |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 24a465c4df09..131e9e6c8a32 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -389,6 +389,41 @@ void ieee80211_iterate_active_interfaces( | |||
389 | struct ieee80211_local *local = hw_to_local(hw); | 389 | struct ieee80211_local *local = hw_to_local(hw); |
390 | struct ieee80211_sub_if_data *sdata; | 390 | struct ieee80211_sub_if_data *sdata; |
391 | 391 | ||
392 | rtnl_lock(); | ||
393 | |||
394 | list_for_each_entry(sdata, &local->interfaces, list) { | ||
395 | switch (sdata->vif.type) { | ||
396 | case IEEE80211_IF_TYPE_INVALID: | ||
397 | case IEEE80211_IF_TYPE_MNTR: | ||
398 | case IEEE80211_IF_TYPE_VLAN: | ||
399 | continue; | ||
400 | case IEEE80211_IF_TYPE_AP: | ||
401 | case IEEE80211_IF_TYPE_STA: | ||
402 | case IEEE80211_IF_TYPE_IBSS: | ||
403 | case IEEE80211_IF_TYPE_WDS: | ||
404 | case IEEE80211_IF_TYPE_MESH_POINT: | ||
405 | break; | ||
406 | } | ||
407 | if (sdata->dev == local->mdev) | ||
408 | continue; | ||
409 | if (netif_running(sdata->dev)) | ||
410 | iterator(data, sdata->dev->dev_addr, | ||
411 | &sdata->vif); | ||
412 | } | ||
413 | |||
414 | rtnl_unlock(); | ||
415 | } | ||
416 | EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces); | ||
417 | |||
418 | void ieee80211_iterate_active_interfaces_atomic( | ||
419 | struct ieee80211_hw *hw, | ||
420 | void (*iterator)(void *data, u8 *mac, | ||
421 | struct ieee80211_vif *vif), | ||
422 | void *data) | ||
423 | { | ||
424 | struct ieee80211_local *local = hw_to_local(hw); | ||
425 | struct ieee80211_sub_if_data *sdata; | ||
426 | |||
392 | rcu_read_lock(); | 427 | rcu_read_lock(); |
393 | 428 | ||
394 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | 429 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
@@ -413,4 +448,4 @@ void ieee80211_iterate_active_interfaces( | |||
413 | 448 | ||
414 | rcu_read_unlock(); | 449 | rcu_read_unlock(); |
415 | } | 450 | } |
416 | EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces); | 451 | EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_atomic); |