Date: Tue, 26 Jan 2016 16:34:27 +0000 (UTC) From: Andriy Voskoboinyk <avos@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294841 - head/sys/dev/rtwn Message-ID: <201601261634.u0QGYRon083631@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avos Date: Tue Jan 26 16:34:27 2016 New Revision: 294841 URL: https://svnweb.freebsd.org/changeset/base/294841 Log: 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 Modified: head/sys/dev/rtwn/if_rtwn.c head/sys/dev/rtwn/if_rtwnreg.h Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Tue Jan 26 16:33:38 2016 (r294840) +++ head/sys/dev/rtwn/if_rtwn.c Tue Jan 26 16:34:27 2016 (r294841) @@ -186,11 +186,9 @@ static void rtwn_iq_calib(struct rtwn_so 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); @@ -3361,18 +3357,6 @@ fail: } 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) { uint16_t reg; @@ -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); -} Modified: head/sys/dev/rtwn/if_rtwnreg.h ============================================================================== --- head/sys/dev/rtwn/if_rtwnreg.h Tue Jan 26 16:33:38 2016 (r294840) +++ head/sys/dev/rtwn/if_rtwnreg.h Tue Jan 26 16:34:27 2016 (r294841) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601261634.u0QGYRon083631>