Linux wireless drivers development
 help / color / mirror / Atom feed
From: Bruno Randolf <br1@einfach.org>
To: linux-wireless@vger.kernel.org
Cc: bob@bobcopeland.com, lrodriguez@atheros.com, bprodoehl@gmail.com,
	mickflemm@gmail.com
Subject: [PATCH] RFC: ath5k: Enable 802.11j 4.9GHz frequencies
Date: Wed, 19 Jan 2011 18:22:08 +0900	[thread overview]
Message-ID: <20110119092208.19777.47542.stgit@localhost6.localdomain6> (raw)

RFC:

This enables 4.9GHz frequencies in ath5k if the regdomain is set to MKK9_MKKC
(0xfe).

I have added a helper function to common ath/regd.c since we know about
MKK9_MKKC there, however in the place where i'm using the function we don't
have an ath_regulatory structure yet, so i'm passing the regdomain code as u16.

I'm using MKK9_MKKC only because this is the regdomain in the 802.11j enabled
sample cards we got from our vendor. I'm not sure if this is commonly used or
if there are other domain codes which indicate 802.11j support for Atheros
hardware (allthough some comments in the HAL suggest that). Also I don't know
if this is common between ath9k and ath5k.

Could someone from Atheros shed some light on this? Other comments?
---
 drivers/net/wireless/ath/ath5k/caps.c |   13 ++++++++-----
 drivers/net/wireless/ath/regd.c       |    6 ++++++
 drivers/net/wireless/ath/regd.h       |    1 +
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/caps.c b/drivers/net/wireless/ath/ath5k/caps.c
index 31cad80..52fa808 100644
--- a/drivers/net/wireless/ath/ath5k/caps.c
+++ b/drivers/net/wireless/ath/ath5k/caps.c
@@ -56,9 +56,8 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
 		 * XXX current ieee80211 implementation because the IEEE
 		 * XXX channel mapping does not support negative channel
 		 * XXX numbers (2312MHz is channel -19). Of course, this
-		 * XXX doesn't matter because these channels are out of range
-		 * XXX but some regulation domains like MKK (Japan) will
-		 * XXX support frequencies somewhere around 4.8GHz.
+		 * XXX doesn't matter because these channels are out of the
+		 * XXX legal range.
 		 */
 
 		/*
@@ -66,8 +65,12 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
 		 */
 
 		if (AR5K_EEPROM_HDR_11A(ee_header)) {
-			/* 4920 */
-			ah->ah_capabilities.cap_range.range_5ghz_min = 5005;
+			if (ath_is_11j_regd(
+			      ah->ah_capabilities.cap_eeprom.ee_regdomain))
+				/* 802.11j enabled card */
+				ah->ah_capabilities.cap_range.range_5ghz_min = 4920; /* 4910? */
+			else
+				ah->ah_capabilities.cap_range.range_5ghz_min = 5005;
 			ah->ah_capabilities.cap_range.range_5ghz_max = 6100;
 
 			/* Set supported modes */
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 2b14775..8d60089 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -158,6 +158,12 @@ ieee80211_regdomain *ath_world_regdomain(struct ath_regulatory *reg)
 	}
 }
 
+bool ath_is_11j_regd(u16 regdomain)
+{
+	return regdomain == MKK9_MKKC;
+}
+EXPORT_SYMBOL(ath_is_11j_regd);
+
 /* Frequency is one where radar detection is required */
 static bool ath_is_radar_freq(u16 center_freq)
 {
diff --git a/drivers/net/wireless/ath/regd.h b/drivers/net/wireless/ath/regd.h
index 345dd97..18d9acb 100644
--- a/drivers/net/wireless/ath/regd.h
+++ b/drivers/net/wireless/ath/regd.h
@@ -250,6 +250,7 @@ enum CountryCode {
 };
 
 bool ath_is_world_regd(struct ath_regulatory *reg);
+bool ath_is_11j_regd(u16 redomain);
 int ath_regd_init(struct ath_regulatory *reg, struct wiphy *wiphy,
 		  int (*reg_notifier)(struct wiphy *wiphy,
 		  struct regulatory_request *request));


                 reply	other threads:[~2011-01-19  9:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20110119092208.19777.47542.stgit@localhost6.localdomain6 \
    --to=br1@einfach.org \
    --cc=bob@bobcopeland.com \
    --cc=bprodoehl@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lrodriguez@atheros.com \
    --cc=mickflemm@gmail.com \
    /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