? .tmscsim.o.flags ? Rules.make Index: Makefile.dc390 =================================================================== RCS file: /home/cvsroot/dc390/Attic/Makefile.dc390,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- Makefile.dc390 2000/05/18 07:42:35 1.1.2.2 +++ Makefile.dc390 2000/09/29 20:01:47 1.1.2.3 @@ -12,7 +12,7 @@ include $(KDIR)/Makefile TOPDIR := $(KDIR) -CFLAGS := -I. -I $(KDIR)/drivers/scsi $(CFLAGS) -DMODULE +CFLAGS := -I. -I $(KDIR)/drivers/scsi -I $(KDIR)/include $(CFLAGS) -DMODULE tmscsim.o: dc390.h tmscsim.h scsiiom.c tmscsim.c arch Rules.make Index: README.tmscsim =================================================================== RCS file: /home/cvsroot/dc390/README.tmscsim,v retrieving revision 2.25.2.4 retrieving revision 2.25.2.5 diff -u -r2.25.2.4 -r2.25.2.5 --- README.tmscsim 2000/05/24 14:31:23 2.25.2.4 +++ README.tmscsim 2000/09/29 17:32:35 2.25.2.5 @@ -401,7 +401,7 @@ maybe the DC390 log messages to the report. Bug reports should be send to me (Kurt Garloff ) as well -as to the linux-scsi list (), as sometimes bugs +as to the linux-scsi list (), as sometimes bugs are caused by the SCSI mid-level code. I will ask you for some more details and probably I will also ask you to @@ -442,4 +442,4 @@ ------------------------------------------------------------------------- Written by Kurt Garloff 1998/06/11 Last updated 2000/01/17, driver revision 2.0d25 -$Id: README.tmscsim,v 2.25.2.4 2000/05/24 14:31:23 garloff Exp $ +$Id: README.tmscsim,v 2.25.2.5 2000/09/29 17:32:35 garloff Exp $ Index: dc390.h =================================================================== RCS file: /home/cvsroot/dc390/dc390.h,v retrieving revision 2.43.2.13 retrieving revision 2.43.2.17 diff -u -r2.43.2.13 -r2.43.2.17 --- dc390.h 2000/05/23 13:12:55 2.43.2.13 +++ dc390.h 2000/10/13 15:15:00 2.43.2.17 @@ -4,7 +4,7 @@ * Description: Device Driver for Tekram DC-390(T) PCI SCSI * * Bus Master Host Adapter * ***********************************************************************/ -/* $Id: dc390.h,v 2.43.2.13 2000/05/23 13:12:55 garloff Exp $ */ +/* $Id: dc390.h,v 2.43.2.17 2000/10/13 15:15:00 garloff Exp $ */ /* * DC390/AMD 53C974 driver, header file @@ -19,7 +19,7 @@ #endif #define DC390_BANNER "Tekram DC390/AM53C974" -#define DC390_VERSION "2.0e 2000/05/23" +#define DC390_VERSION "2.0e4 2000/10/13" /* We don't have eh_abort_handler, eh_device_reset_handler, * eh_bus_reset_handler, eh_host_reset_handler yet! @@ -33,7 +33,7 @@ # define USE_NEW_EH #endif -#if defined(HOSTS_C) || defined(MODULE) +#if defined(HOSTS_C) || defined(MODULE) || LINUX_VERSION_CODE > KERNEL_VERSION(2,3,99) extern int DC390_detect(Scsi_Host_Template *psht); extern int DC390_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)); @@ -47,9 +47,6 @@ # define DC390_release NULL #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,30) -extern struct proc_dir_entry DC390_proc_scsi_tmscsim; -#endif extern int DC390_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,30) @@ -72,6 +69,7 @@ use_clustering: DISABLE_CLUSTERING \ } #else +extern struct proc_dir_entry DC390_proc_scsi_tmscsim; #define DC390_T { \ proc_dir: &DC390_proc_scsi_tmscsim, \ proc_info: DC390_proc_info, \ Index: scsiiom.c =================================================================== RCS file: /home/cvsroot/dc390/scsiiom.c,v retrieving revision 2.55.2.10 retrieving revision 2.55.2.15 diff -u -r2.55.2.10 -r2.55.2.15 --- scsiiom.c 2000/05/22 19:26:47 2.55.2.10 +++ scsiiom.c 2000/09/29 19:56:14 2.55.2.15 @@ -4,7 +4,7 @@ * Description: Device Driver for Tekram DC-390 (T) PCI SCSI * * Bus Master Host Adapter * ***********************************************************************/ -/* $Id: scsiiom.c,v 2.55.2.10 2000/05/22 19:26:47 garloff Exp $ */ +/* $Id: scsiiom.c,v 2.55.2.15 2000/09/29 19:56:14 garloff Exp $ */ static void __inline__ dc390_freetag (PDCB pDCB, PSRB pSRB) @@ -56,7 +56,7 @@ * (pSRB->pcmd->cmnd[0] == TEST_UNIT_READY)) && pACB->scan_devices) ||*/ (pSRB->SRBFlag & AUTO_REQSENSE) ) disc_allowed = 0; - if ( (pDCB->SyncMode & SYNC_ENABLE) && (pDCB->TargetLUN == 0) && + if ( (pDCB->SyncMode & SYNC_ENABLE) && (pDCB->TargetLUN == 0) && (pSRB->pcmd->device->sync) && ( ( ( (pSRB->pcmd->cmnd[0] == REQUEST_SENSE) || (pSRB->SRBFlag & AUTO_REQSENSE) ) && !(pDCB->SyncMode & SYNC_NEGO_DONE) ) || (pSRB->pcmd->cmnd[0] == INQUIRY) ) ) try_sync_nego = 1; @@ -1366,6 +1366,10 @@ pcmd = pSRB->pcmd; DCB_removed = 0; status = pSRB->TargetStatus; + ptr = (PSCSI_INQDATA) (pcmd->request_buffer); + if( pcmd->use_sg ) + ptr = (PSCSI_INQDATA) (((PSGL) ptr)->address); + DEBUG0(printk (" SRBdone (%02x,%08x), SRB %p, pid %li\n", status, pcmd->result,\ pSRB, pcmd->pid);) if(pSRB->SRBFlag & AUTO_REQSENSE) @@ -1491,7 +1495,7 @@ /* Devices are removed below ... */ } else if (status_byte(status) == BUSY && - (pSRB->pcmd->cmnd[0] == TEST_UNIT_READY || pSRB->pcmd->cmnd[0] == INQUIRY) && + (pcmd->cmnd[0] == TEST_UNIT_READY || pcmd->cmnd[0] == INQUIRY) && pACB->scan_devices) { pSRB->AdaptStatus = 0; @@ -1553,14 +1557,33 @@ SET_RES_DID(pcmd->result,DID_OK); } } + if ((pcmd->result & RES_DID) == 0 && + pcmd->cmnd[0] == INQUIRY && + pcmd->cmnd[2] == 0 && + pcmd->request_bufflen >= 8 && + ptr && + (ptr->Vers & 0x07) >= 2) + { + if (ptr->Flags & SCSI_INQ_SYNC) + pcmd->device->sync = 1; + if (ptr->Flags & SCSI_INQ_WBUS16) + pcmd->device->wide = 1; + /* Handled by mid-layer + if (((unsigned char*)(pcmd->buffer))[7] & 0x02) + pcmd->device->tagged_supported = 1; + */ + } ckc_e: if( pACB->scan_devices ) { - if( pSRB->pcmd->cmnd[0] == TEST_UNIT_READY ) + if( pcmd->cmnd[0] == TEST_UNIT_READY /*|| + pcmd->cmnd[0] == INQUIRY*/) { #ifdef DC390_DEBUG0 - printk (KERN_INFO "DC390: Test_Unit_Ready: result: %08x", pcmd->result); + printk (KERN_INFO "DC390: %s: result: %08x", + (pcmd->cmnd[0] == INQUIRY? "INQUIRY": "TEST_UNIT_READY"), + pcmd->result); if (pcmd->result & (DRIVER_SENSE << 24)) printk (" (sense: %02x %02x %02x %02x)\n", pcmd->sense_buffer[0], pcmd->sense_buffer[1], pcmd->sense_buffer[2], pcmd->sense_buffer[3]); @@ -1590,12 +1613,9 @@ //if( pSRB->pcmd->cmnd[0] == INQUIRY && // (host_byte(pcmd->result) == DID_OK || status_byte(pcmd->result) & CHECK_CONDITION) ) - if( pSRB->pcmd->cmnd[0] == INQUIRY && + if( pcmd->cmnd[0] == INQUIRY && (pcmd->result == (DID_OK << 16) || status_byte(pcmd->result) & CHECK_CONDITION) ) { - ptr = (PSCSI_INQDATA) (pcmd->request_buffer); - if( pcmd->use_sg ) - ptr = (PSCSI_INQDATA) (((PSGL) ptr)->address); if ((ptr->DevType & SCSI_DEVTYPE) == TYPE_NODEV) { /* device not present: remove */ @@ -1613,7 +1633,7 @@ }; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,30) - pcmd->resid = pSRB->request_bufflen - pSRB->TotalXferredLen; + pcmd->resid = pcmd->request_bufflen - pSRB->TotalXferredLen; #endif if (!DCB_removed) dc390_Going_remove (pDCB, pSRB); Index: tmscsim.c =================================================================== RCS file: /home/cvsroot/dc390/tmscsim.c,v retrieving revision 2.60.2.19 retrieving revision 2.60.2.24 diff -u -r2.60.2.19 -r2.60.2.24 --- tmscsim.c 2000/05/23 13:12:04 2.60.2.19 +++ tmscsim.c 2000/10/13 15:15:00 2.60.2.24 @@ -7,7 +7,7 @@ ***********************************************************************/ /* (C) Copyright: put under GNU GPL in 10/96 (see README.tmscsim) * *************************************************************************/ -/* $Id: tmscsim.c,v 2.60.2.19 2000/05/23 13:12:04 garloff Exp $ */ +/* $Id: tmscsim.c,v 2.60.2.24 2000/10/13 15:15:00 garloff Exp $ */ /* Enhancements and bugfixes by * * Kurt Garloff * ***********************************************************************/ @@ -153,6 +153,12 @@ * Reset: Unlock, but refuse to queue * * 2.3 __setup function * * 2.0e 00/05/22 KG Return residual for 2.3 * + * 2.0e1 00/05/25 KG Compile fixes for 2.3.99 * + * 2.0e2 00/05/27 KG Jeff Garzik's pci_enable_device() * + * 2.0e3 00/09/29 KG Some 2.4 changes. Don't try Sync Nego * + * before INQUIRY has reported ability. * + * Recognise INQUIRY as scanning command. * + * 2.0e4 00/10/13 KG Allow compilation into 2.4 kernel * ***********************************************************************/ /* Uncomment SA_INTERRUPT, if the driver refuses to share its IRQ with other devices */ @@ -272,7 +278,7 @@ # if USE_SPINLOCKS == 3 /* both */ -# if defined (__SMP__) || DEBUG_SPINLOCKS > 0 +# if defined (CONFIG_SMP) || DEBUG_SPINLOCKS > 0 # define DC390_LOCKA_INIT { spinlock_t __unlocked = SPIN_LOCK_UNLOCKED; pACB->lock = __unlocked; }; # else # define DC390_LOCKA_INIT @@ -1198,7 +1204,8 @@ return (0); } - if( (pACB->scan_devices || cmd->cmnd[0] == TEST_UNIT_READY) && !(pACB->DCBmap[cmd->target] & (1 << cmd->lun)) ) + if( (pACB->scan_devices || cmd->cmnd[0] == TEST_UNIT_READY || cmd->cmnd[0] == INQUIRY) && + !(pACB->DCBmap[cmd->target] & (1 << cmd->lun)) ) { pACB->scan_devices = 1; @@ -1208,7 +1215,7 @@ printk (KERN_ERR "DC390: kmalloc for DCB failed, target %02x lun %02x\n", cmd->target, cmd->lun); DC390_UNLOCK_ACB; - printk ("DC390: No DCB in queuecommand!\n"); + printk ("DC390: No DCB in queue_command!\n"); #ifdef USE_NEW_EH return (1); #else @@ -1948,7 +1955,11 @@ psh->io_port = io_port; psh->n_io_port = 0x80; psh->irq = Irq; +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,50) + psh->base = io_port; +#else psh->base = (char*)io_port; +#endif psh->unique_id = io_port; psh->dma_channel = -1; psh->last_reset = jiffies; @@ -2242,6 +2253,10 @@ if ( PCI_PRESENT ) while (PCI_FIND_DEVICE (PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD53C974)) { +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,30) + if (pci_enable_device (pdev)) + continue; +#endif //DC390_LOCK_IO; /* Remove this when going to new eh */ PCI_GET_IO_AND_IRQ; DEBUG0(printk(KERN_INFO "DC390(%i): IO_PORT=%04x,IRQ=%x\n", dc390_adapterCnt, (UINT) io_port, irq);) @@ -2980,7 +2995,12 @@ DC390_UNLOCK_IO; return( 1 ); } +#endif /* def MODULE */ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,99) +static Scsi_Host_Template driver_template = DC390_T; +#include "scsi_module.c" +#elif defined(MODULE) Scsi_Host_Template driver_template = DC390_T; #include "scsi_module.c" -#endif /* def MODULE */ +#endif Index: tmscsim.h =================================================================== RCS file: /home/cvsroot/dc390/tmscsim.h,v retrieving revision 2.15.2.1 retrieving revision 2.15.2.2 diff -u -r2.15.2.1 -r2.15.2.2 --- tmscsim.h 2000/02/08 21:53:57 2.15.2.1 +++ tmscsim.h 2000/09/29 17:32:36 2.15.2.2 @@ -3,12 +3,22 @@ ;* TEKRAM DC-390(T) PCI SCSI Bus Master Host Adapter * ;* Device Driver * ;***********************************************************************/ -/* $Id: tmscsim.h,v 2.15.2.1 2000/02/08 21:53:57 garloff Exp $ */ +/* $Id: tmscsim.h,v 2.15.2.2 2000/09/29 17:32:36 garloff Exp $ */ #ifndef _TMSCSIM_H #define _TMSCSIM_H #include +#include +/* 2.0 compat */ +#if defined(__SMP__) && !defined(CONFIG_SMP) +# if LINUX_VERSION_CODE < KERNEL_VERSION (2,2,0) +# define CONFIG_SMP +# else +# error __SMP__ defined but not CONFIG_SMP +# endif +#endif + #define IRQ_NONE 255 @@ -222,7 +232,7 @@ UCHAR pad; /* 0x3c: */ -#if defined(USE_SPINLOCKS) && USE_SPINLOCKS > 1 && (defined(__SMP__) || DEBUG_SPINLOCKS > 0) +#if defined(USE_SPINLOCKS) && USE_SPINLOCKS > 1 && (defined(CONFIG_SMP) || DEBUG_SPINLOCKS > 0) spinlock_t lock; #endif UCHAR sel_timeout; @@ -438,8 +448,12 @@ /* Peripheral Device Type definitions */ /* see include/scsi/scsi.h for the rest */ -#define TYPE_PRINTER 0x02 /* Printer device */ -#define TYPE_COMM 0x09 /* Communications device */ +#ifndef TYPE_PRINTER +# define TYPE_PRINTER 0x02 /* Printer device */ +#endif +#ifndef TYPE_COMM +# define TYPE_COMM 0x09 /* Communications device */ +#endif /* ** Inquiry flag definitions (Inq data byte 7)