Skip to content

darwin: only attempt to auto-detach driver is one is active#961

Merged
hjelmn merged 1 commit intolibusb:masterfrom
hjelmn:improve_autodetach
Jul 22, 2021
Merged

darwin: only attempt to auto-detach driver is one is active#961
hjelmn merged 1 commit intolibusb:masterfrom
hjelmn:improve_autodetach

Conversation

@hjelmn
Copy link
Copy Markdown
Member

@hjelmn hjelmn commented Jul 22, 2021

This commit improves the auto-detach code so that it doesn't attempt to detach a kernel
driver if none exists. This will avoid extra info/warning output on the failed detach.

Closes #960

Signed-off-by: Nathan Hjelm hjelmn@google.com

This commit improves the auto-detach code so that it doesn't attempt to detach a kernel
driver if none exists. This will avoid extra info/warning output on the failed detach.

Closes libusb#960

Signed-off-by: Nathan Hjelm <hjelmn@google.com>
@hjelmn
Copy link
Copy Markdown
Member Author

hjelmn commented Jul 22, 2021

@mcuee Should do the trick to remove the messages.

@mcuee mcuee added the macOS label Jul 22, 2021
@mcuee
Copy link
Copy Markdown
Member

mcuee commented Jul 22, 2021

Great. This works very well. Thanks.


libusb_testn on  improve_autodetach ❯ ./examples/xusb 04b4:00f3
Using libusb v1.0.24.11644

Opening device 04B4:00F3...

Reading device descriptor:
            length: 18
      device class: 0
               S/N: 3
           VID:PID: 04B4:00F3
         bcdDevice: 0100
   iMan:iProd:iSer: 1:2:3
          nb confs: 1

Reading BOS descriptor: no descriptor

Reading first configuration descriptor:
             nb interfaces: 1
              interface[0]: id = 0
interface[0].altsetting[0]: num endpoints = 0
   Class.SubClass.Protocol: FF.00.00

Kernel driver attached for interface 0: 0

Claiming interface 0...

Reading string descriptors:
   String (0x01): "Cypress"
   String (0x02): "WestBridge "
   String (0x03): "0000000004BE"

Releasing interface 0...
Closing device...

@hjelmn hjelmn merged commit d2522b3 into libusb:master Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS kernel driver detach code improvement

2 participants