linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vasanthakumar Thiagarajan <vasanth@atheros.com>
To: <linville@tuxdriver.com>
Cc: <linux-wireless@vger.kernel.org>
Subject: [PATCH V2 09/27] ath9k: Enable extended synch for AR9485 to fix L0s recovery issue
Date: Thu, 2 Dec 2010 03:06:53 -0800	[thread overview]
Message-ID: <1291288031-3409-10-git-send-email-vasanth@atheros.com> (raw)
In-Reply-To: <1291288031-3409-1-git-send-email-vasanth@atheros.com>

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath.h        |    1 +
 drivers/net/wireless/ath/ath9k/hw.c   |    5 +++++
 drivers/net/wireless/ath/ath9k/hw.h   |    2 ++
 drivers/net/wireless/ath/ath9k/main.c |    3 +++
 drivers/net/wireless/ath/ath9k/pci.c  |   12 ++++++++++++
 5 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h
index 26bdbee..f913db4 100644
--- a/drivers/net/wireless/ath/ath.h
+++ b/drivers/net/wireless/ath/ath.h
@@ -131,6 +131,7 @@ struct ath_bus_ops {
 	void (*read_cachesize)(struct ath_common *common, int *csz);
 	bool (*eeprom_read)(struct ath_common *common, u32 off, u16 *data);
 	void (*bt_coex_prep)(struct ath_common *common);
+	void (*extn_synch_en)(struct ath_common *common);
 };
 
 struct ath_common {
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 513ae64..b1d3c1e 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1984,6 +1984,11 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
 
 
 
+	if (AR_SREV_9485_10(ah)) {
+		pCap->pcie_lcr_extsync_en = true;
+		pCap->pcie_lcr_offset = 0x80;
+	}
+
 	return 0;
 }
 
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index bde1df3..1eb6a14 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -210,6 +210,8 @@ struct ath9k_hw_capabilities {
 	u8 rx_status_len;
 	u8 tx_desc_len;
 	u8 txs_len;
+	u16 pcie_lcr_offset;
+	bool pcie_lcr_extsync_en;
 };
 
 struct ath9k_ops_config {
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index f026a03..581dbd7 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1188,6 +1188,9 @@ static int ath9k_start(struct ieee80211_hw *hw)
 
 	pm_qos_update_request(&sc->pm_qos_req, 55);
 
+	if (ah->caps.pcie_lcr_extsync_en && common->bus_ops->extn_synch_en)
+		common->bus_ops->extn_synch_en(common);
+
 mutex_unlock:
 	mutex_unlock(&sc->mutex);
 
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 09f69a9..c5a523d 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -104,11 +104,23 @@ static void ath_pci_bt_coex_prep(struct ath_common *common)
 	pci_write_config_byte(pdev, ATH_PCIE_CAP_LINK_CTRL, aspm);
 }
 
+static void ath_pci_extn_synch_enable(struct ath_common *common)
+{
+	struct ath_softc *sc = (struct ath_softc *) common->priv;
+	struct pci_dev *pdev = to_pci_dev(sc->dev);
+	u8 lnkctl;
+
+	pci_read_config_byte(pdev, sc->sc_ah->caps.pcie_lcr_offset, &lnkctl);
+	lnkctl |= PCI_EXP_LNKCTL_ES;
+	pci_write_config_byte(pdev, sc->sc_ah->caps.pcie_lcr_offset, lnkctl);
+}
+
 static const struct ath_bus_ops ath_pci_bus_ops = {
 	.ath_bus_type = ATH_PCI,
 	.read_cachesize = ath_pci_read_cachesize,
 	.eeprom_read = ath_pci_eeprom_read,
 	.bt_coex_prep = ath_pci_bt_coex_prep,
+	.extn_synch_en = ath_pci_extn_synch_enable,
 };
 
 static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
