if_iwm - Stop iwm_watchdog callout when idle.

Submitted by:	Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from:	DragonFlyBSD (6a8683b0e9d734f23bd9647e117da198c2b9a74e)
This commit is contained in:
Kyle Evans 2019-01-24 03:48:50 +00:00
parent d3c83cfead
commit 93ff2218dd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=343386

View File

@ -3814,6 +3814,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);
@ -4754,7 +4756,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
@ -4800,6 +4801,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__);
@ -4834,8 +4839,8 @@ iwm_watchdog(void *arg)
counter_u64_add(sc->sc_ic.ic_oerrors, 1);
return;
}
callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, sc);
}
callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, sc);
}
static void