This resolves an issue introduced by the implementation of the kernel detach code. This
code used claim_interface to detect if a kernel driver is attached. The issue is that if
a driver is attached or the interface is not available and an error message was printed
out. Since this is not an error the info level is more appropriate.
Also downgrading a number of warnings to clean up the output.
Closes #955
Signed-off-by: Nathan Hjelm <hjelmn@google.com>
- usbi_err (HANDLE_CTX (dev_handle), "interface not found");
+ usbi_info (HANDLE_CTX (dev_handle), "interface not found");
return LIBUSB_ERROR_NOT_FOUND;
}
return LIBUSB_ERROR_NOT_FOUND;
}
/* claim the interface */
kresult = (*(cInterface->interface))->USBInterfaceOpen(cInterface->interface);
if (kresult != kIOReturnSuccess) {
/* claim the interface */
kresult = (*(cInterface->interface))->USBInterfaceOpen(cInterface->interface);
if (kresult != kIOReturnSuccess) {
- usbi_err (HANDLE_CTX (dev_handle), "USBInterfaceOpen: %s", darwin_error_str(kresult));
+ usbi_info (HANDLE_CTX (dev_handle), "USBInterfaceOpen: %s", darwin_error_str(kresult));
return darwin_to_libusb (kresult);
}
return darwin_to_libusb (kresult);
}
usbi_dbg ("attempting to detach kernel driver from device");
if (!darwin_has_capture_entitlements ()) {
usbi_dbg ("attempting to detach kernel driver from device");
if (!darwin_has_capture_entitlements ()) {
- usbi_warn (HANDLE_CTX (dev_handle), "no capture entitlements. can not detach the kernel driver for this device");
+ usbi_info (HANDLE_CTX (dev_handle), "no capture entitlements. can not detach the kernel driver for this device");
return LIBUSB_ERROR_NOT_SUPPORTED;
}
/* request authorization */
kresult = IOServiceAuthorize (dpriv->service, kIOServiceInteractionAllowed);
if (kresult != kIOReturnSuccess) {
return LIBUSB_ERROR_NOT_SUPPORTED;
}
/* request authorization */
kresult = IOServiceAuthorize (dpriv->service, kIOServiceInteractionAllowed);
if (kresult != kIOReturnSuccess) {
- usbi_err (HANDLE_CTX (dev_handle), "IOServiceAuthorize: %s", darwin_error_str(kresult));
+ usbi_warn (HANDLE_CTX (dev_handle), "IOServiceAuthorize: %s", darwin_error_str(kresult));
return darwin_to_libusb (kresult);
}
return darwin_to_libusb (kresult);
}
if (dev_handle->auto_detach_kernel_driver) {
ret = darwin_detach_kernel_driver (dev_handle, iface);
if (ret != LIBUSB_SUCCESS) {
if (dev_handle->auto_detach_kernel_driver) {
ret = darwin_detach_kernel_driver (dev_handle, iface);
if (ret != LIBUSB_SUCCESS) {
- usbi_warn (HANDLE_CTX (dev_handle), "failed to auto-detach the kernel driver for this device, ret=%d", ret);
+ usbi_info (HANDLE_CTX (dev_handle), "failed to auto-detach the kernel driver for this device, ret=%d", ret);
if (dev_handle->auto_detach_kernel_driver && dpriv->capture_count > 0) {
ret = darwin_attach_kernel_driver (dev_handle, iface);
if (LIBUSB_SUCCESS != ret) {
if (dev_handle->auto_detach_kernel_driver && dpriv->capture_count > 0) {
ret = darwin_attach_kernel_driver (dev_handle, iface);
if (LIBUSB_SUCCESS != ret) {
- usbi_warn (HANDLE_CTX (dev_handle), "on attempt to reattach the kernel driver got ret=%d", ret);
+ usbi_info (HANDLE_CTX (dev_handle), "on attempt to reattach the kernel driver got ret=%d", ret);
}
/* ignore the error as the interface was successfully released */
}
}
/* ignore the error as the interface was successfully released */
}
-#define LIBUSB_NANO 11639
+#define LIBUSB_NANO 11640