-
Notifications
You must be signed in to change notification settings - Fork 33
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
Implement detach_and_claim_interface
#35
Conversation
9f640ac
to
751218a
Compare
189a026
to
33c1924
Compare
src/platform/linux_usbfs/usbfs.rs
Outdated
if driver.driver[0..6] != *b"usbfs\0" { | ||
return Err(io::Errno::NOENT); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems backwards -- you want to detach a kernel driver (e.g. ftdi_sio
), but don't want to detach another instance of nusb / libusb using usbfs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Monkey see this, monkey do !=
. Monkey no think source is C and that strcmp returns 0 if equal :)
It's actually the opposite for me (Ubuntu 22.04, Kernel 6.5.0). The Those weren't working because the ioctl opcodes were wrong -- the rustix Can you re-test with |
Apparently I see something and write something else :) I promise
I should stop reporting from memory.
All I'm seeing is the following. I probably shouldn't be surprised, mine is also Ubuntu 22.04 with kernel 6.5.0.
Thanks for touching up my silliness :) |
not needed for any modern kernel
Dropped the fallback in the interest of not having legacy code that no one is testing, but if there comes a need for it, it'll be in git history. |
Closes #34
Interestingly, the PR needs the fallback-to-racy code, otherwise it's not working on my ubuntu which is definitely not 12 years old (I'm getting "this ioctl is not valid for this device" error). Not sure what's going on there, maybe it's an undiscovered bug in libusb which I used as the source to port this code from. Or maybe I just can't copy code very well, as the number of force pushes here indicates :)