Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jan 2010 02:31:33 +0000 (UTC)
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r203141 - head/sys/dev/usb/wlan
Message-ID:  <201001290231.o0T2VXaD025226@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: thompsa
Date: Fri Jan 29 02:31:33 2010
New Revision: 203141
URL: http://svn.freebsd.org/changeset/base/203141

Log:
  Attempt to recover on a TX error rather than stopping all transfers.
  
  Submitted by:	Hans Petter Selesky

Modified:
  head/sys/dev/usb/wlan/if_rum.c
  head/sys/dev/usb/wlan/if_zyd.c

Modified: head/sys/dev/usb/wlan/if_rum.c
==============================================================================
--- head/sys/dev/usb/wlan/if_rum.c	Fri Jan 29 01:30:13 2010	(r203140)
+++ head/sys/dev/usb/wlan/if_rum.c	Fri Jan 29 02:31:33 2010	(r203141)
@@ -845,13 +845,18 @@ tr_setup:
 			usbd_xfer_set_priv(xfer, NULL);
 		}
 
-		if (error == USB_ERR_STALLED) {
-			/* try to clear stall first */
+		if (error != USB_ERR_CANCELLED) {
+			if (error == USB_ERR_TIMEOUT)
+				device_printf(sc->sc_dev, "device timeout\n");
+
+			/*
+			 * Try to clear stall first, also if other
+			 * errors occur, hence clearing stall
+			 * introduces a 50 ms delay:
+			 */
 			usbd_xfer_set_stall(xfer);
 			goto tr_setup;
 		}
-		if (error == USB_ERR_TIMEOUT)
-			device_printf(sc->sc_dev, "device timeout\n");
 		break;
 	}
 }

Modified: head/sys/dev/usb/wlan/if_zyd.c
==============================================================================
--- head/sys/dev/usb/wlan/if_zyd.c	Fri Jan 29 01:30:13 2010	(r203140)
+++ head/sys/dev/usb/wlan/if_zyd.c	Fri Jan 29 02:31:33 2010	(r203141)
@@ -2449,13 +2449,18 @@ tr_setup:
 		if (data != NULL)
 			zyd_tx_free(data, error);
 
-		if (error == USB_ERR_STALLED) {
-			/* try to clear stall first */
+		if (error != USB_ERR_CANCELLED) {
+			if (error == USB_ERR_TIMEOUT)
+				device_printf(sc->sc_dev, "device timeout\n");
+
+			/*
+			 * Try to clear stall first, also if other
+			 * errors occur, hence clearing stall
+			 * introduces a 50 ms delay:
+			 */
 			usbd_xfer_set_stall(xfer);
 			goto tr_setup;
 		}
-		if (error == USB_ERR_TIMEOUT)
-			device_printf(sc->sc_dev, "device timeout\n");
 		break;
 	}
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001290231.o0T2VXaD025226>