diff options
-rw-r--r-- | ChangeLog | 18 | ||||
-rwxr-xr-x | debian/rules | 4 | ||||
-rw-r--r-- | i386/README-Drivers | 6 | ||||
-rw-r--r-- | i386/linux/Drivers.in | 6 | ||||
-rw-r--r-- | i386/linux/Makefile.in | 2 | ||||
-rwxr-xr-x | i386/linux/configure | 540 | ||||
-rw-r--r-- | i386/linux/device-drivers.h.in | 1 | ||||
-rw-r--r-- | linux/Files | 3 | ||||
-rw-r--r-- | linux/dev/drivers/scsi/hosts.c | 6 | ||||
-rw-r--r-- | linux/src/drivers/scsi/dc390w.h | 145 | ||||
-rw-r--r-- | linux/src/drivers/scsi/tmscsiw.c | 2096 | ||||
-rw-r--r-- | linux/src/drivers/scsi/tmscsiw.h | 1082 |
12 files changed, 387 insertions, 3522 deletions
@@ -1,3 +1,21 @@ +2001-05-27 Marcus Brinkmann <marcus@gnu.org> + + * debian/rules: Add --enable-ncr53c8xx to configure. + +1999-10-06 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> + + * linux/src/drivers/scsi/tmscsiw.c: Removed. + * linux/src/drivers/scsi/tmscsiw.h: Likewise. + * linux/src/drivers/scsi/dc390w.h: Likewise. + * i386/linux/device-drivers.h.in (CONFIG_SCSI_DC390W): Deleted. + * i386/linux/Drivers.in: Remove linux_DRIVER(dc390w, ...). Now + dc390w, dc390u, and dc390f are aliases to ncr53c8xx. + * i386/linux/configure: Regenerated. + * linux/Files: Likewise. + * i386/linux/Makefile.in (linux-scsi-files): Delete tmscsiw.c. + * linux/dev/drivers/scsi/hosts.c: Do not include dc390w.h. + Reported by Andreas Voegele <andreas.voegele@nikocity.de>. + 2001-05-20 Roland McGrath <roland@frob.com> * kern/sched_prim.c (state_panic): New function, panic with some diff --git a/debian/rules b/debian/rules index 884e077..e721959 100755 --- a/debian/rules +++ b/debian/rules @@ -54,7 +54,7 @@ stamp-configure: $(checkdir) -mkdir build # disabled: - # ncr5380, ncr53c400, ncr53c8xx, ncr53c406a + # ncr5380, ncr53c400, ncr53c406a # hpj2577, hpj2573, hp27248b, hp2585, atp cd build && ../configure \ --enable-floppy \ @@ -80,7 +80,7 @@ stamp-configure: --enable-eata \ --enable-am53c974 --enable-am79c974 \ --enable-dtc3280 --enable-dtc3180 \ - --enable-dc390w --enable-dc390u --enable-dc390f \ + --enable-ncr53c8xx --enable-dc390w --enable-dc390u --enable-dc390f \ --enable-dc390t --enable-dc390 \ --enable-ppa \ --enable-qlogicfas \ diff --git a/i386/README-Drivers b/i386/README-Drivers index 7089b31..b95784f 100644 --- a/i386/README-Drivers +++ b/i386/README-Drivers @@ -158,14 +158,12 @@ DTC3180/3280 NCR53C8XX --enable-ncr53c8xx scsi/ncr53c8xx.c - -Tekram DC-390W/U/F - --enable-dc390w scsi/tmsscsiw.c + --enable-dc390w --enable-dc390u --enable-dc390f Tekram DC-390(T) - --enable-dc390t scsi/tmsscsim.c + --enable-dc390t scsi/tmscsim.c --enable-dc390 IOMEGA Parallel Port ZIP drive diff --git a/i386/linux/Drivers.in b/i386/linux/Drivers.in index 5e79064..21e9293 100644 --- a/i386/linux/Drivers.in +++ b/i386/linux/Drivers.in @@ -88,8 +88,9 @@ AC_DRIVER_ALIAS(t128f, t128) AC_DRIVER_ALIAS(t228, t128) AC_DRIVER_ALIAS(am79c974, am53c974) AC_DRIVER_ALIAS(dtc3180, dtc3280) -AC_DRIVER_ALIAS(dc390u, dc390w) -AC_DRIVER_ALIAS(dc390f, dc390w) +AC_DRIVER_ALIAS(dc390w, ncr53c8xx) +AC_DRIVER_ALIAS(dc390u, ncr53c8xx) +AC_DRIVER_ALIAS(dc390f, ncr53c8xx) AC_DRIVER_ALIAS(dc390, dc390t) AC_DRIVER_ALIAS(epic100, epic) @@ -142,7 +143,6 @@ linux_DRIVER(eata, SCSI_EATA, eata, scsi) linux_DRIVER(am53c974, SCSI_AM53C974, AM53C974, scsi) linux_DRIVER(dtc3280, SCSI_DTC3280, dtc, scsi) linux_DRIVER(ncr53c8xx, SCSI_NCR53C8XX, ncr53c8xx, scsi) -linux_DRIVER(dc390w, SCSI_DC390W, tmscsiw, scsi) linux_DRIVER(dc390t, SCSI_DC390T, tmscsim, scsi) linux_DRIVER(ppa, SCSI_PPA, ppa, scsi) linux_DRIVER(qlogicfas, SCSI_QLOGIC_FAS, qlogicfas, scsi) diff --git a/i386/linux/Makefile.in b/i386/linux/Makefile.in index 2d7d3a6..da97105 100644 --- a/i386/linux/Makefile.in +++ b/i386/linux/Makefile.in @@ -83,7 +83,7 @@ linux-scsi-files = 53c78xx.c AM53C974.c BusLogic.c NCR53c406a.c advansys.c \ eata_dma.c eata_pio.c fdomain.c g_NCR5380.c gdth.c hosts.c in2000.c \ ncr53c8xx.c pas16.c ppa.c qlogicfas.c qlogicisp.c scsi.c scsi_ioctl.c \ scsi_proc.c scsicam.c sd.c sd_ioctl.c seagate.c sr.c sr_ioctl.c \ - t128.c tmscsim.c tmscsiw.c u14-34f.c ultrastor.c wd7000.c + t128.c tmscsim.c u14-34f.c ultrastor.c wd7000.c vpath %.c $(linuxsrcdir)/dev/drivers/scsi vpath %.c $(linuxsrcdir)/src/drivers/scsi diff --git a/i386/linux/configure b/i386/linux/configure index ed8c293..a851dca 100755 --- a/i386/linux/configure +++ b/i386/linux/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12 +# Generated automatically using autoconf version 2.13.1 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -377,8 +377,6 @@ ac_help="$ac_help " ac_help="$ac_help " -ac_help="$ac_help -" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -417,6 +415,7 @@ mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 @@ -700,7 +699,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12" + echo "configure generated by autoconf version 2.13.1" exit 0 ;; -with-* | --with-*) @@ -860,7 +859,7 @@ done if test -r "$cache_file"; then echo "loading cache $cache_file" - . $cache_file + test -f "$cache_file" && . $cache_file else echo "creating cache $cache_file" > $cache_file @@ -870,9 +869,11 @@ ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross +ac_exeext= +ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then @@ -911,8 +912,6 @@ fi - - ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -923,41 +922,59 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:941: checking host system type" >&5 +if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then # Make sure we can run config.sub. -if $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + if $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + ac_cv_host_alias=$host + case "$ac_cv_host_alias" in + NONE) + case $nonopt in + NONE) + if ac_cv_host_alias=`$ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) ac_cv_host_alias=$nonopt ;; + esac ;; + esac + + ac_cv_host=`$ac_config_sub $ac_cv_host_alias` + ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +else + echo $ac_n "(cached) $ac_c" 1>&6 fi -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:943: checking host system type" >&5 +echo "$ac_t""$ac_cv_host" 1>&6 + +host=$ac_cv_host +host_alias=$ac_cv_host_alias +host_cpu=$ac_cv_host_cpu +host_vendor=$ac_cv_host_vendor +host_os=$ac_cv_host_os + -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`$ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac -host=`$ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 case "$host_cpu" in @@ -1009,23 +1026,45 @@ i[3456]86) systype=i386 ;; esac + echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1014: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac +echo "configure:1032: checking build system type" >&5 +if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then + +# Make sure we can run config.sub. + if $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + ac_cv_build_alias=$build + case "$ac_cv_build_alias" in + NONE) + case $nonopt in + NONE) + ac_cv_build_alias=$host_alias ;; + + *) ac_cv_build_alias=$nonopt ;; + esac ;; + esac + + ac_cv_build=`$ac_config_sub $ac_cv_build_alias` + ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +else + echo $ac_n "(cached) $ac_c" 1>&6 +fi + +echo "$ac_t""$ac_cv_build" 1>&6 + +build=$ac_cv_build +build_alias=$ac_cv_build_alias +build_cpu=$ac_cv_build_cpu +build_vendor=$ac_cv_build_vendor +build_os=$ac_cv_build_os + + -build=`$ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 if test $host != $build; then ac_tool_prefix=${host_alias}- @@ -1036,15 +1075,16 @@ fi # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1040: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then +echo "configure:1079: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="${ac_tool_prefix}gcc" @@ -1067,15 +1107,16 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1071: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then +echo "configure:1111: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" @@ -1096,16 +1137,17 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1100: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then +echo "configure:1141: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - for ac_dir in $PATH; do + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then @@ -1144,21 +1186,23 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1148: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1190: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross -cat > conftest.$ac_ext <<EOF -#line 1158 "configure" +cat > conftest.$ac_ext << EOF + +#line 1201 "configure" #include "confdefs.h" + main(){return(0);} EOF -if { (eval echo configure:1162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1172,6 +1216,12 @@ else ac_cv_prog_cc_works=no fi rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then @@ -1182,14 +1232,14 @@ else cross_linkable=yes fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1186: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1236: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1192: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then +echo "configure:1242: checking whether we are using GNU C" >&5 +if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <<EOF @@ -1197,7 +1247,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1231,15 +1281,16 @@ fi # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. set dummy ${ac_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1235: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then +echo "configure:1285: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_LD+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$LD"; then ac_cv_prog_LD="$LD" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_LD="${ac_tool_prefix}ld" @@ -1632,11 +1683,20 @@ if test "${enable_dtc3180+set}" = set; then fi +# Checking for alias dc390w +# Check whether --enable-dc390w or --disable-dc390w was given. +if test "${enable_dc390w+set}" = set; then + enableval="$enable_dc390w" + enable_ncr53c8xx="$enable_dc390w" + +fi + + # Checking for alias dc390u # Check whether --enable-dc390u or --disable-dc390u was given. if test "${enable_dc390u+set}" = set; then enableval="$enable_dc390u" - enable_dc390w="$enable_dc390u" + enable_ncr53c8xx="$enable_dc390u" fi @@ -1645,7 +1705,7 @@ fi # Check whether --enable-dc390f or --disable-dc390f was given. if test "${enable_dc390f+set}" = set; then enableval="$enable_dc390f" - enable_dc390w="$enable_dc390f" + enable_ncr53c8xx="$enable_dc390f" fi @@ -1689,7 +1749,8 @@ driver_class_net_files="auto_irq.o net.o Space.o dev.o net_init.o" # Check whether --enable-floppy or --disable-floppy was given. if test "${enable_floppy+set}" = set; then enableval="$enable_floppy" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_BLK_DEV_FD 1 EOF @@ -1702,6 +1763,7 @@ EOF device_drivers="$device_drivers $driver_class__files" fi +fi fi @@ -1710,7 +1772,8 @@ fi # Check whether --enable-ide or --disable-ide was given. if test "${enable_ide+set}" = set; then enableval="$enable_ide" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_BLK_DEV_IDE 1 EOF @@ -1723,6 +1786,7 @@ EOF device_drivers="$device_drivers $driver_class__files" fi +fi fi @@ -1743,7 +1807,8 @@ fi # Check whether --enable-advansys or --disable-advansys was given. if test "${enable_advansys+set}" = set; then enableval="$enable_advansys" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_ADVANSYS 1 EOF @@ -1756,6 +1821,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -1773,7 +1839,8 @@ fi # Check whether --enable-buslogic or --disable-buslogic was given. if test "${enable_buslogic+set}" = set; then enableval="$enable_buslogic" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_BUSLOGIC 1 EOF @@ -1786,6 +1853,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -1803,7 +1871,8 @@ fi # Check whether --enable-u1434f or --disable-u1434f was given. if test "${enable_u1434f+set}" = set; then enableval="$enable_u1434f" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_U14_34F 1 EOF @@ -1816,6 +1885,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -1833,7 +1903,8 @@ fi # Check whether --enable-ultrastor or --disable-ultrastor was given. if test "${enable_ultrastor+set}" = set; then enableval="$enable_ultrastor" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_ULTRASTOR 1 EOF @@ -1846,6 +1917,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -1863,7 +1935,8 @@ fi # Check whether --enable-aha152x or --disable-aha152x was given. if test "${enable_aha152x+set}" = set; then enableval="$enable_aha152x" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_AHA152X 1 EOF @@ -1876,6 +1949,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -1893,7 +1967,8 @@ fi # Check whether --enable-aha1542 or --disable-aha1542 was given. if test "${enable_aha1542+set}" = set; then enableval="$enable_aha1542" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_AHA1542 1 EOF @@ -1906,6 +1981,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -1923,7 +1999,8 @@ fi # Check whether --enable-aha1740 or --disable-aha1740 was given. if test "${enable_aha1740+set}" = set; then enableval="$enable_aha1740" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_AHA1740 1 EOF @@ -1936,6 +2013,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -1953,7 +2031,8 @@ fi # Check whether --enable-aic7xxx or --disable-aic7xxx was given. if test "${enable_aic7xxx+set}" = set; then enableval="$enable_aic7xxx" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_AIC7XXX 1 EOF @@ -1966,6 +2045,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -1983,7 +2063,8 @@ fi # Check whether --enable-futuredomain or --disable-futuredomain was given. if test "${enable_futuredomain+set}" = set; then enableval="$enable_futuredomain" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_FUTURE_DOMAIN 1 EOF @@ -1996,6 +2077,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2013,7 +2095,8 @@ fi # Check whether --enable-in2000 or --disable-in2000 was given. if test "${enable_in2000+set}" = set; then enableval="$enable_in2000" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_IN2000 1 EOF @@ -2026,6 +2109,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2043,7 +2127,8 @@ fi # Check whether --enable-ncr5380 or --disable-ncr5380 was given. if test "${enable_ncr5380+set}" = set; then enableval="$enable_ncr5380" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_GENERIC_NCR5380 1 EOF @@ -2056,6 +2141,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2073,7 +2159,8 @@ fi # Check whether --enable-ncr53c406a or --disable-ncr53c406a was given. if test "${enable_ncr53c406a+set}" = set; then enableval="$enable_ncr53c406a" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_NCR53C406A 1 EOF @@ -2086,6 +2173,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2103,7 +2191,8 @@ fi # Check whether --enable-pas16 or --disable-pas16 was given. if test "${enable_pas16+set}" = set; then enableval="$enable_pas16" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_PASS16 1 EOF @@ -2116,6 +2205,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2133,7 +2223,8 @@ fi # Check whether --enable-seagate or --disable-seagate was given. if test "${enable_seagate+set}" = set; then enableval="$enable_seagate" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_SEAGATE 1 EOF @@ -2146,6 +2237,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2163,7 +2255,8 @@ fi # Check whether --enable-t128 or --disable-t128 was given. if test "${enable_t128+set}" = set; then enableval="$enable_t128" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_T128 1 EOF @@ -2176,6 +2269,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2193,7 +2287,8 @@ fi # Check whether --enable-ncr53c7xx or --disable-ncr53c7xx was given. if test "${enable_ncr53c7xx+set}" = set; then enableval="$enable_ncr53c7xx" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_NCR53C7xx 1 EOF @@ -2206,6 +2301,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2223,7 +2319,8 @@ fi # Check whether --enable-eatadma or --disable-eatadma was given. if test "${enable_eatadma+set}" = set; then enableval="$enable_eatadma" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_EATA_DMA 1 EOF @@ -2236,6 +2333,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2253,7 +2351,8 @@ fi # Check whether --enable-eatapio or --disable-eatapio was given. if test "${enable_eatapio+set}" = set; then enableval="$enable_eatapio" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_EATA_PIO 1 EOF @@ -2266,6 +2365,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2283,7 +2383,8 @@ fi # Check whether --enable-wd7000 or --disable-wd7000 was given. if test "${enable_wd7000+set}" = set; then enableval="$enable_wd7000" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_7000FASST 1 EOF @@ -2296,6 +2397,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2313,7 +2415,8 @@ fi # Check whether --enable-eata or --disable-eata was given. if test "${enable_eata+set}" = set; then enableval="$enable_eata" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_EATA 1 EOF @@ -2326,6 +2429,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2343,7 +2447,8 @@ fi # Check whether --enable-am53c974 or --disable-am53c974 was given. if test "${enable_am53c974+set}" = set; then enableval="$enable_am53c974" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_AM53C974 1 EOF @@ -2356,6 +2461,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2373,7 +2479,8 @@ fi # Check whether --enable-dtc3280 or --disable-dtc3280 was given. if test "${enable_dtc3280+set}" = set; then enableval="$enable_dtc3280" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_DTC3280 1 EOF @@ -2386,6 +2493,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2403,7 +2511,8 @@ fi # Check whether --enable-ncr53c8xx or --disable-ncr53c8xx was given. if test "${enable_ncr53c8xx+set}" = set; then enableval="$enable_ncr53c8xx" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_NCR53C8XX 1 EOF @@ -2416,35 +2525,6 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi - -fi - - -# Checking for alias tmscsiw -# Check whether --enable-tmscsiw or --disable-tmscsiw was given. -if test "${enable_tmscsiw+set}" = set; then - enableval="$enable_tmscsiw" - enable_dc390w="$enable_tmscsiw" - -fi - - -# Checking for device driver option dc390w -# Check whether --enable-dc390w or --disable-dc390w was given. -if test "${enable_dc390w+set}" = set; then - enableval="$enable_dc390w" - cat >> confdefs.h <<\EOF -#define CONFIG_SCSI_DC390W 1 -EOF - -device_drivers="$device_drivers tmscsiw.o" -if test "${driver_class_scsi_selected+set}" != set; then - driver_class_scsi_selected=yes - cat >> confdefs.h <<EOF -#define $driver_class_scsi_option 1 -EOF - - device_drivers="$device_drivers $driver_class_scsi_files" fi fi @@ -2463,7 +2543,8 @@ fi # Check whether --enable-dc390t or --disable-dc390t was given. if test "${enable_dc390t+set}" = set; then enableval="$enable_dc390t" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_DC390T 1 EOF @@ -2476,6 +2557,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2493,7 +2575,8 @@ fi # Check whether --enable-ppa or --disable-ppa was given. if test "${enable_ppa+set}" = set; then enableval="$enable_ppa" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_PPA 1 EOF @@ -2506,6 +2589,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2523,7 +2607,8 @@ fi # Check whether --enable-qlogicfas or --disable-qlogicfas was given. if test "${enable_qlogicfas+set}" = set; then enableval="$enable_qlogicfas" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_QLOGIC_FAS 1 EOF @@ -2536,6 +2621,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2553,7 +2639,8 @@ fi # Check whether --enable-qlogicisp or --disable-qlogicisp was given. if test "${enable_qlogicisp+set}" = set; then enableval="$enable_qlogicisp" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_QLOGIC_ISP 1 EOF @@ -2566,6 +2653,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2583,7 +2671,8 @@ fi # Check whether --enable-gdth or --disable-gdth was given. if test "${enable_gdth+set}" = set; then enableval="$enable_gdth" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SCSI_GDTH 1 EOF @@ -2596,6 +2685,7 @@ EOF device_drivers="$device_drivers $driver_class_scsi_files" fi +fi fi @@ -2621,7 +2711,8 @@ fi # Check whether --enable-ne2000 or --disable-ne2000 was given. if test "${enable_ne2000+set}" = set; then enableval="$enable_ne2000" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_NE2000 1 EOF @@ -2634,6 +2725,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2642,7 +2734,8 @@ fi # Check whether --enable-el2 or --disable-el2 was given. if test "${enable_el2+set}" = set; then enableval="$enable_el2" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_EL2 1 EOF @@ -2655,6 +2748,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2672,7 +2766,8 @@ fi # Check whether --enable-el3 or --disable-el3 was given. if test "${enable_el3+set}" = set; then enableval="$enable_el3" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_EL3 1 EOF @@ -2685,6 +2780,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2693,7 +2789,8 @@ fi # Check whether --enable-wd80x3 or --disable-wd80x3 was given. if test "${enable_wd80x3+set}" = set; then enableval="$enable_wd80x3" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_WD80x3 1 EOF @@ -2706,6 +2803,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2723,7 +2821,8 @@ fi # Check whether --enable-el1 or --disable-el1 was given. if test "${enable_el1+set}" = set; then enableval="$enable_el1" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_EL1 1 EOF @@ -2736,6 +2835,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2744,7 +2844,8 @@ fi # Check whether --enable-ul or --disable-ul was given. if test "${enable_ul+set}" = set; then enableval="$enable_ul" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_ULTRA 1 EOF @@ -2757,6 +2858,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2765,7 +2867,8 @@ fi # Check whether --enable-ul32 or --disable-ul32 was given. if test "${enable_ul32+set}" = set; then enableval="$enable_ul32" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_ULTRA32 1 EOF @@ -2778,6 +2881,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2786,7 +2890,8 @@ fi # Check whether --enable-hplanplus or --disable-hplanplus was given. if test "${enable_hplanplus+set}" = set; then enableval="$enable_hplanplus" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_HPLAN_PLUS 1 EOF @@ -2799,6 +2904,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2807,7 +2913,8 @@ fi # Check whether --enable-hplan or --disable-hplan was given. if test "${enable_hplan+set}" = set; then enableval="$enable_hplan" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_HPLAN 1 EOF @@ -2820,6 +2927,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2837,7 +2945,8 @@ fi # Check whether --enable-vortex or --disable-vortex was given. if test "${enable_vortex+set}" = set; then enableval="$enable_vortex" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_VORTEX 1 EOF @@ -2850,6 +2959,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2867,7 +2977,8 @@ fi # Check whether --enable-seeq8005 or --disable-seeq8005 was given. if test "${enable_seeq8005+set}" = set; then enableval="$enable_seeq8005" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SEEQ8005 1 EOF @@ -2880,6 +2991,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2897,7 +3009,8 @@ fi # Check whether --enable-hp100 or --disable-hp100 was given. if test "${enable_hp100+set}" = set; then enableval="$enable_hp100" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_HP100 1 EOF @@ -2910,6 +3023,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2918,7 +3032,8 @@ fi # Check whether --enable-ac3200 or --disable-ac3200 was given. if test "${enable_ac3200+set}" = set; then enableval="$enable_ac3200" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_AC3200 1 EOF @@ -2931,6 +3046,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2939,7 +3055,8 @@ fi # Check whether --enable-e2100 or --disable-e2100 was given. if test "${enable_e2100+set}" = set; then enableval="$enable_e2100" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_E2100 1 EOF @@ -2952,6 +3069,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2969,7 +3087,8 @@ fi # Check whether --enable-at1700 or --disable-at1700 was given. if test "${enable_at1700+set}" = set; then enableval="$enable_at1700" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_AT1700 1 EOF @@ -2982,6 +3101,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -2999,7 +3119,8 @@ fi # Check whether --enable-eth16i or --disable-eth16i was given. if test "${enable_eth16i+set}" = set; then enableval="$enable_eth16i" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_ETH16I 1 EOF @@ -3012,6 +3133,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3029,7 +3151,8 @@ fi # Check whether --enable-znet or --disable-znet was given. if test "${enable_znet+set}" = set; then enableval="$enable_znet" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_ZNET 1 EOF @@ -3042,6 +3165,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3059,7 +3183,8 @@ fi # Check whether --enable-eexpress or --disable-eexpress was given. if test "${enable_eexpress+set}" = set; then enableval="$enable_eexpress" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_EEXPRESS 1 EOF @@ -3072,6 +3197,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3089,7 +3215,8 @@ fi # Check whether --enable-eexpresspro or --disable-eexpresspro was given. if test "${enable_eexpresspro+set}" = set; then enableval="$enable_eexpresspro" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_EEXPRESS_PRO 1 EOF @@ -3102,6 +3229,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3119,7 +3247,8 @@ fi # Check whether --enable-eexpresspro100 or --disable-eexpresspro100 was given. if test "${enable_eexpresspro100+set}" = set; then enableval="$enable_eexpresspro100" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_EEXPRESS_PRO100B 1 EOF @@ -3132,6 +3261,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3149,7 +3279,8 @@ fi # Check whether --enable-depca or --disable-depca was given. if test "${enable_depca+set}" = set; then enableval="$enable_depca" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_DEPCA 1 EOF @@ -3162,6 +3293,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3179,7 +3311,8 @@ fi # Check whether --enable-ewrk3 or --disable-ewrk3 was given. if test "${enable_ewrk3+set}" = set; then enableval="$enable_ewrk3" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_EWRK3 1 EOF @@ -3192,6 +3325,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3209,7 +3343,8 @@ fi # Check whether --enable-de4x5 or --disable-de4x5 was given. if test "${enable_de4x5+set}" = set; then enableval="$enable_de4x5" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_DE4X5 1 EOF @@ -3222,6 +3357,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3239,7 +3375,8 @@ fi # Check whether --enable-apricot or --disable-apricot was given. if test "${enable_apricot+set}" = set; then enableval="$enable_apricot" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_APRICOT 1 EOF @@ -3252,6 +3389,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3269,7 +3407,8 @@ fi # Check whether --enable-wavelan or --disable-wavelan was given. if test "${enable_wavelan+set}" = set; then enableval="$enable_wavelan" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_WAVELAN 1 EOF @@ -3282,6 +3421,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3299,7 +3439,8 @@ fi # Check whether --enable-el16 or --disable-el16 was given. if test "${enable_el16+set}" = set; then enableval="$enable_el16" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_EL16 1 EOF @@ -3312,6 +3453,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3329,7 +3471,8 @@ fi # Check whether --enable-elplus or --disable-elplus was given. if test "${enable_elplus+set}" = set; then enableval="$enable_elplus" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_ELPLUS 1 EOF @@ -3342,6 +3485,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3359,7 +3503,8 @@ fi # Check whether --enable-de600 or --disable-de600 was given. if test "${enable_de600+set}" = set; then enableval="$enable_de600" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_DE600 1 EOF @@ -3372,6 +3517,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3389,7 +3535,8 @@ fi # Check whether --enable-de620 or --disable-de620 was given. if test "${enable_de620+set}" = set; then enableval="$enable_de620" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_DE620 1 EOF @@ -3402,6 +3549,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3419,7 +3567,8 @@ fi # Check whether --enable-skg16 or --disable-skg16 was given. if test "${enable_skg16+set}" = set; then enableval="$enable_skg16" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_SK_G16 1 EOF @@ -3432,6 +3581,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3449,7 +3599,8 @@ fi # Check whether --enable-ni52 or --disable-ni52 was given. if test "${enable_ni52+set}" = set; then enableval="$enable_ni52" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_NI52 1 EOF @@ -3462,6 +3613,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3479,7 +3631,8 @@ fi # Check whether --enable-ni65 or --disable-ni65 was given. if test "${enable_ni65+set}" = set; then enableval="$enable_ni65" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_NI65 1 EOF @@ -3492,6 +3645,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3509,7 +3663,8 @@ fi # Check whether --enable-atp or --disable-atp was given. if test "${enable_atp+set}" = set; then enableval="$enable_atp" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_ATP 1 EOF @@ -3522,6 +3677,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3539,7 +3695,8 @@ fi # Check whether --enable-lance or --disable-lance was given. if test "${enable_lance+set}" = set; then enableval="$enable_lance" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_LANCE 1 EOF @@ -3552,6 +3709,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3569,7 +3727,8 @@ fi # Check whether --enable-elcp or --disable-elcp was given. if test "${enable_elcp+set}" = set; then enableval="$enable_elcp" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_DEC_ELCP 1 EOF @@ -3582,6 +3741,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3599,7 +3759,8 @@ fi # Check whether --enable-fmv18x or --disable-fmv18x was given. if test "${enable_fmv18x+set}" = set; then enableval="$enable_fmv18x" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_FMV18X 1 EOF @@ -3612,6 +3773,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3629,7 +3791,8 @@ fi # Check whether --enable-3c515 or --disable-3c515 was given. if test "${enable_3c515+set}" = set; then enableval="$enable_3c515" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_3C515 1 EOF @@ -3642,6 +3805,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3659,7 +3823,8 @@ fi # Check whether --enable-pcnet32 or --disable-pcnet32 was given. if test "${enable_pcnet32+set}" = set; then enableval="$enable_pcnet32" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_PCNET32 1 EOF @@ -3672,6 +3837,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3680,7 +3846,8 @@ fi # Check whether --enable-ne2kpci or --disable-ne2kpci was given. if test "${enable_ne2kpci+set}" = set; then enableval="$enable_ne2kpci" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_NE2K_PCI 1 EOF @@ -3693,6 +3860,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3710,7 +3878,8 @@ fi # Check whether --enable-yellowfin or --disable-yellowfin was given. if test "${enable_yellowfin+set}" = set; then enableval="$enable_yellowfin" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_YELLOWFIN 1 EOF @@ -3723,6 +3892,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3740,7 +3910,8 @@ fi # Check whether --enable-rtl8139 or --disable-rtl8139 was given. if test "${enable_rtl8139+set}" = set; then enableval="$enable_rtl8139" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_RTL8139 1 EOF @@ -3753,6 +3924,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3770,7 +3942,8 @@ fi # Check whether --enable-epic or --disable-epic was given. if test "${enable_epic+set}" = set; then enableval="$enable_epic" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_EPIC 1 EOF @@ -3783,6 +3956,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3800,7 +3974,8 @@ fi # Check whether --enable-tlan or --disable-tlan was given. if test "${enable_tlan+set}" = set; then enableval="$enable_tlan" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_TLAN 1 EOF @@ -3813,6 +3988,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3830,7 +4006,8 @@ fi # Check whether --enable-viarhine or --disable-viarhine was given. if test "${enable_viarhine+set}" = set; then enableval="$enable_viarhine" - cat >> confdefs.h <<\EOF + if test "x$enableval" != xno; then +cat >> confdefs.h <<\EOF #define CONFIG_VIA_RHINE 1 EOF @@ -3843,6 +4020,7 @@ EOF device_drivers="$device_drivers $driver_class_net_files" fi +fi fi @@ -3869,7 +4047,7 @@ EOF # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - case `(ac_space=' '; set) 2>&1` in + case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). @@ -3936,7 +4114,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.12" + echo "$CONFIG_STATUS generated by autoconf version 2.13.1" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -3955,9 +4133,11 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF $ac_vpsub $extrasub +s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g @@ -4072,7 +4252,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in - *Makefile*) ac_comsub="1i\\ + *[Mm]akefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac @@ -4203,5 +4383,5 @@ exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1 diff --git a/i386/linux/device-drivers.h.in b/i386/linux/device-drivers.h.in index 7cb7df8..e0469c0 100644 --- a/i386/linux/device-drivers.h.in +++ b/i386/linux/device-drivers.h.in @@ -33,7 +33,6 @@ #undef CONFIG_SCSI_AM53C974 #undef CONFIG_SCSI_DTC3280 #undef CONFIG_SCSI_NCR53C8XX -#undef CONFIG_SCSI_DC390W #undef CONFIG_SCSI_DC390T #undef CONFIG_SCSI_PPA #undef CONFIG_SCSI_QLOGIC_FAS diff --git a/linux/Files b/linux/Files index 0fdc016..5fbf1aa 100644 --- a/linux/Files +++ b/linux/Files @@ -164,7 +164,6 @@ linux/src/drivers/scsi/aic7xxx_seq.c linux/src/drivers/scsi/constants.c linux/src/drivers/scsi/constants.h linux/src/drivers/scsi/dc390.h -linux/src/drivers/scsi/dc390w.h linux/src/drivers/scsi/dtc.c linux/src/drivers/scsi/dtc.h linux/src/drivers/scsi/eata.c @@ -221,8 +220,6 @@ linux/src/drivers/scsi/tmscsim.c linux/src/drivers/scsi/t128.c linux/src/drivers/scsi/t128.h linux/src/drivers/scsi/tmscsim.h -linux/src/drivers/scsi/tmscsiw.c -linux/src/drivers/scsi/tmscsiw.h linux/src/drivers/scsi/u14-34f.c linux/src/drivers/scsi/u14-34f.h linux/src/drivers/scsi/ultrastor.c diff --git a/linux/dev/drivers/scsi/hosts.c b/linux/dev/drivers/scsi/hosts.c index d5086ef..5318833 100644 --- a/linux/dev/drivers/scsi/hosts.c +++ b/linux/dev/drivers/scsi/hosts.c @@ -153,10 +153,6 @@ #include "NCR53c406a.h" #endif -#ifdef CONFIG_SCSI_DC390W -#include "dc390w.h" -#endif - #ifdef CONFIG_SCSI_DC390T #include "dc390.h" #endif @@ -191,7 +187,7 @@ /* -static const char RCSid[] = "$Header: cvs/gnumach/linux/dev/drivers/scsi/Attic/hosts.c,v 1.1 1999/04/26 05:44:25 tb Exp $"; +static const char RCSid[] = "$Header: cvs/gnumach/linux/dev/drivers/scsi/Attic/hosts.c,v 1.2 2001/05/27 12:44:22 marcus Exp $"; */ /* diff --git a/linux/src/drivers/scsi/dc390w.h b/linux/src/drivers/scsi/dc390w.h deleted file mode 100644 index 7e4030a..0000000 --- a/linux/src/drivers/scsi/dc390w.h +++ /dev/null @@ -1,145 +0,0 @@ -/*********************************************************************** - * FILE NAME : DC390W.H * - * BY : C.L. Huang * - * Description: Device Driver for Tekram DC-390W/U/F (T) PCI SCSI * - * Bus Master Host Adapter * - ***********************************************************************/ - -/* Kernel version autodetection */ - -#include <linux/version.h> -/* Convert Linux Version, Patch-level, Sub-level to LINUX_VERSION_CODE. */ -#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) - -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,50) -#define VERSION_ELF_1_2_13 -#elseif LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,95) -#define VERSION_1_3_85 -#else -#define VERSION_2_0_0 -#endif - -/* - * NCR 53c825A,875 driver, header file - */ - -#ifndef DC390W_H -#define DC390W_H - -#if defined(HOSTS_C) || defined(MODULE) - -#ifdef VERSION_2_0_0 -#include <scsi/scsicam.h> -#else -#include <linux/scsicam.h> -#endif - -extern int DC390W_detect(Scsi_Host_Template *psht); -extern int DC390W_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)); -extern int DC390W_abort(Scsi_Cmnd *cmd); - -#ifdef VERSION_2_0_0 -extern int DC390W_reset(Scsi_Cmnd *cmd, unsigned int resetFlags); -#else -extern int DC390W_reset(Scsi_Cmnd *cmd); -#endif - -#ifdef VERSION_ELF_1_2_13 -extern int DC390W_bios_param(Disk *disk, int devno, int geom[]); -#else -extern int DC390W_bios_param(Disk *disk, kdev_t devno, int geom[]); -#endif - -#ifdef MODULE -static int DC390W_release(struct Scsi_Host *); -#else -#define DC390W_release NULL -#endif - -#ifndef VERSION_ELF_1_2_13 -extern struct proc_dir_entry proc_scsi_tmscsiw; -extern int tmscsiw_proc_info(char*, char**, off_t, int, int, int); -#endif - -#ifdef VERSION_2_0_0 - -#define DC390WUF { \ - NULL, /* *next */ \ - NULL, /* *usage_count */ \ - &proc_scsi_tmscsiw, /* *proc_dir */ \ - tmscsiw_proc_info, /* (*proc_info)() */ \ - "Tekram DC390WUF(T) V1.12 Feb-17-1997", /* *name */ \ - DC390W_detect, \ - DC390W_release, /* (*release)() */ \ - NULL, /* *(*info)() */ \ - NULL, /* (*command)() */ \ - DC390W_queue_command, \ - DC390W_abort, \ - DC390W_reset, \ - NULL, /* slave attach */\ - DC390W_bios_param, \ - 10,/* can queue(-1) */ \ - 7, /* id(-1) */ \ - 32,/* old (SG_ALL) */ \ - 2, /* cmd per lun(2) */ \ - 0, /* present */ \ - 0, /* unchecked isa dma */ \ - ENABLE_CLUSTERING \ - } -#endif - -#ifdef VERSION_1_3_85 - -#define DC390WUF { \ - NULL, /* *next */ \ - NULL, /* *usage_count */ \ - &proc_scsi_tmscsiw, /* *proc_dir */ \ - tmscsiw_proc_info, /* (*proc_info)() */ \ - "Tekram DC390WUF(T) V1.12 Feb-17-1997", /* *name */ \ - DC390W_detect, \ - DC390W_release, /* (*release)() */ \ - NULL, /* *(*info)() */ \ - NULL, /* (*command)() */ \ - DC390W_queue_command, \ - DC390W_abort, \ - DC390W_reset, \ - NULL, /* slave attach */\ - DC390W_bios_param, \ - 10,/* can queue(-1) */ \ - 7, /* id(-1) */ \ - 16,/* old (SG_ALL) */ \ - 2, /* cmd per lun(2) */ \ - 0, /* present */ \ - 0, /* unchecked isa dma */ \ - ENABLE_CLUSTERING \ - } -#endif - -#ifdef VERSION_ELF_1_2_13 - -#define DC390WUF { \ - NULL, \ - NULL, \ - "Tekram DC390WUF(T) V1.12 Feb-17-1997",\ - DC390W_detect, \ - DC390W_release, \ - NULL, /* info */ \ - NULL, /* command, deprecated */ \ - DC390W_queue_command, \ - DC390W_abort, \ - DC390W_reset, \ - NULL, /* slave attach */\ - DC390W_bios_param, \ - 10,/* can queue(-1) */ \ - 7, /* id(-1) */ \ - 16,/* old (SG_ALL) */ \ - 2, /* cmd per lun(2) */ \ - 0, /* present */ \ - 0, /* unchecked isa dma */ \ - ENABLE_CLUSTERING \ - } -#endif - -#endif /* defined(HOSTS_C) || defined(MODULE) */ - -#endif /* DC390W_H */ diff --git a/linux/src/drivers/scsi/tmscsiw.c b/linux/src/drivers/scsi/tmscsiw.c deleted file mode 100644 index d32b9fc..0000000 --- a/linux/src/drivers/scsi/tmscsiw.c +++ /dev/null @@ -1,2096 +0,0 @@ -/*********************************************************************** - * FILE NAME : TMSCSIW.C * - * BY : C.L. Huang (ching@tekram.com.tw) * - * Description: Device Driver for Tekram DC-390W/U/F (T) PCI SCSI * - * Bus Master Host Adapter * - * (C)Copyright 1995-1996 Tekram Technology Co., Ltd. * - ***********************************************************************/ -/* Minor enhancements and bugfixes by * - * Kurt Garloff <K.Garloff@ping.de> * - ***********************************************************************/ -/* HISTORY: * - * * - * REV# DATE NAME DESCRIPTION * - * 1.00 04/03/96 CLH First release * - * 1.01 04/11/96 CLH Maximum support up to 4 Adapters, * - * support KV 1_3_85 * - * 1.02 04/26/96 CLH fixed bug about EEpromBuf when >1 HA * - * 1.03 06/12/96 CLH fixed bug of Media Change for Removable * - * Device, scan all LUN. Support Pre2.0.10 * - * 1.04 06/18/96 CLH fixed bug of Command timeout .... * - * 1.05 10/04/96 CLH Updating for support KV 2.0.0, 2.0.20 * - * 1.06 10/30/96 KG Fixed bug in DC390W_abort(), module * - * support, added tmscsiw_proc_info() * - * 1.07 11/09/96 KG Fixed bug in tmscsiw_proc_info() * - * 1.08 11/18/96 CLH/KG ditto, null ptr in DC390W_Disconnect() * - * 1.09 11/30/96 KG Fixed bug in CheckEEpromCheckSum(), * - * add register the allocated IO space * - * 1.10 12/05/96 CLH Modify in tmscsiw_proc_info() and add * - * in DC390W_initAdapter() for 53C875 * - * Rev. F with double clock. * - * 1.11 02/04/97 CLH Fixed bug of Formatting a partition that* - * across 1GB boundary, with bad sector * - * checking. * - * 1.12 02/17/97 CLH Fixed bug in CheckEEpromCheckSum() * - ***********************************************************************/ - - -#define DC390W_DEBUG -/* #define CHK_UNDER_RUN */ - -#define SCSI_MALLOC - -#ifdef MODULE -#include <linux/module.h> -#endif - -#include <asm/dma.h> -#include <asm/io.h> -#include <asm/system.h> -#include <linux/delay.h> -#include <linux/signal.h> -#include <linux/sched.h> -#include <linux/errno.h> -#include <linux/kernel.h> -#include <linux/ioport.h> -#include <linux/bios32.h> -#include <linux/pci.h> -#include <linux/proc_fs.h> -#include <linux/string.h> -#include <linux/mm.h> -#include <linux/config.h> - -#include <linux/version.h> -#if LINUX_VERSION_CODE < 66354 /* 1.3.50 */ -#include "../block/blk.h" -#else -#include <linux/blk.h> -#endif - -#include "scsi.h" -#include "hosts.h" -#include "tmscsiw.h" -#include "constants.h" -#include "sd.h" -#include "scripts.h" -#include <linux/stat.h> - -#include "dc390w.h" - -#ifndef VERSION_ELF_1_2_13 -struct proc_dir_entry proc_scsi_tmscsiw ={ - PROC_SCSI_DC390WUF, 7 ,"tmscsiw", - S_IFDIR | S_IRUGO | S_IXUGO, 2 - }; -#endif - -static void DC390W_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB ); -static void PrepareSG( PACB pACB, PDCB pDCB, PSRB pSRB ); -static void DoingSRB_Done( PACB pACB ); -static void ExceptionHandler(ULONG wlval, PACB pACB, PDCB pDCB); -static void ParityError( PACB pACB, PDCB pDCB ); -static void PhaseMismatch( PACB pACB ); -static void DC390W_ScsiRstDetect( PACB pACB ); -static void DC390W_ResetSCSIBus( PACB pACB ); -static void DC390W_ResetSCSIBus2( PACB pACB ); -static void AdjustTemp( PACB pACB, PDCB pDCB, PSRB pSRB ); -static void SetXferRate( PACB pACB, PDCB pDCB ); -static void DataIOcommon( PACB pACB, ULONG Swlval, ULONG Cwlval ); -static void SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB ); -static void RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB ); - -static void DC390W_CmdCompleted( PACB pACB ); -static void DC390W_Reselected( PACB pACB ); -static void DC390W_Reselected1( PACB pACB ); -static void DC390W_ReselectedT( PACB pACB ); -static void DC390W_Disconnected( PACB pACB ); -static void DC390W_MessageExtnd( PACB pACB ); -static void DC390W_Signal( PACB pACB ); -static void DC390W_UnknownMsg( PACB pACB ); -static void DC390W_MessageOut( PACB pACB ); -static void DC390W_FatalError( PACB pACB ); -static void DC390W_MessageSync( PACB pACB ); -static void DC390W_MessageWide( PACB pACB ); -static void DC390W_RestorePtr( PACB pACB ); -static void DC390W_MsgReject( PACB pACB ); -static void DC390W_Debug( PACB pACB ); -static void DC390W_download_script (struct Scsi_Host *host); - -int DC390W_initAdapter( PSH psh, ULONG io_port, UCHAR Irq, USHORT index); -void DC390W_initDCB( PACB pACB, PDCB pDCB, PSCSICMD cmd ); -void MyDelay( void ); -void EnDisableCE( UCHAR Flag, USHORT scsiIOPort ); -void EEpromOutDI( USHORT Carry, USHORT scsiIOPort ); -void EEpromPrepare( UCHAR EEpromCmd, USHORT scsiIOPort ); -void ReadEEprom( PUCHAR EEpromBuf, USHORT scsiIOPort ); -UCHAR EEpromInDo(USHORT scsiIOPort); -USHORT EEpromGetData(USHORT scsiIOPort); -USHORT CheckEEpromCheckSum( PUCHAR EEpromBuf, USHORT scsiIOPort); - -#ifdef MODULE -static int DC390W_release(struct Scsi_Host *host); -static int DC390W_shutdown (struct Scsi_Host *host); -#endif - - -static ULONG jmp_table16; -static ULONG jmp_din16; -static ULONG jmp_dout16; -static PSHT pSHT_start = NULL; -static PSH pSH_start = NULL; -static PSH pSH_current = NULL; -static PACB pACB_start= NULL; -static PACB pACB_current = NULL; -static PDCB pPrevDCB = NULL; -static USHORT adapterCnt = 0; -static USHORT InitialTime = 0; -static USHORT CurrDCBscntl3 = 0; -static UCHAR pad_buffer[128]; - -static PVOID IntVector[]={ - DC390W_CmdCompleted, - DC390W_Reselected, - DC390W_Reselected1, - DC390W_ReselectedT, - DC390W_Disconnected, - DC390W_MessageExtnd, - DC390W_Signal, - DC390W_UnknownMsg, - DC390W_MessageOut, - DC390W_FatalError, - DC390W_MessageSync, - DC390W_MessageWide, - DC390W_RestorePtr, - DC390W_MsgReject, - DC390W_Debug, - DC390W_FatalError - }; - -UCHAR eepromBuf[MAX_ADAPTER_NUM][128]; - -UCHAR clock_period[12] = {25, 31, 37, 43, 50, 62, 75, 125, 12, 15, 18, 21}; -UCHAR baddevname[2][28] ={ - "SEAGATE ST3390N 9546", - "SEAGATE ST3390N ??? 0399"}; - -#define BADDEVCNT 2 - -/*********************************************************************** - * - * - * - **********************************************************************/ -static void -QLinkcmd( PSCSICMD cmd, PDCB pDCB ) -{ - ULONG flags; - PSCSICMD pcmd; - - save_flags(flags); - cli(); - - if( !pDCB->QIORBCnt ) - { - pDCB->pQIORBhead = cmd; - pDCB->pQIORBtail = cmd; - pDCB->QIORBCnt++; - cmd->next = NULL; - } - else - { - pcmd = pDCB->pQIORBtail; - pcmd->next = cmd; - pDCB->pQIORBtail = cmd; - pDCB->QIORBCnt++; - cmd->next = NULL; - } - - restore_flags(flags); -} - - -static PSCSICMD -Getcmd( PDCB pDCB ) -{ - ULONG flags; - PSCSICMD pcmd; - - save_flags(flags); - cli(); - - pcmd = pDCB->pQIORBhead; - pDCB->pQIORBhead = pcmd->next; - pcmd->next = NULL; - pDCB->QIORBCnt--; - - restore_flags(flags); - return( pcmd ); -} - - -static PSRB -GetSRB( PACB pACB ) -{ - ULONG flags; - PSRB pSRB; - - save_flags(flags); - cli(); - - pSRB = pACB->pFreeSRB; - if( pSRB ) - { - pACB->pFreeSRB = pSRB->pNextSRB; - pSRB->pNextSRB = NULL; - } - restore_flags(flags); - return( pSRB ); -} - - -static void -RewaitSRB( PDCB pDCB, PSRB pSRB ) -{ - PSRB psrb1; - ULONG flags; - UCHAR bval; - - save_flags(flags); - cli(); - pDCB->GoingSRBCnt--; - psrb1 = pDCB->pGoingSRB; - if( pSRB == psrb1 ) - { - pDCB->pGoingSRB = psrb1->pNextSRB; - } - else - { - while( pSRB != psrb1->pNextSRB ) - psrb1 = psrb1->pNextSRB; - psrb1->pNextSRB = pSRB->pNextSRB; - if( pSRB == pDCB->pGoingLast ) - pDCB->pGoingLast = psrb1; - } - if( (psrb1 = pDCB->pWaitingSRB) ) - { - pSRB->pNextSRB = psrb1; - pDCB->pWaitingSRB = pSRB; - } - else - { - pSRB->pNextSRB = NULL; - pDCB->pWaitingSRB = pSRB; - pDCB->pWaitLast = pSRB; - } - - bval = pSRB->TagNumber; - pDCB->TagMask &= (~(1 << bval)); /* Free TAG number */ - restore_flags(flags); -} - - -static void -DoWaitingSRB( PACB pACB ) -{ - ULONG flags; - PDCB ptr, ptr1; - PSRB pSRB; - - save_flags(flags); - cli(); - - if( !(pACB->pActiveDCB) && !(pACB->ACBFlag & (RESET_DETECT+RESET_DONE+RESET_DEV) ) ) - { - ptr = pACB->pDCBRunRobin; - if( !ptr ) - { - ptr = pACB->pLinkDCB; - pACB->pDCBRunRobin = ptr; - } - ptr1 = ptr; - for( ;ptr1; ) - { - pACB->pDCBRunRobin = ptr1->pNextDCB; - if( !( ptr1->MaxCommand > ptr1->GoingSRBCnt ) || - !( pSRB = ptr1->pWaitingSRB ) ) - { - if(pACB->pDCBRunRobin == ptr) - break; - ptr1 = ptr1->pNextDCB; - } - else - { - DC390W_StartSCSI(pACB, ptr1, pSRB); - ptr1->GoingSRBCnt++; - if( ptr1->pWaitLast == pSRB ) - { - ptr1->pWaitingSRB = NULL; - ptr1->pWaitLast = NULL; - } - else - { - ptr1->pWaitingSRB = pSRB->pNextSRB; - } - pSRB->pNextSRB = NULL; - - if( ptr1->pGoingSRB ) - ptr1->pGoingLast->pNextSRB = pSRB; - else - ptr1->pGoingSRB = pSRB; - ptr1->pGoingLast = pSRB; - - break; - } - } - } - restore_flags(flags); - return; -} - - -static void -SRBwaiting( PDCB pDCB, PSRB pSRB) -{ - if( pDCB->pWaitingSRB ) - { - pDCB->pWaitLast->pNextSRB = pSRB; - pDCB->pWaitLast = pSRB; - pSRB->pNextSRB = NULL; - } - else - { - pDCB->pWaitingSRB = pSRB; - pDCB->pWaitLast = pSRB; - } -} - - -static void -SendSRB( PSCSICMD pcmd, PACB pACB, PSRB pSRB ) -{ - ULONG flags; - PDCB pDCB; - - save_flags(flags); - cli(); - - pDCB = pSRB->pSRBDCB; - PrepareSG( pACB, pDCB, pSRB ); - if( !(pDCB->MaxCommand > pDCB->GoingSRBCnt) || (pACB->pActiveDCB) || - (pACB->ACBFlag & (RESET_DETECT+RESET_DONE+RESET_DEV)) ) - { - SRBwaiting(pDCB, pSRB); - goto SND_EXIT; - } - - if( pDCB->pWaitingSRB ) - { - SRBwaiting(pDCB, pSRB); -/* pSRB = GetWaitingSRB(pDCB); */ - pSRB = pDCB->pWaitingSRB; - pDCB->pWaitingSRB = pSRB->pNextSRB; - pSRB->pNextSRB = NULL; - } - - DC390W_StartSCSI(pACB, pDCB, pSRB); - pDCB->GoingSRBCnt++; - if( pDCB->pGoingSRB ) - { - pDCB->pGoingLast->pNextSRB = pSRB; - pDCB->pGoingLast = pSRB; - } - else - { - pDCB->pGoingSRB = pSRB; - pDCB->pGoingLast = pSRB; - } - -SND_EXIT: - restore_flags(flags); - return; -} - - -/*********************************************************************** - * Function : static int DC390W_queue_command (Scsi_Cmnd *cmd, - * void (*done)(Scsi_Cmnd *)) - * - * Purpose : enqueues a SCSI command - * - * Inputs : cmd - SCSI command, done - function called on completion, with - * a pointer to the command descriptor. - * - * Returns : 0 - * - ***********************************************************************/ - -int -DC390W_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *)) -{ - USHORT ioport, i; - Scsi_Cmnd *pcmd; - struct Scsi_Host *psh; - PACB pACB; - PDCB pDCB; - PSRB pSRB; - ULONG flags; - PUCHAR ptr,ptr1; - - psh = cmd->host; - pACB = (PACB ) psh->hostdata; - ioport = pACB->IOPortBase; - -#ifdef DC390W_DEBUG0 - printk("Cmd=%x,",cmd->cmnd[0]); -#endif - - if( (pACB->scan_devices == END_SCAN) && (cmd->cmnd[0] != INQUIRY) ) - { - pACB->scan_devices = 0; - pPrevDCB->pNextDCB = pACB->pLinkDCB; - } - else if( (pACB->scan_devices) && (cmd->cmnd[0] == 8) ) - { - pACB->scan_devices = 0; - pPrevDCB->pNextDCB = pACB->pLinkDCB; - } - - if ( ( cmd->target > pACB->max_id ) || (cmd->lun > pACB->max_lun) ) - { -/* printk("DC390W: Ignore target %d lun %d\n", - cmd->target, cmd->lun); */ - cmd->result = (DID_BAD_TARGET << 16); - done(cmd); - return( 0 ); - } - - if( (pACB->scan_devices) && !(pACB->DCBmap[cmd->target] & (1 << cmd->lun)) ) - { - if( pACB->DeviceCnt < MAX_DEVICES ) - { - pACB->DCBmap[cmd->target] |= (1 << cmd->lun); - pDCB = pACB->pDCB_free; -#ifdef DC390W_DEBUG0 - printk("pDCB=%8x,ID=%2x,", (UINT) pDCB, cmd->target); -#endif - DC390W_initDCB( pACB, pDCB, cmd ); - } - else /* ???? */ - { -/* printk("DC390W: Ignore target %d lun %d\n", - cmd->target, cmd->lun); */ - cmd->result = (DID_BAD_TARGET << 16); - done(cmd); - return(0); - } - } - else if( !(pACB->scan_devices) && !(pACB->DCBmap[cmd->target] & (1 << cmd->lun)) ) - { -/* printk("DC390W: Ignore target %d lun %d\n", - cmd->target, cmd->lun); */ - cmd->result = (DID_BAD_TARGET << 16); - done(cmd); - return(0); - } - else - { - pDCB = pACB->pLinkDCB; - while( (pDCB->UnitSCSIID != cmd->target) || - (pDCB->UnitSCSILUN != cmd->lun) ) - { - pDCB = pDCB->pNextDCB; - } -#ifdef DC390W_DEBUG0 - printk("pDCB=%8x,ID=%2x,Scan=%1x", (UINT) pDCB, cmd->target, - pACB->scan_devices); -#endif - } - - cmd->scsi_done = done; - cmd->result = 0; - - save_flags(flags); - cli(); - - if( pDCB->QIORBCnt ) - { - QLinkcmd( cmd, pDCB ); - pcmd = Getcmd( pDCB ); - } - else - pcmd = cmd; - - pSRB = GetSRB( pACB ); - - if( !pSRB ) - { - QLinkcmd( pcmd, pDCB ); - restore_flags(flags); - return(0); - } - -/* BuildSRB(pSRB); */ - - pSRB->pSRBDCB = pDCB; - pSRB->pcmd = pcmd; - ptr = (PUCHAR) pSRB->CmdBlock; - ptr1 = (PUCHAR) pcmd->cmnd; - (UCHAR) pSRB->__command[0] = pcmd->cmd_len; - for(i=0; i< pcmd->cmd_len; i++) - { - *ptr = *ptr1; - ptr++; - ptr1++; - } - if( pcmd->use_sg ) - { - pSRB->SGcount = (UCHAR) pcmd->use_sg; - pSRB->pSegmentList = (PSGL) pcmd->request_buffer; - } - else if( pcmd->request_buffer ) - { - pSRB->SGcount = 1; - pSRB->pSegmentList = (PSGL) &pSRB->Segmentx; - pSRB->Segmentx.address = (PUCHAR) pcmd->request_buffer; - pSRB->Segmentx.length = pcmd->request_bufflen; - } - else - pSRB->SGcount = 0; - - pSRB->AdaptStatus = 0; - pSRB->TargetStatus = 0; - pSRB->MsgCnt = 0; - if( pDCB->DevType != TYPE_TAPE ) - pSRB->RetryCnt = 1; - else - pSRB->RetryCnt = 0; - pSRB->SRBStatus = 0; - pSRB->SRBFlag = 0; - pSRB->ScratchABuf = 0; - pSRB->SRBState = 0; - pSRB->RemainSegPtr = 0; - pSRB->XferredLen = 0; - SendSRB( pcmd, pACB, pSRB ); - - restore_flags(flags); - return(0); -} - - -static void -DoNextCmd( PACB pACB, PDCB pDCB ) -{ - Scsi_Cmnd *pcmd; - PSRB pSRB; - ULONG flags; - PUCHAR ptr,ptr1; - USHORT i; - - - if( pACB->ACBFlag & (RESET_DETECT+RESET_DONE+RESET_DEV) ) - return; - save_flags(flags); - cli(); - - pcmd = Getcmd( pDCB ); - pSRB = GetSRB( pACB ); - if( !pSRB ) - { - QLinkcmd( pcmd, pDCB ); - restore_flags(flags); - return; - } - - pSRB->pSRBDCB = pDCB; - pSRB->pcmd = pcmd; - ptr = (PUCHAR) pSRB->CmdBlock; - ptr1 = (PUCHAR) pcmd->cmnd; - (UCHAR) pSRB->__command[0] = pcmd->cmd_len; - for(i=0; i< pcmd->cmd_len; i++) - { - *ptr = *ptr1; - ptr++; - ptr1++; - } - if( pcmd->use_sg ) - { - pSRB->SGcount = (UCHAR) pcmd->use_sg; - pSRB->pSegmentList = (PSGL) pcmd->request_buffer; - } - else if( pcmd->request_buffer ) - { - pSRB->SGcount = 1; - pSRB->pSegmentList = (PSGL) &pSRB->Segmentx; - pSRB->Segmentx.address = (PUCHAR) pcmd->request_buffer; - pSRB->Segmentx.length = pcmd->request_bufflen; - } - else - pSRB->SGcount = 0; - - pSRB->AdaptStatus = 0; - pSRB->TargetStatus = 0; - pSRB->MsgCnt = 0; - if( pDCB->DevType != TYPE_TAPE ) - pSRB->RetryCnt = 1; - else - pSRB->RetryCnt = 0; - pSRB->SRBStatus = 0; - pSRB->SRBFlag = 0; - pSRB->ScratchABuf = 0; - pSRB->SRBState = 0; - SendSRB( pcmd, pACB, pSRB ); - - restore_flags(flags); - return; -} - - -/*********************************************************************** - * Function: - * DC390W_bios_param - * - * Description: - * Return the disk geometry for the given SCSI device. - ***********************************************************************/ -#ifdef VERSION_ELF_1_2_13 -int DC390W_bios_param(Disk *disk, int devno, int geom[]) -#else -int DC390W_bios_param(Disk *disk, kdev_t devno, int geom[]) -#endif -{ - int heads, sectors, cylinders; - PACB pACB; - - pACB = (PACB) disk->device->host->hostdata; - heads = 64; - sectors = 32; - cylinders = disk->capacity / (heads * sectors); - - if ( (pACB->Gmode2 & GREATER_1G) && (cylinders > 1024) ) - { - heads = 255; - sectors = 63; - cylinders = disk->capacity / (heads * sectors); - } - - geom[0] = heads; - geom[1] = sectors; - geom[2] = cylinders; - - return (0); -} - - -/*********************************************************************** - * Function : int DC390W_abort (Scsi_Cmnd *cmd) - * - * Purpose : Abort an errant SCSI command - * - * Inputs : cmd - command to abort - * - * Returns : 0 on success, -1 on failure. - ***********************************************************************/ - -int -DC390W_abort (Scsi_Cmnd *cmd) -{ - ULONG flags; - PACB pACB; - PDCB pDCB, pdcb; - PSRB pSRB, psrb; - USHORT count, i; - PSCSICMD pcmd, pcmd1; - int status; - - -#ifdef DC390W_DEBUG0 - printk("DC390W : Abort Cmd."); -#endif - - save_flags(flags); - cli(); - - pACB = (PACB) cmd->host->hostdata; - pDCB = pACB->pLinkDCB; - pdcb = pDCB; - while( (pDCB->UnitSCSIID != cmd->target) || - (pDCB->UnitSCSILUN != cmd->lun) ) - { - pDCB = pDCB->pNextDCB; - if( pDCB == pdcb ) - goto NOT_RUN; - } - - if( pDCB->QIORBCnt ) - { - pcmd = pDCB->pQIORBhead; - if( pcmd == cmd ) - { - pDCB->pQIORBhead = pcmd->next; - pcmd->next = NULL; - pDCB->QIORBCnt--; - status = SCSI_ABORT_SUCCESS; - goto ABO_X; - } - for( count = pDCB->QIORBCnt, i=0; i<count-1; i++) - { - if( pcmd->next == cmd ) - { - pcmd1 = pcmd->next; - pcmd->next = pcmd1->next; - pcmd1->next = NULL; - pDCB->QIORBCnt--; - status = SCSI_ABORT_SUCCESS; - goto ABO_X; - } - else - { - pcmd = pcmd->next; - } - } - } - - pSRB = pDCB->pWaitingSRB; - if( !pSRB ) - goto ON_GOING; - if( pSRB->pcmd == cmd ) - { - pDCB->pWaitingSRB = pSRB->pNextSRB; - goto IN_WAIT; - } - else - { - psrb = pSRB; - if( !(psrb->pNextSRB) ) - goto ON_GOING; - while( psrb->pNextSRB->pcmd != cmd ) - { - psrb = psrb->pNextSRB; - if( !(psrb->pNextSRB) ) - goto ON_GOING; - } - pSRB = psrb->pNextSRB; - psrb->pNextSRB = pSRB->pNextSRB; - if( pSRB == pDCB->pWaitLast ) - pDCB->pWaitLast = psrb; -IN_WAIT: - pSRB->pNextSRB = pACB->pFreeSRB; - pACB->pFreeSRB = pSRB; - cmd->next = NULL; - status = SCSI_ABORT_SUCCESS; - goto ABO_X; - } - -ON_GOING: - pSRB = pDCB->pGoingSRB; - for( count = pDCB->GoingSRBCnt, i=0; i<count; i++) - { - if( pSRB->pcmd != cmd ) - pSRB = pSRB->pNextSRB; - else - { - if( (pACB->pActiveDCB == pDCB) && (pDCB->pActiveSRB == pSRB) ) - { - status = SCSI_ABORT_BUSY; - goto ABO_X; - } - else - { - status = SCSI_ABORT_SNOOZE; - goto ABO_X; - } - } - } - -NOT_RUN: - status = SCSI_ABORT_NOT_RUNNING; - -ABO_X: - cmd->result = DID_ABORT << 16; - cmd->scsi_done(cmd); - restore_flags(flags); - return( status ); -} - - -static void -ResetDevParam( PACB pACB ) -{ - PDCB pDCB, pdcb; - - pDCB = pACB->pLinkDCB; - if( pDCB == NULL ) - return; - pdcb = pDCB; - do - { - if( pACB->AdaptType == DC390W ) - pdcb->DCBscntl3 = SYNC_CLK_F2+ASYNC_CLK_F2; - else - pdcb->DCBscntl3 = SYNC_CLK_F4+ASYNC_CLK_F4; - pdcb->DCBsxfer = 0; - pdcb = pdcb->pNextDCB; - } - while( pdcb != pDCB ); -} - - -static void -RecoverSRB( PACB pACB ) -{ - PDCB pDCB, pdcb; - PSRB psrb, psrb2; - USHORT cnt, i; - - pDCB = pACB->pLinkDCB; - if( pDCB == NULL ) - return; - pdcb = pDCB; - do - { - cnt = pdcb->GoingSRBCnt; - psrb = pdcb->pGoingSRB; - for (i=0; i<cnt; i++) - { - PrepareSG( pACB, pdcb, psrb ); - psrb2 = psrb; - psrb = psrb->pNextSRB; -/* RewaitSRB( pDCB, psrb ); */ - if( pdcb->pWaitingSRB ) - { - psrb2->pNextSRB = pdcb->pWaitingSRB; - pdcb->pWaitingSRB = psrb2; - } - else - { - pdcb->pWaitingSRB = psrb2; - pdcb->pWaitLast = psrb2; - psrb2->pNextSRB = NULL; - } - } - pdcb->GoingSRBCnt = 0; - pdcb->pGoingSRB = NULL; - pdcb->TagMask = 0; - pdcb = pdcb->pNextDCB; - } - while( pdcb != pDCB ); -} - - -/*********************************************************************** - * Function : int DC390W_reset (Scsi_Cmnd *cmd, ...) - * - * Purpose : perform a hard reset on the SCSI bus( and NCR chip). - * - * Inputs : cmd - command which caused the SCSI RESET - * - * Returns : 0 on success. - ***********************************************************************/ - -#ifdef VERSION_2_0_0 -int DC390W_reset(Scsi_Cmnd *cmd, unsigned int resetFlags) -#else -int DC390W_reset (Scsi_Cmnd *cmd) -#endif -{ - USHORT ioport; - unsigned long flags; - PACB pACB; - ULONG wlval; - UCHAR bval; - USHORT wval; - USHORT i; - - -#ifdef DC390W_DEBUG0 - printk("DC390W : Reset Cmd0,"); -#endif - - pACB = (PACB ) cmd->host->hostdata; - ioport = pACB->IOPortBase; - save_flags(flags); - cli(); - bval = inb(ioport+DCNTL); - bval |= IRQ_DISABLE; - outb(bval,ioport+DCNTL); /* disable interrupt */ - DC390W_ResetSCSIBus( pACB ); - for( i=0; i<500; i++ ) - udelay(1000); - for(;;) - { - bval = inb(ioport+ISTAT); - if( bval & SCSI_INT_PENDING ) - { - wval = inw( ioport+SIST0 ); - if( wval & (SCSI_RESET+SCSI_GERROR) ) - break; - } - if(bval & DMA_INT_PENDING) - { - bval = inb(ioport+DSTAT); - if(bval & ABORT_) - { - wval = inw( ioport+SIST0 ); - break; - } - } - } - bval = inb(ioport+DCNTL); - bval &= ~IRQ_DISABLE; - outb(bval,ioport+DCNTL); /* re-enable interrupt */ - - ioport = pACB->IOPortBase; - bval = inb(ioport+STEST3); - bval |= CLR_SCSI_FIFO; - outb(bval,ioport+STEST3); - bval = CLR_DMA_FIFO; - outb(bval,ioport+CTEST3); - ResetDevParam( pACB ); - DoingSRB_Done( pACB ); - pACB->pActiveDCB = NULL; - wlval = pACB->jmp_reselect; - outl(wlval,(ioport+DSP)); - - pACB->ACBFlag = 0; - DoWaitingSRB( pACB ); - restore_flags(flags); - return( SCSI_RESET_SUCCESS ); -} - - -#include "scsiio.c" - - -/*********************************************************************** - * Function : static void DC390W_initDCB - * - * Purpose : initialize the internal structures for a given DCB - * - * Inputs : cmd - pointer to this scsi cmd request block structure - * - ***********************************************************************/ -void DC390W_initDCB( PACB pACB, PDCB pDCB, PSCSICMD cmd ) -{ - PEEprom prom; - UCHAR bval; - USHORT index; - - if( pACB->DeviceCnt == 0 ) - { - pACB->pLinkDCB = pDCB; - pACB->pDCBRunRobin = pDCB; - pDCB->pNextDCB = pDCB; - pPrevDCB = pDCB; - } - else - pPrevDCB->pNextDCB = pDCB; - - pDCB->pDCBACB = pACB; - pDCB->QIORBCnt = 0; - pDCB->DCBselect = 0; - pDCB->DCBsxfer = 0; - pDCB->DCBsdid = cmd->target; - pDCB->UnitSCSIID = cmd->target; - pDCB->UnitSCSILUN = cmd->lun; - pDCB->pWaitingSRB = NULL; - pDCB->GoingSRBCnt = 0; - pDCB->TagMask = 0; - - pDCB->MaxCommand = 1; - pDCB->AdaptIndex = pACB->AdapterIndex; - index = pACB->AdapterIndex; - - prom = (PEEprom) &eepromBuf[index][cmd->target << 2]; - pDCB->DevMode = prom->EE_MODE1; - pDCB->NegoPeriod = clock_period[prom->EE_SPEED]; - - if( pACB->AdaptType == DC390W ) - pDCB->DCBscntl3 = SYNC_CLK_F2+ASYNC_CLK_F2; - else - pDCB->DCBscntl3 = SYNC_CLK_F4+ASYNC_CLK_F4; - - if( pDCB->DevMode & PARITY_CHK_ ) - pDCB->DCBscntl0 = EN_PARITY_CHK+SATN_IF_PARITY_ERR+FULL_ARBITRATION; - else - pDCB->DCBscntl0 = FULL_ARBITRATION; - - pDCB->AdpMode = eepromBuf[index][EE_MODE2]; - - if( pDCB->DevMode & EN_DISCONNECT_ ) - bval = 0xC0; - else - bval = 0x80; - bval |= cmd->lun; - pDCB->IdentifyMsg = bval; - - if( pDCB->DevMode & SYNC_NEGO_ ) - { - pDCB->SyncMode = SYNC_ENABLE; - pDCB->SyncOffset = SYNC_NEGO_OFFSET; - } - - if( pDCB->DevMode & WIDE_NEGO_ ) - { - if( cmd->lun ) - { - if( !(CurrDCBscntl3 & EN_WIDE_SCSI) ) - pDCB->DevMode &= ~WIDE_NEGO_; - } - else - CurrDCBscntl3 = 0; - } - pDCB->DCBFlag = 0; -} - - -/*********************************************************************** - * Function : static void DC390W_initSRB - * - * Purpose : initialize the internal structures for a given SRB - * - * Inputs : psrb - pointer to this scsi request block structure - * - ***********************************************************************/ -void DC390W_initSRB( PSRB psrb ) -{ -#ifndef VERSION_ELF_1_2_13 - psrb->PhysSRB = virt_to_phys( psrb ); - psrb->__command[1] = virt_to_phys( psrb->CmdBlock ); - psrb->__msgout0[0] = 1; - psrb->__msgout0[1] = virt_to_phys( psrb->MsgOutBuf ); - psrb->SegmentPad[0] = 16; - psrb->SegmentPad[1] = virt_to_phys( pad_buffer ); -#else - psrb->PhysSRB = (ULONG) psrb; - psrb->__command[1] = (ULONG) psrb->CmdBlock; - psrb->__msgout0[0] = 1; - psrb->__msgout0[1] = (ULONG) psrb->MsgOutBuf; - psrb->SegmentPad[0] = 16; - psrb->SegmentPad[1] = (ULONG) pad_buffer; -#endif -} - - -void DC390W_linkSRB( PACB pACB ) -{ - USHORT count, i; - PSRB psrb; - - count = pACB->SRBCount; - - for( i=0; i< count; i++) - { - if( i != count - 1) - pACB->SRB_array[i].pNextSRB = &pACB->SRB_array[i+1]; - else - pACB->SRB_array[i].pNextSRB = NULL; - psrb = (PSRB) &pACB->SRB_array[i]; - DC390W_initSRB( psrb ); - } -} - - -/*********************************************************************** - * Function : static void DC390W_initACB - * - * Purpose : initialize the internal structures for a given SCSI host - * - * Inputs : psh - pointer to this host adapter's structure - * - ***********************************************************************/ -void DC390W_initACB( PSH psh, USHORT chipType, ULONG io_port, UCHAR Irq, USHORT index ) -{ - PACB pACB; - USHORT i; - UCHAR adaptType, bval; - - - psh->can_queue = MAX_CMD_QUEUE; - psh->cmd_per_lun = MAX_CMD_PER_LUN; - psh->this_id = (int) eepromBuf[index][EE_ADAPT_SCSI_ID]; - psh->io_port = io_port; - psh->n_io_port = 0x80; - psh->irq = Irq; - - if( chipType == PCI_DEVICE_ID_NCR53C825A ) - adaptType = DC390W; - else - { - outb( 2, io_port+GPREG ); - bval = inb( io_port+GPREG ); - if( bval & 8 ) - adaptType = DC390U; - else - adaptType = DC390F; - } - - pACB = (PACB) psh->hostdata; - -#ifndef VERSION_ELF_1_2_13 - if( adaptType == DC390U ) - { - psh->max_id = 8; - pACB->max_id = 7; - } - else - { - psh->max_id = 16; - pACB->max_id = 15; - } - -#ifdef CONFIG_SCSI_MULTI_LUN - if( eepromBuf[index][EE_MODE2] & LUN_CHECK ) - psh->max_lun = 8; - else -#endif - psh->max_lun = 1; - -#else - pACB->max_id = 7; -#endif - if( pACB->max_id == eepromBuf[index][EE_ADAPT_SCSI_ID] ) - pACB->max_id--; - -#ifdef CONFIG_SCSI_MULTI_LUN - if( eepromBuf[index][EE_MODE2] & LUN_CHECK ) - pACB->max_lun = 7; - else -#endif - pACB->max_lun = 0; - - pACB->pScsiHost = psh; - pACB->IOPortBase = (USHORT) io_port; - pACB->pLinkDCB = NULL; - pACB->pDCBRunRobin = NULL; - pACB->pActiveDCB = NULL; - pACB->pFreeSRB = pACB->SRB_array; - pACB->SRBCount = MAX_SRB_CNT; - pACB->AdapterIndex = index; - pACB->status = 0; - pACB->AdaptSCSIID = eepromBuf[index][EE_ADAPT_SCSI_ID]; - pACB->AdaptSCSILUN = 0; - pACB->DeviceCnt = 0; - pACB->IRQLevel = Irq; - pACB->AdaptType = adaptType; - pACB->TagMaxNum = eepromBuf[index][EE_TAG_CMD_NUM] << 2; - pACB->ACBFlag = 0; - pACB->scan_devices = 1; - pACB->Gmode2 = eepromBuf[index][EE_MODE2]; - if( eepromBuf[index][EE_MODE2] & LUN_CHECK ) - pACB->LUNchk = 1; - pACB->pDCB_free = &pACB->DCB_array[0]; - DC390W_linkSRB( pACB ); - for(i=0; i<MAX_SCSI_ID; i++) - pACB->DCBmap[i] = 0; -} - - -/*********************************************************************** - * Function : static int DC390W_initAdapter - * - * Purpose : initialize the SCSI chip ctrl registers - * - * Inputs : psh - pointer to this host adapter's structure - * - ***********************************************************************/ -int DC390W_initAdapter( PSH psh, ULONG io_port, UCHAR Irq, USHORT index ) -{ - USHORT ioport, wval; - UCHAR bval; - PACB pACB, pacb; - USHORT used_irq = 0; - - pacb = pACB_start; - if( pacb != NULL ) - { - for ( ; (pacb != (PACB) -1) ; ) - { - if( pacb->IRQLevel == Irq ) - { - used_irq = 1; - break; - } - else - pacb = pacb->pNextACB; - } - } - - if( !used_irq ) - { -#ifdef VERSION_ELF_1_2_13 - if( request_irq(Irq, DC390W_Interrupt, SA_INTERRUPT, "tmscsiw")) -#else - if( request_irq(Irq, DC390W_Interrupt, SA_INTERRUPT | SA_SHIRQ, "tmscsiw", NULL)) -#endif - { - printk("DC390W : register IRQ error!\n"); - return( -1 ); - } - } - request_region(io_port,psh->n_io_port,"tmscsiw"); - - ioport = (USHORT) io_port; - outb(IRQ_DISABLE, ioport+DCNTL); - outb(ABORT_OP, ioport+ISTAT); - udelay(100000); - outb(0, ioport+ISTAT); - bval = inb(ioport+DSTAT); - bval = inb(ioport+ISTAT); - wval = inw(ioport+SIST0); - - pACB = (PACB) psh->hostdata; - bval = pACB->AdaptSCSIID; - bval |= ENABLE_RESEL; - outb(bval,ioport+SCID); - - if(pACB->AdaptType == DC390W) - bval = SYNC_CLK_F2+ASYNC_CLK_F2; - else - { /* @1.09 */ - bval = inb(ioport+CTEST3); - if( (bval & CHIP_REV_MASK) < 0x30 ) /* 53C875 Rev. F or later ? */ - goto REVF; - bval = inb(ioport+STEST1); - if( (bval & 0x0C) == 0x0C ) /* double clock already enable ? */ - goto REVF; - outb(8,ioport+STEST1); /* enable clock doubler */ - udelay(20); - outb(HALT_SCSI_CLK,ioport+STEST3); /* halt clock */ - outb(0x0C,ioport+STEST1); /* select double SCSI clock */ - outb(0,ioport+STEST3); /* re-enable clock */ -REVF: - bval = SYNC_CLK_F4+ASYNC_CLK_F4; - } - outb(bval,ioport+SCNTL3); - - bval = SYNC_PERIOD_F4+ASYNCHRONOUS; /* set to async */ - outb(bval,ioport+SXFER); - - bval = WRT_EN_INVALIDATE; /* Enable write and invalidate */ - outb(bval,ioport+CTEST3); - - bval = EN_DMA_FIFO_536+BURST_LEN_MSB; /* select 536 bytes DMA FIFO, burst len bit2=1 */ - outb(bval,ioport+CTEST5); - - bval = BURST_LEN8+EN_READ_LINE+EN_READ_MULTIPLE+BURST_OPCODE_FETCH+AUTO_START; /* set DMA parameter */ - outb(bval,ioport+DMODE); - - bval = EN_ABORTED+EN_SCRIPT_INT+EN_ILLEGAL_INST; /* enable DMA interrupt */ - outb(bval,ioport+DIEN); - - bval = EN_CACHE_LINE_SIZE+EN_PRE_FETCH+TOTEM_POLE_IRQ+COMPATIBLE_700; - outb(bval,ioport+DCNTL); - - bval = EN_PHASE_MISMATCH+EN_SCSI_GERROR+EN_UNEXPECT_DISC+EN_SCSI_RESET+EN_PARITY_ERROR; - outb(bval,ioport+SIEN0); - - bval = EN_SEL_TIMEOUT+EN_GENERAL_TIMEOUT; - outb(bval,ioport+SIEN1); - - bval = SEL_TO_204ms; /* 250ms selection timeout */ - outb(bval,ioport+STIME0); - - wval = 1 << (eepromBuf[index][EE_ADAPT_SCSI_ID]); /* @1.11 */ - outw(wval,ioport+RESPID0); - - bval = DIS_SINGLE_INIT; - if( eepromBuf[index][EE_MODE2] & ACTIVE_NEGATION ) - bval |= ACTIVE_NEGATION_; - outb(bval,ioport+STEST3); - - return(0); -} - - -/*********************************************************************** - * Function : static int DC390W_init (struct Scsi_Host *host) - * - * Purpose : initialize the internal structures for a given SCSI host - * - * Inputs : host - pointer to this host adapter's structure/ - * - * Preconditions : when this function is called, the chip_type - * field of the pACB structure MUST have been set. - ***********************************************************************/ - -static int -DC390W_init (PSHT psht, USHORT chipType, ULONG io_port, UCHAR Irq, USHORT index) -{ - PSH psh; - PACB pACB; - - if( ! CheckEEpromCheckSum( &eepromBuf[index][0], (USHORT) io_port) ) - { - psh = scsi_register( psht, sizeof(DC390W_ACB) ); - if( !psh ) - return( -1 ); - if( !pSH_start ) - { - pSH_start = psh; - pSH_current = psh; - } - else - { - pSH_current->next = psh; - pSH_current = psh; - } - -#ifdef DC390W_DEBUG0 - printk("DC390W : pSH = %8x,", (UINT) psh); -#endif - - DC390W_initACB( psh, chipType, io_port, Irq, index ); - if( !DC390W_initAdapter( psh, io_port, Irq, index ) ) - { - pACB = (PACB) psh->hostdata; - if( !pACB_start ) - { - pACB_start = pACB; - pACB_current = pACB; - pACB->pNextACB = (PACB) -1; - } - else - { - pACB_current->pNextACB = pACB; - pACB_current = pACB; - pACB->pNextACB = (PACB) -1; - } - -#ifdef DC390W_DEBUG0 - printk("DC390W : pACB = %8x, pDCB_array = %8x, pSRB_array = %8x\n", - (UINT) pACB, (UINT) pACB->DCB_array, (UINT) pACB->SRB_array); - printk("DC390W : ACB size= %4x, DCB size= %4x, SRB size= %4x\n", - sizeof(DC390W_ACB), sizeof(DC390W_DCB), sizeof(DC390W_SRB) ); -#endif - - } - else - { - pSH_start = NULL; - scsi_unregister( psh ); - return( -1 ); - } - DC390W_download_script( psh ); - return( 0 ); - } - else - { - printk("DC390W_init: EEPROM reading error!\n"); - return( -1 ); - } -} - - -void MyDelay( void ) -{ - UCHAR i,j; - - j = inb(0x61) & 0x10; - - for(;;) - { - i = inb(0x61) & 0x10; - if( j ^ i) - break; - } -} - - -void EnDisableCE( UCHAR Flag, USHORT scsiIOPort ) -{ - - UCHAR bval; - USHORT port; - - port = (scsiIOPort & 0xff00) + GPREG; - if(Flag == ENABLE_CE) - bval = 0x10; - else - bval = 0x00; - outb(bval,port); - udelay(8); /* Delay();*/ -} - - -void EEpromOutDI( USHORT Carry, USHORT scsiIOPort ) -{ - UCHAR bval; - USHORT port; - - port = (scsiIOPort & 0xff00) + GPREG; - bval = 0x10; - if(Carry) - bval |= 0x02; /* SK=0, DI */ - outb(bval,port); - udelay(8); /* Delay();*/ - bval |= 0x04; /* SK=1, DI */ - outb(bval,port); - udelay(8); /* Delay();*/ - bval &= 0xfb; /* SK=0, DI */ - outb(bval,port); - udelay(8); /* Delay();*/ -} - - -void EEpromPrepare( UCHAR EEpromCmd, USHORT scsiIOPort ) -{ - UCHAR i,j; - USHORT carryFlag; - - carryFlag = 1; - j = 0x80; - for(i=0;i<9;i++) - { - EEpromOutDI(carryFlag,scsiIOPort); - carryFlag = (EEpromCmd & j) ? 1 : 0; - j >>= 1; - } -} - - -UCHAR EEpromInDo(USHORT scsiIOPort) -{ - UCHAR bval; - USHORT port; - - port = (scsiIOPort & 0xff00) + GPREG; - bval = 0x14; /* SK=1 */ - outb(bval,port); - udelay(8); /* Delay();*/ - bval = 0x10; /* SK=0 */ - outb(bval,port); - udelay(8); /* Delay();*/ - bval = inb(port); - if(bval & 0x01) - return( 1 ); - else - return( 0 ); -} - - -USHORT EEpromGetData(USHORT scsiIOPort) -{ - UCHAR i; - UCHAR carryFlag; - USHORT wval; - - wval = 0; - for(i=0;i<16;i++) - { - wval <<= 1; - carryFlag = EEpromInDo(scsiIOPort); - wval |= carryFlag; - } - return( wval ); -} - - -void ReadEEprom( PUCHAR EEpromBuf, USHORT scsiIOPort ) -{ - UCHAR cmd; - - cmd = EEPROM_READ; -loop_rd: - EnDisableCE(ENABLE_CE, scsiIOPort); - EEpromPrepare(cmd, scsiIOPort); - *((PUSHORT)EEpromBuf) = EEpromGetData(scsiIOPort); - EEpromBuf++; - EEpromBuf++; - cmd++; - EnDisableCE(DISABLE_CE, scsiIOPort); - if(cmd & 0x3f) - goto loop_rd; -} - - -USHORT CheckEEpromCheckSum( PUCHAR EEpromBuf, USHORT scsiIOPort) -{ - USHORT wval,port, *ptr; - UCHAR i,bval; - - port = (scsiIOPort & 0xff00) + GPCNTL; - bval = 0x09; /* configure IO Pin */ - outb(bval,port); - ReadEEprom(EEpromBuf,scsiIOPort); /* read eeprom data */ - wval = 0; - ptr = (PUSHORT) EEpromBuf; - for(i=0; i<128 ;i+=2, ptr++) - wval += *ptr; - return( (wval == 0x1234) ? 0 : -1); -} - - - -static void -DC390W_download_script (struct Scsi_Host *host) -{ - ULONG wlval, wlval1, length, alignm; - USHORT j, k, m; - USHORT ioport; - UCHAR bval; - PACB pACB; - PSRB pSRB; - void *pSrc, *pSrc1; - ULONG *pStart; - ULONG Ent_reselected; - ULONG Ent_reselecttag; - ULONG Ent_select0; - ULONG Ent_select1; - ULONG Ent_check_phase; - ULONG Ent_status1_phase; - ULONG Ent_command_phase; - ULONG Ent_jump_table0; - ULONG Ent_din_phaseB; - ULONG Ent_dout_phaseB; - ULONG Ent_din_pad_0; - ULONG Ent_dout_pad_0; - ULONG Ent_jump_tablew; - ULONG Ent_din_pad_1; - ULONG Ent_dout_pad_1; - ULONG Ent_mout_phase; - ULONG Ent_status_phase; - ULONG Ent_min_phase; - ULONG Ent_jump_msgok; - ULONG Ent_msg__1; - ULONG Ent_msg___3; - ULONG Ent_msg___2; - ULONG Ent_set_atn; - ULONG Ent_msg__a; - ULONG Ent_msg__23; - ULONG Ent_msg__3; - ULONG Ent_msg__4; - ULONG Ent_clr_atn; - ULONG Ent_din_phaseW; - ULONG Ent_dout_phaseW; - ULONG Ent_din_pad_addrB; - ULONG Ent_dout_pad_addrB; - ULONG Ent_din_pad_addrW; - ULONG Ent_dout_pad_addrW; - - - pACB = (PACB) host->hostdata; - ioport = pACB->IOPortBase; - bval = SCRATCHAB_AS_BASE; /* set scratchB contains 4K RAM base address */ - outb(bval,ioport+CTEST2); - - wlval = inl((ioport+SCRATCHB)); /* get starting address of 4K RAM */ -/* wlval += 0x800; */ /* point to Upper 2K RAM */ - DesPhysAddr[0] = wlval; /* destination address */ - -#ifdef DC390W_DEBUG0 - printk("DesAddr=%8x,",(UINT) wlval); -#endif - bval = 0; /* set Scratch_A and Scratch_B to normal mode */ - outb(bval,ioport+CTEST2); - - /*------------------------------------------------------------------- - * patch the label in jump instruction: using offset relative - * to start_script - *------------------------------------------------------------------*/ - - Ent_reselected = (ULONG) reselected - (ULONG) start_script; - Ent_reselecttag = (ULONG) reselecttag - (ULONG) start_script; - Ent_select0 = (ULONG) select0 - (ULONG) start_script; - Ent_select1 = (ULONG) select1 - (ULONG) start_script; - Ent_check_phase = (ULONG) check_phase - (ULONG) start_script; - Ent_status1_phase = (ULONG) status1_phase - (ULONG) start_script; - Ent_command_phase = (ULONG) command_phase - (ULONG) start_script; - Ent_din_phaseB = (ULONG) din_phaseB - (ULONG) start_script; - Ent_dout_phaseB = (ULONG) dout_phaseB - (ULONG) start_script; - Ent_din_phaseW = (ULONG) din_phaseW - (ULONG) start_script; - Ent_dout_phaseW = (ULONG) dout_phaseW - (ULONG) start_script; - Ent_jump_table0 = (ULONG) jump_table0 - (ULONG) start_script; - Ent_din_pad_0 = (ULONG) din_pad_0 - (ULONG) start_script; - Ent_din_pad_addrB = (ULONG) din_pad_addrB - (ULONG) start_script; - Ent_dout_pad_0 = (ULONG) dout_pad_0 - (ULONG) start_script; - Ent_dout_pad_addrB = (ULONG) dout_pad_addrB - (ULONG) start_script; - Ent_jump_tablew = (ULONG) jump_tablew - (ULONG) start_script; - Ent_din_pad_1 = (ULONG) din_pad_1 - (ULONG) start_script; - Ent_din_pad_addrW = (ULONG) din_pad_addrW - (ULONG) start_script; - Ent_dout_pad_1 = (ULONG) dout_pad_1 - (ULONG) start_script; - Ent_dout_pad_addrW = (ULONG) dout_pad_addrW - (ULONG) start_script; - Ent_mout_phase = (ULONG) mout_phase - (ULONG) start_script; - Ent_status_phase = (ULONG) status_phase - (ULONG) start_script; - Ent_min_phase = (ULONG) min_phase - (ULONG) start_script; - Ent_jump_msgok = (ULONG) jump_msgok - (ULONG) start_script; - Ent_msg__1 = (ULONG) msg__1 - (ULONG) start_script; - Ent_msg___3 = (ULONG) msg___3 - (ULONG) start_script; - Ent_msg___2 = (ULONG) msg___2 - (ULONG) start_script; - Ent_set_atn = (ULONG) set_atn - (ULONG) start_script; - Ent_msg__a = (ULONG) msg__a - (ULONG) start_script; - Ent_msg__23 = (ULONG) msg__23 - (ULONG) start_script; - Ent_msg__3 = (ULONG) msg__3 - (ULONG) start_script; - Ent_msg__4 = (ULONG) msg__4 - (ULONG) start_script; - Ent_clr_atn = (ULONG) clr_atn - (ULONG) start_script; - - jmp_select0[0] = Ent_select0 + wlval; - jmp_reselected[0] = Ent_reselected + wlval; - jmp_check_phase[0] = Ent_check_phase + wlval; - jmp_check_phase1[0] = Ent_check_phase + wlval; - jmp_check_phase2[0] = Ent_check_phase + wlval; - jmp_check_phase3[0] = Ent_check_phase + wlval; - jmp_check_phase4[0] = Ent_check_phase + wlval; - jmp_check_phase5[0] = Ent_check_phase + wlval; - jmp_check_phase6[0] = Ent_check_phase + wlval; - jmp_status1_phase[0] = Ent_status1_phase + wlval; - jmp_status1_phase1[0] = Ent_status1_phase + wlval; - jmp_status1_phase2[0] = Ent_status1_phase + wlval; - jmp_status1_phase3[0] = Ent_status1_phase + wlval; - jmp_command_phase[0] = Ent_command_phase + wlval; - for(j=0,k=1,m=0; j< (MAX_SG_LIST_BUF+1); j++) - { - jmp_dio_phaseB[k] = Ent_din_phaseB + m + wlval; - jmp_dio_phaseW[k] = Ent_din_phaseW + m + wlval; - k += 2; - jmp_dio_phaseB[k] = Ent_dout_phaseB + m + wlval; - jmp_dio_phaseW[k] = Ent_dout_phaseW + m + wlval; - k += 2; - m += 8; - } - jmp_din_pad_0[0] = Ent_din_pad_0 + wlval; - jmp_dout_pad_0[0] = Ent_dout_pad_0 + wlval; - jmp_din_pad_addrB[0] = Ent_din_pad_addrB + wlval; - jmp_dout_pad_addrB[0] = Ent_dout_pad_addrB + wlval; - jmp_din_pad_addrW[0] = Ent_din_pad_addrW + wlval; - jmp_dout_pad_addrW[0] = Ent_dout_pad_addrW + wlval; - jmp_din_pad_1[0] = Ent_din_pad_1 + wlval; - jmp_dout_pad_1[0] = Ent_dout_pad_1 + wlval; - jmp_status_phase[0] = Ent_status_phase + wlval; - jmp_min_phase[0] = Ent_min_phase + wlval; - jmp_mout_phase[0] = Ent_mout_phase + wlval; - jmp_jump_msgok[0] = Ent_jump_msgok + wlval; - jmp_msg__1[0] = Ent_msg__1 + wlval; - jmp_msg___3[0] = Ent_msg___3 + wlval; - jmp_msg___2[0] = Ent_msg___2 + wlval; - jmp_msg__a[0] = Ent_msg__a + wlval; - jmp_msg__a1[0] = Ent_msg__a + wlval; - jmp_msg__a2[0] = Ent_msg__a + wlval; - jmp_msg__23[0] = Ent_msg__23 + wlval; - jmp_msg__3[0] = Ent_msg__3 + wlval; - jmp_msg__4[0] = Ent_msg__4 + wlval; - - /*-------------------------------------------------------------------- - // patch the element in ACB struct: using Physical address - //-------------------------------------------------------------------*/ - -#ifndef VERSION_ELF_1_2_13 - wlval1 = virt_to_phys( pACB->msgin123 ); -#else - wlval1 = (ULONG) pACB->msgin123; -#endif - ACB_msgin123_1[0] = wlval1; - ACB_msgin123_2[0] = wlval1; - ACB_msgin123_3[0] = wlval1; - ACB_msgin123_4[0] = wlval1; - ACB_msgin123_5[0] = wlval1; - ACB_msgin123_6[0] = wlval1; - ACB_msgin123_7[0] = wlval1; - -#ifndef VERSION_ELF_1_2_13 - ACB_status[0] = virt_to_phys( &pACB->status ); -#else - ACB_status[0] = (ULONG) &pACB->status; -#endif - /*-------------------------------------------------------------------- - // patch the element in SRB struct: using offset in struct - //-------------------------------------------------------------------*/ - - pSRB = (PSRB) pACB->SRB_array; - select1[0] = (select1[0] & 0xffff0000) + ((ULONG) &pSRB->__select - (ULONG) &pSRB->CmdBlock); - SRB_msgout0[0] = (ULONG) &pSRB->__msgout0 - (ULONG) &pSRB->CmdBlock; - SRB_msgout01[0] = (ULONG) &pSRB->__msgout0 - (ULONG) &pSRB->CmdBlock; - SRB_command[0] = (ULONG) &pSRB->__command - (ULONG) &pSRB->CmdBlock; - SRB_SegmentPad[0] = (ULONG) &pSRB->SegmentPad - (ULONG) &pSRB->CmdBlock; - SRB_SegmentPad1[0] = (ULONG) &pSRB->SegmentPad - (ULONG) &pSRB->CmdBlock; - SRB_SegmentPad2[0] = (ULONG) &pSRB->SegmentPad - (ULONG) &pSRB->CmdBlock; - SRB_SegmentPad3[0] = (ULONG) &pSRB->SegmentPad - (ULONG) &pSRB->CmdBlock; - wlval = (ULONG) &pSRB->Segment0 - (ULONG) &pSRB->CmdBlock; - for(j=0,k=1; j<(MAX_SG_LIST_BUF+1); j++) - { - din_phaseB[k] = wlval; - dout_phaseB[k] = wlval; - din_phaseW[k] = wlval; - dout_phaseW[k] = wlval; - k += 2; - wlval += 8; - } - - - bval = inb(ioport+DCNTL); - bval |= IRQ_DISABLE; - outb(bval,ioport+DCNTL); /* disable interrupt */ - -/* pSrc = scsi_init_malloc( 2048, GFP_ATOMIC); */ - pSrc = scsi_init_malloc( 4096, GFP_ATOMIC); /* 1.11 */ -#ifdef DC390W_DEBUG0 - printk("SrcAlloc=%8x,",(UINT) pSrc); -#endif - alignm = 4 - (((ULONG) pSrc) & 3); - pSrc1 = (void *)(((ULONG) pSrc) + alignm); - length = (ULONG) end_script - (ULONG) start_script; - memcpy( pSrc1, (void *) start_script, length); - pStart = (ULONG *) ((ULONG) start_mov - (ULONG) start_script); - pStart =(ULONG *) (((ULONG) pStart) + ((ULONG) pSrc1)); - -#ifdef DC390W_DEBUG0 - printk("SrcAddr=%8x,\n",(UINT) pSrc1); -#endif -#ifndef VERSION_ELF_1_2_13 - (ULONG *)pStart[1] = virt_to_phys( pSrc1 ); -#else - (ULONG *)pStart[1] = (ULONG) pSrc1; -#endif - -/* wlval = virt_to_phys( start_script ); */ /* physical address of start_script */ -/* SrcPhysAddr[0] = wlval; */ /* sources address */ - -/* start to download SCRIPT instruction to the RAM of NCR53c825A,875 */ - -/* wlval = virt_to_phys( start_mov ); */ - -#ifndef VERSION_ELF_1_2_13 - wlval = virt_to_phys( pStart ); -#else - wlval = (ULONG) pStart; -#endif - - outl(wlval,ioport+DSP); - - bval = inb(ioport+ISTAT); - while(!(bval & DMA_INT_PENDING)) /* check load start_script is finished? */ - bval = inb(ioport+ISTAT); - - bval = inb(ioport+DSTAT); /* clear interrupt */ - - bval = inb(ioport+DCNTL); - bval &= ~IRQ_DISABLE; - outb(bval,ioport+DCNTL); /* re-enable interrupt */ - - scsi_init_free((char *) pSrc, 4096); - - wlval = DesPhysAddr[0]; /* starting addr of RAM */ - wlval -= (ULONG) start_script; - - pACB->jmp_reselect = wlval + (ULONG) start_script; - pACB->jmp_select = wlval + (ULONG) select1; - pACB->jmp_table8 = wlval + (ULONG) jump_table0; - pACB->jmp_set_atn = wlval + (ULONG) set_atn; - pACB->jmp_clear_ack = wlval + (ULONG) msg__a; - pACB->jmp_next = wlval + (ULONG) check_phase; - pACB->jmp_din8 = wlval + (ULONG) din_phaseB+8; - pACB->jmp_dout8 = wlval + (ULONG) dout_phaseB+8; - pACB->jmp_clear_atn = wlval + (ULONG) clr_atn; - pACB->jmp_reselecttag = wlval + (ULONG) reselecttag; - - wlval = pACB->jmp_reselect; - outl(wlval,(ioport+DSP)); - return; -} - - -/*********************************************************************** - * Function : int DC390W_detect(Scsi_Host_Template *psht) - * - * Purpose : detects and initializes NCR53c825A,875 SCSI chips - * that were autoprobed, overridden on the LILO command line, - * or specified at compile time. - * - * Inputs : psht - template for this SCSI adapter - * - * Returns : number of host adapters detected - * - ***********************************************************************/ - -int -DC390W_detect(Scsi_Host_Template *psht) -{ - UCHAR pci_bus, pci_device_fn, irq; -#ifndef VERSION_ELF_1_2_13 - UINT io_port, ram_base; -#else - ULONG io_port, ram_base; -#endif - USHORT i; - int error = 0; - USHORT adaptCnt = 0; /* Number of boards detected */ - USHORT pci_index = 0; /* Device index to PCI BIOS calls */ - USHORT pci_index2 = 0; /* Device index to PCI BIOS calls */ - USHORT chipType = 0; - - -#ifndef VERSION_ELF_1_2_13 - psht->proc_dir = &proc_scsi_tmscsiw; -#endif - - InitialTime = 1; - pSHT_start = psht; - jmp_table16 = (ULONG) jump_tablew - (ULONG) jump_table0; - jmp_din16 = (ULONG) din_phaseW - (ULONG) din_phaseB; - jmp_dout16 = (ULONG) dout_phaseW - (ULONG) dout_phaseB; - pACB_start = NULL; - - if ( pcibios_present() ) - { - for (i = 0; i < MAX_ADAPTER_NUM; ++i) - { - if( !pcibios_find_device( PCI_VENDOR_ID_NCR, - PCI_DEVICE_ID_NCR53C825A, - pci_index, &pci_bus, &pci_device_fn) ) - { - chipType = PCI_DEVICE_ID_NCR53C825A; - pci_index++; - } - else if( !pcibios_find_device( PCI_VENDOR_ID_NCR, - PCI_DEVICE_ID_NCR53C875, - pci_index2, &pci_bus, &pci_device_fn) ) - { - chipType = PCI_DEVICE_ID_NCR53C875; - pci_index2++; - } - - if( chipType ) - { - error = pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_0, &io_port); - error |= pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_2, &ram_base); - error |= pcibios_read_config_byte(pci_bus, pci_device_fn, - PCI_INTERRUPT_LINE, &irq); - if( error ) - { - printk("DC390W_detect: reading configuration registers error!\n"); - InitialTime = 0; - return( 0 ); - } - - (USHORT) io_port = (USHORT) io_port & 0xFFFE; -#ifdef DC390W_DEBUG0 - printk("DC390W : IO_PORT=%4x,RAM_BASE=%8x,IRQ=%x,CHIPID=%x,\n", - (UINT) io_port, (UINT) ram_base, irq, (UCHAR)chipType); -#endif - - if( !DC390W_init(psht, chipType, io_port, irq, i) ) - adaptCnt++; - chipType = 0; - } - else - break; - } - } - InitialTime = 0; - adapterCnt = adaptCnt; - return( adaptCnt ); -} - -#ifndef VERSION_ELF_1_2_13 - -/******************************************************************** - * Function: tmscsiw_set_info() - * - * Purpose: Set adapter info (!) - * - * Not yet implemented - * - *******************************************************************/ - -int tmscsiw_set_info(char *buffer, int length, struct Scsi_Host *shpnt) -{ - return(-ENOSYS); /* Currently this is a no-op */ -} - -/******************************************************************** - * Function: tmscsiw_proc_info(char* buffer, char **start, - * off_t offset, int length, int hostno, int inout) - * - * Purpose: return SCSI Adapter/Device Info - * - * Input: buffer: Pointer to a buffer where to write info - * start : - * offset: - * hostno: Host adapter index - * inout : Read (=0) or set(!=0) info - * - * Output: buffer: contains info - * length; length of info in buffer - * - * return value: length - * - ********************************************************************/ - -/* KG: proc_info taken from driver aha152x.c */ - -#undef SPRINTF -#define SPRINTF(args...) pos += sprintf(pos, ## args) - -#define YESNO(YN)\ -if (YN) SPRINTF(" Yes ");\ -else SPRINTF(" No ") - -int tmscsiw_proc_info(char *buffer, char **start, - off_t offset, int length, int hostno, int inout) -{ - int dev, spd, spd1; - char *pos = buffer; - PSH shpnt; - PACB acbpnt; - PDCB dcbpnt; - unsigned long flags; -/* Scsi_Cmnd *ptr; */ - - acbpnt = pACB_start; - - while(acbpnt != (PACB)-1) - { - shpnt = acbpnt->pScsiHost; - if (shpnt->host_no == hostno) break; - acbpnt = acbpnt->pNextACB; - } - - if (acbpnt == (PACB)-1) return(-ESRCH); - if (!shpnt) return(-ESRCH); - - if(inout) /* Has data been written to the file ? */ - return(tmscsiw_set_info(buffer, length, shpnt)); - - SPRINTF("Tekram DC390W/U/F (T) PCI SCSI Host Adadpter, "); - SPRINTF("Driver Version 1.12, 1997/02/17\n"); - - save_flags(flags); - cli(); - - SPRINTF("SCSI Host Nr %i, ", hostno); - SPRINTF("DC390WUF Adapter Nr %i\n", acbpnt->AdapterIndex); - SPRINTF("IOPortBase 0x%04x, ", acbpnt -> IOPortBase); - SPRINTF("IRQLevel 0x%02x\n",acbpnt -> IRQLevel); - - SPRINTF("Adapter Type: "); - switch(acbpnt->AdaptType) - { - case DC390W: SPRINTF("DC390W, Fast Wide SCSI \n"); break; - case DC390U: SPRINTF("DC390U, Ultra SCSI\n"); break; - case DC390F: SPRINTF("DC390F, Ultra Wide SCSI\n"); break; - default: SPRINTF("Unknown !\n"); - } - - SPRINTF("MaxID %i, MaxLUN %i, ", acbpnt->max_id, acbpnt->max_lun); - SPRINTF("AdapterID %i, AdapterLUN %i\n", acbpnt->AdaptSCSIID, acbpnt->AdaptSCSILUN); - - SPRINTF("TagMaxNum %i, Status %i\n", acbpnt->TagMaxNum, acbpnt->status); - - SPRINTF("Nr of attached devices: %i\n", acbpnt->DeviceCnt); - - SPRINTF("Un ID LUN Prty Sync DsCn SndS TagQ Wide NegoPeriod SyncSpeed SyncOffs\n"); - dcbpnt = acbpnt->pLinkDCB; - - for (dev = 0; dev < acbpnt->DeviceCnt; dev++) - { - SPRINTF("%02i %02i %02i ", dev, dcbpnt->UnitSCSIID, dcbpnt->UnitSCSILUN); - YESNO(dcbpnt->DevMode & PARITY_CHK_); - YESNO(dcbpnt->DCBsxfer & OFFSET_MASK); - YESNO(dcbpnt->DevMode & EN_DISCONNECT_); - YESNO(dcbpnt->DevMode & SEND_START_); - YESNO(dcbpnt->MaxCommand > 1); - YESNO(dcbpnt->DCBscntl3 & EN_WIDE_SCSI); - SPRINTF(" %03i ns ", (dcbpnt->NegoPeriod) << 2); - if (dcbpnt->DCBsxfer & OFFSET_MASK) - { - spd = 1000/(dcbpnt->SyncPeriod <<2); - spd1 = 1000%(dcbpnt->SyncPeriod <<2); - spd1 = (spd1 * 10)/(dcbpnt->SyncPeriod <<2); - SPRINTF(" %2i.%1i M %02i\n", spd, spd1, dcbpnt->DCBsxfer & OFFSET_MASK); - } - else SPRINTF("\n"); - /* Add more info ...*/ - dcbpnt = dcbpnt->pNextDCB; - } - - restore_flags(flags); - *start = buffer + offset; - - if (pos - buffer < offset) - return 0; - else if (pos - buffer - offset < length) - return pos - buffer - offset; - else - return length; -} -#endif /* VERSION_ELF_1_2_13 */ - -#ifdef MODULE - -/*********************************************************************** - * Function : static int DC390W_shutdown (struct Scsi_Host *host) - * - * Purpose : does a clean (we hope) shutdown of the NCR SCSI chip. - * Use prior to dumping core, unloading the NCR driver, etc. - * - * Returns : 0 on success - ***********************************************************************/ -static int -DC390W_shutdown (struct Scsi_Host *host) -{ - USHORT ioport; - unsigned long flags; - PACB pACB = (PACB) host->hostdata; - - ioport = (unsigned int) pACB->IOPortBase; - - save_flags (flags); - cli(); - -/* pACB->soft_reset(host); */ -/* - * For now, we take the simplest solution : reset the SCSI bus. Eventually, - * - If a command is connected, kill it with an ABORT message - * - If commands are disconnected, connect to each target/LUN and - * do a ABORT, followed by a SOFT reset, followed by a hard - * reset. - */ - -#ifdef DC390W_DEBUG0 - printk("DC390W: shutdown,"); -#endif - outb(ASSERT_RST, ioport+SCNTL1); - udelay(25); /* Minimum amount of time to assert RST */ - outb(0, ioport+SCNTL1); - restore_flags (flags); - return( 0 ); -} - - -int DC390W_release(struct Scsi_Host *host) -{ - int irq_count; - struct Scsi_Host *tmp; - - DC390W_shutdown (host); - - if (host->irq != IRQ_NONE) - { - for (irq_count = 0, tmp = pSH_start; tmp; tmp = tmp->next) - { - if ( tmp->irq == host->irq ) - ++irq_count; - } - if (irq_count == 1) - { -#ifdef DC390W_DEBUG0 - printk("DC390W: Free IRQ %i.",host->irq); -#endif -#ifndef VERSION_ELF_1_2_13 - free_irq(host->irq,NULL); -#else - free_irq(host->irq); -#endif - } - } - - release_region(host->io_port,host->n_io_port); - - return( 1 ); -} - -Scsi_Host_Template driver_template = DC390WUF; -#include "scsi_module.c" -#endif /* def MODULE */ - diff --git a/linux/src/drivers/scsi/tmscsiw.h b/linux/src/drivers/scsi/tmscsiw.h deleted file mode 100644 index 4ebbe4a..0000000 --- a/linux/src/drivers/scsi/tmscsiw.h +++ /dev/null @@ -1,1082 +0,0 @@ -/*********************************************************************** -;* File Name : TMSCSIW.H * -;* TEKRAM DC-390 PCI Wide SCSI Bus Master Host Adapter* -;* Device Driver * -;***********************************************************************/ - -#ifndef TMSCSIW_H -#define TMSCSIW_H - -#define IRQ_NONE 255 - -typedef unsigned char UCHAR; -typedef unsigned short USHORT; -typedef unsigned long ULONG; -typedef unsigned int UINT; - -typedef UCHAR *PUCHAR; -typedef USHORT *PUSHORT; -typedef ULONG *PULONG; -typedef Scsi_Host_Template *PSHT; -typedef struct Scsi_Host *PSH; -typedef Scsi_Device *PSCSIDEV; -typedef Scsi_Cmnd *PSCSICMD; -typedef void *PVOID; -typedef struct scatterlist *PSGL, SGL; - - -typedef struct _AddWkSpace -{ -USHORT WKIOCtrlFlag; /* ;b7-Done, b6-wrtVerify, b0-in process */ -USHORT XferredBlkCnt; -USHORT WKToXferBlkCnt; -USHORT WKcSGListDone; -USHORT WKMaxSGIndex; -ULONG WKToXferLen; -USHORT NxtSGoffset; -} AddWkSpace; - -/*;-----------------------------------------------------------------------*/ -typedef struct _SyncMsg -{ -UCHAR ExtendMsg; -UCHAR ExtMsgLen; -UCHAR SyncXferReq; -UCHAR Period; -UCHAR ReqOffset; -} SyncMsg; -/*;-----------------------------------------------------------------------*/ -typedef struct _Capacity -{ -ULONG BlockCount; -ULONG BlockLength; -} Capacity; -/*;-----------------------------------------------------------------------*/ -typedef struct _SGentry -{ -ULONG SGXferDataPtr; -ULONG SGXferDataLen; -} SGentry; - -typedef struct _SGentry1 -{ -ULONG SGXLen; -ULONG SGXPtr; -} SGentry1, *PSGE; - - -#define MAX_ADAPTER_NUM 4 -#define MAX_DEVICES 10 -#define MAX_SG_LIST_BUF 32 -#define MAX_CMD_QUEUE 20 -#define MAX_CMD_PER_LUN 8 -#define MAX_SCSI_ID 16 -#define MAX_SRB_CNT MAX_CMD_QUEUE+4 -#define END_SCAN 2 - -/* -;----------------------------------------------------------------------- -; SCSI Request Block -;----------------------------------------------------------------------- -*/ -struct _SRB -{ -UCHAR CmdBlock[12]; -ULONG Segment0[MAX_SG_LIST_BUF+1][2]; -ULONG SegmentPad[2]; - -ULONG __select; -ULONG __command[2]; /* ;len,ptr */ -ULONG __msgout0[2]; /* ;len,ptr */ - -ULONG PhysSRB; -ULONG ReturnAddr; -ULONG RemainSegPtr; -PSCSICMD pcmd; -struct _SRB *pNextSRB; -struct _DCB *pSRBDCB; -PSGL pSegmentList; -ULONG XferredLen; - -ULONG SGPhysAddr; /*;a segment starting address */ -ULONG XferredLen1; - -SGL Segmentx; /* make a one entry of S/G list table */ - -PUCHAR pMsgPtr; -USHORT SRBState; -USHORT Revxx2; /* ??? */ - -UCHAR MsgInBuf[6]; -UCHAR MsgOutBuf[6]; -UCHAR SenseDataBuf[0x12]; -UCHAR AdaptStatus; -UCHAR TargetStatus; - -UCHAR MsgCnt; -UCHAR EndMessage; -UCHAR TagNumber; -UCHAR InternalReq; /*; 1-ADD internal request, 0-DMD request */ - -UCHAR SGcount; -UCHAR SGIndex; -UCHAR IORBFlag; /*;81h-Reset, 2-retry */ -UCHAR SRBStatus; - -UCHAR RetryCnt; -UCHAR SRBFlag; /*; b0-AutoReqSense,b6-Read,b7-write */ - /*; b4-settimeout,b5-Residual valid */ -UCHAR ScratchABuf; -UCHAR Reserved3[1]; /*;for dword alignment */ -}; - -typedef struct _SRB DC390W_SRB, *PSRB; - -/* -;----------------------------------------------------------------------- -; Device Control Block -;----------------------------------------------------------------------- -*/ -struct _DCB -{ -UCHAR DCBselect; -UCHAR DCBsxfer; -UCHAR DCBsdid; -UCHAR DCBscntl3; - -UCHAR DCBscntl0; -UCHAR IdentifyMsg; -UCHAR DevMode; -UCHAR AdpMode; - -struct _DCB *pNextDCB; -struct _ACB *pDCBACB; - -PSCSICMD pQIORBhead; -PSCSICMD pQIORBtail; -PSCSICMD AboIORBhead; -PSCSICMD AboIORBtail; -USHORT QIORBCnt; -USHORT AboIORBcnt; - -PSRB pWaitingSRB; -PSRB pWaitLast; -PSRB pGoingSRB; -PSRB pGoingLast; -PSRB pActiveSRB; -USHORT GoingSRBCnt; -USHORT WaitSRBCnt; /* ??? */ - -ULONG TagMask; - -USHORT MaxCommand; -USHORT AdaptIndex; /*; UnitInfo struc start */ -USHORT UnitIndex; /*; nth Unit on this card */ -UCHAR UnitSCSIID; /*; SCSI Target ID (SCSI Only) */ -UCHAR UnitSCSILUN; /*; SCSI Log. Unit (SCSI Only) */ - -UCHAR InqDataBuf[8]; -UCHAR CapacityBuf[8]; -UCHAR SyncMode; /*; 0:async mode */ -UCHAR NegoPeriod; /*;for nego. */ -UCHAR SyncPeriod; /*;for reg. */ -UCHAR SyncOffset; /*;for reg. and nego.(low nibble) */ -UCHAR UnitCtrlFlag; -UCHAR DCBFlag; -UCHAR DevType; -UCHAR Reserved2[1]; /*;for dword alignment */ -}; - -typedef struct _DCB DC390W_DCB, *PDCB; -/* -;----------------------------------------------------------------------- -; Adapter Control Block -;----------------------------------------------------------------------- -*/ -struct _ACB -{ -ULONG PhysACB; -ULONG DevVendorID; -PSH pScsiHost; -struct _ACB *pNextACB; -USHORT IOPortBase; -USHORT Revxx1; /* ??? */ - -PDCB pLinkDCB; -PDCB pDCBRunRobin; -PDCB pActiveDCB; -PDCB pDCB_free; -PSRB pFreeSRB; -USHORT SRBCount; -USHORT AdapterIndex; /*; nth Adapter this driver */ -USHORT max_id; -USHORT max_lun; - -ULONG jmp_reselect; -ULONG jmp_select; -ULONG jmp_table8; -ULONG jmp_set_atn; -ULONG jmp_clear_ack; -ULONG jmp_next; -ULONG jmp_din8; -ULONG jmp_dout8; -ULONG jmp_clear_atn; -ULONG jmp_reselecttag; - -UCHAR msgin123[4]; -UCHAR status; -UCHAR AdaptSCSIID; /*; Adapter SCSI Target ID */ -UCHAR AdaptSCSILUN; /*; Adapter SCSI LUN */ -UCHAR DeviceCnt; -UCHAR IRQLevel; -UCHAR AdaptType; /*;1:390W, 2:390U, 3:390F */ -UCHAR TagMaxNum; -UCHAR ACBFlag; -UCHAR Gmode2; -UCHAR LUNchk; -UCHAR scan_devices; -UCHAR Reserved1[1]; /*;for dword alignment */ -UCHAR DCBmap[MAX_SCSI_ID]; -DC390W_DCB DCB_array[MAX_DEVICES]; /* +74h, Len=3E8 */ -DC390W_SRB SRB_array[MAX_SRB_CNT]; /* +45Ch, Len= */ -}; - -typedef struct _ACB DC390W_ACB, *PACB; - -/*;-----------------------------------------------------------------------*/ - -#define PCI_DEVICE_ID_NCR53C825A 0x0003 -#define PCI_DEVICE_ID_NCR53C875 0x000f - -#define CHIP810_ID 0x00011000 -#define CHIP820_ID 0x00021000 -#define CHIP825_ID 0x00031000 -#define CHIP815_ID 0x00041000 -#define CHIP875_ID 0x000f1000 - -#define DC390W 1 /*;825A - 16 BIT*/ -#define DC390U 2 /*;875 - 8 BIT*/ -#define DC390F 3 /*;875 - 16 BIT*/ - -#define BIT31 0x80000000 -#define BIT30 0x40000000 -#define BIT29 0x20000000 -#define BIT28 0x10000000 -#define BIT27 0x08000000 -#define BIT26 0x04000000 -#define BIT25 0x02000000 -#define BIT24 0x01000000 -#define BIT23 0x00800000 -#define BIT22 0x00400000 -#define BIT21 0x00200000 -#define BIT20 0x00100000 -#define BIT19 0x00080000 -#define BIT18 0x00040000 -#define BIT17 0x00020000 -#define BIT16 0x00010000 -#define BIT15 0x00008000 -#define BIT14 0x00004000 -#define BIT13 0x00002000 -#define BIT12 0x00001000 -#define BIT11 0x00000800 -#define BIT10 0x00000400 -#define BIT9 0x00000200 -#define BIT8 0x00000100 -#define BIT7 0x00000080 -#define BIT6 0x00000040 -#define BIT5 0x00000020 -#define BIT4 0x00000010 -#define BIT3 0x00000008 -#define BIT2 0x00000004 -#define BIT1 0x00000002 -#define BIT0 0x00000001 - -/*;---WKIOCtrlFlag */ -#define IN_PROCESSING BIT0 -#define BAD_WRITE_V_CMD BIT1 -#define VERIFY_CMD BIT2 -#define RESIDUAL_SG BIT3 - -/*;---UnitCtrlFlag */ -#define UNIT_ALLOCATED BIT0 -#define UNIT_INFO_CHANGED BIT1 -#define FORMATING_MEDIA BIT2 -#define UNIT_RETRY BIT3 - -/*;---UnitFlags */ -#define DASD_SUPPORT BIT0 -#define SCSI_SUPPORT BIT1 -#define ASPI_SUPPORT BIT2 - -/*;----SRBState machine definition */ -#define SRB_FREE 0 -#define SRB_WAIT BIT0 -#define SRB_READY BIT1 -#define SRB_MSGOUT BIT2 /*;arbitration+msg_out 1st byte*/ -#define SRB_MSGIN BIT3 -#define SRB_MSGIN_MULTI BIT4 -#define SRB_COMMAND BIT5 -#define SRB_START_ BIT6 /*;arbitration+msg_out+command_out*/ -#define SRB_DISCONNECT BIT7 -#define SRB_DATA_XFER BIT8 -#define SRB_XFERPAD BIT9 -#define SRB_STATUS BIT10 -#define SRB_COMPLETED BIT11 - -#define DO_WIDE_NEGO BIT12 -#define DO_SYNC_NEGO BIT13 -#define SRB_UNEXPECT_RESEL BIT14 - -/*;---ACBFlag */ -#define RESET_DEV BIT0 -#define RESET_DETECT BIT1 -#define RESET_DONE BIT2 - -/*;---DCBFlag */ -#define ABORT_DEV_ BIT0 - -/*;---SRBstatus */ -#define SRB_OK BIT0 -#define ABORTION BIT1 -#define OVER_RUN BIT2 -#define UNDER_RUN BIT3 -#define SRB_ERROR BIT4 - -/*;---SRBFlag */ -#define DATAOUT BIT7 -#define DATAIN BIT6 -#define RESIDUAL_VALID BIT5 -#define ENABLE_TIMER BIT4 -#define RESET_DEV0 BIT2 -#define ABORT_DEV BIT1 -#define AUTO_REQSENSE BIT0 - -/*;---Adapter status */ -#define H_STATUS_GOOD 0 -#define H_SEL_TIMEOUT 0x11 -#define H_OVER_UNDER_RUN 0x12 -#define H_UNEXP_BUS_FREE 0x13 -#define H_TARGET_PHASE_F 0x14 -#define H_INVALID_CCB_OP 0x16 -#define H_LINK_CCB_BAD 0x17 -#define H_BAD_TARGET_DIR 0x18 -#define H_DUPLICATE_CCB 0x19 -#define H_BAD_CCB_OR_SG 0x1A -#define H_ABORT 0x0FF - -/*; SCSI Status byte codes*/ -#define SCSI_STAT_GOOD 0x0 /*; Good status */ -#define SCSI_STAT_CHECKCOND 0x02 /*; SCSI Check Condition */ -#define SCSI_STAT_CONDMET 0x04 /*; Condition Met */ -#define SCSI_STAT_BUSY 0x08 /*; Target busy status */ -#define SCSI_STAT_INTER 0x10 /*; Intermediate status */ -#define SCSI_STAT_INTERCONDMET 0x14 /*; Intermediate condition met */ -#define SCSI_STAT_RESCONFLICT 0x18 /*; Reservation conflict */ -#define SCSI_STAT_CMDTERM 0x22 /*; Command Terminated */ -#define SCSI_STAT_QUEUEFULL 0x28 /*; Queue Full */ - -#define SCSI_STAT_UNEXP_BUS_F 0xFD /*; Unexpect Bus Free */ -#define SCSI_STAT_BUS_RST_DETECT 0xFE /*; Scsi Bus Reset detected */ -#define SCSI_STAT_SEL_TIMEOUT 0xFF /*; Selection Time out */ - -/*;---Sync_Mode */ -#define SYNC_DISABLE 0 -#define SYNC_ENABLE BIT0 -#define SYNC_NEGO_DONE BIT1 -#define WIDE_ENABLE BIT2 -#define WIDE_NEGO_DONE BIT3 -#define EN_TAG_QUEUING BIT4 - -#define SYNC_NEGO_OFFSET 16 - -/*;---SCSI bus phase*/ -#define SCSI_DATA_OUT 0 -#define SCSI_DATA_IN 1 -#define SCSI_COMMAND 2 -#define SCSI_STATUS_ 3 -#define SCSI_NOP0 4 -#define SCSI_NOP1 5 -#define SCSI_MSG_OUT 6 -#define SCSI_MSG_IN 7 - -/*;----SCSI MSG BYTE*/ -#define MSG_COMPLETE 0x00 -#define MSG_EXTENDED 0x01 -#define MSG_SAVE_PTR 0x02 -#define MSG_RESTORE_PTR 0x03 -#define MSG_DISCONNECT 0x04 -#define MSG_INITIATOR_ERROR 0x05 -#define MSG_ABORT 0x06 -#define MSG_REJECT_ 0x07 -#define MSG_NOP 0x08 -#define MSG_PARITY_ERROR 0x09 -#define MSG_LINK_CMD_COMPL 0x0A -#define MSG_LINK_CMD_COMPL_FLG 0x0B -#define MSG_BUS_RESET 0x0C -#define MSG_ABORT_TAG 0x0D -#define MSG_SIMPLE_QTAG 0x20 -#define MSG_HEAD_QTAG 0x21 -#define MSG_ORDER_QTAG 0x22 -#define MSG_IDENTIFY 0x80 -#define MSG_HOST_ID 0x0C0 - -/*;----SCSI STATUS BYTE*/ -#define STATUS_GOOD 0x00 -#define CHECK_CONDITION_ 0x02 -#define STATUS_BUSY 0x08 -#define STATUS_INTERMEDIATE 0x10 -#define RESERVE_CONFLICT 0x18 - -/* cmd->result */ -#define STATUS_MASK_ 0xFF -#define MSG_MASK 0xFF00 -#define RETURN_MASK 0xFF0000 - -/* -** Inquiry Data format -*/ - -typedef struct _SCSIInqData { /* INQ */ - - UCHAR DevType; /* Periph Qualifier & Periph Dev Type*/ - UCHAR RMB_TypeMod; /* rem media bit & Dev Type Modifier */ - UCHAR Vers; /* ISO, ECMA, & ANSI versions */ - UCHAR RDF; /* AEN, TRMIOP, & response data format*/ - UCHAR AddLen; /* length of additional data */ - UCHAR Res1; /* reserved */ - UCHAR Res2; /* reserved */ - UCHAR Flags; /* RelADr,Wbus32,Wbus16,Sync,etc. */ - UCHAR VendorID[8]; /* Vendor Identification */ - UCHAR ProductID[16]; /* Product Identification */ - UCHAR ProductRev[4]; /* Product Revision */ - - -} SCSI_INQDATA, *PSCSI_INQDATA; - - -/* Inquiry byte 0 masks */ - - -#define SCSI_DEVTYPE 0x1F /* Peripheral Device Type */ -#define SCSI_PERIPHQUAL 0xE0 /* Peripheral Qualifier */ - - -/* Inquiry byte 1 mask */ - -#define SCSI_REMOVABLE_MEDIA 0x80 /* Removable Media bit (1=removable) */ - - -/* Peripheral Device Type definitions */ - -#define SCSI_DASD 0x00 /* Direct-access Device */ -#define SCSI_SEQACESS 0x01 /* Sequential-access device */ -#define SCSI_PRINTER 0x02 /* Printer device */ -#define SCSI_PROCESSOR 0x03 /* Processor device */ -#define SCSI_WRITEONCE 0x04 /* Write-once device */ -#define SCSI_CDROM 0x05 /* CD-ROM device */ -#define SCSI_SCANNER 0x06 /* Scanner device */ -#define SCSI_OPTICAL 0x07 /* Optical memory device */ -#define SCSI_MEDCHGR 0x08 /* Medium changer device */ -#define SCSI_COMM 0x09 /* Communications device */ -#define SCSI_NODEV 0x1F /* Unknown or no device type */ - -/* -** Inquiry flag definitions (Inq data byte 7) -*/ - -#define SCSI_INQ_RELADR 0x80 /* device supports relative addressing*/ -#define SCSI_INQ_WBUS32 0x40 /* device supports 32 bit data xfers */ -#define SCSI_INQ_WBUS16 0x20 /* device supports 16 bit data xfers */ -#define SCSI_INQ_SYNC 0x10 /* device supports synchronous xfer */ -#define SCSI_INQ_LINKED 0x08 /* device supports linked commands */ -#define SCSI_INQ_CMDQUEUE 0x02 /* device supports command queueing */ -#define SCSI_INQ_SFTRE 0x01 /* device supports soft resets */ - - -/* -;========================================================== -; EEPROM byte offset -;========================================================== -*/ -typedef struct _EEprom -{ -UCHAR EE_MODE1; -UCHAR EE_SPEED; -UCHAR xx1; -UCHAR xx2; -} EEprom, *PEEprom; - -#define EE_ADAPT_SCSI_ID 64 -#define EE_MODE2 65 -#define EE_DELAY 66 -#define EE_TAG_CMD_NUM 67 - -/*; EE_MODE1 bits definition*/ -#define PARITY_CHK_ BIT0 -#define SYNC_NEGO_ BIT1 -#define EN_DISCONNECT_ BIT2 -#define SEND_START_ BIT3 -#define TAG_QUEUING_ BIT4 -#define WIDE_NEGO_ BIT5 - -/*; EE_MODE2 bits definition*/ -#define MORE2_DRV BIT0 -#define GREATER_1G BIT1 -#define RST_SCSI_BUS BIT2 -#define ACTIVE_NEGATION BIT3 -#define NO_SEEK BIT4 -#define LUN_CHECK BIT5 - -#define ENABLE_CE 1 -#define DISABLE_CE 0 -#define EEPROM_READ 0x80 - -/* -;========================================================== -; NCR 53C825 Registers Structure -;========================================================== -*/ -typedef struct _OperatingReg -{ -UCHAR SCSICtrl0; /*; (+00)*/ -UCHAR SCSICtrl1; /*; (+01)*/ -UCHAR SCSICtrl2; /*; (+02)*/ -UCHAR SCSICtrl3; /*; (+03)*/ -UCHAR SCSIChipID; /*; (+04)*/ -UCHAR SCSIXfer; /*; (+05)*/ -UCHAR SCSIDestID; /*; (+06)*/ -UCHAR GeneralPReg; /*; (+07)*/ -UCHAR SCSI1stByteR; /*; (+08)*/ -UCHAR SCSIOPCtrlL; /*; (+09)*/ -UCHAR SCSISelID; /*; (+0A)*/ -UCHAR SCSIBusCtrlLin; /*; (+0B)*/ -UCHAR DMAStatus; /*; (+0C)*/ -UCHAR SCSIStatus0; /*; (+0D)*/ -UCHAR SCSIStatus1; /*; (+0E)*/ -UCHAR SCSIStatus2; /*; (+0F)*/ -ULONG DataStrucAddr; /*; (+10)*/ -UCHAR InterruptStatus;/*; (+14)*/ -UCHAR Reser1; /*; (+15)*/ -UCHAR Reser2; /*; (+16)*/ -UCHAR Reser3; /*; (+17)*/ -UCHAR ChipTest0; /*; (+18)*/ -UCHAR ChipTest1; /*; (+19)*/ -UCHAR ChipTest2; /*; (+1A)*/ -UCHAR ChipTest3; /*; (+1B)*/ -ULONG TempStack; /*; (+1C)*/ -UCHAR DMAFIFO; /*; (+20)*/ -UCHAR ChipTest4; /*; (+21)*/ -UCHAR ChipTest5; /*; (+22)*/ -UCHAR ChipTest6; /*; (+23)*/ -UCHAR DMAByteCnt[3]; /*; (+24)*/ -UCHAR DMACommand; /*; (+27)*/ -ULONG DMANextAddr; /*; (+28)*/ -ULONG DMAScriptsPtr; /*; (+2C)*/ -ULONG DMAScriptPtrSav;/*; (+30)*/ -ULONG ScratchA; /*; (+34)*/ -UCHAR DMAMode; /*; (+38)*/ -UCHAR DMAIntEnable; /*; (+39)*/ -UCHAR DMAWatchDog; /*; (+3A)*/ -UCHAR DMACtrl; /*; (+3B)*/ -ULONG ADDer; /*; (+3C)*/ -UCHAR SCSIIntEnable0; /*; (+40)*/ -UCHAR SCSIIntEnable1; /*; (+41)*/ -UCHAR SCSIIntStatus0; /*; (+42)*/ -UCHAR SCSIIntStatus1; /*; (+43)*/ -UCHAR SCSILongParity; /*; (+44)*/ -UCHAR WideResiData; /*; (+45)*/ -UCHAR MemAccessCtrl; /*; (+46)*/ -UCHAR GeneralPCtrl; /*; (+47)*/ -UCHAR SCSITimer0; /*; (+48)*/ -UCHAR SCSITimer1; /*; (+49)*/ -UCHAR ResponseID0; /*; (+4A)*/ -UCHAR ResponseID1; /*; (+4B)*/ -UCHAR SCSITest0; /*; (+4C)*/ -UCHAR SCSITest1; /*; (+4D)*/ -UCHAR SCSITest2; /*; (+4E)*/ -UCHAR SCSITest3; /*; (+4F)*/ -USHORT SCSIIPDataL; /*; (+50)*/ -USHORT Reser4; /*; (+52)*/ -USHORT SCSIOPDataL; /*; (+54)*/ -USHORT Reser5; /*; (+56)*/ -USHORT SCSIBusDataLin; /*; (+58)*/ -USHORT Reser6; /*; (+5A)*/ -ULONG ScratchB; /*; (+5C)*/ -ULONG ScratchC; /*; (+60)*/ -ULONG ScratchD; /*; (+64)*/ -ULONG ScratchE; /*; (+68)*/ -ULONG ScratchF; /*; (+6C)*/ -ULONG ScratchG; /*; (+70)*/ -ULONG ScratchH; /*; (+74)*/ -ULONG ScratchI; /*; (+78)*/ -ULONG ScratchJ; /*; (+7C)*/ -} OperatingReg; -/* -;========================================================== -; NCR 53C825 Registers bit Definition -;========================================================== -*/ -/*; SCSICtrl0 (+00)*/ -#define FULL_ARBITRATION (BIT7+BIT6) -#define START_ARBIT BIT5 -#define SEL_W_SATN BIT4 -#define EN_PARITY_CHK BIT3 -#define SATN_IF_PARITY_ERR BIT1 -#define TARGET_MODE BIT0 - -/*; SCSICtrl1 (+01)*/ -#define ASSERT_RST BIT3 -#define ASSERT_EVEN_P BIT2 -#define START_SCSI_XFER BIT0 - -/*; SCSICtrl2 (+02)*/ -#define DISC_UNEXPECTED BIT7 -#define CHAIN_MODE BIT6 -#define WIDE_SCSI_SEND BIT3 -#define WIDE_SCSI_RECV BIT0 - -/*; SCSICtrl3 (+03)*/ -#define EN_FAST_20 BIT7 -#define SYNC_CLK_F4 (BIT6+BIT4) -#define SYNC_CLK_F3 BIT6 -#define SYNC_CLK_F2 (BIT5+BIT4) -#define SYNC_CLK_F1_5 BIT5 -#define SYNC_CLK_F1 BIT4 -#define EN_WIDE_SCSI BIT3 -#define ASYNC_CLK_F4 (BIT2+BIT0) -#define ASYNC_CLK_F3 BIT2 -#define ASYNC_CLK_F2 (BIT1+BIT0) -#define ASYNC_CLK_F1_5 BIT1 -#define ASYNC_CLK_F1 BIT0 - -/*; SCSIChipID (+04)*/ -#define ENABLE_RESEL BIT6 -#define ENABLE_SEL BIT5 -#define CHIP_ID_MASK 0FH - -/*; SCSIXfer (+05)*/ -#define PERIOD_MASK (BIT7+BIT6+BIT5) -#define SYNC_PERIOD_F11 (BIT7+BIT6+BIT5) -#define SYNC_PERIOD_F10 (BIT7+BIT6) -#define SYNC_PERIOD_F9 (BIT7+BIT5) -#define SYNC_PERIOD_F8 BIT7 -#define SYNC_PERIOD_F7 (BIT6+BIT5) -#define SYNC_PERIOD_F6 BIT6 -#define SYNC_PERIOD_F5 BIT5 -#define SYNC_PERIOD_F4 0 -#define OFFSET_MASK (BIT4+BIT3+BIT2+BIT1+BIT0) -#define SYNC_OFFSET_16 BIT4 -#define SYNC_OFFSET_8 BIT3 -#define SYNC_OFFSET_7 (BIT2+BIT1+BIT0) -#define SYNC_OFFSET_6 (BIT2+BIT1) -#define SYNC_OFFSET_5 (BIT2+BIT0) -#define SYNC_OFFSET_4 BIT2 -#define SYNC_OFFSET_3 (BIT1+BIT0) -#define SYNC_OFFSET_2 BIT1 -#define SYNC_OFFSET_1 BIT0 -#define SYNC_OFFSET_0 0 -#define ASYNCHRONOUS SYNC_OFFSET_0 -/* -; SCSIDestID (+06) - -; GeneralPReg (+07) - -; SCSI1stByteR (+08) -*/ -/*; SCSIOPCtrlL (+09)*/ -#define ASSERT_REQ BIT7 -#define ASSERT_ACK BIT6 -#define ASSERT_BSY BIT5 -#define ASSERT_SEL BIT4 -#define ASSERT_ATN BIT3 -#define ASSERT_MSG BIT2 -#define ASSERT_C_D BIT1 -#define ASSERT_I_O BIT0 - -/*; SCSISelID (+0A) Read*/ -#define SCSI_ID_VALID BIT7 - -/*; SCSIBusCtrlLin (+0B) Read*/ -#define REQ_SIGNAL BIT7 -#define ACK_SIGNAL BIT6 -#define BSY_SIGNAL BIT5 -#define SEL_SIGNAL BIT4 -#define ATN_SIGNAL BIT3 -#define MSG_SIGNAL BIT2 -#define C_D_SIGNAL BIT1 -#define I_O_SIGNAL BIT0 - -/*; DMAStatus (+0C) Read*/ -#define DMA_FIFO_EMPTY BIT7 -#define MASTER_PARITY_ERR BIT6 -#define BUS_FAULT BIT5 -#define ABORT_ BIT4 -#define SINGLE_STEP_INT BIT3 -#define SCRIPTS_INT BIT2 -#define ILLEGAL_INSTRUC BIT0 - -/*; SCSIStatus0 (+0D) Read*/ -#define SIDL_LSB_FULL BIT7 -#define SODR_LSB_FULL BIT6 -#define SODL_LSB_FULL BIT5 -#define IN_ARBITRATION BIT4 -#define LOST_ARBITRATION BIT3 -#define WIN_ARBITRATION BIT2 -#define RST_SIGNAL BIT1 -#define PARITY_SIGNAL BIT0 - -/*; SCSIStatus1 (+0E) Read*/ -#define SCSI_FIFO_MASK (BIT7+BIT6+BIT5+BIT4) - -/*; SCSIStatus2 (+0F) Read*/ -#define SIDL_MSB_FULL BIT7 -#define SODR_MSB_FULL BIT6 -#define SODL_MSB_FULL BIT5 -#define SCSI_FIFO_MSB BIT4 - -/*; DataStrucAddr (+10)*/ - -/*; InterruptStatus (+14)*/ -#define ABORT_OP BIT7 -#define SOFTWARE_RST BIT6 -#define SIGNAL_PROC BIT5 -#define SEMAPHORE BIT4 -#define CONNECTED BIT3 -#define INT_ON_FLY BIT2 -#define SCSI_INT_PENDING BIT1 -#define DMA_INT_PENDING BIT0 - -/*; ChipTest0 (+18)*/ -/*; ChipTest1 (+19)*/ -#define FIFO_BYTE_EMPTY (BIT7+BIT6+BIT5+BIT4) -#define FIFO_BYTE_FULL (BIT3+BIT2+BIT1+BIT0) - -/*; ChipTest2 (+1A)*/ -#define READ_DIR BIT7 -#define WRITE_DIR 0 -#define SIGNAL_PROC_ BIT6 -#define CFG_AS_IO_MAP BIT5 -#define CFG_AS_MEM_MAP BIT4 -#define SCRATCHAB_AS_BASE BIT3 -#define TRUE_EOP BIT2 -#define INTERNAL_DREQ BIT1 -#define INTERNAL_DACK BIT0 - -/*; ChipTest3 (+1B)*/ -#define CHIP_REV_MASK (BIT7+BIT6+BIT5+BIT4) -#define FLUSH_DMA_FIFO BIT3 -#define CLR_DMA_FIFO BIT2 -#define FETCH_PIN_MODE BIT1 -#define WRT_EN_INVALIDATE BIT0 - -/*; TempStack (+1C)*/ - -/*; DMAFIFO (+20)*/ -/*; 2 upper bits in ChipTest5*/ - -/*; ChipTest4 (+21)*/ -#define BURST_DISABLE BIT7 - -/*; ChipTest5 (+22) */ -#define EN_DMA_FIFO_536 BIT5 -#define BURST_LEN_MSB BIT2 -#define DMAFIFO_MS2B (BIT1+BIT0) -/* -; ChipTest6 (+23) -; DMAByteCnt (+24) -; DMACommand (+27) -; DMANextAddr (+28) -; DMAScriptsPtr (+2C) -; DMAScriptPtrSav (+30) -*/ -/*; ScratchA (+34)*/ -#define COMPLETED_OK_ BIT0 -#define RE_SELECTED_ BIT1 -#define OVER_RUN_ BIT2 - -/*; DMAMode (+38)*/ -#define BURST_LEN16 (BIT7+BIT6) -#define BURST_LEN8 BIT7 -#define BURST_LEN4 BIT6 -#define BURST_LEN2 0 -#define SRC_IO_MAP BIT5 -#define SRC_MEM_MAP 0 -#define DEST_IO_MAP BIT4 -#define DEST_MEM_MAP 0 -#define EN_READ_LINE BIT3 -#define EN_READ_MULTIPLE BIT2 -#define BURST_OPCODE_FETCH BIT1 -#define MANUAL_START BIT0 -#define AUTO_START 0 - -/*; DMAIntEnable (+39)*/ -#define EN_MDPE BIT6 -#define EN_BUS_FAULT BIT5 -#define EN_ABORTED BIT4 -#define EN_SINGLE_STEP BIT3 -#define EN_SCRIPT_INT BIT2 -#define EN_ILLEGAL_INST BIT0 - - -/*; DMAWatchDog (+3A)*/ - -/*; DMACtrl (+3B)*/ -#define EN_CACHE_LINE_SIZE BIT7 -#define PRE_FETCH_FLUSH BIT6 -#define EN_PRE_FETCH BIT5 -#define SINGLE_STEP_MIDE BIT4 -#define TOTEM_POLE_IRQ BIT3 -#define OPEN_DRAIN_IRQ 0 -#define START_DMA BIT2 -#define IRQ_DISABLE BIT1 -#define COMPATIBLE_700 BIT0 - -/*; ADDer (+3C)*/ - -/*; SCSIIntEnable0 (+40)*/ -#define EN_PHASE_MISMATCH BIT7 -#define EN_ARB_SEL_DONE BIT6 -#define EN_BE_SELECTED BIT5 -#define EN_BE_RESELECTED BIT4 -#define EN_SCSI_GERROR BIT3 -#define EN_UNEXPECT_DISC BIT2 -#define EN_SCSI_RESET BIT1 -#define EN_PARITY_ERROR BIT0 - -/*; SCSIIntEnable1 (+41)*/ -#define EN_SEL_TIMEOUT BIT2 -#define EN_GENERAL_TIMEOUT BIT1 -#define EN_HANDSHAKE_TIMEOUT BIT0 - -/*; SCSIIntStatus0 (+42)*/ -#define PHASE_MISMATCH BIT7 -#define ARB_SEL_DONE BIT6 -#define BE_SELECTED BIT5 -#define BE_RESELECTED BIT4 -#define SCSI_GERROR BIT3 -#define UNEXPECT_DISC BIT2 -#define SCSI_RESET BIT1 -#define PARITY_ERROR BIT0 - -/*; SCSIIntStatus1 (+43)*/ -#define SEL_TIMEOUT BIT2 -#define GENERAL_TIMEOUT BIT1 -#define HANDSHAKE_TIMEOUT BIT0 -/* -; SCSILongParity (+44) -; WideResiData (+45) -; MemAccessCtrl (+46) -; GeneralPCtrl (+47) -*/ -/*; SCSITimer0 (+48)*/ -#define HTH_TO_DISABLE 0 -#define SEL_TO_204ms (BIT3+BIT2) -/* -; SCSITimer1 (+49) -; ResponseID0 (+4A) -; ResponseID1 (+4B) -; SCSITest0 (+4C) -; SCSITest1 (+4D) -; SCSITest2 (+4E) -*/ -/*; SCSITest3 (+4F)*/ -#define ACTIVE_NEGATION_ BIT7 -#define FIFO_TEST_READ BIT6 -#define HALT_SCSI_CLK BIT5 -#define DIS_SINGLE_INIT BIT4 -#define TIMER_TEST_MODE BIT2 -#define CLR_SCSI_FIFO BIT1 -#define FIFO_TEST_WRITE BIT0 -/* -; SCSIIPDataL (+50) -; SCSIOPDataL (+54) -; SCSIBusDataLin (+58) -; ScratchB (+5C) -; ScratchC (+60) -; ScratchD (+64) -; ScratchE (+68) -; ScratchF (+6C) -; ScratchG (+70) -; ScratchH (+74) -; ScratchI (+78) -; ScratchJ (+7C) -*/ - -/*********************************************************************** - * NCR53C825 I/O Address Map - * base address is stored at offset 0x10 in the PCI configuration space - *----------------------------------------------------------------------- - * SCSI Core Registers Offset - ***********************************************************************/ -#define SCNTL0 0x00 /* Scsi Control 0 R/W */ -#define SCNTL1 0x01 /* Scsi Control 1 R/W */ -#define SCNTL2 0x02 /* Scsi Control 2 R/W */ -#define SCNTL3 0x03 /* Scsi Control 3 R/W */ -#define SCID 0x04 /* Scsi Chip ID R/W */ -#define SXFER 0x05 /* Scsi Transfer R/W */ -#define SDID 0x06 /* Scsi Destination ID R/W */ -#define GPREG 0x07 /* General Purpose Bits R/W */ -#define SFBR 0x08 /* Scsi First Byte Received R/W */ -#define SOCL 0x09 /* Scsi Output Control Latch R/W */ -#define SSID 0x0A /* Scsi Selector ID R */ -#define SBCL 0x0B /* Scsi Bus Control Lines R/W */ -#define DSTAT 0x0C /* DMA Status R */ -#define SSTAT0 0x0D /* Scsi Status 0 R */ -#define SSTAT1 0x0E /* Scsi Status 1 R */ -#define SSTAT2 0x0F /* Scsi Status 2 R */ -#define DSA 0x10 /* Data Structure Address R/W */ -#define ISTAT 0x14 /* Interrupt Status R/W */ -#define RES15 0x15 /* Reserved */ -#define CTEST0 0x18 /* Reserved */ -#define CTEST1 0x19 /* Chip Test 1 R/W */ -#define CTEST2 0x1A /* Chip Test 2 R */ -#define CTEST3 0x1B /* Chip Test 3 R */ -#define TEMP 0x1C /* Temperary Stack R/W */ -#define DFIFO 0x20 /* DMA FIFO R/W */ -#define CTEST4 0x21 /* Chip Test 4 R/W */ -#define CTEST5 0x22 /* Chip Test 5 R/W */ -#define CTEST6 0x23 /* Chip Test 6 R/W */ -#define DBC 0x24 /* DMA Byte Counter R/W */ -#define DCMD 0x27 /* DMA Command R/W */ -#define DNAD 0x28 /* DMA Next Address For Data R/W */ -#define DSP 0x2C /* DMA SCIPTS Pointer R/W */ -#define DSPS 0x30 /* DMA SCIPTS Pointer Saves R/W */ -#define SCRATCHA 0x34 /* General Purpose Scratch Pad A R/W */ -#define DMODE 0x38 /* DMA Mode R/W */ -#define DIEN 0x39 /* DMA Interrupt Enable R/W */ -#define DWT 0x3A /* DMA Watchdog Timer R/W */ -#define DCNTL 0x3B /* DMA Control R/W */ -#define ADDER 0x3C /* Sum output of Internal adder R */ -#define SIEN0 0x40 /* Scsi Interrupt Enable 0 R/W */ -#define SIEN1 0x41 /* Scsi Interrupt Enable 1 R/W */ -#define SIST0 0x42 /* Scsi Interrupt Status 0 R */ -#define SIST1 0x43 /* Scsi Interrupt Status 1 R */ -#define SLPAR 0x44 /* Scsi Longitudinal Parity R/W */ -#define SWIDE 0x45 /* Reserved */ -#define MACNTL 0x46 /* Memory Access Control R/W */ -#define GPCNTL 0x47 /* General Purpose Control R/W */ -#define STIME0 0x48 /* Scsi Timer 0 R/W */ -#define STIME1 0x49 /* Scsi Timer 1 R/W */ -#define RESPID0 0x4A /* Response ID 0 R/W */ -#define RESPID1 0x4B /* Response ID 1 R/W */ -#define STEST0 0x4C /* Scsi Test 0 R */ -#define STEST1 0x4D /* Scsi Test 1 R */ -#define STEST2 0x4E /* Scsi Test 2 R/W */ -#define STEST3 0x4F /* Scsi Test 3 R/W */ -#define SIDL 0x50 /* Scsi Input Data Latch R */ -#define RES51 0x51 /* Reserved */ -#define SODL 0x54 /* Scsi Output Data Latch R/W */ -#define RES55 0x55 /* Reserved */ -#define SBDL 0x58 /* Scsi Bus Data Lines R */ -#define RES59 0x59 /* Reserved */ -#define SCRATCHB 0x5C /* General Purpose Scratch Pad B R/W */ - - -/* -;========================================================== -; structure for 53C825A register ( I/O ) -;========================================================== -*/ -#define __scntl0 0 -#define __scntl1 1 -#define __scntl2 2 -#define __scntl3 3 -#define __scid 4 -#define __sxfer 5 -#define __sdid 6 -#define __gpreg 7 -#define __sfbr 8 -#define __socl 9 -#define __ssid 0x0A -#define __sbcl 0x0B -#define __dstat 0x0C -#define __sstat0 0x0D -#define __sstat1 0x0E -#define __sstat2 0x0F -#define __dsa 0x10 -#define __istat 0x14 -/*#define 0x15*/ -#define __ctest0 0x18 -#define __ctest1 0x19 -#define __ctest2 0x1A -#define __ctest3 0x1B -#define __temp 0x1C -#define __dfifo 0x20 -#define __ctest4 0x21 -#define __ctest5 0x22 -#define __ctest6 0x23 -#define __dbc 0x24 -#define __dcmd 0x27 -#define __dnad 0x28 -#define __dsp 0x2C -#define __dsps 0x30 -#define __scratcha 0x34 -#define __dmode 0x38 -#define __dien 0x39 -#define __dwt 0x3A -#define __dcntl 0x3B -#define __adder 0x3C -#define __sien0 0x40 -#define __sien1 0x41 -#define __sist0 0x42 -#define __sist1 0x43 -#define __slpar 0x44 -#define __swide 0x45 -#define __mactrl 0x46 -#define __gpctrl 0x47 -#define __stime0 0x48 -#define __stime1 0x49 -#define __respid0 0x4A -#define __respid1 0x4B -#define __stest0 0x4C -#define __stest1 0x4D -#define __stest2 0x4E -#define __stest3 0x4F -#define __sidl 0x50 /*; For wide SCSI, this register*/ -/*#define 0x51 ; contains 2 bytes*/ -#define __sodl 0x54 -/*#define 0x55*/ -#define __sbdl 0x58 -/*#define 0x59*/ -#define __scratchb 0x5C -/* -;========================================================== -; Script interrupt code(Vector) -;========================================================== -*/ -#define __COMPLETE 0 /*; command complete*/ -#define __RESELECTED 1 /*; reselected, without MESSAGE*/ -#define __RESELECTED1 2 /*; reselected with idenntify bytes*/ -#define __RESELECTEDT 3 /*; reselected with TAGS*/ -#define __DISCONNECTED 4 /*; disconnected*/ -#define __MSGEXTEND 5 /*; Extended msgin*/ -#define __SIGNAL 6 /*; signaled, need to clear SIG*/ -#define __MSGUNKNOWN 7 /*; Unknown message*/ -#define __MSGOUT 8 /*; Message out phase detected*/ -#define __FATALERROR 9 /*; Fatal error*/ -#define __MSGSYNC 10 /*; Sync nego input*/ -#define __MSGWIDE 11 /*; Wide nego input*/ -#define __RESTOREPTR 12 /*; restore pointer received*/ -#define __MSGREJECT 13 /*; Reject message received*/ -#define __DEBUG 14 /*; For debug*/ - - -#define DC390W_read8(address) \ - inb(DC390W_ioport + (address))) - -#define DC390W_read16(address) \ - inw(DC390W_ioport + (address))) - -#define DC390W_read32(address) \ - inl(DC390W_ioport + (address))) - -#define DC390W_write8(address,value) \ - outb((value), DC390W_ioport + (address))) - -#define DC390W_write16(address,value) \ - outw((value), DC390W_ioport + (address))) - -#define DC390W_write32(address,value) \ - outl((value), DC390W_ioport + (address))) - -#endif /* TMSCSIW_H */ |