platform/upstream/libusb.git
12 years agoAutotools: Fix autogen.sh behavior when libtool is not found
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.

12 years agoLinux: Fix a major regression in threads_posix.c
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.

12 years agoAutotools: Fix versioning regression in configure.ac
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

12 years agoCore: Add toggleable debug logging
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

12 years agoCore: Fix "LOG_LEVEL_NONE not handled in switch" warning
Ludovic Rousseau [Fri, 1 Jun 2012 09:52:17 +0000 (11:52 +0200)]
Core: Fix "LOG_LEVEL_NONE not handled in switch" warning

12 years agoSamples: Fix no previous prototype warnings in xusb
Ludovic Rousseau [Fri, 1 Jun 2012 09:40:31 +0000 (11:40 +0200)]
Samples: Fix no previous prototype warnings in xusb

12 years agoAutotools: Apply autoupdate 2.68 recommendations
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.

12 years agoCore: Send all logging output to stderr
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

12 years agoDarwin: More OS-X logging improvements
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)

12 years agoWindows: Add new API calls to DLL .def file
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

12 years agoWindows: Restore HID support
Pete Batard [Fri, 11 May 2012 22:34:03 +0000 (23:34 +0100)]
Windows: Restore HID support

12 years agoCore: Only display timestamps in debug mode and use init() as origin
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

12 years agoCore: Define log levels in libusb.h
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

12 years agoDarwin: Align severity of OS-X logging messages
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

12 years agoAll: Add parent and port topology calls
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

12 years agoMisc: Ensure all sources are UTF-8
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

12 years agoWindows: Reduce severity of initial conf desc readout failures
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

12 years agoWindows: Fix missing cygwin thread ID
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

12 years agoWindows: Add INSTALL_WIN.txt
Pete Batard [Thu, 10 May 2012 15:44:30 +0000 (16:44 +0100)]
Windows: Add INSTALL_WIN.txt

12 years agoMisc: Separate nano from version.h
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.

12 years agoSamples: Use the implicit _SOURCES rule
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.

12 years agoSamples: Use a common LDADD for all examples
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

12 years agoSamples: prefer __linux__ over __linux define in xusb
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

12 years agolibusbx-1.0.11
Pete Batard [Tue, 8 May 2012 22:04:44 +0000 (23:04 +0100)]
libusbx-1.0.11

12 years agoDarwin: Sync type of num_iso_packets fields
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

12 years agoCore: Handle TRANSFER_ERROR/TRANSFER_CANCELLED for sync transfers
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

12 years agoBSD: Add thread ID support for OpenBSD > 5.1
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.

12 years agoSamples: fix strcat vs strlcat warning on OpenBSD
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()

12 years agolibusbx 1.0.11-rc1
Pete Batard [Sun, 6 May 2012 23:05:36 +0000 (00:05 +0100)]
libusbx 1.0.11-rc1

12 years agoCore: Add a timestamping and thread ID to logging
Peter Stuge [Sun, 6 May 2012 17:04:00 +0000 (17:04 +0000)]
Core: Add a timestamping and thread ID to logging

12 years agoAutotools: Use "$@" instead of $* to avoid spaces problems
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

12 years agoAutotools: Use "set -e" to exit on the first error
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)

12 years agoAutotools: Do not use source to call an another script
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

12 years agoWindows: Fix deadlock in backend when submitting transfers.
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.

12 years agoSamples: Remove interface requests when querying WCID devices
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.

12 years agoAutotools: Add bootstrap.sh
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.

12 years agoWindows: Fix removal of usbi_fd_notification calls in submit_*_transfer
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.

12 years agoCore: update version struct for ABI compatibility
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

12 years agoLinux: Search for /dev/usbdev<bus>.<device> USB device special files
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.

12 years agoBSD: Provide libusb_get_device_speed() data
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.

12 years agoSamples: Fix not handled in switch warning in xusb.c
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]

12 years agoSamples: Remove unneeded inline in xusb.c
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]

12 years agoLinux: Fix signed vs unsigned compiler warnings
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]

