Browse Source

Import upstream version 0.3

Evgeni Golov 14 years ago
parent
commit
5665ef141d
20 changed files with 5474 additions and 1864 deletions
  1. 8 0
      ChangeLog
  2. 15 6
      Makefile.in
  3. 9 2
      TODO
  4. 67 213
      aclocal.m4
  5. 1526 0
      config.guess
  6. 12 3
      config.h.in
  7. 1658 0
      config.sub
  8. 1684 1426
      configure
  9. 31 9
      configure.ac
  10. 16 8
      doc/Makefile.in
  11. 11 9
      doc/u3-tool.1
  12. 4 10
      src/Makefile.am
  13. 164 151
      src/Makefile.in
  14. 67 19
      src/main.c
  15. 23 4
      src/secure_input.c
  16. 12 0
      src/u3_commands.c
  17. 3 0
      src/u3_scsi.h
  18. 9 1
      src/u3_scsi_sg.c
  19. 142 0
      src/u3_scsi_spt.c
  20. 13 3
      src/u3_scsi_usb.c

+ 8 - 0
ChangeLog

@@ -1,3 +1,11 @@
+0.3:
+ - Detect correct subsystem from configure.
+ - Use MinGW/MSYS to build on MS Windows
+ - Hide password input under MS Windows
+ - Install into sbin instead of bin
+ - Added "reset security" command
+ - Added new devices to PID/VID list of libusb subsystem
+ - Fixed displaying of disk sizes > 4 GB
 
 0.2:
  - Renamed executables(u3_tool -> u3-tool)

+ 15 - 6
Makefile.in

@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -29,11 +29,14 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
 subdir = .
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
 	$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
-	TODO compile depcomp install-sh missing
+	TODO compile config.guess config.sub depcomp install-sh \
+	missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -96,8 +99,6 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
-LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
-LIBUSB_LIBS = @LIBUSB_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
@@ -109,7 +110,6 @@ PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
@@ -125,14 +125,22 @@ 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@
@@ -153,6 +161,7 @@ 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 = configure
@@ -287,7 +296,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS

+ 9 - 2
TODO

@@ -1,8 +1,15 @@
 Major:
- - if possible open sg subsystem Read-only to work around NOMEDIUM error with encrypted partition
- - Wipe all password/hash buffers after usage
+ - If possible open sg subsystem Read-only to work around NOMEDIUM error with encrypted partition
+ - Handle ctrl-c
  - Documentation
  - Further documentation of U3 features
+ - Document which options are destructive
+ - Don't allow enable security if security already enabled
+ - Don't allow disable security if device locked/not secured.
+ - [SG] retry on busy error
+ - MacOS X support
 
 minor:
  - ETA when loading new CD image
+ - Disable Cursor on progress bar
+ - Display info if no options provided

+ 67 - 213
aclocal.m4

@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 # 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
@@ -13,171 +13,13 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(AC_AUTOCONF_VERSION, [2.61],,
-[m4_warning([this file was generated for autoconf 2.61.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
 
-# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
-# 
-# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it 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.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
-AC_DEFUN([PKG_PROG_PKG_CONFIG],
-[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
-fi
-if test -n "$PKG_CONFIG"; then
-	_pkg_min_version=m4_default([$1], [0.9.0])
-	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
-	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-		AC_MSG_RESULT([yes])
-	else
-		AC_MSG_RESULT([no])
-		PKG_CONFIG=""
-	fi
-		
-fi[]dnl
-])# PKG_PROG_PKG_CONFIG
-
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists.  Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-#
-# Similar to PKG_CHECK_MODULES, make sure that the first instance of
-# this or PKG_CHECK_MODULES is called, or make sure to call
-# PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_EXISTS],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-if test -n "$PKG_CONFIG" && \
-    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
-  m4_ifval([$2], [$2], [:])
-m4_ifvaln([$3], [else
-  $3])dnl
-fi])
-
-
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
-m4_define([_PKG_CONFIG],
-[if test -n "$PKG_CONFIG"; then
-    if test -n "$$1"; then
-        pkg_cv_[]$1="$$1"
-    else
-        PKG_CHECK_EXISTS([$3],
-                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
-			 [pkg_failed=yes])
-    fi
-else
-	pkg_failed=untried
-fi[]dnl
-])# _PKG_CONFIG
-
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
-AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
-else
-        _pkg_short_errors_supported=no
-fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
-
-
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_MODULES],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
-AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
-
-pkg_failed=no
-AC_MSG_CHECKING([for $1])
-
-_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
-_PKG_CONFIG([$1][_LIBS], [libs], [$2])
-
-m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
-and $1[]_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.])
-
-if test $pkg_failed = yes; then
-        _PKG_SHORT_ERRORS_SUPPORTED
-        if test $_pkg_short_errors_supported = yes; then
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
-        else 
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
-        fi
-	# Put the nasty error message in config.log where it belongs
-	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
-
-	ifelse([$4], , [AC_MSG_ERROR(dnl
-[Package requirements ($2) were not met:
-
-$$1_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-_PKG_TEXT
-])],
-		[AC_MSG_RESULT([no])
-                $4])
-elif test $pkg_failed = untried; then
-	ifelse([$4], , [AC_MSG_FAILURE(dnl
-[The pkg-config script could not be found or is too old.  Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-_PKG_TEXT
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
-		[$4])
-else
-	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
-	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
-        AC_MSG_RESULT([yes])
-	ifelse([$3], , :, [$3])
-fi[]dnl
-])# PKG_CHECK_MODULES
-
-# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -192,7 +34,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.10'
 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.10.1], [],
+m4_if([$1], [1.10.2], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -206,12 +48,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # AM_SET_CURRENT_AUTOMAKE_VERSION
 # -------------------------------
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10.1])dnl
+[AM_AUTOMAKE_VERSION([1.10.2])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
@@ -461,57 +303,68 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
 # 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.
 
-#serial 3
+#serial 5
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # Grep'ing the whole file is not good either: AIX grep has a line
-  # limit of 2048, but all sed's we know have understand at least 4000.
-  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-    dirpart=`AS_DIRNAME("$mf")`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`AS_DIRNAME(["$file"])`
-    AS_MKDIR_P([$dirpart/$fdir])
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
   done
-done
+}
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
 
@@ -741,14 +594,14 @@ AC_MSG_RESULT([$_am_result])
 rm -f confinc confmf
 ])
 
-# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
 # 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.
 
-# serial 5
+# serial 6
 
 # AM_PROG_CC_C_O
 # --------------
@@ -760,8 +613,9 @@ AC_REQUIRE_AUX_FILE([compile])dnl
 # FIXME: we rely on the cache variable name because
 # there is no other way.
 set dummy $CC
-ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
-if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+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.
@@ -839,13 +693,13 @@ esac
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  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.
 
-# serial 3
+# serial 4
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -862,7 +716,7 @@ AC_DEFUN([_AM_SET_OPTION],
 # ----------------------------------
 # OPTIONS is a space-separated list of Automake options.
 AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
 
 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
 # -------------------------------------------

File diff suppressed because it is too large
+ 1526 - 0
config.guess


+ 12 - 3
config.h.in

@@ -90,21 +90,30 @@
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
+/* Use libusb subsystem */
+#undef SUBSYS_LIBUSB
+
+/* Use sg subsystem */
+#undef SUBSYS_SG
+
+/* Use spt subsystem */
+#undef SUBSYS_SPT
+
 /* Version number of package */
 #undef VERSION
 
 /* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
-   <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
    #define below would cause a syntax error. */
 #undef _UINT32_T
 
 /* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
-   <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
    #define below would cause a syntax error. */
 #undef _UINT64_T
 
 /* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
-   <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
    #define below would cause a syntax error. */
 #undef _UINT8_T
 

File diff suppressed because it is too large
+ 1658 - 0
config.sub


File diff suppressed because it is too large
+ 1684 - 1426
configure


+ 31 - 9
configure.ac

@@ -2,23 +2,46 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.61)
-AC_INIT(u3-tool, 0.2, daviedev@users.sourceforge.net)
+AC_INIT(u3-tool, 0.3, daviedev@users.sourceforge.net)
 AM_INIT_AUTOMAKE
 AC_CONFIG_SRCDIR([config.h.in])
 AC_CONFIG_HEADER([config.h])
