public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cfg80211: Do not call CRDA when using internal regulatory database
@ 2014-01-16 22:02 Chaitanya T K
  2014-01-17 18:52 ` Krishna Chaitanya
  2014-01-17 18:55 ` Johannes Berg
  0 siblings, 2 replies; 6+ messages in thread
From: Chaitanya T K @ 2014-01-16 22:02 UTC (permalink / raw)
  To: linux-wireless, johannes; +Cc: Chaitanya T K

When using internal regulatory data base kconfig option
do not try to call crda, this complely defeats the 
purposes of enabling internal regulatory db.

Signed-off-by: Chaitanya T K <chaitanya.mgit@gmail.com>

---
 net/wireless/reg.c |   29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 7d20d84..1cb0f99 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -454,16 +454,16 @@ static void reg_regdb_search(struct work_struct *work)
 
 static DECLARE_WORK(reg_regdb_work, reg_regdb_search);
 
-static void reg_regdb_query(const char *alpha2)
+static int reg_regdb_query(const char *alpha2)
 {
 	struct reg_regdb_search_request *request;
 
 	if (!alpha2)
-		return;
+		return -1;
 
 	request = kzalloc(sizeof(struct reg_regdb_search_request), GFP_KERNEL);
 	if (!request)
-		return;
+		return -1;
 
 	memcpy(request->alpha2, alpha2, 2);
 
@@ -472,6 +472,7 @@ static void reg_regdb_query(const char *alpha2)
 	mutex_unlock(&reg_regdb_search_mutex);
 
 	schedule_work(&reg_regdb_work);
+	return 0;
 }
 
 /* Feel free to add any other sanity checks here */
@@ -482,7 +483,15 @@ static void reg_regdb_size_check(void)
 }
 #else
 static inline void reg_regdb_size_check(void) {}
-static inline void reg_regdb_query(const char *alpha2) {}
+static inline int reg_regdb_query(const char *alpha2)
+{
+	if (!is_world_regdom((char *) alpha2))
+		pr_info("Calling CRDA for country: %c%c\n",
+			alpha2[0], alpha2[1]);
+	else
+		pr_info("Calling CRDA to update world regulatory domain\n");
+	return kobject_uevent(&reg_pdev->dev.kobj, KOBJ_CHANGE);
+}
 #endif /* CONFIG_CFG80211_INTERNAL_REGDB */
 
 /*
@@ -492,16 +501,8 @@ static inline void reg_regdb_query(const char *alpha2) {}
  */
 static int call_crda(const char *alpha2)
 {
-	if (!is_world_regdom((char *) alpha2))
-		pr_info("Calling CRDA for country: %c%c\n",
-			alpha2[0], alpha2[1]);
-	else
-		pr_info("Calling CRDA to update world regulatory domain\n");
-
-	/* query internal regulatory database (if it exists) */
-	reg_regdb_query(alpha2);
-
-	return kobject_uevent(&reg_pdev->dev.kobj, KOBJ_CHANGE);
+	/* query internal regulatory database/crda depending on config */
+	return reg_regdb_query(alpha2);
 }
 
 static enum reg_request_treatment

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-17 22:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-16 22:02 [PATCH] cfg80211: Do not call CRDA when using internal regulatory database Chaitanya T K
2014-01-17 18:52 ` Krishna Chaitanya
2014-01-17 18:54   ` Johannes Berg
2014-01-17 18:55 ` Johannes Berg
2014-01-17 19:03   ` Krishna Chaitanya
2014-01-17 22:10     ` Krishna Chaitanya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox