Index: sys/dev/usb/controller/xhci.c =================================================================== --- sys/dev/usb/controller/xhci.c +++ sys/dev/usb/controller/xhci.c @@ -100,6 +100,10 @@ SYSCTL_INT(_hw_usb_xhci, OID_AUTO, ctlquirk, CTLFLAG_RWTUN, &xhcictlquirk, 0, "Set to enable control endpoint quirk"); +static int xhcipre356545 = 0; +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, pre356545, CTLFLAG_RWTUN, &xhcipre356545, 0, + "Set to allow endpoints to be configured twice (default before r356545)."); + #ifdef USB_DEBUG static int xhcidebug; static int xhciroute; @@ -3900,8 +3904,8 @@ mask = (1U << epno); xhci_configure_mask(udev, mask | 1U, 0); - - if (!(sc->sc_hw.devs[index].ep_configured & mask)) { + if (!(sc->sc_hw.devs[index].ep_configured & mask) || + (epno > 1 && xhcipre356545)) { sc->sc_hw.devs[index].ep_configured |= mask; err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index); } else { @@ -4302,6 +4306,8 @@ case USB_STATE_CONFIGURED: if (sc->sc_hw.devs[index].state == XHCI_ST_CONFIGURED) { + if (xhcipre356545) + break; /* deconfigure all endpoints, except EP0 */ err = xhci_cmd_configure_ep(sc, 0, 1, index);