12 years agoLinux: Silence unused variable warnings without CLOCK_MONOTONIC
Xiaofan Chen [Sat, 14 Apr 2012 15:17:18 +0000 (23:17 +0800)]
Linux: Silence unused variable warnings without CLOCK_MONOTONIC

12 years agoCore: Add debug message with callback address on completed transfer
Peter Stuge [Mon, 16 Apr 2012 01:59:44 +0000 (03:59 +0200)]
Core: Add debug message with callback address on completed transfer

12 years agoBSD: add NetBSD experimental support
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

12 years agolibusbx-1.0.10
Pete Batard [Tue, 17 Apr 2012 01:20:40 +0000 (02:20 +0100)]
libusbx-1.0.10

12 years agoSamples: Fix initialization discards qualifiers warnings in xusb.c
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

12 years agoSamples: Fix no previous prototype warnings in xusb.c
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’

12 years agoMisc: Add a missing newline at end of .private/README.txt
Ludovic Rousseau [Sat, 14 Apr 2012 07:22:15 +0000 (09:22 +0200)]
Misc: Add a missing newline at end of .private/README.txt

12 years agolibusbx 1.0.10-rc1
Pete Batard [Fri, 13 Apr 2012 21:23:58 +0000 (22:23 +0100)]
libusbx 1.0.10-rc1

12 years agoWindows: add internal binary snapshot scripts
Pete Batard [Thu, 12 Apr 2012 22:52:49 +0000 (23:52 +0100)]
Windows: add internal binary snapshot scripts

12 years agoGit: add pre-commit and post-rewrite hooks for versioning
Pete Batard [Wed, 11 Apr 2012 22:12:21 +0000 (23:12 +0100)]
Git: add pre-commit and post-rewrite hooks for versioning

* Also adds the maintainer-only .private directory

12 years agoMisc: update pkg-config template
Pete Batard [Wed, 11 Apr 2012 16:44:57 +0000 (17:44 +0100)]
Misc: update pkg-config template

* Change human readable name to libusbx and mention OpenBSD

12 years agoWindows: Remove #define options and use same set of defaults
Pete Batard [Tue, 10 Apr 2012 12:30:24 +0000 (13:30 +0100)]
Windows: Remove #define options and use same set of defaults

* The DYNAMIC_FDS, AUTO_CLAIM and FORCE_INSTANT_TIMEOUTS options
  were introduced for development/testing and don't appear to be
  used by the Windows backend users => remove them.

12 years agoWindows: misc improvements
Pete Batard [Tue, 10 Apr 2012 12:05:37 +0000 (13:05 +0100)]
Windows: misc improvements

* prefer calloc over malloc
* silence VS2010 intellisense warnings on mem allocation
* other minor fixes and formatting improvements to align with -pbatard

12 years agoCore: Add get_version() call
Pete Batard [Tue, 10 Apr 2012 10:58:53 +0000 (11:58 +0100)]
Core: Add get_version() call

* Also some formatting/typo improvements

12 years agoWindows: remove obsolete lsusb project files
Pete Batard [Mon, 9 Apr 2012 22:31:24 +0000 (23:31 +0100)]
Windows: remove obsolete lsusb project files

12 years agoWindows: add VS2010 project files
Pete Batard [Mon, 9 Apr 2012 21:59:14 +0000 (22:59 +0100)]
Windows: add VS2010 project files

12 years agoexamples: Use snprintf() instead of sprintf() in dpfp and dpfp_threaded
Peter Stuge [Sat, 7 Apr 2012 03:20:36 +0000 (05:20 +0200)]
examples: Use snprintf() instead of sprintf() in dpfp and dpfp_threaded

The OpenBSD C compiler generates a warning for every use of sprintf()
and for a good reason. Reported in http://marc.info/?m=133376187514495

Reported-by: Xiaofan Chen <xiaofanc@gmail.com>
12 years agoOpenBSD: Fix warning: 'hpriv' may be used uninitialized
Peter Stuge [Sat, 7 Apr 2012 01:55:36 +0000 (03:55 +0200)]
OpenBSD: Fix warning: 'hpriv' may be used uninitialized

