diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-11-05 12:18:12 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-11-25 14:51:26 -0500 |
commit | 0e3802dbfe53bc27a6bf019d022d743349a8d67d (patch) | |
tree | c8c2f046957adbb9fd367a5e6dfafafc686d2336 | |
parent | f75c30ef084fb57d3edab6722077e0adf16ed8fd (diff) |
cfg80211: move core reg_notfier() check to source
Drivers that set the WIPHY_FLAG_CUSTOM_REGULATORY skip
the core world regulatory domain updates, but do want
their reg_notifier() called. Move the check for this
closer to the source of the check that detected skipped
was required and while at it add a helper for the notifier
calling. This has no functional changes. This brings together
the place where we call the reg_notifier() will be called.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/wireless/reg.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index cd50bb56c7e7..38c252f91086 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1222,14 +1222,30 @@ static void reg_process_ht_flags(struct wiphy *wiphy) | |||
1222 | reg_process_ht_flags_band(wiphy, wiphy->bands[band]); | 1222 | reg_process_ht_flags_band(wiphy, wiphy->bands[band]); |
1223 | } | 1223 | } |
1224 | 1224 | ||
1225 | static void reg_call_notifier(struct wiphy *wiphy, | ||
1226 | struct regulatory_request *request) | ||
1227 | { | ||
1228 | if (wiphy->reg_notifier) | ||
1229 | wiphy->reg_notifier(wiphy, request); | ||
1230 | } | ||
1231 | |||
1225 | static void wiphy_update_regulatory(struct wiphy *wiphy, | 1232 | static void wiphy_update_regulatory(struct wiphy *wiphy, |
1226 | enum nl80211_reg_initiator initiator) | 1233 | enum nl80211_reg_initiator initiator) |
1227 | { | 1234 | { |
1228 | enum ieee80211_band band; | 1235 | enum ieee80211_band band; |
1229 | struct regulatory_request *lr = get_last_request(); | 1236 | struct regulatory_request *lr = get_last_request(); |
1230 | 1237 | ||
1231 | if (ignore_reg_update(wiphy, initiator)) | 1238 | if (ignore_reg_update(wiphy, initiator)) { |
1239 | /* | ||
1240 | * Regulatory updates set by CORE are ignored for custom | ||
1241 | * regulatory cards. Let us notify the changes to the driver, | ||
1242 | * as some drivers used this to restore its orig_* reg domain. | ||
1243 | */ | ||
1244 | if (initiator == NL80211_REGDOM_SET_BY_CORE && | ||
1245 | wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) | ||
1246 | reg_call_notifier(wiphy, lr); | ||
1232 | return; | 1247 | return; |
1248 | } | ||
1233 | 1249 | ||
1234 | lr->dfs_region = get_cfg80211_regdom()->dfs_region; | 1250 | lr->dfs_region = get_cfg80211_regdom()->dfs_region; |
1235 | 1251 | ||
@@ -1238,9 +1254,7 @@ static void wiphy_update_regulatory(struct wiphy *wiphy, | |||
1238 | 1254 | ||
1239 | reg_process_beacons(wiphy); | 1255 | reg_process_beacons(wiphy); |
1240 | reg_process_ht_flags(wiphy); | 1256 | reg_process_ht_flags(wiphy); |
1241 | 1257 | reg_call_notifier(wiphy, lr); | |
1242 | if (wiphy->reg_notifier) | ||
1243 | wiphy->reg_notifier(wiphy, lr); | ||
1244 | } | 1258 | } |
1245 | 1259 | ||
1246 | static void update_all_wiphy_regulatory(enum nl80211_reg_initiator initiator) | 1260 | static void update_all_wiphy_regulatory(enum nl80211_reg_initiator initiator) |
@@ -1253,15 +1267,6 @@ static void update_all_wiphy_regulatory(enum nl80211_reg_initiator initiator) | |||
1253 | list_for_each_entry(rdev, &cfg80211_rdev_list, list) { | 1267 | list_for_each_entry(rdev, &cfg80211_rdev_list, list) { |
1254 | wiphy = &rdev->wiphy; | 1268 | wiphy = &rdev->wiphy; |
1255 | wiphy_update_regulatory(wiphy, initiator); | 1269 | wiphy_update_regulatory(wiphy, initiator); |
1256 | /* | ||
1257 | * Regulatory updates set by CORE are ignored for custom | ||
1258 | * regulatory cards. Let us notify the changes to the driver, | ||
1259 | * as some drivers used this to restore its orig_* reg domain. | ||
1260 | */ | ||
1261 | if (initiator == NL80211_REGDOM_SET_BY_CORE && | ||
1262 | wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY && | ||
1263 | wiphy->reg_notifier) | ||
1264 | wiphy->reg_notifier(wiphy, get_last_request()); | ||
1265 | } | 1270 | } |
1266 | } | 1271 | } |
1267 | 1272 | ||