rtwn: use ieee80211_restart_all() for device reset
Tested by: kevlo Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5057
This commit is contained in:
parent
0645c6049d
commit
5274f944ba
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=294841
@ -186,11 +186,9 @@ static void rtwn_iq_calib(struct rtwn_softc *);
|
||||
static void rtwn_lc_calib(struct rtwn_softc *);
|
||||
static void rtwn_temp_calib(struct rtwn_softc *);
|
||||
static void rtwn_init_locked(struct rtwn_softc *);
|
||||
static void rtwn_init(struct rtwn_softc *);
|
||||
static void rtwn_stop_locked(struct rtwn_softc *);
|
||||
static void rtwn_stop(struct rtwn_softc *);
|
||||
static void rtwn_intr(void *);
|
||||
static void rtwn_hw_reset(void *, int);
|
||||
|
||||
/* Aliases. */
|
||||
#define rtwn_bb_write rtwn_write_4
|
||||
@ -295,7 +293,6 @@ rtwn_attach(device_t dev)
|
||||
RTWN_LOCK_INIT(sc);
|
||||
callout_init_mtx(&sc->calib_to, &sc->sc_mtx, 0);
|
||||
callout_init_mtx(&sc->watchdog_to, &sc->sc_mtx, 0);
|
||||
TASK_INIT(&sc->sc_reinit_task, 0, rtwn_hw_reset, sc);
|
||||
mbufq_init(&sc->sc_snd, ifqmaxlen);
|
||||
|
||||
error = rtwn_read_chipid(sc);
|
||||
@ -406,7 +403,6 @@ rtwn_detach(device_t dev)
|
||||
int i;
|
||||
|
||||
if (sc->sc_ic.ic_softc != NULL) {
|
||||
ieee80211_draintask(&sc->sc_ic, &sc->sc_reinit_task);
|
||||
rtwn_stop(sc);
|
||||
|
||||
callout_drain(&sc->calib_to);
|
||||
@ -1899,7 +1895,7 @@ rtwn_watchdog(void *arg)
|
||||
|
||||
if (sc->sc_tx_timer != 0 && --sc->sc_tx_timer == 0) {
|
||||
ic_printf(ic, "device timeout\n");
|
||||
ieee80211_runtask(ic, &sc->sc_reinit_task);
|
||||
ieee80211_restart_all(ic);
|
||||
return;
|
||||
}
|
||||
callout_reset(&sc->watchdog_to, hz, rtwn_watchdog, sc);
|
||||
@ -3360,18 +3356,6 @@ rtwn_init_locked(struct rtwn_softc *sc)
|
||||
rtwn_stop_locked(sc);
|
||||
}
|
||||
|
||||
static void
|
||||
rtwn_init(struct rtwn_softc *sc)
|
||||
{
|
||||
|
||||
RTWN_LOCK(sc);
|
||||
rtwn_init_locked(sc);
|
||||
RTWN_UNLOCK(sc);
|
||||
|
||||
if (sc->sc_flags & RTWN_RUNNING)
|
||||
ieee80211_start_all(&sc->sc_ic);
|
||||
}
|
||||
|
||||
static void
|
||||
rtwn_stop_locked(struct rtwn_softc *sc)
|
||||
{
|
||||
@ -3481,14 +3465,3 @@ rtwn_intr(void *arg)
|
||||
|
||||
RTWN_UNLOCK(sc);
|
||||
}
|
||||
|
||||
static void
|
||||
rtwn_hw_reset(void *arg0, int pending)
|
||||
{
|
||||
struct rtwn_softc *sc = arg0;
|
||||
struct ieee80211com *ic = &sc->sc_ic;
|
||||
|
||||
rtwn_stop(sc);
|
||||
rtwn_init(sc);
|
||||
ieee80211_notify_radio(ic, 1);
|
||||
}
|
||||
|
@ -1295,7 +1295,6 @@ struct rtwn_softc {
|
||||
bus_size_t sc_mapsize;
|
||||
int sc_cap_off;
|
||||
|
||||
struct task sc_reinit_task;
|
||||
struct callout calib_to;
|
||||
struct callout watchdog_to;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user