All of lore.kernel.org
 help / color / mirror / Atom feed
* [ath9k-devel] [PATCH] ath9k: Allow over-riding reg-domain.
@ 2013-03-11 16:45 ` greearb
  0 siblings, 0 replies; 24+ messages in thread
From: greearb at candelatech.com @ 2013-03-11 16:45 UTC (permalink / raw)
  To: ath9k-devel

From: Ben Greear <greearb@candelatech.com>

Otherwise, can't get the Sparklan AR9380 NICs to be
5Ghz APs, since they are in world-roaming domain by
default.  Add this to /etc/modprobe.d/ath9k.conf:

options ath9k override_eeprom_regdomain=0

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 af932c9... dee91a2... M	drivers/net/wireless/ath/ath9k/init.c
 drivers/net/wireless/ath/ath9k/init.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index af932c9..dee91a2 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -56,6 +56,12 @@ static int ath9k_enable_diversity;
 module_param_named(enable_diversity, ath9k_enable_diversity, int, 0444);
 MODULE_PARM_DESC(enable_diversity, "Enable Antenna diversity for AR9565");
 
+static int modparam_override_eeprom_regdomain = -1;
+module_param_named(override_eeprom_regdomain,
+		   modparam_override_eeprom_regdomain, int, 0444);
+MODULE_PARM_DESC(override_eeprom_regdomain, "Override regdomain hardcoded in EEPROM with this value (DANGEROUS).");
+
+
 bool is_ath9k_unloaded;
 /* We use the hw_value as an index into our private channel structure */
 
@@ -740,6 +746,21 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
 	struct ath_hw *ah = sc->sc_ah;
 	struct ath_common *common = ath9k_hw_common(ah);
 
+	if (modparam_override_eeprom_regdomain != -1) {
+#ifdef CONFIG_CFG80211_CERTIFICATION_ONUS
+		struct ath_regulatory *regulatory = ath9k_hw_regulatory(sc->sc_ah);
+		printk(KERN_ERR "ath9k: DANGER! You're overriding EEPROM-defined regulatory domain,"
+		       "\nfrom: 0x%x to 0x%x\n",
+		       regulatory->current_rd, modparam_override_eeprom_regdomain);
+		printk(KERN_ERR "ath9k: Your card was not certified to operate in the domain you chose.\n");
+		printk(KERN_ERR "ath9k: This might result in a violation of your local regulatory rules.\n");
+		printk(KERN_ERR "ath9k: Do not ever do this unless you really know what you are doing!\n");
+		regulatory->current_rd = modparam_override_eeprom_regdomain;
+#else
+		printk(KERN_ERR "ath9k: ERROR:  override_eeprom_regdomain request will be ignored because CF80211_CERTIFICATION_ONUS was not selected when compiling the kernel.\n");
+#endif
+	}
+
 	hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
 		IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
 		IEEE80211_HW_SIGNAL_DBM |
-- 
1.7.3.4

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

end of thread, other threads:[~2013-04-30 18:25 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 16:45 [ath9k-devel] [PATCH] ath9k: Allow over-riding reg-domain greearb at candelatech.com
2013-03-11 16:45 ` greearb
2013-03-11 19:05 ` [ath9k-devel] " John W. Linville
2013-03-11 19:05   ` John W. Linville
2013-03-11 19:51   ` [ath9k-devel] " Ben Greear
2013-03-11 19:51     ` Ben Greear
2013-03-11 20:08     ` [ath9k-devel] " John W. Linville
2013-03-11 20:08       ` John W. Linville
2013-03-11 20:17     ` [ath9k-devel] " Felix Fietkau
2013-03-11 20:17       ` Felix Fietkau
2013-03-11 21:01       ` [ath9k-devel] " Ben Greear
2013-03-11 21:01         ` Ben Greear
2013-03-11 21:36         ` [ath9k-devel] " Felix Fietkau
2013-03-11 21:36           ` Felix Fietkau
2013-03-11 21:44           ` [ath9k-devel] " Ben Greear
2013-03-11 21:44             ` Ben Greear
2013-03-11 21:51             ` [ath9k-devel] " Felix Fietkau
2013-03-11 21:51               ` Felix Fietkau
2013-03-11 22:00               ` [ath9k-devel] " Ben Greear
2013-03-11 22:00                 ` Ben Greear
2013-03-11 22:07                 ` [ath9k-devel] " Felix Fietkau
2013-03-11 22:07                   ` Felix Fietkau
2013-04-30 18:25       ` [ath9k-devel] " Ben Greear
2013-04-30 18:25         ` Ben Greear

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.