diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-02-21 00:04:33 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-27 14:52:58 -0500 |
commit | 69b1572bd82046cc8f730e05c797062ca8c2b535 (patch) | |
tree | 808ae89029f24d10fe570d4d0361fa19edba51fb /net/wireless | |
parent | fff32c04f6074de0719cc46d8f488aaf746f151a (diff) |
cfg80211: rename regdom_changed to regdom_changes() and use it
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/reg.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 5456534bdf8c..3bd2ea2aeccb 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -291,7 +291,7 @@ static bool alpha2_equal(const char *alpha2_x, const char *alpha2_y) | |||
291 | return false; | 291 | return false; |
292 | } | 292 | } |
293 | 293 | ||
294 | static bool regdom_changed(const char *alpha2) | 294 | static bool regdom_changes(const char *alpha2) |
295 | { | 295 | { |
296 | assert_cfg80211_lock(); | 296 | assert_cfg80211_lock(); |
297 | 297 | ||
@@ -1134,8 +1134,7 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1134 | * intersect them, but that seems unlikely | 1134 | * intersect them, but that seems unlikely |
1135 | * to be correct. Reject second one for now. | 1135 | * to be correct. Reject second one for now. |
1136 | */ | 1136 | */ |
1137 | if (!alpha2_equal(alpha2, | 1137 | if (regdom_changes(alpha2)) |
1138 | cfg80211_regdomain->alpha2)) | ||
1139 | return -EOPNOTSUPP; | 1138 | return -EOPNOTSUPP; |
1140 | return -EALREADY; | 1139 | return -EALREADY; |
1141 | } | 1140 | } |
@@ -1143,8 +1142,7 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1143 | * Two consecutive Country IE hints on the same wiphy. | 1142 | * Two consecutive Country IE hints on the same wiphy. |
1144 | * This should be picked up early by the driver/stack | 1143 | * This should be picked up early by the driver/stack |
1145 | */ | 1144 | */ |
1146 | if (WARN_ON(!alpha2_equal(cfg80211_regdomain->alpha2, | 1145 | if (WARN_ON(regdom_changes(alpha2))) |
1147 | alpha2))) | ||
1148 | return 0; | 1146 | return 0; |
1149 | return -EALREADY; | 1147 | return -EALREADY; |
1150 | } | 1148 | } |
@@ -1153,7 +1151,7 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1153 | if (last_request->initiator == REGDOM_SET_BY_CORE) { | 1151 | if (last_request->initiator == REGDOM_SET_BY_CORE) { |
1154 | if (is_old_static_regdom(cfg80211_regdomain)) | 1152 | if (is_old_static_regdom(cfg80211_regdomain)) |
1155 | return 0; | 1153 | return 0; |
1156 | if (!alpha2_equal(cfg80211_regdomain->alpha2, alpha2)) | 1154 | if (regdom_changes(alpha2)) |
1157 | return 0; | 1155 | return 0; |
1158 | return -EALREADY; | 1156 | return -EALREADY; |
1159 | } | 1157 | } |
@@ -1164,7 +1162,7 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1164 | * loaded card also agrees on the regulatory domain. | 1162 | * loaded card also agrees on the regulatory domain. |
1165 | */ | 1163 | */ |
1166 | if (last_request->initiator == REGDOM_SET_BY_DRIVER && | 1164 | if (last_request->initiator == REGDOM_SET_BY_DRIVER && |
1167 | alpha2_equal(cfg80211_regdomain->alpha2, alpha2)) | 1165 | !regdom_changes(alpha2)) |
1168 | return -EALREADY; | 1166 | return -EALREADY; |
1169 | 1167 | ||
1170 | return REG_INTERSECT; | 1168 | return REG_INTERSECT; |
@@ -1185,13 +1183,12 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1185 | if (last_request->initiator == REGDOM_SET_BY_CORE || | 1183 | if (last_request->initiator == REGDOM_SET_BY_CORE || |
1186 | last_request->initiator == REGDOM_SET_BY_DRIVER || | 1184 | last_request->initiator == REGDOM_SET_BY_DRIVER || |
1187 | last_request->initiator == REGDOM_SET_BY_USER) { | 1185 | last_request->initiator == REGDOM_SET_BY_USER) { |
1188 | if (!alpha2_equal(last_request->alpha2, | 1186 | if (regdom_changes(last_request->alpha2)) |
1189 | cfg80211_regdomain->alpha2)) | ||
1190 | return -EAGAIN; | 1187 | return -EAGAIN; |
1191 | } | 1188 | } |
1192 | 1189 | ||
1193 | if (!is_old_static_regdom(cfg80211_regdomain) && | 1190 | if (!is_old_static_regdom(cfg80211_regdomain) && |
1194 | alpha2_equal(cfg80211_regdomain->alpha2, alpha2)) | 1191 | !regdom_changes(alpha2)) |
1195 | return -EALREADY; | 1192 | return -EALREADY; |
1196 | 1193 | ||
1197 | return 0; | 1194 | return 0; |
@@ -1720,7 +1717,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd) | |||
1720 | * checking if the alpha2 changes if CRDA was already called | 1717 | * checking if the alpha2 changes if CRDA was already called |
1721 | */ | 1718 | */ |
1722 | if (!is_old_static_regdom(cfg80211_regdomain) && | 1719 | if (!is_old_static_regdom(cfg80211_regdomain) && |
1723 | !regdom_changed(rd->alpha2)) | 1720 | !regdom_changes(rd->alpha2)) |
1724 | return -EINVAL; | 1721 | return -EINVAL; |
1725 | } | 1722 | } |
1726 | 1723 | ||