| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This prepares for a Windows backend without dependency on pthreads-w32.
pthread_* is renamed to usbi_* and PTHREAD_* to USBI_*.
A usbi_mutex_static_t and usbi_mutex_static_lock() and _unlock() are
introduced for statically initialized mutexes, since they may be
implemented using other types when pthreads mutexes aren't used.
Move -pthread from libusb/Makefile.am to host-specific AM_CFLAGS in
configure.ac. AM_CFLAGS is already used in Makefile.am.
|
|
|
|
| |
Credit to Mike Colagrosso for finding this bug.
|
|
|
|
| |
Use usbi_warn, usbi_err, and usbi_info instead of _usbi_log.
|
|
|
|
| |
Credit to Orin Eman for finding this bug.
|
| |
|
|
|
|
| |
lsusb.c:26: warning: no previous prototype for ‘print_devs’
|
|
|
|
|
| |
os/darwin_usb.c:63: warning: return discards qualifiers from pointer
target type
|
|
|
|
|
|
|
| |
Allows libusb applications to access multiple interfaces of the same
device in the same application.
Also fixes a set alt interface bug.
|
|
|
|
|
| |
The internal timing seems to be working, this will be a better test of
it before we make this timeout unlimited.
|
|
|
|
| |
Require glibc-2.9 for the working timerfd support.
|
| |
|
| |
|
|
|
|
| |
core.c:777: warning: no previous prototype for 'libusb_get_max_iso_packet_size'
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use a new file descriptor from the timerfd system calls to handle
timeouts. On supported systems, this means that there is less hassle
figuring out when the poll() timeout should be, since
libusb_get_next_timeout() will always return 0 and the timeout events will
be triggered as regular activity on the file descriptor set.
Add API function libusb_pollfds_handle_timeouts() to detect whether
you're on a platform with the timing headache, and flesh out the
surrounding documentation.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for the new USBDEVFS_URB_BULK_CONTINUATION flag to libusb.
This flag, which is expected to be available in usbfs starting with
kernel 2.6.32, allows the kernel to cancel multiple URBs upon receipt
of a short packet. This capability allows libusb to preserve data
integrity of large bulk transfers that are split into multiple URBs.
Without this support, these URBs must be canceled in userspace upon
receipt of a short packet, a race condition against future transfers
which might partially fill these canceled URBs.
This patch automatically detects whether a supported kernel is present
and enables the use of the flag when possible.
[dsd: tweaks to supported kernel detection, and some inline
documentation of this mechanism]
|
|
|
|
|
|
|
|
|
|
|
|
| |
At least on Linux, there were some possible races that could occur if
a transfer is cancelled from one thread while another thread is handling
an event for that transfer, or for if a transfer completes while it is
still being submitted from another thread, etc.
On the global level, transfers could be submitted and cancelled at the
same time.
Fix those issues with transfer-level locks.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some users have reported that CLOCK_MONOTONIC does not work on their
systems - I suspect it is available on x86 but perhaps not some
of the more uncommon architectures. We should fall back on
CLOCK_REALTIME in these cases.
Also, CLOCK_MONOTONIC_RAW seems even more monotonic, so we should use
that if it is available.
We now test different clock IDs during initialization to find the
best one that works.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Fix a crash which occurs if the user does the following sequence on a
device: open, close, get_configuration_descriptor.
|
|
|
|
|
| |
Protection needed: http://www.libusb.org/ticket/4
Losing data: fixed in previous commit
|
|
|
|
|
| |
We would previously lose any data that was present on a cancelled URB.
Work harder to make sure this doesn't happen.
|
|
|
|
|
|
|
|
|
| |
As pointed out by Dennis Muhlestein, libusb_get_max_packet_size()
doesn't really do what the documentation might suggest because it
does not consider the number of transaction opportunities per
microframe.
Add a new function to do what is useful for isochronous I/O.
|
|
|
|
|
| |
Note that there are is a kernel bug preventing this from working
properly at the moment, even after this fix.
|
|
|
|
| |
...because the OS does this for us.
|
|
|
|
|
| |
g++ -pedantic doesn't like this
Reported by Eberhard Mattes
|
| |
|
|
|
|
|
|
|
| |
Multi-byte fields in the configuration descriptors that come back from
usbfs are always in bus endian format.
Thanks to Joe Jezak for help investigating and fixing this.
|
| |
|
|
|
|
|
| |
This was a confusion between configuration numbers and zero-based
configuration indexes.
|
|
|
|
|
|
| |
This was due to an API inconsistency which can be safely worked around.
Hopefully we'll remember to fix the API next time we come to break
things.
|
|
|
|
|
|
|
|
|
|
|
|
| |
libusb_control_transfer and libusb_bulk_transfer are designed to be
synchronous such that control is not returned until the transfer
definitively succeeds or fails. That assumption is violated if a signal
interrupts these functions because there is no way for the application
to continue waiting for the transfer without resubmitting it. This
patch changes these synchronous APIs so they do not abort in the case of
a signal interruption.
Signed-off-by: David Moore <dcm@acm.org>
|
|
|
|
|
| |
The -fvisibility and -Wno-pointer-sign options are not available on
old GCC versions.
|
|
|
|
| |
Pointed out by Martin Koegler.
|
| |
|
| |
|
|
|
|
| |
Probably missed a couple of outstanding issues
|
| |
|
|
|
|
| |
My fault. Reported by ihryamzik@gmail.com
|
| |
|
|
|
|
|
| |
Implementation suggested by David Moore. Needed for proper universal
code support on Darwin.
|
|
|
|
|
|
| |
This will differ on Linux and Darwin, at least.
[dsd: minor style tweaks]
|
|
|
|
| |
Pointed out by Nathan Hjelm.
|
|
|
|
| |
[dsd: tweak configure.ac change]
|
|
|
|
|
|
|
|
| |
Add some text describing the libusb_transfer_cb_fn function type
with the semantics I have gathered from reading other parts of
the API docs, referring to the proper section for more details.
[dsd: tweaked the description slightly]
|
|
|
|
|
|
|
|
| |
If the compiler is known to be running in C99 mode,
use "flexible array members" ("foo[]").
If the compiler is running in any other mode, continue
using the non-standard but widely common "foo[0]" syntax.
|