Index: dc390/README.tmscsim =================================================================== RCS file: /usr/local/cvsroot/dc390/README.tmscsim,v retrieving revision 2.2 retrieving revision 2.4 diff -u -r2.2 -r2.4 --- README.tmscsim 1998/10/14 10:34:58 2.2 +++ README.tmscsim 1998/10/24 08:45:02 2.4 @@ -23,7 +23,10 @@ It has originally written by C.L. Huang from the Tekram corp. to support the Tekram DC390(T) adapter. This is where the name comes from: tm = Tekram scsi = SCSI driver, m = AMD (?) as opposed to w for the DC390W/U/F -(NCR53c8X5, X=2/7) driver. +(NCR53c8X5, X=2/7) driver. Yes, there was also a driver for the latter, +tmscsimw, which supported DC390W/U/F adapters. It's not maintained any more, +as the ncr53c8xx is perfectly supporting these adpaters since some time. + The driver first appeared in April 1996, exclusively supported the DC390 and has been enhanced since then in various steps. In May 1998 support for general AM53C974 based adapters and some possibilities to configure it were @@ -39,9 +42,9 @@ of tmscsim.c. The numbering scheme isn't consistent. The first versions went from 1.00 to 1.12, then 1.20a to 1.20t. Finally I decided to use the ncr53c8xx scheme. So -the next revision will be 2.0a to 2.0X (stable), 2.1a to 2.1X (experimental), +the next revisions will be 2.0a to 2.0X (stable), 2.1a to 2.1X (experimental), 2.2a to 2.2X (stable, again) etc. (X = anything between a and z.) If I send -fixes to people for testing, those will have a number appended, e.g. 2.0a1. +fixes to people for testing, those will have a digit appended, e.g. 2.0a1. 2. Installation @@ -339,6 +342,11 @@ Known problems: +* There was a report that with a certain Scanner, the last SCSI command + won't be finished correctly. This might be a command queueing bug or a bug + in SCSI implementation of the scanner. Issueing another command to the + scanner seems to help. (Try echo "INQUIRY x" >/proc/scsi/tmscsim/?, where + x is the index (not the SCSI ID!) of the scanner. See 4.(3).) * If there is a valid partition table, the driver will use it for determing the mapping. Other operating systems may not like this mapping, though it's consistent with the BIOS' behaviour. Old DC390 drivers ignored the @@ -348,14 +356,17 @@ * In some situations, the driver will get stuck in an abort loop. Please disable DsCn, if you meet this problem. Please contact me for further debugging. +* 2.1.115+: Linux misses locks in sr_ioctl.c and scsi_ioctl.c + There used to be a patch included here, which partially solved the + problem. I suggest you contact Chiaki Ishikawa , + Richard Waltham or Doug Ledford + , if you want to help further debugging it. * 2.0.35: CD changers (e.g. NAKAMICHI MBR-7.{0,2}) have problems because the mid-level code doesn't handle BLIST_SINGLELUN correctly. Apply the patch 2035-scsi-singlelun.diff. Thanks to Chiaki Ishikawa. -* 2.1.115+: Linux misses locks in sr_ioctl.c and scsi_ioctl.c: - Apply 21115-sr_ioctl.diff. Thanks to Doug Ledford for this patch. - Reports about whether this patch solves the problem are contradictory, - so you're welcome to further debug this. -[Both files are contained in the dc390-XXX.tar.gz files which can be found + I was told that this fix will be in 2.0.36, so you don't need it for + 2.0.36. +[The patch file is contained in the dc390-XXX.tar.gz files which can be found on the ftp server. See below.] @@ -398,5 +409,5 @@ ------------------------------------------------------------------------- Written by Kurt Garloff 1998/06/11 -Last updated 1998/10/14, driver revision 2.0a -$Id: README.tmscsim,v 2.2 1998/10/14 10:34:58 garloff Exp $ +Last updated 1998/10/15, driver revision 2.0b +$Id: README.tmscsim,v 2.4 1998/10/24 08:45:02 garloff Exp $ Index: dc390/dc390-120-kernel.diff =================================================================== RCS file: /usr/local/cvsroot/dc390/dc390-120-kernel.diff,v retrieving revision 2.1 retrieving revision 2.2 diff -u -r2.1 -r2.2 --- dc390-120-kernel.diff 1998/10/14 10:31:47 2.1 +++ dc390-120-kernel.diff 1998/10/24 10:14:54 2.2 @@ -1,17 +1,22 @@ -# dc390-120-kernel.diff # $Id: dc390-120-kernel.diff,v 2.1 1998/10/14 10:31:47 garloff Exp $ # +# dc390-kernel.diff +# patches against 2.1.125 kernel for DC390/AM53C974 driver integration +# $Id: dc390-120-kernel.diff,v 2.2 1998/10/24 10:14:54 garloff Exp $ # + 8<---------------------------------------------------------------------- Patch for allowing omission of the non DC390 parts of the driver: 8<---------------------------------------------------------------------- ---- linux/drivers/scsi/Config.in.21103.orig Thu Jun 11 12:16:38 1998 -+++ linux/drivers/scsi/Config.in Thu Jun 11 12:19:03 1998 -@@ -104,7 +104,10 @@ +--- linux/drivers/scsi/Config.in.orig Tue Oct 20 23:21:27 1998 ++++ linux/drivers/scsi/Config.in Sat Oct 24 11:40:17 1998 +@@ -104,8 +104,11 @@ + dep_tristate 'Qlogic ISP SCSI support' CONFIG_SCSI_QLOGIC_ISP $CONFIG_SCSI fi dep_tristate 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE $CONFIG_SCSI - if [ "$CONFIG_PCI" = "y" -a "$CONFIG_SCSI_AM53C974" != "y" ]; then +-if [ "$CONFIG_PCI" = "y" -a "$CONFIG_SCSI_AM53C974" != "y" ]; then - dep_tristate 'Tekram DC-390(T) (AMD PCscsi) SCSI support' CONFIG_SCSI_DC390T $CONFIG_SCSI -+ dep_tristate 'Tekram DC-390(T)/AM53C974 (AMD PCscsi) SCSI support' CONFIG_SCSI_DC390T $CONFIG_SCSI ++if [ "$CONFIG_PCI" = "y" ]; then ++ 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 ++ bool ' _omit_ support for non-DC390 adapters' CONFIG_SCSI_DC390T_NOGENSUPP + fi fi dep_tristate 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 $CONFIG_SCSI @@ -20,9 +25,9 @@ 8<---------------------------------------------------------------------- Patch to allow kernel boot parameters to be passed to the driver: 8<---------------------------------------------------------------------- ---- linux/init/main.c.nodc390 Thu May 21 14:01:37 1998 -+++ linux/init/main.c Wed Jun 17 09:28:37 1998 -@@ -156,6 +156,7 @@ +--- linux/init/main.c.orig Wed Oct 21 09:52:43 1998 ++++ linux/init/main.c Sat Oct 24 11:13:32 1998 +@@ -194,6 +194,7 @@ extern void in2000_setup(char *str, int *ints); extern void NCR53c406a_setup(char *str, int *ints); extern void wd7000_setup(char *str, int *ints); @@ -30,7 +35,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); -@@ -625,6 +626,9 @@ +@@ -704,6 +705,9 @@ #endif #ifdef CONFIG_SCSI_IBMMCA { "ibmmcascsi=", ibmmca_scsi_setup }, @@ -44,41 +49,70 @@ 8<---------------------------------------------------------------------- Patch to update Documentation: 8<---------------------------------------------------------------------- ---- linux/Documentation/Configure.help.21114 Tue Aug 11 09:03:33 1998 -+++ linux/Documentation/Configure.help Tue Aug 11 09:07:34 1998 -@@ -3988,10 +3988,10 @@ +--- linux/Documentation/Configure.help.orig Wed Oct 21 00:23:16 1998 ++++ linux/Documentation/Configure.help Sat Oct 24 11:59:44 1998 +@@ -4040,24 +4040,46 @@ say M here and read Documentation/modules.txt. The module will be called NCR53c406.o. -Tekram DC390(T) (AMD PCscsi) SCSI support -+Tekram DC390(T) and AMD53C974 (PCscsi) SCSI support ++Tekram DC390(T) and Am53/79C974 (PCscsi) SCSI support CONFIG_SCSI_DC390T - This driver supports the Tekram DC390(T) PCI SCSI host adapter with +- This driver supports the Tekram DC390(T) PCI SCSI host adapter with - the Am53C974A chip, and perhaps other cards using the same chip. -+ the Am53C974A chip and other cards using the same chip. - This driver does _not_ support the DC390W/U/F adapter with the - NCR/Symbios chips; use "NCR53C8XX SCSI support" for that one. +- This driver does _not_ support the DC390W/U/F adaptor with the +- NCR/Symbios chips; use "NCR53C8XX SCSI support" for that one. ++ This driver supports PCI SCSI host adapters based on the Am53C974A ++ chip, e.g. Tekram DC390(T), DawiControl 2974 and some onboard ++ PCscsi/PCnet (Am53/79C974) solutions. ++ Documentation can be found in linux/drivers/scsi/README.tmscsim. ++ ++ Note that this driver does NOT support Tekram DC390W/U/F, which are ++ based on NCR/Symbios chips. Use the NCR53C8XX driver for those. ++ Also note, that there is another generic Am53C974 driver. -@@ -3999,6 +3999,15 @@ - inserted in and removed from the running kernel whenever you want), - say M here and read Documentation/modules.txt. The module will be + 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 ++ inserted in and removed from the running kernel whenever you want), ++ say M here and read Documentation/modules.txt. The module will be called tmscsim.o. -+ -+Skip support for other AM53C974 based SCSI adapters -+CONFIG_SCSI_DC390T_NOGENSUPP -+ Normally the DC390(T) SCSI driver relies on the DC390 EEPROM to get -+ initial values for its settings, such as speed, termination, etc. -+ If it can't find this EEPROM, it will use defaults or the kernel or -+ module parameters it gets. See linux/drivers/scsi/README.tmscsim for -+ details on driver configuration. -+ With this option set, if no EEPROM is found, the driver gives up. ++Skip support for other Am53/79C974 based SCSI adapters ++CONFIG_SCSI_DC390T_NOGENSUPP ++ Normally, the DC390(T) SCSI driver relies on the DC390 EEPROM to get ++ initial values for its settings, such as speed, termination, etc. ++ If it can't find this EEPROM, it will use defaults or the user ++ supplied boot/module parameters. For details on driver configuration ++ see linux/drivers/scsi/README.tmscsim. ++ ++ With this option set, if no EEPROM is found, the driver gives up and ++ thus only supports Tekram DC390(T) adapters. This can be useful if ++ you have a DC390(T) and another Am53C974 based adapter, which, for ++ some reason, you want to drive with the other AM53C974 driver. ++ ++ If unsure, say N. ++ AM53/79C974 PCI SCSI support CONFIG_SCSI_AM53C974 + This is support for the AM53/79C974 SCSI host adapters. Please read + drivers/scsi/README.AM53C974 for details. Also, the SCSI-HOWTO, + available via FTP (user: anonymous) at +- ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO, is for you. ++ ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO, is for you. ++ ++ Note that there is another driver for AM53C974 based adapters: The ++ Tekram DC390(T) driver. + + 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), + +8<---------------------------------------------------------------------- +I do maintain this driver ... 8<---------------------------------------------------------------------- ---- linux/MAINTAINERS.21114 Fri Jul 31 05:06:52 1998 -+++ linux/MAINTAINERS Fri Aug 7 23:04:25 1998 -@@ -168,6 +168,12 @@ +--- linux/MAINTAINERS.orig Wed Oct 21 00:23:16 1998 ++++ linux/MAINTAINERS Sat Oct 24 11:13:33 1998 +@@ -186,6 +186,12 @@ L: linux-hams@vger.rutgers.edu S: Maintained Index: dc390/dc390.h =================================================================== RCS file: /usr/local/cvsroot/dc390/dc390.h,v retrieving revision 2.1 retrieving revision 2.3 diff -u -r2.1 -r2.3 --- dc390.h 1998/10/14 10:31:47 2.1 +++ dc390.h 1998/10/24 08:45:02 2.3 @@ -4,7 +4,7 @@ * Description: Device Driver for Tekram DC-390(T) PCI SCSI * * Bus Master Host Adapter * ***********************************************************************/ -/* $Id: dc390.h,v 2.1 1998/10/14 10:31:47 garloff Exp $ */ +/* $Id: dc390.h,v 2.3 1998/10/24 08:45:02 garloff Exp $ */ #include @@ -15,6 +15,9 @@ #ifndef DC390_H #define DC390_H +#define DC390_BANNER "Tekram DC390/AM53C974" +#define DC390_VERSION "2.0b 1998/10/24" + #if defined(HOSTS_C) || defined(MODULE) #include @@ -37,7 +40,7 @@ #define DC390_T { \ proc_dir: &DC390_proc_scsi_tmscsim, \ proc_info: DC390_proc_info, \ - name: "Tekram DC390/AM53C974 V2.0a Oct-14-1998", \ + name: DC390_BANNER " V" DC390_VERSION, \ detect: DC390_detect, \ release: DC390_release, \ queuecommand: DC390_queue_command, \ Index: dc390/scsiiom.c =================================================================== RCS file: /usr/local/cvsroot/dc390/scsiiom.c,v retrieving revision 2.1 retrieving revision 2.3 diff -u -r2.1 -r2.3 --- scsiiom.c 1998/10/14 10:31:48 2.1 +++ scsiiom.c 1998/10/24 09:10:28 2.3 @@ -4,7 +4,7 @@ * Description: Device Driver for Tekram DC-390 (T) PCI SCSI * * Bus Master Host Adapter * ***********************************************************************/ -/* $Id: scsiiom.c,v 2.1 1998/10/14 10:31:48 garloff Exp $ */ +/* $Id: scsiiom.c,v 2.3 1998/10/24 09:10:28 garloff Exp $ */ UCHAR dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB ) @@ -497,12 +497,12 @@ for (i=0; i<0x8000; i++) { bval = DC390_read8 (DMA_Status); + DC390_write8 (DMA_Status, BLAST_COMPLETE | DMA_XFER_DONE | DMA_XFER_ABORT | DMA_XFER_ERROR | PCI_MS_ABORT); /* clear */ if (bval & BLAST_COMPLETE) break; } - DC390_write8 (DMA_Status, BLAST_COMPLETE | DMA_XFER_DONE | DMA_XFER_ABORT | DMA_XFER_ERROR | PCI_MS_ABORT); /* clear */ if (i == 0x8000) printk (KERN_CRIT "DC390: DMA Blast aborted unfinished!!\n"); - DC390_write8 (DMA_Cmd, READ_DIRECTION+DMA_IDLE_CMD); /* | DMA_INT */ + //DC390_write8 (DMA_Cmd, READ_DIRECTION+DMA_IDLE_CMD); /* | DMA_INT */ DEBUG1(printk ("Blast: Read %i times DMA_Status %02x", i, bval);) ResidCnt = (ULONG) DC390_read8 (CtcReg_High); Index: dc390/tmscsim.c =================================================================== RCS file: /usr/local/cvsroot/dc390/tmscsim.c,v retrieving revision 2.1 retrieving revision 2.4 diff -u -r2.1 -r2.4 --- tmscsim.c 1998/10/14 10:31:48 2.1 +++ tmscsim.c 1998/10/24 08:50:47 2.4 @@ -5,7 +5,7 @@ * Bus Master Host Adapter * * (C)Copyright 1995-1996 Tekram Technology Co., Ltd. * ***********************************************************************/ -/* $Id: tmscsim.c,v 2.1 1998/10/14 10:31:48 garloff Exp $ */ +/* $Id: tmscsim.c,v 2.4 1998/10/24 08:50:47 garloff Exp $ */ /* Enhancements and bugfixes by * * Kurt Garloff * ***********************************************************************/ @@ -86,8 +86,10 @@ * 2.0a 98/10/14 KG Max Cmnds back to 17. DMA_Stat clearing * * all flags. Clear within while() loops * * in DataIn_0/Out_0. Null ptr in dumpinfo * - * for pSRB==0. Better locking druing init.* - * bios_param() now respects part table. * + * for pSRB==0. Better locking during init.* + * bios_param() now respects part. table. * + * 2.0b 98/10/24 KG Docu fixes. Timeout Msg in DMA Blast. * + * Disallow illegal idx in INQUIRY/REMOVE * ***********************************************************************/ /* Uncomment SA_INTERRUPT, if the driver refuses to share its IRQ with other devices */ @@ -2138,6 +2140,7 @@ char *pos = buffer, *p0 = buffer; char needs_inquiry = 0; int dum = 0; + char dev; PDCB pDCB = pACB->pLinkDCB; DC390_IFLAGS DC390_AFLAGS @@ -2305,10 +2308,10 @@ inquiry: { - char dev; pos = strtok (0, " \t\n.:;="); if (!pos) goto einv; dev = simple_strtoul (pos, &p0, 10); - for (dum = 0; dum pNextDCB; + if (dev >= pACB->DCBCnt) goto einv_dev; + for (dum = 0; dum < dev; dum++) pDCB = pDCB->pNextDCB; printk (KERN_NOTICE " DC390: Issue INQUIRY command to Dev(Idx) %i SCSI ID %i LUN %i\n", dev, pDCB->UnitSCSIID, pDCB->UnitSCSILUN); DC390_UNLOCK_ACB; @@ -2316,12 +2319,13 @@ DC390_UNLOCK_IO; }; return (length); + remove: { - char dev; pos = strtok (0, " \t\n.:;="); if (!pos) goto einv; dev = simple_strtoul (pos, &p0, 10); - for (dum = 0; dum pNextDCB; + if (dev >= pACB->DCBCnt) goto einv_dev; + for (dum = 0; dum < dev; dum++) pDCB = pDCB->pNextDCB; printk (KERN_NOTICE " DC390: Remove DCB for Dev(Idx) %i SCSI ID %i LUN %i\n", dev, pDCB->UnitSCSIID, pDCB->UnitSCSILUN); dc390_remove_dev (pACB, pDCB); @@ -2329,6 +2333,15 @@ DC390_UNLOCK_IO; }; return (length); + + einv_dev: + printk (KERN_WARNING "DC390: Ignore cmnd to illegal Dev(Idx) %i. Valid range: 0 - %i.\n", + dev, pACB->DCBCnt - 1); + DC390_UNLOCK_ACB; + DC390_UNLOCK_IO; + return (-EINVAL); + + } #undef SEARCH @@ -2390,7 +2403,7 @@ return dc390_set_info(buffer, length, pACB); SPRINTF("Tekram DC390/AM53C974 PCI SCSI Host Adapter, "); - SPRINTF("Driver Version 2.0a, 1998/10/14\n"); + SPRINTF("Driver Version %s\n", DC390_VERSION); DC390_LOCK_ACB; @@ -2406,9 +2419,9 @@ SPRINTF("TagMaxNum %i, Status %i, ACBFlag %i, GlitchEater %i ns\n", pACB->TagMaxNum, pACB->status, pACB->ACBFlag, GLITCH_TO_NS(pACB->glitch_cfg)*12); - SPRINTF("Statistics: Nr of Cmnds %li, Cmnds not sent directly %li, Out of SRB conds %li\n", + SPRINTF("Statistics: Cmnds %li, Cmnds not sent directly %li, Out of SRB conds %li\n", pACB->Cmds, pACB->CmdInQ, pACB->CmdOutOfSRB); - SPRINTF(" Nr of lost arbitrations %li\n", pACB->SelLost); + SPRINTF(" Lost arbitrations %li\n", pACB->SelLost); SPRINTF("Nr of attached devices: %i, Nr of DCBs: %i\n", pACB->DeviceCnt, pACB->DCBCnt);