+AC_CANONICAL_HOST
 
 # Checks for programs.
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_INSTALL
 
+# Parse arguments
+AC_ARG_ENABLE([libusb],
+     [  --enable-libusb    Force using libUSB subsystem instead of platform specific],
+     [case "${enableval}" in
+       yes) force_libusb=true ;;
+       no)  force_libusb=false ;;
+       *) AC_MSG_ERROR([bad value ${enableval} for --enable-libusb]) ;;
+     esac],[force_libusb=false])
+
+# Determine subsystem
+AS_IF([test x$force_libusb = xtrue],
+	[ subsystem=libusb ],
+	[ AS_CASE([$host_os],
+		[linux*], [subsystem=sg],
+		[mingw32], [subsystem=spt],
+		[subsystem=libusb])]
+	)
+
+AS_IF([test x$subsystem = xlibusb ], [ AC_DEFINE([SUBSYS_LIBUSB], [1], [Use libusb subsystem]) ])
+AS_IF([test x$subsystem = xsg ], [ AC_DEFINE([SUBSYS_SG], [1], [Use sg subsystem]) ])
+AS_IF([test x$subsystem = xspt ], [ AC_DEFINE([SUBSYS_SPT], [1], [Use spt subsystem]) ])
+
 # Checks for libraries.
-PKG_CHECK_MODULES([LIBUSB], [libusb],
-	[ 
-		LIBUSB_MSG=yes
-	],
-	[ LIBUSB_MSG=no ])
-AM_CONDITIONAL(HAVE_LIBUSB, [test x$LIBUSB_MSG = xyes])
+#FIXME: PKG_CHECK_MODULES not provided on MinGW
+#AS_IF([ test x$subsystem = xlibusb ],
+#	[ PKG_CHECK_MODULES([LIBUSB], [libusb],
+#		[  ],
+#		[ AC_MSG_FAILURE([libusb is required but not found.]) ])
+#	])
 
 # Checks for header files.
 AC_HEADER_STDC
