From owner-p4-projects@FreeBSD.ORG Mon Jan 14 03:40:56 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 41D8116A421; Mon, 14 Jan 2008 03:40:56 +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 E389716A41B for ; Mon, 14 Jan 2008 03:40:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DF5B913C44B for ; Mon, 14 Jan 2008 03:40:55 +0000 (UTC) (envelope-from sephe@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 m0E3etxk008386 for ; Mon, 14 Jan 2008 03:40:55 GMT (envelope-from sephe@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0E3et9r008383 for perforce@freebsd.org; Mon, 14 Jan 2008 03:40:55 GMT (envelope-from sephe@FreeBSD.org) Date: Mon, 14 Jan 2008 03:40:55 GMT Message-Id: <200801140340.m0E3et9r008383@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau To: Perforce Change Reviews Cc: Subject: PERFORCE change 133215 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: Mon, 14 Jan 2008 03:40:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=133215 Change 133215 by sephe@sephe_zealot:sam_wifi on 2008/01/14 03:40:20 - Don't reset watchdog timer, if there are TX descs pending - IFF_DRV_OACTIVE is in ifnet.if_drv_flags - In rt2661_init(), protect if_drv_flags adjustment by RAL_LOCK Affected files ... .. //depot/projects/wifi/sys/dev/ral/rt2661.c#21 edit Differences ... ==== //depot/projects/wifi/sys/dev/ral/rt2661.c#21 (text) ==== @@ -1022,11 +1022,13 @@ bus_dmamap_sync(txq->desc_dmat, txq->desc_map, BUS_DMASYNC_PREWRITE); + if (txq->queued == 0) + sc->sc_tx_timer = 0; + if (txq->queued < txq->count) { struct ifnet *ifp = sc->sc_ic.ic_ifp; - sc->sc_tx_timer = 0; - ifp->if_flags &= ~IFF_DRV_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; rt2661_start(ifp); } } @@ -2647,11 +2649,12 @@ /* kick Rx */ RAL_WRITE(sc, RT2661_RX_CNTL_CSR, 1); - RAL_UNLOCK(sc); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_drv_flags |= IFF_DRV_RUNNING; + RAL_UNLOCK(sc); + if (ic->ic_opmode != IEEE80211_M_MONITOR) { if (ic->ic_roaming != IEEE80211_ROAMING_MANUAL) ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); @@ -2668,8 +2671,8 @@ struct rt2661_softc *sc = priv; RAL_LOCK(sc); + callout_stop(&sc->watchdog_ch); rt2661_stop_locked(sc); - callout_stop(&sc->watchdog_ch); RAL_UNLOCK(sc); }