svn commit: r255347 - head/sys/dev/usb/controller
Hans Petter Selasky
hselasky at FreeBSD.org
Sat Sep 7 06:54:00 UTC 2013
Author: hselasky
Date: Sat Sep 7 06:53:59 2013
New Revision: 255347
URL: http://svnweb.freebsd.org/changeset/base/255347
Log:
Disable USB 3.0 streams mode by default, hence not all XHCI chipsets
implement it to avoid undefined behaviour.
Modified:
head/sys/dev/usb/controller/xhci.c
Modified: head/sys/dev/usb/controller/xhci.c
==============================================================================
--- head/sys/dev/usb/controller/xhci.c Sat Sep 7 06:41:22 2013 (r255346)
+++ head/sys/dev/usb/controller/xhci.c Sat Sep 7 06:53:59 2013 (r255347)
@@ -87,12 +87,18 @@
((struct xhci_softc *)(((uint8_t *)(bus)) - \
((uint8_t *)&(((struct xhci_softc *)0)->sc_bus))))
+static SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI");
+
+static int xhcistreams;
+SYSCTL_INT(_hw_usb_xhci, OID_AUTO, streams, CTLFLAG_RW | CTLFLAG_TUN,
+ &xhcistreams, 0, "Set to enable streams mode support");
+TUNABLE_INT("hw.usb.xhci.streams", &xhcistreams);
+
#ifdef USB_DEBUG
static int xhcidebug;
static int xhciroute;
static int xhcipolling;
-static SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI");
SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN,
&xhcidebug, 0, "Debug level");
TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug);
@@ -4127,7 +4133,8 @@ xhci_set_endpoint_mode(struct usb_device
case USB_EP_MODE_DEFAULT:
return (0);
case USB_EP_MODE_STREAMS:
- if ((ep->edesc->bmAttributes & UE_XFERTYPE) != UE_BULK ||
+ if (xhcistreams == 0 ||
+ (ep->edesc->bmAttributes & UE_XFERTYPE) != UE_BULK ||
udev->speed != USB_SPEED_SUPER)
return (USB_ERR_INVAL);
return (0);
More information about the svn-src-head
mailing list