PERFORCE change 142928 for review

Hans Petter Selasky hselasky at FreeBSD.org
Thu Jun 5 06:57:07 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=142928

Change 142928 by hselasky at hselasky_laptop001 on 2008/06/05 06:56:47

	
	USB Device Side Mode: Only Device Mode has clear stall. Add
	check for USB mode in clear stall callback.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/at9100_dci.c#18 edit
.. //depot/projects/usb/src/sys/dev/usb/uss820_dci.c#13 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/at9100_dci.c#18 (text+ko) ====

@@ -1414,6 +1414,11 @@
 
 	mtx_assert(&(udev->bus->mtx), MA_OWNED);
 
+	/* check mode */
+	if (udev->flags.usb_mode != USB_MODE_DEVICE) {
+		/* not supported */
+		return;
+	}
 	/* get softc */
 	sc = AT9100_DCI_BUS2SC(udev->bus);
 

==== //depot/projects/usb/src/sys/dev/usb/uss820_dci.c#13 (text+ko) ====

@@ -1347,11 +1347,18 @@
 
 	DPRINTFN(4, "pipe=%p\n", pipe);
 
-	/* reset pipe state */
+	/* check mode */
+	if (udev->flags.usb_mode != USB_MODE_DEVICE) {
+		/* not supported */
+		return;
+	}
+	/* get softc */
+	sc = USS820_DCI_BUS2SC(udev->bus);
 
-	sc = USS820_DCI_BUS2SC(udev->bus);
+	/* get endpoint descriptor */
 	ed = pipe->edesc;
 
+	/* reset endpoint */
 	uss820_dci_clear_stall_sub(sc,
 	    (ed->bEndpointAddress & UE_ADDR),
 	    (ed->bmAttributes & UE_XFERTYPE),


More information about the p4-projects mailing list