linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Arik Nemtsov <arik@wizery.com>,
	Arik Nemtsov <arikx.nemtsov@intel.com>,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 4/7] cfg80211: treat the special "unknown" alpha2 as valid
Date: Sun, 11 May 2014 11:50:47 +0300	[thread overview]
Message-ID: <1399798250-20987-5-git-send-email-emmanuel.grumbach@intel.com> (raw)
In-Reply-To: <1399798250-20987-1-git-send-email-emmanuel.grumbach@intel.com>

From: Arik Nemtsov <arik@wizery.com>

If the regulatory request contains the special "99" unknown-country code,
allow a different alpha2 as response.

This special alpha2 is used when the real alpha2 is unknown and should
be provided by the driver via its get_regd() wiphy callback, as part of
the regdomain info.

Change-Id: Ia667ebd6b018bce1a32da7da7c5143a5b8a656a7
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 net/wireless/reg.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index e2f33d7..c429ec5 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -418,7 +418,8 @@ static bool is_user_regdom_saved(void)
 		return false;
 
 	/* This would indicate a mistake on the design */
-	if (WARN(!is_world_regdom(user_alpha2) && !is_an_alpha2(user_alpha2),
+	if (WARN(!is_world_regdom(user_alpha2) && !is_an_alpha2(user_alpha2) &&
+		 !is_unknown_alpha2(user_alpha2),
 		 "Unexpected user alpha2: %c%c\n",
 		 user_alpha2[0], user_alpha2[1]))
 		return false;
@@ -595,7 +596,8 @@ bool reg_is_valid_request(const char *alpha2)
 	if (!lr || lr->processed)
 		return false;
 
-	return alpha2_equal(lr->alpha2, alpha2);
+	return alpha2_equal(lr->alpha2, alpha2) ||
+	       is_unknown_alpha2(lr->alpha2);
 }
 
 static const struct ieee80211_regdomain *reg_get_regdomain(struct wiphy *wiphy)
-- 
1.8.3.2


  parent reply	other threads:[~2014-05-11  8:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-11  8:50 [PATCH 0/7] regulatory enhancements Emmanuel Grumbach
2014-05-11  8:50 ` [PATCH 1/7] cfg80211: don't set reg timeout for user-handled hint Emmanuel Grumbach
2014-05-12  6:47   ` Kalle Valo
2014-05-12  6:49     ` Grumbach, Emmanuel
2014-05-12  7:48       ` Johannes Berg
2014-05-20  8:09   ` Luis R. Rodriguez
2014-05-20 13:21   ` Johannes Berg
2014-05-11  8:50 ` [PATCH 2/7] cfg80211: introduce regulatory flags controlling bw Emmanuel Grumbach
2014-05-20  8:26   ` Luis R. Rodriguez
2014-05-20  8:33     ` Arik Nemtsov
2014-05-20  8:51       ` Luis R. Rodriguez
2014-05-20  9:25         ` Arik Nemtsov
2014-05-20  9:54           ` Luis R. Rodriguez
2014-05-20 12:31             ` Arik Nemtsov
2014-06-10 21:28               ` Luis R. Rodriguez
2014-06-11  5:24                 ` Arik Nemtsov
2014-06-11  6:21                   ` Janusz Dziedzic
2014-06-11  6:38                     ` Arik Nemtsov
2014-06-18 21:50                   ` Luis R. Rodriguez
2014-05-11  8:50 ` [PATCH 3/7] cfg80211: allow drivers to provide regulatory settings Emmanuel Grumbach
2014-05-20  8:44   ` Luis R. Rodriguez
2014-05-20  9:12     ` Arik Nemtsov
2014-05-20  9:53       ` Luis R. Rodriguez
2014-05-20 12:00         ` Arik Nemtsov
2014-06-10 21:43           ` Luis R. Rodriguez
2014-06-11  5:51             ` Arik Nemtsov
2014-05-11  8:50 ` Emmanuel Grumbach [this message]
2014-05-11  8:50 ` [PATCH 5/7] cfg80211: accept world/same regdom from driver/user hints Emmanuel Grumbach
2014-05-11  8:50 ` [PATCH 6/7] cfg80211: leave invalid channels on regdomain change Emmanuel Grumbach
2014-05-11  8:50 ` [PATCH 7/7] regulatory: add NULL to alpha2 Emmanuel Grumbach
2014-05-20  8:48 ` [PATCH 0/7] regulatory enhancements Luis R. Rodriguez
2014-06-10 21:44   ` Luis R. Rodriguez
2014-06-11  5:20     ` Arik Nemtsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399798250-20987-5-git-send-email-emmanuel.grumbach@intel.com \
    --to=emmanuel.grumbach@intel.com \
    --cc=arik@wizery.com \
    --cc=arikx.nemtsov@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).