From owner-svn-src-head@freebsd.org Tue Jan 26 16:34:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41FF0A6E2D3; Tue, 26 Jan 2016 16:34:29 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 061E018D1; Tue, 26 Jan 2016 16:34:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QGYSjt083633; Tue, 26 Jan 2016 16:34:28 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QGYRon083631; Tue, 26 Jan 2016 16:34:27 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601261634.u0QGYRon083631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 26 Jan 2016 16:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294841 - head/sys/dev/rtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 16:34:29 -0000 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;