diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2013-12-24 00:14:23 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-01-03 15:36:57 -0500 |
commit | d88527d3d3d6e3c46688878c7fc082ae42fa766e (patch) | |
tree | a2395936ea69cd5c5692488aedb386cebb197aeb /drivers/net/wireless | |
parent | a6bb860be4808d994410a0d945b351e5b56046e9 (diff) |
ath9k: Identify baseband watchdog signatures
A full HW reset is not required for all baseband watchdog
signatures. Some BB watchdog updates are benign and can
be discarded, some require re-programming of certain registers
and others require a chip reset.
This patch adds a routine to identify such signatures.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_phy.c | 62 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_phy.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 1 |
3 files changed, 65 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index b0203318e50c..9b1494cc0e2b 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -1814,6 +1814,68 @@ void ar9003_hw_attach_phy_ops(struct ath_hw *ah) | |||
1814 | memcpy(ah->nf_regs, ar9300_cca_regs, sizeof(ah->nf_regs)); | 1814 | memcpy(ah->nf_regs, ar9300_cca_regs, sizeof(ah->nf_regs)); |
1815 | } | 1815 | } |
1816 | 1816 | ||
1817 | /* | ||
1818 | * Baseband Watchdog signatures: | ||
1819 | * | ||
1820 | * 0x04000539: BB hang when operating in HT40 DFS Channel. | ||
1821 | * Full chip reset is not required, but a recovery | ||
1822 | * mechanism is needed. | ||
1823 | * | ||
1824 | * 0x1300000a: Related to CAC deafness. | ||
1825 | * Chip reset is not required. | ||
1826 | * | ||
1827 | * 0x0400000a: Related to CAC deafness. | ||
1828 | * Full chip reset is required. | ||
1829 | * | ||
1830 | * 0x04000b09: RX state machine gets into an illegal state | ||
1831 | * when a packet with unsupported rate is received. | ||
1832 | * Full chip reset is required and PHY_RESTART has | ||
1833 | * to be disabled. | ||
1834 | * | ||
1835 | * 0x04000409: Packet stuck on receive. | ||
1836 | * Full chip reset is required for all chips except AR9340. | ||
1837 | */ | ||
1838 | |||
1839 | /* | ||
1840 | * ar9003_hw_bb_watchdog_check(): Returns true if a chip reset is required. | ||
1841 | */ | ||
1842 | bool ar9003_hw_bb_watchdog_check(struct ath_hw *ah) | ||
1843 | { | ||
1844 | u32 val; | ||
1845 | |||
1846 | switch(ah->bb_watchdog_last_status) { | ||
1847 | case 0x04000539: | ||
1848 | val = REG_READ(ah, AR_PHY_RADAR_0); | ||
1849 | val &= (~AR_PHY_RADAR_0_FIRPWR); | ||
1850 | val |= SM(0x7f, AR_PHY_RADAR_0_FIRPWR); | ||
1851 | REG_WRITE(ah, AR_PHY_RADAR_0, val); | ||
1852 | udelay(1); | ||
1853 | val = REG_READ(ah, AR_PHY_RADAR_0); | ||
1854 | val &= ~AR_PHY_RADAR_0_FIRPWR; | ||
1855 | val |= SM(AR9300_DFS_FIRPWR, AR_PHY_RADAR_0_FIRPWR); | ||
1856 | REG_WRITE(ah, AR_PHY_RADAR_0, val); | ||
1857 | |||
1858 | return false; | ||
1859 | case 0x1300000a: | ||
1860 | return false; | ||
1861 | case 0x0400000a: | ||
1862 | case 0x04000b09: | ||
1863 | return true; | ||
1864 | case 0x04000409: | ||
1865 | if (AR_SREV_9340(ah)) | ||
1866 | return false; | ||
1867 | else | ||
1868 | return true; | ||
1869 | default: | ||
1870 | /* | ||
1871 | * For any other unknown signatures, do a | ||
1872 | * full chip reset. | ||
1873 | */ | ||
1874 | return true; | ||
1875 | } | ||
1876 | } | ||
1877 | EXPORT_SYMBOL(ar9003_hw_bb_watchdog_check); | ||
1878 | |||
1817 | void ar9003_hw_bb_watchdog_config(struct ath_hw *ah) | 1879 | void ar9003_hw_bb_watchdog_config(struct ath_hw *ah) |
1818 | { | 1880 | { |
1819 | struct ath_common *common = ath9k_hw_common(ah); | 1881 | struct ath_common *common = ath9k_hw_common(ah); |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.h b/drivers/net/wireless/ath/ath9k/ar9003_phy.h index 1b441715ba39..94a8598d0e95 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h | |||
@@ -1334,4 +1334,6 @@ | |||
1334 | #define AR_PHY_65NM_RXRF_AGC_AGC_OUT 0x00000004 | 1334 | #define AR_PHY_65NM_RXRF_AGC_AGC_OUT 0x00000004 |
1335 | #define AR_PHY_65NM_RXRF_AGC_AGC_OUT_S 2 | 1335 | #define AR_PHY_65NM_RXRF_AGC_AGC_OUT_S 2 |
1336 | 1336 | ||
1337 | #define AR9300_DFS_FIRPWR -28 | ||
1338 | |||
1337 | #endif /* AR9003_PHY_H */ | 1339 | #endif /* AR9003_PHY_H */ |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index cb930d680392..76325094c009 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -1044,6 +1044,7 @@ void ar9002_hw_enable_async_fifo(struct ath_hw *ah); | |||
1044 | * Code specific to AR9003, we stuff these here to avoid callbacks | 1044 | * Code specific to AR9003, we stuff these here to avoid callbacks |
1045 | * for older families | 1045 | * for older families |
1046 | */ | 1046 | */ |
1047 | bool ar9003_hw_bb_watchdog_check(struct ath_hw *ah); | ||
1047 | void ar9003_hw_bb_watchdog_config(struct ath_hw *ah); | 1048 | void ar9003_hw_bb_watchdog_config(struct ath_hw *ah); |
1048 | void ar9003_hw_bb_watchdog_read(struct ath_hw *ah); | 1049 | void ar9003_hw_bb_watchdog_read(struct ath_hw *ah); |
1049 | void ar9003_hw_bb_watchdog_dbg_info(struct ath_hw *ah); | 1050 | void ar9003_hw_bb_watchdog_dbg_info(struct ath_hw *ah); |