Pete Batard [Tue, 18 Sep 2012 20:35:23 +0000 (21:35 +0100)]
Misc: Update copyrights, TODO and libusb_version.describe
* Changes suggested by Chuck Cook & Xiaofan Chen
Pete Batard [Sun, 16 Sep 2012 15:24:24 +0000 (16:24 +0100)]
libusbx 1.0.13-rc2
* Also update NEWS with regards to isoc support for the 0/K Windows drivers
Pete Batard [Sun, 16 Sep 2012 15:19:54 +0000 (16:19 +0100)]
Doc: Fix doxygen warnings and issues
* Remove obsolete tags
* Use QUIET = yes to make issues more prominent
* Fix code display for LIBUSBX_API_VERSION and missing parameter
documentation for libusb_get_port_path()
* Most of the above suggested by Ludovic Rousseau
Pete Batard [Sun, 16 Sep 2012 15:11:10 +0000 (16:11 +0100)]
Misc: Fix missing files from dist package
Pete Batard [Sat, 15 Sep 2012 23:16:06 +0000 (00:16 +0100)]
libusbx 1.0.13-rc1
Pete Batard [Sat, 15 Sep 2012 22:57:21 +0000 (23:57 +0100)]
Core: Introduce LIBUSBX_API_VERSION macro
* This macro can be used to detect if the version of libusbx being
compiled against has a specific API feature, as well as to detect
whether compilation occurs against libusb or libusbx.
Hans de Goede [Sat, 15 Sep 2012 10:31:00 +0000 (11:31 +0100)]
Core: Make libusb_error_name also handle transfer status codes
Note that for the code 0 which means success resp. completed we have an
overlap in the codes. This is not a problem since normally one would not
call libusb_error_name on success / normal completion.
Ludovic Rousseau [Sat, 15 Sep 2012 08:18:50 +0000 (10:18 +0200)]
Samples: Fix compiler warnings in fxload
ezusb.c: In function "ezusb_cpucs"
ezusb.c:163: warning: initialization discards qualifiers from pointer target type
ezusb.c: At top level:
ezusb.c:193: warning: no previous prototype for "parse_ihex"
ezusb.c:340: warning: no previous prototype for "parse_bin"
ezusb.c:377: warning: no previous prototype for "parse_iic"
ezusb.c: In function "ram_poke":
ezusb.c:451: warning: enumeration value "_undef" not handled in switch
ezusb.c:491: warning: passing argument 2 of "ezusb_write" discards qualifiers from pointer target type
Pete Batard [Wed, 5 Sep 2012 23:47:08 +0000 (00:47 +0100)]
Core: Update libusb.h header in accordance with the latest USB specs
* IMPORTANT: This update fixes a typo in the API where MaxPower was being
used instead of bMaxPower, with the latter being what is actually in
the specs.
* As a result, applications that were using MaxPower need to be updated
for bMaxPower.
* If you must maintain compatibility with libusb or older versions of
libusbx, you may also want to either use a #define or copy/paste
struct libusb_config_descriptor from libusb.h under a new name, and
then use a cast on calls that require it. For more info, see the
1.0.13 release notes in the NEWS file.
* Also update copyright notice
Ludovic Rousseau [Thu, 13 Sep 2012 13:50:43 +0000 (15:50 +0200)]
Samples: Display VID:PID of the tested device in xusb
* Also amend the wording of the "no option" comment.
* Closes #42
Pete Batard [Thu, 13 Sep 2012 23:10:57 +0000 (00:10 +0100)]
Windows: Switch to ALLOW_PARTIAL_READS pipe policy enabled by default
* This avoids an issue when libusbK is used for bulk transfers, which
is most likely due to a libusbK bug
* See https://sourceforge.net/mailarchive/message.php?msg_id=
29736015
Pete Batard [Tue, 11 Sep 2012 00:01:07 +0000 (01:01 +0100)]
Samples: Add fxload sample for Cypress EZ-USB chips
* This program was modified from the original fxload at:
http://linux-hotplug.sourceforge.net to add libusbx
as well as non HEX images support.
* Only supports RAM upload for now, with EEPROM and FX3
support to be added at a later stage.
Hans de Goede [Wed, 12 Sep 2012 01:03:47 +0000 (02:03 +0100)]
All: Avoid polluting errors reported on device disconnect
* Makes libusb_cancel_transfer not log an error when the cancel fails
with LIBUSB_ERROR_NO_DEVICE, so that apps can properly clean things
up on device disconnect without flooding the console with these errors.
* Also, some devices (Cypress FX) may switch VID:PID on the fly during
firmware upload => reduce severity of the Windows message when that happens.
Pete Batard [Mon, 10 Sep 2012 23:17:39 +0000 (00:17 +0100)]
Doc: Update logging documentation regarding stderr usage
Pete Batard [Wed, 5 Sep 2012 21:51:19 +0000 (22:51 +0100)]
Windows: Fix handling of composite devices
* Pass missing sub_api parameter to set_composite_interface() and
composite_submit_control_transfer()
* Remove api_flags attribute, that cannot apply for multiple interfaces
* Also simplifies the internal ENUM_DEBUG mode
* Also move polluting info logging message to debug
Pete Batard [Mon, 3 Sep 2012 19:43:18 +0000 (20:43 +0100)]
Samples: xusb improvements
* update and fix usage details
* make topology and speed printout optional (option -i)
* remove unneeded option -g
Pete Batard [Sun, 26 Aug 2012 23:16:00 +0000 (00:16 +0100)]
Windows: Suppress unwanted error message on filter driver
* Interface access error message was unconditional, even if the
filter driver was found later on.
Hans de Goede [Wed, 22 Aug 2012 10:47:00 +0000 (11:47 +0100)]
Linux: Return ERROR_NOT_FOUND in detach-kernel-driver if usbfs is already bound
* Currently applications for devices which only are accessed from userspace
can use claim / release interface to make sure they don't get in each others
way.
* The same however does not work for applications which first need to detach
a "native" / in kernel driver, as this detach will not only detach native
drivers but also the usbfs driver, thus stealing the device from another
userspace / libusbx app.
* This patch fixes libusb_detach_kernel_driver to only detach "real" kernel
drivers and not the special usbfs driver used for userspace access to
USB devices. If the usbfs driver is found LIBUSB_ERROR_NOT_FOUND will be
returned to indicate no driver was detached.
Hans de Goede [Wed, 22 Aug 2012 10:47:00 +0000 (11:47 +0100)]
Linux: Avoid unnecessary splitting of bulk transfers
* With the latest kernels it is no longer needed to always split large bulk
transfers into multiple urbs. This patch takes advantage of this by not
splitting when not necessary. Note that the non-split code path is in essence
using the old split code path with an urb count which is always 1.
* This leads to more sane handling of large transfers with recent kernels,
although our splitting code is well tested, not splitting at all still is
a lot better :)
* When used with a recent kernel, this also fixes the problems, on XHCI attached
devices, when a large bulk-in transfer ends with a short read in an urb other
then the last urb.
* For more on this see: http://marc.info/?l=linux-usb&m=
133797554910355
Hans de Goede [Wed, 22 Aug 2012 10:47:00 +0000 (11:47 +0100)]
Linux: Add support for the new get_capabilities ioctl
* There were a few (new) usbdevfs capabilities which libusbx could not
discover in any other way then checking the kernel version.
* However, this presents the following problems:
1) It is just not very pretty
2) Given the tendency of enterprise distros to backport stuff it is not
reliable
3) Some of these features turn out to not work with certain host controllers,
making depending on them based on the kernel version not a good idea
* Therefore a new USBDEVFS_GET_CAPABILITIES ioctl has been added to the kernel
to offer a better way to find out a device's capabilities (technically
the capabilities of the host controller to which the device is attached,
but that does not matter).
Peter Stuge [Wed, 22 Aug 2012 08:32:10 +0000 (01:32 -0700)]
Core: Handle >= 1 second transfer timeout in libusb_submit_transfer()
* Comparisons between tv_nsec and 1 sec should be >= rather than >,
as we can end up in situations where tv_nsec is exactly
1000000000,
which calls such as timerfd_create() do not accept.
* Issue reported by Sebastian K. See:
https://sourceforge.net/mailarchive/message.php?msg_id=
29706972
Pete Batard [Wed, 22 Aug 2012 20:42:21 +0000 (21:42 +0100)]
Misc: Update and shorten various libusbx URLs
Nicholas Corgan [Mon, 20 Aug 2012 20:32:24 +0000 (13:32 -0700)]
Windows: Add support for 2nd gen Renesas USB 3.0 controllers
* Driver version 3.0.20.0 for uPD720201 & uPD720202 uses RUSB3HUB
* Closes #40
Pete Batard [Sun, 19 Aug 2012 22:40:42 +0000 (23:40 +0100)]
Windows: Add libusbk.sys & libusb0.sys driver support
* Both libusbk and libusb0.sys rely on libusbk.dll being
installed to provides a WinUSB-like API for driver access.
* In case libusbk.dll is not present, fall back to WinUSB.
* Closes #11
* Closes #12
Anthony Clay, ZarthCode LLC [Sun, 19 Aug 2012 19:19:40 +0000 (14:19 -0500)]
Windows: Fix C4005 warning under VS2012 for inline.
* Changed inline macro to not fire when using Visual Studio/C++,
which attempts to redefine the macro - resulting in a C4005 warning.
Pete Batard [Sun, 12 Aug 2012 21:57:10 +0000 (22:57 +0100)]
Samples: Make target mandatory with -b option in xusb
Pete Batard [Sun, 12 Aug 2012 21:37:02 +0000 (22:37 +0100)]
Core: Improve instrumentation of timerfd_settime failures
* Report errno as well as itimerspec data
* Also reuse the timeout variable set to &transfer->timeout
Pete Batard [Tue, 7 Aug 2012 12:36:16 +0000 (13:36 +0100)]
Core: Fix a Clang warning in io.c
* Using sizeof() in the UNUSED() macro didn't silence all
unused variable warnings.
* Also fix an "unused ctx" warning when ENABLE_DEBUG_LOGGING is on
* Also improve debug output on libusb_open() failure
Matthias Bolte [Sat, 28 Jul 2012 19:24:31 +0000 (21:24 +0200)]
Windows: Add workaround for Intel USB 3.0 root hubs
* Intel USB 3.0 root hubs are similar to the Nec/Renesas USB 3.0 root
hubs as they aren't listed under "USB" either but under "IUSB3".
* Extend the existing workaround for Nec/Renesas USB 3.0 root hubs to
handle the Intel ones as well.
* Closes #39
Pete Batard [Tue, 10 Jul 2012 00:59:45 +0000 (01:59 +0100)]
Core: Fix unconditional disarming of timerfd
* Existing code appears disarms the timerfd always, which cancels
pending timeouts as soon as one packet completes.
* This fix moves the disarming of the timerfd to
arm_timerfd_for_next_timeout(), where it is now done conditionally.
It also avoids calling disarm outside of the above call.
* This patch also ensures that all handling of the timerfd is done
under the flying transfers lock.
* Issue reported by Hans de Goede. For more info, see:
https://sourceforge.net/mailarchive/message.php?msg_id=
29442693
Orin Eman [Fri, 3 Aug 2012 13:21:45 +0000 (14:21 +0100)]
Core: NULL list pointers on deletion
* This aims at highlighting unwanted behaviours on list operations,
and facilitate early detection of potential bugs.
* This also requires a fix in threads_windows.c
* See http://sourceforge.net/mailarchive/message.php?msg_id=
29626351
Pete Batard [Wed, 1 Aug 2012 16:43:33 +0000 (17:43 +0100)]
Misc: Add a readme for git user
* Suggested by Yves Arrouye:
http://sourceforge.net/mailarchive/message.php?msg_id=
29577839
Pete Batard [Wed, 18 Jul 2012 17:25:11 +0000 (18:25 +0100)]
Windows: Set device number for root hubs to 1
* Other platforms (Linux, OS-X) appear to use 1 => follow suit.
* For non root hub devices, we simply increment the USB device address.
* Collisions with device address 0 are not expected, but we add
an assertion for just in case.
Pete Batard [Tue, 17 Jul 2012 16:36:13 +0000 (17:36 +0100)]
Windows: Fix overflow when handling HID or composite devices
* When libusb_get_device_list() is called mutliple times, the HID device
path was unconditionally duplicated in the list of device's interfaces.
* Because array boundaries were not checked, this caused overflow and crash.
* This patch adds an out of bound check and also ensures that duplication
of data, for HID and composite, does not occur
* It also renames the private composite_api_flags to api_flags, as well as
reorganizes the private attributes
* Bug report and part of the fix provided by Toby Gray
Simon Haggett [Tue, 10 Jul 2012 15:07:45 +0000 (16:07 +0100)]
Windows: usbi_cond_destroy() should free handles created by usbi_cond_intwait().
* Without this change every call to usbi_cond_destroy() leaks an event handle.
Davidlohr Bueso [Wed, 11 Jul 2012 12:53:00 +0000 (13:53 +0100)]
All: Replace malloc+memset with calloc
Pete Batard [Mon, 2 Jul 2012 22:39:19 +0000 (23:39 +0100)]
Core: Prefix LOG_LEVEL_ with LIBUSB_ to avoid conflicts
* 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.
Pete Batard [Thu, 28 Jun 2012 21:49:47 +0000 (22:49 +0100)]
Misc: Fix more Clang warnings in core and darwin
* 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
Pete Batard [Mon, 25 Jun 2012 18:13:42 +0000 (19:13 +0100)]
Windows: Address MSVC Level 4 & WDK's OACR/Prefast warnings
* 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
Xiaofan Chen [Sun, 17 Jun 2012 12:46:40 +0000 (20:46 +0800)]
Windows: Some versions of dlltool require a library name
* Even though the library name is optional as specified by Microsoft,
some recent versions of libtool require one in libusb-1.0.def.
* Reference thread in MinGW-w64 mailing list.
http://comments.gmane.org/gmane.comp.gnu.mingw.w64.general/5141
Pete Batard [Thu, 21 Jun 2012 19:17:09 +0000 (20:17 +0100)]
Windows: Fix warnings reported by the Intel Compiler
* 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
Pete Batard [Fri, 15 Jun 2012 14:14:48 +0000 (15:14 +0100)]
libusbx-1.0.12
Xiaofan Chen [Thu, 14 Jun 2012 11:42:02 +0000 (12:42 +0100)]
Samples: Remove USB version for speed designations in xusb
Pete Batard [Wed, 13 Jun 2012 12:38:46 +0000 (13:38 +0100)]
Windows: Fix erroneous pointer array allocation reported by Clang
* Result of 'calloc' is converted to a pointer of type 'unsigned char *',
which is incompatible with sizeof operand type 'PUSB_CONFIGURATION_DESCRIPTOR'
* priv->config_descriptor is indeed an array of pointers, with each descriptor
allocated, rather than a sequential list of fixed descriptor.
Pete Batard [Wed, 13 Jun 2012 12:33:00 +0000 (13:33 +0100)]
Core: Fix Clang warnings
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)
Pete Batard [Mon, 11 Jun 2012 13:03:57 +0000 (14:03 +0100)]
libusbx 1.0.12-rc1
Pete Batard [Mon, 11 Jun 2012 13:12:56 +0000 (14:12 +0100)]
Autotools: add libusb-1.0.def and libusb_nano.h as dependencies
* Also add version_nano.h to EXTRA_DIST as it is not added to the
dist archive by default
Pete Batard [Fri, 8 Jun 2012 22:31:56 +0000 (23:31 +0100)]
Windows: Enable MinGW and MSVC DLL interchangeability
* Because we use the WINAPI calling convention, the def file MUST have the @n
aliases. There is no way around this as MinGW's .o use decoration always
for __stdcall, which can't be turned off.
* dlltool must therefore be invoked to create a proper import lib from the .def,
using the --kill-at option.
* To do that, a CREATE_IMPORT_LIB autotools variable is introduced.
* Note: the .def file is currently maintained manually.
Pete Batard [Thu, 7 Jun 2012 18:27:43 +0000 (19:27 +0100)]
All: Prevent memory leaks on realloc failures
* 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)
Pete Batard [Thu, 7 Jun 2012 10:55:30 +0000 (11:55 +0100)]
Windows: Fix possible crash when using longjmp and gcc 4.6
* With gcc-4.6 the option -fomit-frame-pointer is turned on per default
even for the win32 target. This results in segfaults for any application
using setjmp/longjmp and MSVCRT.dll on WinXP.
See http://gcc.gnu.org/ml/gcc/2011-10/msg00351.html
* Issue reported by Lars Kanis
Pete Batard [Wed, 6 Jun 2012 12:49:41 +0000 (13:49 +0100)]
Core: Display libusbx version in libusb_init's debug output
Lars Wirzenius [Wed, 6 Jun 2012 16:34:04 +0000 (17:34 +0100)]
Autotools: Fix autogen.sh behavior when libtool is not found
* Fix naked "exit", which no exit code, to prevent a build failure
from being noticed automatically if a build dependency is lacking.
* Also printed error message to stderr rather than stdout.
Pete Batard [Wed, 6 Jun 2012 09:53:43 +0000 (10:53 +0100)]
Linux: Fix a major regression in threads_posix.c
* On some Linux platforms, libusbx compilation breaks with:
error: implicit declaration of function ‘pthread_mutexattr_settype’
* This regression, introduced in
463dda06db5da5de0eab32820c7af60605625afe,
is due to pthread.h needing __USE_UNIX98, which is tied to _XOPEN_SOURCE
or _GNU_SOURCE being correctly defined, and which the inclusion of
<unistd.h> before the _XOPEN_SOURCE override modified
* As _GNU_LINUX ensures the definition of __USE_UNIX98 and we require it
for syscalls, we now only define _GNU_SOURCE for Linux.
Pete Batard [Tue, 5 Jun 2012 16:29:46 +0000 (17:29 +0100)]
Autotools: Fix versioning regression in configure.ac
* Because of missing [], "LIBUSB_MICROLIBUSB_RC" was being displayed
in lieu of version number
* Regression introduced with
c9d41fe5f0324d969f758f42843e1fd05859f438
Pete Batard [Thu, 31 May 2012 17:31:34 +0000 (18:31 +0100)]
Core: Add toggleable debug logging
* Also fix a missing space in debug log messages introduced
with the previous timestamp logging update
Ludovic Rousseau [Fri, 1 Jun 2012 09:52:17 +0000 (11:52 +0200)]
Core: Fix "LOG_LEVEL_NONE not handled in switch" warning
Ludovic Rousseau [Fri, 1 Jun 2012 09:40:31 +0000 (11:40 +0200)]
Samples: Fix no previous prototype warnings in xusb
Ludovic Rousseau [Fri, 1 Jun 2012 09:30:00 +0000 (11:30 +0200)]
Autotools: Apply autoupdate 2.68 recommendations
* Not applied: AC_PREREQ([2.68]) as this doesn't seem
necessary and 2.68 was released less than 2 years ago.
Pete Batard [Mon, 28 May 2012 11:33:18 +0000 (12:33 +0100)]
Core: Send all logging output to stderr
* This effectively removes the use of stdout for info messages
Pete Batard [Thu, 31 May 2012 12:11:15 +0000 (13:11 +0100)]
Darwin: More OS-X logging improvements
* Further alignment of log messages according to severity
* Fix "'darwin_error_str' defined but not used" warning when
option --disable-log is used (reported by Xiaofan Chen)
Pete Batard [Tue, 29 May 2012 15:06:57 +0000 (16:06 +0100)]
Windows: Add new API calls to DLL .def file
* Generated from a MinGW32 generated DLL using the command:
echo -e "LIBRARY\nEXPORTS" > libusb-1.0.def; strings libusb-1.0.dll | grep libusb | grep @ | sort | sed -e "s/\(.*\)@\([0-9]*\)/ \1\n \1@\2 = \1/" >> libusb-1.0.def
Pete Batard [Fri, 11 May 2012 22:34:03 +0000 (23:34 +0100)]
Windows: Restore HID support
Pete Batard [Thu, 24 May 2012 15:18:58 +0000 (16:18 +0100)]
Core: Only display timestamps in debug mode and use init() as origin
Pete Batard [Thu, 24 May 2012 12:36:23 +0000 (13:36 +0100)]
Core: Define log levels in libusb.h
* Also update xusb sample to use these levels
Pete Batard [Thu, 24 May 2012 10:42:47 +0000 (11:42 +0100)]
Darwin: Align severity of OS-X logging messages
* Some informational messages were actually debug or warning
* Fixes #1
Pete Batard [Thu, 10 May 2012 19:01:10 +0000 (20:01 +0100)]
All: Add parent and port topology calls
* 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
Pete Batard [Wed, 23 May 2012 17:25:01 +0000 (18:25 +0100)]
Misc: Ensure all sources are UTF-8
* Also remove extra lines at the end of samples
Pete Batard [Tue, 22 May 2012 23:10:19 +0000 (00:10 +0100)]
Windows: Reduce severity of initial conf desc readout failures
* Failure to read the config descriptor through regular API calls can
occur for some hubs (eg. 05E3:0608) and is of no major consequence.
* Later failures still reported with error severity as they may hide
something more dramatic
* Issue reported by Jerry from NovaDSP
Pete Batard [Thu, 10 May 2012 16:42:16 +0000 (17:42 +0100)]
Windows: Fix missing cygwin thread ID
* Cygwin uses POSIX threads, not Windows threads
Pete Batard [Thu, 10 May 2012 15:44:30 +0000 (16:44 +0100)]
Windows: Add INSTALL_WIN.txt
Pete Batard [Thu, 10 May 2012 14:56:51 +0000 (15:56 +0100)]
Misc: Separate nano from version.h
* As version.h processed by autotools, the automatic updating of the
nano there can result in unneeded reconfs (eg. after issuing a git
pull, regardless of whether the conf is still valid)
* Avoid this by placing the nano in its own file, as it won't be
processed by autoconf. This also simplifies the versioning git hooks
and removes the sed dependency.
Ludovic Rousseau [Wed, 9 May 2012 07:13:41 +0000 (09:13 +0200)]
Samples: Use the implicit _SOURCES rule
* By default automake looks for a source file foo.c for a foo binary.
Ludovic Rousseau [Wed, 9 May 2012 07:12:01 +0000 (09:12 +0200)]
Samples: Use a common LDADD for all examples
* Similar to libusb patch
a129732fb45fc424743f26f01c906e4514f11521
Pete Batard [Thu, 10 May 2012 14:35:07 +0000 (15:35 +0100)]
Samples: prefer __linux__ over __linux define in xusb
* While both should work, __linux__ seems to be preferred and
what we use in threads_posix.c
* Also fix a typo in .private/README.txt
Pete Batard [Tue, 8 May 2012 22:04:44 +0000 (23:04 +0100)]
libusbx-1.0.11
Ludovic Rousseau [Tue, 8 May 2012 18:34:12 +0000 (20:34 +0200)]
Darwin: Sync type of num_iso_packets fields
* num_iso_packets was a "size_t" in "struct darwin_transfer_priv" and an
"int" in "struct libusb_transfer". The field is now an int in the two
structures
* Fixes warning
os/darwin_usb.c: In function ‘submit_iso_transfer’:
os/darwin_usb.c:1334: warning: comparison between signed and unsigned
Ludovic Rousseau [Tue, 8 May 2012 13:53:56 +0000 (15:53 +0200)]
Core: Handle TRANSFER_ERROR/TRANSFER_CANCELLED for sync transfers
* Return the more appropriate LIBUSB_ERROR_IO instead of
LIBUSB_ERROR_OTHER for the cases LIBUSB_TRANSFER_ERROR and
LIBUSB_TRANSFER_CANCELLED
* Fixes warnings similar to the following when using the GCC
option -Wswitch-enum:
warning: enumeration value ‘LIBUSB_TRANSFER_ERROR’ not handled in switch
Pete Batard [Tue, 8 May 2012 11:10:59 +0000 (12:10 +0100)]
BSD: Add thread ID support for OpenBSD > 5.1
* Uses syscall(SYS_getthrid) which requires real thread support,
currently only available in 5.1-current (but not 5.1-release).
For OpenBSD <= 5.1, -1 will be returned for the thread ID.
Pete Batard [Mon, 7 May 2012 14:41:50 +0000 (15:41 +0100)]
Samples: fix strcat vs strlcat warning on OpenBSD
* Without this, OpenBSD produces the following warning:
strcat() is almost always misused, please use strlcat()
Pete Batard [Sun, 6 May 2012 23:05:36 +0000 (00:05 +0100)]
libusbx 1.0.11-rc1
Peter Stuge [Sun, 6 May 2012 17:04:00 +0000 (17:04 +0000)]
Core: Add a timestamping and thread ID to logging
Ludovic Rousseau [Fri, 4 May 2012 15:56:00 +0000 (16:56 +0100)]
Autotools: Use "$@" instead of $* to avoid spaces problems
* "$@" will correctly handle arguments with spaces
Ludovic Rousseau [Fri, 4 May 2012 15:56:00 +0000 (16:56 +0100)]
Autotools: Use "set -e" to exit on the first error
* The script will not continue if something fails (like a command not found)
Ludovic Rousseau [Fri, 4 May 2012 15:56:00 +0000 (16:56 +0100)]
Autotools: Do not use source to call an another script
* Script is valid for bash but not any /bin/sh
* Thanks to Xiaofan Chen for the bug report
http://sourceforge.net/mailarchive/message.php?msg_id=
29217871
Toby Gray [Thu, 3 May 2012 10:25:11 +0000 (11:25 +0100)]
Windows: Fix deadlock in backend when submitting transfers.
Without this change the Windows backend needed to call usbi_fd_notification()
from within the backend's submit_transfer. This can cause deadlock when
attempting to lock the event lock if another thread was processing events on
the just-submitted transfer.
The deadlock comes about as the thread calling libusb_submit_transfer acquires
the transfer mutex before trying to acquire the event lock; this is the other
order of lock acquisition from an event thread handling activity on the just
submitted transfer. This could lead to one of two deadlocks:
1) If the transfer completes while usbi_fd_notification() is waiting for
the event lock and the callback attempts to resubmit the transfer.
2) If the transfer timeout is hit while usbi_fd_notification() is waiting
for the event lock then the attempt to cancel the transfer will deadlock.
This patch fixes both of these deadlocks by having libusb_submit_transfer()
only call usbi_fd_notification() after having released the transfer mutex.
Pete Batard [Wed, 2 May 2012 17:02:50 +0000 (18:02 +0100)]
Samples: Remove interface requests when querying WCID devices
* As per MS documentation, querying of the Extended Properties
is a device request (0xC0), not an interface one (0xC1), so
there is no issue with the WinUSB wIndex override.
Pete Batard [Wed, 2 May 2012 11:06:36 +0000 (12:06 +0100)]
Autotools: Add bootstrap.sh
bootstrap.sh does not invoke configure whereas autogen.sh does.
This allows libusbx users to choose the one that suits them best.
Uri Lublin [Tue, 1 May 2012 13:47:00 +0000 (14:47 +0100)]
Windows: Fix removal of usbi_fd_notification calls in submit_*_transfer
Commit
4cccbed825fe1dc13812 accidentally removed those calls,
when ! ifdef DYNAMIC_FDS blocks were removed.
Pete Batard [Wed, 25 Apr 2012 23:30:57 +0000 (00:30 +0100)]
Core: update version struct for ABI compatibility
* Adds a static string for describe
* Also update version documentation
James Hanko [Thu, 20 Oct 2011 07:32:34 +0000 (00:32 -0700)]
Linux: Search for /dev/usbdev<bus>.<device> USB device special files
If neither the (now deprecated) usbfs filesystem nor udev is available
then libusbx searches for device nodes also in /dev where they may be
created if the kernel was built with the option CONFIG_USB_DEVICE_CLASS.
This helps on embedded systems such as Android, and all mdev users.
Martin Pieuchot [Thu, 19 Apr 2012 09:33:36 +0000 (11:33 +0200)]
BSD: Provide libusb_get_device_speed() data
Because the different speed values used by the libusb and OpenBSD's
usb_device_info structure are compatible, keep the code simple and
just copy the value returned by the USB_GET_DEVICEINFO ioctl() call.
Ludovic Rousseau [Fri, 20 Apr 2012 09:36:07 +0000 (11:36 +0200)]
Samples: Fix not handled in switch warning in xusb.c
xusb.c: In function ‘test_device’:
xusb.c:722:2: warning: enumeration value ‘USE_GENERIC’ not handled in switch [-Wswitch-enum]
Ludovic Rousseau [Fri, 20 Apr 2012 09:29:50 +0000 (11:29 +0200)]
Samples: Remove unneeded inline in xusb.c
Fixes:
warning: function ‘perr’ can never be inlined because it uses variable argument lists [-Winline]
warning: inlining failed in call to ‘perr’: function not inlinable [-Winline]
Ludovic Rousseau [Fri, 20 Apr 2012 21:25:38 +0000 (22:25 +0100)]
Linux: Fix signed vs unsigned compiler warnings
os/linux_usbfs.c: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Xiaofan Chen [Sat, 14 Apr 2012 15:17:18 +0000 (23:17 +0800)]
Linux: Silence unused variable warnings without CLOCK_MONOTONIC
Peter Stuge [Mon, 16 Apr 2012 01:59:44 +0000 (03:59 +0200)]
Core: Add debug message with callback address on completed transfer
Pete Batard [Thu, 19 Apr 2012 17:01:04 +0000 (18:01 +0100)]
BSD: add NetBSD experimental support
* also improve OS/backend selection in configure.ac
* original libusb patches from Peter Stuge and Xiaofan Chen
Pete Batard [Tue, 17 Apr 2012 01:20:40 +0000 (02:20 +0100)]
libusbx-1.0.10
Ludovic Rousseau [Sat, 14 Apr 2012 07:27:24 +0000 (09:27 +0200)]
Samples: Fix initialization discards qualifiers warnings in xusb.c
xusb.c: In function ‘read_ms_winsub_feature_descriptors’:
xusb.c:542: warning: initialization discards qualifiers from pointer target type
xusb.c:543: warning: initialization discards qualifiers from pointer target type
xusb.c: In function ‘test_device’:
xusb.c:598: warning: initialization discards qualifiers from pointer target type
xusb.c:598: warning: initialization discards qualifiers from pointer target type
xusb.c:598: warning: initialization discards qualifiers from pointer target type
xusb.c:599: warning: initialization discards qualifiers from pointer target type
xusb.c:599: warning: initialization discards qualifiers from pointer target type
Ludovic Rousseau [Sat, 14 Apr 2012 07:24:58 +0000 (09:24 +0200)]
Samples: Fix no previous prototype warnings in xusb.c
xusb.c:139: warning: no previous prototype for ‘display_buffer_hex’
xusb.c:169: warning: no previous prototype for ‘display_ps3_status’
xusb.c:260: warning: no previous prototype for ‘display_xbox_status’
xusb.c:281: warning: no previous prototype for ‘set_xbox_actuators’
xusb.c:299: warning: no previous prototype for ‘send_mass_storage_command’
xusb.c:354: warning: no previous prototype for ‘get_mass_storage_status’
xusb.c:401: warning: no previous prototype for ‘get_sense’
xusb.c:431: warning: no previous prototype for ‘test_mass_storage’
xusb.c:530: warning: no previous prototype for ‘read_ms_winsub_feature_descriptors’
xusb.c:583: warning: no previous prototype for ‘test_device’