diff options
author | Renato Botelho <renato@netgate.com> | 2016-03-07 11:03:11 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-03-07 11:03:11 -0300 |
commit | 81ca6de1be9c20d444d1a292655e4732a9c76539 (patch) | |
tree | f3d51afe9a1f2b88dea2c5e10289db1f3f2ed5d1 /sys/dev/usb/controller | |
parent | 124a553c4366e5f98bf66430356250b0db8eb135 (diff) | |
parent | 81dfa2bb6c9e62b96e6586a82c13db809c03fd20 (diff) | |
download | FreeBSD-src-81ca6de1be9c20d444d1a292655e4732a9c76539.zip FreeBSD-src-81ca6de1be9c20d444d1a292655e4732a9c76539.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'sys/dev/usb/controller')
-rw-r--r-- | sys/dev/usb/controller/xhci.c | 13 | ||||
-rw-r--r-- | sys/dev/usb/controller/xhci.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 3853ed1..18f871e 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -2363,6 +2363,8 @@ xhci_configure_endpoint(struct usb_device *udev, /* store endpoint mode */ pepext->trb_ep_mode = ep_mode; + /* store bMaxPacketSize for control endpoints */ + pepext->trb_ep_maxp = edesc->wMaxPacketSize[0]; usb_pc_cpu_flush(pepext->page_cache); if (ep_mode == USB_EP_MODE_STREAMS) { @@ -2909,6 +2911,17 @@ xhci_transfer_insert(struct usb_xfer *xfer) return (USB_ERR_NOMEM); } + /* check if bMaxPacketSize changed */ + if (xfer->flags_int.control_xfr != 0 && + pepext->trb_ep_maxp != xfer->endpoint->edesc->wMaxPacketSize[0]) { + + DPRINTFN(8, "Reconfigure control endpoint\n"); + + /* force driver to reconfigure endpoint */ + pepext->trb_halted = 1; + pepext->trb_running = 0; + } + /* check for stopped condition, after putting transfer on interrupt queue */ if (pepext->trb_running == 0) { struct xhci_softc *sc = XHCI_BUS2SC(xfer->xroot->bus); diff --git a/sys/dev/usb/controller/xhci.h b/sys/dev/usb/controller/xhci.h index ac21c0f..af5b913 100644 --- a/sys/dev/usb/controller/xhci.h +++ b/sys/dev/usb/controller/xhci.h @@ -383,6 +383,7 @@ struct xhci_endpoint_ext { uint8_t trb_halted; uint8_t trb_running; uint8_t trb_ep_mode; + uint8_t trb_ep_maxp; }; enum { |