1

I'm trying to connect a serial device with Webusb, under linux.

I have been able to list the device and open it, but I can't claim the interface. Chrome complains that the device is busy, and to fix that I need to unregister the CDC-ACM driver.

Is there a way to prevent the CDC-ACM driver from loading the device, without changes on the destkop? maybe I can change the USB descriptors?

Mascarpone
  • 2,516
  • 4
  • 25
  • 46

1 Answers1

2

If you can change the device descriptors then modify the protocol, class and sub-class reported by the CDC-ACM interface so that it is marked as vendor-specific (0xff). The CDC-ACM driver will no longer recognize the interface and bind to it.

Just for completeness, if you could make changes to the desktop then you can either blacklist the usb-serial driver entirely in /etc/modprobe.d/blacklist or you could write a udev rule which runs for that device in particular (recognized be either bus path or vendor and product ID) and executes a script to unbind the driver.

Reilly Grant
  • 5,590
  • 1
  • 13
  • 23
  • the linux usb gadget driver doesn't allow me to change interface specific descriptors. I can change device descriptors, for example lsusb reports that bDeviceClass is ` 0 (Defined at Interface level)`, but then another serial port on the same interface would stop working. Udev could be an option though – Mascarpone Feb 07 '18 at 16:25
  • 1
    Given the number of people asking about this I should really look into patching the Linux serial gadget driver to allow this. – Reilly Grant Feb 21 '18 at 18:57