diff options
author | Nathan Hjelm <hjelmn@google.com> | 2021-07-21 11:47:25 -0600 |
---|---|---|
committer | Nathan Hjelm <hjelmn@google.com> | 2021-07-21 12:41:26 -0600 |
commit | 42f9c3b43f49f22a3b10ed452f500f6f50c093df (patch) | |
tree | f0fb47d7693b44cbe6c7a6ec8f27492df5b412fd /examples | |
parent | 6cae9c6dbd74c0840848f343dd605c5ddcef1ad1 (diff) | |
download | libusb-42f9c3b43f49f22a3b10ed452f500f6f50c093df.tar.gz |
xusb: add check for interface kernel driver
This commit adds a call to libusb_kernel_driver_active and prints out the result. This
provides a way to quickly check the result when testing.
Signed-off-by: Nathan Hjelm <hjelmn@google.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/xusb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/xusb.c b/examples/xusb.c index bf328fe..61ce4dd 100644 --- a/examples/xusb.c +++ b/examples/xusb.c @@ -914,6 +914,8 @@ static int test_device(uint16_t vid, uint16_t pid) libusb_set_auto_detach_kernel_driver(handle, 1); for (iface = 0; iface < nb_ifaces; iface++) { + int ret = libusb_kernel_driver_active(handle, iface); + printf("\nKernel driver attached for interface %d: %d\n", iface, ret); printf("\nClaiming interface %d...\n", iface); r = libusb_claim_interface(handle, iface); if (r != LIBUSB_SUCCESS) { |