From: Kenn H. <ke...@us...> - 2001-02-21 23:59:36
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/scsi In directory usw-pr-cvs1:/tmp/cvs-serv14265 Modified Files: vax-5380.c vax-5380.h Log Message: VS3100m76 SCSI sort of, kind of, seems to work... Index: vax-5380.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/scsi/vax-5380.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- vax-5380.c 2001/01/17 16:00:11 1.1 +++ vax-5380.c 2001/02/22 00:00:36 1.2 @@ -54,6 +54,9 @@ /* * $Log$ + * Revision 1.2 2001/02/22 00:00:36 kenn + * VS3100m76 SCSI sort of, kind of, seems to work... + * * Revision 1.1 2001/01/17 16:00:11 atp * First pass add in of vax files into 2.4 tree * @@ -109,19 +112,21 @@ */ -__initfunc(int vax_5380_detect(Scsi_Host_Template * tpnt)) { +int __init vax_5380_detect(Scsi_Host_Template * tpnt) { struct Scsi_Host *instance; - unsigned char *base; + unsigned long base; + tpnt->proc_name = "vax5380"; + tpnt->proc_info = vax_5380_proc_info; #if INTERNAL_SCSI - base = (char *) 0x200c0080; + base = 0x200c0080; #else - base = (char *) 0x200c0180; + base = 0x200c0180; #endif instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata)); - instance->base = ioremap((unsigned int)base, 0x80); + instance->base = (unsigned long) ioremap(base, 0x80); NCR5380_init(instance, 0); @@ -151,8 +156,7 @@ } #endif - printk("scsi%d : at 0x%08x", instance->host_no, (int) - instance->base); + printk("scsi%d : at 0x%08lx", instance->host_no, instance->base); if (instance->irq == IRQ_NONE) printk (" interrupts disabled"); else @@ -194,6 +198,7 @@ return 0; } +#ifdef PSEUDO_DMA /* * Function : int NCR5380_pread (struct Scsi_Host *instance, * unsigned char *dst, int len) @@ -206,38 +211,35 @@ * Returns : 0 on success, non zero on a failure such as a watchdog * timeout. */ - static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst, int len) { -#if 0 - register unsigned char *reg = (unsigned char *) (instance->base + - T_DATA_REG_OFFSET), *d = dst; + unsigned long base = instance->base; + unsigned char *d = dst; register int i = len; #if 0 for (; i; --i) { - while (!(instance->base[T_STATUS_REG_OFFSET]) & T_ST_RDY) barrier(); + while (!(NCR5380_read(T_STATUS_REG_OFFSET) & T_ST_RDY) barrier(); #else - while (!(instance->base[T_STATUS_REG_OFFSET]) & T_ST_RDY) barrier(); + while (!(NCR5380_read(T_STATUS_REG_OFFSET) & T_ST_RDY) barrier(); for (; i; --i) { #endif - *d++ = *reg; + *d++ = NCR5380_read(T_DATA_REG_OFFSET); } - if (*(instance->base + T_STATUS_REG_OFFSET) & T_ST_TIM) { + if (NCR5380_read(T_STATUS_REG_OFFSET) & T_ST_TIM) { unsigned char tmp; - volatile unsigned char *foo; - foo = instance->base + T_CONTROL_REG_OFFSET; - tmp = *foo; - *foo = tmp | T_CR_CT; - *foo = tmp; + + tmp = NCR5380_read(T_CONTROL_REG_OFFSET); + NCR5380_write(T_CONTROL_REG_OFFSET, tmp | T_CR_CT); + NCR5380_write(T_CONTROL_REG_OFFSET, tmp); + printk("scsi%d : watchdog timer fired in NCR5380_pread()\n", instance->host_no); return -1; } else -#endif return 0; } @@ -257,41 +259,39 @@ static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src, int len) { -#if 0 - register unsigned char *reg = (unsigned char *) (instance->base + - T_DATA_REG_OFFSET), *s = src; + unsigned long base = instance->base; + register unsigned char *s = src; register int i = len; #if 0 for (; i; --i) { - while (!(instance->base[T_STATUS_REG_OFFSET]) & T_ST_RDY) barrier(); + while (!(NCR5380_read(T_STATUS_REG_OFFSET) & T_ST_RDY) barrier(); #else - while (!(instance->base[T_STATUS_REG_OFFSET]) & T_ST_RDY) barrier(); + while (!(NCR5380_read(T_STATUS_REG_OFFSET) & T_ST_RDY) barrier(); for (; i; --i) { #endif - *reg = *s++; + NCR5380_write(T_DATA_REG_OFFSET, *s++); } - if (*(instance->base + T_STATUS_REG_OFFSET) & T_ST_TIM) { + if (NCF5380_read(T_STATUS_REG_OFFSET) & T_ST_TIM) { unsigned char tmp; - volatile unsigned char *foo; - foo = instance->base + T_CONTROL_REG_OFFSET; - tmp = *foo; - *foo = tmp | T_CR_CT; - *foo = tmp; + + tmp = NCR5380_read(T_CONTROL_REG_OFFSET); + NCR5380_write(T_CONTROL_REG_OFFSET, tmp | T_CR_CT); + NCR5380_write(T_CONTROL_REG_OFFSET, tmp); + printk("scsi%d : watchdog timer fired in NCR5380_pwrite()\n", instance->host_no); return -1; } else -#endif return 0; } +#endif /* PSEUDO_DMA */ + #include "NCR5380.c" -#ifdef MODULE /* Eventually this will go into an include file, but this will be later */ -Scsi_Host_Template driver_template = VAX_5380_TEMPLATE; +static Scsi_Host_Template driver_template = VAX_5380_TEMPLATE; #include "scsi_module.c" -#endif Index: vax-5380.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/scsi/vax-5380.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- vax-5380.h 2001/01/17 16:00:11 1.1 +++ vax-5380.h 2001/02/22 00:00:36 1.2 @@ -31,6 +31,9 @@ /* * $Log$ + * Revision 1.2 2001/02/22 00:00:36 kenn + * VS3100m76 SCSI sort of, kind of, seems to work... + * * Revision 1.1 2001/01/17 16:00:11 atp * First pass add in of vax files into 2.4 tree * @@ -59,6 +62,9 @@ int vax_5380_detect(Scsi_Host_Template *); int vax_5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); int vax_5380_reset(Scsi_Cmnd *, unsigned int reset_flags); +int vax_5380_proc_info (char *buffer, char **start, off_t offset, + int length, int hostno, int inout); + #ifndef NULL #define NULL 0 @@ -78,8 +84,6 @@ * macros when this is being used solely for the host stub. */ -#if defined(HOSTS_C) || defined(MODULE) - #define VAX_5380_TEMPLATE { \ name: "VAXstation 3100/MicroVAX 3100 NCR5380 SCSI", \ detect: vax_5380_detect, \ @@ -93,18 +97,16 @@ cmd_per_lun: CMD_PER_LUN, \ use_clustering: DISABLE_CLUSTERING} -#endif - #ifndef HOSTS_C #define NCR5380_implementation_fields \ - volatile unsigned char *base + unsigned volatile char *base #define NCR5380_local_declare() \ - volatile unsigned char *base + unsigned volatile char *base #define NCR5380_setup(instance) \ - base = (volatile unsigned char *) (instance)->base + base = (unsigned volatile char *)((instance)->base) #define VAX_5380_address(reg) (base + ((reg) * 0x04)) @@ -128,6 +130,7 @@ #define NCR5380_queue_command vax_5380_queue_command #define NCR5380_abort vax_5380_abort #define NCR5380_reset vax_5380_reset +#define NCR5380_proc_info vax_5380_proc_info #endif /* else def HOSTS_C */ #endif /* ndef ASM */ |