diff options
author | hselasky <hselasky@FreeBSD.org> | 2013-09-07 06:53:59 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2013-09-07 06:53:59 +0000 |
commit | e551a1e2ec383b455c86c4bb0d4448910312d3c5 (patch) | |
tree | f5f17a3ffb3df0100261ac7de1f9ef46cda6151d /sys/dev/usb/controller/xhci.c | |
parent | e98bbe1af97e36ceb15ac71a44f1f9ea9567482d (diff) | |
download | FreeBSD-src-e551a1e2ec383b455c86c4bb0d4448910312d3c5.zip FreeBSD-src-e551a1e2ec383b455c86c4bb0d4448910312d3c5.tar.gz |
Disable USB 3.0 streams mode by default, hence not all XHCI chipsets
implement it to avoid undefined behaviour.
Diffstat (limited to 'sys/dev/usb/controller/xhci.c')
-rw-r--r-- | sys/dev/usb/controller/xhci.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 6c9a610..b6d31e3 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -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 *udev, struct usb_endpoint *ep, 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); |