diff --git a/Externals/libusbx/AUTHORS b/Externals/libusb/AUTHORS similarity index 64% rename from Externals/libusbx/AUTHORS rename to Externals/libusb/AUTHORS index 6c29e218fe..95b116286c 100644 --- a/Externals/libusbx/AUTHORS +++ b/Externals/libusb/AUTHORS @@ -1,23 +1,26 @@ Copyright © 2001 Johannes Erdfelt Copyright © 2007-2009 Daniel Drake Copyright © 2010-2012 Peter Stuge -Copyright © 2008-2011 Nathan Hjelm -Copyright © 2009-2012 Pete Batard -Copyright © 2009-2012 Ludovic Rousseau +Copyright © 2008-2013 Nathan Hjelm +Copyright © 2009-2013 Pete Batard +Copyright © 2009-2013 Ludovic Rousseau Copyright © 2010-2012 Michael Plante -Copyright © 2011-2012 Hans de Goede -Copyright © 2012 Martin Pieuchot +Copyright © 2011-2013 Hans de Goede +Copyright © 2012-2013 Martin Pieuchot Copyright © 2012-2013 Toby Gray Other contributors: Alan Ott Alan Stern Alex Vatchenko +Andrew Fernandes Anthony Clay Artem Egorkine Aurelien Jarno Bastien Nocera +Bei Zhang Benjamin Dobell +Carl Karsten Chris Dickens Colin Walters Dave Camarillo @@ -26,22 +29,36 @@ David Moore Davidlohr Bueso Federico Manzan Felipe Balbi +Florian Albrechtskirchinger Francesco Montorsi +Francisco Facioni Graeme Gill +Gustavo Zacarias Hans Ulrich Niedermann Hector Martin Hoi-Ho Chan Ilya Konstantinov James Hanko +John Sheu +Joshua Blake +Justin Bischoff +Karsten Koenig Konrad Rzepecki +Kuangye Guo +Lars Kanis Lars Wirzenius Luca Longinotti +Markus Heidelberg Martin Koegler Matthias Bolte Mike Frysinger Mikhail Gusarov +Moritz Fischer +Ларионов Даниил Nicholas Corgan +Omri Iluz Orin Eman +Paul Fertser Pekka Nikander Rob Walker Sean McBride @@ -58,3 +75,4 @@ Vitali Lovich Xiaofan Chen Zoltán Kovács Роман Донченко +xantares diff --git a/Externals/libusbx/COPYING b/Externals/libusb/COPYING similarity index 100% rename from Externals/libusbx/COPYING rename to Externals/libusb/COPYING diff --git a/Externals/libusbx/ChangeLog b/Externals/libusb/ChangeLog similarity index 74% rename from Externals/libusbx/ChangeLog rename to Externals/libusb/ChangeLog index a3304a62d9..30a346d4c5 100644 --- a/Externals/libusbx/ChangeLog +++ b/Externals/libusb/ChangeLog @@ -1,5 +1,42 @@ For detailed information about the changes below, please see the git log or -visit: http://log.libusbx.org +visit: http://log.libusb.info + +2014-05-30: v1.0.19 +* Add support for USB bulk streams on Linux and Mac OS X (#11) +* Windows: Add AMD and Intel USB-3.0 root hub support +* Windows: Fix USB 3.0 speed detection on Windows 8 or later (#10) +* Added Russian translation for libusb_strerror strings +* All: Various small fixes and cleanups +The (#xx) numbers are libusb issue numbers, see ie: +https://github.com/libusb/libusb/issues/11 + +2014-01-25: v1.0.18 +* Fix multiple memory leaks +* Fix a crash when HID transfers return no data on Windows +* Ensure all pending events are consumed +* Improve Android and ucLinux support +* Multiple Windows improvements (error logging, VS2013, VIA xHCI support) +* Multiple OS X improvements (broken compilation, SIGFPE, 64bit support) + +2013-09-06: v1.0.17 +* Hotplug callbacks now always get passed a libusb_context, even if it is + the default context. Previously NULL would be passed for the default context, + but since the first context created is the default context, and most apps + use only 1 context, this meant that apps explicitly creating a context would + still get passed NULL +* Android: Add .mk files to build with the Android NDK +* Darwin: Add Xcode project +* Darwin: Fix crash on unplug (#121) +* Linux: Fix hang (deadlock) on libusb_exit +* Linux: Fix libusb build failure with --disable-udev (#124) +* Linux: Fix libusb_get_device_list() hang with --disable-udev (#130) +* OpenBSD: Update OpenBSD backend with support for control transfers to + non-ugen(4) devices and make get_configuration() no longer generate I/O. + Note that using this libusb version on OpenBSD requires using + OpenBSD 5.3-current or later. Users of older OpenBSD versions are advised + to stay with the libusb shipped with OpenBSD (mpi) +* Windows: fix libusb_dll_2010.vcxproj link errors (#129) +* Various other bug fixes and improvements 2013-07-11: v1.0.16 * Add hotplug support for Darwin and Linux (#9) @@ -40,7 +77,7 @@ https://github.com/libusbx/libusbx/issues/9 * Reverts the previous API change with regards to bMaxPower. If this doesn't matter to you, you are encouraged to keep using v1.0.13, as it will use the same attribute as v2.0, to be released soon. -* Note that LIBUSBX_API_VERSION is *decreased* to 0x010000FF and the previous +* Note that LIBUSB_API_VERSION is *decreased* to 0x010000FF and the previous guidelines with regards to concurrent use of MaxPower/bMaxPower still apply. 2012-09-20: v1.0.13 @@ -51,11 +88,11 @@ https://github.com/libusbx/libusbx/issues/9 * Fix broken support for the 0.1 -> 1.0 libusb-compat layer * Fix unwanted cancellation of pending timeouts as well as major timeout related bugs * Fix handling of HID and composite devices on Windows -* Introduce LIBUSBX_API_VERSION macro +* Introduce LIBUSB_API_VERSION macro * Add Cypress FX/FX2 firmware upload sample, based on fxload from http://linux-hotplug.sourceforge.net * Add libusb0 (libusb-win32) and libusbK driver support on Windows. Note that while - the drivers allow it, isochronous transfers are not supported yet in libusbx. Also + the drivers allow it, isochronous transfers are not supported yet in libusb. Also not supported yet is the use of libusb-win32 filter drivers on composite interfaces * Add support for the new get_capabilities ioctl on Linux and avoid unnecessary splitting of bulk transfers @@ -156,18 +193,18 @@ https://github.com/libusbx/libusbx/issues/9 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ APPENDIX A - How to maintain code compatibility with versions of libusb and -libusbx that use MaxPower: +libusb that use MaxPower: If you must to maintain compatibility with versions of the library that aren't using the bMaxPower attribute in struct libusb_config_descriptor, the -recommended way is to use the new LIBUSBX_API_VERSION macro with an #ifdef. +recommended way is to use the new LIBUSB_API_VERSION macro with an #ifdef. For instance, if your code was written as follows: if (dev->config[0].MaxPower < 250) Then you should modify it to have: -#if defined(LIBUSBX_API_VERSION) && (LIBUSBX_API_VERSION >= 0x01000100) +#if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01000100) if (dev->config[0].bMaxPower < 250) #else if (dev->config[0].MaxPower < 250) diff --git a/Externals/libusbx/INSTALL b/Externals/libusb/INSTALL similarity index 100% rename from Externals/libusbx/INSTALL rename to Externals/libusb/INSTALL diff --git a/Externals/libusbx/Makefile.am b/Externals/libusb/Makefile.am similarity index 95% rename from Externals/libusbx/Makefile.am rename to Externals/libusb/Makefile.am index 93ce9414fd..0155625ac1 100644 --- a/Externals/libusbx/Makefile.am +++ b/Externals/libusb/Makefile.am @@ -2,7 +2,8 @@ AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip ACLOCAL_AMFLAGS = -I m4 DISTCLEANFILES = libusb-1.0.pc EXTRA_DIST = TODO PORTING msvc libusb/libusb-1.0.def libusb/version_nano.h \ - examples/getopt/getopt.c examples/getopt/getopt1.c examples/getopt/getopt.h + examples/getopt/getopt.c examples/getopt/getopt1.c examples/getopt/getopt.h \ + android Xcode SUBDIRS = libusb doc if BUILD_EXAMPLES diff --git a/Externals/libusbx/Makefile.in b/Externals/libusb/Makefile.in similarity index 97% rename from Externals/libusbx/Makefile.in rename to Externals/libusb/Makefile.in index 05bfacf0f1..de8f145d57 100644 --- a/Externals/libusbx/Makefile.in +++ b/Externals/libusb/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -84,9 +84,9 @@ subdir = . DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in $(srcdir)/libusb-1.0.pc.in COPYING \ - THANKS TODO compile config.guess config.sub depcomp install-sh \ - missing ltmain.sh + $(srcdir)/config.h.in $(srcdir)/libusb-1.0.pc.in COPYING TODO \ + compile config.guess config.sub depcomp install-sh missing \ + ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -279,6 +279,7 @@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS_DARWIN = @OS_DARWIN@ OS_LINUX = @OS_LINUX@ +OS_NETBSD = @OS_NETBSD@ OS_OPENBSD = @OS_OPENBSD@ OS_WINDOWS = @OS_WINDOWS@ OTOOL = @OTOOL@ @@ -355,7 +356,8 @@ AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip ACLOCAL_AMFLAGS = -I m4 DISTCLEANFILES = libusb-1.0.pc EXTRA_DIST = TODO PORTING msvc libusb/libusb-1.0.def libusb/version_nano.h \ - examples/getopt/getopt.c examples/getopt/getopt1.c examples/getopt/getopt.h + examples/getopt/getopt.c examples/getopt/getopt1.c examples/getopt/getopt.h \ + android Xcode SUBDIRS = libusb doc $(am__append_1) $(am__append_2) pkgconfigdir = $(libdir)/pkgconfig @@ -401,8 +403,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -633,10 +635,16 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -678,9 +686,10 @@ distcheck: dist && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ diff --git a/Externals/libusb/NEWS b/Externals/libusb/NEWS new file mode 100644 index 0000000000..07695abc1e --- /dev/null +++ b/Externals/libusb/NEWS @@ -0,0 +1,2 @@ +For the latest libusb news, please refer to the ChangeLog file, or visit: +http://libusb.info diff --git a/Externals/libusbx/PORTING b/Externals/libusb/PORTING similarity index 75% rename from Externals/libusbx/PORTING rename to Externals/libusb/PORTING index 9185c37f5a..fa9ec1e58d 100644 --- a/Externals/libusbx/PORTING +++ b/Externals/libusb/PORTING @@ -1,15 +1,15 @@ -PORTING LIBUSBX TO OTHER PLATFORMS +PORTING LIBUSB TO OTHER PLATFORMS Introduction ============ -This document is aimed at developers wishing to port libusbx to unsupported -platforms. I believe the libusbx API is OS-independent, so by supporting +This document is aimed at developers wishing to port libusb to unsupported +platforms. I believe the libusb API is OS-independent, so by supporting multiple operating systems we pave the way for cross-platform USB device drivers. Implementation-wise, the basic idea is that you provide an interface to -libusbx's internal "backend" API, which performs the appropriate operations on +libusb's internal "backend" API, which performs the appropriate operations on your target platform. In terms of USB I/O, your backend provides functionality to submit @@ -27,16 +27,16 @@ e.g. setting configuration, obtaining descriptors, etc. File descriptors for I/O polling ================================ -For libusbx to work, your event handling function obviously needs to be called +For libusb to work, your event handling function obviously needs to be called at various points in time. Your backend must provide a set of file descriptors -which libusbx and its users can pass to poll() or select() to determine when +which libusb and its users can pass to poll() or select() to determine when it is time to call the event handling function. On Linux, this is easy: the usbfs kernel interface exposes a file descriptor which can be passed to poll(). If something similar is not true for your platform, you can emulate this using an internal library thread to reap I/O as necessary, and a pipe() with the main library to raise events. The file -descriptor of the pipe can then be provided to libusbx as an event source. +descriptor of the pipe can then be provided to libusb as an event source. Interface semantics and documentation @@ -46,7 +46,7 @@ Documentation of the backend interface can be found in libusbi.h inside the usbi_os_backend structure definition. Your implementations of these functions will need to call various internal -libusbx functions, prefixed with "usbi_". Documentation for these functions +libusb functions, prefixed with "usbi_". Documentation for these functions can be found in the .c files where they are implemented. You probably want to skim over *all* the documentation before starting your @@ -72,18 +72,18 @@ right usbi_backend for your platform. 4. Produce and test your implementation. -5. Send your implementation to libusbx-devel mailing list. +5. Send your implementation to libusb-devel mailing list. Implementation difficulties? Questions? ======================================= -If you encounter difficulties porting libusbx to your platform, please raise -these issues on the libusbx-devel mailing list. Where possible and sensible, I -am interested in solving problems preventing libusbx from operating on other +If you encounter difficulties porting libusb to your platform, please raise +these issues on the libusb-devel mailing list. Where possible and sensible, I +am interested in solving problems preventing libusb from operating on other platforms. -The libusbx-devel mailing list is also a good place to ask questions and +The libusb-devel mailing list is also a good place to ask questions and make suggestions about the internal API. Hopefully we can produce some better documentation based on your questions and other input. diff --git a/Externals/libusb/README b/Externals/libusb/README new file mode 100644 index 0000000000..715c416a37 --- /dev/null +++ b/Externals/libusb/README @@ -0,0 +1,27 @@ +libusb +====== + +libusb is a library for USB device access from Linux, Mac OS X, +Windows and OpenBSD/NetBSD userspace. +It is written in C and licensed under the GNU Lesser General Public +License version 2.1 or, at your option, any later version (see COPYING). + +libusb is abstracted internally in such a way that it can hopefully +be ported to other operating systems. Please see the PORTING file +for more information. + +libusb homepage: +http://libusb.info/ + +Developers will wish to consult the API documentation: +http://api.libusb.info + +Use the mailing list for questions, comments, etc: +http://mailing-list.libusb.info + +- Pete Batard +- Hans de Goede +- Xiaofan Chen +- Ludovic Rousseau +- Nathan Hjelm +(Please use the mailing list rather than mailing developers directly) diff --git a/Externals/libusb/TODO b/Externals/libusb/TODO new file mode 100644 index 0000000000..19dd1d0e6f --- /dev/null +++ b/Externals/libusb/TODO @@ -0,0 +1,2 @@ +Please see the libusb roadmap by visiting: +https://github.com/libusb/libusb/issues/milestones?direction=asc&sort=due_date diff --git a/Externals/libusb/Xcode/common.xcconfig b/Externals/libusb/Xcode/common.xcconfig new file mode 100644 index 0000000000..cc0ac236b2 --- /dev/null +++ b/Externals/libusb/Xcode/common.xcconfig @@ -0,0 +1,49 @@ +// +// libusb Xcode configuration file +// Copyright © 2012 Pete Batard +// For more information, please visit: +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +// libusb does not follow C99 strict aliasing rules, so disable it. +GCC_STRICT_ALIASING = NO + +// Use C99 dialect. +GCC_C_LANGUAGE_STANDARD = c99 + +// Compiler warnings. +GCC_WARN_64_TO_32_BIT_CONVERSION = YES +GCC_WARN_ABOUT_RETURN_TYPE = YES +GCC_WARN_UNINITIALIZED_AUTOS = YES +GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES +GCC_WARN_SHADOW = YES +GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES +GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES +GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES +GCC_WARN_ABOUT_MISSING_NEWLINE = YES +GCC_WARN_UNKNOWN_PRAGMAS = YES +GCC_WARN_UNUSED_FUNCTION = YES +GCC_WARN_UNUSED_LABEL = YES +GCC_WARN_UNUSED_VARIABLE = YES +CLANG_WARN_EMPTY_BODY = YES +CLANG_WARN_CONSTANT_CONVERSION = YES +CLANG_WARN_ENUM_CONVERSION = YES +CLANG_WARN_INT_CONVERSION = YES +CLANG_WARN_DOCUMENTATION_COMMENTS = YES +CLANG_WARN_BOOL_CONVERSION = YES + +// Static analyzer warnings. +CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES +CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES diff --git a/Externals/libusb/Xcode/config.h b/Externals/libusb/Xcode/config.h new file mode 100644 index 0000000000..492d43a9d7 --- /dev/null +++ b/Externals/libusb/Xcode/config.h @@ -0,0 +1,28 @@ +/* config.h. Manually generated for Xcode. */ + +/* Default visibility */ +#define DEFAULT_VISIBILITY /**/ + +/* Message logging */ +#define ENABLE_LOGGING 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_POLL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Darwin backend */ +#define OS_DARWIN 1 + +/* type of second poll() argument */ +#define POLL_NFDS_TYPE nfds_t + +/* Use POSIX Threads */ +#define THREADS_POSIX 1 + +/* Use GNU extensions */ +#define _GNU_SOURCE 1 diff --git a/Externals/libusb/Xcode/debug.xcconfig b/Externals/libusb/Xcode/debug.xcconfig new file mode 100644 index 0000000000..e910ee8a9f --- /dev/null +++ b/Externals/libusb/Xcode/debug.xcconfig @@ -0,0 +1,29 @@ +// +// libusb Xcode configuration file +// Copyright © 2012 Pete Batard +// For more information, please visit: +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +#include "common.xcconfig" + +// Embed debug symbols in binary itself. +DEBUG_INFORMATION_FORMAT = dwarf + +// No optimizations in debug. +GCC_OPTIMIZATION_LEVEL = 0 + +// +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) DEBUG=1 diff --git a/Externals/libusb/Xcode/libusb.xcconfig b/Externals/libusb/Xcode/libusb.xcconfig new file mode 100644 index 0000000000..12f0c46461 --- /dev/null +++ b/Externals/libusb/Xcode/libusb.xcconfig @@ -0,0 +1,21 @@ +// +// libusb Xcode configuration file +// Copyright © 2012 Pete Batard +// For more information, please visit: +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +PRODUCT_NAME = libusb-1.0.0 +LD_DYLIB_INSTALL_NAME = @rpath/libusb-1.0.0.dylib diff --git a/Externals/libusb/Xcode/libusb.xcodeproj/project.pbxproj b/Externals/libusb/Xcode/libusb.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..a5aeb10fd9 --- /dev/null +++ b/Externals/libusb/Xcode/libusb.xcodeproj/project.pbxproj @@ -0,0 +1 @@ +// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 45; objects = { /* Begin PBXAggregateTarget section */ 008FC0321628BC9400BC5BE2 /* all */ = { isa = PBXAggregateTarget; buildConfigurationList = 008FC0331628BC9400BC5BE2 /* Build configuration list for PBXAggregateTarget "all" */; buildPhases = ( ); dependencies = ( 008FC0371628BC9A00BC5BE2 /* PBXTargetDependency */, 008FC0391628BC9A00BC5BE2 /* PBXTargetDependency */, 008FC03B1628BC9A00BC5BE2 /* PBXTargetDependency */, 008FC03D1628BC9A00BC5BE2 /* PBXTargetDependency */, 008FC03F1628BC9A00BC5BE2 /* PBXTargetDependency */, 008FC0411628BC9A00BC5BE2 /* PBXTargetDependency */, ); name = all; productName = all; }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ 008FBF861628B7E800BC5BE2 /* core.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBF541628B7E800BC5BE2 /* core.c */; }; 008FBF871628B7E800BC5BE2 /* descriptor.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBF551628B7E800BC5BE2 /* descriptor.c */; }; 008FBF881628B7E800BC5BE2 /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBF561628B7E800BC5BE2 /* io.c */; }; 008FBF891628B7E800BC5BE2 /* libusb.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBF5A1628B7E800BC5BE2 /* libusb.h */; }; 008FBF901628B7E800BC5BE2 /* libusbi.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBF671628B7E800BC5BE2 /* libusbi.h */; }; 008FBF921628B7E800BC5BE2 /* darwin_usb.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBF6C1628B7E800BC5BE2 /* darwin_usb.c */; }; 008FBF931628B7E800BC5BE2 /* darwin_usb.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBF6D1628B7E800BC5BE2 /* darwin_usb.h */; }; 008FBF971628B7E800BC5BE2 /* poll_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBF711628B7E800BC5BE2 /* poll_posix.h */; }; 008FBF9A1628B7E800BC5BE2 /* threads_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBF741628B7E800BC5BE2 /* threads_posix.c */; }; 008FBF9B1628B7E800BC5BE2 /* threads_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBF751628B7E800BC5BE2 /* threads_posix.h */; }; 008FBFA01628B7E800BC5BE2 /* sync.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBF7A1628B7E800BC5BE2 /* sync.c */; }; 008FBFA11628B7E800BC5BE2 /* version.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBF7B1628B7E800BC5BE2 /* version.h */; }; 008FBFA21628B7E800BC5BE2 /* version_nano.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBF7C1628B7E800BC5BE2 /* version_nano.h */; }; 008FBFA51628B84200BC5BE2 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBFA41628B84200BC5BE2 /* config.h */; }; 008FBFA71628B87000BC5BE2 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBFA61628B87000BC5BE2 /* CoreFoundation.framework */; }; 008FBFA91628B88000BC5BE2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBFA81628B88000BC5BE2 /* IOKit.framework */; }; 008FBFAB1628B8CB00BC5BE2 /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBFAA1628B8CB00BC5BE2 /* libobjc.dylib */; }; 008FBFEF1628BA3500BC5BE2 /* xusb.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBFED1628BA0E00BC5BE2 /* xusb.c */; }; 008FBFF01628BA3A00BC5BE2 /* libusb-1.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */; }; 008FBFFF1628BB9600BC5BE2 /* dpfp.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBFD71628BA0E00BC5BE2 /* dpfp.c */; }; 008FC0001628BBCD00BC5BE2 /* libusb-1.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */; }; 008FC00F1628BBE400BC5BE2 /* dpfp_threaded.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBFDB1628BA0E00BC5BE2 /* dpfp_threaded.c */; }; 008FC0101628BBE900BC5BE2 /* libusb-1.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */; }; 008FC01F1628BC1500BC5BE2 /* fxload.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBFE11628BA0E00BC5BE2 /* fxload.c */; }; 008FC0201628BC1B00BC5BE2 /* libusb-1.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */; }; 008FC0211628BC5200BC5BE2 /* ezusb.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBFDC1628BA0E00BC5BE2 /* ezusb.c */; }; 008FC0301628BC7400BC5BE2 /* listdevs.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBFE71628BA0E00BC5BE2 /* listdevs.c */; }; 008FC0311628BC7800BC5BE2 /* libusb-1.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */; }; 1438D77A17A2ED9F00166101 /* hotplug.c in Sources */ = {isa = PBXBuildFile; fileRef = 1438D77817A2ED9F00166101 /* hotplug.c */; }; 1438D77B17A2ED9F00166101 /* hotplug.h in Headers */ = {isa = PBXBuildFile; fileRef = 1438D77917A2ED9F00166101 /* hotplug.h */; }; 1438D77D17A2EDCD00166101 /* poll_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 1438D77C17A2EDCD00166101 /* poll_posix.c */; }; 1438D77F17A2F0EA00166101 /* strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 1438D77E17A2F0EA00166101 /* strerror.c */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 008FC0361628BC9A00BC5BE2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 008FBF281628B79300BC5BE2 /* Project object */; proxyType = 1; remoteGlobalIDString = 008FBF301628B79300BC5BE2; remoteInfo = libusb; }; 008FC0381628BC9A00BC5BE2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 008FBF281628B79300BC5BE2 /* Project object */; proxyType = 1; remoteGlobalIDString = 008FBFBC1628B9FE00BC5BE2; remoteInfo = xusb; }; 008FC03A1628BC9A00BC5BE2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 008FBF281628B79300BC5BE2 /* Project object */; proxyType = 1; remoteGlobalIDString = 008FBFF41628BB8B00BC5BE2; remoteInfo = dpfp; }; 008FC03C1628BC9A00BC5BE2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 008FBF281628B79300BC5BE2 /* Project object */; proxyType = 1; remoteGlobalIDString = 008FC0041628BBDB00BC5BE2; remoteInfo = dpfp_threaded; }; 008FC03E1628BC9A00BC5BE2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 008FBF281628B79300BC5BE2 /* Project object */; proxyType = 1; remoteGlobalIDString = 008FC0141628BC0300BC5BE2; remoteInfo = fxload; }; 008FC0401628BC9A00BC5BE2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 008FBF281628B79300BC5BE2 /* Project object */; proxyType = 1; remoteGlobalIDString = 008FC0251628BC6B00BC5BE2; remoteInfo = listdevs; }; 1443EE8B1641926D007E0579 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 008FBF281628B79300BC5BE2 /* Project object */; proxyType = 1; remoteGlobalIDString = 008FBF301628B79300BC5BE2; remoteInfo = libusb; }; 1443EE8D16419273007E0579 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 008FBF281628B79300BC5BE2 /* Project object */; proxyType = 1; remoteGlobalIDString = 008FBF301628B79300BC5BE2; remoteInfo = libusb; }; 1443EE8F16419276007E0579 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 008FBF281628B79300BC5BE2 /* Project object */; proxyType = 1; remoteGlobalIDString = 008FBF301628B79300BC5BE2; remoteInfo = libusb; }; 1443EE911641927A007E0579 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 008FBF281628B79300BC5BE2 /* Project object */; proxyType = 1; remoteGlobalIDString = 008FBF301628B79300BC5BE2; remoteInfo = libusb; }; 1443EE931641927D007E0579 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 008FBF281628B79300BC5BE2 /* Project object */; proxyType = 1; remoteGlobalIDString = 008FBF301628B79300BC5BE2; remoteInfo = libusb; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ 008FBFBB1628B9FE00BC5BE2 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = /usr/share/man/man1/; dstSubfolderSpec = 0; files = ( ); runOnlyForDeploymentPostprocessing = 1; }; 008FBFF31628BB8B00BC5BE2 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = /usr/share/man/man1/; dstSubfolderSpec = 0; files = ( ); runOnlyForDeploymentPostprocessing = 1; }; 008FC0031628BBDB00BC5BE2 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = /usr/share/man/man1/; dstSubfolderSpec = 0; files = ( ); runOnlyForDeploymentPostprocessing = 1; }; 008FC0131628BC0300BC5BE2 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = /usr/share/man/man1/; dstSubfolderSpec = 0; files = ( ); runOnlyForDeploymentPostprocessing = 1; }; 008FC0241628BC6B00BC5BE2 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = /usr/share/man/man1/; dstSubfolderSpec = 0; files = ( ); runOnlyForDeploymentPostprocessing = 1; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = "libusb-1.0.0.dylib"; sourceTree = BUILT_PRODUCTS_DIR; }; 008FBF541628B7E800BC5BE2 /* core.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = core.c; sourceTree = ""; }; 008FBF551628B7E800BC5BE2 /* descriptor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = descriptor.c; sourceTree = ""; }; 008FBF561628B7E800BC5BE2 /* io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = io.c; sourceTree = ""; }; 008FBF5A1628B7E800BC5BE2 /* libusb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libusb.h; sourceTree = ""; }; 008FBF671628B7E800BC5BE2 /* libusbi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libusbi.h; sourceTree = ""; }; 008FBF6C1628B7E800BC5BE2 /* darwin_usb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = darwin_usb.c; sourceTree = ""; }; 008FBF6D1628B7E800BC5BE2 /* darwin_usb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = darwin_usb.h; sourceTree = ""; }; 008FBF711628B7E800BC5BE2 /* poll_posix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = poll_posix.h; sourceTree = ""; }; 008FBF741628B7E800BC5BE2 /* threads_posix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = threads_posix.c; sourceTree = ""; }; 008FBF751628B7E800BC5BE2 /* threads_posix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = threads_posix.h; sourceTree = ""; }; 008FBF7A1628B7E800BC5BE2 /* sync.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sync.c; sourceTree = ""; }; 008FBF7B1628B7E800BC5BE2 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = ""; }; 008FBF7C1628B7E800BC5BE2 /* version_nano.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version_nano.h; sourceTree = ""; }; 008FBFA41628B84200BC5BE2 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; }; 008FBFA61628B87000BC5BE2 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 008FBFA81628B88000BC5BE2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; 008FBFAA1628B8CB00BC5BE2 /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libobjc.dylib; path = usr/lib/libobjc.dylib; sourceTree = SDKROOT; }; 008FBFBD1628B9FE00BC5BE2 /* xusb */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = xusb; sourceTree = BUILT_PRODUCTS_DIR; }; 008FBFD71628BA0E00BC5BE2 /* dpfp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = dpfp.c; sourceTree = ""; }; 008FBFDB1628BA0E00BC5BE2 /* dpfp_threaded.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = dpfp_threaded.c; sourceTree = ""; }; 008FBFDC1628BA0E00BC5BE2 /* ezusb.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ezusb.c; sourceTree = ""; }; 008FBFDD1628BA0E00BC5BE2 /* ezusb.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ezusb.h; sourceTree = ""; }; 008FBFE11628BA0E00BC5BE2 /* fxload.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fxload.c; sourceTree = ""; }; 008FBFE71628BA0E00BC5BE2 /* listdevs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = listdevs.c; sourceTree = ""; }; 008FBFED1628BA0E00BC5BE2 /* xusb.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = xusb.c; sourceTree = ""; }; 008FBFF51628BB8B00BC5BE2 /* dpfp */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = dpfp; sourceTree = BUILT_PRODUCTS_DIR; }; 008FC0051628BBDB00BC5BE2 /* dpfp_threaded */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = dpfp_threaded; sourceTree = BUILT_PRODUCTS_DIR; }; 008FC0151628BC0300BC5BE2 /* fxload */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = fxload; sourceTree = BUILT_PRODUCTS_DIR; }; 008FC0261628BC6B00BC5BE2 /* listdevs */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = listdevs; sourceTree = BUILT_PRODUCTS_DIR; }; 1438D77817A2ED9F00166101 /* hotplug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hotplug.c; sourceTree = ""; }; 1438D77917A2ED9F00166101 /* hotplug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hotplug.h; sourceTree = ""; }; 1438D77C17A2EDCD00166101 /* poll_posix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = poll_posix.c; sourceTree = ""; }; 1438D77E17A2F0EA00166101 /* strerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strerror.c; sourceTree = ""; }; 1443EE8416417E63007E0579 /* common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = common.xcconfig; sourceTree = SOURCE_ROOT; }; 1443EE8516417E63007E0579 /* debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = debug.xcconfig; sourceTree = SOURCE_ROOT; }; 1443EE8616417E63007E0579 /* libusb_debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = libusb_debug.xcconfig; sourceTree = SOURCE_ROOT; }; 1443EE8716417E63007E0579 /* libusb.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = libusb.xcconfig; sourceTree = SOURCE_ROOT; }; 1443EE8816417E63007E0579 /* release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = release.xcconfig; sourceTree = SOURCE_ROOT; }; 1443EE8916417EA6007E0579 /* libusb_release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = libusb_release.xcconfig; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 008FBF2E1628B79300BC5BE2 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 008FBFAB1628B8CB00BC5BE2 /* libobjc.dylib in Frameworks */, 008FBFA91628B88000BC5BE2 /* IOKit.framework in Frameworks */, 008FBFA71628B87000BC5BE2 /* CoreFoundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 008FBFBA1628B9FE00BC5BE2 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 008FBFF01628BA3A00BC5BE2 /* libusb-1.0.0.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 008FBFF21628BB8B00BC5BE2 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 008FC0001628BBCD00BC5BE2 /* libusb-1.0.0.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 008FC0021628BBDB00BC5BE2 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 008FC0101628BBE900BC5BE2 /* libusb-1.0.0.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 008FC0121628BC0300BC5BE2 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 008FC0201628BC1B00BC5BE2 /* libusb-1.0.0.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 008FC0231628BC6B00BC5BE2 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 008FC0311628BC7800BC5BE2 /* libusb-1.0.0.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 008FBF261628B79300BC5BE2 = { isa = PBXGroup; children = ( 1443EE8316417DE3007E0579 /* xcconfig */, 008FBFA41628B84200BC5BE2 /* config.h */, 008FBF3B1628B7E800BC5BE2 /* libusb */, 008FBFC81628BA0E00BC5BE2 /* examples */, 1443EE8A16419057007E0579 /* Apple */, 008FBF321628B79300BC5BE2 /* Products */, ); sourceTree = ""; }; 008FBF321628B79300BC5BE2 /* Products */ = { isa = PBXGroup; children = ( 008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */, 008FBFBD1628B9FE00BC5BE2 /* xusb */, 008FBFF51628BB8B00BC5BE2 /* dpfp */, 008FC0051628BBDB00BC5BE2 /* dpfp_threaded */, 008FC0151628BC0300BC5BE2 /* fxload */, 008FC0261628BC6B00BC5BE2 /* listdevs */, ); name = Products; sourceTree = ""; }; 008FBF3B1628B7E800BC5BE2 /* libusb */ = { isa = PBXGroup; children = ( 008FBF541628B7E800BC5BE2 /* core.c */, 008FBF551628B7E800BC5BE2 /* descriptor.c */, 1438D77817A2ED9F00166101 /* hotplug.c */, 1438D77917A2ED9F00166101 /* hotplug.h */, 008FBF561628B7E800BC5BE2 /* io.c */, 008FBF5A1628B7E800BC5BE2 /* libusb.h */, 008FBF671628B7E800BC5BE2 /* libusbi.h */, 008FBF6B1628B7E800BC5BE2 /* os */, 1438D77E17A2F0EA00166101 /* strerror.c */, 008FBF7A1628B7E800BC5BE2 /* sync.c */, 008FBF7B1628B7E800BC5BE2 /* version.h */, 008FBF7C1628B7E800BC5BE2 /* version_nano.h */, ); name = libusb; path = ../libusb; sourceTree = ""; }; 008FBF6B1628B7E800BC5BE2 /* os */ = { isa = PBXGroup; children = ( 008FBF6C1628B7E800BC5BE2 /* darwin_usb.c */, 008FBF6D1628B7E800BC5BE2 /* darwin_usb.h */, 1438D77C17A2EDCD00166101 /* poll_posix.c */, 008FBF711628B7E800BC5BE2 /* poll_posix.h */, 008FBF741628B7E800BC5BE2 /* threads_posix.c */, 008FBF751628B7E800BC5BE2 /* threads_posix.h */, ); path = os; sourceTree = ""; }; 008FBFC81628BA0E00BC5BE2 /* examples */ = { isa = PBXGroup; children = ( 008FBFD71628BA0E00BC5BE2 /* dpfp.c */, 008FBFDB1628BA0E00BC5BE2 /* dpfp_threaded.c */, 008FBFDC1628BA0E00BC5BE2 /* ezusb.c */, 008FBFE11628BA0E00BC5BE2 /* fxload.c */, 008FBFE71628BA0E00BC5BE2 /* listdevs.c */, 008FBFED1628BA0E00BC5BE2 /* xusb.c */, 008FBFDD1628BA0E00BC5BE2 /* ezusb.h */, ); name = examples; path = ../examples; sourceTree = ""; }; 1443EE8316417DE3007E0579 /* xcconfig */ = { isa = PBXGroup; children = ( 1443EE8416417E63007E0579 /* common.xcconfig */, 1443EE8516417E63007E0579 /* debug.xcconfig */, 1443EE8816417E63007E0579 /* release.xcconfig */, 1443EE8716417E63007E0579 /* libusb.xcconfig */, 1443EE8616417E63007E0579 /* libusb_debug.xcconfig */, 1443EE8916417EA6007E0579 /* libusb_release.xcconfig */, ); name = xcconfig; path = ../libusb; sourceTree = ""; }; 1443EE8A16419057007E0579 /* Apple */ = { isa = PBXGroup; children = ( 008FBFAA1628B8CB00BC5BE2 /* libobjc.dylib */, 008FBFA81628B88000BC5BE2 /* IOKit.framework */, 008FBFA61628B87000BC5BE2 /* CoreFoundation.framework */, ); name = Apple; path = ../libusb; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 008FBF2F1628B79300BC5BE2 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 008FBF891628B7E800BC5BE2 /* libusb.h in Headers */, 008FBF901628B7E800BC5BE2 /* libusbi.h in Headers */, 008FBF931628B7E800BC5BE2 /* darwin_usb.h in Headers */, 008FBF971628B7E800BC5BE2 /* poll_posix.h in Headers */, 008FBF9B1628B7E800BC5BE2 /* threads_posix.h in Headers */, 008FBFA11628B7E800BC5BE2 /* version.h in Headers */, 008FBFA21628B7E800BC5BE2 /* version_nano.h in Headers */, 008FBFA51628B84200BC5BE2 /* config.h in Headers */, 1438D77B17A2ED9F00166101 /* hotplug.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 008FBF301628B79300BC5BE2 /* libusb */ = { isa = PBXNativeTarget; buildConfigurationList = 008FBF351628B79300BC5BE2 /* Build configuration list for PBXNativeTarget "libusb" */; buildPhases = ( 008FBF2D1628B79300BC5BE2 /* Sources */, 008FBF2E1628B79300BC5BE2 /* Frameworks */, 008FBF2F1628B79300BC5BE2 /* Headers */, ); buildRules = ( ); dependencies = ( ); name = libusb; productName = libusb; productReference = 008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */; productType = "com.apple.product-type.library.dynamic"; }; 008FBFBC1628B9FE00BC5BE2 /* xusb */ = { isa = PBXNativeTarget; buildConfigurationList = 008FBFC61628B9FE00BC5BE2 /* Build configuration list for PBXNativeTarget "xusb" */; buildPhases = ( 008FBFB91628B9FE00BC5BE2 /* Sources */, 008FBFBA1628B9FE00BC5BE2 /* Frameworks */, 008FBFBB1628B9FE00BC5BE2 /* CopyFiles */, ); buildRules = ( ); dependencies = ( 1443EE941641927D007E0579 /* PBXTargetDependency */, ); name = xusb; productName = xusb; productReference = 008FBFBD1628B9FE00BC5BE2 /* xusb */; productType = "com.apple.product-type.tool"; }; 008FBFF41628BB8B00BC5BE2 /* dpfp */ = { isa = PBXNativeTarget; buildConfigurationList = 008FBFFC1628BB8C00BC5BE2 /* Build configuration list for PBXNativeTarget "dpfp" */; buildPhases = ( 008FBFF11628BB8B00BC5BE2 /* Sources */, 008FBFF21628BB8B00BC5BE2 /* Frameworks */, 008FBFF31628BB8B00BC5BE2 /* CopyFiles */, ); buildRules = ( ); dependencies = ( 1443EE921641927A007E0579 /* PBXTargetDependency */, ); name = dpfp; productName = dpfp; productReference = 008FBFF51628BB8B00BC5BE2 /* dpfp */; productType = "com.apple.product-type.tool"; }; 008FC0041628BBDB00BC5BE2 /* dpfp_threaded */ = { isa = PBXNativeTarget; buildConfigurationList = 008FC00C1628BBDB00BC5BE2 /* Build configuration list for PBXNativeTarget "dpfp_threaded" */; buildPhases = ( 008FC0011628BBDB00BC5BE2 /* Sources */, 008FC0021628BBDB00BC5BE2 /* Frameworks */, 008FC0031628BBDB00BC5BE2 /* CopyFiles */, ); buildRules = ( ); dependencies = ( 1443EE9016419276007E0579 /* PBXTargetDependency */, ); name = dpfp_threaded; productName = dpfp_threaded; productReference = 008FC0051628BBDB00BC5BE2 /* dpfp_threaded */; productType = "com.apple.product-type.tool"; }; 008FC0141628BC0300BC5BE2 /* fxload */ = { isa = PBXNativeTarget; buildConfigurationList = 008FC01C1628BC0300BC5BE2 /* Build configuration list for PBXNativeTarget "fxload" */; buildPhases = ( 008FC0111628BC0300BC5BE2 /* Sources */, 008FC0121628BC0300BC5BE2 /* Frameworks */, 008FC0131628BC0300BC5BE2 /* CopyFiles */, ); buildRules = ( ); dependencies = ( 1443EE8E16419273007E0579 /* PBXTargetDependency */, ); name = fxload; productName = fxload; productReference = 008FC0151628BC0300BC5BE2 /* fxload */; productType = "com.apple.product-type.tool"; }; 008FC0251628BC6B00BC5BE2 /* listdevs */ = { isa = PBXNativeTarget; buildConfigurationList = 008FC02D1628BC6B00BC5BE2 /* Build configuration list for PBXNativeTarget "listdevs" */; buildPhases = ( 008FC0221628BC6B00BC5BE2 /* Sources */, 008FC0231628BC6B00BC5BE2 /* Frameworks */, 008FC0241628BC6B00BC5BE2 /* CopyFiles */, ); buildRules = ( ); dependencies = ( 1443EE8C1641926D007E0579 /* PBXTargetDependency */, ); name = listdevs; productName = listdevs; productReference = 008FC0261628BC6B00BC5BE2 /* listdevs */; productType = "com.apple.product-type.tool"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 008FBF281628B79300BC5BE2 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0450; ORGANIZATIONNAME = libusb; }; buildConfigurationList = 008FBF2B1628B79300BC5BE2 /* Build configuration list for PBXProject "libusb" */; compatibilityVersion = "Xcode 3.1"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 008FBF261628B79300BC5BE2; productRefGroup = 008FBF321628B79300BC5BE2 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 008FBF301628B79300BC5BE2 /* libusb */, 008FBFBC1628B9FE00BC5BE2 /* xusb */, 008FBFF41628BB8B00BC5BE2 /* dpfp */, 008FC0041628BBDB00BC5BE2 /* dpfp_threaded */, 008FC0141628BC0300BC5BE2 /* fxload */, 008FC0251628BC6B00BC5BE2 /* listdevs */, 008FC0321628BC9400BC5BE2 /* all */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ 008FBF2D1628B79300BC5BE2 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 008FBF861628B7E800BC5BE2 /* core.c in Sources */, 008FBF871628B7E800BC5BE2 /* descriptor.c in Sources */, 008FBF881628B7E800BC5BE2 /* io.c in Sources */, 008FBF921628B7E800BC5BE2 /* darwin_usb.c in Sources */, 008FBF9A1628B7E800BC5BE2 /* threads_posix.c in Sources */, 008FBFA01628B7E800BC5BE2 /* sync.c in Sources */, 1438D77A17A2ED9F00166101 /* hotplug.c in Sources */, 1438D77D17A2EDCD00166101 /* poll_posix.c in Sources */, 1438D77F17A2F0EA00166101 /* strerror.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 008FBFB91628B9FE00BC5BE2 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 008FBFEF1628BA3500BC5BE2 /* xusb.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 008FBFF11628BB8B00BC5BE2 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 008FBFFF1628BB9600BC5BE2 /* dpfp.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 008FC0011628BBDB00BC5BE2 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 008FC00F1628BBE400BC5BE2 /* dpfp_threaded.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 008FC0111628BC0300BC5BE2 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 008FC0211628BC5200BC5BE2 /* ezusb.c in Sources */, 008FC01F1628BC1500BC5BE2 /* fxload.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 008FC0221628BC6B00BC5BE2 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 008FC0301628BC7400BC5BE2 /* listdevs.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 008FC0371628BC9A00BC5BE2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 008FBF301628B79300BC5BE2 /* libusb */; targetProxy = 008FC0361628BC9A00BC5BE2 /* PBXContainerItemProxy */; }; 008FC0391628BC9A00BC5BE2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 008FBFBC1628B9FE00BC5BE2 /* xusb */; targetProxy = 008FC0381628BC9A00BC5BE2 /* PBXContainerItemProxy */; }; 008FC03B1628BC9A00BC5BE2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 008FBFF41628BB8B00BC5BE2 /* dpfp */; targetProxy = 008FC03A1628BC9A00BC5BE2 /* PBXContainerItemProxy */; }; 008FC03D1628BC9A00BC5BE2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 008FC0041628BBDB00BC5BE2 /* dpfp_threaded */; targetProxy = 008FC03C1628BC9A00BC5BE2 /* PBXContainerItemProxy */; }; 008FC03F1628BC9A00BC5BE2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 008FC0141628BC0300BC5BE2 /* fxload */; targetProxy = 008FC03E1628BC9A00BC5BE2 /* PBXContainerItemProxy */; }; 008FC0411628BC9A00BC5BE2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 008FC0251628BC6B00BC5BE2 /* listdevs */; targetProxy = 008FC0401628BC9A00BC5BE2 /* PBXContainerItemProxy */; }; 1443EE8C1641926D007E0579 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 008FBF301628B79300BC5BE2 /* libusb */; targetProxy = 1443EE8B1641926D007E0579 /* PBXContainerItemProxy */; }; 1443EE8E16419273007E0579 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 008FBF301628B79300BC5BE2 /* libusb */; targetProxy = 1443EE8D16419273007E0579 /* PBXContainerItemProxy */; }; 1443EE9016419276007E0579 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 008FBF301628B79300BC5BE2 /* libusb */; targetProxy = 1443EE8F16419276007E0579 /* PBXContainerItemProxy */; }; 1443EE921641927A007E0579 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 008FBF301628B79300BC5BE2 /* libusb */; targetProxy = 1443EE911641927A007E0579 /* PBXContainerItemProxy */; }; 1443EE941641927D007E0579 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 008FBF301628B79300BC5BE2 /* libusb */; targetProxy = 1443EE931641927D007E0579 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ 008FBF331628B79300BC5BE2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { }; name = Debug; }; 008FBF341628B79300BC5BE2 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { }; name = Release; }; 008FBF361628B79300BC5BE2 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1443EE8616417E63007E0579 /* libusb_debug.xcconfig */; buildSettings = { }; name = Debug; }; 008FBF371628B79300BC5BE2 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1443EE8916417EA6007E0579 /* libusb_release.xcconfig */; buildSettings = { }; name = Release; }; 008FBFC41628B9FE00BC5BE2 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1443EE8516417E63007E0579 /* debug.xcconfig */; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; 008FBFC51628B9FE00BC5BE2 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1443EE8816417E63007E0579 /* release.xcconfig */; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; 008FBFFD1628BB8C00BC5BE2 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1443EE8516417E63007E0579 /* debug.xcconfig */; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; 008FBFFE1628BB8C00BC5BE2 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1443EE8816417E63007E0579 /* release.xcconfig */; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; 008FC00D1628BBDB00BC5BE2 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1443EE8516417E63007E0579 /* debug.xcconfig */; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; 008FC00E1628BBDB00BC5BE2 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1443EE8816417E63007E0579 /* release.xcconfig */; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; 008FC01D1628BC0300BC5BE2 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1443EE8516417E63007E0579 /* debug.xcconfig */; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; 008FC01E1628BC0300BC5BE2 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1443EE8816417E63007E0579 /* release.xcconfig */; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; 008FC02E1628BC6B00BC5BE2 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1443EE8516417E63007E0579 /* debug.xcconfig */; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; 008FC02F1628BC6B00BC5BE2 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1443EE8816417E63007E0579 /* release.xcconfig */; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; 008FC0341628BC9400BC5BE2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; 008FC0351628BC9400BC5BE2 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 008FBF2B1628B79300BC5BE2 /* Build configuration list for PBXProject "libusb" */ = { isa = XCConfigurationList; buildConfigurations = ( 008FBF331628B79300BC5BE2 /* Debug */, 008FBF341628B79300BC5BE2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 008FBF351628B79300BC5BE2 /* Build configuration list for PBXNativeTarget "libusb" */ = { isa = XCConfigurationList; buildConfigurations = ( 008FBF361628B79300BC5BE2 /* Debug */, 008FBF371628B79300BC5BE2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 008FBFC61628B9FE00BC5BE2 /* Build configuration list for PBXNativeTarget "xusb" */ = { isa = XCConfigurationList; buildConfigurations = ( 008FBFC41628B9FE00BC5BE2 /* Debug */, 008FBFC51628B9FE00BC5BE2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 008FBFFC1628BB8C00BC5BE2 /* Build configuration list for PBXNativeTarget "dpfp" */ = { isa = XCConfigurationList; buildConfigurations = ( 008FBFFD1628BB8C00BC5BE2 /* Debug */, 008FBFFE1628BB8C00BC5BE2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 008FC00C1628BBDB00BC5BE2 /* Build configuration list for PBXNativeTarget "dpfp_threaded" */ = { isa = XCConfigurationList; buildConfigurations = ( 008FC00D1628BBDB00BC5BE2 /* Debug */, 008FC00E1628BBDB00BC5BE2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 008FC01C1628BC0300BC5BE2 /* Build configuration list for PBXNativeTarget "fxload" */ = { isa = XCConfigurationList; buildConfigurations = ( 008FC01D1628BC0300BC5BE2 /* Debug */, 008FC01E1628BC0300BC5BE2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 008FC02D1628BC6B00BC5BE2 /* Build configuration list for PBXNativeTarget "listdevs" */ = { isa = XCConfigurationList; buildConfigurations = ( 008FC02E1628BC6B00BC5BE2 /* Debug */, 008FC02F1628BC6B00BC5BE2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 008FC0331628BC9400BC5BE2 /* Build configuration list for PBXAggregateTarget "all" */ = { isa = XCConfigurationList; buildConfigurations = ( 008FC0341628BC9400BC5BE2 /* Debug */, 008FC0351628BC9400BC5BE2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 008FBF281628B79300BC5BE2 /* Project object */; } \ No newline at end of file diff --git a/Externals/libusb/Xcode/libusb_debug.xcconfig b/Externals/libusb/Xcode/libusb_debug.xcconfig new file mode 100644 index 0000000000..11bc4c3b32 --- /dev/null +++ b/Externals/libusb/Xcode/libusb_debug.xcconfig @@ -0,0 +1,21 @@ +// +// libusb Xcode configuration file +// Copyright © 2012 Pete Batard +// For more information, please visit: +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +#include "debug.xcconfig" +#include "libusb.xcconfig" diff --git a/Externals/libusb/Xcode/libusb_release.xcconfig b/Externals/libusb/Xcode/libusb_release.xcconfig new file mode 100644 index 0000000000..3bd47bb28a --- /dev/null +++ b/Externals/libusb/Xcode/libusb_release.xcconfig @@ -0,0 +1,21 @@ +// +// libusb Xcode configuration file +// Copyright © 2012 Pete Batard +// For more information, please visit: +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +#include "release.xcconfig" +#include "libusb.xcconfig" diff --git a/Externals/libusb/Xcode/release.xcconfig b/Externals/libusb/Xcode/release.xcconfig new file mode 100644 index 0000000000..ead284a7d2 --- /dev/null +++ b/Externals/libusb/Xcode/release.xcconfig @@ -0,0 +1,30 @@ +// +// libusb Xcode configuration file +// Copyright © 2012 Pete Batard +// For more information, please visit: +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +#include "common.xcconfig" + +// Put debug symbols in separate .dym file. +DEBUG_INFORMATION_FORMAT = dwarf-with-dsym + +// Optimizations in release. +GCC_OPTIMIZATION_LEVEL = s +LLVM_LTO = YES + +// Define NDEBUG so asserts go away in release. +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) NDEBUG=1 diff --git a/Externals/libusbx/aclocal.m4 b/Externals/libusb/aclocal.m4 similarity index 91% rename from Externals/libusbx/aclocal.m4 rename to Externals/libusb/aclocal.m4 index b839727512..37bee63f71 100644 --- a/Externals/libusbx/aclocal.m4 +++ b/Externals/libusb/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.13.4 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.13' +[am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.13.4], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,7 +51,7 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.13.4])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) @@ -418,6 +418,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -526,7 +532,48 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further @@ -534,7 +581,6 @@ dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -682,38 +728,6 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -dnl Make sure AC_PROG_CC is never called again, or it will override our -dnl setting of CC. -m4_define([AC_PROG_CC], - [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) -]) - # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. @@ -784,6 +798,70 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. diff --git a/Externals/libusb/android/README b/Externals/libusb/android/README new file mode 100644 index 0000000000..1afecc7d8c --- /dev/null +++ b/Externals/libusb/android/README @@ -0,0 +1,114 @@ +libusb for Android +================== + +Building: +--------- + +To build libusb for Android do the following: + + 1. Download the latest NDK from: + http://developer.android.com/tools/sdk/ndk/index.html + + 2. Extract the NDK. + + 3. Open a shell and make sure there exist an NDK global variable + set to the directory where you extracted the NDK. + + 4. Change directory to libusb's "android/jni" + + 5. Run "$NDK/ndk-build". + +The libusb library, examples and tests can then be found in: + "android/libs/$ARCH" + +Where $ARCH is one of: + armeabi + armeabi-v7a + x86 + + +Installing: +----------- + +If you wish to use libusb from native code in own Android application +then you should add the following line to your Android.mk file: + + include $(PATH_TO_LIBUSB_SRC)/android/jni/libusb.mk + +You will then need to add the following lines to the build +configuration for each native binary which uses libusb: + + LOCAL_C_INCLUDES += $(LIBUSB_ROOT_ABS) + LOCAL_SHARED_LIBRARIES += libusb1.0 + +The Android build system will then correctly include libusb in the +application package (APK) file, provided ndk-build is invoked before +the package is built. + + +For a rooted device it is possible to install libusb into the system +image of a running device: + + 1. Enable ADB on the device. + + 2. Connect the device to a machine running ADB. + + 3. Execute the following commands on the machine + running ADB: + + # Make the system partition writable + adb shell su -c "mount -o remount,rw /system" + + # Install libusb + adb push obj/local/armeabi/libusb1.0.so /sdcard/ + adb shell su -c "cat > /system/lib/libusb1.0.so < /sdcard/libusb1.0.so" + adb shell rm /system/lib/libusb1.0.so + + # Install the samples and tests + for B in listdevs fxload xusb sam3u_benchmark hotplugtest stress + do + adb push "obj/local/armeabi/$B" /sdcard/ + adb shell su -c "cat > /system/bin/$B < /sdcard/$B" + adb shell su -c "chmod 0755 /system/bin/$B" + adb shell rm "/sdcard/$B" + done + + # Make the system partition read only again + adb shell su -c "mount -o remount,ro /system" + + # Run listdevs to + adb shell su -c "listdevs" + + 4. If your device only has a single OTG port then ADB can generally + be switched to using Wifi with the following commands when connected + via USB: + + adb shell netcfg + # Note the wifi IP address of the phone + adb tcpip 5555 + # Use the IP address from netcfg + adb connect 192.168.1.123:5555 + +Runtime Permissions: +-------------------- + +The default system configuration on most Android device will not allow +access to USB devices. There are several options for changing this. + +If you have control of the system image then you can modify the +ueventd.rc used in the image to change the permissions on +/dev/bus/usb/*/*. If using this approach then it is advisable to +create a new Android permission to protect access to these files. +It is not advisable to give all applications read and write permissions +to these files. + +For rooted devices the code using libusb could be executed as root +using the "su" command. An alternative would be to use the "su" command +to change the permissions on the appropriate /dev/bus/usb/ files. + +Users have reported success in using android.hardware.usb.UsbManager +to request permission to use the UsbDevice and then opening the +device. The difficulties in this method is that there is no guarantee +that it will continue to work in the future Android versions, it +requires invoking Java APIs and running code to match each +android.hardware.usb.UsbDevice to a libusb_device. diff --git a/Externals/libusb/android/config.h b/Externals/libusb/android/config.h new file mode 100644 index 0000000000..d36325e765 --- /dev/null +++ b/Externals/libusb/android/config.h @@ -0,0 +1,81 @@ +/* + * Android build config for libusb + * Copyright © 2012-2013 RealVNC Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* Start with debug message logging enabled */ +/* #undef ENABLE_DEBUG_LOGGING */ + +/* Message logging */ +#define ENABLE_LOGGING + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Linux backend */ +#define OS_LINUX 1 + +/* Enable output to system log */ +#define USE_SYSTEM_LOGGING_FACILITY 1 + +/* type of second poll() argument */ +#define POLL_NFDS_TYPE nfds_t + +/* Use POSIX Threads */ +#define THREADS_POSIX 1 + +/* Default visibility */ +#define DEFAULT_VISIBILITY __attribute__((visibility("default"))) + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_POLL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_FILTER_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_NETLINK_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ASM_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 diff --git a/Externals/libusb/android/jni/Android.mk b/Externals/libusb/android/jni/Android.mk new file mode 100644 index 0000000000..6a32b50149 --- /dev/null +++ b/Externals/libusb/android/jni/Android.mk @@ -0,0 +1,23 @@ +# Android build config for libusb, examples and tests +# Copyright © 2012-2013 RealVNC Ltd. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# + +LOCAL_PATH:= $(call my-dir) + +include $(LOCAL_PATH)/libusb.mk +include $(LOCAL_PATH)/examples.mk +include $(LOCAL_PATH)/tests.mk diff --git a/Externals/libusb/android/jni/Application.mk b/Externals/libusb/android/jni/Application.mk new file mode 100644 index 0000000000..f972a9e429 --- /dev/null +++ b/Externals/libusb/android/jni/Application.mk @@ -0,0 +1,24 @@ +# Android application build config for libusb +# Copyright © 2012-2013 RealVNC Ltd. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# + +APP_ABI := all + +# Workaround for MIPS toolchain linker being unable to find liblog dependency +# of shared object in NDK versions at least up to r9. +# +APP_LDFLAGS := -llog diff --git a/Externals/libusb/android/jni/examples.mk b/Externals/libusb/android/jni/examples.mk new file mode 100644 index 0000000000..05609cc8e8 --- /dev/null +++ b/Externals/libusb/android/jni/examples.mk @@ -0,0 +1,134 @@ +# Android build config for libusb examples +# Copyright © 2012-2013 RealVNC Ltd. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# + +LOCAL_PATH:= $(call my-dir) +LIBUSB_ROOT_REL:= ../.. +LIBUSB_ROOT_ABS:= $(LOCAL_PATH)/../.. + +# listdevs + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + $(LIBUSB_ROOT_REL)/examples/listdevs.c + +LOCAL_C_INCLUDES += \ + $(LIBUSB_ROOT_ABS) + +LOCAL_SHARED_LIBRARIES += libusb1.0 + +LOCAL_MODULE:= listdevs + +include $(BUILD_EXECUTABLE) + +# xusb + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + $(LIBUSB_ROOT_REL)/examples/xusb.c + +LOCAL_C_INCLUDES += \ + $(LIBUSB_ROOT_ABS) + +LOCAL_SHARED_LIBRARIES += libusb1.0 + +LOCAL_MODULE:= xusb + +include $(BUILD_EXECUTABLE) + +# hotplugtest + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + $(LIBUSB_ROOT_REL)/examples/hotplugtest.c + +LOCAL_C_INCLUDES += \ + $(LIBUSB_ROOT_ABS) + +LOCAL_SHARED_LIBRARIES += libusb1.0 + +LOCAL_MODULE:= hotplugtest + +include $(BUILD_EXECUTABLE) + +# fxload + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + $(LIBUSB_ROOT_REL)/examples/fxload.c \ + $(LIBUSB_ROOT_REL)/examples/ezusb.c + +LOCAL_C_INCLUDES += \ + $(LIBUSB_ROOT_ABS) + +LOCAL_SHARED_LIBRARIES += libusb1.0 + +LOCAL_MODULE:= fxload + +include $(BUILD_EXECUTABLE) + +# sam3u_benchmake + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + $(LIBUSB_ROOT_REL)/examples/sam3u_benchmark.c + +LOCAL_C_INCLUDES += \ + $(LIBUSB_ROOT_ABS) + +LOCAL_SHARED_LIBRARIES += libusb1.0 + +LOCAL_MODULE:= sam3u_benchmark + +include $(BUILD_EXECUTABLE) + +# dpfp + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + $(LIBUSB_ROOT_REL)/examples/dpfp.c + +LOCAL_C_INCLUDES += \ + $(LIBUSB_ROOT_ABS) + +LOCAL_SHARED_LIBRARIES += libusb1.0 + +LOCAL_MODULE:= dpfp + +include $(BUILD_EXECUTABLE) + +# dpfp_threaded + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + $(LIBUSB_ROOT_REL)/examples/dpfp_threaded.c + +LOCAL_C_INCLUDES += \ + $(LIBUSB_ROOT_ABS) + +LOCAL_SHARED_LIBRARIES += libusb1.0 + +LOCAL_MODULE:= dpfp_threaded + +include $(BUILD_EXECUTABLE) diff --git a/Externals/libusb/android/jni/libusb.mk b/Externals/libusb/android/jni/libusb.mk new file mode 100644 index 0000000000..f4896b2ef4 --- /dev/null +++ b/Externals/libusb/android/jni/libusb.mk @@ -0,0 +1,54 @@ +# Android build config for libusb +# Copyright © 2012-2013 RealVNC Ltd. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# + +LOCAL_PATH:= $(call my-dir) +LIBUSB_ROOT_REL:= ../.. +LIBUSB_ROOT_ABS:= $(LOCAL_PATH)/../.. + +# libusb + +include $(CLEAR_VARS) + +LIBUSB_ROOT_REL:= ../.. +LIBUSB_ROOT_ABS:= $(LOCAL_PATH)/../.. + +LOCAL_SRC_FILES := \ + $(LIBUSB_ROOT_REL)/libusb/core.c \ + $(LIBUSB_ROOT_REL)/libusb/descriptor.c \ + $(LIBUSB_ROOT_REL)/libusb/hotplug.c \ + $(LIBUSB_ROOT_REL)/libusb/io.c \ + $(LIBUSB_ROOT_REL)/libusb/sync.c \ + $(LIBUSB_ROOT_REL)/libusb/strerror.c \ + $(LIBUSB_ROOT_REL)/libusb/os/linux_usbfs.c \ + $(LIBUSB_ROOT_REL)/libusb/os/poll_posix.c \ + $(LIBUSB_ROOT_REL)/libusb/os/threads_posix.c \ + $(LIBUSB_ROOT_REL)/libusb/os/linux_netlink.c + +LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/.. \ + $(LIBUSB_ROOT_ABS)/libusb \ + $(LIBUSB_ROOT_ABS)/libusb/os + +LOCAL_EXPORT_C_INCLUDES := \ + $(LIBUSB_ROOT_ABS)/libusb + +LOCAL_LDLIBS := -llog + +LOCAL_MODULE := libusb1.0 + +include $(BUILD_SHARED_LIBRARY) diff --git a/Externals/libusb/android/jni/tests.mk b/Externals/libusb/android/jni/tests.mk new file mode 100644 index 0000000000..93d55161bf --- /dev/null +++ b/Externals/libusb/android/jni/tests.mk @@ -0,0 +1,56 @@ +# Android build config for libusb tests +# Copyright © 2012-2013 RealVNC Ltd. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# + +LOCAL_PATH:= $(call my-dir) +LIBUSB_ROOT_REL:= ../.. +LIBUSB_ROOT_ABS:= $(LOCAL_PATH)/../.. + +# testlib + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + $(LIBUSB_ROOT_REL)/tests/testlib.c + +LOCAL_C_INCLUDES += \ + $(LIBUSB_ROOT_ABS)/tests + +LOCAL_EXPORT_C_INCLUDES := \ + $(LIBUSB_ROOT_ABS)/tests + +LOCAL_MODULE := testlib + +include $(BUILD_STATIC_LIBRARY) + + +# stress + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + $(LIBUSB_ROOT_REL)/tests/stress.c + +LOCAL_C_INCLUDES += \ + $(LIBUSB_ROOT_ABS) + +LOCAL_SHARED_LIBRARIES += libusb1.0 +LOCAL_STATIC_LIBRARIES += testlib + +LOCAL_MODULE:= stress + +include $(BUILD_EXECUTABLE) diff --git a/Externals/libusbx/compile b/Externals/libusb/compile old mode 100644 new mode 100755 similarity index 100% rename from Externals/libusbx/compile rename to Externals/libusb/compile diff --git a/Externals/libusbx/config.guess b/Externals/libusb/config.guess old mode 100644 new mode 100755 similarity index 92% rename from Externals/libusbx/config.guess rename to Externals/libusb/config.guess index 1804e9fcdc..9afd676206 --- a/Externals/libusbx/config.guess +++ b/Externals/libusb/config.guess @@ -1,10 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012, 2013 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2012-12-29' +timestamp='2013-11-29' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -26,7 +24,7 @@ timestamp='2012-12-29' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD @@ -52,9 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, -2012, 2013 Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -136,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -857,21 +874,21 @@ EOF exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -884,59 +901,54 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -955,54 +967,63 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1235,19 +1256,31 @@ EOF exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) diff --git a/Externals/libusbx/config.h.in b/Externals/libusb/config.h.in similarity index 87% rename from Externals/libusbx/config.h.in rename to Externals/libusb/config.h.in index 41c7f0f7fc..effc220854 100644 --- a/Externals/libusbx/config.h.in +++ b/Externals/libusb/config.h.in @@ -9,6 +9,9 @@ /* Message logging */ #undef ENABLE_LOGGING +/* Define to 1 if you have the header file. */ +#undef HAVE_ASM_TYPES_H + /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H @@ -54,6 +57,15 @@ /* Define to 1 if the system has the type `struct timespec'. */ #undef HAVE_STRUCT_TIMESPEC +/* syslog() function available */ +#undef HAVE_SYSLOG_FUNC + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYSLOG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H @@ -70,16 +82,16 @@ */ #undef LT_OBJDIR -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -#undef NO_MINUS_C_MINUS_O - /* Darwin backend */ #undef OS_DARWIN /* Linux backend */ #undef OS_LINUX -/* OpenBSD/NetBSD backend */ +/* NetBSD backend */ +#undef OS_NETBSD + +/* OpenBSD backend */ #undef OS_OPENBSD /* Windows backend */ @@ -118,6 +130,9 @@ /* timerfd headers available */ #undef USBI_TIMERFD_AVAILABLE +/* Enable output to system log */ +#undef USE_SYSTEM_LOGGING_FACILITY + /* Use udev for device enumeration/hotplug */ #undef USE_UDEV diff --git a/Externals/libusbx/config.sub b/Externals/libusb/config.sub old mode 100644 new mode 100755 similarity index 98% rename from Externals/libusbx/config.sub rename to Externals/libusb/config.sub index 52f04bcd71..ece8142bc0 --- a/Externals/libusbx/config.sub +++ b/Externals/libusb/config.sub @@ -1,10 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012, 2013 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2012-12-29' +timestamp='2013-10-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -70,9 +68,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, -2012, 2013 Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -256,12 +252,12 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc \ + | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ @@ -269,6 +265,7 @@ case $basic_machine in | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ @@ -290,16 +287,17 @@ case $basic_machine in | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nios | nios2 \ + | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ - | or32 \ + | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ @@ -327,7 +325,7 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -369,13 +367,13 @@ case $basic_machine in | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -384,6 +382,7 @@ case $basic_machine in | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ @@ -407,12 +406,13 @@ case $basic_machine in | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ @@ -796,7 +796,7 @@ case $basic_machine in os=-mingw64 ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -832,7 +832,7 @@ case $basic_machine in basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -1354,7 +1354,7 @@ case $os in -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ + | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ @@ -1500,9 +1500,6 @@ case $os in -aros*) os=-aros ;; - -kaos*) - os=-kaos - ;; -zvmoe) os=-zvmoe ;; @@ -1551,6 +1548,9 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; hexagon-*) os=-elf ;; @@ -1594,6 +1594,9 @@ case $basic_machine in mips*-*) os=-elf ;; + or1k-*) + os=-elf + ;; or32-*) os=-coff ;; diff --git a/Externals/libusbx/configure b/Externals/libusb/configure old mode 100644 new mode 100755 similarity index 98% rename from Externals/libusbx/configure rename to Externals/libusb/configure index fcf943c2a0..88b5ed9ad7 --- a/Externals/libusbx/configure +++ b/Externals/libusb/configure @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libusbx 1.0.16. +# Generated by GNU Autoconf 2.69 for libusb 1.0.19. # -# Report bugs to . +# Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -275,7 +275,7 @@ fi $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: libusbx-devel@lists.sourceforge.net about your system, +$0: libusb-devel@lists.sourceforge.net about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." @@ -588,12 +588,12 @@ MFLAGS= MAKEFLAGS= # Identity of this package. -PACKAGE_NAME='libusbx' -PACKAGE_TARNAME='libusbx' -PACKAGE_VERSION='1.0.16' -PACKAGE_STRING='libusbx 1.0.16' -PACKAGE_BUGREPORT='libusbx-devel@lists.sourceforge.net' -PACKAGE_URL='http://libusbx.org' +PACKAGE_NAME='libusb' +PACKAGE_TARNAME='libusb' +PACKAGE_VERSION='1.0.19' +PACKAGE_STRING='libusb 1.0.19' +PACKAGE_BUGREPORT='libusb-devel@lists.sourceforge.net' +PACKAGE_URL='http://libusb.info' ac_unique_file="libusb/core.c" # Factoring default headers for most tests. @@ -652,6 +652,8 @@ THREADS_POSIX_FALSE THREADS_POSIX_TRUE OS_WINDOWS_FALSE OS_WINDOWS_TRUE +OS_NETBSD_FALSE +OS_NETBSD_TRUE OS_OPENBSD_FALSE OS_OPENBSD_TRUE OS_DARWIN_FALSE @@ -659,6 +661,7 @@ OS_DARWIN_TRUE OS_LINUX_FALSE OS_LINUX_TRUE OS_WINDOWS +OS_NETBSD OS_OPENBSD OS_DARWIN USE_UDEV @@ -796,6 +799,7 @@ enable_udev enable_timerfd enable_log enable_debug_log +enable_system_log enable_examples_build enable_tests_build ' @@ -1348,7 +1352,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libusbx 1.0.16 to adapt to many kinds of systems. +\`configure' configures libusb 1.0.19 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1396,7 +1400,7 @@ Fine tuning of the installation directories: --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/libusbx] + --docdir=DIR documentation root [DATAROOTDIR/doc/libusb] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] @@ -1418,7 +1422,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libusbx 1.0.16:";; + short | recursive ) echo "Configuration of libusb 1.0.19:";; esac cat <<\_ACEOF @@ -1441,12 +1445,15 @@ Optional Features: optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-udev use udev for device enumeration and hotplug support - (recommended, default: yes) - --enable-timerfd use timerfd for timing (default auto) + (recommended) [default=yes] + --enable-timerfd use timerfd for timing [default=auto] --disable-log disable all logging - --enable-debug-log start with debug message logging enabled (default n) - --enable-examples-build build example applications (default n) - --enable-tests-build build test applications (default n) + --enable-debug-log start with debug message logging enabled + [default=no] + --enable-system-log output logging messages to system wide log, if + supported by the OS [default=no] + --enable-examples-build build example applications [default=no] + --enable-tests-build build test applications [default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1470,8 +1477,8 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . -libusbx home page: . +Report bugs to . +libusb home page: . _ACEOF ac_status=$? fi @@ -1534,7 +1541,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libusbx configure 1.0.16 +libusb configure 1.0.19 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1879,9 +1886,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## -------------------------------------------------- ## -## Report this to libusbx-devel@lists.sourceforge.net ## -## -------------------------------------------------- ##" +( $as_echo "## ------------------------------------------------- ## +## Report this to libusb-devel@lists.sourceforge.net ## +## ------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac @@ -2003,7 +2010,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libusbx $as_me 1.0.16, which was +It was created by libusb $as_me 1.0.19, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2361,7 +2368,7 @@ lt_revision="0" lt_age="1" LTLDFLAGS="-version-info ${lt_current}:${lt_revision}:${lt_age}" -am__api_version='1.13' +am__api_version='1.14' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2875,8 +2882,8 @@ fi # Define the identity of the package. - PACKAGE='libusbx' - VERSION='1.0.16' + PACKAGE='libusb' + VERSION='1.0.19' cat >>confdefs.h <<_ACEOF @@ -2927,6 +2934,47 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } @@ -3784,6 +3832,65 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -6386,7 +6493,7 @@ ia64-*-hpux*) rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -6404,7 +6511,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -6423,7 +6533,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -11781,131 +11894,6 @@ _ACEOF ;; esac -if test "x$CC" != xcc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 -$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 -$as_echo_n "checking whether cc understands -c and -o together... " >&6; } -fi -set dummy $CC; ac_cc=`$as_echo "$2" | - sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -# Make sure it works both with $CC and with simple cc. -# We do the test twice because some compilers refuse to overwrite an -# existing .o file with -o, though they will create one. -ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -rm -f conftest2.* -if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; -then - eval ac_cv_prog_cc_${ac_cc}_c_o=yes - if test "x$CC" != xcc; then - # Test first that cc exists at all. - if { ac_try='cc -c conftest.$ac_ext >&5' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' - rm -f conftest2.* - if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; - then - # cc works too. - : - else - # cc exists but doesn't like -o. - eval ac_cv_prog_cc_${ac_cc}_c_o=no - fi - fi - fi -else - eval ac_cv_prog_cc_${ac_cc}_c_o=no -fi -rm -f core conftest* - -fi -if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h - -fi - -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi - $as_echo "#define _GNU_SOURCE 1" >>confdefs.h @@ -11917,7 +11905,17 @@ LTLDFLAGS="${LTLDFLAGS} -no-undefined" $as_echo_n "checking operating system... " >&6; } case $host in -*-linux*) +*-linux-android*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: This is a Linux-Android system" >&5 +$as_echo "This is a Linux-Android system" >&6; } + is_backend_android="yes" + ;; +*) + is_backend_android="no" +esac + +case $host in +*-linux* | *-uclinux*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux" >&5 $as_echo "Linux" >&6; } backend="linux" @@ -11932,13 +11930,13 @@ $as_echo "Darwin/Mac OS X" >&6; } *-openbsd*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenBSD" >&5 $as_echo "OpenBSD" >&6; } - backend="bsd" + backend="openbsd" threads="posix" ;; *-netbsd*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: NetBSD (using OpenBSD backend)" >&5 -$as_echo "NetBSD (using OpenBSD backend)" >&6; } - backend="bsd" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: NetBSD" >&5 +$as_echo "NetBSD" >&6; } + backend="netbsd" threads="posix" ;; *-mingw*) @@ -12095,7 +12093,7 @@ fi $as_echo "#define USE_UDEV 1" >>confdefs.h else - for ac_header in linux/netlink.h linux/filter.h + for ac_header in asm/types.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -12104,6 +12102,27 @@ if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF +fi + +done + + for ac_header in linux/netlink.h linux/filter.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " +#ifdef HAVE_ASM_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + else as_fn_error $? "\"Linux netlink headers not found\"" "$LINENO" 5 fi @@ -12112,8 +12131,20 @@ done fi + +case $is_backend_android in +yes) + THREAD_CFLAGS="-c" + LIBS="${LIBS} -c" + +$as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h + + ;; +*) THREAD_CFLAGS="-pthread" LIBS="${LIBS} -pthread" +esac + for ac_header in poll.h do : ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" @@ -12162,7 +12193,7 @@ $as_echo "#define POLL_NFDS_TYPE unsigned int" >>confdefs.h fi ;; -bsd) +openbsd) $as_echo "#define OS_OPENBSD 1" >>confdefs.h @@ -12182,6 +12213,29 @@ fi done +$as_echo "#define POLL_NFDS_TYPE nfds_t" >>confdefs.h + + ;; +netbsd) + +$as_echo "#define OS_NETBSD 1" >>confdefs.h + + + THREAD_CFLAGS="-pthread" + LIBS="-pthread" + for ac_header in poll.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" +if test "x$ac_cv_header_poll_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_POLL_H 1 +_ACEOF + +fi + +done + + $as_echo "#define POLL_NFDS_TYPE nfds_t" >>confdefs.h ;; @@ -12216,7 +12270,7 @@ else OS_DARWIN_FALSE= fi - if test "x$backend" = xbsd; then + if test "x$backend" = xopenbsd; then OS_OPENBSD_TRUE= OS_OPENBSD_FALSE='#' else @@ -12224,6 +12278,14 @@ else OS_OPENBSD_FALSE= fi + if test "x$backend" = xnetbsd; then + OS_NETBSD_TRUE= + OS_NETBSD_FALSE='#' +else + OS_NETBSD_TRUE='#' + OS_NETBSD_FALSE= +fi + if test "x$backend" = xwindows; then OS_WINDOWS_TRUE= OS_WINDOWS_FALSE='#' @@ -12351,6 +12413,45 @@ $as_echo "#define ENABLE_DEBUG_LOGGING 1" >>confdefs.h fi +# Check whether --enable-system-log was given. +if test "${enable_system_log+set}" = set; then : + enableval=$enable_system_log; system_log_enabled=$enableval +else + system_log_enabled='no' +fi + +if test "x$system_log_enabled" != "xno"; then + +$as_echo "#define USE_SYSTEM_LOGGING_FACILITY 1" >>confdefs.h + +fi + +# Check if syslog is available in standard C library +for ac_header in syslog.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default" +if test "x$ac_cv_header_syslog_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYSLOG_H 1 +_ACEOF + +fi + +done + +ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog" +if test "x$ac_cv_func_syslog" = xyes; then : + have_syslog=yes +else + have_syslog=no +fi + +if test "x$have_syslog" != "xno"; then + +$as_echo "#define HAVE_SYSLOG_FUNC 1" >>confdefs.h + +fi + # Examples build # Check whether --enable-examples-build was given. if test "${enable_examples_build+set}" = set; then : @@ -12658,6 +12759,10 @@ if test -z "${OS_OPENBSD_TRUE}" && test -z "${OS_OPENBSD_FALSE}"; then as_fn_error $? "conditional \"OS_OPENBSD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${OS_NETBSD_TRUE}" && test -z "${OS_NETBSD_FALSE}"; then + as_fn_error $? "conditional \"OS_NETBSD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${OS_WINDOWS_TRUE}" && test -z "${OS_WINDOWS_FALSE}"; then as_fn_error $? "conditional \"OS_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -13083,7 +13188,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libusbx $as_me 1.0.16, which was +This file was extended by libusb $as_me 1.0.19, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13143,14 +13248,14 @@ $config_headers Configuration commands: $config_commands -Report bugs to . -libusbx home page: ." +Report bugs to . +libusb home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libusbx config.status 1.0.16 +libusb config.status 1.0.19 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/Externals/libusbx/configure.ac b/Externals/libusb/configure.ac similarity index 77% rename from Externals/libusbx/configure.ac rename to Externals/libusb/configure.ac index 6d6b35d6e4..fffa2e8947 100644 --- a/Externals/libusbx/configure.ac +++ b/Externals/libusb/configure.ac @@ -15,7 +15,7 @@ LU_DEFINE_VERSION_ATOM([LIBUSB_MINOR]) LU_DEFINE_VERSION_ATOM([LIBUSB_MICRO]) LU_DEFINE_VERSION_RC_ATOM([LIBUSB_RC]) -AC_INIT([libusbx],[LIBUSB_MAJOR[.]LIBUSB_MINOR[.]LIBUSB_MICRO[]LIBUSB_RC],[libusbx-devel@lists.sourceforge.net],[libusbx],[http://libusbx.org]) +AC_INIT([libusb],[LIBUSB_MAJOR[.]LIBUSB_MINOR[.]LIBUSB_MICRO[]LIBUSB_RC],[libusb-devel@lists.sourceforge.net],[libusb],[http://libusb.info]) # Library versioning # These numbers should be tweaked on every release. Read carefully: @@ -46,8 +46,18 @@ LTLDFLAGS="${LTLDFLAGS} -no-undefined" AC_MSG_CHECKING([operating system]) +dnl on linux-android platform, some functions are in different places case $host in -*-linux*) +*-linux-android*) + AC_MSG_RESULT([This is a Linux-Android system]) + is_backend_android="yes" + ;; +*) + is_backend_android="no" +esac + +case $host in +*-linux* | *-uclinux*) AC_MSG_RESULT([Linux]) backend="linux" threads="posix" @@ -59,12 +69,12 @@ case $host in ;; *-openbsd*) AC_MSG_RESULT([OpenBSD]) - backend="bsd" + backend="openbsd" threads="posix" ;; *-netbsd*) - AC_MSG_RESULT([NetBSD (using OpenBSD backend)]) - backend="bsd" + AC_MSG_RESULT([NetBSD]) + backend="netbsd" threads="posix" ;; *-mingw*) @@ -89,7 +99,7 @@ linux) AC_SUBST(OS_LINUX) AC_SEARCH_LIBS(clock_gettime, rt, [], [], -pthread) AC_ARG_ENABLE([udev], - [AC_HELP_STRING([--enable-udev], [use udev for device enumeration and hotplug support (recommended, default: yes)])], + [AC_HELP_STRING([--enable-udev], [use udev for device enumeration and hotplug support (recommended) [default=yes]])], [], [enable_udev="yes"]) if test "x$enable_udev" = "xyes" ; then # system has udev. use it or fail! @@ -97,11 +107,31 @@ linux) AC_CHECK_LIB([udev], [udev_new], [], [AC_ERROR(["udev support requested but libudev not installed"])]) AC_DEFINE(USE_UDEV, 1, [Use udev for device enumeration/hotplug]) else - AC_CHECK_HEADERS([linux/netlink.h linux/filter.h], [], [AC_ERROR(["Linux netlink headers not found"])]) + AC_CHECK_HEADERS([asm/types.h sys/socket.h], [], []) + AC_CHECK_HEADERS([linux/netlink.h linux/filter.h], [], [AC_ERROR(["Linux netlink headers not found"])], [ +#ifdef HAVE_ASM_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +]) fi AC_SUBST(USE_UDEV) + +case $is_backend_android in +yes) + dnl some pthread functions is in libc + THREAD_CFLAGS="-c" + LIBS="${LIBS} -c" + dnl there are gettimeofday function but configure doesn't seem to be able to find it. + AC_DEFINE([HAVE_GETTIMEOFDAY], [1], [Define if you have gettimeofday]) + ;; +*) THREAD_CFLAGS="-pthread" LIBS="${LIBS} -pthread" +esac + AC_CHECK_HEADERS([poll.h]) AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument]) ;; @@ -116,14 +146,22 @@ darwin) [AC_DEFINE([POLL_NFDS_TYPE],[unsigned int],[type of second poll() argument])], [#include ]) ;; -bsd) - AC_DEFINE(OS_OPENBSD, 1, [OpenBSD/NetBSD backend]) +openbsd) + AC_DEFINE(OS_OPENBSD, 1, [OpenBSD backend]) AC_SUBST(OS_OPENBSD) THREAD_CFLAGS="-pthread" LIBS="-pthread" AC_CHECK_HEADERS([poll.h]) AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument]) ;; +netbsd) + AC_DEFINE(OS_NETBSD, 1, [NetBSD backend]) + AC_SUBST(OS_NETBSD) + THREAD_CFLAGS="-pthread" + LIBS="-pthread" + AC_CHECK_HEADERS([poll.h]) + AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument]) + ;; windows) AC_DEFINE(OS_WINDOWS, 1, [Windows backend]) AC_SUBST(OS_WINDOWS) @@ -137,7 +175,8 @@ AC_SUBST(LIBS) AM_CONDITIONAL(OS_LINUX, test "x$backend" = xlinux) AM_CONDITIONAL(OS_DARWIN, test "x$backend" = xdarwin) -AM_CONDITIONAL(OS_OPENBSD, test "x$backend" = xbsd) +AM_CONDITIONAL(OS_OPENBSD, test "x$backend" = xopenbsd) +AM_CONDITIONAL(OS_NETBSD, test "x$backend" = xnetbsd) AM_CONDITIONAL(OS_WINDOWS, test "x$backend" = xwindows) AM_CONDITIONAL(THREADS_POSIX, test "x$threads" = xposix) AM_CONDITIONAL(CREATE_IMPORT_LIB, test "x$create_import_lib" = "xyes") @@ -150,7 +189,7 @@ fi AC_CHECK_HEADER([sys/timerfd.h], [timerfd_h=1], [timerfd_h=0]) AC_ARG_ENABLE([timerfd], [AS_HELP_STRING([--enable-timerfd], - [use timerfd for timing (default auto)])], + [use timerfd for timing [default=auto]])], [use_timerfd=$enableval], [use_timerfd='auto']) if test "x$use_timerfd" = "xyes" -a "x$timerfd_h" = "x0"; then @@ -185,23 +224,38 @@ if test "x$log_enabled" != "xno"; then fi AC_ARG_ENABLE([debug-log], [AS_HELP_STRING([--enable-debug-log], - [start with debug message logging enabled (default n)])], + [start with debug message logging enabled [default=no]])], [debug_log_enabled=$enableval], [debug_log_enabled='no']) if test "x$debug_log_enabled" != "xno"; then AC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Start with debug message logging enabled]) fi +AC_ARG_ENABLE([system-log], [AS_HELP_STRING([--enable-system-log], + [output logging messages to system wide log, if supported by the OS [default=no]])], + [system_log_enabled=$enableval], + [system_log_enabled='no']) +if test "x$system_log_enabled" != "xno"; then + AC_DEFINE([USE_SYSTEM_LOGGING_FACILITY], 1, [Enable output to system log]) +fi + +# Check if syslog is available in standard C library +AC_CHECK_HEADERS(syslog.h) +AC_CHECK_FUNC([syslog], [have_syslog=yes], [have_syslog=no]) +if test "x$have_syslog" != "xno"; then + AC_DEFINE([HAVE_SYSLOG_FUNC], 1, [syslog() function available]) +fi + # Examples build AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build], - [build example applications (default n)])], + [build example applications [default=no]])], [build_examples=$enableval], [build_examples='no']) AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"]) # Tests build AC_ARG_ENABLE([tests-build], [AS_HELP_STRING([--enable-tests-build], - [build test applications (default n)])], + [build test applications [default=no]])], [build_tests=$enableval], [build_tests='no']) AM_CONDITIONAL([BUILD_TESTS], [test "x$build_tests" != "xno"]) diff --git a/Externals/libusbx/depcomp b/Externals/libusb/depcomp old mode 100644 new mode 100755 similarity index 99% rename from Externals/libusbx/depcomp rename to Externals/libusb/depcomp index 06b0882dd0..4ebd5b3a2f --- a/Externals/libusbx/depcomp +++ b/Externals/libusb/depcomp @@ -1,7 +1,7 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2012-10-18.11; # UTC +scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. @@ -552,6 +552,7 @@ $ { G p }' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; diff --git a/Externals/libusb/doc/Makefile.am b/Externals/libusb/doc/Makefile.am new file mode 100644 index 0000000000..76211f2dfa --- /dev/null +++ b/Externals/libusb/doc/Makefile.am @@ -0,0 +1,9 @@ +EXTRA_DIST = doxygen.cfg.in + +docs: doxygen.cfg + doxygen $^ + +docs-upload: docs + ln -s html api-1.0 + scp -r api-1.0 pbatard@web.sourceforge.net:/home/project-web/libusb/htdocs + rm -f api-1.0 diff --git a/Externals/libusb/doc/Makefile.in b/Externals/libusb/doc/Makefile.in new file mode 100644 index 0000000000..05eafee89f --- /dev/null +++ b/Externals/libusb/doc/Makefile.in @@ -0,0 +1,443 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = doc +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(srcdir)/doxygen.cfg.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/libusb/version.h $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = doxygen.cfg +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLDFLAGS = @LTLDFLAGS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OS_DARWIN = @OS_DARWIN@ +OS_LINUX = @OS_LINUX@ +OS_NETBSD = @OS_NETBSD@ +OS_OPENBSD = @OS_OPENBSD@ +OS_WINDOWS = @OS_WINDOWS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +RC = @RC@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_UDEV = @USE_UDEV@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = doxygen.cfg.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +doxygen.cfg: $(top_builddir)/config.status $(srcdir)/doxygen.cfg.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am + + +docs: doxygen.cfg + doxygen $^ + +docs-upload: docs + ln -s html api-1.0 + scp -r api-1.0 pbatard@web.sourceforge.net:/home/project-web/libusb/htdocs + rm -f api-1.0 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Externals/libusb/doc/doxygen.cfg.in b/Externals/libusb/doc/doxygen.cfg.in new file mode 100644 index 0000000000..bb5e0c0abf --- /dev/null +++ b/Externals/libusb/doc/doxygen.cfg.in @@ -0,0 +1,1288 @@ +# Doxyfile 1.5.3 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file that +# follow. The default is UTF-8 which is also the encoding used for all text before +# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into +# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of +# possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "A cross-platform user library to access USB devices" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will +# copy the logo to the output directory. + +PROJECT_LOGO = libusb.png + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, +# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, +# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, +# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to +# include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be extracted +# and appear in the documentation as a namespace called 'anonymous_namespace{file}', +# where file will be replaced with the base name of the file that contains the anonymous +# namespace. By default anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from the +# version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @top_srcdir@/libusb + +# This tag can be used to specify the character encoding of the source files that +# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default +# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. +# See http://www.gnu.org/software/libiconv for the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = @top_srcdir@/libusb/libusbi.h @top_srcdir@/libusb/hotplug.h + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the output. +# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, +# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH +# then you must also enable this option. If you don't then doxygen will produce +# a warning and turn it on anyway + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = YES + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = API_EXPORTED= LIBUSB_CALL= DEFAULT_VISIBILITY= + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to +# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to +# specify the directory where the mscgen tool resides. If left empty the tool is assumed to +# be found in the default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a caller dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the number +# of direct children of the root node in a graph is already larger than +# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, which results in a white background. +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO diff --git a/Externals/libusb/examples/Makefile.am b/Externals/libusb/examples/Makefile.am new file mode 100644 index 0000000000..8081927417 --- /dev/null +++ b/Externals/libusb/examples/Makefile.am @@ -0,0 +1,19 @@ +AM_CPPFLAGS = -I$(top_srcdir)/libusb +LDADD = ../libusb/libusb-1.0.la + +noinst_PROGRAMS = listdevs xusb fxload hotplugtest + +if HAVE_SIGACTION +noinst_PROGRAMS += dpfp + +if THREADS_POSIX +dpfp_threaded_CFLAGS = $(AM_CFLAGS) +noinst_PROGRAMS += dpfp_threaded +endif + +sam3u_benchmark_SOURCES = sam3u_benchmark.c +noinst_PROGRAMS += sam3u_benchmark +endif + +fxload_SOURCES = ezusb.c ezusb.h fxload.c +fxload_CFLAGS = $(THREAD_CFLAGS) $(AM_CFLAGS) diff --git a/Externals/libusb/examples/Makefile.in b/Externals/libusb/examples/Makefile.in new file mode 100644 index 0000000000..ae50fe0fbb --- /dev/null +++ b/Externals/libusb/examples/Makefile.in @@ -0,0 +1,700 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = listdevs$(EXEEXT) xusb$(EXEEXT) fxload$(EXEEXT) \ + hotplugtest$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \ + $(am__EXEEXT_3) +@HAVE_SIGACTION_TRUE@am__append_1 = dpfp +@HAVE_SIGACTION_TRUE@@THREADS_POSIX_TRUE@am__append_2 = dpfp_threaded +@HAVE_SIGACTION_TRUE@am__append_3 = sam3u_benchmark +subdir = examples +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/libusb/version.h $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +@HAVE_SIGACTION_TRUE@am__EXEEXT_1 = dpfp$(EXEEXT) +@HAVE_SIGACTION_TRUE@@THREADS_POSIX_TRUE@am__EXEEXT_2 = dpfp_threaded$(EXEEXT) +@HAVE_SIGACTION_TRUE@am__EXEEXT_3 = sam3u_benchmark$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) +dpfp_SOURCES = dpfp.c +dpfp_OBJECTS = dpfp.$(OBJEXT) +dpfp_LDADD = $(LDADD) +dpfp_DEPENDENCIES = ../libusb/libusb-1.0.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +dpfp_threaded_SOURCES = dpfp_threaded.c +dpfp_threaded_OBJECTS = dpfp_threaded-dpfp_threaded.$(OBJEXT) +dpfp_threaded_LDADD = $(LDADD) +dpfp_threaded_DEPENDENCIES = ../libusb/libusb-1.0.la +dpfp_threaded_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(dpfp_threaded_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_fxload_OBJECTS = fxload-ezusb.$(OBJEXT) fxload-fxload.$(OBJEXT) +fxload_OBJECTS = $(am_fxload_OBJECTS) +fxload_LDADD = $(LDADD) +fxload_DEPENDENCIES = ../libusb/libusb-1.0.la +fxload_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(fxload_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +hotplugtest_SOURCES = hotplugtest.c +hotplugtest_OBJECTS = hotplugtest.$(OBJEXT) +hotplugtest_LDADD = $(LDADD) +hotplugtest_DEPENDENCIES = ../libusb/libusb-1.0.la +listdevs_SOURCES = listdevs.c +listdevs_OBJECTS = listdevs.$(OBJEXT) +listdevs_LDADD = $(LDADD) +listdevs_DEPENDENCIES = ../libusb/libusb-1.0.la +am__sam3u_benchmark_SOURCES_DIST = sam3u_benchmark.c +@HAVE_SIGACTION_TRUE@am_sam3u_benchmark_OBJECTS = \ +@HAVE_SIGACTION_TRUE@ sam3u_benchmark.$(OBJEXT) +sam3u_benchmark_OBJECTS = $(am_sam3u_benchmark_OBJECTS) +sam3u_benchmark_LDADD = $(LDADD) +sam3u_benchmark_DEPENDENCIES = ../libusb/libusb-1.0.la +xusb_SOURCES = xusb.c +xusb_OBJECTS = xusb.$(OBJEXT) +xusb_LDADD = $(LDADD) +xusb_DEPENDENCIES = ../libusb/libusb-1.0.la +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = dpfp.c dpfp_threaded.c $(fxload_SOURCES) hotplugtest.c \ + listdevs.c $(sam3u_benchmark_SOURCES) xusb.c +DIST_SOURCES = dpfp.c dpfp_threaded.c $(fxload_SOURCES) hotplugtest.c \ + listdevs.c $(am__sam3u_benchmark_SOURCES_DIST) xusb.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLDFLAGS = @LTLDFLAGS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OS_DARWIN = @OS_DARWIN@ +OS_LINUX = @OS_LINUX@ +OS_NETBSD = @OS_NETBSD@ +OS_OPENBSD = @OS_OPENBSD@ +OS_WINDOWS = @OS_WINDOWS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +RC = @RC@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_UDEV = @USE_UDEV@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = -I$(top_srcdir)/libusb +LDADD = ../libusb/libusb-1.0.la +@HAVE_SIGACTION_TRUE@@THREADS_POSIX_TRUE@dpfp_threaded_CFLAGS = $(AM_CFLAGS) +@HAVE_SIGACTION_TRUE@sam3u_benchmark_SOURCES = sam3u_benchmark.c +fxload_SOURCES = ezusb.c ezusb.h fxload.c +fxload_CFLAGS = $(THREAD_CFLAGS) $(AM_CFLAGS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu examples/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +dpfp$(EXEEXT): $(dpfp_OBJECTS) $(dpfp_DEPENDENCIES) $(EXTRA_dpfp_DEPENDENCIES) + @rm -f dpfp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dpfp_OBJECTS) $(dpfp_LDADD) $(LIBS) + +dpfp_threaded$(EXEEXT): $(dpfp_threaded_OBJECTS) $(dpfp_threaded_DEPENDENCIES) $(EXTRA_dpfp_threaded_DEPENDENCIES) + @rm -f dpfp_threaded$(EXEEXT) + $(AM_V_CCLD)$(dpfp_threaded_LINK) $(dpfp_threaded_OBJECTS) $(dpfp_threaded_LDADD) $(LIBS) + +fxload$(EXEEXT): $(fxload_OBJECTS) $(fxload_DEPENDENCIES) $(EXTRA_fxload_DEPENDENCIES) + @rm -f fxload$(EXEEXT) + $(AM_V_CCLD)$(fxload_LINK) $(fxload_OBJECTS) $(fxload_LDADD) $(LIBS) + +hotplugtest$(EXEEXT): $(hotplugtest_OBJECTS) $(hotplugtest_DEPENDENCIES) $(EXTRA_hotplugtest_DEPENDENCIES) + @rm -f hotplugtest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(hotplugtest_OBJECTS) $(hotplugtest_LDADD) $(LIBS) + +listdevs$(EXEEXT): $(listdevs_OBJECTS) $(listdevs_DEPENDENCIES) $(EXTRA_listdevs_DEPENDENCIES) + @rm -f listdevs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(listdevs_OBJECTS) $(listdevs_LDADD) $(LIBS) + +sam3u_benchmark$(EXEEXT): $(sam3u_benchmark_OBJECTS) $(sam3u_benchmark_DEPENDENCIES) $(EXTRA_sam3u_benchmark_DEPENDENCIES) + @rm -f sam3u_benchmark$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sam3u_benchmark_OBJECTS) $(sam3u_benchmark_LDADD) $(LIBS) + +xusb$(EXEEXT): $(xusb_OBJECTS) $(xusb_DEPENDENCIES) $(EXTRA_xusb_DEPENDENCIES) + @rm -f xusb$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xusb_OBJECTS) $(xusb_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpfp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpfp_threaded-dpfp_threaded.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fxload-ezusb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fxload-fxload.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hotplugtest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listdevs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sam3u_benchmark.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xusb.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +dpfp_threaded-dpfp_threaded.o: dpfp_threaded.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -MT dpfp_threaded-dpfp_threaded.o -MD -MP -MF $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo -c -o dpfp_threaded-dpfp_threaded.o `test -f 'dpfp_threaded.c' || echo '$(srcdir)/'`dpfp_threaded.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo $(DEPDIR)/dpfp_threaded-dpfp_threaded.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dpfp_threaded.c' object='dpfp_threaded-dpfp_threaded.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -c -o dpfp_threaded-dpfp_threaded.o `test -f 'dpfp_threaded.c' || echo '$(srcdir)/'`dpfp_threaded.c + +dpfp_threaded-dpfp_threaded.obj: dpfp_threaded.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -MT dpfp_threaded-dpfp_threaded.obj -MD -MP -MF $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo -c -o dpfp_threaded-dpfp_threaded.obj `if test -f 'dpfp_threaded.c'; then $(CYGPATH_W) 'dpfp_threaded.c'; else $(CYGPATH_W) '$(srcdir)/dpfp_threaded.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo $(DEPDIR)/dpfp_threaded-dpfp_threaded.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dpfp_threaded.c' object='dpfp_threaded-dpfp_threaded.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -c -o dpfp_threaded-dpfp_threaded.obj `if test -f 'dpfp_threaded.c'; then $(CYGPATH_W) 'dpfp_threaded.c'; else $(CYGPATH_W) '$(srcdir)/dpfp_threaded.c'; fi` + +fxload-ezusb.o: ezusb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -MT fxload-ezusb.o -MD -MP -MF $(DEPDIR)/fxload-ezusb.Tpo -c -o fxload-ezusb.o `test -f 'ezusb.c' || echo '$(srcdir)/'`ezusb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fxload-ezusb.Tpo $(DEPDIR)/fxload-ezusb.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ezusb.c' object='fxload-ezusb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -c -o fxload-ezusb.o `test -f 'ezusb.c' || echo '$(srcdir)/'`ezusb.c + +fxload-ezusb.obj: ezusb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -MT fxload-ezusb.obj -MD -MP -MF $(DEPDIR)/fxload-ezusb.Tpo -c -o fxload-ezusb.obj `if test -f 'ezusb.c'; then $(CYGPATH_W) 'ezusb.c'; else $(CYGPATH_W) '$(srcdir)/ezusb.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fxload-ezusb.Tpo $(DEPDIR)/fxload-ezusb.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ezusb.c' object='fxload-ezusb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -c -o fxload-ezusb.obj `if test -f 'ezusb.c'; then $(CYGPATH_W) 'ezusb.c'; else $(CYGPATH_W) '$(srcdir)/ezusb.c'; fi` + +fxload-fxload.o: fxload.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -MT fxload-fxload.o -MD -MP -MF $(DEPDIR)/fxload-fxload.Tpo -c -o fxload-fxload.o `test -f 'fxload.c' || echo '$(srcdir)/'`fxload.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fxload-fxload.Tpo $(DEPDIR)/fxload-fxload.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fxload.c' object='fxload-fxload.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -c -o fxload-fxload.o `test -f 'fxload.c' || echo '$(srcdir)/'`fxload.c + +fxload-fxload.obj: fxload.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -MT fxload-fxload.obj -MD -MP -MF $(DEPDIR)/fxload-fxload.Tpo -c -o fxload-fxload.obj `if test -f 'fxload.c'; then $(CYGPATH_W) 'fxload.c'; else $(CYGPATH_W) '$(srcdir)/fxload.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fxload-fxload.Tpo $(DEPDIR)/fxload-fxload.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fxload.c' object='fxload-fxload.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -c -o fxload-fxload.obj `if test -f 'fxload.c'; then $(CYGPATH_W) 'fxload.c'; else $(CYGPATH_W) '$(srcdir)/fxload.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Externals/libusb/examples/dpfp.c b/Externals/libusb/examples/dpfp.c new file mode 100644 index 0000000000..ed682671ab --- /dev/null +++ b/Externals/libusb/examples/dpfp.c @@ -0,0 +1,506 @@ +/* + * libusb example program to manipulate U.are.U 4000B fingerprint scanner. + * Copyright © 2007 Daniel Drake + * + * Basic image capture program only, does not consider the powerup quirks or + * the fact that image encryption may be enabled. Not expected to work + * flawlessly all of the time. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include +#include + +#include "libusb.h" + +#define EP_INTR (1 | LIBUSB_ENDPOINT_IN) +#define EP_DATA (2 | LIBUSB_ENDPOINT_IN) +#define CTRL_IN (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN) +#define CTRL_OUT (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT) +#define USB_RQ 0x04 +#define INTR_LENGTH 64 + +enum { + MODE_INIT = 0x00, + MODE_AWAIT_FINGER_ON = 0x10, + MODE_AWAIT_FINGER_OFF = 0x12, + MODE_CAPTURE = 0x20, + MODE_SHUT_UP = 0x30, + MODE_READY = 0x80, +}; + +static int next_state(void); + +enum { + STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON = 1, + STATE_AWAIT_IRQ_FINGER_DETECTED, + STATE_AWAIT_MODE_CHANGE_CAPTURE, + STATE_AWAIT_IMAGE, + STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF, + STATE_AWAIT_IRQ_FINGER_REMOVED, +}; + +static int state = 0; +static struct libusb_device_handle *devh = NULL; +static unsigned char imgbuf[0x1b340]; +static unsigned char irqbuf[INTR_LENGTH]; +static struct libusb_transfer *img_transfer = NULL; +static struct libusb_transfer *irq_transfer = NULL; +static int img_idx = 0; +static int do_exit = 0; + +static int find_dpfp_device(void) +{ + devh = libusb_open_device_with_vid_pid(NULL, 0x05ba, 0x000a); + return devh ? 0 : -EIO; +} + +static int print_f0_data(void) +{ + unsigned char data[0x10]; + int r; + unsigned int i; + + r = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0xf0, 0, data, + sizeof(data), 0); + if (r < 0) { + fprintf(stderr, "F0 error %d\n", r); + return r; + } + if ((unsigned int) r < sizeof(data)) { + fprintf(stderr, "short read (%d)\n", r); + return -1; + } + + printf("F0 data:"); + for (i = 0; i < sizeof(data); i++) + printf("%02x ", data[i]); + printf("\n"); + return 0; +} + +static int get_hwstat(unsigned char *status) +{ + int r; + + r = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0x07, 0, status, 1, 0); + if (r < 0) { + fprintf(stderr, "read hwstat error %d\n", r); + return r; + } + if ((unsigned int) r < 1) { + fprintf(stderr, "short read (%d)\n", r); + return -1; + } + + printf("hwstat reads %02x\n", *status); + return 0; +} + +static int set_hwstat(unsigned char data) +{ + int r; + + printf("set hwstat to %02x\n", data); + r = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x07, 0, &data, 1, 0); + if (r < 0) { + fprintf(stderr, "set hwstat error %d\n", r); + return r; + } + if ((unsigned int) r < 1) { + fprintf(stderr, "short write (%d)", r); + return -1; + } + + return 0; +} + +static int set_mode(unsigned char data) +{ + int r; + printf("set mode %02x\n", data); + + r = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x4e, 0, &data, 1, 0); + if (r < 0) { + fprintf(stderr, "set mode error %d\n", r); + return r; + } + if ((unsigned int) r < 1) { + fprintf(stderr, "short write (%d)", r); + return -1; + } + + return 0; +} + +static void LIBUSB_CALL cb_mode_changed(struct libusb_transfer *transfer) +{ + if (transfer->status != LIBUSB_TRANSFER_COMPLETED) { + fprintf(stderr, "mode change transfer not completed!\n"); + do_exit = 2; + } + + printf("async cb_mode_changed length=%d actual_length=%d\n", + transfer->length, transfer->actual_length); + if (next_state() < 0) + do_exit = 2; +} + +static int set_mode_async(unsigned char data) +{ + unsigned char *buf = (unsigned char*) malloc(LIBUSB_CONTROL_SETUP_SIZE + 1); + struct libusb_transfer *transfer; + + if (!buf) + return -ENOMEM; + + transfer = libusb_alloc_transfer(0); + if (!transfer) { + free(buf); + return -ENOMEM; + } + + printf("async set mode %02x\n", data); + libusb_fill_control_setup(buf, CTRL_OUT, USB_RQ, 0x4e, 0, 1); + buf[LIBUSB_CONTROL_SETUP_SIZE] = data; + libusb_fill_control_transfer(transfer, devh, buf, cb_mode_changed, NULL, + 1000); + + transfer->flags = LIBUSB_TRANSFER_SHORT_NOT_OK + | LIBUSB_TRANSFER_FREE_BUFFER | LIBUSB_TRANSFER_FREE_TRANSFER; + return libusb_submit_transfer(transfer); +} + +static int do_sync_intr(unsigned char *data) +{ + int r; + int transferred; + + r = libusb_interrupt_transfer(devh, EP_INTR, data, INTR_LENGTH, + &transferred, 1000); + if (r < 0) { + fprintf(stderr, "intr error %d\n", r); + return r; + } + if (transferred < INTR_LENGTH) { + fprintf(stderr, "short read (%d)\n", r); + return -1; + } + + printf("recv interrupt %04x\n", *((uint16_t *) data)); + return 0; +} + +static int sync_intr(unsigned char type) +{ + int r; + unsigned char data[INTR_LENGTH]; + + while (1) { + r = do_sync_intr(data); + if (r < 0) + return r; + if (data[0] == type) + return 0; + } +} + +static int save_to_file(unsigned char *data) +{ + FILE *fd; + char filename[64]; + + snprintf(filename, sizeof(filename), "finger%d.pgm", img_idx++); + fd = fopen(filename, "w"); + if (!fd) + return -1; + + fputs("P5 384 289 255 ", fd); + (void) fwrite(data + 64, 1, 384*289, fd); + fclose(fd); + printf("saved image to %s\n", filename); + return 0; +} + +static int next_state(void) +{ + int r = 0; + printf("old state: %d\n", state); + switch (state) { + case STATE_AWAIT_IRQ_FINGER_REMOVED: + state = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON; + r = set_mode_async(MODE_AWAIT_FINGER_ON); + break; + case STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON: + state = STATE_AWAIT_IRQ_FINGER_DETECTED; + break; + case STATE_AWAIT_IRQ_FINGER_DETECTED: + state = STATE_AWAIT_MODE_CHANGE_CAPTURE; + r = set_mode_async(MODE_CAPTURE); + break; + case STATE_AWAIT_MODE_CHANGE_CAPTURE: + state = STATE_AWAIT_IMAGE; + break; + case STATE_AWAIT_IMAGE: + state = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF; + r = set_mode_async(MODE_AWAIT_FINGER_OFF); + break; + case STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF: + state = STATE_AWAIT_IRQ_FINGER_REMOVED; + break; + default: + printf("unrecognised state %d\n", state); + } + if (r < 0) { + fprintf(stderr, "error detected changing state\n"); + return r; + } + + printf("new state: %d\n", state); + return 0; +} + +static void LIBUSB_CALL cb_irq(struct libusb_transfer *transfer) +{ + unsigned char irqtype = transfer->buffer[0]; + + if (transfer->status != LIBUSB_TRANSFER_COMPLETED) { + fprintf(stderr, "irq transfer status %d?\n", transfer->status); + do_exit = 2; + libusb_free_transfer(transfer); + irq_transfer = NULL; + return; + } + + printf("IRQ callback %02x\n", irqtype); + switch (state) { + case STATE_AWAIT_IRQ_FINGER_DETECTED: + if (irqtype == 0x01) { + if (next_state() < 0) { + do_exit = 2; + return; + } + } else { + printf("finger-on-sensor detected in wrong state!\n"); + } + break; + case STATE_AWAIT_IRQ_FINGER_REMOVED: + if (irqtype == 0x02) { + if (next_state() < 0) { + do_exit = 2; + return; + } + } else { + printf("finger-on-sensor detected in wrong state!\n"); + } + break; + } + if (libusb_submit_transfer(irq_transfer) < 0) + do_exit = 2; +} + +static void LIBUSB_CALL cb_img(struct libusb_transfer *transfer) +{ + if (transfer->status != LIBUSB_TRANSFER_COMPLETED) { + fprintf(stderr, "img transfer status %d?\n", transfer->status); + do_exit = 2; + libusb_free_transfer(transfer); + img_transfer = NULL; + return; + } + + printf("Image callback\n"); + save_to_file(imgbuf); + if (next_state() < 0) { + do_exit = 2; + return; + } + if (libusb_submit_transfer(img_transfer) < 0) + do_exit = 2; +} + +static int init_capture(void) +{ + int r; + + r = libusb_submit_transfer(irq_transfer); + if (r < 0) + return r; + + r = libusb_submit_transfer(img_transfer); + if (r < 0) { + libusb_cancel_transfer(irq_transfer); + while (irq_transfer) + if (libusb_handle_events(NULL) < 0) + break; + return r; + } + + /* start state machine */ + state = STATE_AWAIT_IRQ_FINGER_REMOVED; + return next_state(); +} + +static int do_init(void) +{ + unsigned char status; + int r; + + r = get_hwstat(&status); + if (r < 0) + return r; + + if (!(status & 0x80)) { + r = set_hwstat(status | 0x80); + if (r < 0) + return r; + r = get_hwstat(&status); + if (r < 0) + return r; + } + + status &= ~0x80; + r = set_hwstat(status); + if (r < 0) + return r; + + r = get_hwstat(&status); + if (r < 0) + return r; + + r = sync_intr(0x56); + if (r < 0) + return r; + + return 0; +} + +static int alloc_transfers(void) +{ + img_transfer = libusb_alloc_transfer(0); + if (!img_transfer) + return -ENOMEM; + + irq_transfer = libusb_alloc_transfer(0); + if (!irq_transfer) + return -ENOMEM; + + libusb_fill_bulk_transfer(img_transfer, devh, EP_DATA, imgbuf, + sizeof(imgbuf), cb_img, NULL, 0); + libusb_fill_interrupt_transfer(irq_transfer, devh, EP_INTR, irqbuf, + sizeof(irqbuf), cb_irq, NULL, 0); + + return 0; +} + +static void sighandler(int signum) +{ + do_exit = 1; +} + +int main(void) +{ + struct sigaction sigact; + int r = 1; + + r = libusb_init(NULL); + if (r < 0) { + fprintf(stderr, "failed to initialise libusb\n"); + exit(1); + } + + r = find_dpfp_device(); + if (r < 0) { + fprintf(stderr, "Could not find/open device\n"); + goto out; + } + + r = libusb_claim_interface(devh, 0); + if (r < 0) { + fprintf(stderr, "usb_claim_interface error %d\n", r); + goto out; + } + printf("claimed interface\n"); + + r = print_f0_data(); + if (r < 0) + goto out_release; + + r = do_init(); + if (r < 0) + goto out_deinit; + + /* async from here onwards */ + + r = alloc_transfers(); + if (r < 0) + goto out_deinit; + + r = init_capture(); + if (r < 0) + goto out_deinit; + + sigact.sa_handler = sighandler; + sigemptyset(&sigact.sa_mask); + sigact.sa_flags = 0; + sigaction(SIGINT, &sigact, NULL); + sigaction(SIGTERM, &sigact, NULL); + sigaction(SIGQUIT, &sigact, NULL); + + while (!do_exit) { + r = libusb_handle_events(NULL); + if (r < 0) + goto out_deinit; + } + + printf("shutting down...\n"); + + if (irq_transfer) { + r = libusb_cancel_transfer(irq_transfer); + if (r < 0) + goto out_deinit; + } + + if (img_transfer) { + r = libusb_cancel_transfer(img_transfer); + if (r < 0) + goto out_deinit; + } + + while (irq_transfer || img_transfer) + if (libusb_handle_events(NULL) < 0) + break; + + if (do_exit == 1) + r = 0; + else + r = 1; + +out_deinit: + libusb_free_transfer(img_transfer); + libusb_free_transfer(irq_transfer); + set_mode(0); + set_hwstat(0x80); +out_release: + libusb_release_interface(devh, 0); +out: + libusb_close(devh); + libusb_exit(NULL); + return r >= 0 ? r : -r; +} diff --git a/Externals/libusb/examples/dpfp_threaded.c b/Externals/libusb/examples/dpfp_threaded.c new file mode 100644 index 0000000000..771e2ec27b --- /dev/null +++ b/Externals/libusb/examples/dpfp_threaded.c @@ -0,0 +1,544 @@ +/* + * libusb example program to manipulate U.are.U 4000B fingerprint scanner. + * Copyright © 2007 Daniel Drake + * + * Basic image capture program only, does not consider the powerup quirks or + * the fact that image encryption may be enabled. Not expected to work + * flawlessly all of the time. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include +#include +#include + +#include "libusb.h" + +#define EP_INTR (1 | LIBUSB_ENDPOINT_IN) +#define EP_DATA (2 | LIBUSB_ENDPOINT_IN) +#define CTRL_IN (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN) +#define CTRL_OUT (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT) +#define USB_RQ 0x04 +#define INTR_LENGTH 64 + +enum { + MODE_INIT = 0x00, + MODE_AWAIT_FINGER_ON = 0x10, + MODE_AWAIT_FINGER_OFF = 0x12, + MODE_CAPTURE = 0x20, + MODE_SHUT_UP = 0x30, + MODE_READY = 0x80, +}; + +static int next_state(void); + +enum { + STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON = 1, + STATE_AWAIT_IRQ_FINGER_DETECTED, + STATE_AWAIT_MODE_CHANGE_CAPTURE, + STATE_AWAIT_IMAGE, + STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF, + STATE_AWAIT_IRQ_FINGER_REMOVED, +}; + +static int state = 0; +static struct libusb_device_handle *devh = NULL; +static unsigned char imgbuf[0x1b340]; +static unsigned char irqbuf[INTR_LENGTH]; +static struct libusb_transfer *img_transfer = NULL; +static struct libusb_transfer *irq_transfer = NULL; +static int img_idx = 0; +static int do_exit = 0; + +static pthread_t poll_thread; +static pthread_cond_t exit_cond = PTHREAD_COND_INITIALIZER; +static pthread_mutex_t exit_cond_lock = PTHREAD_MUTEX_INITIALIZER; + +static void request_exit(int code) +{ + do_exit = code; + pthread_cond_signal(&exit_cond); +} + +static void *poll_thread_main(void *arg) +{ + int r = 0; + printf("poll thread running\n"); + + while (!do_exit) { + struct timeval tv = { 1, 0 }; + r = libusb_handle_events_timeout(NULL, &tv); + if (r < 0) { + request_exit(2); + break; + } + } + + printf("poll thread shutting down\n"); + return NULL; +} + +static int find_dpfp_device(void) +{ + devh = libusb_open_device_with_vid_pid(NULL, 0x05ba, 0x000a); + return devh ? 0 : -EIO; +} + +static int print_f0_data(void) +{ + unsigned char data[0x10]; + int r; + unsigned int i; + + r = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0xf0, 0, data, + sizeof(data), 0); + if (r < 0) { + fprintf(stderr, "F0 error %d\n", r); + return r; + } + if ((unsigned int) r < sizeof(data)) { + fprintf(stderr, "short read (%d)\n", r); + return -1; + } + + printf("F0 data:"); + for (i = 0; i < sizeof(data); i++) + printf("%02x ", data[i]); + printf("\n"); + return 0; +} + +static int get_hwstat(unsigned char *status) +{ + int r; + + r = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0x07, 0, status, 1, 0); + if (r < 0) { + fprintf(stderr, "read hwstat error %d\n", r); + return r; + } + if ((unsigned int) r < 1) { + fprintf(stderr, "short read (%d)\n", r); + return -1; + } + + printf("hwstat reads %02x\n", *status); + return 0; +} + +static int set_hwstat(unsigned char data) +{ + int r; + + printf("set hwstat to %02x\n", data); + r = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x07, 0, &data, 1, 0); + if (r < 0) { + fprintf(stderr, "set hwstat error %d\n", r); + return r; + } + if ((unsigned int) r < 1) { + fprintf(stderr, "short write (%d)", r); + return -1; + } + + return 0; +} + +static int set_mode(unsigned char data) +{ + int r; + printf("set mode %02x\n", data); + + r = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x4e, 0, &data, 1, 0); + if (r < 0) { + fprintf(stderr, "set mode error %d\n", r); + return r; + } + if ((unsigned int) r < 1) { + fprintf(stderr, "short write (%d)", r); + return -1; + } + + return 0; +} + +static void LIBUSB_CALL cb_mode_changed(struct libusb_transfer *transfer) +{ + if (transfer->status != LIBUSB_TRANSFER_COMPLETED) { + fprintf(stderr, "mode change transfer not completed!\n"); + request_exit(2); + } + + printf("async cb_mode_changed length=%d actual_length=%d\n", + transfer->length, transfer->actual_length); + if (next_state() < 0) + request_exit(2); +} + +static int set_mode_async(unsigned char data) +{ + unsigned char *buf = (unsigned char*) malloc(LIBUSB_CONTROL_SETUP_SIZE + 1); + struct libusb_transfer *transfer; + + if (!buf) + return -ENOMEM; + + transfer = libusb_alloc_transfer(0); + if (!transfer) { + free(buf); + return -ENOMEM; + } + + printf("async set mode %02x\n", data); + libusb_fill_control_setup(buf, CTRL_OUT, USB_RQ, 0x4e, 0, 1); + buf[LIBUSB_CONTROL_SETUP_SIZE] = data; + libusb_fill_control_transfer(transfer, devh, buf, cb_mode_changed, NULL, + 1000); + + transfer->flags = LIBUSB_TRANSFER_SHORT_NOT_OK + | LIBUSB_TRANSFER_FREE_BUFFER | LIBUSB_TRANSFER_FREE_TRANSFER; + return libusb_submit_transfer(transfer); +} + +static int do_sync_intr(unsigned char *data) +{ + int r; + int transferred; + + r = libusb_interrupt_transfer(devh, EP_INTR, data, INTR_LENGTH, + &transferred, 1000); + if (r < 0) { + fprintf(stderr, "intr error %d\n", r); + return r; + } + if (transferred < INTR_LENGTH) { + fprintf(stderr, "short read (%d)\n", r); + return -1; + } + + printf("recv interrupt %04x\n", *((uint16_t *) data)); + return 0; +} + +static int sync_intr(unsigned char type) +{ + int r; + unsigned char data[INTR_LENGTH]; + + while (1) { + r = do_sync_intr(data); + if (r < 0) + return r; + if (data[0] == type) + return 0; + } +} + +static int save_to_file(unsigned char *data) +{ + FILE *fd; + char filename[64]; + + snprintf(filename, sizeof(filename), "finger%d.pgm", img_idx++); + fd = fopen(filename, "w"); + if (!fd) + return -1; + + fputs("P5 384 289 255 ", fd); + (void) fwrite(data + 64, 1, 384*289, fd); + fclose(fd); + printf("saved image to %s\n", filename); + return 0; +} + +static int next_state(void) +{ + int r = 0; + printf("old state: %d\n", state); + switch (state) { + case STATE_AWAIT_IRQ_FINGER_REMOVED: + state = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON; + r = set_mode_async(MODE_AWAIT_FINGER_ON); + break; + case STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON: + state = STATE_AWAIT_IRQ_FINGER_DETECTED; + break; + case STATE_AWAIT_IRQ_FINGER_DETECTED: + state = STATE_AWAIT_MODE_CHANGE_CAPTURE; + r = set_mode_async(MODE_CAPTURE); + break; + case STATE_AWAIT_MODE_CHANGE_CAPTURE: + state = STATE_AWAIT_IMAGE; + break; + case STATE_AWAIT_IMAGE: + state = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF; + r = set_mode_async(MODE_AWAIT_FINGER_OFF); + break; + case STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF: + state = STATE_AWAIT_IRQ_FINGER_REMOVED; + break; + default: + printf("unrecognised state %d\n", state); + } + if (r < 0) { + fprintf(stderr, "error detected changing state\n"); + return r; + } + + printf("new state: %d\n", state); + return 0; +} + +static void LIBUSB_CALL cb_irq(struct libusb_transfer *transfer) +{ + unsigned char irqtype = transfer->buffer[0]; + + if (transfer->status != LIBUSB_TRANSFER_COMPLETED) { + fprintf(stderr, "irq transfer status %d?\n", transfer->status); + irq_transfer = NULL; + request_exit(2); + return; + } + + printf("IRQ callback %02x\n", irqtype); + switch (state) { + case STATE_AWAIT_IRQ_FINGER_DETECTED: + if (irqtype == 0x01) { + if (next_state() < 0) { + request_exit(2); + return; + } + } else { + printf("finger-on-sensor detected in wrong state!\n"); + } + break; + case STATE_AWAIT_IRQ_FINGER_REMOVED: + if (irqtype == 0x02) { + if (next_state() < 0) { + request_exit(2); + return; + } + } else { + printf("finger-on-sensor detected in wrong state!\n"); + } + break; + } + if (libusb_submit_transfer(irq_transfer) < 0) + request_exit(2); +} + +static void LIBUSB_CALL cb_img(struct libusb_transfer *transfer) +{ + if (transfer->status != LIBUSB_TRANSFER_COMPLETED) { + fprintf(stderr, "img transfer status %d?\n", transfer->status); + img_transfer = NULL; + request_exit(2); + return; + } + + printf("Image callback\n"); + save_to_file(imgbuf); + if (next_state() < 0) { + request_exit(2); + return; + } + if (libusb_submit_transfer(img_transfer) < 0) + request_exit(2); +} + +static int init_capture(void) +{ + int r; + + r = libusb_submit_transfer(irq_transfer); + if (r < 0) + return r; + + r = libusb_submit_transfer(img_transfer); + if (r < 0) { + libusb_cancel_transfer(irq_transfer); + while (irq_transfer) + if (libusb_handle_events(NULL) < 0) + break; + return r; + } + + /* start state machine */ + state = STATE_AWAIT_IRQ_FINGER_REMOVED; + return next_state(); +} + +static int do_init(void) +{ + unsigned char status; + int r; + + r = get_hwstat(&status); + if (r < 0) + return r; + + if (!(status & 0x80)) { + r = set_hwstat(status | 0x80); + if (r < 0) + return r; + r = get_hwstat(&status); + if (r < 0) + return r; + } + + status &= ~0x80; + r = set_hwstat(status); + if (r < 0) + return r; + + r = get_hwstat(&status); + if (r < 0) + return r; + + r = sync_intr(0x56); + if (r < 0) + return r; + + return 0; +} + +static int alloc_transfers(void) +{ + img_transfer = libusb_alloc_transfer(0); + if (!img_transfer) + return -ENOMEM; + + irq_transfer = libusb_alloc_transfer(0); + if (!irq_transfer) + return -ENOMEM; + + libusb_fill_bulk_transfer(img_transfer, devh, EP_DATA, imgbuf, + sizeof(imgbuf), cb_img, NULL, 0); + libusb_fill_interrupt_transfer(irq_transfer, devh, EP_INTR, irqbuf, + sizeof(irqbuf), cb_irq, NULL, 0); + + return 0; +} + +static void sighandler(int signum) +{ + request_exit(1); +} + +int main(void) +{ + struct sigaction sigact; + int r = 1; + + r = libusb_init(NULL); + if (r < 0) { + fprintf(stderr, "failed to initialise libusb\n"); + exit(1); + } + + r = find_dpfp_device(); + if (r < 0) { + fprintf(stderr, "Could not find/open device\n"); + goto out; + } + + r = libusb_claim_interface(devh, 0); + if (r < 0) { + fprintf(stderr, "usb_claim_interface error %d %s\n", r, strerror(-r)); + goto out; + } + printf("claimed interface\n"); + + r = print_f0_data(); + if (r < 0) + goto out_release; + + r = do_init(); + if (r < 0) + goto out_deinit; + + /* async from here onwards */ + + sigact.sa_handler = sighandler; + sigemptyset(&sigact.sa_mask); + sigact.sa_flags = 0; + sigaction(SIGINT, &sigact, NULL); + sigaction(SIGTERM, &sigact, NULL); + sigaction(SIGQUIT, &sigact, NULL); + + r = pthread_create(&poll_thread, NULL, poll_thread_main, NULL); + if (r) + goto out_deinit; + + r = alloc_transfers(); + if (r < 0) { + request_exit(1); + pthread_join(poll_thread, NULL); + goto out_deinit; + } + + r = init_capture(); + if (r < 0) { + request_exit(1); + pthread_join(poll_thread, NULL); + goto out_deinit; + } + + while (!do_exit) { + pthread_mutex_lock(&exit_cond_lock); + pthread_cond_wait(&exit_cond, &exit_cond_lock); + pthread_mutex_unlock(&exit_cond_lock); + } + + printf("shutting down...\n"); + pthread_join(poll_thread, NULL); + + r = libusb_cancel_transfer(irq_transfer); + if (r < 0) { + request_exit(1); + goto out_deinit; + } + + r = libusb_cancel_transfer(img_transfer); + if (r < 0) { + request_exit(1); + goto out_deinit; + } + + while (img_transfer || irq_transfer) + if (libusb_handle_events(NULL) < 0) + break; + + if (do_exit == 1) + r = 0; + else + r = 1; + +out_deinit: + libusb_free_transfer(img_transfer); + libusb_free_transfer(irq_transfer); + set_mode(0); + set_hwstat(0x80); +out_release: + libusb_release_interface(devh, 0); +out: + libusb_close(devh); + libusb_exit(NULL); + return r >= 0 ? r : -r; +} diff --git a/Externals/libusb/examples/ezusb.c b/Externals/libusb/examples/ezusb.c new file mode 100644 index 0000000000..f369e5094a --- /dev/null +++ b/Externals/libusb/examples/ezusb.c @@ -0,0 +1,831 @@ +/* + * Copyright © 2001 Stephen Williams (steve@icarus.com) + * Copyright © 2001-2002 David Brownell (dbrownell@users.sourceforge.net) + * Copyright © 2008 Roger Williams (rawqux@users.sourceforge.net) + * Copyright © 2012 Pete Batard (pete@akeo.ie) + * Copyright © 2013 Federico Manzan (f.manzan@gmail.com) + * + * This source code is free software; you can redistribute it + * and/or modify it in source code form under the terms of the GNU + * General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ +#include +#include +#include +#include +#include + +#include "libusb.h" +#include "ezusb.h" + +extern void logerror(const char *format, ...) + __attribute__ ((format(printf, 1, 2))); + +/* + * This file contains functions for uploading firmware into Cypress + * EZ-USB microcontrollers. These chips use control endpoint 0 and vendor + * specific commands to support writing into the on-chip SRAM. They also + * support writing into the CPUCS register, which is how we reset the + * processor after loading firmware (including the reset vector). + * + * These Cypress devices are 8-bit 8051 based microcontrollers with + * special support for USB I/O. They come in several packages, and + * some can be set up with external memory when device costs allow. + * Note that the design was originally by AnchorChips, so you may find + * references to that vendor (which was later merged into Cypress). + * The Cypress FX parts are largely compatible with the Anchorhip ones. + */ + +int verbose = 1; + +/* + * return true if [addr,addr+len] includes external RAM + * for Anchorchips EZ-USB or Cypress EZ-USB FX + */ +static bool fx_is_external(uint32_t addr, size_t len) +{ + /* with 8KB RAM, 0x0000-0x1b3f can be written + * we can't tell if it's a 4KB device here + */ + if (addr <= 0x1b3f) + return ((addr + len) > 0x1b40); + + /* there may be more RAM; unclear if we can write it. + * some bulk buffers may be unused, 0x1b3f-0x1f3f + * firmware can set ISODISAB for 2KB at 0x2000-0x27ff + */ + return true; +} + +/* + * return true if [addr,addr+len] includes external RAM + * for Cypress EZ-USB FX2 + */ +static bool fx2_is_external(uint32_t addr, size_t len) +{ + /* 1st 8KB for data/code, 0x0000-0x1fff */ + if (addr <= 0x1fff) + return ((addr + len) > 0x2000); + + /* and 512 for data, 0xe000-0xe1ff */ + else if (addr >= 0xe000 && addr <= 0xe1ff) + return ((addr + len) > 0xe200); + + /* otherwise, it's certainly external */ + else + return true; +} + +/* + * return true if [addr,addr+len] includes external RAM + * for Cypress EZ-USB FX2LP + */ +static bool fx2lp_is_external(uint32_t addr, size_t len) +{ + /* 1st 16KB for data/code, 0x0000-0x3fff */ + if (addr <= 0x3fff) + return ((addr + len) > 0x4000); + + /* and 512 for data, 0xe000-0xe1ff */ + else if (addr >= 0xe000 && addr <= 0xe1ff) + return ((addr + len) > 0xe200); + + /* otherwise, it's certainly external */ + else + return true; +} + + +/*****************************************************************************/ + +/* + * These are the requests (bRequest) that the bootstrap loader is expected + * to recognize. The codes are reserved by Cypress, and these values match + * what EZ-USB hardware, or "Vend_Ax" firmware (2nd stage loader) uses. + * Cypress' "a3load" is nice because it supports both FX and FX2, although + * it doesn't have the EEPROM support (subset of "Vend_Ax"). + */ +#define RW_INTERNAL 0xA0 /* hardware implements this one */ +#define RW_MEMORY 0xA3 + +/* + * Issues the specified vendor-specific write request. + */ +static int ezusb_write(libusb_device_handle *device, const char *label, + uint8_t opcode, uint32_t addr, const unsigned char *data, size_t len) +{ + int status; + + if (verbose > 1) + logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len); + status = libusb_control_transfer(device, + LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE, + opcode, addr & 0xFFFF, addr >> 16, + (unsigned char*)data, (uint16_t)len, 1000); + if (status != len) { + if (status < 0) + logerror("%s: %s\n", label, libusb_error_name(status)); + else + logerror("%s ==> %d\n", label, status); + } + return (status < 0) ? -EIO : 0; +} + +/* + * Issues the specified vendor-specific read request. + */ +static int ezusb_read(libusb_device_handle *device, const char *label, + uint8_t opcode, uint32_t addr, const unsigned char *data, size_t len) +{ + int status; + + if (verbose > 1) + logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len); + status = libusb_control_transfer(device, + LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE, + opcode, addr & 0xFFFF, addr >> 16, + (unsigned char*)data, (uint16_t)len, 1000); + if (status != len) { + if (status < 0) + logerror("%s: %s\n", label, libusb_error_name(status)); + else + logerror("%s ==> %d\n", label, status); + } + return (status < 0) ? -EIO : 0; +} + +/* + * Modifies the CPUCS register to stop or reset the CPU. + * Returns false on error. + */ +static bool ezusb_cpucs(libusb_device_handle *device, uint32_t addr, bool doRun) +{ + int status; + uint8_t data = doRun ? 0x00 : 0x01; + + if (verbose) + logerror("%s\n", data ? "stop CPU" : "reset CPU"); + status = libusb_control_transfer(device, + LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE, + RW_INTERNAL, addr & 0xFFFF, addr >> 16, + &data, 1, 1000); + if ((status != 1) && + /* We may get an I/O error from libusb as the device disappears */ + ((!doRun) || (status != LIBUSB_ERROR_IO))) + { + const char *mesg = "can't modify CPUCS"; + if (status < 0) + logerror("%s: %s\n", mesg, libusb_error_name(status)); + else + logerror("%s\n", mesg); + return false; + } else + return true; +} + +/* + * Send an FX3 jumpt to address command + * Returns false on error. + */ +static bool ezusb_fx3_jump(libusb_device_handle *device, uint32_t addr) +{ + int status; + + if (verbose) + logerror("transfer execution to Program Entry at 0x%08x\n", addr); + status = libusb_control_transfer(device, + LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE, + RW_INTERNAL, addr & 0xFFFF, addr >> 16, + NULL, 0, 1000); + /* We may get an I/O error from libusb as the device disappears */ + if ((status != 0) && (status != LIBUSB_ERROR_IO)) + { + const char *mesg = "failed to send jump command"; + if (status < 0) + logerror("%s: %s\n", mesg, libusb_error_name(status)); + else + logerror("%s\n", mesg); + return false; + } else + return true; +} + +/*****************************************************************************/ + +/* + * Parse an Intel HEX image file and invoke the poke() function on the + * various segments to implement policies such as writing to RAM (with + * a one or two stage loader setup, depending on the firmware) or to + * EEPROM (two stages required). + * + * image - the hex image file + * context - for use by poke() + * is_external - if non-null, used to check which segments go into + * external memory (writable only by software loader) + * poke - called with each memory segment; errors indicated + * by returning negative values. + * + * Caller is responsible for halting CPU as needed, such as when + * overwriting a second stage loader. + */ +static int parse_ihex(FILE *image, void *context, + bool (*is_external)(uint32_t addr, size_t len), + int (*poke) (void *context, uint32_t addr, bool external, + const unsigned char *data, size_t len)) +{ + unsigned char data[1023]; + uint32_t data_addr = 0; + size_t data_len = 0; + int rc; + int first_line = 1; + bool external = false; + + /* Read the input file as an IHEX file, and report the memory segments + * as we go. Each line holds a max of 16 bytes, but uploading is + * faster (and EEPROM space smaller) if we merge those lines into larger + * chunks. Most hex files keep memory segments together, which makes + * such merging all but free. (But it may still be worth sorting the + * hex files to make up for undesirable behavior from tools.) + * + * Note that EEPROM segments max out at 1023 bytes; the upload protocol + * allows segments of up to 64 KBytes (more than a loader could handle). + */ + for (;;) { + char buf[512], *cp; + char tmp, type; + size_t len; + unsigned idx, off; + + cp = fgets(buf, sizeof(buf), image); + if (cp == NULL) { + logerror("EOF without EOF record!\n"); + break; + } + + /* EXTENSION: "# comment-till-end-of-line", for copyrights etc */ + if (buf[0] == '#') + continue; + + if (buf[0] != ':') { + logerror("not an ihex record: %s", buf); + return -2; + } + + /* ignore any newline */ + cp = strchr(buf, '\n'); + if (cp) + *cp = 0; + + if (verbose >= 3) + logerror("** LINE: %s\n", buf); + + /* Read the length field (up to 16 bytes) */ + tmp = buf[3]; + buf[3] = 0; + len = strtoul(buf+1, NULL, 16); + buf[3] = tmp; + + /* Read the target offset (address up to 64KB) */ + tmp = buf[7]; + buf[7] = 0; + off = (int)strtoul(buf+3, NULL, 16); + buf[7] = tmp; + + /* Initialize data_addr */ + if (first_line) { + data_addr = off; + first_line = 0; + } + + /* Read the record type */ + tmp = buf[9]; + buf[9] = 0; + type = (char)strtoul(buf+7, NULL, 16); + buf[9] = tmp; + + /* If this is an EOF record, then make it so. */ + if (type == 1) { + if (verbose >= 2) + logerror("EOF on hexfile\n"); + break; + } + + if (type != 0) { + logerror("unsupported record type: %u\n", type); + return -3; + } + + if ((len * 2) + 11 > strlen(buf)) { + logerror("record too short?\n"); + return -4; + } + + /* FIXME check for _physically_ contiguous not just virtually + * e.g. on FX2 0x1f00-0x2100 includes both on-chip and external + * memory so it's not really contiguous */ + + /* flush the saved data if it's not contiguous, + * or when we've buffered as much as we can. + */ + if (data_len != 0 + && (off != (data_addr + data_len) + /* || !merge */ + || (data_len + len) > sizeof(data))) { + if (is_external) + external = is_external(data_addr, data_len); + rc = poke(context, data_addr, external, data, data_len); + if (rc < 0) + return -1; + data_addr = off; + data_len = 0; + } + + /* append to saved data, flush later */ + for (idx = 0, cp = buf+9 ; idx < len ; idx += 1, cp += 2) { + tmp = cp[2]; + cp[2] = 0; + data[data_len + idx] = (uint8_t)strtoul(cp, NULL, 16); + cp[2] = tmp; + } + data_len += len; + } + + + /* flush any data remaining */ + if (data_len != 0) { + if (is_external) + external = is_external(data_addr, data_len); + rc = poke(context, data_addr, external, data, data_len); + if (rc < 0) + return -1; + } + return 0; +} + +/* + * Parse a binary image file and write it as is to the target. + * Applies to Cypress BIX images for RAM or Cypress IIC images + * for EEPROM. + * + * image - the BIX image file + * context - for use by poke() + * is_external - if non-null, used to check which segments go into + * external memory (writable only by software loader) + * poke - called with each memory segment; errors indicated + * by returning negative values. + * + * Caller is responsible for halting CPU as needed, such as when + * overwriting a second stage loader. + */ +static int parse_bin(FILE *image, void *context, + bool (*is_external)(uint32_t addr, size_t len), int (*poke)(void *context, + uint32_t addr, bool external, const unsigned char *data, size_t len)) +{ + unsigned char data[4096]; + uint32_t data_addr = 0; + size_t data_len = 0; + int rc; + bool external = false; + + for (;;) { + data_len = fread(data, 1, 4096, image); + if (data_len == 0) + break; + if (is_external) + external = is_external(data_addr, data_len); + rc = poke(context, data_addr, external, data, data_len); + if (rc < 0) + return -1; + data_addr += (uint32_t)data_len; + } + return feof(image)?0:-1; +} + +/* + * Parse a Cypress IIC image file and invoke the poke() function on the + * various segments for writing to RAM + * + * image - the IIC image file + * context - for use by poke() + * is_external - if non-null, used to check which segments go into + * external memory (writable only by software loader) + * poke - called with each memory segment; errors indicated + * by returning negative values. + * + * Caller is responsible for halting CPU as needed, such as when + * overwriting a second stage loader. + */ +static int parse_iic(FILE *image, void *context, + bool (*is_external)(uint32_t addr, size_t len), + int (*poke)(void *context, uint32_t addr, bool external, const unsigned char *data, size_t len)) +{ + unsigned char data[4096]; + uint32_t data_addr = 0; + size_t data_len = 0, read_len; + uint8_t block_header[4]; + int rc; + bool external = false; + long file_size, initial_pos; + + initial_pos = ftell(image); + if (initial_pos < 0) + return -1; + + if (fseek(image, 0L, SEEK_END) != 0) + return -1; + file_size = ftell(image); + if (fseek(image, initial_pos, SEEK_SET) != 0) + return -1; + for (;;) { + /* Ignore the trailing reset IIC data (5 bytes) */ + if (ftell(image) >= (file_size - 5)) + break; + if (fread(&block_header, 1, sizeof(block_header), image) != 4) { + logerror("unable to read IIC block header\n"); + return -1; + } + data_len = (block_header[0] << 8) + block_header[1]; + data_addr = (block_header[2] << 8) + block_header[3]; + if (data_len > sizeof(data)) { + /* If this is ever reported as an error, switch to using malloc/realloc */ + logerror("IIC data block too small - please report this error to libusb.info\n"); + return -1; + } + read_len = fread(data, 1, data_len, image); + if (read_len != data_len) { + logerror("read error\n"); + return -1; + } + if (is_external) + external = is_external(data_addr, data_len); + rc = poke(context, data_addr, external, data, data_len); + if (rc < 0) + return -1; + } + return 0; +} + +/* the parse call will be selected according to the image type */ +static int (*parse[IMG_TYPE_MAX])(FILE *image, void *context, bool (*is_external)(uint32_t addr, size_t len), + int (*poke)(void *context, uint32_t addr, bool external, const unsigned char *data, size_t len)) + = { parse_ihex, parse_iic, parse_bin }; + +/*****************************************************************************/ + +/* + * For writing to RAM using a first (hardware) or second (software) + * stage loader and 0xA0 or 0xA3 vendor requests + */ +typedef enum { + _undef = 0, + internal_only, /* hardware first-stage loader */ + skip_internal, /* first phase, second-stage loader */ + skip_external /* second phase, second-stage loader */ +} ram_mode; + +struct ram_poke_context { + libusb_device_handle *device; + ram_mode mode; + size_t total, count; +}; + +#define RETRY_LIMIT 5 + +static int ram_poke(void *context, uint32_t addr, bool external, + const unsigned char *data, size_t len) +{ + struct ram_poke_context *ctx = (struct ram_poke_context*)context; + int rc; + unsigned retry = 0; + + switch (ctx->mode) { + case internal_only: /* CPU should be stopped */ + if (external) { + logerror("can't write %u bytes external memory at 0x%08x\n", + (unsigned)len, addr); + return -EINVAL; + } + break; + case skip_internal: /* CPU must be running */ + if (!external) { + if (verbose >= 2) { + logerror("SKIP on-chip RAM, %u bytes at 0x%08x\n", + (unsigned)len, addr); + } + return 0; + } + break; + case skip_external: /* CPU should be stopped */ + if (external) { + if (verbose >= 2) { + logerror("SKIP external RAM, %u bytes at 0x%08x\n", + (unsigned)len, addr); + } + return 0; + } + break; + case _undef: + default: + logerror("bug\n"); + return -EDOM; + } + + ctx->total += len; + ctx->count++; + + /* Retry this till we get a real error. Control messages are not + * NAKed (just dropped) so time out means is a real problem. + */ + while ((rc = ezusb_write(ctx->device, + external ? "write external" : "write on-chip", + external ? RW_MEMORY : RW_INTERNAL, + addr, data, len)) < 0 + && retry < RETRY_LIMIT) { + if (rc != LIBUSB_ERROR_TIMEOUT) + break; + retry += 1; + } + return rc; +} + +/* + * Load a Cypress Image file into target RAM. + * See http://www.cypress.com/?docID=41351 (AN76405 PDF) for more info. + */ +static int fx3_load_ram(libusb_device_handle *device, const char *path) +{ + uint32_t dCheckSum, dExpectedCheckSum, dAddress, i, dLen, dLength; + uint32_t* dImageBuf; + unsigned char *bBuf, hBuf[4], blBuf[4], rBuf[4096]; + FILE *image; + int ret = 0; + + image = fopen(path, "rb"); + if (image == NULL) { + logerror("unable to open '%s' for input\n", path); + return -2; + } else if (verbose) + logerror("open firmware image %s for RAM upload\n", path); + + // Read header + if (fread(hBuf, sizeof(char), sizeof(hBuf), image) != sizeof(hBuf)) { + logerror("could not read image header"); + ret = -3; + goto exit; + } + + // check "CY" signature byte and format + if ((hBuf[0] != 'C') || (hBuf[1] != 'Y')) { + logerror("image doesn't have a CYpress signature\n"); + ret = -3; + goto exit; + } + + // Check bImageType + switch(hBuf[3]) { + case 0xB0: + if (verbose) + logerror("normal FW binary %s image with checksum\n", (hBuf[2]&0x01)?"data":"executable"); + break; + case 0xB1: + logerror("security binary image is not currently supported\n"); + ret = -3; + goto exit; + case 0xB2: + logerror("VID:PID image is not currently supported\n"); + ret = -3; + goto exit; + default: + logerror("invalid image type 0x%02X\n", hBuf[3]); + ret = -3; + goto exit; + } + + // Read the bootloader version + if (verbose) { + if ((ezusb_read(device, "read bootloader version", RW_INTERNAL, 0xFFFF0020, blBuf, 4) < 0)) { + logerror("Could not read bootloader version\n"); + ret = -8; + goto exit; + } + logerror("FX3 bootloader version: 0x%02X%02X%02X%02X\n", blBuf[3], blBuf[2], blBuf[1], blBuf[0]); + } + + dCheckSum = 0; + if (verbose) + logerror("writing image...\n"); + while (1) { + if ((fread(&dLength, sizeof(uint32_t), 1, image) != 1) || // read dLength + (fread(&dAddress, sizeof(uint32_t), 1, image) != 1)) { // read dAddress + logerror("could not read image"); + ret = -3; + goto exit; + } + if (dLength == 0) + break; // done + + // coverity[tainted_data] + dImageBuf = (uint32_t*)calloc(dLength, sizeof(uint32_t)); + if (dImageBuf == NULL) { + logerror("could not allocate buffer for image chunk\n"); + ret = -4; + goto exit; + } + + // read sections + if (fread(dImageBuf, sizeof(uint32_t), dLength, image) != dLength) { + logerror("could not read image"); + free(dImageBuf); + ret = -3; + goto exit; + } + for (i = 0; i < dLength; i++) + dCheckSum += dImageBuf[i]; + dLength <<= 2; // convert to Byte length + bBuf = (unsigned char*) dImageBuf; + + while (dLength > 0) { + dLen = 4096; // 4K max + if (dLen > dLength) + dLen = dLength; + if ((ezusb_write(device, "write firmware", RW_INTERNAL, dAddress, bBuf, dLen) < 0) || + (ezusb_read(device, "read firmware", RW_INTERNAL, dAddress, rBuf, dLen) < 0)) { + logerror("R/W error\n"); + free(dImageBuf); + ret = -5; + goto exit; + } + // Verify data: rBuf with bBuf + for (i = 0; i < dLen; i++) { + if (rBuf[i] != bBuf[i]) { + logerror("verify error"); + free(dImageBuf); + ret = -6; + goto exit; + } + } + + dLength -= dLen; + bBuf += dLen; + dAddress += dLen; + } + free(dImageBuf); + } + + // read pre-computed checksum data + if ((fread(&dExpectedCheckSum, sizeof(uint32_t), 1, image) != 1) || + (dCheckSum != dExpectedCheckSum)) { + logerror("checksum error\n"); + ret = -7; + goto exit; + } + + // transfer execution to Program Entry + if (!ezusb_fx3_jump(device, dAddress)) { + ret = -6; + } + +exit: + fclose(image); + return ret; +} + +/* + * Load a firmware file into target RAM. device is the open libusb + * device, and the path is the name of the source file. Open the file, + * parse the bytes, and write them in one or two phases. + * + * If stage == 0, this uses the first stage loader, built into EZ-USB + * hardware but limited to writing on-chip memory or CPUCS. Everything + * is written during one stage, unless there's an error such as the image + * holding data that needs to be written to external memory. + * + * Otherwise, things are written in two stages. First the external + * memory is written, expecting a second stage loader to have already + * been loaded. Then file is re-parsed and on-chip memory is written. + */ +int ezusb_load_ram(libusb_device_handle *device, const char *path, int fx_type, int img_type, int stage) +{ + FILE *image; + uint32_t cpucs_addr; + bool (*is_external)(uint32_t off, size_t len); + struct ram_poke_context ctx; + int status; + uint8_t iic_header[8] = { 0 }; + int ret = 0; + + if (fx_type == FX_TYPE_FX3) + return fx3_load_ram(device, path); + + image = fopen(path, "rb"); + if (image == NULL) { + logerror("%s: unable to open for input.\n", path); + return -2; + } else if (verbose > 1) + logerror("open firmware image %s for RAM upload\n", path); + + if (img_type == IMG_TYPE_IIC) { + if ( (fread(iic_header, 1, sizeof(iic_header), image) != sizeof(iic_header)) + || (((fx_type == FX_TYPE_FX2LP) || (fx_type == FX_TYPE_FX2)) && (iic_header[0] != 0xC2)) + || ((fx_type == FX_TYPE_AN21) && (iic_header[0] != 0xB2)) + || ((fx_type == FX_TYPE_FX1) && (iic_header[0] != 0xB6)) ) { + logerror("IIC image does not contain executable code - cannot load to RAM.\n"); + ret = -1; + goto exit; + } + } + + /* EZ-USB original/FX and FX2 devices differ, apart from the 8051 core */ + switch(fx_type) { + case FX_TYPE_FX2LP: + cpucs_addr = 0xe600; + is_external = fx2lp_is_external; + break; + case FX_TYPE_FX2: + cpucs_addr = 0xe600; + is_external = fx2_is_external; + break; + default: + cpucs_addr = 0x7f92; + is_external = fx_is_external; + break; + } + + /* use only first stage loader? */ + if (stage == 0) { + ctx.mode = internal_only; + + /* if required, halt the CPU while we overwrite its code/data */ + if (cpucs_addr && !ezusb_cpucs(device, cpucs_addr, false)) + { + ret = -1; + goto exit; + } + + /* 2nd stage, first part? loader was already uploaded */ + } else { + ctx.mode = skip_internal; + + /* let CPU run; overwrite the 2nd stage loader later */ + if (verbose) + logerror("2nd stage: write external memory\n"); + } + + /* scan the image, first (maybe only) time */ + ctx.device = device; + ctx.total = ctx.count = 0; + status = parse[img_type](image, &ctx, is_external, ram_poke); + if (status < 0) { + logerror("unable to upload %s\n", path); + ret = status; + goto exit; + } + + /* second part of 2nd stage: rescan */ + // TODO: what should we do for non HEX images there? + if (stage) { + ctx.mode = skip_external; + + /* if needed, halt the CPU while we overwrite the 1st stage loader */ + if (cpucs_addr && !ezusb_cpucs(device, cpucs_addr, false)) + { + ret = -1; + goto exit; + } + + /* at least write the interrupt vectors (at 0x0000) for reset! */ + rewind(image); + if (verbose) + logerror("2nd stage: write on-chip memory\n"); + status = parse_ihex(image, &ctx, is_external, ram_poke); + if (status < 0) { + logerror("unable to completely upload %s\n", path); + ret = status; + goto exit; + } + } + + if (verbose && (ctx.count != 0)) { + logerror("... WROTE: %d bytes, %d segments, avg %d\n", + (int)ctx.total, (int)ctx.count, (int)(ctx.total/ctx.count)); + } + + /* if required, reset the CPU so it runs what we just uploaded */ + if (cpucs_addr && !ezusb_cpucs(device, cpucs_addr, true)) + ret = -1; + +exit: + fclose(image); + return ret; +} diff --git a/Externals/libusb/examples/ezusb.h b/Externals/libusb/examples/ezusb.h new file mode 100644 index 0000000000..cd0776de7b --- /dev/null +++ b/Externals/libusb/examples/ezusb.h @@ -0,0 +1,120 @@ +#ifndef __ezusb_H +#define __ezusb_H +/* + * Copyright © 2001 Stephen Williams (steve@icarus.com) + * Copyright © 2002 David Brownell (dbrownell@users.sourceforge.net) + * Copyright © 2013 Federico Manzan (f.manzan@gmail.com) + * + * This source code is free software; you can redistribute it + * and/or modify it in source code form under the terms of the GNU + * General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ +#if !defined(_MSC_VER) +#include +#else +#define __attribute__(x) +#if !defined(bool) +#define bool int +#endif +#if !defined(true) +#define true (1 == 1) +#endif +#if !defined(false) +#define false (!true) +#endif +#if defined(_PREFAST_) +#pragma warning(disable:28193) +#endif +#endif + +#define FX_TYPE_UNDEFINED -1 +#define FX_TYPE_AN21 0 /* Original AnchorChips parts */ +#define FX_TYPE_FX1 1 /* Updated Cypress versions */ +#define FX_TYPE_FX2 2 /* USB 2.0 versions */ +#define FX_TYPE_FX2LP 3 /* Updated FX2 */ +#define FX_TYPE_FX3 4 /* USB 3.0 versions */ +#define FX_TYPE_MAX 5 +#define FX_TYPE_NAMES { "an21", "fx", "fx2", "fx2lp", "fx3" } + +#define IMG_TYPE_UNDEFINED -1 +#define IMG_TYPE_HEX 0 /* Intel HEX */ +#define IMG_TYPE_IIC 1 /* Cypress 8051 IIC */ +#define IMG_TYPE_BIX 2 /* Cypress 8051 BIX */ +#define IMG_TYPE_IMG 3 /* Cypress IMG format */ +#define IMG_TYPE_MAX 4 +#define IMG_TYPE_NAMES { "Intel HEX", "Cypress 8051 IIC", "Cypress 8051 BIX", "Cypress IMG format" } + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Automatically identified devices (VID, PID, type, designation). + * TODO: Could use some validation. Also where's the FX2? + */ +typedef struct { + uint16_t vid; + uint16_t pid; + int type; + const char* designation; +} fx_known_device; + +#define FX_KNOWN_DEVICES { \ + { 0x0547, 0x2122, FX_TYPE_AN21, "Cypress EZ-USB (2122S)" },\ + { 0x0547, 0x2125, FX_TYPE_AN21, "Cypress EZ-USB (2121S/2125S)" },\ + { 0x0547, 0x2126, FX_TYPE_AN21, "Cypress EZ-USB (2126S)" },\ + { 0x0547, 0x2131, FX_TYPE_AN21, "Cypress EZ-USB (2131Q/2131S/2135S)" },\ + { 0x0547, 0x2136, FX_TYPE_AN21, "Cypress EZ-USB (2136S)" },\ + { 0x0547, 0x2225, FX_TYPE_AN21, "Cypress EZ-USB (2225)" },\ + { 0x0547, 0x2226, FX_TYPE_AN21, "Cypress EZ-USB (2226)" },\ + { 0x0547, 0x2235, FX_TYPE_AN21, "Cypress EZ-USB (2235)" },\ + { 0x0547, 0x2236, FX_TYPE_AN21, "Cypress EZ-USB (2236)" },\ + { 0x04b4, 0x6473, FX_TYPE_FX1, "Cypress EZ-USB FX1" },\ + { 0x04b4, 0x8613, FX_TYPE_FX2LP, "Cypress EZ-USB FX2LP (68013A/68014A/68015A/68016A)" }, \ + { 0x04b4, 0x00f3, FX_TYPE_FX3, "Cypress FX3" },\ +} + +/* + * This function uploads the firmware from the given file into RAM. + * Stage == 0 means this is a single stage load (or the first of + * two stages). Otherwise it's the second of two stages; the + * caller having preloaded the second stage loader. + * + * The target processor is reset at the end of this upload. + */ +extern int ezusb_load_ram(libusb_device_handle *device, + const char *path, int fx_type, int img_type, int stage); + +/* + * This function uploads the firmware from the given file into EEPROM. + * This uses the right CPUCS address to terminate the EEPROM load with + * a reset command where FX parts behave differently than FX2 ones. + * The configuration byte is as provided here (zero for an21xx parts) + * and the EEPROM type is set so that the microcontroller will boot + * from it. + * + * The caller must have preloaded a second stage loader that knows + * how to respond to the EEPROM write request. + */ +extern int ezusb_load_eeprom(libusb_device_handle *device, + const char *path, int fx_type, int img_type, int config); + +/* Verbosity level (default 1). Can be increased or decreased with options v/q */ +extern int verbose; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Externals/libusb/examples/fxload.c b/Externals/libusb/examples/fxload.c new file mode 100644 index 0000000000..f1d973b3b6 --- /dev/null +++ b/Externals/libusb/examples/fxload.c @@ -0,0 +1,287 @@ +/* + * Copyright © 2001 Stephen Williams (steve@icarus.com) + * Copyright © 2001-2002 David Brownell (dbrownell@users.sourceforge.net) + * Copyright © 2008 Roger Williams (rawqux@users.sourceforge.net) + * Copyright © 2012 Pete Batard (pete@akeo.ie) + * Copyright © 2013 Federico Manzan (f.manzan@gmail.com) + * + * This source code is free software; you can redistribute it + * and/or modify it in source code form under the terms of the GNU + * General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "libusb.h" +#include "ezusb.h" + +#if !defined(_WIN32) || defined(__CYGWIN__ ) +#include +static bool dosyslog = false; +#include +#define _stricmp strcasecmp +#endif + +#ifndef FXLOAD_VERSION +#define FXLOAD_VERSION (__DATE__ " (libusb)") +#endif + +#ifndef ARRAYSIZE +#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0])) +#endif + +void logerror(const char *format, ...) + __attribute__ ((format (__printf__, 1, 2))); + +void logerror(const char *format, ...) +{ + va_list ap; + va_start(ap, format); + +#if !defined(_WIN32) || defined(__CYGWIN__ ) + if (dosyslog) + vsyslog(LOG_ERR, format, ap); + else +#endif + vfprintf(stderr, format, ap); + va_end(ap); +} + +static int print_usage(int error_code) { + fprintf(stderr, "\nUsage: fxload [-v] [-V] [-t type] [-d vid:pid] [-p bus,addr] -i firmware\n"); + fprintf(stderr, " -i -- Firmware to upload\n"); + fprintf(stderr, " -t -- Target type: an21, fx, fx2, fx2lp, fx3\n"); + fprintf(stderr, " -d -- Target device, as an USB VID:PID\n"); + fprintf(stderr, " -p -- Target device, as a libusb bus number and device address path\n"); + fprintf(stderr, " -v -- Increase verbosity\n"); + fprintf(stderr, " -q -- Decrease verbosity (silent mode)\n"); + fprintf(stderr, " -V -- Print program version\n"); + return error_code; +} + +#define FIRMWARE 0 +#define LOADER 1 +int main(int argc, char*argv[]) +{ + fx_known_device known_device[] = FX_KNOWN_DEVICES; + const char *path[] = { NULL, NULL }; + const char *device_id = NULL; + const char *device_path = getenv("DEVICE"); + const char *type = NULL; + const char *fx_name[FX_TYPE_MAX] = FX_TYPE_NAMES; + const char *ext, *img_name[] = IMG_TYPE_NAMES; + int fx_type = FX_TYPE_UNDEFINED, img_type[ARRAYSIZE(path)]; + int i, j, opt, status; + unsigned vid = 0, pid = 0; + unsigned busnum = 0, devaddr = 0, _busnum, _devaddr; + libusb_device *dev, **devs; + libusb_device_handle *device = NULL; + struct libusb_device_descriptor desc; + + while ((opt = getopt(argc, argv, "qvV?hd:p:i:I:t:")) != EOF) + switch (opt) { + + case 'd': + device_id = optarg; + if (sscanf(device_id, "%x:%x" , &vid, &pid) != 2 ) { + fputs ("please specify VID & PID as \"vid:pid\" in hexadecimal format\n", stderr); + return -1; + } + break; + + case 'p': + device_path = optarg; + if (sscanf(device_path, "%u,%u", &busnum, &devaddr) != 2 ) { + fputs ("please specify bus number & device number as \"bus,dev\" in decimal format\n", stderr); + return -1; + } + break; + + case 'i': + case 'I': + path[FIRMWARE] = optarg; + break; + + case 'V': + puts(FXLOAD_VERSION); + return 0; + + case 't': + type = optarg; + break; + + case 'v': + verbose++; + break; + + case 'q': + verbose--; + break; + + case '?': + case 'h': + default: + return print_usage(-1); + + } + + if (path[FIRMWARE] == NULL) { + logerror("no firmware specified!\n"); + return print_usage(-1); + } + if ((device_id != NULL) && (device_path != NULL)) { + logerror("only one of -d or -p can be specified\n"); + return print_usage(-1); + } + + /* determine the target type */ + if (type != NULL) { + for (i=0; i= FX_TYPE_MAX) { + logerror("illegal microcontroller type: %s\n", type); + return print_usage(-1); + } + } + + /* open the device using libusb */ + status = libusb_init(NULL); + if (status < 0) { + logerror("libusb_init() failed: %s\n", libusb_error_name(status)); + return -1; + } + libusb_set_debug(NULL, verbose); + + /* try to pick up missing parameters from known devices */ + if ((type == NULL) || (device_id == NULL) || (device_path != NULL)) { + if (libusb_get_device_list(NULL, &devs) < 0) { + logerror("libusb_get_device_list() failed: %s\n", libusb_error_name(status)); + goto err; + } + for (i=0; (dev=devs[i]) != NULL; i++) { + _busnum = libusb_get_bus_number(dev); + _devaddr = libusb_get_device_address(dev); + if ((type != NULL) && (device_path != NULL)) { + // if both a type and bus,addr were specified, we just need to find our match + if ((libusb_get_bus_number(dev) == busnum) && (libusb_get_device_address(dev) == devaddr)) + break; + } else { + status = libusb_get_device_descriptor(dev, &desc); + if (status >= 0) { + if (verbose >= 3) { + logerror("examining %04x:%04x (%d,%d)\n", + desc.idVendor, desc.idProduct, _busnum, _devaddr); + } + for (j=0; j 1) + logerror("single stage: load on-chip memory\n"); + status = ezusb_load_ram(device, path[FIRMWARE], fx_type, img_type[FIRMWARE], 0); + + libusb_release_interface(device, 0); + libusb_close(device); + libusb_exit(NULL); + return status; +err: + libusb_exit(NULL); + return -1; +} diff --git a/Externals/libusb/examples/getopt/getopt.c b/Externals/libusb/examples/getopt/getopt.c new file mode 100644 index 0000000000..b7f26eb4b6 --- /dev/null +++ b/Externals/libusb/examples/getopt/getopt.c @@ -0,0 +1,1060 @@ +/* Getopt for GNU. + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to drepper@gnu.org + before changing it! + Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* This tells Alpha OSF/1 not to define a getopt prototype in . + Ditto for AIX 3.2 and . */ +#ifndef _NO_PROTO +# define _NO_PROTO +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if !defined __STDC__ || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +# ifndef const +# define const +# endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#define GETOPT_INTERFACE_VERSION 2 +#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +# include +# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +# define ELIDE_CODE +# endif +#endif + +#ifndef ELIDE_CODE + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +/* Don't include stdlib.h for non-GNU C libraries because some of them + contain conflicting prototypes for getopt. */ +# include +# include +#endif /* GNU C library. */ + +#ifdef VMS +# include +# if HAVE_STRING_H - 0 +# include +# endif +#endif + +#ifndef _ +/* This is for other GNU distributions with internationalized messages. */ +# if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC +# include +# ifndef _ +# define _(msgid) gettext (msgid) +# endif +# else +# define _(msgid) (msgid) +# endif +#endif + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* 1003.2 says this must be 1 before any call. */ +int optind = 1; + +/* Formerly, initialization of getopt depended on optind==0, which + causes problems with re-calling getopt as programs generally don't + know that. */ + +int __getopt_initialized; + +/* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + +static char *nextchar; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters. + + PERMUTE is the default. We permute the contents of ARGV as we scan, + so that eventually all the non-options are at the end. This allows options + to be given in any order, even with programs that were not written to + expect this. + + RETURN_IN_ORDER is an option available to programs that were written + to expect options and other ARGV-elements in any order and that care about + the ordering of the two. We describe each non-option ARGV-element + as if it were the argument of an option with character code 1. + Using `-' as the first character of the list of option characters + selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return -1 with `optind' != ARGC. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +/* Value of POSIXLY_CORRECT environment variable. */ +static char *posixly_correct; + +#ifdef __GNU_LIBRARY__ +/* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work + in GCC. */ +# include +# define my_index strchr +#else + +# if HAVE_STRING_H +# include +# else +# include +# endif + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +#ifndef getenv +#ifdef _MSC_VER +// DDK will complain if you don't use the stdlib defined getenv +#include +#else +extern char *getenv (); +#endif +#endif + +static char * +my_index (str, chr) + const char *str; + int chr; +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +/* If using GCC, we can safely declare strlen this way. + If not using GCC, it is ok not to declare it. */ +#ifdef __GNUC__ +/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. + That was relevant to code that was here before. */ +# if (!defined __STDC__ || !__STDC__) && !defined strlen +/* gcc with -traditional declares the built-in strlen to return int, + and has done so at least since version 2.4.5. -- rms. */ +extern int strlen (const char *); +# endif /* not __STDC__ */ +#endif /* __GNUC__ */ + +#endif /* not __GNU_LIBRARY__ */ + +/* Handle permutation of arguments. */ + +/* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first of them; + `last_nonopt' is the index after the last of them. */ + +static int first_nonopt; +static int last_nonopt; + +#ifdef _LIBC +/* Stored original parameters. + XXX This is no good solution. We should rather copy the args so + that we can compare them later. But we must not use malloc(3). */ +extern int __libc_argc; +extern char **__libc_argv; + +/* Bash 2.0 gives us an environment variable containing flags + indicating ARGV elements that should not be considered arguments. */ + +# ifdef USE_NONOPTION_FLAGS +/* Defined in getopt_init.c */ +extern char *__getopt_nonoption_flags; + +static int nonoption_flags_max_len; +static int nonoption_flags_len; +# endif + +# ifdef USE_NONOPTION_FLAGS +# define SWAP_FLAGS(ch1, ch2) \ + if (nonoption_flags_len > 0) \ + { \ + char __tmp = __getopt_nonoption_flags[ch1]; \ + __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ + __getopt_nonoption_flags[ch2] = __tmp; \ + } +# else +# define SWAP_FLAGS(ch1, ch2) +# endif +#else /* !_LIBC */ +# define SWAP_FLAGS(ch1, ch2) +#endif /* _LIBC */ + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +#if defined __STDC__ && __STDC__ +static void exchange (char **); +#endif + +static void +exchange (argv) + char **argv; +{ + int bottom = first_nonopt; + int middle = last_nonopt; + int top = optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + /* First make sure the handling of the `__getopt_nonoption_flags' + string can work normally. Our top argument must be in the range + of the string. */ + if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) + { + /* We must extend the array. The user plays games with us and + presents new arguments. */ + char *new_str = malloc (top + 1); + if (new_str == NULL) + nonoption_flags_len = nonoption_flags_max_len = 0; + else + { + memset (__mempcpy (new_str, __getopt_nonoption_flags, + nonoption_flags_max_len), + '\0', top + 1 - nonoption_flags_max_len); + nonoption_flags_max_len = top + 1; + __getopt_nonoption_flags = new_str; + } + } +#endif + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + SWAP_FLAGS (bottom + i, middle + i); + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + first_nonopt += (optind - last_nonopt); + last_nonopt = optind; +} + +/* Initialize the internal data when the first call is made. */ + +#if defined __STDC__ && __STDC__ +static const char *_getopt_initialize (int, char *const *, const char *); +#endif +static const char * +_getopt_initialize (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + first_nonopt = last_nonopt = optind; + + nextchar = NULL; + + posixly_correct = getenv ("POSIXLY_CORRECT"); + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (posixly_correct != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + if (posixly_correct == NULL + && argc == __libc_argc && argv == __libc_argv) + { + if (nonoption_flags_max_len == 0) + { + if (__getopt_nonoption_flags == NULL + || __getopt_nonoption_flags[0] == '\0') + nonoption_flags_max_len = -1; + else + { + const char *orig_str = __getopt_nonoption_flags; + int len = nonoption_flags_max_len = strlen (orig_str); + if (nonoption_flags_max_len < argc) + nonoption_flags_max_len = argc; + __getopt_nonoption_flags = + (char *) malloc (nonoption_flags_max_len); + if (__getopt_nonoption_flags == NULL) + nonoption_flags_max_len = -1; + else + memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), + '\0', nonoption_flags_max_len - len); + } + } + nonoption_flags_len = nonoption_flags_max_len; + } + else + nonoption_flags_len = 0; +#endif + + return optstring; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns -1. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +int +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; +{ + int print_errors = opterr; + if (optstring[0] == ':') + print_errors = 0; + + if (argc < 1) + return -1; + + optarg = NULL; + + if (optind == 0 || !__getopt_initialized) + { + if (optind == 0) + optind = 1; /* Don't scan ARGV[0], the program name. */ + optstring = _getopt_initialize (argc, argv, optstring); + __getopt_initialized = 1; + } + + /* Test whether ARGV[optind] points to a non-option argument. + Either it does not have option syntax, or there is an environment flag + from the shell indicating it is not an option. The later information + is only used when the used in the GNU libc. */ +#if defined _LIBC && defined USE_NONOPTION_FLAGS +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ + || (optind < nonoption_flags_len \ + && __getopt_nonoption_flags[optind] == '1')) +#else +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') +#endif + + if (nextchar == NULL || *nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been + moved back by the user (who may also have changed the arguments). */ + if (last_nonopt > optind) + last_nonopt = optind; + if (first_nonopt > optind) + first_nonopt = optind; + + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc && NONOPTION_P) + optind++; + last_nonopt = optind; + } + + /* The special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return -1; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if (NONOPTION_P) + { + if (ordering == REQUIRE_ORDER) + return -1; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + /* Decode the current option-ARGV-element. */ + + /* Check whether the ARGV-element is a long option. + + If long_only and the ARGV-element has the form "-f", where f is + a valid short option, don't consider it an abbreviated form of + a long option that starts with f. Otherwise there would be no + way to give the -f short option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an abbreviation of + the long option, just like "--fu", and not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + + if (longopts != NULL + && (argv[optind][1] == '-' + || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = -1; + int option_index; + + for (nameend = nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) + == (unsigned int) strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else if (long_only + || pfound->has_arg != p->has_arg + || pfound->flag != p->flag + || pfound->val != p->val) + /* Second or later nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (print_errors) + fprintf (stderr, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + optopt = 0; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + optind++; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (print_errors) + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + _("%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + _("%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[optind - 1][0], pfound->name); + } + + nextchar += strlen (nextchar); + + optopt = pfound->val; + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (print_errors) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + optopt = pfound->val; + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' + || my_index (optstring, *nextchar) == NULL) + { + if (print_errors) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, _("%s: unrecognized option `--%s'\n"), + argv[0], nextchar); + else + /* +option or -option */ + fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[optind][0], nextchar); + } + nextchar = (char *) ""; + optind++; + optopt = 0; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (print_errors) + { + if (posixly_correct) + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: illegal option -- %c\n"), + argv[0], c); + else + fprintf (stderr, _("%s: invalid option -- %c\n"), + argv[0], c); + } + optopt = c; + return '?'; + } + /* Convenience. Treat POSIX -W foo same as long option --foo */ + if (temp[0] == 'W' && temp[1] == ';') + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = 0; + int option_index; + + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (print_errors) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + return c; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + + /* optarg is now the argument, see if it's in the + table of longopts. */ + + for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p != NULL && p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + if (ambig && !exact) + { + if (print_errors) + fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + return '?'; + } + if (pfound != NULL) + { + option_index = indfound; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (print_errors) + fprintf (stderr, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name); + + nextchar += strlen (nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (print_errors) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + nextchar = NULL; + return 'W'; /* Let the application handle it. */ + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = NULL; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (print_errors) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, + _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int +getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +#endif /* Not ELIDE_CODE. */ + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == -1) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/Externals/libusb/examples/getopt/getopt.h b/Externals/libusb/examples/getopt/getopt.h new file mode 100644 index 0000000000..a1b8dd6658 --- /dev/null +++ b/Externals/libusb/examples/getopt/getopt.h @@ -0,0 +1,180 @@ +/* Declarations for getopt. + Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _GETOPT_H + +#ifndef __need_getopt +# define _GETOPT_H 1 +#endif + +/* If __GNU_LIBRARY__ is not already defined, either we are being used + standalone, or this is the first header included in the source file. + If we are being used with glibc, we need to include , but + that does not exist if we are standalone. So: if __GNU_LIBRARY__ is + not defined, include , which will pull in for us + if it's from glibc. (Why ctype.h? It's guaranteed to exist and it + doesn't flood the namespace with stuff the way some other headers do.) */ +#if !defined __GNU_LIBRARY__ +# include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +#ifndef __need_getopt +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +# if (defined __STDC__ && __STDC__) || defined __cplusplus + const char *name; +# else + char *name; +# endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +# define no_argument 0 +# define required_argument 1 +# define optional_argument 2 +#endif /* need getopt */ + + +/* Get definitions and prototypes for functions to process the + arguments in ARGV (ARGC of them, minus the program name) for + options given in OPTS. + + Return the option character from OPTS just read. Return -1 when + there are no more options. For unrecognized options, or options + missing arguments, `optopt' is set to the option letter, and '?' is + returned. + + The OPTS string is a list of characters which are recognized option + letters, optionally followed by colons, specifying that that letter + takes an argument, to be placed in `optarg'. + + If a letter in OPTS is followed by two colons, its argument is + optional. This behavior is specific to the GNU `getopt'. + + The argument `--' causes premature termination of argument + scanning, explicitly telling `getopt' that there are no more + options. + + If OPTS begins with `--', then non-option arguments are treated as + arguments to the option '\0'. This behavior is specific to the GNU + `getopt'. */ + +#if (defined __STDC__ && __STDC__) || defined __cplusplus +# ifdef __GNU_LIBRARY__ +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int __argc, char *const *__argv, const char *__shortopts); +# else /* not __GNU_LIBRARY__ */ +extern int getopt (); +# endif /* __GNU_LIBRARY__ */ + +# ifndef __need_getopt +extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, + const struct option *__longopts, int *__longind); +extern int getopt_long_only (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only); +# endif +#else /* not __STDC__ */ +extern int getopt (); +# ifndef __need_getopt +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +# endif +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +/* Make sure we later can get all the definitions and declarations. */ +#undef __need_getopt + +#endif /* getopt.h */ diff --git a/Externals/libusb/examples/getopt/getopt1.c b/Externals/libusb/examples/getopt/getopt1.c new file mode 100644 index 0000000000..22a7efbdd1 --- /dev/null +++ b/Externals/libusb/examples/getopt/getopt1.c @@ -0,0 +1,188 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "getopt.h" + +#if !defined __STDC__ || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#define GETOPT_INTERFACE_VERSION 2 +#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +#include +#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +#define ELIDE_CODE +#endif +#endif + +#ifndef ELIDE_CODE + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int +getopt_long (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 0); +} + +/* Like getopt_long, but '-' as well as '--' can indicate a long option. + If an option that starts with '-' (not '--') doesn't match a long option, + but does match a short option, it is parsed as a short option + instead. */ + +int +getopt_long_only (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 1); +} + + +#endif /* Not ELIDE_CODE. */ + +#ifdef TEST + +#include + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = + { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 0, 0, 0}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long (argc, argv, "abc:d:0123456789", + long_options, &option_index); + if (c == -1) + break; + + switch (c) + { + case 0: + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case 'd': + printf ("option d with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/Externals/libusb/examples/hotplugtest.c b/Externals/libusb/examples/hotplugtest.c new file mode 100644 index 0000000000..368011beca --- /dev/null +++ b/Externals/libusb/examples/hotplugtest.c @@ -0,0 +1,104 @@ +/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */ +/* + * libusb example program for hotplug API + * Copyright © 2012-2013 Nathan Hjelm + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +#include "libusb.h" + +int done = 0; +libusb_device_handle *handle; + +static int LIBUSB_CALL hotplug_callback(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *user_data) +{ + struct libusb_device_descriptor desc; + int rc; + + rc = libusb_get_device_descriptor(dev, &desc); + if (LIBUSB_SUCCESS != rc) { + fprintf (stderr, "Error getting device descriptor\n"); + } + + printf ("Device attached: %04x:%04x\n", desc.idVendor, desc.idProduct); + + libusb_open (dev, &handle); + + done++; + + return 0; +} + +static int LIBUSB_CALL hotplug_callback_detach(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *user_data) +{ + printf ("Device detached\n"); + + libusb_close (handle); + + done++; + return 0; +} + +int main(int argc, char *argv[]) +{ + libusb_hotplug_callback_handle hp[2]; + int product_id, vendor_id, class_id; + int rc; + + vendor_id = (argc > 1) ? strtol (argv[1], NULL, 0) : 0x045a; + product_id = (argc > 2) ? strtol (argv[2], NULL, 0) : 0x5005; + class_id = (argc > 3) ? strtol (argv[3], NULL, 0) : LIBUSB_HOTPLUG_MATCH_ANY; + + rc = libusb_init (NULL); + if (rc < 0) + { + printf("failed to initialise libusb: %s\n", libusb_error_name(rc)); + return EXIT_FAILURE; + } + + if (!libusb_has_capability (LIBUSB_CAP_HAS_HOTPLUG)) { + printf ("Hotplug capabilites are not supported on this platform\n"); + libusb_exit (NULL); + return EXIT_FAILURE; + } + + rc = libusb_hotplug_register_callback (NULL, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, 0, vendor_id, + product_id, class_id, hotplug_callback, NULL, &hp[0]); + if (LIBUSB_SUCCESS != rc) { + fprintf (stderr, "Error registering callback 0\n"); + libusb_exit (NULL); + return EXIT_FAILURE; + } + + rc = libusb_hotplug_register_callback (NULL, LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, 0, vendor_id, + product_id,class_id, hotplug_callback_detach, NULL, &hp[1]); + if (LIBUSB_SUCCESS != rc) { + fprintf (stderr, "Error registering callback 1\n"); + libusb_exit (NULL); + return EXIT_FAILURE; + } + + while (done < 2) { + rc = libusb_handle_events (NULL); + if (rc < 0) + printf("libusb_handle_events() failed: %s\n", libusb_error_name(rc)); + } + + libusb_exit (NULL); +} diff --git a/Externals/libusb/examples/listdevs.c b/Externals/libusb/examples/listdevs.c new file mode 100644 index 0000000000..332891066c --- /dev/null +++ b/Externals/libusb/examples/listdevs.c @@ -0,0 +1,71 @@ +/* + * libusb example program to list devices on the bus + * Copyright © 2007 Daniel Drake + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +#include "libusb.h" + +static void print_devs(libusb_device **devs) +{ + libusb_device *dev; + int i = 0, j = 0; + uint8_t path[8]; + + while ((dev = devs[i++]) != NULL) { + struct libusb_device_descriptor desc; + int r = libusb_get_device_descriptor(dev, &desc); + if (r < 0) { + fprintf(stderr, "failed to get device descriptor"); + return; + } + + printf("%04x:%04x (bus %d, device %d)", + desc.idVendor, desc.idProduct, + libusb_get_bus_number(dev), libusb_get_device_address(dev)); + + r = libusb_get_port_numbers(dev, path, sizeof(path)); + if (r > 0) { + printf(" path: %d", path[0]); + for (j = 1; j < r; j++) + printf(".%d", path[j]); + } + printf("\n"); + } +} + +int main(void) +{ + libusb_device **devs; + int r; + ssize_t cnt; + + r = libusb_init(NULL); + if (r < 0) + return r; + + cnt = libusb_get_device_list(NULL, &devs); + if (cnt < 0) + return (int) cnt; + + print_devs(devs); + libusb_free_device_list(devs, 1); + + libusb_exit(NULL); + return 0; +} diff --git a/Externals/libusb/examples/sam3u_benchmark.c b/Externals/libusb/examples/sam3u_benchmark.c new file mode 100644 index 0000000000..99d6b0f1be --- /dev/null +++ b/Externals/libusb/examples/sam3u_benchmark.c @@ -0,0 +1,193 @@ +/* + * libusb example program to measure Atmel SAM3U isochronous performance + * Copyright (C) 2012 Harald Welte + * + * Copied with the author's permission under LGPL-2.1 from + * http://git.gnumonks.org/cgi-bin/gitweb.cgi?p=sam3u-tests.git;a=blob;f=usb-benchmark-project/host/benchmark.c;h=74959f7ee88f1597286cd435f312a8ff52c56b7e + * + * An Atmel SAM3U test firmware is also available in the above repository. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include +#include + +#include + + +#define EP_DATA_IN 0x82 +#define EP_ISO_IN 0x86 + +static int do_exit = 0; +static struct libusb_device_handle *devh = NULL; + +static unsigned long num_bytes = 0, num_xfer = 0; +static struct timeval tv_start; + +static void LIBUSB_CALL cb_xfr(struct libusb_transfer *xfr) +{ + unsigned int i; + + if (xfr->status != LIBUSB_TRANSFER_COMPLETED) { + fprintf(stderr, "transfer status %d\n", xfr->status); + libusb_free_transfer(xfr); + exit(3); + } + + if (xfr->type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS) { + for (i = 0; i < xfr->num_iso_packets; i++) { + struct libusb_iso_packet_descriptor *pack = &xfr->iso_packet_desc[i]; + + if (pack->status != LIBUSB_TRANSFER_COMPLETED) { + fprintf(stderr, "Error: pack %u status %d\n", i, pack->status); + exit(5); + } + + printf("pack%u length:%u, actual_length:%u\n", i, pack->length, pack->actual_length); + } + } + + printf("length:%u, actual_length:%u\n", xfr->length, xfr->actual_length); + for (i = 0; i < xfr->actual_length; i++) { + printf("%02x", xfr->buffer[i]); + if (i % 16) + printf("\n"); + else if (i % 8) + printf(" "); + else + printf(" "); + } + num_bytes += xfr->actual_length; + num_xfer++; + + if (libusb_submit_transfer(xfr) < 0) { + fprintf(stderr, "error re-submitting URB\n"); + exit(1); + } +} + +static int benchmark_in(uint8_t ep) +{ + static uint8_t buf[2048]; + static struct libusb_transfer *xfr; + int num_iso_pack = 0; + + if (ep == EP_ISO_IN) + num_iso_pack = 16; + + xfr = libusb_alloc_transfer(num_iso_pack); + if (!xfr) + return -ENOMEM; + + if (ep == EP_ISO_IN) { + libusb_fill_iso_transfer(xfr, devh, ep, buf, + sizeof(buf), num_iso_pack, cb_xfr, NULL, 0); + libusb_set_iso_packet_lengths(xfr, sizeof(buf)/num_iso_pack); + } else + libusb_fill_bulk_transfer(xfr, devh, ep, buf, + sizeof(buf), cb_xfr, NULL, 0); + + gettimeofday(&tv_start, NULL); + + /* NOTE: To reach maximum possible performance the program must + * submit *multiple* transfers here, not just one. + * + * When only one transfer is submitted there is a gap in the bus + * schedule from when the transfer completes until a new transfer + * is submitted by the callback. This causes some jitter for + * isochronous transfers and loss of throughput for bulk transfers. + * + * This is avoided by queueing multiple transfers in advance, so + * that the host controller is always kept busy, and will schedule + * more transfers on the bus while the callback is running for + * transfers which have completed on the bus. + */ + + return libusb_submit_transfer(xfr); +} + +static void measure(void) +{ + struct timeval tv_stop; + unsigned int diff_msec; + + gettimeofday(&tv_stop, NULL); + + diff_msec = (tv_stop.tv_sec - tv_start.tv_sec)*1000; + diff_msec += (tv_stop.tv_usec - tv_start.tv_usec)/1000; + + printf("%lu transfers (total %lu bytes) in %u miliseconds => %lu bytes/sec\n", + num_xfer, num_bytes, diff_msec, (num_bytes*1000)/diff_msec); +} + +static void sig_hdlr(int signum) +{ + switch (signum) { + case SIGINT: + measure(); + do_exit = 1; + break; + } +} + +int main(int argc, char **argv) +{ + int rc; + struct sigaction sigact; + + sigact.sa_handler = sig_hdlr; + sigemptyset(&sigact.sa_mask); + sigact.sa_flags = 0; + sigaction(SIGINT, &sigact, NULL); + + rc = libusb_init(NULL); + if (rc < 0) { + fprintf(stderr, "Error initializing libusb: %s\n", libusb_error_name(rc)); + exit(1); + } + + devh = libusb_open_device_with_vid_pid(NULL, 0x16c0, 0x0763); + if (!devh) { + fprintf(stderr, "Error finding USB device\n"); + goto out; + } + + rc = libusb_claim_interface(devh, 2); + if (rc < 0) { + fprintf(stderr, "Error claiming interface: %s\n", libusb_error_name(rc)); + goto out; + } + + benchmark_in(EP_ISO_IN); + + while (!do_exit) { + rc = libusb_handle_events(NULL); + if (rc != LIBUSB_SUCCESS) + break; + } + + /* Measurement has already been done by the signal handler. */ + + libusb_release_interface(devh, 0); +out: + if (devh) + libusb_close(devh); + libusb_exit(NULL); + return rc; +} diff --git a/Externals/libusb/examples/xusb.c b/Externals/libusb/examples/xusb.c new file mode 100644 index 0000000000..f7549ca154 --- /dev/null +++ b/Externals/libusb/examples/xusb.c @@ -0,0 +1,1129 @@ +/* + * xusb: Generic USB test program + * Copyright © 2009-2012 Pete Batard + * Contributions to Mass Storage by Alan Stern. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include +#include + +#include "libusb.h" + +#if defined(_WIN32) +#define msleep(msecs) Sleep(msecs) +#else +#include +#define msleep(msecs) usleep(1000*msecs) +#endif + +#if defined(_MSC_VER) +#define snprintf _snprintf +#define putenv _putenv +#endif + +#if !defined(bool) +#define bool int +#endif +#if !defined(true) +#define true (1 == 1) +#endif +#if !defined(false) +#define false (!true) +#endif + +// Future versions of libusb will use usb_interface instead of interface +// in libusb_config_descriptor => catter for that +#define usb_interface interface + +// Global variables +static bool binary_dump = false; +static bool extra_info = false; +static bool force_device_request = false; // For WCID descriptor queries +static const char* binary_name = NULL; + +static int perr(char const *format, ...) +{ + va_list args; + int r; + + va_start (args, format); + r = vfprintf(stderr, format, args); + va_end(args); + + return r; +} + +#define ERR_EXIT(errcode) do { perr(" %s\n", libusb_strerror((enum libusb_error)errcode)); return -1; } while (0) +#define CALL_CHECK(fcall) do { r=fcall; if (r < 0) ERR_EXIT(r); } while (0); +#define B(x) (((x)!=0)?1:0) +#define be_to_int32(buf) (((buf)[0]<<24)|((buf)[1]<<16)|((buf)[2]<<8)|(buf)[3]) + +#define RETRY_MAX 5 +#define REQUEST_SENSE_LENGTH 0x12 +#define INQUIRY_LENGTH 0x24 +#define READ_CAPACITY_LENGTH 0x08 + +// HID Class-Specific Requests values. See section 7.2 of the HID specifications +#define HID_GET_REPORT 0x01 +#define HID_GET_IDLE 0x02 +#define HID_GET_PROTOCOL 0x03 +#define HID_SET_REPORT 0x09 +#define HID_SET_IDLE 0x0A +#define HID_SET_PROTOCOL 0x0B +#define HID_REPORT_TYPE_INPUT 0x01 +#define HID_REPORT_TYPE_OUTPUT 0x02 +#define HID_REPORT_TYPE_FEATURE 0x03 + +// Mass Storage Requests values. See section 3 of the Bulk-Only Mass Storage Class specifications +#define BOMS_RESET 0xFF +#define BOMS_GET_MAX_LUN 0xFE + +// Section 5.1: Command Block Wrapper (CBW) +struct command_block_wrapper { + uint8_t dCBWSignature[4]; + uint32_t dCBWTag; + uint32_t dCBWDataTransferLength; + uint8_t bmCBWFlags; + uint8_t bCBWLUN; + uint8_t bCBWCBLength; + uint8_t CBWCB[16]; +}; + +// Section 5.2: Command Status Wrapper (CSW) +struct command_status_wrapper { + uint8_t dCSWSignature[4]; + uint32_t dCSWTag; + uint32_t dCSWDataResidue; + uint8_t bCSWStatus; +}; + +static uint8_t cdb_length[256] = { +// 0 1 2 3 4 5 6 7 8 9 A B C D E F + 06,06,06,06,06,06,06,06,06,06,06,06,06,06,06,06, // 0 + 06,06,06,06,06,06,06,06,06,06,06,06,06,06,06,06, // 1 + 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, // 2 + 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, // 3 + 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, // 4 + 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, // 5 + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00, // 6 + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00, // 7 + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, // 8 + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, // 9 + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, // A + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, // B + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00, // C + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00, // D + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00, // E + 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00, // F +}; + +static enum test_type { + USE_GENERIC, + USE_PS3, + USE_XBOX, + USE_SCSI, + USE_HID, +} test_mode; +static uint16_t VID, PID; + +static void display_buffer_hex(unsigned char *buffer, unsigned size) +{ + unsigned i, j, k; + + for (i=0; i 126)) { + printf("."); + } else { + printf("%c", buffer[i+j]); + } + } + } + } + printf("\n" ); +} + +static char* uuid_to_string(const uint8_t* uuid) +{ + static char uuid_string[40]; + if (uuid == NULL) return NULL; + sprintf(uuid_string, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x}", + uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7], + uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]); + return uuid_string; +} + +// The PS3 Controller is really a HID device that got its HID Report Descriptors +// removed by Sony +static int display_ps3_status(libusb_device_handle *handle) +{ + int r; + uint8_t input_report[49]; + uint8_t master_bt_address[8]; + uint8_t device_bt_address[18]; + + // Get the controller's bluetooth address of its master device + CALL_CHECK(libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE, + HID_GET_REPORT, 0x03f5, 0, master_bt_address, sizeof(master_bt_address), 100)); + printf("\nMaster's bluetooth address: %02X:%02X:%02X:%02X:%02X:%02X\n", master_bt_address[2], master_bt_address[3], + master_bt_address[4], master_bt_address[5], master_bt_address[6], master_bt_address[7]); + + // Get the controller's bluetooth address + CALL_CHECK(libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE, + HID_GET_REPORT, 0x03f2, 0, device_bt_address, sizeof(device_bt_address), 100)); + printf("\nMaster's bluetooth address: %02X:%02X:%02X:%02X:%02X:%02X\n", device_bt_address[4], device_bt_address[5], + device_bt_address[6], device_bt_address[7], device_bt_address[8], device_bt_address[9]); + + // Get the status of the controller's buttons via its HID report + printf("\nReading PS3 Input Report...\n"); + CALL_CHECK(libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE, + HID_GET_REPORT, (HID_REPORT_TYPE_INPUT<<8)|0x01, 0, input_report, sizeof(input_report), 1000)); + switch(input_report[2]){ /** Direction pad plus start, select, and joystick buttons */ + case 0x01: + printf("\tSELECT pressed\n"); + break; + case 0x02: + printf("\tLEFT 3 pressed\n"); + break; + case 0x04: + printf("\tRIGHT 3 pressed\n"); + break; + case 0x08: + printf("\tSTART presed\n"); + break; + case 0x10: + printf("\tUP pressed\n"); + break; + case 0x20: + printf("\tRIGHT pressed\n"); + break; + case 0x40: + printf("\tDOWN pressed\n"); + break; + case 0x80: + printf("\tLEFT pressed\n"); + break; + } + switch(input_report[3]){ /** Shapes plus top right and left buttons */ + case 0x01: + printf("\tLEFT 2 pressed\n"); + break; + case 0x02: + printf("\tRIGHT 2 pressed\n"); + break; + case 0x04: + printf("\tLEFT 1 pressed\n"); + break; + case 0x08: + printf("\tRIGHT 1 presed\n"); + break; + case 0x10: + printf("\tTRIANGLE pressed\n"); + break; + case 0x20: + printf("\tCIRCLE pressed\n"); + break; + case 0x40: + printf("\tCROSS pressed\n"); + break; + case 0x80: + printf("\tSQUARE pressed\n"); + break; + } + printf("\tPS button: %d\n", input_report[4]); + printf("\tLeft Analog (X,Y): (%d,%d)\n", input_report[6], input_report[7]); + printf("\tRight Analog (X,Y): (%d,%d)\n", input_report[8], input_report[9]); + printf("\tL2 Value: %d\tR2 Value: %d\n", input_report[18], input_report[19]); + printf("\tL1 Value: %d\tR1 Value: %d\n", input_report[20], input_report[21]); + printf("\tRoll (x axis): %d Yaw (y axis): %d Pitch (z axis) %d\n", + //(((input_report[42] + 128) % 256) - 128), + (int8_t)(input_report[42]), + (int8_t)(input_report[44]), + (int8_t)(input_report[46])); + printf("\tAcceleration: %d\n\n", (int8_t)(input_report[48])); + return 0; +} +// The XBOX Controller is really a HID device that got its HID Report Descriptors +// removed by Microsoft. +// Input/Output reports described at http://euc.jp/periphs/xbox-controller.ja.html +static int display_xbox_status(libusb_device_handle *handle) +{ + int r; + uint8_t input_report[20]; + printf("\nReading XBox Input Report...\n"); + CALL_CHECK(libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE, + HID_GET_REPORT, (HID_REPORT_TYPE_INPUT<<8)|0x00, 0, input_report, 20, 1000)); + printf(" D-pad: %02X\n", input_report[2]&0x0F); + printf(" Start:%d, Back:%d, Left Stick Press:%d, Right Stick Press:%d\n", B(input_report[2]&0x10), B(input_report[2]&0x20), + B(input_report[2]&0x40), B(input_report[2]&0x80)); + // A, B, X, Y, Black, White are pressure sensitive + printf(" A:%d, B:%d, X:%d, Y:%d, White:%d, Black:%d\n", input_report[4], input_report[5], + input_report[6], input_report[7], input_report[9], input_report[8]); + printf(" Left Trigger: %d, Right Trigger: %d\n", input_report[10], input_report[11]); + printf(" Left Analog (X,Y): (%d,%d)\n", (int16_t)((input_report[13]<<8)|input_report[12]), + (int16_t)((input_report[15]<<8)|input_report[14])); + printf(" Right Analog (X,Y): (%d,%d)\n", (int16_t)((input_report[17]<<8)|input_report[16]), + (int16_t)((input_report[19]<<8)|input_report[18])); + return 0; +} + +static int set_xbox_actuators(libusb_device_handle *handle, uint8_t left, uint8_t right) +{ + int r; + uint8_t output_report[6]; + + printf("\nWriting XBox Controller Output Report...\n"); + + memset(output_report, 0, sizeof(output_report)); + output_report[1] = sizeof(output_report); + output_report[3] = left; + output_report[5] = right; + + CALL_CHECK(libusb_control_transfer(handle, LIBUSB_ENDPOINT_OUT|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE, + HID_SET_REPORT, (HID_REPORT_TYPE_OUTPUT<<8)|0x00, 0, output_report, 06, 1000)); + return 0; +} + +static int send_mass_storage_command(libusb_device_handle *handle, uint8_t endpoint, uint8_t lun, + uint8_t *cdb, uint8_t direction, int data_length, uint32_t *ret_tag) +{ + static uint32_t tag = 1; + uint8_t cdb_len; + int i, r, size; + struct command_block_wrapper cbw; + + if (cdb == NULL) { + return -1; + } + + if (endpoint & LIBUSB_ENDPOINT_IN) { + perr("send_mass_storage_command: cannot send command on IN endpoint\n"); + return -1; + } + + cdb_len = cdb_length[cdb[0]]; + if ((cdb_len == 0) || (cdb_len > sizeof(cbw.CBWCB))) { + perr("send_mass_storage_command: don't know how to handle this command (%02X, length %d)\n", + cdb[0], cdb_len); + return -1; + } + + memset(&cbw, 0, sizeof(cbw)); + cbw.dCBWSignature[0] = 'U'; + cbw.dCBWSignature[1] = 'S'; + cbw.dCBWSignature[2] = 'B'; + cbw.dCBWSignature[3] = 'C'; + *ret_tag = tag; + cbw.dCBWTag = tag++; + cbw.dCBWDataTransferLength = data_length; + cbw.bmCBWFlags = direction; + cbw.bCBWLUN = lun; + // Subclass is 1 or 6 => cdb_len + cbw.bCBWCBLength = cdb_len; + memcpy(cbw.CBWCB, cdb, cdb_len); + + i = 0; + do { + // The transfer length must always be exactly 31 bytes. + r = libusb_bulk_transfer(handle, endpoint, (unsigned char*)&cbw, 31, &size, 1000); + if (r == LIBUSB_ERROR_PIPE) { + libusb_clear_halt(handle, endpoint); + } + i++; + } while ((r == LIBUSB_ERROR_PIPE) && (i HID_REPORT_TYPE_FEATURE)) { + return 0; + } else { + return (record_size[type - HID_REPORT_TYPE_INPUT]+7)/8; + } +} + +static int test_hid(libusb_device_handle *handle, uint8_t endpoint_in) +{ + int r, size, descriptor_size; + uint8_t hid_report_descriptor[256]; + uint8_t *report_buffer; + FILE *fd; + + printf("\nReading HID Report Descriptors:\n"); + descriptor_size = libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_STANDARD|LIBUSB_RECIPIENT_INTERFACE, + LIBUSB_REQUEST_GET_DESCRIPTOR, LIBUSB_DT_REPORT<<8, 0, hid_report_descriptor, sizeof(hid_report_descriptor), 1000); + if (descriptor_size < 0) { + printf(" Failed\n"); + return -1; + } + display_buffer_hex(hid_report_descriptor, descriptor_size); + if ((binary_dump) && ((fd = fopen(binary_name, "w")) != NULL)) { + if (fwrite(hid_report_descriptor, 1, descriptor_size, fd) != descriptor_size) { + printf(" Error writing descriptor to file\n"); + } + fclose(fd); + } + + size = get_hid_record_size(hid_report_descriptor, descriptor_size, HID_REPORT_TYPE_FEATURE); + if (size <= 0) { + printf("\nSkipping Feature Report readout (None detected)\n"); + } else { + report_buffer = (uint8_t*) calloc(size, 1); + if (report_buffer == NULL) { + return -1; + } + + printf("\nReading Feature Report (length %d)...\n", size); + r = libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE, + HID_GET_REPORT, (HID_REPORT_TYPE_FEATURE<<8)|0, 0, report_buffer, (uint16_t)size, 5000); + if (r >= 0) { + display_buffer_hex(report_buffer, size); + } else { + switch(r) { + case LIBUSB_ERROR_NOT_FOUND: + printf(" No Feature Report available for this device\n"); + break; + case LIBUSB_ERROR_PIPE: + printf(" Detected stall - resetting pipe...\n"); + libusb_clear_halt(handle, 0); + break; + default: + printf(" Error: %s\n", libusb_strerror((enum libusb_error)r)); + break; + } + } + free(report_buffer); + } + + size = get_hid_record_size(hid_report_descriptor, descriptor_size, HID_REPORT_TYPE_INPUT); + if (size <= 0) { + printf("\nSkipping Input Report readout (None detected)\n"); + } else { + report_buffer = (uint8_t*) calloc(size, 1); + if (report_buffer == NULL) { + return -1; + } + + printf("\nReading Input Report (length %d)...\n", size); + r = libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE, + HID_GET_REPORT, (HID_REPORT_TYPE_INPUT<<8)|0x00, 0, report_buffer, (uint16_t)size, 5000); + if (r >= 0) { + display_buffer_hex(report_buffer, size); + } else { + switch(r) { + case LIBUSB_ERROR_TIMEOUT: + printf(" Timeout! Please make sure you act on the device within the 5 seconds allocated...\n"); + break; + case LIBUSB_ERROR_PIPE: + printf(" Detected stall - resetting pipe...\n"); + libusb_clear_halt(handle, 0); + break; + default: + printf(" Error: %s\n", libusb_strerror((enum libusb_error)r)); + break; + } + } + + // Attempt a bulk read from endpoint 0 (this should just return a raw input report) + printf("\nTesting interrupt read using endpoint %02X...\n", endpoint_in); + r = libusb_interrupt_transfer(handle, endpoint_in, report_buffer, size, &size, 5000); + if (r >= 0) { + display_buffer_hex(report_buffer, size); + } else { + printf(" %s\n", libusb_strerror((enum libusb_error)r)); + } + + free(report_buffer); + } + return 0; +} + +// Read the MS WinUSB Feature Descriptors, that are used on Windows 8 for automated driver installation +static void read_ms_winsub_feature_descriptors(libusb_device_handle *handle, uint8_t bRequest, int iface_number) +{ +#define MAX_OS_FD_LENGTH 256 + int i, r; + uint8_t os_desc[MAX_OS_FD_LENGTH]; + uint32_t length; + void* le_type_punning_IS_fine; + struct { + const char* desc; + uint8_t recipient; + uint16_t index; + uint16_t header_size; + } os_fd[2] = { + {"Extended Compat ID", LIBUSB_RECIPIENT_DEVICE, 0x0004, 0x10}, + {"Extended Properties", LIBUSB_RECIPIENT_INTERFACE, 0x0005, 0x0A} + }; + + if (iface_number < 0) return; + // WinUSB has a limitation that forces wIndex to the interface number when issuing + // an Interface Request. To work around that, we can force a Device Request for + // the Extended Properties, assuming the device answers both equally. + if (force_device_request) + os_fd[1].recipient = LIBUSB_RECIPIENT_DEVICE; + + for (i=0; i<2; i++) { + printf("\nReading %s OS Feature Descriptor (wIndex = 0x%04d):\n", os_fd[i].desc, os_fd[i].index); + + // Read the header part + r = libusb_control_transfer(handle, (uint8_t)(LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_VENDOR|os_fd[i].recipient), + bRequest, (uint16_t)(((iface_number)<< 8)|0x00), os_fd[i].index, os_desc, os_fd[i].header_size, 1000); + if (r < os_fd[i].header_size) { + perr(" Failed: %s", (r<0)?libusb_strerror((enum libusb_error)r):"header size is too small"); + return; + } + le_type_punning_IS_fine = (void*)os_desc; + length = *((uint32_t*)le_type_punning_IS_fine); + if (length > MAX_OS_FD_LENGTH) { + length = MAX_OS_FD_LENGTH; + } + + // Read the full feature descriptor + r = libusb_control_transfer(handle, (uint8_t)(LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_VENDOR|os_fd[i].recipient), + bRequest, (uint16_t)(((iface_number)<< 8)|0x00), os_fd[i].index, os_desc, (uint16_t)length, 1000); + if (r < 0) { + perr(" Failed: %s", libusb_strerror((enum libusb_error)r)); + return; + } else { + display_buffer_hex(os_desc, r); + } + } +} + +static void print_device_cap(struct libusb_bos_dev_capability_descriptor *dev_cap) +{ + switch(dev_cap->bDevCapabilityType) { + case LIBUSB_BT_USB_2_0_EXTENSION: { + struct libusb_usb_2_0_extension_descriptor *usb_2_0_ext = NULL; + libusb_get_usb_2_0_extension_descriptor(NULL, dev_cap, &usb_2_0_ext); + if (usb_2_0_ext) { + printf(" USB 2.0 extension:\n"); + printf(" attributes : %02X\n", usb_2_0_ext->bmAttributes); + libusb_free_usb_2_0_extension_descriptor(usb_2_0_ext); + } + break; + } + case LIBUSB_BT_SS_USB_DEVICE_CAPABILITY: { + struct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap = NULL; + libusb_get_ss_usb_device_capability_descriptor(NULL, dev_cap, &ss_usb_device_cap); + if (ss_usb_device_cap) { + printf(" USB 3.0 capabilities:\n"); + printf(" attributes : %02X\n", ss_usb_device_cap->bmAttributes); + printf(" supported speeds : %04X\n", ss_usb_device_cap->wSpeedSupported); + printf(" supported functionality: %02X\n", ss_usb_device_cap->bFunctionalitySupport); + libusb_free_ss_usb_device_capability_descriptor(ss_usb_device_cap); + } + break; + } + case LIBUSB_BT_CONTAINER_ID: { + struct libusb_container_id_descriptor *container_id = NULL; + libusb_get_container_id_descriptor(NULL, dev_cap, &container_id); + if (container_id) { + printf(" Container ID:\n %s\n", uuid_to_string(container_id->ContainerID)); + libusb_free_container_id_descriptor(container_id); + } + break; + } + default: + printf(" Unknown BOS device capability %02x:\n", dev_cap->bDevCapabilityType); + } +} + +static int test_device(uint16_t vid, uint16_t pid) +{ + libusb_device_handle *handle; + libusb_device *dev; + uint8_t bus, port_path[8]; + struct libusb_bos_descriptor *bos_desc; + struct libusb_config_descriptor *conf_desc; + const struct libusb_endpoint_descriptor *endpoint; + int i, j, k, r; + int iface, nb_ifaces, first_iface = -1; + struct libusb_device_descriptor dev_desc; + const char* speed_name[5] = { "Unknown", "1.5 Mbit/s (USB LowSpeed)", "12 Mbit/s (USB FullSpeed)", + "480 Mbit/s (USB HighSpeed)", "5000 Mbit/s (USB SuperSpeed)"}; + char string[128]; + uint8_t string_index[3]; // indexes of the string descriptors + uint8_t endpoint_in = 0, endpoint_out = 0; // default IN and OUT endpoints + + printf("Opening device %04X:%04X...\n", vid, pid); + handle = libusb_open_device_with_vid_pid(NULL, vid, pid); + + if (handle == NULL) { + perr(" Failed.\n"); + return -1; + } + + dev = libusb_get_device(handle); + bus = libusb_get_bus_number(dev); + if (extra_info) { + r = libusb_get_port_numbers(dev, port_path, sizeof(port_path)); + if (r > 0) { + printf("\nDevice properties:\n"); + printf(" bus number: %d\n", bus); + printf(" port path: %d", port_path[0]); + for (i=1; i%d", port_path[i]); + } + printf(" (from root hub)\n"); + } + r = libusb_get_device_speed(dev); + if ((r<0) || (r>4)) r=0; + printf(" speed: %s\n", speed_name[r]); + } + + printf("\nReading device descriptor:\n"); + CALL_CHECK(libusb_get_device_descriptor(dev, &dev_desc)); + printf(" length: %d\n", dev_desc.bLength); + printf(" device class: %d\n", dev_desc.bDeviceClass); + printf(" S/N: %d\n", dev_desc.iSerialNumber); + printf(" VID:PID: %04X:%04X\n", dev_desc.idVendor, dev_desc.idProduct); + printf(" bcdDevice: %04X\n", dev_desc.bcdDevice); + printf(" iMan:iProd:iSer: %d:%d:%d\n", dev_desc.iManufacturer, dev_desc.iProduct, dev_desc.iSerialNumber); + printf(" nb confs: %d\n", dev_desc.bNumConfigurations); + // Copy the string descriptors for easier parsing + string_index[0] = dev_desc.iManufacturer; + string_index[1] = dev_desc.iProduct; + string_index[2] = dev_desc.iSerialNumber; + + printf("\nReading BOS descriptor: "); + if (libusb_get_bos_descriptor(handle, &bos_desc) == LIBUSB_SUCCESS) { + printf("%d caps\n", bos_desc->bNumDeviceCaps); + for (i = 0; i < bos_desc->bNumDeviceCaps; i++) + print_device_cap(bos_desc->dev_capability[i]); + libusb_free_bos_descriptor(bos_desc); + } else { + printf("no descriptor\n"); + } + + printf("\nReading first configuration descriptor:\n"); + CALL_CHECK(libusb_get_config_descriptor(dev, 0, &conf_desc)); + nb_ifaces = conf_desc->bNumInterfaces; + printf(" nb interfaces: %d\n", nb_ifaces); + if (nb_ifaces > 0) + first_iface = conf_desc->usb_interface[0].altsetting[0].bInterfaceNumber; + for (i=0; iusb_interface[i].altsetting[0].bInterfaceNumber); + for (j=0; jusb_interface[i].num_altsetting; j++) { + printf("interface[%d].altsetting[%d]: num endpoints = %d\n", + i, j, conf_desc->usb_interface[i].altsetting[j].bNumEndpoints); + printf(" Class.SubClass.Protocol: %02X.%02X.%02X\n", + conf_desc->usb_interface[i].altsetting[j].bInterfaceClass, + conf_desc->usb_interface[i].altsetting[j].bInterfaceSubClass, + conf_desc->usb_interface[i].altsetting[j].bInterfaceProtocol); + if ( (conf_desc->usb_interface[i].altsetting[j].bInterfaceClass == LIBUSB_CLASS_MASS_STORAGE) + && ( (conf_desc->usb_interface[i].altsetting[j].bInterfaceSubClass == 0x01) + || (conf_desc->usb_interface[i].altsetting[j].bInterfaceSubClass == 0x06) ) + && (conf_desc->usb_interface[i].altsetting[j].bInterfaceProtocol == 0x50) ) { + // Mass storage devices that can use basic SCSI commands + test_mode = USE_SCSI; + } + for (k=0; kusb_interface[i].altsetting[j].bNumEndpoints; k++) { + struct libusb_ss_endpoint_companion_descriptor *ep_comp = NULL; + endpoint = &conf_desc->usb_interface[i].altsetting[j].endpoint[k]; + printf(" endpoint[%d].address: %02X\n", k, endpoint->bEndpointAddress); + // Use the first interrupt or bulk IN/OUT endpoints as default for testing + if ((endpoint->bmAttributes & LIBUSB_TRANSFER_TYPE_MASK) & (LIBUSB_TRANSFER_TYPE_BULK | LIBUSB_TRANSFER_TYPE_INTERRUPT)) { + if (endpoint->bEndpointAddress & LIBUSB_ENDPOINT_IN) { + if (!endpoint_in) + endpoint_in = endpoint->bEndpointAddress; + } else { + if (!endpoint_out) + endpoint_out = endpoint->bEndpointAddress; + } + } + printf(" max packet size: %04X\n", endpoint->wMaxPacketSize); + printf(" polling interval: %02X\n", endpoint->bInterval); + libusb_get_ss_endpoint_companion_descriptor(NULL, endpoint, &ep_comp); + if (ep_comp) { + printf(" max burst: %02X (USB 3.0)\n", ep_comp->bMaxBurst); + printf(" bytes per interval: %04X (USB 3.0)\n", ep_comp->wBytesPerInterval); + libusb_free_ss_endpoint_companion_descriptor(ep_comp); + } + } + } + } + libusb_free_config_descriptor(conf_desc); + + libusb_set_auto_detach_kernel_driver(handle, 1); + for (iface = 0; iface < nb_ifaces; iface++) + { + printf("\nClaiming interface %d...\n", iface); + r = libusb_claim_interface(handle, iface); + if (r != LIBUSB_SUCCESS) { + perr(" Failed.\n"); + } + } + + printf("\nReading string descriptors:\n"); + for (i=0; i<3; i++) { + if (string_index[i] == 0) { + continue; + } + if (libusb_get_string_descriptor_ascii(handle, string_index[i], (unsigned char*)string, 128) >= 0) { + printf(" String (0x%02X): \"%s\"\n", string_index[i], string); + } + } + // Read the OS String Descriptor + if (libusb_get_string_descriptor_ascii(handle, 0xEE, (unsigned char*)string, 128) >= 0) { + printf(" String (0x%02X): \"%s\"\n", 0xEE, string); + // If this is a Microsoft OS String Descriptor, + // attempt to read the WinUSB extended Feature Descriptors + if (strncmp(string, "MSFT100", 7) == 0) + read_ms_winsub_feature_descriptors(handle, string[7], first_iface); + } + + switch(test_mode) { + case USE_PS3: + CALL_CHECK(display_ps3_status(handle)); + break; + case USE_XBOX: + CALL_CHECK(display_xbox_status(handle)); + CALL_CHECK(set_xbox_actuators(handle, 128, 222)); + msleep(2000); + CALL_CHECK(set_xbox_actuators(handle, 0, 0)); + break; + case USE_HID: + test_hid(handle, endpoint_in); + break; + case USE_SCSI: + CALL_CHECK(test_mass_storage(handle, endpoint_in, endpoint_out)); + case USE_GENERIC: + break; + } + + printf("\n"); + for (iface = 0; iface= 2) { + for (j = 1; j= 2) ) { + switch(argv[j][1]) { + case 'd': + debug_mode = true; + break; + case 'i': + extra_info = true; + break; + case 'w': + force_device_request = true; + break; + case 'b': + if ((j+1 >= argc) || (argv[j+1][0] == '-') || (argv[j+1][0] == '/')) { + printf(" Option -b requires a file name\n"); + return 1; + } + binary_name = argv[++j]; + binary_dump = true; + break; + case 'l': + if ((j+1 >= argc) || (argv[j+1][0] == '-') || (argv[j+1][0] == '/')) { + printf(" Option -l requires an ISO 639-1 language parameter\n"); + return 1; + } + error_lang = argv[++j]; + break; + case 'j': + // OLIMEX ARM-USB-TINY JTAG, 2 channel composite device - 2 interfaces + if (!VID && !PID) { + VID = 0x15BA; + PID = 0x0004; + } + break; + case 'k': + // Generic 2 GB USB Key (SCSI Transparent/Bulk Only) - 1 interface + if (!VID && !PID) { + VID = 0x0204; + PID = 0x6025; + } + break; + // The following tests will force VID:PID if already provided + case 'p': + // Sony PS3 Controller - 1 interface + VID = 0x054C; + PID = 0x0268; + test_mode = USE_PS3; + break; + case 's': + // Microsoft Sidewinder Precision Pro Joystick - 1 HID interface + VID = 0x045E; + PID = 0x0008; + test_mode = USE_HID; + break; + case 'x': + // Microsoft XBox Controller Type S - 1 interface + VID = 0x045E; + PID = 0x0289; + test_mode = USE_XBOX; + break; + default: + show_help = true; + break; + } + } else { + for (i=0; i 7)) { + printf("usage: %s [-h] [-d] [-i] [-k] [-b file] [-l lang] [-j] [-x] [-s] [-p] [-w] [vid:pid]\n", argv[0]); + printf(" -h : display usage\n"); + printf(" -d : enable debug output\n"); + printf(" -i : print topology and speed info\n"); + printf(" -j : test composite FTDI based JTAG device\n"); + printf(" -k : test Mass Storage device\n"); + printf(" -b file : dump Mass Storage data to file 'file'\n"); + printf(" -p : test Sony PS3 SixAxis controller\n"); + printf(" -s : test Microsoft Sidewinder Precision Pro (HID)\n"); + printf(" -x : test Microsoft XBox Controller Type S\n"); + printf(" -l lang : language to report errors in (ISO 639-1)\n"); + printf(" -w : force the use of device requests when querying WCID descriptors\n"); + printf("If only the vid:pid is provided, xusb attempts to run the most appropriate test\n"); + return 0; + } + + // xusb is commonly used as a debug tool, so it's convenient to have debug output during libusb_init(), + // but since we can't call on libusb_set_debug() before libusb_init(), we use the env variable method + old_dbg_str = getenv("LIBUSB_DEBUG"); + if (debug_mode) { + putenv("LIBUSB_DEBUG=4"); // LIBUSB_LOG_LEVEL_DEBUG + } + + version = libusb_get_version(); + printf("Using libusb v%d.%d.%d.%d\n\n", version->major, version->minor, version->micro, version->nano); + r = libusb_init(NULL); + if (r < 0) + return r; + + // If not set externally, and no debug option was given, use info log level + if ((old_dbg_str == NULL) && (!debug_mode)) + libusb_set_debug(NULL, LIBUSB_LOG_LEVEL_INFO); + if (error_lang != NULL) { + r = libusb_setlocale(error_lang); + if (r < 0) + printf("Invalid or unsupported locale '%s': %s\n", error_lang, libusb_strerror((enum libusb_error)r)); + } + + test_device(VID, PID); + + libusb_exit(NULL); + + if (debug_mode) { + snprintf(str, sizeof(str), "LIBUSB_DEBUG=%s", (old_dbg_str == NULL)?"":old_dbg_str); + str[sizeof(str) - 1] = 0; // Windows may not NUL terminate the string + } + + return 0; +} diff --git a/Externals/libusbx/install-sh b/Externals/libusb/install-sh old mode 100644 new mode 100755 similarity index 100% rename from Externals/libusbx/install-sh rename to Externals/libusb/install-sh diff --git a/Externals/libusbx/libusb-1.0.pc.in b/Externals/libusb/libusb-1.0.pc.in similarity index 94% rename from Externals/libusbx/libusb-1.0.pc.in rename to Externals/libusb/libusb-1.0.pc.in index 7bc33c1210..aa023b3198 100644 --- a/Externals/libusbx/libusb-1.0.pc.in +++ b/Externals/libusb/libusb-1.0.pc.in @@ -3,7 +3,7 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -Name: libusbx-1.0 +Name: libusb-1.0 Description: C API for USB device access from Linux, Mac OS X, Windows and OpenBSD/NetBSD userspace Version: @VERSION@ Libs: -L${libdir} -lusb-1.0 diff --git a/Externals/libusbx/libusb/Makefile.am b/Externals/libusb/libusb/Makefile.am similarity index 88% rename from Externals/libusbx/libusb/Makefile.am rename to Externals/libusb/libusb/Makefile.am index 7f9c1f9093..80e3705e52 100644 --- a/Externals/libusbx/libusb/Makefile.am +++ b/Externals/libusb/libusb/Makefile.am @@ -1,16 +1,19 @@ all: libusb-1.0.la libusb-1.0.dll +AUTOMAKE_OPTIONS = subdir-objects + lib_LTLIBRARIES = libusb-1.0.la POSIX_POLL_SRC = os/poll_posix.c LINUX_USBFS_SRC = os/linux_usbfs.c DARWIN_USB_SRC = os/darwin_usb.c OPENBSD_USB_SRC = os/openbsd_usb.c +NETBSD_USB_SRC = os/netbsd_usb.c WINDOWS_USB_SRC = os/poll_windows.c os/windows_usb.c libusb-1.0.rc libusb-1.0.def WINCE_USB_SRC = os/wince_usb.c os/wince_usb.h EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(OPENBSD_USB_SRC) \ - $(WINDOWS_USB_SRC) $(WINCE_USB_SRC) \ + $(NETBSD_USB_SRC) $(WINDOWS_USB_SRC) $(WINCE_USB_SRC) \ $(POSIX_POLL_SRC) \ os/threads_posix.c os/threads_windows.c \ os/linux_udev.c os/linux_netlink.c @@ -36,6 +39,10 @@ if OS_OPENBSD OS_SRC = $(OPENBSD_USB_SRC) $(POSIX_POLL_SRC) endif +if OS_NETBSD +OS_SRC = $(NETBSD_USB_SRC) $(POSIX_POLL_SRC) +endif + if OS_WINDOWS OS_SRC = $(WINDOWS_USB_SRC) @@ -45,7 +52,7 @@ OS_SRC = $(WINDOWS_USB_SRC) libusb-1.0.rc: version.h version_nano.h endif -libusb-1.0.dll: libusb-1.0.def +libusb-1.0.dll: libusb-1.0.def libusb-1.0.la if CREATE_IMPORT_LIB # Rebuild the import lib from the .def so that MS and MinGW DLLs can be interchanged $(AM_V_GEN)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $(srcdir)/libusb-1.0.def --dllname $@ --output-lib .libs/$@.a diff --git a/Externals/libusbx/libusb/Makefile.in b/Externals/libusb/libusb/Makefile.in similarity index 73% rename from Externals/libusbx/libusb/Makefile.in rename to Externals/libusb/libusb/Makefile.in index 2461c45a80..0fcff7781a 100644 --- a/Externals/libusbx/libusb/Makefile.in +++ b/Externals/libusb/libusb/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -129,30 +129,36 @@ am__libusb_1_0_la_SOURCES_DIST = libusbi.h core.c descriptor.c io.c \ os/threads_windows.h os/threads_windows.c os/threads_posix.h \ os/threads_posix.c os/darwin_usb.c os/poll_posix.c \ os/linux_usbfs.c os/linux_netlink.c os/linux_udev.c \ - os/openbsd_usb.c os/poll_windows.c os/windows_usb.c \ - libusb-1.0.rc libusb-1.0.def os/poll_posix.h os/poll_windows.h -@THREADS_POSIX_FALSE@am__objects_1 = libusb_1_0_la-threads_windows.lo -@THREADS_POSIX_TRUE@am__objects_1 = libusb_1_0_la-threads_posix.lo -am__objects_2 = libusb_1_0_la-darwin_usb.lo -am__objects_3 = libusb_1_0_la-poll_posix.lo -am__objects_4 = libusb_1_0_la-linux_usbfs.lo -am__objects_5 = libusb_1_0_la-openbsd_usb.lo -am__objects_6 = libusb_1_0_la-poll_windows.lo \ - libusb_1_0_la-windows_usb.lo libusb-1.0.lo -@OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_OPENBSD_FALSE@@OS_WINDOWS_TRUE@am__objects_7 = $(am__objects_6) -@OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_OPENBSD_TRUE@am__objects_7 = $(am__objects_5) \ -@OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_OPENBSD_TRUE@ $(am__objects_3) -@OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_FALSE@am__objects_7 = $(am__objects_4) \ + os/netbsd_usb.c os/openbsd_usb.c os/poll_windows.c \ + os/windows_usb.c libusb-1.0.rc libusb-1.0.def os/poll_posix.h \ + os/poll_windows.h +am__dirstamp = $(am__leading_dot)dirstamp +@THREADS_POSIX_FALSE@am__objects_1 = \ +@THREADS_POSIX_FALSE@ os/libusb_1_0_la-threads_windows.lo +@THREADS_POSIX_TRUE@am__objects_1 = os/libusb_1_0_la-threads_posix.lo +am__objects_2 = os/libusb_1_0_la-darwin_usb.lo +am__objects_3 = os/libusb_1_0_la-poll_posix.lo +am__objects_4 = os/libusb_1_0_la-linux_usbfs.lo +am__objects_5 = os/libusb_1_0_la-netbsd_usb.lo +am__objects_6 = os/libusb_1_0_la-openbsd_usb.lo +am__objects_7 = os/libusb_1_0_la-poll_windows.lo \ + os/libusb_1_0_la-windows_usb.lo libusb-1.0.lo +@OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_NETBSD_FALSE@@OS_OPENBSD_FALSE@@OS_WINDOWS_TRUE@am__objects_8 = $(am__objects_7) +@OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_NETBSD_FALSE@@OS_OPENBSD_TRUE@am__objects_8 = $(am__objects_6) \ +@OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_NETBSD_FALSE@@OS_OPENBSD_TRUE@ $(am__objects_3) +@OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_NETBSD_TRUE@am__objects_8 = $(am__objects_5) \ +@OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_NETBSD_TRUE@ $(am__objects_3) +@OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_FALSE@am__objects_8 = $(am__objects_4) \ @OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_FALSE@ $(am__objects_3) \ -@OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_FALSE@ libusb_1_0_la-linux_netlink.lo -@OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_TRUE@am__objects_7 = $(am__objects_4) \ +@OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_FALSE@ os/libusb_1_0_la-linux_netlink.lo +@OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_TRUE@am__objects_8 = $(am__objects_4) \ @OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_TRUE@ $(am__objects_3) \ -@OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_TRUE@ libusb_1_0_la-linux_udev.lo -@OS_DARWIN_TRUE@am__objects_7 = $(am__objects_2) $(am__objects_3) +@OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_TRUE@ os/libusb_1_0_la-linux_udev.lo +@OS_DARWIN_TRUE@am__objects_8 = $(am__objects_2) $(am__objects_3) am_libusb_1_0_la_OBJECTS = libusb_1_0_la-core.lo \ libusb_1_0_la-descriptor.lo libusb_1_0_la-io.lo \ libusb_1_0_la-strerror.lo libusb_1_0_la-sync.lo \ - libusb_1_0_la-hotplug.lo $(am__objects_1) $(am__objects_7) + libusb_1_0_la-hotplug.lo $(am__objects_1) $(am__objects_8) libusb_1_0_la_OBJECTS = $(am_libusb_1_0_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -274,6 +280,7 @@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS_DARWIN = @OS_DARWIN@ OS_LINUX = @OS_LINUX@ +OS_NETBSD = @OS_NETBSD@ OS_OPENBSD = @OS_OPENBSD@ OS_WINDOWS = @OS_WINDOWS@ OTOOL = @OTOOL@ @@ -346,15 +353,17 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = subdir-objects lib_LTLIBRARIES = libusb-1.0.la POSIX_POLL_SRC = os/poll_posix.c LINUX_USBFS_SRC = os/linux_usbfs.c DARWIN_USB_SRC = os/darwin_usb.c OPENBSD_USB_SRC = os/openbsd_usb.c +NETBSD_USB_SRC = os/netbsd_usb.c WINDOWS_USB_SRC = os/poll_windows.c os/windows_usb.c libusb-1.0.rc libusb-1.0.def WINCE_USB_SRC = os/wince_usb.c os/wince_usb.h EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(OPENBSD_USB_SRC) \ - $(WINDOWS_USB_SRC) $(WINCE_USB_SRC) \ + $(NETBSD_USB_SRC) $(WINDOWS_USB_SRC) $(WINCE_USB_SRC) \ $(POSIX_POLL_SRC) \ os/threads_posix.c os/threads_windows.c \ os/linux_udev.c os/linux_netlink.c @@ -366,6 +375,7 @@ EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(OPENBSD_USB_SRC) \ @OS_LINUX_TRUE@@USE_UDEV_TRUE@OS_SRC = $(LINUX_USBFS_SRC) $(POSIX_POLL_SRC) \ @OS_LINUX_TRUE@@USE_UDEV_TRUE@ os/linux_udev.c +@OS_NETBSD_TRUE@OS_SRC = $(NETBSD_USB_SRC) $(POSIX_POLL_SRC) @OS_OPENBSD_TRUE@OS_SRC = $(OPENBSD_USB_SRC) $(POSIX_POLL_SRC) @OS_WINDOWS_TRUE@OS_SRC = $(WINDOWS_USB_SRC) @OS_DARWIN_TRUE@AM_CFLAGS_EXT = -no-cpp-precomp @@ -449,50 +459,84 @@ clean-libLTLIBRARIES: echo rm -f $${locs}; \ rm -f $${locs}; \ } +os/$(am__dirstamp): + @$(MKDIR_P) os + @: > os/$(am__dirstamp) +os/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) os/$(DEPDIR) + @: > os/$(DEPDIR)/$(am__dirstamp) +os/libusb_1_0_la-threads_windows.lo: os/$(am__dirstamp) \ + os/$(DEPDIR)/$(am__dirstamp) +os/libusb_1_0_la-threads_posix.lo: os/$(am__dirstamp) \ + os/$(DEPDIR)/$(am__dirstamp) +os/libusb_1_0_la-darwin_usb.lo: os/$(am__dirstamp) \ + os/$(DEPDIR)/$(am__dirstamp) +os/libusb_1_0_la-poll_posix.lo: os/$(am__dirstamp) \ + os/$(DEPDIR)/$(am__dirstamp) +os/libusb_1_0_la-linux_usbfs.lo: os/$(am__dirstamp) \ + os/$(DEPDIR)/$(am__dirstamp) +os/libusb_1_0_la-linux_netlink.lo: os/$(am__dirstamp) \ + os/$(DEPDIR)/$(am__dirstamp) +os/libusb_1_0_la-linux_udev.lo: os/$(am__dirstamp) \ + os/$(DEPDIR)/$(am__dirstamp) +os/libusb_1_0_la-netbsd_usb.lo: os/$(am__dirstamp) \ + os/$(DEPDIR)/$(am__dirstamp) +os/libusb_1_0_la-openbsd_usb.lo: os/$(am__dirstamp) \ + os/$(DEPDIR)/$(am__dirstamp) +os/libusb_1_0_la-poll_windows.lo: os/$(am__dirstamp) \ + os/$(DEPDIR)/$(am__dirstamp) +os/libusb_1_0_la-windows_usb.lo: os/$(am__dirstamp) \ + os/$(DEPDIR)/$(am__dirstamp) libusb-1.0.la: $(libusb_1_0_la_OBJECTS) $(libusb_1_0_la_DEPENDENCIES) $(EXTRA_libusb_1_0_la_DEPENDENCIES) $(AM_V_CCLD)$(libusb_1_0_la_LINK) -rpath $(libdir) $(libusb_1_0_la_OBJECTS) $(libusb_1_0_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) + -rm -f os/*.$(OBJEXT) + -rm -f os/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-core.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-darwin_usb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-descriptor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-hotplug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-io.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-linux_netlink.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-linux_udev.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-linux_usbfs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-openbsd_usb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-poll_posix.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-poll_windows.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-strerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-sync.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-threads_posix.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-threads_windows.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-windows_usb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-darwin_usb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-linux_netlink.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-linux_udev.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-linux_usbfs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-netbsd_usb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-openbsd_usb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-poll_posix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-poll_windows.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-threads_posix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-threads_windows.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-windows_usb.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -539,81 +583,89 @@ libusb_1_0_la-hotplug.lo: hotplug.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-hotplug.lo `test -f 'hotplug.c' || echo '$(srcdir)/'`hotplug.c -libusb_1_0_la-threads_windows.lo: os/threads_windows.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-threads_windows.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-threads_windows.Tpo -c -o libusb_1_0_la-threads_windows.lo `test -f 'os/threads_windows.c' || echo '$(srcdir)/'`os/threads_windows.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-threads_windows.Tpo $(DEPDIR)/libusb_1_0_la-threads_windows.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/threads_windows.c' object='libusb_1_0_la-threads_windows.lo' libtool=yes @AMDEPBACKSLASH@ +os/libusb_1_0_la-threads_windows.lo: os/threads_windows.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-threads_windows.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-threads_windows.Tpo -c -o os/libusb_1_0_la-threads_windows.lo `test -f 'os/threads_windows.c' || echo '$(srcdir)/'`os/threads_windows.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-threads_windows.Tpo os/$(DEPDIR)/libusb_1_0_la-threads_windows.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/threads_windows.c' object='os/libusb_1_0_la-threads_windows.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-threads_windows.lo `test -f 'os/threads_windows.c' || echo '$(srcdir)/'`os/threads_windows.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-threads_windows.lo `test -f 'os/threads_windows.c' || echo '$(srcdir)/'`os/threads_windows.c -libusb_1_0_la-threads_posix.lo: os/threads_posix.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-threads_posix.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-threads_posix.Tpo -c -o libusb_1_0_la-threads_posix.lo `test -f 'os/threads_posix.c' || echo '$(srcdir)/'`os/threads_posix.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-threads_posix.Tpo $(DEPDIR)/libusb_1_0_la-threads_posix.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/threads_posix.c' object='libusb_1_0_la-threads_posix.lo' libtool=yes @AMDEPBACKSLASH@ +os/libusb_1_0_la-threads_posix.lo: os/threads_posix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-threads_posix.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-threads_posix.Tpo -c -o os/libusb_1_0_la-threads_posix.lo `test -f 'os/threads_posix.c' || echo '$(srcdir)/'`os/threads_posix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-threads_posix.Tpo os/$(DEPDIR)/libusb_1_0_la-threads_posix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/threads_posix.c' object='os/libusb_1_0_la-threads_posix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-threads_posix.lo `test -f 'os/threads_posix.c' || echo '$(srcdir)/'`os/threads_posix.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-threads_posix.lo `test -f 'os/threads_posix.c' || echo '$(srcdir)/'`os/threads_posix.c -libusb_1_0_la-darwin_usb.lo: os/darwin_usb.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-darwin_usb.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-darwin_usb.Tpo -c -o libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '$(srcdir)/'`os/darwin_usb.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-darwin_usb.Tpo $(DEPDIR)/libusb_1_0_la-darwin_usb.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/darwin_usb.c' object='libusb_1_0_la-darwin_usb.lo' libtool=yes @AMDEPBACKSLASH@ +os/libusb_1_0_la-darwin_usb.lo: os/darwin_usb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-darwin_usb.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-darwin_usb.Tpo -c -o os/libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '$(srcdir)/'`os/darwin_usb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-darwin_usb.Tpo os/$(DEPDIR)/libusb_1_0_la-darwin_usb.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/darwin_usb.c' object='os/libusb_1_0_la-darwin_usb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '$(srcdir)/'`os/darwin_usb.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '$(srcdir)/'`os/darwin_usb.c -libusb_1_0_la-poll_posix.lo: os/poll_posix.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-poll_posix.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-poll_posix.Tpo -c -o libusb_1_0_la-poll_posix.lo `test -f 'os/poll_posix.c' || echo '$(srcdir)/'`os/poll_posix.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-poll_posix.Tpo $(DEPDIR)/libusb_1_0_la-poll_posix.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/poll_posix.c' object='libusb_1_0_la-poll_posix.lo' libtool=yes @AMDEPBACKSLASH@ +os/libusb_1_0_la-poll_posix.lo: os/poll_posix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-poll_posix.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-poll_posix.Tpo -c -o os/libusb_1_0_la-poll_posix.lo `test -f 'os/poll_posix.c' || echo '$(srcdir)/'`os/poll_posix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-poll_posix.Tpo os/$(DEPDIR)/libusb_1_0_la-poll_posix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/poll_posix.c' object='os/libusb_1_0_la-poll_posix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-poll_posix.lo `test -f 'os/poll_posix.c' || echo '$(srcdir)/'`os/poll_posix.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-poll_posix.lo `test -f 'os/poll_posix.c' || echo '$(srcdir)/'`os/poll_posix.c -libusb_1_0_la-linux_usbfs.lo: os/linux_usbfs.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-linux_usbfs.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-linux_usbfs.Tpo -c -o libusb_1_0_la-linux_usbfs.lo `test -f 'os/linux_usbfs.c' || echo '$(srcdir)/'`os/linux_usbfs.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-linux_usbfs.Tpo $(DEPDIR)/libusb_1_0_la-linux_usbfs.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/linux_usbfs.c' object='libusb_1_0_la-linux_usbfs.lo' libtool=yes @AMDEPBACKSLASH@ +os/libusb_1_0_la-linux_usbfs.lo: os/linux_usbfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-linux_usbfs.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-linux_usbfs.Tpo -c -o os/libusb_1_0_la-linux_usbfs.lo `test -f 'os/linux_usbfs.c' || echo '$(srcdir)/'`os/linux_usbfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-linux_usbfs.Tpo os/$(DEPDIR)/libusb_1_0_la-linux_usbfs.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/linux_usbfs.c' object='os/libusb_1_0_la-linux_usbfs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-linux_usbfs.lo `test -f 'os/linux_usbfs.c' || echo '$(srcdir)/'`os/linux_usbfs.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-linux_usbfs.lo `test -f 'os/linux_usbfs.c' || echo '$(srcdir)/'`os/linux_usbfs.c -libusb_1_0_la-linux_netlink.lo: os/linux_netlink.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-linux_netlink.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-linux_netlink.Tpo -c -o libusb_1_0_la-linux_netlink.lo `test -f 'os/linux_netlink.c' || echo '$(srcdir)/'`os/linux_netlink.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-linux_netlink.Tpo $(DEPDIR)/libusb_1_0_la-linux_netlink.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/linux_netlink.c' object='libusb_1_0_la-linux_netlink.lo' libtool=yes @AMDEPBACKSLASH@ +os/libusb_1_0_la-linux_netlink.lo: os/linux_netlink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-linux_netlink.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-linux_netlink.Tpo -c -o os/libusb_1_0_la-linux_netlink.lo `test -f 'os/linux_netlink.c' || echo '$(srcdir)/'`os/linux_netlink.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-linux_netlink.Tpo os/$(DEPDIR)/libusb_1_0_la-linux_netlink.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/linux_netlink.c' object='os/libusb_1_0_la-linux_netlink.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-linux_netlink.lo `test -f 'os/linux_netlink.c' || echo '$(srcdir)/'`os/linux_netlink.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-linux_netlink.lo `test -f 'os/linux_netlink.c' || echo '$(srcdir)/'`os/linux_netlink.c -libusb_1_0_la-linux_udev.lo: os/linux_udev.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-linux_udev.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-linux_udev.Tpo -c -o libusb_1_0_la-linux_udev.lo `test -f 'os/linux_udev.c' || echo '$(srcdir)/'`os/linux_udev.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-linux_udev.Tpo $(DEPDIR)/libusb_1_0_la-linux_udev.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/linux_udev.c' object='libusb_1_0_la-linux_udev.lo' libtool=yes @AMDEPBACKSLASH@ +os/libusb_1_0_la-linux_udev.lo: os/linux_udev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-linux_udev.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-linux_udev.Tpo -c -o os/libusb_1_0_la-linux_udev.lo `test -f 'os/linux_udev.c' || echo '$(srcdir)/'`os/linux_udev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-linux_udev.Tpo os/$(DEPDIR)/libusb_1_0_la-linux_udev.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/linux_udev.c' object='os/libusb_1_0_la-linux_udev.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-linux_udev.lo `test -f 'os/linux_udev.c' || echo '$(srcdir)/'`os/linux_udev.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-linux_udev.lo `test -f 'os/linux_udev.c' || echo '$(srcdir)/'`os/linux_udev.c -libusb_1_0_la-openbsd_usb.lo: os/openbsd_usb.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-openbsd_usb.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-openbsd_usb.Tpo -c -o libusb_1_0_la-openbsd_usb.lo `test -f 'os/openbsd_usb.c' || echo '$(srcdir)/'`os/openbsd_usb.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-openbsd_usb.Tpo $(DEPDIR)/libusb_1_0_la-openbsd_usb.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/openbsd_usb.c' object='libusb_1_0_la-openbsd_usb.lo' libtool=yes @AMDEPBACKSLASH@ +os/libusb_1_0_la-netbsd_usb.lo: os/netbsd_usb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-netbsd_usb.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-netbsd_usb.Tpo -c -o os/libusb_1_0_la-netbsd_usb.lo `test -f 'os/netbsd_usb.c' || echo '$(srcdir)/'`os/netbsd_usb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-netbsd_usb.Tpo os/$(DEPDIR)/libusb_1_0_la-netbsd_usb.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/netbsd_usb.c' object='os/libusb_1_0_la-netbsd_usb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-openbsd_usb.lo `test -f 'os/openbsd_usb.c' || echo '$(srcdir)/'`os/openbsd_usb.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-netbsd_usb.lo `test -f 'os/netbsd_usb.c' || echo '$(srcdir)/'`os/netbsd_usb.c -libusb_1_0_la-poll_windows.lo: os/poll_windows.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-poll_windows.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-poll_windows.Tpo -c -o libusb_1_0_la-poll_windows.lo `test -f 'os/poll_windows.c' || echo '$(srcdir)/'`os/poll_windows.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-poll_windows.Tpo $(DEPDIR)/libusb_1_0_la-poll_windows.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/poll_windows.c' object='libusb_1_0_la-poll_windows.lo' libtool=yes @AMDEPBACKSLASH@ +os/libusb_1_0_la-openbsd_usb.lo: os/openbsd_usb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-openbsd_usb.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-openbsd_usb.Tpo -c -o os/libusb_1_0_la-openbsd_usb.lo `test -f 'os/openbsd_usb.c' || echo '$(srcdir)/'`os/openbsd_usb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-openbsd_usb.Tpo os/$(DEPDIR)/libusb_1_0_la-openbsd_usb.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/openbsd_usb.c' object='os/libusb_1_0_la-openbsd_usb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-poll_windows.lo `test -f 'os/poll_windows.c' || echo '$(srcdir)/'`os/poll_windows.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-openbsd_usb.lo `test -f 'os/openbsd_usb.c' || echo '$(srcdir)/'`os/openbsd_usb.c -libusb_1_0_la-windows_usb.lo: os/windows_usb.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-windows_usb.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-windows_usb.Tpo -c -o libusb_1_0_la-windows_usb.lo `test -f 'os/windows_usb.c' || echo '$(srcdir)/'`os/windows_usb.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-windows_usb.Tpo $(DEPDIR)/libusb_1_0_la-windows_usb.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/windows_usb.c' object='libusb_1_0_la-windows_usb.lo' libtool=yes @AMDEPBACKSLASH@ +os/libusb_1_0_la-poll_windows.lo: os/poll_windows.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-poll_windows.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-poll_windows.Tpo -c -o os/libusb_1_0_la-poll_windows.lo `test -f 'os/poll_windows.c' || echo '$(srcdir)/'`os/poll_windows.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-poll_windows.Tpo os/$(DEPDIR)/libusb_1_0_la-poll_windows.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/poll_windows.c' object='os/libusb_1_0_la-poll_windows.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-windows_usb.lo `test -f 'os/windows_usb.c' || echo '$(srcdir)/'`os/windows_usb.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-poll_windows.lo `test -f 'os/poll_windows.c' || echo '$(srcdir)/'`os/poll_windows.c + +os/libusb_1_0_la-windows_usb.lo: os/windows_usb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-windows_usb.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-windows_usb.Tpo -c -o os/libusb_1_0_la-windows_usb.lo `test -f 'os/windows_usb.c' || echo '$(srcdir)/'`os/windows_usb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-windows_usb.Tpo os/$(DEPDIR)/libusb_1_0_la-windows_usb.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/windows_usb.c' object='os/libusb_1_0_la-windows_usb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-windows_usb.lo `test -f 'os/windows_usb.c' || echo '$(srcdir)/'`os/windows_usb.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs + -rm -rf os/.libs os/_libs install-hdrHEADERS: $(hdr_HEADERS) @$(NORMAL_INSTALL) @list='$(hdr_HEADERS)'; test -n "$(hdrdir)" || list=; \ @@ -751,6 +803,8 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f os/$(DEPDIR)/$(am__dirstamp) + -rm -f os/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -761,7 +815,7 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -rf ./$(DEPDIR) os/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -807,7 +861,7 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -rf ./$(DEPDIR) os/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -851,7 +905,7 @@ all: libusb-1.0.la libusb-1.0.dll @OS_WINDOWS_TRUE@libusb-1.0.rc: version.h version_nano.h -libusb-1.0.dll: libusb-1.0.def +libusb-1.0.dll: libusb-1.0.def libusb-1.0.la # Rebuild the import lib from the .def so that MS and MinGW DLLs can be interchanged @CREATE_IMPORT_LIB_TRUE@ $(AM_V_GEN)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $(srcdir)/libusb-1.0.def --dllname $@ --output-lib .libs/$@.a diff --git a/Externals/libusbx/libusb/core.c b/Externals/libusb/libusb/core.c similarity index 87% rename from Externals/libusbx/libusb/core.c rename to Externals/libusb/libusb/core.c index e29e8df254..f3d7ece652 100644 --- a/Externals/libusbx/libusb/core.c +++ b/Externals/libusb/libusb/core.c @@ -1,6 +1,6 @@ /* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */ /* - * Core functions for libusbx + * Core functions for libusb * Copyright © 2012-2013 Nathan Hjelm * Copyright © 2007-2008 Daniel Drake * Copyright © 2001 Johannes Erdfelt @@ -33,6 +33,9 @@ #ifdef HAVE_SYS_TIME_H #include #endif +#ifdef HAVE_SYSLOG_H +#include +#endif #ifdef __ANDROID__ #include @@ -47,6 +50,8 @@ const struct usbi_os_backend * const usbi_backend = &linux_usbfs_backend; const struct usbi_os_backend * const usbi_backend = &darwin_backend; #elif defined(OS_OPENBSD) const struct usbi_os_backend * const usbi_backend = &openbsd_backend; +#elif defined(OS_NETBSD) +const struct usbi_os_backend * const usbi_backend = &netbsd_backend; #elif defined(OS_WINDOWS) const struct usbi_os_backend * const usbi_backend = &windows_backend; #elif defined(OS_WINCE) @@ -56,9 +61,9 @@ const struct usbi_os_backend * const usbi_backend = &wince_backend; #endif struct libusb_context *usbi_default_context = NULL; -const struct libusb_version libusb_version_internal = +static const struct libusb_version libusb_version_internal = { LIBUSB_MAJOR, LIBUSB_MINOR, LIBUSB_MICRO, LIBUSB_NANO, - LIBUSB_RC, "http://libusbx.org" }; + LIBUSB_RC, "http://libusb.info" }; static int default_context_refcnt = 0; static usbi_mutex_static_t default_context_lock = USBI_MUTEX_INITIALIZER; static struct timeval timestamp_origin = { 0, 0 }; @@ -67,18 +72,18 @@ usbi_mutex_static_t active_contexts_lock = USBI_MUTEX_INITIALIZER; struct list_head active_contexts_list; /** - * \mainpage libusbx-1.0 API Reference + * \mainpage libusb-1.0 API Reference * * \section intro Introduction * - * libusbx is an open source library that allows you to communicate with USB + * libusb is an open source library that allows you to communicate with USB * devices from userspace. For more info, see the - * libusbx homepage. + * libusb homepage. * * This documentation is aimed at application developers wishing to * communicate with USB peripherals from their own software. After reviewing * this documentation, feedback and questions can be sent to the - * libusbx-devel mailing list. + * libusb-devel mailing list. * * This documentation assumes knowledge of how to operate USB devices from * a software standpoint (descriptors, configurations, interfaces, endpoints, @@ -102,25 +107,25 @@ struct list_head active_contexts_list; * \section gettingstarted Getting Started * * To begin reading the API documentation, start with the Modules page which - * links to the different categories of libusbx's functionality. + * links to the different categories of libusb's functionality. * * One decision you will have to make is whether to use the synchronous * or the asynchronous data transfer interface. The \ref io documentation * provides some insight into this topic. * - * Some example programs can be found in the libusbx source distribution under - * the "examples" subdirectory. The libusbx homepage includes a list of - * real-life project examples which use libusbx. + * Some example programs can be found in the libusb source distribution under + * the "examples" subdirectory. The libusb homepage includes a list of + * real-life project examples which use libusb. * * \section errorhandling Error handling * - * libusbx functions typically return 0 on success or a negative error code + * libusb functions typically return 0 on success or a negative error code * on failure. These negative error codes relate to LIBUSB_ERROR constants * which are listed on the \ref misc "miscellaneous" documentation page. * * \section msglog Debug message logging * - * libusbx uses stderr for all logging. By default, logging is set to NONE, + * libusb uses stderr for all logging. By default, logging is set to NONE, * which means that no output will be produced. However, unless the library * has been compiled with logging disabled, then any application calls to * libusb_set_debug(), or the setting of the environmental variable @@ -129,19 +134,19 @@ struct list_head active_contexts_list; * direct it to the null device if its output is undesireable. * * The libusb_set_debug() function can be used to enable logging of certain - * messages. Under standard configuration, libusbx doesn't really log much + * messages. Under standard configuration, libusb doesn't really log much * so you are advised to use this function to enable all error/warning/ * informational messages. It will help debug problems with your software. * * The logged messages are unstructured. There is no one-to-one correspondence * between messages being logged and success or failure return codes from - * libusbx functions. There is no format to the messages, so you should not + * libusb functions. There is no format to the messages, so you should not * try to capture or parse them. They are not and will not be localized. * These messages are not intended to being passed to your application user; - * instead, you should interpret the error codes returned from libusbx functions + * instead, you should interpret the error codes returned from libusb functions * and provide appropriate notification to the user. The messages are simply * there to aid you as a programmer, and if you're confused because you're - * getting a strange error code from a libusbx function, enabling message + * getting a strange error code from a libusb function, enabling message * logging may give you a suitable explanation. * * The LIBUSB_DEBUG environment variable can be used to enable message logging @@ -150,18 +155,18 @@ struct list_head active_contexts_list; * environment variable is set, the message logging verbosity level is fixed * and libusb_set_debug() effectively does nothing. * - * libusbx can be compiled without any logging functions, useful for embedded + * libusb can be compiled without any logging functions, useful for embedded * systems. In this case, libusb_set_debug() and the LIBUSB_DEBUG environment * variable have no effects. * - * libusbx can also be compiled with verbose debugging messages always. When + * libusb can also be compiled with verbose debugging messages always. When * the library is compiled in this way, all messages of all verbosities are * always logged. libusb_set_debug() and the LIBUSB_DEBUG environment variable * have no effects. * * \section remarks Other remarks * - * libusbx does have imperfections. The \ref caveats "caveats" page attempts + * libusb does have imperfections. The \ref caveats "caveats" page attempts * to document these. */ @@ -176,7 +181,7 @@ struct list_head active_contexts_list; * reset). * * The problem is that any other program could reset the device your program - * is working with, at any time. libusbx does not offer a mechanism to inform + * is working with, at any time. libusb does not offer a mechanism to inform * you when this has happened, so if someone else resets your device it will * not be clear to your own program why the device state has changed. * @@ -201,7 +206,7 @@ struct list_head active_contexts_list; * * \section configsel Configuration selection and handling * - * When libusbx presents a device handle to an application, there is a chance + * When libusb presents a device handle to an application, there is a chance * that the corresponding device may be in unconfigured state. For devices * with multiple configurations, there is also a chance that the configuration * currently selected is not the one that the application wants to use. @@ -212,13 +217,13 @@ struct list_head active_contexts_list; * -# If the device is already in the desired configuration, calling * libusb_set_configuration() using the same configuration value will cause * a lightweight device reset. This may not be desirable behaviour. - * -# libusbx will be unable to change configuration if the device is in + * -# libusb will be unable to change configuration if the device is in * another configuration and other programs or drivers have claimed * interfaces under that configuration. - * -# In the case where the desired configuration is already active, libusbx + * -# In the case where the desired configuration is already active, libusb * may not even be able to perform a lightweight device reset. For example, * take my USB keyboard with fingerprint reader: I'm interested in driving - * the fingerprint reader interface through libusbx, but the kernel's + * the fingerprint reader interface through libusb, but the kernel's * USB-HID driver will almost always have claimed the keyboard interface. * Because the kernel has claimed an interface, it is not even possible to * perform the lightweight device reset, so libusb_set_configuration() will @@ -258,13 +263,13 @@ if (cfg != desired) * considerations apply to Darwin or other platforms. * * When a transfer completes early (i.e. when less data is received/sent in - * any one packet than the transfer buffer allows for) then libusbx is designed + * any one packet than the transfer buffer allows for) then libusb is designed * to terminate the transfer immediately, not transferring or receiving any * more data unless other transfers have been queued by the user. * - * On legacy platforms, libusbx is unable to do this in all situations. After + * On legacy platforms, libusb is unable to do this in all situations. After * the incomplete packet occurs, "surplus" data may be transferred. For recent - * versions of libusbx, this information is kept (the data length of the + * versions of libusb, this information is kept (the data length of the * transfer is updated) and, for device-to-host transfers, any surplus data was * added to the buffer. Still, this is not a nice solution because it loses the * information about the end of the short packet, and the user probably wanted @@ -273,7 +278,7 @@ if (cfg != desired) * * \section zlp Zero length packets * - * - libusbx is able to send a packet of zero length to an endpoint simply by + * - libusb is able to send a packet of zero length to an endpoint simply by * submitting a transfer of zero length. * - The \ref libusb_transfer_flags::LIBUSB_TRANSFER_ADD_ZERO_PACKET * "LIBUSB_TRANSFER_ADD_ZERO_PACKET" flag is currently only supported on Linux. @@ -282,24 +287,24 @@ if (cfg != desired) /** * \page contexts Contexts * - * It is possible that libusbx may be used simultaneously from two independent + * It is possible that libusb may be used simultaneously from two independent * libraries linked into the same executable. For example, if your application * has a plugin-like system which allows the user to dynamically load a range * of modules into your program, it is feasible that two independently - * developed modules may both use libusbx. + * developed modules may both use libusb. * - * libusbx is written to allow for these multiple user scenarios. The two - * "instances" of libusbx will not interfere: libusb_set_debug() calls + * libusb is written to allow for these multiple user scenarios. The two + * "instances" of libusb will not interfere: libusb_set_debug() calls * from one user will not affect the same settings for other users, other - * users can continue using libusbx after one of them calls libusb_exit(), etc. + * users can continue using libusb after one of them calls libusb_exit(), etc. * - * This is made possible through libusbx's context concept. When you + * This is made possible through libusb's context concept. When you * call libusb_init(), you are (optionally) given a context. You can then pass - * this context pointer back into future libusbx functions. + * this context pointer back into future libusb functions. * * In order to keep things simple for more simplistic applications, it is * legal to pass NULL to all functions requiring a context pointer (as long as - * you're sure no other code will attempt to use libusbx from the same process). + * you're sure no other code will attempt to use libusb from the same process). * When you pass NULL, the default context will be used. The default context * is created the first time a process calls libusb_init() when no other * context is alive. Contexts are destroyed during libusb_exit(). @@ -312,17 +317,17 @@ if (cfg != desired) * reference count goes from 0 to 1, and is deinitialized and destroyed when * its reference count goes from 1 to 0. * - * You may be wondering why only a subset of libusbx functions require a - * context pointer in their function definition. Internally, libusbx stores + * You may be wondering why only a subset of libusb functions require a + * context pointer in their function definition. Internally, libusb stores * context pointers in other objects (e.g. libusb_device instances) and hence * can infer the context from those objects. */ /** * @defgroup lib Library initialization/deinitialization - * This page details how to initialize and deinitialize libusbx. Initialization - * must be performed before using any libusbx functionality, and similarly you - * must not call any libusbx functions after deinitialization. + * This page details how to initialize and deinitialize libusb. Initialization + * must be performed before using any libusb functionality, and similarly you + * must not call any libusb functions after deinitialization. */ /** @@ -379,7 +384,7 @@ libusb_free_device_list(list, 1); * device. * * \section devshandles Devices and device handles - * libusbx has a concept of a USB device, represented by the + * libusb has a concept of a USB device, represented by the * \ref libusb_device opaque type. A device represents a USB device that * is currently or was previously connected to the system. Using a reference * to a device, you can determine certain information about the device (e.g. @@ -395,8 +400,8 @@ libusb_free_device_list(list, 1); * using the device. * * When you've found a device that you'd like to operate, you must ask - * libusbx to open the device using the libusb_open() function. Assuming - * success, libusbx then returns you a device handle + * libusb to open the device using the libusb_open() function. Assuming + * success, libusb then returns you a device handle * (a \ref libusb_device_handle pointer). All "real" I/O operations then * operate on the handle rather than the original device pointer. * @@ -404,10 +409,10 @@ libusb_free_device_list(list, 1); * * Device discovery (i.e. calling libusb_get_device_list()) returns a * freshly-allocated list of devices. The list itself must be freed when - * you are done with it. libusbx also needs to know when it is OK to free + * you are done with it. libusb also needs to know when it is OK to free * the contents of the list - the devices themselves. * - * To handle these issues, libusbx provides you with two separate items: + * To handle these issues, libusb provides you with two separate items: * - A function to free the list itself * - A reference counting system for the devices inside * @@ -564,6 +569,10 @@ void usbi_disconnect_device(struct libusb_device *dev) dev->attached = 0; usbi_mutex_unlock(&dev->lock); + usbi_mutex_lock(&ctx->usb_devs_lock); + list_del(&dev->list); + usbi_mutex_unlock(&ctx->usb_devs_lock); + /* Signal that an event has occurred for this device if we support hotplug AND * the hotplug pipe is ready. This prevents an event from getting raised during * initial enumeration. libusb_handle_events will take care of dereferencing the @@ -574,10 +583,6 @@ void usbi_disconnect_device(struct libusb_device *dev) usbi_err(DEVICE_CTX(dev), "error writing hotplug message"); } } - - usbi_mutex_lock(&ctx->usb_devs_lock); - list_del(&dev->list); - usbi_mutex_unlock(&ctx->usb_devs_lock); } /* Perform some final sanity checks on a newly discovered device. If this @@ -603,7 +608,7 @@ int usbi_sanitize_device(struct libusb_device *dev) return 0; } -/* Examine libusbx's internal list of known devices, looking for one with +/* Examine libusb's internal list of known devices, looking for one with * a specific session ID. Returns the matching device if it was found, and * NULL otherwise. */ struct libusb_device *usbi_get_device_by_session_id(struct libusb_context *ctx, @@ -615,7 +620,7 @@ struct libusb_device *usbi_get_device_by_session_id(struct libusb_context *ctx, usbi_mutex_lock(&ctx->usb_devs_lock); list_for_each_entry(dev, &ctx->usb_devs, list, struct libusb_device) if (dev->session_data == session_id) { - ret = dev; + ret = libusb_ref_device(dev); break; } usbi_mutex_unlock(&ctx->usb_devs_lock); @@ -758,7 +763,7 @@ uint8_t API_EXPORTED libusb_get_port_number(libusb_device *dev) /** \ingroup dev * Get the list of all port numbers from root for the specified device * - * Since version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102 + * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 * \param dev a device * \param port_numbers the array that should contain the port numbers * \param port_numbers_len the maximum length of the array. As per the USB 3.0 @@ -770,22 +775,22 @@ int API_EXPORTED libusb_get_port_numbers(libusb_device *dev, uint8_t* port_numbers, int port_numbers_len) { int i = port_numbers_len; + struct libusb_context *ctx = DEVICE_CTX(dev); - while(dev) { - // HCDs can be listed as devices and would have port #0 - // TODO: see how the other backends want to implement HCDs as parents - if (dev->port_number == 0) - break; - i--; - if (i < 0) { - usbi_warn(DEVICE_CTX(dev), - "port numbers array too small"); + if (port_numbers_len <= 0) + return LIBUSB_ERROR_INVALID_PARAM; + + // HCDs can be listed as devices with port #0 + while((dev) && (dev->port_number != 0)) { + if (--i < 0) { + usbi_warn(ctx, "port numbers array is too small"); return LIBUSB_ERROR_OVERFLOW; } port_numbers[i] = dev->port_number; dev = dev->parent_dev; } - memmove(port_numbers, &port_numbers[i], port_numbers_len - i); + if (i < port_numbers_len) + memmove(port_numbers, &port_numbers[i], port_numbers_len - i); return port_numbers_len - i; } @@ -806,7 +811,7 @@ int API_EXPORTED libusb_get_port_path(libusb_context *ctx, libusb_device *dev, * \returns the device parent or NULL if not available * You should issue a \ref libusb_get_device_list() before calling this * function and make sure that you only access the parent before issuing - * \ref libusb_free_device_list(). The reason is that libusbx currently does + * \ref libusb_free_device_list(). The reason is that libusb currently does * not maintain a permanent list of device instances, and therefore can * only guarantee that parents are fully instantiated within a * libusb_get_device_list() - libusb_free_device_list() block. @@ -894,10 +899,14 @@ int API_EXPORTED libusb_get_max_packet_size(libusb_device *dev, } ep = find_endpoint(config, endpoint); - if (!ep) - return LIBUSB_ERROR_NOT_FOUND; + if (!ep) { + r = LIBUSB_ERROR_NOT_FOUND; + goto out; + } r = ep->wMaxPacketSize; + +out: libusb_free_config_descriptor(config); return r; } @@ -945,17 +954,21 @@ int API_EXPORTED libusb_get_max_iso_packet_size(libusb_device *dev, } ep = find_endpoint(config, endpoint); - if (!ep) - return LIBUSB_ERROR_NOT_FOUND; + if (!ep) { + r = LIBUSB_ERROR_NOT_FOUND; + goto out; + } val = ep->wMaxPacketSize; ep_type = (enum libusb_transfer_type) (ep->bmAttributes & 0x3); - libusb_free_config_descriptor(config); r = val & 0x07ff; if (ep_type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS || ep_type == LIBUSB_TRANSFER_TYPE_INTERRUPT) r *= (1 + ((val >> 11) & 3)); + +out: + libusb_free_config_descriptor(config); return r; } @@ -1115,7 +1128,7 @@ int API_EXPORTED libusb_open(libusb_device *dev, /* At this point, we want to interrupt any existing event handlers so * that they realise the addition of the new device's poll fd. One * example when this is desirable is if the user is running a separate - * dedicated libusbx events handling thread, which is running with a long + * dedicated libusb events handling thread, which is running with a long * or infinite timeout. We want to interrupt that iteration of the loop, * so that it picks up the new fd, and then continues. */ usbi_fd_notification(ctx); @@ -1126,7 +1139,7 @@ int API_EXPORTED libusb_open(libusb_device *dev, /** \ingroup dev * Convenience function for finding a device with a particular * idVendor/idProduct combination. This function is intended - * for those scenarios where you are using libusbx to knock up a quick test + * for those scenarios where you are using libusb to knock up a quick test * application - it allows you to avoid calling libusb_get_device_list() and * worrying about traversing/freeing the list. * @@ -1420,7 +1433,7 @@ int API_EXPORTED libusb_set_configuration(libusb_device_handle *dev, * you wish to use before you can perform I/O on any of its endpoints. * * It is legal to attempt to claim an already-claimed interface, in which - * case libusbx just returns 0 without doing anything. + * case libusb just returns 0 without doing anything. * * If auto_detach_kernel_driver is set to 1 for dev, the kernel driver * will be detached if necessary, on failure the detach error is returned. @@ -1610,9 +1623,72 @@ int API_EXPORTED libusb_reset_device(libusb_device_handle *dev) return usbi_backend->reset_device(dev); } +/** \ingroup asyncio + * Allocate up to num_streams usb bulk streams on the specified endpoints. This + * function takes an array of endpoints rather then a single endpoint because + * some protocols require that endpoints are setup with similar stream ids. + * All endpoints passed in must belong to the same interface. + * + * Note this function may return less streams then requested. Also note that the + * same number of streams are allocated for each endpoint in the endpoint array. + * + * Stream id 0 is reserved, and should not be used to communicate with devices. + * If libusb_alloc_streams() returns with a value of N, you may use stream ids + * 1 to N. + * + * Since version 1.0.19, \ref LIBUSB_API_VERSION >= 0x01000103 + * + * \param dev a device handle + * \param num_streams number of streams to try to allocate + * \param endpoints array of endpoints to allocate streams on + * \param num_endpoints length of the endpoints array + * \returns number of streams allocated, or a LIBUSB_ERROR code on failure + */ +int API_EXPORTED libusb_alloc_streams(libusb_device_handle *dev, + uint32_t num_streams, unsigned char *endpoints, int num_endpoints) +{ + usbi_dbg("streams %u eps %d", (unsigned) num_streams, num_endpoints); + + if (!dev->dev->attached) + return LIBUSB_ERROR_NO_DEVICE; + + if (usbi_backend->alloc_streams) + return usbi_backend->alloc_streams(dev, num_streams, endpoints, + num_endpoints); + else + return LIBUSB_ERROR_NOT_SUPPORTED; +} + +/** \ingroup asyncio + * Free usb bulk streams allocated with libusb_alloc_streams(). + * + * Note streams are automatically free-ed when releasing an interface. + * + * Since version 1.0.19, \ref LIBUSB_API_VERSION >= 0x01000103 + * + * \param dev a device handle + * \param endpoints array of endpoints to free streams on + * \param num_endpoints length of the endpoints array + * \returns LIBUSB_SUCCESS, or a LIBUSB_ERROR code on failure + */ +int API_EXPORTED libusb_free_streams(libusb_device_handle *dev, + unsigned char *endpoints, int num_endpoints) +{ + usbi_dbg("eps %d", num_endpoints); + + if (!dev->dev->attached) + return LIBUSB_ERROR_NO_DEVICE; + + if (usbi_backend->free_streams) + return usbi_backend->free_streams(dev, endpoints, + num_endpoints); + else + return LIBUSB_ERROR_NOT_SUPPORTED; +} + /** \ingroup dev * Determine if a kernel driver is active on an interface. If a kernel driver - * is active, you cannot claim the interface, and libusbx will be unable to + * is active, you cannot claim the interface, and libusb will be unable to * perform I/O. * * This functionality is not available on Windows. @@ -1647,7 +1723,7 @@ int API_EXPORTED libusb_kernel_driver_active(libusb_device_handle *dev, * * This functionality is not available on Darwin or Windows. * - * Note that libusbx itself also talks to the device through a special kernel + * Note that libusb itself also talks to the device through a special kernel * driver, if this driver is already attached to the device, this call will * not detach it and return LIBUSB_ERROR_NOT_FOUND. * @@ -1711,15 +1787,15 @@ int API_EXPORTED libusb_attach_kernel_driver(libusb_device_handle *dev, } /** \ingroup dev - * Enable/disable libusbx's automatic kernel driver detachment. When this is - * enabled libusbx will automatically detach the kernel driver on an interface + * Enable/disable libusb's automatic kernel driver detachment. When this is + * enabled libusb will automatically detach the kernel driver on an interface * when claiming the interface, and attach it when releasing the interface. * * Automatic kernel driver detachment is disabled on newly opened device * handles by default. * * On platforms which do not have LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER - * this function will return LIBUSB_ERROR_NOT_SUPPORTED, and libusbx will + * this function will return LIBUSB_ERROR_NOT_SUPPORTED, and libusb will * continue as if this function was never called. * * \param dev a device handle @@ -1749,19 +1825,19 @@ int API_EXPORTED libusb_set_auto_detach_kernel_driver( * printed. If you choose to increase the message verbosity level, ensure * that your application does not close the stdout/stderr file descriptors. * - * You are advised to use level LIBUSB_LOG_LEVEL_WARNING. libusbx is conservative + * You are advised to use level LIBUSB_LOG_LEVEL_WARNING. libusb is conservative * with its message logging and most of the time, will only log messages that * explain error conditions and other oddities. This will help you debug * your software. * - * If the LIBUSB_DEBUG environment variable was set when libusbx was + * If the LIBUSB_DEBUG environment variable was set when libusb was * initialized, this function does nothing: the message verbosity is fixed * to the value in the environment variable. * - * If libusbx was compiled without any message logging, this function does + * If libusb was compiled without any message logging, this function does * nothing: you'll never get any messages. * - * If libusbx was compiled with verbose debug message logging, this function + * If libusb was compiled with verbose debug message logging, this function * does nothing: you'll always get messages from all levels. * * \param ctx the context to operate on, or NULL for the default context @@ -1776,7 +1852,7 @@ void API_EXPORTED libusb_set_debug(libusb_context *ctx, int level) /** \ingroup lib * Initialize libusb. This function must be called before calling any other - * libusbx function. + * libusb function. * * If you do not provide an output location for a context pointer, a default * context will be created. If there was already a default context, it will @@ -1831,7 +1907,7 @@ int API_EXPORTED libusb_init(libusb_context **context) usbi_dbg("created default context"); } - usbi_dbg("libusbx v%d.%d.%d.%d", libusb_version_internal.major, libusb_version_internal.minor, + usbi_dbg("libusb v%d.%d.%d.%d", libusb_version_internal.major, libusb_version_internal.minor, libusb_version_internal.micro, libusb_version_internal.nano); usbi_mutex_init(&ctx->usb_devs_lock, NULL); @@ -1873,10 +1949,6 @@ err_free_ctx: if (ctx == usbi_default_context) usbi_default_context = NULL; - usbi_mutex_destroy(&ctx->open_devs_lock); - usbi_mutex_destroy(&ctx->usb_devs_lock); - usbi_mutex_destroy(&ctx->hotplug_cbs_lock); - usbi_mutex_static_lock(&active_contexts_lock); list_del (&ctx->list); usbi_mutex_static_unlock(&active_contexts_lock); @@ -1888,6 +1960,10 @@ err_free_ctx: } usbi_mutex_unlock(&ctx->usb_devs_lock); + usbi_mutex_destroy(&ctx->open_devs_lock); + usbi_mutex_destroy(&ctx->usb_devs_lock); + usbi_mutex_destroy(&ctx->hotplug_cbs_lock); + free(ctx); err_unlock: usbi_mutex_static_unlock(&default_context_lock); @@ -1902,6 +1978,7 @@ err_unlock: void API_EXPORTED libusb_exit(struct libusb_context *ctx) { struct libusb_device *dev, *next; + struct timeval tv = { 0, 0 }; usbi_dbg(""); USBI_GET_CONTEXT(ctx); @@ -1926,6 +2003,19 @@ void API_EXPORTED libusb_exit(struct libusb_context *ctx) if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) { usbi_hotplug_deregister_all(ctx); + + /* + * Ensure any pending unplug events are read from the hotplug + * pipe. The usb_device-s hold in the events are no longer part + * of usb_devs, but the events still hold a reference! + * + * Note we don't do this if the application has left devices + * open (which implies a buggy app) to avoid packet completion + * handlers running when the app does not expect them to run. + */ + if (list_empty(&ctx->open_devs)) + libusb_handle_events_timeout(ctx, &tv); + usbi_mutex_lock(&ctx->usb_devs_lock); list_for_each_entry_safe(dev, next, &ctx->usb_devs, list, struct libusb_device) { list_del(&dev->list); @@ -2026,10 +2116,42 @@ int usbi_gettimeofday(struct timeval *tp, void *tzp) } #endif -static void usbi_log_str(struct libusb_context *ctx, const char * str) +static void usbi_log_str(struct libusb_context *ctx, + enum libusb_log_level level, const char * str) { - UNUSED(ctx); +#if defined(USE_SYSTEM_LOGGING_FACILITY) +#if defined(OS_WINDOWS) || defined(OS_WINCE) + /* Windows CE only supports the Unicode version of OutputDebugString. */ + WCHAR wbuf[USBI_MAX_LOG_LEN]; + MultiByteToWideChar(CP_UTF8, 0, str, -1, wbuf, sizeof(wbuf)); + OutputDebugStringW(wbuf); +#elif defined(__ANDROID__) + int priority = ANDROID_LOG_UNKNOWN; + switch (level) { + case LIBUSB_LOG_LEVEL_INFO: priority = ANDROID_LOG_INFO; break; + case LIBUSB_LOG_LEVEL_WARNING: priority = ANDROID_LOG_WARN; break; + case LIBUSB_LOG_LEVEL_ERROR: priority = ANDROID_LOG_ERROR; break; + case LIBUSB_LOG_LEVEL_DEBUG: priority = ANDROID_LOG_DEBUG; break; + } + __android_log_write(priority, "libusb", str); +#elif defined(HAVE_SYSLOG_FUNC) + int syslog_level = LOG_INFO; + switch (level) { + case LIBUSB_LOG_LEVEL_INFO: syslog_level = LOG_INFO; break; + case LIBUSB_LOG_LEVEL_WARNING: syslog_level = LOG_WARNING; break; + case LIBUSB_LOG_LEVEL_ERROR: syslog_level = LOG_ERR; break; + case LIBUSB_LOG_LEVEL_DEBUG: syslog_level = LOG_DEBUG; break; + } + syslog(syslog_level, "%s", str); +#else /* All of gcc, Clang, XCode seem to use #warning */ +#warning System logging is not supported on this platform. Logging to stderr will be used instead. fputs(str, stderr); +#endif +#else + fputs(str, stderr); +#endif /* USE_SYSTEM_LOGGING_FACILITY */ + UNUSED(ctx); + UNUSED(level); } void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level, @@ -2045,47 +2167,32 @@ void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level, global_debug = 1; UNUSED(ctx); #else + int ctx_level = 0; + USBI_GET_CONTEXT(ctx); - if (ctx == NULL) + if (ctx) { + ctx_level = ctx->debug; + } else { + char *dbg = getenv("LIBUSB_DEBUG"); + if (dbg) + ctx_level = atoi(dbg); + } + global_debug = (ctx_level == LIBUSB_LOG_LEVEL_DEBUG); + if (!ctx_level) return; - global_debug = (ctx->debug == LIBUSB_LOG_LEVEL_DEBUG); - if (!ctx->debug) + if (level == LIBUSB_LOG_LEVEL_WARNING && ctx_level < LIBUSB_LOG_LEVEL_WARNING) return; - if (level == LIBUSB_LOG_LEVEL_WARNING && ctx->debug < LIBUSB_LOG_LEVEL_WARNING) + if (level == LIBUSB_LOG_LEVEL_INFO && ctx_level < LIBUSB_LOG_LEVEL_INFO) return; - if (level == LIBUSB_LOG_LEVEL_INFO && ctx->debug < LIBUSB_LOG_LEVEL_INFO) - return; - if (level == LIBUSB_LOG_LEVEL_DEBUG && ctx->debug < LIBUSB_LOG_LEVEL_DEBUG) + if (level == LIBUSB_LOG_LEVEL_DEBUG && ctx_level < LIBUSB_LOG_LEVEL_DEBUG) return; #endif -#ifdef __ANDROID__ - int prio; - switch (level) { - case LOG_LEVEL_INFO: - prio = ANDROID_LOG_INFO; - break; - case LOG_LEVEL_WARNING: - prio = ANDROID_LOG_WARN; - break; - case LOG_LEVEL_ERROR: - prio = ANDROID_LOG_ERROR; - break; - case LOG_LEVEL_DEBUG: - prio = ANDROID_LOG_DEBUG; - break; - default: - prio = ANDROID_LOG_UNKNOWN; - break; - } - - __android_log_vprint(prio, "LibUsb", format, args); -#else usbi_gettimeofday(&now, NULL); if ((global_debug) && (!has_debug_header_been_displayed)) { has_debug_header_been_displayed = 1; - usbi_log_str(ctx, "[timestamp] [threadID] facility level [function call] \n"); - usbi_log_str(ctx, "--------------------------------------------------------------------------------\n"); + usbi_log_str(ctx, LIBUSB_LOG_LEVEL_DEBUG, "[timestamp] [threadID] facility level [function call] \n"); + usbi_log_str(ctx, LIBUSB_LOG_LEVEL_DEBUG, "--------------------------------------------------------------------------------\n"); } if (now.tv_usec < timestamp_origin.tv_usec) { now.tv_sec--; @@ -2108,7 +2215,7 @@ void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level, prefix = "debug"; break; case LIBUSB_LOG_LEVEL_NONE: - break; + return; default: prefix = "unknown"; break; @@ -2116,11 +2223,11 @@ void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level, if (global_debug) { header_len = snprintf(buf, sizeof(buf), - "[%2d.%06d] [%08x] libusbx: %s [%s] ", + "[%2d.%06d] [%08x] libusb: %s [%s] ", (int)now.tv_sec, (int)now.tv_usec, usbi_get_tid(), prefix, function); } else { header_len = snprintf(buf, sizeof(buf), - "libusbx: %s [%s] ", prefix, function); + "libusb: %s [%s] ", prefix, function); } if (header_len < 0 || header_len >= sizeof(buf)) { @@ -2143,8 +2250,7 @@ void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level, } strcpy(buf + header_len + text_len, USBI_LOG_LINE_END); - usbi_log_str(ctx, buf); -#endif + usbi_log_str(ctx, level, buf); } void usbi_log(struct libusb_context *ctx, enum libusb_log_level level, @@ -2158,7 +2264,7 @@ void usbi_log(struct libusb_context *ctx, enum libusb_log_level level, } /** \ingroup misc - * Returns a constant NULL-terminated string with the ASCII name of a libusbx + * Returns a constant NULL-terminated string with the ASCII name of a libusb * error or transfer status code. The caller must not free() the returned * string. * diff --git a/Externals/libusbx/libusb/descriptor.c b/Externals/libusb/libusb/descriptor.c similarity index 99% rename from Externals/libusbx/libusb/descriptor.c rename to Externals/libusb/libusb/descriptor.c index ba6d1467d7..93d34ced50 100644 --- a/Externals/libusbx/libusb/descriptor.c +++ b/Externals/libusb/libusb/descriptor.c @@ -1,6 +1,6 @@ /* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */ /* - * USB descriptor handling functions for libusbx + * USB descriptor handling functions for libusb * Copyright © 2007 Daniel Drake * Copyright © 2001 Johannes Erdfelt * @@ -541,7 +541,7 @@ int usbi_device_cache_descriptor(libusb_device *dev) * * This is a non-blocking function; the device descriptor is cached in memory. * - * Note since libusbx-1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102, this + * Note since libusb-1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102, this * function always succeeds. * * \param dev the device @@ -660,7 +660,7 @@ int API_EXPORTED libusb_get_config_descriptor(libusb_device *dev, /* iterate through all configurations, returning the index of the configuration * matching a specific bConfigurationValue in the idx output parameter, or -1 * if the config was not found. - * returns 0 or a LIBUSB_ERROR code + * returns 0 on success or a LIBUSB_ERROR code */ int usbi_get_config_index_by_value(struct libusb_device *dev, uint8_t bConfigurationValue, int *idx) @@ -673,8 +673,10 @@ int usbi_get_config_index_by_value(struct libusb_device *dev, int host_endian; int r = usbi_backend->get_config_descriptor(dev, i, tmp, sizeof(tmp), &host_endian); - if (r < 0) + if (r < 0) { + *idx = -1; return r; + } if (tmp[5] == bConfigurationValue) { *idx = i; return 0; diff --git a/Externals/libusbx/libusb/hotplug.c b/Externals/libusb/libusb/hotplug.c similarity index 88% rename from Externals/libusbx/libusb/hotplug.c rename to Externals/libusb/libusb/hotplug.c index 6b04342f08..eba8f98b5e 100644 --- a/Externals/libusbx/libusb/hotplug.c +++ b/Externals/libusb/libusb/hotplug.c @@ -1,6 +1,6 @@ /* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */ /* - * Hotplug functions for libusbx + * Hotplug functions for libusb * Copyright © 2012-2013 Nathan Hjelm * Copyright © 2012-2013 Peter Stuge * @@ -45,7 +45,7 @@ * * \section intro Introduction * - * Version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102, has added support + * Version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102, has added support * for hotplug events on some platforms (you should test if your platform * supports hotplug notification by calling \ref libusb_has_capability() with * parameter \ref LIBUSB_CAP_HAS_HOTPLUG). @@ -59,7 +59,11 @@ * * A callback function must return an int (0 or 1) indicating whether the callback is * expecting additional events. Returning 0 will rearm the callback and 1 will cause - * the callback to be deregistered. + * the callback to be deregistered. Note that when callbacks are called from + * libusb_hotplug_register_callback() because of the \ref LIBUSB_HOTPLUG_ENUMERATE + * flag, the callback return value is ignored, iow you cannot cause a callback + * to be deregistered by returning 1 when it is called from + * libusb_hotplug_register_callback(). * * Callbacks for a particular context are automatically deregistered by libusb_exit(). * @@ -76,12 +80,16 @@ * are invalid and will remain so even if the device comes back. * * When handling a LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED event it is considered - * safe to call any libusbx function that takes a libusb_device. On the other hand, + * safe to call any libusb function that takes a libusb_device. On the other hand, * when handling a LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT event the only safe function * is libusb_get_device_descriptor(). * * The following code provides an example of the usage of the hotplug interface: \code +#include +#include +#include + static int count = 0; int hotplug_callback(struct libusb_context *ctx, struct libusb_device *dev, @@ -127,10 +135,11 @@ int main (void) { } while (count < 2) { + libusb_handle_events_completed(NULL, NULL); usleep(10000); } - libusb_hotplug_deregister_callback(handle); + libusb_hotplug_deregister_callback(NULL, handle); libusb_exit(NULL); return 0; @@ -167,8 +176,7 @@ static int usbi_hotplug_match_cb (struct libusb_context *ctx, return 0; } - return hotplug_cb->cb (ctx == usbi_default_context ? NULL : ctx, - dev, event, hotplug_cb->user_data); + return hotplug_cb->cb (ctx, dev, event, hotplug_cb->user_data); } void usbi_hotplug_match(struct libusb_context *ctx, struct libusb_device *dev, @@ -192,18 +200,7 @@ void usbi_hotplug_match(struct libusb_context *ctx, struct libusb_device *dev, usbi_mutex_unlock(&ctx->hotplug_cbs_lock); - /* loop through and disconnect all open handles for this device */ - if (LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT == event) { - struct libusb_device_handle *handle; - - usbi_mutex_lock(&ctx->open_devs_lock); - list_for_each_entry(handle, &ctx->open_devs, list, struct libusb_device_handle) { - if (dev == handle->dev) { - usbi_handle_disconnect (handle); - } - } - usbi_mutex_unlock(&ctx->open_devs_lock); - } + /* the backend is expected to call the callback for each active transfer */ } int API_EXPORTED libusb_hotplug_register_callback(libusb_context *ctx, @@ -253,19 +250,29 @@ int API_EXPORTED libusb_hotplug_register_callback(libusb_context *ctx, list_add(&new_callback->list, &ctx->hotplug_cbs); + usbi_mutex_unlock(&ctx->hotplug_cbs_lock); + + if (flags & LIBUSB_HOTPLUG_ENUMERATE) { - struct libusb_device *dev; + int i, len; + struct libusb_device **devs; - usbi_mutex_lock(&ctx->usb_devs_lock); - - list_for_each_entry(dev, &ctx->usb_devs, list, struct libusb_device) { - (void) usbi_hotplug_match_cb (ctx, dev, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, new_callback); + len = (int) libusb_get_device_list(ctx, &devs); + if (len < 0) { + libusb_hotplug_deregister_callback(ctx, + new_callback->handle); + return len; } - usbi_mutex_unlock(&ctx->usb_devs_lock); + for (i = 0; i < len; i++) { + usbi_hotplug_match_cb(ctx, devs[i], + LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, + new_callback); + } + + libusb_free_device_list(devs, 1); } - usbi_mutex_unlock(&ctx->hotplug_cbs_lock); if (handle) { *handle = new_callback->handle; diff --git a/Externals/libusbx/libusb/hotplug.h b/Externals/libusb/libusb/hotplug.h similarity index 98% rename from Externals/libusbx/libusb/hotplug.h rename to Externals/libusb/libusb/hotplug.h index 614ddbcff0..321a0a8630 100644 --- a/Externals/libusbx/libusb/hotplug.h +++ b/Externals/libusb/libusb/hotplug.h @@ -1,6 +1,6 @@ /* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */ /* - * Hotplug support for libusbx + * Hotplug support for libusb * Copyright © 2012-2013 Nathan Hjelm * Copyright © 2012-2013 Peter Stuge * diff --git a/Externals/libusbx/libusb/io.c b/Externals/libusb/libusb/io.c similarity index 90% rename from Externals/libusbx/libusb/io.c rename to Externals/libusb/libusb/io.c index 4368b99457..b9ca767d76 100644 --- a/Externals/libusbx/libusb/io.c +++ b/Externals/libusb/libusb/io.c @@ -1,6 +1,6 @@ /* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */ /* - * I/O functions for libusbx + * I/O functions for libusb * Copyright © 2007-2009 Daniel Drake * Copyright © 2001 Johannes Erdfelt * @@ -43,10 +43,10 @@ * * \section intro Introduction * - * If you're using libusbx in your application, you're probably wanting to + * If you're using libusb in your application, you're probably wanting to * perform I/O with devices - you want to perform USB data transfers. * - * libusbx offers two separate interfaces for device I/O. This page aims to + * libusb offers two separate interfaces for device I/O. This page aims to * introduce the two in order to help you decide which one is more suitable * for your application. You can also choose to use both interfaces in your * application by considering each transfer on a case-by-case basis. @@ -76,7 +76,7 @@ * Data will arrive when the button is pressed by the user, which is * potentially hours later. * - * libusbx offers both a synchronous and an asynchronous interface to performing + * libusb offers both a synchronous and an asynchronous interface to performing * USB transfers. The main difference is that the synchronous interface * combines both steps indicated above into a single function call, whereas * the asynchronous interface separates them. @@ -131,9 +131,9 @@ if (r == 0 && actual_length == sizeof(data)) { * above. * * Instead of providing which functions that block until the I/O has complete, - * libusbx's asynchronous interface presents non-blocking functions which + * libusb's asynchronous interface presents non-blocking functions which * begin a transfer and then return immediately. Your application passes a - * callback function pointer to this non-blocking function, which libusbx will + * callback function pointer to this non-blocking function, which libusb will * call with the results of the transaction when it has completed. * * Transfers which have been submitted through the non-blocking functions @@ -144,12 +144,12 @@ if (r == 0 && actual_length == sizeof(data)) { * to use threads. * * This added flexibility does come with some complications though: - * - In the interest of being a lightweight library, libusbx does not create + * - In the interest of being a lightweight library, libusb does not create * threads and can only operate when your application is calling into it. Your - * application must call into libusbx from it's main loop when events are ready - * to be handled, or you must use some other scheme to allow libusbx to + * application must call into libusb from it's main loop when events are ready + * to be handled, or you must use some other scheme to allow libusb to * undertake whatever work needs to be done. - * - libusbx also needs to be called into at certain fixed points in time in + * - libusb also needs to be called into at certain fixed points in time in * order to accurately handle transfer timeouts. * - Memory handling becomes more complex. You cannot use stack memory unless * the function with that stack is guaranteed not to return until the transfer @@ -159,7 +159,7 @@ if (r == 0 && actual_length == sizeof(data)) { * results are handled. This becomes particularly obvious when you want to * submit a second transfer based on the results of an earlier transfer. * - * Internally, libusbx's synchronous interface is expressed in terms of function + * Internally, libusb's synchronous interface is expressed in terms of function * calls to the asynchronous interface. * * For details on how to use the asynchronous API, see the @@ -176,25 +176,25 @@ if (r == 0 && actual_length == sizeof(data)) { * constraints on packet size defined by endpoint descriptors. The host must * not send data payloads larger than the endpoint's maximum packet size. * - * libusbx and the underlying OS abstract out the packet concept, allowing you + * libusb and the underlying OS abstract out the packet concept, allowing you * to request transfers of any size. Internally, the request will be divided * up into correctly-sized packets. You do not have to be concerned with * packet sizes, but there is one exception when considering overflows. * * \section overflow Bulk/interrupt transfer overflows * - * When requesting data on a bulk endpoint, libusbx requires you to supply a - * buffer and the maximum number of bytes of data that libusbx can put in that + * When requesting data on a bulk endpoint, libusb requires you to supply a + * buffer and the maximum number of bytes of data that libusb can put in that * buffer. However, the size of the buffer is not communicated to the device - * the device is just asked to send any amount of data. * * There is no problem if the device sends an amount of data that is less than - * or equal to the buffer size. libusbx reports this condition to you through + * or equal to the buffer size. libusb reports this condition to you through * the \ref libusb_transfer::actual_length "libusb_transfer.actual_length" * field. * * Problems may occur if the device attempts to send more data than can fit in - * the buffer. libusbx reports LIBUSB_TRANSFER_OVERFLOW for this condition but + * the buffer. libusb reports LIBUSB_TRANSFER_OVERFLOW for this condition but * other behaviour is largely undefined: actual_length may or may not be * accurate, the chunk of data that can fit in the buffer (before overflow) * may or may not have been transferred. @@ -212,7 +212,7 @@ if (r == 0 && actual_length == sizeof(data)) { /** * @defgroup asyncio Asynchronous device I/O * - * This page details libusbx's asynchronous (non-blocking) API for USB device + * This page details libusb's asynchronous (non-blocking) API for USB device * I/O. This interface is very powerful but is also quite complex - you will * need to read this page carefully to understand the necessary considerations * and issues surrounding use of this interface. Simplistic applications @@ -227,7 +227,7 @@ if (r == 0 && actual_length == sizeof(data)) { * * \section asyncabstraction Transfer abstraction * - * For the asynchronous I/O, libusbx implements the concept of a generic + * For the asynchronous I/O, libusb implements the concept of a generic * transfer entity for all types of I/O (control, bulk, interrupt, * isochronous). The generic transfer object must be treated slightly * differently depending on which type of I/O you are performing with it. @@ -240,7 +240,7 @@ if (r == 0 && actual_length == sizeof(data)) { * -# Allocation: allocate a libusb_transfer * -# Filling: populate the libusb_transfer instance with information * about the transfer you wish to perform - * -# Submission: ask libusbx to submit the transfer + * -# Submission: ask libusb to submit the transfer * -# Completion handling: examine transfer results in the * libusb_transfer structure * -# Deallocation: clean up resources @@ -287,7 +287,7 @@ if (r == 0 && actual_length == sizeof(data)) { * * The user-specified callback is passed a pointer to the libusb_transfer * structure which was used to setup and submit the transfer. At completion - * time, libusbx has populated this structure with results of the transfer: + * time, libusb has populated this structure with results of the transfer: * success or failure reason, number of bytes of data transferred, etc. See * the libusb_transfer structure documentation for more information. * @@ -326,7 +326,7 @@ if (r == 0 && actual_length == sizeof(data)) { * has completed will result in undefined behaviour. * * When a transfer is cancelled, some of the data may have been transferred. - * libusbx will communicate this to you in the transfer callback. Do not assume + * libusb will communicate this to you in the transfer callback. Do not assume * that no data was transferred. * * \section bulk_overflows Overflows on device-to-host bulk/interrupt endpoints @@ -468,7 +468,7 @@ if (r == 0 && actual_length == sizeof(data)) { * * In most circumstances, it is not safe to use stack memory for transfer * buffers. This is because the function that fired off the asynchronous - * transfer may return before libusbx has finished using the buffer, and when + * transfer may return before libusb has finished using the buffer, and when * the function returns it's stack gets destroyed. This is true for both * host-to-device and device-to-host transfers. * @@ -488,43 +488,43 @@ if (r == 0 && actual_length == sizeof(data)) { * \ref libusb_transfer_status::LIBUSB_TRANSFER_ERROR "LIBUSB_TRANSFER_ERROR" * (they would normally be regarded as COMPLETED) * - \ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_BUFFER - * "LIBUSB_TRANSFER_FREE_BUFFER" allows you to ask libusbx to free the transfer + * "LIBUSB_TRANSFER_FREE_BUFFER" allows you to ask libusb to free the transfer * buffer when freeing the transfer. * - \ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_TRANSFER - * "LIBUSB_TRANSFER_FREE_TRANSFER" causes libusbx to automatically free the + * "LIBUSB_TRANSFER_FREE_TRANSFER" causes libusb to automatically free the * transfer after the transfer callback returns. * * \section asyncevent Event handling * - * An asynchronous model requires that libusbx perform work at various + * An asynchronous model requires that libusb perform work at various * points in time - namely processing the results of previously-submitted * transfers and invoking the user-supplied callback function. * * This gives rise to the libusb_handle_events() function which your - * application must call into when libusbx has work do to. This gives libusbx + * application must call into when libusb has work do to. This gives libusb * the opportunity to reap pending transfers, invoke callbacks, etc. * * There are 2 different approaches to dealing with libusb_handle_events: * * -# Repeatedly call libusb_handle_events() in blocking mode from a dedicated * thread. - * -# Integrate libusbx with your application's main event loop. libusbx + * -# Integrate libusb with your application's main event loop. libusb * exposes a set of file descriptors which allow you to do this. * * The first approach has the big advantage that it will also work on Windows - * were libusbx' poll API for select / poll integration is not available. So + * were libusb' poll API for select / poll integration is not available. So * if you want to support Windows and use the async API, you must use this * approach, see the \ref eventthread "Using an event handling thread" section * below for details. * * If you prefer a single threaded approach with a single central event loop, - * see the \ref poll "polling and timing" section for how to integrate libusbx + * see the \ref poll "polling and timing" section for how to integrate libusb * into your application's main event loop. * * \section eventthread Using an event handling thread * * Lets begin with stating the obvious: If you're going to use a separate - * thread for libusbx event handling, your callback functions MUST be + * thread for libusb event handling, your callback functions MUST be * threadsafe. * * Other then that doing event handling from a separate thread, is mostly @@ -545,7 +545,7 @@ void *event_thread_func(void *ctx) * libusb_handle_events() will not return. * * There are 2 different ways of dealing with this, depending on if your - * application uses libusbx' \ref hotplug "hotplug" support or not. + * application uses libusb' \ref hotplug "hotplug" support or not. * * Applications which do not use hotplug support, should not start the event * thread until after their first call to libusb_open(), and should stop the @@ -582,7 +582,7 @@ void my_libusb_exit(void) /** * @defgroup poll Polling and timing * - * This page documents libusbx's functions for polling events and timing. + * This page documents libusb's functions for polling events and timing. * These functions are only necessary for users of the * \ref asyncio "asynchronous API". If you are only using the simpler * \ref syncio "synchronous API" then you do not need to ever call these @@ -590,28 +590,28 @@ void my_libusb_exit(void) * * The justification for the functionality described here has already been * discussed in the \ref asyncevent "event handling" section of the - * asynchronous API documentation. In summary, libusbx does not create internal + * asynchronous API documentation. In summary, libusb does not create internal * threads for event processing and hence relies on your application calling - * into libusbx at certain points in time so that pending events can be handled. + * into libusb at certain points in time so that pending events can be handled. * * Your main loop is probably already calling poll() or select() or a * variant on a set of file descriptors for other event sources (e.g. keyboard * button presses, mouse movements, network sockets, etc). You then add - * libusbx's file descriptors to your poll()/select() calls, and when activity + * libusb's file descriptors to your poll()/select() calls, and when activity * is detected on such descriptors you know it is time to call * libusb_handle_events(). * - * There is one final event handling complication. libusbx supports + * There is one final event handling complication. libusb supports * asynchronous transfers which time out after a specified time period. * * On some platforms a timerfd is used, so the timeout handling is just another - * fd, on other platforms this requires that libusbx is called into at or after - * the timeout to handle it. So, in addition to considering libusbx's file - * descriptors in your main event loop, you must also consider that libusbx + * fd, on other platforms this requires that libusb is called into at or after + * the timeout to handle it. So, in addition to considering libusb's file + * descriptors in your main event loop, you must also consider that libusb * sometimes needs to be called into at fixed points in time even when there * is no file descriptor activity, see \ref polltime details. * - * In order to know precisely when libusbx needs to be called into, libusbx + * In order to know precisely when libusb needs to be called into, libusb * offers you a set of pollable file descriptors and information about when * the next timeout expires. * @@ -620,10 +620,10 @@ void my_libusb_exit(void) * * \section pollsimple The simple option * - * If your application revolves solely around libusbx and does not need to + * If your application revolves solely around libusb and does not need to * handle other event sources, you can have a program structure as follows: \code -// initialize libusbx +// initialize libusb // find and open device // maybe fire off some initial async I/O @@ -646,15 +646,15 @@ while (user_has_not_requested_exit) * * In more advanced applications, you will already have a main loop which * is monitoring other event sources: network sockets, X11 events, mouse - * movements, etc. Through exposing a set of file descriptors, libusbx is + * movements, etc. Through exposing a set of file descriptors, libusb is * designed to cleanly integrate into such main loops. * * In addition to polling file descriptors for the other event sources, you - * take a set of file descriptors from libusbx and monitor those too. When you - * detect activity on libusbx's file descriptors, you call + * take a set of file descriptors from libusb and monitor those too. When you + * detect activity on libusb's file descriptors, you call * libusb_handle_events_timeout() in non-blocking mode. * - * What's more, libusbx may also need to handle events at specific moments in + * What's more, libusb may also need to handle events at specific moments in * time. No file descriptor activity is generated at these times, so your * own application needs to be continually aware of when the next one of these * moments occurs (through calling libusb_get_next_timeout()), and then it @@ -662,25 +662,25 @@ while (user_has_not_requested_exit) * these moments occur. This means that you need to adjust your * poll()/select() timeout accordingly. * - * libusbx provides you with a set of file descriptors to poll and expects you + * libusb provides you with a set of file descriptors to poll and expects you * to poll all of them, treating them as a single entity. The meaning of each * file descriptor in the set is an internal implementation detail, * platform-dependent and may vary from release to release. Don't try and - * interpret the meaning of the file descriptors, just do as libusbx indicates, + * interpret the meaning of the file descriptors, just do as libusb indicates, * polling all of them at once. * * In pseudo-code, you want something that looks like: \code -// initialise libusbx +// initialise libusb libusb_get_pollfds(ctx) while (user has not requested application exit) { libusb_get_next_timeout(ctx); - poll(on libusbx file descriptors plus any other event sources of interest, - using a timeout no larger than the value libusbx just suggested) - if (poll() indicated activity on libusbx file descriptors) + poll(on libusb file descriptors plus any other event sources of interest, + using a timeout no larger than the value libusb just suggested) + if (poll() indicated activity on libusb file descriptors) libusb_handle_events_timeout(ctx, &zero_tv); - if (time has elapsed to or beyond the libusbx timeout) + if (time has elapsed to or beyond the libusb timeout) libusb_handle_events_timeout(ctx, &zero_tv); // handle events from other sources here } @@ -690,7 +690,7 @@ while (user has not requested application exit) { * * \subsection polltime Notes on time-based events * - * The above complication with having to track time and call into libusbx at + * The above complication with having to track time and call into libusb at * specific moments is a bit of a headache. For maximum compatibility, you do * need to write your main loop as above, but you may decide that you can * restrict the supported platforms of your application and get away with @@ -702,18 +702,18 @@ while (user has not requested application exit) { * - Linux, provided that the following version requirements are satisfied: * - Linux v2.6.27 or newer, compiled with timerfd support * - glibc v2.9 or newer - * - libusbx v1.0.5 or newer + * - libusb v1.0.5 or newer * * Under these configurations, libusb_get_next_timeout() will \em always return * 0, so your main loop can be simplified to: \code -// initialise libusbx +// initialise libusb libusb_get_pollfds(ctx) while (user has not requested application exit) { - poll(on libusbx file descriptors plus any other event sources of interest, + poll(on libusb file descriptors plus any other event sources of interest, using any timeout that you like) - if (poll() indicated activity on libusbx file descriptors) + if (poll() indicated activity on libusb file descriptors) libusb_handle_events_timeout(ctx, &zero_tv); // handle events from other sources here } @@ -723,20 +723,20 @@ while (user has not requested application exit) { * * Do remember that if you simplify your main loop to the above, you will * lose compatibility with some platforms (including legacy Linux platforms, - * and any future platforms supported by libusbx which may have time-based + * and any future platforms supported by libusb which may have time-based * event requirements). The resultant problems will likely appear as * strange bugs in your application. * * You can use the libusb_pollfds_handle_timeouts() function to do a runtime * check to see if it is safe to ignore the time-based event complications. - * If your application has taken the shortcut of ignoring libusbx's next timeout + * If your application has taken the shortcut of ignoring libusb's next timeout * in your main loop, then you are advised to check the return value of * libusb_pollfds_handle_timeouts() during application startup, and to abort * if the platform does suffer from these timing complications. * * \subsection fdsetchange Changes in the file descriptor set * - * The set of file descriptors that libusbx uses as event sources may change + * The set of file descriptors that libusb uses as event sources may change * during the life of your application. Rather than having to repeatedly * call libusb_get_pollfds(), you can set up notification functions for when * the file descriptor set changes using libusb_set_pollfd_notifiers(). @@ -757,10 +757,10 @@ while (user has not requested application exit) { /** \page mtasync Multi-threaded applications and asynchronous I/O * - * libusbx is a thread-safe library, but extra considerations must be applied - * to applications which interact with libusbx from multiple threads. + * libusb is a thread-safe library, but extra considerations must be applied + * to applications which interact with libusb from multiple threads. * - * The underlying issue that must be addressed is that all libusbx I/O + * The underlying issue that must be addressed is that all libusb I/O * revolves around monitoring file descriptors through the poll()/select() * system calls. This is directly exposed at the * \ref asyncio "asynchronous interface" but it is important to note that the @@ -768,13 +768,13 @@ while (user has not requested application exit) { * asynchonrous interface, therefore the same considerations apply. * * The issue is that if two or more threads are concurrently calling poll() - * or select() on libusbx's file descriptors then only one of those threads + * or select() on libusb's file descriptors then only one of those threads * will be woken up when an event arrives. The others will be completely * oblivious that anything has happened. * * Consider the following pseudo-code, which submits an asynchronous transfer * then waits for its completion. This style is one way you could implement a - * synchronous interface on top of the asynchronous interface (and libusbx + * synchronous interface on top of the asynchronous interface (and libusb * does something similar, albeit more advanced due to the complications * explained on this page). * @@ -787,7 +787,7 @@ void cb(struct libusb_transfer *transfer) void myfunc() { struct libusb_transfer *transfer; - unsigned char buffer[LIBUSB_CONTROL_SETUP_SIZE]; + unsigned char buffer[LIBUSB_CONTROL_SETUP_SIZE] __attribute__ ((aligned (2))); int completed = 0; transfer = libusb_alloc_transfer(0); @@ -797,7 +797,7 @@ void myfunc() { libusb_submit_transfer(transfer); while (!completed) { - poll(libusbx file descriptors, 120*1000); + poll(libusb file descriptors, 120*1000); if (poll indicates activity) libusb_handle_events_timeout(ctx, &zero_tv); } @@ -811,7 +811,7 @@ void myfunc() { * The poll() loop has a long timeout to minimize CPU usage during situations * when nothing is happening (it could reasonably be unlimited). * - * If this is the only thread that is polling libusbx's file descriptors, there + * If this is the only thread that is polling libusb's file descriptors, there * is no problem: there is no danger that another thread will swallow up the * event that we are interested in. On the other hand, if there is another * thread polling the same descriptors, there is a chance that it will receive @@ -823,13 +823,13 @@ void myfunc() { * * The solution here is to ensure that no two threads are ever polling the * file descriptors at the same time. A naive implementation of this would - * impact the capabilities of the library, so libusbx offers the scheme + * impact the capabilities of the library, so libusb offers the scheme * documented below to ensure no loss of functionality. * * Before we go any further, it is worth mentioning that all libusb-wrapped * event handling procedures fully adhere to the scheme documented below. * This includes libusb_handle_events() and its variants, and all the - * synchronous I/O functions - libusbx hides this headache from you. + * synchronous I/O functions - libusb hides this headache from you. * * \section Using libusb_handle_events() from multiple threads * @@ -875,17 +875,17 @@ void myfunc() { * * \section eventlock The events lock * - * The problem is when we consider the fact that libusbx exposes file + * The problem is when we consider the fact that libusb exposes file * descriptors to allow for you to integrate asynchronous USB I/O into * existing main loops, effectively allowing you to do some work behind - * libusbx's back. If you do take libusbx's file descriptors and pass them to + * libusb's back. If you do take libusb's file descriptors and pass them to * poll()/select() yourself, you need to be aware of the associated issues. * * The first concept to be introduced is the events lock. The events lock * is used to serialize threads that want to handle events, such that only * one thread is handling events at any one time. * - * You must take the events lock before polling libusbx file descriptors, + * You must take the events lock before polling libusb file descriptors, * using libusb_lock_events(). You must release the lock as soon as you have * aborted your poll()/select() loop, using libusb_unlock_events(). * @@ -896,7 +896,7 @@ void myfunc() { \code libusb_lock_events(ctx); while (!completed) { - poll(libusbx file descriptors, 120*1000); + poll(libusb file descriptors, 120*1000); if (poll indicates activity) libusb_handle_events_timeout(ctx, &zero_tv); } @@ -912,7 +912,7 @@ void myfunc() { * status of its transfer until the code above has finished (30 seconds later) * due to contention on the lock. * - * To solve this, libusbx offers you a mechanism to determine when another + * To solve this, libusb offers you a mechanism to determine when another * thread is handling events. It also offers a mechanism to block your thread * until the event handling thread has completed an event (and this mechanism * does not involve polling of file descriptors). @@ -938,7 +938,7 @@ if (libusb_try_lock_events(ctx) == 0) { libusb_unlock_events(ctx); goto retry; } - poll(libusbx file descriptors, 120*1000); + poll(libusb file descriptors, 120*1000); if (poll indicates activity) libusb_handle_events_locked(ctx, 0); } @@ -984,8 +984,8 @@ printf("completed!\n"); * should be apparent from the code shown above. * -# libusb_try_lock_events() is a non-blocking function which attempts * to acquire the events lock but returns a failure code if it is contended. - * -# libusb_event_handling_ok() checks that libusbx is still happy for your - * thread to be performing event handling. Sometimes, libusbx needs to + * -# libusb_event_handling_ok() checks that libusb is still happy for your + * thread to be performing event handling. Sometimes, libusb needs to * interrupt the event handler, and this is how you can check if you have * been interrupted. If this function returns 0, the correct behaviour is * for you to give up the event handling lock, and then to repeat the cycle. @@ -995,12 +995,12 @@ printf("completed!\n"); * libusb_handle_events_timeout() that you can call while holding the * events lock. libusb_handle_events_timeout() itself implements similar * logic to the above, so be sure not to call it when you are - * "working behind libusbx's back", as is the case here. + * "working behind libusb's back", as is the case here. * -# libusb_event_handler_active() determines if someone is currently * holding the events lock * * You might be wondering why there is no function to wake up all threads - * blocked on libusb_wait_for_event(). This is because libusbx can do this + * blocked on libusb_wait_for_event(). This is because libusb can do this * internally: it will wake up all such threads when someone calls * libusb_unlock_events() or when a transfer completes (at the point after its * callback has returned). @@ -1009,7 +1009,7 @@ printf("completed!\n"); * * The above explanation should be enough to get you going, but if you're * really thinking through the issues then you may be left with some more - * questions regarding libusbx's internals. If you're curious, read on, and if + * questions regarding libusb's internals. If you're curious, read on, and if * not, skip to the next section to avoid confusing yourself! * * The immediate question that may spring to mind is: what if one thread @@ -1024,14 +1024,14 @@ printf("completed!\n"); * are all kinds of race conditions that could arise here, so it is * important that nobody is doing event handling at this time. * - * libusbx handles these issues internally, so application developers do not + * libusb handles these issues internally, so application developers do not * have to stop their event handlers while opening/closing devices. Here's how * it works, focusing on the libusb_close() situation first: * - * -# During initialization, libusbx opens an internal pipe, and it adds the read + * -# During initialization, libusb opens an internal pipe, and it adds the read * end of this pipe to the set of file descriptors to be polled. - * -# During libusb_close(), libusbx writes some dummy data on this control pipe. - * This immediately interrupts the event handler. libusbx also records + * -# During libusb_close(), libusb writes some dummy data on this control pipe. + * This immediately interrupts the event handler. libusb also records * internally that it is trying to interrupt event handlers for this * high-priority event. * -# At this point, some of the functions described above start behaving @@ -1046,7 +1046,7 @@ printf("completed!\n"); * giving up the events lock very quickly, giving the high-priority * libusb_close() operation a "free ride" to acquire the events lock. All * threads that are competing to do event handling become event waiters. - * -# With the events lock held inside libusb_close(), libusbx can safely remove + * -# With the events lock held inside libusb_close(), libusb can safely remove * a file descriptor from the poll set, in the safety of knowledge that * nobody is polling those descriptors or trying to access the poll set. * -# After obtaining the events lock, the close operation completes very @@ -1063,7 +1063,7 @@ printf("completed!\n"); * call to libusb_open(): * * -# The device is opened and a file descriptor is added to the poll set. - * -# libusbx sends some dummy data on the control pipe, and records that it + * -# libusb sends some dummy data on the control pipe, and records that it * is trying to modify the poll descriptor set. * -# The event handler is interrupted, and the same behaviour change as for * libusb_close() takes effect, causing all event handling threads to become @@ -1079,7 +1079,7 @@ printf("completed!\n"); * * The above may seem a little complicated, but hopefully I have made it clear * why such complications are necessary. Also, do not forget that this only - * applies to applications that take libusbx's file descriptors and integrate + * applies to applications that take libusb's file descriptors and integrate * them into their own polling loops. * * You may decide that it is OK for your multi-threaded application to ignore @@ -1291,7 +1291,7 @@ out: } /** \ingroup asyncio - * Allocate a libusbx transfer with a specified number of isochronous packet + * Allocate a libusb transfer with a specified number of isochronous packet * descriptors. The returned transfer is pre-initialized for you. When the new * transfer is no longer needed, it should be freed with * libusb_free_transfer(). @@ -1439,6 +1439,7 @@ int API_EXPORTED libusb_submit_transfer(struct libusb_transfer *transfer) int r; int updated_fds; + usbi_mutex_lock(&ctx->flying_transfers_lock); usbi_mutex_lock(&itransfer->lock); itransfer->transferred = 0; itransfer->flags = 0; @@ -1448,7 +1449,6 @@ int API_EXPORTED libusb_submit_transfer(struct libusb_transfer *transfer) goto out; } - usbi_mutex_lock(&ctx->flying_transfers_lock); r = add_to_flying_list(itransfer); if (r == LIBUSB_SUCCESS) { r = usbi_backend->submit_transfer(itransfer); @@ -1456,12 +1456,14 @@ int API_EXPORTED libusb_submit_transfer(struct libusb_transfer *transfer) if (r != LIBUSB_SUCCESS) { list_del(&itransfer->list); arm_timerfd_for_next_timeout(ctx); + } else { + /* keep a reference to this device */ + libusb_ref_device(transfer->dev_handle->dev); } - usbi_mutex_unlock(&ctx->flying_transfers_lock); - out: updated_fds = (itransfer->flags & USBI_TRANSFER_UPDATED_FDS); usbi_mutex_unlock(&itransfer->lock); + usbi_mutex_unlock(&ctx->flying_transfers_lock); if (updated_fds) usbi_fd_notification(ctx); return r; @@ -1508,6 +1510,43 @@ int API_EXPORTED libusb_cancel_transfer(struct libusb_transfer *transfer) return r; } +/** \ingroup asyncio + * Set a transfers bulk stream id. Note users are advised to use + * libusb_fill_bulk_stream_transfer() instead of calling this function + * directly. + * + * Since version 1.0.19, \ref LIBUSB_API_VERSION >= 0x01000103 + * + * \param transfer the transfer to set the stream id for + * \param stream_id the stream id to set + * \see libusb_alloc_streams() + */ +void API_EXPORTED libusb_transfer_set_stream_id( + struct libusb_transfer *transfer, uint32_t stream_id) +{ + struct usbi_transfer *itransfer = + LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer); + + itransfer->stream_id = stream_id; +} + +/** \ingroup asyncio + * Get a transfers bulk stream id. + * + * Since version 1.0.19, \ref LIBUSB_API_VERSION >= 0x01000103 + * + * \param transfer the transfer to get the stream id for + * \returns the stream id for the transfer + */ +uint32_t API_EXPORTED libusb_transfer_get_stream_id( + struct libusb_transfer *transfer) +{ + struct usbi_transfer *itransfer = + LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer); + + return itransfer->stream_id; +} + /* Handle completion of a transfer (completion might be an error condition). * This will invoke the user-supplied callback function, which may end up * freeing the transfer. Therefore you cannot use the transfer structure @@ -1522,6 +1561,7 @@ int usbi_handle_transfer_completion(struct usbi_transfer *itransfer, struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); struct libusb_context *ctx = TRANSFER_CTX(transfer); + struct libusb_device_handle *handle = transfer->dev_handle; uint8_t flags; int r = 0; @@ -1562,6 +1602,7 @@ int usbi_handle_transfer_completion(struct usbi_transfer *itransfer, usbi_mutex_lock(&ctx->event_waiters_lock); usbi_cond_broadcast(&ctx->event_waiters_cond); usbi_mutex_unlock(&ctx->event_waiters_lock); + libusb_unref_device(handle->dev); return 0; } @@ -1585,11 +1626,11 @@ int usbi_handle_transfer_cancellation(struct usbi_transfer *transfer) /** \ingroup poll * Attempt to acquire the event handling lock. This lock is used to ensure that - * only one thread is monitoring libusbx event sources at any one time. + * only one thread is monitoring libusb event sources at any one time. * * You only need to use this lock if you are developing an application - * which calls poll() or select() on libusbx's file descriptors directly. - * If you stick to libusbx's event handling loop functions (e.g. + * which calls poll() or select() on libusb's file descriptors directly. + * If you stick to libusb's event handling loop functions (e.g. * libusb_handle_events()) then you do not need to be concerned with this * locking. * @@ -1600,7 +1641,7 @@ int usbi_handle_transfer_cancellation(struct usbi_transfer *transfer) * \param ctx the context to operate on, or NULL for the default context * \returns 0 if the lock was obtained successfully * \returns 1 if the lock was not obtained (i.e. another thread holds the lock) - * \see \ref mtasync + * \ref mtasync */ int API_EXPORTED libusb_try_lock_events(libusb_context *ctx) { @@ -1629,11 +1670,11 @@ int API_EXPORTED libusb_try_lock_events(libusb_context *ctx) /** \ingroup poll * Acquire the event handling lock, blocking until successful acquisition if * it is contended. This lock is used to ensure that only one thread is - * monitoring libusbx event sources at any one time. + * monitoring libusb event sources at any one time. * * You only need to use this lock if you are developing an application - * which calls poll() or select() on libusbx's file descriptors directly. - * If you stick to libusbx's event handling loop functions (e.g. + * which calls poll() or select() on libusb's file descriptors directly. + * If you stick to libusb's event handling loop functions (e.g. * libusb_handle_events()) then you do not need to be concerned with this * locking. * @@ -1642,7 +1683,7 @@ int API_EXPORTED libusb_try_lock_events(libusb_context *ctx) * as soon as possible. * * \param ctx the context to operate on, or NULL for the default context - * \see \ref mtasync + * \ref mtasync */ void API_EXPORTED libusb_lock_events(libusb_context *ctx) { @@ -1657,7 +1698,7 @@ void API_EXPORTED libusb_lock_events(libusb_context *ctx) * on libusb_wait_for_event(). * * \param ctx the context to operate on, or NULL for the default context - * \see \ref mtasync + * \ref mtasync */ void API_EXPORTED libusb_unlock_events(libusb_context *ctx) { @@ -1676,7 +1717,7 @@ void API_EXPORTED libusb_unlock_events(libusb_context *ctx) /** \ingroup poll * Determine if it is still OK for this thread to be doing event handling. * - * Sometimes, libusbx needs to temporarily pause all event handlers, and this + * Sometimes, libusb needs to temporarily pause all event handlers, and this * is the function you should use before polling file descriptors to see if * this is the case. * @@ -1692,7 +1733,7 @@ void API_EXPORTED libusb_unlock_events(libusb_context *ctx) * \param ctx the context to operate on, or NULL for the default context * \returns 1 if event handling can start or continue * \returns 0 if this thread must give up the events lock - * \see \ref fullstory "Multi-threaded I/O: the full story" + * \ref fullstory "Multi-threaded I/O: the full story" */ int API_EXPORTED libusb_event_handling_ok(libusb_context *ctx) { @@ -1720,7 +1761,7 @@ int API_EXPORTED libusb_event_handling_ok(libusb_context *ctx) * \param ctx the context to operate on, or NULL for the default context * \returns 1 if a thread is handling events * \returns 0 if there are no threads currently handling events - * \see \ref mtasync + * \ref mtasync */ int API_EXPORTED libusb_event_handler_active(libusb_context *ctx) { @@ -1750,14 +1791,14 @@ int API_EXPORTED libusb_event_handler_active(libusb_context *ctx) * events, then call libusb_wait_for_event(). * * You only need to use this lock if you are developing an application - * which calls poll() or select() on libusbx's file descriptors directly, + * which calls poll() or select() on libusb's file descriptors directly, * and may potentially be handling events from 2 threads simultaenously. - * If you stick to libusbx's event handling loop functions (e.g. + * If you stick to libusb's event handling loop functions (e.g. * libusb_handle_events()) then you do not need to be concerned with this * locking. * * \param ctx the context to operate on, or NULL for the default context - * \see \ref mtasync + * \ref mtasync */ void API_EXPORTED libusb_lock_event_waiters(libusb_context *ctx) { @@ -1768,7 +1809,7 @@ void API_EXPORTED libusb_lock_event_waiters(libusb_context *ctx) /** \ingroup poll * Release the event waiters lock. * \param ctx the context to operate on, or NULL for the default context - * \see \ref mtasync + * \ref mtasync */ void API_EXPORTED libusb_unlock_event_waiters(libusb_context *ctx) { @@ -1799,7 +1840,7 @@ void API_EXPORTED libusb_unlock_event_waiters(libusb_context *ctx) * indicates unlimited timeout. * \returns 0 after a transfer completes or another thread stops event handling * \returns 1 if the timeout expired - * \see \ref mtasync + * \ref mtasync */ int API_EXPORTED libusb_wait_for_event(libusb_context *ctx, struct timeval *tv) { @@ -1926,6 +1967,7 @@ static int handle_events(struct libusb_context *ctx, struct timeval *tv) struct pollfd *fds = NULL; int i = -1; int timeout_ms; + int special_event; usbi_mutex_lock(&ctx->pollfds_lock); list_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd) @@ -1955,6 +1997,7 @@ static int handle_events(struct libusb_context *ctx, struct timeval *tv) if (tv->tv_usec % 1000) timeout_ms++; +redo_poll: usbi_dbg("poll() %d fds with timeout in %dms", nfds, timeout_ms); r = usbi_poll(fds, nfds, timeout_ms); usbi_dbg("poll() returned %d", r); @@ -1970,6 +2013,8 @@ static int handle_events(struct libusb_context *ctx, struct timeval *tv) return LIBUSB_ERROR_IO; } + special_event = 0; + /* fd[0] is always the ctrl pipe */ if (fds[0].revents) { /* another thread wanted to interrupt event handling, and it succeeded! @@ -1993,11 +2038,12 @@ static int handle_events(struct libusb_context *ctx, struct timeval *tv) ssize_t ret; usbi_dbg("caught a fish on the hotplug pipe"); + special_event = 1; /* read the message from the hotplug thread */ ret = usbi_read(ctx->hotplug_pipe[0], &message, sizeof (message)); - if (ret < sizeof(message)) { - usbi_err(ctx, "hotplug pipe read error %d < %d", + if (ret != sizeof(message)) { + usbi_err(ctx, "hotplug pipe read error %d != %u", ret, sizeof(message)); r = LIBUSB_ERROR_OTHER; goto handled; @@ -2020,6 +2066,7 @@ static int handle_events(struct libusb_context *ctx, struct timeval *tv) /* timerfd indicates that a timeout has expired */ int ret; usbi_dbg("timerfd triggered"); + special_event = 1; ret = handle_timerfd_trigger(ctx); if (ret < 0) { @@ -2044,6 +2091,11 @@ static int handle_events(struct libusb_context *ctx, struct timeval *tv) usbi_err(ctx, "backend handle_events failed with error %d", r); handled: + if (r == 0 && special_event) { + timeout_ms = 0; + goto redo_poll; + } + free(fds); return r; } @@ -2078,7 +2130,7 @@ static int get_next_timeout(libusb_context *ctx, struct timeval *tv, /** \ingroup poll * Handle any pending events. * - * libusbx determines "pending events" by checking if any timeouts have expired + * libusb determines "pending events" by checking if any timeouts have expired * and by checking the set of file descriptors for activity. * * If a zero timeval is passed, this function will handle any already-pending @@ -2099,7 +2151,7 @@ static int get_next_timeout(libusb_context *ctx, struct timeval *tv, * timeval struct for non-blocking mode * \param completed pointer to completion integer to check, or NULL * \returns 0 on success, or a LIBUSB_ERROR code on failure - * \see \ref mtasync + * \ref mtasync */ int API_EXPORTED libusb_handle_events_timeout_completed(libusb_context *ctx, struct timeval *tv, int *completed) @@ -2210,7 +2262,7 @@ int API_EXPORTED libusb_handle_events(libusb_context *ctx) * \param ctx the context to operate on, or NULL for the default context * \param completed pointer to completion integer to check, or NULL * \returns 0 on success, or a LIBUSB_ERROR code on failure - * \see \ref mtasync + * \ref mtasync */ int API_EXPORTED libusb_handle_events_completed(libusb_context *ctx, int *completed) @@ -2227,16 +2279,16 @@ int API_EXPORTED libusb_handle_events_completed(libusb_context *ctx, * held, see libusb_lock_events(). * * This function is designed to be called under the situation where you have - * taken the event lock and are calling poll()/select() directly on libusbx's + * taken the event lock and are calling poll()/select() directly on libusb's * file descriptors (as opposed to using libusb_handle_events() or similar). - * You detect events on libusbx's descriptors, so you then call this function + * You detect events on libusb's descriptors, so you then call this function * with a zero timeout value (while still holding the event lock). * * \param ctx the context to operate on, or NULL for the default context * \param tv the maximum time to block waiting for events, or zero for * non-blocking mode * \returns 0 on success, or a LIBUSB_ERROR code on failure - * \see \ref mtasync + * \ref mtasync */ int API_EXPORTED libusb_handle_events_locked(libusb_context *ctx, struct timeval *tv) @@ -2256,19 +2308,19 @@ int API_EXPORTED libusb_handle_events_locked(libusb_context *ctx, /** \ingroup poll * Determines whether your application must apply special timing considerations - * when monitoring libusbx's file descriptors. + * when monitoring libusb's file descriptors. * * This function is only useful for applications which retrieve and poll - * libusbx's file descriptors in their own main loop (\ref pollmain). + * libusb's file descriptors in their own main loop (\ref pollmain). * - * Ordinarily, libusbx's event handler needs to be called into at specific + * Ordinarily, libusb's event handler needs to be called into at specific * moments in time (in addition to times when there is activity on the file * descriptor set). The usual approach is to use libusb_get_next_timeout() * to learn about when the next timeout occurs, and to adjust your * poll()/select() timeout accordingly so that you can make a call into the * library at that time. * - * Some platforms supported by libusbx do not come with this baggage - any + * Some platforms supported by libusb do not come with this baggage - any * events relevant to timing will be represented by activity on the file * descriptor set, and libusb_get_next_timeout() will always return 0. * This function allows you to detect whether you are running on such a @@ -2277,10 +2329,10 @@ int API_EXPORTED libusb_handle_events_locked(libusb_context *ctx, * Since v1.0.5. * * \param ctx the context to operate on, or NULL for the default context - * \returns 0 if you must call into libusbx at times determined by + * \returns 0 if you must call into libusb at times determined by * libusb_get_next_timeout(), or 1 if all timeout events are handled internally * or through regular activity on the file descriptors. - * \see \ref pollmain "Polling libusbx file descriptors for event handling" + * \ref pollmain "Polling libusb file descriptors for event handling" */ int API_EXPORTED libusb_pollfds_handle_timeouts(libusb_context *ctx) { @@ -2294,21 +2346,21 @@ int API_EXPORTED libusb_pollfds_handle_timeouts(libusb_context *ctx) } /** \ingroup poll - * Determine the next internal timeout that libusbx needs to handle. You only + * Determine the next internal timeout that libusb needs to handle. You only * need to use this function if you are calling poll() or select() or similar - * on libusbx's file descriptors yourself - you do not need to use it if you + * on libusb's file descriptors yourself - you do not need to use it if you * are calling libusb_handle_events() or a variant directly. * * You should call this function in your main loop in order to determine how - * long to wait for select() or poll() to return results. libusbx needs to be + * long to wait for select() or poll() to return results. libusb needs to be * called into at this timeout, so you should use it as an upper bound on * your select() or poll() call. * * When the timeout has expired, call into libusb_handle_events_timeout() - * (perhaps in non-blocking mode) so that libusbx can handle the timeout. + * (perhaps in non-blocking mode) so that libusb can handle the timeout. * * This function may return 1 (success) and an all-zero timeval. If this is - * the case, it indicates that libusbx has a timeout that has already expired + * the case, it indicates that libusb has a timeout that has already expired * so you should call libusb_handle_events_timeout() or similar immediately. * A return code of 0 indicates that there are no pending timeouts. * @@ -2317,7 +2369,7 @@ int API_EXPORTED libusb_pollfds_handle_timeouts(libusb_context *ctx) * * \param ctx the context to operate on, or NULL for the default context * \param tv output location for a relative time against the current - * clock in which libusbx must be called into in order to process timeout events + * clock in which libusb must be called into in order to process timeout events * \returns 0 if there are no pending timeouts, 1 if a timeout was returned, * or LIBUSB_ERROR_OTHER on failure */ @@ -2384,7 +2436,7 @@ int API_EXPORTED libusb_get_next_timeout(libusb_context *ctx, /** \ingroup poll * Register notification functions for file descriptor additions/removals. * These functions will be invoked for every new or removed file descriptor - * that libusbx uses as an event source. + * that libusb uses as an event source. * * To remove notifiers, pass NULL values for the function pointers. * @@ -2462,7 +2514,7 @@ void usbi_remove_pollfd(struct libusb_context *ctx, int fd) /** \ingroup poll * Retrieve a list of file descriptors that should be polled by your main loop - * as libusbx event sources. + * as libusb event sources. * * The returned list is NULL-terminated and should be freed with free() when * done. The actual list contents must not be touched. @@ -2502,7 +2554,7 @@ out: usbi_mutex_unlock(&ctx->pollfds_lock); return (const struct libusb_pollfd **) ret; #else - usbi_err(ctx, "external polling of libusbx's internal descriptors "\ + usbi_err(ctx, "external polling of libusb's internal descriptors "\ "is not yet supported on Windows platforms"); return NULL; #endif diff --git a/Externals/libusbx/libusb/libusb-1.0.def b/Externals/libusb/libusb/libusb-1.0.def similarity index 95% rename from Externals/libusbx/libusb/libusb-1.0.def rename to Externals/libusb/libusb/libusb-1.0.def index cb0e32ab93..d45cfc55a2 100644 --- a/Externals/libusbx/libusb/libusb-1.0.def +++ b/Externals/libusb/libusb/libusb-1.0.def @@ -1,5 +1,7 @@ LIBRARY "libusb-1.0.dll" EXPORTS + libusb_alloc_streams + libusb_alloc_streams@16 = libusb_alloc_streams libusb_alloc_transfer libusb_alloc_transfer@4 = libusb_alloc_transfer libusb_attach_kernel_driver @@ -38,6 +40,8 @@ EXPORTS libusb_free_ss_endpoint_companion_descriptor@4 = libusb_free_ss_endpoint_companion_descriptor libusb_free_ss_usb_device_capability_descriptor libusb_free_ss_usb_device_capability_descriptor@4 = libusb_free_ss_usb_device_capability_descriptor + libusb_free_streams + libusb_free_streams@12 = libusb_free_streams libusb_free_transfer libusb_free_transfer@4 = libusb_free_transfer libusb_free_usb_2_0_extension_descriptor @@ -146,6 +150,10 @@ EXPORTS libusb_strerror@4 = libusb_strerror libusb_submit_transfer libusb_submit_transfer@4 = libusb_submit_transfer + libusb_transfer_get_stream_id + libusb_transfer_get_stream_id@4 = libusb_transfer_get_stream_id + libusb_transfer_set_stream_id + libusb_transfer_set_stream_id@8 = libusb_transfer_set_stream_id libusb_try_lock_events libusb_try_lock_events@4 = libusb_try_lock_events libusb_unlock_event_waiters diff --git a/Externals/libusbx/libusb/libusb-1.0.rc b/Externals/libusb/libusb/libusb-1.0.rc similarity index 97% rename from Externals/libusbx/libusb/libusb-1.0.rc rename to Externals/libusb/libusb/libusb-1.0.rc index ae49757cc1..3dce6d5a91 100644 --- a/Externals/libusbx/libusb/libusb-1.0.rc +++ b/Externals/libusb/libusb/libusb-1.0.rc @@ -41,7 +41,7 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "CompanyName", "libusbx.org\0" + VALUE "CompanyName", "libusb.info\0" VALUE "FileDescription", "C library for writing portable USB drivers in userspace\0" VALUE "FileVersion", LIBUSB_VERSIONSTRING VALUE "InternalName", "libusb\0" diff --git a/Externals/libusbx/libusb/libusb.h b/Externals/libusb/libusb/libusb.h similarity index 92% rename from Externals/libusbx/libusb/libusb.h rename to Externals/libusb/libusb/libusb.h index e8e120162f..a19ab3488e 100644 --- a/Externals/libusbx/libusb/libusb.h +++ b/Externals/libusb/libusb/libusb.h @@ -1,10 +1,10 @@ /* - * Public libusbx header file + * Public libusb header file * Copyright © 2001 Johannes Erdfelt * Copyright © 2007-2008 Daniel Drake * Copyright © 2012 Pete Batard * Copyright © 2012 Nathan Hjelm - * For more information, please visit: http://libusbx.org + * For more information, please visit: http://libusb.info * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -62,7 +62,7 @@ typedef unsigned __int32 uint32_t; #include /* 'interface' might be defined as a macro on Windows, so we need to - * undefine it so as not to break the current libusbx API, because + * undefine it so as not to break the current libusb API, because * libusb_config_descriptor has an 'interface' member * As this can be problematic if you include windows.h after libusb.h * in your sources, we force windows.h to be included first. */ @@ -85,14 +85,14 @@ typedef unsigned __int32 uint32_t; /** \def LIBUSB_CALL * \ingroup misc - * libusbx's Windows calling convention. + * libusb's Windows calling convention. * * Under Windows, the selection of available compilers and configurations * means that, unlike other platforms, there is not one true calling * convention (calling convention: the manner in which parameters are * passed to funcions in the generated assembly code). * - * Matching the Windows API itself, libusbx uses the WINAPI convention (which + * Matching the Windows API itself, libusb uses the WINAPI convention (which * translates to the stdcall convention) and guarantees that the * library is compiled in this way. The public header file also includes * appropriate annotations so that your own software will use the right @@ -100,7 +100,7 @@ typedef unsigned __int32 uint32_t; * your codebase. * * The one consideration that you must apply in your software is to mark - * all functions which you use as libusbx callbacks with this LIBUSB_CALL + * all functions which you use as libusb callbacks with this LIBUSB_CALL * annotation, so that they too get compiled for the correct calling * convention. * @@ -108,7 +108,7 @@ typedef unsigned __int32 uint32_t; * means that you can apply it to your code without worrying about * cross-platform compatibility. */ -/* LIBUSB_CALL must be defined on both definition and declaration of libusbx +/* LIBUSB_CALL must be defined on both definition and declaration of libusb * functions. You'd think that declaration would be enough, but cygwin will * complain about conflicting types unless both are marked this way. * The placement of this macro is important too; it must appear after the @@ -121,36 +121,39 @@ typedef unsigned __int32 uint32_t; #define LIBUSB_CALL #endif -/** \def LIBUSBX_API_VERSION +/** \def LIBUSB_API_VERSION * \ingroup misc - * libusbx's API version. + * libusb's API version. * - * Since version 1.0.13, to help with feature detection, libusbx defines - * a LIBUSBX_API_VERSION macro that gets increased every time there is a + * Since version 1.0.13, to help with feature detection, libusb defines + * a LIBUSB_API_VERSION macro that gets increased every time there is a * significant change to the API, such as the introduction of a new call, * the definition of a new macro/enum member, or any other element that - * libusbx applications may want to detect at compilation time. + * libusb applications may want to detect at compilation time. * * The macro is typically used in an application as follows: * \code - * #if defined(LIBUSBX_API_VERSION) && (LIBUSBX_API_VERSION >= 0x01001234) - * // Use one of the newer features from the libusbx API + * #if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01001234) + * // Use one of the newer features from the libusb API * #endif * \endcode * - * Another feature of LIBUSBX_API_VERSION is that it can be used to detect - * whether you are compiling against the libusb or the libusbx library. + * Another feature of LIBUSB_API_VERSION is that it can be used to detect + * whether you are compiling against the libusb or the libusb library. * - * Internally, LIBUSBX_API_VERSION is defined as follows: - * (libusbx major << 24) | (libusbx minor << 16) | (16 bit incremental) + * Internally, LIBUSB_API_VERSION is defined as follows: + * (libusb major << 24) | (libusb minor << 16) | (16 bit incremental) */ -#define LIBUSBX_API_VERSION 0x01000102 +#define LIBUSB_API_VERSION 0x01000103 + +/* The following is kept for compatibility, but will be deprecated in the future */ +#define LIBUSBX_API_VERSION LIBUSB_API_VERSION #ifdef __cplusplus extern "C" { #endif -/** \def libusb_cpu_to_le16 +/** * \ingroup misc * Convert a 16-bit value from host-endian to little-endian format. On * little endian systems, this function does nothing. On big endian systems, @@ -340,7 +343,10 @@ enum libusb_transfer_type { LIBUSB_TRANSFER_TYPE_BULK = 2, /** Interrupt endpoint */ - LIBUSB_TRANSFER_TYPE_INTERRUPT = 3 + LIBUSB_TRANSFER_TYPE_INTERRUPT = 3, + + /** Stream endpoint */ + LIBUSB_TRANSFER_TYPE_BULK_STREAM = 4, }; /** \ingroup misc @@ -562,7 +568,7 @@ struct libusb_endpoint_descriptor { /** For audio devices only: the address if the synch endpoint */ uint8_t bSynchAddress; - /** Extra descriptors. If libusbx encounters unknown endpoint descriptors, + /** Extra descriptors. If libusb encounters unknown endpoint descriptors, * it will store them here, should you wish to parse them. */ const unsigned char *extra; @@ -612,7 +618,7 @@ struct libusb_interface_descriptor { * by the bNumEndpoints field. */ const struct libusb_endpoint_descriptor *endpoint; - /** Extra descriptors. If libusbx encounters unknown interface descriptors, + /** Extra descriptors. If libusb encounters unknown interface descriptors, * it will store them here, should you wish to parse them. */ const unsigned char *extra; @@ -670,7 +676,7 @@ struct libusb_config_descriptor { * this array is determined by the bNumInterfaces field. */ const struct libusb_interface *interface; - /** Extra descriptors. If libusbx encounters unknown configuration + /** Extra descriptors. If libusb encounters unknown configuration * descriptors, it will store them here, should you wish to parse them. */ const unsigned char *extra; @@ -889,7 +895,7 @@ struct libusb_control_setup { #define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup)) -/* libusbx */ +/* libusb */ struct libusb_context; struct libusb_device; @@ -897,7 +903,7 @@ struct libusb_device_handle; struct libusb_hotplug_callback; /** \ingroup lib - * Structure providing the version of the libusbx runtime + * Structure providing the version of the libusb runtime */ struct libusb_version { /** Library major version. */ @@ -920,16 +926,16 @@ struct libusb_version { }; /** \ingroup lib - * Structure representing a libusbx session. The concept of individual libusbx + * Structure representing a libusb session. The concept of individual libusb * sessions allows for your program to use two libraries (or dynamically * load two modules) which both independently use libusb. This will prevent - * interference between the individual libusbx users - for example + * interference between the individual libusb users - for example * libusb_set_debug() will not affect the other user of the library, and * libusb_exit() will not destroy resources that the other user is still * using. * * Sessions are created by libusb_init() and destroyed through libusb_exit(). - * If your application is guaranteed to only ever include a single libusbx + * If your application is guaranteed to only ever include a single libusb * user (i.e. you), you do not have to worry about contexts: pass NULL in * every function call where a context is required. The default context * will be used. @@ -1042,7 +1048,7 @@ enum libusb_bos_type { }; /** \ingroup misc - * Error codes. Most libusbx functions return 0 on success or one of these + * Error codes. Most libusb functions return 0 on success or one of these * codes on failure. * You can call libusb_error_name() to retrieve a string representation of an * error code or libusb_strerror() to get an end-user suitable description of @@ -1188,7 +1194,7 @@ struct libusb_transfer; * Asynchronous transfer callback function type. When submitting asynchronous * transfers, you pass a pointer to a callback function of this type via the * \ref libusb_transfer::callback "callback" member of the libusb_transfer - * structure. libusbx will call this function later, when the transfer has + * structure. libusb will call this function later, when the transfer has * completed or failed. See \ref asyncio for more information. * \param transfer The libusb_transfer struct the callback function is being * notified about. @@ -1271,7 +1277,7 @@ enum libusb_capability { LIBUSB_CAP_HAS_HOTPLUG = 0x0001, /** The library can access HID devices without requiring user intervention. * Note that before being able to actually access an HID device, you may - * still have to call additional libusbx functions such as + * still have to call additional libusb functions such as * \ref libusb_detach_kernel_driver(). */ LIBUSB_CAP_HAS_HID_ACCESS = 0x0100, /** The library supports detaching of the default USB driver, using @@ -1384,6 +1390,11 @@ int LIBUSB_CALL libusb_clear_halt(libusb_device_handle *dev, unsigned char endpoint); int LIBUSB_CALL libusb_reset_device(libusb_device_handle *dev); +int LIBUSB_CALL libusb_alloc_streams(libusb_device_handle *dev, + uint32_t num_streams, unsigned char *endpoints, int num_endpoints); +int LIBUSB_CALL libusb_free_streams(libusb_device_handle *dev, + unsigned char *endpoints, int num_endpoints); + int LIBUSB_CALL libusb_kernel_driver_active(libusb_device_handle *dev, int interface_number); int LIBUSB_CALL libusb_detach_kernel_driver(libusb_device_handle *dev, @@ -1428,7 +1439,7 @@ static inline unsigned char *libusb_control_transfer_get_data( static inline struct libusb_control_setup *libusb_control_transfer_get_setup( struct libusb_transfer *transfer) { - return (struct libusb_control_setup *) transfer->buffer; + return (struct libusb_control_setup *)(void *) transfer->buffer; } /** \ingroup asyncio @@ -1437,6 +1448,7 @@ static inline struct libusb_control_setup *libusb_control_transfer_get_setup( * be given in host-endian byte order. * * \param buffer buffer to output the setup packet into + * This pointer must be aligned to at least 2 bytes boundary. * \param bmRequestType see the * \ref libusb_control_setup::bmRequestType "bmRequestType" field of * \ref libusb_control_setup @@ -1457,7 +1469,7 @@ static inline void libusb_fill_control_setup(unsigned char *buffer, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength) { - struct libusb_control_setup *setup = (struct libusb_control_setup *) buffer; + struct libusb_control_setup *setup = (struct libusb_control_setup *)(void *) buffer; setup->bmRequestType = bmRequestType; setup->bRequest = bRequest; setup->wValue = libusb_cpu_to_le16(wValue); @@ -1469,6 +1481,10 @@ struct libusb_transfer * LIBUSB_CALL libusb_alloc_transfer(int iso_packets); int LIBUSB_CALL libusb_submit_transfer(struct libusb_transfer *transfer); int LIBUSB_CALL libusb_cancel_transfer(struct libusb_transfer *transfer); void LIBUSB_CALL libusb_free_transfer(struct libusb_transfer *transfer); +void LIBUSB_CALL libusb_transfer_set_stream_id( + struct libusb_transfer *transfer, uint32_t stream_id); +uint32_t LIBUSB_CALL libusb_transfer_get_stream_id( + struct libusb_transfer *transfer); /** \ingroup asyncio * Helper function to populate the required \ref libusb_transfer fields @@ -1493,6 +1509,7 @@ void LIBUSB_CALL libusb_free_transfer(struct libusb_transfer *transfer); * \param dev_handle handle of the device that will handle the transfer * \param buffer data buffer. If provided, this function will interpret the * first 8 bytes as a setup packet and infer the transfer length from that. + * This pointer must be aligned to at least 2 bytes boundary. * \param callback callback function to be invoked on transfer completion * \param user_data user data to pass to callback function * \param timeout timeout for the transfer in milliseconds @@ -1502,7 +1519,7 @@ static inline void libusb_fill_control_transfer( unsigned char *buffer, libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout) { - struct libusb_control_setup *setup = (struct libusb_control_setup *) buffer; + struct libusb_control_setup *setup = (struct libusb_control_setup *)(void *) buffer; transfer->dev_handle = dev_handle; transfer->endpoint = 0; transfer->type = LIBUSB_TRANSFER_TYPE_CONTROL; @@ -1543,6 +1560,34 @@ static inline void libusb_fill_bulk_transfer(struct libusb_transfer *transfer, transfer->callback = callback; } +/** \ingroup asyncio + * Helper function to populate the required \ref libusb_transfer fields + * for a bulk transfer using bulk streams. + * + * Since version 1.0.19, \ref LIBUSB_API_VERSION >= 0x01000103 + * + * \param transfer the transfer to populate + * \param dev_handle handle of the device that will handle the transfer + * \param endpoint address of the endpoint where this transfer will be sent + * \param stream_id bulk stream id for this transfer + * \param buffer data buffer + * \param length length of data buffer + * \param callback callback function to be invoked on transfer completion + * \param user_data user data to pass to callback function + * \param timeout timeout for the transfer in milliseconds + */ +static inline void libusb_fill_bulk_stream_transfer( + struct libusb_transfer *transfer, libusb_device_handle *dev_handle, + unsigned char endpoint, uint32_t stream_id, + unsigned char *buffer, int length, libusb_transfer_cb_fn callback, + void *user_data, unsigned int timeout) +{ + libusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer, + length, callback, user_data, timeout); + transfer->type = LIBUSB_TRANSFER_TYPE_BULK_STREAM; + libusb_transfer_set_stream_id(transfer, stream_id); +} + /** \ingroup asyncio * Helper function to populate the required \ref libusb_transfer fields * for an interrupt transfer. @@ -1827,7 +1872,7 @@ void LIBUSB_CALL libusb_set_pollfd_notifiers(libusb_context *ctx, * per libusb_context and it is safe to call libusb_hotplug_deregister_callback() * on an already deregisted callback. * - * Since version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102 + * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 * * For more information, see \ref hotplug. */ @@ -1835,7 +1880,7 @@ typedef int libusb_hotplug_callback_handle; /** \ingroup hotplug * - * Since version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102 + * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 * * Flags for hotplug events */ typedef enum { @@ -1845,7 +1890,7 @@ typedef enum { /** \ingroup hotplug * - * Since version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102 + * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 * * Hotplug events */ typedef enum { @@ -1869,15 +1914,15 @@ typedef enum { * This callback may be called by an internal event thread and as such it is * recommended the callback do minimal processing before returning. * - * libusbx will call this function later, when a matching event had happened on + * libusb will call this function later, when a matching event had happened on * a matching device. See \ref hotplug for more information. * * It is safe to call either libusb_hotplug_register_callback() or * libusb_hotplug_deregister_callback() from within a callback function. * - * Since version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102 + * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 * - * \param libusb_context context of this notification + * \param ctx context of this notification * \param device libusb_device this event occurred on * \param event event that occurred * \param user_data user data provided when this callback was registered @@ -1897,7 +1942,19 @@ typedef int (LIBUSB_CALL *libusb_hotplug_callback_fn)(libusb_context *ctx, * armed until either it is deregistered with libusb_hotplug_deregister_callback() * or the supplied callback returns 1 to indicate it is finished processing events. * - * Since version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102 + * If the \ref LIBUSB_HOTPLUG_ENUMERATE is passed the callback will be + * called with a \ref LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED for all devices + * already plugged into the machine. Note that libusb modifies its internal + * device list from a separate thread, while calling hotplug callbacks from + * libusb_handle_events(), so it is possible for a device to already be present + * on, or removed from, its internal device list, while the hotplug callbacks + * still need to be dispatched. This means that when using \ref + * LIBUSB_HOTPLUG_ENUMERATE, your callback may be called twice for the arrival + * of the same device, once from libusb_hotplug_register_callback() and once + * from libusb_handle_events(); and/or your callback may be called for the + * removal of a device for which an arrived call was never made. + * + * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 * * \param[in] ctx context to register this callback with * \param[in] events bitwise or of events that will trigger this callback. See \ref @@ -1926,7 +1983,7 @@ int LIBUSB_CALL libusb_hotplug_register_callback(libusb_context *ctx, * Deregister a callback from a libusb_context. This function is safe to call from within * a hotplug callback. * - * Since version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102 + * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 * * \param[in] ctx context this callback is registered with * \param[in] handle the handle of the callback to deregister diff --git a/Externals/libusbx/libusb/libusbi.h b/Externals/libusb/libusb/libusbi.h similarity index 95% rename from Externals/libusbx/libusb/libusbi.h rename to Externals/libusb/libusb/libusbi.h index 02efae300d..a36482c933 100644 --- a/Externals/libusbx/libusb/libusbi.h +++ b/Externals/libusb/libusb/libusbi.h @@ -1,5 +1,5 @@ /* - * Internal header for libusbx + * Internal header for libusb * Copyright © 2007-2009 Daniel Drake * Copyright © 2001 Johannes Erdfelt * @@ -23,6 +23,8 @@ #include "config.h" +#include + #include #include #include @@ -37,11 +39,11 @@ #include "libusb.h" #include "version.h" -/* Inside the libusbx code, mark all public functions as follows: +/* Inside the libusb code, mark all public functions as follows: * return_type API_EXPORTED function_name(params) { ... } * But if the function returns a pointer, mark it as follows: * DEFAULT_VISIBILITY return_type * LIBUSB_CALL function_name(params) { ... } - * In the libusbx public header, mark all declarations as: + * In the libusb public header, mark all declarations as: * return_type LIBUSB_CALL function_name(params); */ #define API_EXPORTED LIBUSB_CALL DEFAULT_VISIBILITY @@ -147,6 +149,15 @@ static inline void *usbi_reallocf(void *ptr, size_t size) #define TIMESPEC_IS_SET(ts) ((ts)->tv_sec != 0 || (ts)->tv_nsec != 0) +/* Some platforms don't have this define */ +#ifndef TIMESPEC_TO_TIMEVAL +#define TIMESPEC_TO_TIMEVAL(tv, ts) \ + do { \ + (tv)->tv_sec = (ts)->tv_sec; \ + (tv)->tv_usec = (ts)->tv_nsec / 1000; \ + } while (0) +#endif + void usbi_log(struct libusb_context *ctx, enum libusb_log_level level, const char *function, const char *format, ...); @@ -355,6 +366,7 @@ struct usbi_transfer { struct list_head list; struct timeval timeout; int transferred; + uint32_t stream_id; uint8_t flags; /* this lock is held during libusb_submit_transfer() and @@ -433,7 +445,7 @@ void usbi_connect_device (struct libusb_device *dev); void usbi_disconnect_device (struct libusb_device *dev); /* Internal abstraction for poll (needs struct usbi_transfer on Windows) */ -#if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_OPENBSD) +#if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_OPENBSD) || defined(OS_NETBSD) #include #include "os/poll_posix.h" #elif defined(OS_WINDOWS) || defined(OS_WINCE) @@ -501,7 +513,7 @@ struct usbi_os_backend { * to determine specific capabilities of the system, allocate required * data structures for later, etc. * - * This function is called when a libusbx user initializes the library + * This function is called when a libusb user initializes the library * prior to use. * * Return 0 on success, or a LIBUSB_ERROR code on failure. @@ -531,9 +543,9 @@ struct usbi_os_backend { * but that is an unlikely case. * * After computing a session ID for a device, call - * usbi_get_device_by_session_id(). This function checks if libusbx already - * knows about the device, and if so, it provides you with a libusb_device - * structure for it. + * usbi_get_device_by_session_id(). This function checks if libusb already + * knows about the device, and if so, it provides you with a reference + * to a libusb_device structure for it. * * If usbi_get_device_by_session_id() returns NULL, it is time to allocate * a new device structure for the device. Call usbi_alloc_device() to @@ -592,7 +604,7 @@ struct usbi_os_backend { * * Your backend should allocate any internal resources required for I/O * and other operations so that those operations can happen (hopefully) - * without hiccup. This is also a good place to inform libusbx that it + * without hiccup. This is also a good place to inform libusb that it * should monitor certain file descriptors related to this device - * see the usbi_add_pollfd() function. * @@ -616,7 +628,7 @@ struct usbi_os_backend { /* Close a device such that the handle cannot be used again. Your backend * should destroy any resources that were allocated in the open path. * This may also be a good place to call usbi_remove_pollfd() to inform - * libusbx of any file descriptors associated with this device that should + * libusb of any file descriptors associated with this device that should * no longer be monitored. * * This function is called when the user closes a device handle. @@ -689,7 +701,7 @@ struct usbi_os_backend { * (LE). If it returns the multi-byte values in host-endian format, * set the host_endian output parameter to "1". * - * Return 0 on success or a LIBUSB_ERROR code on failure. + * Return the length read on success or a LIBUSB_ERROR code on failure. */ int (*get_config_descriptor)(struct libusb_device *device, uint8_t config_index, unsigned char *buffer, size_t len, @@ -717,7 +729,7 @@ struct usbi_os_backend { * * If you cannot retrieve this from cache, either do not implement this * function, or return LIBUSB_ERROR_NOT_SUPPORTED. This will cause - * libusbx to retrieve the information through a standard control transfer. + * libusb to retrieve the information through a standard control transfer. * * This function must be non-blocking. * Return: @@ -832,6 +844,14 @@ struct usbi_os_backend { */ int (*reset_device)(struct libusb_device_handle *handle); + /* Alloc num_streams usb3 bulk streams on the passed in endpoints */ + int (*alloc_streams)(struct libusb_device_handle *handle, + uint32_t num_streams, unsigned char *endpoints, int num_endpoints); + + /* Free usb3 bulk streams allocated with alloc_streams */ + int (*free_streams)(struct libusb_device_handle *handle, + unsigned char *endpoints, int num_endpoints); + /* Determine if a kernel driver is active on an interface. Optional. * * The presence of a kernel driver on an interface indicates that any @@ -916,7 +936,7 @@ struct usbi_os_backend { * all private data from the transfer as if you were just about to report * completion or cancellation. * - * This function might seem a bit out of place. It is used when libusbx + * This function might seem a bit out of place. It is used when libusb * detects a disconnected device - it calls this function for all pending * transfers before reporting completion (with the disconnect code) to * the user. Maybe we can improve upon this internal interface in future. @@ -995,6 +1015,7 @@ extern const struct usbi_os_backend * const usbi_backend; extern const struct usbi_os_backend linux_usbfs_backend; extern const struct usbi_os_backend darwin_backend; extern const struct usbi_os_backend openbsd_backend; +extern const struct usbi_os_backend netbsd_backend; extern const struct usbi_os_backend windows_backend; extern const struct usbi_os_backend wince_backend; diff --git a/Externals/libusbx/libusb/os/darwin_usb.c b/Externals/libusb/libusb/os/darwin_usb.c similarity index 89% rename from Externals/libusbx/libusb/os/darwin_usb.c rename to Externals/libusb/libusb/os/darwin_usb.c index a24558cb59..19174b131c 100644 --- a/Externals/libusbx/libusb/os/darwin_usb.c +++ b/Externals/libusb/libusb/os/darwin_usb.c @@ -1,7 +1,7 @@ /* -*- Mode: C; indent-tabs-mode:nil -*- */ /* - * darwin backend for libusbx 1.0 - * Copyright © 2008-2013 Nathan Hjelm + * darwin backend for libusb 1.0 + * Copyright © 2008-2014 Nathan Hjelm * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -71,6 +71,7 @@ static int process_new_device (struct libusb_context *ctx, io_service_t service) #if defined(ENABLE_LOGGING) static const char *darwin_error_str (int result) { + static char string_buffer[50]; switch (result) { case kIOReturnSuccess: return "no error"; @@ -103,7 +104,8 @@ static const char *darwin_error_str (int result) { case kIOUSBHighSpeedSplitError: return "high speed split error"; default: - return "unknown error"; + snprintf(string_buffer, sizeof(string_buffer), "unknown error (0x%x)", result); + return string_buffer; } } #endif @@ -149,7 +151,7 @@ static void darwin_ref_cached_device(struct darwin_cached_device *cached_dev) { cached_dev->refcount++; } -static int ep_to_pipeRef(struct libusb_device_handle *dev_handle, uint8_t ep, uint8_t *pipep, uint8_t *ifcp) { +static int ep_to_pipeRef(struct libusb_device_handle *dev_handle, uint8_t ep, uint8_t *pipep, uint8_t *ifcp, struct darwin_interface **interface_out) { struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv; /* current interface */ @@ -166,8 +168,14 @@ static int ep_to_pipeRef(struct libusb_device_handle *dev_handle, uint8_t ep, ui for (i = 0 ; i < cInterface->num_endpoints ; i++) { if (cInterface->endpoint_addrs[i] == ep) { *pipep = i + 1; - *ifcp = iface; - usbi_dbg ("pipe %d on interface %d matches", *pipep, *ifcp); + + if (ifcp) + *ifcp = iface; + + if (interface_out) + *interface_out = cInterface; + + usbi_dbg ("pipe %d on interface %d matches", *pipep, iface); return 0; } } @@ -177,7 +185,7 @@ static int ep_to_pipeRef(struct libusb_device_handle *dev_handle, uint8_t ep, ui /* No pipe found with the correct endpoint address */ usbi_warn (HANDLE_CTX(dev_handle), "no pipeRef found with endpoint address 0x%02x.", ep); - return -1; + return LIBUSB_ERROR_NOT_FOUND; } static int usb_setup_device_iterator (io_iterator_t *deviceIterator, UInt32 location) { @@ -210,6 +218,7 @@ static int usb_setup_device_iterator (io_iterator_t *deviceIterator, UInt32 loca return IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDict, deviceIterator); } +/* Returns 1 on success, 0 on failure. */ static int get_ioregistry_value_number (io_service_t service, CFStringRef property, CFNumberType type, void *p) { CFTypeRef cfNumber = IORegistryEntryCreateCFProperty (service, property, kCFAllocatorDefault, 0); int ret = 0; @@ -275,6 +284,8 @@ static void darwin_devices_detached (void *ptr, io_iterator_t rem_devices) { UInt64 session; int ret; + usbi_mutex_lock(&active_contexts_lock); + while ((device = IOIteratorNext (rem_devices)) != 0) { /* get the location from the i/o registry */ ret = get_ioregistry_value_number (device, CFSTR("sessionID"), kCFNumberSInt64Type, &session); @@ -282,21 +293,31 @@ static void darwin_devices_detached (void *ptr, io_iterator_t rem_devices) { if (!ret) continue; - usbi_mutex_lock(&active_contexts_lock); - list_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context) { usbi_dbg ("notifying context %p of device disconnect", ctx); - dev = usbi_get_device_by_session_id(ctx, session); + dev = usbi_get_device_by_session_id(ctx, (unsigned long) session); if (dev) { /* signal the core that this device has been disconnected. the core will tear down this device when the reference count reaches 0 */ usbi_disconnect_device(dev); + libusb_unref_device(dev); } } - - usbi_mutex_unlock(&active_contexts_lock); } + + usbi_mutex_unlock(&active_contexts_lock); +} + +static void darwin_hotplug_poll (void) +{ + /* not sure if 5 seconds will be too long/short but it should work ok */ + mach_timespec_t timeout = {.tv_sec = 5, .tv_nsec = 0}; + + /* since a kernel thread may nodify the IOInterators used for + * hotplug notidication we can't just clear the iterators. + * instead just wait until all IOService providers are quiet */ + (void) IOKitWaitQuiet (kIOMasterPortDefault, &timeout); } static void darwin_clear_iterator (io_iterator_t iter) { @@ -342,8 +363,8 @@ static void *darwin_event_thread_main (void *arg0) { /* create notifications for removed devices */ kresult = IOServiceAddMatchingNotification (libusb_notification_port, kIOTerminatedNotification, IOServiceMatching(kIOUSBDeviceClassName), - (IOServiceMatchingCallback)darwin_devices_detached, - (void *)ctx, &libusb_rem_device_iterator); + darwin_devices_detached, + ctx, &libusb_rem_device_iterator); if (kresult != kIOReturnSuccess) { usbi_err (ctx, "could not add hotplug event source: %s", darwin_error_str (kresult)); @@ -354,8 +375,8 @@ static void *darwin_event_thread_main (void *arg0) { /* create notifications for attached devices */ kresult = IOServiceAddMatchingNotification(libusb_notification_port, kIOFirstMatchNotification, IOServiceMatching(kIOUSBDeviceClassName), - (IOServiceMatchingCallback)darwin_devices_attached, - (void *)ctx, &libusb_add_device_iterator); + darwin_devices_attached, + ctx, &libusb_add_device_iterator); if (kresult != kIOReturnSuccess) { usbi_err (ctx, "could not add hotplug event source: %s", darwin_error_str (kresult)); @@ -397,7 +418,8 @@ static void *darwin_event_thread_main (void *arg0) { pthread_exit (NULL); } -static void _darwin_finalize(void) { +/* cleanup function to destroy cached devices */ +static void __attribute__((destructor)) _darwin_finalize(void) { struct darwin_cached_device *dev, *next; usbi_mutex_lock(&darwin_cached_devices_lock); @@ -409,7 +431,6 @@ static void _darwin_finalize(void) { static int darwin_init(struct libusb_context *ctx) { host_name_port_t host_self; - static int initted = 0; int rc; rc = darwin_scan_devices (ctx); @@ -420,17 +441,12 @@ static int darwin_init(struct libusb_context *ctx) { if (OSAtomicIncrement32Barrier(&initCount) == 1) { /* create the clocks that will be used */ - if (!initted) { - initted = 1; - atexit(_darwin_finalize); - } - host_self = mach_host_self(); host_get_clock_service(host_self, CALENDAR_CLOCK, &clock_realtime); host_get_clock_service(host_self, SYSTEM_CLOCK, &clock_monotonic); mach_port_deallocate(mach_task_self(), host_self); - pthread_create (&libusb_darwin_at, NULL, darwin_event_thread_main, (void *)ctx); + pthread_create (&libusb_darwin_at, NULL, darwin_event_thread_main, ctx); pthread_mutex_lock (&libusb_darwin_at_mutex); while (!libusb_darwin_acfl) @@ -524,7 +540,7 @@ static int darwin_get_config_descriptor(struct libusb_device *dev, uint8_t confi if (ret != LIBUSB_SUCCESS) return ret; - return len; + return (int) len; } /* check whether the os has configured the device */ @@ -701,7 +717,7 @@ static int darwin_cache_device_descriptor (struct libusb_context *ctx, struct da else usbi_warn (ctx, "could not retrieve device descriptor %.4x:%.4x: %s (%x). skipping device", idVendor, idProduct, darwin_error_str (ret), ret); - return -1; + return darwin_to_libusb (ret); } /* catch buggy hubs (which appear to be virtual). Apple's own USB prober has problems with these devices. */ @@ -709,7 +725,7 @@ static int darwin_cache_device_descriptor (struct libusb_context *ctx, struct da /* not a valid device */ usbi_warn (ctx, "idProduct from iokit (%04x) does not match idProduct in descriptor (%04x). skipping device", idProduct, libusb_le16_to_cpu (dev->dev_descriptor.idProduct)); - return -1; + return LIBUSB_ERROR_NO_DEVICE; } usbi_dbg ("cached device descriptor:"); @@ -729,26 +745,24 @@ static int darwin_cache_device_descriptor (struct libusb_context *ctx, struct da dev->can_enumerate = 1; - return 0; + return LIBUSB_SUCCESS; } static int darwin_get_cached_device(struct libusb_context *ctx, io_service_t service, struct darwin_cached_device **cached_out) { struct darwin_cached_device *new_device; - UInt64 sessionID, parent_sessionID; + UInt64 sessionID = 0, parent_sessionID = 0; int ret = LIBUSB_SUCCESS; usb_device_t **device; io_service_t parent; kern_return_t result; UInt8 port = 0; - *cached_out = NULL; - /* get some info from the io registry */ (void) get_ioregistry_value_number (service, CFSTR("sessionID"), kCFNumberSInt64Type, &sessionID); (void) get_ioregistry_value_number (service, CFSTR("PortNum"), kCFNumberSInt8Type, &port); - usbi_dbg("finding cached device for sessionID 0x\n" PRIx64, sessionID); + usbi_dbg("finding cached device for sessionID 0x%" PRIx64, sessionID); result = IORegistryEntryGetParentEntry (service, kIOUSBPlane, &parent); @@ -759,8 +773,10 @@ static int darwin_get_cached_device(struct libusb_context *ctx, io_service_t ser usbi_mutex_lock(&darwin_cached_devices_lock); do { + *cached_out = NULL; + list_for_each_entry(new_device, &darwin_cached_devices, list, struct darwin_cached_device) { - usbi_dbg("matching sessionID 0x%x against cached device with sessionID 0x%x", sessionID, new_device->session); + usbi_dbg("matching sessionID 0x%" PRIx64 " against cached device with sessionID 0x%" PRIx64, sessionID, new_device->session); if (new_device->session == sessionID) { usbi_dbg("using cached device for device"); *cached_out = new_device; @@ -771,19 +787,17 @@ static int darwin_get_cached_device(struct libusb_context *ctx, io_service_t ser if (*cached_out) break; - usbi_dbg("caching new device with sessionID 0x%x\n", sessionID); - - new_device = calloc (1, sizeof (*new_device)); - if (!new_device) { - ret = LIBUSB_ERROR_NO_MEM; - break; - } + usbi_dbg("caching new device with sessionID 0x%" PRIx64, sessionID); device = darwin_device_from_service (service); if (!device) { ret = LIBUSB_ERROR_NO_DEVICE; - free (new_device); - new_device = NULL; + break; + } + + new_device = calloc (1, sizeof (*new_device)); + if (!new_device) { + ret = LIBUSB_ERROR_NO_MEM; break; } @@ -833,7 +847,7 @@ static int process_new_device (struct libusb_context *ctx, io_service_t service) do { ret = darwin_get_cached_device (ctx, service, &cached_device); - if (ret < 0 || (cached_device && !cached_device->can_enumerate)) { + if (ret < 0 || !cached_device->can_enumerate) { return ret; } @@ -843,10 +857,10 @@ static int process_new_device (struct libusb_context *ctx, io_service_t service) if (ret) break; - usbi_dbg ("allocating new device in context %p for with session 0x%08x", + usbi_dbg ("allocating new device in context %p for with session 0x%" PRIx64, ctx, cached_device->session); - dev = usbi_alloc_device(ctx, cached_device->session); + dev = usbi_alloc_device(ctx, (unsigned long) cached_device->session); if (!dev) { return LIBUSB_ERROR_NO_MEM; } @@ -857,7 +871,7 @@ static int process_new_device (struct libusb_context *ctx, io_service_t service) darwin_ref_cached_device (priv->dev); if (cached_device->parent_session > 0) { - dev->parent_dev = usbi_get_device_by_session_id (ctx, cached_device->parent_session); + dev->parent_dev = usbi_get_device_by_session_id (ctx, (unsigned long) cached_device->parent_session); } else { dev->parent_dev = NULL; } @@ -865,11 +879,6 @@ static int process_new_device (struct libusb_context *ctx, io_service_t service) dev->bus_number = cached_device->location >> 24; dev->device_address = cached_device->address; - /* need to add a reference to the parent device */ - if (dev->parent_dev) { - libusb_ref_device(dev->parent_dev); - } - (*(priv->dev->device))->GetDeviceSpeed (priv->dev->device, &devSpeed); switch (devSpeed) { @@ -1129,7 +1138,7 @@ static int get_endpoints (struct libusb_device_handle *dev_handle, int iface) { usbi_dbg ("interface: %i pipe %i: dir: %i number: %i", iface, i, direction, number); - cInterface->endpoint_addrs[i - 1] = ((direction << 7 & LIBUSB_ENDPOINT_DIR_MASK) | (number & LIBUSB_ENDPOINT_ADDRESS_MASK)); + cInterface->endpoint_addrs[i - 1] = (((kUSBIn == direction) << kUSBRqDirnShift) | (number & LIBUSB_ENDPOINT_ADDRESS_MASK)); } cInterface->num_endpoints = numep; @@ -1301,22 +1310,18 @@ static int darwin_set_interface_altsetting(struct libusb_device_handle *dev_hand } static int darwin_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint) { - struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv; - /* current interface */ struct darwin_interface *cInterface; - uint8_t pipeRef, iface; IOReturn kresult; + uint8_t pipeRef; /* determine the interface/endpoint to use */ - if (ep_to_pipeRef (dev_handle, endpoint, &pipeRef, &iface) != 0) { + if (ep_to_pipeRef (dev_handle, endpoint, &pipeRef, NULL, &cInterface) != 0) { usbi_err (HANDLE_CTX (dev_handle), "endpoint not found on any open interface"); return LIBUSB_ERROR_NOT_FOUND; } - cInterface = &priv->interfaces[iface]; - /* newer versions of darwin support clearing additional bits on the device's endpoint */ kresult = (*(cInterface->interface))->ClearPipeStallBothEnds(cInterface->interface, pipeRef); if (kresult) @@ -1430,26 +1435,29 @@ static void darwin_destroy_device(struct libusb_device *dev) { static int submit_bulk_transfer(struct usbi_transfer *itransfer) { struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); - struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv; IOReturn ret; uint8_t transferType; /* None of the values below are used in libusbx for bulk transfers */ - uint8_t direction, number, interval, pipeRef, iface; + uint8_t direction, number, interval, pipeRef; uint16_t maxPacketSize; struct darwin_interface *cInterface; - if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) { + if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, NULL, &cInterface) != 0) { usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface"); return LIBUSB_ERROR_NOT_FOUND; } - cInterface = &priv->interfaces[iface]; + ret = (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number, + &transferType, &maxPacketSize, &interval); - (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number, - &transferType, &maxPacketSize, &interval); + if (ret) { + usbi_err (TRANSFER_CTX (transfer), "bulk transfer failed (dir = %s): %s (code = 0x%08x)", IS_XFERIN(transfer) ? "In" : "Out", + darwin_error_str(ret), ret); + return darwin_to_libusb (ret); + } if (0 != (transfer->length % maxPacketSize)) { /* do not need a zero packet */ @@ -1485,13 +1493,44 @@ static int submit_bulk_transfer(struct usbi_transfer *itransfer) { return darwin_to_libusb (ret); } +#if InterfaceVersion >= 550 +static int submit_stream_transfer(struct usbi_transfer *itransfer) { + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct darwin_interface *cInterface; + uint8_t pipeRef; + IOReturn ret; + + if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, NULL, &cInterface) != 0) { + usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface"); + + return LIBUSB_ERROR_NOT_FOUND; + } + + itransfer->flags |= USBI_TRANSFER_OS_HANDLES_TIMEOUT; + + if (IS_XFERIN(transfer)) + ret = (*(cInterface->interface))->ReadStreamsPipeAsyncTO(cInterface->interface, pipeRef, itransfer->stream_id, + transfer->buffer, transfer->length, transfer->timeout, + transfer->timeout, darwin_async_io_callback, (void *)itransfer); + else + ret = (*(cInterface->interface))->WriteStreamsPipeAsyncTO(cInterface->interface, pipeRef, itransfer->stream_id, + transfer->buffer, transfer->length, transfer->timeout, + transfer->timeout, darwin_async_io_callback, (void *)itransfer); + + if (ret) + usbi_err (TRANSFER_CTX (transfer), "bulk stream transfer failed (dir = %s): %s (code = 0x%08x)", IS_XFERIN(transfer) ? "In" : "Out", + darwin_error_str(ret), ret); + + return darwin_to_libusb (ret); +} +#endif + static int submit_iso_transfer(struct usbi_transfer *itransfer) { struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); - struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv; IOReturn kresult; - uint8_t direction, number, interval, pipeRef, iface, transferType; + uint8_t direction, number, interval, pipeRef, transferType; uint16_t maxPacketSize; UInt64 frame; AbsoluteTime atTime; @@ -1512,19 +1551,17 @@ static int submit_iso_transfer(struct usbi_transfer *itransfer) { return LIBUSB_ERROR_NO_MEM; } - /* copy the frame list from the libusbx descriptor (the structures differ only is member order) */ + /* copy the frame list from the libusb descriptor (the structures differ only is member order) */ for (i = 0 ; i < transfer->num_iso_packets ; i++) tpriv->isoc_framelist[i].frReqCount = transfer->iso_packet_desc[i].length; /* determine the interface/endpoint to use */ - if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) { + if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, NULL, &cInterface) != 0) { usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface"); return LIBUSB_ERROR_NOT_FOUND; } - cInterface = &priv->interfaces[iface]; - /* determine the properties of this endpoint and the speed of the device */ (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number, &transferType, &maxPacketSize, &interval); @@ -1579,7 +1616,6 @@ static int submit_control_transfer(struct usbi_transfer *itransfer) { struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); struct libusb_control_setup *setup = (struct libusb_control_setup *) transfer->buffer; struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev); - struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv; struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); IOReturn kresult; @@ -1593,7 +1629,7 @@ static int submit_control_transfer(struct usbi_transfer *itransfer) { tpriv->req.wValue = OSSwapLittleToHostInt16 (setup->wValue); tpriv->req.wIndex = OSSwapLittleToHostInt16 (setup->wIndex); tpriv->req.wLength = OSSwapLittleToHostInt16 (setup->wLength); - /* data is stored after the libusbx control block */ + /* data is stored after the libusb control block */ tpriv->req.pData = transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE; tpriv->req.completionTimeout = transfer->timeout; tpriv->req.noDataTimeout = transfer->timeout; @@ -1604,16 +1640,14 @@ static int submit_control_transfer(struct usbi_transfer *itransfer) { if (transfer->endpoint) { struct darwin_interface *cInterface; - uint8_t pipeRef, iface; + uint8_t pipeRef; - if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) { + if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, NULL, &cInterface) != 0) { usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface"); return LIBUSB_ERROR_NOT_FOUND; } - cInterface = &priv->interfaces[iface]; - kresult = (*(cInterface->interface))->ControlRequestAsyncTO (cInterface->interface, pipeRef, &(tpriv->req), darwin_async_io_callback, itransfer); } else /* control request on endpoint 0 */ @@ -1636,6 +1670,13 @@ static int darwin_submit_transfer(struct usbi_transfer *itransfer) { return submit_bulk_transfer(itransfer); case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: return submit_iso_transfer(itransfer); + case LIBUSB_TRANSFER_TYPE_BULK_STREAM: +#if InterfaceVersion >= 550 + return submit_stream_transfer(itransfer); +#else + usbi_err (TRANSFER_CTX(transfer), "IOUSBFamily version does not support bulk stream transfers"); + return LIBUSB_ERROR_NOT_SUPPORTED; +#endif default: usbi_err (TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type); return LIBUSB_ERROR_INVALID_PARAM; @@ -1660,26 +1701,28 @@ static int cancel_control_transfer(struct usbi_transfer *itransfer) { static int darwin_abort_transfers (struct usbi_transfer *itransfer) { struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev); - struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv; struct darwin_interface *cInterface; uint8_t pipeRef, iface; IOReturn kresult; - if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) { + if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface, &cInterface) != 0) { usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface"); return LIBUSB_ERROR_NOT_FOUND; } - cInterface = &priv->interfaces[iface]; - if (!dpriv->device) return LIBUSB_ERROR_NO_DEVICE; usbi_warn (ITRANSFER_CTX (itransfer), "aborting all transactions on interface %d pipe %d", iface, pipeRef); /* abort transactions */ - (*(cInterface->interface))->AbortPipe (cInterface->interface, pipeRef); +#if InterfaceVersion >= 550 + if (LIBUSB_TRANSFER_TYPE_BULK_STREAM == transfer->type) + (*(cInterface->interface))->AbortStreamsPipe (cInterface->interface, pipeRef, itransfer->stream_id); + else +#endif + (*(cInterface->interface))->AbortPipe (cInterface->interface, pipeRef); usbi_dbg ("calling clear pipe stall to clear the data toggle bit"); @@ -1727,10 +1770,9 @@ static void darwin_async_io_callback (void *refcon, IOReturn result, void *arg0) /* if requested write a zero packet */ if (kIOReturnSuccess == result && IS_XFEROUT(transfer) && transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) { struct darwin_interface *cInterface; - uint8_t iface, pipeRef; + uint8_t pipeRef; - (void) ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface); - cInterface = &priv->interfaces[iface]; + (void) ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, NULL, &cInterface); (*(cInterface->interface))->WritePipe (cInterface->interface, pipeRef, transfer->buffer, 0); } @@ -1861,6 +1903,64 @@ static int darwin_clock_gettime(int clk_id, struct timespec *tp) { return 0; } +#if InterfaceVersion >= 550 +static int darwin_alloc_streams (struct libusb_device_handle *dev_handle, uint32_t num_streams, unsigned char *endpoints, + int num_endpoints) { + struct darwin_interface *cInterface; + UInt32 supportsStreams; + uint8_t pipeRef; + int rc, i; + + /* find the mimimum number of supported streams on the endpoint list */ + for (i = 0 ; i < num_endpoints ; ++i) { + if (0 != (rc = ep_to_pipeRef (dev_handle, endpoints[i], &pipeRef, NULL, &cInterface))) { + return rc; + } + + (*(cInterface->interface))->SupportsStreams (cInterface->interface, pipeRef, &supportsStreams); + if (num_streams > supportsStreams) + num_streams = supportsStreams; + } + + /* it is an error if any endpoint in endpoints does not support streams */ + if (0 == num_streams) + return LIBUSB_ERROR_INVALID_PARAM; + + /* create the streams */ + for (i = 0 ; i < num_endpoints ; ++i) { + (void) ep_to_pipeRef (dev_handle, endpoints[i], &pipeRef, NULL, &cInterface); + + rc = (*(cInterface->interface))->CreateStreams (cInterface->interface, pipeRef, num_streams); + if (kIOReturnSuccess != rc) + return darwin_to_libusb(rc); + } + + return num_streams; +} + +static int darwin_free_streams (struct libusb_device_handle *dev_handle, unsigned char *endpoints, int num_endpoints) { + struct darwin_interface *cInterface; + UInt32 supportsStreams; + uint8_t pipeRef; + int rc; + + for (int i = 0 ; i < num_endpoints ; ++i) { + if (0 != (rc = ep_to_pipeRef (dev_handle, endpoints[i], &pipeRef, NULL, &cInterface))) + return rc; + + (*(cInterface->interface))->SupportsStreams (cInterface->interface, pipeRef, &supportsStreams); + if (0 == supportsStreams) + return LIBUSB_ERROR_INVALID_PARAM; + + rc = (*(cInterface->interface))->CreateStreams (cInterface->interface, pipeRef, 0); + if (kIOReturnSuccess != rc) + return darwin_to_libusb(rc); + } + + return LIBUSB_SUCCESS; +} +#endif + const struct usbi_os_backend darwin_backend = { .name = "Darwin", .caps = 0, @@ -1870,6 +1970,7 @@ const struct usbi_os_backend darwin_backend = { .get_device_descriptor = darwin_get_device_descriptor, .get_active_config_descriptor = darwin_get_active_config_descriptor, .get_config_descriptor = darwin_get_config_descriptor, + .hotplug_poll = darwin_hotplug_poll, .open = darwin_open, .close = darwin_close, @@ -1882,6 +1983,11 @@ const struct usbi_os_backend darwin_backend = { .clear_halt = darwin_clear_halt, .reset_device = darwin_reset_device, +#if InterfaceVersion >= 550 + .alloc_streams = darwin_alloc_streams, + .free_streams = darwin_free_streams, +#endif + .kernel_driver_active = darwin_kernel_driver_active, .detach_kernel_driver = darwin_detach_kernel_driver, .attach_kernel_driver = darwin_attach_kernel_driver, diff --git a/Externals/libusbx/libusb/os/darwin_usb.h b/Externals/libusb/libusb/os/darwin_usb.h similarity index 97% rename from Externals/libusbx/libusb/os/darwin_usb.h rename to Externals/libusb/libusb/os/darwin_usb.h index 53b8542b13..8838881958 100644 --- a/Externals/libusbx/libusb/os/darwin_usb.h +++ b/Externals/libusb/libusb/os/darwin_usb.h @@ -1,5 +1,5 @@ /* - * darwin backend for libusbx 1.0 + * darwin backend for libusb 1.0 * Copyright © 2008-2013 Nathan Hjelm * * This library is free software; you can redistribute it and/or @@ -137,7 +137,7 @@ struct darwin_device_handle_priv { uint8_t num_endpoints; CFRunLoopSourceRef cfSource; uint64_t frames[256]; - uint8_t endpoint_addrs[USB_MAXENDPOINTS]; + uint8_t endpoint_addrs[USB_MAXENDPOINTS]; } interfaces[USB_MAXINTERFACES]; }; diff --git a/Externals/libusbx/libusb/os/linux_netlink.c b/Externals/libusb/libusb/os/linux_netlink.c similarity index 63% rename from Externals/libusbx/libusb/os/linux_netlink.c rename to Externals/libusb/libusb/os/linux_netlink.c index 3a68f69d9c..306f0b4524 100644 --- a/Externals/libusbx/libusb/os/linux_netlink.c +++ b/Externals/libusb/libusb/os/linux_netlink.c @@ -21,6 +21,10 @@ */ #include "config.h" +#include "libusb.h" +#include "libusbi.h" +#include "linux_usbfs.h" + #include #include #include @@ -30,46 +34,113 @@ #include #include #include + +#ifdef HAVE_ASM_TYPES_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H #include +#endif + #include -#include "libusb.h" -#include "libusbi.h" -#include "linux_usbfs.h" - +#ifdef HAVE_LINUX_NETLINK_H #include +#endif + +#ifdef HAVE_LINUX_FILTER_H #include +#endif #define KERNEL 1 static int linux_netlink_socket = -1; +static int netlink_control_pipe[2] = { -1, -1 }; static pthread_t libusb_linux_event_thread; static void *linux_netlink_event_thread_main(void *arg); struct sockaddr_nl snl = { .nl_family=AF_NETLINK, .nl_groups=KERNEL }; +static int set_fd_cloexec_nb (int fd) +{ + int flags; + +#if defined(FD_CLOEXEC) + flags = fcntl (linux_netlink_socket, F_GETFD); + if (0 > flags) { + return -1; + } + + if (!(flags & FD_CLOEXEC)) { + fcntl (linux_netlink_socket, F_SETFD, flags | FD_CLOEXEC); + } +#endif + + flags = fcntl (linux_netlink_socket, F_GETFL); + if (0 > flags) { + return -1; + } + + if (!(flags & O_NONBLOCK)) { + fcntl (linux_netlink_socket, F_SETFL, flags | O_NONBLOCK); + } + + return 0; +} + int linux_netlink_start_event_monitor(void) { + int socktype = SOCK_RAW; int ret; snl.nl_groups = KERNEL; - linux_netlink_socket = socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_KOBJECT_UEVENT); +#if defined(SOCK_CLOEXEC) + socktype |= SOCK_CLOEXEC; +#endif +#if defined(SOCK_NONBLOCK) + socktype |= SOCK_NONBLOCK; +#endif + + linux_netlink_socket = socket(PF_NETLINK, socktype, NETLINK_KOBJECT_UEVENT); + if (-1 == linux_netlink_socket && EINVAL == errno) { + linux_netlink_socket = socket(PF_NETLINK, SOCK_RAW, NETLINK_KOBJECT_UEVENT); + } + if (-1 == linux_netlink_socket) { return LIBUSB_ERROR_OTHER; } + ret = set_fd_cloexec_nb (linux_netlink_socket); + if (0 != ret) { + close (linux_netlink_socket); + linux_netlink_socket = -1; + return LIBUSB_ERROR_OTHER; + } + ret = bind(linux_netlink_socket, (struct sockaddr *) &snl, sizeof(snl)); if (0 != ret) { + close(linux_netlink_socket); return LIBUSB_ERROR_OTHER; } /* TODO -- add authentication */ /* setsockopt(linux_netlink_socket, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)); */ + ret = usbi_pipe(netlink_control_pipe); + if (ret) { + usbi_err(NULL, "could not create netlink control pipe"); + close(linux_netlink_socket); + return LIBUSB_ERROR_OTHER; + } + ret = pthread_create(&libusb_linux_event_thread, NULL, linux_netlink_event_thread_main, NULL); if (0 != ret) { + close(netlink_control_pipe[0]); + close(netlink_control_pipe[1]); + close(linux_netlink_socket); return LIBUSB_ERROR_OTHER; } @@ -79,22 +150,30 @@ int linux_netlink_start_event_monitor(void) int linux_netlink_stop_event_monitor(void) { int r; + char dummy = 1; if (-1 == linux_netlink_socket) { /* already closed. nothing to do */ return LIBUSB_SUCCESS; } - r = close(linux_netlink_socket); - if (0 > r) { - usbi_err(NULL, "error closing netlink socket. %s", strerror(errno)); - return LIBUSB_ERROR_OTHER; + /* Write some dummy data to the control pipe and + * wait for the thread to exit */ + r = usbi_write(netlink_control_pipe[1], &dummy, sizeof(dummy)); + if (r <= 0) { + usbi_warn(NULL, "netlink control pipe signal failed"); } + pthread_join(libusb_linux_event_thread, NULL); - pthread_cancel(libusb_linux_event_thread); - + close(linux_netlink_socket); linux_netlink_socket = -1; + /* close and reset control pipe */ + close(netlink_control_pipe[0]); + close(netlink_control_pipe[1]); + netlink_control_pipe[0] = -1; + netlink_control_pipe[1] = -1; + return LIBUSB_SUCCESS; } @@ -145,8 +224,32 @@ static int linux_netlink_parse(char *buffer, size_t len, int *detached, const ch tmp = netlink_message_parse(buffer, len, "BUSNUM"); if (NULL == tmp) { - /* no bus number (likely a usb interface). ignore*/ - return -1; + /* no bus number. try "DEVICE" */ + tmp = netlink_message_parse(buffer, len, "DEVICE"); + if (NULL == tmp) { + /* not usb. ignore */ + return -1; + } + + /* Parse a device path such as /dev/bus/usb/003/004 */ + char *pLastSlash = (char*)strrchr(tmp,'/'); + if(NULL == pLastSlash) { + return -1; + } + + *devaddr = strtoul(pLastSlash + 1, NULL, 10); + if (errno) { + errno = 0; + return -1; + } + + *busnum = strtoul(pLastSlash - 3, NULL, 10); + if (errno) { + errno = 0; + return -1; + } + + return 0; } *busnum = (uint8_t)(strtoul(tmp, NULL, 10) & 0xff); @@ -214,7 +317,7 @@ static int linux_netlink_read_message(void) /* signal device is available (or not) to all contexts */ if (detached) - linux_hotplug_disconnected(busnum, devaddr, sys_name); + linux_device_disconnected(busnum, devaddr, sys_name); else linux_hotplug_enumerate(busnum, devaddr, sys_name); @@ -223,20 +326,32 @@ static int linux_netlink_read_message(void) static void *linux_netlink_event_thread_main(void *arg) { - struct pollfd fds = {.fd = linux_netlink_socket, - .events = POLLIN}; + char dummy; + int r; + struct pollfd fds[] = { + { .fd = netlink_control_pipe[0], + .events = POLLIN }, + { .fd = linux_netlink_socket, + .events = POLLIN }, + }; /* silence compiler warning */ (void) arg; - while (1 == poll(&fds, 1, -1)) { - if (POLLIN != fds.revents) { + while (poll(fds, 2, -1) >= 0) { + if (fds[0].revents & POLLIN) { + /* activity on control pipe, read the byte and exit */ + r = usbi_read(netlink_control_pipe[0], &dummy, sizeof(dummy)); + if (r <= 0) { + usbi_warn(NULL, "netlink control pipe read failed"); + } break; } - - usbi_mutex_static_lock(&linux_hotplug_lock); - linux_netlink_read_message(); - usbi_mutex_static_unlock(&linux_hotplug_lock); + if (fds[1].revents & POLLIN) { + usbi_mutex_static_lock(&linux_hotplug_lock); + linux_netlink_read_message(); + usbi_mutex_static_unlock(&linux_hotplug_lock); + } } return NULL; diff --git a/Externals/libusbx/libusb/os/linux_udev.c b/Externals/libusb/libusb/os/linux_udev.c similarity index 82% rename from Externals/libusbx/libusb/os/linux_udev.c rename to Externals/libusb/libusb/os/linux_udev.c index 5a2aadfd44..0394048ab7 100644 --- a/Externals/libusbx/libusb/os/linux_udev.c +++ b/Externals/libusb/libusb/os/linux_udev.c @@ -46,6 +46,7 @@ /* udev context */ static struct udev *udev_ctx = NULL; static int udev_monitor_fd = -1; +static int udev_control_pipe[2] = {-1, -1}; static struct udev_monitor *udev_monitor = NULL; static pthread_t linux_event_thread; @@ -60,7 +61,7 @@ int linux_udev_start_event_monitor(void) udev_ctx = udev_new(); if (!udev_ctx) { usbi_err(NULL, "could not create udev context"); - return LIBUSB_ERROR_OTHER; + goto err; } udev_monitor = udev_monitor_new_from_netlink(udev_ctx, "udev"); @@ -95,34 +96,49 @@ int linux_udev_start_event_monitor(void) goto err_free_monitor; } + r = usbi_pipe(udev_control_pipe); + if (r) { + usbi_err(NULL, "could not create udev control pipe"); + goto err_free_monitor; + } + r = pthread_create(&linux_event_thread, NULL, linux_udev_event_thread_main, NULL); if (r) { usbi_err(NULL, "creating hotplug event thread (%d)", r); - goto err_free_monitor; + goto err_close_pipe; } return LIBUSB_SUCCESS; +err_close_pipe: + close(udev_control_pipe[0]); + close(udev_control_pipe[1]); err_free_monitor: udev_monitor_unref(udev_monitor); udev_monitor = NULL; udev_monitor_fd = -1; err_free_ctx: udev_unref(udev_ctx); +err: udev_ctx = NULL; return LIBUSB_ERROR_OTHER; } int linux_udev_stop_event_monitor(void) { + char dummy = 1; + int r; + assert(udev_ctx != NULL); assert(udev_monitor != NULL); assert(udev_monitor_fd != -1); - /* Cancel the event thread. This is the only way to guarantee the - thread exits since closing the monitor fd won't necessarily cause - poll to return. */ - pthread_cancel(linux_event_thread); + /* Write some dummy data to the control pipe and + * wait for the thread to exit */ + r = usbi_write(udev_control_pipe[1], &dummy, sizeof(dummy)); + if (r <= 0) { + usbi_warn(NULL, "udev control pipe signal failed"); + } pthread_join(linux_event_thread, NULL); /* Release the udev monitor */ @@ -134,27 +150,45 @@ int linux_udev_stop_event_monitor(void) udev_unref(udev_ctx); udev_ctx = NULL; + /* close and reset control pipe */ + close(udev_control_pipe[0]); + close(udev_control_pipe[1]); + udev_control_pipe[0] = -1; + udev_control_pipe[1] = -1; + return LIBUSB_SUCCESS; } static void *linux_udev_event_thread_main(void *arg) { + char dummy; + int r; struct udev_device* udev_dev; - struct pollfd fds = {.fd = udev_monitor_fd, - .events = POLLIN}; + struct pollfd fds[] = { + {.fd = udev_control_pipe[0], + .events = POLLIN}, + {.fd = udev_monitor_fd, + .events = POLLIN}, + }; usbi_dbg("udev event thread entering."); - while (1 == poll(&fds, 1, -1)) { - if (NULL == udev_monitor || POLLIN != fds.revents) { + while (poll(fds, 2, -1) >= 0) { + if (fds[0].revents & POLLIN) { + /* activity on control pipe, read the byte and exit */ + r = usbi_read(udev_control_pipe[0], &dummy, sizeof(dummy)); + if (r <= 0) { + usbi_warn(NULL, "udev control pipe read failed"); + } break; } - - usbi_mutex_static_lock(&linux_hotplug_lock); - udev_dev = udev_monitor_receive_device(udev_monitor); - if (udev_dev) - udev_hotplug_event(udev_dev); - usbi_mutex_static_unlock(&linux_hotplug_lock); + if (fds[1].revents & POLLIN) { + usbi_mutex_static_lock(&linux_hotplug_lock); + udev_dev = udev_monitor_receive_device(udev_monitor); + if (udev_dev) + udev_hotplug_event(udev_dev); + usbi_mutex_static_unlock(&linux_hotplug_lock); + } } usbi_dbg("udev event thread exiting"); @@ -207,7 +241,7 @@ static void udev_hotplug_event(struct udev_device* udev_dev) if (strncmp(udev_action, "add", 3) == 0) { linux_hotplug_enumerate(busnum, devaddr, sys_name); } else if (detached) { - linux_hotplug_disconnected(busnum, devaddr, sys_name); + linux_device_disconnected(busnum, devaddr, sys_name); } else { usbi_err(NULL, "ignoring udev action %s", udev_action); } diff --git a/Externals/libusbx/libusb/os/linux_usbfs.c b/Externals/libusb/libusb/os/linux_usbfs.c similarity index 93% rename from Externals/libusbx/libusb/os/linux_usbfs.c rename to Externals/libusb/libusb/os/linux_usbfs.c index 09288af719..db21710101 100644 --- a/Externals/libusbx/libusb/os/linux_usbfs.c +++ b/Externals/libusb/libusb/os/linux_usbfs.c @@ -1,5 +1,6 @@ +/* -*- Mode: C; c-basic-offset:8 ; indent-tabs-mode:t -*- */ /* - * Linux usbfs backend for libusbx + * Linux usbfs backend for libusb * Copyright © 2007-2009 Daniel Drake * Copyright © 2001 Johannes Erdfelt * Copyright © 2013 Nathan Hjelm @@ -48,7 +49,7 @@ * sysfs allows us to read the kernel's in-memory copies of device descriptors * and so forth, avoiding the need to open the device: * - The binary "descriptors" file contains all config descriptors since - * 2.6.26, commit 217a9081d8e69026186067711131b77f0ce219ed + * 2.6.26, commit 217a9081d8e69026186067711131b77f0ce219ed * - The binary "descriptors" file was added in 2.6.23, commit * 69d42a78f935d19384d1f6e4f94b65bb162b36df, but it only contains the * active config descriptors @@ -118,9 +119,11 @@ static int sysfs_can_relate_devices = -1; static int sysfs_has_descriptors = -1; /* how many times have we initted (and not exited) ? */ -static volatile int init_count = 0; +static int init_count = 0; -/* Serialize hotplug start/stop, scan-devices, event-thread, and poll */ +/* Serialize hotplug start/stop */ +usbi_mutex_static_t linux_hotplug_startstop_lock = USBI_MUTEX_INITIALIZER; +/* Serialize scan-devices, event-thread, and poll */ usbi_mutex_static_t linux_hotplug_lock = USBI_MUTEX_INITIALIZER; static int linux_start_event_monitor(void); @@ -181,6 +184,7 @@ static int _get_usbfs_fd(struct libusb_device *dev, mode_t mode, int silent) struct libusb_context *ctx = DEVICE_CTX(dev); char path[PATH_MAX]; int fd; + int delay = 10000; if (usbdev_names) snprintf(path, PATH_MAX, "%s/usbdev%d.%d", @@ -193,11 +197,23 @@ static int _get_usbfs_fd(struct libusb_device *dev, mode_t mode, int silent) if (fd != -1) return fd; /* Success */ + if (errno == ENOENT) { + if (!silent) + usbi_err(ctx, "File doesn't exist, wait %d ms and try again\n", delay/1000); + + /* Wait 10ms for USB device path creation.*/ + usleep(delay); + + fd = open(path, mode); + if (fd != -1) + return fd; /* Success */ + } + if (!silent) { - usbi_err(ctx, "libusbx couldn't open USB device %s: %s", + usbi_err(ctx, "libusb couldn't open USB device %s: %s", path, strerror(errno)); if (errno == EACCES && mode == O_RDWR) - usbi_err(ctx, "libusbx requires write access to USB " + usbi_err(ctx, "libusb requires write access to USB " "device nodes."); } @@ -419,7 +435,7 @@ static int op_init(struct libusb_context *ctx) if (sysfs_has_descriptors) usbi_dbg("sysfs has complete descriptors"); - usbi_mutex_static_lock(&linux_hotplug_lock); + usbi_mutex_static_lock(&linux_hotplug_startstop_lock); r = LIBUSB_SUCCESS; if (init_count == 0) { /* start up hotplug event handler */ @@ -433,20 +449,20 @@ static int op_init(struct libusb_context *ctx) linux_stop_event_monitor(); } else usbi_err(ctx, "error starting hotplug event monitor"); - usbi_mutex_static_unlock(&linux_hotplug_lock); + usbi_mutex_static_unlock(&linux_hotplug_startstop_lock); return r; } static void op_exit(void) { - usbi_mutex_static_lock(&linux_hotplug_lock); + usbi_mutex_static_lock(&linux_hotplug_startstop_lock); assert(init_count != 0); if (!--init_count) { /* tear down event handler */ (void)linux_stop_event_monitor(); } - usbi_mutex_static_unlock(&linux_hotplug_lock); + usbi_mutex_static_unlock(&linux_hotplug_startstop_lock); } static int linux_start_event_monitor(void) @@ -469,11 +485,19 @@ static int linux_stop_event_monitor(void) static int linux_scan_devices(struct libusb_context *ctx) { + int ret; + + usbi_mutex_static_lock(&linux_hotplug_lock); + #if defined(USE_UDEV) - return linux_udev_scan_devices(ctx); + ret = linux_udev_scan_devices(ctx); #else - return linux_default_scan_devices(ctx); + ret = linux_default_scan_devices(ctx); #endif + + usbi_mutex_static_unlock(&linux_hotplug_lock); + + return ret; } static void op_hotplug_poll(void) @@ -553,7 +577,7 @@ static int op_get_device_descriptor(struct libusb_device *dev, static int sysfs_get_active_config(struct libusb_device *dev, int *config) { char *endptr; - char tmp[4] = {0, 0, 0, 0}; + char tmp[5] = {0, 0, 0, 0, 0}; long num; int fd; ssize_t r; @@ -565,7 +589,7 @@ static int sysfs_get_active_config(struct libusb_device *dev, int *config) r = read(fd, tmp, sizeof(tmp)); close(fd); if (r < 0) { - usbi_err(DEVICE_CTX(dev), + usbi_err(DEVICE_CTX(dev), "read bConfigurationValue failed ret=%d errno=%d", r, errno); return LIBUSB_ERROR_IO; } else if (r == 0) { @@ -596,6 +620,8 @@ int linux_get_device_address (struct libusb_context *ctx, int detached, uint8_t *busnum, uint8_t *devaddr,const char *dev_node, const char *sys_name) { + int sysfs_attr; + usbi_dbg("getting address for device: %s detached: %d", sys_name, detached); /* can't use sysfs to read the bus and device number if the * device has been detached */ @@ -616,17 +642,22 @@ int linux_get_device_address (struct libusb_context *ctx, int detached, usbi_dbg("scan %s", sys_name); - *busnum = __read_sysfs_attr(ctx, sys_name, "busnum"); - if (0 > *busnum) - return *busnum; + sysfs_attr = __read_sysfs_attr(ctx, sys_name, "busnum"); + if (0 > sysfs_attr) + return sysfs_attr; + if (sysfs_attr > 255) + return LIBUSB_ERROR_INVALID_PARAM; + *busnum = (uint8_t) sysfs_attr; - *devaddr = __read_sysfs_attr(ctx, sys_name, "devnum"); - if (0 > *devaddr) - return *devaddr; + sysfs_attr = __read_sysfs_attr(ctx, sys_name, "devnum"); + if (0 > sysfs_attr) + return sysfs_attr; + if (sysfs_attr > 255) + return LIBUSB_ERROR_INVALID_PARAM; + + *devaddr = (uint8_t) sysfs_attr; usbi_dbg("bus=%d dev=%d", *busnum, *devaddr); - if (*busnum > 255 || *devaddr > 255) - return LIBUSB_ERROR_INVALID_PARAM; return LIBUSB_SUCCESS; } @@ -895,7 +926,7 @@ static int initialize_device(struct libusb_device *dev, uint8_t busnum, } priv->descriptors_len += r; } while (priv->descriptors_len == descriptors_size); - + close(fd); if (priv->descriptors_len < DEVICE_DESC_LENGTH) { @@ -1030,9 +1061,11 @@ int linux_enumerate_device(struct libusb_context *ctx, usbi_dbg("busnum %d devaddr %d session_id %ld", busnum, devaddr, session_id); - if (usbi_get_device_by_session_id(ctx, session_id)) { + dev = usbi_get_device_by_session_id(ctx, session_id); + if (dev) { /* device already exists in the context */ usbi_dbg("session_id %ld already exists", session_id); + libusb_unref_device(dev); return LIBUSB_SUCCESS; } @@ -1072,7 +1105,7 @@ void linux_hotplug_enumerate(uint8_t busnum, uint8_t devaddr, const char *sys_na usbi_mutex_static_unlock(&active_contexts_lock); } -void linux_hotplug_disconnected(uint8_t busnum, uint8_t devaddr, const char *sys_name) +void linux_device_disconnected(uint8_t busnum, uint8_t devaddr, const char *sys_name) { struct libusb_context *ctx; struct libusb_device *dev; @@ -1083,6 +1116,7 @@ void linux_hotplug_disconnected(uint8_t busnum, uint8_t devaddr, const char *sys dev = usbi_get_device_by_session_id (ctx, session_id); if (NULL != dev) { usbi_disconnect_device (dev); + libusb_unref_device(dev); } else { usbi_dbg("device not found for session %x", session_id); } @@ -1247,8 +1281,20 @@ static int op_open(struct libusb_device_handle *handle) int r; hpriv->fd = _get_usbfs_fd(handle->dev, O_RDWR, 0); - if (hpriv->fd < 0) + if (hpriv->fd < 0) { + if (hpriv->fd == LIBUSB_ERROR_NO_DEVICE) { + /* device will still be marked as attached if hotplug monitor thread + * hasn't processed remove event yet */ + usbi_mutex_static_lock(&linux_hotplug_lock); + if (handle->dev->attached) { + usbi_dbg("open failed with no device, but device still attached"); + linux_device_disconnected(handle->dev->bus_number, + handle->dev->device_address, NULL); + } + usbi_mutex_static_unlock(&linux_hotplug_lock); + } return hpriv->fd; + } r = ioctl(hpriv->fd, IOCTL_USBFS_GET_CAPABILITIES, &hpriv->caps); if (r < 0) { @@ -1449,6 +1495,56 @@ out: return ret; } +static int do_streams_ioctl(struct libusb_device_handle *handle, long req, + uint32_t num_streams, unsigned char *endpoints, int num_endpoints) +{ + int r, fd = _device_handle_priv(handle)->fd; + struct usbfs_streams *streams; + + if (num_endpoints > 30) /* Max 15 in + 15 out eps */ + return LIBUSB_ERROR_INVALID_PARAM; + + streams = malloc(sizeof(struct usbfs_streams) + num_endpoints); + if (!streams) + return LIBUSB_ERROR_NO_MEM; + + streams->num_streams = num_streams; + streams->num_eps = num_endpoints; + memcpy(streams->eps, endpoints, num_endpoints); + + r = ioctl(fd, req, streams); + + free(streams); + + if (r < 0) { + if (errno == ENOTTY) + return LIBUSB_ERROR_NOT_SUPPORTED; + else if (errno == EINVAL) + return LIBUSB_ERROR_INVALID_PARAM; + else if (errno == ENODEV) + return LIBUSB_ERROR_NO_DEVICE; + + usbi_err(HANDLE_CTX(handle), + "streams-ioctl failed error %d errno %d", r, errno); + return LIBUSB_ERROR_OTHER; + } + return r; +} + +static int op_alloc_streams(struct libusb_device_handle *handle, + uint32_t num_streams, unsigned char *endpoints, int num_endpoints) +{ + return do_streams_ioctl(handle, IOCTL_USBFS_ALLOC_STREAMS, + num_streams, endpoints, num_endpoints); +} + +static int op_free_streams(struct libusb_device_handle *handle, + unsigned char *endpoints, int num_endpoints) +{ + return do_streams_ioctl(handle, IOCTL_USBFS_FREE_STREAMS, 0, + endpoints, num_endpoints); +} + static int op_kernel_driver_active(struct libusb_device_handle *handle, int interface) { @@ -1656,8 +1752,7 @@ static void free_iso_urbs(struct linux_transfer_priv *tpriv) tpriv->iso_urbs = NULL; } -static int submit_bulk_transfer(struct usbi_transfer *itransfer, - unsigned char urb_type) +static int submit_bulk_transfer(struct usbi_transfer *itransfer) { struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); @@ -1745,7 +1840,19 @@ static int submit_bulk_transfer(struct usbi_transfer *itransfer, for (i = 0; i < num_urbs; i++) { struct usbfs_urb *urb = &urbs[i]; urb->usercontext = itransfer; - urb->type = urb_type; + switch (transfer->type) { + case LIBUSB_TRANSFER_TYPE_BULK: + urb->type = USBFS_URB_TYPE_BULK; + urb->stream_id = 0; + break; + case LIBUSB_TRANSFER_TYPE_BULK_STREAM: + urb->type = USBFS_URB_TYPE_BULK; + urb->stream_id = itransfer->stream_id; + break; + case LIBUSB_TRANSFER_TYPE_INTERRUPT: + urb->type = USBFS_URB_TYPE_INTERRUPT; + break; + } urb->endpoint = transfer->endpoint; urb->buffer = transfer->buffer + (i * bulk_buffer_len); /* don't set the short not ok flag for the last URB */ @@ -1775,7 +1882,7 @@ static int submit_bulk_transfer(struct usbi_transfer *itransfer, "submiturb failed error %d errno=%d", r, errno); r = LIBUSB_ERROR_IO; } - + /* if the first URB submission fails, we can simply free up and * return failure immediately. */ if (i == 0) { @@ -1790,7 +1897,7 @@ static int submit_bulk_transfer(struct usbi_transfer *itransfer, * complications: * - discarding is asynchronous - discarded urbs will be reaped * later. the user must not have freed the transfer when the - * discarded URBs are reaped, otherwise libusbx will be using + * discarded URBs are reaped, otherwise libusb will be using * freed memory. * - the earlier URBs may have completed successfully and we do * not want to throw away any data. @@ -1952,7 +2059,7 @@ static int submit_iso_transfer(struct usbi_transfer *itransfer) * complications: * - discarding is asynchronous - discarded urbs will be reaped * later. the user must not have freed the transfer when the - * discarded URBs are reaped, otherwise libusbx will be using + * discarded URBs are reaped, otherwise libusb will be using * freed memory. * - the earlier URBs may have completed successfully and we do * not want to throw away any data. @@ -2028,9 +2135,10 @@ static int op_submit_transfer(struct usbi_transfer *itransfer) case LIBUSB_TRANSFER_TYPE_CONTROL: return submit_control_transfer(itransfer); case LIBUSB_TRANSFER_TYPE_BULK: - return submit_bulk_transfer(itransfer, USBFS_URB_TYPE_BULK); + case LIBUSB_TRANSFER_TYPE_BULK_STREAM: + return submit_bulk_transfer(itransfer); case LIBUSB_TRANSFER_TYPE_INTERRUPT: - return submit_bulk_transfer(itransfer, USBFS_URB_TYPE_INTERRUPT); + return submit_bulk_transfer(itransfer); case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: return submit_iso_transfer(itransfer); default: @@ -2048,6 +2156,7 @@ static int op_cancel_transfer(struct usbi_transfer *itransfer) switch (transfer->type) { case LIBUSB_TRANSFER_TYPE_BULK: + case LIBUSB_TRANSFER_TYPE_BULK_STREAM: if (tpriv->reap_action == ERROR) break; /* else, fall through */ @@ -2078,6 +2187,7 @@ static void op_clear_transfer_priv(struct usbi_transfer *itransfer) switch (transfer->type) { case LIBUSB_TRANSFER_TYPE_CONTROL: case LIBUSB_TRANSFER_TYPE_BULK: + case LIBUSB_TRANSFER_TYPE_BULK_STREAM: case LIBUSB_TRANSFER_TYPE_INTERRUPT: usbi_mutex_lock(&itransfer->lock); if (tpriv->urbs) @@ -2127,7 +2237,7 @@ static int handle_bulk_completion(struct usbi_transfer *itransfer, * * When this happens, our objectives are not to lose any "surplus" data, * and also to stick it at the end of the previously-received data - * (closing any holes), so that libusbx reports the total amount of + * (closing any holes), so that libusb reports the total amount of * transferred data and presents it in a contiguous chunk. */ if (urb->actual_length > 0) { @@ -2446,6 +2556,7 @@ static int reap_for_handle(struct libusb_device_handle *handle) case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: return handle_iso_completion(itransfer, urb); case LIBUSB_TRANSFER_TYPE_BULK: + case LIBUSB_TRANSFER_TYPE_BULK_STREAM: case LIBUSB_TRANSFER_TYPE_INTERRUPT: return handle_bulk_completion(itransfer, urb); case LIBUSB_TRANSFER_TYPE_CONTROL: @@ -2479,9 +2590,22 @@ static int op_handle_events(struct libusb_context *ctx, break; } + if (!hpriv || hpriv->fd != pollfd->fd) { + usbi_err(ctx, "cannot find handle for fd %d\n", + pollfd->fd); + continue; + } + if (pollfd->revents & POLLERR) { usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->fd); usbi_handle_disconnect(handle); + /* device will still be marked as attached if hotplug monitor thread + * hasn't processed remove event yet */ + usbi_mutex_static_lock(&linux_hotplug_lock); + if (handle->dev->attached) + linux_device_disconnected(handle->dev->bus_number, + handle->dev->device_address, NULL); + usbi_mutex_static_unlock(&linux_hotplug_lock); continue; } @@ -2543,6 +2667,9 @@ const struct usbi_os_backend linux_usbfs_backend = { .clear_halt = op_clear_halt, .reset_device = op_reset_device, + .alloc_streams = op_alloc_streams, + .free_streams = op_free_streams, + .kernel_driver_active = op_kernel_driver_active, .detach_kernel_driver = op_detach_kernel_driver, .attach_kernel_driver = op_attach_kernel_driver, diff --git a/Externals/libusbx/libusb/os/linux_usbfs.h b/Externals/libusb/libusb/os/linux_usbfs.h similarity index 91% rename from Externals/libusbx/libusb/os/linux_usbfs.h rename to Externals/libusb/libusb/os/linux_usbfs.h index 499bab78e8..f2404abf58 100644 --- a/Externals/libusbx/libusb/os/linux_usbfs.h +++ b/Externals/libusb/libusb/os/linux_usbfs.h @@ -94,7 +94,10 @@ struct usbfs_urb { int buffer_length; int actual_length; int start_frame; - int number_of_packets; + union { + int number_of_packets; /* Only used for isoc urbs */ + unsigned int stream_id; /* Only used with bulk streams */ + }; int error_count; unsigned int signr; void *usercontext; @@ -132,6 +135,12 @@ struct usbfs_disconnect_claim { char driver[USBFS_MAXDRIVERNAME + 1]; }; +struct usbfs_streams { + unsigned int num_streams; /* Not used by USBDEVFS_FREE_STREAMS */ + unsigned int num_eps; + unsigned char eps[0]; +}; + #define IOCTL_USBFS_CONTROL _IOWR('U', 0, struct usbfs_ctrltransfer) #define IOCTL_USBFS_BULK _IOWR('U', 2, struct usbfs_bulktransfer) #define IOCTL_USBFS_RESETEP _IOR('U', 3, unsigned int) @@ -155,6 +164,8 @@ struct usbfs_disconnect_claim { #define IOCTL_USBFS_RELEASE_PORT _IOR('U', 25, unsigned int) #define IOCTL_USBFS_GET_CAPABILITIES _IOR('U', 26, __u32) #define IOCTL_USBFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbfs_disconnect_claim) +#define IOCTL_USBFS_ALLOC_STREAMS _IOR('U', 28, struct usbfs_streams) +#define IOCTL_USBFS_FREE_STREAMS _IOR('U', 29, struct usbfs_streams) extern usbi_mutex_static_t linux_hotplug_lock; @@ -170,7 +181,7 @@ void linux_netlink_hotplug_poll(void); #endif void linux_hotplug_enumerate(uint8_t busnum, uint8_t devaddr, const char *sys_name); -void linux_hotplug_disconnected(uint8_t busnum, uint8_t devaddr, const char *sys_name); +void linux_device_disconnected(uint8_t busnum, uint8_t devaddr, const char *sys_name); int linux_get_device_address (struct libusb_context *ctx, int detached, uint8_t *busnum, uint8_t *devaddr, const char *dev_node, diff --git a/Externals/libusbx/libusb/os/openbsd_usb.c b/Externals/libusb/libusb/os/netbsd_usb.c similarity index 81% rename from Externals/libusbx/libusb/os/openbsd_usb.c rename to Externals/libusb/libusb/os/netbsd_usb.c index f4fd4543a6..ed4f50e6de 100644 --- a/Externals/libusbx/libusb/os/openbsd_usb.c +++ b/Externals/libusb/libusb/os/netbsd_usb.c @@ -47,36 +47,36 @@ struct handle_priv { /* * Backend functions */ -static int obsd_get_device_list(struct libusb_context *, +static int netbsd_get_device_list(struct libusb_context *, struct discovered_devs **); -static int obsd_open(struct libusb_device_handle *); -static void obsd_close(struct libusb_device_handle *); +static int netbsd_open(struct libusb_device_handle *); +static void netbsd_close(struct libusb_device_handle *); -static int obsd_get_device_descriptor(struct libusb_device *, unsigned char *, +static int netbsd_get_device_descriptor(struct libusb_device *, unsigned char *, int *); -static int obsd_get_active_config_descriptor(struct libusb_device *, +static int netbsd_get_active_config_descriptor(struct libusb_device *, unsigned char *, size_t, int *); -static int obsd_get_config_descriptor(struct libusb_device *, uint8_t, +static int netbsd_get_config_descriptor(struct libusb_device *, uint8_t, unsigned char *, size_t, int *); -static int obsd_get_configuration(struct libusb_device_handle *, int *); -static int obsd_set_configuration(struct libusb_device_handle *, int); +static int netbsd_get_configuration(struct libusb_device_handle *, int *); +static int netbsd_set_configuration(struct libusb_device_handle *, int); -static int obsd_claim_interface(struct libusb_device_handle *, int); -static int obsd_release_interface(struct libusb_device_handle *, int); +static int netbsd_claim_interface(struct libusb_device_handle *, int); +static int netbsd_release_interface(struct libusb_device_handle *, int); -static int obsd_set_interface_altsetting(struct libusb_device_handle *, int, +static int netbsd_set_interface_altsetting(struct libusb_device_handle *, int, int); -static int obsd_clear_halt(struct libusb_device_handle *, unsigned char); -static int obsd_reset_device(struct libusb_device_handle *); -static void obsd_destroy_device(struct libusb_device *); +static int netbsd_clear_halt(struct libusb_device_handle *, unsigned char); +static int netbsd_reset_device(struct libusb_device_handle *); +static void netbsd_destroy_device(struct libusb_device *); -static int obsd_submit_transfer(struct usbi_transfer *); -static int obsd_cancel_transfer(struct usbi_transfer *); -static void obsd_clear_transfer_priv(struct usbi_transfer *); -static int obsd_handle_events(struct libusb_context *ctx, struct pollfd *, +static int netbsd_submit_transfer(struct usbi_transfer *); +static int netbsd_cancel_transfer(struct usbi_transfer *); +static void netbsd_clear_transfer_priv(struct usbi_transfer *); +static int netbsd_handle_events(struct libusb_context *ctx, struct pollfd *, nfds_t, int); -static int obsd_clock_gettime(int, struct timespec *); +static int netbsd_clock_gettime(int, struct timespec *); /* * Private functions @@ -87,44 +87,47 @@ static int _sync_control_transfer(struct usbi_transfer *); static int _sync_gen_transfer(struct usbi_transfer *); static int _access_endpoint(struct libusb_transfer *); -const struct usbi_os_backend openbsd_backend = { - "Synchronous OpenBSD backend", +const struct usbi_os_backend netbsd_backend = { + "Synchronous NetBSD backend", 0, NULL, /* init() */ NULL, /* exit() */ - obsd_get_device_list, + netbsd_get_device_list, NULL, /* hotplug_poll */ - obsd_open, - obsd_close, + netbsd_open, + netbsd_close, - obsd_get_device_descriptor, - obsd_get_active_config_descriptor, - obsd_get_config_descriptor, + netbsd_get_device_descriptor, + netbsd_get_active_config_descriptor, + netbsd_get_config_descriptor, NULL, /* get_config_descriptor_by_value() */ - obsd_get_configuration, - obsd_set_configuration, + netbsd_get_configuration, + netbsd_set_configuration, - obsd_claim_interface, - obsd_release_interface, + netbsd_claim_interface, + netbsd_release_interface, - obsd_set_interface_altsetting, - obsd_clear_halt, - obsd_reset_device, + netbsd_set_interface_altsetting, + netbsd_clear_halt, + netbsd_reset_device, + + NULL, /* alloc_streams */ + NULL, /* free_streams */ NULL, /* kernel_driver_active() */ NULL, /* detach_kernel_driver() */ NULL, /* attach_kernel_driver() */ - obsd_destroy_device, + netbsd_destroy_device, - obsd_submit_transfer, - obsd_cancel_transfer, - obsd_clear_transfer_priv, + netbsd_submit_transfer, + netbsd_cancel_transfer, + netbsd_clear_transfer_priv, - obsd_handle_events, + netbsd_handle_events, - obsd_clock_gettime, + netbsd_clock_gettime, sizeof(struct device_priv), sizeof(struct handle_priv), 0, /* transfer_priv_size */ @@ -132,7 +135,7 @@ const struct usbi_os_backend openbsd_backend = { }; int -obsd_get_device_list(struct libusb_context * ctx, +netbsd_get_device_list(struct libusb_context * ctx, struct discovered_devs **discdevs) { struct libusb_device *dev; @@ -161,9 +164,7 @@ obsd_get_device_list(struct libusb_context * ctx, session_id = (di.udi_bus << 8 | di.udi_addr); dev = usbi_get_device_by_session_id(ctx, session_id); - if (dev) { - dev = libusb_ref_device(dev); - } else { + if (dev == NULL) { dev = usbi_alloc_device(ctx, session_id); if (dev == NULL) return (LIBUSB_ERROR_NO_MEM); @@ -207,7 +208,7 @@ error: } int -obsd_open(struct libusb_device_handle *handle) +netbsd_open(struct libusb_device_handle *handle) { struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv; struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; @@ -228,7 +229,7 @@ obsd_open(struct libusb_device_handle *handle) } void -obsd_close(struct libusb_device_handle *handle) +netbsd_close(struct libusb_device_handle *handle) { struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv; struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; @@ -245,7 +246,7 @@ obsd_close(struct libusb_device_handle *handle) } int -obsd_get_device_descriptor(struct libusb_device *dev, unsigned char *buf, +netbsd_get_device_descriptor(struct libusb_device *dev, unsigned char *buf, int *host_endian) { struct device_priv *dpriv = (struct device_priv *)dev->os_priv; @@ -260,7 +261,7 @@ obsd_get_device_descriptor(struct libusb_device *dev, unsigned char *buf, } int -obsd_get_active_config_descriptor(struct libusb_device *dev, +netbsd_get_active_config_descriptor(struct libusb_device *dev, unsigned char *buf, size_t len, int *host_endian) { struct device_priv *dpriv = (struct device_priv *)dev->os_priv; @@ -279,7 +280,7 @@ obsd_get_active_config_descriptor(struct libusb_device *dev, } int -obsd_get_config_descriptor(struct libusb_device *dev, uint8_t idx, +netbsd_get_config_descriptor(struct libusb_device *dev, uint8_t idx, unsigned char *buf, size_t len, int *host_endian) { struct device_priv *dpriv = (struct device_priv *)dev->os_priv; @@ -317,7 +318,7 @@ obsd_get_config_descriptor(struct libusb_device *dev, uint8_t idx, } int -obsd_get_configuration(struct libusb_device_handle *handle, int *config) +netbsd_get_configuration(struct libusb_device_handle *handle, int *config) { struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; @@ -332,7 +333,7 @@ obsd_get_configuration(struct libusb_device_handle *handle, int *config) } int -obsd_set_configuration(struct libusb_device_handle *handle, int config) +netbsd_set_configuration(struct libusb_device_handle *handle, int config) { struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; @@ -345,7 +346,7 @@ obsd_set_configuration(struct libusb_device_handle *handle, int config) } int -obsd_claim_interface(struct libusb_device_handle *handle, int iface) +netbsd_claim_interface(struct libusb_device_handle *handle, int iface) { struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv; int i; @@ -357,7 +358,7 @@ obsd_claim_interface(struct libusb_device_handle *handle, int iface) } int -obsd_release_interface(struct libusb_device_handle *handle, int iface) +netbsd_release_interface(struct libusb_device_handle *handle, int iface) { struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv; int i; @@ -370,7 +371,7 @@ obsd_release_interface(struct libusb_device_handle *handle, int iface) } int -obsd_set_interface_altsetting(struct libusb_device_handle *handle, int iface, +netbsd_set_interface_altsetting(struct libusb_device_handle *handle, int iface, int altsetting) { struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; @@ -390,7 +391,7 @@ obsd_set_interface_altsetting(struct libusb_device_handle *handle, int iface, } int -obsd_clear_halt(struct libusb_device_handle *handle, unsigned char endpoint) +netbsd_clear_halt(struct libusb_device_handle *handle, unsigned char endpoint) { struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; struct usb_ctl_request req; @@ -410,7 +411,7 @@ obsd_clear_halt(struct libusb_device_handle *handle, unsigned char endpoint) } int -obsd_reset_device(struct libusb_device_handle *handle) +netbsd_reset_device(struct libusb_device_handle *handle) { usbi_dbg(""); @@ -418,7 +419,7 @@ obsd_reset_device(struct libusb_device_handle *handle) } void -obsd_destroy_device(struct libusb_device *dev) +netbsd_destroy_device(struct libusb_device *dev) { struct device_priv *dpriv = (struct device_priv *)dev->os_priv; @@ -428,7 +429,7 @@ obsd_destroy_device(struct libusb_device *dev) } int -obsd_submit_transfer(struct usbi_transfer *itransfer) +netbsd_submit_transfer(struct usbi_transfer *itransfer) { struct libusb_transfer *transfer; struct handle_priv *hpriv; @@ -460,6 +461,9 @@ obsd_submit_transfer(struct usbi_transfer *itransfer) } err = _sync_gen_transfer(itransfer); break; + case LIBUSB_TRANSFER_TYPE_BULK_STREAM: + err = LIBUSB_ERROR_NOT_SUPPORTED; + break; } if (err) @@ -472,7 +476,7 @@ obsd_submit_transfer(struct usbi_transfer *itransfer) } int -obsd_cancel_transfer(struct usbi_transfer *itransfer) +netbsd_cancel_transfer(struct usbi_transfer *itransfer) { usbi_dbg(""); @@ -480,7 +484,7 @@ obsd_cancel_transfer(struct usbi_transfer *itransfer) } void -obsd_clear_transfer_priv(struct usbi_transfer *itransfer) +netbsd_clear_transfer_priv(struct usbi_transfer *itransfer) { usbi_dbg(""); @@ -488,7 +492,7 @@ obsd_clear_transfer_priv(struct usbi_transfer *itransfer) } int -obsd_handle_events(struct libusb_context *ctx, struct pollfd *fds, nfds_t nfds, +netbsd_handle_events(struct libusb_context *ctx, struct pollfd *fds, nfds_t nfds, int num_ready) { struct libusb_device_handle *handle; @@ -548,7 +552,7 @@ obsd_handle_events(struct libusb_context *ctx, struct pollfd *fds, nfds_t nfds, } int -obsd_clock_gettime(int clkid, struct timespec *tp) +netbsd_clock_gettime(int clkid, struct timespec *tp) { usbi_dbg("clock %d", clkid); @@ -641,7 +645,7 @@ _sync_control_transfer(struct usbi_transfer *itransfer) req.ucr_request.bmRequestType = setup->bmRequestType; req.ucr_request.bRequest = setup->bRequest; - /* Don't use USETW, libusbx already deals with the endianness */ + /* Don't use USETW, libusb already deals with the endianness */ (*(uint16_t *)req.ucr_request.wValue) = setup->wValue; (*(uint16_t *)req.ucr_request.wIndex) = setup->wIndex; (*(uint16_t *)req.ucr_request.wLength) = setup->wLength; diff --git a/Externals/libusb/libusb/os/openbsd_usb.c b/Externals/libusb/libusb/os/openbsd_usb.c new file mode 100644 index 0000000000..ff470bead5 --- /dev/null +++ b/Externals/libusb/libusb/os/openbsd_usb.c @@ -0,0 +1,832 @@ +/* + * Copyright © 2011-2013 Martin Pieuchot + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "libusb.h" +#include "libusbi.h" + +struct device_priv { + char *devname; /* name of the ugen(4) node */ + int fd; /* device file descriptor */ + + unsigned char *cdesc; /* active config descriptor */ + usb_device_descriptor_t ddesc; /* usb device descriptor */ +}; + +struct handle_priv { + int pipe[2]; /* for event notification */ + int endpoints[USB_MAX_ENDPOINTS]; +}; + +/* + * Backend functions + */ +static int obsd_get_device_list(struct libusb_context *, + struct discovered_devs **); +static int obsd_open(struct libusb_device_handle *); +static void obsd_close(struct libusb_device_handle *); + +static int obsd_get_device_descriptor(struct libusb_device *, unsigned char *, + int *); +static int obsd_get_active_config_descriptor(struct libusb_device *, + unsigned char *, size_t, int *); +static int obsd_get_config_descriptor(struct libusb_device *, uint8_t, + unsigned char *, size_t, int *); + +static int obsd_get_configuration(struct libusb_device_handle *, int *); +static int obsd_set_configuration(struct libusb_device_handle *, int); + +static int obsd_claim_interface(struct libusb_device_handle *, int); +static int obsd_release_interface(struct libusb_device_handle *, int); + +static int obsd_set_interface_altsetting(struct libusb_device_handle *, int, + int); +static int obsd_clear_halt(struct libusb_device_handle *, unsigned char); +static int obsd_reset_device(struct libusb_device_handle *); +static void obsd_destroy_device(struct libusb_device *); + +static int obsd_submit_transfer(struct usbi_transfer *); +static int obsd_cancel_transfer(struct usbi_transfer *); +static void obsd_clear_transfer_priv(struct usbi_transfer *); +static int obsd_handle_events(struct libusb_context *ctx, struct pollfd *, + nfds_t, int); +static int obsd_clock_gettime(int, struct timespec *); + +/* + * Private functions + */ +static int _errno_to_libusb(int); +static int _cache_active_config_descriptor(struct libusb_device *); +static int _sync_control_transfer(struct usbi_transfer *); +static int _sync_gen_transfer(struct usbi_transfer *); +static int _access_endpoint(struct libusb_transfer *); + +static int _bus_open(int); + + +const struct usbi_os_backend openbsd_backend = { + "Synchronous OpenBSD backend", + 0, + NULL, /* init() */ + NULL, /* exit() */ + obsd_get_device_list, + NULL, /* hotplug_poll */ + obsd_open, + obsd_close, + + obsd_get_device_descriptor, + obsd_get_active_config_descriptor, + obsd_get_config_descriptor, + NULL, /* get_config_descriptor_by_value() */ + + obsd_get_configuration, + obsd_set_configuration, + + obsd_claim_interface, + obsd_release_interface, + + obsd_set_interface_altsetting, + obsd_clear_halt, + obsd_reset_device, + + NULL, /* alloc_streams */ + NULL, /* free_streams */ + + NULL, /* kernel_driver_active() */ + NULL, /* detach_kernel_driver() */ + NULL, /* attach_kernel_driver() */ + + obsd_destroy_device, + + obsd_submit_transfer, + obsd_cancel_transfer, + obsd_clear_transfer_priv, + + obsd_handle_events, + + obsd_clock_gettime, + sizeof(struct device_priv), + sizeof(struct handle_priv), + 0, /* transfer_priv_size */ + 0, /* add_iso_packet_size */ +}; + +#define DEVPATH "/dev/" +#define USBDEV DEVPATH "usb" + +int +obsd_get_device_list(struct libusb_context * ctx, + struct discovered_devs **discdevs) +{ + struct discovered_devs *ddd; + struct libusb_device *dev; + struct device_priv *dpriv; + struct usb_device_info di; + struct usb_device_ddesc dd; + unsigned long session_id; + char devices[USB_MAX_DEVICES]; + char busnode[16]; + char *udevname; + int fd, addr, i, j; + + usbi_dbg(""); + + for (i = 0; i < 8; i++) { + snprintf(busnode, sizeof(busnode), USBDEV "%d", i); + + if ((fd = open(busnode, O_RDWR)) < 0) { + if (errno != ENOENT && errno != ENXIO) + usbi_err(ctx, "could not open %s", busnode); + continue; + } + + bzero(devices, sizeof(devices)); + for (addr = 1; addr < USB_MAX_DEVICES; addr++) { + if (devices[addr]) + continue; + + di.udi_addr = addr; + if (ioctl(fd, USB_DEVICEINFO, &di) < 0) + continue; + + /* + * XXX If ugen(4) is attached to the USB device + * it will be used. + */ + udevname = NULL; + for (j = 0; j < USB_MAX_DEVNAMES; j++) + if (!strncmp("ugen", di.udi_devnames[j], 4)) { + udevname = strdup(di.udi_devnames[j]); + break; + } + + session_id = (di.udi_bus << 8 | di.udi_addr); + dev = usbi_get_device_by_session_id(ctx, session_id); + + if (dev == NULL) { + dev = usbi_alloc_device(ctx, session_id); + if (dev == NULL) { + close(fd); + return (LIBUSB_ERROR_NO_MEM); + } + + dev->bus_number = di.udi_bus; + dev->device_address = di.udi_addr; + dev->speed = di.udi_speed; + + dpriv = (struct device_priv *)dev->os_priv; + dpriv->fd = -1; + dpriv->cdesc = NULL; + dpriv->devname = udevname; + + dd.udd_bus = di.udi_bus; + dd.udd_addr = di.udi_addr; + if (ioctl(fd, USB_DEVICE_GET_DDESC, &dd) < 0) { + libusb_unref_device(dev); + continue; + } + dpriv->ddesc = dd.udd_desc; + + if (_cache_active_config_descriptor(dev)) { + libusb_unref_device(dev); + continue; + } + + if (usbi_sanitize_device(dev)) { + libusb_unref_device(dev); + continue; + } + } + + ddd = discovered_devs_append(*discdevs, dev); + if (ddd == NULL) { + close(fd); + return (LIBUSB_ERROR_NO_MEM); + } + libusb_unref_device(dev); + + *discdevs = ddd; + devices[addr] = 1; + } + + close(fd); + } + + return (LIBUSB_SUCCESS); +} + +int +obsd_open(struct libusb_device_handle *handle) +{ + struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv; + struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; + char devnode[16]; + + if (dpriv->devname) { + /* + * Only open ugen(4) attached devices read-write, all + * read-only operations are done through the bus node. + */ + snprintf(devnode, sizeof(devnode), DEVPATH "%s.00", + dpriv->devname); + dpriv->fd = open(devnode, O_RDWR); + if (dpriv->fd < 0) + return _errno_to_libusb(errno); + + usbi_dbg("open %s: fd %d", devnode, dpriv->fd); + } + + if (pipe(hpriv->pipe) < 0) + return _errno_to_libusb(errno); + + return usbi_add_pollfd(HANDLE_CTX(handle), hpriv->pipe[0], POLLIN); +} + +void +obsd_close(struct libusb_device_handle *handle) +{ + struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv; + struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; + + if (dpriv->devname) { + usbi_dbg("close: fd %d", dpriv->fd); + + close(dpriv->fd); + dpriv->fd = -1; + } + + usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->pipe[0]); + + close(hpriv->pipe[0]); + close(hpriv->pipe[1]); +} + +int +obsd_get_device_descriptor(struct libusb_device *dev, unsigned char *buf, + int *host_endian) +{ + struct device_priv *dpriv = (struct device_priv *)dev->os_priv; + + usbi_dbg(""); + + memcpy(buf, &dpriv->ddesc, DEVICE_DESC_LENGTH); + + *host_endian = 0; + + return (LIBUSB_SUCCESS); +} + +int +obsd_get_active_config_descriptor(struct libusb_device *dev, + unsigned char *buf, size_t len, int *host_endian) +{ + struct device_priv *dpriv = (struct device_priv *)dev->os_priv; + usb_config_descriptor_t *ucd = (usb_config_descriptor_t *)dpriv->cdesc; + + len = MIN(len, UGETW(ucd->wTotalLength)); + + usbi_dbg("len %d", len); + + memcpy(buf, dpriv->cdesc, len); + + *host_endian = 0; + + return (len); +} + +int +obsd_get_config_descriptor(struct libusb_device *dev, uint8_t idx, + unsigned char *buf, size_t len, int *host_endian) +{ + struct usb_device_fdesc udf; + int fd, err; + + if ((fd = _bus_open(dev->bus_number)) < 0) + return _errno_to_libusb(errno); + + udf.udf_bus = dev->bus_number; + udf.udf_addr = dev->device_address; + udf.udf_config_index = idx; + udf.udf_size = len; + udf.udf_data = buf; + + usbi_dbg("index %d, len %d", udf.udf_config_index, len); + + if (ioctl(fd, USB_DEVICE_GET_FDESC, &udf) < 0) { + err = errno; + close(fd); + return _errno_to_libusb(err); + } + close(fd); + + *host_endian = 0; + + return (len); +} + +int +obsd_get_configuration(struct libusb_device_handle *handle, int *config) +{ + struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; + usb_config_descriptor_t *ucd = (usb_config_descriptor_t *)dpriv->cdesc; + + *config = ucd->bConfigurationValue; + + usbi_dbg("bConfigurationValue %d", *config); + + return (LIBUSB_SUCCESS); +} + +int +obsd_set_configuration(struct libusb_device_handle *handle, int config) +{ + struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; + + if (dpriv->devname == NULL) + return (LIBUSB_ERROR_NOT_SUPPORTED); + + usbi_dbg("bConfigurationValue %d", config); + + if (ioctl(dpriv->fd, USB_SET_CONFIG, &config) < 0) + return _errno_to_libusb(errno); + + return _cache_active_config_descriptor(handle->dev); +} + +int +obsd_claim_interface(struct libusb_device_handle *handle, int iface) +{ + struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv; + int i; + + for (i = 0; i < USB_MAX_ENDPOINTS; i++) + hpriv->endpoints[i] = -1; + + return (LIBUSB_SUCCESS); +} + +int +obsd_release_interface(struct libusb_device_handle *handle, int iface) +{ + struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv; + int i; + + for (i = 0; i < USB_MAX_ENDPOINTS; i++) + if (hpriv->endpoints[i] >= 0) + close(hpriv->endpoints[i]); + + return (LIBUSB_SUCCESS); +} + +int +obsd_set_interface_altsetting(struct libusb_device_handle *handle, int iface, + int altsetting) +{ + struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; + struct usb_alt_interface intf; + + if (dpriv->devname == NULL) + return (LIBUSB_ERROR_NOT_SUPPORTED); + + usbi_dbg("iface %d, setting %d", iface, altsetting); + + memset(&intf, 0, sizeof(intf)); + + intf.uai_interface_index = iface; + intf.uai_alt_no = altsetting; + + if (ioctl(dpriv->fd, USB_SET_ALTINTERFACE, &intf) < 0) + return _errno_to_libusb(errno); + + return (LIBUSB_SUCCESS); +} + +int +obsd_clear_halt(struct libusb_device_handle *handle, unsigned char endpoint) +{ + struct usb_ctl_request req; + int fd, err; + + if ((fd = _bus_open(handle->dev->bus_number)) < 0) + return _errno_to_libusb(errno); + + usbi_dbg(""); + + req.ucr_addr = handle->dev->device_address; + req.ucr_request.bmRequestType = UT_WRITE_ENDPOINT; + req.ucr_request.bRequest = UR_CLEAR_FEATURE; + USETW(req.ucr_request.wValue, UF_ENDPOINT_HALT); + USETW(req.ucr_request.wIndex, endpoint); + USETW(req.ucr_request.wLength, 0); + + if (ioctl(fd, USB_REQUEST, &req) < 0) { + err = errno; + close(fd); + return _errno_to_libusb(err); + } + close(fd); + + return (LIBUSB_SUCCESS); +} + +int +obsd_reset_device(struct libusb_device_handle *handle) +{ + usbi_dbg(""); + + return (LIBUSB_ERROR_NOT_SUPPORTED); +} + +void +obsd_destroy_device(struct libusb_device *dev) +{ + struct device_priv *dpriv = (struct device_priv *)dev->os_priv; + + usbi_dbg(""); + + free(dpriv->cdesc); + free(dpriv->devname); +} + +int +obsd_submit_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer; + struct handle_priv *hpriv; + int err = 0; + + usbi_dbg(""); + + transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + hpriv = (struct handle_priv *)transfer->dev_handle->os_priv; + + switch (transfer->type) { + case LIBUSB_TRANSFER_TYPE_CONTROL: + err = _sync_control_transfer(itransfer); + break; + case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: + if (IS_XFEROUT(transfer)) { + /* Isochronous write is not supported */ + err = LIBUSB_ERROR_NOT_SUPPORTED; + break; + } + err = _sync_gen_transfer(itransfer); + break; + case LIBUSB_TRANSFER_TYPE_BULK: + case LIBUSB_TRANSFER_TYPE_INTERRUPT: + if (IS_XFEROUT(transfer) && + transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) { + err = LIBUSB_ERROR_NOT_SUPPORTED; + break; + } + err = _sync_gen_transfer(itransfer); + break; + case LIBUSB_TRANSFER_TYPE_BULK_STREAM: + err = LIBUSB_ERROR_NOT_SUPPORTED; + break; + } + + if (err) + return (err); + + if (write(hpriv->pipe[1], &itransfer, sizeof(itransfer)) < 0) + return _errno_to_libusb(errno); + + return (LIBUSB_SUCCESS); +} + +int +obsd_cancel_transfer(struct usbi_transfer *itransfer) +{ + usbi_dbg(""); + + return (LIBUSB_ERROR_NOT_SUPPORTED); +} + +void +obsd_clear_transfer_priv(struct usbi_transfer *itransfer) +{ + usbi_dbg(""); + + /* Nothing to do */ +} + +int +obsd_handle_events(struct libusb_context *ctx, struct pollfd *fds, nfds_t nfds, + int num_ready) +{ + struct libusb_device_handle *handle; + struct handle_priv *hpriv = NULL; + struct usbi_transfer *itransfer; + struct pollfd *pollfd; + int i, err = 0; + + usbi_dbg(""); + + pthread_mutex_lock(&ctx->open_devs_lock); + for (i = 0; i < nfds && num_ready > 0; i++) { + pollfd = &fds[i]; + + if (!pollfd->revents) + continue; + + hpriv = NULL; + num_ready--; + list_for_each_entry(handle, &ctx->open_devs, list, + struct libusb_device_handle) { + hpriv = (struct handle_priv *)handle->os_priv; + + if (hpriv->pipe[0] == pollfd->fd) + break; + + hpriv = NULL; + } + + if (NULL == hpriv) { + usbi_dbg("fd %d is not an event pipe!", pollfd->fd); + err = ENOENT; + break; + } + + if (pollfd->revents & POLLERR) { + usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->pipe[0]); + usbi_handle_disconnect(handle); + continue; + } + + if (read(hpriv->pipe[0], &itransfer, sizeof(itransfer)) < 0) { + err = errno; + break; + } + + if ((err = usbi_handle_transfer_completion(itransfer, + LIBUSB_TRANSFER_COMPLETED))) + break; + } + pthread_mutex_unlock(&ctx->open_devs_lock); + + if (err) + return _errno_to_libusb(err); + + return (LIBUSB_SUCCESS); +} + +int +obsd_clock_gettime(int clkid, struct timespec *tp) +{ + usbi_dbg("clock %d", clkid); + + if (clkid == USBI_CLOCK_REALTIME) + return clock_gettime(CLOCK_REALTIME, tp); + + if (clkid == USBI_CLOCK_MONOTONIC) + return clock_gettime(CLOCK_MONOTONIC, tp); + + return (LIBUSB_ERROR_INVALID_PARAM); +} + +int +_errno_to_libusb(int err) +{ + usbi_dbg("error: %s (%d)", strerror(err), err); + + switch (err) { + case EIO: + return (LIBUSB_ERROR_IO); + case EACCES: + return (LIBUSB_ERROR_ACCESS); + case ENOENT: + return (LIBUSB_ERROR_NO_DEVICE); + case ENOMEM: + return (LIBUSB_ERROR_NO_MEM); + case ETIMEDOUT: + return (LIBUSB_ERROR_TIMEOUT); + } + + return (LIBUSB_ERROR_OTHER); +} + +int +_cache_active_config_descriptor(struct libusb_device *dev) +{ + struct device_priv *dpriv = (struct device_priv *)dev->os_priv; + struct usb_device_cdesc udc; + struct usb_device_fdesc udf; + unsigned char* buf; + int fd, len, err; + + if ((fd = _bus_open(dev->bus_number)) < 0) + return _errno_to_libusb(errno); + + usbi_dbg("fd %d, addr %d", fd, dev->device_address); + + udc.udc_bus = dev->bus_number; + udc.udc_addr = dev->device_address; + udc.udc_config_index = USB_CURRENT_CONFIG_INDEX; + if (ioctl(fd, USB_DEVICE_GET_CDESC, &udc) < 0) { + err = errno; + close(fd); + return _errno_to_libusb(errno); + } + + usbi_dbg("active bLength %d", udc.udc_desc.bLength); + + len = UGETW(udc.udc_desc.wTotalLength); + buf = malloc(len); + if (buf == NULL) + return (LIBUSB_ERROR_NO_MEM); + + udf.udf_bus = dev->bus_number; + udf.udf_addr = dev->device_address; + udf.udf_config_index = udc.udc_config_index; + udf.udf_size = len; + udf.udf_data = buf; + + usbi_dbg("index %d, len %d", udf.udf_config_index, len); + + if (ioctl(fd, USB_DEVICE_GET_FDESC, &udf) < 0) { + err = errno; + close(fd); + free(buf); + return _errno_to_libusb(err); + } + close(fd); + + if (dpriv->cdesc) + free(dpriv->cdesc); + dpriv->cdesc = buf; + + return (LIBUSB_SUCCESS); +} + +int +_sync_control_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer; + struct libusb_control_setup *setup; + struct device_priv *dpriv; + struct usb_ctl_request req; + + transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + dpriv = (struct device_priv *)transfer->dev_handle->dev->os_priv; + setup = (struct libusb_control_setup *)transfer->buffer; + + usbi_dbg("type %x request %x value %x index %d length %d timeout %d", + setup->bmRequestType, setup->bRequest, + libusb_le16_to_cpu(setup->wValue), + libusb_le16_to_cpu(setup->wIndex), + libusb_le16_to_cpu(setup->wLength), transfer->timeout); + + req.ucr_addr = transfer->dev_handle->dev->device_address; + req.ucr_request.bmRequestType = setup->bmRequestType; + req.ucr_request.bRequest = setup->bRequest; + /* Don't use USETW, libusb already deals with the endianness */ + (*(uint16_t *)req.ucr_request.wValue) = setup->wValue; + (*(uint16_t *)req.ucr_request.wIndex) = setup->wIndex; + (*(uint16_t *)req.ucr_request.wLength) = setup->wLength; + req.ucr_data = transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE; + + if ((transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) == 0) + req.ucr_flags = USBD_SHORT_XFER_OK; + + if (dpriv->devname == NULL) { + /* + * XXX If the device is not attached to ugen(4) it is + * XXX still possible to submit a control transfer but + * XXX with the default timeout only. + */ + int fd, err; + + if ((fd = _bus_open(transfer->dev_handle->dev->bus_number)) < 0) + return _errno_to_libusb(errno); + + if ((ioctl(fd, USB_REQUEST, &req)) < 0) { + err = errno; + close(fd); + return _errno_to_libusb(err); + } + close(fd); + } else { + if ((ioctl(dpriv->fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0) + return _errno_to_libusb(errno); + + if ((ioctl(dpriv->fd, USB_DO_REQUEST, &req)) < 0) + return _errno_to_libusb(errno); + } + + itransfer->transferred = req.ucr_actlen; + + usbi_dbg("transferred %d", itransfer->transferred); + + return (0); +} + +int +_access_endpoint(struct libusb_transfer *transfer) +{ + struct handle_priv *hpriv; + struct device_priv *dpriv; + char devnode[16]; + int fd, endpt; + mode_t mode; + + hpriv = (struct handle_priv *)transfer->dev_handle->os_priv; + dpriv = (struct device_priv *)transfer->dev_handle->dev->os_priv; + + endpt = UE_GET_ADDR(transfer->endpoint); + mode = IS_XFERIN(transfer) ? O_RDONLY : O_WRONLY; + + usbi_dbg("endpoint %d mode %d", endpt, mode); + + if (hpriv->endpoints[endpt] < 0) { + /* Pick the right endpoint node */ + snprintf(devnode, sizeof(devnode), DEVPATH "%s.%02d", + dpriv->devname, endpt); + + /* We may need to read/write to the same endpoint later. */ + if (((fd = open(devnode, O_RDWR)) < 0) && (errno == ENXIO)) + if ((fd = open(devnode, mode)) < 0) + return (-1); + + hpriv->endpoints[endpt] = fd; + } + + return (hpriv->endpoints[endpt]); +} + +int +_sync_gen_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer; + struct device_priv *dpriv; + int fd, nr = 1; + + transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + dpriv = (struct device_priv *)transfer->dev_handle->dev->os_priv; + + if (dpriv->devname == NULL) + return (LIBUSB_ERROR_NOT_SUPPORTED); + + /* + * Bulk, Interrupt or Isochronous transfer depends on the + * endpoint and thus the node to open. + */ + if ((fd = _access_endpoint(transfer)) < 0) + return _errno_to_libusb(errno); + + if ((ioctl(fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0) + return _errno_to_libusb(errno); + + if (IS_XFERIN(transfer)) { + if ((transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) == 0) + if ((ioctl(fd, USB_SET_SHORT_XFER, &nr)) < 0) + return _errno_to_libusb(errno); + + nr = read(fd, transfer->buffer, transfer->length); + } else { + nr = write(fd, transfer->buffer, transfer->length); + } + + if (nr < 0) + return _errno_to_libusb(errno); + + itransfer->transferred = nr; + + return (0); +} + +int +_bus_open(int number) +{ + char busnode[16]; + + snprintf(busnode, sizeof(busnode), USBDEV "%d", number); + + return open(busnode, O_RDWR); +} diff --git a/Externals/libusbx/libusb/os/poll_posix.c b/Externals/libusb/libusb/os/poll_posix.c similarity index 100% rename from Externals/libusbx/libusb/os/poll_posix.c rename to Externals/libusb/libusb/os/poll_posix.c diff --git a/Externals/libusbx/libusb/os/poll_posix.h b/Externals/libusb/libusb/os/poll_posix.h similarity index 100% rename from Externals/libusbx/libusb/os/poll_posix.h rename to Externals/libusb/libusb/os/poll_posix.h diff --git a/Externals/libusbx/libusb/os/poll_windows.c b/Externals/libusb/libusb/os/poll_windows.c similarity index 99% rename from Externals/libusbx/libusb/os/poll_windows.c rename to Externals/libusb/libusb/os/poll_windows.c index 7ed19ba324..2a75c5e7e6 100644 --- a/Externals/libusbx/libusb/os/poll_windows.c +++ b/Externals/libusb/libusb/os/poll_windows.c @@ -22,7 +22,7 @@ */ /* - * poll() and pipe() Windows compatibility layer for libusbx 1.0 + * poll() and pipe() Windows compatibility layer for libusb 1.0 * * The way this layer works is by using OVERLAPPED with async I/O transfers, as * OVERLAPPED have an associated event which is flagged for I/O completion. @@ -252,7 +252,7 @@ void exit_polling(void) /* * Create a fake pipe. - * As libusbx only uses pipes for signaling, all we need from a pipe is an + * As libusb only uses pipes for signaling, all we need from a pipe is an * event. To that extent, we create a single wfd and overlapped as a means * to access that event. */ @@ -428,7 +428,7 @@ struct winfd fd_to_winfd(int fd) CHECK_INIT_POLLING; - if (fd <= 0) + if (fd < 0) return INVALID_WINFD; for (i=0; i * Copyright © 2011 Peter Stuge @@ -63,7 +63,9 @@ finish: int usbi_get_tid(void) { int ret = -1; -#if defined(__linux__) +#if defined(__ANDROID__) + ret = gettid(); +#elif defined(__linux__) ret = syscall(SYS_gettid); #elif defined(__OpenBSD__) /* The following only works with OpenBSD > 5.1 as it requires diff --git a/Externals/libusbx/libusb/os/threads_posix.h b/Externals/libusb/libusb/os/threads_posix.h similarity index 97% rename from Externals/libusbx/libusb/os/threads_posix.h rename to Externals/libusb/libusb/os/threads_posix.h index 0b6a71a552..d7a5d215fe 100644 --- a/Externals/libusbx/libusb/os/threads_posix.h +++ b/Externals/libusb/libusb/os/threads_posix.h @@ -1,5 +1,5 @@ /* - * libusbx synchronization using POSIX Threads + * libusb synchronization using POSIX Threads * * Copyright © 2010 Peter Stuge * diff --git a/Externals/libusbx/libusb/os/threads_windows.c b/Externals/libusb/libusb/os/threads_windows.c similarity index 99% rename from Externals/libusbx/libusb/os/threads_windows.c rename to Externals/libusb/libusb/os/threads_windows.c index cad27e9ea0..ac12738c7c 100644 --- a/Externals/libusbx/libusb/os/threads_windows.c +++ b/Externals/libusb/libusb/os/threads_windows.c @@ -1,5 +1,5 @@ /* - * libusbx synchronization on Microsoft Windows + * libusb synchronization on Microsoft Windows * * Copyright © 2010 Michael Plante * diff --git a/Externals/libusbx/libusb/os/threads_windows.h b/Externals/libusb/libusb/os/threads_windows.h similarity index 98% rename from Externals/libusbx/libusb/os/threads_windows.h rename to Externals/libusb/libusb/os/threads_windows.h index df8a0eeb03..2b829253b4 100644 --- a/Externals/libusbx/libusb/os/threads_windows.h +++ b/Externals/libusb/libusb/os/threads_windows.h @@ -1,5 +1,5 @@ /* - * libusbx synchronization on Microsoft Windows + * libusb synchronization on Microsoft Windows * * Copyright © 2010 Michael Plante * diff --git a/Externals/libusbx/libusb/os/wince_usb.c b/Externals/libusb/libusb/os/wince_usb.c similarity index 97% rename from Externals/libusbx/libusb/os/wince_usb.c rename to Externals/libusb/libusb/os/wince_usb.c index e4a66331e5..4d9b3ccc25 100644 --- a/Externals/libusbx/libusb/os/wince_usb.c +++ b/Externals/libusb/libusb/os/wince_usb.c @@ -1,5 +1,5 @@ /* - * Windows CE backend for libusbx 1.0 + * Windows CE backend for libusb 1.0 * Copyright © 2011-2013 RealVNC Ltd. * Large portions taken from Windows backend, which is * Copyright © 2009-2010 Pete Batard @@ -38,7 +38,7 @@ unsigned __stdcall wince_clock_gettime_threaded(void* param); uint64_t hires_frequency, hires_ticks_to_ps; int errno; const uint64_t epoch_time = UINT64_C(116444736000000000); // 1970.01.01 00:00:000 in MS Filetime -enum windows_version windows_version = WINDOWS_CE; +int windows_version = WINDOWS_CE; static int concurrent_usage = -1; // Timer thread // NB: index 0 is for monotonic and 1 is for the thread exit event @@ -234,6 +234,12 @@ static int wince_init(struct libusb_context *ctx) usbi_err(ctx, "Unable to create timer thread - aborting"); goto init_exit; } + + // Wait for timer thread to init before continuing. + if (WaitForSingleObject(timer_response, INFINITE) != WAIT_OBJECT_0) { + usbi_err(ctx, "Failed to wait for timer thread to become ready - aborting"); + goto init_exit; + } } // At this stage, either we went through full init successfully, or didn't need to r = LIBUSB_SUCCESS; @@ -366,7 +372,6 @@ static int wince_get_device_list( if (dev) { usbi_dbg("using existing device for %d/%d (session %ld)", bus_addr, dev_addr, session_id); - libusb_ref_device(dev); // Release just this element in the device list (as we already hold a // reference to it). UkwReleaseDeviceList(driver_handle, &devices[i], 1); @@ -684,6 +689,8 @@ static int wince_submit_transfer( return wince_submit_control_or_bulk_transfer(itransfer); case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: return wince_submit_iso_transfer(itransfer); + case LIBUSB_TRANSFER_TYPE_BULK_STREAM: + return LIBUSB_ERROR_NOT_SUPPORTED; default: usbi_err(TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type); return LIBUSB_ERROR_INVALID_PARAM; @@ -796,6 +803,8 @@ static void wince_handle_callback (struct usbi_transfer *itransfer, uint32_t io_ case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: wince_transfer_callback (itransfer, io_result, io_size); break; + case LIBUSB_TRANSFER_TYPE_BULK_STREAM: + return LIBUSB_ERROR_NOT_SUPPORTED; default: usbi_err(ITRANSFER_CTX(itransfer), "unknown endpoint type %d", transfer->type); } @@ -877,6 +886,11 @@ unsigned __stdcall wince_clock_gettime_threaded(void* param) usbi_dbg("hires timer available (Frequency: %"PRIu64" Hz)", hires_frequency); } + // Signal wince_init() that we're ready to service requests + if (ReleaseSemaphore(timer_response, 1, NULL) == 0) { + usbi_dbg("unable to release timer semaphore: %s", windows_error_str(0)); + } + // Main loop - wait for requests while (1) { timer_index = WaitForMultipleObjects(2, timer_request, FALSE, INFINITE) - WAIT_OBJECT_0; @@ -911,7 +925,7 @@ unsigned __stdcall wince_clock_gettime_threaded(void* param) nb_responses = InterlockedExchange((LONG*)&request_count[0], 0); if ( (nb_responses) && (ReleaseSemaphore(timer_response, nb_responses, NULL) == 0) ) { - usbi_dbg("unable to release timer semaphore %d: %s", windows_error_str(0)); + usbi_dbg("unable to release timer semaphore: %s", windows_error_str(0)); } continue; case 1: // time to quit @@ -995,6 +1009,9 @@ const struct usbi_os_backend wince_backend = { wince_clear_halt, wince_reset_device, + NULL, /* alloc_streams */ + NULL, /* free_streams */ + wince_kernel_driver_active, wince_detach_kernel_driver, wince_attach_kernel_driver, diff --git a/Externals/libusbx/libusb/os/wince_usb.h b/Externals/libusb/libusb/os/wince_usb.h similarity index 99% rename from Externals/libusbx/libusb/os/wince_usb.h rename to Externals/libusb/libusb/os/wince_usb.h index 3db9693a13..bc61b5c103 100644 --- a/Externals/libusbx/libusb/os/wince_usb.h +++ b/Externals/libusb/libusb/os/wince_usb.h @@ -1,5 +1,5 @@ /* - * Windows CE backend for libusbx 1.0 + * Windows CE backend for libusb 1.0 * Copyright © 2011-2013 RealVNC Ltd. * Portions taken from Windows backend, which is * Copyright © 2009-2010 Pete Batard @@ -36,7 +36,7 @@ // This backend dynamically loads ceusbkwrapper.dll and doesn't include // ceusbkwrapper.h directly to simplify the build process. The kernel // side wrapper driver is built using the platform image build tools, -// which makes it difficult to reference directly from the libusbx build +// which makes it difficult to reference directly from the libusb build // system. struct UKW_DEVICE_PRIV; typedef struct UKW_DEVICE_PRIV *UKW_DEVICE; diff --git a/Externals/libusbx/libusb/os/windows_common.h b/Externals/libusb/libusb/os/windows_common.h similarity index 99% rename from Externals/libusbx/libusb/os/windows_common.h rename to Externals/libusb/libusb/os/windows_common.h index 1da72bd9f8..fe95d79d2d 100644 --- a/Externals/libusbx/libusb/os/windows_common.h +++ b/Externals/libusb/libusb/os/windows_common.h @@ -1,5 +1,5 @@ /* - * Windows backend common header for libusbx 1.0 + * Windows backend common header for libusb 1.0 * * This file brings together header code common between * the desktop Windows and Windows CE backends. diff --git a/Externals/libusbx/libusb/os/windows_usb.c b/Externals/libusb/libusb/os/windows_usb.c similarity index 94% rename from Externals/libusbx/libusb/os/windows_usb.c rename to Externals/libusb/libusb/os/windows_usb.c index 63357b1a21..6c4297184c 100644 --- a/Externals/libusbx/libusb/os/windows_usb.c +++ b/Externals/libusb/libusb/os/windows_usb.c @@ -1,5 +1,5 @@ /* - * windows backend for libusbx 1.0 + * windows backend for libusb 1.0 * Copyright © 2009-2012 Pete Batard * With contributions from Michael Plante, Orin Eman et al. * Parts of this code adapted from libusb-win32-v1 by Stephan Meyer @@ -100,7 +100,8 @@ static int composite_copy_transfer_data(int sub_api, struct usbi_transfer *itran // Global variables uint64_t hires_frequency, hires_ticks_to_ps; const uint64_t epoch_time = UINT64_C(116444736000000000); // 1970.01.01 00:00:000 in MS Filetime -enum windows_version windows_version = WINDOWS_UNSUPPORTED; +int windows_version = WINDOWS_UNDEFINED; +static char windows_version_str[128] = "Windows Undefined"; // Concurrency static int concurrent_usage = -1; usbi_mutex_t autoclaim_lock; @@ -158,6 +159,20 @@ static char err_string[ERR_BUFFER_SIZE]; safe_sprintf(err_string, ERR_BUFFER_SIZE, "[%u] ", error_code); + // Translate codes returned by SetupAPI. The ones we are dealing with are either + // in 0x0000xxxx or 0xE000xxxx and can be distinguished from standard error codes. + // See http://msdn.microsoft.com/en-us/library/windows/hardware/ff545011.aspx + switch (error_code & 0xE0000000) { + case 0: + error_code = HRESULT_FROM_WIN32(error_code); // Still leaves ERROR_SUCCESS unmodified + break; + case 0xE0000000: + error_code = 0x80000000 | (FACILITY_SETUPAPI << 16) | (error_code & 0x0000FFFF); + break; + default: + break; + } + size = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error_code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &err_string[safe_strlen(err_string)], ERR_BUFFER_SIZE - (DWORD)safe_strlen(err_string), NULL); @@ -195,7 +210,7 @@ static char* sanitize_path(const char* path) size = safe_strlen(path)+1; root_size = sizeof(root_prefix)-1; - // Microsoft indiscriminatly uses '\\?\', '\\.\', '##?#" or "##.#" for root prefixes. + // Microsoft indiscriminately uses '\\?\', '\\.\', '##?#" or "##.#" for root prefixes. if (!((size > 3) && (((path[0] == '\\') && (path[1] == '\\') && (path[3] == '\\')) || ((path[0] == '#') && (path[1] == '#') && (path[3] == '#'))))) { add_root = root_size; @@ -207,7 +222,7 @@ static char* sanitize_path(const char* path) safe_strcpy(&ret_path[add_root], size-add_root, path); - // Ensure consistancy with root prefix + // Ensure consistency with root prefix for (j=0; j 6 || (vi.dwMajorVersion == 6 && vi.dwMinorVersion >= 2)) { + // Starting with Windows 8.1 Preview, GetVersionEx() does no longer report the actual OS version + // See: http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074.aspx + + major_equal = VerSetConditionMask(0, VER_MAJORVERSION, VER_EQUAL); + for (major = vi.dwMajorVersion; major <= 9; major++) { + memset(&vi2, 0, sizeof(vi2)); + vi2.dwOSVersionInfoSize = sizeof(vi2); vi2.dwMajorVersion = major; + if (!VerifyVersionInfoA(&vi2, VER_MAJORVERSION, major_equal)) + continue; + if (vi.dwMajorVersion < major) { + vi.dwMajorVersion = major; vi.dwMinorVersion = 0; + } + + minor_equal = VerSetConditionMask(0, VER_MINORVERSION, VER_EQUAL); + for (minor = vi.dwMinorVersion; minor <= 9; minor++) { + memset(&vi2, 0, sizeof(vi2)); vi2.dwOSVersionInfoSize = sizeof(vi2); + vi2.dwMinorVersion = minor; + if (!VerifyVersionInfoA(&vi2, VER_MINORVERSION, minor_equal)) + continue; + vi.dwMinorVersion = minor; + break; + } + + break; + } + } + + if (vi.dwMajorVersion <= 0xf && vi.dwMinorVersion <= 0xf) { + ws = (vi.wProductType <= VER_NT_WORKSTATION); + windows_version = vi.dwMajorVersion << 4 | vi.dwMinorVersion; + switch (windows_version) { + case 0x50: w = "2000"; + break; + case 0x51: w = "XP"; + break; + case 0x52: w = ("2003"); + break; + case 0x60: w = (ws?"Vista":"2008"); + break; + case 0x61: w = (ws?"7":"2008_R2"); + break; + case 0x62: w = (ws?"8":"2012"); + break; + case 0x63: w = (ws?"8.1":"2012_R2"); + break; + case 0x64: w = (ws?"8.2":"2012_R3"); + break; + default: + if (windows_version < 0x50) + windows_version = WINDOWS_UNSUPPORTED; + else + w = "9 or later"; + break; + } + } + } + + if (is_x64()) + w64 = "64-bit"; + + vptr = &windows_version_str[sizeof("Windows ") - 1]; + vlen = sizeof(windows_version_str) - sizeof("Windows ") - 1; + if (!w) + safe_sprintf(vptr, vlen, "%s %u.%u %s", (vi.dwPlatformId==VER_PLATFORM_WIN32_NT?"NT":"??"), + (unsigned)vi.dwMajorVersion, (unsigned)vi.dwMinorVersion, w64); + else if (vi.wServicePackMinor) + safe_sprintf(vptr, vlen, "%s SP%u.%u %s", w, vi.wServicePackMajor, vi.wServicePackMinor, w64); + else if (vi.wServicePackMajor) + safe_sprintf(vptr, vlen, "%s SP%u %s", w, vi.wServicePackMajor, w64); + else + safe_sprintf(vptr, vlen, "%s %s", w, w64); +} + /* - * init: libusbx backend init function + * init: libusb backend init function * * This function enumerates the HCDs (Host Controller Drivers) and populates our private HCD list - * In our implementation, we equate Windows' "HCD" to libusbx's "bus". Note that bus is zero indexed. + * In our implementation, we equate Windows' "HCD" to libusb's "bus". Note that bus is zero indexed. * HCDs are not expected to change after init (might not hold true for hot pluggable USB PCI card?) */ static int windows_init(struct libusb_context *ctx) { int i, r = LIBUSB_ERROR_OTHER; - OSVERSIONINFO os_version; HANDLE semaphore; char sem_name[11+1+8]; // strlen(libusb_init)+'\0'+(32-bit hex PID) @@ -822,19 +948,8 @@ static int windows_init(struct libusb_context *ctx) // NB: concurrent usage supposes that init calls are equally balanced with // exit calls. If init is called more than exit, we will not exit properly if ( ++concurrent_usage == 0 ) { // First init? - // Detect OS version - memset(&os_version, 0, sizeof(OSVERSIONINFO)); - os_version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - windows_version = WINDOWS_UNSUPPORTED; - if ((GetVersionEx(&os_version) != 0) && (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)) { - if ((os_version.dwMajorVersion == 5) && (os_version.dwMinorVersion == 1)) { - windows_version = WINDOWS_XP; - } else if ((os_version.dwMajorVersion == 5) && (os_version.dwMinorVersion == 2)) { - windows_version = WINDOWS_2003; // also includes XP 64 - } else if (os_version.dwMajorVersion >= 6) { - windows_version = WINDOWS_VISTA_AND_LATER; - } - } + get_windows_version(); + usbi_dbg(windows_version_str); if (windows_version == WINDOWS_UNSUPPORTED) { usbi_err(ctx, "This version of Windows is NOT supported"); r = LIBUSB_ERROR_NOT_SUPPORTED; @@ -886,6 +1001,12 @@ static int windows_init(struct libusb_context *ctx) } SetThreadAffinityMask(timer_thread, 0); + // Wait for timer thread to init before continuing. + if (WaitForSingleObject(timer_response, INFINITE) != WAIT_OBJECT_0) { + usbi_err(ctx, "Failed to wait for timer thread to become ready - aborting"); + goto init_exit; + } + // Create a hash table to store session ids. Second parameter is better if prime htab_create(ctx, HTAB_SIZE); } @@ -1008,6 +1129,7 @@ static int cache_config_descriptors(struct libusb_device *dev, HANDLE hub_handle // Dummy call to get the required data size. Initial failures are reported as info rather // than error as they can occur for non-penalizing situations, such as with some hubs. + // coverity[tainted_data_argument] if (!DeviceIoControl(hub_handle, IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, &cd_buf_short, size, &cd_buf_short, size, &ret_size, NULL)) { usbi_info(ctx, "could not access configuration descriptor (dummy) for '%s': %s", device_id, windows_error_str(0)); @@ -1058,14 +1180,14 @@ static int cache_config_descriptors(struct libusb_device *dev, HANDLE hub_handle // Cache the descriptor priv->config_descriptor[i] = (unsigned char*) malloc(cd_data->wTotalLength); if (priv->config_descriptor[i] == NULL) - return LIBUSB_ERROR_NO_MEM; + LOOP_BREAK(LIBUSB_ERROR_NO_MEM); memcpy(priv->config_descriptor[i], cd_data, cd_data->wTotalLength); } return LIBUSB_SUCCESS; } /* - * Populate a libusbx device structure + * Populate a libusb device structure */ static int init_device(struct libusb_device* dev, struct libusb_device* parent_dev, uint8_t port_number, char* device_id, DWORD devinst) @@ -1073,14 +1195,16 @@ static int init_device(struct libusb_device* dev, struct libusb_device* parent_d HANDLE handle; DWORD size; USB_NODE_CONNECTION_INFORMATION_EX conn_info; + USB_NODE_CONNECTION_INFORMATION_EX_V2 conn_info_v2; struct windows_device_priv *priv, *parent_priv; - struct libusb_context *ctx = DEVICE_CTX(dev); + struct libusb_context *ctx; struct libusb_device* tmp_dev; unsigned i; if ((dev == NULL) || (parent_dev == NULL)) { return LIBUSB_ERROR_NOT_FOUND; } + ctx = DEVICE_CTX(dev); priv = _device_priv(dev); parent_priv = _device_priv(parent_dev); if (parent_priv->apib->id != USB_API_HUB) { @@ -1097,8 +1221,10 @@ static int init_device(struct libusb_device* dev, struct libusb_device* parent_d if (tmp_dev->bus_number != 0) { usbi_dbg("got bus number from ancestor #%d", i); parent_dev->bus_number = tmp_dev->bus_number; + libusb_unref_device(tmp_dev); break; } + libusb_unref_device(tmp_dev); } } if (parent_dev->bus_number == 0) { @@ -1110,7 +1236,7 @@ static int init_device(struct libusb_device* dev, struct libusb_device* parent_d dev->port_number = port_number; priv->depth = parent_priv->depth + 1; priv->parent_dev = parent_dev; - dev->parent_dev = libusb_ref_device(parent_dev); + dev->parent_dev = parent_dev; // If the device address is already set, we can stop here if (dev->device_address != 0) { @@ -1126,6 +1252,7 @@ static int init_device(struct libusb_device* dev, struct libusb_device* parent_d } size = sizeof(conn_info); conn_info.ConnectionIndex = (ULONG)port_number; + // coverity[tainted_data_argument] if (!DeviceIoControl(handle, IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX, &conn_info, size, &conn_info, size, &size, NULL)) { usbi_warn(ctx, "could not get node connection information for device '%s': %s", @@ -1147,6 +1274,23 @@ static int init_device(struct libusb_device* dev, struct libusb_device* parent_d dev->num_configurations = 0; priv->dev_descriptor.bNumConfigurations = 0; } + + // In their great wisdom, Microsoft decided to BREAK the USB speed report between Windows 7 and Windows 8 + if (windows_version >= WINDOWS_8) { + memset(&conn_info_v2, 0, sizeof(conn_info_v2)); + size = sizeof(conn_info_v2); + conn_info_v2.ConnectionIndex = (ULONG)port_number; + conn_info_v2.Length = size; + conn_info_v2.SupportedUsbProtocols.Usb300 = 1; + if (!DeviceIoControl(handle, IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX_V2, + &conn_info_v2, size, &conn_info_v2, size, &size, NULL)) { + usbi_warn(ctx, "could not get node connection information (V2) for device '%s': %s", + device_id, windows_error_str(0)); + } else if (conn_info_v2.Flags.DeviceIsOperatingAtSuperSpeedOrHigher) { + conn_info.Speed = 3; + } + } + safe_closehandle(handle); if (conn_info.DeviceAddress > UINT8_MAX) { @@ -1224,7 +1368,7 @@ static void get_api_type(struct libusb_context *ctx, HDEVINFO *dev_info, for (k=0; k<3; k++) { j = get_sub_api(lookup[k].list, i); if (j >= 0) { - usbi_dbg("matched %s name against %s API", + usbi_dbg("matched %s name against %s", lookup[k].designation, (i!=USB_API_WINUSBX)?usb_api_backend[i].designation:sub_api_name[j]); *api = i; *sub_api = j; @@ -1317,7 +1461,7 @@ static int set_hid_interface(struct libusb_context* ctx, struct libusb_device* d } /* - * get_device_list: libusbx backend device enumeration function + * get_device_list: libusb backend device enumeration function */ static int windows_get_device_list(struct libusb_context *ctx, struct discovered_devs **_discdevs) { @@ -1467,7 +1611,7 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered if (!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_DRIVER, ®_type, (BYTE*)strbuf, size, &size)) { usbi_info(ctx, "The following device has no driver: '%s'", dev_id_path); - usbi_info(ctx, "libusbx will not be able to access it."); + usbi_info(ctx, "libusb will not be able to access it."); } // ...and to add the additional device interface GUIDs key = pSetupDiOpenDevRegKey(dev_info, &dev_info_data, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_READ); @@ -1531,6 +1675,7 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered parent_priv = _device_priv(parent_dev); // virtual USB devices are also listed during GEN - don't process these yet if ( (pass == GEN_PASS) && (parent_priv->apib->id != USB_API_HUB) ) { + libusb_unref_device(parent_dev); continue; } break; @@ -1553,20 +1698,20 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered LOOP_BREAK(LIBUSB_ERROR_NO_MEM); } windows_device_priv_init(dev); - // Keep track of devices that need unref - unref_list[unref_cur++] = dev; - if (unref_cur >= unref_size) { - unref_size += 64; - unref_list = usbi_reallocf(unref_list, unref_size*sizeof(libusb_device*)); - if (unref_list == NULL) { - usbi_err(ctx, "could not realloc list for unref - aborting."); - LOOP_BREAK(LIBUSB_ERROR_NO_MEM); - } - } } else { usbi_dbg("found existing device for session [%X] (%d.%d)", session_id, dev->bus_number, dev->device_address); } + // Keep track of devices that need unref + unref_list[unref_cur++] = dev; + if (unref_cur >= unref_size) { + unref_size += 64; + unref_list = usbi_reallocf(unref_list, unref_size*sizeof(libusb_device*)); + if (unref_list == NULL) { + usbi_err(ctx, "could not realloc list for unref - aborting."); + LOOP_BREAK(LIBUSB_ERROR_NO_MEM); + } + } priv = _device_priv(dev); } @@ -1652,6 +1797,7 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered break; } } + libusb_unref_device(parent_dev); break; } } @@ -1663,16 +1809,18 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered } // Unref newly allocated devs - for (i=0; iconfig_descriptor[config_index], size); *host_endian = 0; - return size; + return (int)size; } /* @@ -1995,6 +2143,8 @@ static int windows_submit_transfer(struct usbi_transfer *itransfer) return submit_bulk_transfer(itransfer); case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: return submit_iso_transfer(itransfer); + case LIBUSB_TRANSFER_TYPE_BULK_STREAM: + return LIBUSB_ERROR_NOT_SUPPORTED; default: usbi_err(TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type); return LIBUSB_ERROR_INVALID_PARAM; @@ -2028,6 +2178,8 @@ static int windows_cancel_transfer(struct usbi_transfer *itransfer) case LIBUSB_TRANSFER_TYPE_INTERRUPT: case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: return windows_abort_transfers(itransfer); + case LIBUSB_TRANSFER_TYPE_BULK_STREAM: + return LIBUSB_ERROR_NOT_SUPPORTED; default: usbi_err(ITRANSFER_CTX(itransfer), "unknown endpoint type %d", transfer->type); return LIBUSB_ERROR_INVALID_PARAM; @@ -2068,7 +2220,7 @@ static void windows_transfer_callback(struct usbi_transfer *itransfer, uint32_t } break; default: - usbi_err(ITRANSFER_CTX(itransfer), "detected I/O error %d: %s", io_result, windows_error_str(0)); + usbi_err(ITRANSFER_CTX(itransfer), "detected I/O error %d: %s", io_result, windows_error_str(io_result)); status = LIBUSB_TRANSFER_ERROR; break; } @@ -2087,6 +2239,9 @@ static void windows_handle_callback (struct usbi_transfer *itransfer, uint32_t i case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: windows_transfer_callback (itransfer, io_result, io_size); break; + case LIBUSB_TRANSFER_TYPE_BULK_STREAM: + usbi_warn(ITRANSFER_CTX(itransfer), "bulk stream transfers are not yet supported on this platform"); + break; default: usbi_err(ITRANSFER_CTX(itransfer), "unknown endpoint type %d", transfer->type); } @@ -2172,6 +2327,11 @@ unsigned __stdcall windows_clock_gettime_threaded(void* param) usbi_dbg("hires timer available (Frequency: %"PRIu64" Hz)", hires_frequency); } + // Signal windows_init() that we're ready to service requests + if (ReleaseSemaphore(timer_response, 1, NULL) == 0) { + usbi_dbg("unable to release timer semaphore: %s", windows_error_str(0)); + } + // Main loop - wait for requests while (1) { timer_index = WaitForMultipleObjects(2, timer_request, FALSE, INFINITE) - WAIT_OBJECT_0; @@ -2193,7 +2353,7 @@ unsigned __stdcall windows_clock_gettime_threaded(void* param) case 0: WaitForSingleObject(timer_mutex, INFINITE); // Requests to this thread are for hires always - if (QueryPerformanceCounter(&hires_counter) != 0) { + if ((QueryPerformanceCounter(&hires_counter) != 0) && (hires_frequency != 0)) { timer_tp.tv_sec = (long)(hires_counter.QuadPart / hires_frequency); timer_tp.tv_nsec = (long)(((hires_counter.QuadPart % hires_frequency)/1000) * hires_ticks_to_ps); } else { @@ -2206,7 +2366,7 @@ unsigned __stdcall windows_clock_gettime_threaded(void* param) nb_responses = InterlockedExchange((LONG*)&request_count[0], 0); if ( (nb_responses) && (ReleaseSemaphore(timer_response, nb_responses, NULL) == 0) ) { - usbi_dbg("unable to release timer semaphore %d: %s", windows_error_str(0)); + usbi_dbg("unable to release timer semaphore: %s", windows_error_str(0)); } continue; case 1: // time to quit @@ -2288,6 +2448,9 @@ const struct usbi_os_backend windows_backend = { windows_clear_halt, windows_reset_device, + NULL, /* alloc_streams */ + NULL, /* free_streams */ + windows_kernel_driver_active, windows_detach_kernel_driver, windows_attach_kernel_driver, @@ -2366,7 +2529,7 @@ static int common_configure_endpoints(int sub_api, struct libusb_device_handle * return LIBUSB_SUCCESS; } // These names must be uppercase -const char* hub_driver_names[] = {"USBHUB", "USBHUB3", "NUSB3HUB", "RUSB3HUB", "FLXHCIH", "TIHUB3", "ETRONHUB3", "VIAHUB3", "ASMTHUB3", "IUSB3HUB"}; +const char* hub_driver_names[] = {"USBHUB", "USBHUB3", "USB3HUB", "NUSB3HUB", "RUSB3HUB", "FLXHCIH", "TIHUB3", "ETRONHUB3", "VIAHUB3", "ASMTHUB3", "IUSB3HUB", "VUSB3HUB", "AMDHUB30"}; const char* composite_driver_names[] = {"USBCCGP"}; const char* winusbx_driver_names[] = WINUSBX_DRV_NAMES; const char* hid_driver_names[] = {"HIDUSB", "MOUHID", "KBDHID"}; @@ -2726,11 +2889,10 @@ static int winusbx_claim_interface(int sub_api, struct libusb_device_handle *dev usbi_err(ctx, "could not open device %s: %s", filter_path, windows_error_str(0)); } else { WinUSBX[sub_api].Free(winusb_handle); - if (!WinUSBX[sub_api].Initialize(file_handle, &winusb_handle)) { - continue; - } - found_filter = true; - break; + if (WinUSBX[sub_api].Initialize(file_handle, &winusb_handle)) + found_filter = true; + else + usbi_err(ctx, "could not initialize filter driver for %s", filter_path); } } } @@ -4146,19 +4308,21 @@ static int hid_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, if (transfer_priv->hid_buffer != NULL) { // If we have a valid hid_buffer, it means the transfer was async if (transfer_priv->hid_dest != NULL) { // Data readout - // First, check for overflow - if (corrected_size > transfer_priv->hid_expected_size) { - usbi_err(ctx, "OVERFLOW!"); - corrected_size = (uint32_t)transfer_priv->hid_expected_size; - r = LIBUSB_TRANSFER_OVERFLOW; - } + if (corrected_size > 0) { + // First, check for overflow + if (corrected_size > transfer_priv->hid_expected_size) { + usbi_err(ctx, "OVERFLOW!"); + corrected_size = (uint32_t)transfer_priv->hid_expected_size; + r = LIBUSB_TRANSFER_OVERFLOW; + } - if (transfer_priv->hid_buffer[0] == 0) { - // Discard the 1 byte report ID prefix - corrected_size--; - memcpy(transfer_priv->hid_dest, transfer_priv->hid_buffer+1, corrected_size); - } else { - memcpy(transfer_priv->hid_dest, transfer_priv->hid_buffer, corrected_size); + if (transfer_priv->hid_buffer[0] == 0) { + // Discard the 1 byte report ID prefix + corrected_size--; + memcpy(transfer_priv->hid_dest, transfer_priv->hid_buffer+1, corrected_size); + } else { + memcpy(transfer_priv->hid_dest, transfer_priv->hid_buffer, corrected_size); + } } transfer_priv->hid_dest = NULL; } @@ -4286,7 +4450,7 @@ static int composite_submit_control_transfer(int sub_api, struct usbi_transfer * } } - usbi_err(ctx, "no libusbx supported interfaces to complete request"); + usbi_err(ctx, "no libusb supported interfaces to complete request"); return LIBUSB_ERROR_NOT_FOUND; } diff --git a/Externals/libusbx/libusb/os/windows_usb.h b/Externals/libusb/libusb/os/windows_usb.h similarity index 96% rename from Externals/libusbx/libusb/os/windows_usb.h rename to Externals/libusb/libusb/os/windows_usb.h index 5d67a562e8..413adfc492 100644 --- a/Externals/libusbx/libusb/os/windows_usb.h +++ b/Externals/libusb/libusb/os/windows_usb.h @@ -1,5 +1,5 @@ /* - * Windows backend for libusbx 1.0 + * Windows backend for libusb 1.0 * Copyright © 2009-2012 Pete Batard * With contributions from Michael Plante, Orin Eman et al. * Parts of this code adapted from libusb-win32-v1 by Stephan Meyer @@ -40,6 +40,11 @@ #define SPDRP_INSTALL_STATE 34 #endif +// Missing from MinGW +#if !defined(FACILITY_SETUPAPI) +#define FACILITY_SETUPAPI 15 +#endif + #if defined(__CYGWIN__ ) #define _stricmp stricmp // cygwin produces a warning unless these prototypes are defined @@ -305,6 +310,9 @@ struct driver_lookup { /* OLE32 dependency */ DLL_DECLARE_PREFIXED(WINAPI, HRESULT, p, CLSIDFromString, (LPCOLESTR, LPCLSID)); +/* This call is only available from XP SP2 */ +DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, IsWow64Process, (HANDLE, PBOOL)); + /* SetupAPI dependencies */ DLL_DECLARE_PREFIXED(WINAPI, HDEVINFO, p, SetupDiGetClassDevsA, (const GUID*, PCSTR, HWND, DWORD)); DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiEnumDeviceInfo, (HDEVINFO, DWORD, PSP_DEVINFO_DATA)); @@ -359,6 +367,9 @@ typedef RETURN_TYPE CONFIGRET; #if !defined(USB_GET_HUB_CAPABILITIES_EX) #define USB_GET_HUB_CAPABILITIES_EX 276 #endif +#if !defined(USB_GET_NODE_CONNECTION_INFORMATION_EX_V2) +#define USB_GET_NODE_CONNECTION_INFORMATION_EX_V2 279 +#endif #ifndef METHOD_BUFFERED #define METHOD_BUFFERED 0 @@ -419,6 +430,9 @@ DLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Device_IDA, (DEVINST, PCHAR, ULONG, ULONG) #define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX \ CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION_EX, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX_V2 \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION_EX_V2, METHOD_BUFFERED, FILE_ANY_ACCESS) + #define IOCTL_USB_GET_NODE_CONNECTION_ATTRIBUTES \ CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_ATTRIBUTES, METHOD_BUFFERED, FILE_ANY_ACCESS) @@ -559,6 +573,32 @@ typedef struct USB_NODE_CONNECTION_INFORMATION_EX { // USB_PIPE_INFO PipeList[0]; } USB_NODE_CONNECTION_INFORMATION_EX, *PUSB_NODE_CONNECTION_INFORMATION_EX; +typedef union _USB_PROTOCOLS { + ULONG ul; + struct { + ULONG Usb110:1; + ULONG Usb200:1; + ULONG Usb300:1; + ULONG ReservedMBZ:29; + }; +} USB_PROTOCOLS, *PUSB_PROTOCOLS; + +typedef union _USB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS { + ULONG ul; + struct { + ULONG DeviceIsOperatingAtSuperSpeedOrHigher:1; + ULONG DeviceIsSuperSpeedCapableOrHigher:1; + ULONG ReservedMBZ:30; + }; +} USB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS, *PUSB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS; + +typedef struct _USB_NODE_CONNECTION_INFORMATION_EX_V2 { + ULONG ConnectionIndex; + ULONG Length; + USB_PROTOCOLS SupportedUsbProtocols; + USB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS Flags; +} USB_NODE_CONNECTION_INFORMATION_EX_V2, *PUSB_NODE_CONNECTION_INFORMATION_EX_V2; + typedef struct USB_HUB_CAP_FLAGS { ULONG HubIsHighSpeedCapable:1; ULONG HubIsHighSpeed:1; diff --git a/Externals/libusbx/libusb/strerror.c b/Externals/libusb/libusb/strerror.c similarity index 87% rename from Externals/libusbx/libusb/strerror.c rename to Externals/libusb/libusb/strerror.c index a3c3afa3fc..7fba0e4725 100644 --- a/Externals/libusbx/libusb/strerror.c +++ b/Externals/libusb/libusb/strerror.c @@ -35,7 +35,7 @@ static size_t usbi_locale = 0; * How to add a new \ref libusb_strerror() translation: *
    *
  1. Download the latest \c strerror.c from:
    - * https://raw.github.com/libusbx/libusbx/master/libusb/sterror.c
  2. + * https://raw.github.com/libusb/libusb/master/libusb/sterror.c *
  3. Open the file in an UTF-8 capable editor
  4. *
  5. Add the 2 letter ISO 639-1 * code for your locale at the end of \c usbi_locale_supported[]
    @@ -53,11 +53,11 @@ static size_t usbi_locale = 0; * } * };\endcode
  6. *
  7. Translate each of the English messages from the section you copied into your language
  8. - *
  9. Save the file (in UTF-8 format) and send it to \c libusbx-devel@lists.sourceforge.net
  10. + *
  11. Save the file (in UTF-8 format) and send it to \c libusb-devel\@lists.sourceforge.net
  12. *
*/ -static const char* usbi_locale_supported[] = { "en", "nl", "fr" }; +static const char* usbi_locale_supported[] = { "en", "nl", "fr", "ru" }; static const char* usbi_localized_errors[ARRAYSIZE(usbi_locale_supported)][LIBUSB_ERROR_COUNT] = { { /* English (en) */ "Success", @@ -103,7 +103,22 @@ static const char* usbi_localized_errors[ARRAYSIZE(usbi_locale_supported)][LIBUS "Appel système abandonné (peut-être à cause d’un signal)", "Mémoire insuffisante", "Opération non supportée or non implémentée sur cette plateforme", - "Autre erreur" + "Autre erreur", + }, { /* Russian (ru) */ + "Успех", + "Ошибка ввода/вывода", + "Неверный параметр", + "Доступ запрещён (не хватает прав)", + "Устройство отсутствует (возможно, оно было отсоединено)", + "Элемент не найден", + "Ресурс занят", + "Истекло время ожидания операции", + "Переполнение", + "Ошибка канала", + "Системный вызов прерван (возможно, сигналом)", + "Память исчерпана", + "Операция не поддерживается данной платформой", + "Неизвестная ошибка" } }; diff --git a/Externals/libusbx/libusb/sync.c b/Externals/libusb/libusb/sync.c similarity index 96% rename from Externals/libusbx/libusb/sync.c rename to Externals/libusb/libusb/sync.c index 42e486db39..d87032d01d 100644 --- a/Externals/libusbx/libusb/sync.c +++ b/Externals/libusb/libusb/sync.c @@ -1,5 +1,5 @@ /* - * Synchronous I/O functions for libusbx + * Synchronous I/O functions for libusb * Copyright © 2007-2008 Daniel Drake * * This library is free software; you can redistribute it and/or @@ -28,7 +28,7 @@ /** * @defgroup syncio Synchronous device I/O * - * This page documents libusbx's synchronous (blocking) API for USB device I/O. + * This page documents libusb's synchronous (blocking) API for USB device I/O. * This interface is easy to use but has some limitations. More advanced users * may wish to consider using the \ref asyncio "asynchronous I/O API" instead. */ @@ -222,9 +222,9 @@ static int do_sync_bulk_transfer(struct libusb_device_handle *dev_handle, * Not all of the data may have been written. * * Also check transferred when dealing with a timeout error code. - * libusbx may have to split your transfer into a number of chunks to satisfy + * libusb may have to split your transfer into a number of chunks to satisfy * underlying O/S requirements, meaning that the timeout may expire after - * the first few chunks have completed. libusbx is careful not to lose any data + * the first few chunks have completed. libusb is careful not to lose any data * that may have been transferred; do not assume that timeout conditions * indicate a complete lack of I/O. * @@ -270,9 +270,9 @@ int API_EXPORTED libusb_bulk_transfer(struct libusb_device_handle *dev_handle, * writes. Not all of the data may have been written. * * Also check transferred when dealing with a timeout error code. - * libusbx may have to split your transfer into a number of chunks to satisfy + * libusb may have to split your transfer into a number of chunks to satisfy * underlying O/S requirements, meaning that the timeout may expire after - * the first few chunks have completed. libusbx is careful not to lose any data + * the first few chunks have completed. libusb is careful not to lose any data * that may have been transferred; do not assume that timeout conditions * indicate a complete lack of I/O. * diff --git a/Externals/libusbx/libusb/version.h b/Externals/libusb/libusb/version.h similarity index 94% rename from Externals/libusbx/libusb/version.h rename to Externals/libusb/libusb/version.h index cf37de97a5..3305765561 100644 --- a/Externals/libusbx/libusb/version.h +++ b/Externals/libusb/libusb/version.h @@ -7,7 +7,7 @@ #define LIBUSB_MINOR 0 #endif #ifndef LIBUSB_MICRO -#define LIBUSB_MICRO 16 +#define LIBUSB_MICRO 19 #endif #ifndef LIBUSB_NANO #define LIBUSB_NANO 0 diff --git a/Externals/libusb/libusb/version_nano.h b/Externals/libusb/libusb/version_nano.h new file mode 100644 index 0000000000..8c4063a317 --- /dev/null +++ b/Externals/libusb/libusb/version_nano.h @@ -0,0 +1 @@ +#define LIBUSB_NANO 10903 diff --git a/Externals/libusbx/ltmain.sh b/Externals/libusb/ltmain.sh similarity index 100% rename from Externals/libusbx/ltmain.sh rename to Externals/libusb/ltmain.sh diff --git a/Externals/libusbx/m4/libtool.m4 b/Externals/libusb/m4/libtool.m4 similarity index 99% rename from Externals/libusbx/m4/libtool.m4 rename to Externals/libusb/m4/libtool.m4 index 56666f0ece..f12cfdf0b4 100644 --- a/Externals/libusbx/m4/libtool.m4 +++ b/Externals/libusb/m4/libtool.m4 @@ -1312,7 +1312,7 @@ ia64-*-hpux*) rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -1326,7 +1326,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1345,7 +1348,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) diff --git a/Externals/libusbx/m4/ltoptions.m4 b/Externals/libusb/m4/ltoptions.m4 similarity index 100% rename from Externals/libusbx/m4/ltoptions.m4 rename to Externals/libusb/m4/ltoptions.m4 diff --git a/Externals/libusbx/m4/ltsugar.m4 b/Externals/libusb/m4/ltsugar.m4 similarity index 100% rename from Externals/libusbx/m4/ltsugar.m4 rename to Externals/libusb/m4/ltsugar.m4 diff --git a/Externals/libusbx/m4/ltversion.m4 b/Externals/libusb/m4/ltversion.m4 similarity index 100% rename from Externals/libusbx/m4/ltversion.m4 rename to Externals/libusb/m4/ltversion.m4 diff --git a/Externals/libusbx/m4/lt~obsolete.m4 b/Externals/libusb/m4/lt~obsolete.m4 similarity index 100% rename from Externals/libusbx/m4/lt~obsolete.m4 rename to Externals/libusb/m4/lt~obsolete.m4 diff --git a/Externals/libusbx/missing b/Externals/libusb/missing old mode 100644 new mode 100755 similarity index 98% rename from Externals/libusbx/missing rename to Externals/libusb/missing index cdea514931..db98974ff5 --- a/Externals/libusbx/missing +++ b/Externals/libusb/missing @@ -1,7 +1,7 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-06-26.16; # UTC +scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. @@ -160,7 +160,7 @@ give_advice () ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'automa4te' program to be rebuilt." + echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) diff --git a/Externals/libusbx/msvc/config.h b/Externals/libusb/msvc/config.h similarity index 93% rename from Externals/libusbx/msvc/config.h rename to Externals/libusb/msvc/config.h index bb542c5dc8..4b418db11d 100644 --- a/Externals/libusbx/msvc/config.h +++ b/Externals/libusb/msvc/config.h @@ -25,6 +25,9 @@ /* Uncomment to start with debug message logging enabled */ // #define ENABLE_DEBUG_LOGGING 1 +/* Uncomment to enabling logging to system log */ +// #define USE_SYSTEM_LOGGING_FACILITY + /* type of second poll() argument */ #define POLL_NFDS_TYPE unsigned int diff --git a/Externals/libusbx/msvc/ddk_build.cmd b/Externals/libusb/msvc/ddk_build.cmd similarity index 100% rename from Externals/libusbx/msvc/ddk_build.cmd rename to Externals/libusb/msvc/ddk_build.cmd diff --git a/Externals/libusb/msvc/errno.h b/Externals/libusb/msvc/errno.h new file mode 100644 index 0000000000..07d15e3d44 --- /dev/null +++ b/Externals/libusb/msvc/errno.h @@ -0,0 +1,102 @@ +/* + * errno.h + * This file has no copyright assigned and is placed in the Public Domain. + * This file is a part of the mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within the package. + * + * Error numbers and access to error reporting. + * + */ + +#ifndef _ERRNO_H_ +#define _ERRNO_H_ + +#include + +/* + * Error numbers. + * TODO: Can't be sure of some of these assignments, I guessed from the + * names given by strerror and the defines in the Cygnus errno.h. A lot + * of the names from the Cygnus errno.h are not represented, and a few + * of the descriptions returned by strerror do not obviously match + * their error naming. + */ +#define EPERM 1 /* Operation not permitted */ +#define ENOFILE 2 /* No such file or directory */ +#define ENOENT 2 +#define ESRCH 3 /* No such process */ +#define EINTR 4 /* Interrupted function call */ +#define EIO 5 /* Input/output error */ +#define ENXIO 6 /* No such device or address */ +#define E2BIG 7 /* Arg list too long */ +#define ENOEXEC 8 /* Exec format error */ +#define EBADF 9 /* Bad file descriptor */ +#define ECHILD 10 /* No child processes */ +#define EAGAIN 11 /* Resource temporarily unavailable */ +#define ENOMEM 12 /* Not enough space */ +#define EACCES 13 /* Permission denied */ +#define EFAULT 14 /* Bad address */ +/* 15 - Unknown Error */ +#define EBUSY 16 /* strerror reports "Resource device" */ +#define EEXIST 17 /* File exists */ +#define EXDEV 18 /* Improper link (cross-device link?) */ +#define ENODEV 19 /* No such device */ +#define ENOTDIR 20 /* Not a directory */ +#define EISDIR 21 /* Is a directory */ +#define EINVAL 22 /* Invalid argument */ +#define ENFILE 23 /* Too many open files in system */ +#define EMFILE 24 /* Too many open files */ +#define ENOTTY 25 /* Inappropriate I/O control operation */ +/* 26 - Unknown Error */ +#define EFBIG 27 /* File too large */ +#define ENOSPC 28 /* No space left on device */ +#define ESPIPE 29 /* Invalid seek (seek on a pipe?) */ +#define EROFS 30 /* Read-only file system */ +#define EMLINK 31 /* Too many links */ +#define EPIPE 32 /* Broken pipe */ +#define EDOM 33 /* Domain error (math functions) */ +#define ERANGE 34 /* Result too large (possibly too small) */ +/* 35 - Unknown Error */ +#define EDEADLOCK 36 /* Resource deadlock avoided (non-Cyg) */ +#define EDEADLK 36 +#if 0 +/* 37 - Unknown Error */ +#define ENAMETOOLONG 38 /* Filename too long (91 in Cyg?) */ +#define ENOLCK 39 /* No locks available (46 in Cyg?) */ +#define ENOSYS 40 /* Function not implemented (88 in Cyg?) */ +#define ENOTEMPTY 41 /* Directory not empty (90 in Cyg?) */ +#define EILSEQ 42 /* Illegal byte sequence */ +#endif + +/* + * NOTE: ENAMETOOLONG and ENOTEMPTY conflict with definitions in the + * sockets.h header provided with windows32api-0.1.2. + * You should go and put an #if 0 ... #endif around the whole block + * of errors (look at the comment above them). + */ + +#ifndef RC_INVOKED + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Definitions of errno. For _doserrno, sys_nerr and * sys_errlist, see + * stdlib.h. + */ +#if defined(_UWIN) || defined(_WIN32_WCE) +#undef errno +extern int errno; +#else +_CRTIMP int* __cdecl _errno(void); +#define errno (*_errno()) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* Not RC_INVOKED */ + +#endif /* Not _ERRNO_H_ */ \ No newline at end of file diff --git a/Externals/libusb/msvc/fxload_2010.vcxproj b/Externals/libusb/msvc/fxload_2010.vcxproj new file mode 100644 index 0000000000..56e585303c --- /dev/null +++ b/Externals/libusb/msvc/fxload_2010.vcxproj @@ -0,0 +1,170 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + fxload + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88} + examples + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + {ae83e1b4-ce06-47ee-b7a3-c3a1d7c2d71e} + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/fxload_2010.vcxproj.filters b/Externals/libusb/msvc/fxload_2010.vcxproj.filters new file mode 100644 index 0000000000..824ae40362 --- /dev/null +++ b/Externals/libusb/msvc/fxload_2010.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {651ff73d-037b-4903-8dd3-56e9950be25c} + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/fxload_2012.vcxproj b/Externals/libusb/msvc/fxload_2012.vcxproj new file mode 100644 index 0000000000..fb53a43d55 --- /dev/null +++ b/Externals/libusb/msvc/fxload_2012.vcxproj @@ -0,0 +1,174 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + fxload + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88} + examples + Win32Proj + + + + Application + Unicode + true + v110 + + + Application + Unicode + v110 + + + Application + Unicode + true + v110 + + + Application + Unicode + v110 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + {ae83e1b4-ce06-47ee-b7a3-c3a1d7c2d71e} + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/fxload_2012.vcxproj.filters b/Externals/libusb/msvc/fxload_2012.vcxproj.filters new file mode 100644 index 0000000000..824ae40362 --- /dev/null +++ b/Externals/libusb/msvc/fxload_2012.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {651ff73d-037b-4903-8dd3-56e9950be25c} + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/fxload_2013.vcxproj b/Externals/libusb/msvc/fxload_2013.vcxproj new file mode 100644 index 0000000000..74a0d28247 --- /dev/null +++ b/Externals/libusb/msvc/fxload_2013.vcxproj @@ -0,0 +1,174 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + fxload + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88} + examples + Win32Proj + + + + Application + Unicode + true + v120 + + + Application + Unicode + v120 + + + Application + Unicode + true + v120 + + + Application + Unicode + v120 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + {ae83e1b4-ce06-47ee-b7a3-c3a1d7c2d71e} + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/fxload_sources b/Externals/libusb/msvc/fxload_sources new file mode 100644 index 0000000000..d6e31d691b --- /dev/null +++ b/Externals/libusb/msvc/fxload_sources @@ -0,0 +1,23 @@ +TARGETNAME=fxload +TARGETTYPE=PROGRAM +386_STDCALL=0 + +_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) + +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +!IFDEF STATIC_LIBC +USE_LIBCMT=1 +!ELSE +USE_MSVCRT=1 +!ENDIF + +UMTYPE=console +INCLUDES=..\..\msvc;..\..\libusb;..\getopt;$(DDK_INC_PATH) +C_DEFINES=$(C_DEFINES) /D__GNU_LIBRARY__ +UMLIBS=..\..\libusb\os\obj$(BUILD_ALT_DIR)\*\libusb-1.0.lib \ + ..\getopt\getopt_ddkbuild\obj$(BUILD_ALT_DIR)\*\getopt.lib +SOURCES=..\ezusb.c \ + ..\fxload.c diff --git a/Externals/libusb/msvc/getopt_2005.vcproj b/Externals/libusb/msvc/getopt_2005.vcproj new file mode 100644 index 0000000000..a98a0a805f --- /dev/null +++ b/Externals/libusb/msvc/getopt_2005.vcproj @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Externals/libusb/msvc/getopt_2010.vcxproj b/Externals/libusb/msvc/getopt_2010.vcxproj new file mode 100644 index 0000000000..66c5e44144 --- /dev/null +++ b/Externals/libusb/msvc/getopt_2010.vcxproj @@ -0,0 +1,131 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} + getopt + + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + + + + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + true + + + + + X64 + + + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebug + Level3 + ProgramDatabase + + + true + + + + + MaxSpeed + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + true + + + + + X64 + + + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/getopt_2010.vcxproj.filters b/Externals/libusb/msvc/getopt_2010.vcxproj.filters new file mode 100644 index 0000000000..7cf095b2ce --- /dev/null +++ b/Externals/libusb/msvc/getopt_2010.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/getopt_2012.vcxproj b/Externals/libusb/msvc/getopt_2012.vcxproj new file mode 100644 index 0000000000..01b792832e --- /dev/null +++ b/Externals/libusb/msvc/getopt_2012.vcxproj @@ -0,0 +1,136 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} + getopt + getopt + + + + StaticLibrary + Unicode + true + v110 + + + StaticLibrary + Unicode + v110 + + + StaticLibrary + Unicode + true + v110 + + + StaticLibrary + Unicode + v110 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + + + + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + true + + + + + X64 + + + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebug + Level3 + ProgramDatabase + + + true + + + + + MaxSpeed + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + true + + + + + X64 + + + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/getopt_2012.vcxproj.filters b/Externals/libusb/msvc/getopt_2012.vcxproj.filters new file mode 100644 index 0000000000..7cf095b2ce --- /dev/null +++ b/Externals/libusb/msvc/getopt_2012.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/getopt_2013.vcxproj b/Externals/libusb/msvc/getopt_2013.vcxproj new file mode 100644 index 0000000000..ee36fd405d --- /dev/null +++ b/Externals/libusb/msvc/getopt_2013.vcxproj @@ -0,0 +1,136 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} + getopt + getopt + + + + StaticLibrary + Unicode + true + v120 + + + StaticLibrary + Unicode + v120 + + + StaticLibrary + Unicode + true + v120 + + + StaticLibrary + Unicode + v120 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + + + + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + true + + + + + X64 + + + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebug + Level3 + ProgramDatabase + + + true + + + + + MaxSpeed + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + true + + + + + X64 + + + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/getopt_sources b/Externals/libusb/msvc/getopt_sources new file mode 100644 index 0000000000..b9adc1b75a --- /dev/null +++ b/Externals/libusb/msvc/getopt_sources @@ -0,0 +1,20 @@ +TARGETTYPE=LIBRARY +TARGETNAME=getopt +386_STDCALL=0 + +_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) + +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +USE_MSVCRT=1 + +INCLUDES=$(DDK_INC_PATH) +C_DEFINES = $(C_DEFINES) /DDDKBUILD /DHAVE_STRING_H + +TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\user32.lib + +SOURCES=..\getopt1.c \ + ..\getopt.c diff --git a/Externals/libusb/msvc/hotplugtest_2010.vcxproj b/Externals/libusb/msvc/hotplugtest_2010.vcxproj new file mode 100644 index 0000000000..ae4afeb336 --- /dev/null +++ b/Externals/libusb/msvc/hotplugtest_2010.vcxproj @@ -0,0 +1,163 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + hotplugtest + {99D2AC64-DC66-4422-91CE-6715C403C9E5} + examples + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/hotplugtest_2010.vcxproj.filters b/Externals/libusb/msvc/hotplugtest_2010.vcxproj.filters new file mode 100644 index 0000000000..125ac1be48 --- /dev/null +++ b/Externals/libusb/msvc/hotplugtest_2010.vcxproj.filters @@ -0,0 +1,14 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/hotplugtest_2012.vcxproj b/Externals/libusb/msvc/hotplugtest_2012.vcxproj new file mode 100644 index 0000000000..4460e364e1 --- /dev/null +++ b/Externals/libusb/msvc/hotplugtest_2012.vcxproj @@ -0,0 +1,167 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + hotplugtest + {99D2AC64-DC66-4422-91CE-6715C403C9E5} + examples + Win32Proj + + + + Application + Unicode + true + v110 + + + Application + Unicode + v110 + + + Application + Unicode + true + v110 + + + Application + Unicode + v110 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/hotplugtest_2012.vcxproj.filters b/Externals/libusb/msvc/hotplugtest_2012.vcxproj.filters new file mode 100644 index 0000000000..125ac1be48 --- /dev/null +++ b/Externals/libusb/msvc/hotplugtest_2012.vcxproj.filters @@ -0,0 +1,14 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/hotplugtest_2013.vcxproj b/Externals/libusb/msvc/hotplugtest_2013.vcxproj new file mode 100644 index 0000000000..578c6fff34 --- /dev/null +++ b/Externals/libusb/msvc/hotplugtest_2013.vcxproj @@ -0,0 +1,167 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + hotplugtest + {99D2AC64-DC66-4422-91CE-6715C403C9E5} + examples + Win32Proj + + + + Application + Unicode + true + v120 + + + Application + Unicode + v120 + + + Application + Unicode + true + v120 + + + Application + Unicode + v120 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/hotplugtest_sources b/Externals/libusb/msvc/hotplugtest_sources new file mode 100644 index 0000000000..1b27cad913 --- /dev/null +++ b/Externals/libusb/msvc/hotplugtest_sources @@ -0,0 +1,20 @@ +TARGETNAME=hotplugtest +TARGETTYPE=PROGRAM +386_STDCALL=0 + +_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) + +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +!IFDEF STATIC_LIBC +USE_LIBCMT=1 +!ELSE +USE_MSVCRT=1 +!ENDIF + +UMTYPE=console +INCLUDES=..\..\msvc;..\..\libusb;$(DDK_INC_PATH) +UMLIBS=..\..\libusb\os\obj$(BUILD_ALT_DIR)\*\libusb-1.0.lib +SOURCES=..\hotplugtest.c diff --git a/Externals/libusb/msvc/inttypes.h b/Externals/libusb/msvc/inttypes.h new file mode 100644 index 0000000000..289bb50b4d --- /dev/null +++ b/Externals/libusb/msvc/inttypes.h @@ -0,0 +1,295 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file was original part of the w64 mingw-runtime package. + */ + +/* + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * Modified for libusb/MSVC: Pete Batard + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Date: 2010-04-02 + */ + +#ifndef _MSC_VER +#error This header should only be used with Microsoft compilers +#endif + +/* 7.8 Format conversion of integer types */ + +#ifndef _INTTYPES_H_ +#define _INTTYPES_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + intmax_t quot; + intmax_t rem; + } imaxdiv_t; + + +/* 7.8.1 Macros for format specifiers + * + * MS runtime does not yet understand C9x standard "ll" + * length specifier. It appears to treat "ll" as "l". + * The non-standard I64 length specifier causes warning in GCC, + * but understood by MS runtime functions. + */ + +/* fprintf macros for signed types */ +#define PRId8 "d" +#define PRId16 "d" +#define PRId32 "d" +#define PRId64 "I64d" + +#define PRIdLEAST8 "d" +#define PRIdLEAST16 "d" +#define PRIdLEAST32 "d" +#define PRIdLEAST64 "I64d" + +#define PRIdFAST8 "d" +#define PRIdFAST16 "d" +#define PRIdFAST32 "d" +#define PRIdFAST64 "I64d" + +#define PRIdMAX "I64d" + +#define PRIi8 "i" +#define PRIi16 "i" +#define PRIi32 "i" +#define PRIi64 "I64i" + +#define PRIiLEAST8 "i" +#define PRIiLEAST16 "i" +#define PRIiLEAST32 "i" +#define PRIiLEAST64 "I64i" + +#define PRIiFAST8 "i" +#define PRIiFAST16 "i" +#define PRIiFAST32 "i" +#define PRIiFAST64 "I64i" + +#define PRIiMAX "I64i" + +#define PRIo8 "o" +#define PRIo16 "o" +#define PRIo32 "o" +#define PRIo64 "I64o" + +#define PRIoLEAST8 "o" +#define PRIoLEAST16 "o" +#define PRIoLEAST32 "o" +#define PRIoLEAST64 "I64o" + +#define PRIoFAST8 "o" +#define PRIoFAST16 "o" +#define PRIoFAST32 "o" +#define PRIoFAST64 "I64o" + +#define PRIoMAX "I64o" + +/* fprintf macros for unsigned types */ +#define PRIu8 "u" +#define PRIu16 "u" +#define PRIu32 "u" +#define PRIu64 "I64u" + + +#define PRIuLEAST8 "u" +#define PRIuLEAST16 "u" +#define PRIuLEAST32 "u" +#define PRIuLEAST64 "I64u" + +#define PRIuFAST8 "u" +#define PRIuFAST16 "u" +#define PRIuFAST32 "u" +#define PRIuFAST64 "I64u" + +#define PRIuMAX "I64u" + +#define PRIx8 "x" +#define PRIx16 "x" +#define PRIx32 "x" +#define PRIx64 "I64x" + +#define PRIxLEAST8 "x" +#define PRIxLEAST16 "x" +#define PRIxLEAST32 "x" +#define PRIxLEAST64 "I64x" + +#define PRIxFAST8 "x" +#define PRIxFAST16 "x" +#define PRIxFAST32 "x" +#define PRIxFAST64 "I64x" + +#define PRIxMAX "I64x" + +#define PRIX8 "X" +#define PRIX16 "X" +#define PRIX32 "X" +#define PRIX64 "I64X" + +#define PRIXLEAST8 "X" +#define PRIXLEAST16 "X" +#define PRIXLEAST32 "X" +#define PRIXLEAST64 "I64X" + +#define PRIXFAST8 "X" +#define PRIXFAST16 "X" +#define PRIXFAST32 "X" +#define PRIXFAST64 "I64X" + +#define PRIXMAX "I64X" + +/* + * fscanf macros for signed int types + * NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t + * (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have + * no length identifiers + */ + +#define SCNd16 "hd" +#define SCNd32 "d" +#define SCNd64 "I64d" + +#define SCNdLEAST16 "hd" +#define SCNdLEAST32 "d" +#define SCNdLEAST64 "I64d" + +#define SCNdFAST16 "hd" +#define SCNdFAST32 "d" +#define SCNdFAST64 "I64d" + +#define SCNdMAX "I64d" + +#define SCNi16 "hi" +#define SCNi32 "i" +#define SCNi64 "I64i" + +#define SCNiLEAST16 "hi" +#define SCNiLEAST32 "i" +#define SCNiLEAST64 "I64i" + +#define SCNiFAST16 "hi" +#define SCNiFAST32 "i" +#define SCNiFAST64 "I64i" + +#define SCNiMAX "I64i" + +#define SCNo16 "ho" +#define SCNo32 "o" +#define SCNo64 "I64o" + +#define SCNoLEAST16 "ho" +#define SCNoLEAST32 "o" +#define SCNoLEAST64 "I64o" + +#define SCNoFAST16 "ho" +#define SCNoFAST32 "o" +#define SCNoFAST64 "I64o" + +#define SCNoMAX "I64o" + +#define SCNx16 "hx" +#define SCNx32 "x" +#define SCNx64 "I64x" + +#define SCNxLEAST16 "hx" +#define SCNxLEAST32 "x" +#define SCNxLEAST64 "I64x" + +#define SCNxFAST16 "hx" +#define SCNxFAST32 "x" +#define SCNxFAST64 "I64x" + +#define SCNxMAX "I64x" + +/* fscanf macros for unsigned int types */ + +#define SCNu16 "hu" +#define SCNu32 "u" +#define SCNu64 "I64u" + +#define SCNuLEAST16 "hu" +#define SCNuLEAST32 "u" +#define SCNuLEAST64 "I64u" + +#define SCNuFAST16 "hu" +#define SCNuFAST32 "u" +#define SCNuFAST64 "I64u" + +#define SCNuMAX "I64u" + +#ifdef _WIN64 +#define PRIdPTR "I64d" +#define PRIiPTR "I64i" +#define PRIoPTR "I64o" +#define PRIuPTR "I64u" +#define PRIxPTR "I64x" +#define PRIXPTR "I64X" +#define SCNdPTR "I64d" +#define SCNiPTR "I64i" +#define SCNoPTR "I64o" +#define SCNxPTR "I64x" +#define SCNuPTR "I64u" +#else +#define PRIdPTR "d" +#define PRIiPTR "i" +#define PRIoPTR "o" +#define PRIuPTR "u" +#define PRIxPTR "x" +#define PRIXPTR "X" +#define SCNdPTR "d" +#define SCNiPTR "i" +#define SCNoPTR "o" +#define SCNxPTR "x" + #define SCNuPTR "u" +#endif + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +/* + * no length modifier for char types prior to C9x + * MS runtime scanf appears to treat "hh" as "h" + */ + +/* signed char */ +#define SCNd8 "hhd" +#define SCNdLEAST8 "hhd" +#define SCNdFAST8 "hhd" + +#define SCNi8 "hhi" +#define SCNiLEAST8 "hhi" +#define SCNiFAST8 "hhi" + +#define SCNo8 "hho" +#define SCNoLEAST8 "hho" +#define SCNoFAST8 "hho" + +#define SCNx8 "hhx" +#define SCNxLEAST8 "hhx" +#define SCNxFAST8 "hhx" + +/* unsigned char */ +#define SCNu8 "hhu" +#define SCNuLEAST8 "hhu" +#define SCNuFAST8 "hhu" +#endif /* __STDC_VERSION__ >= 199901 */ + + +#ifdef __cplusplus +} +#endif + +#endif /* ndef _INTTYPES_H */ diff --git a/Externals/libusb/msvc/libusb.dsw b/Externals/libusb/msvc/libusb.dsw new file mode 100644 index 0000000000..4e2652e3d4 --- /dev/null +++ b/Externals/libusb/msvc/libusb.dsw @@ -0,0 +1,71 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "libusb_dll"=".\libusb_dll.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "libusb_static"=".\libusb_static.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "listdevs"=".\listdevs.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libusb_static + End Project Dependency +}}} + +############################################################################### + +Project: "xusb"=".\xusb.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libusb_static + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/Externals/libusb/msvc/libusb_2005.sln b/Externals/libusb/msvc/libusb_2005.sln new file mode 100644 index 0000000000..c1dc4421da --- /dev/null +++ b/Externals/libusb/msvc/libusb_2005.sln @@ -0,0 +1,95 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0 (static)", "libusb_static_2005.vcproj", "{5AB6B770-1925-48D5-ABC2-930F3259C020}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0 (dll)", "libusb_dll_2005.vcproj", "{8224C054-5968-4238-832C-167155E7ECC3}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "listdevs", "listdevs_2005.vcproj", "{98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {5AB6B770-1925-48D5-ABC2-930F3259C020} = {5AB6B770-1925-48D5-ABC2-930F3259C020} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xusb", "xusb_2005.vcproj", "{08A6FA39-21B7-4A05-9252-2F9864A5E5A4}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {5AB6B770-1925-48D5-ABC2-930F3259C020} = {5AB6B770-1925-48D5-ABC2-930F3259C020} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress", "stress_2005.vcproj", "{53942EFF-C810-458D-B3CB-EE5CE9F1E781}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {5AB6B770-1925-48D5-ABC2-930F3259C020} = {5AB6B770-1925-48D5-ABC2-930F3259C020} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Debug|Win32.ActiveCfg = Debug|Win32 + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Debug|Win32.Build.0 = Debug|Win32 + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Debug|x64.ActiveCfg = Debug|x64 + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Debug|x64.Build.0 = Debug|x64 + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Release|Win32.ActiveCfg = Release|Win32 + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Release|Win32.Build.0 = Release|Win32 + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Release|x64.ActiveCfg = Release|x64 + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Release|x64.Build.0 = Release|x64 + {8224C054-5968-4238-832C-167155E7ECC3}.Debug|Win32.ActiveCfg = Debug|Win32 + {8224C054-5968-4238-832C-167155E7ECC3}.Debug|Win32.Build.0 = Debug|Win32 + {8224C054-5968-4238-832C-167155E7ECC3}.Debug|x64.ActiveCfg = Debug|x64 + {8224C054-5968-4238-832C-167155E7ECC3}.Debug|x64.Build.0 = Debug|x64 + {8224C054-5968-4238-832C-167155E7ECC3}.Release|Win32.ActiveCfg = Release|Win32 + {8224C054-5968-4238-832C-167155E7ECC3}.Release|Win32.Build.0 = Release|Win32 + {8224C054-5968-4238-832C-167155E7ECC3}.Release|x64.ActiveCfg = Release|x64 + {8224C054-5968-4238-832C-167155E7ECC3}.Release|x64.Build.0 = Release|x64 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Debug|Win32.ActiveCfg = Debug|Win32 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Debug|Win32.Build.0 = Debug|Win32 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Debug|x64.ActiveCfg = Debug|x64 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Debug|x64.Build.0 = Debug|x64 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Release|Win32.ActiveCfg = Release|Win32 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Release|Win32.Build.0 = Release|Win32 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Release|x64.ActiveCfg = Release|x64 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Release|x64.Build.0 = Release|x64 + {08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Debug|Win32.ActiveCfg = Debug|Win32 + {08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Debug|Win32.Build.0 = Debug|Win32 + {08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Debug|x64.ActiveCfg = Debug|x64 + {08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Debug|x64.Build.0 = Debug|x64 + {08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Release|Win32.ActiveCfg = Release|Win32 + {08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Release|Win32.Build.0 = Release|Win32 + {08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Release|x64.ActiveCfg = Release|x64 + {08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Release|x64.Build.0 = Release|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.ActiveCfg = Debug|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.Build.0 = Debug|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.ActiveCfg = Debug|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.Build.0 = Debug|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.ActiveCfg = Release|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.Build.0 = Release|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.ActiveCfg = Release|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Externals/libusb/msvc/libusb_2010.sln b/Externals/libusb/msvc/libusb_2010.sln new file mode 100644 index 0000000000..25da8671f6 --- /dev/null +++ b/Externals/libusb/msvc/libusb_2010.sln @@ -0,0 +1,94 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0 (static)", "libusb_static_2010.vcxproj", "{349EE8F9-7D25-4909-AAF5-FF3FADE72187}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0 (dll)", "libusb_dll_2010.vcxproj", "{349EE8FA-7D25-4909-AAF5-FF3FADE72187}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "listdevs", "listdevs_2010.vcxproj", "{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xusb", "xusb_2010.vcxproj", "{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fxload", "fxload_2010.vcxproj", "{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}" + ProjectSection(ProjectDependencies) = postProject + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} = {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "getopt", "getopt_2010.vcxproj", "{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress", "stress_2010.vcxproj", "{53942EFF-C810-458D-B3CB-EE5CE9F1E781}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hotplugtest", "hotplugtest_2010.vcxproj", "{99D2AC64-DC66-4422-91CE-6715C403C9E5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.Build.0 = Debug|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.ActiveCfg = Debug|x64 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.Build.0 = Debug|x64 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.Build.0 = Release|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|x64.ActiveCfg = Release|x64 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|x64.Build.0 = Release|x64 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.ActiveCfg = Debug|x64 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|x64.ActiveCfg = Release|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.ActiveCfg = Debug|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.Build.0 = Debug|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.ActiveCfg = Debug|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.Build.0 = Debug|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.ActiveCfg = Release|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.Build.0 = Release|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.ActiveCfg = Release|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.Build.0 = Release|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.ActiveCfg = Debug|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.Build.0 = Debug|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|x64.ActiveCfg = Debug|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|x64.Build.0 = Debug|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.ActiveCfg = Release|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.Build.0 = Release|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.ActiveCfg = Release|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.Build.0 = Release|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|Win32.ActiveCfg = Debug|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|Win32.Build.0 = Debug|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|x64.ActiveCfg = Debug|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|x64.Build.0 = Debug|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|Win32.ActiveCfg = Release|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|Win32.Build.0 = Release|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|x64.ActiveCfg = Release|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|x64.Build.0 = Release|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.ActiveCfg = Debug|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.Build.0 = Debug|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.ActiveCfg = Debug|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.Build.0 = Debug|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.ActiveCfg = Release|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.Build.0 = Release|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.ActiveCfg = Release|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.Build.0 = Release|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.ActiveCfg = Debug|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.Build.0 = Debug|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.ActiveCfg = Debug|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.Build.0 = Debug|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.ActiveCfg = Release|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.Build.0 = Release|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.ActiveCfg = Release|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.Build.0 = Release|x64 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|Win32.ActiveCfg = Debug|Win32 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|Win32.Build.0 = Debug|Win32 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|x64.ActiveCfg = Debug|x64 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|x64.Build.0 = Debug|x64 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|Win32.ActiveCfg = Release|Win32 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|Win32.Build.0 = Release|Win32 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|x64.ActiveCfg = Release|x64 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Externals/libusb/msvc/libusb_2012.sln b/Externals/libusb/msvc/libusb_2012.sln new file mode 100644 index 0000000000..d1e3e93932 --- /dev/null +++ b/Externals/libusb/msvc/libusb_2012.sln @@ -0,0 +1,94 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0 (static)", "libusb_static_2012.vcxproj", "{349EE8F9-7D25-4909-AAF5-FF3FADE72187}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0 (dll)", "libusb_dll_2012.vcxproj", "{349EE8FA-7D25-4909-AAF5-FF3FADE72187}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "listdevs", "listdevs_2012.vcxproj", "{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xusb", "xusb_2012.vcxproj", "{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fxload", "fxload_2012.vcxproj", "{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}" + ProjectSection(ProjectDependencies) = postProject + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} = {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "getopt", "getopt_2012.vcxproj", "{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress", "stress_2012.vcxproj", "{53942EFF-C810-458D-B3CB-EE5CE9F1E781}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hotplugtest", "hotplugtest_2012.vcxproj", "{99D2AC64-DC66-4422-91CE-6715C403C9E5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.Build.0 = Debug|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.ActiveCfg = Debug|x64 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.Build.0 = Debug|x64 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.Build.0 = Release|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|x64.ActiveCfg = Release|x64 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|x64.Build.0 = Release|x64 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.ActiveCfg = Debug|x64 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|x64.ActiveCfg = Release|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.ActiveCfg = Debug|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.Build.0 = Debug|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.ActiveCfg = Debug|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.Build.0 = Debug|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.ActiveCfg = Release|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.Build.0 = Release|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.ActiveCfg = Release|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.Build.0 = Release|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.ActiveCfg = Debug|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.Build.0 = Debug|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|x64.ActiveCfg = Debug|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|x64.Build.0 = Debug|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.ActiveCfg = Release|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.Build.0 = Release|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.ActiveCfg = Release|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.Build.0 = Release|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|Win32.ActiveCfg = Debug|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|Win32.Build.0 = Debug|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|x64.ActiveCfg = Debug|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|x64.Build.0 = Debug|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|Win32.ActiveCfg = Release|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|Win32.Build.0 = Release|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|x64.ActiveCfg = Release|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|x64.Build.0 = Release|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.ActiveCfg = Debug|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.Build.0 = Debug|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.ActiveCfg = Debug|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.Build.0 = Debug|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.ActiveCfg = Release|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.Build.0 = Release|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.ActiveCfg = Release|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.Build.0 = Release|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.ActiveCfg = Debug|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.Build.0 = Debug|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.ActiveCfg = Debug|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.Build.0 = Debug|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.ActiveCfg = Release|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.Build.0 = Release|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.ActiveCfg = Release|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.Build.0 = Release|x64 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|Win32.ActiveCfg = Debug|Win32 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|Win32.Build.0 = Debug|Win32 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|x64.ActiveCfg = Debug|x64 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|x64.Build.0 = Debug|x64 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|Win32.ActiveCfg = Release|Win32 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|Win32.Build.0 = Release|Win32 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|x64.ActiveCfg = Release|x64 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Externals/libusb/msvc/libusb_2013.sln b/Externals/libusb/msvc/libusb_2013.sln new file mode 100644 index 0000000000..58cc316162 --- /dev/null +++ b/Externals/libusb/msvc/libusb_2013.sln @@ -0,0 +1,100 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0 (static)", "libusb_static_2013.vcxproj", "{349EE8F9-7D25-4909-AAF5-FF3FADE72187}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0 (dll)", "libusb_dll_2013.vcxproj", "{349EE8FA-7D25-4909-AAF5-FF3FADE72187}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "listdevs", "listdevs_2013.vcxproj", "{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xusb", "xusb_2013.vcxproj", "{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fxload", "fxload_2013.vcxproj", "{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}" + ProjectSection(ProjectDependencies) = postProject + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} = {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "getopt", "getopt_2013.vcxproj", "{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress", "stress_2013.vcxproj", "{53942EFF-C810-458D-B3CB-EE5CE9F1E781}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hotplugtest", "hotplugtest_2013.vcxproj", "{99D2AC64-DC66-4422-91CE-6715C403C9E5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.Build.0 = Debug|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.ActiveCfg = Debug|x64 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.Build.0 = Debug|x64 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.Build.0 = Release|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|x64.ActiveCfg = Release|x64 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|x64.Build.0 = Release|x64 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.Build.0 = Debug|Win32 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.ActiveCfg = Debug|x64 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.Build.0 = Debug|x64 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.Build.0 = Release|Win32 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|x64.ActiveCfg = Release|x64 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|x64.Build.0 = Release|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.ActiveCfg = Debug|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.Build.0 = Debug|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.ActiveCfg = Debug|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.Build.0 = Debug|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.ActiveCfg = Release|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.Build.0 = Release|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.ActiveCfg = Release|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.Build.0 = Release|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.ActiveCfg = Debug|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.Build.0 = Debug|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|x64.ActiveCfg = Debug|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|x64.Build.0 = Debug|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.ActiveCfg = Release|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.Build.0 = Release|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.ActiveCfg = Release|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.Build.0 = Release|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|Win32.ActiveCfg = Debug|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|Win32.Build.0 = Debug|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|x64.ActiveCfg = Debug|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|x64.Build.0 = Debug|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|Win32.ActiveCfg = Release|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|Win32.Build.0 = Release|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|x64.ActiveCfg = Release|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|x64.Build.0 = Release|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.ActiveCfg = Debug|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.Build.0 = Debug|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.ActiveCfg = Debug|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.Build.0 = Debug|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.ActiveCfg = Release|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.Build.0 = Release|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.ActiveCfg = Release|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.Build.0 = Release|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.ActiveCfg = Debug|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.Build.0 = Debug|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.ActiveCfg = Debug|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.Build.0 = Debug|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.ActiveCfg = Release|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.Build.0 = Release|Win32 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.ActiveCfg = Release|x64 + {53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.Build.0 = Release|x64 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|Win32.ActiveCfg = Debug|Win32 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|Win32.Build.0 = Debug|Win32 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|x64.ActiveCfg = Debug|x64 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|x64.Build.0 = Debug|x64 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|Win32.ActiveCfg = Release|Win32 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|Win32.Build.0 = Release|Win32 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|x64.ActiveCfg = Release|x64 + {99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Externals/libusb/msvc/libusb_dll.dsp b/Externals/libusb/msvc/libusb_dll.dsp new file mode 100644 index 0000000000..34f4bdaedc --- /dev/null +++ b/Externals/libusb/msvc/libusb_dll.dsp @@ -0,0 +1,194 @@ +# Microsoft Developer Studio Project File - Name="libusb_dll" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=libusb_dll - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libusb_dll.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libusb_dll.mak" CFG="libusb_dll - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libusb_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libusb_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libusb_dll - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../Win32/Release/dll" +# PROP Intermediate_Dir "../Win32/Release/dll" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "LIBUSB_DLL_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../libusb" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /D "_USRDLL" /FR /FD /EHsc /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"Win32/Release/dll/libusb-1.0.dll" + +!ELSEIF "$(CFG)" == "libusb_dll - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../Win32/Debug/dll" +# PROP Intermediate_Dir "../Win32/Debug/dll" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "LIBUSB_DLL_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "../libusb" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /D "_USRDLL" /FR /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo /n +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Win32/Debug/dll/libusb-1.0.dll" +# SUBTRACT LINK32 /pdb:none /incremental:no + +!ENDIF + +# Begin Target + +# Name "libusb_dll - Win32 Release" +# Name "libusb_dll - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\libusb\core.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\darwin_usb.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=..\libusb\descriptor.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\io.c +# End Source File +# Begin Source File + +SOURCE="..\libusb\libusb-1.0.rc" +# End Source File +# Begin Source File + +SOURCE="..\libusb\libusb-1.0.def" +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\linux_usbfs.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\poll_windows.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\sync.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\threads_windows.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\windows_usb.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\config.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\darwin_usb.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\libusb.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\libusbi.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\linux_usbfs.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\poll_posix.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\poll_windows.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\threads_posix.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\threads_windows.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\windows_usb.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\windows_common.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/Externals/libusb/msvc/libusb_dll_2005.vcproj b/Externals/libusb/msvc/libusb_dll_2005.vcproj new file mode 100644 index 0000000000..347aa9591c --- /dev/null +++ b/Externals/libusb/msvc/libusb_dll_2005.vcproj @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Externals/libusb/msvc/libusb_dll_2010.vcxproj b/Externals/libusb/msvc/libusb_dll_2010.vcxproj new file mode 100644 index 0000000000..89433d59be --- /dev/null +++ b/Externals/libusb/msvc/libusb_dll_2010.vcxproj @@ -0,0 +1,170 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + libusb-1.0 (dll) + {349EE8FA-7D25-4909-AAF5-FF3FADE72187} + libusbdll + + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + libusb-1.0 + libusb-1.0 + libusb-1.0 + libusb-1.0 + + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level4 + ProgramDatabase + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + true + + + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level4 + ProgramDatabase + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + true + + + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level4 + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + + + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level4 + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/libusb_dll_2010.vcxproj.filters b/Externals/libusb/msvc/libusb_dll_2010.vcxproj.filters new file mode 100644 index 0000000000..c3714de399 --- /dev/null +++ b/Externals/libusb/msvc/libusb_dll_2010.vcxproj.filters @@ -0,0 +1,81 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {d81e81ca-b13e-4a15-b54b-b12b41361e6b} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/libusb_dll_2012.vcxproj b/Externals/libusb/msvc/libusb_dll_2012.vcxproj new file mode 100644 index 0000000000..a26d240700 --- /dev/null +++ b/Externals/libusb/msvc/libusb_dll_2012.vcxproj @@ -0,0 +1,175 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + libusb-1.0 (dll) + {349EE8FA-7D25-4909-AAF5-FF3FADE72187} + libusbdll + + + + DynamicLibrary + Unicode + true + v110 + + + DynamicLibrary + Unicode + v110 + + + DynamicLibrary + Unicode + true + v110 + + + DynamicLibrary + Unicode + v110 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + libusb-1.0 + libusb-1.0 + libusb-1.0 + libusb-1.0 + + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level4 + ProgramDatabase + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + true + + + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level4 + ProgramDatabase + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + true + + + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level4 + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + + + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level4 + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/libusb_dll_2012.vcxproj.filters b/Externals/libusb/msvc/libusb_dll_2012.vcxproj.filters new file mode 100644 index 0000000000..f00a0d098a --- /dev/null +++ b/Externals/libusb/msvc/libusb_dll_2012.vcxproj.filters @@ -0,0 +1,84 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {d81e81ca-b13e-4a15-b54b-b12b41361e6b} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/libusb_dll_2013.vcxproj b/Externals/libusb/msvc/libusb_dll_2013.vcxproj new file mode 100644 index 0000000000..5881c6dfee --- /dev/null +++ b/Externals/libusb/msvc/libusb_dll_2013.vcxproj @@ -0,0 +1,175 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + libusb-1.0 (dll) + {349EE8FA-7D25-4909-AAF5-FF3FADE72187} + libusbdll + + + + DynamicLibrary + Unicode + true + v120 + + + DynamicLibrary + Unicode + v120 + + + DynamicLibrary + Unicode + true + v120 + + + DynamicLibrary + Unicode + v120 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + libusb-1.0 + libusb-1.0 + libusb-1.0 + libusb-1.0 + + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level4 + ProgramDatabase + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + true + + + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level4 + ProgramDatabase + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + true + + + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level4 + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + + + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level4 + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/libusb_dll_wince.vcproj b/Externals/libusb/msvc/libusb_dll_wince.vcproj new file mode 100644 index 0000000000..77b1858b03 --- /dev/null +++ b/Externals/libusb/msvc/libusb_dll_wince.vcproj @@ -0,0 +1,1243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Externals/libusbx/msvc/libusb_sources b/Externals/libusb/msvc/libusb_sources similarity index 100% rename from Externals/libusbx/msvc/libusb_sources rename to Externals/libusb/msvc/libusb_sources diff --git a/Externals/libusbx/msvc/libusb_static.dsp b/Externals/libusb/msvc/libusb_static.dsp similarity index 96% rename from Externals/libusbx/msvc/libusb_static.dsp rename to Externals/libusb/msvc/libusb_static.dsp index afdbbeddb2..d703a58ef3 100644 --- a/Externals/libusbx/msvc/libusb_static.dsp +++ b/Externals/libusb/msvc/libusb_static.dsp @@ -1,174 +1,174 @@ -# Microsoft Developer Studio Project File - Name="libusb_static" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=libusb_static - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libusb_static.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libusb_static.mak" CFG="libusb_static - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libusb_static - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libusb_static - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libusb_static - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../Win32/Release/lib" -# PROP Intermediate_Dir "../Win32/Release/lib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../libusb" /D "WIN32" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /D "_LIB" /FR /FD /EHsc /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"../Win32/Release/lib/libusb-1.0.lib" - -!ELSEIF "$(CFG)" == "libusb_static - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../Win32/Debug/lib" -# PROP Intermediate_Dir "../Win32/Debug/lib" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "../libusb" /D "WIN32" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /D "_LIB" /FR /FD /GZ /EHsc /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo /n -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"../Win32/Debug/lib/libusb-1.0.lib" - -!ENDIF - -# Begin Target - -# Name "libusb_static - Win32 Release" -# Name "libusb_static - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\libusb\core.c -# End Source File -# Begin Source File - -SOURCE=..\libusb\os\darwin_usb.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=..\libusb\descriptor.c -# End Source File -# Begin Source File - -SOURCE=..\libusb\io.c -# End Source File -# Begin Source File - -SOURCE=..\libusb\os\linux_usbfs.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=..\libusb\os\poll_windows.c -# End Source File -# Begin Source File - -SOURCE=..\libusb\sync.c -# End Source File -# Begin Source File - -SOURCE=..\libusb\os\threads_windows.c -# End Source File -# Begin Source File - -SOURCE=..\libusb\os\windows_usb.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\config.h -# End Source File -# Begin Source File - -SOURCE=..\libusb\os\darwin_usb.h -# End Source File -# Begin Source File - -SOURCE=..\libusb\libusb.h -# End Source File -# Begin Source File - -SOURCE=..\libusb\libusbi.h -# End Source File -# Begin Source File - -SOURCE=..\libusb\os\linux_usbfs.h -# End Source File -# Begin Source File - -SOURCE=..\libusb\os\poll_posix.h -# End Source File -# Begin Source File - -SOURCE=..\libusb\os\poll_windows.h -# End Source File -# Begin Source File - -SOURCE=..\libusb\os\threads_posix.h -# End Source File -# Begin Source File - -SOURCE=..\libusb\os\threads_windows.h -# End Source File -# Begin Source File - -SOURCE=..\libusb\os\windows_usb.h -# End Source File -# Begin Source File - -SOURCE=..\libusb\os\windows_common.h -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="libusb_static" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libusb_static - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libusb_static.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libusb_static.mak" CFG="libusb_static - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libusb_static - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libusb_static - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libusb_static - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../Win32/Release/lib" +# PROP Intermediate_Dir "../Win32/Release/lib" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../libusb" /D "WIN32" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /D "_LIB" /FR /FD /EHsc /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"../Win32/Release/lib/libusb-1.0.lib" + +!ELSEIF "$(CFG)" == "libusb_static - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../Win32/Debug/lib" +# PROP Intermediate_Dir "../Win32/Debug/lib" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "../libusb" /D "WIN32" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /D "_LIB" /FR /FD /GZ /EHsc /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo /n +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"../Win32/Debug/lib/libusb-1.0.lib" + +!ENDIF + +# Begin Target + +# Name "libusb_static - Win32 Release" +# Name "libusb_static - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\libusb\core.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\darwin_usb.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=..\libusb\descriptor.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\io.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\linux_usbfs.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\poll_windows.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\sync.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\threads_windows.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\windows_usb.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\config.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\darwin_usb.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\libusb.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\libusbi.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\linux_usbfs.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\poll_posix.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\poll_windows.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\threads_posix.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\threads_windows.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\windows_usb.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\windows_common.h +# End Source File +# End Group +# End Target +# End Project diff --git a/Externals/libusb/msvc/libusb_static_2005.vcproj b/Externals/libusb/msvc/libusb_static_2005.vcproj new file mode 100644 index 0000000000..18f92f9a1b --- /dev/null +++ b/Externals/libusb/msvc/libusb_static_2005.vcproj @@ -0,0 +1,362 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Externals/libusb/msvc/libusb_static_2010.vcxproj b/Externals/libusb/msvc/libusb_static_2010.vcxproj new file mode 100644 index 0000000000..c6fea1b415 --- /dev/null +++ b/Externals/libusb/msvc/libusb_static_2010.vcxproj @@ -0,0 +1,156 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + libusb-1.0 (static) + {349EE8F9-7D25-4909-AAF5-FF3FADE72187} + libusb + + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + libusb-1.0 + libusb-1.0 + libusb-1.0 + libusb-1.0 + + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebug + Level4 + ProgramDatabase + + + $(OutDir)libusb-1.0.lib + + + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebug + Level4 + ProgramDatabase + + + $(OutDir)libusb-1.0.lib + + + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level4 + + + $(OutDir)libusb-1.0.lib + + + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level4 + + + $(OutDir)libusb-1.0.lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusbx/msvc/libusb_static_2013.vcxproj.filters b/Externals/libusb/msvc/libusb_static_2010.vcxproj.filters similarity index 95% rename from Externals/libusbx/msvc/libusb_static_2013.vcxproj.filters rename to Externals/libusb/msvc/libusb_static_2010.vcxproj.filters index ccb10a17b7..62770c5f40 100644 --- a/Externals/libusbx/msvc/libusb_static_2013.vcxproj.filters +++ b/Externals/libusb/msvc/libusb_static_2010.vcxproj.filters @@ -1,74 +1,74 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + \ No newline at end of file diff --git a/Externals/libusb/msvc/libusb_static_2012.vcxproj b/Externals/libusb/msvc/libusb_static_2012.vcxproj new file mode 100644 index 0000000000..7bd8c6851a --- /dev/null +++ b/Externals/libusb/msvc/libusb_static_2012.vcxproj @@ -0,0 +1,160 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + libusb-1.0 (static) + {349EE8F9-7D25-4909-AAF5-FF3FADE72187} + libusb + + + + StaticLibrary + Unicode + true + v110 + + + StaticLibrary + Unicode + v110 + + + StaticLibrary + Unicode + true + v110 + + + StaticLibrary + Unicode + v110 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + libusb-1.0 + libusb-1.0 + libusb-1.0 + libusb-1.0 + + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebug + Level4 + ProgramDatabase + + + $(OutDir)libusb-1.0.lib + + + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebug + Level4 + ProgramDatabase + + + $(OutDir)libusb-1.0.lib + + + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level4 + + + $(OutDir)libusb-1.0.lib + + + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level4 + + + $(OutDir)libusb-1.0.lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/libusb_static_2012.vcxproj.filters b/Externals/libusb/msvc/libusb_static_2012.vcxproj.filters new file mode 100644 index 0000000000..62770c5f40 --- /dev/null +++ b/Externals/libusb/msvc/libusb_static_2012.vcxproj.filters @@ -0,0 +1,74 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/libusb_static_2013.vcxproj b/Externals/libusb/msvc/libusb_static_2013.vcxproj new file mode 100644 index 0000000000..0f71d7fd5d --- /dev/null +++ b/Externals/libusb/msvc/libusb_static_2013.vcxproj @@ -0,0 +1,160 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + libusb-1.0 (static) + {349EE8F9-7D25-4909-AAF5-FF3FADE72187} + libusb + + + + StaticLibrary + Unicode + true + v120 + + + StaticLibrary + Unicode + v120 + + + StaticLibrary + Unicode + true + v120 + + + StaticLibrary + Unicode + v120 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + libusb-1.0 + libusb-1.0 + libusb-1.0 + libusb-1.0 + + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebug + Level4 + ProgramDatabase + + + $(OutDir)libusb-1.0.lib + + + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebug + Level4 + ProgramDatabase + + + $(OutDir)libusb-1.0.lib + + + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level4 + + + $(OutDir)libusb-1.0.lib + + + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level4 + + + $(OutDir)libusb-1.0.lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusbx/msvc/libusb_static_wince.vcproj b/Externals/libusb/msvc/libusb_static_wince.vcproj similarity index 95% rename from Externals/libusbx/msvc/libusb_static_wince.vcproj rename to Externals/libusb/msvc/libusb_static_wince.vcproj index a595319848..57db8cd40b 100644 --- a/Externals/libusbx/msvc/libusb_static_wince.vcproj +++ b/Externals/libusb/msvc/libusb_static_wince.vcproj @@ -1,1185 +1,1185 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Externals/libusb/msvc/libusb_wince.sln b/Externals/libusb/msvc/libusb_wince.sln new file mode 100644 index 0000000000..51c310d310 --- /dev/null +++ b/Externals/libusb/msvc/libusb_wince.sln @@ -0,0 +1,246 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0 (dll)", "libusb_dll_wince.vcproj", "{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "listdevs", "listdevs_wince.vcproj", "{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xusb", "xusb_wince.vcproj", "{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0 (static)", "libusb_static_wince.vcproj", "{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress", "stress_wince.vcproj", "{61476624-3354-48C8-9334-85AC0D624640}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|STANDARDSDK_500 (ARMV4I) = Debug|STANDARDSDK_500 (ARMV4I) + Debug|STANDARDSDK_500 (MIPSII) = Debug|STANDARDSDK_500 (MIPSII) + Debug|STANDARDSDK_500 (MIPSII_FP) = Debug|STANDARDSDK_500 (MIPSII_FP) + Debug|STANDARDSDK_500 (MIPSIV) = Debug|STANDARDSDK_500 (MIPSIV) + Debug|STANDARDSDK_500 (MIPSIV_FP) = Debug|STANDARDSDK_500 (MIPSIV_FP) + Debug|STANDARDSDK_500 (SH4) = Debug|STANDARDSDK_500 (SH4) + Debug|STANDARDSDK_500 (x86) = Debug|STANDARDSDK_500 (x86) + Release|STANDARDSDK_500 (ARMV4I) = Release|STANDARDSDK_500 (ARMV4I) + Release|STANDARDSDK_500 (MIPSII) = Release|STANDARDSDK_500 (MIPSII) + Release|STANDARDSDK_500 (MIPSII_FP) = Release|STANDARDSDK_500 (MIPSII_FP) + Release|STANDARDSDK_500 (MIPSIV) = Release|STANDARDSDK_500 (MIPSIV) + Release|STANDARDSDK_500 (MIPSIV_FP) = Release|STANDARDSDK_500 (MIPSIV_FP) + Release|STANDARDSDK_500 (SH4) = Release|STANDARDSDK_500 (SH4) + Release|STANDARDSDK_500 (x86) = Release|STANDARDSDK_500 (x86) + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (ARMV4I).ActiveCfg = Debug|STANDARDSDK_500 (ARMV4I) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (ARMV4I).Build.0 = Debug|STANDARDSDK_500 (ARMV4I) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (ARMV4I).Deploy.0 = Debug|STANDARDSDK_500 (ARMV4I) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSII).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSII).Build.0 = Debug|STANDARDSDK_500 (MIPSII) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSII).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII_FP) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSII_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSII_FP) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII_FP) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSIV).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSIV).Build.0 = Debug|STANDARDSDK_500 (MIPSIV) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSIV).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV_FP) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSIV_FP) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV_FP) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (SH4).ActiveCfg = Debug|STANDARDSDK_500 (SH4) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (SH4).Build.0 = Debug|STANDARDSDK_500 (SH4) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (SH4).Deploy.0 = Debug|STANDARDSDK_500 (SH4) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (x86).ActiveCfg = Debug|STANDARDSDK_500 (x86) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (x86).Build.0 = Debug|STANDARDSDK_500 (x86) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (x86).Deploy.0 = Debug|STANDARDSDK_500 (x86) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (ARMV4I).ActiveCfg = Release|STANDARDSDK_500 (ARMV4I) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (ARMV4I).Build.0 = Release|STANDARDSDK_500 (ARMV4I) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (ARMV4I).Deploy.0 = Release|STANDARDSDK_500 (ARMV4I) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSII).ActiveCfg = Release|STANDARDSDK_500 (MIPSII) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSII).Build.0 = Release|STANDARDSDK_500 (MIPSII) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSII).Deploy.0 = Release|STANDARDSDK_500 (MIPSII) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSII_FP) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSII_FP).Build.0 = Release|STANDARDSDK_500 (MIPSII_FP) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSII_FP) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSIV).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSIV).Build.0 = Release|STANDARDSDK_500 (MIPSIV) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSIV).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV_FP) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Release|STANDARDSDK_500 (MIPSIV_FP) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV_FP) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (SH4).ActiveCfg = Release|STANDARDSDK_500 (SH4) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (SH4).Build.0 = Release|STANDARDSDK_500 (SH4) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (SH4).Deploy.0 = Release|STANDARDSDK_500 (SH4) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (x86).ActiveCfg = Release|STANDARDSDK_500 (x86) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (x86).Build.0 = Release|STANDARDSDK_500 (x86) + {6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (x86).Deploy.0 = Release|STANDARDSDK_500 (x86) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (ARMV4I).ActiveCfg = Debug|STANDARDSDK_500 (ARMV4I) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (ARMV4I).Build.0 = Debug|STANDARDSDK_500 (ARMV4I) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (ARMV4I).Deploy.0 = Debug|STANDARDSDK_500 (ARMV4I) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSII).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSII).Build.0 = Debug|STANDARDSDK_500 (MIPSII) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSII).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII_FP) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSII_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSII_FP) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII_FP) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSIV).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSIV).Build.0 = Debug|STANDARDSDK_500 (MIPSIV) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSIV).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV_FP) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSIV_FP) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV_FP) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (SH4).ActiveCfg = Debug|STANDARDSDK_500 (SH4) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (SH4).Build.0 = Debug|STANDARDSDK_500 (SH4) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (SH4).Deploy.0 = Debug|STANDARDSDK_500 (SH4) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (x86).ActiveCfg = Debug|STANDARDSDK_500 (x86) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (x86).Build.0 = Debug|STANDARDSDK_500 (x86) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (x86).Deploy.0 = Debug|STANDARDSDK_500 (x86) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (ARMV4I).ActiveCfg = Release|STANDARDSDK_500 (ARMV4I) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (ARMV4I).Build.0 = Release|STANDARDSDK_500 (ARMV4I) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (ARMV4I).Deploy.0 = Release|STANDARDSDK_500 (ARMV4I) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSII).ActiveCfg = Release|STANDARDSDK_500 (MIPSII) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSII).Build.0 = Release|STANDARDSDK_500 (MIPSII) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSII).Deploy.0 = Release|STANDARDSDK_500 (MIPSII) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSII_FP) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSII_FP).Build.0 = Release|STANDARDSDK_500 (MIPSII_FP) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSII_FP) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSIV).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSIV).Build.0 = Release|STANDARDSDK_500 (MIPSIV) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSIV).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV_FP) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Release|STANDARDSDK_500 (MIPSIV_FP) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV_FP) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (SH4).ActiveCfg = Release|STANDARDSDK_500 (SH4) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (SH4).Build.0 = Release|STANDARDSDK_500 (SH4) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (SH4).Deploy.0 = Release|STANDARDSDK_500 (SH4) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (x86).ActiveCfg = Release|STANDARDSDK_500 (x86) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (x86).Build.0 = Release|STANDARDSDK_500 (x86) + {960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (x86).Deploy.0 = Release|STANDARDSDK_500 (x86) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (ARMV4I).ActiveCfg = Debug|STANDARDSDK_500 (ARMV4I) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (ARMV4I).Build.0 = Debug|STANDARDSDK_500 (ARMV4I) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (ARMV4I).Deploy.0 = Debug|STANDARDSDK_500 (ARMV4I) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSII).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSII).Build.0 = Debug|STANDARDSDK_500 (MIPSII) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSII).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII_FP) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSII_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSII_FP) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII_FP) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSIV).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSIV).Build.0 = Debug|STANDARDSDK_500 (MIPSIV) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSIV).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV_FP) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSIV_FP) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV_FP) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (SH4).ActiveCfg = Debug|STANDARDSDK_500 (SH4) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (SH4).Build.0 = Debug|STANDARDSDK_500 (SH4) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (SH4).Deploy.0 = Debug|STANDARDSDK_500 (SH4) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (x86).ActiveCfg = Debug|STANDARDSDK_500 (x86) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (x86).Build.0 = Debug|STANDARDSDK_500 (x86) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (x86).Deploy.0 = Debug|STANDARDSDK_500 (x86) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (ARMV4I).ActiveCfg = Release|STANDARDSDK_500 (ARMV4I) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (ARMV4I).Build.0 = Release|STANDARDSDK_500 (ARMV4I) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (ARMV4I).Deploy.0 = Release|STANDARDSDK_500 (ARMV4I) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSII).ActiveCfg = Release|STANDARDSDK_500 (MIPSII) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSII).Build.0 = Release|STANDARDSDK_500 (MIPSII) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSII).Deploy.0 = Release|STANDARDSDK_500 (MIPSII) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSII_FP) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSII_FP).Build.0 = Release|STANDARDSDK_500 (MIPSII_FP) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSII_FP) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSIV).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSIV).Build.0 = Release|STANDARDSDK_500 (MIPSIV) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSIV).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV_FP) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Release|STANDARDSDK_500 (MIPSIV_FP) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV_FP) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (SH4).ActiveCfg = Release|STANDARDSDK_500 (SH4) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (SH4).Build.0 = Release|STANDARDSDK_500 (SH4) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (SH4).Deploy.0 = Release|STANDARDSDK_500 (SH4) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (x86).ActiveCfg = Release|STANDARDSDK_500 (x86) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (x86).Build.0 = Release|STANDARDSDK_500 (x86) + {93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (x86).Deploy.0 = Release|STANDARDSDK_500 (x86) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (ARMV4I).ActiveCfg = Debug|STANDARDSDK_500 (ARMV4I) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (ARMV4I).Build.0 = Debug|STANDARDSDK_500 (ARMV4I) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (ARMV4I).Deploy.0 = Debug|STANDARDSDK_500 (ARMV4I) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSII).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSII).Build.0 = Debug|STANDARDSDK_500 (MIPSII) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSII).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII_FP) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSII_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSII_FP) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII_FP) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSIV).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSIV).Build.0 = Debug|STANDARDSDK_500 (MIPSIV) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSIV).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV_FP) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSIV_FP) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV_FP) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (SH4).ActiveCfg = Debug|STANDARDSDK_500 (SH4) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (SH4).Build.0 = Debug|STANDARDSDK_500 (SH4) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (SH4).Deploy.0 = Debug|STANDARDSDK_500 (SH4) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (x86).ActiveCfg = Debug|STANDARDSDK_500 (x86) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (x86).Build.0 = Debug|STANDARDSDK_500 (x86) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (x86).Deploy.0 = Debug|STANDARDSDK_500 (x86) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (ARMV4I).ActiveCfg = Release|STANDARDSDK_500 (ARMV4I) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (ARMV4I).Build.0 = Release|STANDARDSDK_500 (ARMV4I) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (ARMV4I).Deploy.0 = Release|STANDARDSDK_500 (ARMV4I) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSII).ActiveCfg = Release|STANDARDSDK_500 (MIPSII) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSII).Build.0 = Release|STANDARDSDK_500 (MIPSII) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSII).Deploy.0 = Release|STANDARDSDK_500 (MIPSII) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSII_FP) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSII_FP).Build.0 = Release|STANDARDSDK_500 (MIPSII_FP) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSII_FP) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSIV).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSIV).Build.0 = Release|STANDARDSDK_500 (MIPSIV) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSIV).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV_FP) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Release|STANDARDSDK_500 (MIPSIV_FP) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV_FP) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (SH4).ActiveCfg = Release|STANDARDSDK_500 (SH4) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (SH4).Build.0 = Release|STANDARDSDK_500 (SH4) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (SH4).Deploy.0 = Release|STANDARDSDK_500 (SH4) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (x86).ActiveCfg = Release|STANDARDSDK_500 (x86) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (x86).Build.0 = Release|STANDARDSDK_500 (x86) + {CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (x86).Deploy.0 = Release|STANDARDSDK_500 (x86) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (ARMV4I).ActiveCfg = Debug|STANDARDSDK_500 (ARMV4I) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (ARMV4I).Build.0 = Debug|STANDARDSDK_500 (ARMV4I) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (ARMV4I).Deploy.0 = Debug|STANDARDSDK_500 (ARMV4I) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSII).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSII).Build.0 = Debug|STANDARDSDK_500 (MIPSII) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSII).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII_FP) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSII_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSII_FP) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII_FP) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSIV).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSIV).Build.0 = Debug|STANDARDSDK_500 (MIPSIV) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSIV).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV_FP) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSIV_FP) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV_FP) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (SH4).ActiveCfg = Debug|STANDARDSDK_500 (SH4) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (SH4).Build.0 = Debug|STANDARDSDK_500 (SH4) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (SH4).Deploy.0 = Debug|STANDARDSDK_500 (SH4) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (x86).ActiveCfg = Debug|STANDARDSDK_500 (x86) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (x86).Build.0 = Debug|STANDARDSDK_500 (x86) + {61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (x86).Deploy.0 = Debug|STANDARDSDK_500 (x86) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (ARMV4I).ActiveCfg = Release|STANDARDSDK_500 (ARMV4I) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (ARMV4I).Build.0 = Release|STANDARDSDK_500 (ARMV4I) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (ARMV4I).Deploy.0 = Release|STANDARDSDK_500 (ARMV4I) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSII).ActiveCfg = Release|STANDARDSDK_500 (MIPSII) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSII).Build.0 = Release|STANDARDSDK_500 (MIPSII) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSII).Deploy.0 = Release|STANDARDSDK_500 (MIPSII) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSII_FP) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSII_FP).Build.0 = Release|STANDARDSDK_500 (MIPSII_FP) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSII_FP) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSIV).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSIV).Build.0 = Release|STANDARDSDK_500 (MIPSIV) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSIV).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV_FP) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Release|STANDARDSDK_500 (MIPSIV_FP) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV_FP) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (SH4).ActiveCfg = Release|STANDARDSDK_500 (SH4) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (SH4).Build.0 = Release|STANDARDSDK_500 (SH4) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (SH4).Deploy.0 = Release|STANDARDSDK_500 (SH4) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (x86).ActiveCfg = Release|STANDARDSDK_500 (x86) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (x86).Build.0 = Release|STANDARDSDK_500 (x86) + {61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (x86).Deploy.0 = Release|STANDARDSDK_500 (x86) + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Externals/libusb/msvc/listdevs.dsp b/Externals/libusb/msvc/listdevs.dsp new file mode 100644 index 0000000000..2ed8aec31a --- /dev/null +++ b/Externals/libusb/msvc/listdevs.dsp @@ -0,0 +1,103 @@ +# Microsoft Developer Studio Project File - Name="listdevs" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=listdevs - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "listdevs.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "listdevs.mak" CFG="listdevs - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "listdevs - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "listdevs - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "listdevs - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../Win32/Release/examples" +# PROP Intermediate_Dir "../Win32/Release/examples/listdevs" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "../libusb" /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /FR /FD /EHsc /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "listdevs - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../Win32/Debug/examples" +# PROP Intermediate_Dir "../Win32/Debug/examples/listdevs" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../libusb" /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /FR /FD /GZ /EHsc /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo /n "../Win32/Debug/dll/core.sbr" "../Win32/Debug/dll/descriptor.sbr" "../Win32/Debug/dll/io.sbr" "../Win32/Debug/dll/sync.sbr" "../Win32/Debug/dll/poll_windows.sbr" "../Win32/Debug/dll/threads_windows.sbr" "../Win32/Debug/dll/windows_usb.sbr" +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "listdevs - Win32 Release" +# Name "listdevs - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\examples\listdevs.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/Externals/libusb/msvc/listdevs_2005.vcproj b/Externals/libusb/msvc/listdevs_2005.vcproj new file mode 100644 index 0000000000..cff754e0e3 --- /dev/null +++ b/Externals/libusb/msvc/listdevs_2005.vcproj @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Externals/libusb/msvc/listdevs_2010.vcxproj b/Externals/libusb/msvc/listdevs_2010.vcxproj new file mode 100644 index 0000000000..173af38dd1 --- /dev/null +++ b/Externals/libusb/msvc/listdevs_2010.vcxproj @@ -0,0 +1,165 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + listdevs + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87} + examples + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + $(TargetDir)$(ProjectName).pdb + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + $(TargetDir)$(ProjectName).pdb + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + $(TargetDir)$(ProjectName).pdb + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + $(TargetDir)$(ProjectName).pdb + Console + MachineX64 + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/listdevs_2010.vcxproj.filters b/Externals/libusb/msvc/listdevs_2010.vcxproj.filters new file mode 100644 index 0000000000..1378e296c8 --- /dev/null +++ b/Externals/libusb/msvc/listdevs_2010.vcxproj.filters @@ -0,0 +1,14 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/listdevs_2012.vcxproj b/Externals/libusb/msvc/listdevs_2012.vcxproj new file mode 100644 index 0000000000..4ecc865e4f --- /dev/null +++ b/Externals/libusb/msvc/listdevs_2012.vcxproj @@ -0,0 +1,169 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + listdevs + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87} + examples + Win32Proj + + + + Application + Unicode + true + v110 + + + Application + Unicode + v110 + + + Application + Unicode + true + v110 + + + Application + Unicode + v110 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + $(TargetDir)$(ProjectName).pdb + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + $(TargetDir)$(ProjectName).pdb + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + $(TargetDir)$(ProjectName).pdb + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + $(TargetDir)$(ProjectName).pdb + Console + MachineX64 + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/listdevs_2012.vcxproj.filters b/Externals/libusb/msvc/listdevs_2012.vcxproj.filters new file mode 100644 index 0000000000..1378e296c8 --- /dev/null +++ b/Externals/libusb/msvc/listdevs_2012.vcxproj.filters @@ -0,0 +1,14 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/listdevs_2013.vcxproj b/Externals/libusb/msvc/listdevs_2013.vcxproj new file mode 100644 index 0000000000..7289504c9d --- /dev/null +++ b/Externals/libusb/msvc/listdevs_2013.vcxproj @@ -0,0 +1,169 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + listdevs + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87} + examples + Win32Proj + + + + Application + Unicode + true + v120 + + + Application + Unicode + v120 + + + Application + Unicode + true + v120 + + + Application + Unicode + v120 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + $(TargetDir)$(ProjectName).pdb + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + $(TargetDir)$(ProjectName).pdb + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + $(TargetDir)$(ProjectName).pdb + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + $(TargetDir)$(ProjectName).pdb + Console + MachineX64 + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/listdevs_sources b/Externals/libusb/msvc/listdevs_sources new file mode 100644 index 0000000000..97a5723e4c --- /dev/null +++ b/Externals/libusb/msvc/listdevs_sources @@ -0,0 +1,19 @@ +TARGETNAME=listdevs +TARGETTYPE=PROGRAM +386_STDCALL=0 + +_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +!IFDEF STATIC_LIBC +USE_LIBCMT=1 +!ELSE +USE_MSVCRT=1 +!ENDIF + +UMTYPE=console +INCLUDES=..\..\libusb;$(DDK_INC_PATH) +UMLIBS=..\..\libusb\os\obj$(BUILD_ALT_DIR)\*\libusb-1.0.lib +SOURCES=..\listdevs.c diff --git a/Externals/libusb/msvc/listdevs_wince.vcproj b/Externals/libusb/msvc/listdevs_wince.vcproj new file mode 100644 index 0000000000..1bb6c6dca7 --- /dev/null +++ b/Externals/libusb/msvc/listdevs_wince.vcproj @@ -0,0 +1,1120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Externals/libusbx/msvc/missing.c b/Externals/libusb/msvc/missing.c similarity index 100% rename from Externals/libusbx/msvc/missing.c rename to Externals/libusb/msvc/missing.c diff --git a/Externals/libusbx/msvc/missing.h b/Externals/libusb/msvc/missing.h similarity index 100% rename from Externals/libusbx/msvc/missing.h rename to Externals/libusb/msvc/missing.h diff --git a/Externals/libusb/msvc/stdint.h b/Externals/libusb/msvc/stdint.h new file mode 100644 index 0000000000..00988d9bba --- /dev/null +++ b/Externals/libusb/msvc/stdint.h @@ -0,0 +1,256 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file was originally part of the w64 mingw-runtime package. + */ + +/* ISO C9x 7.18 Integer types + * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794) + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * Contributor: Danny Smith + * Modified for libusb/MSVC: Pete Batard + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Date: 2010-04-02 + */ + +#ifndef _MSC_VER +#error This header should only be used with Microsoft compilers +#endif + +#ifndef _STDINT_H +#define _STDINT_H + +#ifndef _INTPTR_T_DEFINED +#define _INTPTR_T_DEFINED +#ifndef __intptr_t_defined +#define __intptr_t_defined +#undef intptr_t +#ifdef _WIN64 + typedef __int64 intptr_t; +#else + typedef int intptr_t; +#endif /* _WIN64 */ +#endif /* __intptr_t_defined */ +#endif /* _INTPTR_T_DEFINED */ + +#ifndef _UINTPTR_T_DEFINED +#define _UINTPTR_T_DEFINED +#ifndef __uintptr_t_defined +#define __uintptr_t_defined +#undef uintptr_t +#ifdef _WIN64 + typedef unsigned __int64 uintptr_t; +#else + typedef unsigned int uintptr_t; +#endif /* _WIN64 */ +#endif /* __uintptr_t_defined */ +#endif /* _UINTPTR_T_DEFINED */ + +#ifndef _PTRDIFF_T_DEFINED +#define _PTRDIFF_T_DEFINED +#ifndef _PTRDIFF_T_ +#define _PTRDIFF_T_ +#undef ptrdiff_t +#ifdef _WIN64 + typedef __int64 ptrdiff_t; +#else + typedef int ptrdiff_t; +#endif /* _WIN64 */ +#endif /* _PTRDIFF_T_ */ +#endif /* _PTRDIFF_T_DEFINED */ + +#ifndef _WCHAR_T_DEFINED +#define _WCHAR_T_DEFINED +#ifndef __cplusplus + typedef unsigned short wchar_t; +#endif /* C++ */ +#endif /* _WCHAR_T_DEFINED */ + +#ifndef _WCTYPE_T_DEFINED +#define _WCTYPE_T_DEFINED +#ifndef _WINT_T +#define _WINT_T + typedef unsigned short wint_t; + typedef unsigned short wctype_t; +#endif /* _WINT_T */ +#endif /* _WCTYPE_T_DEFINED */ + +/* 7.18.1.1 Exact-width integer types */ +typedef __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; + +/* 7.18.1.2 Minimum-width integer types */ +typedef signed char int_least8_t; +typedef unsigned char uint_least8_t; +typedef short int_least16_t; +typedef unsigned short uint_least16_t; +typedef int int_least32_t; +typedef unsigned uint_least32_t; +typedef __int64 int_least64_t; +typedef unsigned __int64 uint_least64_t; + +/* 7.18.1.3 Fastest minimum-width integer types + * Not actually guaranteed to be fastest for all purposes + * Here we use the exact-width types for 8 and 16-bit ints. + */ +typedef __int8 int_fast8_t; +typedef unsigned __int8 uint_fast8_t; +typedef __int16 int_fast16_t; +typedef unsigned __int16 uint_fast16_t; +typedef __int32 int_fast32_t; +typedef unsigned __int32 uint_fast32_t; +typedef __int64 int_fast64_t; +typedef unsigned __int64 uint_fast64_t; + +/* 7.18.1.5 Greatest-width integer types */ +typedef __int64 intmax_t; +typedef unsigned __int64 uintmax_t; + +/* 7.18.2 Limits of specified-width integer types */ + +/* 7.18.2.1 Limits of exact-width integer types */ +#define INT8_MIN (-128) +#define INT16_MIN (-32768) +#define INT32_MIN (-2147483647 - 1) +#define INT64_MIN (-9223372036854775807LL - 1) + +#define INT8_MAX 127 +#define INT16_MAX 32767 +#define INT32_MAX 2147483647 +#define INT64_MAX 9223372036854775807LL + +#define UINT8_MAX 255 +#define UINT16_MAX 65535 +#define UINT32_MAX 0xffffffffU /* 4294967295U */ +#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */ + +/* 7.18.2.2 Limits of minimum-width integer types */ +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST64_MIN INT64_MIN + +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MAX INT64_MAX + +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +/* 7.18.2.3 Limits of fastest minimum-width integer types */ +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST64_MIN INT64_MIN + +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MAX INT64_MAX + +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +/* 7.18.2.4 Limits of integer types capable of holding + object pointers */ +#ifdef _WIN64 +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX +#else +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX +#endif + +/* 7.18.2.5 Limits of greatest-width integer types */ +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +/* 7.18.3 Limits of other integer types */ +#ifdef _WIN64 +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX +#else +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX +#endif + +#define SIG_ATOMIC_MIN INT32_MIN +#define SIG_ATOMIC_MAX INT32_MAX + +#ifndef SIZE_MAX +#ifdef _WIN64 +#define SIZE_MAX UINT64_MAX +#else +#define SIZE_MAX UINT32_MAX +#endif +#endif + +#ifndef WCHAR_MIN /* also in wchar.h */ +#define WCHAR_MIN 0U +#define WCHAR_MAX 0xffffU +#endif + +/* + * wint_t is unsigned short for compatibility with MS runtime + */ +#define WINT_MIN 0U +#define WINT_MAX 0xffffU + + +/* 7.18.4 Macros for integer constants */ + +/* 7.18.4.1 Macros for minimum-width integer constants + + Accoding to Douglas Gwyn : + "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC + 9899:1999 as initially published, the expansion was required + to be an integer constant of precisely matching type, which + is impossible to accomplish for the shorter types on most + platforms, because C99 provides no standard way to designate + an integer constant with width less than that of type int. + TC1 changed this to require just an integer constant + *expression* with *promoted* type." + + The trick used here is from Clive D W Feather. +*/ + +#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val)) +#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val)) +#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val)) +/* The 'trick' doesn't work in C89 for long long because, without + suffix, (val) will be evaluated as int, not intmax_t */ +#define INT64_C(val) val##i64 + +#define UINT8_C(val) (val) +#define UINT16_C(val) (val) +#define UINT32_C(val) (val##i32) +#define UINT64_C(val) val##ui64 + +/* 7.18.4.2 Macros for greatest-width integer constants */ +#define INTMAX_C(val) val##i64 +#define UINTMAX_C(val) val##ui64 + +#endif diff --git a/Externals/libusb/msvc/stress_2005.vcproj b/Externals/libusb/msvc/stress_2005.vcproj new file mode 100644 index 0000000000..ca59d1b97a --- /dev/null +++ b/Externals/libusb/msvc/stress_2005.vcproj @@ -0,0 +1,390 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Externals/libusb/msvc/stress_2010.vcxproj b/Externals/libusb/msvc/stress_2010.vcxproj new file mode 100644 index 0000000000..b6d6b85125 --- /dev/null +++ b/Externals/libusb/msvc/stress_2010.vcxproj @@ -0,0 +1,167 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + stress + {53942EFF-C810-458D-B3CB-EE5CE9F1E781} + tests + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/stress_2010.vcxproj.filters b/Externals/libusb/msvc/stress_2010.vcxproj.filters new file mode 100644 index 0000000000..fca1eb6352 --- /dev/null +++ b/Externals/libusb/msvc/stress_2010.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {28b6220e-d087-4f48-bd69-ffe0ac5bcc7a} + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/stress_2012.vcxproj b/Externals/libusb/msvc/stress_2012.vcxproj new file mode 100644 index 0000000000..c3cdea1bea --- /dev/null +++ b/Externals/libusb/msvc/stress_2012.vcxproj @@ -0,0 +1,171 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + stress + {53942EFF-C810-458D-B3CB-EE5CE9F1E781} + tests + Win32Proj + + + + Application + Unicode + true + v110 + + + Application + Unicode + v110 + + + Application + Unicode + true + v110 + + + Application + Unicode + v110 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/stress_2012.vcxproj.filters b/Externals/libusb/msvc/stress_2012.vcxproj.filters new file mode 100644 index 0000000000..fca1eb6352 --- /dev/null +++ b/Externals/libusb/msvc/stress_2012.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {28b6220e-d087-4f48-bd69-ffe0ac5bcc7a} + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/stress_2013.vcxproj b/Externals/libusb/msvc/stress_2013.vcxproj new file mode 100644 index 0000000000..df1b586360 --- /dev/null +++ b/Externals/libusb/msvc/stress_2013.vcxproj @@ -0,0 +1,171 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + stress + {53942EFF-C810-458D-B3CB-EE5CE9F1E781} + tests + Win32Proj + + + + Application + Unicode + true + v120 + + + Application + Unicode + v120 + + + Application + Unicode + true + v120 + + + Application + Unicode + v120 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\ + $(SolutionDir)..\$(Platform)\$(Configuration)\tests\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/stress_wince.vcproj b/Externals/libusb/msvc/stress_wince.vcproj new file mode 100644 index 0000000000..a0bf46905b --- /dev/null +++ b/Externals/libusb/msvc/stress_wince.vcproj @@ -0,0 +1,1128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Externals/libusb/msvc/xusb.dsp b/Externals/libusb/msvc/xusb.dsp new file mode 100644 index 0000000000..a99178ccd7 --- /dev/null +++ b/Externals/libusb/msvc/xusb.dsp @@ -0,0 +1,102 @@ +# Microsoft Developer Studio Project File - Name="xusb" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=xusb - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "xusb.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "xusb.mak" CFG="xusb - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "xusb - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "xusb - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "xusb - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../Win32/Release/examples" +# PROP Intermediate_Dir "../Win32/Release/examples/xusb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../libusb" /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /FR /FD /EHsc /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "xusb - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "xusb___Win32_Debug" +# PROP BASE Intermediate_Dir "xusb___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../Win32/Debug/examples" +# PROP Intermediate_Dir "../Win32/Debug/examples/xusb" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "../libusb" /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /FR /FD /GZ /EHsc /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo /n "../Win32/Debug/dll/core.sbr" "../Win32/Debug/dll/descriptor.sbr" "../Win32/Debug/dll/io.sbr" "../Win32/Debug/dll/sync.sbr" "../Win32/Debug/dll/poll_windows.sbr" "../Win32/Debug/dll/threads_windows.sbr" "../Win32/Debug/dll/windows_usb.sbr" +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 + +!ENDIF + +# Begin Target + +# Name "xusb - Win32 Release" +# Name "xusb - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\examples\xusb.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/Externals/libusb/msvc/xusb_2005.vcproj b/Externals/libusb/msvc/xusb_2005.vcproj new file mode 100644 index 0000000000..b12f5c13df --- /dev/null +++ b/Externals/libusb/msvc/xusb_2005.vcproj @@ -0,0 +1,344 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Externals/libusb/msvc/xusb_2010.vcxproj b/Externals/libusb/msvc/xusb_2010.vcxproj new file mode 100644 index 0000000000..7c4811d9f7 --- /dev/null +++ b/Externals/libusb/msvc/xusb_2010.vcxproj @@ -0,0 +1,163 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + xusb + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11} + examples + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/xusb_2010.vcxproj.filters b/Externals/libusb/msvc/xusb_2010.vcxproj.filters new file mode 100644 index 0000000000..f71902f455 --- /dev/null +++ b/Externals/libusb/msvc/xusb_2010.vcxproj.filters @@ -0,0 +1,14 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/xusb_2012.vcxproj b/Externals/libusb/msvc/xusb_2012.vcxproj new file mode 100644 index 0000000000..7d64df51d9 --- /dev/null +++ b/Externals/libusb/msvc/xusb_2012.vcxproj @@ -0,0 +1,167 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + xusb + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11} + examples + Win32Proj + + + + Application + Unicode + true + v110 + + + Application + Unicode + v110 + + + Application + Unicode + true + v110 + + + Application + Unicode + v110 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/xusb_2012.vcxproj.filters b/Externals/libusb/msvc/xusb_2012.vcxproj.filters new file mode 100644 index 0000000000..f71902f455 --- /dev/null +++ b/Externals/libusb/msvc/xusb_2012.vcxproj.filters @@ -0,0 +1,14 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/xusb_2013.vcxproj b/Externals/libusb/msvc/xusb_2013.vcxproj new file mode 100644 index 0000000000..3fd53ad69b --- /dev/null +++ b/Externals/libusb/msvc/xusb_2013.vcxproj @@ -0,0 +1,167 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + xusb + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11} + examples + Win32Proj + + + + Application + Unicode + true + v120 + + + Application + Unicode + v120 + + + Application + Unicode + true + v120 + + + Application + Unicode + v120 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + + + + \ No newline at end of file diff --git a/Externals/libusb/msvc/xusb_sources b/Externals/libusb/msvc/xusb_sources new file mode 100644 index 0000000000..b43f94f683 --- /dev/null +++ b/Externals/libusb/msvc/xusb_sources @@ -0,0 +1,20 @@ +TARGETNAME=xusb +TARGETTYPE=PROGRAM +386_STDCALL=0 + +_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) + +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +!IFDEF STATIC_LIBC +USE_LIBCMT=1 +!ELSE +USE_MSVCRT=1 +!ENDIF + +UMTYPE=console +INCLUDES=..\..\msvc;..\..\libusb;$(DDK_INC_PATH) +UMLIBS=..\..\libusb\os\obj$(BUILD_ALT_DIR)\*\libusb-1.0.lib +SOURCES=..\xusb.c diff --git a/Externals/libusb/msvc/xusb_wince.vcproj b/Externals/libusb/msvc/xusb_wince.vcproj new file mode 100644 index 0000000000..f994678013 --- /dev/null +++ b/Externals/libusb/msvc/xusb_wince.vcproj @@ -0,0 +1,1120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Externals/libusb/tests/Makefile.am b/Externals/libusb/tests/Makefile.am new file mode 100644 index 0000000000..12c51056aa --- /dev/null +++ b/Externals/libusb/tests/Makefile.am @@ -0,0 +1,6 @@ +AM_CPPFLAGS = -I$(top_srcdir)/libusb +LDADD = ../libusb/libusb-1.0.la + +noinst_PROGRAMS = stress + +stress_SOURCES = stress.c libusb_testlib.h testlib.c diff --git a/Externals/libusb/tests/Makefile.in b/Externals/libusb/tests/Makefile.in new file mode 100644 index 0000000000..5a5487178e --- /dev/null +++ b/Externals/libusb/tests/Makefile.in @@ -0,0 +1,583 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = stress$(EXEEXT) +subdir = tests +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/libusb/version.h $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_stress_OBJECTS = stress.$(OBJEXT) testlib.$(OBJEXT) +stress_OBJECTS = $(am_stress_OBJECTS) +stress_LDADD = $(LDADD) +stress_DEPENDENCIES = ../libusb/libusb-1.0.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(stress_SOURCES) +DIST_SOURCES = $(stress_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLDFLAGS = @LTLDFLAGS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OS_DARWIN = @OS_DARWIN@ +OS_LINUX = @OS_LINUX@ +OS_NETBSD = @OS_NETBSD@ +OS_OPENBSD = @OS_OPENBSD@ +OS_WINDOWS = @OS_WINDOWS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +RC = @RC@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_UDEV = @USE_UDEV@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = -I$(top_srcdir)/libusb +LDADD = ../libusb/libusb-1.0.la +stress_SOURCES = stress.c libusb_testlib.h testlib.c +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +stress$(EXEEXT): $(stress_OBJECTS) $(stress_DEPENDENCIES) $(EXTRA_stress_DEPENDENCIES) + @rm -f stress$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stress_OBJECTS) $(stress_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stress.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testlib.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Externals/libusb/tests/libusb_testlib.h b/Externals/libusb/tests/libusb_testlib.h new file mode 100644 index 0000000000..6c987d31cd --- /dev/null +++ b/Externals/libusb/tests/libusb_testlib.h @@ -0,0 +1,107 @@ +/* + * libusb test library helper functions + * Copyright © 2012 Toby Gray + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef LIBUSB_TESTLIB_H +#define LIBUSB_TESTLIB_H + +#include + +#if !defined(bool) +#define bool int +#endif +#if !defined(true) +#define true (1 == 1) +#endif +#if !defined(false) +#define false (!true) +#endif + +/** Values returned from a test function to indicate test result */ +typedef enum { + /** Indicates that the test ran successfully. */ + TEST_STATUS_SUCCESS, + /** Indicates that the test failed one or more test. */ + TEST_STATUS_FAILURE, + /** Indicates that an unexpected error occurred. */ + TEST_STATUS_ERROR, + /** Indicates that the test can't be run. For example this may be + * due to no suitable device being connected to perform the tests.*/ + TEST_STATUS_SKIP +} libusb_testlib_result; + +/** + * Context for test library functions + */ +typedef struct { + char ** test_names; + int test_count; + bool list_tests; + bool verbose; + int old_stdout; + int old_stderr; + FILE* output_file; + int null_fd; +} libusb_testlib_ctx; + +/** + * Logs some test information or state + */ +void libusb_testlib_logf(libusb_testlib_ctx * ctx, + const char* fmt, ...); + +/** + * Function pointer for a libusb test function. + * + * Should return TEST_STATUS_SUCCESS on success or another TEST_STATUS value. + */ +typedef libusb_testlib_result +(*libusb_testlib_test_function)(libusb_testlib_ctx * ctx); + +/** + * Structure holding a test description. + */ +typedef struct { + /** Human readable name of the test. */ + const char * name; + /** The test library will call this function to run the test. */ + libusb_testlib_test_function function; +} libusb_testlib_test; + +/** + * Value to use at the end of a test array to indicate the last + * element. + */ +#define LIBUSB_NULL_TEST {NULL, NULL} + +/** + * Runs the tests provided. + * + * Before running any tests argc and argv will be processed + * to determine the mode of operation. + * + * \param argc The argc from main + * \param argv The argv from main + * \param tests A NULL_TEST terminated array of tests + * \return 0 on success, non-zero on failure + */ +int libusb_testlib_run_tests(int argc, + char ** argv, + const libusb_testlib_test * tests); + +#endif //LIBUSB_TESTLIB_H diff --git a/Externals/libusb/tests/stress.c b/Externals/libusb/tests/stress.c new file mode 100644 index 0000000000..0f50003674 --- /dev/null +++ b/Externals/libusb/tests/stress.c @@ -0,0 +1,160 @@ +/* + * libusb stress test program to perform simple stress tests + * Copyright © 2012 Toby Gray + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include + +#include "libusb.h" +#include "libusb_testlib.h" + +/** Test that creates and destroys a single concurrent context + * 10000 times. */ +static libusb_testlib_result test_init_and_exit(libusb_testlib_ctx * tctx) +{ + libusb_context * ctx = NULL; + int i; + for (i = 0; i < 10000; ++i) { + int r = libusb_init(&ctx); + if (r != LIBUSB_SUCCESS) { + libusb_testlib_logf(tctx, + "Failed to init libusb on iteration %d: %d", + i, r); + return TEST_STATUS_FAILURE; + } + libusb_exit(ctx); + ctx = NULL; + } + + return TEST_STATUS_SUCCESS; +} + +/** Tests that devices can be listed 1000 times. */ +static libusb_testlib_result test_get_device_list(libusb_testlib_ctx * tctx) +{ + libusb_context * ctx = NULL; + int r, i; + r = libusb_init(&ctx); + if (r != LIBUSB_SUCCESS) { + libusb_testlib_logf(tctx, "Failed to init libusb: %d", r); + return TEST_STATUS_FAILURE; + } + for (i = 0; i < 1000; ++i) { + libusb_device ** device_list; + ssize_t list_size = libusb_get_device_list(ctx, &device_list); + if (list_size < 0 || device_list == NULL) { + libusb_testlib_logf(tctx, + "Failed to get device list on iteration %d: %d (%p)", + i, -list_size, device_list); + return TEST_STATUS_FAILURE; + } + libusb_free_device_list(device_list, 1); + } + libusb_exit(ctx); + return TEST_STATUS_SUCCESS; +} + +/** Tests that 100 concurrent device lists can be open at a time. */ +static libusb_testlib_result test_many_device_lists(libusb_testlib_ctx * tctx) +{ +#define LIST_COUNT 100 + libusb_context * ctx = NULL; + libusb_device ** device_lists[LIST_COUNT]; + int r, i; + memset(device_lists, 0, sizeof(device_lists)); + + r = libusb_init(&ctx); + if (r != LIBUSB_SUCCESS) { + libusb_testlib_logf(tctx, "Failed to init libusb: %d", r); + return TEST_STATUS_FAILURE; + } + + /* Create the 100 device lists. */ + for (i = 0; i < LIST_COUNT; ++i) { + ssize_t list_size = libusb_get_device_list(ctx, &(device_lists[i])); + if (list_size < 0 || device_lists[i] == NULL) { + libusb_testlib_logf(tctx, + "Failed to get device list on iteration %d: %d (%p)", + i, -list_size, device_lists[i]); + return TEST_STATUS_FAILURE; + } + } + + /* Destroy the 100 device lists. */ + for (i = 0; i < LIST_COUNT; ++i) { + if (device_lists[i]) { + libusb_free_device_list(device_lists[i], 1); + device_lists[i] = NULL; + } + } + + libusb_exit(ctx); + return TEST_STATUS_SUCCESS; +#undef LIST_COUNT +} + +/** Tests that the default context (used for various things including + * logging) works correctly when the first context created in a + * process is destroyed. */ +static libusb_testlib_result test_default_context_change(libusb_testlib_ctx * tctx) +{ + libusb_context * ctx = NULL; + int r, i; + + for (i = 0; i < 100; ++i) { + /* First create a new context */ + r = libusb_init(&ctx); + if (r != LIBUSB_SUCCESS) { + libusb_testlib_logf(tctx, "Failed to init libusb: %d", r); + return TEST_STATUS_FAILURE; + } + + /* Enable debug output, to be sure to use the context */ + libusb_set_debug(NULL, LIBUSB_LOG_LEVEL_DEBUG); + libusb_set_debug(ctx, LIBUSB_LOG_LEVEL_DEBUG); + + /* Now create a reference to the default context */ + r = libusb_init(NULL); + if (r != LIBUSB_SUCCESS) { + libusb_testlib_logf(tctx, "Failed to init libusb: %d", r); + return TEST_STATUS_FAILURE; + } + + /* Destroy the first context */ + libusb_exit(ctx); + /* Destroy the default context */ + libusb_exit(NULL); + } + + return TEST_STATUS_SUCCESS; +} + +/* Fill in the list of tests. */ +static const libusb_testlib_test tests[] = { + {"init_and_exit", &test_init_and_exit}, + {"get_device_list", &test_get_device_list}, + {"many_device_lists", &test_many_device_lists}, + {"default_context_change", &test_default_context_change}, + LIBUSB_NULL_TEST +}; + +int main (int argc, char ** argv) +{ + return libusb_testlib_run_tests(argc, argv, tests); +} diff --git a/Externals/libusb/tests/testlib.c b/Externals/libusb/tests/testlib.c new file mode 100644 index 0000000000..aa38cf1278 --- /dev/null +++ b/Externals/libusb/tests/testlib.c @@ -0,0 +1,277 @@ +/* + * libusb test library helper functions + * Copyright © 2012 Toby Gray + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libusb_testlib.h" + +#include +#include +#include +#include +#if !defined(_WIN32_WCE) +#include +#include +#include +#endif + +#if defined(_WIN32_WCE) +// No support for selective redirection of STDOUT on WinCE. +#define DISABLE_STDOUT_REDIRECTION +#define STDOUT_FILENO 1 +#elif defined(_WIN32) +#include +#define dup _dup +#define dup2 _dup2 +#define open _open +#define close _close +#define fdopen _fdopen +#define NULL_PATH "nul" +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 +#else +#include +#define NULL_PATH "/dev/null" +#endif +#define INVALID_FD -1 +#define IGNORE_RETVAL(expr) do { (void)(expr); } while(0) + +/** + * Converts a test result code into a human readable string. + */ +static const char* test_result_to_str(libusb_testlib_result result) +{ + switch (result) { + case TEST_STATUS_SUCCESS: + return "Success"; + case TEST_STATUS_FAILURE: + return "Failure"; + case TEST_STATUS_ERROR: + return "Error"; + case TEST_STATUS_SKIP: + return "Skip"; + default: + return "Unknown"; + } +} + +static void print_usage(int argc, char ** argv) +{ + printf("Usage: %s [-l] [-v] [ ...]\n", + argc > 0 ? argv[0] : "test_*"); + printf(" -l List available tests\n"); + printf(" -v Don't redirect STDERR/STDOUT during tests\n"); +} + +static void cleanup_test_output(libusb_testlib_ctx * ctx) +{ +#ifndef DISABLE_STDOUT_REDIRECTION + if (!ctx->verbose) { + if (ctx->old_stdout != INVALID_FD) { + IGNORE_RETVAL(dup2(ctx->old_stdout, STDOUT_FILENO)); + ctx->old_stdout = INVALID_FD; + } + if (ctx->old_stderr != INVALID_FD) { + IGNORE_RETVAL(dup2(ctx->old_stderr, STDERR_FILENO)); + ctx->old_stderr = INVALID_FD; + } + if (ctx->null_fd != INVALID_FD) { + close(ctx->null_fd); + ctx->null_fd = INVALID_FD; + } + if (ctx->output_file != stdout) { + fclose(ctx->output_file); + ctx->output_file = stdout; + } + } +#endif +} + +/** + * Setup test output handles + * \return zero on success, non-zero on failure + */ +static int setup_test_output(libusb_testlib_ctx * ctx) +{ +#ifndef DISABLE_STDOUT_REDIRECTION + /* Stop output to stdout and stderr from being displayed if using non-verbose output */ + if (!ctx->verbose) { + /* Keep a copy of STDOUT and STDERR */ + ctx->old_stdout = dup(STDOUT_FILENO); + if (ctx->old_stdout < 0) { + ctx->old_stdout = INVALID_FD; + printf("Failed to duplicate stdout handle: %d\n", errno); + return 1; + } + ctx->old_stderr = dup(STDERR_FILENO); + if (ctx->old_stderr < 0) { + ctx->old_stderr = INVALID_FD; + cleanup_test_output(ctx); + printf("Failed to duplicate stderr handle: %d\n", errno); + return 1; + } + /* Redirect STDOUT_FILENO and STDERR_FILENO to /dev/null or "nul"*/ + ctx->null_fd = open(NULL_PATH, O_WRONLY); + if (ctx->null_fd < 0) { + ctx->null_fd = INVALID_FD; + cleanup_test_output(ctx); + printf("Failed to open null handle: %d\n", errno); + return 1; + } + if ((dup2(ctx->null_fd, STDOUT_FILENO) < 0) || + (dup2(ctx->null_fd, STDERR_FILENO) < 0)) { + cleanup_test_output(ctx); + return 1; + } + ctx->output_file = fdopen(ctx->old_stdout, "w"); + if (!ctx->output_file) { + ctx->output_file = stdout; + cleanup_test_output(ctx); + printf("Failed to open FILE for output handle: %d\n", errno); + return 1; + } + } +#endif + return 0; +} + +void libusb_testlib_logf(libusb_testlib_ctx * ctx, + const char* fmt, ...) +{ + va_list va; + va_start(va, fmt); + vfprintf(ctx->output_file, fmt, va); + va_end(va); + fprintf(ctx->output_file, "\n"); + fflush(ctx->output_file); +} + +int libusb_testlib_run_tests(int argc, + char ** argv, + const libusb_testlib_test * tests) +{ + int run_count = 0; + int idx = 0; + int pass_count = 0; + int fail_count = 0; + int error_count = 0; + int skip_count = 0; + int r, j; + size_t arglen; + libusb_testlib_result test_result; + libusb_testlib_ctx ctx; + + /* Setup default mode of operation */ + ctx.test_names = NULL; + ctx.test_count = 0; + ctx.list_tests = false; + ctx.verbose = false; + ctx.old_stdout = INVALID_FD; + ctx.old_stderr = INVALID_FD; + ctx.output_file = stdout; + ctx.null_fd = INVALID_FD; + + /* Parse command line options */ + if (argc >= 2) { + for (j = 1; j < argc; j++) { + arglen = strlen(argv[j]); + if ( ((argv[j][0] == '-') || (argv[j][0] == '/')) && + arglen >=2 ) { + switch (argv[j][1]) { + case 'l': + ctx.list_tests = true; + break; + case 'v': + ctx.verbose = true; + break; + default: + printf("Unknown option: '%s'\n", argv[j]); + print_usage(argc, argv); + return 1; + } + } else { + /* End of command line options, remaining must be list of tests to run */ + ctx.test_names = argv + j; + ctx.test_count = argc - j; + break; + } + } + } + + /* Validate command line options */ + if (ctx.test_names && ctx.list_tests) { + printf("List of tests requested but test list provided\n"); + print_usage(argc, argv); + return 1; + } + + /* Setup test log output */ + r = setup_test_output(&ctx); + if (r != 0) + return r; + + /* Act on any options not related to running tests */ + if (ctx.list_tests) { + while (tests[idx].function != NULL) { + libusb_testlib_logf(&ctx, tests[idx].name); + ++idx; + } + cleanup_test_output(&ctx); + return 0; + } + + /* Run any requested tests */ + while (tests[idx].function != NULL) { + const libusb_testlib_test * test = &tests[idx]; + ++idx; + if (ctx.test_count > 0) { + /* Filtering tests to run, check if this is one of them */ + int i; + for (i = 0; i < ctx.test_count; ++i) { + if (strcmp(ctx.test_names[i], test->name) == 0) + /* Matches a requested test name */ + break; + } + if (i >= ctx.test_count) { + /* Failed to find a test match, so do the next loop iteration */ + continue; + } + } + libusb_testlib_logf(&ctx, + "Starting test run: %s...", test->name); + test_result = test->function(&ctx); + libusb_testlib_logf(&ctx, + "%s (%d)", + test_result_to_str(test_result), test_result); + switch (test_result) { + case TEST_STATUS_SUCCESS: pass_count++; break; + case TEST_STATUS_FAILURE: fail_count++; break; + case TEST_STATUS_ERROR: error_count++; break; + case TEST_STATUS_SKIP: skip_count++; break; + } + ++run_count; + } + libusb_testlib_logf(&ctx, "---"); + libusb_testlib_logf(&ctx, "Ran %d tests", run_count); + libusb_testlib_logf(&ctx, "Passed %d tests", pass_count); + libusb_testlib_logf(&ctx, "Failed %d tests", fail_count); + libusb_testlib_logf(&ctx, "Error in %d tests", error_count); + libusb_testlib_logf(&ctx, "Skipped %d tests", skip_count); + + cleanup_test_output(&ctx); + return pass_count != run_count; +} diff --git a/Externals/libusbx/NEWS b/Externals/libusbx/NEWS deleted file mode 100644 index 1620253883..0000000000 --- a/Externals/libusbx/NEWS +++ /dev/null @@ -1,2 +0,0 @@ -For the latest libusbx news, please refer to the ChangeLog file, or visit: -http://libusbx.org diff --git a/Externals/libusbx/README b/Externals/libusbx/README deleted file mode 100644 index 3add73110f..0000000000 --- a/Externals/libusbx/README +++ /dev/null @@ -1,28 +0,0 @@ -libusbx -======= - -libusbx is a library for USB device access from Linux, Mac OS X, -Windows and OpenBSD/NetBSD userspace, with OpenBSD/NetBSD, and to a -lesser extent some of the newest features of Windows (such as libusbK -and libusb-win32 driver support) being EXPERIMENTAL. -It is written in C and licensed under the GNU Lesser General Public -License version 2.1 or, at your option, any later version (see COPYING). - -libusbx is abstracted internally in such a way that it can hopefully -be ported to other operating systems. Please see the PORTING file -for more information. - -libusbx homepage: -http://libusbx.org/ - -Developers will wish to consult the API documentation: -http://api.libusbx.org - -Use the mailing list for questions, comments, etc: -http://mailing-list.libusbx.org - -- Pete Batard -- Hans de Goede -- Xiaofan Chen -- Ludovic Rousseau -(use the mailing list rather than mailing developers directly) diff --git a/Externals/libusbx/THANKS b/Externals/libusbx/THANKS deleted file mode 100644 index 4189af2cb5..0000000000 --- a/Externals/libusbx/THANKS +++ /dev/null @@ -1,7 +0,0 @@ -Development contributors are listed in the AUTHORS file. Community members who -have also made significant contributions in other areas are listed below: - -Alan Stern -Ludovic Rousseau -Tim Roberts -Xiaofan Chen diff --git a/Externals/libusbx/TODO b/Externals/libusbx/TODO deleted file mode 100644 index e64b279154..0000000000 --- a/Externals/libusbx/TODO +++ /dev/null @@ -1,2 +0,0 @@ -Please see the libusbx roadmap by visiting: -https://github.com/libusbx/libusbx/issues/milestones?direction=asc&sort=due_date \ No newline at end of file diff --git a/Externals/libusbx/libusb/version_nano.h b/Externals/libusbx/libusb/version_nano.h deleted file mode 100644 index 525cd7d52d..0000000000 --- a/Externals/libusbx/libusb/version_nano.h +++ /dev/null @@ -1 +0,0 @@ -#define LIBUSB_NANO 10774 diff --git a/Externals/libusbx/msvc/libusb_static_2013.vcxproj b/Externals/libusbx/msvc/libusb_static_2013.vcxproj deleted file mode 100644 index c2ee80d41b..0000000000 --- a/Externals/libusbx/msvc/libusb_static_2013.vcxproj +++ /dev/null @@ -1,77 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {349EE8F9-7D25-4909-AAF5-FF3FADE72187} - libusb-1.0 - - - - StaticLibrary - v120 - Unicode - - - true - - - false - - - - - - - - - - - - - .;..\libusb;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/Core/Core/Core.vcxproj b/Source/Core/Core/Core.vcxproj index 67d8257e2a..51f8ce0ce1 100644 --- a/Source/Core/Core/Core.vcxproj +++ b/Source/Core/Core/Core.vcxproj @@ -446,7 +446,7 @@ {8ada04d7-6db1-4da4-ab55-64fb12a0997b} - + {349ee8f9-7d25-4909-aaf5-ff3fade72187} diff --git a/Source/VSProps/Base.props b/Source/VSProps/Base.props index a1abd19963..a61da6d95e 100644 --- a/Source/VSProps/Base.props +++ b/Source/VSProps/Base.props @@ -37,7 +37,7 @@ $(ExternalsDir)Bochs_disasm;%(AdditionalIncludeDirectories) $(ExternalsDir)GL;%(AdditionalIncludeDirectories) $(ExternalsDir)libpng;%(AdditionalIncludeDirectories) - $(ExternalsDir)libusbx\libusb;%(AdditionalIncludeDirectories) + $(ExternalsDir)libusb\libusb;%(AdditionalIncludeDirectories) $(ExternalsDir)LZO;%(AdditionalIncludeDirectories) $(ExternalsDir)miniupnpc\src;%(AdditionalIncludeDirectories) $(ExternalsDir)polarssl\include;%(AdditionalIncludeDirectories) diff --git a/Source/dolphin-emu.sln b/Source/dolphin-emu.sln index c4fb3b6511..ab9df5f158 100644 --- a/Source/dolphin-emu.sln +++ b/Source/dolphin-emu.sln @@ -51,7 +51,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SCMRevGen", "Core\Common\SC EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SFML_Network", "..\Externals\SFML\build\vc2010\SFML_Network.vcxproj", "{93D73454-2512-424E-9CDA-4BB357FE13DD}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0", "..\Externals\libusbx\msvc\libusb_static_2013.vcxproj", "{349EE8F9-7D25-4909-AAF5-FF3FADE72187}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0", "..\Externals\libusb\msvc\libusb_static_2013.vcxproj", "{349EE8F9-7D25-4909-AAF5-FF3FADE72187}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "..\Externals\portaudio\build\portaudio.vcxproj", "{0A18A071-125E-442F-AFF7-A3F68ABECF99}" EndProject