Limit USB gadget driver speed

风格不统一 提交于 2019-12-11 18:53:43

问题


tl;dr: How do I compel Linux to reject high-speed USB connections so that it defaults to full speed?

Full explanation:

I'm writing a USB gadget driver based on Linux gadget zero. The hardware I'm testing on has high speed capable USB which won't be the case of the actual product. For some reason, the gadget (although it has no high speed descriptors on any configuration) is being reported as a high speed gadget (struct usb_gadget->speed==USB_SPEED_HIGH on set_config function of composite gadget). This makes the driver fail miserably just before configuration bind (trying to load a high speed configuration that obviously doesn’t exist).

I'm looking for a way to inform Linux that the gadget is not high speed capable so that when a host connects the switch from fullspeed to highspeed is denied (or something that would produce a similar results).


回答1:


uhci and ohci kernel modules drive USB 1.X controllers. ehci modules drives USB 2.0 controller.

If you unload one of these, you enforce a restriction to the other.




回答2:


enum usb_device_speed       speed;
enum usb_device_speed       max_speed;

you can setup usb_composite_driver


来源:https://stackoverflow.com/questions/13704906/limit-usb-gadget-driver-speed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!