From: greearb@candelatech.com
To: linux-wireless@vger.kernel.org
Cc: ath9k-devel@venema.h4ckr.net, Ben Greear <greearb@candelatech.com>
Subject: [PATCH] ath9k: Allow over-riding reg-domain.
Date: Mon, 11 Mar 2013 09:45:06 -0700 [thread overview]
Message-ID: <1363020306-924-1-git-send-email-greearb@candelatech.com> (raw)
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
next reply other threads:[~2013-03-11 16:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-11 16:45 greearb [this message]
2013-03-11 19:05 ` [PATCH] ath9k: Allow over-riding reg-domain 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
-- strict thread matches above, loose matches on Subject: below --
2013-03-11 22:45 Xose Vazquez Perez
2013-03-11 22:56 ` Adrian Chadd
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=1363020306-924-1-git-send-email-greearb@candelatech.com \
--to=greearb@candelatech.com \
--cc=ath9k-devel@venema.h4ckr.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).