History log of /src/lib/libusb/libusb10_io.c (Results 1 – 25 of 171)
Revision Date Author Comments
# b0d5c1cf 05-Aug-2025 ShengYi Hung <aokblast@FreeBSD.org>

libusb: implement libusb_pollfds_handle_timeouts

This function tells applications who maintain the pollfds themselves if
they should handle the timeout for each xfer themselves. In FreeBSD, the
time

libusb: implement libusb_pollfds_handle_timeouts

This function tells applications who maintain the pollfds themselves if
they should handle the timeout for each xfer themselves. In FreeBSD, the
timeout for each xfer is handled by kernel and doesn't need a special timer to
do so. Therefore, we return 1 to indicate that it is handled by libusb
internally.

Approved by: lwhsu (mentor), markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51742

show more ...


# 3eda3493 09-Jul-2025 ShengYi Hung <aokblast@FreeBSD.org>

libusb: implement libusb_fill_bulk_stream_transfer

Bulk streams are essentially bulk transfers with a stream ID. All
requirements from both libusb20 and the kernel are already handled; we
just need

libusb: implement libusb_fill_bulk_stream_transfer

Bulk streams are essentially bulk transfers with a stream ID. All
requirements from both libusb20 and the kernel are already handled; we
just need to set the stream ID.

Approved by: markj (mentor), lwhsu(mentor)
Differential Revision: https://reviews.freebsd.org/D51226

show more ...


# 1c675fb3 09-Jul-2025 ShengYi Hung <aokblast@FreeBSD.org>

libusb: implement libusb_free_pollfds

libusb provides an API that frees the storage for pollfds regardless of
their contents. It does not check whether the file descriptors inside
are already closed

libusb: implement libusb_free_pollfds

libusb provides an API that frees the storage for pollfds regardless of
their contents. It does not check whether the file descriptors inside
are already closed.

Approved by: markj (mentor), lwhsu(mentor)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51221

show more ...


# bca5df45 04-Jun-2025 ShengYi Hung <aokblast@FreeBSD.org>

libusb: replace LOG_LEVEL with DEBUG_LEVEL

The libusb set debug level by libusb_log_level instead of
libusb_debug_level. We switch to libusb_log_level for better
compatibility with the upstream libu

libusb: replace LOG_LEVEL with DEBUG_LEVEL

The libusb set debug level by libusb_log_level instead of
libusb_debug_level. We switch to libusb_log_level for better
compatibility with the upstream libusb.

Additionally, The upstream libusb has an option allows user to override the log
function with a user-defined callback.
To support the callback function with a single string without va_arg, we
refactor the log facility as a function instead of a macro and parse all
va_args inside.

The legacy debug_level enum has been removed to enforce maintainer migrate from their
deprecated source code.

Reviewed by: kevans
Approved by: markj (mentor), lwhsu (mentor)
MFC after: 2 weeks
Sponsored by: FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50680

show more ...


# ae28929b 15-May-2025 Baptiste Daroussin <bapt@FreeBSD.org>

libusb: use eventfd

Simplify libusb code by replacing pipe(2) inter thread event mecanism
with eventfd(2).

MFC After: 3 weeks
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/

libusb: use eventfd

Simplify libusb code by replacing pipe(2) inter thread event mecanism
with eventfd(2).

MFC After: 3 weeks
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D50360

show more ...


# d2852659 05-May-2025 SHENGYI HUNG <aokblast@FreeBSD.org>

libusb: Emit event after deregistering hotplug handler

The original implementation did not emit an event when a hotplug handler
was deregistered. This omission causes issues for programs that follow

libusb: Emit event after deregistering hotplug handler

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

show more ...


# 2a63c3be 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c comment pattern

Remove /^/[*/]\s*\$FreeBSD\$.*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


# 6847ea50 11-Jun-2021 Hans Petter Selasky <hselasky@FreeBSD.org>

Improve handling of USB device re-open in the LibUSB v1.x API.

Make sure the "device_is_gone" flag is cleared after every successful open,
so that the "device_is_gone" flag doesn't persist forever.

Improve handling of USB device re-open in the LibUSB v1.x API.

Make sure the "device_is_gone" flag is cleared after every successful open,
so that the "device_is_gone" flag doesn't persist forever.

Found by: sergii.dmytruk@3mdeb.com
PR: 256296
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

show more ...


# 01d4e214 05-Oct-2018 Glen Barber <gjb@FreeBSD.org>

MFH r338661 through r339200.

Sponsored by: The FreeBSD Foundation


# ab530bf0 29-Sep-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r338988 through r339014.


# 26829924 28-Sep-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

When multiple threads are involved receiving completion events in LibUSB
make sure there is always a master polling thread, by setting the "ctx_handler"
field in the context. Else the reception of co

When multiple threads are involved receiving completion events in LibUSB
make sure there is always a master polling thread, by setting the "ctx_handler"
field in the context. Else the reception of completion events can stop.
This happens if event threads are created and destroyed during runtime.

Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231742
MFC after: 1 week
Approved by: re (kib)
Sponsored by: Mellanox Technologies

show more ...


# c0b5e991 14-Sep-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r338595 through r338689, and resolve conflicts.


# 5b21ba5c 14-Sep-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Improve LibUSB debugging by simultaneously allowing both function
and transfer prints. Make sure the debug level comes from the
correct USB context.

