diff options
author | David S. Miller <davem@davemloft.net> | 2009-05-08 05:48:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-08 05:48:30 -0400 |
commit | 22f6dacdfcfdc792d068e9c41234808860498d04 (patch) | |
tree | 281a7d476f256ea3e2f800177ba685b169cc0540 /net/wireless/reg.c | |
parent | 928f308f556f4943e50c5064b546f47bce301f02 (diff) | |
parent | 9b05126baa146fc3f41360164141d4e1b3ea93c4 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
include/net/tcp.h
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 f38cc39fa79e..139d13fdc94f 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -906,6 +906,7 @@ EXPORT_SYMBOL(freq_reg_info); | |||
906 | int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, | 906 | int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, |
907 | const struct ieee80211_reg_rule **reg_rule) | 907 | const struct ieee80211_reg_rule **reg_rule) |
908 | { | 908 | { |
909 | assert_cfg80211_lock(); | ||
909 | return freq_reg_info_regd(wiphy, center_freq, | 910 | return freq_reg_info_regd(wiphy, center_freq, |
910 | bandwidth, reg_rule, NULL); | 911 | bandwidth, reg_rule, NULL); |
911 | } | 912 | } |
@@ -1134,7 +1135,8 @@ static bool reg_is_world_roaming(struct wiphy *wiphy) | |||
1134 | if (is_world_regdom(cfg80211_regdomain->alpha2) || | 1135 | if (is_world_regdom(cfg80211_regdomain->alpha2) || |
1135 | (wiphy->regd && is_world_regdom(wiphy->regd->alpha2))) | 1136 | (wiphy->regd && is_world_regdom(wiphy->regd->alpha2))) |
1136 | return true; | 1137 | return true; |
1137 | if (last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && | 1138 | if (last_request && |
1139 | last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && | ||
1138 | wiphy->custom_regulatory) | 1140 | wiphy->custom_regulatory) |
1139 | return true; | 1141 | return true; |
1140 | return false; | 1142 | return false; |
@@ -1143,6 +1145,12 @@ static bool reg_is_world_roaming(struct wiphy *wiphy) | |||
1143 | /* Reap the advantages of previously found beacons */ | 1145 | /* Reap the advantages of previously found beacons */ |
1144 | static void reg_process_beacons(struct wiphy *wiphy) | 1146 | static void reg_process_beacons(struct wiphy *wiphy) |
1145 | { | 1147 | { |
1148 | /* | ||
1149 | * Means we are just firing up cfg80211, so no beacons would | ||
1150 | * have been processed yet. | ||
1151 | */ | ||
1152 | if (!last_request) | ||
1153 | return; | ||
1146 | if (!reg_is_world_roaming(wiphy)) | 1154 | if (!reg_is_world_roaming(wiphy)) |
1147 | return; | 1155 | return; |
1148 | wiphy_update_beacon_reg(wiphy); | 1156 | wiphy_update_beacon_reg(wiphy); |
@@ -1177,6 +1185,8 @@ static void handle_channel_custom(struct wiphy *wiphy, | |||
1177 | struct ieee80211_supported_band *sband; | 1185 | struct ieee80211_supported_band *sband; |
1178 | struct ieee80211_channel *chan; | 1186 | struct ieee80211_channel *chan; |
1179 | 1187 | ||
1188 | assert_cfg80211_lock(); | ||
1189 | |||
1180 | sband = wiphy->bands[band]; | 1190 | sband = wiphy->bands[band]; |
1181 | BUG_ON(chan_idx >= sband->n_channels); | 1191 | BUG_ON(chan_idx >= sband->n_channels); |
1182 | chan = &sband->channels[chan_idx]; | 1192 | chan = &sband->channels[chan_idx]; |
@@ -1215,10 +1225,13 @@ void wiphy_apply_custom_regulatory(struct wiphy *wiphy, | |||
1215 | const struct ieee80211_regdomain *regd) | 1225 | const struct ieee80211_regdomain *regd) |
1216 | { | 1226 | { |
1217 | enum ieee80211_band band; | 1227 | enum ieee80211_band band; |
1228 | |||
1229 | mutex_lock(&cfg80211_mutex); | ||
1218 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { | 1230 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { |
1219 | if (wiphy->bands[band]) | 1231 | if (wiphy->bands[band]) |
1220 | handle_band_custom(wiphy, band, regd); | 1232 | handle_band_custom(wiphy, band, regd); |
1221 | } | 1233 | } |
1234 | mutex_unlock(&cfg80211_mutex); | ||
1222 | } | 1235 | } |
1223 | EXPORT_SYMBOL(wiphy_apply_custom_regulatory); | 1236 | EXPORT_SYMBOL(wiphy_apply_custom_regulatory); |
1224 | 1237 | ||
@@ -1424,7 +1437,7 @@ new_request: | |||
1424 | return call_crda(last_request->alpha2); | 1437 | return call_crda(last_request->alpha2); |
1425 | } | 1438 | } |
1426 | 1439 | ||
1427 | /* This currently only processes user and driver regulatory hints */ | 1440 | /* This processes *all* regulatory hints */ |
1428 | static void reg_process_hint(struct regulatory_request *reg_request) | 1441 | static void reg_process_hint(struct regulatory_request *reg_request) |
1429 | { | 1442 | { |
1430 | int r = 0; | 1443 | int r = 0; |