PERFORCE change 173119 for review

Hans Petter Selasky hselasky at FreeBSD.org
Thu Jan 14 08:22:41 UTC 2010


http://p4web.freebsd.org/chv.cgi?CH=173119

Change 173119 by hselasky at 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


More information about the p4-projects mailing list