Found by: Ludovic Rousseau <ludovic.rousseau+fre

Improve LibUSB debugging by simultaneously allowing both function
and transfer prints. Make sure the debug level comes from the
correct USB context.

Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231264
MFC after: 1 week
Approved by: re (kib)
Sponsored by: Mellanox Technologies

show more ...


# 540c7229 12-Sep-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix issues about cancelling USB transfers in LibUSB when the USB device has
been detached. When a USB device has been detached the kernel file handle
stops responding to commands. USB applications wh

Fix issues about cancelling USB transfers in LibUSB when the USB device has
been detached. When a USB device has been detached the kernel file handle
stops responding to commands. USB applications which continue to run after
the USB device has been detached, depend on LibUSB generated events to tear
down its pending USB transfers. Add code to handle the needed cleanup when
processing the USB transfer(s) fails and prevent new USB transfer(s) from
being submitted.

Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231076
MFC after: 1 week
Approved by: re (gjb)
Sponsored by: Mellanox Technologies

show more ...


# b0d5c1cf 05-Aug-2025 ShengYi Hung <aokblast@FreeBSD.org>

libusb: implement libusb_pollfds_handle_timeouts

This function tells applications who maintain the pollfds themselves if
they should handle the timeout for each xfer themselves. In FreeBSD, the
time

libusb: implement libusb_pollfds_handle_timeouts

This function tells applications who maintain the pollfds themselves if
they should handle the timeout for each xfer themselves. In FreeBSD, the
timeout for each xfer is handled by kernel and doesn't need a special timer to
do so. Therefore, we return 1 to indicate that it is handled by libusb
internally.

Approved by: lwhsu (mentor), markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51742

show more ...


# 3eda3493 09-Jul-2025 ShengYi Hung <aokblast@FreeBSD.org>

libusb: implement libusb_fill_bulk_stream_transfer

Bulk streams are essentially bulk transfers with a stream ID. All
requirements from both libusb20 and the kernel are already handled; we
just need

libusb: implement libusb_fill_bulk_stream_transfer

Bulk streams are essentially bulk transfers with a stream ID. All
requirements from both libusb20 and the kernel are already handled; we
just need to set the stream ID.

Approved by: markj (mentor), lwhsu(mentor)
Differential Revision: https://reviews.freebsd.org/D51226

show more ...


# 1c675fb3 09-Jul-2025 ShengYi Hung <aokblast@FreeBSD.org>

libusb: implement libusb_free_pollfds

libusb provides an API that frees the storage for pollfds regardless of
their contents. It does not check whether the file descriptors inside
are already closed

libusb: implement libusb_free_pollfds

libusb provides an API that frees the storage for pollfds regardless of
their contents. It does not check whether the file descriptors inside
are already closed.

Approved by: markj (mentor), lwhsu(mentor)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51221

show more ...


# bca5df45 04-Jun-2025 ShengYi Hung <aokblast@FreeBSD.org>

libusb: replace LOG_LEVEL with DEBUG_LEVEL

The libusb set debug level by libusb_log_level instead of
libusb_debug_level. We switch to libusb_log_level for better
compatibility with the upstream libu

libusb: replace LOG_LEVEL with DEBUG_LEVEL

The libusb set debug level by libusb_log_level instead of
libusb_debug_level. We switch to libusb_log_level for better
compatibility with the upstream libusb.

Additionally, The upstream libusb has an option allows user to override the log
function with a user-defined callback.
To support the callback function with a single string without va_arg, we
refactor the log facility as a function instead of a macro and parse all
va_args inside.

The legacy debug_level enum has been removed to enforce maintainer migrate from their
deprecated source code.

Reviewed by: kevans
Approved by: markj (mentor), lwhsu (mentor)
MFC after: 2 weeks
Sponsored by: FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50680

show more ...


# ae28929b 15-May-2025 Baptiste Daroussin <bapt@FreeBSD.org>

libusb: use eventfd

Simplify libusb code by replacing pipe(2) inter thread event mecanism
with eventfd(2).

MFC After: 3 weeks
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/

libusb: use eventfd

Simplify libusb code by replacing pipe(2) inter thread event mecanism
with eventfd(2).

MFC After: 3 weeks
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D50360

show more ...


# d2852659 05-May-2025 SHENGYI HUNG <aokblast@FreeBSD.org>

libusb: Emit event after deregistering hotplug handler

The original implementation did not emit an event when a hotplug handler
was deregistered. This omission causes issues for programs that follow

libusb: Emit event after deregistering hotplug handler

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

show more ...


# 2a63c3be 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c comment pattern

Remove /^/[*/]\s*\$FreeBSD\$.*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


# 6847ea50 11-Jun-2021 Hans Petter Selasky <hselasky@FreeBSD.org>

Improve handling of USB device re-open in the LibUSB v1.x API.

Make sure the "device_is_gone" flag is cleared after every successful open,
so that the "device_is_gone" flag doesn't persist forever.

Improve handling of USB device re-open in the LibUSB v1.x API.

Make sure the "device_is_gone" flag is cleared after every successful open,
so that the "device_is_gone" flag doesn't persist forever.

Found by: sergii.dmytruk@3mdeb.com
PR: 256296
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

show more ...


# 01d4e214 05-Oct-2018 Glen Barber <gjb@FreeBSD.org>

MFH r338661 through r339200.

Sponsored by: The FreeBSD Foundation


1234567