@@ -45,6 +68,5 @@ AC_CONFIG_FILES([Makefile
 AC_OUTPUT
 
 echo ""
-echo "Options:"
-echo "LibUSB used:     ${LIBUSB_MSG}"
+echo "Subsystem:     ${subsystem}"
 echo ""

+ 16 - 8
doc/Makefile.in

@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -29,6 +29,8 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
 subdir = doc
 DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in
@@ -74,8 +76,6 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
-LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
-LIBUSB_LIBS = @LIBUSB_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
@@ -87,7 +87,6 @@ PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
@@ -103,14 +102,22 @@ 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@
@@ -131,6 +138,7 @@ sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 dist_man_MANS = u3-tool.1
@@ -141,8 +149,8 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -177,8 +185,8 @@ install-man1: $(man1_MANS) $(man_MANS)
 	  esac; \
 	done; \
 	for i in $$list; do \
-	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
-	  else file=$$i; fi; \
+	  if test -f $$i; then file=$$i; \
+	  else file=$(srcdir)/$$i; fi; \
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
 	  case "$$ext" in \
 	    1*) ;; \

+ 11 - 9
doc/u3-tool.1

@@ -2,7 +2,7 @@
 .SH NAME
 u3-tool \- Tool for controlling the special features of an U3 USB Flash disk. 
 .SH SYNOPSIS
-.B u3-tool [-cdDehiuvV] [-l
+.B u3-tool [-cdDehiRuvV] [-l
 .I cd image
 .B ] [-p
 .I cd size
@@ -12,23 +12,25 @@ u3-tool \- Tool for controlling the special features of an U3 USB Flash disk.
 This tool can be used to control some of the special features of U3 Flash disks.
 .SH OPTIONS
 .IP -c
-Change password
+Change current password.
 .IP -d
-Disable device security
+Disable device security leaving the data intact. The current password is required to perform this command. WARNING: this makes all current data files AND possibly also deleted data public.
 .IP -D
 Dump all raw info(for debug)
 .IP -e
-Enable device security
+Enable device security, protecting all files currently on the data partition using a password.
 .IP -h
-Print this help message
+Print a short help message.
 .IP -i
-Display device info
+Display device information.
 .IP "-l <cd image>"
-Load CD image into device
+Load a new CD image into the cd partition of the device. Make sure the cd partition is big enough to contain the file. Else you'll have to repartition the device using the '-p' option.
 .IP "-p <cd size>"
-Repartition device
+Repartition device, reassinging the device space between the cd and data partition. The argument specifies the size of the CD partition. The rest of the device will be assigned to the data partition. The data partition needs reformating after this command has been issued.
+.IP -R
+Reset device security destroying private data. This can be used if the device is blocked or the password is lost.
 .IP -u
-Unlock device
+Unlock secured data partition. This requires the current password.
 .IP -v
 Use verbose output
 .IP -V

+ 4 - 10
src/Makefile.am

@@ -1,15 +1,9 @@
-bin_PROGRAMS = u3-tool
+sbin_PROGRAMS = u3-tool
 
 shared_source = display_progress.c display_progress.h main.c md5.c md5.h \
 	secure_input.c secure_input.h u3_commands.c u3_commands.h u3_error.c \
 	u3_error.h u3.h u3_scsi.h 
 
-u3_tool_SOURCES = $(shared_source) u3_scsi_sg.c sg_err.h
-
-if HAVE_LIBUSB
-bin_PROGRAMS += u3-tool-usb
-
-u3_tool_usb_SOURCES = $(shared_source) u3_scsi_usb.c
-u3_tool_usb_CFLAGS = $(LIBUSB_CFLAGS)
-u3_tool_usb_LDADD = $(LIBUSB_LIBS)
-endif
+u3_tool_SOURCES = $(shared_source) u3_scsi_usb.c u3_scsi_spt.c u3_scsi_sg.c sg_err.h
+u3_tool_CFLAGS = $(LIBUSB_CFLAGS)
+u3_tool_LDADD = $(LIBUSB_LIBS)

+ 164 - 151
src/Makefile.in

@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -30,8 +30,9 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-bin_PROGRAMS = u3-tool$(EXEEXT) $(am__EXEEXT_1)
-@HAVE_LIBUSB_TRUE@am__append_1 = u3-tool-usb
+build_triplet = @build@
+host_triplet = @host@
+sbin_PROGRAMS = u3-tool$(EXEEXT)
 subdir = src
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -41,32 +42,19 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
-@HAVE_LIBUSB_TRUE@am__EXEEXT_1 = u3-tool-usb$(EXEEXT)
-am__installdirs = "$(DESTDIR)$(bindir)"
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(bin_PROGRAMS)
-am__objects_1 = display_progress.$(OBJEXT) main.$(OBJEXT) \
-	md5.$(OBJEXT) secure_input.$(OBJEXT) u3_commands.$(OBJEXT) \
-	u3_error.$(OBJEXT)
-am_u3_tool_OBJECTS = $(am__objects_1) u3_scsi_sg.$(OBJEXT)
+am__installdirs = "$(DESTDIR)$(sbindir)"
+sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(sbin_PROGRAMS)
+am__objects_1 = u3_tool-display_progress.$(OBJEXT) \
+	u3_tool-main.$(OBJEXT) u3_tool-md5.$(OBJEXT) \
+	u3_tool-secure_input.$(OBJEXT) u3_tool-u3_commands.$(OBJEXT) \
+	u3_tool-u3_error.$(OBJEXT)
+am_u3_tool_OBJECTS = $(am__objects_1) u3_tool-u3_scsi_usb.$(OBJEXT) \
+	u3_tool-u3_scsi_spt.$(OBJEXT) u3_tool-u3_scsi_sg.$(OBJEXT)
 u3_tool_OBJECTS = $(am_u3_tool_OBJECTS)
-u3_tool_LDADD = $(LDADD)
-am__u3_tool_usb_SOURCES_DIST = display_progress.c display_progress.h \
-	main.c md5.c md5.h secure_input.c secure_input.h u3_commands.c \
-	u3_commands.h u3_error.c u3_error.h u3.h u3_scsi.h \
-	u3_scsi_usb.c
-am__objects_2 = u3_tool_usb-display_progress.$(OBJEXT) \
-	u3_tool_usb-main.$(OBJEXT) u3_tool_usb-md5.$(OBJEXT) \
-	u3_tool_usb-secure_input.$(OBJEXT) \
-	u3_tool_usb-u3_commands.$(OBJEXT) \
-	u3_tool_usb-u3_error.$(OBJEXT)
-@HAVE_LIBUSB_TRUE@am_u3_tool_usb_OBJECTS = $(am__objects_2) \
-@HAVE_LIBUSB_TRUE@	u3_tool_usb-u3_scsi_usb.$(OBJEXT)
-u3_tool_usb_OBJECTS = $(am_u3_tool_usb_OBJECTS)
-am__DEPENDENCIES_1 =
-@HAVE_LIBUSB_TRUE@u3_tool_usb_DEPENDENCIES = $(am__DEPENDENCIES_1)
-u3_tool_usb_LINK = $(CCLD) $(u3_tool_usb_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+u3_tool_DEPENDENCIES =
+u3_tool_LINK = $(CCLD) $(u3_tool_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
@@ -74,8 +62,8 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(u3_tool_SOURCES) $(u3_tool_usb_SOURCES)
-DIST_SOURCES = $(u3_tool_SOURCES) $(am__u3_tool_usb_SOURCES_DIST)
+SOURCES = $(u3_tool_SOURCES)
+DIST_SOURCES = $(u3_tool_SOURCES)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -107,8 +95,6 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
-LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
-LIBUSB_LIBS = @LIBUSB_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
@@ -120,7 +106,6 @@ PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
@@ -136,14 +121,22 @@ 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@
@@ -164,16 +157,16 @@ sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 shared_source = display_progress.c display_progress.h main.c md5.c md5.h \
 	secure_input.c secure_input.h u3_commands.c u3_commands.h u3_error.c \
 	u3_error.h u3.h u3_scsi.h 
 
-u3_tool_SOURCES = $(shared_source) u3_scsi_sg.c sg_err.h
-@HAVE_LIBUSB_TRUE@u3_tool_usb_SOURCES = $(shared_source) u3_scsi_usb.c
-@HAVE_LIBUSB_TRUE@u3_tool_usb_CFLAGS = $(LIBUSB_CFLAGS)
-@HAVE_LIBUSB_TRUE@u3_tool_usb_LDADD = $(LIBUSB_LIBS)
+u3_tool_SOURCES = $(shared_source) u3_scsi_usb.c u3_scsi_spt.c u3_scsi_sg.c sg_err.h
+u3_tool_CFLAGS = $(LIBUSB_CFLAGS)
+u3_tool_LDADD = $(LIBUSB_LIBS)
 all: all-am
 
 .SUFFIXES:
@@ -182,8 +175,8 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -207,35 +200,32 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-install-binPROGRAMS: $(bin_PROGRAMS)
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
-	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+	@list='$(sbin_PROGRAMS)'; for p in $$list; do \
 	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
 	  if test -f $$p \
 	  ; then \
 	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
-	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
 	  else :; fi; \
 	done
 
-uninstall-binPROGRAMS:
+uninstall-sbinPROGRAMS:
 	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	@list='$(sbin_PROGRAMS)'; for p in $$list; do \
 	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	  echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(sbindir)/$$f"; \
 	done
 
-clean-binPROGRAMS:
-	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+clean-sbinPROGRAMS:
+	-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
 u3-tool$(EXEEXT): $(u3_tool_OBJECTS) $(u3_tool_DEPENDENCIES) 
 	@rm -f u3-tool$(EXEEXT)
-	$(LINK) $(u3_tool_OBJECTS) $(u3_tool_LDADD) $(LIBS)
-u3-tool-usb$(EXEEXT): $(u3_tool_usb_OBJECTS) $(u3_tool_usb_DEPENDENCIES) 
-	@rm -f u3-tool-usb$(EXEEXT)
-	$(u3_tool_usb_LINK) $(u3_tool_usb_OBJECTS) $(u3_tool_usb_LDADD) $(LIBS)
+	$(u3_tool_LINK) $(u3_tool_OBJECTS) $(u3_tool_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -243,20 +233,15 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/display_progress.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secure_input.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_commands.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_error.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_scsi_sg.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool_usb-display_progress.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool_usb-main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool_usb-md5.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool_usb-secure_input.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool_usb-u3_commands.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool_usb-u3_error.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool_usb-u3_scsi_usb.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool-display_progress.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool-main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool-md5.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool-secure_input.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool-u3_commands.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool-u3_error.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool-u3_scsi_sg.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool-u3_scsi_spt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u3_tool-u3_scsi_usb.Po@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -272,110 +257,138 @@ distclean-compile:
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
-u3_tool_usb-display_progress.o: display_progress.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -MT u3_tool_usb-display_progress.o -MD -MP -MF $(DEPDIR)/u3_tool_usb-display_progress.Tpo -c -o u3_tool_usb-display_progress.o `test -f 'display_progress.c' || echo '$(srcdir)/'`display_progress.c
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool_usb-display_progress.Tpo $(DEPDIR)/u3_tool_usb-display_progress.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='display_progress.c' object='u3_tool_usb-display_progress.o' libtool=no @AMDEPBACKSLASH@
+u3_tool-display_progress.o: display_progress.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-display_progress.o -MD -MP -MF $(DEPDIR)/u3_tool-display_progress.Tpo -c -o u3_tool-display_progress.o `test -f 'display_progress.c' || echo '$(srcdir)/'`display_progress.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-display_progress.Tpo $(DEPDIR)/u3_tool-display_progress.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='display_progress.c' object='u3_tool-display_progress.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -c -o u3_tool_usb-display_progress.o `test -f 'display_progress.c' || echo '$(srcdir)/'`display_progress.c
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-display_progress.o `test -f 'display_progress.c' || echo '$(srcdir)/'`display_progress.c
 
-u3_tool_usb-display_progress.obj: display_progress.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -MT u3_tool_usb-display_progress.obj -MD -MP -MF $(DEPDIR)/u3_tool_usb-display_progress.Tpo -c -o u3_tool_usb-display_progress.obj `if test -f 'display_progress.c'; then $(CYGPATH_W) 'display_progress.c'; else $(CYGPATH_W) '$(srcdir)/display_progress.c'; fi`
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool_usb-display_progress.Tpo $(DEPDIR)/u3_tool_usb-display_progress.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='display_progress.c' object='u3_tool_usb-display_progress.obj' libtool=no @AMDEPBACKSLASH@
+u3_tool-display_progress.obj: display_progress.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-display_progress.obj -MD -MP -MF $(DEPDIR)/u3_tool-display_progress.Tpo -c -o u3_tool-display_progress.obj `if test -f 'display_progress.c'; then $(CYGPATH_W) 'display_progress.c'; else $(CYGPATH_W) '$(srcdir)/display_progress.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-display_progress.Tpo $(DEPDIR)/u3_tool-display_progress.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='display_progress.c' object='u3_tool-display_progress.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -c -o u3_tool_usb-display_progress.obj `if test -f 'display_progress.c'; then $(CYGPATH_W) 'display_progress.c'; else $(CYGPATH_W) '$(srcdir)/display_progress.c'; fi`
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-display_progress.obj `if test -f 'display_progress.c'; then $(CYGPATH_W) 'display_progress.c'; else $(CYGPATH_W) '$(srcdir)/display_progress.c'; fi`
 
-u3_tool_usb-main.o: main.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -MT u3_tool_usb-main.o -MD -MP -MF $(DEPDIR)/u3_tool_usb-main.Tpo -c -o u3_tool_usb-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool_usb-main.Tpo $(DEPDIR)/u3_tool_usb-main.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='main.c' object='u3_tool_usb-main.o' libtool=no @AMDEPBACKSLASH@
+u3_tool-main.o: main.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-main.o -MD -MP -MF $(DEPDIR)/u3_tool-main.Tpo -c -o u3_tool-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-main.Tpo $(DEPDIR)/u3_tool-main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='main.c' object='u3_tool-main.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -c -o u3_tool_usb-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
 
-u3_tool_usb-main.obj: main.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -MT u3_tool_usb-main.obj -MD -MP -MF $(DEPDIR)/u3_tool_usb-main.Tpo -c -o u3_tool_usb-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool_usb-main.Tpo $(DEPDIR)/u3_tool_usb-main.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='main.c' object='u3_tool_usb-main.obj' libtool=no @AMDEPBACKSLASH@
+u3_tool-main.obj: main.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-main.obj -MD -MP -MF $(DEPDIR)/u3_tool-main.Tpo -c -o u3_tool-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-main.Tpo $(DEPDIR)/u3_tool-main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='main.c' object='u3_tool-main.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -c -o u3_tool_usb-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
 
-u3_tool_usb-md5.o: md5.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -MT u3_tool_usb-md5.o -MD -MP -MF $(DEPDIR)/u3_tool_usb-md5.Tpo -c -o u3_tool_usb-md5.o `test -f 'md5.c' || echo '$(srcdir)/'`md5.c
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool_usb-md5.Tpo $(DEPDIR)/u3_tool_usb-md5.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='md5.c' object='u3_tool_usb-md5.o' libtool=no @AMDEPBACKSLASH@
+u3_tool-md5.o: md5.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-md5.o -MD -MP -MF $(DEPDIR)/u3_tool-md5.Tpo -c -o u3_tool-md5.o `test -f 'md5.c' || echo '$(srcdir)/'`md5.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-md5.Tpo $(DEPDIR)/u3_tool-md5.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='md5.c' object='u3_tool-md5.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -c -o u3_tool_usb-md5.o `test -f 'md5.c' || echo '$(srcdir)/'`md5.c
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-md5.o `test -f 'md5.c' || echo '$(srcdir)/'`md5.c
 
-u3_tool_usb-md5.obj: md5.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -MT u3_tool_usb-md5.obj -MD -MP -MF $(DEPDIR)/u3_tool_usb-md5.Tpo -c -o u3_tool_usb-md5.obj `if test -f 'md5.c'; then $(CYGPATH_W) 'md5.c'; else $(CYGPATH_W) '$(srcdir)/md5.c'; fi`
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool_usb-md5.Tpo $(DEPDIR)/u3_tool_usb-md5.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='md5.c' object='u3_tool_usb-md5.obj' libtool=no @AMDEPBACKSLASH@
+u3_tool-md5.obj: md5.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-md5.obj -MD -MP -MF $(DEPDIR)/u3_tool-md5.Tpo -c -o u3_tool-md5.obj `if test -f 'md5.c'; then $(CYGPATH_W) 'md5.c'; else $(CYGPATH_W) '$(srcdir)/md5.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-md5.Tpo $(DEPDIR)/u3_tool-md5.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='md5.c' object='u3_tool-md5.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -c -o u3_tool_usb-md5.obj `if test -f 'md5.c'; then $(CYGPATH_W) 'md5.c'; else $(CYGPATH_W) '$(srcdir)/md5.c'; fi`
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-md5.obj `if test -f 'md5.c'; then $(CYGPATH_W) 'md5.c'; else $(CYGPATH_W) '$(srcdir)/md5.c'; fi`
 
-u3_tool_usb-secure_input.o: secure_input.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -MT u3_tool_usb-secure_input.o -MD -MP -MF $(DEPDIR)/u3_tool_usb-secure_input.Tpo -c -o u3_tool_usb-secure_input.o `test -f 'secure_input.c' || echo '$(srcdir)/'`secure_input.c
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool_usb-secure_input.Tpo $(DEPDIR)/u3_tool_usb-secure_input.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='secure_input.c' object='u3_tool_usb-secure_input.o' libtool=no @AMDEPBACKSLASH@
+u3_tool-secure_input.o: secure_input.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-secure_input.o -MD -MP -MF $(DEPDIR)/u3_tool-secure_input.Tpo -c -o u3_tool-secure_input.o `test -f 'secure_input.c' || echo '$(srcdir)/'`secure_input.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-secure_input.Tpo $(DEPDIR)/u3_tool-secure_input.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='secure_input.c' object='u3_tool-secure_input.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -c -o u3_tool_usb-secure_input.o `test -f 'secure_input.c' || echo '$(srcdir)/'`secure_input.c
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-secure_input.o `test -f 'secure_input.c' || echo '$(srcdir)/'`secure_input.c
 
-u3_tool_usb-secure_input.obj: secure_input.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -MT u3_tool_usb-secure_input.obj -MD -MP -MF $(DEPDIR)/u3_tool_usb-secure_input.Tpo -c -o u3_tool_usb-secure_input.obj `if test -f 'secure_input.c'; then $(CYGPATH_W) 'secure_input.c'; else $(CYGPATH_W) '$(srcdir)/secure_input.c'; fi`
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool_usb-secure_input.Tpo $(DEPDIR)/u3_tool_usb-secure_input.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='secure_input.c' object='u3_tool_usb-secure_input.obj' libtool=no @AMDEPBACKSLASH@
+u3_tool-secure_input.obj: secure_input.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-secure_input.obj -MD -MP -MF $(DEPDIR)/u3_tool-secure_input.Tpo -c -o u3_tool-secure_input.obj `if test -f 'secure_input.c'; then $(CYGPATH_W) 'secure_input.c'; else $(CYGPATH_W) '$(srcdir)/secure_input.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-secure_input.Tpo $(DEPDIR)/u3_tool-secure_input.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='secure_input.c' object='u3_tool-secure_input.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -c -o u3_tool_usb-secure_input.obj `if test -f 'secure_input.c'; then $(CYGPATH_W) 'secure_input.c'; else $(CYGPATH_W) '$(srcdir)/secure_input.c'; fi`
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-secure_input.obj `if test -f 'secure_input.c'; then $(CYGPATH_W) 'secure_input.c'; else $(CYGPATH_W) '$(srcdir)/secure_input.c'; fi`
 
-u3_tool_usb-u3_commands.o: u3_commands.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -MT u3_tool_usb-u3_commands.o -MD -MP -MF $(DEPDIR)/u3_tool_usb-u3_commands.Tpo -c -o u3_tool_usb-u3_commands.o `test -f 'u3_commands.c' || echo '$(srcdir)/'`u3_commands.c
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool_usb-u3_commands.Tpo $(DEPDIR)/u3_tool_usb-u3_commands.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_commands.c' object='u3_tool_usb-u3_commands.o' libtool=no @AMDEPBACKSLASH@
+u3_tool-u3_commands.o: u3_commands.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-u3_commands.o -MD -MP -MF $(DEPDIR)/u3_tool-u3_commands.Tpo -c -o u3_tool-u3_commands.o `test -f 'u3_commands.c' || echo '$(srcdir)/'`u3_commands.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-u3_commands.Tpo $(DEPDIR)/u3_tool-u3_commands.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_commands.c' object='u3_tool-u3_commands.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -c -o u3_tool_usb-u3_commands.o `test -f 'u3_commands.c' || echo '$(srcdir)/'`u3_commands.c
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-u3_commands.o `test -f 'u3_commands.c' || echo '$(srcdir)/'`u3_commands.c
 
-u3_tool_usb-u3_commands.obj: u3_commands.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -MT u3_tool_usb-u3_commands.obj -MD -MP -MF $(DEPDIR)/u3_tool_usb-u3_commands.Tpo -c -o u3_tool_usb-u3_commands.obj `if test -f 'u3_commands.c'; then $(CYGPATH_W) 'u3_commands.c'; else $(CYGPATH_W) '$(srcdir)/u3_commands.c'; fi`
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool_usb-u3_commands.Tpo $(DEPDIR)/u3_tool_usb-u3_commands.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_commands.c' object='u3_tool_usb-u3_commands.obj' libtool=no @AMDEPBACKSLASH@
+u3_tool-u3_commands.obj: u3_commands.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-u3_commands.obj -MD -MP -MF $(DEPDIR)/u3_tool-u3_commands.Tpo -c -o u3_tool-u3_commands.obj `if test -f 'u3_commands.c'; then $(CYGPATH_W) 'u3_commands.c'; else $(CYGPATH_W) '$(srcdir)/u3_commands.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-u3_commands.Tpo $(DEPDIR)/u3_tool-u3_commands.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_commands.c' object='u3_tool-u3_commands.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -c -o u3_tool_usb-u3_commands.obj `if test -f 'u3_commands.c'; then $(CYGPATH_W) 'u3_commands.c'; else $(CYGPATH_W) '$(srcdir)/u3_commands.c'; fi`
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-u3_commands.obj `if test -f 'u3_commands.c'; then $(CYGPATH_W) 'u3_commands.c'; else $(CYGPATH_W) '$(srcdir)/u3_commands.c'; fi`
 
-u3_tool_usb-u3_error.o: u3_error.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -MT u3_tool_usb-u3_error.o -MD -MP -MF $(DEPDIR)/u3_tool_usb-u3_error.Tpo -c -o u3_tool_usb-u3_error.o `test -f 'u3_error.c' || echo '$(srcdir)/'`u3_error.c
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool_usb-u3_error.Tpo $(DEPDIR)/u3_tool_usb-u3_error.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_error.c' object='u3_tool_usb-u3_error.o' libtool=no @AMDEPBACKSLASH@
+u3_tool-u3_error.o: u3_error.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-u3_error.o -MD -MP -MF $(DEPDIR)/u3_tool-u3_error.Tpo -c -o u3_tool-u3_error.o `test -f 'u3_error.c' || echo '$(srcdir)/'`u3_error.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-u3_error.Tpo $(DEPDIR)/u3_tool-u3_error.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_error.c' object='u3_tool-u3_error.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -c -o u3_tool_usb-u3_error.o `test -f 'u3_error.c' || echo '$(srcdir)/'`u3_error.c
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-u3_error.o `test -f 'u3_error.c' || echo '$(srcdir)/'`u3_error.c
 
-u3_tool_usb-u3_error.obj: u3_error.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -MT u3_tool_usb-u3_error.obj -MD -MP -MF $(DEPDIR)/u3_tool_usb-u3_error.Tpo -c -o u3_tool_usb-u3_error.obj `if test -f 'u3_error.c'; then $(CYGPATH_W) 'u3_error.c'; else $(CYGPATH_W) '$(srcdir)/u3_error.c'; fi`
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool_usb-u3_error.Tpo $(DEPDIR)/u3_tool_usb-u3_error.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_error.c' object='u3_tool_usb-u3_error.obj' libtool=no @AMDEPBACKSLASH@
+u3_tool-u3_error.obj: u3_error.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-u3_error.obj -MD -MP -MF $(DEPDIR)/u3_tool-u3_error.Tpo -c -o u3_tool-u3_error.obj `if test -f 'u3_error.c'; then $(CYGPATH_W) 'u3_error.c'; else $(CYGPATH_W) '$(srcdir)/u3_error.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-u3_error.Tpo $(DEPDIR)/u3_tool-u3_error.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_error.c' object='u3_tool-u3_error.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -c -o u3_tool_usb-u3_error.obj `if test -f 'u3_error.c'; then $(CYGPATH_W) 'u3_error.c'; else $(CYGPATH_W) '$(srcdir)/u3_error.c'; fi`
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-u3_error.obj `if test -f 'u3_error.c'; then $(CYGPATH_W) 'u3_error.c'; else $(CYGPATH_W) '$(srcdir)/u3_error.c'; fi`
 
-u3_tool_usb-u3_scsi_usb.o: u3_scsi_usb.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -MT u3_tool_usb-u3_scsi_usb.o -MD -MP -MF $(DEPDIR)/u3_tool_usb-u3_scsi_usb.Tpo -c -o u3_tool_usb-u3_scsi_usb.o `test -f 'u3_scsi_usb.c' || echo '$(srcdir)/'`u3_scsi_usb.c
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool_usb-u3_scsi_usb.Tpo $(DEPDIR)/u3_tool_usb-u3_scsi_usb.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_scsi_usb.c' object='u3_tool_usb-u3_scsi_usb.o' libtool=no @AMDEPBACKSLASH@
+u3_tool-u3_scsi_usb.o: u3_scsi_usb.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-u3_scsi_usb.o -MD -MP -MF $(DEPDIR)/u3_tool-u3_scsi_usb.Tpo -c -o u3_tool-u3_scsi_usb.o `test -f 'u3_scsi_usb.c' || echo '$(srcdir)/'`u3_scsi_usb.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-u3_scsi_usb.Tpo $(DEPDIR)/u3_tool-u3_scsi_usb.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_scsi_usb.c' object='u3_tool-u3_scsi_usb.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -c -o u3_tool_usb-u3_scsi_usb.o `test -f 'u3_scsi_usb.c' || echo '$(srcdir)/'`u3_scsi_usb.c
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-u3_scsi_usb.o `test -f 'u3_scsi_usb.c' || echo '$(srcdir)/'`u3_scsi_usb.c
 
-u3_tool_usb-u3_scsi_usb.obj: u3_scsi_usb.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -MT u3_tool_usb-u3_scsi_usb.obj -MD -MP -MF $(DEPDIR)/u3_tool_usb-u3_scsi_usb.Tpo -c -o u3_tool_usb-u3_scsi_usb.obj `if test -f 'u3_scsi_usb.c'; then $(CYGPATH_W) 'u3_scsi_usb.c'; else $(CYGPATH_W) '$(srcdir)/u3_scsi_usb.c'; fi`
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool_usb-u3_scsi_usb.Tpo $(DEPDIR)/u3_tool_usb-u3_scsi_usb.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_scsi_usb.c' object='u3_tool_usb-u3_scsi_usb.obj' libtool=no @AMDEPBACKSLASH@
+u3_tool-u3_scsi_usb.obj: u3_scsi_usb.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-u3_scsi_usb.obj -MD -MP -MF $(DEPDIR)/u3_tool-u3_scsi_usb.Tpo -c -o u3_tool-u3_scsi_usb.obj `if test -f 'u3_scsi_usb.c'; then $(CYGPATH_W) 'u3_scsi_usb.c'; else $(CYGPATH_W) '$(srcdir)/u3_scsi_usb.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-u3_scsi_usb.Tpo $(DEPDIR)/u3_tool-u3_scsi_usb.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_scsi_usb.c' object='u3_tool-u3_scsi_usb.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_usb_CFLAGS) $(CFLAGS) -c -o u3_tool_usb-u3_scsi_usb.obj `if test -f 'u3_scsi_usb.c'; then $(CYGPATH_W) 'u3_scsi_usb.c'; else $(CYGPATH_W) '$(srcdir)/u3_scsi_usb.c'; fi`
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-u3_scsi_usb.obj `if test -f 'u3_scsi_usb.c'; then $(CYGPATH_W) 'u3_scsi_usb.c'; else $(CYGPATH_W) '$(srcdir)/u3_scsi_usb.c'; fi`
+
+u3_tool-u3_scsi_spt.o: u3_scsi_spt.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-u3_scsi_spt.o -MD -MP -MF $(DEPDIR)/u3_tool-u3_scsi_spt.Tpo -c -o u3_tool-u3_scsi_spt.o `test -f 'u3_scsi_spt.c' || echo '$(srcdir)/'`u3_scsi_spt.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-u3_scsi_spt.Tpo $(DEPDIR)/u3_tool-u3_scsi_spt.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_scsi_spt.c' object='u3_tool-u3_scsi_spt.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-u3_scsi_spt.o `test -f 'u3_scsi_spt.c' || echo '$(srcdir)/'`u3_scsi_spt.c
+
+u3_tool-u3_scsi_spt.obj: u3_scsi_spt.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-u3_scsi_spt.obj -MD -MP -MF $(DEPDIR)/u3_tool-u3_scsi_spt.Tpo -c -o u3_tool-u3_scsi_spt.obj `if test -f 'u3_scsi_spt.c'; then $(CYGPATH_W) 'u3_scsi_spt.c'; else $(CYGPATH_W) '$(srcdir)/u3_scsi_spt.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-u3_scsi_spt.Tpo $(DEPDIR)/u3_tool-u3_scsi_spt.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_scsi_spt.c' object='u3_tool-u3_scsi_spt.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-u3_scsi_spt.obj `if test -f 'u3_scsi_spt.c'; then $(CYGPATH_W) 'u3_scsi_spt.c'; else $(CYGPATH_W) '$(srcdir)/u3_scsi_spt.c'; fi`
+
+u3_tool-u3_scsi_sg.o: u3_scsi_sg.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-u3_scsi_sg.o -MD -MP -MF $(DEPDIR)/u3_tool-u3_scsi_sg.Tpo -c -o u3_tool-u3_scsi_sg.o `test -f 'u3_scsi_sg.c' || echo '$(srcdir)/'`u3_scsi_sg.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-u3_scsi_sg.Tpo $(DEPDIR)/u3_tool-u3_scsi_sg.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_scsi_sg.c' object='u3_tool-u3_scsi_sg.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-u3_scsi_sg.o `test -f 'u3_scsi_sg.c' || echo '$(srcdir)/'`u3_scsi_sg.c
+
+u3_tool-u3_scsi_sg.obj: u3_scsi_sg.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -MT u3_tool-u3_scsi_sg.obj -MD -MP -MF $(DEPDIR)/u3_tool-u3_scsi_sg.Tpo -c -o u3_tool-u3_scsi_sg.obj `if test -f 'u3_scsi_sg.c'; then $(CYGPATH_W) 'u3_scsi_sg.c'; else $(CYGPATH_W) '$(srcdir)/u3_scsi_sg.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/u3_tool-u3_scsi_sg.Tpo $(DEPDIR)/u3_tool-u3_scsi_sg.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='u3_scsi_sg.c' object='u3_tool-u3_scsi_sg.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(u3_tool_CFLAGS) $(CFLAGS) -c -o u3_tool-u3_scsi_sg.obj `if test -f 'u3_scsi_sg.c'; then $(CYGPATH_W) 'u3_scsi_sg.c'; else $(CYGPATH_W) '$(srcdir)/u3_scsi_sg.c'; fi`
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
@@ -447,7 +460,7 @@ check-am: all-am
 check: check-am
 all-am: Makefile $(PROGRAMS)
 installdirs:
-	for dir in "$(DESTDIR)$(bindir)"; do \
+	for dir in "$(DESTDIR)$(sbindir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -476,7 +489,7 @@ maintainer-clean-generic:
 	@echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am
 
 distclean: distclean-am
 	-rm -rf ./$(DEPDIR)
@@ -498,7 +511,7 @@ install-data-am:
 
 install-dvi: install-dvi-am
 
-install-exec-am: install-binPROGRAMS
+install-exec-am: install-sbinPROGRAMS
 
 install-html: install-html-am
 
@@ -529,22 +542,22 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-binPROGRAMS
+uninstall-am: uninstall-sbinPROGRAMS
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-sbinPROGRAMS ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-binPROGRAMS \
-	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 \
+	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-sbinPROGRAMS install-strip \
 	installcheck installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
-	uninstall-am uninstall-binPROGRAMS
+	uninstall-am uninstall-sbinPROGRAMS
 
 # 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.

+ 67 - 19
src/main.c

@@ -48,7 +48,7 @@ int debug = 0;
 int batch_mode = 0;
 
 enum action_t { unknown, load, partition, dump, info, unlock, change_password,
-		enable_security, disable_security };
+		enable_security, disable_security, reset_security };
 
 /********************************** Helpers ***********************************/
 
@@ -100,7 +100,7 @@ char factor_symbols[] = "kMGTPE";
  *
  * @param size	Data size to print
  */
-void print_human_size(size_t size) {
+void print_human_size(uint64_t size) {
 	float fsize = 0;
 	unsigned int factor = 0;
 	
@@ -345,7 +345,42 @@ int do_enable_security(u3_handle_t *device, char *password) {
 	return EXIT_SUCCESS;
 }
 
-int do_disable_security(u3_handle_t *device) {
+int do_disable_security(u3_handle_t *device, char *password) {
+	int result=0;
+	int tries_left=0;
+
+	// check password retry counter
+	if (get_tries_left(device, &tries_left) != U3_SUCCESS) {
+		return EXIT_FAILURE;
+	}
+
+	if (tries_left == 0) {
+		printf("Unable to disable security, device is blocked\n");
+		return EXIT_FAILURE;
+	} else if (tries_left == 1) {
+		printf("Warning: This is the your last password try. If this attempt fails,");
+		printf(" all data on the data partition is lost.\n");
+		if (!confirm())
+			return EXIT_FAILURE;
+	}
+
+	// disable security
+	if (u3_disable_security(device, password, &result) != U3_SUCCESS) {
+		fprintf(stderr, "u3_disable_security() failed: %s\n",
+			u3_error_msg(device));
+		return EXIT_FAILURE;
+	}
+
+	if (result) {
+		printf("OK\n");
+		return EXIT_SUCCESS;
+	} else {
+		printf("Password incorrect\n");
+		return EXIT_FAILURE;
+	}
+}
+
+int do_reset_security(u3_handle_t *device) {
 	int result=0;
 
 	// the enable security command is always possible without the correct
@@ -368,7 +403,7 @@ int do_disable_security(u3_handle_t *device) {
 		printf("OK\n");
 		return EXIT_SUCCESS;
 	} else {
-		printf("Password incorrect\n");
+		printf("Failed\n");
 		return EXIT_FAILURE;
 	}
 }
@@ -579,17 +614,17 @@ void usage(const char *name) {
 	printf("\t-i                Display device info\n");
 	printf("\t-l <cd image>     Load CD image into device\n");
 	printf("\t-p <cd size>      Repartition device\n");
+	printf("\t-R                Reset device security, destroying private data\n");
 	printf("\t-u                Unlock device\n");
 	printf("\t-v                Use verbose output\n");
 	printf("\t-V                Print version information\n");
 	printf("\n");
-	printf("The device name depends on the used subsystem.\n");
-	printf("Examples: '/dev/sda0'(sg), 'scan'(USB),'vid:pid'(USB), "
-			"'e'(Windows)\n");
+	printf("For the device name use:\n  %s\n", u3_subsystem_help);
 }
 
 void print_version() {
 	printf("u3-tool %s\n", version);
+	printf("subsystem: %s\n", u3_subsystem_name);
 	printf("\n");
 	printf("Copyright (C) 2009\n");
 	printf("This is free software; see the source for copying "
@@ -618,7 +653,7 @@ int main(int argc, char *argv[]) {
 	//
 	// parse options
 	//
-	while ((c = getopt(argc, argv, "cdDehil:p:uvVz")) != -1) {
+	while ((c = getopt(argc, argv, "cdDehil:p:RuvVz")) != -1) {
 		switch (c) {
 			case 'c':
 				action = change_password;
@@ -642,6 +677,9 @@ int main(int argc, char *argv[]) {
 				strncpy(size_string, optarg, MAX_SIZE_STRING_LENGTH);
 				size_string[MAX_SIZE_STRING_LENGTH] = '\0';
 				break;
+			case 'R':
+				action = reset_security;
+				break;
 			case 'u':
 				action = unlock;
 				break;
@@ -672,8 +710,19 @@ int main(int argc, char *argv[]) {
 		exit(EXIT_FAILURE);
 	}
 	device_name = argv[optind];
-		
-	if ((action == unlock || action == change_password)
+
+	//
+	// open the device
+	// 
+	if (u3_open(&device, device_name)) {
+		fprintf(stderr, "Error opening device: %s\n", u3_error_msg(&device));
+		exit(EXIT_FAILURE);
+	}
+
+	//
+	// ask passwords
+	//
+	if ((action == unlock || action == change_password || action == disable_security)
 	     && ask_password)
 	{
 		int proceed = 0;
@@ -708,18 +757,12 @@ int main(int argc, char *argv[]) {
 			} else {
 				fprintf(stderr, "Passwords don't match\n");
 			}
+			
+			memset(validate_password, 0, sizeof(validate_password));
 		} while (!proceed);
 	}
 
 	//
-	// open the device
-	// 
-	if (u3_open(&device, device_name)) {
-		fprintf(stderr, "Error opening device: %s\n", u3_error_msg(&device));
-		exit(EXIT_FAILURE);
-	}
-
-	//
 	// preform action
 	//
 	switch (action) {
@@ -754,10 +797,13 @@ int main(int argc, char *argv[]) {
 				retval = do_enable_security(&device, new_password);
 			break;
 		case disable_security:
+			retval = do_disable_security(&device, password);
+			break;
+		case reset_security:
 			printf("WARNING: This will delete all data on the data ");
 			printf("partition\n");
 			if (confirm())
-				retval = do_disable_security(&device);
+				retval = do_reset_security(&device);
 			break;
 		default:
 			fprintf(stderr, "No action specified, use '-h' option for help.\n");
@@ -767,6 +813,8 @@ int main(int argc, char *argv[]) {
 	//
 	// clean up
 	//
+	memset(password, 0, sizeof(password));
+	memset(new_password, 0, sizeof(new_password));
 	u3_close(&device);
 
 	return retval;

+ 23 - 4
src/secure_input.c

@@ -19,7 +19,9 @@
 #include "secure_input.h"
 #include <stdio.h>
 #include <unistd.h>
-#ifndef WIN32
+#ifdef WIN32
+# include <windows.h>
+#else
 # include <termios.h>
 # include <sys/ioctl.h>
 #endif
@@ -27,14 +29,28 @@
 void
 secure_input(char *buf, size_t buf_size)
 {
-#ifndef WIN32
+#ifdef WIN32
+	DWORD mode;
+	HANDLE ih;
+#else
 	struct termio ttymode;
 #endif
 	int pos;
 	int ch;
 
-#ifndef WIN32
+	// input checking
+	if (buf_size < 1) return;
+	buf[0] = '\n';
+
 	// hide input
+#ifdef WIN32
+	ih = GetStdHandle(STD_INPUT_HANDLE);
+	if (!GetConsoleMode(ih, &mode)) {
+		fprintf(stderr, "Failed to obtain handle to console\n");
+		return;
+	}
+	SetConsoleMode(ih, mode & ~(ENABLE_ECHO_INPUT ));
+#else
 	ioctl(STDIN_FILENO, TCGETA, &ttymode);
 	ttymode.c_lflag &= ~( ECHO | ECHOE | ECHONL );
 	ioctl(STDIN_FILENO, TCSETAF, &ttymode);
@@ -53,8 +69,11 @@ secure_input(char *buf, size_t buf_size)
 	while (ch != '\n' && ch != EOF)
 		ch = fgetc(stdin);
 
-#ifndef WIN32
 	// unhide input
+#ifdef WIN32
+	SetConsoleMode(ih, mode);
+	fputc('\n', stdout);
+#else
 	ttymode.c_lflag |= ECHO | ECHOE | ECHONL;
 	ioctl(STDIN_FILENO, TCSETAF, &ttymode);
 	fputc('\n', stdout);

+ 12 - 0
src/u3_commands.c

@@ -461,9 +461,12 @@ int u3_enable_security(u3_handle_t *device, const char *password) {
 	if (u3_send_cmd(device, cmd, U3_DATA_TO_DEV, sizeof(data),
 		(uint8_t *) &data, &status) != U3_SUCCESS)
 	{
+		memset(&data, 0, sizeof(data));
 		return U3_FAILURE;
 	}
 
+	memset(&data, 0, sizeof(data));
+
 	if (status != 0) {
 		u3_set_error(device, "Device reported command failed: status %d", status);
 		return U3_FAILURE;
@@ -488,6 +491,7 @@ int u3_disable_security(u3_handle_t *device, const char *password,
 	if (u3_send_cmd(device, cmd, U3_DATA_TO_DEV, sizeof(passhash_buf),
 		passhash_buf, &status) != U3_SUCCESS)
 	{
+		memset(passhash_buf, 0, sizeof(passhash_buf));
 		return U3_FAILURE;
 	}
 
@@ -495,6 +499,8 @@ int u3_disable_security(u3_handle_t *device, const char *password,
 		*result = 1;
 	}
 
+	memset(passhash_buf, 0, sizeof(passhash_buf));
+
 	return U3_SUCCESS;
 }
 
@@ -512,6 +518,7 @@ int u3_unlock(u3_handle_t *device, const char *password, int *result) {
 	if (u3_send_cmd(device, cmd, U3_DATA_TO_DEV, sizeof(passhash_buf),
 		passhash_buf, &status) != U3_SUCCESS)
 	{
+		memset(passhash_buf, 0, sizeof(passhash_buf));
 		return U3_FAILURE;
 	}
 
@@ -519,6 +526,8 @@ int u3_unlock(u3_handle_t *device, const char *password, int *result) {
 		*result = 1;
 	}
 
+	memset(passhash_buf, 0, sizeof(passhash_buf));
+
 	return U3_SUCCESS;
 }
 
@@ -539,6 +548,7 @@ int u3_change_password(u3_handle_t *device, const char *old_password,
 	if (u3_send_cmd(device, cmd, U3_DATA_TO_DEV, sizeof(passhash_buf),
 		(uint8_t *) passhash_buf, &status) != U3_SUCCESS)
 	{
+		memset(passhash_buf, 0, sizeof(passhash_buf));
 		return U3_FAILURE;
 	}
 
@@ -546,6 +556,8 @@ int u3_change_password(u3_handle_t *device, const char *old_password,
 		*result = 1;
 	}
 
+	memset(passhash_buf, 0, sizeof(passhash_buf));
+
 	return U3_SUCCESS;
 }
 

+ 3 - 0
src/u3_scsi.h

@@ -29,6 +29,9 @@
 
 #define U3_CMD_LEN		12
 
+extern const char *u3_subsystem_name;
+extern const char *u3_subsystem_help;
+
 /**
  * Open U3 device
  *

+ 9 - 1
src/u3_scsi_sg.c

@@ -16,6 +16,11 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */ 
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef SUBSYS_SG
 #include "u3_scsi.h"
 #include "u3_error.h"
 
@@ -35,6 +40,9 @@
 
 #define U3_TIMEOUT 2000	//2000 millisecs == 2 seconds 
 
+const char *u3_subsystem_name = "sg";
+const char *u3_subsystem_help = "'/dev/sda0', '/dev/sg3'";
+
 int u3_open(u3_handle_t *device, const char *which) 
 {
 	int k;
@@ -162,4 +170,4 @@ int u3_send_cmd(u3_handle_t *device, uint8_t cmd[U3_CMD_LEN],
 	return U3_SUCCESS;
 }
 
-
+#endif //SUBSYS_SG

+ 142 - 0
src/u3_scsi_spt.c

@@ -0,0 +1,142 @@
+/**
+ * u3-tool - U3 USB stick manager
+ * Copyright (C) 2007 Daviedev, daviedev@users.sourceforge.net
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it 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.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */ 
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef SUBSYS_SPT
+#include "u3_scsi.h"
+#include "u3_error.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <ctype.h>
+
+#include <windows.h>
+#include <ddk/ntddscsi.h>
+
+#define U3_TIMEOUT 2	// 2 seconds 
+
+const char *u3_subsystem_name = "spt";
+const char *u3_subsystem_help = "The drive letter of the device";
+
+int u3_open(u3_handle_t *device, const char *which) 
+{
+	HANDLE hDevice;
+    CHAR lpszDeviceName[7];
+    DWORD dwBytesReturned;
+    DWORD dwError;
+
+    u3_set_error(device, "");
+    device->dev = NULL;
+
+    // check parameter
+    if (strlen(which) != 1 || ! isalpha(which[0])) {
+        u3_set_error(device, "Unknown drive name '%s', Expecting a "
+            "drive letter", which);
+        return U3_FAILURE;
+    }
+
+    //take the drive letter and put it in the format used in CreateFile
+    memcpy(lpszDeviceName, (char *) "\\\\.\\*:", 7);
+    lpszDeviceName[4] = which[0];
+
+    //get a handle to the device, the parameters used here must be used in order for this to work
+    hDevice=CreateFile(lpszDeviceName,
+						GENERIC_READ|GENERIC_WRITE,
+						FILE_SHARE_READ|FILE_SHARE_WRITE,
+						NULL,
+						OPEN_EXISTING,
+						FILE_ATTRIBUTE_NORMAL,
+						NULL);
+
+    //if for some reason we couldn't get a handle to the device we will try again using slightly different parameters for CreateFile
+    if (hDevice==INVALID_HANDLE_VALUE)
+    {
+		u3_set_error(device, "Failed openning handle for %s: Error %d\n", which, GetLastError());
+		return U3_FAILURE;
+	}
+
+	
+	device->dev = hDevice;
+	return U3_SUCCESS;
+}
+
+void u3_close(u3_handle_t *device) 
+{
+	HANDLE hDevice = (HANDLE)device->dev;
+	CloseHandle(hDevice);
+}
+
+int u3_send_cmd(u3_handle_t *device, uint8_t cmd[U3_CMD_LEN],
+		int dxfer_direction, int dxfer_length, uint8_t *dxfer_data,
+		uint8_t *status)
+{
+	HANDLE hDevice = (HANDLE)device->dev;
+	SCSI_PASS_THROUGH_DIRECT sptd;
+	DWORD returned;
+	BOOL err;
+
+	// translate dxfer_direction
+	switch (dxfer_direction) {
+		case U3_DATA_NONE:
+			dxfer_direction = SCSI_IOCTL_DATA_UNSPECIFIED;
+			break;
+		case U3_DATA_TO_DEV:
+			dxfer_direction = SCSI_IOCTL_DATA_OUT;
+			break;
+		case U3_DATA_FROM_DEV:
+			dxfer_direction = SCSI_IOCTL_DATA_IN;
+			break;
+	}
+
+	// Prepare command
+    memset(&sptd, 0, sizeof(SCSI_PASS_THROUGH_DIRECT));
+    sptd.Length             = sizeof(SCSI_PASS_THROUGH_DIRECT);// fixed
+    sptd.CdbLength          = U3_CMD_LEN;						// length of command in bytes
+    sptd.SenseInfoLength    = 0;								// don't use this currently...
+    sptd.DataIn             = dxfer_direction;					// data direction
+    sptd.DataTransferLength = dxfer_length;					// Size of data transfered
+    sptd.TimeOutValue       = U3_TIMEOUT;						// timeout in seconds
+    sptd.DataBuffer         = dxfer_data;						// data buffer
+    //sptd.SenseInfoOffset    = offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS, sbuf);
+    memcpy(sptd.Cdb, cmd, U3_CMD_LEN);
+
+	// preform ioctl on device
+    err = DeviceIoControl(hDevice, IOCTL_SCSI_PASS_THROUGH_DIRECT, &sptd,
+						sizeof(sptd), &sptd, sizeof(sptd), &returned, NULL);
+
+	// evaluate result
+	if (!err) {
+		u3_set_error(device, "Failed executing scsi command: "
+			"Error %d", GetLastError());
+		return U3_FAILURE;
+	}
+
+	*status = sptd.ScsiStatus;
+
+	return U3_SUCCESS;
+}
+
+#endif // SUBSYS_SPT

+ 13 - 3
src/u3_scsi_usb.c

@@ -16,6 +16,11 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */ 
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef SUBSYS_LIBUSB
 #include "u3_scsi.h"
 #include "u3_error.h"
 
@@ -47,10 +52,12 @@
 
 #define U3_DEVICE_TIMEOUT 20000	//2000 millisecs == 2 seconds 
 
-#define U3_DEV_LIST_LENGTH 2
+#define U3_DEV_LIST_LENGTH 4
 uint16_t u3_dev_list[U3_DEV_LIST_LENGTH][2] = {
-	{ 0x08ec, 0x0020 },
-	{ 0x0781, 0x5406 },
+	{ 0x08ec, 0x0020 }, // Verbatim Store 'N Go
+	{ 0x0781, 0x5406 }, // Sandisk Cruzer Micro
+	{ 0x0781, 0x5408 }, // Sandisk Cruzer Titanium
+	{ 0x0781, 0x550a }, // Sandisk Cruzer Pattern
 };
 
 struct u3_usb_handle {
@@ -78,6 +85,8 @@ struct usb_msc_csw {
 	uint8_t bCSWStatus;
 } __attribute__ ((packed));
 
+const char *u3_subsystem_name = "libusb";
+const char *u3_subsystem_help = "'scan' to automatically use the first detected U3 device, or 'vid:pid' if not detected";
 
 struct usb_device *
 locate_u3_device(uint16_t vid, uint16_t pid)
@@ -350,3 +359,4 @@ int u3_send_cmd(u3_handle_t *device, uint8_t cmd[U3_CMD_LEN],
 	return U3_SUCCESS;
 }
 
+#endif //SUBSYS_LIBUSB