Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Paste
P654
usb hackery
Active
Public
Actions
Authored by
adrian
on Thu, Nov 28, 7:48 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F103742380: usb hackery
Thu, Nov 28, 7:48 PM
2024-11-28 19:48:40 (UTC+0)
Subscribers
None
diff --git a/sys/dev/rtwn/usb/rtwn_usb_reg.c b/sys/dev/rtwn/usb/rtwn_usb_reg.c
index 5a992379e248..e81e6383433d 100644
--- a/sys/dev/rtwn/usb/rtwn_usb_reg.c
+++ b/sys/dev/rtwn/usb/rtwn_usb_reg.c
@@ -67,7 +67,7 @@ rtwn_do_request(struct rtwn_softc *sc, struct usb_device_request *req,
while (ntries--) {
err = usbd_do_request_flags(uc->uc_udev, &sc->sc_mtx,
- req, data, 0, NULL, 250 /* ms */);
+ req, data, USB_FORCE_CTRL_LONG, NULL, 250 /* ms */);
if (err == USB_ERR_NORMAL_COMPLETION)
return (0);
@@ -79,6 +79,10 @@ rtwn_do_request(struct rtwn_softc *sc, struct usb_device_request *req,
usb_pause_mtx(&sc->sc_mtx, hz / 100);
}
+
+ device_printf(sc->sc_dev, "%s: control transfer failed; err=%d\n",
+ __func__,
+ err);
return (EIO);
}
diff --git a/sys/dev/usb/usb_request.c b/sys/dev/usb/usb_request.c
index 55e5f04194d9..a8c4265cd1e9 100644
--- a/sys/dev/usb/usb_request.c
+++ b/sys/dev/usb/usb_request.c
@@ -536,6 +536,14 @@ usbd_do_request_flags(struct usb_device *udev, struct mtx *mtx,
goto done;
}
+ /* Set control transfer interval to 1 ms */
+ if (flags & USB_FORCE_CTRL_LONG)
+ usbd_xfer_set_interval(xfer, 2);
+ /*
+ * XXX should I set the interval back to the default somehow
+ * otherwise?
+ */
+
#ifdef USB_REQ_DEBUG
/* Get debug bits */
usbd_get_debug_bits(udev, req, &dbg);
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
index 5192591281f4..5c5bf72d13b3 100644
--- a/sys/dev/usb/usbdi.h
+++ b/sys/dev/usb/usbdi.h
@@ -82,6 +82,7 @@ typedef enum { /* keep in sync with usb_errstr_table */
#define USB_USER_DATA_PTR 0x0020 /* internal flag */
#define USB_MULTI_SHORT_OK 0x0040 /* allow multiple short frames */
#define USB_MANUAL_STATUS 0x0080 /* manual ctrl status */
+#define USB_FORCE_CTRL_LONG 0x0100 /* force 1ms for control transfers */
#define USB_NO_TIMEOUT 0
#define USB_DEFAULT_TIMEOUT 5000 /* 5000 ms = 5 seconds */
Event Timeline
adrian
created this paste.
Thu, Nov 28, 7:48 PM
2024-11-28 19:48:40 (UTC+0)
adrian
created this object in space
S1 Global
.
Log In to Comment