aboutsummaryrefslogtreecommitdiff
path: root/lib/libusb/libusb10_hotplug.c
diff options
context:
space:
mode:
authorShengYi Hung <aokblast@FreeBSD.org>2025-06-11 19:07:39 +0000
committerShengYi Hung <aokblast@FreeBSD.org>2026-06-22 13:36:47 +0000
commit2879c818e5535e9c9dc592714c7d4ef0c1c9e8c1 (patch)
tree4c3e0527d9810697a77d3d3a11e57d7615dc2305 /lib/libusb/libusb10_hotplug.c
parentae489991d1c0b550ead309abc1eade3b185e7499 (diff)
libusb: implement libusb_set_option
Implement libusb_set_option for API compatibility of libusb upstream The implementation status of each option is as following: LIBUSB_OPTION_LOG_LEVEL: just like libusb_set_debug LIBUSB_OPTION_LOG_CB: add callback support for DPRINTF LIBUSB_OPTION_NO_DEVICE_DISCOVERY: disable initialization of devd and netlink when register. Also, create no thread when registration of callback happens. LIBUSB_OPTION_USE_USBDK: no needed as USBDK is for Windows Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50818
Diffstat (limited to 'lib/libusb/libusb10_hotplug.c')
-rw-r--r--lib/libusb/libusb10_hotplug.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libusb/libusb10_hotplug.c b/lib/libusb/libusb10_hotplug.c
index 359c818b5720..8b8de5019e4e 100644
--- a/lib/libusb/libusb10_hotplug.c
+++ b/lib/libusb/libusb10_hotplug.c
@@ -348,6 +348,9 @@ int libusb_hotplug_register_callback(libusb_context *ctx,
ctx = GET_CONTEXT(ctx);
+ if (ctx->no_discovery)
+ return (LIBUSB_SUCCESS);
+
if (ctx->usb_event_mode == usb_event_none) {
HOTPLUG_LOCK(ctx);
if (!netlink_init(ctx) && !devd_init(ctx))