raw-gadget icon indicating copy to clipboard operation
raw-gadget copied to clipboard

Expose more hardware information via ioctls

Open xairy opened this issue 2 years ago • 5 comments

The Gadget subsystem provides information about the capabilities of the UDC hardware. It might be useful to expose this information via Raw Gadget ioctls.

xairy avatar Jun 21 '23 20:06 xairy

One of the things we need to expose is usb_gadget->ep0->maxpacket: looks like some UDCs expect bMaxPacketSize0 in the device descriptor to be not lower than the maxpacket that they set.

xairy avatar Oct 25 '23 00:10 xairy

Some UDCs also have a minimum device speed they support, e.g. DWC3.

This information is not exposed through usb_gadget though.

The comment for max_speed is also misleading.

xairy avatar Oct 27 '23 14:10 xairy

So the speed provided to USB_RAW_IOCTL_INIT is rather just a hint, and the UDC might decide to use a different one. Perhaps, we should expose the actual speed of the device as well.

xairy avatar Oct 27 '23 14:10 xairy

~~It also appears the UDC might set a particular maxpacket value for non-control endpoints, (see calls to dwc2_hsotg_set_ep_maxpacket in dwc2), and Raw Gadget should expose this via USB_RAW_IOCTL_EPS_INFO.~~

~~Or is that the dwc2 driver that needs to be fixed? Other UDCs don't seem to do this.~~

Nevermind, dwc2 takes those values from the USB descriptors.

xairy avatar Oct 27 '23 15:10 xairy

Issue #73 is related to exposing whether the UDC supports remote wake up.

xairy avatar Jun 28 '24 19:06 xairy