ath9k: use cold reset instead of warm reset on ar9280 to make recovery from stuck...
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 593-ath9k_ar9280_cold_reset.patch
1 --- a/drivers/net/wireless/ath/ath9k/hw.c
2 +++ b/drivers/net/wireless/ath/ath9k/hw.c
3 @@ -1368,10 +1368,16 @@ static bool ath9k_hw_set_reset_reg(struc
4 static bool ath9k_hw_chip_reset(struct ath_hw *ah,
5 struct ath9k_channel *chan)
6 {
7 - if (AR_SREV_9280(ah) && ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) {
8 - if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON))
9 - return false;
10 - } else if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_WARM))
11 + int reset_type = ATH9K_RESET_WARM;
12 +
13 + if (AR_SREV_9280(ah)) {
14 + if (ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL))
15 + reset_type = ATH9K_RESET_POWER_ON;
16 + else
17 + reset_type = ATH9K_RESET_COLD;
18 + }
19 +
20 + if (!ath9k_hw_set_reset_reg(ah, reset_type))
21 return false;
22
23 if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))