-- 
1.7.0.4


  parent reply	other threads:[~2010-12-02 11:11 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-02 11:06 [PATCH V2 00/27] Add support for AR9485 Vasanthakumar Thiagarajan
2010-12-02 11:06 ` [PATCH V2 01/27] ath9k_hw: Define hw version macros " Vasanthakumar Thiagarajan
2010-12-02 11:06 ` [PATCH V2 02/27] ath9k_hw: Add initvals.h " Vasanthakumar Thiagarajan
2010-12-02 11:06 ` [PATCH V2 03/27] ath9k_hw: Enable hw initialization " Vasanthakumar Thiagarajan
2010-12-02 11:06 ` [PATCH V2 04/27] ath9k_hw: Initialize mode registers " Vasanthakumar Thiagarajan
2010-12-02 11:06 ` [PATCH V2 05/27] ath9k_hw: Initialize tx/rx gain table from initvals.h " Vasanthakumar Thiagarajan
2010-12-02 11:06 ` [PATCH V2 06/27] ath9k_hw: Eeeprom changes " Vasanthakumar Thiagarajan
2010-12-02 11:06 ` [PATCH V2 07/27] ath9k_hw: Disable LDPC " Vasanthakumar Thiagarajan
2010-12-02 11:06 ` [PATCH V2 08/27] ath9k: Disable TX STBC " Vasanthakumar Thiagarajan
2010-12-02 11:06 ` Vasanthakumar Thiagarajan [this message]
2010-12-02 11:06 ` [PATCH V2 10/27] ath9k_hw: Find the maximum number of chains that hw supports Vasanthakumar Thiagarajan
2010-12-02 11:06 ` [PATCH V2 11/27] ath9k_hw: Configure pll control for AR9485 Vasanthakumar Thiagarajan
2010-12-02 11:06 ` [PATCH V2 12/27] ath9k_hw: Find chansel of AR_PHY_65NM_CH0_SYNTH7 from an array " Vasanthakumar Thiagarajan
2010-12-03  1:45   ` Felix Fietkau
2010-12-03  4:50     ` Vasanthakumar Thiagarajan
2010-12-03 12:14       ` Felix Fietkau
2010-12-03 12:40         ` Vasanthakumar Thiagarajan
2010-12-03 12:48           ` Felix Fietkau
2010-12-06  6:03             ` Vasanthakumar Thiagarajan
2010-12-06 10:42               ` Felix Fietkau
2010-12-06 11:44                 ` Vasanthakumar Thiagarajan
2010-12-06 11:50                   ` Felix Fietkau
2010-12-06 11:54                     ` Vasanthakumar Thiagarajan
2010-12-06 11:51                   ` Johannes Berg
2010-12-02 11:06 ` [PATCH V2 13/27] ath9k_hw: Add a helper function to get spur channel pointer from cal data for AR9003 family Vasanthakumar Thiagarajan
2010-12-02 11:06 ` [PATCH V2 14/27] ath9k_hw: Read spur channel information from eeprom for AR9485 Vasanthakumar Thiagarajan
2010-12-02 11:06 ` [PATCH V2 15/27] ath9k_hw: Configure xpa bias level " Vasanthakumar Thiagarajan
2010-12-02 11:07 ` [PATCH V2 16/27] ath9k_hw: Read and configure antenna diversity control " Vasanthakumar Thiagarajan
2010-12-02 11:22   ` Julian Calaby
2010-12-02 12:09     ` Vasanthakumar Thiagarajan
2010-12-02 12:16       ` Julian Calaby
2010-12-02 12:21         ` Vasanthakumar Thiagarajan
2010-12-02 12:29           ` Julian Calaby
2010-12-02 11:07 ` [PATCH V2 17/27] ath9k_hw: Configure attenuation control only for supported chains Vasanthakumar Thiagarajan
2010-12-02 11:07 ` [PATCH V2 18/27] ath9k_hw: Configure internal regulator for AR9485 Vasanthakumar Thiagarajan
2010-12-02 11:07 ` [PATCH V2 19/27] ath9k_hw: Read and configure turnning caps to regulate freq accuracy Vasanthakumar Thiagarajan
2010-12-02 11:07 ` [PATCH V2 20/27] ath9k_hw: Configure power control only for the supported chains Vasanthakumar Thiagarajan
2010-12-02 11:07 ` [PATCH V2 21/27] ath9k_hw: Program appropriate chianmask for AR9485 before starting AGC/IQ cal Vasanthakumar Thiagarajan
2010-12-02 11:07 ` [PATCH V2 22/27] ath9k_hw: Define IQcal correction coefficient registers using index Vasanthakumar Thiagarajan
2010-12-02 11:07 ` [PATCH V2 23/27] ath9k_hw: Add IQ cal changes for AR9485 Vasanthakumar Thiagarajan
2010-12-02 11:07 ` [PATCH V2 24/27] ath9k_hw: Program appropriate register for temperature compensation cal " Vasanthakumar Thiagarajan
2010-12-02 11:07 ` [PATCH V2 25/27] ath9k_hw: Setup paprd only for supported chains Vasanthakumar Thiagarajan
2010-12-02 11:07 ` [PATCH V2 26/27] ath9k_hw: Disable MRC CCK for AR9485 Vasanthakumar Thiagarajan
2010-12-02 11:07 ` [PATCH V2 27/27] ath9k: Add device id of AR9485 to pci table Vasanthakumar Thiagarajan

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=1291288031-3409-10-git-send-email-vasanth@atheros.com \
    --to=vasanth@atheros.com \
    --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).