| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
* this is a restore of previous commit which was reverted
when merging with master
|
|
|
|
|
| |
* this is a restore of previous commit which was reverted
when merging with master
|
| |
|
|
|
|
|
| |
* up to "Core: Fix #122 warning: no previous prototype for ‘usbi_log_v’"
a8e2e7cab278fbfcba91909eaf762cf66da9eda5
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
This reverts commit 200fe7158aa6dda2940c6b6b7d4702a9173130a9.
|
|
|
|
| |
* typo fixes and race condition warning suggested by Alan Stern
|
|
|
|
| |
* also introduces 3 new driver related error codes
|
|
|
|
|
|
| |
* error C2065: 'LONG_PTR' : undeclared identifier; in poll_windows
* warning C4761: integral size mismatch in argument; in libusb.h
* issue reported by Satz Klauer
|
|
|
|
| |
* also added -j2 to _bm.sh
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
|
|
|
|
|
| |
* add missing warning on alloc failure
* prefer calloc() to malloc()
* add casts to address VS2010 IntelliSense warnings
|
| |
|
|
|
|
| |
* reverts 3209815810a7e1deb6cb961a4dac01b9cfb64d7d
|
|
|
|
| |
* reverts 52925893448df74e895d756c3280af15494d4166
|
| |
|
|
|
|
|
| |
* indexes were outgrowing the array before realloc,
resulting in out of bound access and crash.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
* also trailing whitespaces and formatting
|
|
|
|
| |
* MinGW was issuing a "suggest parenthesis" warning with timercmp
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* fixed typos and missing breaks
* device_speed in .def
* device_speed in xusb
|
| |
|
| |
|
|
|
|
| |
[stuge: Formatting fixes and split out libusb_get_device_speed() change]
|
|
|
|
|
|
| |
* use (currently superspeed unaware) USB_NODE_CONNECTION_INFORMATION_EX
[stuge: Explicitly convert OS device speeds to libusb device speeds]
|
|
|
|
| |
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Remove code duplication.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
| |
|
| |
|
| |
|
|
|
|
| |
References #28.
|
|
|
|
|
| |
The code does not use threads so no need to #include <pthread.h>
Fixes #74.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
| |
|
|
|
|
|
|
|
|
| |
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.
|