0

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).

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
user1783395
  • 95
  • 1
  • 5
  • before of running a compil process, you could try to unload or blacklist some modules, like `uhci`, `ohci`... take a look at `man modprobe`! – F. Hauri - Give Up GitHub Dec 04 '12 at 14:22
  • The solution I finally applyed was to modify the usb gadget driver (I mean the hardware controler) so that the hardware rejected the highspeed request. (I designed the hardware/embedded system so I already had the required documentation, I dont think this is the best solution if applied to a generic PC). – user1783395 Dec 04 '12 at 19:10

2 Answers2

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.

ypnos
  • 50,202
  • 14
  • 95
  • 141
  • Although that should work and does answer the question it didn’t solve my problem. The host is still connecting to my gadget in high speed (which shouldn’t happen since I disabled the USB2.0 support from the kernel). – user1783395 Dec 04 '12 at 16:32
-1
enum usb_device_speed       speed;
enum usb_device_speed       max_speed;

you can setup usb_composite_driver
leesagacious
  • 182
  • 1
  • 8