As reported in http://marc.info/?m=133376187514495

The variable would be used uninitialized when the internal list of
open devices is empty as obsd_handle_events() checks which device
the event fd belongs to, which can not actually happen, but if it
ever does happen then we will now return LIBUSB_ERROR_NO_DEVICE.

Reported-by: Xiaofan Chen <xiaofanc@gmail.com>
12 years agoWindows: Fix support for variadic macros
Pete Batard [Mon, 9 Apr 2012 21:28:34 +0000 (22:28 +0100)]
Windows: Fix support for variadic macros

* Visual C++ did not support variadic macros until VS2005, as per
  http://msdn.microsoft.com/en-us/library/ms177415%28v=VS.80%29.aspx

12 years agoMisc: Indicate that licence is LGPL-2.1 or later
Ludovic Rousseau [Wed, 4 Apr 2012 07:30:12 +0000 (09:30 +0200)]
Misc: Indicate that licence is LGPL-2.1 or later

Also make the name of the licence more explicit.

12 years agoMisc: Update list of maintainers from README
Ludovic Rousseau [Wed, 4 Apr 2012 07:24:17 +0000 (09:24 +0200)]
Misc: Update list of maintainers from README

12 years agoMisc: Fix missing libsub's -> libusbx's from previous patches
Pete Batard [Tue, 3 Apr 2012 15:31:32 +0000 (16:31 +0100)]
Misc: Fix missing libsub's -> libusbx's from previous patches

12 years agoDoc: Update doxygen for libusbx and add logo
Pete Batard [Tue, 3 Apr 2012 12:42:42 +0000 (13:42 +0100)]
Doc: Update doxygen for libusbx and add logo

12 years agoMisc: Rebrand to libusbx
Pete Batard [Tue, 3 Apr 2012 12:40:39 +0000 (13:40 +0100)]
Misc: Rebrand to libusbx

* Mentions of 'libusb' in doxygen are changed to 'libusbx'
* Also update copyright notices and remove unneeded EOF LFs

12 years agolibusbx 1.0.9
Pete Batard [Mon, 2 Apr 2012 14:47:53 +0000 (15:47 +0100)]
libusbx 1.0.9

* Also updated AUTHORS and THANKS

12 years agoSamples: Fix "warning: no newline at end of file" in xusb.c
Pete Batard [Sun, 1 Apr 2012 20:30:52 +0000 (21:30 +0100)]
Samples: Fix "warning: no newline at end of file" in xusb.c

* Also remove trailing whitespaces

12 years agoAutotools: Fix missing DLL .def file from make dist
Pete Batard [Sat, 31 Mar 2012 21:32:56 +0000 (22:32 +0100)]
Autotools: Fix missing DLL .def file from make dist

12 years agoAutotools: Fix msvc dir not being included in make dist
Pete Batard [Sat, 31 Mar 2012 21:14:47 +0000 (22:14 +0100)]
Autotools: Fix msvc dir not being included in make dist

12 years agoLinux: Don't spam the console with 'device unconfigured' errors
Hans de Goede [Fri, 30 Mar 2012 12:40:32 +0000 (13:40 +0100)]
Linux: Don't spam the console with 'device unconfigured' errors

12 years agolibusbx 1.0.9-rc5
Pete Batard [Fri, 30 Mar 2012 23:17:44 +0000 (00:17 +0100)]
libusbx 1.0.9-rc5

12 years agoAutotools: remove --enable-debug-log option in autogen.sh
Pete Batard [Fri, 30 Mar 2012 23:21:18 +0000 (00:21 +0100)]
Autotools: remove --enable-debug-log option in autogen.sh

12 years agoDarwin: Fix a warning on 64 bit platforms
Pete Batard [Fri, 30 Mar 2012 12:40:32 +0000 (13:40 +0100)]
Darwin: Fix a warning on 64 bit platforms

12 years agoAutotools: Fix make distcheck and add ChangeLog
Pete Batard [Fri, 30 Mar 2012 12:05:12 +0000 (13:05 +0100)]
Autotools: Fix make distcheck and add ChangeLog

