summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libusb-1.0.9-rc31.0.9-rc3Peter Stuge2011-09-221-2/+2
|
* descriptor.c: Use size_t for minor 64 bit compliance improvementSean McBride2011-09-221-2/+2
| | | | Fixes #121.
* Darwin: Fix warnings about mismatched signed/unsigned compareSean McBride2011-09-221-2/+3
| | | | References #121.
* Fix unused variable warnings when without timerfd and/or when on DarwinSean McBride2011-09-222-0/+8
| | | | References #121.
* Correctly handle LIBUSB_TRANSFER_OVERFLOW in libusb_control_transfer()Ludovic Rousseau2011-09-221-0/+3
| | | | | | | | sync.c: In function `libusb_control_transfer': sync.c:122: warning: enumeration value `LIBUSB_TRANSFER_OVERFLOW' not handled in switch Fixes #120.
* Windows: do not set altsetting 0 as part of libusb_release_interface()Pete Batard2011-09-221-1/+0
| | | | | | * pointed out by Travis Robinson and Xiaofan Chen * similar to a change advised by Alan Stern for the Linux kernel: http://marc.info/?m=122790204410765
* Windows: fix communication with hubsPete Batard2011-09-221-4/+2
| | | | * issue reported by René Haunstrup in http://marc.info/?m=130503019227814
* Windows: add USB 3.0 controller supportPete Batard2011-09-221-7/+15
| | | | | | * Windows 8, NEC/Renesas, TI, Fresco Logic, Etron, VIA, ASMedia (some of which untested!) * includes workaround for NEC/Renesas USB 3.0 root hubs
* Windows: add static keywords and drop duplicated or unneeded codePete Batard2011-09-221-7/+5
|
* Windows: fix 'windows_error_str' defined but not used when not loggingPete Batard2011-09-221-0/+2
|
* libusbi.h: Silence unused context variable warnings when not loggingPeter Stuge2011-09-221-2/+2
|
* Windows: copy DLL file regardless of ddk_build.cmd dll argument casePete Batard2011-09-221-1/+1
|
* Windows: Add uint32_t typedef for old MSC so that DDK can build lsusbPete Batard2011-09-221-0/+1
|
* Darwin: fix port leak in darwin_clock_gettime()Vitali Lovich2011-09-221-2/+16
|
* Darwin: remove unnecessary run loop invalidation during libusb_exit()Vitali Lovich2011-09-221-1/+0
|
* Darwin: fix port leak during libusb_exit()Vitali Lovich2011-09-221-0/+1
|
* Darwin: fix potential leak on libusb_claim_interface() errorVitali Lovich2011-09-221-3/+4
|
* Darwin: Fix #117 transfer size 64/32 bit issue for transfer callbacksNathan Hjelm2011-09-221-2/+4
| | | | The transfer size is now always truncated to 32 bits.
* Remove username from SF FRS rsync upload commandPeter Stuge2011-09-221-1/+1
|
* Support release candidate versions in configure.ac and libusb-1.0.rcPeter Stuge2011-09-223-3/+11
|
* Tidy .gitignore a littlePeter Stuge2011-09-221-4/+1
| | | | | 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.
* Docs: Clarify that libusb_handle_events_timeout() tv param can't be NULLHans de Goede2011-09-221-9/+9
| | | | | | | | | | | 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 <hdegoede@redhat.com>
* Makefile.am: Do not remove ChangeLog on make distclean, fixes #116Peter Stuge2011-09-221-1/+2
| | | | [pbatard: Remove it on make maintainer-clean instead]
* Darwin: Reduce race likelihood between cancellation and device disconnectVitali Lovich2011-09-221-0/+7
| | | | | References #88. The race condition still remains, but this change makes it less likely to trigger.
* Document that libusb_get_device_list() can return any libusb_error codePeter Stuge2011-09-221-2/+2
| | | | Fixes #87.
* Linux: Fix #81 URB double free race condition on device disconnectPete Batard2011-09-221-2/+9
| | | | | | | | | | | | | | | | | 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]
* Add libusb_error_name() API functionPeter Stuge2011-09-223-0/+52
| | | | | | | | | Until we have i18ned error messages we can at least offer easy translation from numeric error code to the error code's name. [hansg: switch() on enum to get a compiler warning if a case is missing] [hansg: Better return value when called with an unknown error code] [hansg: Fix DEFAULT_VISIBILITY in definition to compile on all platforms]
* Add libusb_has_capability() API functionPeter Stuge2011-09-223-0/+30
| | | | | | | | | | 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.
* Fix typos in introductory documentationSebastian Pipping2011-09-221-2/+2
|
* Linux: Add libusb_open() debug and error messages with the device pathPekka Nikander2011-09-221-0/+3
| | | | Fixes #109.
* Add debug message with libusb_open() error codePekka Nikander2011-09-221-0/+1
| | | | References #109.
* Document libusb_handle_events_completed() and _timeout_completed()Hans de Goede2011-09-221-6/+89
| | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> [stuge: Note that the old racy functions should be avoided by new code]
* Fix #56 race condition causing delayed completion of sync transfersGraeme Gill2011-09-224-9/+39
| | | | | | | | | | | | | | | | | | | | | | | 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 <hdegoede@redhat.com> [stuge: Simplify libusb_handle_events_timeout() change with a goto] [pbatard: Fix _handle_events_timeout() and _completed() definitions]
* Darwin: Use a condition to signal async thread ready in libusb_init()Nathan Hjelm2011-09-221-4/+16
|
* Fix #64 use of reserved identifiers throughout libusbNathan Hjelm2011-09-2213-206/+206
|
* Darwin: fix libusb_get_device_list() and libusb_claim_interface() leaksNathan Hjelm2011-09-221-4/+5
|
* Darwin: use kIOMasterPortDefault instead of creating a master portNathan Hjelm2011-09-221-19/+2
|
* Allow devices with zero configurations to be discoveredPeter Stuge2011-09-151-4/+2
| | | | | | | | | | | | | At least in Linux, wireless USB devices have zero configurations until they have been authorized. This device state can be set for any USB device using: echo 0 > /sys/bus/usb/devices/?-?/authorized An unauthorized device would previously make usbi_sanitize_device() return LIBUSB_ERROR_IO, although there really was no I/O error. Reported-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Linux: Continue enumeration even if one device returns an errorPeter Stuge2011-09-151-15/+21
|
* Linux: Handle single- and two-digit kernel versions like 3.0 and 4Hans de Goede2011-09-151-13/+21
| | | | | | The code has been tested with various version strings. [stuge: Remove bogus string length check and optimize for newer kernels]
* Windows: Provide libusb_get_device_speed() dataPete Batard2011-09-152-9/+19
| | | | | | | | | * 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]
* Darwin: Provide libusb_get_device_speed() dataTrygve Laugstøl2011-09-151-0/+11
| | | | References #45.
* Linux: Provide libusb_get_device_speed() data from sysfsHans de Goede2011-09-151-1/+15
| | | | | | References #45. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Add new API function libusb_get_device_speed()Hans de Goede2011-09-154-0/+36
| | | | | | | | | | | | | | Reworked version of my earlier patch, largely modelled after (if not copy and pasted from) Trygve Laugstøl's <trygvis@inamo.no> similar commit 5a6541e0d80fb1f21e2b960bc2337a612f9d74fb in git://git.libusb.org/libusb-trygvis.git http://git.libusb.org/libusb-trygvis.git http://git.libusb.org/?p=libusb-trygvis.git;a=commitdiff;h=5a6541e0d This patch does not add any OS specific code. The supporting code in each backend follows in separate patches. References #45. Signed-off-By: Hans de Goede <hdegoede@redhat.com>
* Darwin: Improve device enumeration performanceNathan Hjelm2011-09-131-62/+160
| | | | | | | | 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]
* Linux: Use __read_sysfs_attr() to get busnum and devaddrHans de Goede2011-07-241-39/+6
| | | | | | Remove code duplication. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Linux: Add __read_sysfs_attr() helper functionHans de Goede2011-07-241-0/+35
| | | | | | | | 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 <hdegoede@redhat.com>
* Linux: Stop kernel from re-attaching in-kernel driver after resetHans de Goede2011-07-241-5/+35
| | | | | | | | | | | | | | | | | | | 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 <hdegoede@redhat.com>
* Core: Use USB_MAXINTERFACES rather then sizeof(claimed_interfaces)Hans de Goede2011-07-241-3/+3
| | | | | | | | | claimed_interfaces is a long and thus its size differs on 32 versus 64 bits, this patch uses USB_MAXINTERFACES instead of sizeof(claimed_interfaces) on interface number range checks for consistent behavior independent of the arch. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Linux: Fix warnings seen when compiling with gcc-4.6Hans de Goede2011-07-243-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 <hdegoede@redhat.com> [stuge: Add fixes for dpfp examples and update source references]