diff options
author | Rajkumar Manoharan <rmanohar@qca.qualcomm.com> | 2011-10-13 01:30:35 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-10-14 14:48:21 -0400 |
commit | 5f0c04ea1e7394c2b28fa247c1722487f9a77523 (patch) | |
tree | 9fda529d8f452955210869418d78ad123308e1b9 /drivers/net/wireless/ath/ath9k/hw.c | |
parent | a240dc7b3c7463bd60cf0a9b2a90f52f78aae0fd (diff) |
ath9k_hw: Improve fast channel change for AR9003 chips
In order to reduce the overall scan time, fast channel change
should be implemented properly. This patch adds fast channel
change support across band switch or channel mode switch
instead of doing full chip reset. During the fastcc, tx iqcal
measurements are preserved and will be reloaded after successful
the channel change.
This patch also addressed fast channel issue where the STA can not
see APs in higher than operating channel on 5GHz band after
the association.
Cc: Paul Stewart <pstew@google.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 58794a4e40ad..e51d93d33d5f 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -1394,6 +1394,14 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah, | |||
1394 | struct ath_common *common = ath9k_hw_common(ah); | 1394 | struct ath_common *common = ath9k_hw_common(ah); |
1395 | u32 qnum; | 1395 | u32 qnum; |
1396 | int r; | 1396 | int r; |
1397 | bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA); | ||
1398 | bool band_switch, mode_diff; | ||
1399 | u8 ini_reloaded; | ||
1400 | |||
1401 | band_switch = (chan->channelFlags & (CHANNEL_2GHZ | CHANNEL_5GHZ)) != | ||
1402 | (ah->curchan->channelFlags & (CHANNEL_2GHZ | | ||
1403 | CHANNEL_5GHZ)); | ||
1404 | mode_diff = (chan->chanmode != ah->curchan->chanmode); | ||
1397 | 1405 | ||
1398 | for (qnum = 0; qnum < AR_NUM_QCU; qnum++) { | 1406 | for (qnum = 0; qnum < AR_NUM_QCU; qnum++) { |
1399 | if (ath9k_hw_numtxpending(ah, qnum)) { | 1407 | if (ath9k_hw_numtxpending(ah, qnum)) { |
@@ -1408,6 +1416,18 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah, | |||
1408 | return false; | 1416 | return false; |
1409 | } | 1417 | } |
1410 | 1418 | ||
1419 | if (edma && (band_switch || mode_diff)) { | ||
1420 | ath9k_hw_mark_phy_inactive(ah); | ||
1421 | udelay(5); | ||
1422 | |||
1423 | ath9k_hw_init_pll(ah, NULL); | ||
1424 | |||
1425 | if (ath9k_hw_fast_chan_change(ah, chan, &ini_reloaded)) { | ||
1426 | ath_err(common, "Failed to do fast channel change\n"); | ||
1427 | return false; | ||
1428 | } | ||
1429 | } | ||
1430 | |||
1411 | ath9k_hw_set_channel_regs(ah, chan); | 1431 | ath9k_hw_set_channel_regs(ah, chan); |
1412 | 1432 | ||
1413 | r = ath9k_hw_rf_set_freq(ah, chan); | 1433 | r = ath9k_hw_rf_set_freq(ah, chan); |
@@ -1424,6 +1444,16 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah, | |||
1424 | 1444 | ||
1425 | ath9k_hw_spur_mitigate_freq(ah, chan); | 1445 | ath9k_hw_spur_mitigate_freq(ah, chan); |
1426 | 1446 | ||
1447 | if (edma && (band_switch || mode_diff)) { | ||
1448 | if (band_switch || ini_reloaded) | ||
1449 | ah->eep_ops->set_board_values(ah, chan); | ||
1450 | |||
1451 | ath9k_hw_init_bb(ah, chan); | ||
1452 | |||
1453 | if (band_switch || ini_reloaded) | ||
1454 | ath9k_hw_init_cal(ah, chan); | ||
1455 | } | ||
1456 | |||
1427 | return true; | 1457 | return true; |
1428 | } | 1458 | } |
1429 | 1459 | ||
@@ -1677,6 +1707,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
1677 | 1707 | ||
1678 | ath9k_hw_init_bb(ah, chan); | 1708 | ath9k_hw_init_bb(ah, chan); |
1679 | 1709 | ||
1710 | if (caldata) | ||
1711 | caldata->done_txiqcal_once = false; | ||
1680 | if (!ath9k_hw_init_cal(ah, chan)) | 1712 | if (!ath9k_hw_init_cal(ah, chan)) |
1681 | return -EIO; | 1713 | return -EIO; |
1682 | 1714 | ||