aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2012-06-04 10:53:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-06 15:20:30 -0400
commitaf68abadac378f7a4a44fe766383e7b88c7f9c3b (patch)
treebad7c43d612dfc187dda5be0bf2c4be4c252d1de /drivers/net/wireless/ath/ath9k/main.c
parentef1b6cd9a1ba06a3daf9a03aa8f25d52d1f2c31a (diff)
ath9k: Fix work handling
* Currently, there is no synchronization between the reset work and the tx-poll work. Fix this and make sure that we bail out properly if a reset work is in progress. * Cleanup the PLL WAR and enable it for AR9340 too and use a helper for restarting work/timers after a reset. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 304769a3e179..b228aff481e1 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -158,6 +158,22 @@ static void ath_cancel_work(struct ath_softc *sc)
158 cancel_work_sync(&sc->hw_reset_work); 158 cancel_work_sync(&sc->hw_reset_work);
159} 159}
160 160
161static void ath_restart_work(struct ath_softc *sc)
162{
163 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
164
165 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
166
167 if (AR_SREV_9485(sc->sc_ah) || AR_SREV_9340(sc->sc_ah))
168 ieee80211_queue_delayed_work(sc->hw, &sc->hw_pll_work,
169 msecs_to_jiffies(ATH_PLL_WORK_INTERVAL));
170
171 ath_start_rx_poll(sc, 3);
172
173 if (!common->disable_ani)
174 ath_start_ani(common);
175}
176
161static bool ath_prepare_reset(struct ath_softc *sc, bool retry_tx, bool flush) 177static bool ath_prepare_reset(struct ath_softc *sc, bool retry_tx, bool flush)
162{ 178{
163 struct ath_hw *ah = sc->sc_ah; 179 struct ath_hw *ah = sc->sc_ah;
@@ -209,11 +225,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
209 if (sc->sc_flags & SC_OP_BEACONS) 225 if (sc->sc_flags & SC_OP_BEACONS)
210 ath_set_beacon(sc); 226 ath_set_beacon(sc);
211 227
212 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0); 228 ath_restart_work(sc);
213 ieee80211_queue_delayed_work(sc->hw, &sc->hw_pll_work, HZ/2);
214 ath_start_rx_poll(sc, 3);
215 if (!common->disable_ani)
216 ath_start_ani(common);
217 } 229 }
218 230
219 if ((ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) && sc->ant_rx != 3) { 231 if ((ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) && sc->ant_rx != 3) {