Messages in this thread Patch in this message | | | Date | Thu, 26 Feb 1998 02:30:49 +0100 (CET) | From | Kurt Garloff <> | Subject | DC390-driver 1.12 for Linux-2.1 (fwd) |
| |
Sorry, if you get this twice. I had a problem with my ISP connection and the last one did get sent incompletely.
Kurt Garloff, Dortmund <K.Garloff@ping.de> PGP key on http://student.physik.uni-dortmund.de/homepages/garloff
---------- Forwarded message ---------- Date: Wed, 25 Feb 1998 23:55:24 +0100 (CET) From: Kurt Garloff <garloff@kg1.ping.de> To: ... Subject: DC390-driver 1.12 for Linux-2.1
Hi folks,
here is the update from version 1.10 of the DC390 SCSI driver included in Linux-2.1.8X to 1.12. It includes the 1.11 changes (support for large disks and shared IRQs) and some cleaning of the code (the version check #ifdefs are not needed within the 2.X.X kernels). The patch is against 2.1.88.
The 1.11 version was out for more than a year now and proved to be stable. However, somehow the 1.10 was included into the kernels (2.0.31, 2.1.5X) and not updated yet. I hope, my 1.11 patch gets into 2.0.34 and this patch (1.12) into 2.1.89 or 90.
Things that I plan to do during the next time on the driver: - General AM53C974 support. At the moment, the driver relies on the DC390 BIOS settings. - Init parameters, esp. important for non DC390's - Dynamic config changes via write to /proc/scsi/tmtscim/? - Identify a problem reported twice: CD-R not seen by kernel (/proc/scsi/scsi) but by the driver (/proc/scsi/tmscsim/?)
Kurt Garloff, Dortmund <K.Garloff@ping.de> PGP key on http://student.physik.uni-dortmund.de/homepages/garloff --- linux/drivers/scsi/tmscsim.h.110 Wed May 14 07:41:13 1997 +++ linux/drivers/scsi/tmscsim.h Wed Feb 25 22:23:54 1998 @@ -4,8 +4,8 @@ ;* Device Driver * ;***********************************************************************/ -#ifndef TMSCSIM_H -#define TMSCSIM_H +#ifndef _TMSCSIM_H +#define _TMSCSIM_H #define IRQ_NONE 255 @@ -677,4 +677,4 @@ (PCI_CFG2_ENABLE | (((function) << 1) & 0xe)) -#endif /* TMSCSIM_H */ +#endif /* _TMSCSIM_H */ --- linux/drivers/scsi/tmscsim.c.110 Thu Jul 10 16:55:30 1997 +++ linux/drivers/scsi/tmscsim.c Wed Feb 25 22:14:48 1998 @@ -24,6 +24,9 @@ * 1.09 11/30/96 KG Added register the allocated IO space * * 1.10 12/05/96 CLH Modified tmscsim_proc_info(), and reset * * pending interrupt in DC390_detect() * + * 1.11 02/05/97 KG/CLH Fixeds problem with partitions greater * + * than 1GB * + * 1.12 25/02/98 KG Cleaned up ifdefs for 2.1 kernel * ***********************************************************************/ @@ -32,7 +35,7 @@ #define SCSI_MALLOC #ifdef MODULE -#include <linux/module.h> +# include <linux/module.h> #endif #include <asm/dma.h> @@ -677,11 +680,11 @@ sectors = 32; cylinders = disk->capacity / (heads * sectors); - if ( cylinders > 1024) + if ( (pACB->Gmode2 & GREATER_1G) && (cylinders > 1024) ) { heads = 255; sectors = 63; - cylinders = disk->capacity / (255 * 63); + cylinders = disk->capacity / (heads * sectors); } geom[0] = heads; @@ -898,11 +901,7 @@ * Returns : 0 on success. ***********************************************************************/ -#ifdef VERSION_2_0_0 int DC390_reset(Scsi_Cmnd *cmd, unsigned int resetFlags) -#else -int DC390_reset (Scsi_Cmnd *cmd) -#endif { USHORT ioport; unsigned long flags; @@ -1161,7 +1160,7 @@ if( !used_irq ) { - if( request_irq(Irq, DC390_Interrupt, SA_INTERRUPT, "tmscsim", NULL)) + if( request_irq(Irq, DC390_Interrupt, SA_INTERRUPT | SA_SHIRQ, "tmscsim", NULL)) { printk("DC390: register IRQ error!\n"); return( -1 ); @@ -1763,11 +1762,11 @@ if (acbpnt == (PACB)-1) return(-ESRCH); if(!shpnt) return(-ESRCH); - if(inout) // Has data been written to the file ? + if(inout) /* Has data been written to the file ? */ return(tmscsim_set_info(buffer, length, shpnt)); SPRINTF("Tekram DC390(T) PCI SCSI Host Adadpter, "); - SPRINTF("Driver Version 1.10, 1996/12/05\n"); + SPRINTF("Driver Version 1.12, 1998/02/25\n"); save_flags(flags); cli(); --- linux/drivers/scsi/dc390.h.110 Sat Feb 21 04:13:25 1998 +++ linux/drivers/scsi/dc390.h Wed Feb 25 22:20:06 1998 @@ -5,19 +5,7 @@ * Bus Master Host Adapter * ***********************************************************************/ -/* Kernel version autodetection */ - #include <linux/version.h> -/* Convert Linux Version, Patch-level, Sub-level to LINUX_VERSION_CODE. */ -#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) - -#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,50) -#define VERSION_ELF_1_2_13 -#elseif LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,95) -#define VERSION_1_3_85 -#else -#define VERSION_2_0_0 -#endif /* * AMD 53C974 driver, header file @@ -28,45 +16,27 @@ #if defined(HOSTS_C) || defined(MODULE) -#ifdef VERSION_2_0_0 #include <scsi/scsicam.h> -#else -#include <linux/scsicam.h> -#endif extern int DC390_detect(Scsi_Host_Template *psht); extern int DC390_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)); extern int DC390_abort(Scsi_Cmnd *cmd); - -#ifdef VERSION_2_0_0 extern int DC390_reset(Scsi_Cmnd *cmd, unsigned int resetFlags); -#else -extern int DC390_reset(Scsi_Cmnd *cmd); -#endif - -#ifdef VERSION_ELF_1_2_13 -extern int DC390_bios_param(Disk *disk, int devno, int geom[]); -#else extern int DC390_bios_param(Disk *disk, kdev_t devno, int geom[]); -#endif #ifdef MODULE static int DC390_release(struct Scsi_Host *); #else -#define DC390_release NULL +# define DC390_release NULL #endif -#ifndef VERSION_ELF_1_2_13 extern struct proc_dir_entry proc_scsi_tmscsim; extern int tmscsim_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout); -#endif - -#ifdef VERSION_2_0_0 #define DC390_T { \ proc_dir: &proc_scsi_tmscsim, \ - proc_info: tmscsim_proc_info, \ - name: "Tekram DC390(T) V1.10 Dec-05-1996",\ + proc_info: tmscsim_proc_info, \ + name: "Tekram DC390(T) V1.12 Feb-25-1998",\ detect: DC390_detect, \ release: DC390_release, \ queuecommand: DC390_queue_command, \ @@ -79,61 +49,6 @@ cmd_per_lun: 2, \ use_clustering: DISABLE_CLUSTERING \ } -#endif - - -#ifdef VERSION_1_3_85 - -#define DC390_T { \ - NULL, /* *next */ \ - NULL, /* *usage_count */ \ - &proc_scsi_tmscsim, /* *proc_dir */ \ - tmscsim_proc_info, /* (*proc_info)() */ \ - "Tekram DC390(T) V1.10 Dec-05-1996", /* *name */ \ - DC390_detect, \ - DC390_release, /* (*release)() */ \ - NULL, /* *(*info)() */ \ - NULL, /* (*command)() */ \ - DC390_queue_command, \ - DC390_abort, \ - DC390_reset, \ - NULL, /* slave attach */\ - DC390_bios_param, \ - 10,/* can queue(-1) */ \ - 7, /* id(-1) */ \ - SG_ALL, \ - 2, /* cmd per lun(2) */ \ - 0, /* present */ \ - 0, /* unchecked isa dma */ \ - DISABLE_CLUSTERING \ - } -#endif - - -#ifdef VERSION_ELF_1_2_13 - -#define DC390_T { \ - NULL, \ - NULL, \ - "Tekram DC390(T) V1.10 Dec-05-1996",\ - DC390_detect, \ - DC390_release, \ - NULL, /* info */ \ - NULL, /* command, deprecated */ \ - DC390_queue_command, \ - DC390_abort, \ - DC390_reset, \ - NULL, /* slave attach */\ - DC390_bios_param, \ - 10,/* can queue(-1) */ \ - 7, /* id(-1) */ \ - 16,/* old (SG_ALL) */ \ - 2, /* cmd per lun(2) */ \ - 0, /* present */ \ - 0, /* unchecked isa dma */ \ - DISABLE_CLUSTERING \ - } -#endif #endif /* defined(HOSTS_C) || defined(MODULE) */ --- linux/drivers/scsi/scsiiom.c.110 Wed May 14 07:41:13 1997 +++ linux/drivers/scsi/scsiiom.c Wed Feb 25 22:24:58 1998 @@ -175,13 +175,8 @@ } -#ifndef VERSION_ELF_1_2_13 static void DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs) -#else -static void -DC390_Interrupt( int irq, struct pt_regs *regs) -#endif { PACB pACB; PDCB pDCB; @@ -303,11 +298,7 @@ pSRB->pSegmentList++; psgl = pSRB->pSegmentList; -#ifndef VERSION_ELF_1_2_13 pSRB->SGPhysAddr = virt_to_phys( psgl->address ); -#else - pSRB->SGPhysAddr = (ULONG) psgl->address; -#endif pSRB->SGToBeXferLen = (ULONG) psgl->length; } else @@ -368,11 +359,7 @@ pSRB->pSegmentList++; psgl = pSRB->pSegmentList; -#ifndef VERSION_ELF_1_2_13 pSRB->SGPhysAddr = virt_to_phys( psgl->address ); -#else - pSRB->SGPhysAddr = (ULONG) psgl->address; -#endif pSRB->SGToBeXferLen = (ULONG) psgl->length; } else @@ -427,11 +414,7 @@ if( residual ) { bval = inb(ioport+ScsiFifo); /* get residual byte */ -#ifndef VERSION_ELF_1_2_13 ptr = (PUCHAR) phys_to_virt( pSRB->SGPhysAddr ); -#else - ptr = (PUCHAR) pSRB->SGPhysAddr; -#endif *ptr = bval; pSRB->SGPhysAddr++; pSRB->TotalXferredLen++; @@ -643,11 +626,7 @@ if( !pSRB->SGToBeXferLen ) { psgl = pSRB->pSegmentList; -#ifndef VERSION_ELF_1_2_13 pSRB->SGPhysAddr = virt_to_phys( psgl->address ); -#else - pSRB->SGPhysAddr = (ULONG) psgl->address; -#endif pSRB->SGToBeXferLen = (ULONG) psgl->length; } lval = pSRB->SGToBeXferLen; | |