Thread (4 messages) 4 messages, 2 authors, 2013-10-14

[PATCH v2 2/2] cfg80211: add an option to disable processing country IEs

flat view
STALE4754d

From: Mihir Shete <hidden>
Date: 2013-10-13 04:32:00
Subsystem: 802.11 (including cfg80211/nl80211), the rest · Maintainers: Johannes Berg, Linus Torvalds

Revision v2 of 2 in this series.

Revisions (2)
  1. v1 [diff vs current]
  2. v2 current
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: Henri Bahini <redacted>
Cc: Tushnim Bhattacharyya <redacted>
Cc: Luis R. Rodriguez <redacted>
Signed-off-by: Mihir Shete <redacted>
---
 include/uapi/linux/nl80211.h | 5 +++++
 net/wireless/reg.c           | 3 +++
 2 files changed, 8 insertions(+)
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 6e574ce..9746f55 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2343,9 +2343,14 @@ enum nl80211_reg_type {
  *	domain. The regulatory domain used will be based on the
  *	ISO3166-alpha2 from country IE provided through
  *	regulatory_hint_country_ie()
+ * @NL80211_COUNTRY_IE_IGNORE_CORE - for devices that have a preference to
+ *	to ignore all country IE information processed by the core. This will
+ *	override %NL80211_COUNTRY_IE_FOLLOW_POWER if the country IE hint is
+ *	issued by the core
  */
 enum nl80211_country_ie_pref {
 	NL80211_COUNTRY_IE_FOLLOW_POWER	= 1<<0,
+	NL80211_COUNTRY_IE_IGNORE_CORE	= 1<<1,
 };
 
 /**
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 87b4ee3..699c4dc 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1322,6 +1322,9 @@ get_reg_request_treatment(struct wiphy *wiphy,
 	case NL80211_REGDOM_SET_BY_CORE:
 		return REG_REQ_OK;
 	case NL80211_REGDOM_SET_BY_COUNTRY_IE:
+		if (wiphy->country_ie_pref & NL80211_COUNTRY_IE_IGNORE_CORE)
+			return REG_REQ_IGNORE;
+
 		if (reg_request_cell_base(lr)) {
 			/* Trust a Cell base station over the AP's country IE */
 			if (regdom_changes(pending_request->alpha2))
-- 
1.8.2.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help