| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Closes #1167
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new initialization function addresses some shortcomings of the
libusb_set_option() interface. Namely, it allows setting the
no-enumeration option (and others) on only the contexts where it is
requested. The old initialization function (libusb_init()) is deprecated
and will be removed in a future release. For now it translates to a call
to libusb_init_context() with no options specified.
Closes #1026
Signed-off-by: Nathan Hjelm <hjelmn@google.com>
[Tormod: Doxygen description of libusb_init_option structure]
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Also add BOS platform descriptor dump to xusb example.
Closes #1133
[Tormod: Fixed copy-pasto in Doxygen comment]
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Types:
struct libusb_interface_association_descriptor
struct libusb_interface_association_descriptor_array
Accessor / cleanup functions:
libusb_get_interface_association_descriptors
libusb_get_active_interface_association_descriptors
libusb_free_interface_association_descriptors
Signed-off-by: Ryan Metcalfe <ryan.metcalfe@novanta.com>
[Tormod: Fixed Doxygen comment]
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
libusb_set_option uses variable arguments and therefore cannot use
__stdcall.
In practice, this does not get exported anyway. Verified under MinGW's
objdump tool with 32 and 64-bit combinations.
Closes #1197
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
|
|
|
|
|
|
| |
Since libusb_set_option() is variadic, there is no symbol
for it with @ appended in the DLL, and the automatic
generation of libusb-1.0.def misses it.
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Updated by running the following on a libusb-1.0 DLL generated by MinGW32:
echo -e "LIBRARY \"libusb-1.0.dll\"\nEXPORTS" > libusb-1.0.def
strings libusb-1.0.dll | grep ^libusb | grep @ | LC_ALL=C sort | uniq | \
sed -e "s/\(.*\)@\([0-9]*\)/ \1\n \1@\2 = \1/" | LC_ALL=C sort >> libusb-1.0.def
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes issue #944 C++ symbol for libusb_set_option not exported correctly.
As per the report in issue #944, original commit is correct but subsequent edits cause the regression.
https://github.com/libusb/libusb/blob/v1.0.22-rc1/libusb/libusb-1.0.def#L156
Closes #964
Signed-off-by: Xiaofan Chen xiaofanc@gmail.com
Signed-off-by: Nathan Hjelm <hjelmn@google.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Closes #380
[dickens] Fixed up API version in doxygen, whitespace issues, function
visibility annotation (can't use API_EXPORTED for pointer values) and
added new function to libusb-1.0.defs
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
| |
messages to the provided log handling function
Closes #486
Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
|
|
|
|
|
|
|
|
|
|
|
| |
For simplicity and to address some build warnings, this commit reworks
the project files to eliminate duplication and consolidate common build
flags and options. Also adds the stress and testlibusb projects to the
DDK build script.
Closes #402
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This new function allows more flexibility in extending the library to
support more user-configurable options. It is intended to provide a
single API that can support a wide variety of needs and eliminates the
need for new API functions to set future options.
The function is introduced with a single option (LIBUSB_OPTION_LOG_LEVEL)
that replaces the libusb_set_debug() function. Documentation relating to
libusb_set_debug() and the uses of this function in the examples and
tests have been updated accordingly.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a function to allocate memory belonging to a specific device,
so that the operating system can DMA straight into it for zerocopy,
and also avoid some clearing. Also, this allows up-front memory
allocation in the kernel at program startup; memory allocation is
otherwise done per-transfer, which can fail in a system where memory has become
fragmented over time).
This mirrors new functionality going into Linux' USB stack (recently
reviewed and acked upstream); only Linux is supported as a backend
currently.
[Chris Dickens] Modified to fix doxygen documentation, correct parameter
naming, reposition function declarations, and address a missing request
during the patch review process.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
| |
This new function will allow the user to purposely interrupt an
event handling thread, causing it to return from the event handling
function. This is mainly useful for cleanly exiting from a dedicated
event handling thread during application shutdown.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
| |
This patch adds a new API call to ensure that the same memory
allocator is used to both allocate and free the list of libusb_pollfd
structures. It is an incorrect assumption that the user's free() will
use the same memory allocator that libusb uses internally.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add auto-detach-kernel-driver functionality, and a
libusb_set_auto_detach_kernel_driver() function.
Note that I went with a libusb_set_auto_detach_kernel_driver() function,
rather then with a libusb_enable_auto_detach_kernel_driver(), so that apps
can also disable it again. This is necessary to handle 2 corner cases:
1) When an app wants to do a libusb_set_configuration after claiming 1 or
more interfaces, it needs to first release the interface(s), and in this
case libusb_release_interface() should *not* (re-)attach the kernel driver
2) Some usb classes use multiple interfaces for one function, ie usb-audio
devices do this. In this case attaching the driver will fail until all
interfaces are released, so the app should first release all interfaces, and
only then (re-)attach the kernel driver.
auto-detach-kernel-driver functionality is still useful for these apps, since
doing libusb_detach_kernel_driver() followed by libusb_claim_interface() in
2 separate calls is inherently racy, but they need to be able to disable the
auto-detach functionality before releasing interfaces to be able to properly
handle the 2 described corner cases.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the much requested libusb_strerror() function, taking into
account all issues people raised wrt previous attempts.
Criteria / Decisions underlying this implementation:
- Must support translated messages
- Must not use gettext as that does not work well in combination with Windows
(when building with Visual C, or for Windows CE)
- API compatible with FreeBSD and various patched libusb-s floating around
- KISS:
- Do not add any (other) library dependencies
- Do not try to deal with message encodings (iconv), simply always return UTF-8
making encoding the problem of the application using libusb_strerror.
- Defaults to English, so apps which don't want translated messages,
don't need to do anything special
- Defaults to English (with pure ASCII messages), so apps which don't
call libusb_setlocale() don't need to worry about encoding
|
|
|
|
|
|
|
| |
Based on earlier work done on this by Maya Erez <merez@codeaurora.org>,
Nathan Hjelm <hjelmn@me.com> and Pete Batard <pete@akeo.ie>.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
| |
Based on earlier work done on this by Maya Erez <merez@codeaurora.org>,
Nathan Hjelm <hjelmn@me.com> and Pete Batard <pete@akeo.ie>.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
| |
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
| |
|
|
|
|
|
|
|
| |
* Even though the library name is optional as specified by Microsoft,
some recent versions of libtool require one in libusb-1.0.def.
* Reference thread in MinGW-w64 mailing list.
http://comments.gmane.org/gmane.comp.gnu.mingw.w64.general/5141
|
|
|
|
|
| |
* Generated from a MinGW32 generated DLL using the command:
echo -e "LIBRARY\nEXPORTS" > libusb-1.0.def; strings libusb-1.0.dll | grep libusb | grep @ | sort | sed -e "s/\(.*\)@\([0-9]*\)/ \1\n \1@\2 = \1/" >> libusb-1.0.def
|
|
|
|
| |
* Also some formatting/typo improvements
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
|
|
|
| |
Since it is currently not planned to change the filename of the libusb
library between libusb-1.0 versions at least on Windows systems it's
important to have a capability API.
Currently there exists only one capability; LIBUSB_CAP_HAS_CAPABILITY,
which tests support for the libusb_has_capability() API.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
* 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.
|