cfg80211: add an option to disable processing country IEs
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Mon, 11 Nov 2013 21:15:31 +0000 (22:15 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 Nov 2013 19:51:51 +0000 (20:51 +0100)
Certain vendors may want to disable the processing of
country IEs so that they can continue using the regulatory
domain the driver or user has set.  Currently there is no
way to stop the core from processing country IEs, so add
support to the core to ignore country IE hints.

Cc: Mihir Shete <smihir@qti.qualcomm.com>
Cc: Henri Bahini <hbahini@qca.qualcomm.com>
Cc: Tushnim Bhattacharyya <tushnimb@qca.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/regulatory.h
net/wireless/reg.c

index b03ddee3341dd9a7d0a65ccd01f564c50bd9ba3c..92ab80f69efe4e4bf6eae75c7dff8439b3039ccf 100644 (file)
@@ -123,12 +123,17 @@ struct regulatory_request {
  *     derived from the regulatory domain. The regulatory domain used will be
  *     based on the ISO3166-alpha2 from country IE provided through
  *     regulatory_hint_country_ie()
+ * @REGULATORY_COUNTRY_IE_IGNORE: for devices that have a preference to ignore
+ *     all country IE information processed by the regulatory core. This will
+ *     override %REGULATORY_COUNTRY_IE_FOLLOW_POWER as all country IEs will
+ *     be ignored.
  */
 enum ieee80211_regulatory_flags {
        REGULATORY_CUSTOM_REG                   = BIT(0),
        REGULATORY_STRICT_REG                   = BIT(1),
        REGULATORY_DISABLE_BEACON_HINTS         = BIT(2),
        REGULATORY_COUNTRY_IE_FOLLOW_POWER      = BIT(3),
+       REGULATORY_COUNTRY_IE_IGNORE            = BIT(4),
 };
 
 struct ieee80211_freq_range {
index 6b3051f6a8a7b3e9b1937f443b81f51e96712efc..067c1f63a1aea3762f9c5979ef0f7450906acc37 100644 (file)
@@ -1543,6 +1543,9 @@ __reg_process_hint_country_ie(struct wiphy *wiphy,
                if (regdom_changes(country_ie_request->alpha2))
                        return REG_REQ_IGNORE;
                return REG_REQ_ALREADY_SET;
+       } else {
+               if (wiphy->regulatory_flags & REGULATORY_COUNTRY_IE_IGNORE)
+                       return REG_REQ_IGNORE;
        }
 
        if (unlikely(!is_an_alpha2(country_ie_request->alpha2)))