diff options
Diffstat (limited to 'drivers/net/wireless/ath')
32 files changed, 421 insertions, 328 deletions
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c index 0312cee39570..2e9b330f6413 100644 --- a/drivers/net/wireless/ath/ar9170/main.c +++ b/drivers/net/wireless/ath/ar9170/main.c | |||
@@ -927,7 +927,6 @@ static void ar9170_rx_phy_status(struct ar9170 *ar, | |||
927 | 927 | ||
928 | /* TODO: we could do something with phy_errors */ | 928 | /* TODO: we could do something with phy_errors */ |
929 | status->signal = ar->noise[0] + phy->rssi_combined; | 929 | status->signal = ar->noise[0] + phy->rssi_combined; |
930 | status->noise = ar->noise[0]; | ||
931 | } | 930 | } |
932 | 931 | ||
933 | static struct sk_buff *ar9170_rx_copy_data(u8 *buf, int len) | 932 | static struct sk_buff *ar9170_rx_copy_data(u8 *buf, int len) |
@@ -2548,8 +2547,7 @@ void *ar9170_alloc(size_t priv_size) | |||
2548 | BIT(NL80211_IFTYPE_ADHOC); | 2547 | BIT(NL80211_IFTYPE_ADHOC); |
2549 | ar->hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS | | 2548 | ar->hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS | |
2550 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | | 2549 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | |
2551 | IEEE80211_HW_SIGNAL_DBM | | 2550 | IEEE80211_HW_SIGNAL_DBM; |
2552 | IEEE80211_HW_NOISE_DBM; | ||
2553 | 2551 | ||
2554 | if (modparam_ht) { | 2552 | if (modparam_ht) { |
2555 | ar->hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION; | 2553 | ar->hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION; |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index c274979ada3a..7f5953fac434 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -548,8 +548,7 @@ ath5k_pci_probe(struct pci_dev *pdev, | |||
548 | SET_IEEE80211_DEV(hw, &pdev->dev); | 548 | SET_IEEE80211_DEV(hw, &pdev->dev); |
549 | hw->flags = IEEE80211_HW_RX_INCLUDES_FCS | | 549 | hw->flags = IEEE80211_HW_RX_INCLUDES_FCS | |
550 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | | 550 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | |
551 | IEEE80211_HW_SIGNAL_DBM | | 551 | IEEE80211_HW_SIGNAL_DBM; |
552 | IEEE80211_HW_NOISE_DBM; | ||
553 | 552 | ||
554 | hw->wiphy->interface_modes = | 553 | hw->wiphy->interface_modes = |
555 | BIT(NL80211_IFTYPE_AP) | | 554 | BIT(NL80211_IFTYPE_AP) | |
@@ -2030,8 +2029,7 @@ accept: | |||
2030 | rxs->freq = sc->curchan->center_freq; | 2029 | rxs->freq = sc->curchan->center_freq; |
2031 | rxs->band = sc->curband->band; | 2030 | rxs->band = sc->curband->band; |
2032 | 2031 | ||
2033 | rxs->noise = sc->ah->ah_noise_floor; | 2032 | rxs->signal = sc->ah->ah_noise_floor + rs.rs_rssi; |
2034 | rxs->signal = rxs->noise + rs.rs_rssi; | ||
2035 | 2033 | ||
2036 | rxs->antenna = rs.rs_antenna; | 2034 | rxs->antenna = rs.rs_antenna; |
2037 | 2035 | ||
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c index cec62d311c78..ba8b20f01594 100644 --- a/drivers/net/wireless/ath/ath9k/ani.c +++ b/drivers/net/wireless/ath/ath9k/ani.c | |||
@@ -657,12 +657,3 @@ void ath9k_hw_ani_init(struct ath_hw *ah) | |||
657 | if (ah->config.enable_ani) | 657 | if (ah->config.enable_ani) |
658 | ah->proc_phyerr |= HAL_PROCESS_ANI; | 658 | ah->proc_phyerr |= HAL_PROCESS_ANI; |
659 | } | 659 | } |
660 | |||
661 | void ath9k_hw_ani_disable(struct ath_hw *ah) | ||
662 | { | ||
663 | ath_print(ath9k_hw_common(ah), ATH_DBG_ANI, "Disabling ANI\n"); | ||
664 | |||
665 | ath9k_hw_disable_mib_counters(ah); | ||
666 | REG_WRITE(ah, AR_PHY_ERR_1, 0); | ||
667 | REG_WRITE(ah, AR_PHY_ERR_2, 0); | ||
668 | } | ||
diff --git a/drivers/net/wireless/ath/ath9k/ani.h b/drivers/net/wireless/ath/ath9k/ani.h index 4e1ab94a5153..3356762ea384 100644 --- a/drivers/net/wireless/ath/ath9k/ani.h +++ b/drivers/net/wireless/ath/ath9k/ani.h | |||
@@ -118,6 +118,5 @@ u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah, u32 *rxc_pcnt, | |||
118 | void ath9k_hw_procmibevent(struct ath_hw *ah); | 118 | void ath9k_hw_procmibevent(struct ath_hw *ah); |
119 | void ath9k_hw_ani_setup(struct ath_hw *ah); | 119 | void ath9k_hw_ani_setup(struct ath_hw *ah); |
120 | void ath9k_hw_ani_init(struct ath_hw *ah); | 120 | void ath9k_hw_ani_init(struct ath_hw *ah); |
121 | void ath9k_hw_ani_disable(struct ath_hw *ah); | ||
122 | 121 | ||
123 | #endif /* ANI_H */ | 122 | #endif /* ANI_H */ |
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_initvals.h b/drivers/net/wireless/ath/ath9k/ar5008_initvals.h index cd953f6c4628..025c31ac6146 100644 --- a/drivers/net/wireless/ath/ath9k/ar5008_initvals.h +++ b/drivers/net/wireless/ath/ath9k/ar5008_initvals.h | |||
@@ -249,7 +249,7 @@ static const u32 ar5416Common[][2] = { | |||
249 | { 0x00008258, 0x00000000 }, | 249 | { 0x00008258, 0x00000000 }, |
250 | { 0x0000825c, 0x400000ff }, | 250 | { 0x0000825c, 0x400000ff }, |
251 | { 0x00008260, 0x00080922 }, | 251 | { 0x00008260, 0x00080922 }, |
252 | { 0x00008264, 0xa8000010 }, | 252 | { 0x00008264, 0x88000010 }, |
253 | { 0x00008270, 0x00000000 }, | 253 | { 0x00008270, 0x00000000 }, |
254 | { 0x00008274, 0x40000000 }, | 254 | { 0x00008274, 0x40000000 }, |
255 | { 0x00008278, 0x003e4180 }, | 255 | { 0x00008278, 0x003e4180 }, |
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c index de8ce1291a46..b2c17c98bb38 100644 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c | |||
@@ -850,7 +850,7 @@ static int ar5008_hw_process_ini(struct ath_hw *ah, | |||
850 | 850 | ||
851 | REG_WRITE_ARRAY(&ah->iniBB_RfGain, freqIndex, regWrites); | 851 | REG_WRITE_ARRAY(&ah->iniBB_RfGain, freqIndex, regWrites); |
852 | 852 | ||
853 | if (AR_SREV_9280_20(ah) && IS_CHAN_A_5MHZ_SPACED(chan)) { | 853 | if (IS_CHAN_A_FAST_CLOCK(ah, chan)) { |
854 | REG_WRITE_ARRAY(&ah->iniModesAdditional, modesIndex, | 854 | REG_WRITE_ARRAY(&ah->iniModesAdditional, modesIndex, |
855 | regWrites); | 855 | regWrites); |
856 | } | 856 | } |
@@ -892,8 +892,7 @@ static void ar5008_hw_set_rfmode(struct ath_hw *ah, struct ath9k_channel *chan) | |||
892 | rfMode |= (IS_CHAN_5GHZ(chan)) ? | 892 | rfMode |= (IS_CHAN_5GHZ(chan)) ? |
893 | AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ; | 893 | AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ; |
894 | 894 | ||
895 | if ((AR_SREV_9280_20(ah) || AR_SREV_9300_20_OR_LATER(ah)) | 895 | if (IS_CHAN_A_FAST_CLOCK(ah, chan)) |
896 | && IS_CHAN_A_5MHZ_SPACED(chan)) | ||
897 | rfMode |= (AR_PHY_MODE_DYNAMIC | AR_PHY_MODE_DYN_CCK_DISABLE); | 896 | rfMode |= (AR_PHY_MODE_DYNAMIC | AR_PHY_MODE_DYN_CCK_DISABLE); |
898 | 897 | ||
899 | REG_WRITE(ah, AR_PHY_MODE, rfMode); | 898 | REG_WRITE(ah, AR_PHY_MODE, rfMode); |
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c index adb33b34a56d..a8a8cdc04afa 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c | |||
@@ -408,6 +408,8 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah, | |||
408 | REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000); | 408 | REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000); |
409 | 409 | ||
410 | } else { | 410 | } else { |
411 | ENABLE_REGWRITE_BUFFER(ah); | ||
412 | |||
411 | REG_WRITE(ah, AR_PCIE_SERDES, 0x9248fc00); | 413 | REG_WRITE(ah, AR_PCIE_SERDES, 0x9248fc00); |
412 | REG_WRITE(ah, AR_PCIE_SERDES, 0x24924924); | 414 | REG_WRITE(ah, AR_PCIE_SERDES, 0x24924924); |
413 | 415 | ||
@@ -428,6 +430,9 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah, | |||
428 | 430 | ||
429 | /* Load the new settings */ | 431 | /* Load the new settings */ |
430 | REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000); | 432 | REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000); |
433 | |||
434 | REGWRITE_BUFFER_FLUSH(ah); | ||
435 | DISABLE_REGWRITE_BUFFER(ah); | ||
431 | } | 436 | } |
432 | 437 | ||
433 | udelay(1000); | 438 | udelay(1000); |
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_initvals.h b/drivers/net/wireless/ath/ath9k/ar9002_initvals.h index f06313d3bad6..dae7f3304eb8 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_initvals.h +++ b/drivers/net/wireless/ath/ath9k/ar9002_initvals.h | |||
@@ -793,7 +793,7 @@ static const u32 ar9280Common_9280_2[][2] = { | |||
793 | { 0x00008258, 0x00000000 }, | 793 | { 0x00008258, 0x00000000 }, |
794 | { 0x0000825c, 0x400000ff }, | 794 | { 0x0000825c, 0x400000ff }, |
795 | { 0x00008260, 0x00080922 }, | 795 | { 0x00008260, 0x00080922 }, |
796 | { 0x00008264, 0xa8a00010 }, | 796 | { 0x00008264, 0x88a00010 }, |
797 | { 0x00008270, 0x00000000 }, | 797 | { 0x00008270, 0x00000000 }, |
798 | { 0x00008274, 0x40000000 }, | 798 | { 0x00008274, 0x40000000 }, |
799 | { 0x00008278, 0x003e4180 }, | 799 | { 0x00008278, 0x003e4180 }, |
@@ -1963,7 +1963,7 @@ static const u32 ar9285Common_9285[][2] = { | |||
1963 | { 0x00008258, 0x00000000 }, | 1963 | { 0x00008258, 0x00000000 }, |
1964 | { 0x0000825c, 0x400000ff }, | 1964 | { 0x0000825c, 0x400000ff }, |
1965 | { 0x00008260, 0x00080922 }, | 1965 | { 0x00008260, 0x00080922 }, |
1966 | { 0x00008264, 0xa8a00010 }, | 1966 | { 0x00008264, 0x88a00010 }, |
1967 | { 0x00008270, 0x00000000 }, | 1967 | { 0x00008270, 0x00000000 }, |
1968 | { 0x00008274, 0x40000000 }, | 1968 | { 0x00008274, 0x40000000 }, |
1969 | { 0x00008278, 0x003e4180 }, | 1969 | { 0x00008278, 0x003e4180 }, |
@@ -3185,7 +3185,7 @@ static const u32 ar9287Common_9287_1_0[][2] = { | |||
3185 | { 0x00008258, 0x00000000 }, | 3185 | { 0x00008258, 0x00000000 }, |
3186 | { 0x0000825c, 0x400000ff }, | 3186 | { 0x0000825c, 0x400000ff }, |
3187 | { 0x00008260, 0x00080922 }, | 3187 | { 0x00008260, 0x00080922 }, |
3188 | { 0x00008264, 0xa8a00010 }, | 3188 | { 0x00008264, 0x88a00010 }, |
3189 | { 0x00008270, 0x00000000 }, | 3189 | { 0x00008270, 0x00000000 }, |
3190 | { 0x00008274, 0x40000000 }, | 3190 | { 0x00008274, 0x40000000 }, |
3191 | { 0x00008278, 0x003e4180 }, | 3191 | { 0x00008278, 0x003e4180 }, |
@@ -4973,7 +4973,7 @@ static const u32 ar9271Common_9271[][2] = { | |||
4973 | { 0x00008258, 0x00000000 }, | 4973 | { 0x00008258, 0x00000000 }, |
4974 | { 0x0000825c, 0x400000ff }, | 4974 | { 0x0000825c, 0x400000ff }, |
4975 | { 0x00008260, 0x00080922 }, | 4975 | { 0x00008260, 0x00080922 }, |
4976 | { 0x00008264, 0xa8a00010 }, | 4976 | { 0x00008264, 0x88a00010 }, |
4977 | { 0x00008270, 0x00000000 }, | 4977 | { 0x00008270, 0x00000000 }, |
4978 | { 0x00008274, 0x40000000 }, | 4978 | { 0x00008274, 0x40000000 }, |
4979 | { 0x00008278, 0x003e4180 }, | 4979 | { 0x00008278, 0x003e4180 }, |
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_phy.c b/drivers/net/wireless/ath/ath9k/ar9002_phy.c index 18cfe1a9781c..ed314e89bfe1 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_phy.c | |||
@@ -455,16 +455,12 @@ static u32 ar9002_hw_compute_pll_control(struct ath_hw *ah, | |||
455 | pll |= SM(0x2, AR_RTC_9160_PLL_CLKSEL); | 455 | pll |= SM(0x2, AR_RTC_9160_PLL_CLKSEL); |
456 | 456 | ||
457 | if (chan && IS_CHAN_5GHZ(chan)) { | 457 | if (chan && IS_CHAN_5GHZ(chan)) { |
458 | pll |= SM(0x28, AR_RTC_9160_PLL_DIV); | 458 | if (IS_CHAN_A_FAST_CLOCK(ah, chan)) |
459 | 459 | pll = 0x142c; | |
460 | 460 | else if (AR_SREV_9280_20(ah)) | |
461 | if (AR_SREV_9280_20(ah)) { | 461 | pll = 0x2850; |
462 | if (((chan->channel % 20) == 0) | 462 | else |
463 | || ((chan->channel % 10) == 0)) | 463 | pll |= SM(0x28, AR_RTC_9160_PLL_DIV); |
464 | pll = 0x2850; | ||
465 | else | ||
466 | pll = 0x142c; | ||
467 | } | ||
468 | } else { | 464 | } else { |
469 | pll |= SM(0x2c, AR_RTC_9160_PLL_DIV); | 465 | pll |= SM(0x2c, AR_RTC_9160_PLL_DIV); |
470 | } | 466 | } |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c index 5e20b4860c7f..5fcafb460877 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c | |||
@@ -755,7 +755,8 @@ static bool ar9003_hw_init_cal(struct ath_hw *ah, | |||
755 | } | 755 | } |
756 | 756 | ||
757 | /* Do Tx IQ Calibration */ | 757 | /* Do Tx IQ Calibration */ |
758 | ar9003_hw_tx_iq_cal(ah); | 758 | if (ah->config.tx_iq_calibration) |
759 | ar9003_hw_tx_iq_cal(ah); | ||
759 | 760 | ||
760 | /* Revert chainmasks to their original values before NF cal */ | 761 | /* Revert chainmasks to their original values before NF cal */ |
761 | ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask); | 762 | ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask); |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index 5d92be47c5a5..8a79550dff71 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | |||
@@ -659,6 +659,9 @@ static void ar9300_swap_eeprom(struct ar9300_eeprom *eep) | |||
659 | word = swab16(eep->baseEepHeader.regDmn[1]); | 659 | word = swab16(eep->baseEepHeader.regDmn[1]); |
660 | eep->baseEepHeader.regDmn[1] = word; | 660 | eep->baseEepHeader.regDmn[1] = word; |
661 | 661 | ||
662 | dword = swab32(eep->baseEepHeader.swreg); | ||
663 | eep->baseEepHeader.swreg = dword; | ||
664 | |||
662 | dword = swab32(eep->modalHeader2G.antCtrlCommon); | 665 | dword = swab32(eep->modalHeader2G.antCtrlCommon); |
663 | eep->modalHeader2G.antCtrlCommon = dword; | 666 | eep->modalHeader2G.antCtrlCommon = dword; |
664 | 667 | ||
@@ -1200,7 +1203,7 @@ static u8 ar9003_hw_eeprom_get_tgt_pwr(struct ath_hw *ah, | |||
1200 | u8 *pFreqBin; | 1203 | u8 *pFreqBin; |
1201 | 1204 | ||
1202 | if (is2GHz) { | 1205 | if (is2GHz) { |
1203 | numPiers = AR9300_NUM_5G_20_TARGET_POWERS; | 1206 | numPiers = AR9300_NUM_2G_20_TARGET_POWERS; |
1204 | pEepromTargetPwr = eep->calTargetPower2G; | 1207 | pEepromTargetPwr = eep->calTargetPower2G; |
1205 | pFreqBin = eep->calTarget_freqbin_2G; | 1208 | pFreqBin = eep->calTarget_freqbin_2G; |
1206 | } else { | 1209 | } else { |
@@ -1236,7 +1239,7 @@ static u8 ar9003_hw_eeprom_get_ht20_tgt_pwr(struct ath_hw *ah, | |||
1236 | u8 *pFreqBin; | 1239 | u8 *pFreqBin; |
1237 | 1240 | ||
1238 | if (is2GHz) { | 1241 | if (is2GHz) { |
1239 | numPiers = AR9300_NUM_5G_20_TARGET_POWERS; | 1242 | numPiers = AR9300_NUM_2G_20_TARGET_POWERS; |
1240 | pEepromTargetPwr = eep->calTargetPower2GHT20; | 1243 | pEepromTargetPwr = eep->calTargetPower2GHT20; |
1241 | pFreqBin = eep->calTarget_freqbin_2GHT20; | 1244 | pFreqBin = eep->calTarget_freqbin_2GHT20; |
1242 | } else { | 1245 | } else { |
@@ -1817,6 +1820,7 @@ static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah, | |||
1817 | u8 twiceMaxRegulatoryPower, | 1820 | u8 twiceMaxRegulatoryPower, |
1818 | u8 powerLimit) | 1821 | u8 powerLimit) |
1819 | { | 1822 | { |
1823 | ah->txpower_limit = powerLimit; | ||
1820 | ar9003_hw_set_target_power_eeprom(ah, chan->channel); | 1824 | ar9003_hw_set_target_power_eeprom(ah, chan->channel); |
1821 | ar9003_hw_calibration_apply(ah, chan->channel); | 1825 | ar9003_hw_calibration_apply(ah, chan->channel); |
1822 | } | 1826 | } |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h index 5fe335e22c89..d8c0318f416f 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | |||
@@ -265,7 +265,7 @@ struct cal_ctl_edge_pwr { | |||
265 | } __packed; | 265 | } __packed; |
266 | 266 | ||
267 | struct cal_ctl_data_2g { | 267 | struct cal_ctl_data_2g { |
268 | struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_5G]; | 268 | struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_2G]; |
269 | } __packed; | 269 | } __packed; |
270 | 270 | ||
271 | struct cal_ctl_data_5g { | 271 | struct cal_ctl_data_5g { |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_initvals.h b/drivers/net/wireless/ath/ath9k/ar9003_initvals.h index e0391b12e533..a131cd10ef29 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_initvals.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_initvals.h | |||
@@ -31,7 +31,7 @@ static const u32 ar9300_2p0_radio_postamble[][5] = { | |||
31 | 31 | ||
32 | static const u32 ar9300Modes_lowest_ob_db_tx_gain_table_2p0[][5] = { | 32 | static const u32 ar9300Modes_lowest_ob_db_tx_gain_table_2p0[][5] = { |
33 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ | 33 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ |
34 | {0x0000a410, 0x000050da, 0x000050da, 0x000050da, 0x000050da}, | 34 | {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, |
35 | {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | 35 | {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
36 | {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002}, | 36 | {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002}, |
37 | {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004}, | 37 | {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004}, |
@@ -545,7 +545,7 @@ static const u32 ar9300_2p0_soc_postamble[][5] = { | |||
545 | }; | 545 | }; |
546 | 546 | ||
547 | static const u32 ar9200_merlin_2p0_radio_core[][2] = { | 547 | static const u32 ar9200_merlin_2p0_radio_core[][2] = { |
548 | /* Addr common */ | 548 | /* Addr allmodes */ |
549 | {0x00007800, 0x00040000}, | 549 | {0x00007800, 0x00040000}, |
550 | {0x00007804, 0xdb005012}, | 550 | {0x00007804, 0xdb005012}, |
551 | {0x00007808, 0x04924914}, | 551 | {0x00007808, 0x04924914}, |
@@ -835,71 +835,71 @@ static const u32 ar9300_2p0_baseband_core[][2] = { | |||
835 | 835 | ||
836 | static const u32 ar9300Modes_high_power_tx_gain_table_2p0[][5] = { | 836 | static const u32 ar9300Modes_high_power_tx_gain_table_2p0[][5] = { |
837 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ | 837 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ |
838 | {0x0000a410, 0x000050d9, 0x000050d9, 0x000050da, 0x000050da}, | 838 | {0x0000a410, 0x000050db, 0x000050db, 0x000050d9, 0x000050d9}, |
839 | {0x0000a500, 0x00020220, 0x00020220, 0x00000000, 0x00000000}, | 839 | {0x0000a500, 0x00020220, 0x00020220, 0x00000000, 0x00000000}, |
840 | {0x0000a504, 0x06020223, 0x06020223, 0x04000002, 0x04000002}, | 840 | {0x0000a504, 0x06020223, 0x06020223, 0x04000002, 0x04000002}, |
841 | {0x0000a508, 0x0b022220, 0x0b022220, 0x08000004, 0x08000004}, | 841 | {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004}, |
842 | {0x0000a50c, 0x10022223, 0x10022223, 0x0b000200, 0x0b000200}, | 842 | {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200}, |
843 | {0x0000a510, 0x17022620, 0x17022620, 0x0f000202, 0x0f000202}, | 843 | {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202}, |
844 | {0x0000a514, 0x1b022622, 0x1b022622, 0x11000400, 0x11000400}, | 844 | {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400}, |
845 | {0x0000a518, 0x1f022822, 0x1f022822, 0x15000402, 0x15000402}, | 845 | {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402}, |
846 | {0x0000a51c, 0x24022842, 0x24022842, 0x19000404, 0x19000404}, | 846 | {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404}, |
847 | {0x0000a520, 0x28042840, 0x28042840, 0x1b000603, 0x1b000603}, | 847 | {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603}, |
848 | {0x0000a524, 0x2c042842, 0x2c042842, 0x1f000a02, 0x1f000a02}, | 848 | {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02}, |
849 | {0x0000a528, 0x30042844, 0x30042844, 0x23000a04, 0x23000a04}, | 849 | {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04}, |
850 | {0x0000a52c, 0x34042846, 0x34042846, 0x26000a20, 0x26000a20}, | 850 | {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20}, |
851 | {0x0000a530, 0x39042869, 0x39042869, 0x2a000e20, 0x2a000e20}, | 851 | {0x0000a530, 0x34043643, 0x34043643, 0x2a000e20, 0x2a000e20}, |
852 | {0x0000a534, 0x3d062869, 0x3d062869, 0x2e000e22, 0x2e000e22}, | 852 | {0x0000a534, 0x38043a44, 0x38043a44, 0x2e000e22, 0x2e000e22}, |
853 | {0x0000a538, 0x44062c69, 0x44062c69, 0x31000e24, 0x31000e24}, | 853 | {0x0000a538, 0x3b043e45, 0x3b043e45, 0x31000e24, 0x31000e24}, |
854 | {0x0000a53c, 0x48063069, 0x48063069, 0x34001640, 0x34001640}, | 854 | {0x0000a53c, 0x40063e46, 0x40063e46, 0x34001640, 0x34001640}, |
855 | {0x0000a540, 0x4c0a3065, 0x4c0a3065, 0x38001660, 0x38001660}, | 855 | {0x0000a540, 0x44083e46, 0x44083e46, 0x38001660, 0x38001660}, |
856 | {0x0000a544, 0x500a3069, 0x500a3069, 0x3b001861, 0x3b001861}, | 856 | {0x0000a544, 0x46083e66, 0x46083e66, 0x3b001861, 0x3b001861}, |
857 | {0x0000a548, 0x530a3469, 0x530a3469, 0x3e001a81, 0x3e001a81}, | 857 | {0x0000a548, 0x4b0a3e69, 0x4b0a3e69, 0x3e001a81, 0x3e001a81}, |
858 | {0x0000a54c, 0x590a7464, 0x590a7464, 0x42001a83, 0x42001a83}, | 858 | {0x0000a54c, 0x4f0a5e66, 0x4f0a5e66, 0x42001a83, 0x42001a83}, |
859 | {0x0000a550, 0x5e0a7865, 0x5e0a7865, 0x44001c84, 0x44001c84}, | 859 | {0x0000a550, 0x540a7e66, 0x540a7e66, 0x44001c84, 0x44001c84}, |
860 | {0x0000a554, 0x630a7e66, 0x630a7e66, 0x48001ce3, 0x48001ce3}, | 860 | {0x0000a554, 0x570a7e89, 0x570a7e89, 0x48001ce3, 0x48001ce3}, |
861 | {0x0000a558, 0x680a7e89, 0x680a7e89, 0x4c001ce5, 0x4c001ce5}, | 861 | {0x0000a558, 0x5c0e7e8a, 0x5c0e7e8a, 0x4c001ce5, 0x4c001ce5}, |
862 | {0x0000a55c, 0x6e0a7e8c, 0x6e0a7e8c, 0x50001ce9, 0x50001ce9}, | 862 | {0x0000a55c, 0x60127e8b, 0x60127e8b, 0x50001ce9, 0x50001ce9}, |
863 | {0x0000a560, 0x730e7e8c, 0x730e7e8c, 0x54001ceb, 0x54001ceb}, | 863 | {0x0000a560, 0x65127ecc, 0x65127ecc, 0x54001ceb, 0x54001ceb}, |
864 | {0x0000a564, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, | 864 | {0x0000a564, 0x6b169ecd, 0x6b169ecd, 0x56001eec, 0x56001eec}, |
865 | {0x0000a568, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, | 865 | {0x0000a568, 0x70169f0e, 0x70169f0e, 0x56001eec, 0x56001eec}, |
866 | {0x0000a56c, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, | 866 | {0x0000a56c, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, |
867 | {0x0000a570, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, | 867 | {0x0000a570, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, |
868 | {0x0000a574, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, | 868 | {0x0000a574, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, |
869 | {0x0000a578, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, | 869 | {0x0000a578, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, |
870 | {0x0000a57c, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, | 870 | {0x0000a57c, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, |
871 | {0x0000a580, 0x00820220, 0x00820220, 0x00800000, 0x00800000}, | 871 | {0x0000a580, 0x00820220, 0x00820220, 0x00800000, 0x00800000}, |
872 | {0x0000a584, 0x06820223, 0x06820223, 0x04800002, 0x04800002}, | 872 | {0x0000a584, 0x06820223, 0x06820223, 0x04800002, 0x04800002}, |
873 | {0x0000a588, 0x0b822220, 0x0b822220, 0x08800004, 0x08800004}, | 873 | {0x0000a588, 0x0a822220, 0x0a822220, 0x08800004, 0x08800004}, |
874 | {0x0000a58c, 0x10822223, 0x10822223, 0x0b800200, 0x0b800200}, | 874 | {0x0000a58c, 0x0f822223, 0x0f822223, 0x0b800200, 0x0b800200}, |
875 | {0x0000a590, 0x17822620, 0x17822620, 0x0f800202, 0x0f800202}, | 875 | {0x0000a590, 0x14822620, 0x14822620, 0x0f800202, 0x0f800202}, |
876 | {0x0000a594, 0x1b822622, 0x1b822622, 0x11800400, 0x11800400}, | 876 | {0x0000a594, 0x18822622, 0x18822622, 0x11800400, 0x11800400}, |
877 | {0x0000a598, 0x1f822822, 0x1f822822, 0x15800402, 0x15800402}, | 877 | {0x0000a598, 0x1b822822, 0x1b822822, 0x15800402, 0x15800402}, |
878 | {0x0000a59c, 0x24822842, 0x24822842, 0x19800404, 0x19800404}, | 878 | {0x0000a59c, 0x20822842, 0x20822842, 0x19800404, 0x19800404}, |
879 | {0x0000a5a0, 0x28842840, 0x28842840, 0x1b800603, 0x1b800603}, | 879 | {0x0000a5a0, 0x22822c41, 0x22822c41, 0x1b800603, 0x1b800603}, |
880 | {0x0000a5a4, 0x2c842842, 0x2c842842, 0x1f800a02, 0x1f800a02}, | 880 | {0x0000a5a4, 0x28823042, 0x28823042, 0x1f800a02, 0x1f800a02}, |
881 | {0x0000a5a8, 0x30842844, 0x30842844, 0x23800a04, 0x23800a04}, | 881 | {0x0000a5a8, 0x2c823044, 0x2c823044, 0x23800a04, 0x23800a04}, |
882 | {0x0000a5ac, 0x34842846, 0x34842846, 0x26800a20, 0x26800a20}, | 882 | {0x0000a5ac, 0x2f823644, 0x2f823644, 0x26800a20, 0x26800a20}, |
883 | {0x0000a5b0, 0x39842869, 0x39842869, 0x2a800e20, 0x2a800e20}, | 883 | {0x0000a5b0, 0x34843643, 0x34843643, 0x2a800e20, 0x2a800e20}, |
884 | {0x0000a5b4, 0x3d862869, 0x3d862869, 0x2e800e22, 0x2e800e22}, | 884 | {0x0000a5b4, 0x38843a44, 0x38843a44, 0x2e800e22, 0x2e800e22}, |
885 | {0x0000a5b8, 0x44862c69, 0x44862c69, 0x31800e24, 0x31800e24}, | 885 | {0x0000a5b8, 0x3b843e45, 0x3b843e45, 0x31800e24, 0x31800e24}, |
886 | {0x0000a5bc, 0x48863069, 0x48863069, 0x34801640, 0x34801640}, | 886 | {0x0000a5bc, 0x40863e46, 0x40863e46, 0x34801640, 0x34801640}, |
887 | {0x0000a5c0, 0x4c8a3065, 0x4c8a3065, 0x38801660, 0x38801660}, | 887 | {0x0000a5c0, 0x4c8a3065, 0x44883e46, 0x44883e46, 0x38801660}, |
888 | {0x0000a5c4, 0x508a3069, 0x508a3069, 0x3b801861, 0x3b801861}, | 888 | {0x0000a5c4, 0x46883e66, 0x46883e66, 0x3b801861, 0x3b801861}, |
889 | {0x0000a5c8, 0x538a3469, 0x538a3469, 0x3e801a81, 0x3e801a81}, | 889 | {0x0000a5c8, 0x4b8a3e69, 0x4b8a3e69, 0x3e801a81, 0x3e801a81}, |
890 | {0x0000a5cc, 0x598a7464, 0x598a7464, 0x42801a83, 0x42801a83}, | 890 | {0x0000a5cc, 0x4f8a5e66, 0x4f8a5e66, 0x42801a83, 0x42801a83}, |
891 | {0x0000a5d0, 0x5e8a7865, 0x5e8a7865, 0x44801c84, 0x44801c84}, | 891 | {0x0000a5d0, 0x548a7e66, 0x548a7e66, 0x44801c84, 0x44801c84}, |
892 | {0x0000a5d4, 0x638a7e66, 0x638a7e66, 0x48801ce3, 0x48801ce3}, | 892 | {0x0000a5d4, 0x578a7e89, 0x578a7e89, 0x48801ce3, 0x48801ce3}, |
893 | {0x0000a5d8, 0x688a7e89, 0x688a7e89, 0x4c801ce5, 0x4c801ce5}, | 893 | {0x0000a5d8, 0x5c8e7e8a, 0x5c8e7e8a, 0x4c801ce5, 0x4c801ce5}, |
894 | {0x0000a5dc, 0x6e8a7e8c, 0x6e8a7e8c, 0x50801ce9, 0x50801ce9}, | 894 | {0x0000a5dc, 0x60927e8b, 0x60927e8b, 0x50801ce9, 0x50801ce9}, |
895 | {0x0000a5e0, 0x738e7e8c, 0x738e7e8c, 0x54801ceb, 0x54801ceb}, | 895 | {0x0000a5e0, 0x65927ecc, 0x65927ecc, 0x54801ceb, 0x54801ceb}, |
896 | {0x0000a5e4, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, | 896 | {0x0000a5e4, 0x6b969ecd, 0x6b969ecd, 0x56801eec, 0x56801eec}, |
897 | {0x0000a5e8, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, | 897 | {0x0000a5e8, 0x70969f0e, 0x70969f0e, 0x56801eec, 0x56801eec}, |
898 | {0x0000a5ec, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, | 898 | {0x0000a5ec, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, |
899 | {0x0000a5f0, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, | 899 | {0x0000a5f0, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, |
900 | {0x0000a5f4, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, | 900 | {0x0000a5f4, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, |
901 | {0x0000a5f8, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, | 901 | {0x0000a5f8, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, |
902 | {0x0000a5fc, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, | 902 | {0x0000a5fc, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, |
903 | {0x00016044, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6}, | 903 | {0x00016044, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6}, |
904 | {0x00016048, 0xad241a61, 0xad241a61, 0xad241a61, 0xad241a61}, | 904 | {0x00016048, 0xad241a61, 0xad241a61, 0xad241a61, 0xad241a61}, |
905 | {0x00016068, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c}, | 905 | {0x00016068, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c}, |
@@ -913,71 +913,71 @@ static const u32 ar9300Modes_high_power_tx_gain_table_2p0[][5] = { | |||
913 | 913 | ||
914 | static const u32 ar9300Modes_high_ob_db_tx_gain_table_2p0[][5] = { | 914 | static const u32 ar9300Modes_high_ob_db_tx_gain_table_2p0[][5] = { |
915 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ | 915 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ |
916 | {0x0000a410, 0x000050d9, 0x000050d9, 0x000050da, 0x000050da}, | 916 | {0x0000a410, 0x000050db, 0x000050db, 0x000050d9, 0x000050d9}, |
917 | {0x0000a500, 0x00020220, 0x00020220, 0x00000000, 0x00000000}, | 917 | {0x0000a500, 0x00020220, 0x00020220, 0x00000000, 0x00000000}, |
918 | {0x0000a504, 0x06020223, 0x06020223, 0x04000002, 0x04000002}, | 918 | {0x0000a504, 0x06020223, 0x06020223, 0x04000002, 0x04000002}, |
919 | {0x0000a508, 0x0b022220, 0x0b022220, 0x08000004, 0x08000004}, | 919 | {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004}, |
920 | {0x0000a50c, 0x10022223, 0x10022223, 0x0b000200, 0x0b000200}, | 920 | {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200}, |
921 | {0x0000a510, 0x17022620, 0x17022620, 0x0f000202, 0x0f000202}, | 921 | {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202}, |
922 | {0x0000a514, 0x1b022622, 0x1b022622, 0x11000400, 0x11000400}, | 922 | {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400}, |
923 | {0x0000a518, 0x1f022822, 0x1f022822, 0x15000402, 0x15000402}, | 923 | {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402}, |
924 | {0x0000a51c, 0x24022842, 0x24022842, 0x19000404, 0x19000404}, | 924 | {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404}, |
925 | {0x0000a520, 0x28042840, 0x28042840, 0x1b000603, 0x1b000603}, | 925 | {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603}, |
926 | {0x0000a524, 0x2c042842, 0x2c042842, 0x1f000a02, 0x1f000a02}, | 926 | {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02}, |
927 | {0x0000a528, 0x30042844, 0x30042844, 0x23000a04, 0x23000a04}, | 927 | {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04}, |
928 | {0x0000a52c, 0x34042846, 0x34042846, 0x26000a20, 0x26000a20}, | 928 | {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20}, |
929 | {0x0000a530, 0x39042869, 0x39042869, 0x2a000e20, 0x2a000e20}, | 929 | {0x0000a530, 0x34043643, 0x34043643, 0x2a000e20, 0x2a000e20}, |
930 | {0x0000a534, 0x3d062869, 0x3d062869, 0x2e000e22, 0x2e000e22}, | 930 | {0x0000a534, 0x38043a44, 0x38043a44, 0x2e000e22, 0x2e000e22}, |
931 | {0x0000a538, 0x44062c69, 0x44062c69, 0x31000e24, 0x31000e24}, | 931 | {0x0000a538, 0x3b043e45, 0x3b043e45, 0x31000e24, 0x31000e24}, |
932 | {0x0000a53c, 0x48063069, 0x48063069, 0x34001640, 0x34001640}, | 932 | {0x0000a53c, 0x40063e46, 0x40063e46, 0x34001640, 0x34001640}, |
933 | {0x0000a540, 0x4c0a3065, 0x4c0a3065, 0x38001660, 0x38001660}, | 933 | {0x0000a540, 0x44083e46, 0x44083e46, 0x38001660, 0x38001660}, |
934 | {0x0000a544, 0x500a3069, 0x500a3069, 0x3b001861, 0x3b001861}, | 934 | {0x0000a544, 0x46083e66, 0x46083e66, 0x3b001861, 0x3b001861}, |
935 | {0x0000a548, 0x530a3469, 0x530a3469, 0x3e001a81, 0x3e001a81}, | 935 | {0x0000a548, 0x4b0a3e69, 0x4b0a3e69, 0x3e001a81, 0x3e001a81}, |
936 | {0x0000a54c, 0x590a7464, 0x590a7464, 0x42001a83, 0x42001a83}, | 936 | {0x0000a54c, 0x4f0a5e66, 0x4f0a5e66, 0x42001a83, 0x42001a83}, |
937 | {0x0000a550, 0x5e0a7865, 0x5e0a7865, 0x44001c84, 0x44001c84}, | 937 | {0x0000a550, 0x540a7e66, 0x540a7e66, 0x44001c84, 0x44001c84}, |
938 | {0x0000a554, 0x630a7e66, 0x630a7e66, 0x48001ce3, 0x48001ce3}, | 938 | {0x0000a554, 0x570a7e89, 0x570a7e89, 0x48001ce3, 0x48001ce3}, |
939 | {0x0000a558, 0x680a7e89, 0x680a7e89, 0x4c001ce5, 0x4c001ce5}, | 939 | {0x0000a558, 0x5c0e7e8a, 0x5c0e7e8a, 0x4c001ce5, 0x4c001ce5}, |
940 | {0x0000a55c, 0x6e0a7e8c, 0x6e0a7e8c, 0x50001ce9, 0x50001ce9}, | 940 | {0x0000a55c, 0x60127e8b, 0x60127e8b, 0x50001ce9, 0x50001ce9}, |
941 | {0x0000a560, 0x730e7e8c, 0x730e7e8c, 0x54001ceb, 0x54001ceb}, | 941 | {0x0000a560, 0x65127ecc, 0x65127ecc, 0x54001ceb, 0x54001ceb}, |
942 | {0x0000a564, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, | 942 | {0x0000a564, 0x6b169ecd, 0x6b169ecd, 0x56001eec, 0x56001eec}, |
943 | {0x0000a568, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, | 943 | {0x0000a568, 0x70169f0e, 0x70169f0e, 0x56001eec, 0x56001eec}, |
944 | {0x0000a56c, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, | 944 | {0x0000a56c, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, |
945 | {0x0000a570, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, | 945 | {0x0000a570, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, |
946 | {0x0000a574, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, | 946 | {0x0000a574, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, |
947 | {0x0000a578, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, | 947 | {0x0000a578, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, |
948 | {0x0000a57c, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec}, | 948 | {0x0000a57c, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec}, |
949 | {0x0000a580, 0x00820220, 0x00820220, 0x00800000, 0x00800000}, | 949 | {0x0000a580, 0x00820220, 0x00820220, 0x00800000, 0x00800000}, |
950 | {0x0000a584, 0x06820223, 0x06820223, 0x04800002, 0x04800002}, | 950 | {0x0000a584, 0x06820223, 0x06820223, 0x04800002, 0x04800002}, |
951 | {0x0000a588, 0x0b822220, 0x0b822220, 0x08800004, 0x08800004}, | 951 | {0x0000a588, 0x0a822220, 0x0a822220, 0x08800004, 0x08800004}, |
952 | {0x0000a58c, 0x10822223, 0x10822223, 0x0b800200, 0x0b800200}, | 952 | {0x0000a58c, 0x0f822223, 0x0f822223, 0x0b800200, 0x0b800200}, |
953 | {0x0000a590, 0x17822620, 0x17822620, 0x0f800202, 0x0f800202}, | 953 | {0x0000a590, 0x14822620, 0x14822620, 0x0f800202, 0x0f800202}, |
954 | {0x0000a594, 0x1b822622, 0x1b822622, 0x11800400, 0x11800400}, | 954 | {0x0000a594, 0x18822622, 0x18822622, 0x11800400, 0x11800400}, |
955 | {0x0000a598, 0x1f822822, 0x1f822822, 0x15800402, 0x15800402}, | 955 | {0x0000a598, 0x1b822822, 0x1b822822, 0x15800402, 0x15800402}, |
956 | {0x0000a59c, 0x24822842, 0x24822842, 0x19800404, 0x19800404}, | 956 | {0x0000a59c, 0x20822842, 0x20822842, 0x19800404, 0x19800404}, |
957 | {0x0000a5a0, 0x28842840, 0x28842840, 0x1b800603, 0x1b800603}, | 957 | {0x0000a5a0, 0x22822c41, 0x22822c41, 0x1b800603, 0x1b800603}, |
958 | {0x0000a5a4, 0x2c842842, 0x2c842842, 0x1f800a02, 0x1f800a02}, | 958 | {0x0000a5a4, 0x28823042, 0x28823042, 0x1f800a02, 0x1f800a02}, |
959 | {0x0000a5a8, 0x30842844, 0x30842844, 0x23800a04, 0x23800a04}, | 959 | {0x0000a5a8, 0x2c823044, 0x2c823044, 0x23800a04, 0x23800a04}, |
960 | {0x0000a5ac, 0x34842846, 0x34842846, 0x26800a20, 0x26800a20}, | 960 | {0x0000a5ac, 0x2f823644, 0x2f823644, 0x26800a20, 0x26800a20}, |
961 | {0x0000a5b0, 0x39842869, 0x39842869, 0x2a800e20, 0x2a800e20}, | 961 | {0x0000a5b0, 0x34843643, 0x34843643, 0x2a800e20, 0x2a800e20}, |
962 | {0x0000a5b4, 0x3d862869, 0x3d862869, 0x2e800e22, 0x2e800e22}, | 962 | {0x0000a5b4, 0x38843a44, 0x38843a44, 0x2e800e22, 0x2e800e22}, |
963 | {0x0000a5b8, 0x44862c69, 0x44862c69, 0x31800e24, 0x31800e24}, | 963 | {0x0000a5b8, 0x3b843e45, 0x3b843e45, 0x31800e24, 0x31800e24}, |
964 | {0x0000a5bc, 0x48863069, 0x48863069, 0x34801640, 0x34801640}, | 964 | {0x0000a5bc, 0x40863e46, 0x40863e46, 0x34801640, 0x34801640}, |
965 | {0x0000a5c0, 0x4c8a3065, 0x4c8a3065, 0x38801660, 0x38801660}, | 965 | {0x0000a5c0, 0x44883e46, 0x44883e46, 0x38801660, 0x38801660}, |
966 | {0x0000a5c4, 0x508a3069, 0x508a3069, 0x3b801861, 0x3b801861}, | 966 | {0x0000a5c4, 0x46883e66, 0x46883e66, 0x3b801861, 0x3b801861}, |
967 | {0x0000a5c8, 0x538a3469, 0x538a3469, 0x3e801a81, 0x3e801a81}, | 967 | {0x0000a5c8, 0x4b8a3e69, 0x4b8a3e69, 0x3e801a81, 0x3e801a81}, |
968 | {0x0000a5cc, 0x598a7464, 0x598a7464, 0x42801a83, 0x42801a83}, | 968 | {0x0000a5cc, 0x4f8a5e66, 0x4f8a5e66, 0x42801a83, 0x42801a83}, |
969 | {0x0000a5d0, 0x5e8a7865, 0x5e8a7865, 0x44801c84, 0x44801c84}, | 969 | {0x0000a5d0, 0x548a7e66, 0x548a7e66, 0x44801c84, 0x44801c84}, |
970 | {0x0000a5d4, 0x638a7e66, 0x638a7e66, 0x48801ce3, 0x48801ce3}, | 970 | {0x0000a5d4, 0x578a7e89, 0x578a7e89, 0x48801ce3, 0x48801ce3}, |
971 | {0x0000a5d8, 0x688a7e89, 0x688a7e89, 0x4c801ce5, 0x4c801ce5}, | 971 | {0x0000a5d8, 0x5c8e7e8a, 0x5c8e7e8a, 0x4c801ce5, 0x4c801ce5}, |
972 | {0x0000a5dc, 0x6e8a7e8c, 0x6e8a7e8c, 0x50801ce9, 0x50801ce9}, | 972 | {0x0000a5dc, 0x60927e8b, 0x60927e8b, 0x50801ce9, 0x50801ce9}, |
973 | {0x0000a5e0, 0x738e7e8c, 0x738e7e8c, 0x54801ceb, 0x54801ceb}, | 973 | {0x0000a5e0, 0x65927ecc, 0x65927ecc, 0x54801ceb, 0x54801ceb}, |
974 | {0x0000a5e4, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, | 974 | {0x0000a5e4, 0x6b969ecd, 0x6b969ecd, 0x56801eec, 0x56801eec}, |
975 | {0x0000a5e8, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, | 975 | {0x0000a5e8, 0x70969f0e, 0x70969f0e, 0x56801eec, 0x56801eec}, |
976 | {0x0000a5ec, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, | 976 | {0x0000a5ec, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, |
977 | {0x0000a5f0, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, | 977 | {0x0000a5f0, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, |
978 | {0x0000a5f4, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, | 978 | {0x0000a5f4, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, |
979 | {0x0000a5f8, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, | 979 | {0x0000a5f8, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, |
980 | {0x0000a5fc, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec}, | 980 | {0x0000a5fc, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec}, |
981 | {0x00016044, 0x056db2e4, 0x056db2e4, 0x056db2e4, 0x056db2e4}, | 981 | {0x00016044, 0x056db2e4, 0x056db2e4, 0x056db2e4, 0x056db2e4}, |
982 | {0x00016048, 0x8c001a61, 0x8c001a61, 0x8c001a61, 0x8c001a61}, | 982 | {0x00016048, 0x8c001a61, 0x8c001a61, 0x8c001a61, 0x8c001a61}, |
983 | {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, | 983 | {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, |
@@ -1251,7 +1251,7 @@ static const u32 ar9300Common_rx_gain_table_2p0[][2] = { | |||
1251 | 1251 | ||
1252 | static const u32 ar9300Modes_low_ob_db_tx_gain_table_2p0[][5] = { | 1252 | static const u32 ar9300Modes_low_ob_db_tx_gain_table_2p0[][5] = { |
1253 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ | 1253 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ |
1254 | {0x0000a410, 0x000050da, 0x000050da, 0x000050da, 0x000050da}, | 1254 | {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, |
1255 | {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | 1255 | {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
1256 | {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002}, | 1256 | {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002}, |
1257 | {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004}, | 1257 | {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004}, |
@@ -1760,31 +1760,22 @@ static const u32 ar9300_2p0_soc_preamble[][2] = { | |||
1760 | {0x00007038, 0x000004c2}, | 1760 | {0x00007038, 0x000004c2}, |
1761 | }; | 1761 | }; |
1762 | 1762 | ||
1763 | /* | ||
1764 | * PCIE-PHY programming array, to be used prior to entering | ||
1765 | * full sleep (holding RTC in reset, PLL is ON in L1 mode) | ||
1766 | */ | ||
1767 | static const u32 ar9300PciePhy_pll_on_clkreq_disable_L1_2p0[][2] = { | 1763 | static const u32 ar9300PciePhy_pll_on_clkreq_disable_L1_2p0[][2] = { |
1764 | /* Addr allmodes */ | ||
1768 | {0x00004040, 0x08212e5e}, | 1765 | {0x00004040, 0x08212e5e}, |
1769 | {0x00004040, 0x0008003b}, | 1766 | {0x00004040, 0x0008003b}, |
1770 | {0x00004044, 0x00000000}, | 1767 | {0x00004044, 0x00000000}, |
1771 | }; | 1768 | }; |
1772 | 1769 | ||
1773 | /* | ||
1774 | * PCIE-PHY programming array, to be used when not in | ||
1775 | * full sleep (holding RTC in reset) | ||
1776 | */ | ||
1777 | static const u32 ar9300PciePhy_clkreq_enable_L1_2p0[][2] = { | 1770 | static const u32 ar9300PciePhy_clkreq_enable_L1_2p0[][2] = { |
1771 | /* Addr allmodes */ | ||
1778 | {0x00004040, 0x08253e5e}, | 1772 | {0x00004040, 0x08253e5e}, |
1779 | {0x00004040, 0x0008003b}, | 1773 | {0x00004040, 0x0008003b}, |
1780 | {0x00004044, 0x00000000}, | 1774 | {0x00004044, 0x00000000}, |
1781 | }; | 1775 | }; |
1782 | 1776 | ||
1783 | /* | ||
1784 | * PCIE-PHY programming array, to be used prior to entering | ||
1785 | * full sleep (holding RTC in reset) | ||
1786 | */ | ||
1787 | static const u32 ar9300PciePhy_clkreq_disable_L1_2p0[][2] = { | 1777 | static const u32 ar9300PciePhy_clkreq_disable_L1_2p0[][2] = { |
1778 | /* Addr allmodes */ | ||
1788 | {0x00004040, 0x08213e5e}, | 1779 | {0x00004040, 0x08213e5e}, |
1789 | {0x00004040, 0x0008003b}, | 1780 | {0x00004040, 0x0008003b}, |
1790 | {0x00004044, 0x00000000}, | 1781 | {0x00004044, 0x00000000}, |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c index 7d111fbf8bc5..37ba37481a47 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c | |||
@@ -311,6 +311,9 @@ static void ar9003_hw_set11n_txdesc(struct ath_hw *ah, void *ds, | |||
311 | { | 311 | { |
312 | struct ar9003_txc *ads = (struct ar9003_txc *) ds; | 312 | struct ar9003_txc *ads = (struct ar9003_txc *) ds; |
313 | 313 | ||
314 | if (txpower > ah->txpower_limit) | ||
315 | txpower = ah->txpower_limit; | ||
316 | |||
314 | txpower += ah->txpower_indexoffset; | 317 | txpower += ah->txpower_indexoffset; |
315 | if (txpower > 63) | 318 | if (txpower > 63) |
316 | txpower = 63; | 319 | txpower = 63; |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index 137543b2d739..80431a2f6dc1 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -375,16 +375,7 @@ static u32 ar9003_hw_compute_pll_control(struct ath_hw *ah, | |||
375 | else if (chan && IS_CHAN_QUARTER_RATE(chan)) | 375 | else if (chan && IS_CHAN_QUARTER_RATE(chan)) |
376 | pll |= SM(0x2, AR_RTC_9300_PLL_CLKSEL); | 376 | pll |= SM(0x2, AR_RTC_9300_PLL_CLKSEL); |
377 | 377 | ||
378 | if (chan && IS_CHAN_5GHZ(chan)) { | 378 | pll |= SM(0x2c, AR_RTC_9300_PLL_DIV); |
379 | pll |= SM(0x28, AR_RTC_9300_PLL_DIV); | ||
380 | |||
381 | /* | ||
382 | * When doing fast clock, set PLL to 0x142c | ||
383 | */ | ||
384 | if (IS_CHAN_A_5MHZ_SPACED(chan)) | ||
385 | pll = 0x142c; | ||
386 | } else | ||
387 | pll |= SM(0x2c, AR_RTC_9300_PLL_DIV); | ||
388 | 379 | ||
389 | return pll; | 380 | return pll; |
390 | } | 381 | } |
@@ -592,7 +583,7 @@ static int ar9003_hw_process_ini(struct ath_hw *ah, | |||
592 | * For 5GHz channels requiring Fast Clock, apply | 583 | * For 5GHz channels requiring Fast Clock, apply |
593 | * different modal values. | 584 | * different modal values. |
594 | */ | 585 | */ |
595 | if (IS_CHAN_A_5MHZ_SPACED(chan)) | 586 | if (IS_CHAN_A_FAST_CLOCK(ah, chan)) |
596 | REG_WRITE_ARRAY(&ah->iniModesAdditional, | 587 | REG_WRITE_ARRAY(&ah->iniModesAdditional, |
597 | modesIndex, regWrites); | 588 | modesIndex, regWrites); |
598 | 589 | ||
@@ -622,7 +613,7 @@ static void ar9003_hw_set_rfmode(struct ath_hw *ah, | |||
622 | rfMode |= (IS_CHAN_B(chan) || IS_CHAN_G(chan)) | 613 | rfMode |= (IS_CHAN_B(chan) || IS_CHAN_G(chan)) |
623 | ? AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM; | 614 | ? AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM; |
624 | 615 | ||
625 | if (IS_CHAN_A_5MHZ_SPACED(chan)) | 616 | if (IS_CHAN_A_FAST_CLOCK(ah, chan)) |
626 | rfMode |= (AR_PHY_MODE_DYNAMIC | AR_PHY_MODE_DYN_CCK_DISABLE); | 617 | rfMode |= (AR_PHY_MODE_DYNAMIC | AR_PHY_MODE_DYN_CCK_DISABLE); |
627 | 618 | ||
628 | REG_WRITE(ah, AR_PHY_MODE, rfMode); | 619 | REG_WRITE(ah, AR_PHY_MODE, rfMode); |
@@ -1102,6 +1093,7 @@ static void ar9003_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan) | |||
1102 | ath_print(common, ATH_DBG_ANY, "Timeout while waiting for nf " | 1093 | ath_print(common, ATH_DBG_ANY, "Timeout while waiting for nf " |
1103 | "to load: AR_PHY_AGC_CONTROL=0x%x\n", | 1094 | "to load: AR_PHY_AGC_CONTROL=0x%x\n", |
1104 | REG_READ(ah, AR_PHY_AGC_CONTROL)); | 1095 | REG_READ(ah, AR_PHY_AGC_CONTROL)); |
1096 | return; | ||
1105 | } | 1097 | } |
1106 | 1098 | ||
1107 | /* | 1099 | /* |
diff --git a/drivers/net/wireless/ath/ath9k/common.c b/drivers/net/wireless/ath/ath9k/common.c index 09effdedc8c0..b4424a623cf5 100644 --- a/drivers/net/wireless/ath/ath9k/common.c +++ b/drivers/net/wireless/ath/ath9k/common.c | |||
@@ -212,7 +212,6 @@ int ath9k_cmn_rx_skb_preprocess(struct ath_common *common, | |||
212 | rx_status->mactime = ath9k_hw_extend_tsf(ah, rx_stats->rs_tstamp); | 212 | rx_status->mactime = ath9k_hw_extend_tsf(ah, rx_stats->rs_tstamp); |
213 | rx_status->band = hw->conf.channel->band; | 213 | rx_status->band = hw->conf.channel->band; |
214 | rx_status->freq = hw->conf.channel->center_freq; | 214 | rx_status->freq = hw->conf.channel->center_freq; |
215 | rx_status->noise = common->ani.noise_floor; | ||
216 | rx_status->signal = ATH_DEFAULT_NOISE_FLOOR + rx_stats->rs_rssi; | 215 | rx_status->signal = ATH_DEFAULT_NOISE_FLOOR + rx_stats->rs_rssi; |
217 | rx_status->antenna = rx_stats->rs_antenna; | 216 | rx_status->antenna = rx_stats->rs_antenna; |
218 | rx_status->flag |= RX_FLAG_TSFT; | 217 | rx_status->flag |= RX_FLAG_TSFT; |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h index fb9c8c92eabe..21354c15a9a9 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.h +++ b/drivers/net/wireless/ath/ath9k/eeprom.h | |||
@@ -300,7 +300,8 @@ struct base_eep_header { | |||
300 | u32 binBuildNumber; | 300 | u32 binBuildNumber; |
301 | u8 deviceType; | 301 | u8 deviceType; |
302 | u8 pwdclkind; | 302 | u8 pwdclkind; |
303 | u8 futureBase_1[2]; | 303 | u8 fastClk5g; |
304 | u8 divChain; | ||
304 | u8 rxGainType; | 305 | u8 rxGainType; |
305 | u8 dacHiPwrMode_5G; | 306 | u8 dacHiPwrMode_5G; |
306 | u8 openLoopPwrCntl; | 307 | u8 openLoopPwrCntl; |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c index cf59799ef307..e591ad6016e5 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom_def.c +++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c | |||
@@ -274,6 +274,8 @@ static u32 ath9k_hw_def_get_eeprom(struct ath_hw *ah, | |||
274 | return pBase->txMask; | 274 | return pBase->txMask; |
275 | case EEP_RX_MASK: | 275 | case EEP_RX_MASK: |
276 | return pBase->rxMask; | 276 | return pBase->rxMask; |
277 | case EEP_FSTCLK_5G: | ||
278 | return pBase->fastClk5g; | ||
277 | case EEP_RXGAIN_TYPE: | 279 | case EEP_RXGAIN_TYPE: |
278 | return pBase->rxGainType; | 280 | return pBase->rxGainType; |
279 | case EEP_TXGAIN_TYPE: | 281 | case EEP_TXGAIN_TYPE: |
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index 3091bb3cef9b..74872ca76f9a 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c | |||
@@ -93,14 +93,24 @@ static int hif_usb_send_regout(struct hif_device_usb *hif_dev, | |||
93 | return ret; | 93 | return ret; |
94 | } | 94 | } |
95 | 95 | ||
96 | static inline void ath9k_skb_queue_purge(struct hif_device_usb *hif_dev, | ||
97 | struct sk_buff_head *list) | ||
98 | { | ||
99 | struct sk_buff *skb; | ||
100 | |||
101 | while ((skb = __skb_dequeue(list)) != NULL) { | ||
102 | dev_kfree_skb_any(skb); | ||
103 | TX_STAT_INC(skb_dropped); | ||
104 | } | ||
105 | } | ||
106 | |||
96 | static void hif_usb_tx_cb(struct urb *urb) | 107 | static void hif_usb_tx_cb(struct urb *urb) |
97 | { | 108 | { |
98 | struct tx_buf *tx_buf = (struct tx_buf *) urb->context; | 109 | struct tx_buf *tx_buf = (struct tx_buf *) urb->context; |
99 | struct hif_device_usb *hif_dev = tx_buf->hif_dev; | 110 | struct hif_device_usb *hif_dev = tx_buf->hif_dev; |
100 | struct sk_buff *skb; | 111 | struct sk_buff *skb; |
101 | bool drop, flush; | ||
102 | 112 | ||
103 | if (!hif_dev) | 113 | if (!hif_dev || !tx_buf) |
104 | return; | 114 | return; |
105 | 115 | ||
106 | switch (urb->status) { | 116 | switch (urb->status) { |
@@ -108,57 +118,47 @@ static void hif_usb_tx_cb(struct urb *urb) | |||
108 | break; | 118 | break; |
109 | case -ENOENT: | 119 | case -ENOENT: |
110 | case -ECONNRESET: | 120 | case -ECONNRESET: |
111 | break; | ||
112 | case -ENODEV: | 121 | case -ENODEV: |
113 | case -ESHUTDOWN: | 122 | case -ESHUTDOWN: |
123 | /* | ||
124 | * The URB has been killed, free the SKBs | ||
125 | * and return. | ||
126 | */ | ||
127 | ath9k_skb_queue_purge(hif_dev, &tx_buf->skb_queue); | ||
114 | return; | 128 | return; |
115 | default: | 129 | default: |
116 | break; | 130 | break; |
117 | } | 131 | } |
118 | 132 | ||
119 | if (tx_buf) { | 133 | /* Check if TX has been stopped */ |
120 | spin_lock(&hif_dev->tx.tx_lock); | 134 | spin_lock(&hif_dev->tx.tx_lock); |
121 | drop = !!(hif_dev->tx.flags & HIF_USB_TX_STOP); | 135 | if (hif_dev->tx.flags & HIF_USB_TX_STOP) { |
122 | flush = !!(hif_dev->tx.flags & HIF_USB_TX_FLUSH); | ||
123 | spin_unlock(&hif_dev->tx.tx_lock); | ||
124 | |||
125 | while ((skb = __skb_dequeue(&tx_buf->skb_queue)) != NULL) { | ||
126 | if (!drop && !flush) { | ||
127 | ath9k_htc_txcompletion_cb(hif_dev->htc_handle, | ||
128 | skb, 1); | ||
129 | TX_STAT_INC(skb_completed); | ||
130 | } else { | ||
131 | dev_kfree_skb_any(skb); | ||
132 | TX_STAT_INC(skb_dropped); | ||
133 | } | ||
134 | } | ||
135 | |||
136 | if (flush) | ||
137 | return; | ||
138 | |||
139 | tx_buf->len = tx_buf->offset = 0; | ||
140 | __skb_queue_head_init(&tx_buf->skb_queue); | ||
141 | |||
142 | spin_lock(&hif_dev->tx.tx_lock); | ||
143 | list_del(&tx_buf->list); | ||
144 | list_add_tail(&tx_buf->list, &hif_dev->tx.tx_buf); | ||
145 | hif_dev->tx.tx_buf_cnt++; | ||
146 | if (!drop) | ||
147 | __hif_usb_tx(hif_dev); /* Check for pending SKBs */ | ||
148 | TX_STAT_INC(buf_completed); | ||
149 | spin_unlock(&hif_dev->tx.tx_lock); | 136 | spin_unlock(&hif_dev->tx.tx_lock); |
150 | } | 137 | ath9k_skb_queue_purge(hif_dev, &tx_buf->skb_queue); |
151 | } | 138 | goto add_free; |
152 | 139 | } | |
153 | static inline void ath9k_skb_queue_purge(struct hif_device_usb *hif_dev, | 140 | spin_unlock(&hif_dev->tx.tx_lock); |
154 | struct sk_buff_head *list) | 141 | |
155 | { | 142 | /* Complete the queued SKBs. */ |
156 | struct sk_buff *skb; | 143 | while ((skb = __skb_dequeue(&tx_buf->skb_queue)) != NULL) { |
157 | 144 | ath9k_htc_txcompletion_cb(hif_dev->htc_handle, | |
158 | while ((skb = __skb_dequeue(list)) != NULL) { | 145 | skb, 1); |
159 | dev_kfree_skb_any(skb); | 146 | TX_STAT_INC(skb_completed); |
160 | TX_STAT_INC(skb_dropped); | 147 | } |
161 | } | 148 | |
149 | add_free: | ||
150 | /* Re-initialize the SKB queue */ | ||
151 | tx_buf->len = tx_buf->offset = 0; | ||
152 | __skb_queue_head_init(&tx_buf->skb_queue); | ||
153 | |||
154 | /* Add this TX buffer to the free list */ | ||
155 | spin_lock(&hif_dev->tx.tx_lock); | ||
156 | list_move_tail(&tx_buf->list, &hif_dev->tx.tx_buf); | ||
157 | hif_dev->tx.tx_buf_cnt++; | ||
158 | if (!(hif_dev->tx.flags & HIF_USB_TX_STOP)) | ||
159 | __hif_usb_tx(hif_dev); /* Check for pending SKBs */ | ||
160 | TX_STAT_INC(buf_completed); | ||
161 | spin_unlock(&hif_dev->tx.tx_lock); | ||
162 | } | 162 | } |
163 | 163 | ||
164 | /* TX lock has to be taken */ | 164 | /* TX lock has to be taken */ |
@@ -178,8 +178,7 @@ static int __hif_usb_tx(struct hif_device_usb *hif_dev) | |||
178 | return 0; | 178 | return 0; |
179 | 179 | ||
180 | tx_buf = list_first_entry(&hif_dev->tx.tx_buf, struct tx_buf, list); | 180 | tx_buf = list_first_entry(&hif_dev->tx.tx_buf, struct tx_buf, list); |
181 | list_del(&tx_buf->list); | 181 | list_move_tail(&tx_buf->list, &hif_dev->tx.tx_pending); |
182 | list_add_tail(&tx_buf->list, &hif_dev->tx.tx_pending); | ||
183 | hif_dev->tx.tx_buf_cnt--; | 182 | hif_dev->tx.tx_buf_cnt--; |
184 | 183 | ||
185 | tx_skb_cnt = min_t(u16, hif_dev->tx.tx_skb_cnt, MAX_TX_AGGR_NUM); | 184 | tx_skb_cnt = min_t(u16, hif_dev->tx.tx_skb_cnt, MAX_TX_AGGR_NUM); |
@@ -511,9 +510,18 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb) | |||
511 | if (likely(urb->actual_length != 0)) { | 510 | if (likely(urb->actual_length != 0)) { |
512 | skb_put(skb, urb->actual_length); | 511 | skb_put(skb, urb->actual_length); |
513 | 512 | ||
513 | /* Process the command first */ | ||
514 | ath9k_htc_rx_msg(hif_dev->htc_handle, skb, | ||
515 | skb->len, USB_REG_IN_PIPE); | ||
516 | |||
517 | |||
514 | nskb = alloc_skb(MAX_REG_IN_BUF_SIZE, GFP_ATOMIC); | 518 | nskb = alloc_skb(MAX_REG_IN_BUF_SIZE, GFP_ATOMIC); |
515 | if (!nskb) | 519 | if (!nskb) { |
516 | goto resubmit; | 520 | dev_err(&hif_dev->udev->dev, |
521 | "ath9k_htc: REG_IN memory allocation failure\n"); | ||
522 | urb->context = NULL; | ||
523 | return; | ||
524 | } | ||
517 | 525 | ||
518 | usb_fill_int_urb(urb, hif_dev->udev, | 526 | usb_fill_int_urb(urb, hif_dev->udev, |
519 | usb_rcvintpipe(hif_dev->udev, USB_REG_IN_PIPE), | 527 | usb_rcvintpipe(hif_dev->udev, USB_REG_IN_PIPE), |
@@ -523,12 +531,9 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb) | |||
523 | ret = usb_submit_urb(urb, GFP_ATOMIC); | 531 | ret = usb_submit_urb(urb, GFP_ATOMIC); |
524 | if (ret) { | 532 | if (ret) { |
525 | kfree_skb(nskb); | 533 | kfree_skb(nskb); |
526 | goto free; | 534 | urb->context = NULL; |
527 | } | 535 | } |
528 | 536 | ||
529 | ath9k_htc_rx_msg(hif_dev->htc_handle, skb, | ||
530 | skb->len, USB_REG_IN_PIPE); | ||
531 | |||
532 | return; | 537 | return; |
533 | } | 538 | } |
534 | 539 | ||
@@ -548,20 +553,17 @@ free: | |||
548 | 553 | ||
549 | static void ath9k_hif_usb_dealloc_tx_urbs(struct hif_device_usb *hif_dev) | 554 | static void ath9k_hif_usb_dealloc_tx_urbs(struct hif_device_usb *hif_dev) |
550 | { | 555 | { |
551 | unsigned long flags; | ||
552 | struct tx_buf *tx_buf = NULL, *tx_buf_tmp = NULL; | 556 | struct tx_buf *tx_buf = NULL, *tx_buf_tmp = NULL; |
553 | 557 | ||
554 | list_for_each_entry_safe(tx_buf, tx_buf_tmp, &hif_dev->tx.tx_buf, list) { | 558 | list_for_each_entry_safe(tx_buf, tx_buf_tmp, |
559 | &hif_dev->tx.tx_buf, list) { | ||
560 | usb_kill_urb(tx_buf->urb); | ||
555 | list_del(&tx_buf->list); | 561 | list_del(&tx_buf->list); |
556 | usb_free_urb(tx_buf->urb); | 562 | usb_free_urb(tx_buf->urb); |
557 | kfree(tx_buf->buf); | 563 | kfree(tx_buf->buf); |
558 | kfree(tx_buf); | 564 | kfree(tx_buf); |
559 | } | 565 | } |
560 | 566 | ||
561 | spin_lock_irqsave(&hif_dev->tx.tx_lock, flags); | ||
562 | hif_dev->tx.flags |= HIF_USB_TX_FLUSH; | ||
563 | spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags); | ||
564 | |||
565 | list_for_each_entry_safe(tx_buf, tx_buf_tmp, | 567 | list_for_each_entry_safe(tx_buf, tx_buf_tmp, |
566 | &hif_dev->tx.tx_pending, list) { | 568 | &hif_dev->tx.tx_pending, list) { |
567 | usb_kill_urb(tx_buf->urb); | 569 | usb_kill_urb(tx_buf->urb); |
@@ -570,10 +572,6 @@ static void ath9k_hif_usb_dealloc_tx_urbs(struct hif_device_usb *hif_dev) | |||
570 | kfree(tx_buf->buf); | 572 | kfree(tx_buf->buf); |
571 | kfree(tx_buf); | 573 | kfree(tx_buf); |
572 | } | 574 | } |
573 | |||
574 | spin_lock_irqsave(&hif_dev->tx.tx_lock, flags); | ||
575 | hif_dev->tx.flags &= ~HIF_USB_TX_FLUSH; | ||
576 | spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags); | ||
577 | } | 575 | } |
578 | 576 | ||
579 | static int ath9k_hif_usb_alloc_tx_urbs(struct hif_device_usb *hif_dev) | 577 | static int ath9k_hif_usb_alloc_tx_urbs(struct hif_device_usb *hif_dev) |
@@ -897,6 +895,26 @@ err_alloc: | |||
897 | return ret; | 895 | return ret; |
898 | } | 896 | } |
899 | 897 | ||
898 | static void ath9k_hif_usb_reboot(struct usb_device *udev) | ||
899 | { | ||
900 | u32 reboot_cmd = 0xffffffff; | ||
901 | void *buf; | ||
902 | int ret; | ||
903 | |||
904 | buf = kmalloc(4, GFP_KERNEL); | ||
905 | if (!buf) | ||
906 | return; | ||
907 | |||
908 | memcpy(buf, &reboot_cmd, 4); | ||
909 | |||
910 | ret = usb_bulk_msg(udev, usb_sndbulkpipe(udev, USB_REG_OUT_PIPE), | ||
911 | buf, 4, NULL, HZ); | ||
912 | if (ret) | ||
913 | dev_err(&udev->dev, "ath9k_htc: USB reboot failed\n"); | ||
914 | |||
915 | kfree(buf); | ||
916 | } | ||
917 | |||
900 | static void ath9k_hif_usb_disconnect(struct usb_interface *interface) | 918 | static void ath9k_hif_usb_disconnect(struct usb_interface *interface) |
901 | { | 919 | { |
902 | struct usb_device *udev = interface_to_usbdev(interface); | 920 | struct usb_device *udev = interface_to_usbdev(interface); |
@@ -904,14 +922,15 @@ static void ath9k_hif_usb_disconnect(struct usb_interface *interface) | |||
904 | (struct hif_device_usb *) usb_get_intfdata(interface); | 922 | (struct hif_device_usb *) usb_get_intfdata(interface); |
905 | 923 | ||
906 | if (hif_dev) { | 924 | if (hif_dev) { |
907 | ath9k_htc_hw_deinit(hif_dev->htc_handle, true); | 925 | ath9k_htc_hw_deinit(hif_dev->htc_handle, |
926 | (udev->state == USB_STATE_NOTATTACHED) ? true : false); | ||
908 | ath9k_htc_hw_free(hif_dev->htc_handle); | 927 | ath9k_htc_hw_free(hif_dev->htc_handle); |
909 | ath9k_hif_usb_dev_deinit(hif_dev); | 928 | ath9k_hif_usb_dev_deinit(hif_dev); |
910 | usb_set_intfdata(interface, NULL); | 929 | usb_set_intfdata(interface, NULL); |
911 | } | 930 | } |
912 | 931 | ||
913 | if (hif_dev->flags & HIF_USB_START) | 932 | if (hif_dev->flags & HIF_USB_START) |
914 | usb_reset_device(udev); | 933 | ath9k_hif_usb_reboot(udev); |
915 | 934 | ||
916 | kfree(hif_dev); | 935 | kfree(hif_dev); |
917 | dev_info(&udev->dev, "ath9k_htc: USB layer deinitialized\n"); | 936 | dev_info(&udev->dev, "ath9k_htc: USB layer deinitialized\n"); |
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.h b/drivers/net/wireless/ath/ath9k/hif_usb.h index 7d49a8af420e..0aca49b6fcb6 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.h +++ b/drivers/net/wireless/ath/ath9k/hif_usb.h | |||
@@ -61,7 +61,6 @@ struct tx_buf { | |||
61 | }; | 61 | }; |
62 | 62 | ||
63 | #define HIF_USB_TX_STOP BIT(0) | 63 | #define HIF_USB_TX_STOP BIT(0) |
64 | #define HIF_USB_TX_FLUSH BIT(1) | ||
65 | 64 | ||
66 | struct hif_usb_tx { | 65 | struct hif_usb_tx { |
67 | u8 flags; | 66 | u8 flags; |
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index c765ff4a505c..1ae18bbc4d9e 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h | |||
@@ -329,6 +329,7 @@ struct htc_beacon_config { | |||
329 | #define OP_ASSOCIATED BIT(8) | 329 | #define OP_ASSOCIATED BIT(8) |
330 | #define OP_ENABLE_BEACON BIT(9) | 330 | #define OP_ENABLE_BEACON BIT(9) |
331 | #define OP_LED_DEINIT BIT(10) | 331 | #define OP_LED_DEINIT BIT(10) |
332 | #define OP_UNPLUGGED BIT(11) | ||
332 | 333 | ||
333 | struct ath9k_htc_priv { | 334 | struct ath9k_htc_priv { |
334 | struct device *dev; | 335 | struct device *dev; |
@@ -378,6 +379,7 @@ struct ath9k_htc_priv { | |||
378 | struct mutex htc_pm_lock; | 379 | struct mutex htc_pm_lock; |
379 | unsigned long ps_usecount; | 380 | unsigned long ps_usecount; |
380 | bool ps_enabled; | 381 | bool ps_enabled; |
382 | bool ps_idle; | ||
381 | 383 | ||
382 | struct ath_led radio_led; | 384 | struct ath_led radio_led; |
383 | struct ath_led assoc_led; | 385 | struct ath_led assoc_led; |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index a86189629d92..701f2ef5a440 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -744,6 +744,9 @@ int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev, | |||
744 | if (ret) | 744 | if (ret) |
745 | goto err_init; | 745 | goto err_init; |
746 | 746 | ||
747 | /* The device may have been unplugged earlier. */ | ||
748 | priv->op_flags &= ~OP_UNPLUGGED; | ||
749 | |||
747 | ret = ath9k_init_device(priv, devid); | 750 | ret = ath9k_init_device(priv, devid); |
748 | if (ret) | 751 | if (ret) |
749 | goto err_init; | 752 | goto err_init; |
@@ -760,6 +763,11 @@ err_free: | |||
760 | void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug) | 763 | void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug) |
761 | { | 764 | { |
762 | if (htc_handle->drv_priv) { | 765 | if (htc_handle->drv_priv) { |
766 | |||
767 | /* Check if the device has been yanked out. */ | ||
768 | if (hotunplug) | ||
769 | htc_handle->drv_priv->op_flags |= OP_UNPLUGGED; | ||
770 | |||
763 | ath9k_deinit_device(htc_handle->drv_priv); | 771 | ath9k_deinit_device(htc_handle->drv_priv); |
764 | ath9k_deinit_wmi(htc_handle->drv_priv); | 772 | ath9k_deinit_wmi(htc_handle->drv_priv); |
765 | ieee80211_free_hw(htc_handle->drv_priv->hw); | 773 | ieee80211_free_hw(htc_handle->drv_priv->hw); |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index ec7bcc8696ec..ca7f3a78eb11 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -94,8 +94,11 @@ void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv) | |||
94 | if (--priv->ps_usecount != 0) | 94 | if (--priv->ps_usecount != 0) |
95 | goto unlock; | 95 | goto unlock; |
96 | 96 | ||
97 | if (priv->ps_enabled) | 97 | if (priv->ps_idle) |
98 | ath9k_hw_setpower(priv->ah, ATH9K_PM_FULL_SLEEP); | ||
99 | else if (priv->ps_enabled) | ||
98 | ath9k_hw_setpower(priv->ah, ATH9K_PM_NETWORK_SLEEP); | 100 | ath9k_hw_setpower(priv->ah, ATH9K_PM_NETWORK_SLEEP); |
101 | |||
99 | unlock: | 102 | unlock: |
100 | mutex_unlock(&priv->htc_pm_lock); | 103 | mutex_unlock(&priv->htc_pm_lock); |
101 | } | 104 | } |
@@ -153,7 +156,6 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv, | |||
153 | ath_print(common, ATH_DBG_FATAL, | 156 | ath_print(common, ATH_DBG_FATAL, |
154 | "Unable to reset channel (%u Mhz) " | 157 | "Unable to reset channel (%u Mhz) " |
155 | "reset status %d\n", channel->center_freq, ret); | 158 | "reset status %d\n", channel->center_freq, ret); |
156 | ath9k_htc_ps_restore(priv); | ||
157 | goto err; | 159 | goto err; |
158 | } | 160 | } |
159 | 161 | ||
@@ -1097,7 +1099,7 @@ fail_tx: | |||
1097 | return 0; | 1099 | return 0; |
1098 | } | 1100 | } |
1099 | 1101 | ||
1100 | static int ath9k_htc_start(struct ieee80211_hw *hw) | 1102 | static int ath9k_htc_radio_enable(struct ieee80211_hw *hw) |
1101 | { | 1103 | { |
1102 | struct ath9k_htc_priv *priv = hw->priv; | 1104 | struct ath9k_htc_priv *priv = hw->priv; |
1103 | struct ath_hw *ah = priv->ah; | 1105 | struct ath_hw *ah = priv->ah; |
@@ -1113,8 +1115,6 @@ static int ath9k_htc_start(struct ieee80211_hw *hw) | |||
1113 | "Starting driver with initial channel: %d MHz\n", | 1115 | "Starting driver with initial channel: %d MHz\n", |
1114 | curchan->center_freq); | 1116 | curchan->center_freq); |
1115 | 1117 | ||
1116 | mutex_lock(&priv->mutex); | ||
1117 | |||
1118 | /* setup initial channel */ | 1118 | /* setup initial channel */ |
1119 | init_channel = ath9k_cmn_get_curchannel(hw, ah); | 1119 | init_channel = ath9k_cmn_get_curchannel(hw, ah); |
1120 | 1120 | ||
@@ -1127,7 +1127,7 @@ static int ath9k_htc_start(struct ieee80211_hw *hw) | |||
1127 | ath_print(common, ATH_DBG_FATAL, | 1127 | ath_print(common, ATH_DBG_FATAL, |
1128 | "Unable to reset hardware; reset status %d " | 1128 | "Unable to reset hardware; reset status %d " |
1129 | "(freq %u MHz)\n", ret, curchan->center_freq); | 1129 | "(freq %u MHz)\n", ret, curchan->center_freq); |
1130 | goto mutex_unlock; | 1130 | return ret; |
1131 | } | 1131 | } |
1132 | 1132 | ||
1133 | ath_update_txpow(priv); | 1133 | ath_update_txpow(priv); |
@@ -1135,16 +1135,8 @@ static int ath9k_htc_start(struct ieee80211_hw *hw) | |||
1135 | mode = ath9k_htc_get_curmode(priv, init_channel); | 1135 | mode = ath9k_htc_get_curmode(priv, init_channel); |
1136 | htc_mode = cpu_to_be16(mode); | 1136 | htc_mode = cpu_to_be16(mode); |
1137 | WMI_CMD_BUF(WMI_SET_MODE_CMDID, &htc_mode); | 1137 | WMI_CMD_BUF(WMI_SET_MODE_CMDID, &htc_mode); |
1138 | if (ret) | ||
1139 | goto mutex_unlock; | ||
1140 | |||
1141 | WMI_CMD(WMI_ATH_INIT_CMDID); | 1138 | WMI_CMD(WMI_ATH_INIT_CMDID); |
1142 | if (ret) | ||
1143 | goto mutex_unlock; | ||
1144 | |||
1145 | WMI_CMD(WMI_START_RECV_CMDID); | 1139 | WMI_CMD(WMI_START_RECV_CMDID); |
1146 | if (ret) | ||
1147 | goto mutex_unlock; | ||
1148 | 1140 | ||
1149 | ath9k_host_rx_init(priv); | 1141 | ath9k_host_rx_init(priv); |
1150 | 1142 | ||
@@ -1157,12 +1149,22 @@ static int ath9k_htc_start(struct ieee80211_hw *hw) | |||
1157 | 1149 | ||
1158 | ieee80211_wake_queues(hw); | 1150 | ieee80211_wake_queues(hw); |
1159 | 1151 | ||
1160 | mutex_unlock: | 1152 | return ret; |
1153 | } | ||
1154 | |||
1155 | static int ath9k_htc_start(struct ieee80211_hw *hw) | ||
1156 | { | ||
1157 | struct ath9k_htc_priv *priv = hw->priv; | ||
1158 | int ret = 0; | ||
1159 | |||
1160 | mutex_lock(&priv->mutex); | ||
1161 | ret = ath9k_htc_radio_enable(hw); | ||
1161 | mutex_unlock(&priv->mutex); | 1162 | mutex_unlock(&priv->mutex); |
1163 | |||
1162 | return ret; | 1164 | return ret; |
1163 | } | 1165 | } |
1164 | 1166 | ||
1165 | static void ath9k_htc_stop(struct ieee80211_hw *hw) | 1167 | static void ath9k_htc_radio_disable(struct ieee80211_hw *hw) |
1166 | { | 1168 | { |
1167 | struct ath9k_htc_priv *priv = hw->priv; | 1169 | struct ath9k_htc_priv *priv = hw->priv; |
1168 | struct ath_hw *ah = priv->ah; | 1170 | struct ath_hw *ah = priv->ah; |
@@ -1170,14 +1172,18 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw) | |||
1170 | int ret = 0; | 1172 | int ret = 0; |
1171 | u8 cmd_rsp; | 1173 | u8 cmd_rsp; |
1172 | 1174 | ||
1173 | mutex_lock(&priv->mutex); | ||
1174 | |||
1175 | if (priv->op_flags & OP_INVALID) { | 1175 | if (priv->op_flags & OP_INVALID) { |
1176 | ath_print(common, ATH_DBG_ANY, "Device not present\n"); | 1176 | ath_print(common, ATH_DBG_ANY, "Device not present\n"); |
1177 | mutex_unlock(&priv->mutex); | ||
1178 | return; | 1177 | return; |
1179 | } | 1178 | } |
1180 | 1179 | ||
1180 | /* Cancel all the running timers/work .. */ | ||
1181 | cancel_work_sync(&priv->ps_work); | ||
1182 | cancel_delayed_work_sync(&priv->ath9k_ani_work); | ||
1183 | cancel_delayed_work_sync(&priv->ath9k_aggr_work); | ||
1184 | cancel_delayed_work_sync(&priv->ath9k_led_blink_work); | ||
1185 | ath9k_led_stop_brightness(priv); | ||
1186 | |||
1181 | ath9k_htc_ps_wakeup(priv); | 1187 | ath9k_htc_ps_wakeup(priv); |
1182 | htc_stop(priv->htc); | 1188 | htc_stop(priv->htc); |
1183 | WMI_CMD(WMI_DISABLE_INTR_CMDID); | 1189 | WMI_CMD(WMI_DISABLE_INTR_CMDID); |
@@ -1189,11 +1195,6 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw) | |||
1189 | ath9k_htc_ps_restore(priv); | 1195 | ath9k_htc_ps_restore(priv); |
1190 | ath9k_htc_setpower(priv, ATH9K_PM_FULL_SLEEP); | 1196 | ath9k_htc_setpower(priv, ATH9K_PM_FULL_SLEEP); |
1191 | 1197 | ||
1192 | cancel_work_sync(&priv->ps_work); | ||
1193 | cancel_delayed_work_sync(&priv->ath9k_ani_work); | ||
1194 | cancel_delayed_work_sync(&priv->ath9k_aggr_work); | ||
1195 | cancel_delayed_work_sync(&priv->ath9k_led_blink_work); | ||
1196 | ath9k_led_stop_brightness(priv); | ||
1197 | skb_queue_purge(&priv->tx_queue); | 1198 | skb_queue_purge(&priv->tx_queue); |
1198 | 1199 | ||
1199 | /* Remove monitor interface here */ | 1200 | /* Remove monitor interface here */ |
@@ -1207,11 +1208,20 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw) | |||
1207 | } | 1208 | } |
1208 | 1209 | ||
1209 | priv->op_flags |= OP_INVALID; | 1210 | priv->op_flags |= OP_INVALID; |
1210 | mutex_unlock(&priv->mutex); | ||
1211 | 1211 | ||
1212 | ath_print(common, ATH_DBG_CONFIG, "Driver halt\n"); | 1212 | ath_print(common, ATH_DBG_CONFIG, "Driver halt\n"); |
1213 | } | 1213 | } |
1214 | 1214 | ||
1215 | static void ath9k_htc_stop(struct ieee80211_hw *hw) | ||
1216 | { | ||
1217 | struct ath9k_htc_priv *priv = hw->priv; | ||
1218 | |||
1219 | mutex_lock(&priv->mutex); | ||
1220 | ath9k_htc_radio_disable(hw); | ||
1221 | mutex_unlock(&priv->mutex); | ||
1222 | } | ||
1223 | |||
1224 | |||
1215 | static int ath9k_htc_add_interface(struct ieee80211_hw *hw, | 1225 | static int ath9k_htc_add_interface(struct ieee80211_hw *hw, |
1216 | struct ieee80211_vif *vif) | 1226 | struct ieee80211_vif *vif) |
1217 | { | 1227 | { |
@@ -1325,6 +1335,23 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed) | |||
1325 | 1335 | ||
1326 | mutex_lock(&priv->mutex); | 1336 | mutex_lock(&priv->mutex); |
1327 | 1337 | ||
1338 | if (changed & IEEE80211_CONF_CHANGE_IDLE) { | ||
1339 | bool enable_radio = false; | ||
1340 | bool idle = !!(conf->flags & IEEE80211_CONF_IDLE); | ||
1341 | |||
1342 | if (!idle && priv->ps_idle) | ||
1343 | enable_radio = true; | ||
1344 | |||
1345 | priv->ps_idle = idle; | ||
1346 | |||
1347 | if (enable_radio) { | ||
1348 | ath9k_htc_setpower(priv, ATH9K_PM_AWAKE); | ||
1349 | ath9k_htc_radio_enable(hw); | ||
1350 | ath_print(common, ATH_DBG_CONFIG, | ||
1351 | "not-idle: enabling radio\n"); | ||
1352 | } | ||
1353 | } | ||
1354 | |||
1328 | if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { | 1355 | if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { |
1329 | struct ieee80211_channel *curchan = hw->conf.channel; | 1356 | struct ieee80211_channel *curchan = hw->conf.channel; |
1330 | int pos = curchan->hw_value; | 1357 | int pos = curchan->hw_value; |
@@ -1368,6 +1395,13 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed) | |||
1368 | } | 1395 | } |
1369 | } | 1396 | } |
1370 | 1397 | ||
1398 | if (priv->ps_idle) { | ||
1399 | ath_print(common, ATH_DBG_CONFIG, | ||
1400 | "idle: disabling radio\n"); | ||
1401 | ath9k_htc_radio_disable(hw); | ||
1402 | } | ||
1403 | |||
1404 | |||
1371 | mutex_unlock(&priv->mutex); | 1405 | mutex_unlock(&priv->mutex); |
1372 | 1406 | ||
1373 | return 0; | 1407 | return 0; |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c index 2c3c51007dd3..28abc7d5e909 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | |||
@@ -244,16 +244,25 @@ void ath9k_htc_txep(void *drv_priv, struct sk_buff *skb, | |||
244 | enum htc_endpoint_id ep_id, bool txok) | 244 | enum htc_endpoint_id ep_id, bool txok) |
245 | { | 245 | { |
246 | struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) drv_priv; | 246 | struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) drv_priv; |
247 | struct ath_common *common = ath9k_hw_common(priv->ah); | ||
247 | struct ieee80211_tx_info *tx_info; | 248 | struct ieee80211_tx_info *tx_info; |
248 | 249 | ||
249 | if (!skb) | 250 | if (!skb) |
250 | return; | 251 | return; |
251 | 252 | ||
252 | if (ep_id == priv->mgmt_ep) | 253 | if (ep_id == priv->mgmt_ep) { |
253 | skb_pull(skb, sizeof(struct tx_mgmt_hdr)); | 254 | skb_pull(skb, sizeof(struct tx_mgmt_hdr)); |
254 | else | 255 | } else if ((ep_id == priv->data_bk_ep) || |
255 | /* TODO: Check for cab/uapsd/data */ | 256 | (ep_id == priv->data_be_ep) || |
257 | (ep_id == priv->data_vi_ep) || | ||
258 | (ep_id == priv->data_vo_ep)) { | ||
256 | skb_pull(skb, sizeof(struct tx_frame_hdr)); | 259 | skb_pull(skb, sizeof(struct tx_frame_hdr)); |
260 | } else { | ||
261 | ath_print(common, ATH_DBG_FATAL, | ||
262 | "Unsupported TX EPID: %d\n", ep_id); | ||
263 | dev_kfree_skb_any(skb); | ||
264 | return; | ||
265 | } | ||
257 | 266 | ||
258 | tx_info = IEEE80211_SKB_CB(skb); | 267 | tx_info = IEEE80211_SKB_CB(skb); |
259 | 268 | ||
@@ -439,10 +448,32 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, | |||
439 | struct ieee80211_hw *hw = priv->hw; | 448 | struct ieee80211_hw *hw = priv->hw; |
440 | struct sk_buff *skb = rxbuf->skb; | 449 | struct sk_buff *skb = rxbuf->skb; |
441 | struct ath_common *common = ath9k_hw_common(priv->ah); | 450 | struct ath_common *common = ath9k_hw_common(priv->ah); |
451 | struct ath_htc_rx_status *rxstatus; | ||
442 | int hdrlen, padpos, padsize; | 452 | int hdrlen, padpos, padsize; |
443 | int last_rssi = ATH_RSSI_DUMMY_MARKER; | 453 | int last_rssi = ATH_RSSI_DUMMY_MARKER; |
444 | __le16 fc; | 454 | __le16 fc; |
445 | 455 | ||
456 | if (skb->len <= HTC_RX_FRAME_HEADER_SIZE) { | ||
457 | ath_print(common, ATH_DBG_FATAL, | ||
458 | "Corrupted RX frame, dropping\n"); | ||
459 | goto rx_next; | ||
460 | } | ||
461 | |||
462 | rxstatus = (struct ath_htc_rx_status *)skb->data; | ||
463 | |||
464 | if (be16_to_cpu(rxstatus->rs_datalen) - | ||
465 | (skb->len - HTC_RX_FRAME_HEADER_SIZE) != 0) { | ||
466 | ath_print(common, ATH_DBG_FATAL, | ||
467 | "Corrupted RX data len, dropping " | ||
468 | "(dlen: %d, skblen: %d)\n", | ||
469 | rxstatus->rs_datalen, skb->len); | ||
470 | goto rx_next; | ||
471 | } | ||
472 | |||
473 | /* Get the RX status information */ | ||
474 | memcpy(&rxbuf->rxstatus, rxstatus, HTC_RX_FRAME_HEADER_SIZE); | ||
475 | skb_pull(skb, HTC_RX_FRAME_HEADER_SIZE); | ||
476 | |||
446 | hdr = (struct ieee80211_hdr *)skb->data; | 477 | hdr = (struct ieee80211_hdr *)skb->data; |
447 | fc = hdr->frame_control; | 478 | fc = hdr->frame_control; |
448 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 479 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
@@ -607,8 +638,6 @@ void ath9k_htc_rxep(void *drv_priv, struct sk_buff *skb, | |||
607 | struct ath_hw *ah = priv->ah; | 638 | struct ath_hw *ah = priv->ah; |
608 | struct ath_common *common = ath9k_hw_common(ah); | 639 | struct ath_common *common = ath9k_hw_common(ah); |
609 | struct ath9k_htc_rxbuf *rxbuf = NULL, *tmp_buf = NULL; | 640 | struct ath9k_htc_rxbuf *rxbuf = NULL, *tmp_buf = NULL; |
610 | struct ath_htc_rx_status *rxstatus; | ||
611 | u32 len = 0; | ||
612 | 641 | ||
613 | spin_lock(&priv->rx.rxbuflock); | 642 | spin_lock(&priv->rx.rxbuflock); |
614 | list_for_each_entry(tmp_buf, &priv->rx.rxbuf, list) { | 643 | list_for_each_entry(tmp_buf, &priv->rx.rxbuf, list) { |
@@ -625,27 +654,7 @@ void ath9k_htc_rxep(void *drv_priv, struct sk_buff *skb, | |||
625 | goto err; | 654 | goto err; |
626 | } | 655 | } |
627 | 656 | ||
628 | len = skb->len; | ||
629 | if (len <= HTC_RX_FRAME_HEADER_SIZE) { | ||
630 | ath_print(common, ATH_DBG_FATAL, | ||
631 | "Corrupted RX frame, dropping\n"); | ||
632 | goto err; | ||
633 | } | ||
634 | |||
635 | rxstatus = (struct ath_htc_rx_status *)skb->data; | ||
636 | |||
637 | if (be16_to_cpu(rxstatus->rs_datalen) - | ||
638 | (len - HTC_RX_FRAME_HEADER_SIZE) != 0) { | ||
639 | ath_print(common, ATH_DBG_FATAL, | ||
640 | "Corrupted RX data len, dropping " | ||
641 | "(epid: %d, dlen: %d, skblen: %d)\n", | ||
642 | ep_id, rxstatus->rs_datalen, len); | ||
643 | goto err; | ||
644 | } | ||
645 | |||
646 | spin_lock(&priv->rx.rxbuflock); | 657 | spin_lock(&priv->rx.rxbuflock); |
647 | memcpy(&rxbuf->rxstatus, rxstatus, HTC_RX_FRAME_HEADER_SIZE); | ||
648 | skb_pull(skb, HTC_RX_FRAME_HEADER_SIZE); | ||
649 | rxbuf->skb = skb; | 658 | rxbuf->skb = skb; |
650 | rxbuf->in_process = true; | 659 | rxbuf->in_process = true; |
651 | spin_unlock(&priv->rx.rxbuflock); | 660 | spin_unlock(&priv->rx.rxbuflock); |
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c index f2dca258bdc2..7bf6ce1e7e2e 100644 --- a/drivers/net/wireless/ath/ath9k/htc_hst.c +++ b/drivers/net/wireless/ath/ath9k/htc_hst.c | |||
@@ -341,8 +341,9 @@ void ath9k_htc_txcompletion_cb(struct htc_target *htc_handle, | |||
341 | skb_pull(skb, sizeof(struct htc_frame_hdr)); | 341 | skb_pull(skb, sizeof(struct htc_frame_hdr)); |
342 | 342 | ||
343 | if (endpoint->ep_callbacks.tx) { | 343 | if (endpoint->ep_callbacks.tx) { |
344 | endpoint->ep_callbacks.tx(htc_handle->drv_priv, skb, | 344 | endpoint->ep_callbacks.tx(endpoint->ep_callbacks.priv, |
345 | htc_hdr->endpoint_id, txok); | 345 | skb, htc_hdr->endpoint_id, |
346 | txok); | ||
346 | } | 347 | } |
347 | } | 348 | } |
348 | 349 | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 5a29048db3b1..559019262d30 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #define ATH9K_CLOCK_RATE_CCK 22 | 26 | #define ATH9K_CLOCK_RATE_CCK 22 |
27 | #define ATH9K_CLOCK_RATE_5GHZ_OFDM 40 | 27 | #define ATH9K_CLOCK_RATE_5GHZ_OFDM 40 |
28 | #define ATH9K_CLOCK_RATE_2GHZ_OFDM 44 | 28 | #define ATH9K_CLOCK_RATE_2GHZ_OFDM 44 |
29 | #define ATH9K_CLOCK_FAST_RATE_5GHZ_OFDM 44 | ||
29 | 30 | ||
30 | static bool ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type); | 31 | static bool ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type); |
31 | 32 | ||
@@ -91,7 +92,11 @@ static u32 ath9k_hw_mac_clks(struct ath_hw *ah, u32 usecs) | |||
91 | return usecs *ATH9K_CLOCK_RATE_CCK; | 92 | return usecs *ATH9K_CLOCK_RATE_CCK; |
92 | if (conf->channel->band == IEEE80211_BAND_2GHZ) | 93 | if (conf->channel->band == IEEE80211_BAND_2GHZ) |
93 | return usecs *ATH9K_CLOCK_RATE_2GHZ_OFDM; | 94 | return usecs *ATH9K_CLOCK_RATE_2GHZ_OFDM; |
94 | return usecs *ATH9K_CLOCK_RATE_5GHZ_OFDM; | 95 | |
96 | if (ah->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK) | ||
97 | return usecs * ATH9K_CLOCK_FAST_RATE_5GHZ_OFDM; | ||
98 | else | ||
99 | return usecs * ATH9K_CLOCK_RATE_5GHZ_OFDM; | ||
95 | } | 100 | } |
96 | 101 | ||
97 | static u32 ath9k_hw_mac_to_clks(struct ath_hw *ah, u32 usecs) | 102 | static u32 ath9k_hw_mac_to_clks(struct ath_hw *ah, u32 usecs) |
@@ -387,6 +392,12 @@ static void ath9k_hw_init_config(struct ath_hw *ah) | |||
387 | ah->config.rx_intr_mitigation = true; | 392 | ah->config.rx_intr_mitigation = true; |
388 | 393 | ||
389 | /* | 394 | /* |
395 | * Tx IQ Calibration (ah->config.tx_iq_calibration) is only | ||
396 | * used by AR9003, but it is showing reliability issues. | ||
397 | * It will take a while to fix so this is currently disabled. | ||
398 | */ | ||
399 | |||
400 | /* | ||
390 | * We need this for PCI devices only (Cardbus, PCI, miniPCI) | 401 | * We need this for PCI devices only (Cardbus, PCI, miniPCI) |
391 | * _and_ if on non-uniprocessor systems (Multiprocessor/HT). | 402 | * _and_ if on non-uniprocessor systems (Multiprocessor/HT). |
392 | * This means we use it for all AR5416 devices, and the few | 403 | * This means we use it for all AR5416 devices, and the few |
@@ -819,9 +830,6 @@ void ath9k_hw_deinit(struct ath_hw *ah) | |||
819 | if (common->state < ATH_HW_INITIALIZED) | 830 | if (common->state < ATH_HW_INITIALIZED) |
820 | goto free_hw; | 831 | goto free_hw; |
821 | 832 | ||
822 | if (!AR_SREV_9100(ah)) | ||
823 | ath9k_hw_ani_disable(ah); | ||
824 | |||
825 | ath9k_hw_setpower(ah, ATH9K_PM_FULL_SLEEP); | 833 | ath9k_hw_setpower(ah, ATH9K_PM_FULL_SLEEP); |
826 | 834 | ||
827 | free_hw: | 835 | free_hw: |
@@ -1221,8 +1229,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
1221 | (chan->channel != ah->curchan->channel) && | 1229 | (chan->channel != ah->curchan->channel) && |
1222 | ((chan->channelFlags & CHANNEL_ALL) == | 1230 | ((chan->channelFlags & CHANNEL_ALL) == |
1223 | (ah->curchan->channelFlags & CHANNEL_ALL)) && | 1231 | (ah->curchan->channelFlags & CHANNEL_ALL)) && |
1224 | !(AR_SREV_9280(ah) || IS_CHAN_A_5MHZ_SPACED(chan) || | 1232 | !AR_SREV_9280(ah)) { |
1225 | IS_CHAN_A_5MHZ_SPACED(ah->curchan))) { | ||
1226 | 1233 | ||
1227 | if (ath9k_hw_channel_change(ah, chan)) { | 1234 | if (ath9k_hw_channel_change(ah, chan)) { |
1228 | ath9k_hw_loadnf(ah, ah->curchan); | 1235 | ath9k_hw_loadnf(ah, ah->curchan); |
@@ -2186,7 +2193,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
2186 | } | 2193 | } |
2187 | 2194 | ||
2188 | if (AR_SREV_9300_20_OR_LATER(ah)) { | 2195 | if (AR_SREV_9300_20_OR_LATER(ah)) { |
2189 | pCap->hw_caps |= ATH9K_HW_CAP_EDMA | ATH9K_HW_CAP_LDPC; | 2196 | pCap->hw_caps |= ATH9K_HW_CAP_EDMA | ATH9K_HW_CAP_LDPC | |
2197 | ATH9K_HW_CAP_FASTCLOCK; | ||
2190 | pCap->rx_hp_qdepth = ATH9K_HW_RX_HP_QDEPTH; | 2198 | pCap->rx_hp_qdepth = ATH9K_HW_RX_HP_QDEPTH; |
2191 | pCap->rx_lp_qdepth = ATH9K_HW_RX_LP_QDEPTH; | 2199 | pCap->rx_lp_qdepth = ATH9K_HW_RX_LP_QDEPTH; |
2192 | pCap->rx_status_len = sizeof(struct ar9003_rxs); | 2200 | pCap->rx_status_len = sizeof(struct ar9003_rxs); |
@@ -2194,6 +2202,11 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
2194 | pCap->txs_len = sizeof(struct ar9003_txs); | 2202 | pCap->txs_len = sizeof(struct ar9003_txs); |
2195 | } else { | 2203 | } else { |
2196 | pCap->tx_desc_len = sizeof(struct ath_desc); | 2204 | pCap->tx_desc_len = sizeof(struct ath_desc); |
2205 | if (AR_SREV_9280_20(ah) && | ||
2206 | ((ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) <= | ||
2207 | AR5416_EEP_MINOR_VER_16) || | ||
2208 | ah->eep_ops->get_eeprom(ah, EEP_FSTCLK_5G))) | ||
2209 | pCap->hw_caps |= ATH9K_HW_CAP_FASTCLOCK; | ||
2197 | } | 2210 | } |
2198 | 2211 | ||
2199 | if (AR_SREV_9300_20_OR_LATER(ah)) | 2212 | if (AR_SREV_9300_20_OR_LATER(ah)) |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index a78e09bab431..77245dff5993 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -198,6 +198,7 @@ enum ath9k_hw_caps { | |||
198 | ATH9K_HW_CAP_EDMA = BIT(17), | 198 | ATH9K_HW_CAP_EDMA = BIT(17), |
199 | ATH9K_HW_CAP_RAC_SUPPORTED = BIT(18), | 199 | ATH9K_HW_CAP_RAC_SUPPORTED = BIT(18), |
200 | ATH9K_HW_CAP_LDPC = BIT(19), | 200 | ATH9K_HW_CAP_LDPC = BIT(19), |
201 | ATH9K_HW_CAP_FASTCLOCK = BIT(20), | ||
201 | }; | 202 | }; |
202 | 203 | ||
203 | enum ath9k_capability_type { | 204 | enum ath9k_capability_type { |
@@ -261,6 +262,7 @@ struct ath9k_ops_config { | |||
261 | #define AR_BASE_FREQ_5GHZ 4900 | 262 | #define AR_BASE_FREQ_5GHZ 4900 |
262 | #define AR_SPUR_FEEQ_BOUND_HT40 19 | 263 | #define AR_SPUR_FEEQ_BOUND_HT40 19 |
263 | #define AR_SPUR_FEEQ_BOUND_HT20 10 | 264 | #define AR_SPUR_FEEQ_BOUND_HT20 10 |
265 | bool tx_iq_calibration; /* Only available for >= AR9003 */ | ||
264 | int spurmode; | 266 | int spurmode; |
265 | u16 spurchans[AR_EEPROM_MODAL_SPURS][2]; | 267 | u16 spurchans[AR_EEPROM_MODAL_SPURS][2]; |
266 | u8 max_txtrig_level; | 268 | u8 max_txtrig_level; |
@@ -367,10 +369,9 @@ struct ath9k_channel { | |||
367 | #define IS_CHAN_2GHZ(_c) (((_c)->channelFlags & CHANNEL_2GHZ) != 0) | 369 | #define IS_CHAN_2GHZ(_c) (((_c)->channelFlags & CHANNEL_2GHZ) != 0) |
368 | #define IS_CHAN_HALF_RATE(_c) (((_c)->channelFlags & CHANNEL_HALF) != 0) | 370 | #define IS_CHAN_HALF_RATE(_c) (((_c)->channelFlags & CHANNEL_HALF) != 0) |
369 | #define IS_CHAN_QUARTER_RATE(_c) (((_c)->channelFlags & CHANNEL_QUARTER) != 0) | 371 | #define IS_CHAN_QUARTER_RATE(_c) (((_c)->channelFlags & CHANNEL_QUARTER) != 0) |
370 | #define IS_CHAN_A_5MHZ_SPACED(_c) \ | 372 | #define IS_CHAN_A_FAST_CLOCK(_ah, _c) \ |
371 | ((((_c)->channelFlags & CHANNEL_5GHZ) != 0) && \ | 373 | ((((_c)->channelFlags & CHANNEL_5GHZ) != 0) && \ |
372 | (((_c)->channel % 20) != 0) && \ | 374 | ((_ah)->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK)) |
373 | (((_c)->channel % 10) != 0)) | ||
374 | 375 | ||
375 | /* These macros check chanmode and not channelFlags */ | 376 | /* These macros check chanmode and not channelFlags */ |
376 | #define IS_CHAN_B(_c) ((_c)->chanmode == CHANNEL_B) | 377 | #define IS_CHAN_B(_c) ((_c)->chanmode == CHANNEL_B) |
@@ -718,6 +719,7 @@ struct ath_hw { | |||
718 | u32 *addac5416_21; | 719 | u32 *addac5416_21; |
719 | u32 *bank6Temp; | 720 | u32 *bank6Temp; |
720 | 721 | ||
722 | u8 txpower_limit; | ||
721 | int16_t txpower_indexoffset; | 723 | int16_t txpower_indexoffset; |
722 | int coverage_class; | 724 | int coverage_class; |
723 | u32 beacon_interval; | 725 | u32 beacon_interval; |
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c index 7bbf502563bc..0e425cb4bbb1 100644 --- a/drivers/net/wireless/ath/ath9k/mac.c +++ b/drivers/net/wireless/ath/ath9k/mac.c | |||
@@ -878,10 +878,12 @@ enum ath9k_int ath9k_hw_set_interrupts(struct ath_hw *ah, | |||
878 | if (ints & ATH9K_INT_TX) { | 878 | if (ints & ATH9K_INT_TX) { |
879 | if (ah->config.tx_intr_mitigation) | 879 | if (ah->config.tx_intr_mitigation) |
880 | mask |= AR_IMR_TXMINTR | AR_IMR_TXINTM; | 880 | mask |= AR_IMR_TXMINTR | AR_IMR_TXINTM; |
881 | if (ah->txok_interrupt_mask) | 881 | else { |
882 | mask |= AR_IMR_TXOK; | 882 | if (ah->txok_interrupt_mask) |
883 | if (ah->txdesc_interrupt_mask) | 883 | mask |= AR_IMR_TXOK; |
884 | mask |= AR_IMR_TXDESC; | 884 | if (ah->txdesc_interrupt_mask) |
885 | mask |= AR_IMR_TXDESC; | ||
886 | } | ||
885 | if (ah->txerr_interrupt_mask) | 887 | if (ah->txerr_interrupt_mask) |
886 | mask |= AR_IMR_TXERR; | 888 | mask |= AR_IMR_TXERR; |
887 | if (ah->txeol_interrupt_mask) | 889 | if (ah->txeol_interrupt_mask) |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index aad370a7f95b..893b552981a0 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -2044,6 +2044,25 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw, | |||
2044 | return ret; | 2044 | return ret; |
2045 | } | 2045 | } |
2046 | 2046 | ||
2047 | static int ath9k_get_survey(struct ieee80211_hw *hw, int idx, | ||
2048 | struct survey_info *survey) | ||
2049 | { | ||
2050 | struct ath_wiphy *aphy = hw->priv; | ||
2051 | struct ath_softc *sc = aphy->sc; | ||
2052 | struct ath_hw *ah = sc->sc_ah; | ||
2053 | struct ath_common *common = ath9k_hw_common(ah); | ||
2054 | struct ieee80211_conf *conf = &hw->conf; | ||
2055 | |||
2056 | if (idx != 0) | ||
2057 | return -ENOENT; | ||
2058 | |||
2059 | survey->channel = conf->channel; | ||
2060 | survey->filled = SURVEY_INFO_NOISE_DBM; | ||
2061 | survey->noise = common->ani.noise_floor; | ||
2062 | |||
2063 | return 0; | ||
2064 | } | ||
2065 | |||
2047 | static void ath9k_sw_scan_start(struct ieee80211_hw *hw) | 2066 | static void ath9k_sw_scan_start(struct ieee80211_hw *hw) |
2048 | { | 2067 | { |
2049 | struct ath_wiphy *aphy = hw->priv; | 2068 | struct ath_wiphy *aphy = hw->priv; |
@@ -2115,6 +2134,7 @@ struct ieee80211_ops ath9k_ops = { | |||
2115 | .set_tsf = ath9k_set_tsf, | 2134 | .set_tsf = ath9k_set_tsf, |
2116 | .reset_tsf = ath9k_reset_tsf, | 2135 | .reset_tsf = ath9k_reset_tsf, |
2117 | .ampdu_action = ath9k_ampdu_action, | 2136 | .ampdu_action = ath9k_ampdu_action, |
2137 | .get_survey = ath9k_get_survey, | ||
2118 | .sw_scan_start = ath9k_sw_scan_start, | 2138 | .sw_scan_start = ath9k_sw_scan_start, |
2119 | .sw_scan_complete = ath9k_sw_scan_complete, | 2139 | .sw_scan_complete = ath9k_sw_scan_complete, |
2120 | .rfkill_poll = ath9k_rfkill_poll_state, | 2140 | .rfkill_poll = ath9k_rfkill_poll_state, |
diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c index dc6c6fc2e095..e23172c9caaf 100644 --- a/drivers/net/wireless/ath/ath9k/wmi.c +++ b/drivers/net/wireless/ath/ath9k/wmi.c | |||
@@ -276,6 +276,9 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id, | |||
276 | int time_left, ret = 0; | 276 | int time_left, ret = 0; |
277 | unsigned long flags; | 277 | unsigned long flags; |
278 | 278 | ||
279 | if (wmi->drv_priv->op_flags & OP_UNPLUGGED) | ||
280 | return 0; | ||
281 | |||
279 | if (!wmi) | 282 | if (!wmi) |
280 | return -EINVAL; | 283 | return -EINVAL; |
281 | 284 | ||
@@ -302,14 +305,14 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id, | |||
302 | wmi->cmd_rsp_buf = rsp_buf; | 305 | wmi->cmd_rsp_buf = rsp_buf; |
303 | wmi->cmd_rsp_len = rsp_len; | 306 | wmi->cmd_rsp_len = rsp_len; |
304 | 307 | ||
305 | ret = ath9k_wmi_cmd_issue(wmi, skb, cmd_id, cmd_len); | ||
306 | if (ret) | ||
307 | goto out; | ||
308 | |||
309 | spin_lock_irqsave(&wmi->wmi_lock, flags); | 308 | spin_lock_irqsave(&wmi->wmi_lock, flags); |
310 | wmi->last_cmd_id = cmd_id; | 309 | wmi->last_cmd_id = cmd_id; |
311 | spin_unlock_irqrestore(&wmi->wmi_lock, flags); | 310 | spin_unlock_irqrestore(&wmi->wmi_lock, flags); |
312 | 311 | ||
312 | ret = ath9k_wmi_cmd_issue(wmi, skb, cmd_id, cmd_len); | ||
313 | if (ret) | ||
314 | goto out; | ||
315 | |||
313 | time_left = wait_for_completion_timeout(&wmi->cmd_wait, timeout); | 316 | time_left = wait_for_completion_timeout(&wmi->cmd_wait, timeout); |
314 | if (!time_left) { | 317 | if (!time_left) { |
315 | ath_print(common, ATH_DBG_WMI, | 318 | ath_print(common, ATH_DBG_WMI, |
diff --git a/drivers/net/wireless/ath/ath9k/wmi.h b/drivers/net/wireless/ath/ath9k/wmi.h index 167e15c50062..765db5faa2d3 100644 --- a/drivers/net/wireless/ath/ath9k/wmi.h +++ b/drivers/net/wireless/ath/ath9k/wmi.h | |||
@@ -126,14 +126,14 @@ void ath9k_wmi_tasklet(unsigned long data); | |||
126 | do { \ | 126 | do { \ |
127 | ret = ath9k_wmi_cmd(priv->wmi, _wmi_cmd, NULL, 0, \ | 127 | ret = ath9k_wmi_cmd(priv->wmi, _wmi_cmd, NULL, 0, \ |
128 | (u8 *) &cmd_rsp, \ | 128 | (u8 *) &cmd_rsp, \ |
129 | sizeof(cmd_rsp), HZ); \ | 129 | sizeof(cmd_rsp), HZ*2); \ |
130 | } while (0) | 130 | } while (0) |
131 | 131 | ||
132 | #define WMI_CMD_BUF(_wmi_cmd, _buf) \ | 132 | #define WMI_CMD_BUF(_wmi_cmd, _buf) \ |
133 | do { \ | 133 | do { \ |
134 | ret = ath9k_wmi_cmd(priv->wmi, _wmi_cmd, \ | 134 | ret = ath9k_wmi_cmd(priv->wmi, _wmi_cmd, \ |
135 | (u8 *) _buf, sizeof(*_buf), \ | 135 | (u8 *) _buf, sizeof(*_buf), \ |
136 | &cmd_rsp, sizeof(cmd_rsp), HZ); \ | 136 | &cmd_rsp, sizeof(cmd_rsp), HZ*2); \ |
137 | } while (0) | 137 | } while (0) |
138 | 138 | ||
139 | #endif /* WMI_H */ | 139 | #endif /* WMI_H */ |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index b0d345a675fe..3db19172b43b 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -2290,6 +2290,8 @@ void ath_tx_edma_tasklet(struct ath_softc *sc) | |||
2290 | ath_tx_complete_buf(sc, bf, txq, &bf_head, | 2290 | ath_tx_complete_buf(sc, bf, txq, &bf_head, |
2291 | &txs, txok, 0); | 2291 | &txs, txok, 0); |
2292 | 2292 | ||
2293 | ath_wake_mac80211_queue(sc, txq); | ||
2294 | |||
2293 | spin_lock_bh(&txq->axq_lock); | 2295 | spin_lock_bh(&txq->axq_lock); |
2294 | if (!list_empty(&txq->txq_fifo_pending)) { | 2296 | if (!list_empty(&txq->txq_fifo_pending)) { |
2295 | INIT_LIST_HEAD(&bf_head); | 2297 | INIT_LIST_HEAD(&bf_head); |