summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-04-19 04:00:00 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-04-19 04:00:00 +0000
commit46e045034336a2cc90c1798cd7cc07af744ddfd6 (patch)
tree3b9b51fc482e729f663d25333e77fbed9aaa939a /drivers/scsi
parent31dc59d503a02e84c4de98826452acaeb56dc15a (diff)
Merge with Linux 2.3.99-pre4.
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/ChangeLog.ncr53c8xx10
-rw-r--r--drivers/scsi/ChangeLog.sym53c8xx8
-rw-r--r--drivers/scsi/Config.in31
-rw-r--r--drivers/scsi/Makefile8
-rw-r--r--drivers/scsi/dmx3191d.c125
-rw-r--r--drivers/scsi/dmx3191d.h74
-rw-r--r--drivers/scsi/esp.c9
-rw-r--r--drivers/scsi/esp.h4
-rw-r--r--drivers/scsi/hosts.c7
-rw-r--r--drivers/scsi/hosts.h2
-rw-r--r--drivers/scsi/ncr53c8xx.c34
-rw-r--r--drivers/scsi/qlogicisp.c8
-rw-r--r--drivers/scsi/scsi.c2
-rw-r--r--drivers/scsi/sd.c4
-rw-r--r--drivers/scsi/sg.c52
-rw-r--r--drivers/scsi/sym53c8xx.c35
-rw-r--r--drivers/scsi/sym53c8xx_comm.h10
-rw-r--r--drivers/scsi/wd33c93.c2
18 files changed, 336 insertions, 89 deletions
diff --git a/drivers/scsi/ChangeLog.ncr53c8xx b/drivers/scsi/ChangeLog.ncr53c8xx
index 8f4d4f19c..678042b16 100644
--- a/drivers/scsi/ChangeLog.ncr53c8xx
+++ b/drivers/scsi/ChangeLog.ncr53c8xx
@@ -1,3 +1,13 @@
+Sat Apr 1 12:00 2000 Gerard Roudier (groudier@club-internet.fr)
+ * revision 3.2h
+ - Fix a compilation problem on Alpha introduced in version 3.2g.
+ (`port' changed to `base_io').
+ - Move from `sym' to this driver a tiny change for __sparc__ that
+ applies to cache line size (? Probably from David S Miller).
+ - Make sure no data transfer will happen for Scsi_Cmnd requests
+ that supply SCSI_DATA_NONE direction (this avoids some BUG()
+ statement in the PCI code when a data buffer is also supplied).
+
Mon March 6 23:15 2000 Gerard Roudier (groudier@club-internet.fr)
* revision 3.2g
- Add the file sym53c8xx_comm.h that collects code that should
diff --git a/drivers/scsi/ChangeLog.sym53c8xx b/drivers/scsi/ChangeLog.sym53c8xx
index 47448ec71..84f7ea1c8 100644
--- a/drivers/scsi/ChangeLog.sym53c8xx
+++ b/drivers/scsi/ChangeLog.sym53c8xx
@@ -1,3 +1,11 @@
+Sat Apr 1 12:00 2000 Gerard Roudier (groudier@club-internet.fr)
+ * revision 1.5l
+ - Tiny change for __sparc__ appeared in 2.3.99-pre4.1 that
+ applies to cache line size (? Probably from David S Miller).
+ - Make sure no data transfer will happen for Scsi_Cmnd requests
+ that supply SCSI_DATA_NONE direction (this avoids some BUG()
+ statement in the PCI code when a data buffer is also supplied).
+
Mon Mar 6 23:30 2000 Gerard Roudier (groudier@club-internet.fr)
* version sym53c8xx-1.5k
- Test against expected data transfer direction from SCRIPTS.
diff --git a/drivers/scsi/Config.in b/drivers/scsi/Config.in
index b0407de9e..a12560ec9 100644
--- a/drivers/scsi/Config.in
+++ b/drivers/scsi/Config.in
@@ -55,7 +55,9 @@ if [ "$CONFIG_SCSI_AIC7XXX" != "n" ]; then
bool ' Collect statistics to report in /proc' CONFIG_AIC7XXX_PROC_STATS
int ' Delay in seconds after SCSI bus reset' CONFIG_AIC7XXX_RESET_DELAY 5
fi
-dep_tristate 'IBM ServeRAID support' CONFIG_SCSI_IPS $CONFIG_SCSI
+if [ "$CONFIG_X86" = "y" ]; then
+ dep_tristate 'IBM ServeRAID support' CONFIG_SCSI_IPS $CONFIG_SCSI
+fi
dep_tristate 'AdvanSys SCSI support' CONFIG_SCSI_ADVANSYS $CONFIG_SCSI
dep_tristate 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 $CONFIG_SCSI
dep_tristate 'AM53/79C974 PCI SCSI support' CONFIG_SCSI_AM53C974 $CONFIG_SCSI
@@ -65,6 +67,7 @@ dep_tristate 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC $CONFIG_SCSI
if [ "$CONFIG_SCSI_BUSLOGIC" != "n" ]; then
bool ' Omit FlashPoint support' CONFIG_SCSI_OMIT_FLASHPOINT
fi
+dep_tristate 'DMX3191D SCSI support' CONFIG_SCSI_DMX3191D $CONFIG_SCSI $CONFIG_PCI
dep_tristate 'DTC3180/3280 SCSI support' CONFIG_SCSI_DTC3280 $CONFIG_SCSI
dep_tristate 'EATA ISA/EISA/PCI (DPT and generic EATA/DMA-compliant boards) support' CONFIG_SCSI_EATA $CONFIG_SCSI
if [ "$CONFIG_SCSI_EATA" != "n" ]; then
@@ -86,10 +89,8 @@ if [ "$CONFIG_SCSI_GENERIC_NCR5380" != "n" ]; then
"Port CONFIG_SCSI_G_NCR5380_PORT \
Memory CONFIG_SCSI_G_NCR5380_MEM" Port
fi
-if [ "$CONFIG_PCI" = "y" ]; then
- dep_tristate 'Initio 9100U(W) support' CONFIG_SCSI_INITIO $CONFIG_SCSI
- dep_tristate 'Initio INI-A100U2W support' CONFIG_SCSI_INIA100 $CONFIG_SCSI
-fi
+dep_tristate 'Initio 9100U(W) support' CONFIG_SCSI_INITIO $CONFIG_SCSI $CONFIG_PCI
+dep_tristate 'Initio INI-A100U2W support' CONFIG_SCSI_INIA100 $CONFIG_SCSI $CONFIG_PCI
if [ "$CONFIG_PARPORT" != "n" ]; then
dep_tristate 'IOMEGA parallel port (ppa - older drives)' CONFIG_SCSI_PPA $CONFIG_SCSI $CONFIG_PARPORT
dep_tristate 'IOMEGA parallel port (imm - newer drives)' CONFIG_SCSI_IMM $CONFIG_SCSI $CONFIG_PARPORT
@@ -101,13 +102,11 @@ fi
dep_tristate 'NCR53c406a SCSI support' CONFIG_SCSI_NCR53C406A $CONFIG_SCSI
dep_tristate 'symbios 53c416 SCSI support' CONFIG_SCSI_SYM53C416 $CONFIG_SCSI
dep_tristate 'Simple 53c710 SCSI support (Compaq, NCR machines)' CONFIG_SCSI_SIM710 $CONFIG_SCSI
-if [ "$CONFIG_PCI" = "y" ]; then
- dep_tristate 'NCR53c7,8xx SCSI support' CONFIG_SCSI_NCR53C7xx $CONFIG_SCSI
- if [ "$CONFIG_SCSI_NCR53C7xx" != "n" ]; then
- bool ' always negotiate synchronous transfers' CONFIG_SCSI_NCR53C7xx_sync
- bool ' allow FAST-SCSI [10MHz]' CONFIG_SCSI_NCR53C7xx_FAST
- bool ' allow DISCONNECT' CONFIG_SCSI_NCR53C7xx_DISCONNECT
- fi
+dep_tristate 'NCR53c7,8xx SCSI support' CONFIG_SCSI_NCR53C7xx $CONFIG_SCSI $CONFIG_PCI
+if [ "$CONFIG_SCSI_NCR53C7xx" != "n" ]; then
+ bool ' always negotiate synchronous transfers' CONFIG_SCSI_NCR53C7xx_sync
+ bool ' allow FAST-SCSI [10MHz]' CONFIG_SCSI_NCR53C7xx_FAST
+ bool ' allow DISCONNECT' CONFIG_SCSI_NCR53C7xx_DISCONNECT
fi
if [ "$CONFIG_PCI" = "y" -a "$CONFIG_SCSI_NCR53C7xx" != "y" ]; then
dep_tristate 'NCR53C8XX SCSI support' CONFIG_SCSI_NCR53C8XX $CONFIG_SCSI
@@ -149,7 +148,9 @@ if [ "$CONFIG_PCI" = "y" ]; then
dep_tristate 'Qlogic ISP FC SCSI support' CONFIG_SCSI_QLOGIC_FC $CONFIG_SCSI
dep_tristate 'Qlogic QLA 1280 SCSI support' CONFIG_SCSI_QLOGIC_1280 $CONFIG_SCSI
fi
-dep_tristate 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE $CONFIG_SCSI
+if [ "$CONFIG_X86" = "y" ]; then
+ dep_tristate 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE $CONFIG_SCSI
+fi
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
@@ -162,7 +163,9 @@ dep_tristate 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F $CONFIG_SCSI
bool ' enable elevator sorting' CONFIG_SCSI_U14_34F_LINKED_COMMANDS
int ' maximum number of queued commands' CONFIG_SCSI_U14_34F_MAX_TAGS 8
fi
-dep_tristate 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR $CONFIG_SCSI
+if [ "$CONFIG_X86" = "y" ]; then
+ dep_tristate 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR $CONFIG_SCSI
+fi
#
# Note - this is a very special 'host' adapter that simulates the presence of some disks.
# It can come in very handy for troubleshooting. Anyone else is welcome to use it - all
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index 81a164066..e5531e006 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -613,6 +613,14 @@ else
endif
endif
+ifeq ($(CONFIG_SCSI_DMX3191D),y)
+L_OBJS += dmx3191d.o
+else
+ ifeq ($(CONFIG_SCSI_DMX3191D),m)
+ M_OBJS += dmx3191d.o
+ endif
+endif
+
ifeq ($(CONFIG_SCSI_DTC3280),y)
L_OBJS += dtc.o
else
diff --git a/drivers/scsi/dmx3191d.c b/drivers/scsi/dmx3191d.c
new file mode 100644
index 000000000..2bc31ea28
--- /dev/null
+++ b/drivers/scsi/dmx3191d.c
@@ -0,0 +1,125 @@
+
+/*
+ dmx3191d.c - midlevel driver for the Domex DMX3191D SCSI card.
+ Copyright (C) 2000 by Massimo Piccioni <dafastidio@libero.it>
+
+ Based on the generic NCR5380 driver by Drew Eckhardt et al.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include <asm/io.h>
+#include <asm/system.h>
+#include <linux/blk.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/sched.h>
+#include <linux/signal.h>
+#include <linux/stat.h>
+#include <linux/version.h>
+
+#include "scsi.h"
+#include "hosts.h"
+#include "constants.h"
+#include "sd.h"
+
+#include "dmx3191d.h"
+
+/* play with these values to tune up your system performances */
+/* default setting from g_NCR5380.c */
+/*
+#define USLEEP
+#define USLEEP_POLL 1
+#define USLEEP_SLEEP 20
+#define USLEEP_WAITLONG 500
+*/
+
+#define AUTOSENSE
+#include "NCR5380.h"
+#include "NCR5380.c"
+
+
+int __init dmx3191d_detect(Scsi_Host_Template *tmpl) {
+ int boards = 0;
+ struct Scsi_Host *instance = NULL;
+ struct pci_dev *pdev = NULL;
+
+ if (!pci_present()) {
+ dmx3191d_printk("PCI support not enabled\n");
+ return 0;
+ }
+
+ tmpl->proc_name = DMX3191D_DRIVER_NAME;
+
+ while ((pdev = pci_find_device(PCI_VENDOR_ID_DOMEX,
+ PCI_DEVICE_ID_DOMEX_DMX3191D, pdev))) {
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,13)
+ unsigned long port = pdev->base_address[0] & PCI_IOADDRESS_MASK;
+#else
+ unsigned long port = pdev->resource[0].start;
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,3,13) */
+
+ if (check_region(port, DMX3191D_REGION)) {
+ dmx3191d_printk("region 0x%lx-0x%lx already reserved\n",
+ port, port + DMX3191D_REGION);
+ continue;
+ }
+
+ request_region(port, DMX3191D_REGION, DMX3191D_DRIVER_NAME);
+
+ instance = scsi_register(tmpl, sizeof(struct NCR5380_hostdata));
+ instance->io_port = port;
+ instance->irq = pdev->irq;
+ NCR5380_init(instance, FLAG_NO_PSEUDO_DMA | FLAG_DTC3181E);
+
+ if (request_irq(pdev->irq, dmx3191d_do_intr, SA_SHIRQ,
+ DMX3191D_DRIVER_NAME, instance)) {
+ dmx3191d_printk("irq %d not available\n", pdev->irq);
+ /* Steam powered scsi controllers run without an IRQ
+ anyway */
+ instance->irq = IRQ_NONE;
+ }
+
+ boards++;
+ }
+ return boards;
+}
+
+const char * dmx3191d_info(struct Scsi_Host *host) {
+ static const char *info ="Domex DMX3191D";
+
+ return info;
+}
+
+int dmx3191d_release_resources(struct Scsi_Host *instance)
+{
+ release_region(instance->io_port, DMX3191D_REGION);
+ if(instance->irq!=IRQ_NONE)
+ free_irq(instance->irq, instance);
+
+ return 0;
+}
+
+
+#ifdef MODULE
+Scsi_Host_Template driver_template = DMX3191D;
+
+#include "scsi_module.c"
+
+#endif /* MODULE */
+
diff --git a/drivers/scsi/dmx3191d.h b/drivers/scsi/dmx3191d.h
new file mode 100644
index 000000000..c037d3bf0
--- /dev/null
+++ b/drivers/scsi/dmx3191d.h
@@ -0,0 +1,74 @@
+
+/*
+ dmx3191d.h - defines for the Domex DMX3191D SCSI card.
+ Copyright (C) 2000 by Massimo Piccioni <dafastidio@libero.it>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+*/
+
+#ifndef __DMX3191D_H
+#define __DMX3191D_H
+
+#define DMX3191D_DRIVER_NAME "dmx3191d"
+#define DMX3191D_REGION 8
+
+#ifndef PCI_VENDOR_ID_DOMEX
+#define PCI_VENDOR_ID_DOMEX 0x134a
+#define PCI_DEVICE_ID_DOMEX_DMX3191D 0x0001
+#endif
+
+#define dmx3191d_printk( args... ) printk(__FILE__": " ##args)
+
+#ifndef ASM
+int dmx3191d_abort(Scsi_Cmnd *);
+int dmx3191d_detect(Scsi_Host_Template *);
+const char* dmx3191d_info(struct Scsi_Host *);
+int dmx3191d_proc_info(char *, char **, off_t, int, int, int);
+int dmx3191d_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
+int dmx3191d_release_resources(struct Scsi_Host *);
+int dmx3191d_reset(Scsi_Cmnd *, unsigned int);
+
+
+#if defined(HOSTS_C) || defined(MODULE)
+#define DMX3191D { \
+ proc_info: dmx3191d_proc_info, \
+ name: "Domex DMX3191D", \
+ detect: dmx3191d_detect, \
+ release: dmx3191d_release_resources, \
+ info: dmx3191d_info, \
+ queuecommand: dmx3191d_queue_command, \
+ abort: dmx3191d_abort, \
+ reset: dmx3191d_reset, \
+ bios_param: NULL, \
+ can_queue: 32, \
+ this_id: 7, \
+ sg_tablesize: SG_ALL, \
+ cmd_per_lun: 2, \
+ use_clustering: DISABLE_CLUSTERING \
+}
+#endif /* HOSTS_C || MODULE */
+
+
+#ifndef HOSTS_C
+#define NCR5380_read(reg) inb(port + reg)
+#define NCR5380_write(reg, value) outb(value, port + reg)
+
+#define NCR5380_implementation_fields unsigned int port
+#define NCR5380_local_declare() NCR5380_implementation_fields
+#define NCR5380_setup(instance) port = instance->io_port
+
+#define NCR5380_abort dmx3191d_abort
+#define do_NCR5380_intr dmx3191d_do_intr
+#define NCR5380_intr dmx3191d_intr
+#define NCR5380_proc_info dmx3191d_proc_info
+#define NCR5380_queue_command dmx3191d_queue_command
+#define NCR5380_reset dmx3191d_reset
+
+#endif /* HOSTS_C */
+#endif /* ASM */
+
+#endif /* __DMX3191D_H */
+
diff --git a/drivers/scsi/esp.c b/drivers/scsi/esp.c
index fccfb59c8..1dcc8acb8 100644
--- a/drivers/scsi/esp.c
+++ b/drivers/scsi/esp.c
@@ -1,4 +1,4 @@
-/* $Id: esp.c,v 1.92 2000/02/18 13:49:58 davem Exp $
+/* $Id: esp.c,v 1.94 2000/03/30 02:09:10 davem Exp $
* esp.c: EnhancedScsiProcessor Sun SCSI driver code.
*
* Copyright (C) 1995, 1998 David S. Miller (davem@caip.rutgers.edu)
@@ -4348,6 +4348,13 @@ static void esp_intr(int irq, void *dev_id, struct pt_regs *pregs)
spin_unlock_irqrestore(&esp->lock, flags);
}
+int esp_revoke(Scsi_Device* SDptr)
+{
+ struct esp *esp = (struct esp *) SDptr->host->hostdata;
+ esp->targets_present &= ~(1 << SDptr->id);
+ return 0;
+}
+
#ifdef MODULE
Scsi_Host_Template driver_template = SCSI_SPARC_ESP;
diff --git a/drivers/scsi/esp.h b/drivers/scsi/esp.h
index dfbfb9e53..9bebad41b 100644
--- a/drivers/scsi/esp.h
+++ b/drivers/scsi/esp.h
@@ -1,4 +1,4 @@
-/* $Id: esp.h,v 1.27 1999/12/15 14:12:52 davem Exp $
+/* $Id: esp.h,v 1.28 2000/03/30 01:33:17 davem Exp $
* esp.h: Defines and structures for the Sparc ESP (Enhanced SCSI
* Processor) driver under Linux.
*
@@ -398,12 +398,14 @@ extern int esp_abort(Scsi_Cmnd *);
extern int esp_reset(Scsi_Cmnd *, unsigned int);
extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
int hostno, int inout);
+extern int esp_revoke(Scsi_Device* SDptr);
#define SCSI_SPARC_ESP { \
proc_name: "esp", \
proc_info: &esp_proc_info, \
name: "Sun ESP 100/100a/200", \
detect: esp_detect, \
+ revoke: esp_revoke, \
info: esp_info, \
command: esp_command, \
queuecommand: esp_queue, \
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index b626d3fdd..56c441a62 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -205,6 +205,10 @@
#include "t128.h"
#endif
+#ifdef CONFIG_SCSI_DMX3191D
+#include "dmx3191d.h"
+#endif
+
#ifdef CONFIG_SCSI_DTC3280
#include "dtc.h"
#endif
@@ -554,6 +558,9 @@ static Scsi_Host_Template builtin_scsi_hosts[] =
#ifdef CONFIG_SCSI_T128
TRANTOR_T128,
#endif
+#ifdef CONFIG_SCSI_DMX3191D
+ DMX3191D,
+#endif
#ifdef CONFIG_SCSI_DTC3280
DTC3x80,
#endif
diff --git a/drivers/scsi/hosts.h b/drivers/scsi/hosts.h
index 685925e7d..f7e546fa6 100644
--- a/drivers/scsi/hosts.h
+++ b/drivers/scsi/hosts.h
@@ -96,6 +96,8 @@ typedef struct SHT
*/
int (* detect)(struct SHT *);
+ int (*revoke)(Scsi_Device *);
+
/* Used with loadable modules to unload the host structures. Note:
* there is a default action built into the modules code which may
* be sufficient for most host adapters. Thus you may not have to supply
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c
index 5fc1bfaab..e40cdb7c2 100644
--- a/drivers/scsi/ncr53c8xx.c
+++ b/drivers/scsi/ncr53c8xx.c
@@ -104,7 +104,7 @@
/*
** Name and version of the driver
*/
-#define SCSI_NCR_DRIVER_NAME "ncr53c8xx - version 3.2g"
+#define SCSI_NCR_DRIVER_NAME "ncr53c8xx - version 3.2h"
#define SCSI_NCR_DEBUG_FLAGS (0)
@@ -1120,7 +1120,7 @@ struct ncb {
u_char revision_id; /* PCI device revision id */
u_char bus; /* PCI BUS number */
u_char device_fn; /* PCI BUS device and function */
- u_long port; /* IO space base address */
+ u_long base_io; /* IO space base address */
u_int irq; /* IRQ level */
u_int features; /* Chip features map */
u_char myaddr; /* SCSI id of the adapter */
@@ -3734,7 +3734,7 @@ ncr_attach (Scsi_Host_Template *tpnt, int unit, ncr_device *device)
*/
request_region(device->slot.io_port, 128, "ncr53c8xx");
- np->port = device->slot.io_port;
+ np->base_io = device->slot.io_port;
#ifdef SCSI_NCR_NVRAM_SUPPORT
if (nvram) {
@@ -3951,11 +3951,11 @@ attach_error:
unmap_pci_mem((vm_offset_t) np->vaddr, (u_long) 128);
}
#endif /* !NCR_IOMAPPED */
- if (np->port) {
+ if (np->base_io) {
#ifdef DEBUG_NCR53C8XX
- printk(KERN_DEBUG "%s: releasing IO region %x[%d]\n", ncr_name(np), np->port, 128);
+ printk(KERN_DEBUG "%s: releasing IO region %x[%d]\n", ncr_name(np), np->base_io, 128);
#endif
- release_region(np->port, 128);
+ release_region(np->base_io, 128);
}
if (np->irq) {
#ifdef DEBUG_NCR53C8XX
@@ -4260,11 +4260,17 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
**----------------------------------------------------
*/
- segments = ncr_scatter (np, cp, cp->cmd);
-
- if (segments < 0) {
- ncr_free_ccb(np, cp);
- return(DID_ERROR);
+ direction = scsi_data_direction(cmd);
+ if (direction != SCSI_DATA_NONE) {
+ segments = ncr_scatter (np, cp, cp->cmd);
+ if (segments < 0) {
+ ncr_free_ccb(np, cp);
+ return(DID_ERROR);
+ }
+ }
+ else {
+ cp->data_len = 0;
+ segments = 0;
}
/*----------------------------------------------------
@@ -4275,8 +4281,6 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
*/
if (!cp->data_len)
direction = SCSI_DATA_NONE;
- else
- direction = scsi_data_direction(cmd);
/*
** If data direction is UNKNOWN, speculate DATA_READ
@@ -4796,9 +4800,9 @@ static int ncr_detach(ncb_p np)
#endif /* !NCR_IOMAPPED */
#ifdef DEBUG_NCR53C8XX
- printk("%s: releasing IO region %x[%d]\n", ncr_name(np), np->port, 128);
+ printk("%s: releasing IO region %x[%d]\n", ncr_name(np), np->base_io, 128);
#endif
- release_region(np->port, 128);
+ release_region(np->base_io, 128);
/*
** Free allocated ccb(s)
diff --git a/drivers/scsi/qlogicisp.c b/drivers/scsi/qlogicisp.c
index 8e9c314ba..b5da20220 100644
--- a/drivers/scsi/qlogicisp.c
+++ b/drivers/scsi/qlogicisp.c
@@ -1389,14 +1389,6 @@ static int isp1020_init(struct Scsi_Host *sh)
return 1;
}
-#ifdef __sparc__
- command |= (PCI_COMMAND_MASTER|PCI_COMMAND_IO|PCI_COMMAND_MEMORY|
- PCI_COMMAND_INVALIDATE|PCI_COMMAND_SERR);
- pci_write_config_word(pdev, PCI_COMMAND, command);
- pci_read_config_word(pdev, PCI_COMMAND, &command);
- pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 16);
- pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 64);
-#endif
#ifdef __alpha__
/* Force ALPHA to use bus I/O and not bus MEM.
This is to avoid having to use HAE_MEM registers,
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 9fa8bc444..87236abbb 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -1866,6 +1866,8 @@ static int proc_scsi_gen_write(struct file * file, const char * buf,
* Nobody is using this device any more.
* Free all of the command structures.
*/
+ if (HBA_ptr->hostt->revoke)
+ HBA_ptr->hostt->revoke(scd);
devfs_unregister (scd->de);
scsi_release_commandblocks(scd);
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 584a84905..ac162c564 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -120,7 +120,6 @@ static int sd_ioctl(struct inode * inode, struct file * file, unsigned int cmd,
struct Scsi_Host * host;
Scsi_Device * SDev;
int diskinfo[4];
- struct hd_geometry *loc = (struct hd_geometry *) arg;
SDev = rscsi_disks[DEVICE_NR(dev)].device;
/*
@@ -138,6 +137,8 @@ static int sd_ioctl(struct inode * inode, struct file * file, unsigned int cmd,
switch (cmd)
{
case HDIO_GETGEO: /* Return BIOS disk parameters */
+ {
+ struct hd_geometry *loc = (struct hd_geometry *) arg;
if(!loc)
return -EINVAL;
@@ -164,6 +165,7 @@ static int sd_ioctl(struct inode * inode, struct file * file, unsigned int cmd,
put_user(sd[SD_PARTITION(inode->i_rdev)].start_sect, &loc->start))
return -EFAULT;
return 0;
+ }
case BLKGETSIZE: /* Return device size */
if (!arg)
return -EINVAL;
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index daca9f800..4fca4d14d 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -17,8 +17,8 @@
* any later version.
*
*/
- static char * sg_version_str = "Version: 3.1.12 (20000222)";
- static int sg_version_num = 30112; /* 2 digits for each component */
+ static char * sg_version_str = "Version: 3.1.13 (20000323)";
+ static int sg_version_num = 30113; /* 2 digits for each component */
/*
* D. P. Gilbert (dgilbert@interlog.com, dougg@triode.net.au), notes:
* - scsi logging is available via SCSI_LOG_TIMEOUT macros. First
@@ -66,8 +66,10 @@
#ifdef CONFIG_PROC_FS
#include <linux/proc_fs.h>
static int sg_proc_init(void);
+#ifdef MODULE
static void sg_proc_cleanup(void);
#endif
+#endif
#ifndef LINUX_VERSION_CODE
#include <linux/version.h>
@@ -548,12 +550,16 @@ static ssize_t sg_write(struct file * filp, const char * buf,
hp->cmd_len = (unsigned char)cmd_size;
hp->iovec_count = 0;
hp->mx_sb_len = 0;
+#if 1
+ hp->dxfer_direction = SG_DXFER_UNKNOWN;
+#else
if (input_size > 0)
hp->dxfer_direction = ((old_hdr.reply_len - size_sg_header) > 0) ?
SG_DXFER_TO_FROM_DEV : SG_DXFER_TO_DEV;
else
hp->dxfer_direction = (mxsize > 0) ? SG_DXFER_FROM_DEV :
SG_DXFER_NONE;
+#endif
hp->dxfer_len = mxsize;
hp->dxferp = (unsigned char *)buf + cmd_size;
hp->sbp = NULL;
@@ -671,6 +677,8 @@ static int sg_common_write(Sg_fd * sfp, Sg_request * srp,
SCpnt->sc_data_direction = SCSI_DATA_READ; break;
case SG_DXFER_TO_DEV:
SCpnt->sc_data_direction = SCSI_DATA_WRITE; break;
+ case SG_DXFER_UNKNOWN:
+ SCpnt->sc_data_direction = SCSI_DATA_UNKNOWN; break;
default:
SCpnt->sc_data_direction = SCSI_DATA_NONE; break;
}
@@ -1166,9 +1174,10 @@ static int sg_attach(Scsi_Device * scsidp)
for(k = 0; k < sg_template.dev_max; k++)
if(! sg_dev_arr[k]) break;
- if(k >= sg_template.dev_max) panic ("sg_dev_arr corrupt");
-
- sdp = (Sg_device *)kmalloc(sizeof(Sg_device), GFP_ATOMIC);
+ if(k < sg_template.dev_max)
+ sdp = (Sg_device *)kmalloc(sizeof(Sg_device), GFP_ATOMIC);
+ else
+ sdp = NULL;
if (NULL == sdp) {
scsidp->attached--;
write_unlock_irqrestore(&sg_dev_arr_lock, flags);
@@ -1318,12 +1327,16 @@ static int sg_start_req(Sg_request * srp)
Sg_fd * sfp = srp->parentfp;
sg_io_hdr_t * hp = &srp->header;
int dxfer_len = (int)hp->dxfer_len;
+ int dxfer_dir = hp->dxfer_direction;
Sg_scatter_hold * req_schp = &srp->data;
Sg_scatter_hold * rsv_schp = &sfp->reserve;
SCSI_LOG_TIMEOUT(4, printk("sg_start_req: dxfer_len=%d\n", dxfer_len));
- if ((hp->flags & SG_FLAG_DIRECT_IO) && (dxfer_len > 0) &&
- (hp->dxfer_direction != SG_DXFER_NONE) && (0 == hp->iovec_count) &&
+ if ((dxfer_len <= 0) || (dxfer_dir == SG_DXFER_NONE))
+ return 0;
+ if ((hp->flags & SG_FLAG_DIRECT_IO) &&
+ (dxfer_dir != SG_DXFER_UNKNOWN) &&
+ (0 == hp->iovec_count) &&
(! sfp->parentdp->device->host->unchecked_isa_dma)) {
res = sg_build_dir(srp, sfp, dxfer_len);
if (res <= 0) /* -ve -> error, 0 -> done, 1 -> try indirect */
@@ -1563,12 +1576,13 @@ static int sg_write_xfer(Sg_request * srp)
int num_xfer = 0;
int j, k, onum, usglen, ksglen, res, ok;
int iovec_count = (int)hp->iovec_count;
+ int dxfer_dir = hp->dxfer_direction;
unsigned char * p;
unsigned char * up;
int new_interface = ('\0' == hp->interface_id) ? 0 : 1;
- if ((SG_DXFER_TO_DEV == hp->dxfer_direction) ||
- (SG_DXFER_TO_FROM_DEV == hp->dxfer_direction)) {
+ if ((SG_DXFER_UNKNOWN == dxfer_dir) || (SG_DXFER_TO_DEV == dxfer_dir) ||
+ (SG_DXFER_TO_FROM_DEV == dxfer_dir)) {
num_xfer = (int)(new_interface ? hp->dxfer_len : hp->flags);
if (schp->bufflen < num_xfer)
num_xfer = schp->bufflen;
@@ -1711,12 +1725,13 @@ static int sg_read_xfer(Sg_request * srp)
int num_xfer = 0;
int j, k, onum, usglen, ksglen, res, ok;
int iovec_count = (int)hp->iovec_count;
+ int dxfer_dir = hp->dxfer_direction;
unsigned char * p;
unsigned char * up;
int new_interface = ('\0' == hp->interface_id) ? 0 : 1;
- if ((SG_DXFER_FROM_DEV == hp->dxfer_direction) ||
- (SG_DXFER_TO_FROM_DEV == hp->dxfer_direction)) {
+ if ((SG_DXFER_UNKNOWN == dxfer_dir) || (SG_DXFER_FROM_DEV == dxfer_dir) ||
+ (SG_DXFER_TO_FROM_DEV == dxfer_dir)) {
num_xfer = hp->dxfer_len;
if (schp->bufflen < num_xfer)
num_xfer = schp->bufflen;
@@ -2445,6 +2460,7 @@ static int sg_proc_init()
return 0;
}
+#ifdef MODULE
static void sg_proc_cleanup()
{
int k;
@@ -2456,6 +2472,7 @@ static void sg_proc_cleanup()
remove_proc_entry(sg_proc_leaf_names[k], sg_proc_sgp);
remove_proc_entry(sg_proc_sg_dirname, proc_scsi);
}
+#endif
static int sg_proc_dressz_read(char * buffer, char ** start, off_t offset,
int size, int * eof, void * data)
@@ -2505,7 +2522,7 @@ static int sg_proc_debug_info(char * buffer, int * len, off_t * begin,
}
read_lock(&sg_dev_arr_lock);
max_dev = sg_last_dev();
- PRINT_PROC("dev_max=%d max_active_device=%d (origin 1)\n",
+ PRINT_PROC("dev_max(currently)=%d max_active_device=%d (origin 1)\n",
sg_template.dev_max, max_dev);
PRINT_PROC(" scsi_dma_free_sectors=%u sg_pool_secs_aval=%d "
"def_reserved_size=%d\n",
@@ -2523,12 +2540,13 @@ static int sg_proc_debug_info(char * buffer, int * len, off_t * begin,
}
dev = MINOR(sdp->i_rdev);
- PRINT_PROC(" >>> device=%d(sg%d) ", dev, dev);
- PRINT_PROC("scsi%d chan=%d id=%d lun=%d em=%d sg_tablesize=%d"
+ if ((fp = sdp->headfp)) {
+ PRINT_PROC(" >>> device=%d(sg%d) ", dev, dev);
+ PRINT_PROC("scsi%d chan=%d id=%d lun=%d em=%d sg_tablesize=%d"
" excl=%d\n", scsidp->host->host_no, scsidp->channel,
scsidp->id, scsidp->lun, scsidp->host->hostt->emulated,
sdp->sg_tablesize, sdp->exclude);
- fp = sdp->headfp;
+ }
for (k = 1; fp; fp = fp->nextfp, ++k) {
PRINT_PROC(" FD(%d): timeout=%d bufflen=%d "
"(res)sgat=%d low_dma=%d\n",
@@ -2543,13 +2561,13 @@ static int sg_proc_debug_info(char * buffer, int * len, off_t * begin,
while (srp) {
hp = &srp->header;
/* stop indenting so far ... */
- PRINT_PROC(srp->res_used ? " reserved_buff>> " :
+ PRINT_PROC(srp->res_used ? " rb>> " :
((SG_INFO_DIRECT_IO_MASK & hp->info) ? " dio>> " : " "));
blen = srp->my_cmdp ? srp->my_cmdp->bufflen : srp->data.bufflen;
usg = srp->my_cmdp ? srp->my_cmdp->use_sg : srp->data.k_use_sg;
PRINT_PROC(srp->done ? "rcv: id=%d" : (srp->my_cmdp ? "act: id=%d" :
"prior: id=%d"), srp->header.pack_id);
- if (! srp->res_used) PRINT_PROC(" blen=%d", blen);
+ PRINT_PROC(" blen=%d", blen);
if (srp->done)
PRINT_PROC(" dur=%d", sg_jif_to_ms(hp->duration));
else
diff --git a/drivers/scsi/sym53c8xx.c b/drivers/scsi/sym53c8xx.c
index f9bbce41e..5c57cb275 100644
--- a/drivers/scsi/sym53c8xx.c
+++ b/drivers/scsi/sym53c8xx.c
@@ -84,7 +84,7 @@
/*
** Name and version of the driver
*/
-#define SCSI_NCR_DRIVER_NAME "sym53c8xx - version 1.5k"
+#define SCSI_NCR_DRIVER_NAME "sym53c8xx - version 1.5l"
/* #define DEBUG_896R1 */
#define SCSI_NCR_OPTIMIZE_896
@@ -6303,7 +6303,6 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
lcb_p lp = ncr_lp(np, tp, cmd->lun);
ccb_p cp;
- int segments;
u_char idmsg, *msgptr;
u_int msglen;
int direction;
@@ -6452,11 +6451,17 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
**----------------------------------------------------
*/
- cp->segments = segments = np->scatter (np, cp, cp->cmd);
-
- if (segments < 0) {
- ncr_free_ccb(np, cp);
- return(DID_ERROR);
+ direction = scsi_data_direction(cmd);
+ if (direction != SCSI_DATA_NONE) {
+ cp->segments = np->scatter (np, cp, cp->cmd);
+ if (cp->segments < 0) {
+ ncr_free_ccb(np, cp);
+ return(DID_ERROR);
+ }
+ }
+ else {
+ cp->data_len = 0;
+ cp->segments = 0;
}
/*----------------------------------------------------
@@ -6467,8 +6472,6 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
*/
if (!cp->data_len)
direction = SCSI_DATA_NONE;
- else
- direction = scsi_data_direction(cmd);
/*
** If data direction is UNKNOWN, speculate DATA_READ
@@ -6480,7 +6483,7 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
case SCSI_DATA_UNKNOWN:
case SCSI_DATA_WRITE:
goalp = NCB_SCRIPT_PHYS (np, data_out2) + 8;
- lastp = goalp - 8 - (segments * (SCR_SG_SIZE*4));
+ lastp = goalp - 8 - (cp->segments * (SCR_SG_SIZE*4));
if (direction != SCSI_DATA_UNKNOWN)
break;
cp->phys.header.wgoalp = cpu_to_scr(goalp);
@@ -6489,7 +6492,7 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
case SCSI_DATA_READ:
cp->host_flags |= HF_DATA_IN;
goalp = NCB_SCRIPT_PHYS (np, data_in2) + 8;
- lastp = goalp - 8 - (segments * (SCR_SG_SIZE*4));
+ lastp = goalp - 8 - (cp->segments * (SCR_SG_SIZE*4));
break;
default:
case SCSI_DATA_NONE:
@@ -12317,16 +12320,6 @@ sym53c8xx_pci_init(Scsi_Host_Template *tpnt, pcidev_t pdev, ncr_device *device)
#endif
#endif /* __powerpc__ */
-#ifdef __sparc__
- /*
- ** Fix-ups for sparc.
- */
- if (!cache_line_size)
- suggested_cache_line_size = 16;
-
- driver_setup.pci_fix_up |= 0x7;
-#endif /* __sparc__ */
-
#if defined(__i386__) && !defined(MODULE)
if (!cache_line_size) {
#if LINUX_VERSION_CODE < LinuxVersionCode(2,1,75)
diff --git a/drivers/scsi/sym53c8xx_comm.h b/drivers/scsi/sym53c8xx_comm.h
index fa02ff585..a9cc78a54 100644
--- a/drivers/scsi/sym53c8xx_comm.h
+++ b/drivers/scsi/sym53c8xx_comm.h
@@ -2497,16 +2497,6 @@ sym53c8xx_pci_init(Scsi_Host_Template *tpnt, pcidev_t pdev, ncr_device *device)
#endif
#endif /* __powerpc__ */
-#ifdef __sparc__
- /*
- ** Fix-ups for sparc.
- */
- if (!cache_line_size)
- suggested_cache_line_size = 16;
-
- driver_setup.pci_fix_up |= 0x7;
-#endif /* __sparc__ */
-
#if defined(__i386__) && !defined(MODULE)
if (!cache_line_size) {
#if LINUX_VERSION_CODE < LinuxVersionCode(2,1,75)
diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c
index 9234c2393..4f351e7aa 100644
--- a/drivers/scsi/wd33c93.c
+++ b/drivers/scsi/wd33c93.c
@@ -1657,7 +1657,7 @@ int wd33c93_setup (char *str)
setup_used[i] = 0;
done_setup = 1;
- return 0;
+ return 1;
}
__setup("wd33c93", wd33c93_setup);