commit 767092ba395f8191e884f28e1cd27fe3b0d8d398
Author: Peter Stuge
Date: Thu Sep 15 17:04:43 2011 +0200
Remove username from SF FRS rsync upload command
commit 559f995778e9283384d8f09c435b135d9680dc6a
Author: Peter Stuge
Date: Thu Sep 15 16:48:35 2011 +0200
Support release candidate versions in configure.ac and libusb-1.0.rc
commit b04f4b6e2ca82012f31c4a72650c59de9661de7c
Author: Peter Stuge
Date: Thu Sep 15 16:32:47 2011 +0200
Tidy .gitignore a little
There's no xusb, we need a glob pattern for matching .exe files, and
fpusb tarballs aren't very common in the libusb source dir.
commit 4ff9a08cee025af25c1f34597a394e45933721e2
Author: Hans de Goede
Date: Wed Sep 14 10:53:48 2011 +0200
Docs: Clarify that libusb_handle_events_timeout() tv param can't be NULL
The example code and API doc for libusb_handle_events_timeout() could be
interpreted as it being OK to pass a NULL pointer for the tv argument (I
interpreted it like that when I first started coding for libusb).
This patch changes the docs to make it clear that one must always supply
a tv struct to libusb_handle_events_timeout.
Signed-off-by: Hans de Goede
commit 82e736b62f1f8edd375426c7b2a834a73ec9b9ad
Author: Peter Stuge
Date: Wed Sep 14 08:23:43 2011 +0200
Makefile.am: Do not remove ChangeLog on make distclean, fixes #116
[pbatard: Remove it on make maintainer-clean instead]
commit 7f89e8f40e20e005fce0e463cf3fbcb5644eb490
Author: Vitali Lovich
Date: Wed Sep 14 07:02:06 2011 +0200
Darwin: Reduce race likelihood between cancellation and device disconnect
References #88. The race condition still remains, but this change
makes it less likely to trigger.
commit 0ce97d6533a090fcfad9752fb8e898e22256e433
Author: Peter Stuge
Date: Wed Sep 14 04:00:33 2011 +0200
Document that libusb_get_device_list() can return any libusb_error code
Fixes #87.
commit 08e25e8a0280d8da81abda73442149b3771017b8
Author: Pete Batard
Date: Thu Jun 16 10:49:13 2011 +0100
Linux: Fix #81 URB double free race condition on device disconnect
A submitted transfer that has just been failed by the kernel could be
picked up by an event handler to be cleaned up, where freeing of URB
memory would race with the submit function doing it's own cleanup and
freeing as a result of the submit failing.
libusb_submit_transfer() always holds itransfer->lock, so the race can
be avoided by taking that lock also in the cleanup path and checking
that the URB memory has not already been freed before freeing it there.
As http://libusb.org/ticket/81#comment:14 notes there is still another
possible, but unlikely, race condition between libusb_submit_transfer()
and an event handling thread. That will require more work to solve.
[stuge: Add check in cleanup path that URBs have not already been freed]
commit 0c5c5707756df0dbf19e26ad38099d98e5f55b2e
Author: Peter Stuge
Date: Wed Sep 14 03:00:14 2011 +0200
Add libusb_error_name() API function
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: Clearer return value when called with unknown error codes]
commit bb6b0c1d29aeb5f57d2919d2639cd7df8435dfd6
Author: Peter Stuge
Date: Wed Sep 14 02:30:18 2011 +0200
Add libusb_has_capability() API function
Since it is currently not planned to change the filename of the libusb
DLL file for Windows systems between libusb-1.0 versions it is important
to have this API available starting with the first release that supports
Windows.
Currently there exists only one capability; LIBUSB_CAN_GET_DEVICE_SPEED,
which will always be supported when libusb_has_capability() is available.
commit aeed58186e2710897a76efaaa19824cbac9c6bb8
Author: Sebastian Pipping
Date: Tue Sep 13 20:38:26 2011 +0200
Fix typos in introductory documentation
commit 0389585ce5e5b934d74431e7f0b384c037016c98
Author: Pekka Nikander
Date: Tue Sep 13 18:57:43 2011 +0200
Linux: Add libusb_open() debug and error messages with the device path
Fixes #109.
commit 025ec0860cda0fde854cd933437337534c5cea02
Author: Pekka Nikander
Date: Tue Sep 13 18:52:36 2011 +0200
Add debug message with libusb_open() error code
References #109.
commit d43918b98068303f2dd63466c14cab7461d03183
Author: Hans de Goede
Date: Mon Sep 12 18:11:20 2011 +0200
Document libusb_handle_events_completed() and _timeout_completed()
Signed-off-by: Hans de Goede
[stuge: Note that the old racy functions should be avoided by new code]
commit 39fe51e716dd56617480cc0d2a4d3171403e1812
Author: Graeme Gill
Date: Sat Sep 10 15:47:05 2011 +0200
Fix #56 race condition causing delayed completion of sync transfers
The sync API had a race where it would check a condition to know if it
needed to call a libusb_handle_events() function. However, the check
was done outside of the lock that is held while the condition is set,
so another thread could completely serve whatever was needed to make
the condition true between it being checked and the event handler being
called. This situation would be detected after a libusb-internal timeout
of 60 seconds, after which the transfer would be completed without
error, but with significant delay.
Original patch at http://marc.info/?l=libusb-devel&m=127252114815709
Changes by Hans de Goede:
- Renamed the "race-proof" functions from libusb_handle_events*_check()
to libusb_handle_events*_completed()
- Drop r = 0 setting in libusb_handle_events_timeout_completed()
(to make both completed checking cases identical flow wise)
Signed-off-by: Hans de Goede
[stuge: Simplify libusb_handle_events_timeout() change with a goto]
commit 0eb7e43759003610d1afe6148aa6ff4f5859ccb0
Author: Peter Stuge
Date: Wed Jul 27 03:15:03 2011 +0200
Allow devices with zero configurations to be discovered
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
commit 5010c3e80423d13acee6eeb4af974e8a9bcdd006
Author: Peter Stuge
Date: Wed Jul 27 06:17:48 2011 +0200
Linux: Continue enumeration even if one device returns an error
commit 2bf8848fb5c85ace0f445c0820a0c173cf76bf43
Author: Hans de Goede
Date: Fri Jun 17 10:19:00 2011 +0200
Linux: Handle single- and two-digit kernel versions like 3.0 and 4
The code has been tested with various version strings.
[stuge: Remove bogus string length check and optimize for newer kernels]
commit 0288bf24f91eca9f433ebad91a7eb6c0e3e29133
Author: Pete Batard
Date: Thu Mar 3 18:35:35 2011 +0000
Windows: Provide libusb_get_device_speed() data
* use (currently superspeed unaware) USB_NODE_CONNECTION_INFORMATION_EX
Fixes #45.
[stuge: Explicitly convert OS device speeds to libusb device speeds]
[pbatard: Add breaks overlooked when adding explicit conversion]
commit 382b7deaadd7e2f1d08c9e921e460bb3abf130b2
Author: Trygve Laugstøl
Date: Tue Jul 19 23:20:40 2011 +0200
Darwin: Provide libusb_get_device_speed() data
References #45.
commit 44d6319f57e7e2c77347da228ed032e62716b438
Author: Hans de Goede
Date: Thu Feb 17 15:06:40 2011 +0100
Linux: Provide libusb_get_device_speed() data from sysfs
References #45.
Signed-off-by: Hans de Goede
commit c8c40bcbd22abca922ff31c4ed6a75fd7af78b59
Author: Hans de Goede
Date: Thu Feb 17 13:17:55 2011 +0100
Add new API function libusb_get_device_speed()
Reworked version of my earlier patch, largely modelled after (if not
copy and pasted from) Trygve Laugstøl's 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
commit 0db8cba7f2c372f0127c7df9724e5a35e93f2069
Author: Nathan Hjelm
Date: Sun Mar 20 00:25:44 2011 -0600
Darwin: Improve device enumeration performance
The device location is saved, and later used whenever iterating over
devices. Fixes #111 and #112.
[stuge: Formatting fixes and split out libusb_get_device_speed() change]
[stuge: Combine with patch that uses the saved device location]
commit 511ec4301deb516691e39e3df5b90fe28cb2bb0f
Author: Hans de Goede
Date: Thu Feb 17 12:49:36 2011 +0100
Linux: Use __read_sysfs_attr() to get busnum and devaddr
Remove code duplication.
Signed-off-by: Hans de Goede
commit e05bbc59ca7b896e2b825bde59bf883ac8c09f5c
Author: Hans de Goede
Date: Thu Feb 17 12:45:10 2011 +0100
Linux: Add __read_sysfs_attr() helper function
On Linux we often need to read (postive) integers from sysfs. This patch
adds a helper function for this. This is a preparation patch for adding
a libusb_get_device_speed() function to libusb.
Signed-off-by: Hans de Goede
commit 20e26dda0f86dafa3436b152e090b5f3410c8ce4
Author: Hans de Goede
Date: Tue Feb 8 16:37:18 2011 +0100
Linux: Stop kernel from re-attaching in-kernel driver after reset
When an interface is bound to the usbfs driver (iow claimed), the
kernel will unbind it, and then after the reset do a device_attach
on the interface, which will bind the default in kernel driver to
the interface.
So if an app has detached the in kernel driver, and claimed the
interface and then does a libusb_reset_device. Things end up with
the interface no longer being bound to the usbfs driver (so no longer
claimed) and instead it is bound to the in kernel driver (iow the in
kernel driver is re-attached).
We can stop this from happening by releasing all claimed interfaces
before the reset, as the kernel will not do the device attach after
reset, if no driver was bound to the interface before the reset.
Signed-off-by: Hans de Goede
commit 4e294dc9848aab86b31d2fff228cf97e7eadf913
Author: Hans de Goede
Date: Thu Feb 17 12:35:46 2011 +0100
Core: Use USB_MAXINTERFACES rather then sizeof(claimed_interfaces)
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
commit a68f956dd4c29d6ed799f04f07a3346317843999
Author: Hans de Goede
Date: Wed Feb 9 12:40:35 2011 +0100
Linux: Fix warnings seen when compiling with gcc-4.6
Compiling with gcc-4.6 results in the following warnings:
os/linux_usbfs.c: In function 'op_get_configuration':
os/linux_usbfs.c:1144:6: warning: variable 'r' set but not used ...
os/linux_usbfs.c: In function 'op_handle_events':
os/linux_usbfs.c:2091:40: warning: 'status' may be used uninitialized ...
os/linux_usbfs.c:2044:6: note: 'status' was declared here
dpfp.c: In function 'save_to_file':
dpfp.c:228:9: warning: variable 'ignore' set but not used ...
dpfp_threaded.c: In function 'save_to_file':
dpfp_threaded.c:257:9: warning: variable 'ignore' set but not used ...
This patch fixes these. (The second comes from handle_control_completion()
which gcc seems to inline into op_handle_events().)
Signed-off-by: Hans de Goede
[stuge: Add fixes for dpfp examples and update source references]
commit 209b5ccd827039b933b730e3f29abd0d72d3c6c6
Author: Vitali Lovich
Date: Tue Jun 14 08:51:57 2011 +0200
Darwin: Fix #108 crash when a device is unplugged
commit d3543e9140536a9751811b44f8496489be1e6bb7
Author: Peter Stuge
Date: Mon Jun 13 22:58:23 2011 +0200
libusb.h: Add missing LIBUSB_CLASS_ codes currently defined by usb.org
LIBUSB_CLASS_PHYSICAL
LIBUSB_CLASS_SMART_CARD
LIBUSB_CLASS_CONTENT_SECURITY
LIBUSB_CLASS_VIDEO
LIBUSB_CLASS_PERSONAL_HEALTHCARE
LIBUSB_CLASS_DIAGNOSTIC_DEVICE
Per http://www.usb.org/developers/defined_class
commit 08bc7ffb6a3b65afc6795cd048a890ee8da7d954
Author: Peter Stuge
Date: Mon Jun 13 22:53:40 2011 +0200
libusb.h: Add LIBUSB_CLASS_IMAGE in addition to LIBUSB_CLASS_PTP
The old LIBUSB_CLASS_PTP name is kept for compatibility. Fixes #106.
commit 3d7938d85a33cd98553c0c898a8dd0490826b077
Author: Peter Stuge
Date: Mon Jun 13 22:52:48 2011 +0200
libusb.h: Fix LIBUSB_CLASS_PRINTER description typo
References #106.
commit 5d0526af1a922afab02cdbdf4bb7078702759571
Author: Sean McBride
Date: Fri Feb 11 11:28:04 2011 -0500
Darwin: Fix #100 warning cast to pointer from integer of different size
commit bb8854ff5680136e29b57505300f131c2646f258
Author: Sean McBride
Date: Mon Jun 13 22:26:43 2011 +0200
configure.ac: Fix #97 clang warning about -fgnu89-inline
Remove the test that sets the flag since GNU89 inline semantics are not
required by libusb.
[stuge: Also remove reference to the test result]
commit cb3c2e488f298b78027c9d5fc0bec0e5ba27d761
Author: Pete Batard
Date: Wed Jun 15 01:38:58 2011 +0200
Windows: Make cancel_io() in poll_windows.c static
References #97.
commit 6635dbb4acb5ee556a020e431b15c954edfcbd29
Author: Peter Stuge
Date: Mon Jun 13 22:21:02 2011 +0200
Windows: Make upperize() in windows_usb.h static
References #97.
commit 9479ce9dae3d0dbe2ce693bd02ccceb018a75fe9
Author: Vitali Lovich
Date: Wed Mar 16 17:33:57 2011 -0700
descriptor.c: Fix buffer read overflow caught by valgrind
In parse_interface() an unexpected descriptor would be parsed without
validating the descriptor's length. It is possible for size to be 0 at
this point, which means that the parsing would read past the end of the
source buffer. Fix #83 by checking the length of the remaining buffer
before parsing.
commit c775c2f43037cd235b65410583179195e25f9c4a
Author: Vitali Lovich
Date: Wed Mar 16 19:51:40 2011 -0700
Clean up in-flight transfers and device handle when closing a device
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]
commit 74282582cc879f091ad1d847411337bc3fa78a2b
Author: Vitali Lovich
Date: Wed Mar 16 19:43:30 2011 -0700
Add recursive mutexes to threading abstraction
This is necessary for the device close path which needs to attain the
events lock, but which might itself be called while handling an event.
The events lock is necessary to properly clean up transfers which might
still be pointing to the device. References #82.
[stuge: Move usbi_mutex_init_recursive() into threads_posix.c]
[stuge: Must also #define _XOPEN_SOURCE 500 to be able to build]
[pbatard: Un-inline usbi_mutex_init_recursive() to make Cygwin happy]
commit 8f1bc0659136faf312dabe8fe67380a798299d33
Author: Vitali Lovich
Date: Wed Mar 16 19:48:35 2011 -0700
Add USBI_TRANSFER_CANCELLING and _DEVICE_DISAPPEARED status flags
The flags are used to indicate if a cancellation has started, and if
a cancellation has failed because the device is no longer available.
References #82.
commit 87ba8a9ead4fd9e81ae3c5a894f698779de1f2c2
Author: Vitali Lovich
Date: Wed Mar 16 19:50:04 2011 -0700
Linux: Detect and report that device has gone away while discarding URBs
Return LIBUSB_ERROR_NO_DEVICE if the device is no longer available
(ENODEV) to discard the urbs. References #82.
commit 2c85c363cddd72b9ab425f05e2ee03e0b1df24f1
Author: Peter Stuge
Date: Mon Jun 6 02:46:46 2011 +0200
libusbi.h: Add comma after last value in enum usbi_transfer_flags
commit 5d7be3e1337f2444097504931ac0f2f0997b2b05
Author: Peter Stuge
Date: Sun Jun 5 23:28:07 2011 +0200
threads_posix.h: Whitespace fix
commit 18db4813e844fc6929680afcc9b793abcb06876a
Author: Peter Stuge
Date: Sun Jun 5 23:21:08 2011 +0200
libusb/Makefile.am: Correct threading files in libusb_1_0_la_SOURCES
commit 5f30c81f66e8dd61f8eae16de548697708f9bd18
Author: Alan Ott
Date: Thu Jul 21 16:37:48 2011 +0200
Linux: Fix #70 race condition in sysfs_get_device_list()
Change the way libusb chooses between using sysfs and usbfs for information
about the attached devies. Using the old method, a race condition could
occur if a device was unplugged just before (or during) the call to
libusb_get_device_list(), corrupting the internal sysfs_can_relate_devices
and sysfs_has_descriptors variables and preventing libusb_get_device_list()
from working in future calls.
The old method was based on the assumption that if certain sysfs files
(eg: busnum) could not be opened, that indicated an inadequacy of sysfs
(ie: the running kernel's sysfs version did not contain those files),
when in reality those files couldn't be opened because the device had
been unplugged.
The new method checks the adequacy of sysfs during libusb_init()
(op_init()) and if a sysfs file cannot be opened, it is now assumed that
it is because the device has been unplugged, not because sysfs is
inadequate.
Signed-off-by: Alan Ott
[stuge: Include closedir() bugfix posted in ticket by Arne Laansoo]
[stuge: Remove dead code in sysfs_scan_device() found by Hans de Goede]
commit 40327cd134718475f6cec8935b856d4fdff2099c
Author: Sean McBride
Date: Thu Feb 10 17:11:29 2011 -0500
Darwin: Fix #63 error when apps use Objective-C garbage collection
commit 3ba2fae24886fec89410e5f2295f65363edcc2df
Author: Sean McBride
Date: Fri Feb 5 11:50:34 2010 -0500
Darwin: Fix #28 clang analyzer warning about unbalanced retain/release
commit b67120f047f7eafa15c88c66fa61cef40805ec1f
Author: Sean McBride
Date: Fri Feb 5 11:50:34 2010 -0500
io.c: Fix clang analyzer warning about unused variable
References #28.
commit 51af85d03a098d7d99ea544e8e9535b5476bab33
Author: Peter Stuge
Date: Tue May 10 10:44:18 2011 +0200
.gitignore: Add m4 subdirectory created by libtool
commit c569e5b3b314538f45d0b3b6f14ce3dbdfee1be9
Author: Ludovic Rousseau
Date: Mon Nov 15 14:45:50 2010 +0100
Linux: Do not include useless pthread.h
The code does not use threads so no need to #include
Fixes #74.
commit 82af9f9d440ef49015652c699157cf62020f097a
Author: Pete Batard
Date: Tue Mar 8 17:41:05 2011 +0000
Windows: minor code improvements
* mostly warnings from VS2010's Intellisense
commit 7e636dbe06001b9ac68e452a2fdc05e33fbb4e3a
Author: Pete Batard
Date: Tue Mar 8 17:40:39 2011 +0000
Windows: prevent set_configuration request from being sent using WinUSB
* multiple WinUSB set configuration requests can stall a device and
WinUSB does not support setting of alt configuration in the first place
* issue reported and investigated by Xiaofan Chen
commit 578c50c99646e5ebbcfbea653524a519b843ebcd
Author: Graeme Gill
Date: Tue Mar 8 17:39:16 2011 +0000
Windows: fixed default WinUSB timeout and ineffective policy settings
* default WinUSB timeout was 5 seconds, which may be to small.
PIPE_TRANSFER_TIMEOUT policy is now set to infinite for all EPs.
* other WinUSB policy settings were called before the endpoints
had been set. This is now fixed.
commit 25fa63ea1cfe02e784cb62d3b869fd15e62b5b6e
Author: Pete Batard
Date: Tue Mar 8 17:37:40 2011 +0000
Windows: Don't leak pipe fds
use _open() and _close() rather than _open_osfhandle() and CloseHandle()
* use of CloseHandle() prevented the pipe fds from being
relinquished on libusb_exit()
* leaked fds could lead to the OS running out of new fds
and LIBUSB_ERROR_NO_MEM being returned as a result
* using _open() avoids _open_osfhandle() redef for cygwin
* issue reported by Stephano Antonelli
commit 3ccd9bddec316ee4b867959fd7f616eb4d410997
Author: Peter Stuge
Date: Tue May 10 10:05:29 2011 +0200
Windows: enumeration overhaul
* 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)
commit bb108cbe39802785d10fe025b74ca5ee19734151
Author: Pete Batard
Date: Tue May 10 00:56:18 2011 +0100
Windows: MS project files part 4 - MSVC6 project files
Fixes #57 and #1.
commit 78896ae99b9c2d5672fc93c5bad0f5e8e75c53ea
Author: Pete Batard
Date: Tue May 10 00:53:09 2011 +0100
Windows: MS project files part 3 - VS2005 project files
References #57.
commit 9e5f4277e379a82f5d32e81db1bd0ffaa6637596
Author: Pete Batard
Date: Tue May 10 00:38:49 2011 +0100
Windows: MS project files part 2 - WDK project files
References #57.
commit c1e75431418cdfc10ec963d823fce479cdae6840
Author: Pete Batard
Date: Tue May 10 00:38:12 2011 +0100
Windows: MS project files part 1 - support files & preliminaries
* adds the MSVC support files used by MSVC6, VS2005 and WDK
* also adds missing defines required by MS compilers in libusb.h
* also anticipatory sets .gitattributes for CRLF handling
* also adds manually maintained .def file for import lib generation
References #57.
commit 85a14f43e0ce27cd47f84fdaeacbaa81cebdb886
Author: Peter Stuge
Date: Mon May 9 08:12:24 2011 +0200
Move library version number from configure.ac to libusb/version.h
This is neccessary to support native MS builds. The Windows resource
file libusb/libusb-1.0.rc must include the release version, which was
previously only available after configure had run and had substituted
the numbers into a generated libusb/libusb-1.0.rc file.
The version atoms are now stored as CPP style #defines in libusb/version.h
so that the .rc no longer needs to be generated but can simply include the
header file and access the version information directly.
The m4 macro LU_DEFINE_VERSION_ATOM() was added to configure.ac to get
version atoms from libusb/version.h for use in AC_INIT(). The macro
handles C and C++ style comments in version.h, but can easily be made
to fail by obscuring the file. Please don't do that.
Tested with MinGW using autoconf, and manual compile of libusb-1.0.rc
using RC.EXE Version 5.2.3690.0 from Visual C++ 2005 Express Edition.
commit 3481f52b014110f6c291e5a15e79ba774dcdfacf
Author: Peter Stuge
Date: Tue May 10 08:36:32 2011 +0200
Windows: Debug builds create the same .dll file name as non-debug
Thanks to Pete for pointing this out!
commit 9da8cf5c9ed9bd381a77d8170fc0556edbcce4dc
Author: Pete Batard
Date: Tue Mar 8 17:18:48 2011 +0000
Windows: explicit use of ANSI or WideChar calls
* This is in anticipation of adding MSVC project files
that use Unicode rather than MBCS
commit ae675c1f49dc00b695fce7296903f60998cc28ed
Author: Pete Batard
Date: Tue Mar 8 17:16:23 2011 +0000
Windows: Remove SetupAPI, AdvAPI32 and OLE32 link-time dependencies
* this ensures that libusb dependent applications only need
to explicitly link against libusb on Windows
The run-time dependency on Cfgmgr32.dll, OLE32.dll and SetupAPI.dll remains.
commit 356e312511e4892977636da52ec497ad2c716032
Author: Pete Batard
Date: Tue Mar 8 17:12:33 2011 +0000
Add .gitattributes to avoid Windows line ending issues with autocrlf
commit 61c120f025f3dee04eeb88159d7c0403a8bf91fe
Author: Peter Stuge
Date: Sun Feb 27 09:37:54 2011 +0100
Windows: Touch up FileDescription and ProductName resource strings
commit 99b4ddcd893834a4be8b5884037b650e57ba0ba2
Author: Peter Stuge
Date: Sun Feb 27 07:20:40 2011 +0100
Windows: Remove emulated direct device access via HID API
Either use a library such as HIDAPI to communicate with HID class
devices, or replace the kernel driver for the device with one that
offers support for the complete libusb API.
commit 4be84ab49c838d534d3a1b8a64ffa89774984ee7
Author: Peter Stuge
Date: Sun Feb 27 06:59:15 2011 +0100
Revert libusb_strerror() until we have i18n and l10n
commit 0e177f22fcc69d9aab6fb410e85f3413f478c94c
Author: Pete Batard
Date: Wed Jan 19 14:00:12 2011 +0000
dpfp_threaded: return instead of pthread_exit() to avoid Cygwin warning
commit e65878f21b0a0bb96debcb292dc03ce3c4ebb701
Author: Pete Batard
Date: Wed Jan 19 13:52:08 2011 +0000
Windows: Rename various variables named "index" to avoid shadow warnings
commit 019bf73bb2677dc7720bc8280527316adcbaa506
Author: Pete Batard
Date: Tue Oct 5 12:50:53 2010 +0100
Windows: Fix logic in enumeration of driver name and port number
commit 24494ed5db27737fc607fc35dda722521c9fe4d4
Author: Pete Batard
Date: Tue Oct 5 12:50:13 2010 +0100
Windows: Allow claiming any interface in composite device using WinUSB
Issue reported by Benjamin Dobell, see #48. The call to
WinUsb_QueryInterfaceSettings() is removed since it doesn't work
on any other interface but the first (a WinUSB limitation).
This allows the use of WinUSB.sys in lieu of the usbccgp.sys
"USB Generic Parent" default driver for composite devices.
commit 9c8e6545f2fbb171f81a9451eaf2d09e1fbc13b3
Author: Pete Batard
Date: Tue Oct 5 12:47:15 2010 +0100
Windows: Allow arbitrary bConfigurationValue in config descriptors
Unlike bInterfaceNumber, bConfigurationValue does not have to be
either sequential or contiguous. The bConfigurationValue is now
included in debug output. Fixes #48 reported by Benjamin Dobell.
commit dcd002974e511879320233fd5b0600e06bdc5620
Author: Thomas Röfer
Date: Fri Nov 19 22:03:11 2010 +0100
Darwin: Schedule isochronous transfers further in the future
This is required to make OpenKinect transfer data at 30 fps. This
change was originally made by Theo Watson, and Thomas improved on it.
The commit came via OpenKinect into libusb thanks to Kyle Machulis and
Hector Martin. Fixes #66.
commit e83fad33dbaf9f37811da6d4cd9d3be554817944
Author: Thomas Röfer
Date: Fri Nov 19 22:03:11 2010 +0100
Darwin: Fix #65 memory leak in submit_iso_transfer()
This was also independently fixed by Hoi-Ho Chan, but Thomas caught
an additional problem with his fix.
This commit came via OpenKinect into libusb thanks to Kyle Machulis
and Hector Martin.
commit 1a2d21fe42ad5a157651c787e2f500fc162c325b
Author: Peter Stuge
Date: Sat Feb 26 04:21:05 2011 +0100
configure.ac: Refactor Windows backend settings into one occurence
The Windows backend is used both with MinGW and Cygwin, and since most
settings are identical they can be set in one place.
commit 717f47621d18de16b87e237f3740299f43e4ca1c
Author: Peter Stuge
Date: Mon Nov 15 19:58:51 2010 +0100
configure.ac: Rename AM_LDFLAGS to LTLDFLAGS and actually use them
The new variable name tries to clarify that libtool is being used.
Linker flags must thus always be specified with -Wl.
Factor out the libtool flag -no-undefined from host specific cases.
The flag is required to build a Windows DLL, but is correct also for
the other supported systems.
Also, start actually using LTLDFLAGS in libusb/Makefile.am, so that
libtool will see the options set by configure.
commit 3cbe5736469c1c52049752c137ae11387e9b079d
Author: Peter Stuge
Date: Sun Nov 21 23:38:46 2010 +0100
configure.ac: Clean up PC_LIBS_PRIVATE and AM_LDFLAGS
Move linker options for when linking the library itself from
PC_LIBS_PRIVATE into AM_LDFLAGS. PC_LIBS_PRIVATE should only
contain flags needed to link applications statically against libusb.
Fixes #72.
commit ef39d1510580b9fcbacf13443fa7a4e553a9a88e
Author: Peter Stuge
Date: Fri Feb 25 02:33:29 2011 +0100
configure.ac: Call AC_CONFIG_FILES() for each output file
This avoids a problem with Windows line endings.
commit 6e52ea067711e6e7e1b2882757fb61b11b6f8feb
Author: Peter Stuge
Date: Sun Nov 21 23:37:27 2010 +0100
configure.ac: Whitespace changes and trivial reordering
commit 44b85dabc3f4efe0918a598f981675aa3765cc26
Author: Peter Stuge
Date: Sun Nov 21 23:10:35 2010 +0100
configure.ac: Quote AC_COMPILE_IFELSE() input
commit 19d5882c398e49a453ff78494db23b7f4d13c37c
Author: Peter Stuge
Date: Sun Nov 21 23:09:02 2010 +0100
configure.ac: Define booleans to 1 when set, instead of an empty string
This makes the generated config.h look a lot nicer.
commit c24649d796c8b5c97af79a41856422def2e593bc
Author: Peter Stuge
Date: Sat Oct 30 22:28:59 2010 +0200
configure.ac: Clean up redundancy and fix LIBS on Linux
LIBS, AM_LDFLAGS, OS_ conditionals and THREADS_POSIX had a bit of
redundancy throughout the file, and on Linux LIBS ended up missing
the -pthread flag.
commit 0bd4a4dd89ff64b99ab55bfc0c5782502c10c676
Author: Peter Stuge
Date: Sat Feb 26 04:08:38 2011 +0100
configure.ac: Touch up Darwin and Cygwin OS messages
commit 16cf11a1213272afd616598fa3aba0941e66ec3c
Author: Peter Stuge
Date: Sat Oct 30 22:13:05 2010 +0200
configure.ac: Do not use -pthread on Darwin
It's not needed because Darwin has POSIX Threads in libc. Fixes #96.
commit a120747d561929682cd0276ea4c13fb22fad8554
Author: Peter Stuge
Date: Sat Oct 30 22:07:37 2010 +0200
configure.ac: Check for poll.h, and for nfds_t on Darwin
On Linux, assume nfds_t is always available.
On Darwin, fall back to unsigned int when poll() exists but there
is no nfds_t, such as on Mac OS X before 10.4.
On Windows (both MinGW and Cygwin), always use unsigned int instead
of nfds_t, and don't check for poll.h because we use our own poll()
implementation.
commit 21d03d12f92c0d9bd7990861ca0ebf5009f82799
Author: Nathan Hjelm
Date: Tue Oct 5 20:08:08 2010 -0600
Darwin: Add support for control requests on endpoints other than 0
Signed-off-by: Nathan Hjelm
commit 9bfacd760b40f1137a7835198c6028cbdaddeb18
Author: Nathan Hjelm
Date: Tue Oct 5 23:11:50 2010 -0600
Darwin: Add more error checking for libusb_open()
Now also check the CreateDeviceAsyncEventSource() return code for errors.
Signed-off-by: Nathan Hjelm
commit 478cd4a30728595fd742aa192d8149ee4216d4bc
Author: Peter Stuge
Date: Wed Nov 3 21:46:53 2010 +0100
Core: libusb_get_next_timeout() must consider all flying transfers
If transfer->flags indicated that a transfer had a timeout, but no
timeout was actually set, then libusb_get_next_timeout() would look
no further for a timeout, ignoring any transfers later in the list
which had a timeout set.
Since libusb has an internal 60 second timeout this bug could not
cause complete lockup, but it could cause a 60 second timeout even
when a transfer was submitted with a shorter timeout.
commit 7802e4a3e38bcefccf96ae510ec2c6b7a959b8b5
Author: Ludovic Rousseau
Date: Mon Nov 15 14:55:51 2010 +0100
Linux: Correctly catch read() errors for sysfs config descriptors
read(2) returns ssize_t (signed) and not size_t (unsigned) or int.
Silence "warning: comparison of unsigned expression < 0 is always false"
and fix #75.
commit 4c7f3c8c3012bddba058afd2abdda792944fcda1
Author: Peter Stuge
Date: Sun Jan 23 04:01:25 2011 +0100
Linux: Refactor cancellation into one function for all transfer types
commit 011f1f297bc134188fab9960da1b1b9f0bd541aa
Author: Peter Stuge
Date: Sun Oct 17 08:19:56 2010 +0200
Linux: Refactor discarding of URBs into a function and return all errors
The Linux backend did not always return errors according to the
libusb_cancel_transfer() documentation.
commit 26246df19cb4d88954a5aa9ed5f6b859e451df85
Author: Peter Stuge
Date: Sun Jan 23 04:01:01 2011 +0100
Linux: Set private number of URBs also for control transfers
commit 295c9d12e25bc2dbdd8b42bd67a1f7120f0631a1
Author: Alan Stern
Date: Sun Oct 17 06:57:06 2010 +0200
Linux: cancel URBs in reverse order
In a multi-URB transfer, URBs should be cancelled in reverse order of
submission. This prevents races that might otherwise occur (after URB N
is cancelled, data may be transferred for URB N+1 before it too can be
cancelled). Fixes #8.
commit 07df377a5df25e9c1811b554dc00eb8c40e5b995
Author: Alan Stern
Date: Sun Oct 17 04:17:32 2010 +0200
Linux: report correct value for urb->actual_length
Transferred bytes are returned correctly by the kernel for every URB,
even when an error occurs. Hence they should always be included in
the transfer statistics. The same is true for isochronous packet
length and status.
[stuge: set itransfer->transferred so data is stored at correct offset]
commit b26db49208c7a6ef0a99645142af21ce80c57c22
Author: Alan Stern
Date: Fri Oct 22 11:13:34 2010 +0200
Linux: improve reporting of URB error status codes
Fix the way overflow errors are handled (they can occur in any
transaction, not just the last one in a transfer) and add tests
for other commonly-occuring error statuses.
commit efc29733ad31f81883a7ac51a6cc6cda9ad4feb9
Author: Alan Stern
Date: Tue Oct 5 11:08:40 2010 -0400
Linux: improve detection of BULK_CONTINUATION kernel support
Clarify the comments describing the BULK_CONTINATION flag, and improve
the subroutine that checks whether the flag is supported by making it
"future-proof", i.e., by working properly with kernel version numbers
higher than 2.6.
commit bd267cf92269e0c4cd8eef795b91eefb2c63452e
Author: Peter Stuge
Date: Mon Nov 22 05:14:00 2010 +0100
README: Update webpage URL and add Peter's email address
commit 845b715675703c5f1bc907f6302ece416c9f112c
Author: Peter Stuge
Date: Wed Aug 4 07:30:22 2010 +0200
libusb is not just for Linux!
commit 67d9ef7b6877e17f2deec81cd41dc0948f6bed4b
Author: Nathan Hjelm
Date: Tue Oct 5 19:48:39 2010 -0600
Remove USBI_OS_HANDLES_TIMEOUT and fix int/isoc timeouts on Darwin
Backends set USBI_TRANSFER_OS_HANDLES_TIMEOUT for transfers instead.
Darwin only handles timeouts for bulk and control transfers, so the
backend now sets that flag accordingly, making libusb core handle
timeouts for interrupt and isochronous transfers. Fixes #31.
Signed-off-by: Nathan Hjelm
[stuge: rework libusb_get_next_timeout() and enum usbi_transfer_flags]
[stuge: fix typo; set USBI_TRANSFER_TIMED_OUT flag correctly]
commit 370922dfbe0964c0b8a0c1974bb1d7b85ac10607
Author: Peter Stuge
Date: Sun Nov 14 03:14:00 2010 +0100
Silence "warning: suggest braces around empty body in an 'if' statement"
commit 0f85015bdf87f3bca0d86ed87c9b976176640922
Author: Konrad Rzepecki
Date: Sat Nov 13 14:09:22 2010 +0100
Disallow libusb_get_string_descriptor_ascii() with index 0
String descriptor 0 is the list of supported language IDs in the device,
which can't have an ASCII representation. Calling the function with
index 0 is thus not really useful. Fixes #43.
commit 3b41c31d3fa2c1f93649cc5fc0f59acbf3efd5a1
Author: Ludovic Rousseau
Date: Fri Mar 19 15:35:14 2010 +0100
Use const for the usbi_parse_descriptor() format string
Constant strings should be "const char *" instead of "char *". Silence
"discards qualifiers from pointer target type" warnings. Fixes #61.
commit 7f2e9f0776386997d2b4c4c47598ab88e3caeb7a
Author: Hector Martin
Date: Wed Aug 25 03:21:57 2010 +0200
Linux: Fix usbfs/sysfs config descriptor handling on big-endian
usbfs endian-swaps, sysfs doesn't, not the other way around. Fixes #51;
descriptor endian parsing is backwards using sysfs on big-endian hosts.
usbfs is untested.
Signed-off-by: Hector Martin
[stuge: checked against Documentation/usb/proc_usb_info.txt]
commit 2aa8984e59cf0f492e7fbebb8924f54f6160cc5e
Author: Ludovic Rousseau
Date: Tue Aug 17 20:53:04 2010 +0200
examples: #include without directory name
The libusb-1.0 directory name belongs in the compile command, e.g.
via pkg-config --cflags. Fixes #58.
commit 7da756e09fd97efad2b35b5cee0e2b2550aac2cb
Author: Ludovic Rousseau
Date: Thu Jun 24 10:14:24 2010 +0200
Add missing argument to libusb_wait_for_event() documentation, fix #55
In the libusb_wait_for_event() sample code in the section "Letting other
threads do the work for you" the call to libusb_wait_for_event() was not
updated by commit 1df713d622ab4f0b03aad72d903ac7beb8fb3b90, which added
the libusb_context *ctx parameter to the function, so the sample code
was broken until now.
commit 678c242705b29f9cb6cc421b5625a6485ae58047
Author: Peter Stuge
Date: Sat Oct 16 14:22:30 2010 +0200
examples: Silence warnings about return value of fwrite()
commit 9cd9059bf9baac69a9d6c909f4c1e000592fa260
Author: Peter Stuge
Date: Sat Oct 16 11:47:14 2010 +0200
Linux: Don't free() URBs prematurely on hardware error; fix #54
When an URB in a multi-URB transfer had an error, handle_bulk_completion()
would free all URBs and segfault once the next one completed, instead of
cancelling the remaining URBs and cleaning up as usual.
This is basically the patch from the ticket, plus some restructuring
for increased readability of the function.
Many thanks to Brian Shirley and National Instruments for finding and
fixing this!
commit 116d34f608b02f4e14668450b158acf5db726f95
Author: Pete Batard
Date: Tue Oct 5 12:43:41 2010 +0100
Windows: add support for filter drivers
* precedence is driver > upper filter > lower filter, and defined
in struct driver_lookup lookup from set_device_paths()
commit eb833fcd837e3aac2e497438b14c8612254c28ce
Author: Pete Batard
Date: Tue Oct 5 12:36:49 2010 +0100
Windows: fix errcode shadow warning, and string and DLL_DECLARE fixes
* use FormatMessageA, and overall improvement of windows_error_str()
* use safe_strlen() always
* better typing/init default
* more explicit debug message for devices with no driver
commit 1feadb5f78e1d2cdfd2aaf0011e041c2848bae37
Author: Pete Batard
Date: Tue Oct 5 12:29:32 2010 +0100
Windows: use IOCTLs for HID input, output and feature reports
* fixes feature reports not providing actual read size
(reported by Axel Rohde http://marc.info/?m=127033070021994)
* removes the USE_HIDD_FOR_REPORTS macro
* IOCTL usage inspired from HIDAPI by Alan Ott
commit d7c25451f4075d2a12eb5cbc91ff3de8c0292da0
Author: Daniel Drake
Date: Mon Oct 4 20:03:58 2010 +0100
Fix libtool version setting
This was being set too early to take effect.
commit a6fb54e2eef4e393bd06829bc3bdc746ea9d41a6
Author: Mike Frysinger
Date: Mon Oct 4 20:01:07 2010 +0100
Populate the pkg-config Libs.private field
commit a9b4065f048e750b7317f6434406fd528b69bf33
Author: Mike Frysinger
Date: Fri Aug 20 00:09:46 2010 -0400
Linux: fix build failure when CLOCK_MONOTONIC does not exist
This is not available on all platforms.
commit d192c5bd32736fde0080d756de6221287af34891
Author: Daniel Drake
Date: Mon Oct 4 18:45:18 2010 +0100
Update libtool version info
With input from various people on the mailing list, update the libtool
versioning info and start to update this on every release.
The next libusb release will not need a change here. All following ones
will.
commit e65f69a7ef3de357c867ddaac9598efe407078b6
Author: Pete Batard
Date: Thu Aug 5 16:40:09 2010 +0100
Updated documentation for unsupported Darwin/Windows calls
commit c8bab4e19413d70c515a2eaf747a75b7f66fdc0b
Author: Pete Batard
Date: Sun Sep 19 14:24:25 2010 +0100
Windows: Make libusb_pollfd() return error
Windows does not have numerical file descriptors but does have the
concept of event sources. Exposing these event sources will require
some careful thought and design, to be completed later.
commit bd623f70d99fad8b975f8d4ee62ea4b1abf1272f
Author: Daniel Drake
Date: Sun Sep 19 14:21:01 2010 +0100
MinGW: Use --add-stdcall-alias linker option
Naming of symbols inside the library is inconsistent on Windows:
http://wyw.dcweb.cn/stdcall.htm
Use this linker option to add aliases which add compatibility with
the "MSVC DLL" platform when a DEF file is used. It also better matches
the appearance of the Windows API itself.
commit 29f9f9e3af3340df6a955881a93caf9d2a6d08d6
Author: Pete Batard
Date: Fri Aug 13 11:59:49 2010 +0100
Introduced calling convention (for Windows)
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
Signed-off-by: Pete Batard
[dsd: slight change of strategy, add documentation]
commit be523f1fe7c136c3fca06ae9c96aff44a22482ba
Author: Pete Batard
Date: Fri Aug 6 21:56:04 2010 -0600
Windows: fix string copy in sanitize_path
The NULL byte was not being copied.
commit 7fd36af9f749ce8bf96f89cefd519a9f46825573
Author: Pete Batard
Date: Fri Jul 30 00:30:31 2010 +0100
Windows: DuplicateHandle failure is not a warning
This is because WinUSB handles are not duplicable, and generate a
lot of these warnings.
commit 33cd2f68b4d500e852e354e5acae3d9a96a8ec26
Author: Pete Batard
Date: Fri Jul 30 00:23:05 2010 +0100
removed trailing whitespaces
commit e47849afe9381c864683220eac9ce7bcf43f7883
Author: Pete Batard
Date: Wed Aug 4 18:18:32 2010 -0600
Windows: Mark interfaces as unused when releasing
Without this important cleanup, the autoclaim code could attempt to
reuse an unclaimed interface as if it were already claimed.
commit b30ca141a0bdce26e7cfdd91d346e49051532ee7
Author: Pete Batard
Date: Wed Aug 4 18:15:59 2010 -0600
Windows: fix device path string duplication
commit e8d7a89503d5655c4b04da718c6971e25ff48162
Author: Nathan Hjelm
Date: Mon Aug 2 21:27:38 2010 -0600
Darwin: Cache device configuration value
Cache device configuration value to bring the Darwin backend more in
line with the libusb spec. To handle buggy devices GetConfiguration is
not called unless the device has more than one configuration.
commit fe5d1d2050f715ffa8cbd35a378ac969a1a01584
Author: Xiaofan Chen
Date: Fri Jul 30 15:56:43 2010 +0100
Fix inconsistencies between prototypes and definitions
This removes some warnings on cygwin regarding a name clash against
the standard library "index" function.
commit 3b538c43e11b805a37d93b6283d270d5d5f0d1f5
Author: Hoi-Ho Chan
Date: Tue Jul 27 21:04:17 2010 -0600
Darwin: handle kIOReturnUnderrun
This return code indicates that the device returned a data packet
less than the max packet size. In libusb backend terms, this is
a successful transfer.
commit 9a4249f8a104b98a15a7e3ba7ecae9a385ed9027
Author: Pete Batard
Date: Sat Jul 10 17:51:13 2010 -0600
Add Windows support
Via Cygwin/MinGW, libusb now has windows support.
Thanks to contributors: Michael Plante, Orin Eman, Peter Stuge,
Stephan Meyer, Xiaofan Chen.
commit d38dd5e3d2a872f7064eea084ddea8c33811dd7d
Author: Hoi-Ho Chan
Date: Sat Jul 24 13:48:00 2010 -0600
Darwin: write iso transfer details into correct packets
commit fbff5b4b665ff2ebc948162617cf7f4f5d2fabeb
Author: Nathan Hjelm
Date: Sat Jul 24 13:42:57 2010 -0600
Darwin: fix interface object leak
commit dffc09835d6860ae9b6a62c39af5be346188cb05
Author: Nathan Hjelm
Date: Sat Jul 24 13:41:03 2010 -0600
Darwin: clean up some debug messages
commit 946d1abbca397b8e88a1b0b4df176dcc5e3b7348
Author: Nathan Hjelm
Date: Sat Jul 24 13:39:16 2010 -0600
Darwin: Don't open devices during scan unless we have to unsuspend
commit 3b6d9ac82e2599cad7817d21e909a42275ddc4c4
Author: Peter Stuge
Date: Fri Jun 25 08:08:13 2010 +0200
Linux: Handle early complete of multi-URB transfer
commit a516fcb99376686d2d0028e5ac69950c57a55b9e
Author: Daniel Drake
Date: Wed Jul 21 17:49:21 2010 -0600
Only compile dpfp examples when sigaction is available
It's not available on MinGW.
commit a1d831ef82e1700f4ebb9df6ca5cef74be757c08
Author: Aurelien Jarno
Date: Tue May 25 09:32:19 2010 +0200
configure.ac: fix bashisms
commit 7211aba6e290f9805e911959b2a43a4b3ec56d4f
Author: Daniel Drake
Date: Fri Jun 25 12:01:58 2010 -0500
Only include sys/time.h on appropriate platforms
This header doesn't exist on windows.
For libusb, determine at configure-time if the header is available.
For libusb.h, use gcc predefined macros to only include the header
on platforms that need it.
commit b33c3cb9651459de1f3d549677cbac67a017a295
Author: Daniel Drake
Date: Tue Jun 22 18:45:38 2010 -0500
Linux: Fix log message commit
Forgot to test this.
commit 139648d5723190734a51c1c66ddf41c3e87adf10
Author: Ludovic Rousseau
Date: Mon Jun 21 10:19:29 2010 +0200
Only initialize the default context when it is requested
commit 22d61cd0891d8304dfc1a70579cf154fd8e6644a
Author: Daniel Drake
Date: Tue Jun 22 18:20:23 2010 -0500
Linux: fix log message that was being unconditionally sent to stderr (#44)
This message was put in place to aid libusb-compat-0.1 users, who
may run into the change that libusb-0.1 allowed you to usb_open() a
device that you don't have write access to, but libusb-1.0 does not.
As explained on the ticket this change is dangerous so it should go through
the usual logging mechanism. I also added a similar regular log message
to libusb-compat-0.1.
commit 82065a2c5e9d5ad0b2bb28792d12462f2fa150f0
Author: Ludovic Rousseau
Date: Thu Jun 10 18:41:27 2010 +0200
Fix 2 documentation typos
commit 351c062aacdde0b0fa7972ee9b7c6b355dcee110
Author: Ludovic Rousseau
Date: Wed Apr 21 16:49:33 2010 +0200
add AM_MAINTAINER_MODE
commit a7c056c14867e1cc3ef83682f2706cdbdca7c4ce
Author: Pete Batard
Date: Thu Jun 10 17:00:25 2010 -0500
Factorize event handler interruption code
This will be additionally used by the windows backend which modifies
the fd set frequently.
commit fc0af8e3f76925ad09e0fbc6d233d500753ee375
Author: Pete Batard
Date: Sat Jun 5 12:14:19 2010 -0500
Abstract low-level event handler operations
The Windows backend uses something other than UNIX file descriptors
for event handling. Abstract out the operations to allow for this.
commit 64383fb5b55a74b706967836e81cef61e57df86a
Author: Pete Batard
Date: Tue Jun 1 11:38:14 2010 +0100
fixes the possibility of using a broken timercmp on Windows
Microsoft's implementation of timercmp does not work for >= or <=.
commit f6d60a9a8fcf06629812da886e3a5de592624b61
Author: Pete Batard
Date: Mon Feb 1 19:26:13 2010 +0000
Switched to standard int pointer type for windows 64-bit compat
On 64-bit Windows a pointer is 64 bit, but long is still 32 bit for
backwards compatibility.
uintptr_t nicely hides this difference and also works on Linux.
[dsd: add appropriate include]
commit a2fa855ce3795e31905b255267874af0603168bc
Author: Michael Plante
Date: Tue Mar 9 16:39:46 2010 -0600
added doxygen, dpfp, msvc, and xusb stuff to gitignore
commit 845d96a9c30b6f053208ed6b5b5d4ad1655e2026
Author: Daniel Drake
Date: Mon May 31 19:56:34 2010 -0500
Add reference counting to default context
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.
commit 0e77f017fd3d1bdec4aced0429a380d3e434081b
Author: Daniel Drake
Date: Thu May 27 19:24:49 2010 -0400
Fix libusb_init() error handling
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.
commit b03de9d07bf9a6b0c4e6cba9ec06b5271a22e621
Author: Michael Plante
Date: Mon May 24 11:57:10 2010 -0300
Modify log functions to compile with MSVC6
MSVC6 does not support variadics.
commit aa77b02da65afb0332b9e6853dae9e4dcda00bfa
Author: Pete Batard
Date: Sun Feb 14 19:46:05 2010 -0600
Add type parameter to the list_for_each_entry() and _safe() macros
typeof() is a GCC extension, not supported by target compilers such
as MSVC.
commit b92b16f437079208c8dfb1dc2380893846a07ee9
Author: Daniel Drake
Date: Wed May 19 17:37:29 2010 -0300
Fix a usbi_pollfd leak in error path
I accidently missed this when applying Pete Batard's earlier patch.
Pointed out by Michael Plante.
commit 8aceb5c99056aaed6e6f2db1b303817e37e9fe8c
Author: Pete Batard
Date: Sun Feb 14 19:47:30 2010 -0600
Rename all interface parameters to usb_interface or interface_number
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
commit d7031ee8e1c449af23b2674fe18d9fc652c9bd80
Author: Pete Batard
Date: Mon May 17 19:30:27 2010 -0300
Stricter types and casts
commit 9996ccaed740f8fcec4287a478ccaaa573f9865a
Author: Pete Batard
Date: Mon May 17 19:16:54 2010 -0300
Fixes to error handling and exit codepaths
Various locks and things were being leaked/left open when handling
errors and during deinitialization.
[dsd: small tweaks]
commit 371ca4e440894bd1c845971418aa24c9d3919e63
Author: Nathan Hjelm
Date: Thu May 13 19:38:05 2010 -0300
Darwin: Define IO_OBJECT_NULL if not already defined
Needed on Mac OSX 10.3
commit 7ba92cff94bbba19284749c614c26141d3023f37
Author: Hans Ulrich Niedermann
Date: Fri Jan 29 12:08:52 2010 +0100
libusb_cpu_to_le16: macro->static inline function
The libusb_cpu_to_le16 macro was a ({ ... }) expression, which
generates the following compiler warning every time it is used,
(and that is several times for every #include ):
libusb.h:880: warning: ISO C forbids braced-groups within expressions
With this patch, #include stops generating compiler
warnings on gcc 4.4.
As libusb.h heavily relies on the use of static inline functions
those can be relied on to work properly, and there should not be
any significant difference in the code the compiler generates.
commit 3473ac6c6fab32202d02d87679ebdb24e7d2df98
Author: Francesco
Date: Tue Mar 9 16:35:35 2010 -0600
Add libusb_strerror() to get short error message in English from enum
[dsd: small tweaks]
commit 5b69f3b7b0610d5f518954792ddc93332a41d292
Author: Michael Plante
Date: Thu Feb 25 19:39:22 2010 -0600
Fix libusb_device::lock memory leak
commit a636df4ca1b87ed3094a87828c022092a80ba613
Author: Pete Batard
Date: Wed May 12 21:46:31 2010 -0300
Whitespace cleanup
commit 23b5db8b3e353176dfa0635bfb6f0e2658f6e3de
Author: Peter Stuge
Date: Tue May 11 00:51:43 2010 +0100
Add internal abstraction for POSIX Threads
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]
commit a04cbb0095a78aeed3f65aaf06c46069d0ac184a
Author: Daniel Drake
Date: Tue May 4 19:01:59 2010 -0300
v1.0.8 release
commit 53b47299531974fa8901b74a163f3c8ebae4eec9
Author: Daniel Drake
Date: Thu Apr 22 18:12:51 2010 -0300
Linux: don't set SHORT_NOT_OK on bulk out URBs (#20
Setting this flag is illegal, and the behaviour we're looking for
is already in place for host-to-device transfers without this flag.
commit 1519828b7ee1fce46d4c51fc097d52e01b8e0bb4
Author: Daniel Drake
Date: Tue Apr 20 20:14:09 2010 -0300
Linux: Handle failure to read active configuration during enumeration
commit 45168627cc15aee3875192f34286110dbbd27095
Author: Nathan Hjelm
Date: Tue Apr 20 19:43:06 2010 -0300
Darwin: don't reuse cached descriptors during enumeration
Descriptor reuse was causing scans to return invalid information when
the device at a location has changed.
commit 3af329db6dcbfb96d24867c757f9e125e5b7b0e5
Author: Daniel Drake
Date: Mon Apr 19 19:36:55 2010 -0300
v1.0.7 release
commit ceb8cacd6d2a4189de0db2ee46d45217511c69be
Author: Daniel Drake
Date: Mon Apr 19 19:31:12 2010 -0300
Document that fd set contents are an internal implementation detail (#36)
commit 9bea500b5747bdeba7c8251d45608558e71a1db5
Author: Martin Koegler
Date: Mon Apr 19 19:22:46 2010 -0300
Linux: correct config descriptor endianness fix
The seek_to_next_config codepath deals with both sysfs and usbfs;
make sure we only convert values in the usbfs path.
commit 02df59a309e813c50b8230de99e69fb4e1814279
Author: Martin Koegler
Date: Mon Apr 5 17:11:32 2010 +0200
Linux: Fix endianness handling of usbfs config descriptors (#27)
driver/usb/core/devio.c function usbdev_read translate the follwing files
to CPU endianess:
le16_to_cpus(&temp_desc.bcdUSB);
le16_to_cpus(&temp_desc.idVendor);
le16_to_cpus(&temp_desc.idProduct);
le16_to_cpus(&temp_desc.bcdDevice);
All other data is passed without any change.
libusb/os/linux_usbfs.c calls usbi_parse_descriptor with host_endian=1
for config descriptors. According to the kernel code, they must be
processed with host_endian=0, as they are not translated by the kernel.
Signed-off-by: Martin Koegler
commit ec303b01a5d4e51c000a283853af65059fa62285
Author: Nathan Hjelm
Date: Tue Mar 23 16:22:08 2010 -0600
Darwin: fix enumeration of devices with non-consecutive addresses (#23)
commit cd809e2f7cee3874b7ae16b2c482a8b63a90e4a5
Author: Bastien Nocera
Date: Mon Mar 8 10:50:51 2010 +0000
Add more interface classes
As used in bluez.
commit 1ce4aa67d849f5cad8a21072dc1c7b42158ce817
Author: Nathan Hjelm
Date: Thu Mar 18 11:32:32 2010 -0600
Darwin: Cleanup async callback code, catch request timeouts
commit 68af9f8d731f700267335941a8214d34ab518cc8
Author: Nathan Hjelm
Date: Thu Mar 18 11:31:46 2010 -0600
Darwin: fix endianness of control setup packet
IOUSBLib expects the control request to be in host byte order.
Swap the request into host byte order.
commit cfce4d127184f4e4f334976151a0f80594bb5e22
Author: Nathan Hjelm
Date: Mon Feb 15 14:10:08 2010 -0600
Darwin: fix memory leak in process_device
Credit to Mike Colagrosso for finding this bug.
commit 161893cfbefefe315f657677705abe090fc526f2
Author: Nathan Hjelm
Date: Mon Feb 15 14:09:19 2010 -0600
Darwin: use logging functions
Use usbi_warn, usbi_err, and usbi_info instead of _usbi_log.
commit 2a72f38548208044dc3aa62681419d006c35732d
Author: Nathan Hjelm
Date: Mon Feb 15 14:07:44 2010 -0600
Darwin: support multiple calls to libusb_init
Credit to Orin Eman for finding this bug.
commit a4186794d87124503db2f5f51f51ce90bb95daa7
Author: Daniel Drake
Date: Sun Nov 22 17:20:53 2009 +0000
v1.0.6 release
commit 8392ff22136fccaf1e15d186157609b8dd127bc5
Author: Ludovic Rousseau
Date: Sun Oct 25 10:06:41 2009 +0100
lsusb example: make print_devs() static
lsusb.c:26: warning: no previous prototype for ‘print_devs’
commit 9cc6bfaa15239bb6db1c1570b9beb6df2f848951
Author: Ludovic Rousseau
Date: Sun Oct 25 10:05:10 2009 +0100
Darwin: fix warning in darwin_error_str()
os/darwin_usb.c:63: warning: return discards qualifiers from pointer
target type
commit 4c706d2fb6b2c43b10d72ac5dff51cac4d939f1a
Author: Nathan Hjelm
Date: Sat Nov 21 17:06:43 2009 +0000
Darwin: allow devices to be opened multiple times
Allows libusb applications to access multiple interfaces of the same
device in the same application.
Also fixes a set alt interface bug.
commit 0232fc559cdacb9561f982dd6d28feb4435b3e4e
Author: Daniel Drake
Date: Sat Nov 21 17:01:32 2009 +0000
Increase libusb_handle_events() timeout to 60 seconds
The internal timing seems to be working, this will be a better test of
it before we make this timeout unlimited.
commit 0bd7ef5d8697973a026c36c15d6276177b4ec4ea
Author: Daniel Drake
Date: Sat Nov 21 16:57:25 2009 +0000
Refine timerfd header check (#18)
Require glibc-2.9 for the working timerfd support.
commit 90d8fcab9018b8e6887a7e0592d1e5f692117234
Author: Daniel Drake
Date: Sun Nov 15 12:17:13 2009 +0000
v1.0.5 release
commit 11d591058e3f105b0e90c23bbf58b18de691e690
Author: Daniel Drake
Date: Sat Nov 7 10:43:59 2009 +0000
Update documentation about early completion caveats
commit f796c9528a71aa55326b6f0c9c7c5ec073d2bf92
Author: Ludovic Rousseau
Date: Sun Oct 25 09:59:51 2009 +0100
Add libusb_get_max_iso_packet_size() to libusb.h
core.c:777: warning: no previous prototype for 'libusb_get_max_iso_packet_size'
commit 4783008b7e711de9cb31631e60dda995f44068de
Author: Daniel Drake
Date: Wed Oct 28 20:33:49 2009 +0545
Use timerfd for timeout handling
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.
commit 9b120c2b3735566533c179aa8ca758fe45899a38
Author: Daniel Drake
Date: Sat Nov 7 10:03:07 2009 +0000
Use AM_SILENT_RULES for building
commit ef6ea6c3ae38e4524f10e16e8cb88177d39c4826
Author: Daniel Drake
Date: Fri Nov 6 21:54:08 2009 +0000
v1.0.4 release
commit 217f57617e0cff0d1bd6d726b243f04c6b179773
Author: David Moore
Date: Fri Nov 6 21:37:25 2009 +0000
Linux: Add support for the new URB_BULK_CONTINUATION flag
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]
commit 69830057547396f893f0d7b3125a05d016313b10
Author: Daniel Drake
Date: Wed Oct 28 15:13:22 2009 +0545
Transfer locking
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.
commit 98f1b30d24359cb3185051b8df9ebb663cc10369
Author: Daniel Drake
Date: Mon Sep 14 08:01:24 2009 +0100
Clarify that timeout 0 means unlimited timeout
commit 858684f0dd25921e09565034a88709dbf6f6c61b
Author: Daniel Drake
Date: Fri Sep 11 22:09:12 2009 +0100
Linux: more flexibility with monotonic clock
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.
commit fe0d8dce1ed704915d501e7da700440c78144211
Author: Nathan Hjelm
Date: Fri Sep 11 18:00:29 2009 +0100
Darwin: handle overflows
commit f46716f42040986203fa6e873bfdabe1be2900ec
Author: Daniel Drake
Date: Thu Aug 27 21:14:54 2009 +0545
v1.0.3 release
commit 5b489b8b2a5aba7b8b804e5af6d2628735548238
Author: Toby Peterson
Date: Sun Aug 23 10:04:59 2009 +0545
Darwin: 64-bit type fixes
commit ad8ae04d0b52009af0b1180e005f7554d2bbb26c
Author: Nathan Hjelm
Date: Sun Aug 23 10:02:55 2009 +0545
Darwin: fix crash when reading descriptors after close
Fix a crash which occurs if the user does the following sequence on a
device: open, close, get_configuration_descriptor.
commit 45ae2aecf5512dcff059b2a416534e81c6a00c88
Author: Daniel Drake
Date: Sat Aug 1 13:55:15 2009 +0545
move bug info to bug tracker
Protection needed: http://www.libusb.org/ticket/4
Losing data: fixed in previous commit
commit 126129e174062c2a27423817a459e5113f777789
Author: Daniel Drake
Date: Thu Jul 9 22:09:04 2009 +0100
Linux: try harder not to lose any data
We would previously lose any data that was present on a cancelled URB.
Work harder to make sure this doesn't happen.
commit 0334ee642b47dfe1ca9db64b22e7702ea14b3f09
Author: Daniel Drake
Date: Sun Jun 28 19:49:10 2009 +0100
Add libusb_get_max_iso_packet_size()
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.
commit 615f18e64e96ae4ecc8e43d0de00933059a5209a
Author: Daniel Drake
Date: Sat Jun 20 22:33:21 2009 +0100
Linux: fix sending of zero length bulk packets
Note that there are is a kernel bug preventing this from working
properly at the moment, even after this fix.
commit 86f79fbf61c2018bdf009c7ebf92b38f3a16fd0c
Author: Nathan Hjelm
Date: Fri Jun 19 22:18:44 2009 +0100
Darwin: Don't cancel transfers on timeout
...because the OS does this for us.
commit d4bd9ed4de19a9c766f7a23eea8c852cdd61c18f
Author: Daniel Drake
Date: Sun Jun 14 19:23:21 2009 +0100
Don't terminate enums with commas
g++ -pedantic doesn't like this
Reported by Eberhard Mattes
commit 8be256082eb9bd8e243d89529f742926bb29a21b
Author: Daniel Drake
Date: Sat Jun 13 17:19:07 2009 +0100
v1.0.2 release
commit 060e006e663fd59c281be29b71eb197e02b210e8
Author: Daniel Drake
Date: Wed Jun 10 21:42:05 2009 +0100
Linux: fix config descriptor parsing on big-endian systems
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.
commit c4a905022f684da9a4a853eb9232a81a53df2652
Author: Nathan Hjelm
Date: Sun Jun 7 22:29:35 2009 +0100
Darwin: improve handling of disconnected devices
commit 6b69f54451762ef590b9c938ab000c07cf9099a3
Author: Nathan Hjelm
Date: Sun Jun 7 22:26:37 2009 +0100
Darwin: fix parsing of config descriptors
This was a confusion between configuration numbers and zero-based
configuration indexes.
commit 2b3a9ffa776b383cb2dbc3c55e490e32e4c3c22b
Author: Daniel Drake
Date: Sun Jun 7 22:19:53 2009 +0100
Eliminate -Wsign-compare compiler warnings
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.
commit cad5cb55c37137e94e35c74fdabfe42a5cbd229b
Author: David Moore
Date: Wed May 27 23:15:54 2009 -0700
Make synchronous transfer APIs robust against signal interruption
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
commit b501795985a23109f176d296e7b544b4c6354528
Author: Alex Vatchenko
Date: Thu May 28 15:58:50 2009 -0400
pre-gcc-3.4 compatibility
The -fvisibility and -Wno-pointer-sign options are not available on
old GCC versions.
commit 00bb2805e994887f0a754a825c3ce03d22393386
Author: Daniel Drake
Date: Tue May 26 15:53:26 2009 -0400
Fix memory leak in config descriptor parsing
Pointed out by Martin Koegler.
commit 068ff5b8a83fec0a9a91c80535a25b89a9ae64e8
Author: Daniel Drake
Date: Tue May 12 19:20:51 2009 -0400
Update AUTHORS
commit aa24c04e4043e39674b59ff0d302b2365cd0078f
Author: Daniel Drake
Date: Tue May 12 19:03:37 2009 -0400
v1.0.1 release
commit 44767677447fae4267131f99c591b14117486cac
Author: Daniel Drake
Date: Tue May 12 19:01:44 2009 -0400
Add BUGS file
Probably missed a couple of outstanding issues
commit e0365a6f22e0e7f330ac931df031cf6f17f453d1
Author: Nathan Hjelm
Date: Sun Mar 22 21:13:29 2009 -0400
Darwin: get_config_descriptor bugfixes
commit 5fd0e8478240fece646a58a3c6114001a73be99f
Author: Daniel Drake
Date: Wed Feb 25 12:33:33 2009 -0300
Fix compilation of Darwin backend
My fault. Reported by ihryamzik@gmail.com
commit b49f6bf5c910d0fd694ecf165d7927673707bff9
Author: Nathan Hjelm
Date: Mon Feb 16 21:39:29 2009 -0300
Darwin backend
commit d859158581e9a3250f36cdeeb8ea67cda04053bd
Author: Nathan Hjelm
Date: Mon Feb 16 21:30:49 2009 -0300
Make endianness macros endian-independent
Implementation suggested by David Moore. Needed for proper universal
code support on Darwin.
commit 9196f58bdc8b9e967261df39865215faa5d39cfa
Author: Nathan Hjelm
Date: Mon Feb 16 21:25:18 2009 -0300
Abstract clock reading into OS layer
This will differ on Linux and Darwin, at least.
[dsd: minor style tweaks]
commit e91207860cac09b3afaafc4c14221b78d585c59a
Author: Daniel Drake
Date: Mon Feb 16 21:20:28 2009 -0300
Fix endianness in device descriptors
Pointed out by Nathan Hjelm.
commit ccf6d3d2f6acf9b9a1cb5e1f1b03f382ae509b17
Author: Nathan Hjelm
Date: Mon Feb 16 21:13:52 2009 -0300
Only link with librt on Linux
[dsd: tweak configure.ac change]
commit 894539931e4b4bd85708fe98b956049243cd6fb0
Author: Hans Ulrich Niedermann
Date: Mon Jan 26 00:31:48 2009 +0100
API docs: describe libusb_transfer_cb_fn type
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]
commit abe34a2656f8f9f21e53603796c536585e6233ef
Author: Hans Ulrich Niedermann
Date: Sun Jan 25 18:21:59 2009 +0100
Make empty array in struct compatible with C99
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.
commit 620075c7400764d9bb539b5c02065c45c2e8251e
Author: Hans Ulrich Niedermann
Date: Sun Jan 25 18:20:45 2009 +0100
Avoid signedness errors in API docs example code
commit c754ae294cfe96ec4738d6641137c9e6c56330c7
Author: Daniel Drake
Date: Sat Jan 17 00:25:40 2009 +0000
Decrement poll() result when internal pipe has been handled
When we receive data on the internal control pipe, we need to correctly
decrement the number of ready file descriptors before passing on the
remaining work to the OS implementation.
commit b9ca960f2ba271d2b1a58e22b7c70464d69f6c8a
Author: David Moore
Date: Sun Jan 11 21:46:17 2009 -0800
Prevent transfer from being submitted twice or improperly canceled
This ensures that tpriv->urbs and tpriv->iso_urbs are always set to NULL
whenever a transfer is not submitted. In this way, submit_*_transfer()
and cancel_*_transfer() can error check to ensure that the transfer is
in the correct state to be either submitted or canceled, preventing
potential memory leaks or double frees.
Signed-off-by: David Moore
commit d2a8ec2da8abcd8f4648ed118da16191011982dd
Author: David Moore
Date: Wed Jan 7 22:31:09 2009 -0800
Linux: Fix race condition in cancel_bulk_transfer()
This fixes a race condition in cancel_bulk_transfer(). In the old
version, awaiting_reap and awaiting_discard are incremented in
cancel_bulk_transfer() and decremented in handle_bulk_completion().
However, since these events may take place in two different threads,
these variables may reach zero before all URBs have been canceled,
triggered spurious callbacks and duplicate frees.
This changes the logic to use a single variable "num_retired" to replace
both awaiting_reap and awaiting_discard. num_retired is incremented
only in handle_bulk_completion() and thus there is no race. The handler
will know that all URBs have been canceled when num_retired becomes
equal to num_urbs.
This change also simplifies a great deal of the logic in both functions
and is a net reduction in the amount of code.
Note that some variables such as "reap_action" probably need to still be
protected by a mutex, and this patch does not address that issue.
Signed-off-by: David Moore
commit 34b9eebe35d8167d43cffb6ad6175f6b2251b572
Author: Daniel Drake
Date: Sat Dec 13 20:06:49 2008 +0000
v1.0.0 release
It's here!
commit b1d636dde418dc8fe6a8f037dea0d800e57c6b94
Author: Mikhail Gusarov
Date: Wed Dec 10 15:24:05 2008 +0600
EOL-whitespace fixes
Signed-off-by: Mikhail Gusarov