summaryrefslogtreecommitdiff
path: root/libusb
Commit message (Collapse)AuthorAgeFilesLines
* [internal] bumped internal versionpbr349Pete Batard2012-01-081-1/+1
|
* [darwin] (re)add topology-analysis code to Darwin backendNathan Hjelm2012-01-081-24/+62
| | | | | * this is a restore of previous commit which was reverted when merging with master
* [linux] (re)add topology-analysis code to Linux backendAlan Stern2012-01-081-0/+69
| | | | | * this is a restore of previous commit which was reverted when merging with master
* [internal] bumped internal versionpbr348Pete Batard2012-01-081-1/+1
|
* [misc] align with masterPete Batard2012-01-0821-452/+588
| | | | | * up to "Core: Fix #122 warning: no previous prototype for ‘usbi_log_v’" a8e2e7cab278fbfcba91909eaf762cf66da9eda5
* [USB 3.0] added SuperSpeed speed ID for USB_NODE_CONNECTION_INFORMATION_EXPete Batard2012-01-071-0/+1
| | | | | | * tests condicted 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
* [revert] "[core] is_device_interface_accessible() prototype"Pete Batard2012-01-074-70/+0
| | | | This reverts commit 200fe7158aa6dda2940c6b6b7d4702a9173130a9.
* [core] amended previous commit and added libusb_strerror supportPete Batard2011-11-182-2/+11
| | | | * typo fixes and race condition warning suggested by Alan Stern
* [core] is_device_interface_accessible() prototypePete Batard2011-11-174-0/+61
| | | | * also introduces 3 new driver related error codes
* [msvc] fix additional MSVC6 errors and warningsPete Batard2011-11-152-2/+2
| | | | | | * error C2065: 'LONG_PTR' : undeclared identifier; in poll_windows * warning C4761: integral size mismatch in argument; in libusb.h * issue reported by Satz Klauer
* [internal] bumped internal versionpbr347Pete Batard2011-11-131-1/+1
| | | | * also added -j2 to _bm.sh
* [msvc] fix for MSVC6 preprocessor not accepting blank parametersPete Batard2011-11-131-23/+25
| | | | | | | * unlike later iterations of Visual Studio, MSVC6 does not accept blank parameters on macro calls [eg. CALL(a, ,b)] * blank params were used with the DLL_DECLARE and DLL_LOAD macros * issue reported by Satz Klauer
* [internal] bumped internal versionpbr346Pete Batard2011-11-021-1/+1
|
* [windows] fix Clang warnings about unused assignationsPete Batard2011-11-021-2/+1
|
* [windows] memory allocation improvementsPete Batard2011-11-023-18/+19
| | | | | | * add missing warning on alloc failure * prefer calloc() to malloc() * add casts to address VS2010 IntelliSense warnings
* [internal] bumped internal versionpbr345Pete Batard2011-09-231-1/+1
|
* [autotools] improves "cleaner windres step"Peter Stuge2011-09-231-2/+5
| | | | * reverts 3209815810a7e1deb6cb961a4dac01b9cfb64d7d
* [logging] improve "remove warnings when logging is disabled for MinGW/cygwin"Peter Stuge2011-09-232-44/+10
| | | | * reverts 52925893448df74e895d756c3280af15494d4166
* [darwin] add topology-analysis code to OS X backendNathan Hjelm2011-09-231-24/+62
|
* [enum] fix bad realloc trigger for the unref_list arrayDave Camarillo2011-09-231-1/+1
| | | | | * indexes were outgrowing the array before realloc, resulting in out of bound access and crash.
* [internal] bumped internal versionpbr344Pete Batard2011-09-191-1/+1
|
* [USB 3.0] added native Windows 8 supportPete Batard2011-09-191-1/+1
|
* [misc] align with 1.0.9-rc1Pete Batard2011-09-191-11/+11
|
* [internal] bumped internal versionpbr343Pete Batard2011-09-121-1/+1
|
* [logging] remove warnings when logging is disabled for MinGW/cygwinPete Batard2011-09-121-9/+45
| | | | * also trailing whitespaces and formatting
* [MinGW] fix that annoying timercmp warning in io.cPete Batard2011-09-121-2/+6
| | | | * MinGW was issuing a "suggest parenthesis" warning with timercmp
* [autotools] cleaner windres stepPete Batard2011-09-121-1/+2
|
* [internal] bumped internal versionpbr342Pete Batard2011-09-061-1/+1
|
* [contrib] add non-officially supported CMake supportVitali Lovich2011-09-065-0/+346
|
* add missing LIBUSB_CLASS codesPeter Stuge2011-09-061-4/+23
|
* get_device_speed fixes and addonsPete Batard2011-09-063-4/+15
| | | | | | * fixed typos and missing breaks * device_speed in .def * device_speed in xusb
* Darwin: Optimize device iteration further using saved device locationNathan Hjelm2011-09-061-4/+28
|
* Darwin: Provide libusb_get_device_speed() dataTrygve Laugstøl2011-09-061-0/+11
|
* Darwin: Improve device enumeration performance and save device locationNathan Hjelm2011-09-061-58/+132
| | | | [stuge: Formatting fixes and split out libusb_get_device_speed() change]
* Windows: Provide libusb_get_device_speed() dataPete Batard2011-09-062-9/+18
| | | | | | * use (currently superspeed unaware) USB_NODE_CONNECTION_INFORMATION_EX [stuge: Explicitly convert OS device speeds to libusb device speeds]
* Linux: Provide libusb_get_device_speed() data from sysfsHans de Goede2011-09-061-1/+15
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Add new API function libusb_get_device_speed()Hans de Goede2011-09-063-0/+33
| | | | | | | | | | | | | | 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. Signed-off-By: Hans de Goede <hdegoede@redhat.com>
* Linux: Use __read_sysfs_attr() to get busnum and devaddrHans de Goede2011-09-061-39/+6
| | | | | | Remove code duplication. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Linux: Add __read_sysfs_attr() helper functionHans de Goede2011-09-061-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-09-061-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-09-061-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-09-061-0/+4
| | | | | | | | | | | | | | | | | | | 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]
* Darwin: Fix #100 warning cast to pointer from integer of different sizeSean McBride2011-09-061-4/+3
|
* Darwin: Fix #63 error when apps use Objective-C garbage collectionSean McBride2011-09-061-1/+14
|
* Darwin: Fix #28 clang analyzer warning about unbalanced retain/releaseSean McBride2011-09-061-2/+4
|
* io.c: Fix clang analyzer warning about unused variableSean McBride2011-09-061-0/+2
| | | | References #28.
* Do not include useless pthread.hLudovic Rousseau2011-09-051-1/+0
| | | | | The code does not use threads so no need to #include <pthread.h> Fixes #74.
* Fix #70 race condition in sysfs_get_device_list()Alan Ott2011-09-051-48/+95
| | | | | | | | | | | | | | | | | | | | | | | | 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 <alan@signal11.us> [stuge: Include closedir() bugfix posted in ticket by Arne Laansoo] [stuge: Remove dead code in sysfs_scan_device() found by Hans de Goede]
* Darwin: Fix #108 crash when a device is unpluggedVitali Lovich2011-09-051-2/+12
|
* descriptor.c: Fix buffer read overflow caught by valgrindVitali Lovich2011-09-051-5/+7
| | | | | | | | 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.