darwin: use the IO registry to detect if a kernel driver is attached to an interface#959
Conversation
|
This is a return to the prior approach which broke when IOUSBFamily was rewritten. This commit fixes the issues with the previous approach and has been verified on macOS 10.12 and 11. |
|
@mcuee This should work better than claiming/releasing the interface. It should also work with older macOS versions given this approach used to work. |
…to an interface The implementation of libusb_kernel_driver_active was attempting to open the interface to check if a driver is attached. This may have side effects (like configuring the device) that may be unexpected to the user. This commit updates the code to find the interface's IO registry entry (either IOUSBHostInterface or the legacy IOUSBInterface) and check if the entry has a child entry. A child entry indicates that a driver is currently attached. Signed-off-by: Nathan Hjelm <hjelmn@google.com>
5a02a12 to
b8e3626
Compare
|
Tested with 10.7 and this works there as well. |
|
Great. I will try this out soon. |
|
Yes this is good. |
|
@hjelmn Still I see an issue with the output from the Cypress EZUSB FX2LP bootloader device, I think the two info should not be there since there is no kernel driver to detach in the first place. I think the kernel driver detaching code should check whether there is a need to detach kernel driver first. I will create another issue for that. |
The implementation of libusb_kernel_driver_active was attempting to open the interface to
check if a driver is attached. This may have side effects (like configuring the device)
that may be unexpected to the user. This commit updates the code to find the interface's
IO registry entry (either IOUSBHostInterface or the legacy IOUSBInterface) and check if
the entry has a child entry. A child entry indicates that a driver is currently attached.
Signed-off-by: Nathan Hjelm hjelmn@google.com