aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hw.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-10-07 15:40:44 -0400
committerDavid S. Miller <davem@davemloft.net>2013-10-07 15:40:44 -0400
commit7009deab19d7be03e05f67ceac56cfdfc73aa71c (patch)
tree106f789a079e606753809fad4290644a9310d62d /drivers/net/wireless/ath/ath9k/hw.c
parent5cde282938915f36a2e6769b51c24c4159654859 (diff)
parent274dede8c52036a1849ea970fab8d185fb0dce2b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
Conflicts: drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h drivers/net/wireless/rtlwifi/rtl8188ee/phy.h drivers/net/wireless/rtlwifi/rtl8192ce/phy.h drivers/net/wireless/rtlwifi/rtl8192de/phy.h drivers/net/wireless/rtlwifi/rtl8723ae/phy.h Just some minor conflicts between the wireless-next changes and Joe Perches's "extern" removal from function prototypes in header files. John W. Linville says: ==================== Regarding the Bluetooth bits, Gustavo says: "The big work here is from Marcel and Johan. They did a lot of work in the L2CAP, HCI and MGMT layers. The most important ones are the addition of a new MGMT command to enable/disable LE advertisement and the introduction of the HCI user channel to allow applications to get directly and exclusive access to Bluetooth devices." As to the ath10k bits, Kalle says: "Bartosz dropped support for qca98xx hw1.0 hardware from ath10k, it's just too much to support it. Michal added support for the new firmware interface. Marek fixed WEP in AP and IBSS mode. Rest of the changes are minor fixes or cleanups." And also: "Major changes are: * throughput improvements including aligning the RX frames correctly and optimising HTT layer (Michal) * remove qca98xx hw1.0 support (Bartosz) * add support for firmware version 999.999.0.636 (Michal) * firmware htt statistics support (Kalle) * fix WEP in AP and IBSS mode (Marek) * fix a mutex unlock balance in debugfs file (Shafi) And of course there's a lot of smaller fixes and cleanup." For the wl12xx bits, Luca says: "Here are some patches intended for 3.13. Eliad is upstreaming a bunch of patches that have been pending in the internal tree. Mostly bugfixes and other small improvements." Along with that... Arend and friends bring us a batch of brcmfmac updates, Larry Finger offers some rtlwifi refactoring, and Sujith sends the usual batch of ath9k updates. As usual, there are a number of other small updates from a variety of players as well. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c59
1 files changed, 42 insertions, 17 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index ecc6ec4a1edb..f11e8389a9be 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -549,6 +549,18 @@ static int ath9k_hw_post_init(struct ath_hw *ah)
549 549
550 ath9k_hw_ani_init(ah); 550 ath9k_hw_ani_init(ah);
551 551
552 /*
553 * EEPROM needs to be initialized before we do this.
554 * This is required for regulatory compliance.
555 */
556 if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) {
557 u16 regdmn = ah->eep_ops->get_eeprom(ah, EEP_REG_0);
558 if ((regdmn & 0xF0) == CTL_FCC) {
559 ah->nf_2g.max = AR_PHY_CCA_MAX_GOOD_VAL_9462_FCC_2GHZ;
560 ah->nf_5g.max = AR_PHY_CCA_MAX_GOOD_VAL_9462_FCC_5GHZ;
561 }
562 }
563
552 return 0; 564 return 0;
553} 565}
554 566
@@ -1644,6 +1656,19 @@ hang_check_iter:
1644 return true; 1656 return true;
1645} 1657}
1646 1658
1659void ath9k_hw_check_nav(struct ath_hw *ah)
1660{
1661 struct ath_common *common = ath9k_hw_common(ah);
1662 u32 val;
1663
1664 val = REG_READ(ah, AR_NAV);
1665 if (val != 0xdeadbeef && val > 0x7fff) {
1666 ath_dbg(common, BSTUCK, "Abnormal NAV: 0x%x\n", val);
1667 REG_WRITE(ah, AR_NAV, 0);
1668 }
1669}
1670EXPORT_SYMBOL(ath9k_hw_check_nav);
1671
1647bool ath9k_hw_check_alive(struct ath_hw *ah) 1672bool ath9k_hw_check_alive(struct ath_hw *ah)
1648{ 1673{
1649 int count = 50; 1674 int count = 50;
@@ -1822,9 +1847,9 @@ static int ath9k_hw_do_fastcc(struct ath_hw *ah, struct ath9k_channel *chan)
1822 * re-using are present. 1847 * re-using are present.
1823 */ 1848 */
1824 if (AR_SREV_9462(ah) && (ah->caldata && 1849 if (AR_SREV_9462(ah) && (ah->caldata &&
1825 (!ah->caldata->done_txiqcal_once || 1850 (!test_bit(TXIQCAL_DONE, &ah->caldata->cal_flags) ||
1826 !ah->caldata->done_txclcal_once || 1851 !test_bit(TXCLCAL_DONE, &ah->caldata->cal_flags) ||
1827 !ah->caldata->rtt_done))) 1852 !test_bit(RTT_DONE, &ah->caldata->cal_flags))))
1828 goto fail; 1853 goto fail;
1829 1854
1830 ath_dbg(common, RESET, "FastChannelChange for %d -> %d\n", 1855 ath_dbg(common, RESET, "FastChannelChange for %d -> %d\n",
@@ -1880,7 +1905,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
1880 memset(caldata, 0, sizeof(*caldata)); 1905 memset(caldata, 0, sizeof(*caldata));
1881 ath9k_init_nfcal_hist_buffer(ah, chan); 1906 ath9k_init_nfcal_hist_buffer(ah, chan);
1882 } else if (caldata) { 1907 } else if (caldata) {
1883 caldata->paprd_packet_sent = false; 1908 clear_bit(PAPRD_PACKET_SENT, &caldata->cal_flags);
1884 } 1909 }
1885 ah->noise = ath9k_hw_getchan_noise(ah, chan); 1910 ah->noise = ath9k_hw_getchan_noise(ah, chan);
1886 1911
@@ -2017,8 +2042,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
2017 ath9k_hw_init_bb(ah, chan); 2042 ath9k_hw_init_bb(ah, chan);
2018 2043
2019 if (caldata) { 2044 if (caldata) {
2020 caldata->done_txiqcal_once = false; 2045 clear_bit(TXIQCAL_DONE, &caldata->cal_flags);
2021 caldata->done_txclcal_once = false; 2046 clear_bit(TXCLCAL_DONE, &caldata->cal_flags);
2022 } 2047 }
2023 if (!ath9k_hw_init_cal(ah, chan)) 2048 if (!ath9k_hw_init_cal(ah, chan))
2024 return -EIO; 2049 return -EIO;
@@ -3240,19 +3265,19 @@ void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len)
3240 3265
3241 /* chipsets >= AR9280 are single-chip */ 3266 /* chipsets >= AR9280 are single-chip */
3242 if (AR_SREV_9280_20_OR_LATER(ah)) { 3267 if (AR_SREV_9280_20_OR_LATER(ah)) {
3243 used = snprintf(hw_name, len, 3268 used = scnprintf(hw_name, len,
3244 "Atheros AR%s Rev:%x", 3269 "Atheros AR%s Rev:%x",
3245 ath9k_hw_mac_bb_name(ah->hw_version.macVersion), 3270 ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
3246 ah->hw_version.macRev); 3271 ah->hw_version.macRev);
3247 } 3272 }
3248 else { 3273 else {
3249 used = snprintf(hw_name, len, 3274 used = scnprintf(hw_name, len,
3250 "Atheros AR%s MAC/BB Rev:%x AR%s RF Rev:%x", 3275 "Atheros AR%s MAC/BB Rev:%x AR%s RF Rev:%x",
3251 ath9k_hw_mac_bb_name(ah->hw_version.macVersion), 3276 ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
3252 ah->hw_version.macRev, 3277 ah->hw_version.macRev,
3253 ath9k_hw_rf_name((ah->hw_version.analog5GhzRev & 3278 ath9k_hw_rf_name((ah->hw_version.analog5GhzRev
3254 AR_RADIO_SREV_MAJOR)), 3279 & AR_RADIO_SREV_MAJOR)),
3255 ah->hw_version.phyRev); 3280 ah->hw_version.phyRev);
3256 } 3281 }
3257 3282
3258 hw_name[used] = '\0'; 3283 hw_name[used] = '\0';