I configured my opi to work as a composite usb gadget (mouse and rndis). Everything works, but the actual refresh rate of the mouse was 250 Hz. I tried to configure bInterval, which is responsible for the device update frequency, this could only be done by rebuilding the kernel with bInterval changes in the high-speed descriptor structures from 4 to 1 in the file drivers/usb/gadget/function/f_hid.c. It had an effect. But the frequency only rose to 500 Hz. I tried to find what could limit this, I looked in drivers/usb/dwc2/gadget.c and also in composite.c but I couldn’t find anything. Now I don’t know where to look next or i missed sth..
drivers/usb/gadget/function/f_hid.c
/* High-Speed Support */
static struct usb_endpoint_descriptor hidg_hs_in_ep_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_IN,
.bmAttributes = USB_ENDPOINT_XFER_INT,
/*.wMaxPacketSize = DYNAMIC */
.bInterval = 4, /* FIXME: Add this field in the <<< changed to 1
* HID gadget configuration?
* (struct hidg_func_descriptor)
*/
};
static struct usb_endpoint_descriptor hidg_hs_out_ep_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_OUT,
.bmAttributes = USB_ENDPOINT_XFER_INT,
/*.wMaxPacketSize = DYNAMIC */
.bInterval = 4, /* FIXME: Add this field in the <<< changed to 1
* HID gadget configuration?
* (struct hidg_func_descriptor)
*/
};