summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-10-02 18:33:10 -0700
committerJohannes Berg <johannes.berg@intel.com>2013-10-11 15:31:43 +0200
commitfa1fb9cb1c734204018d2b4e6f38c4a9b4146612 (patch)
tree4c13d601e1130ec3c5607afc455da21f2464755f /net
parentcea85247f8725fcad1ac7533ce5b32dace506cfc (diff)
downloadlinux-next-fa1fb9cb1c734204018d2b4e6f38c4a9b4146612.tar.gz
cfg80211: simplify strict custom alpha2 regdomain check
This makes it easier to read. Cc: smihir@qti.qualcomm.com Cc: tushnimb@qca.qualcomm.com Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/reg.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 37c2a63d0697..edb2ba4e2a18 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -972,6 +972,13 @@ static bool reg_dev_ignore_cell_hint(struct wiphy *wiphy)
}
#endif
+static bool wiphy_strict_alpha2_regd(struct wiphy *wiphy)
+{
+ if (wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY &&
+ !(wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY))
+ return true;
+ return false;
+}
static bool ignore_reg_update(struct wiphy *wiphy,
enum nl80211_reg_initiator initiator)
@@ -995,9 +1002,8 @@ static bool ignore_reg_update(struct wiphy *wiphy,
* wiphy->regd will be set once the device has its own
* desired regulatory domain set
*/
- if (wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY && !wiphy->regd &&
+ if (wiphy_strict_alpha2_regd(wiphy) && !wiphy->regd &&
initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
- !(wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) &&
!is_world_regdom(lr->alpha2)) {
REG_DBG_PRINT("Ignoring regulatory request %s since the driver requires its own regulatory domain to be set first\n",
reg_initiator_name(initiator));