diff options
Diffstat (limited to 'net/wireless/reg.c')
| -rw-r--r-- | net/wireless/reg.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 6c1993d99902..08265ca15785 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
| @@ -907,6 +907,7 @@ EXPORT_SYMBOL(freq_reg_info); | |||
| 907 | int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, | 907 | int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, |
| 908 | const struct ieee80211_reg_rule **reg_rule) | 908 | const struct ieee80211_reg_rule **reg_rule) |
| 909 | { | 909 | { |
| 910 | assert_cfg80211_lock(); | ||
| 910 | return freq_reg_info_regd(wiphy, center_freq, | 911 | return freq_reg_info_regd(wiphy, center_freq, |
| 911 | bandwidth, reg_rule, NULL); | 912 | bandwidth, reg_rule, NULL); |
| 912 | } | 913 | } |
| @@ -1133,7 +1134,8 @@ static bool reg_is_world_roaming(struct wiphy *wiphy) | |||
| 1133 | if (is_world_regdom(cfg80211_regdomain->alpha2) || | 1134 | if (is_world_regdom(cfg80211_regdomain->alpha2) || |
| 1134 | (wiphy->regd && is_world_regdom(wiphy->regd->alpha2))) | 1135 | (wiphy->regd && is_world_regdom(wiphy->regd->alpha2))) |
| 1135 | return true; | 1136 | return true; |
| 1136 | if (last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && | 1137 | if (last_request && |
| 1138 | last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && | ||
| 1137 | wiphy->custom_regulatory) | 1139 | wiphy->custom_regulatory) |
| 1138 | return true; | 1140 | return true; |
| 1139 | return false; | 1141 | return false; |
| @@ -1142,6 +1144,12 @@ static bool reg_is_world_roaming(struct wiphy *wiphy) | |||
| 1142 | /* Reap the advantages of previously found beacons */ | 1144 | /* Reap the advantages of previously found beacons */ |
| 1143 | static void reg_process_beacons(struct wiphy *wiphy) | 1145 | static void reg_process_beacons(struct wiphy *wiphy) |
| 1144 | { | 1146 | { |
| 1147 | /* | ||
| 1148 | * Means we are just firing up cfg80211, so no beacons would | ||
| 1149 | * have been processed yet. | ||
| 1150 | */ | ||
| 1151 | if (!last_request) | ||
| 1152 | return; | ||
| 1145 | if (!reg_is_world_roaming(wiphy)) | 1153 | if (!reg_is_world_roaming(wiphy)) |
| 1146 | return; | 1154 | return; |
| 1147 | wiphy_update_beacon_reg(wiphy); | 1155 | wiphy_update_beacon_reg(wiphy); |
| @@ -1176,6 +1184,8 @@ static void handle_channel_custom(struct wiphy *wiphy, | |||
| 1176 | struct ieee80211_supported_band *sband; | 1184 | struct ieee80211_supported_band *sband; |
| 1177 | struct ieee80211_channel *chan; | 1185 | struct ieee80211_channel *chan; |
| 1178 | 1186 | ||
| 1187 | assert_cfg80211_lock(); | ||
| 1188 | |||
| 1179 | sband = wiphy->bands[band]; | 1189 | sband = wiphy->bands[band]; |
| 1180 | BUG_ON(chan_idx >= sband->n_channels); | 1190 | BUG_ON(chan_idx >= sband->n_channels); |
| 1181 | chan = &sband->channels[chan_idx]; | 1191 | chan = &sband->channels[chan_idx]; |
| @@ -1214,10 +1224,13 @@ void wiphy_apply_custom_regulatory(struct wiphy *wiphy, | |||
| 1214 | const struct ieee80211_regdomain *regd) | 1224 | const struct ieee80211_regdomain *regd) |
| 1215 | { | 1225 | { |
| 1216 | enum ieee80211_band band; | 1226 | enum ieee80211_band band; |
| 1227 | |||
| 1228 | mutex_lock(&cfg80211_mutex); | ||
| 1217 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { | 1229 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { |
| 1218 | if (wiphy->bands[band]) | 1230 | if (wiphy->bands[band]) |
| 1219 | handle_band_custom(wiphy, band, regd); | 1231 | handle_band_custom(wiphy, band, regd); |
| 1220 | } | 1232 | } |
| 1233 | mutex_unlock(&cfg80211_mutex); | ||
| 1221 | } | 1234 | } |
| 1222 | EXPORT_SYMBOL(wiphy_apply_custom_regulatory); | 1235 | EXPORT_SYMBOL(wiphy_apply_custom_regulatory); |
| 1223 | 1236 | ||
| @@ -1423,7 +1436,7 @@ new_request: | |||
| 1423 | return call_crda(last_request->alpha2); | 1436 | return call_crda(last_request->alpha2); |
| 1424 | } | 1437 | } |
| 1425 | 1438 | ||
| 1426 | /* This currently only processes user and driver regulatory hints */ | 1439 | /* This processes *all* regulatory hints */ |
| 1427 | static void reg_process_hint(struct regulatory_request *reg_request) | 1440 | static void reg_process_hint(struct regulatory_request *reg_request) |
| 1428 | { | 1441 | { |
| 1429 | int r = 0; | 1442 | int r = 0; |
