linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] ath9k: Allow over-riding reg-domain.
@ 2013-03-11 22:45 Xose Vazquez Perez
  2013-03-11 22:56 ` Adrian Chadd
  0 siblings, 1 reply; 14+ messages in thread
From: Xose Vazquez Perez @ 2013-03-11 22:45 UTC (permalink / raw)
  To: greearb, linux-wireless

Ben Greear wrote:

> 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:

You can use atheros branch [0] of iwleeprom [1] to
manipulate the EEPROM.

And you should read: http://wireless.kernel.org/en/users/Drivers/ath#Regulatory


[0] svn co http://iwleeprom.googlecode.com/svn/
[1] http://code.google.com/p/iwleeprom/

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH] ath9k: Allow over-riding reg-domain.
@ 2013-03-11 16:45 greearb
  2013-03-11 19:05 ` John W. Linville
  0 siblings, 1 reply; 14+ messages in thread
From: greearb @ 2013-03-11 16:45 UTC (permalink / raw)
  To: linux-wireless; +Cc: ath9k-devel, Ben Greear

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] 14+ messages in thread

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

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 22:45 [PATCH] ath9k: Allow over-riding reg-domain Xose Vazquez Perez
2013-03-11 22:56 ` Adrian Chadd
  -- strict thread matches above, loose matches on Subject: below --
2013-03-11 16:45 greearb
2013-03-11 19:05 ` John W. Linville
2013-03-11 19:51   ` Ben Greear
2013-03-11 20:08     ` John W. Linville
2013-03-11 20:17     ` Felix Fietkau
2013-03-11 21:01       ` Ben Greear
2013-03-11 21:36         ` Felix Fietkau
2013-03-11 21:44           ` Ben Greear
2013-03-11 21:51             ` Felix Fietkau
2013-03-11 22:00               ` Ben Greear
2013-03-11 22:07                 ` Felix Fietkau
2013-04-30 18:25       ` Ben Greear

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).