Search Linux Wireless

[PATCH] cfg80211: unblock user hint when cfg80211_regdom is intersected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mihir Shete <mihirsht@xxxxxxxxx>

User hints are always ignored if cfg80211_regdom is intersected.
Add checks to make sure that user hints are processed if the
previous hints are done processing.

Signed-off-by: Mihir Shete <mihirsht@xxxxxxxxx>
---
 net/wireless/reg.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index b4973bc..2c4e2ba 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -396,6 +396,14 @@ static bool regdom_changes(const char *alpha2)
 	return !alpha2_equal(r->alpha2, alpha2);
 }
 
+static bool is_cfg80211_regdom_intersected(void)
+{
+	const struct ieee80211_regdomain *r = get_cfg80211_regdom();
+
+	if (!r)
+		return false;
+	return is_intersected_alpha2(r->alpha2);
+}
 /*
  * The NL80211_REGDOM_SET_BY_USER regdom alpha2 is cached, this lets
  * you know if a valid regulatory hint with NL80211_REGDOM_SET_BY_USER
@@ -1650,9 +1658,14 @@ __reg_process_hint_user(struct regulatory_request *user_request)
 	 */
 	if ((lr->initiator == NL80211_REGDOM_SET_BY_CORE ||
 	     lr->initiator == NL80211_REGDOM_SET_BY_DRIVER ||
-	     lr->initiator == NL80211_REGDOM_SET_BY_USER) &&
-	    regdom_changes(lr->alpha2))
-		return REG_REQ_IGNORE;
+	     lr->initiator == NL80211_REGDOM_SET_BY_USER)) {
+		if (lr->intersect) {
+			if (!is_cfg80211_regdom_intersected())
+				return REG_REQ_IGNORE;
+		} else if (regdom_changes(lr->alpha2)) {
+			return REG_REQ_IGNORE;
+		}
+	}
 
 	if (!regdom_changes(user_request->alpha2))
 		return REG_REQ_ALREADY_SET;
-- 
1.8.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux