aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/controller
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-09-01 08:14:46 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-09-01 08:14:46 +0000
commit59ca674ef24541b4cdebc20d6399904f46a2cc03 (patch)
treeedcca17371fb2d4aa9fd08e543ebc6e53f777ade /sys/dev/usb/controller
parent2721e6f91bd9805dcfa4037c78f12b53c158ebe1 (diff)
Notes
Diffstat (limited to 'sys/dev/usb/controller')
-rw-r--r--sys/dev/usb/controller/xhci.c13
-rw-r--r--sys/dev/usb/controller/xhci.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c
index 1656e622d70f..e96f910b2cb7 100644
--- a/sys/dev/usb/controller/xhci.c
+++ b/sys/dev/usb/controller/xhci.c
@@ -2398,6 +2398,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) {
@@ -2927,6 +2929,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 e2c3b887a338..c0427e0cf11f 100644
--- a/sys/dev/usb/controller/xhci.h
+++ b/sys/dev/usb/controller/xhci.h
@@ -393,6 +393,7 @@ struct xhci_endpoint_ext {
uint8_t trb_halted;
uint8_t trb_running;
uint8_t trb_ep_mode;
+ uint8_t trb_ep_maxp;
};
enum {