diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2012-12-19 13:53:04 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-01-03 07:01:38 -0500 |
commit | 0f500a5f6cadac888d5d3fce326452372d1a8343 (patch) | |
tree | aa44c923191fff33e55a4320e2ae26811966fbc2 /net/wireless/reg.c | |
parent | 3195e489a878aaa3b735d4a1b7c5c79b3786efed (diff) |
cfg80211: move world roaming check for beacon hints
We should not add new beacon hints even if the wiphy
is not world roaming. Without this we were always adding
a beacon hint if not world roaming for every non world
roaming wiphy interface.
Tested-by: Ben Greear <greearb@candelatech.com>
Reported-by: Ben Greear <greearb@candelatech.com>
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
[fix locking]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r-- | net/wireless/reg.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index b68eeef45e6c..0b35de001937 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1044,6 +1044,9 @@ static void handle_reg_beacon(struct wiphy *wiphy, unsigned int chan_idx, | |||
1044 | 1044 | ||
1045 | chan->beacon_found = true; | 1045 | chan->beacon_found = true; |
1046 | 1046 | ||
1047 | if (!reg_is_world_roaming(wiphy)) | ||
1048 | return; | ||
1049 | |||
1047 | if (wiphy->flags & WIPHY_FLAG_DISABLE_BEACON_HINTS) | 1050 | if (wiphy->flags & WIPHY_FLAG_DISABLE_BEACON_HINTS) |
1048 | return; | 1051 | return; |
1049 | 1052 | ||
@@ -1110,8 +1113,6 @@ static void reg_process_beacons(struct wiphy *wiphy) | |||
1110 | */ | 1113 | */ |
1111 | if (!last_request) | 1114 | if (!last_request) |
1112 | return; | 1115 | return; |
1113 | if (!reg_is_world_roaming(wiphy)) | ||
1114 | return; | ||
1115 | wiphy_update_beacon_reg(wiphy); | 1116 | wiphy_update_beacon_reg(wiphy); |
1116 | } | 1117 | } |
1117 | 1118 | ||
@@ -1593,11 +1594,8 @@ static void reg_process_pending_beacon_hints(void) | |||
1593 | struct cfg80211_registered_device *rdev; | 1594 | struct cfg80211_registered_device *rdev; |
1594 | struct reg_beacon *pending_beacon, *tmp; | 1595 | struct reg_beacon *pending_beacon, *tmp; |
1595 | 1596 | ||
1596 | /* | ||
1597 | * No need to hold the reg_mutex here as we just touch wiphys | ||
1598 | * and do not read or access regulatory variables. | ||
1599 | */ | ||
1600 | mutex_lock(&cfg80211_mutex); | 1597 | mutex_lock(&cfg80211_mutex); |
1598 | mutex_lock(®_mutex); | ||
1601 | 1599 | ||
1602 | /* This goes through the _pending_ beacon list */ | 1600 | /* This goes through the _pending_ beacon list */ |
1603 | spin_lock_bh(®_pending_beacons_lock); | 1601 | spin_lock_bh(®_pending_beacons_lock); |
@@ -1615,6 +1613,7 @@ static void reg_process_pending_beacon_hints(void) | |||
1615 | } | 1613 | } |
1616 | 1614 | ||
1617 | spin_unlock_bh(®_pending_beacons_lock); | 1615 | spin_unlock_bh(®_pending_beacons_lock); |
1616 | mutex_unlock(®_mutex); | ||
1618 | mutex_unlock(&cfg80211_mutex); | 1617 | mutex_unlock(&cfg80211_mutex); |
1619 | } | 1618 | } |
1620 | 1619 | ||