From patchwork Wed Jan 19 09:22:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Randolf X-Patchwork-Id: 488771 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0J9LkFD031408 for ; Wed, 19 Jan 2011 09:21:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753746Ab1ASJVo (ORCPT ); Wed, 19 Jan 2011 04:21:44 -0500 Received: from mail30g.wh2.ocn.ne.jp ([220.111.41.239]:17707 "HELO mail30g.wh2.ocn.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752994Ab1ASJVn (ORCPT ); Wed, 19 Jan 2011 04:21:43 -0500 Received: from vs3001.wh2.ocn.ne.jp (125.206.180.229) by mail30g.wh2.ocn.ne.jp (RS ver 1.0.95vs) with SMTP id 0-0969248902 for ; Wed, 19 Jan 2011 18:21:42 +0900 (JST) Received: (qmail 99186 invoked from network); 19 Jan 2011 09:21:42 -0000 Received: from unknown (HELO localhost6.localdomain6) (220.110.201.18) by with SMTP; 19 Jan 2011 09:21:42 -0000 Subject: [PATCH] RFC: ath5k: Enable 802.11j 4.9GHz frequencies To: linux-wireless@vger.kernel.org From: Bruno Randolf Cc: bob@bobcopeland.com, lrodriguez@atheros.com, bprodoehl@gmail.com, mickflemm@gmail.com Date: Wed, 19 Jan 2011 18:22:08 +0900 Message-ID: <20110119092208.19777.47542.stgit@localhost6.localdomain6> User-Agent: StGit/0.15 MIME-Version: 1.0 X-SF-Loop: 1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 19 Jan 2011 09:21:47 +0000 (UTC) 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));