ar71xx: add an external reset callback for ar913x and use it in ath9k
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 556-ath9k_ar913x_external_reset.patch
1 --- a/drivers/net/wireless/ath/ath9k/hw.c
2 +++ b/drivers/net/wireless/ath/ath9k/hw.c
3 @@ -1374,7 +1374,10 @@ static bool ath9k_hw_set_reset(struct at
4
5 REGWRITE_BUFFER_FLUSH(ah);
6
7 - udelay(50);
8 + if (AR_SREV_9100(ah))
9 + mdelay(10);
10 + else
11 + udelay(50);
12
13 REG_WRITE(ah, AR_RTC_RC, 0);
14 if (!ath9k_hw_wait(ah, AR_RTC_RC, AR_RTC_RC_M, 0, AH_WAIT_TIMEOUT)) {
15 @@ -1385,8 +1388,12 @@ static bool ath9k_hw_set_reset(struct at
16 if (!AR_SREV_9100(ah))
17 REG_WRITE(ah, AR_RC, 0);
18
19 - if (AR_SREV_9100(ah))
20 + if (AR_SREV_9100(ah) && type != ATH9K_RESET_WARM) {
21 + if (ah->external_reset)
22 + ah->external_reset();
23 +
24 udelay(50);
25 + }
26
27 return true;
28 }