12 years agoAutotools: Fix package name and URLs in configure.ac
Pete Batard [Fri, 30 Mar 2012 12:04:18 +0000 (13:04 +0100)]
Autotools: Fix package name and URLs in configure.ac

12 years agolibusbx 1.0.9-rc4
Pete Batard [Thu, 29 Mar 2012 22:22:28 +0000 (23:22 +0100)]
libusbx 1.0.9-rc4

12 years agoGit: add export-ignore for git config file
Pete Batard [Thu, 29 Mar 2012 22:21:25 +0000 (23:21 +0100)]
Git: add export-ignore for git config file

* Prevents release archives produced from git to contain
  git related files.

12 years agoSamples: fix a "value is always 0" Clang warning in xusb.c
Pete Batard [Wed, 28 Mar 2012 10:43:00 +0000 (11:43 +0100)]
Samples: fix a "value is always 0" Clang warning in xusb.c

* Remove the use of os_fd[i].recipient and alter comments with
  regards to Windows Extended Props test limitations with WinUSB

12 years agoWindows: fix Clang warnings about unused assignations
Pete Batard [Wed, 28 Mar 2012 00:02:02 +0000 (01:02 +0100)]
Windows: fix Clang warnings about unused assignations

12 years agoSamples: Fix missing xusb from VS project files
Pete Batard [Wed, 28 Mar 2012 09:56:32 +0000 (10:56 +0100)]
Samples: Fix missing xusb from VS project files

12 years agoautotools: LT_LANG([Windows Resource]) makes windres check redundant
Pete Batard [Mon, 26 Mar 2012 22:34:25 +0000 (23:34 +0100)]
autotools: LT_LANG([Windows Resource]) makes windres check redundant

12 years agoExamples: add xusb sample
Pete Batard [Mon, 26 Mar 2012 22:48:49 +0000 (23:48 +0100)]
Examples: add xusb sample

* Also improvements to WDK build scripts:
  cd to original dir on error, use 2 cores if available

12 years agoVS2005: Bring x86_64 output directories in line with x86_32
Pete Batard [Mon, 26 Mar 2012 23:03:07 +0000 (00:03 +0100)]
VS2005: Bring x86_64 output directories in line with x86_32

12 years agoLinux: fix inaccurate comment
Hans de Goede [Mon, 26 Mar 2012 22:01:48 +0000 (23:01 +0100)]
Linux: fix inaccurate comment

* We don't stop on urbs/iso pkts with less data then requested

12 years agoLinux: Remove unneeded status assignation
Hans de Goede [Mon, 26 Mar 2012 22:00:28 +0000 (23:00 +0100)]
Linux: Remove unneeded status assignation

* status value was never used

12 years agoLinux: Translate iso pkt status codes to libusb transfer status codes
Hans de Goede [Mon, 26 Mar 2012 21:54:12 +0000 (22:54 +0100)]
Linux: Translate iso pkt status codes to libusb transfer status codes

* Linux negative errno from iso pkts status must be translated and reported.

12 years agoLinux: Fix handling of urb status codes
Hans de Goede [Mon, 26 Mar 2012 21:51:56 +0000 (22:51 +0100)]
Linux: Fix handling of urb status codes

* Adds EOVERFLOW handling in handle_control_completion
* Removes handling of codes that can never occur on an iso urb

12 years agoLinux: Don't print errors when cancel_transfer fails with NOT_FOUND
Hans de Goede [Mon, 26 Mar 2012 20:37:03 +0000 (21:37 +0100)]
Linux: Don't print errors when cancel_transfer fails with NOT_FOUND

* Under some cricumstances, LIBUSB_ERROR_NOT_FOUND is an expected
  return value for cancel_transfer so printing an error is undesirable.

12 years agoLinux: Fix cancel_transfer return value when cancelling a multi-urb transfer
Hans de Goede [Mon, 26 Mar 2012 20:33:39 +0000 (21:33 +0100)]
Linux: Fix cancel_transfer return value when cancelling a multi-urb transfer

