From owner-p4-projects@FreeBSD.ORG Tue Nov 30 03:31:35 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2685316A4D0; Tue, 30 Nov 2004 03:31:35 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DCD7D16A4CE for ; Tue, 30 Nov 2004 03:31:34 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE71D43D49 for ; Tue, 30 Nov 2004 03:31:34 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id iAU3VYHv053788 for ; Tue, 30 Nov 2004 03:31:34 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id iAU3VYgh053785 for perforce@freebsd.org; Tue, 30 Nov 2004 03:31:34 GMT (envelope-from sam@freebsd.org) Date: Tue, 30 Nov 2004 03:31:34 GMT Message-Id: <200411300331.iAU3VYgh053785@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 66083 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2004 03:31:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=66083 Change 66083 by sam@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 */