linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sujith Manoharan <sujith@msujith.org>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 02/16] ath9k: Initialize baseband for DFS channels
Date: Fri,  6 Dec 2013 16:28:40 +0530	[thread overview]
Message-ID: <1386327534-31105-3-git-send-email-sujith@msujith.org> (raw)
In-Reply-To: <1386327534-31105-1-git-send-email-sujith@msujith.org>

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Certain baseband registers require different values
to be programmed when operating in a DFS channel to
ensure that radar detection works correctly. This
is required for AR9300, AR9340 and AR9580.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_hw.c  | 6 ++++++
 drivers/net/wireless/ath/ath9k/ar9003_phy.c | 6 ++++++
 drivers/net/wireless/ath/ath9k/hw.h         | 1 +
 3 files changed, 13 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
index d8c1eee..4e8ae4a 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
@@ -152,6 +152,8 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
 			       ar9340Modes_fast_clock_1p0);
 		INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
 			       ar9340_1p0_baseband_core_txfir_coeff_japan_2484);
+		INIT_INI_ARRAY(&ah->ini_dfs,
+			       ar9340_1p0_baseband_postamble_dfs_channel);
 
 		if (!ah->is_clk_25mhz)
 			INIT_INI_ARRAY(&ah->iniAdditional,
@@ -340,6 +342,8 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
 			       ar9580_1p0_modes_fast_clock);
 		INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
 			       ar9580_1p0_baseband_core_txfir_coeff_japan_2484);
+		INIT_INI_ARRAY(&ah->ini_dfs,
+			       ar9580_1p0_baseband_postamble_dfs_channel);
 	} else if (AR_SREV_9565_11_OR_LATER(ah)) {
 		INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE],
 			       ar9565_1p1_mac_core);
@@ -458,6 +462,8 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
 			       ar9300Modes_fast_clock_2p2);
 		INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
 			       ar9300_2p2_baseband_core_txfir_coeff_japan_2484);
+		INIT_INI_ARRAY(&ah->ini_dfs,
+			       ar9300_2p2_baseband_postamble_dfs_channel);
 	}
 }
 
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index 39b71b3..9f051a0 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -1332,6 +1332,7 @@ static void ar9003_hw_ani_cache_ini_regs(struct ath_hw *ah)
 static void ar9003_hw_set_radar_params(struct ath_hw *ah,
 				       struct ath_hw_radar_conf *conf)
 {
+	unsigned int regWrites = 0;
 	u32 radar_0 = 0, radar_1 = 0;
 
 	if (!conf) {
@@ -1358,6 +1359,11 @@ static void ar9003_hw_set_radar_params(struct ath_hw *ah,
 		REG_SET_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
 	else
 		REG_CLR_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
+
+	if (AR_SREV_9300(ah) || AR_SREV_9340(ah) || AR_SREV_9580(ah)) {
+		REG_WRITE_ARRAY(&ah->ini_dfs,
+				IS_CHAN_HT40(ah->curchan) ? 2 : 1, regWrites);
+	}
 }
 
 static void ar9003_hw_set_radar_conf(struct ath_hw *ah)
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index e508436..7490047 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -864,6 +864,7 @@ struct ath_hw {
 	u32 gpio_mask;
 	u32 gpio_val;
 
+	struct ar5416IniArray ini_dfs;
 	struct ar5416IniArray iniModes;
 	struct ar5416IniArray iniCommon;
 	struct ar5416IniArray iniBB_RfGain;
-- 
1.8.4.2


  parent reply	other threads:[~2013-12-06 11:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-06 10:58 [PATCH 00/16] ath9k patches Sujith Manoharan
2013-12-06 10:58 ` [PATCH 01/16] ath9k: Add initval arrays for DFS channels Sujith Manoharan
2013-12-06 10:58 ` Sujith Manoharan [this message]
2013-12-06 10:58 ` [PATCH 03/16] ath9k: Update mac_postamble for AR9003 family Sujith Manoharan
2013-12-06 10:58 ` [PATCH 04/16] ath9k: Remove AR955x INI duplicates Sujith Manoharan
2013-12-06 10:58 ` [PATCH 05/16] ath9k: Update AR9331 v1.1 initvals Sujith Manoharan
2013-12-06 10:58 ` [PATCH 06/16] ath9k: Update AR9331 v1.2 initvals Sujith Manoharan
2013-12-06 10:58 ` [PATCH 07/16] ath9k: Use a separate TX gain table for WZR-HP-G450H Sujith Manoharan
2013-12-06 10:58 ` [PATCH 08/16] ath9k: Update high power gain table for AR9300 Sujith Manoharan
2013-12-06 10:58 ` [PATCH 09/16] ath9k: Identify duplicate AR9485 initvals Sujith Manoharan
2013-12-06 10:58 ` [PATCH 10/16] ath9k: Identify duplicate AR9462 v2.0 initvals Sujith Manoharan
2013-12-06 10:58 ` [PATCH 11/16] ath9k: Identify duplicate AR9565 v1.0 initvals Sujith Manoharan
2013-12-06 10:58 ` [PATCH 12/16] ath9k: Fix regulatory compliance Sujith Manoharan
2013-12-06 10:58 ` [PATCH 13/16] ath9k: Remove AR9330 v1.0 macro as it's not supported Sujith Manoharan
2013-12-06 10:58 ` [PATCH 14/16] ath9k: Enable manual peak calibration for AR9331 v1.1 Sujith Manoharan
2013-12-06 10:58 ` [PATCH 15/16] ath9k: Fix internal regulator for AR955x Sujith Manoharan
2013-12-06 10:58 ` [PATCH 16/16] ath9k: Apply tuning caps for AR9330 and AR9485 Sujith Manoharan

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=1386327534-31105-3-git-send-email-sujith@msujith.org \
    --to=sujith@msujith.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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;
as well as URLs for NNTP newsgroup(s).