| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
* The LOG_LEVEL_ enums, that were moved to the public API
in 933a319469bcccc962031c989e39d9d1f44f2885 may conflict
with applications/headers that also define their own
LOG_LEVEL_ values internally.
* As a matter of fact, as per Trac #31, this produces a
conflict with libusb-compat, as it defines its own levels.
|
|
|
|
|
|
|
|
|
|
| |
* http://sourceforge.net/mailarchive/message.php?msg_id=29418038
* core.c:700:4: warning: Function call argument is an uninitialized value
* darwin_usb.c:1713:11: warning: Access to field 'cfSource' results in a
dereference of a null pointer (loaded from variable 'hpriv')
* sync.c/dpfp.c/dpfp_threaded.c: warning: Result of 'malloc' is converted
to a pointer of type 'unsigned char', which is incompatible with sizeof
operand type
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* The library is now compiled with warning level 4 for VS2010
* Move silencing of 4200, 28125 and 28719 to msvc/config.h
* Add fixes in core to silence unused variables warnings
* Ensure that spinlock is always set interlocked in poll_windows
* Add missing check for calloc return value
* Fix data assignation in conditionals warnings
* Fix an OACR/Prefast error related to the use of strncpy in xusb.c
* Also fixes whitespace inconsistencies in core
* Issues reported by Orin Eman and Xiaofan Chen. See:
https://sourceforge.net/mailarchive/message.php?msg_id=29412656
|
|
|
|
|
|
|
|
|
| |
* windows_usb.c(161): warning #181: argument is incompatible
with corresponding format string conversion
* windows_usb.c(2124): warning #111: statement is unreachable
usbi_dbg("ERROR: broken timer thread");
* multiple: warning #188: enumerated type mixed with another
* Issues reported by Orin Eman
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
core.c:
* Result of 'malloc' is converted to a pointer of type 'struct libusb_device *',
which is incompatible with sizeof operand type 'void *'
* Memory is never released; potential leak of memory pointed to by 'devs'
* Assigned value is garbage or undefined (due to potentially empty and
uninitialized device list)
descriptor.c:
* Function call argument is an uninitialized value
io.c:
* Call to 'malloc' has an allocation size of 0 bytes
* Branch condition evaluates to a garbage value (due to get_next_timeout
returning a negative error code instead of zero on error)
|
|
|
|
|
|
|
|
| |
* p = realloc(p, new_size) does not free the original buffer in case of
a realloc failure.
* reallocf() can be used to do so, but is not available on all platforms.
* This patch introduces usbi_reallocf() in libusbi.h and use that instead of realloc
* Issue and original patch submitted by Moritz Lipp (trac #27)
|
| |
|
|
|
|
|
| |
* Also fix a missing space in debug log messages introduced
with the previous timestamp logging update
|
| |
|
|
|
|
| |
* This effectively removes the use of stdout for info messages
|
| |
|
|
|
|
| |
* Also update xusb sample to use these levels
|
|
|
|
|
|
| |
* Adds libusb_get_port_number, libusb_get_parent and libusb_get_port_path
* Linux implementation provided by Alan Stern, OS X by Nathan Hjelm
* Unsupported for *BSD platforms
|
| |
|
|
|
|
|
| |
* Adds a static string for describe
* Also update version documentation
|
|
|
|
| |
* Also some formatting/typo improvements
|
|
|
|
|
| |
* Mentions of 'libusb' in doxygen are changed to 'libusbx'
* Also update copyright notices and remove unneeded EOF LFs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some protocols which use USB require an extra zero length data packet
to signal end-of-transfer on bulk endpoints, if the last data packet
is exactly wMaxPacketSize bytes long.
This flag allows applications to inform libusb about this requirement,
so that libusb can handle the issue transparently.
At the moment the new flag is only supported on Linux, and submitting
a transfer with the flag set returns an error at submit time on other
systems. Hopefully implementations will soon follow for other systems.
References #6.
|
| |
|
| |
|
|
|
|
| |
Fixes #87.
|
|
|
|
|
|
|
|
|
| |
Until we have i18ned error messages we can at least offer easy
translation from numeric error code to the error code's name.
[hansg: switch() on enum to get a compiler warning if a case is missing]
[hansg: Better return value when called with an unknown error code]
[hansg: Fix DEFAULT_VISIBILITY in definition to compile on all platforms]
|
|
|
|
|
|
|
|
|
| |
Since it is currently not planned to change the filename of the libusb
library between libusb-1.0 versions at least on Windows systems it's
important to have a capability API.
Currently there exists only one capability; LIBUSB_CAP_HAS_CAPABILITY,
which tests support for the libusb_has_capability() API.
|
|
|
|
| |
References #109.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At least in Linux, wireless USB devices have zero configurations until
they have been authorized. This device state can be set for any USB
device using:
echo 0 > /sys/bus/usb/devices/?-?/authorized
An unauthorized device would previously make usbi_sanitize_device()
return LIBUSB_ERROR_IO, although there really was no I/O error.
Reported-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reworked version of my earlier patch, largely modelled after (if not
copy and pasted from) Trygve Laugstøl's <trygvis@inamo.no> similar
commit 5a6541e0d80fb1f21e2b960bc2337a612f9d74fb in
git://git.libusb.org/libusb-trygvis.git
http://git.libusb.org/libusb-trygvis.git
http://git.libusb.org/?p=libusb-trygvis.git;a=commitdiff;h=5a6541e0d
This patch does not add any OS specific code. The supporting code in
each backend follows in separate patches. References #45.
Signed-off-By: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
| |
claimed_interfaces is a long and thus its size differs on 32
versus 64 bits, this patch uses USB_MAXINTERFACES instead of
sizeof(claimed_interfaces) on interface number range checks
for consistent behavior independent of the arch.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Any in-flight transfers should properly invalidate their references
to device handles that are being closed. Additionally, they should be
removed from the transfer-in-flight list. This is done with the events
lock held to protect against another thread processing the same transfer.
The events lock is initialized as a recursive mutex, because the device
close code might itself be called while an event is being handled.
Fixes #82.
[stuge: Trivial rework to reduce indenting]
|
|
|
|
|
|
|
|
| |
* uses multiple passes in a single call
* uses a hash table, in anticipation for hotplug
* adds a (dummy) HUB interface for harmonization
* adds calloc on device struct creation in core
(to detect and avoid unnecessary double initialization)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under Windows, a variety of compilers and configurations are available,
meaning that the manner of parameter passing (e.g. registers vs stack)
can vary.
Match the Windows API calling convention and document this appropriately.
This calling convention will be used regardless of the configuration of
the user's development platform.
The only user-level complication is that all functions used as libusb
callbacks must use the same calling convention as libusb. The
LIBUSB_CALL macro is provided to make this easy.
Signed-off-by: Michael Plante <michael.plante@gmail.com>
Signed-off-by: Pete Batard <pbatard@gmail.com>
[dsd: slight change of strategy, add documentation]
|
|
|
|
|
|
| |
Via Cygwin/MinGW, libusb now has windows support.
Thanks to contributors: Michael Plante, Orin Eman, Peter Stuge,
Stephan Meyer, Xiaofan Chen.
|
| |
|
| |
|
|
|
|
|
| |
This will be additionally used by the windows backend which modifies
the fd set frequently.
|
|
|
|
|
| |
The Windows backend uses something other than UNIX file descriptors
for event handling. Abstract out the operations to allow for this.
|
|
|
|
|
|
|
|
| |
Michael Plante pointed out that if 2 users call libusb_init(NULL) within
a process, we end up creating 2 default contexts, one of which is lost.
Add reference counting so that the default context is reused and
destroyed only after the last user.
|
|
|
|
|
|
| |
9996ccaed7 introduced a problem in that mutexes could be destroyed
in the error handling codepath before they had been created.
Pointed out by Michael Plante.
|
|
|
|
| |
MSVC6 does not support variadics.
|
|
|
|
|
| |
typeof() is a GCC extension, not supported by target compilers such
as MSVC.
|
|
|
|
|
|
|
|
|
|
| |
Remove the use of the ambiguous "interface" where possible without
breaking the API.
'interface' is a preprocessor #define already associated with COM on Windows,
that can cause a conflict as soon as windows.h is included.
There are a few more places where interface is still used, which should
be changed for libusb-2.0
|
| |
|
|
|
|
|
|
|
| |
Various locks and things were being leaked/left open when handling
errors and during deinitialization.
[dsd: small tweaks]
|
|
|
|
| |
[dsd: small tweaks]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 THREAD_CFLAGS in
configure.ac. This will enable optional use of -lpthread for cygwin.
[dsd: minor tweaks, and roll in a change based on patches from Pete
Batard to only build dpfp_threaded example when we're using pthreads]
|
| |
|
|
|
|
|
| |
We would previously lose any data that was present on a cancelled URB.
Work harder to make sure this doesn't happen.
|