https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231264
Bug ID: 231264
Summary: libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O
done"); does not work in libusb10_do_transfer_cb()
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: usb
Assignee: [email protected]
Reporter: [email protected]
The _only_ use of DPRINTF(..., LIBUSB_DEBUG_TRANSFER, ...) is in the function
libusb10_do_transfer_cb of libusb10_io.c
https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb10_io.c#L500
The function uses it as:
ctx = GET_CONTEXT(NULL);
DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done");
Since the ctx context is fetched from NULL it has default values and ctx->debug
is 0.
DPRINTF() definition uses ctx->debug to know the debug level.
https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb10.h#L44
In the present case the debug level will be 0 so nothing is logged.
I don't know how to get the libusb context from a libusb_transfer, the only
parameter passed to libusb10_do_transfer_cb().
Another idea for improvement would be to use a bitmap for ctx->debug so it
would be possible to enable both LIBUSB_DEBUG_TRANSFER and
LIBUSB_DEBUG_FUNCTION at the same time.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[email protected]"