Index: Makefile =================================================================== RCS file: Makefile diff -N Makefile --- /dev/null Sun Oct 3 02:13:27 1999 +++ /tmp/cvsQXl5BD Wed May 24 16:58:04 2000 @@ -0,0 +1,30 @@ +# Makefile for the dc395x_trm (TRM-S1040 chip on Tekram DC3x5) driver +# (w) 5/2000, garloff@suse.de + +KDIR := /usr/src/linux + +TARGETS := Rules.make arch dc395x_trm.o +.PHONY: dc395x_trm.o + +default: $(TARGETS) + + +Rules.make: $(KDIR)/Rules.make + cp -pf $(KDIR)/Rules.make . + +arch: $(KDIR)/arch + rm -f arch + ln -s $(KDIR)/arch . + +clean: + rm -f $(TARGETS) + +dc395x_trm.o: + $(MAKE) -f Makefile.dc395 KDIR=$(KDIR) + +install: + $(MAKE) -f Makefile.dc395 KDIR=$(KDIR) install_mod + +load: + $(MAKE) -f Makefile.dc395 KDIR=$(KDIR) load_module + Index: Makefile.dc395 =================================================================== RCS file: Makefile.dc395 diff -N Makefile.dc395 --- /dev/null Sun Oct 3 02:13:27 1999 +++ /tmp/cvsOOauW6 Wed May 24 16:58:04 2000 @@ -0,0 +1,47 @@ +# Makefile for dc395x_trm to be called by master Makefile that +# does the preparation work (setting up links, copying Rules.make ...) +# (w) 5/2000 garloff@suse.de + +TARGET = dc395x_trm.o +TARGETMODDIR = scsi + +default: $(TARGET) + +TOPDIR := $(KDIR) +include $(KDIR)/.config +include $(KDIR)/Makefile +TOPDIR := $(KDIR) + +CFLAGS := -I. -I $(KDIR)/drivers/scsi $(CFLAGS) -DMODULE + +dc395x_trm.o: dc395x_trm.c dc395x_trm.h arch Rules.make + +MODLIB := $(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) + +install_mod: $(MODLIB)/$(TARGETMODDIR)/dc395x_trm.o + +$(MODLIB)/$(TARGETMODDIR)/dc395x_trm.o: dc395x_trm.o + @if test $(shell id -u) = 0; then \ + echo "Install dc395x_trm"; install -o root -g root -d $(MODLIB)/$(TARGETMODDIR); \ + install -o root -g root -m 0644 dc395x_trm.o $(MODLIB)/$(TARGETMODDIR)/; \ + echo "depmod -a $(KERNELRELEASE)"; depmod -a $(KERNELRELEASE); \ + else \ + echo "Give root password for installation of kernel module"; \ + su -c \ + 'echo "Install dc395x_trm"; install -o root -g root -d $(MODLIB)/$(TARGETMODDIR); \ + install -o root -g root -m 0644 dc395x_trm.o $(MODLIB)/$(TARGETMODDIR)/; \ + echo "depmod -a $(KERNELRELEASE)"; depmod -a $(KERNELRELEASE)'; \ + fi + +load_module: install_mod + @if test $(shell id -u) = 0; then \ + if test ! -z "$(shell lsmod | grep dc395x_trm)"; then echo "Remove dc395x_trm"; \ + rmmod dc395x_trm; fi; \ + echo "Load dc395x_trm"; modprobe dc395x_trm; \ + else \ + echo "Give root password for loading of kernel module"; \ + su -c \ + 'if test ! -z "$(shell lsmod | grep dc395x_trm)"; then echo "Remove dc395x_trm"; \ + rmmod dc395x_trm; fi; \ + echo "Load dc395x_trm"; modprobe dc395x_trm'; \ + fi Index: README.dc395x =================================================================== RCS file: /home/cvsroot/dc395/README.dc395x,v retrieving revision 1.7 retrieving revision 1.9 diff -u -r1.7 -r1.9 --- README.dc395x 2000/02/19 15:27:19 1.7 +++ README.dc395x 2000/05/24 14:56:57 1.9 @@ -2,7 +2,7 @@ ========================================== Preliminary. 2000-02-14 Kurt Garloff -$Id: README.dc395x,v 1.7 2000/02/19 15:27:19 garloff Exp $ +$Id: README.dc395x,v 1.9 2000/05/24 14:56:57 garloff Exp $ This driver is similar to the DC390/AM53c974 driver (tmscsim), so you might want to have a look into the README.tmscsim. @@ -15,6 +15,7 @@ the same than the ones from the tmscsim driver, except, that the SpdIdx is now interpreted as 20Mhz, 13.3MHz, 10MHz, 8MHz, 6.7MHz, 5.8Mhz, 5Mhz, 4Mhz and that the bit5 (0x20) was added to the DevMode meaning Wide negotiation. +The name for the driver is dc395x_trm. Status ------ @@ -124,7 +125,7 @@ important data, which you don't have a backup of! YOU RISK DATA LOSS! OK, you want to use it anyway? -Start with read-only access of your data. catting od dding it to /dev/null +Start with read-only access of your data. catting or dding it to /dev/null is a good start. Proceed with read-only filesystem checks (e2fsck -nfF). Produce concurrent load on your SCSI bus. Still no trouble? What does the badblocks program say? (Take care: With -w it will overwrite your data!) @@ -145,8 +146,8 @@ If your driver crashes badly, log via network or a serial console. (The latter is what I do during driver development.) -If you can provide me with exact observations and logs, I would be very -pleased! +If you can provide me with exact observations and logs of failures, I would +be very pleased! Installation @@ -155,6 +156,7 @@ have to do some handwork to install the driver. IF YOU NEVER COMPILED A KERNEL YOURSELF BEFORE, YOU SHOULD NOW BETTER GO AND READ SOME DOCUMENTATION ABOUT IT. YOU ARE LIKELY TO SCREW YOURSELF, OTHERWISE. +FIRST COMPILE A KERNEL WITHOUT THIS DRIVER AND GET IT TO WORK. Maybe you Linux distributor will be nice enough to include the driver in its distribution, so you don't have to do it yourself. @@ -169,10 +171,20 @@ dc395-integ23.diff. (Replace XX by 20, 22, or 23) > cd /usr/src/ > patch -p0 -d /usr/src cd /usr/src/linux > make oldconfig (enable CONFIG_SCSI_DC395x_TRMS1040) @@ -181,6 +193,9 @@ > make modules_install > depmod -ae +NEW: You may be able to skip compilation of the kernel by just using the +Makefile. + I will provide a complete patch which makes kernel integration easier and will ask to apply it to the main tree, as soon as I got enough reports about the stability of the driver. @@ -206,5 +221,14 @@ http://www.garloff.de/kurt/linux/dc395/ ftp://ftp.suse.com/pub/people/garloff/linux/dc395/ (and mirrors, of course) -Announcements will be sent to the linux-scsi list. +Announcements will be sent to the linux-scsi@vger.rutgers.edu list. + +Acknowledgements +---------------- +I'd like to thank SuSE GmbH, Nuremberg, to allow me working on this driver +during my working hours for them. +Thanks to all the people that took the risk to install the driver in its +alpha stage and sent detailed bug reports to me, sometimes. Without them, +the driver would now not approach stability. They are the reason why free +software rules. Index: dc395-integ20.diff =================================================================== RCS file: /home/cvsroot/dc395/dc395-integ20.diff,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- dc395-integ20.diff 2000/02/14 11:08:32 1.4 +++ dc395-integ20.diff 2000/02/28 12:24:49 1.5 @@ -1,6 +1,48 @@ ---- linux/drivers/scsi/Config.in.ORIG Mon Jul 12 17:08:37 1999 -+++ linux/drivers/scsi/Config.in Mon Jul 12 17:11:42 1999 -@@ -88,6 +88,9 @@ +diff -uNr linux.orig/Documentation/Configure.help linux/Documentation/Configure.help +--- linux.orig/Documentation/Configure.help Sun Jun 13 19:20:59 1999 ++++ linux/Documentation/Configure.help Mon Feb 28 13:06:01 2000 +@@ -2223,6 +2223,19 @@ + and removed from the running kernel whenever you want), say M here + and read Documentation/modules.txt. + ++Tekram DC395/U/UW and DC315/U SCSI support ++CONFIG_SCSI_DC395x_TRMS1040 ++ This driver supports the PCI SCSI host adapters baseds on Tekram's ++ ASIC TRM-S1040 chip, i.e. Tekram DC315 and DC395 variants. ++ This driver does work, but please note that it is still alpha status, ++ so better have a bootable disk and a backup in case of emergency. ++ Please read the file drivers/scsi/README.dc395x. ++ ++ If you want to compile this driver as a module ( = code which can be ++ inserted in and removed from the running kernel whenever you want), ++ say M here and read Documentation/modules.txt. The module will be ++ called dc395x_trm.o. ++ + Tekram DC390(T) and Am53/79C974 (PCscsi) SCSI support + CONFIG_SCSI_DC390T + This driver supports PCI SCSI host adapters based on the Am53C974A +diff -uNr linux.orig/MAINTAINERS linux/MAINTAINERS +--- linux.orig/MAINTAINERS Sun Jun 13 19:20:59 1999 ++++ linux/MAINTAINERS Mon Feb 28 13:05:21 2000 +@@ -170,10 +170,12 @@ + W: http://www.cyclades.com/ + S: Supported + +-DC390/AM53C974 SCSI driver ++DC390/AM53C974 and DC395/TRM-S1040 SCSI drivers + P: Kurt Garloff ++M: garloff@suse.de + M: kurt@garloff.de +-W: http://www.garloff.de/kurt/linux/dc390/ ++W: http://www.garloff.de/kurt/linux/ ++L: linux-scsi@vger.rutgers.edu + S: Maintained + + DAC960 RAID DRIVER +diff -uNr linux.orig/drivers/scsi/Config.in linux/drivers/scsi/Config.in +--- linux.orig/drivers/scsi/Config.in Sun Jun 13 19:21:02 1999 ++++ linux/drivers/scsi/Config.in Mon Feb 28 13:03:21 2000 +@@ -93,6 +93,9 @@ fi dep_tristate 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE $CONFIG_SCSI if [ "$CONFIG_PCI" = "y" ]; then @@ -10,9 +52,10 @@ dep_tristate 'Tekram DC390(T) and Am53/79C974 SCSI support' CONFIG_SCSI_DC390T $CONFIG_SCSI if [ "$CONFIG_SCSI_DC390T" != "n" ]; then bool ' _omit_ support for non-DC390 adapters' CONFIG_SCSI_DC390T_NOGENSUPP ---- linux/drivers/scsi/Makefile.ORIG Mon Jul 12 17:08:37 1999 -+++ linux/drivers/scsi/Makefile Mon Jul 12 17:17:08 1999 -@@ -178,6 +178,14 @@ +diff -uNr linux.orig/drivers/scsi/Makefile linux/drivers/scsi/Makefile +--- linux.orig/drivers/scsi/Makefile Sun Jun 13 19:21:02 1999 ++++ linux/drivers/scsi/Makefile Mon Feb 28 13:03:21 2000 +@@ -195,6 +195,14 @@ endif endif @@ -27,7 +70,7 @@ ifeq ($(CONFIG_SCSI_DC390T),y) L_OBJS += tmscsim.o else -@@ -388,6 +396,9 @@ +@@ -453,6 +461,9 @@ seagate.o: seagate.c $(CC) $(CFLAGS) -DARBITRATE -DSLOW_HANDSHAKE -DFAST32 -c seagate.c @@ -37,10 +80,11 @@ tmscsim.o : tmscsim.c $(CC) $(CFLAGS) -c tmscsim.c ---- linux/drivers/scsi/hosts.c.ORIG Mon Jul 12 17:08:37 1999 -+++ linux/drivers/scsi/hosts.c Mon Jul 12 17:11:42 1999 -@@ -153,6 +153,10 @@ - #include "NCR53c406a.h" +diff -uNr linux.orig/drivers/scsi/hosts.c linux/drivers/scsi/hosts.c +--- linux.orig/drivers/scsi/hosts.c Sun Jun 13 19:21:02 1999 ++++ linux/drivers/scsi/hosts.c Mon Feb 28 13:03:21 2000 +@@ -157,6 +157,10 @@ + #include "sym53c416.h" #endif +#ifdef CONFIG_SCSI_DC395x_TRMS1040 @@ -50,7 +94,7 @@ #ifdef CONFIG_SCSI_DC390T #include "dc390.h" #endif -@@ -312,6 +316,9 @@ +@@ -347,6 +351,9 @@ #endif #ifdef CONFIG_SCSI_EATA EATA, @@ -60,8 +104,9 @@ #endif #ifdef CONFIG_SCSI_AM53C974 AM53C974, ---- linux/include/linux/proc_fs.h.ORIG Mon Jul 12 17:08:37 1999 -+++ linux/include/linux/proc_fs.h Mon Jul 12 17:12:58 1999 +diff -uNr linux.orig/include/linux/proc_fs.h linux/include/linux/proc_fs.h +--- linux.orig/include/linux/proc_fs.h Mon Feb 28 11:46:26 2000 ++++ linux/include/linux/proc_fs.h Mon Feb 28 13:03:22 2000 @@ -133,6 +133,7 @@ PROC_SCSI_SEAGATE, PROC_SCSI_T128, @@ -70,57 +115,21 @@ PROC_SCSI_NCR53C7xx, PROC_SCSI_NCR53C8XX, PROC_SCSI_ULTRASTOR, ---- linux/Documentation/Configure.help.ORIG Mon Jul 12 17:08:37 1999 -+++ linux/Documentation/Configure.help Mon Jul 12 17:11:42 1999 -@@ -2055,6 +2055,18 @@ - and removed from the running kernel whenever you want), say M here - and read Documentation/modules.txt. - -+Tekram DC395/U/UW and DC315/U SCSI support -+CONFIG_SCSI_DC395x_TRMS1040 -+ This driver supports the PCI SCSI host adapters baseds on Tekramīs -+ ASIC TRM-S1040 chip, i.e. Tekram DC315 and DC395 variants. -+ This driver does work, but please note that it is still alpha status, -+ so better have a bootable disk and a backup in case of emergency. -+ -+ If you want to compile this driver as a module ( = code which can be -+ inserted in and removed from the running kernel whenever you want), -+ say M here and read Documentation/modules.txt. The module will be -+ called dc395x_trm.o. -+ - Tekram DC390(T) and Am53/79C974 (PCscsi) SCSI support - CONFIG_SCSI_DC390T - This driver supports PCI SCSI host adapters based on the Am53C974A ---- linux/MAINTAINERS.ORIG Mon Jul 12 17:08:37 1999 -+++ linux/MAINTAINERS Mon Jul 12 17:11:42 1999 -@@ -170,10 +170,11 @@ - W: http://www.cyclades.com/ - S: Supported - --DC390/AM53C974 SCSI driver -+DC390/AM53C974 and DC395/TRM-S1040 SCSI drivers - P: Kurt Garloff -+M: garloff@suse.de - M: kurt@garloff.de --W: http://www.garloff.de/kurt/linux/dc390/ -+W: http://www.garloff.de/kurt/linux/ - S: Maintained - - EATA ISA/EISA/PCI SCSI DRIVER ---- linux/init/main.c.nodc395 Mon Dec 13 01:29:36 1999 -+++ linux/init/main.c Mon Feb 14 11:12:23 2000 -@@ -200,6 +200,7 @@ +diff -uNr linux.orig/init/main.c linux/init/main.c +--- linux.orig/init/main.c Sun Jun 13 19:21:04 1999 ++++ linux/init/main.c Mon Feb 28 13:04:45 2000 +@@ -109,6 +109,7 @@ extern void sym53c416_setup(char *str, int *ints); extern void wd7000_setup(char *str, int *ints); extern void dc390_setup(char* str, int *ints); +extern void DC395x_trm_setup(char* str, int *ints); + extern void ppa_setup(char *str, int *ints); extern void scsi_luns_setup(char *str, int *ints); - extern void scsi_logging_setup(char *str, int *ints); extern void sound_setup(char *str, int *ints); -@@ -765,6 +766,9 @@ +@@ -399,6 +400,9 @@ #endif #if defined(CONFIG_SCSI_DC390T) && ! defined(CONFIG_SCSI_DC390T_NOGENSUPP) - { "tmscsim=", dc390_setup }, + { "tmscsim=", dc390_setup }, +#endif +#if defined(CONFIG_SCSI_DC395x_TRMS1040) + { "dc395x_trm=", DC395x_trm_setup }, Index: dc395-integ22.diff =================================================================== RCS file: /home/cvsroot/dc395/dc395-integ22.diff,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- dc395-integ22.diff 2000/02/14 11:08:32 1.1 +++ dc395-integ22.diff 2000/02/28 12:24:49 1.2 @@ -1,6 +1,48 @@ ---- linux/drivers/scsi/Config.in.ORIG Wed Jun 16 23:32:33 1999 -+++ linux/drivers/scsi/Config.in Mon Jun 28 21:55:47 1999 -@@ -126,6 +126,9 @@ +diff -uNr linux.orig/Documentation/Configure.help linux/Documentation/Configure.help +--- linux.orig/Documentation/Configure.help Mon Feb 28 12:52:13 2000 ++++ linux/Documentation/Configure.help Mon Feb 28 12:44:44 2000 +@@ -4571,6 +4571,19 @@ + read Documentation/modules.txt. The module will be called + sym53c416.o. + ++Tekram DC395/U/UW and DC315/U SCSI support ++CONFIG_SCSI_DC395x_TRMS1040 ++ This driver supports the PCI SCSI host adapters baseds on Tekram's ++ ASIC TRM-S1040 chip, i.e. Tekram DC315 and DC395 variants. ++ This driver does work, but please note that it is still beta status, ++ so better have a bootable disk and a backup in case of emergency. ++ Please read the file drivers/scsi/README.dc395x. ++ ++ If you want to compile this driver as a module ( = code which can be ++ inserted in and removed from the running kernel whenever you want), ++ say M here and read Documentation/modules.txt. The module will be ++ called dc395x_trm.o. ++ + Tekram DC390(T) and Am53/79C974 (PCscsi) SCSI support + CONFIG_SCSI_DC390T + This driver supports PCI SCSI host adapters based on the Am53C974A +diff -uNr linux.orig/MAINTAINERS linux/MAINTAINERS +--- linux.orig/MAINTAINERS Mon Feb 28 12:52:13 2000 ++++ linux/MAINTAINERS Mon Feb 28 12:43:24 2000 +@@ -222,10 +222,12 @@ + L: linux-hams@vger.rutgers.edu + S: Maintained + +-DC390/AM53C974 SCSI driver ++DC390/AM53C974 and DC395/TRM-S1040 SCSI drivers + P: Kurt Garloff ++M: garloff@suse.de + M: kurt@garloff.de +-W: http://www.garloff.de/kurt/linux/dc390/ ++W: http://www.garloff.de/kurt/linux/ ++L: linux-scsi@vger.rutgers.edu + S: Maintained + + DECnet NETWORK LAYER +diff -uNr linux.orig/drivers/scsi/Config.in linux/drivers/scsi/Config.in +--- linux.orig/drivers/scsi/Config.in Mon Feb 28 12:52:38 2000 ++++ linux/drivers/scsi/Config.in Mon Feb 28 12:42:43 2000 +@@ -125,6 +125,9 @@ fi dep_tristate 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE $CONFIG_SCSI if [ "$CONFIG_PCI" = "y" ]; then @@ -10,9 +52,10 @@ dep_tristate 'Tekram DC390(T) and Am53/79C974 SCSI support' CONFIG_SCSI_DC390T $CONFIG_SCSI if [ "$CONFIG_SCSI_DC390T" != "n" ]; then bool ' _omit_ support for non-DC390 adapters' CONFIG_SCSI_DC390T_NOGENSUPP ---- linux/drivers/scsi/Makefile.ORIG Wed Jun 16 23:32:19 1999 -+++ linux/drivers/scsi/Makefile Mon Jun 28 21:53:11 1999 -@@ -346,6 +346,14 @@ +diff -uNr linux.orig/drivers/scsi/Makefile linux/drivers/scsi/Makefile +--- linux.orig/drivers/scsi/Makefile Mon Feb 28 12:52:38 2000 ++++ linux/drivers/scsi/Makefile Mon Feb 28 12:42:43 2000 +@@ -362,6 +362,14 @@ endif endif @@ -27,9 +70,10 @@ ifeq ($(CONFIG_SCSI_DC390T),y) L_OBJS += tmscsim.o else ---- linux/drivers/scsi/hosts.c.ORIG Wed Jun 16 23:46:03 1999 -+++ linux/drivers/scsi/hosts.c Mon Jun 28 21:58:44 1999 -@@ -231,6 +231,10 @@ +diff -uNr linux.orig/drivers/scsi/hosts.c linux/drivers/scsi/hosts.c +--- linux.orig/drivers/scsi/hosts.c Mon Feb 28 12:52:38 2000 ++++ linux/drivers/scsi/hosts.c Mon Feb 28 12:42:44 2000 +@@ -239,6 +239,10 @@ #include "sym53c416.h" #endif @@ -40,7 +84,7 @@ #ifdef CONFIG_SCSI_DC390T #include "dc390.h" #endif -@@ -529,6 +533,9 @@ +@@ -547,6 +551,9 @@ #endif #ifdef CONFIG_SCSI_EATA EATA, @@ -50,9 +94,10 @@ #endif #ifdef CONFIG_SCSI_DC390T DC390_T, ---- linux/include/linux/proc_fs.h.ORIG Mon Jun 28 18:38:28 1999 -+++ linux/include/linux/proc_fs.h Mon Jun 28 22:03:51 1999 -@@ -183,6 +183,7 @@ +diff -uNr linux.orig/include/linux/proc_fs.h linux/include/linux/proc_fs.h +--- linux.orig/include/linux/proc_fs.h Mon Feb 28 12:52:38 2000 ++++ linux/include/linux/proc_fs.h Mon Feb 28 12:42:44 2000 +@@ -181,6 +181,7 @@ PROC_SCSI_IBMMCA, PROC_SCSI_FD_MCS, PROC_SCSI_EATA2X, @@ -60,46 +105,10 @@ PROC_SCSI_DC390T, PROC_SCSI_AM53C974, PROC_SCSI_SSC, ---- linux/Documentation/Configure.help.ORIG Mon Jun 28 18:11:35 1999 -+++ linux/Documentation/Configure.help Mon Jun 28 22:10:44 1999 -@@ -4673,6 +4673,18 @@ - read Documentation/modules.txt. The module will be called - sym53c416.o. - -+Tekram DC395/U/UW and DC315/U SCSI support -+CONFIG_SCSI_DC395x_TRMS1040 -+ This driver supports the PCI SCSI host adapters baseds on Tekramīs -+ ASIC TRM-S1040 chip, i.e. Tekram DC315 and DC395 variants. -+ This driver does work, but please note that it is still alpha status, -+ so better have a bootable disk and a backup in case of emergency. -+ -+ If you want to compile this driver as a module ( = code which can be -+ inserted in and removed from the running kernel whenever you want), -+ say M here and read Documentation/modules.txt. The module will be -+ called dc395x_trm.o. -+ - Tekram DC390(T) and Am53/79C974 (PCscsi) SCSI support - CONFIG_SCSI_DC390T - This driver supports PCI SCSI host adapters based on the Am53C974A ---- linux/MAINTAINERS.ORIG Sun Jul 4 23:11:46 1999 -+++ linux/MAINTAINERS Mon Jul 12 17:00:23 1999 -@@ -212,10 +212,11 @@ - L: linux-hams@vger.rutgers.edu - S: Maintained - --DC390/AM53C974 SCSI driver -+DC390/AM53C974 and DC395/TRM-S1040 SCSI drivers - P: Kurt Garloff -+M: garloff@suse.de - M: kurt@garloff.de --W: http://www.garloff.de/kurt/linux/dc390/ -+W: http://www.garloff.de/kurt/linux/ - S: Maintained - - DECnet NETWORK LAYER ---- linux/init/main.c.nodc395 Mon Dec 13 01:29:36 1999 -+++ linux/init/main.c Mon Feb 14 11:12:23 2000 -@@ -200,6 +200,7 @@ +diff -uNr linux.orig/init/main.c linux/init/main.c +--- linux.orig/init/main.c Mon Feb 28 12:52:41 2000 ++++ linux/init/main.c Mon Feb 28 12:42:44 2000 +@@ -195,6 +195,7 @@ extern void sym53c416_setup(char *str, int *ints); extern void wd7000_setup(char *str, int *ints); extern void dc390_setup(char* str, int *ints); @@ -107,7 +116,7 @@ extern void scsi_luns_setup(char *str, int *ints); extern void scsi_logging_setup(char *str, int *ints); extern void sound_setup(char *str, int *ints); -@@ -765,6 +766,9 @@ +@@ -748,6 +749,9 @@ #endif #if defined(CONFIG_SCSI_DC390T) && ! defined(CONFIG_SCSI_DC390T_NOGENSUPP) { "tmscsim=", dc390_setup }, Index: dc395-integ23.diff =================================================================== RCS file: /home/cvsroot/dc395/dc395-integ23.diff,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- dc395-integ23.diff 2000/01/31 21:38:01 1.1 +++ dc395-integ23.diff 2000/02/28 12:24:49 1.2 @@ -1,6 +1,48 @@ ---- linux/drivers/scsi/Config.in.orig Wed Dec 15 05:43:56 1999 -+++ linux/drivers/scsi/Config.in Mon Jan 31 22:03:20 2000 -@@ -129,6 +129,9 @@ +diff -uNr linux.orig/Documentation/Configure.help linux/Documentation/Configure.help +--- linux.orig/Documentation/Configure.help Sun Feb 27 05:32:12 2000 ++++ linux/Documentation/Configure.help Mon Feb 28 12:34:23 2000 +@@ -5482,6 +5482,19 @@ + read Documentation/modules.txt. The module will be called + sym53c416.o. + ++Tekram DC395/U/UW and DC315/U SCSI support ++CONFIG_SCSI_DC395x_TRMS1040 ++ This driver supports the PCI SCSI host adapters baseds on Tekram's ++ ASIC TRM-S1040 chip, i.e. Tekram DC315 and DC395 variants. ++ This driver does work, but please note that it is still beta status, ++ so better have a bootable disk and a backup in case of emergency. ++ Please read the file drivers/scsi/README.dc395x. ++ ++ If you want to compile this driver as a module ( = code which can be ++ inserted in and removed from the running kernel whenever you want), ++ say M here and read Documentation/modules.txt. The module will be ++ called dc395x_trm.o. ++ + Tekram DC390(T) and Am53/79C974 (PCscsi) SCSI support + CONFIG_SCSI_DC390T + This driver supports PCI SCSI host adapters based on the Am53C974A +diff -uNr linux.orig/MAINTAINERS linux/MAINTAINERS +--- linux.orig/MAINTAINERS Sat Feb 26 00:16:37 2000 ++++ linux/MAINTAINERS Mon Feb 28 12:32:23 2000 +@@ -255,10 +255,12 @@ + L: linux-hams@vger.rutgers.edu + S: Maintained + +-DC390/AM53C974 SCSI driver ++DC390/AM53C974 and DC395/TRM-S1040 SCSI drivers + P: Kurt Garloff ++M: garloff@suse.de + M: kurt@garloff.de +-W: http://www.garloff.de/kurt/linux/dc390/ ++W: http://www.garloff.de/kurt/linux/ ++L: linux-scsi@vger.rutgers.edu + S: Maintained + + DECnet NETWORK LAYER +diff -uNr linux.orig/drivers/scsi/Config.in linux/drivers/scsi/Config.in +--- linux.orig/drivers/scsi/Config.in Sun Feb 27 05:32:15 2000 ++++ linux/drivers/scsi/Config.in Mon Feb 28 12:31:12 2000 +@@ -155,6 +155,9 @@ fi dep_tristate 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE $CONFIG_SCSI if [ "$CONFIG_PCI" = "y" ]; then @@ -10,9 +52,10 @@ dep_tristate 'Tekram DC390(T) and Am53/79C974 SCSI support' CONFIG_SCSI_DC390T $CONFIG_SCSI if [ "$CONFIG_SCSI_DC390T" != "n" ]; then bool ' _omit_ support for non-DC390 adapters' CONFIG_SCSI_DC390T_NOGENSUPP ---- linux/drivers/scsi/Makefile.orig Thu Dec 30 02:16:30 1999 -+++ linux/drivers/scsi/Makefile Mon Jan 31 22:01:46 2000 -@@ -394,6 +394,14 @@ +diff -uNr linux.orig/drivers/scsi/Makefile linux/drivers/scsi/Makefile +--- linux.orig/drivers/scsi/Makefile Fri Feb 25 07:51:47 2000 ++++ linux/drivers/scsi/Makefile Mon Feb 28 12:31:12 2000 +@@ -412,6 +412,14 @@ endif endif @@ -27,9 +70,10 @@ ifeq ($(CONFIG_SCSI_DC390T),y) L_OBJS += tmscsim.o else ---- linux/drivers/scsi/hosts.c.orig Mon Dec 13 08:04:20 1999 -+++ linux/drivers/scsi/hosts.c Mon Jan 31 22:04:29 2000 -@@ -243,6 +243,10 @@ +diff -uNr linux.orig/drivers/scsi/hosts.c linux/drivers/scsi/hosts.c +--- linux.orig/drivers/scsi/hosts.c Fri Feb 25 07:51:47 2000 ++++ linux/drivers/scsi/hosts.c Mon Feb 28 12:31:12 2000 +@@ -249,6 +249,10 @@ #include "sym53c416.h" #endif @@ -40,7 +84,7 @@ #ifdef CONFIG_SCSI_DC390T #include "dc390.h" #endif -@@ -562,6 +566,9 @@ +@@ -579,6 +583,9 @@ #endif #ifdef CONFIG_SCSI_EATA EATA, @@ -50,40 +94,3 @@ #endif #ifdef CONFIG_SCSI_DC390T DC390_T, ---- linux/Documentation/Configure.help.orig Tue Jan 11 03:25:32 2000 -+++ linux/Documentation/Configure.help Mon Jan 31 22:01:46 2000 -@@ -5045,6 +5045,18 @@ - read Documentation/modules.txt. The module will be called - sym53c416.o. - -+Tekram DC395/U/UW and DC315/U SCSI support -+CONFIG_SCSI_DC395x_TRMS1040 -+ This driver supports the PCI SCSI host adapters baseds on Tekramīs -+ ASIC TRM-S1040 chip, i.e. Tekram DC315 and DC395 variants. -+ This driver does work, but please note that it is still alpha status, -+ so better have a bootable disk and a backup in case of emergency. -+ -+ If you want to compile this driver as a module ( = code which can be -+ inserted in and removed from the running kernel whenever you want), -+ say M here and read Documentation/modules.txt. The module will be -+ called dc395x_trm.o. -+ - Tekram DC390(T) and Am53/79C974 (PCscsi) SCSI support - CONFIG_SCSI_DC390T - This driver supports PCI SCSI host adapters based on the Am53C974A ---- linux/MAINTAINERS.orig Mon Jan 10 23:19:46 2000 -+++ linux/MAINTAINERS Mon Jan 31 22:01:46 2000 -@@ -255,10 +255,11 @@ - L: linux-hams@vger.rutgers.edu - S: Maintained - --DC390/AM53C974 SCSI driver -+DC390/AM53C974 and DC395/TRM-S1040 SCSI drivers - P: Kurt Garloff -+M: garloff@suse.de - M: kurt@garloff.de --W: http://www.garloff.de/kurt/linux/dc390/ -+W: http://www.garloff.de/kurt/linux/ - S: Maintained - - DECnet NETWORK LAYER Index: dc395x_trm.c =================================================================== RCS file: /home/cvsroot/dc395/dc395x_trm.c,v retrieving revision 1.55 retrieving revision 1.60 diff -u -r1.55 -r1.60 --- dc395x_trm.c 2000/02/25 18:34:14 1.55 +++ dc395x_trm.c 2000/05/23 13:16:09 1.60 @@ -12,7 +12,7 @@ //* Kurt Garloff //* (C) 1999-2000 Kurt Garloff //* License: GNU GPL -//* $Id: dc395x_trm.c,v 1.55 2000/02/25 18:34:14 garloff Exp $ +//* $Id: dc395x_trm.c,v 1.60 2000/05/23 13:16:09 garloff Exp $ //*********************************************************************** //* Tekram PCI SCSI adapter (DC395/U/UW/F or DC315/U) revision history //* @@ -71,6 +71,12 @@ //* Avoid DMA for up to 4 bytes (=:PIO) //* DOP1: Don't rely on CTR being zero, as //* FIFO may be non-empty. +//* 1.27 00/05/23 KG Linux 2.3 and 2.0 compatibility +//* Cleanups +//* Timer for chip flaw (misses SelTO), +//* (but disabled, as it does fail smtms) +//* Connector cfg output changed +//+ No clrfifo after MIP1 //*********************************************************************** /* ************************************************************************* @@ -106,7 +112,7 @@ //#define DC395x_DEBUG0 //#define DC395x_DEBUG1 //#define DC395x_DEBUGDCB -//#define DC395x_DEBUGTRACE +#define DC395x_DEBUGTRACE //#define DC395x_DEBUGTRACEALL //#define DC395x_DEBUGPARSE //#define DC395x_SGPARANOIA @@ -483,7 +489,7 @@ PSRB pFreeSRB; PSRB pTmpSRB; struct timer_list Waiting_Timer; - //struct timer_list Data_Timer; + struct timer_list SelTO_Timer; WORD SRBCount; WORD AdapterIndex; /* nth Adapter this driver */ @@ -1448,9 +1454,18 @@ /* Override defaults on cmdline: * tmscsim: AdaptID, MaxSpeed (Index), DevMode (Bitmapped), AdaptMode (Bitmapped) */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,13) +void __init DC395x_trm_setup (char *str) +{ + int i, im; + int ints[6]; + (void)get_options (str, ARRAY_SIZE(ints), ints); +#else void __init DC395x_trm_setup (char *str, int *ints) { - int i, im = ints[0]; + int i, im; +#endif + im = ints[0]; if (im > 6) { printk (KERN_NOTICE "DC395x: ignore extra params!\n"); @@ -1461,11 +1476,9 @@ /* DC395x_checkparams (); */ }; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,13) -#ifndef MODULE +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,13) && !defined(MODULE) __setup("dc395x_trm=", DC395x_trm_setup); #endif -#endif /* Queueing philosphy: * There are a couple of lists: @@ -1744,7 +1757,7 @@ if( !DC395x_StartSCSI(pACB, ptr1, pSRB) ) DC395x_Waiting_to_Going (ptr1, pSRB); else - DC395x_waiting_timer (pACB, HZ/20); + DC395x_waiting_timer (pACB, HZ/50); break; } } while (ptr1 != ptr); @@ -1817,7 +1830,7 @@ else { DC395x_Waiting_insert (pDCB, pSRB); - DC395x_waiting_timer (pACB, HZ/20); + DC395x_waiting_timer (pACB, HZ/50); } } @@ -2285,6 +2298,10 @@ printk ("DC395x: Clr FIFO (%i bytes) on phase %02x in %s\n", fifocnt & 0x3f, lines, txt); #endif + if (pACB->pActiveDCB && pACB->pActiveDCB->pActiveSRB) { + PSRB pSRB = pACB->pActiveDCB->pActiveSRB; + TRACEPRINTF ("#*"); + } DC395x_write16 (TRM_S1040_SCSI_CONTROL, DO_CLRFIFO); } @@ -2584,7 +2601,6 @@ //DC395x_ACB_LOCK(pACB,acb_flags); if (timer_pending (&pACB->Waiting_Timer)) del_timer (&pACB->Waiting_Timer); - //if (timer_pending (&pACB->Data_Timer)) del_timer (&pACB->Data_Timer); /* ** disable interrupt */ @@ -2644,7 +2660,7 @@ *ptr++ = pDCB->SyncOffset; /* Transfer period (max. REQ/ACK dist) */ pSRB->MsgCnt += 5; pSRB->SRBState |= SRB_DO_SYNC_NEGO; - TRACEPRINTF("S*"); + TRACEPRINTF("S *"); } /* SDTR */ @@ -2664,9 +2680,44 @@ *ptr++ = wide; pSRB->MsgCnt += 4; pSRB->SRBState |= SRB_DO_WIDE_NEGO; - TRACEPRINTF("W*"); + TRACEPRINTF("W *"); } + +/* Timer to work around chip flaw: When selecting and the bus is + * busy, we sometimes miss a Selection timeout IRQ */ +void DC395x_selection_timeout_missed (unsigned long ptr); +/* Sets the timer to wake us up */ +static void DC395x_selto_timer (PACB pACB) +{ + if (timer_pending (&pACB->SelTO_Timer)) return; + init_timer (&pACB->SelTO_Timer); + pACB->SelTO_Timer.function = DC395x_selection_timeout_missed; + pACB->SelTO_Timer.data = (unsigned long)pACB; + if (time_before (jiffies + HZ, pACB->pScsiHost->last_reset + HZ/2)) + pACB->SelTO_Timer.expires = pACB->pScsiHost->last_reset + HZ/2 + 1; + else + pACB->SelTO_Timer.expires = jiffies + HZ + 1; + add_timer (&pACB->SelTO_Timer); +} + +void DC395x_selection_timeout_missed (unsigned long ptr) +{ + unsigned int flags; + PACB pACB = (PACB)ptr; PSRB pSRB; + printk ("DC395x: Debug: Chip forgot to produce SelTO IRQ!\n"); + if (!pACB->pActiveDCB || !pACB->pActiveDCB->pActiveSRB) { + printk ("DC395x: ... but no cmd pending? Oops!\n"); + return; + } + DC395x_LOCK_IO; + pSRB = pACB->pActiveDCB->pActiveSRB; + TRACEPRINTF("N/TO *"); + DC395x_Disconnect (pACB); + DC395x_UNLOCK_IO; +} + + /* ********************************************************************** ** scsiio @@ -2701,9 +2752,11 @@ * Timeout, a Disconnect or a Reselction IRQ, so we would be screwed! * (This is likely to be a bug in the hardware. Obviously, most people * only have one initiator per SCSI bus.) - * Instead let this fail and have the timer make sure the command is tried - * again after a short time */ + * Instead let this fail and have the timer make sure the command is + * tried again after a short time */ TRACEPRINTF ("^*"); + //DC395x_selto_timer (pACB); + //DC395x_monitor_next_IRQ = 1; return 1; }; #endif @@ -2955,6 +3008,8 @@ } /* This acknowledges the IRQ */ scsi_intstatus = DC395x_read8(TRM_S1040_SCSI_INTSTATUS ); + if ((scsi_status & 0x2007) == 0x2002) + printk ("DC395x: COP after COP completed? %04x\n", scsi_status); #if 1//def DC395x_DEBUG0 if (DC395x_monitor_next_IRQ) { printk(KERN_INFO "DC395x: status=%04x intstatus=%02x\n", scsi_status, scsi_intstatus); @@ -2968,6 +3023,9 @@ #endif //printk ("DC395x_IRQ: intstatus = %02x ", scsi_intstatus); + if (timer_pending (&pACB->SelTO_Timer)) + del_timer (&pACB->SelTO_Timer); + if(scsi_intstatus & (INT_SELTIMEOUT | INT_DISCONNECT)) { DC395x_Disconnect( pACB );/* bus free interrupt */ @@ -2997,15 +3055,12 @@ goto out_unlock; } pSRB = pDCB->pActiveSRB; - if( pDCB ) + if( pDCB->DCBFlag & ABORT_DEV_ ) { - if( pDCB->DCBFlag & ABORT_DEV_ ) - { #ifdef DC395x_DEBUG0 printk(KERN_INFO "MsgOut Abort Device..... "); #endif DC395x_EnableMsgOut_Abort( pACB, pSRB ); - } } /* ************************************************************ @@ -3363,7 +3418,6 @@ printk(KERN_INFO "DC395x_DataOutPhase0..... "); #endif TRACEPRINTF("DOP0*"); - //if (timer_pending (&pACB->Data_Timer)) del_timer (&pACB->Data_Timer); pDCB = pSRB->pSRBDCB; scsi_status = *pscsi_status; @@ -3528,7 +3582,6 @@ printk(KERN_INFO "DC395x_DataInPhase0..............\n "); #endif TRACEPRINTF("DIP0*"); - //if (timer_pending (&pACB->Data_Timer)) del_timer (&pACB->Data_Timer); scsi_status = *pscsi_status; /* KG: DataIn is much more tricky than DataOut. When the device is finished @@ -3713,102 +3766,6 @@ TRACEPRINTF(".*"); } -#if 0 -void DC395x_data1_timed_out (unsigned long ptr); -/* Sets the timer to wake us up */ -static void DC395x_data1_timer (PSRB pSRB, unsigned long to) -{ - PACB pACB; - PDCB pDCB = pSRB->pSRBDCB; - if (pDCB) pACB = pDCB->pDCBACB; - else { - printk ("DC395x: Data1_Timer_Set: DCB == 0! (pid %li) Oops!\n", - pSRB->pcmd->pid); - return; - } - if (timer_pending (&pACB->Data_Timer)) return; - init_timer (&pACB->Data_Timer); - pACB->Data_Timer.function = DC395x_data1_timed_out; - pACB->Data_Timer.data = (unsigned long)pSRB; - pACB->Data_Timer.expires = jiffies + to; - add_timer (&pACB->Data_Timer); -} - -void DC395x_data1_timed_out (unsigned long ptr) -{ - unsigned long flags; - PSRB pSRB = (PSRB)ptr; - PDCB pDCB = pSRB->pSRBDCB; - PACB pACB; - WORD s_stat; - if (pDCB) pACB = pDCB->pDCBACB; - else { - printk ("DC395x: Data1_Timed_Out: DCB == 0! (pid %li) Oops!\n", - pSRB->pcmd->pid); - return; - } - DC395x_LOCK_IO; - s_stat = DC395x_read16 (TRM_S1040_SCSI_STATUS); - printk ("DC395x: ***** BUG ***** Data1 timed out!\n"); - printk ("DC395x: This means: You are in serious trouble! Lower Sync Offset for tgt %02i!\n", - pDCB->TargetID); - TRACEPRINTF("!*"); - DC395x_dumpinfo (pACB, 0, 0); - /* Try to handle different cases */ - if (s_stat & SEQUENCERACTIVE) - { - DC395x_data1_timer (pSRB, HZ*30); - printk ("DC395x: SCSI Sequencer Active! What now?\n"); - printk ("DC395x: Something weird got your device upset!\n"); - printk ("DC395x: SCSI engine seems to have 0x%05x bytes remaining of 0x%05x\n", - DC395x_read32 (TRM_S1040_SCSI_COUNTER), pSRB->SRBTotalXferLength); - printk ("DC395x: DMA engine at pos 0x%04x + FIFO %02x\n", - DC395x_read32 (TRM_S1040_DMA_CXCNT), DC395x_read8 (TRM_S1040_DMA_FIFOCNT)); - printk ("DC395x: Recover by waiting for the SCSI bus being reset ...\n"); - DC395x_write8 (TRM_S1040_DMA_CONTROL, ABORTXFER | CLRXFIFO); - DC395x_write16 (TRM_S1040_SCSI_CONTROL, DO_CMDABORT | DO_CLRFIFO); - /* - udelay (100); - DC395x_write16 (TRM_S1040_SCSI_CONTROL, DO_RSTSCSI); - */ - DC395x_write16 (TRM_S1040_SCSI_CONTROL, DO_HWRESELECT | DO_DATALATCH); - printk ("DC395x: Trying to abort ...\n"); - pDCB->DCBFlag |= ABORT_DEV_; - //DC395x_EnableMsgOut_Abort (pACB, pSRB); - printk ("DC395x: Read README.dc395x for more info.\n"); - DC395x_UNLOCK_IO; - return; - }; - if ((s_stat & PHASEMASK) != pSRB->ScsiPhase) - { - void (*DC395x_stateV)( PACB, PSRB, PWORD ); - printk ("DC395x: Probably missed a SCSI phase change IRQ: %02x -> %02x\n", - pSRB->ScsiPhase, (s_stat & PHASEMASK)); - /* Try to handle it */ - DC395x_stateV = (void *) DC395x_SCSI_phase0[pSRB->ScsiPhase]; - DC395x_stateV( pACB, pSRB, &s_stat ); - pSRB->ScsiPhase = s_stat & PHASEMASK; - DC395x_stateV = (void *) DC395x_SCSI_phase1[pSRB->ScsiPhase]; - DC395x_stateV( pACB, pSRB, &s_stat ); - DC395x_UNLOCK_IO; - return; - }; - TRACEPRINTF("R*"); - if (s_stat & PH_DATA_IN) - { - DC395x_DataInPhase0 (pACB, pSRB, &s_stat); - DC395x_DataInPhase1 (pACB, pSRB, &s_stat); - } - else - { - DC395x_DataOutPhase0 (pACB, pSRB, &s_stat); - DC395x_DataOutPhase1 (pACB, pSRB, &s_stat); - } - DC395x_UNLOCK_IO; - printk ("DC395x: Data1 restarted (%04x)\n", s_stat); -} -#endif - /* ********************************************************************* ** scsiio @@ -4156,6 +4113,7 @@ PDCB pDCB = pSRB->pSRBDCB; printk ("DC395x: Target %02i: No sync transfers\n", pDCB->TargetID); + TRACEPRINTF("!S *"); pDCB->SyncMode &= ~(SYNC_NEGO_ENABLE); pDCB->SyncMode |= SYNC_NEGO_DONE; //pDCB->SyncPeriod &= 0; pDCB->SyncOffset = 0; @@ -4217,6 +4175,7 @@ pDCB->SyncOffset, (fact/pDCB->MinNegoPeriod), ((fact%pDCB->MinNegoPeriod)*10+pDCB->MinNegoPeriod/2)/pDCB->MinNegoPeriod); + TRACEPRINTF("S%i *", pDCB->MinNegoPeriod << 2); if (!(pSRB->SRBState & SRB_DO_SYNC_NEGO)) { /* Reply with corrected SDTR Message */ @@ -4252,6 +4211,7 @@ printk ("DC395x: WDTR got rejected from target %02i\n", pDCB->TargetID); #endif + TRACEPRINTF("!W *"); pDCB->SyncPeriod &= ~WIDE_SYNC; pDCB->SyncMode &= ~(WIDE_NEGO_ENABLE); pDCB->SyncMode |= WIDE_NEGO_DONE; pSRB->SRBState &= ~SRB_DO_WIDE_NEGO; @@ -4284,6 +4244,7 @@ if (pSRB->MsgInBuf[3] > 0) pDCB->SyncPeriod |= WIDE_SYNC; else pDCB->SyncPeriod &= ~WIDE_SYNC; pSRB->SRBState &= ~SRB_DO_WIDE_NEGO; + TRACEPRINTF("W%i *", (pDCB->SyncPeriod & WIDE_SYNC? 1: 0)); //pDCB->SyncMode &= ~(WIDE_NEGO_ENABLE+WIDE_NEGO_DONE); #ifdef DC395x_DEBUG_KG printk ("DC395x: Wide transfers (%i bit) negotiated with target %02i\n", @@ -4488,7 +4449,11 @@ //1.25 if ((*pscsi_status & PHASEMASK) != PH_MSG_IN) - DC395x_clrfifo (pACB, "MIP0"); +#if 0 + DC395x_clrfifo (pACB, "MIP0_"); +#else + TRACEPRINTF("N/Cln *"); +#endif *pscsi_status = PH_BUS_FREE; DC395x_write16 (TRM_S1040_SCSI_CONTROL, DO_DATALATCH); /* it's important ... you know! */ DC395x_write8 (TRM_S1040_SCSI_COMMAND, SCMD_MSGACCEPT); @@ -4655,7 +4620,7 @@ ** Selection time out ** SRB_START_ || SRB_MSGOUT || (!SRB_DISCONNECT && !SRB_COMPLETED) */ - /* Normal Sel Timeout */ + /* Unexp. Disc / Sel Timeout */ if (pSRB->SRBState != SRB_START_ && pSRB->SRBState != SRB_MSGOUT) { pSRB->SRBState = SRB_READY; @@ -5162,7 +5127,7 @@ /* Here is the info for Doug Gilbert's sg3 ... */ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,30) - pcmd->SCp.resid = pSRB->SRBTotalXferLength; + pcmd->resid = pSRB->SRBTotalXferLength; #endif /* This may be interpreted by sb. or not ... */ pcmd->SCp.this_residual = pSRB->SRBTotalXferLength; @@ -5366,7 +5331,6 @@ printk (KERN_INFO "DC395x_ScsiRstDetect\n"); /* delay half a second */ if (timer_pending (&pACB->Waiting_Timer)) del_timer (&pACB->Waiting_Timer); - //if (timer_pending (&pACB->Data_Timer)) del_timer (&pACB->Data_Timer); DC395x_write8(TRM_S1040_SCSI_CONTROL, DO_RSTMODULE); DC395x_write8(TRM_S1040_DMA_CONTROL, DMARESETMODULE); @@ -5431,14 +5395,16 @@ pSRB->SRBSGListPointer = &pSRB->SegmentX[0]; pSRB->SRBSGCount = 1; pSRB->SRBSGIndex = 0; + /* KG: Can this prevent crap sense data ? */ + memset (pcmd->sense_buffer, 0, sizeof(pcmd->sense_buffer)); if( DC395x_StartSCSI( pACB, pDCB, pSRB ) ) - { + { /* Should only happen, if sb. else grabs the bus */ printk ("DC395x: Request Sense failed for pid %li (%02i-%i)!\n", pSRB->pcmd->pid, pDCB->TargetID, pDCB->TargetLUN); TRACEPRINTF ("?*"); DC395x_Going_to_Waiting (pDCB, pSRB); - DC395x_waiting_timer (pACB, HZ/50); + DC395x_waiting_timer (pACB, HZ/100); } TRACEPRINTF (".*"); } @@ -6087,20 +6053,20 @@ bval = DC395x_read8(TRM_S1040_GEN_STATUS); printk ("DC395%c: Connectors: ", ((bval & WIDESCSI)? 'W': ' ')); - if (bval & CON5068) { + if (!(bval & CON5068)) { printk ("ext"); - if (bval & EXT68HIGH) printk ("68 "); + if (!(bval & EXT68HIGH)) printk ("68 "); else printk ("50 "); } - if (bval & CON68) { + if (!(bval & CON68)) { printk ("int68"); - if (bval & INT68HIGH) printk (" "); + if (!(bval & INT68HIGH)) printk (" "); else printk ("(50) "); } - if (bval & CON50) + if (!(bval & CON50)) printk ("int50 "); - if ((bval & (CON5068 | CON50 | CON68)) == (CON5068 | CON50 | CON68)) - printk ("\nDC395x: ERROR: Never use all three connectors !!!\n"); + if ((bval & (CON5068 | CON50 | CON68)) == 0 /*(CON5068 | CON50 | CON68)*/) + printk (" Oops! (All 3?) "); bval = DC395x_read8(TRM_S1040_GEN_CONTROL); printk (" Termination: "); if (bval & DIS_TERM) @@ -6359,7 +6325,7 @@ //DC395x_DRV_LOCK(drv_flags); #ifdef NEW_PCI # if LINUX_VERSION_CODE >= KERNEL_VERSION (2,3,10) - io_port = pPCI_DEVICE->resource[0].start & PCI_BASE_ADDRESS_IO_MASK; + io_port = pci_resource_start (pPCI_DEVICE, 0) & PCI_BASE_ADDRESS_IO_MASK; # else io_port = pPCI_DEVICE->base_address[0] & PCI_BASE_ADDRESS_IO_MASK; # endif @@ -7057,8 +7023,10 @@ */ DC395x_write8(TRM_S1040_DMA_INTEN, 0); DC395x_write8(TRM_S1040_SCSI_INTEN, 0); - if (timer_pending (&pACB->Waiting_Timer)) del_timer (&pACB->Waiting_Timer); - //if (timer_pending (&pACB->Data_Timer)) del_timer (&pACB->Data_Timer); + if (timer_pending (&pACB->Waiting_Timer)) + del_timer (&pACB->Waiting_Timer); + if (timer_pending (&pACB->SelTO_Timer)) + del_timer (&pACB->SelTO_Timer); if (1 || pACB->Config & HCC_SCSI_RESET) DC395x_ResetSCSIBus( pACB ); Index: dc395x_trm.h =================================================================== RCS file: /home/cvsroot/dc395/dc395x_trm.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- dc395x_trm.h 2000/02/25 09:21:11 1.25 +++ dc395x_trm.h 2000/05/23 09:53:01 1.26 @@ -8,7 +8,7 @@ ** ********************************************************************** */ -/* $Id: dc395x_trm.h,v 1.25 2000/02/25 09:21:11 garloff Exp $ */ +/* $Id: dc395x_trm.h,v 1.26 2000/05/23 09:53:01 garloff Exp $ */ /* ***************************************************** ** Tekram TRM_S1040 for DC395x driver, header file @@ -18,7 +18,7 @@ #define DC395x_trm_H #define DC395x_BANNER "Tekram DC395U/UW/F DC315/U" -#define DC395x_VERSION "1.26, 2000-02-25" +#define DC395x_VERSION "1.27, 2000-05-23" /* Kernel version autodetection */ #include