From 6a8683b0e9d734f23bd9647e117da198c2b9a74e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Imre=20Vad=C3=A1sz?= Date: Thu, 24 May 2018 23:05:10 +0200 Subject: [PATCH] if_iwm - Stop iwm_watchdog callout when idle. --- sys/dev/netif/iwm/if_iwm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/netif/iwm/if_iwm.c b/sys/dev/netif/iwm/if_iwm.c index c0cdfe1f0f..f3e78bf912 100644 --- a/sys/dev/netif/iwm/if_iwm.c +++ b/sys/dev/netif/iwm/if_iwm.c @@ -3849,6 +3849,8 @@ iwm_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, } else { error = iwm_tx(sc, m, ni, 0); } + if (sc->sc_tx_timer == 0) + callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, sc); sc->sc_tx_timer = 5; IWM_UNLOCK(sc); @@ -4777,7 +4779,6 @@ iwm_init(struct iwm_softc *sc) * Ok, firmware loaded and we are jogging */ sc->sc_flags |= IWM_FLAG_HW_INITED; - callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, sc); } static int @@ -4823,6 +4824,10 @@ iwm_start(struct iwm_softc *sc) ieee80211_free_node(ni); continue; } + if (sc->sc_tx_timer == 0) { + callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, + sc); + } sc->sc_tx_timer = 15; } IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TRACE, "<-%s\n", __func__); @@ -4860,8 +4865,8 @@ iwm_watchdog(void *arg) #endif return; } + callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, sc); } - callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, sc); } static void -- 2.11.4.GIT