PERFORCE change 66083 for review

Sam Leffler sam at FreeBSD.org
Mon Nov 29 19:31:35 PST 2004


http://perforce.freebsd.org/chv.cgi?CH=66083

Change 66083 by sam at sam_ebb on 2004/11/30 03:31:17

	cleanup stuck beacon handling a touch

Affected files ...

.. //depot/projects/wifi/sys/dev/ath/if_ath.c#31 edit
.. //depot/projects/wifi/sys/dev/ath/if_athvar.h#12 edit

Differences ...

==== //depot/projects/wifi/sys/dev/ath/if_ath.c#31 (text+ko) ====

@@ -120,6 +120,7 @@
 static void	ath_updateslot(struct ifnet *);
 static int	ath_beacon_alloc(struct ath_softc *, struct ieee80211_node *);
 static void	ath_beacon_proc(void *, int);
+static void	ath_beacon_stuck_proc(void *, int);
 static void	ath_beacon_free(struct ath_softc *);
 static void	ath_beacon_config(struct ath_softc *);
 static int	ath_desc_alloc(struct ath_softc *);
@@ -356,6 +357,7 @@
 	TASK_INIT(&sc->sc_rxorntask, 0, ath_rxorn_proc, sc);
 	TASK_INIT(&sc->sc_fataltask, 0, ath_fatal_proc, sc);
 	TASK_INIT(&sc->sc_bmisstask, 0, ath_bmiss_proc, sc);
+	TASK_INIT(&sc->sc_bstucktask, 0, ath_beacon_stuck_proc, sc);
 
 	/*
 	 * Allocate hardware transmit queues: one queue for
@@ -743,10 +745,7 @@
 	struct ath_softc *sc = arg;
 	struct ifnet *ifp = &sc->sc_if;
 
-	if (sc->sc_bmisscount != 0)
-		if_printf(ifp, "stuck beacon; resetting\n");
-	else
-		if_printf(ifp, "hardware error; resetting\n");
+	if_printf(ifp, "hardware error; resetting\n");
 	ath_reset(ifp);
 }
 
@@ -1811,7 +1810,7 @@
 			__func__, sc->sc_bmisscount);
 		/* XXX reset if too many? */
 		if (sc->sc_bmisscount > 3)
-			taskqueue_enqueue(taskqueue_swi, &sc->sc_fataltask);
+			taskqueue_enqueue(taskqueue_swi, &sc->sc_bstucktask);
 		return;
 	}
 	if (sc->sc_bmisscount != 0) {
@@ -1857,7 +1856,7 @@
 		DPRINTF(sc, ATH_DEBUG_ANY,
 			"%s: beacon queue %u did not stop?\n",
 			__func__, sc->sc_bhalq);
-		/* XXX how to recover? reset? */
+		/* NB: should never happen since we check above? */
 	}
 	bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_PREWRITE);
 
@@ -1874,6 +1873,17 @@
 		sc->sc_bhalq, (caddr_t)bf->bf_daddr, bf->bf_desc);
 }
 
+static void
+ath_beacon_stuck_proc(void *arg, int pending)
+{
+	struct ath_softc *sc = arg;
+	struct ifnet *ifp = &sc->sc_if;
+
+	if_printf(ifp, "stuck beacon; resetting (bmiss count %u)\n",
+		sc->sc_bmisscount);
+	ath_reset(ifp);
+}
+
 /*
  * Reclaim beacon resources.
  */

==== //depot/projects/wifi/sys/dev/ath/if_athvar.h#12 (text+ko) ====

@@ -221,6 +221,7 @@
 	struct ath_buf		*sc_bufptr;	/* allocated buffer ptr */
 	struct ieee80211_beacon_offsets sc_boff;/* dynamic update state */
 	struct task		sc_bmisstask;	/* bmiss int processing */
+	struct task		sc_bstucktask;	/* stuck beacon processing */
 	enum {
 		OK,				/* no change needed */
 		UPDATE,				/* update pending */


More information about the p4-projects mailing list