aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@frijolero.org>2012-03-23 10:23:31 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-09 16:37:11 -0400
commit80007efeff0568375b08faf93c7aad65602cb97e (patch)
treecef9bf4795d131b53d831c8e178e417b2c0cba89 /net/wireless
parentd2a079fd48c05235b86016a33a79cb86a86e15a8 (diff)
cfg80211: warn if db.txt is empty with CONFIG_CFG80211_INTERNAL_REGDB
It has happened twice now where elaborate troubleshooting has undergone on systems where CONFIG_CFG80211_INTERNAL_REGDB [0] has been set but yet net/wireless/db.txt was not updated. Despite the documentation on this it seems system integrators could use some more help with this, so throw out a kernel warning at boot time when their database is empty. This does mean that the error-prone system integrator won't likely realize the issue until they boot the machine but -- it does not seem to make sense to enable a build bug breaking random build testing. [0] http://wireless.kernel.org/en/developers/Regulatory/CRDA#CONFIG_CFG80211_INTERNAL_REGDB Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Youngsin Lee <youngsin@qualcomm.com> Cc: Raja Mani <rmani@qca.qualcomm.com> Cc: Senthil Kumar Balasubramanian <senthilb@qca.qualcomm.com> Cc: Vipin Mehta <vipimeht@qca.qualcomm.com> Cc: yahuan@qca.qualcomm.com Cc: jjan@qca.qualcomm.com Cc: vthiagar@qca.qualcomm.com Cc: henrykim@qualcomm.com Cc: jouni@qca.qualcomm.com Cc: athiruve@qca.qualcomm.com Cc: cjkim@qualcomm.com Cc: philipk@qca.qualcomm.com Cc: sunnykim@qualcomm.com Cc: sskwak@qualcomm.com Cc: kkim@qualcomm.com Cc: mattbyun@qualcomm.com Cc: ryanlee@qualcomm.com Cc: simbap@qualcomm.com Cc: krislee@qualcomm.com Cc: conner@qualcomm.com Cc: hojinkim@qualcomm.com Cc: honglee@qualcomm.com Cc: johnwkim@qualcomm.com Cc: jinyong@qca.qualcomm.com Cc: stable@vger.kernel.org Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/reg.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index e9a0ac83b84c..15f347477a99 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -388,7 +388,15 @@ static void reg_regdb_query(const char *alpha2)
388 388
389 schedule_work(&reg_regdb_work); 389 schedule_work(&reg_regdb_work);
390} 390}
391
392/* Feel free to add any other sanity checks here */
393static void reg_regdb_size_check(void)
394{
395 /* We should ideally BUILD_BUG_ON() but then random builds would fail */
396 WARN_ONCE(!reg_regdb_size, "db.txt is empty, you should update it...");
397}
391#else 398#else
399static inline void reg_regdb_size_check(void) {}
392static inline void reg_regdb_query(const char *alpha2) {} 400static inline void reg_regdb_query(const char *alpha2) {}
393#endif /* CONFIG_CFG80211_INTERNAL_REGDB */ 401#endif /* CONFIG_CFG80211_INTERNAL_REGDB */
394 402
@@ -2322,6 +2330,8 @@ int __init regulatory_init(void)
2322 spin_lock_init(&reg_requests_lock); 2330 spin_lock_init(&reg_requests_lock);
2323 spin_lock_init(&reg_pending_beacons_lock); 2331 spin_lock_init(&reg_pending_beacons_lock);
2324 2332
2333 reg_regdb_size_check();
2334
2325 cfg80211_regdomain = cfg80211_world_regdom; 2335 cfg80211_regdomain = cfg80211_world_regdom;
2326 2336
2327 user_alpha2[0] = '9'; 2337 user_alpha2[0] = '9';