aboutsummaryrefslogtreecommitdiff
path: root/lib/libusb/libusb10.c
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2010-10-14 20:04:36 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2010-10-14 20:04:36 +0000
commitf1b5fa6e496ae0eb2a3a60ecd613ff92d432e5b9 (patch)
treefa43319fefc62e8ee751a4bcef8985b2fdf2f589 /lib/libusb/libusb10.c
parent113801819a491237c6fa06f135740d0c19bc608a (diff)
downloadsrc-f1b5fa6e496ae0eb2a3a60ecd613ff92d432e5b9.tar.gz
src-f1b5fa6e496ae0eb2a3a60ecd613ff92d432e5b9.zip
LibUSB (new API):
- Add a new API function to check the connected status of the USB handle in the LibUSB v1.0 and LibUSB v0.1 interfaces. Approved by: thompsa (mentor)
Notes
Notes: svn path=/head/; revision=213848
Diffstat (limited to 'lib/libusb/libusb10.c')
-rw-r--r--lib/libusb/libusb10.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c
index a3f0087b8227..7d6c9d93fb4a 100644
--- a/lib/libusb/libusb10.c
+++ b/lib/libusb/libusb10.c
@@ -663,6 +663,21 @@ libusb_reset_device(struct libusb20_device *pdev)
}
int
+libusb_check_connected(struct libusb20_device *pdev)
+{
+ libusb_device *dev;
+ int err;
+
+ dev = libusb_get_device(pdev);
+ if (dev == NULL)
+ return (LIBUSB_ERROR_INVALID_PARAM);
+
+ err = libusb20_dev_check_connected(pdev);
+
+ return (err ? LIBUSB_ERROR_NO_DEVICE : 0);
+}
+
+int
libusb_kernel_driver_active(struct libusb20_device *pdev, int interface)
{
if (pdev == NULL)