-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detaching a (Linux) kernel driver #246
Comments
yeah, I encounter the similar issue on Ubuntu 20.04 that claim the interface automatically. I used a simple script in python to detach the kernel driver. I think the reason they don't implement that feature is because it is different for different platforms and it touches a lot of low-level stuff for different platform, not sure if there is a general fix for that. I can confirm that you don't face the same issue on MacOS not sure on Windows. |
There are two pieces to this,
|
Thanks, that's useful to know. If Windows requires invasive action to relinquish control to the browser, I understand the answer to my question will be "claiming an interface should not be disruptive" for the foreseeable future. Thus I should redesign the device to use a vendor subclass. Since the user has already performed an action to approve opening the device, taking a defensive position due to security seems questionable. But given the above, I don't think it matters. My question has been answered. I'm guessing it doesn't need further clarification in the spec, though I think a note that this is intended behavior would be useful. |
I'm buildling a USBTMC device, which I'd like to access with WebUSB. When my device connects, the interface is immediately bound to the Linux
usbtmc
kernel driver, andclaimInterface
fails withNetworkError
.libusb provides
libusb_detach_kernel_driver
to explicitly hijack the device.I can't find any information in the WebUSB specification about how implementations are supposed to handle this case. If I have requested the device, the user likely wants the webpage detaching the driver ("just make it work.") To me, it seems
claimInterface
should use always try to detach the kernel driver, but it would be nice with some guidance on how disruptiveclaimInterface
ought to be.For anyone looking for an answer, this udev rule is for a Raspberry Pi RP2040 that can then be claimed by WebUSB:
Caveat emptor: I don't know how this works on other OSes, but I don't think it matters for the general question of how eager
claimInterface
should be to succeed.The text was updated successfully, but these errors were encountered: