Index: dc390/2035-scsi-singlelun.diff =================================================================== RCS file: /usr/local/cvsroot/dc390/2035-scsi-singlelun.diff,v retrieving revision 1.1 retrieving revision 2.1 diff -u -r1.1 -r2.1 Index: dc390/21115-sr_ioctl.diff =================================================================== RCS file: /usr/local/cvsroot/dc390/21115-sr_ioctl.diff,v retrieving revision 1.2 retrieving revision 2.1 diff -u -r1.2 -r2.1 Index: dc390/README.tmscsim =================================================================== RCS file: /usr/local/cvsroot/dc390/README.tmscsim,v retrieving revision 1.23 retrieving revision 2.2 diff -u -r1.23 -r2.2 --- README.tmscsim 1998/09/07 10:32:57 1.23 +++ README.tmscsim 1998/10/14 10:34:58 2.2 @@ -37,6 +37,11 @@ For a more detailed description of the driver's history, see the first lines 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), +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. 2. Installation @@ -52,23 +57,24 @@ README.tmscsim) from this directory to linux/drivers/scsi. You have to recompile your kernel/module of course. -You should apply the three patches included in dc390-120-kernel.diff -(Applying them: cd /usr/src; patch -p0 <~/dc390-120-kernel.diff) +You should apply the three patches included in dc390-20-kernel.diff +(Applying them: cd /usr/src; patch -p0 <~/dc390-20-kernel.diff) The patches are against 2.1.103, so you might have to manually resolve rejections when applying to another kernel version. The patches will update the kernel startup code to allow boot parameters to be passed to the driver, update the Documentation and finally offer you the possibility to omit the non-DC390 parts of the driver. -(You can save a few bytes of driver memory if you got a DC390 and want to -omit the support for non DC390 adapters by selecting "Omit support for -non DC390".) +(By selecting "Omit support for non DC390" you basically disable the +emulation of a DC390 EEPROM for non DC390 adapters. This saves a few bytes +of memory.) If you got a very old kernel without the tmscsim driver (pre 2.0.31) I recommend upgrading your kernel. However, if you don't want to, please contact me to get the appropriate patches. -Testing a SCSI driver is always a delicate thing to do. So please take some +Testing a SCSI driver is always a delicate thing to do. The 2.0 driver has +proven stable on many systems, but it's still a good idea to take some precautions. In an ideal world you would have a full backup of your disks. The world isn't ideal and most people don't have full backups (me neither). So take at least the following two measures: @@ -110,6 +116,7 @@ * Support for dyn. addition/removal of devices via add/remove-single-device (Try: echo "scsi add-single-device H C I L" >/proc/scsi/scsi H = Host, C = Channel, I = SCSI ID, L = SCSI LUN.) Use with care! + * Try to use the partition table for the determination of the mapping 4. Configuration via /proc/scsi/tmscsim/? @@ -160,7 +167,10 @@ SyncOffs is the offset used for synchronous negotiations; max. is 15. The last values are only shown, if Sync is enabled. (NegoPeriod is still displayed in brackets to show the values which will be used after enabling -Sync.) +Sync.) +The STOP parameter is for testing/debugging purposes only and should bet set +to No. Please don't fiddle with it, unless you want to get rid of the +contents of your disk. If you want to change a setting, you can do that by writing to /proc/scsi/tmscsim/?. Basically you have to imitate the output of driver. @@ -203,7 +213,7 @@ discussed above. The values used in this example will result in maximum performance. -(3) Special commands: You can force a driver reset, an INQUIRY command and +(3) Special commands: You can force a SCSI bus reset, an INQUIRY command and the removal of a device's DCB. This is only used for debugging when you meet problems. The parameter of the INQUIRY and remove command is the device index as shown by the @@ -228,7 +238,9 @@ 5. Configuration via boot/module parameters ------------------------------------------- With the DC390, the driver reads its EEPROM settings and IGNORES boot / -module parameters. +module parameters. If you want to override the EEPROM settings of a DC390, +you have to use the /proc/scsi/tmscsim/? interface described in the above +chapter. However, if you do have another AM53C974 based adapter you might want to adjust some settings before you are able to write to the /proc/scsi/tmscsim/? @@ -323,11 +335,16 @@ * TagQ and Disconnection (Resel: SRB Tag Seleection) * Problems with IRQ sharing (IO-APIC on SMP Systems) (??) -* Selection / Arbitration -* Crashes with readcdda (xcdroast) +* Driver crashes with readcdda (xcdroast) Known problems: +* 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 + partition table and used a H/S = 64/32 or 255/63 translation. So if you + want to be compatible to those, use this old mapping when creating + partition tables. * 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. @@ -336,6 +353,10 @@ 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 +on the ftp server. See below.] 7. Bug reports, debugging and updates @@ -370,11 +391,12 @@ Thanks to C.L. Huang and Philip Giang (Tekram) for the initial driver release and support. Thanks to Doug Ledford, Gerard Roudier for support with SCSI coding. -Thanks to Chiaki Ishikawa, Andreas Haumer, Hubert Tonneau for intensively -testing the driver (and even risking data loss doing this). +Thanks to a lot of people (espec. Chiaki Ishikawa, Andreas Haumer, Hubert +Tonneau) for intensively testing the driver (and even risking data loss +doing this during early revisions). ------------------------------------------------------------------------- Written by Kurt Garloff 1998/06/11 -Last updated 1998/06/18, driver revision 1.20p -$Id: README.tmscsim,v 1.23 1998/09/07 10:32:57 garloff Exp $ +Last updated 1998/10/14, driver revision 2.0a +$Id: README.tmscsim,v 2.2 1998/10/14 10:34:58 garloff Exp $ Index: dc390/dc390-120-kernel.diff =================================================================== RCS file: /usr/local/cvsroot/dc390/dc390-120-kernel.diff,v retrieving revision 1.6 retrieving revision 2.1 diff -u -r1.6 -r2.1 --- dc390-120-kernel.diff 1998/08/20 10:17:46 1.6 +++ dc390-120-kernel.diff 1998/10/14 10:31:47 2.1 @@ -1,4 +1,4 @@ -# dc390-120-kernel.diff # $Id: dc390-120-kernel.diff,v 1.6 1998/08/20 10:17:46 garloff Exp $ # +# dc390-120-kernel.diff # $Id: dc390-120-kernel.diff,v 2.1 1998/10/14 10:31:47 garloff Exp $ # 8<---------------------------------------------------------------------- Patch for allowing omission of the non DC390 parts of the driver: 8<---------------------------------------------------------------------- Index: dc390/dc390.h =================================================================== RCS file: /usr/local/cvsroot/dc390/dc390.h,v retrieving revision 1.44 retrieving revision 2.1 diff -u -r1.44 -r2.1 --- dc390.h 1998/09/07 10:32:58 1.44 +++ dc390.h 1998/10/14 10:31:47 2.1 @@ -4,7 +4,7 @@ * Description: Device Driver for Tekram DC-390(T) PCI SCSI * * Bus Master Host Adapter * ***********************************************************************/ -/* $Id: dc390.h,v 1.44 1998/09/07 10:32:58 garloff Exp $ */ +/* $Id: dc390.h,v 2.1 1998/10/14 10:31:47 garloff Exp $ */ #include @@ -37,7 +37,7 @@ #define DC390_T { \ proc_dir: &DC390_proc_scsi_tmscsim, \ proc_info: DC390_proc_info, \ - name: "Tekram DC390/AM53C974 V1.20t Sep-07-1998", \ + name: "Tekram DC390/AM53C974 V2.0a Oct-14-1998", \ 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 1.67 retrieving revision 2.1 diff -u -r1.67 -r2.1 --- scsiiom.c 1998/09/07 10:45:50 1.67 +++ scsiiom.c 1998/10/14 10:31:48 2.1 @@ -4,7 +4,7 @@ * Description: Device Driver for Tekram DC-390 (T) PCI SCSI * * Bus Master Host Adapter * ***********************************************************************/ -/* $Id: scsiiom.c,v 1.67 1998/09/07 10:45:50 garloff Exp $ */ +/* $Id: scsiiom.c,v 2.1 1998/10/14 10:31:48 garloff Exp $ */ UCHAR dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB ) @@ -187,6 +187,8 @@ PCI_WRITE_CONFIG_WORD (PDEV, PCI_STATUS, (PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_DETECTED_PARITY));};) dstate = DC390_read8 (DMA_Status); + DC390_write8 (DMA_Status, dstate); /* clear */ + //DC390_write8 (DMA_Status, DMA_XFER_DONE | DMA_XFER_ABORT | DMA_XFER_ERROR | PCI_MS_ABORT); /* clear */ if (! pACB->pActiveDCB || ! pACB->pActiveDCB->pActiveSRB) return dstate; else pSRB = pACB->pActiveDCB->pActiveSRB; @@ -194,26 +196,24 @@ if (dstate & (DMA_XFER_ABORT | DMA_XFER_ERROR | POWER_DOWN | PCI_MS_ABORT)) { printk (KERN_ERR "DC390: DMA error (%02x)!\n", dstate); - DC390_write8 (DMA_Status, dstate); /* clear status */ return dstate; }; if (dstate & DMA_XFER_DONE) { - ULONG residual, xferCnt; int ctr = 3000000; - DC390_write8 (DMA_Status, DMA_XFER_DONE); /* clear */ + ULONG residual, xferCnt; int ctr = 5000000; if (! (DC390_read8 (DMA_Cmd) & READ_DIRECTION)) { do { DEBUG1(printk (KERN_DEBUG "DC390: read residual bytes ... \n");) dstate = DC390_read8 (DMA_Status); + DC390_write8 (DMA_Status, dstate); /* clear */ residual = DC390_read8 (CtcReg_Low) | DC390_read8 (CtcReg_Mid) << 8 | DC390_read8 (CtcReg_High) << 16; residual += DC390_read8 (Current_Fifo) & 0x1f; } while (residual && ! (dstate & SCSI_INTERRUPT) && --ctr); - if (!ctr) printk (KERN_CRIT "DC390: DataOut_0: DMA aborted unfinished: %06x bytes remain!\n", DC390_read32 (DMA_Wk_ByteCntr)); + if (!ctr) printk (KERN_CRIT "DC390: dma_intr: DMA aborted unfinished: %06x bytes remain!\n", DC390_read32 (DMA_Wk_ByteCntr)); /* residual = ... */ - //DC390_write8 (DMA_Status, DMA_XFER_DONE); /* clear */ } else residual = 0; @@ -252,7 +252,7 @@ if (pACB == 0) { - printk(KERN_ERR "DC390: Interrupt on uninitalized adapter!\n"); + printk(KERN_ERR "DC390: Interrupt on uninitialized adapter!\n"); return; } DC390_LOCK_DRV; @@ -390,10 +390,11 @@ if( sstatus & COUNT_2_ZERO ) { - int ctr = 3000000; /* only try for about a tenth of a second */ - while( --ctr && !(DC390_read8 (DMA_Status) & DMA_XFER_DONE) && pSRB->SGToBeXferLen ); - DC390_write8 (DMA_Status, DMA_XFER_DONE); /* clear */ + int ctr = 5000000; /* only try for about a tenth of a second */ + while( --ctr && !(DC390_read8 (DMA_Status) & DMA_XFER_DONE) && pSRB->SGToBeXferLen ) + DC390_write8 (DMA_Status, DMA_XFER_DONE | DMA_XFER_ABORT | DMA_XFER_ERROR | PCI_MS_ABORT); /* clear */ if (!ctr) printk (KERN_CRIT "DC390: DataOut_0: DMA aborted unfinished: %06x bytes remain!\n", DC390_read32 (DMA_Wk_ByteCntr)); + DC390_write8 (DMA_Status, DMA_XFER_DONE | DMA_XFER_ABORT | DMA_XFER_ERROR | PCI_MS_ABORT); /* clear */ pSRB->TotalXferredLen += pSRB->SGToBeXferLen; pSRB->SGIndex++; if( pSRB->SGIndex < pSRB->SGcount ) @@ -440,14 +441,17 @@ if( sstatus & COUNT_2_ZERO ) { - int ctr = 3000000; /* only try for about a tenth of a second */ - while( --ctr && !(DC390_read8 (DMA_Status) & DMA_XFER_DONE) && pSRB->SGToBeXferLen ); - if (!ctr) printk (KERN_CRIT "DC390: DataOut_0: DMA aborted unfinished: %06x bytes remain!\n", DC390_read32 (DMA_Wk_ByteCntr)); + int ctr = 5000000; /* only try for about a tenth of a second */ + int dstate = 0; + while( --ctr && !((dstate = DC390_read8 (DMA_Status)) & DMA_XFER_DONE) && pSRB->SGToBeXferLen ) + DC390_write8 (DMA_Status, DMA_XFER_DONE | DMA_XFER_ABORT | DMA_XFER_ERROR | PCI_MS_ABORT); /* clear */ + if (!ctr) printk (KERN_CRIT "DC390: DataIn_0: DMA aborted unfinished: %06x bytes remain!\n", DC390_read32 (DMA_Wk_ByteCntr)); + if (!ctr) printk (KERN_CRIT "DC390: DataIn_0: DMA State: %i\n", dstate); DEBUG1(ResidCnt = ((ULONG) DC390_read8 (CtcReg_High) << 16) \ + ((ULONG) DC390_read8 (CtcReg_Mid) << 8) \ + ((ULONG) DC390_read8 (CtcReg_Low));) DEBUG1(printk ("Count_2_Zero (ResidCnt=%li,ToBeXfer=%li),", ResidCnt, pSRB->SGToBeXferLen);) - DC390_write8 (DMA_Status, DMA_XFER_DONE); /* clear */ + DC390_write8 (DMA_Status, DMA_XFER_DONE | DMA_XFER_ABORT | DMA_XFER_ERROR | PCI_MS_ABORT); /* clear */ DC390_write8 (DMA_Cmd, READ_DIRECTION+DMA_IDLE_CMD); /* | DMA_INT */ @@ -496,9 +500,9 @@ 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_Status, DMA_XFER_DONE); /* clear */ 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 1.82 retrieving revision 2.1 diff -u -r1.82 -r2.1 --- tmscsim.c 1998/09/07 10:32:58 1.82 +++ tmscsim.c 1998/10/14 10:31:48 2.1 @@ -5,7 +5,7 @@ * Bus Master Host Adapter * * (C)Copyright 1995-1996 Tekram Technology Co., Ltd. * ***********************************************************************/ -/* $Id: tmscsim.c,v 1.82 1998/09/07 10:32:58 garloff Exp $ */ +/* $Id: tmscsim.c,v 2.1 1998/10/14 10:31:48 garloff Exp $ */ /* Enhancements and bugfixes by * * Kurt Garloff * ***********************************************************************/ @@ -83,6 +83,11 @@ * initfunc -> __init; better abort; * * Timeout for XFER_DONE & BLAST_COMPLETE; * * Allow up to 33 commands being processed * + * 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. * ***********************************************************************/ /* Uncomment SA_INTERRUPT, if the driver refuses to share its IRQ with other devices */ @@ -896,6 +901,84 @@ }; } +/* We ignore mapping problems, as we expect everybody to respect + * valid partition tables. Waiting for complaints ;-) */ + +#ifdef CONFIG_SCSI_DC390T_TRADMAP +/* + * The next function, partsize(), is copied from scsicam.c. + * + * This is ugly code duplication, but I didn't find another way to solve it: + * We want to respect the partition table and if it fails, we apply the + * DC390 BIOS heuristic. Too bad, just calling scsicam_bios_param() doesn't do + * the job, because we don't know, whether the values returned are from + * the part. table or determined by setsize(). Unfortunately the setsize() + * values differ from the ones chosen by the DC390 BIOS. + * + * Looking forward to seeing suggestions for a better solution! KG, 98/10/14 + */ +#include + +/* + * Function : static int partsize(struct buffer_head *bh, unsigned long + * capacity,unsigned int *cyls, unsigned int *hds, unsigned int *secs); + * + * Purpose : to determine the BIOS mapping used to create the partition + * table, storing the results in *cyls, *hds, and *secs + * + * Returns : -1 on failure, 0 on success. + * + */ + +static int partsize(struct buffer_head *bh, unsigned long capacity, + unsigned int *cyls, unsigned int *hds, unsigned int *secs) { + struct partition *p, *largest = NULL; + int i, largest_cyl; + int cyl, ext_cyl, end_head, end_cyl, end_sector; + unsigned int logical_end, physical_end, ext_physical_end; + + + if (*(unsigned short *) (bh->b_data+510) == 0xAA55) { + for (largest_cyl = -1, p = (struct partition *) + (0x1BE + bh->b_data), i = 0; i < 4; ++i, ++p) { + if (!p->sys_ind) + continue; + cyl = p->cyl + ((p->sector & 0xc0) << 2); + if (cyl > largest_cyl) { + largest_cyl = cyl; + largest = p; + } + } + } + + if (largest) { + end_cyl = largest->end_cyl + ((largest->end_sector & 0xc0) << 2); + end_head = largest->end_head; + end_sector = largest->end_sector & 0x3f; + + physical_end = end_cyl * (end_head + 1) * end_sector + + end_head * end_sector + end_sector; + + /* This is the actual _sector_ number at the end */ + logical_end = get_unaligned(&largest->start_sect) + + get_unaligned(&largest->nr_sects); + + /* This is for >1023 cylinders */ + ext_cyl= (logical_end-(end_head * end_sector + end_sector)) + /(end_head + 1) / end_sector; + ext_physical_end = ext_cyl * (end_head + 1) * end_sector + + end_head * end_sector + end_sector; + + if ((logical_end == physical_end) || + (end_cyl==1023 && ext_physical_end==logical_end)) { + *secs = end_sector; + *hds = end_head + 1; + *cyls = capacity / ((end_head + 1) * end_sector); + return 0; + } + } + return -1; +} /*********************************************************************** * Function: @@ -903,6 +986,7 @@ * * Description: * Return the disk geometry for the given SCSI device. + * Respect the partition table, otherwise try own heuristic * * Note: * In contrary to other externally callable funcs (DC390_), we don't lock @@ -910,37 +994,57 @@ int DC390_bios_param (Disk *disk, kdev_t devno, int geom[]) { int heads, sectors, cylinders; - PACB pACB; - - pACB = (PACB) disk->device->host->hostdata; - heads = 64; - sectors = 32; - cylinders = disk->capacity / (heads * sectors); + PACB pACB = (PACB) disk->device->host->hostdata; + struct buffer_head *bh; + int ret_code = -1; + int size = disk->capacity; - if ( (pACB->Gmode2 & GREATER_1G) && (cylinders > 1024) ) + if ((bh = bread(MKDEV(MAJOR(devno), MINOR(devno)&~0xf), 0, 1024))) { - heads = 255; - sectors = 63; - cylinders = disk->capacity / (heads * sectors); + /* try to infer mapping from partition table */ + ret_code = partsize (bh, (unsigned long) size, (unsigned int *) geom + 2, + (unsigned int *) geom + 0, (unsigned int *) geom + 1); + brelse (bh); } + if (ret_code == -1) + { + heads = 64; + sectors = 32; + cylinders = size / (heads * sectors); + + if ( (pACB->Gmode2 & GREATER_1G) && (cylinders > 1024) ) + { + heads = 255; + sectors = 63; + cylinders = size / (heads * sectors); + } - geom[0] = heads; - geom[1] = sectors; - geom[2] = cylinders; + geom[0] = heads; + geom[1] = sectors; + geom[2] = cylinders; + } return (0); } - +#else +int DC390_bios_param (Disk *disk, kdev_t devno, int geom[]) +{ + return scsicam_bios_param (disk, devno, geom); +}; +#endif void dc390_dumpinfo (PACB pACB, PDCB pDCB, PSRB pSRB) { USHORT pstat; PDEVDECL1; - if (pSRB) printk ("DC390: SRB: Xferred %08lx, Remain %08lx, State %08lx, Phase %02x\n", - pSRB->TotalXferredLen, pSRB->SGToBeXferLen, pSRB->SRBState, - pSRB->ScsiPhase); - printk ("DC390: AdpaterStatus: %02x, SRB Status %02x\n", pSRB->AdaptStatus, pSRB->SRBStatus); + if (pSRB) + { + printk ("DC390: SRB: Xferred %08lx, Remain %08lx, State %08lx, Phase %02x\n", + pSRB->TotalXferredLen, pSRB->SGToBeXferLen, pSRB->SRBState, + pSRB->ScsiPhase); + printk ("DC390: AdpaterStatus: %02x, SRB Status %02x\n", pSRB->AdaptStatus, pSRB->SRBStatus); + }; printk ("DC390: Status of last IRQ (DMA/SC/Int/IRQ): %08lx\n", dc390_laststatus); printk ("DC390: Register dump: SCSI block:\n"); printk ("DC390: XferCnt Cmd Stat IntS IRQS FFIS Ctl1 Ctl2 Ctl3 Ctl4\n"); @@ -958,6 +1062,7 @@ DC390_read8(DMA_Status), DC390_read32(DMA_ScsiBusCtrl)); PDEVSET1; PCI_READ_CONFIG_WORD(PDEV, PCI_STATUS, &pstat); printk ("DC390: Register dump: PCI Status: %04x\n", pstat); + printk ("DC390: Please report driver trouble to K.Garloff@ping.de\n"); }; @@ -1457,7 +1562,7 @@ int __init dc390_initAdapter (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index) { PACB pACB, pacb; - UCHAR used_irq = 0; + UCHAR used_irq = 0, dstate; int i; pacb = dc390_pACB_start; @@ -1516,6 +1621,8 @@ DC390_write8 (DMA_Cmd, DMA_IDLE_CMD); DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD); DC390_write32 (DMA_ScsiBusCtrl, WRT_ERASE_DMA_STAT | EN_INT_ON_PCI_ABORT); + dstate = DC390_read8 (DMA_Status); + DC390_write8 (DMA_Status, dstate); /* clear */ return(0); } @@ -1716,11 +1823,12 @@ if (dc390_CheckEEpromCheckSum (PDEV, index)) { - int period; - printk (KERN_WARNING "DC390_init: No EEPROM found!\n"); #ifdef CONFIG_SCSI_DC390T_NOGENSUPP + printk (KERN_ERR "DC390_init: No EEPROM found!\n"); return( -1 ); #else + int period; + printk (KERN_INFO "DC390_init: No EEPROM found!\n"); printk (KERN_INFO "DC390_init: Trying default EEPROM settings:\n"); dc390_checkparams (); period = dc390_clock_period1[tmscsim[1]]; @@ -1732,8 +1840,6 @@ #endif }; - DC390_read8_ (INT_Status, io_port); /* Reset Pending INT */ - psh = scsi_register( psht, sizeof(DC390_ACB) ); if( !psh ) return( -1 ); @@ -1760,6 +1866,8 @@ dc390_initACB( psh, io_port, Irq, index ); PDEVSET; + DC390_read8_ (INT_Status, io_port); /* Reset Pending INT */ + if( !dc390_initAdapter( psh, io_port, Irq, index ) ) { pACB = (PACB) psh->hostdata; @@ -1781,6 +1889,8 @@ DEBUG0(printk("DC390: ACB size= %4x, DCB size= %4x, SRB size= %4x\n",\ sizeof(DC390_ACB), sizeof(DC390_DCB), sizeof(DC390_SRB) );) + DC390_read8_ (INT_Status, io_port); /* Reset Pending INT */ + DC390_UNLOCK_ACB; return (0); } @@ -1858,10 +1968,10 @@ if ( PCI_PRESENT ) while (PCI_FIND_DEVICE (PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD53C974)) { + DC390_LOCK_IO; /* Remove this when going to new eh */ PCI_GET_IO_AND_IRQ; DEBUG0(printk(KERN_DEBUG "DC390(%i): IO_PORT=%04x,IRQ=%x\n", adaptCnt, (UINT) io_port, irq);) - DC390_LOCK_IO; /* Remove this when going to new eh */ if( !DC390_init(psht, io_port, irq, PDEV, adaptCnt)) { PCI_SET_MASTER; @@ -2280,7 +2390,7 @@ return dc390_set_info(buffer, length, pACB); SPRINTF("Tekram DC390/AM53C974 PCI SCSI Host Adapter, "); - SPRINTF("Driver Version 1.20t, 1998/09/07\n"); + SPRINTF("Driver Version 2.0a, 1998/10/14\n"); DC390_LOCK_ACB; Index: dc390/tmscsim.h =================================================================== RCS file: /usr/local/cvsroot/dc390/tmscsim.h,v retrieving revision 1.32 retrieving revision 2.1 diff -u -r1.32 -r2.1 --- tmscsim.h 1998/09/07 10:32:58 1.32 +++ tmscsim.h 1998/10/14 10:31:48 2.1 @@ -3,7 +3,7 @@ ;* TEKRAM DC-390(T) PCI SCSI Bus Master Host Adapter * ;* Device Driver * ;***********************************************************************/ -/* $Id: tmscsim.h,v 1.32 1998/09/07 10:32:58 garloff Exp $ */ +/* $Id: tmscsim.h,v 2.1 1998/10/14 10:31:48 garloff Exp $ */ #ifndef _TMSCSIM_H #define _TMSCSIM_H @@ -13,7 +13,7 @@ #define MAX_ADAPTER_NUM 4 #define MAX_SG_LIST_BUF 16 #define MAX_CMD_PER_LUN 8 -#define MAX_CMD_QUEUE 4*MAX_CMD_PER_LUN+1 +#define MAX_CMD_QUEUE 2*MAX_CMD_PER_LUN+1 #define MAX_SCSI_ID 8 #define MAX_SRB_CNT MAX_CMD_QUEUE+1 /* Max number of started commands */ #define END_SCAN 2