1 --- a/drivers/net/wireless/ath/ath9k/hw.c
2 +++ b/drivers/net/wireless/ath/ath9k/hw.c
3 @@ -1170,6 +1170,41 @@ static bool ath9k_hw_set_reset(struct at
4 rst_flags |= AR_RTC_RC_MAC_COLD;
7 + if (AR_SREV_9330(ah)) {
12 + * call external reset function to reset WMAC if:
13 + * - doing a cold reset
14 + * - we have pending frames in the TX queues
17 + for (i = 0; i < AR_NUM_QCU; i++) {
18 + npend = ath9k_hw_numtxpending(ah, i);
23 + if (ah->external_reset &&
24 + (npend || type == ATH9K_RESET_COLD)) {
27 + ath_dbg(ath9k_hw_common(ah), ATH_DBG_RESET,
28 + "reset MAC via external reset\n");
30 + reset_err = ah->external_reset();
32 + ath_err(ath9k_hw_common(ah),
33 + "External reset failed, err=%d\n",
38 + REG_WRITE(ah, AR_RTC_RESET, 1);
42 REG_WRITE(ah, AR_RTC_RC, rst_flags);
44 REGWRITE_BUFFER_FLUSH(ah);
45 --- a/drivers/net/wireless/ath/ath9k/hw.h
46 +++ b/drivers/net/wireless/ath/ath9k/hw.h
47 @@ -864,6 +864,7 @@ struct ath_hw {
50 int (*get_mac_revision)(void);
51 + int (*external_reset)(void);
55 --- a/drivers/net/wireless/ath/ath9k/init.c
56 +++ b/drivers/net/wireless/ath/ath9k/init.c
57 @@ -576,6 +576,7 @@ static int ath9k_init_softc(u16 devid, s
58 sc->sc_ah->led_pin = pdata->led_pin;
59 ah->is_clk_25mhz = pdata->is_clk_25mhz;
60 ah->get_mac_revision = pdata->get_mac_revision;
61 + ah->external_reset = pdata->external_reset;
64 common = ath9k_hw_common(ah);
65 --- a/include/linux/ath9k_platform.h
66 +++ b/include/linux/ath9k_platform.h
67 @@ -31,6 +31,7 @@ struct ath9k_platform_data {
70 int (*get_mac_revision)(void);
71 + int (*external_reset)(void);
74 #endif /* _LINUX_ATH9K_PLATFORM_H */