Fix how libusb20_dev_kernel_driver_active() and
libusb_dev_kernel_driver_active() works. In case of libusb20 the manpage was wrong and in case of libusb10 the implementation was wrong. Submitted by: Kai Wang MFC after: 3 days
This commit is contained in:
parent
f6c6639af8
commit
4d2472aa7b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=226220
@ -223,8 +223,8 @@ code on failure.
|
|||||||
.Ft int
|
.Ft int
|
||||||
.Fn libusb_kernel_driver_active "libusb_device_handle *devh" "int interface"
|
.Fn libusb_kernel_driver_active "libusb_device_handle *devh" "int interface"
|
||||||
Determine if a driver is active on a interface.
|
Determine if a driver is active on a interface.
|
||||||
Returns 0 if no kernel driver
|
Returns 0 if no kernel driver is active
|
||||||
is active, 1 if a kernel driver is active, LIBUSB_ERROR_NO_DEVICE
|
and 1 if a kernel driver is active, LIBUSB_ERROR_NO_DEVICE
|
||||||
if the device has been disconnected and a LIBUSB_ERROR code on failure.
|
if the device has been disconnected and a LIBUSB_ERROR code on failure.
|
||||||
.Pp
|
.Pp
|
||||||
.Ft int
|
.Ft int
|
||||||
|
@ -216,7 +216,6 @@ libusb_get_device_list(libusb_context *ctx, libusb_device ***list)
|
|||||||
libusb20_be_free(usb_backend);
|
libusb20_be_free(usb_backend);
|
||||||
return (LIBUSB_ERROR_NO_MEM);
|
return (LIBUSB_ERROR_NO_MEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get device into libUSB v1.0 list */
|
/* get device into libUSB v1.0 list */
|
||||||
libusb20_be_dequeue_device(usb_backend, pdev);
|
libusb20_be_dequeue_device(usb_backend, pdev);
|
||||||
|
|
||||||
@ -718,8 +717,10 @@ libusb_kernel_driver_active(struct libusb20_device *pdev, int interface)
|
|||||||
if (pdev == NULL)
|
if (pdev == NULL)
|
||||||
return (LIBUSB_ERROR_INVALID_PARAM);
|
return (LIBUSB_ERROR_INVALID_PARAM);
|
||||||
|
|
||||||
return (libusb20_dev_kernel_driver_active(
|
if (libusb20_dev_kernel_driver_active(pdev, interface))
|
||||||
pdev, interface));
|
return (0); /* no kernel driver is active */
|
||||||
|
else
|
||||||
|
return (1); /* kernel driver is active */
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -614,10 +614,9 @@ The file descriptor can be used for polling purposes.
|
|||||||
.Pp
|
.Pp
|
||||||
.
|
.
|
||||||
.Fn libusb20_dev_kernel_driver_active
|
.Fn libusb20_dev_kernel_driver_active
|
||||||
returns a non-zero value if a kernel driver is active on
|
returns zero if a kernel driver is active on the given USB interface.
|
||||||
the given USB interface.
|
|
||||||
.
|
.
|
||||||
Else zero is returned.
|
Else a LIBUSB20_ERROR value is returned.
|
||||||
.
|
.
|
||||||
.Pp
|
.Pp
|
||||||
.
|
.
|
||||||
|
Loading…
Reference in New Issue
Block a user