* if we've successfully cancelled the last urb, and then another urb
  fails with errno == EINVAL, we shouldn't return LIBUSB_ERROR_NOT_FOUND

12 years agolibusbi.h: Add IS_EPIN() IS_EPOUT() IS_XFERIN() and IS_XFEROUT() macros
Peter Stuge [Thu, 22 Mar 2012 00:52:59 +0000 (01:52 +0100)]
libusbi.h: Add IS_EPIN() IS_EPOUT() IS_XFERIN() and IS_XFEROUT() macros

The macros make backend code a little simpler to read, since the
transfer and endpoint direction is checked in several places across
the supported platforms.

12 years agoAdd LIBUSB_TRANSFER_ADD_ZERO_PACKET flag to indicate need for ZLP
Peter Stuge [Wed, 22 Feb 2012 13:21:54 +0000 (14:21 +0100)]
Add LIBUSB_TRANSFER_ADD_ZERO_PACKET flag to indicate need for ZLP

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.

12 years agolibusb.h: Add comma after last value in enums to ease future expansion
Peter Stuge [Sun, 19 Feb 2012 05:58:16 +0000 (06:58 +0100)]
libusb.h: Add comma after last value in enums to ease future expansion

12 years agoLinux: Rework bulk continuation check to generic kernel version check
Peter Stuge [Sun, 19 Feb 2012 04:39:33 +0000 (05:39 +0100)]
Linux: Rework bulk continuation check to generic kernel version check

The old check_flag_bulk_continuation() tested for one specific running
kernel version. The new kernel_version_ge() instead allows to test the
running kernel version against major, minor and sublevel parameters.

12 years agoOpenBSD: Correctly catch attempts to do isochronous OUT transfers
Peter Stuge [Sun, 19 Feb 2012 04:32:10 +0000 (05:32 +0100)]
OpenBSD: Correctly catch attempts to do isochronous OUT transfers

LIBUSB_ENDPOINT_OUT is the value of the direction bit, which is 0 for
OUT transfers, so the previous condition could never evaluate to true.

12 years agoDarwin: Do not reject devices with product id 0x0000
Peter Stuge [Sat, 18 Feb 2012 23:42:20 +0000 (00:42 +0100)]
Darwin: Do not reject devices with product id 0x0000

Fixes #128.

12 years agoDo not call timerfd functions when timerfd is not being used
Peter Stuge [Mon, 13 Feb 2012 15:59:51 +0000 (16:59 +0100)]
Do not call timerfd functions when timerfd is not being used

When libusb was built with timerfd support but used on a system
without timerfd support the library would hang indefinitely on
completion of the first transfer, since timerfd functions were
being called unconditionally and the error returned when timerfd
was not being used caused a confused internal state.

Many thanks to Ivo Smits for looking into the issue, proposing
an initial solution, and helping with testing! Fixes #73.

12 years agoWindows: Fix MSVC6 IDE warning on line continuation in libusb-1.0.rc
Michael Plante [Sun, 12 Feb 2012 18:49:35 +0000 (13:49 -0500)]
Windows: Fix MSVC6 IDE warning on line continuation in libusb-1.0.rc

* libusb\libusb-1.0.rc(21): Could not find the file LIBUSB_RC.
* only shows up first time after opening workspace.
* shows up on either build or clean.
* not actually due to rc.exe, but prior to it.
* probably an IDE bug.
* does not show up when running an exported makefile.

Signed-off-by: Michael Plante <michael.plante@gmail.com>
12 years agoWindows: Add Renesas SuperSpeed support for libusb_get_device_speed()
Pete Batard [Sat, 7 Jan 2012 23:30:23 +0000 (23:30 +0000)]
Windows: Add Renesas SuperSpeed support for libusb_get_device_speed()

* tests conducted using a Renesas PCIE USB 3.0 controller and driver and
  a mass storage USB 3.0 confirm that USB_NODE_CONNECTION_INFORMATION_EX
  uses (undocumented) value 3 for SuperSpeed