From owner-p4-projects@FreeBSD.ORG Fri May 2 00:44:04 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2AECE106567C; Fri, 2 May 2008 00:44:04 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E13191065676 for ; Fri, 2 May 2008 00:44:03 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id CC7C68FC14 for ; Fri, 2 May 2008 00:44:03 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m420i3h1069337 for ; Fri, 2 May 2008 00:44:03 GMT (envelope-from thompsa@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m420i3qq069328 for perforce@freebsd.org; Fri, 2 May 2008 00:44:03 GMT (envelope-from thompsa@freebsd.org) Date: Fri, 2 May 2008 00:44:03 GMT Message-Id: <200805020044.m420i3qq069328@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to thompsa@freebsd.org using -f From: Andrew Thompson To: Perforce Change Reviews Cc: Subject: PERFORCE change 141021 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2008 00:44:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=141021 Change 141021 by thompsa@thompsa_burger on 2008/05/02 00:43:20 Make bwi_stop() do the locking like the corresponding bwi_init() does. Affected files ... .. //depot/projects/vap/sys/dev/bwi/if_bwi.c#14 edit Differences ... ==== //depot/projects/vap/sys/dev/bwi/if_bwi.c#14 (text+ko) ==== @@ -127,6 +127,7 @@ static void bwi_restart(void *, int); static void bwi_init_statechg(struct bwi_softc *, int); static void bwi_stop(struct bwi_softc *, int); +static void bwi_stop_locked(struct bwi_softc *, int); static int bwi_newbuf(struct bwi_softc *, int, int); static int bwi_encap(struct bwi_softc *, int, struct mbuf *, struct ieee80211_node *); @@ -580,10 +581,7 @@ struct ieee80211com *ic = ifp->if_l2com; int i; - BWI_LOCK(sc); bwi_stop(sc, 1); - BWI_UNLOCK(sc); - callout_drain(&sc->sc_calib_ch); ieee80211_ifdetach(ic); @@ -648,9 +646,7 @@ void bwi_suspend(struct bwi_softc *sc) { - BWI_LOCK(sc); bwi_stop(sc, 1); - BWI_UNLOCK(sc); } void @@ -665,9 +661,7 @@ int bwi_shutdown(struct bwi_softc *sc) { - BWI_LOCK(sc); bwi_stop(sc, 1); - BWI_UNLOCK(sc); return 0; } @@ -1239,7 +1233,7 @@ BWI_LOCK(sc); - bwi_stop(sc, statechg); + bwi_stop_locked(sc, statechg); bwi_bbp_power_on(sc, BWI_CLOCK_MODE_FAST); @@ -1306,7 +1300,7 @@ BWI_UNLOCK(sc); return; bad: - bwi_stop(sc, 1); + bwi_stop_locked(sc, 1); BWI_UNLOCK(sc); } @@ -1513,6 +1507,14 @@ static void bwi_stop(struct bwi_softc *sc, int statechg) { + BWI_LOCK(sc); + bwi_stop(sc, statechg); + BWI_UNLOCK(sc); +} + +static void +bwi_stop_locked(struct bwi_softc *sc, int statechg) +{ struct ifnet *ifp = sc->sc_ifp; struct bwi_mac *mac; int i, error, pwr_off = 0;