Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Apr 2008 22:19:49 GMT
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 139303 for review
Message-ID:  <200804032219.m33MJnMS041513@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=139303

Change 139303 by thompsa@thompsa_burger on 2008/04/03 22:19:26

	wpi_start doesnt recurse anymore.

Affected files ...

.. //depot/projects/vap/sys/dev/wpi/if_wpi.c#16 edit
.. //depot/projects/vap/sys/dev/wpi/if_wpivar.h#6 edit

Differences ...

==== //depot/projects/vap/sys/dev/wpi/if_wpi.c#16 (text+ko) ====

@@ -197,6 +197,7 @@
 static int	wpi_tx_data(struct wpi_softc *, struct mbuf *,
 		    struct ieee80211_node *, int);
 static void	wpi_start(struct ifnet *);
+static void	wpi_start_locked(struct ifnet *);
 static int	wpi_raw_xmit(struct ieee80211_node *, struct mbuf *,
 		    const struct ieee80211_bpf_params *);
 static void	wpi_scan_start(struct ieee80211com *);
@@ -1585,7 +1586,7 @@
 
 	sc->sc_tx_timer = 0;
 	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-	wpi_start(ifp);
+	wpi_start_locked(ifp);
 }
 
 static void
@@ -1985,17 +1986,25 @@
 wpi_start(struct ifnet *ifp)
 {
 	struct wpi_softc *sc = ifp->if_softc;
+
+	WPI_LOCK(sc);
+	wpi_start_locked(ifp);
+	WPI_UNLOCK(sc);
+}
+
+static void
+wpi_start_locked(struct ifnet *ifp)
+{
+	struct wpi_softc *sc = ifp->if_softc;
 	struct ieee80211_node *ni;
 	struct mbuf *m;
-	int ac, waslocked;
+	int ac;
+
+	WPI_LOCK_ASSERT(sc);
 
 	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
 		return;
 
-	waslocked = WPI_LOCK_OWNED(sc);
-	if (!waslocked)
-		WPI_LOCK(sc);
-
 	for (;;) {
 		IFQ_POLL(&ifp->if_snd, m);
 		if (m == NULL)
@@ -2023,9 +2032,6 @@
 		}
 		sc->sc_tx_timer = 5;
 	}
-
-	if (!waslocked)
-		WPI_UNLOCK(sc);
 }
 
 static int

==== //depot/projects/vap/sys/dev/wpi/if_wpivar.h#6 (text+ko) ====

@@ -238,7 +238,6 @@
 #define WPI_LOCK(_sc)		mtx_lock(&(_sc)->sc_mtx)
 #define WPI_UNLOCK(_sc)		mtx_unlock(&(_sc)->sc_mtx)
 #define WPI_LOCK_ASSERT(sc)     mtx_assert(&(sc)->sc_mtx, MA_OWNED)
-#define WPI_LOCK_OWNED(_sc)	mtx_owned(&(_sc)->sc_mtx)
 #define WPI_LOCK_DESTROY(_sc)	mtx_destroy(&(_sc)->sc_mtx)
 
 #define WPI_CMD_LOCK_INIT(_sc)  \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804032219.m33MJnMS041513>