Commit 03977d26 authored by James Bottomley's avatar James Bottomley

Merge raven.il.steeleye.com:/home/jejb/BK/scsi-misc-2.5

into raven.il.steeleye.com:/home/jejb/BK/scsi-for-linus-2.5
parents f8546efb 4f14b1c5
...@@ -946,16 +946,6 @@ config SCSI_SYM53C8XX_2 ...@@ -946,16 +946,6 @@ config SCSI_SYM53C8XX_2
Please read <file:drivers/scsi/sym53c8xx_2/Documentation.txt> for more Please read <file:drivers/scsi/sym53c8xx_2/Documentation.txt> for more
information. information.
config SCSI_ZALON
tristate "Zalon SCSI support"
depends on GSC && SCSI
help
The Zalon is a GSC/HSC bus interface chip that sits between the
PA-RISC processor and the NCR 53c720 SCSI controller on C100,
C110, J200, J210 and some D, K & R-class machines. It's also
used on the add-in Bluefish, Barracuda & Shrike SCSI cards.
Say Y here if you have one of these machines or cards.
config SCSI_SYM53C8XX_DMA_ADDRESSING_MODE config SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
int "DMA addressing mode" int "DMA addressing mode"
depends on SCSI_SYM53C8XX_2 depends on SCSI_SYM53C8XX_2
...@@ -1010,9 +1000,19 @@ config SCSI_SYM53C8XX_IOMAPPED ...@@ -1010,9 +1000,19 @@ config SCSI_SYM53C8XX_IOMAPPED
If you say Y here, the driver will preferently use normal IO rather than If you say Y here, the driver will preferently use normal IO rather than
memory mapped IO. memory mapped IO.
config SCSI_ZALON
tristate "Zalon SCSI support"
depends on GSC && SCSI
help
The Zalon is a GSC/HSC bus interface chip that sits between the
PA-RISC processor and the NCR 53c720 SCSI controller on C100,
C110, J200, J210 and some D, K & R-class machines. It's also
used on the add-in Bluefish, Barracuda & Shrike SCSI cards.
Say Y here if you have one of these machines or cards.
config SCSI_NCR53C8XX config SCSI_NCR53C8XX
tristate "NCR53C8XX SCSI support" tristate "NCR53C8XX SCSI support"
depends on PCI && SCSI_SYM53C8XX_2!=y && SCSI depends on PCI && SCSI_SYM53C8XX_2!=y && SCSI_ZALON!=y && SCSI
---help--- ---help---
This is the BSD ncr driver adapted to Linux for the NCR53C8XX family This is the BSD ncr driver adapted to Linux for the NCR53C8XX family
of PCI-SCSI controllers. This driver supports parity checking, of PCI-SCSI controllers. This driver supports parity checking,
......
...@@ -271,13 +271,8 @@ ...@@ -271,13 +271,8 @@
**************************************************************************/ **************************************************************************/
#include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#ifdef PCMCIA
#undef MODULE
#endif
#include <linux/config.h> /* for CONFIG_PCI */
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/blk.h> #include <linux/blk.h>
...@@ -295,9 +290,13 @@ ...@@ -295,9 +290,13 @@
#include "scsi.h" #include "scsi.h"
#include "hosts.h" #include "hosts.h"
#include "fdomain.h"
MODULE_AUTHOR("Rickard E. Faith");
MODULE_DESCRIPTION("Future domain SCSI driver");
MODULE_LICENSE("GPL");
#define VERSION "$Revision: 5.50 $" #define VERSION "$Revision: 5.51 $"
/* START OF USER DEFINABLE OPTIONS */ /* START OF USER DEFINABLE OPTIONS */
...@@ -421,15 +420,12 @@ static int FIFO_Size = 0x2000; /* 8k FIFO for ...@@ -421,15 +420,12 @@ static int FIFO_Size = 0x2000; /* 8k FIFO for
static void do_fdomain_16x0_intr( int irq, void *dev_id, static void do_fdomain_16x0_intr( int irq, void *dev_id,
struct pt_regs * regs ); struct pt_regs * regs );
int fdomain_16x0_bus_reset(Scsi_Cmnd *SCpnt);
#ifdef MODULE /* Allow insmod parameters to be like LILO parameters. For example:
/* Allow insmod parameters to be like LILO insmod fdomain fdomain=0x140,11 */
parameters. For example:
insmod fdomain fdomain=0x140,11
*/
static char * fdomain = NULL; static char * fdomain = NULL;
MODULE_PARM(fdomain, "s"); MODULE_PARM(fdomain, "s");
#endif
static unsigned long addresses[] = { static unsigned long addresses[] = {
0xc8000, 0xc8000,
...@@ -561,7 +557,7 @@ static void print_banner( struct Scsi_Host *shpnt ) ...@@ -561,7 +557,7 @@ static void print_banner( struct Scsi_Host *shpnt )
printk( "\n" ); printk( "\n" );
} }
static int __init fdomain_setup(char *str) int __init fdomain_setup(char *str)
{ {
int ints[4]; int ints[4];
...@@ -862,7 +858,7 @@ static int fdomain_pci_bios_detect( int *irq, int *iobase, struct pci_dev **ret_ ...@@ -862,7 +858,7 @@ static int fdomain_pci_bios_detect( int *irq, int *iobase, struct pci_dev **ret_
} }
#endif #endif
static int fdomain_16x0_detect( Scsi_Host_Template *tpnt ) struct Scsi_Host *__fdomain_16x0_detect( Scsi_Host_Template *tpnt )
{ {
int retcode; int retcode;
struct Scsi_Host *shpnt; struct Scsi_Host *shpnt;
...@@ -879,13 +875,6 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt ) ...@@ -879,13 +875,6 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
unsigned char buf[buflen]; unsigned char buf[buflen];
#endif #endif
tpnt->proc_name = "fdomain";
#ifdef MODULE
if (fdomain)
fdomain_setup(fdomain);
#endif
if (setup_called) { if (setup_called) {
#if DEBUG_DETECT #if DEBUG_DETECT
printk( "scsi: <fdomain> No BIOS, using port_base = 0x%x, irq = %d\n", printk( "scsi: <fdomain> No BIOS, using port_base = 0x%x, irq = %d\n",
...@@ -895,7 +884,7 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt ) ...@@ -895,7 +884,7 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
printk( "scsi: <fdomain> Cannot locate chip at port base 0x%x\n", printk( "scsi: <fdomain> Cannot locate chip at port base 0x%x\n",
port_base ); port_base );
printk( "scsi: <fdomain> Bad LILO/INSMOD parameters?\n" ); printk( "scsi: <fdomain> Bad LILO/INSMOD parameters?\n" );
return 0; return NULL;
} }
} else { } else {
int flag = 0; int flag = 0;
...@@ -910,7 +899,7 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt ) ...@@ -910,7 +899,7 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
if (!flag) { if (!flag) {
printk( "scsi: <fdomain> Detection failed (no card)\n" ); printk( "scsi: <fdomain> Detection failed (no card)\n" );
return 0; return NULL;
} }
} }
} }
...@@ -936,7 +925,7 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt ) ...@@ -936,7 +925,7 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
if (setup_called) { if (setup_called) {
printk(KERN_ERR "scsi: <fdomain> Bad LILO/INSMOD parameters?\n"); printk(KERN_ERR "scsi: <fdomain> Bad LILO/INSMOD parameters?\n");
} }
return 0; return NULL;
} }
if (this_id) { if (this_id) {
...@@ -957,7 +946,7 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt ) ...@@ -957,7 +946,7 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
shpnt = scsi_register( tpnt, 0 ); shpnt = scsi_register( tpnt, 0 );
if(shpnt == NULL) if(shpnt == NULL)
return 0; return NULL;
shpnt->irq = interrupt_level; shpnt->irq = interrupt_level;
shpnt->io_port = port_base; shpnt->io_port = port_base;
scsi_set_device(shpnt, &pdev->dev); scsi_set_device(shpnt, &pdev->dev);
...@@ -967,7 +956,7 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt ) ...@@ -967,7 +956,7 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
/* Log IRQ with kernel */ /* Log IRQ with kernel */
if (!interrupt_level) { if (!interrupt_level) {
printk(KERN_ERR "scsi: <fdomain> Card Detected, but driver not loaded (no IRQ)\n" ); printk(KERN_ERR "scsi: <fdomain> Card Detected, but driver not loaded (no IRQ)\n" );
return 0; return NULL;
} else { } else {
/* Register the IRQ with the kernel */ /* Register the IRQ with the kernel */
...@@ -988,7 +977,7 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt ) ...@@ -988,7 +977,7 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
printk(KERN_ERR " Send mail to faith@acm.org\n" ); printk(KERN_ERR " Send mail to faith@acm.org\n" );
} }
printk(KERN_ERR "scsi: <fdomain> Detected, but driver not loaded (IRQ)\n" ); printk(KERN_ERR "scsi: <fdomain> Detected, but driver not loaded (IRQ)\n" );
return 0; return NULL;
} }
} }
...@@ -1048,7 +1037,14 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt ) ...@@ -1048,7 +1037,14 @@ static int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
} }
#endif #endif
return 1; /* Maximum of one adapter will be detected. */ return shpnt;
}
static int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
{
if (fdomain)
fdomain_setup(fdomain);
return (__fdomain_16x0_detect(tpnt) != NULL);
} }
static const char *fdomain_16x0_info( struct Scsi_Host *ignore ) static const char *fdomain_16x0_info( struct Scsi_Host *ignore )
...@@ -1150,8 +1146,9 @@ static int fdomain_select( int target ) ...@@ -1150,8 +1146,9 @@ static int fdomain_select( int target )
{ {
int status; int status;
unsigned long timeout; unsigned long timeout;
#if ERRORS_ONLY
static int flag = 0; static int flag = 0;
#endif
outb( 0x82, SCSI_Cntl_port ); /* Bus Enable + Select */ outb( 0x82, SCSI_Cntl_port ); /* Bus Enable + Select */
outb( adapter_mask | (1 << target), SCSI_Data_NoACK_port ); outb( adapter_mask | (1 << target), SCSI_Data_NoACK_port );
...@@ -1574,6 +1571,7 @@ static int fdomain_16x0_command(Scsi_Cmnd *SCpnt) ...@@ -1574,6 +1571,7 @@ static int fdomain_16x0_command(Scsi_Cmnd *SCpnt)
/* End of code derived from Tommy Thorn's work. */ /* End of code derived from Tommy Thorn's work. */
#if DEBUG_ABORT
static void print_info(Scsi_Cmnd *SCpnt) static void print_info(Scsi_Cmnd *SCpnt)
{ {
unsigned int imr; unsigned int imr;
...@@ -1643,6 +1641,7 @@ static void print_info(Scsi_Cmnd *SCpnt) ...@@ -1643,6 +1641,7 @@ static void print_info(Scsi_Cmnd *SCpnt)
printk( "Configuration 2 = 0x%02x\n", printk( "Configuration 2 = 0x%02x\n",
inb( port_base + Configuration2 ) ); inb( port_base + Configuration2 ) );
} }
#endif
static int fdomain_16x0_abort( Scsi_Cmnd *SCpnt) static int fdomain_16x0_abort( Scsi_Cmnd *SCpnt)
{ {
...@@ -1670,7 +1669,7 @@ static int fdomain_16x0_abort( Scsi_Cmnd *SCpnt) ...@@ -1670,7 +1669,7 @@ static int fdomain_16x0_abort( Scsi_Cmnd *SCpnt)
return SUCCESS; return SUCCESS;
} }
static int fdomain_16x0_bus_reset(Scsi_Cmnd *SCpnt) int fdomain_16x0_bus_reset(Scsi_Cmnd *SCpnt)
{ {
outb( 1, SCSI_Cntl_port ); outb( 1, SCSI_Cntl_port );
do_pause( 2 ); do_pause( 2 );
...@@ -1866,9 +1865,29 @@ static int fdomain_16x0_release(struct Scsi_Host *shpnt) ...@@ -1866,9 +1865,29 @@ static int fdomain_16x0_release(struct Scsi_Host *shpnt)
return 0; return 0;
} }
MODULE_LICENSE("GPL"); Scsi_Host_Template fdomain_driver_template = {
.module = THIS_MODULE,
/* Eventually this will go into an include file, but this will be later */ .name = "fdomain",
static Scsi_Host_Template driver_template = FDOMAIN_16X0; .proc_name = "fdomain",
.proc_info = fdomain_16x0_proc_info,
.detect = fdomain_16x0_detect,
.info = fdomain_16x0_info,
.command = fdomain_16x0_command,
.queuecommand = fdomain_16x0_queue,
.eh_abort_handler = fdomain_16x0_abort,
.eh_bus_reset_handler = fdomain_16x0_bus_reset,
.eh_device_reset_handler = fdomain_16x0_device_reset,
.eh_host_reset_handler = fdomain_16x0_host_reset,
.bios_param = fdomain_16x0_biosparam,
.release = fdomain_16x0_release,
.can_queue = 1,
.this_id = 6,
.sg_tablesize = 64,
.cmd_per_lun = 1,
.use_clustering = DISABLE_CLUSTERING,
};
#ifndef PCMCIA
#define driver_template fdomain_driver_template
#include "scsi_module.c" #include "scsi_module.c"
#endif
/* fdomain.h -- Header for Future Domain TMC-16x0 driver
* Created: Sun May 3 18:47:33 1992 by faith@cs.unc.edu
* Revised: Thu Oct 12 13:21:35 1995 by faith@acm.org
* Author: Rickard E. Faith, faith@cs.unc.edu
* Copyright 1992, 1993, 1994, 1995 Rickard E. Faith
*
* $Id: fdomain.h,v 5.12 1995/10/12 19:01:09 root Exp $
* 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, 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.
*/
#ifndef _FDOMAIN_H
#define _FDOMAIN_H
static int fdomain_16x0_detect( Scsi_Host_Template *);
static int fdomain_16x0_command( Scsi_Cmnd *);
static int fdomain_16x0_abort(Scsi_Cmnd *);
static const char *fdomain_16x0_info(struct Scsi_Host *);
static int fdomain_16x0_bus_reset(Scsi_Cmnd *);
static int fdomain_16x0_host_reset(Scsi_Cmnd *);
static int fdomain_16x0_device_reset(Scsi_Cmnd *);
static int fdomain_16x0_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
static int fdomain_16x0_biosparam(struct scsi_device *,
struct block_device *, sector_t, int * );
static int fdomain_16x0_proc_info(char *buffer, char **start, off_t offset,
int length, int hostno, int inout );
static int fdomain_16x0_release(struct Scsi_Host *shpnt);
#define FDOMAIN_16X0 { .proc_info = fdomain_16x0_proc_info, \
.detect = fdomain_16x0_detect, \
.info = fdomain_16x0_info, \
.command = fdomain_16x0_command, \
.queuecommand = fdomain_16x0_queue, \
.eh_abort_handler = fdomain_16x0_abort, \
.eh_bus_reset_handler = fdomain_16x0_bus_reset, \
.eh_device_reset_handler = fdomain_16x0_device_reset, \
.eh_host_reset_handler = fdomain_16x0_host_reset, \
.bios_param = fdomain_16x0_biosparam, \
.release = fdomain_16x0_release, \
.can_queue = 1, \
.this_id = 6, \
.sg_tablesize = 64, \
.cmd_per_lun = 1, \
.use_clustering = DISABLE_CLUSTERING \
}
#endif
...@@ -5024,7 +5024,6 @@ static int ncr_abort_command (ncb_p np, Scsi_Cmnd *cmd) ...@@ -5024,7 +5024,6 @@ static int ncr_abort_command (ncb_p np, Scsi_Cmnd *cmd)
**========================================================== **==========================================================
*/ */
#ifdef MODULE
static int ncr_detach(ncb_p np) static int ncr_detach(ncb_p np)
{ {
ccb_p cp; ccb_p cp;
...@@ -5160,7 +5159,6 @@ static int ncr_detach(ncb_p np) ...@@ -5160,7 +5159,6 @@ static int ncr_detach(ncb_p np)
return 1; return 1;
} }
#endif
/*========================================================== /*==========================================================
** **
...@@ -8935,7 +8933,6 @@ int ncr53c8xx_abort(Scsi_Cmnd *cmd) ...@@ -8935,7 +8933,6 @@ int ncr53c8xx_abort(Scsi_Cmnd *cmd)
} }
#ifdef MODULE
int ncr53c8xx_release(struct Scsi_Host *host) int ncr53c8xx_release(struct Scsi_Host *host)
{ {
#ifdef DEBUG_NCR53C8XX #ifdef DEBUG_NCR53C8XX
...@@ -8945,7 +8942,6 @@ printk("ncr53c8xx : release\n"); ...@@ -8945,7 +8942,6 @@ printk("ncr53c8xx : release\n");
return 1; return 1;
} }
#endif
/* /*
......
...@@ -60,17 +60,12 @@ const char *ncr53c8xx_info(struct Scsi_Host *host); ...@@ -60,17 +60,12 @@ const char *ncr53c8xx_info(struct Scsi_Host *host);
int ncr53c8xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); int ncr53c8xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int ncr53c8xx_reset(Scsi_Cmnd *, unsigned int); int ncr53c8xx_reset(Scsi_Cmnd *, unsigned int);
int ncr53c8xx_slave_configure(Scsi_Device *); int ncr53c8xx_slave_configure(Scsi_Device *);
#ifdef MODULE
int ncr53c8xx_release(struct Scsi_Host *); int ncr53c8xx_release(struct Scsi_Host *);
#else
#define ncr53c8xx_release NULL
#endif
#if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,75) #if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,75)
#define NCR53C8XX { .name = "", \ #define NCR53C8XX { .name = "ncr53c8xx", \
.detect = ncr53c8xx_detect, \ .detect = ncr53c8xx_detect, \
.release = ncr53c8xx_release, \ .release = ncr53c8xx_release, \
.info = ncr53c8xx_info, \ .info = ncr53c8xx_info, \
......
...@@ -3,22 +3,11 @@ ...@@ -3,22 +3,11 @@
# #
menu "PCMCIA SCSI adapter support" menu "PCMCIA SCSI adapter support"
depends on SCSI!=n && HOTPLUG && PCMCIA!=n depends on SCSI!=n && PCMCIA!=n
config SCSI_PCMCIA
bool "PCMCIA SCSI adapter support"
help
Say Y here if you intend to attach a PCMCIA or CardBus card to your
computer which acts as a SCSI host adapter. These are credit card
size devices often used with laptops.
Note that the answer to this question won't directly affect the
kernel: saying N will just cause the configurator to skip all
the questions PCMCIA SCSI host adapters.
config PCMCIA_AHA152X config PCMCIA_AHA152X
tristate "Adaptec AHA152X PCMCIA support" tristate "Adaptec AHA152X PCMCIA support"
depends on SCSI_PCMCIA && m depends on m
help help
Say Y here if you intend to attach this type of PCMCIA SCSI host Say Y here if you intend to attach this type of PCMCIA SCSI host
adapter to your computer. adapter to your computer.
...@@ -30,7 +19,7 @@ config PCMCIA_AHA152X ...@@ -30,7 +19,7 @@ config PCMCIA_AHA152X
config PCMCIA_FDOMAIN config PCMCIA_FDOMAIN
tristate "Future Domain PCMCIA support" tristate "Future Domain PCMCIA support"
depends on SCSI_PCMCIA && m depends on m
help help
Say Y here if you intend to attach this type of PCMCIA SCSI host Say Y here if you intend to attach this type of PCMCIA SCSI host
adapter to your computer. adapter to your computer.
...@@ -42,7 +31,7 @@ config PCMCIA_FDOMAIN ...@@ -42,7 +31,7 @@ config PCMCIA_FDOMAIN
config PCMCIA_NINJA_SCSI config PCMCIA_NINJA_SCSI
tristate "NinjaSCSI-3 / NinjaSCSI-32Bi (16bit) PCMCIA support" tristate "NinjaSCSI-3 / NinjaSCSI-32Bi (16bit) PCMCIA support"
depends on SCSI_PCMCIA && m depends on m
help help
If you intend to attach this type of PCMCIA SCSI host adapter to If you intend to attach this type of PCMCIA SCSI host adapter to
your computer, say Y here and read your computer, say Y here and read
...@@ -55,7 +44,7 @@ config PCMCIA_NINJA_SCSI ...@@ -55,7 +44,7 @@ config PCMCIA_NINJA_SCSI
config PCMCIA_QLOGIC config PCMCIA_QLOGIC
tristate "Qlogic PCMCIA support" tristate "Qlogic PCMCIA support"
depends on SCSI_PCMCIA && m depends on m
help help
Say Y here if you intend to attach this type of PCMCIA SCSI host Say Y here if you intend to attach this type of PCMCIA SCSI host
adapter to your computer. adapter to your computer.
...@@ -65,10 +54,4 @@ config PCMCIA_QLOGIC ...@@ -65,10 +54,4 @@ config PCMCIA_QLOGIC
whenever you want). If you want to compile it as a module, say M whenever you want). If you want to compile it as a module, say M
here and read <file:Documentation/modules.txt>. here and read <file:Documentation/modules.txt>.
config PCMCIA_SCSICARD
bool
depends on PCMCIA_QLOGIC=y || PCMCIA_AHA152X=y || PCMCIA_FDOMAIN=y || PCMCIA_NINJA_SCSI=y
default y
endmenu endmenu
...@@ -61,15 +61,15 @@ MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>"); ...@@ -61,15 +61,15 @@ MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
MODULE_DESCRIPTION("Future Domain PCMCIA SCSI driver"); MODULE_DESCRIPTION("Future Domain PCMCIA SCSI driver");
MODULE_LICENSE("Dual MPL/GPL"); MODULE_LICENSE("Dual MPL/GPL");
#define INT_MODULE_PARM(n, v) static int n = v; MODULE_PARM(n, "i")
/* Bit map of interrupts to choose from */ /* Bit map of interrupts to choose from */
INT_MODULE_PARM(irq_mask, 0xdeb8); static int irq_mask = 0xdeb8;
MODULE_PARM(irq_mask, "i");
static int irq_list[4] = { -1 }; static int irq_list[4] = { -1 };
MODULE_PARM(irq_list, "1-4i"); MODULE_PARM(irq_list, "1-4i");
#ifdef PCMCIA_DEBUG #ifdef PCMCIA_DEBUG
INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG); static int pc_debug = PCMCIA_DEBUG;
MODULE_PARM(pc_debug, "i");
#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
static char *version = static char *version =
"fdomain_cs.c 1.47 2001/10/13 00:08:52 (David Hinds)"; "fdomain_cs.c 1.47 2001/10/13 00:08:52 (David Hinds)";
...@@ -81,11 +81,15 @@ static char *version = ...@@ -81,11 +81,15 @@ static char *version =
typedef struct scsi_info_t { typedef struct scsi_info_t {
dev_link_t link; dev_link_t link;
struct Scsi_Host *host;
int ndev; int ndev;
dev_node_t node[8]; dev_node_t node[8];
} scsi_info_t; } scsi_info_t;
extern Scsi_Host_Template fdomain_driver_template;
extern void fdomain_setup(char *str, int *ints); extern void fdomain_setup(char *str, int *ints);
extern struct Scsi_Host *__fdomain_16x0_detect( Scsi_Host_Template *tpnt );
extern int fdomain_16x0_bus_reset(Scsi_Cmnd *SCpnt);
static void fdomain_release(u_long arg); static void fdomain_release(u_long arg);
static int fdomain_event(event_t event, int priority, static int fdomain_event(event_t event, int priority,
...@@ -94,8 +98,6 @@ static int fdomain_event(event_t event, int priority, ...@@ -94,8 +98,6 @@ static int fdomain_event(event_t event, int priority,
static dev_link_t *fdomain_attach(void); static dev_link_t *fdomain_attach(void);
static void fdomain_detach(dev_link_t *); static void fdomain_detach(dev_link_t *);
#define driver_template fdomain_driver_template
extern Scsi_Host_Template fdomain_driver_template;
static dev_link_t *dev_list = NULL; static dev_link_t *dev_list = NULL;
...@@ -231,7 +233,6 @@ static void fdomain_config(dev_link_t *link) ...@@ -231,7 +233,6 @@ static void fdomain_config(dev_link_t *link)
link->conf.ConfigBase = parse.config.base; link->conf.ConfigBase = parse.config.base;
/* Configure card */ /* Configure card */
driver_template.module = &__this_module;
link->state |= DEV_CONFIG; link->state |= DEV_CONFIG;
tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
...@@ -260,14 +261,18 @@ static void fdomain_config(dev_link_t *link) ...@@ -260,14 +261,18 @@ static void fdomain_config(dev_link_t *link)
sprintf(str, "%d,%d", link->io.BasePort1, link->irq.AssignedIRQ); sprintf(str, "%d,%d", link->io.BasePort1, link->irq.AssignedIRQ);
fdomain_setup(str, ints); fdomain_setup(str, ints);
scsi_register_host(&driver_template); host = __fdomain_16x0_detect(&fdomain_driver_template);
if (!host) {
printk(KERN_INFO "fdomain_cs: no SCSI devices found\n");
goto cs_failed;
}
scsi_add_host(host, NULL);
tail = &link->dev; tail = &link->dev;
info->ndev = 0; info->ndev = 0;
for (host = scsi_host_get_next(NULL); host;
host = scsi_host_get_next(host)) list_for_each_entry (dev, &host->my_devices, siblings) {
if (host->hostt == &driver_template)
list_for_each_entry (dev, &host->my_devices, siblings) {
u_long arg[2], id; u_long arg[2], id;
kernel_scsi_ioctl(dev, SCSI_IOCTL_GET_IDLUN, arg); kernel_scsi_ioctl(dev, SCSI_IOCTL_GET_IDLUN, arg);
id = (arg[0]&0x0f) + ((arg[0]>>4)&0xf0) + id = (arg[0]&0x0f) + ((arg[0]>>4)&0xf0) +
...@@ -296,10 +301,11 @@ static void fdomain_config(dev_link_t *link) ...@@ -296,10 +301,11 @@ static void fdomain_config(dev_link_t *link)
} }
*tail = node; tail = &node->next; *tail = node; tail = &node->next;
info->ndev++; info->ndev++;
}
}
*tail = NULL; *tail = NULL;
if (info->ndev == 0) info->host = host;
printk(KERN_INFO "fdomain_cs: no SCSI devices found\n");
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
return; return;
...@@ -316,30 +322,22 @@ static void fdomain_config(dev_link_t *link) ...@@ -316,30 +322,22 @@ static void fdomain_config(dev_link_t *link)
static void fdomain_release(u_long arg) static void fdomain_release(u_long arg)
{ {
dev_link_t *link = (dev_link_t *)arg; dev_link_t *link = (dev_link_t *)arg;
scsi_info_t *info = link->priv;
DEBUG(0, "fdomain_release(0x%p)\n", link); DEBUG(0, "fdomain_release(0x%p)\n", link);
#warning This does not protect you. You need some real fix for your races. scsi_remove_host(info->host);
#if 0
if (GET_USE_COUNT(&__this_module) != 0) {
DEBUG(1, "fdomain_cs: release postponed, "
"device still open\n");
link->state |= DEV_STALE_CONFIG;
return;
}
#endif
scsi_unregister_host(&driver_template);
link->dev = NULL; link->dev = NULL;
CardServices(ReleaseConfiguration, link->handle); CardServices(ReleaseConfiguration, link->handle);
CardServices(ReleaseIO, link->handle, &link->io); CardServices(ReleaseIO, link->handle, &link->io);
CardServices(ReleaseIRQ, link->handle, &link->irq); CardServices(ReleaseIRQ, link->handle, &link->irq);
scsi_unregister(info->host);
link->state &= ~DEV_CONFIG; link->state &= ~DEV_CONFIG;
if (link->state & DEV_STALE_LINK) if (link->state & DEV_STALE_LINK)
fdomain_detach(link); fdomain_detach(link);
} /* fdomain_release */ } /* fdomain_release */
/*====================================================================*/ /*====================================================================*/
...@@ -374,7 +372,7 @@ static int fdomain_event(event_t event, int priority, ...@@ -374,7 +372,7 @@ static int fdomain_event(event_t event, int priority,
case CS_EVENT_CARD_RESET: case CS_EVENT_CARD_RESET:
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
CardServices(RequestConfiguration, link->handle, &link->conf); CardServices(RequestConfiguration, link->handle, &link->conf);
fdomain_16x0_reset(NULL, 0); fdomain_16x0_bus_reset(NULL);
} }
break; break;
} }
......
...@@ -55,7 +55,11 @@ ...@@ -55,7 +55,11 @@
#include <pcmcia/ds.h> #include <pcmcia/ds.h>
#include <pcmcia/ciscode.h> #include <pcmcia/ciscode.h>
extern Scsi_Host_Template qlogicfas_driver_template;
extern void qlogicfas_preset(int port, int irq); extern void qlogicfas_preset(int port, int irq);
extern struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *);
extern int qlogicfas_bus_reset(Scsi_Cmnd *);
#ifdef PCMCIA_DEBUG #ifdef PCMCIA_DEBUG
static int pc_debug = PCMCIA_DEBUG; static int pc_debug = PCMCIA_DEBUG;
...@@ -81,6 +85,7 @@ MODULE_PARM(irq_list, "1-4i"); ...@@ -81,6 +85,7 @@ MODULE_PARM(irq_list, "1-4i");
typedef struct scsi_info_t { typedef struct scsi_info_t {
dev_link_t link; dev_link_t link;
struct Scsi_Host *host;
unsigned short manf_id; unsigned short manf_id;
int ndev; int ndev;
dev_node_t node[8]; dev_node_t node[8];
...@@ -92,9 +97,6 @@ static int qlogic_event(event_t event, int priority, event_callback_args_t * arg ...@@ -92,9 +97,6 @@ static int qlogic_event(event_t event, int priority, event_callback_args_t * arg
static dev_link_t *qlogic_attach(void); static dev_link_t *qlogic_attach(void);
static void qlogic_detach(dev_link_t *); static void qlogic_detach(dev_link_t *);
/* Import our driver template */
extern Scsi_Host_Template qlogicfas_driver_template;
#define driver_template qlogicfas_driver_template
static dev_link_t *dev_list = NULL; static dev_link_t *dev_list = NULL;
...@@ -233,7 +235,6 @@ static void qlogic_config(dev_link_t * link) ...@@ -233,7 +235,6 @@ static void qlogic_config(dev_link_t * link)
info->manf_id = le16_to_cpu(tuple.TupleData[0]); info->manf_id = le16_to_cpu(tuple.TupleData[0]);
/* Configure card */ /* Configure card */
driver_template.module = &__this_module;
link->state |= DEV_CONFIG; link->state |= DEV_CONFIG;
tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
...@@ -272,46 +273,52 @@ static void qlogic_config(dev_link_t * link) ...@@ -272,46 +273,52 @@ static void qlogic_config(dev_link_t * link)
else else
qlogicfas_preset(link->io.BasePort1, link->irq.AssignedIRQ); qlogicfas_preset(link->io.BasePort1, link->irq.AssignedIRQ);
scsi_register_host(&driver_template);
tail = &link->dev; tail = &link->dev;
info->ndev = 0; info->ndev = 0;
for (host = scsi_host_get_next(NULL); host; host = scsi_host_get_next(host))
if (host->hostt == &driver_template) host = __qlogicfas_detect(&qlogicfas_driver_template);
list_for_each_entry (dev, &host->my_devices, siblings) { if (!host) {
u_long arg[2], id;
kernel_scsi_ioctl(dev, SCSI_IOCTL_GET_IDLUN, arg);
id = (arg[0] & 0x0f) + ((arg[0] >> 4) & 0xf0) + ((arg[0] >> 8) & 0xf00) + ((arg[0] >> 12) & 0xf000);
node = &info->node[info->ndev];
node->minor = 0;
switch (dev->type) {
case TYPE_TAPE:
node->major = SCSI_TAPE_MAJOR;
sprintf(node->dev_name, "st#%04lx", id);
break;
case TYPE_DISK:
case TYPE_MOD:
node->major = SCSI_DISK0_MAJOR;
sprintf(node->dev_name, "sd#%04lx", id);
break;
case TYPE_ROM:
case TYPE_WORM:
node->major = SCSI_CDROM_MAJOR;
sprintf(node->dev_name, "sr#%04lx", id);
break;
default:
node->major = SCSI_GENERIC_MAJOR;
sprintf(node->dev_name, "sg#%04lx", id);
break;
}
*tail = node;
tail = &node->next;
info->ndev++;
}
*tail = NULL;
if (info->ndev == 0)
printk(KERN_INFO "qlogic_cs: no SCSI devices found\n"); printk(KERN_INFO "qlogic_cs: no SCSI devices found\n");
goto out;
}
scsi_add_host(host, NULL);
list_for_each_entry(dev, &host->my_devices, siblings) {
u_long arg[2], id;
kernel_scsi_ioctl(dev, SCSI_IOCTL_GET_IDLUN, arg);
id = (arg[0] & 0x0f) + ((arg[0] >> 4) & 0xf0) + ((arg[0] >> 8) & 0xf00) + ((arg[0] >> 12) & 0xf000);
node = &info->node[info->ndev];
node->minor = 0;
switch (dev->type) {
case TYPE_TAPE:
node->major = SCSI_TAPE_MAJOR;
sprintf(node->dev_name, "st#%04lx", id);
break;
case TYPE_DISK:
case TYPE_MOD:
node->major = SCSI_DISK0_MAJOR;
sprintf(node->dev_name, "sd#%04lx", id);
break;
case TYPE_ROM:
case TYPE_WORM:
node->major = SCSI_CDROM_MAJOR;
sprintf(node->dev_name, "sr#%04lx", id);
break;
default:
node->major = SCSI_GENERIC_MAJOR;
sprintf(node->dev_name, "sg#%04lx", id);
break;
}
*tail = node;
tail = &node->next;
info->ndev++;
}
*tail = NULL;
info->host = host;
out:
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
return; return;
...@@ -327,29 +334,22 @@ static void qlogic_config(dev_link_t * link) ...@@ -327,29 +334,22 @@ static void qlogic_config(dev_link_t * link)
static void qlogic_release(u_long arg) static void qlogic_release(u_long arg)
{ {
dev_link_t *link = (dev_link_t *) arg; dev_link_t *link = (dev_link_t *) arg;
scsi_info_t *info = link->priv;
DEBUG(0, "qlogic_release(0x%p)\n", link); DEBUG(0, "qlogic_release(0x%p)\n", link);
#warning This does not protect you. You need some real fix for your races. scsi_remove_host(info->host);
#if 0
if (GET_USE_COUNT(&__this_module) != 0) {
DEBUG(0, "qlogic_cs: release postponed, device still open\n");
link->state |= DEV_STALE_CONFIG;
return;
}
#endif
scsi_unregister_host(&driver_template);
link->dev = NULL; link->dev = NULL;
CardServices(ReleaseConfiguration, link->handle); CardServices(ReleaseConfiguration, link->handle);
CardServices(ReleaseIO, link->handle, &link->io); CardServices(ReleaseIO, link->handle, &link->io);
CardServices(ReleaseIRQ, link->handle, &link->irq); CardServices(ReleaseIRQ, link->handle, &link->irq);
scsi_unregister(info->host);
link->state &= ~DEV_CONFIG; link->state &= ~DEV_CONFIG;
if (link->state & DEV_STALE_LINK) if (link->state & DEV_STALE_LINK)
qlogic_detach(link); qlogic_detach(link);
} /* qlogic_release */ } /* qlogic_release */
/*====================================================================*/ /*====================================================================*/
...@@ -390,7 +390,7 @@ static int qlogic_event(event_t event, int priority, event_callback_args_t * arg ...@@ -390,7 +390,7 @@ static int qlogic_event(event_t event, int priority, event_callback_args_t * arg
outb(0x04, link->io.BasePort1 + 0xd); outb(0x04, link->io.BasePort1 + 0xd);
} }
/* Ugggglllyyyy!!! */ /* Ugggglllyyyy!!! */
driver_template.eh_bus_reset_handler(NULL); qlogicfas_bus_reset(NULL);
} }
break; break;
} }
......
...@@ -127,11 +127,6 @@ ...@@ -127,11 +127,6 @@
#endif #endif
#include <linux/module.h> #include <linux/module.h>
#ifdef PCMCIA
#undef MODULE
#endif
#include <linux/blk.h> /* to get disk capacity */ #include <linux/blk.h> /* to get disk capacity */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -148,7 +143,6 @@ ...@@ -148,7 +143,6 @@
#include "scsi.h" #include "scsi.h"
#include "hosts.h" #include "hosts.h"
#include "qlogicfas.h"
/*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/
/* driver state info, local to driver */ /* driver state info, local to driver */
...@@ -166,6 +160,8 @@ static int qlcfg8 = (SLOWCABLE << 7) | (QL_ENABLE_PARITY << 4); ...@@ -166,6 +160,8 @@ static int qlcfg8 = (SLOWCABLE << 7) | (QL_ENABLE_PARITY << 4);
static int qlcfg9 = ((XTALFREQ + 4) / 5); static int qlcfg9 = ((XTALFREQ + 4) / 5);
static int qlcfgc = (FASTCLK << 3) | (FASTSCSI << 4); static int qlcfgc = (FASTCLK << 3) | (FASTSCSI << 4);
int qlogicfas_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *));
/*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/
/* The qlogic card uses two register maps - These macros select which one */ /* The qlogic card uses two register maps - These macros select which one */
#define REG0 ( outb( inb( qbase + 0xd ) & 0x7f , qbase + 0xd ), outb( 4 , qbase + 0xd )) #define REG0 ( outb( inb( qbase + 0xd ) & 0x7f , qbase + 0xd ), outb( 4 , qbase + 0xd ))
...@@ -631,14 +627,12 @@ void qlogicfas_preset(int port, int irq) ...@@ -631,14 +627,12 @@ void qlogicfas_preset(int port, int irq)
* Look for qlogic card and init if found * Look for qlogic card and init if found
*/ */
int __devinit qlogicfas_detect(Scsi_Host_Template * host) struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host)
{ {
int i, j; /* these are only used by IRQ detect */ int i, j; /* these are only used by IRQ detect */
int qltyp; /* type of chip */ int qltyp; /* type of chip */
struct Scsi_Host *hreg; /* registered host structure */ struct Scsi_Host *hreg; /* registered host structure */
host->proc_name = "qlogicfas";
/* Qlogic Cards only exist at 0x230 or 0x330 (the chip itself /* Qlogic Cards only exist at 0x230 or 0x330 (the chip itself
* decodes the address - I check 230 first since MIDI cards are * decodes the address - I check 230 first since MIDI cards are
* typically at 0x330 * typically at 0x330
...@@ -659,7 +653,7 @@ int __devinit qlogicfas_detect(Scsi_Host_Template * host) ...@@ -659,7 +653,7 @@ int __devinit qlogicfas_detect(Scsi_Host_Template * host)
release_region(qbase, 0x10); release_region(qbase, 0x10);
} }
if (qbase == 0x430) if (qbase == 0x430)
return 0; return NULL;;
} else } else
printk(KERN_INFO "Ql: Using preset base address of %03x\n", qbase); printk(KERN_INFO "Ql: Using preset base address of %03x\n", qbase);
...@@ -726,16 +720,21 @@ int __devinit qlogicfas_detect(Scsi_Host_Template * host) ...@@ -726,16 +720,21 @@ int __devinit qlogicfas_detect(Scsi_Host_Template * host)
qltyp, qbase, qlirq, QL_TURBO_PDMA); qltyp, qbase, qlirq, QL_TURBO_PDMA);
host->name = qinfo; host->name = qinfo;
return 1; return hreg;
err_release_mem: err_release_mem:
release_region(qbase, 0x10); release_region(qbase, 0x10);
if (host->can_queue) if (host->can_queue)
free_irq(qlirq, do_ql_ihandl); free_irq(qlirq, do_ql_ihandl);
return 0; return NULL;;
} }
int __devinit qlogicfas_detect(Scsi_Host_Template *sht)
{
return (__qlogicfas_detect(sht) != NULL);
}
/* /*
* Return bios parameters * Return bios parameters
*/ */
...@@ -777,7 +776,7 @@ static int qlogicfas_abort(Scsi_Cmnd * cmd) ...@@ -777,7 +776,7 @@ static int qlogicfas_abort(Scsi_Cmnd * cmd)
* the PCMCIA qlogic_stub code. This wants fixing * the PCMCIA qlogic_stub code. This wants fixing
*/ */
static int qlogicfas_bus_reset(Scsi_Cmnd * cmd) int qlogicfas_bus_reset(Scsi_Cmnd * cmd)
{ {
qabort = 2; qabort = 2;
ql_zap(); ql_zap();
...@@ -818,9 +817,27 @@ MODULE_LICENSE("GPL"); ...@@ -818,9 +817,27 @@ MODULE_LICENSE("GPL");
/* /*
* The driver template is also needed for PCMCIA * The driver template is also needed for PCMCIA
*/ */
Scsi_Host_Template qlogicfas_driver_template = {
Scsi_Host_Template qlogicfas_driver_template = QLOGICFAS; .module = THIS_MODULE,
.name = "qlogicfas",
.proc_name = "qlogicfas",
.detect = qlogicfas_detect,
.info = qlogicfas_info,
.command = qlogicfas_command,
.queuecommand = qlogicfas_queuecommand,
.eh_abort_handler = qlogicfas_abort,
.eh_bus_reset_handler = qlogicfas_bus_reset,
.eh_device_reset_handler= qlogicfas_device_reset,
.eh_host_reset_handler = qlogicfas_host_reset,
.bios_param = qlogicfas_biosparam,
.can_queue = 0,
.this_id = -1,
.sg_tablesize = SG_ALL,
.cmd_per_lun = 1,
.use_clustering = DISABLE_CLUSTERING,
};
#ifndef PCMCIA
#define driver_template qlogicfas_driver_template #define driver_template qlogicfas_driver_template
#include "scsi_module.c" #include "scsi_module.c"
#endif
#ifndef _QLOGICFAS_H
#define _QLOGICFAS_H
static int qlogicfas_detect(Scsi_Host_Template * );
static const char * qlogicfas_info(struct Scsi_Host *);
static int qlogicfas_command(Scsi_Cmnd *);
static int qlogicfas_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
static int qlogicfas_abort(Scsi_Cmnd *);
static int qlogicfas_bus_reset(Scsi_Cmnd *);
static int qlogicfas_device_reset(Scsi_Cmnd *);
static int qlogicfas_host_reset(Scsi_Cmnd *);
static int qlogicfas_biosparam(struct scsi_device *, struct block_device *,
sector_t, int[]);
#define QLOGICFAS { \
.detect = qlogicfas_detect, \
.info = qlogicfas_info, \
.command = qlogicfas_command, \
.queuecommand = qlogicfas_queuecommand, \
.eh_abort_handler = qlogicfas_abort, \
.eh_bus_reset_handler = qlogicfas_bus_reset, \
.eh_device_reset_handler = qlogicfas_device_reset, \
.eh_host_reset_handler = qlogicfas_host_reset, \
.bios_param = qlogicfas_biosparam, \
.can_queue = 0, \
.this_id = -1, \
.sg_tablesize = SG_ALL, \
.cmd_per_lun = 1, \
.use_clustering = DISABLE_CLUSTERING \
}
#endif /* _QLOGICFAS_H */
...@@ -514,7 +514,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) ...@@ -514,7 +514,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
* actually did complete normally. * actually did complete normally.
*/ */
if (rtn == SUCCESS) { if (rtn == SUCCESS) {
int rtn = scsi_eh_completed_normally(scmd); rtn = scsi_eh_completed_normally(scmd);
SCSI_LOG_ERROR_RECOVERY(3, SCSI_LOG_ERROR_RECOVERY(3,
printk("%s: scsi_eh_completed_normally %x\n", printk("%s: scsi_eh_completed_normally %x\n",
__FUNCTION__, rtn)); __FUNCTION__, rtn));
...@@ -544,20 +544,20 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) ...@@ -544,20 +544,20 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
static int scsi_request_sense(struct scsi_cmnd *scmd) static int scsi_request_sense(struct scsi_cmnd *scmd)
{ {
static unsigned char generic_sense[6] = static unsigned char generic_sense[6] =
{REQUEST_SENSE, 0, 0, 0, 255, 0}; {REQUEST_SENSE, 0, 0, 0, 254, 0};
unsigned char scsi_result0[256], *scsi_result = &scsi_result0[0]; unsigned char *scsi_result;
int saved_result; int saved_result;
int rtn; int rtn;
memcpy(scmd->cmnd, generic_sense, sizeof(generic_sense)); memcpy(scmd->cmnd, generic_sense, sizeof(generic_sense));
if (scmd->device->host->hostt->unchecked_isa_dma) { scsi_result = kmalloc(254, GFP_ATOMIC | (scmd->device->host->hostt->unchecked_isa_dma) ? __GFP_DMA : 0);
scsi_result = kmalloc(512, GFP_ATOMIC | __GFP_DMA);
if (unlikely(!scsi_result)) {
printk(KERN_ERR "%s: cannot allocate scsi_result.\n", if (unlikely(!scsi_result)) {
__FUNCTION__); printk(KERN_ERR "%s: cannot allocate scsi_result.\n",
return FAILED; __FUNCTION__);
} return FAILED;
} }
/* /*
...@@ -567,11 +567,11 @@ static int scsi_request_sense(struct scsi_cmnd *scmd) ...@@ -567,11 +567,11 @@ static int scsi_request_sense(struct scsi_cmnd *scmd)
* address (db). 0 is not a valid sense code. * address (db). 0 is not a valid sense code.
*/ */
memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer)); memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer));
memset(scsi_result, 0, 256); memset(scsi_result, 0, 254);
saved_result = scmd->result; saved_result = scmd->result;
scmd->request_buffer = scsi_result; scmd->request_buffer = scsi_result;
scmd->request_bufflen = 256; scmd->request_bufflen = 254;
scmd->use_sg = 0; scmd->use_sg = 0;
scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]); scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]);
scmd->sc_data_direction = SCSI_DATA_READ; scmd->sc_data_direction = SCSI_DATA_READ;
...@@ -580,13 +580,12 @@ static int scsi_request_sense(struct scsi_cmnd *scmd) ...@@ -580,13 +580,12 @@ static int scsi_request_sense(struct scsi_cmnd *scmd)
rtn = scsi_send_eh_cmnd(scmd, SENSE_TIMEOUT); rtn = scsi_send_eh_cmnd(scmd, SENSE_TIMEOUT);
/* last chance to have valid sense data */ /* last chance to have valid sense data */
if (!SCSI_SENSE_VALID(scmd)) { if(!SCSI_SENSE_VALID(scmd)) {
memcpy(scmd->sense_buffer, scmd->request_buffer, memcpy(scmd->sense_buffer, scmd->request_buffer,
sizeof(scmd->sense_buffer)); sizeof(scmd->sense_buffer));
} }
if (scsi_result != &scsi_result0[0]) kfree(scsi_result);
kfree(scsi_result);
/* /*
* when we eventually call scsi_finish, we really wish to complete * when we eventually call scsi_finish, we really wish to complete
...@@ -702,25 +701,14 @@ static int scsi_eh_get_sense(struct list_head *work_q, ...@@ -702,25 +701,14 @@ static int scsi_eh_get_sense(struct list_head *work_q,
* upper level. * upper level.
*/ */
if (rtn == SUCCESS) if (rtn == SUCCESS)
scsi_eh_finish_cmd(scmd, done_q); /* we don't want this command reissued, just
if (rtn != NEEDS_RETRY) * finished with the sense data, so set
* retries to the max allowed to ensure it
* won't get reissued */
scmd->retries = scmd->allowed;
else if (rtn != NEEDS_RETRY)
continue; continue;
/*
* we only come in here if we want to retry a
* command. the test to see whether the command
* should be retried should be keeping track of the
* number of tries, so we don't end up looping, of
* course.
*/
scmd->state = NEEDS_RETRY;
rtn = scsi_eh_retry_cmd(scmd);
if (rtn != SUCCESS)
continue;
/*
* we eventually hand this one back to the top level.
*/
scsi_eh_finish_cmd(scmd, done_q); scsi_eh_finish_cmd(scmd, done_q);
} }
...@@ -1322,9 +1310,11 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) ...@@ -1322,9 +1310,11 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
rtn = scsi_check_sense(scmd); rtn = scsi_check_sense(scmd);
if (rtn == NEEDS_RETRY) if (rtn == NEEDS_RETRY)
goto maybe_retry; goto maybe_retry;
/* if rtn == FAILED, we have no sense information */ /* if rtn == FAILED, we have no sense information;
/* was: return rtn; */ * returning FAILED will wake the error handler thread
return SUCCESS; * to collect the sense and redo the decide
* disposition */
return rtn;
case CONDITION_GOOD: case CONDITION_GOOD:
case INTERMEDIATE_GOOD: case INTERMEDIATE_GOOD:
case INTERMEDIATE_C_GOOD: case INTERMEDIATE_C_GOOD:
......
...@@ -265,7 +265,6 @@ static int scsi_init_cmd_errh(struct scsi_cmnd *cmd) ...@@ -265,7 +265,6 @@ static int scsi_init_cmd_errh(struct scsi_cmnd *cmd)
cmd->serial_number = 0; cmd->serial_number = 0;
cmd->serial_number_at_timeout = 0; cmd->serial_number_at_timeout = 0;
cmd->flags = 0; cmd->flags = 0;
cmd->retries = 0;
cmd->abort_reason = 0; cmd->abort_reason = 0;
memset(cmd->sense_buffer, 0, sizeof cmd->sense_buffer); memset(cmd->sense_buffer, 0, sizeof cmd->sense_buffer);
......
...@@ -1197,7 +1197,7 @@ sd_init_onedisk(struct scsi_disk * sdkp, struct gendisk *disk) ...@@ -1197,7 +1197,7 @@ sd_init_onedisk(struct scsi_disk * sdkp, struct gendisk *disk)
return; return;
} }
buffer = kmalloc(512, GFP_DMA); buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
if (!buffer) { if (!buffer) {
printk(KERN_WARNING "(sd_init_onedisk:) Memory allocation " printk(KERN_WARNING "(sd_init_onedisk:) Memory allocation "
"failure.\n"); "failure.\n");
......
...@@ -604,7 +604,7 @@ static void get_sectorsize(struct scsi_cd *cd) ...@@ -604,7 +604,7 @@ static void get_sectorsize(struct scsi_cd *cd)
struct scsi_request *SRpnt = NULL; struct scsi_request *SRpnt = NULL;
request_queue_t *queue; request_queue_t *queue;
buffer = kmalloc(512, GFP_DMA); buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
if (!buffer) if (!buffer)
goto Enomem; goto Enomem;
SRpnt = scsi_allocate_request(cd->device); SRpnt = scsi_allocate_request(cd->device);
...@@ -698,7 +698,7 @@ static void get_sectorsize(struct scsi_cd *cd) ...@@ -698,7 +698,7 @@ static void get_sectorsize(struct scsi_cd *cd)
goto out; goto out;
} }
void get_capabilities(struct scsi_cd *cd) static void get_capabilities(struct scsi_cd *cd)
{ {
struct cdrom_generic_command cgc; struct cdrom_generic_command cgc;
unsigned char *buffer; unsigned char *buffer;
...@@ -716,9 +716,8 @@ void get_capabilities(struct scsi_cd *cd) ...@@ -716,9 +716,8 @@ void get_capabilities(struct scsi_cd *cd)
"" ""
}; };
buffer = kmalloc(512, GFP_DMA); buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
if (!buffer) if (!buffer) {
{
printk(KERN_ERR "sr: out of memory.\n"); printk(KERN_ERR "sr: out of memory.\n");
return; return;
} }
......
...@@ -112,8 +112,8 @@ ...@@ -112,8 +112,8 @@
#include <asm/spinlock.h> #include <asm/spinlock.h>
#endif #endif
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/sched.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -7214,7 +7214,6 @@ static int ncr_abort_command (ncb_p np, Scsi_Cmnd *cmd) ...@@ -7214,7 +7214,6 @@ static int ncr_abort_command (ncb_p np, Scsi_Cmnd *cmd)
**========================================================== **==========================================================
*/ */
#ifdef MODULE
static int ncr_detach(ncb_p np) static int ncr_detach(ncb_p np)
{ {
int i; int i;
...@@ -7260,7 +7259,6 @@ static int ncr_detach(ncb_p np) ...@@ -7260,7 +7259,6 @@ static int ncr_detach(ncb_p np)
return 1; return 1;
} }
#endif
/*========================================================== /*==========================================================
** **
...@@ -12958,6 +12956,7 @@ if (sym53c8xx) ...@@ -12958,6 +12956,7 @@ if (sym53c8xx)
} }
if (i != count) /* Ignore this device if we already have it */ if (i != count) /* Ignore this device if we already have it */
continue; continue;
pci_set_master(pcidev);
devp = &devtbl[count]; devp = &devtbl[count];
devp->host_id = driver_setup.host_id; devp->host_id = driver_setup.host_id;
devp->attach_done = 0; devp->attach_done = 0;
...@@ -13798,7 +13797,6 @@ int sym53c8xx_abort(Scsi_Cmnd *cmd) ...@@ -13798,7 +13797,6 @@ int sym53c8xx_abort(Scsi_Cmnd *cmd)
} }
#ifdef MODULE
int sym53c8xx_release(struct Scsi_Host *host) int sym53c8xx_release(struct Scsi_Host *host)
{ {
#ifdef DEBUG_SYM53C8XX #ifdef DEBUG_SYM53C8XX
...@@ -13808,7 +13806,6 @@ printk("sym53c8xx : release\n"); ...@@ -13808,7 +13806,6 @@ printk("sym53c8xx : release\n");
return 1; return 1;
} }
#endif
/* /*
......
...@@ -75,17 +75,11 @@ const char *sym53c8xx_info(struct Scsi_Host *host); ...@@ -75,17 +75,11 @@ const char *sym53c8xx_info(struct Scsi_Host *host);
int sym53c8xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); int sym53c8xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int sym53c8xx_reset(Scsi_Cmnd *, unsigned int); int sym53c8xx_reset(Scsi_Cmnd *, unsigned int);
int sym53c8xx_slave_configure(Scsi_Device *); int sym53c8xx_slave_configure(Scsi_Device *);
#ifdef MODULE
int sym53c8xx_release(struct Scsi_Host *); int sym53c8xx_release(struct Scsi_Host *);
#else
#define sym53c8xx_release NULL
#endif
#if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,75) #if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,75)
#define SYM53C8XX { .name = "", \ #define SYM53C8XX { .name = "sym53c8xx", \
.detect = sym53c8xx_detect, \ .detect = sym53c8xx_detect, \
.release = sym53c8xx_release, \ .release = sym53c8xx_release, \
.info = sym53c8xx_info, \ .info = sym53c8xx_info, \
......
...@@ -151,7 +151,6 @@ int zalon7xx_detect(Scsi_Host_Template *tpnt) ...@@ -151,7 +151,6 @@ int zalon7xx_detect(Scsi_Host_Template *tpnt)
return (hosts_used != 0); return (hosts_used != 0);
} }
#ifdef MODULE
extern int ncr53c8xx_release(struct Scsi_Host *host); extern int ncr53c8xx_release(struct Scsi_Host *host);
int zalon7xx_release(struct Scsi_Host *host) int zalon7xx_release(struct Scsi_Host *host)
...@@ -160,4 +159,3 @@ int zalon7xx_release(struct Scsi_Host *host) ...@@ -160,4 +159,3 @@ int zalon7xx_release(struct Scsi_Host *host)
unregister_parisc_driver(&zalon_driver); unregister_parisc_driver(&zalon_driver);
return 1; return 1;
} }
#endif
...@@ -15,12 +15,7 @@ extern struct proc_dir_entry proc_scsi_zalon7xx; ...@@ -15,12 +15,7 @@ extern struct proc_dir_entry proc_scsi_zalon7xx;
int zalon7xx_detect(Scsi_Host_Template *tpnt); int zalon7xx_detect(Scsi_Host_Template *tpnt);
const char *ncr53c8xx_info(struct Scsi_Host *host); const char *ncr53c8xx_info(struct Scsi_Host *host);
int ncr53c8xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); int ncr53c8xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
#ifdef MODULE
int zalon7xx_release(struct Scsi_Host *); int zalon7xx_release(struct Scsi_Host *);
#else
#define zalon7xx_release NULL
#endif
#define GSC_SCSI_ZALON_OFFSET 0x800 #define GSC_SCSI_ZALON_OFFSET 0x800
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment