From owner-p4-projects@FreeBSD.ORG Thu Jan 14 08:22:41 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 689FE1065676; Thu, 14 Jan 2010 08:22:41 +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 12EC01065670 for ; Thu, 14 Jan 2010 08:22:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 0048D8FC0A for ; Thu, 14 Jan 2010 08:22:41 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o0E8MeVH010096 for ; Thu, 14 Jan 2010 08:22:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o0E8MeV2010094 for perforce@freebsd.org; Thu, 14 Jan 2010 08:22:40 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 14 Jan 2010 08:22:40 GMT Message-Id: <201001140822.o0E8MeV2010094@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 173119 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 08:22:41 -0000 http://p4web.freebsd.org/chv.cgi?CH=173119 Change 173119 by hselasky@hselasky_laptop001 on 2010/01/14 08:22:03 USB WLAN: - final patches for RUN driver. - link RUN driver into kernel module build - patch by: Akinori Affected files ... .. //depot/projects/usb/src/sys/dev/usb/wlan/if_run.c#4 edit .. //depot/projects/usb/src/sys/dev/usb/wlan/if_runvar.h#3 edit .. //depot/projects/usb/src/sys/modules/usb/Makefile#25 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/wlan/if_run.c#4 (text+ko) ==== @@ -347,7 +347,7 @@ static void run_update_beacon(struct ieee80211vap *, int); static void run_update_beacon_locked(struct ieee80211vap *, int); static void run_updateprot(struct ieee80211com *ic); -static void run_usb_timeout(struct run_softc *); +static void run_usb_timeout_cb(void *, int); static void run_reset_livelock(struct run_softc *); static void run_enable_tsf_sync(struct run_softc *); static void run_enable_mrr(struct run_softc *); @@ -713,6 +713,7 @@ TASK_INIT(&rvp->amrr_task, 0, run_amrr_cb, rvp); TASK_INIT(&sc->wme_task, 0, run_wme_update_cb, ic); + TASK_INIT(&sc->usb_timeout_task, 0, run_usb_timeout_cb, sc); callout_init((struct callout *)&rvp->amrr_ch, 1); ieee80211_amrr_init(&rvp->amrr, vap, IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD, @@ -2344,7 +2345,6 @@ unsigned int len; int actlen; int sumlen; - int timeout; usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); @@ -2414,19 +2414,10 @@ usbd_transfer_submit(xfer); - /* avoid doing the USB timeout from this function */ - - timeout = sc->sc_usb_timeout; - sc->sc_usb_timeout = 0; - RUN_UNLOCK(sc); - run_start(ifp); - RUN_LOCK(sc); - sc->sc_usb_timeout = timeout; - break; default: @@ -2445,9 +2436,7 @@ if (error != USB_ERR_CANCELLED) { if (error == USB_ERR_TIMEOUT) { device_printf(sc->sc_dev, "device timeout\n"); - - /* defer until later */ - sc->sc_usb_timeout = 1; + ieee80211_runtask(ifp->if_l2com, &sc->usb_timeout_task); } /* @@ -2901,10 +2890,6 @@ goto bad; } - /* Device is in trouble. Fix it before sending more frame. */ - if(sc->sc_usb_timeout == 1) - run_usb_timeout(sc); - if (params == NULL) { /* tx mgt packet */ if ((error = run_tx_mgt(sc, m, ni)) != 0){ @@ -2951,10 +2936,6 @@ } for (;;) { - /* Device is in trouble. Fix it before sending more frame. */ - if(sc->sc_usb_timeout == 1) - run_usb_timeout(sc); - /* send data frames */ IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) @@ -3373,17 +3354,13 @@ } static void -run_usb_timeout(struct run_softc *sc) +run_usb_timeout_cb(void *arg, int pending) { - struct ieee80211vap *vap = &sc->sc_rvp->vap; + struct run_softc *sc = arg; + struct ieee80211vap *vap = &sc->sc_rvp->vap; RUN_LOCK_ASSERT(sc, MA_OWNED); - if (sc->sc_usb_timeout == 0) - return; - - sc->sc_usb_timeout = 0; - if(vap->iv_state == IEEE80211_S_RUN && vap->iv_opmode != IEEE80211_M_STA) run_reset_livelock(sc); @@ -4100,6 +4077,7 @@ ieee80211_draintask(ic, &sc->wme_task); for(i = 0; i < RUN_N_XFER; i++) usbd_transfer_drain(sc->sc_xfer[i]); + ieee80211_draintask(ic, &sc->usb_timeout_task); RUN_LOCK(sc); ==== //depot/projects/usb/src/sys/dev/usb/wlan/if_runvar.h#3 (text+ko) ==== @@ -190,6 +190,7 @@ struct run_endpoint_queue sc_epq[RUN_EP_QUEUES]; struct task wme_task; + struct task usb_timeout_task; struct usb_xfer *sc_xfer[RUN_N_XFER]; @@ -210,8 +211,6 @@ } sc_txtapu; #define sc_txtap sc_txtapu.th int sc_txtap_len; - - uint8_t sc_usb_timeout; }; #define RUN_LOCK(sc) mtx_lock(&(sc)->sc_mtx) ==== //depot/projects/usb/src/sys/modules/usb/Makefile#25 (text+ko) ==== @@ -27,7 +27,7 @@ SUBDIR = usb SUBDIR += ehci musb ohci uhci uss820dci ${_at91dci} ${_atmegadci} -SUBDIR += rum uath upgt ural zyd ${_urtw} +SUBDIR += rum run uath upgt ural zyd ${_urtw} SUBDIR += atp uhid ukbd ums udbp ufm SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umodem umoscom uplcom uslcom uvisor uvscom