| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
libusb provides a function to get the callback userdata for a given
callback since this structure is opaque to libusb user.
Approved by: markj (mentor), lwhsu (mentor)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D51223
|
|
|
|
|
|
|
|
|
|
|
| |
Application can use libusb_get_pollfds to get pollfds from libusb then
close the fd themselves. This cause the hotplug thread unable to leave
because it will be consider as a invalid event then loop forever instead
of a broken event that should be quit immediately.
Reviewed by: bapt
Sponsored by: FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50959
|
|
|
|
|
| |
Reviewed by: hrs
Differential Revision: https://reviews.freebsd.org/D50739
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original implementation did not emit an event when a hotplug handler
was deregistered. This omission causes issues for programs that follow
the best practices recommended by libusb—particularly those that use
`libusb_hotplug_register_callback()` or similar functions in a loop
while managing hotplug handlers dynamically.
Without emitting an event after deregistration, these programs can
become stuck waiting indefinitely for an event that will never come,
as the condition to break out of the wait loop is never satisfied.
See: https://github.com/libusb/libusb/blob/6c0ae1ab456da49e7805115e77ce0428ace4ea41/libusb/hotplug.c#L459
Reviewed by: bapt
Sponsored By: FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50170
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Try to fetch events from nlsysevent or devd to determine when
to scan the usb bus for devices addition or removal.
if none are available fallback on the regular timer based (4s)
scanner
if devd socket or netlink socket is closed or error fallback on the
timer based method.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D48300
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a hotplug callback has been registered, and the program using
libusb is calling libusb_exit then the thread handler is set to
NO_THREAD which result in the variable controlling the loop the be set
to 0, it does a last pass through device available without having done
a scan, which result in a sigbus after it tried to unregister all the
devices.
directly break the loop instead and cleanup the list of devices
this fixes the tests with LGPLed libusb's hotplugtest program
MFC After: 3 days
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D48298
|
|
|
|
| |
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
|
|
|
|
|
|
|
|
|
|
|
|
| |
Differential Revision: https://reviews.freebsd.org/D23430
Submitted by: cem
Reported by: Coverity
Coverity CID: 1368773
MFC after: 3 days
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=357298
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libusb_hotplug_register_callback().
Else when registering multiple filters the same USB device may appear twice in
the list.
MFC after: 3 days
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=349410
|
|
|
|
|
|
|
|
|
|
|
|
| |
devices are enumerated regardless of of the LIBUSB_HOTPLUG_ENUMERATE
flag. Make sure when the flag is not specified no arrival events are
generated for currently enumerated devices.
MFC after: 3 days
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=349409
|
|
libusb_hotplug_deregister_callback() for the LibUSB v1.0 API and
update the libusb(3) manual page.
Approved by: re (kib)
Requested by: swills
MFC after: 1 week
Notes:
svn path=/head/; revision=302080
|