Commit ae1092b7 authored by James Bottomley's avatar James Bottomley

Merge raven.il.steeleye.com:/home/jejb/BK/scsi-tmp-2.7

into raven.il.steeleye.com:/home/jejb/BK/scsi-for-linus-2.6
parents bfd3fcff 9dbd5c7d
......@@ -577,7 +577,7 @@ LILO Linux Boot Loader (in /etc/lilo.conf):
INSMOD Loadable Kernel Module Installation Facility:
insmod BusLogic.o \
'BusLogic_Options="QueueDepth:[,7,15];QueueDepth:31,BusSettleTime:30"'
'BusLogic="QueueDepth:[,7,15];QueueDepth:31,BusSettleTime:30"'
NOTE: Module Utilities 2.1.71 or later is required for correct parsing
of driver options containing commas.
......
......@@ -1235,8 +1235,8 @@ W: http://ldm.sourceforge.net
S: Maintained
LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers
P: Gerard Roudier
M: groudier@free.fr
P: Matthew Wilcox
M: matthew@wil.cx
L: linux-scsi@vger.kernel.org
S: Maintained
......
......@@ -5,11 +5,11 @@
* Error Report logging output. This module implements SCSI-3
* Opcode lookup and a sorted table of SCSI-3 ASC/ASCQ strings.
*
* Copyright (c) 1991-2002 Steven J. Ralston
* Copyright (c) 1991-2003 Steven J. Ralston
* Written By: Steven J. Ralston
* (yes I wrote some of the orig. code back in 1991!)
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
* (mailto:mpt_linux_developer@lsil.com)
*
* $Id: isense.c,v 1.33 2002/02/27 18:44:19 sralston Exp $
*/
......@@ -66,7 +66,7 @@
#endif
#define MODULEAUTHOR "Steven J. Ralston"
#define COPYRIGHT "Copyright (c) 2001-2002 " MODULEAUTHOR
#define COPYRIGHT "Copyright (c) 2001-2003 " MODULEAUTHOR
#include "mptbase.h"
#include "isense.h"
......
......@@ -44,10 +44,10 @@
* for gobs of hard work fixing and optimizing LAN code.
* THANK YOU!
*
* Copyright (c) 1999-2002 LSI Logic Corporation
* Copyright (c) 1999-2003 LSI Logic Corporation
* Originally By: Steven J. Ralston
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
* (mailto:mpt_linux_developer@lsil.com)
*
* $Id: mptbase.c,v 1.126 2002/12/16 15:28:45 pdelaney Exp $
*/
......@@ -3138,7 +3138,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
{
int hard_reset_done = 0;
u32 ioc_state;
int cnt = 0;
int cntdn, cnt = 0;
dprintk((KERN_WARNING MYNAM ": KickStarting %s!\n", ioc->name));
if ((int)ioc->chip_type > (int)FC929) {
......@@ -3161,7 +3161,8 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
dprintk((MYIOC_s_INFO_FMT "Diagnostic reset successful!\n",
ioc->name));
for (cnt=0; cnt<HZ*20; cnt++) {
cntdn = ((sleepFlag == CAN_SLEEP) ? HZ : 1000) * 20; /* 20 seconds */
for (cnt=0; cnt<cntdn; cnt++) {
if ((ioc_state = mpt_GetIocState(ioc, 1)) == MPI_IOC_STATE_READY) {
dprintk((MYIOC_s_INFO_FMT "KickStart successful! (cnt=%d)\n",
ioc->name, cnt));
......
......@@ -8,10 +8,10 @@
* Credits:
* (see mptbase.c)
*
* Copyright (c) 1999-2002 LSI Logic Corporation
* Copyright (c) 1999-2003 LSI Logic Corporation
* Originally By: Steven J. Ralston
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
* (mailto:mpt_linux_developer@lsil.com)
*
* $Id: mptbase.h,v 1.144 2003/01/28 21:31:56 pdelaney Exp $
*/
......@@ -77,11 +77,11 @@
#endif
#ifndef COPYRIGHT
#define COPYRIGHT "Copyright (c) 1999-2002 " MODULEAUTHOR
#define COPYRIGHT "Copyright (c) 1999-2003 " MODULEAUTHOR
#endif
#define MPT_LINUX_VERSION_COMMON "2.05.00.03"
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-2.05.00.03"
#define MPT_LINUX_VERSION_COMMON "2.05.00.05"
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-2.05.00.05"
#define WHAT_MAGIC_STRING "@" "(" "#" ")"
#define show_mptmod_ver(s,ver) \
......
......@@ -29,10 +29,10 @@
*
* (see also mptbase.c)
*
* Copyright (c) 1999-2002 LSI Logic Corporation
* Copyright (c) 1999-2003 LSI Logic Corporation
* Originally By: Steven J. Ralston, Noah Romer
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
* (mailto:mpt_linux_developer@lsil.com)
*
* $Id: mptctl.c,v 1.63 2002/12/03 21:26:33 pdelaney Exp $
*/
......@@ -91,7 +91,7 @@
#include "../../scsi/scsi.h"
#include "../../scsi/hosts.h"
#define COPYRIGHT "Copyright (c) 1999-2001 LSI Logic Corporation"
#define COPYRIGHT "Copyright (c) 1999-2003 LSI Logic Corporation"
#define MODULEAUTHOR "Steven J. Ralston, Noah Romer, Pamela Delaney"
#include "mptbase.h"
#include "mptctl.h"
......@@ -2985,6 +2985,21 @@ void mptctl_exit(void)
mpt_deregister(mptctl_id);
printk(KERN_INFO MYNAM ": Deregistered from Fusion MPT base driver\n");
#ifdef CONFIG_COMPAT
unregister_ioctl32_conversion(MPTIOCINFO);
unregister_ioctl32_conversion(MPTIOCINFO1);
unregister_ioctl32_conversion(MPTTARGETINFO);
unregister_ioctl32_conversion(MPTTEST);
unregister_ioctl32_conversion(MPTEVENTQUERY);
unregister_ioctl32_conversion(MPTEVENTENABLE);
unregister_ioctl32_conversion(MPTEVENTREPORT);
unregister_ioctl32_conversion(MPTHARDRESET);
unregister_ioctl32_conversion(MPTCOMMAND32);
unregister_ioctl32_conversion(MPTFWDOWNLOAD32);
unregister_ioctl32_conversion(HP_GETHOSTINFO);
unregister_ioctl32_conversion(HP_GETTARGETINFO);
#endif
/* Free allocated memory */
for (i=0; i<MPT_MAX_ADAPTERS; i++) {
ioc = NULL;
......
......@@ -15,10 +15,10 @@
*
* (see also mptbase.c)
*
* Copyright (c) 1999-2002 LSI Logic Corporation
* Copyright (c) 1999-2003 LSI Logic Corporation
* Originally By: Steven J. Ralston
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
* (mailto:mpt_linux_developer@lsil.com)
*
* $Id: mptctl.h,v 1.13 2002/12/03 21:26:33 pdelaney Exp $
*/
......
......@@ -23,8 +23,9 @@
*
* (see also mptbase.c)
*
* Copyright (c) 2000-2002 LSI Logic Corporation
* Copyright (c) 2000-2003 LSI Logic Corporation
* Originally By: Noah Romer
* (mailto:mpt_linux_developer@lsil.com)
*
* $Id: mptlan.c,v 1.53 2002/10/17 20:15:58 pdelaney Exp $
*/
......
This diff is collapsed.
......@@ -15,10 +15,10 @@
*
* (see also mptbase.c)
*
* Copyright (c) 1999-2002 LSI Logic Corporation
* Copyright (c) 1999-2003 LSI Logic Corporation
* Originally By: Steven J. Ralston
* (mailto:netscape.net)
* (mailto:Pam.Delaney@lsil.com)
* (mailto:mpt_linux_developer@lsil.com)
*
* $Id: mptscsih.h,v 1.21 2002/12/03 21:26:35 pdelaney Exp $
*/
......
......@@ -4,10 +4,10 @@
* (Ultimately) SCSI-3 definitions; for now, inheriting
* SCSI-2 definitions.
*
* Copyright (c) 1996-2002 Steven J. Ralston
* Copyright (c) 1996-2003 Steven J. Ralston
* Written By: Steven J. Ralston (19960517)
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
* (mailto:mpt_linux_developer@lsil.com)
*
* $Id: scsi3.h,v 1.9 2002/02/27 18:45:02 sralston Exp $
*/
......
This diff is collapsed.
......@@ -253,7 +253,7 @@ config SCSI_ACARD
config SCSI_AHA152X
tristate "Adaptec AHA152X/2825 support"
depends on ISA && SCSI
depends on ISA && SCSI && !64BIT
---help---
This is a driver for the AHA-1510, AHA-1520, AHA-1522, and AHA-2825
SCSI host adapters. It also works for the AVA-1505, but the IRQ etc.
......@@ -911,37 +911,34 @@ config SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
depends on SCSI_SYM53C8XX_2
default "1"
---help---
This option only applies to PCI-SCSI chip that are PCI DAC capable
(875A, 895A, 896, 1010-33, 1010-66, 1000).
When set to 0, only PCI 32 bit DMA addressing (SAC) will be performed.
When set to 1, 40 bit DMA addressing (with upper 24 bits of address
set to zero) is supported. The addressable range is here 1 TB.
When set to 2, full 64 bits of address for DMA are supported, but only
16 segments of 4 GB can be addressed. The addressable range is so
limited to 64 GB.
This option only applies to PCI-SCSI chips that are PCI DAC
capable (875A, 895A, 896, 1010-33, 1010-66, 1000).
The safest value is 0 (32 bit DMA addressing) that is guessed to still
fit most of real machines.
When set to 0, the driver will program the chip to only perform
32-bit DMA. When set to 1, the chip will be able to perform DMA
to addresses up to 1TB. When set to 2, the driver supports the
full 64-bit DMA address range, but can only address 16 segments
of 4 GB each. This limits the total addressable range to 64 GB.
The preferred value 1 (40 bit DMA addressing) should make happy
properly engineered PCI DAC capable host bridges. You may configure
this option for Intel platforms with more than 4 GB of memory.
Most machines with less than 4GB of memory should use a setting
of 0 for best performance. If your machine has 4GB of memory
or more, you should set this option to 1 (the default).
The still experimental value 2 (64 bit DMA addressing with 16 x 4GB
segments limitation) can be used on systems that require PCI address
bits past bit 39 to be set for the addressing of memory using PCI
DAC cycles.
The still experimental value 2 (64 bit DMA addressing with 16
x 4GB segments limitation) can be used on systems that require
PCI address bits past bit 39 to be set for the addressing of
memory using PCI DAC cycles.
config SCSI_SYM53C8XX_DEFAULT_TAGS
int "default tagged command queue depth"
depends on SCSI_SYM53C8XX_2
default "16"
help
This is the default value of the command queue depth the driver will
announce to the generic SCSI layer for devices that support tagged
command queueing. This value can be changed from the boot command line.
This is a soft limit that cannot exceed CONFIG_SCSI_SYM53C8XX_MAX_TAGS.
This is the default value of the command queue depth the
driver will announce to the generic SCSI layer for devices
that support tagged command queueing. This value can be changed
from the boot command line. This is a soft limit that cannot
exceed CONFIG_SCSI_SYM53C8XX_MAX_TAGS.
config SCSI_SYM53C8XX_MAX_TAGS
int "maximum number of queued commands"
......@@ -954,11 +951,12 @@ config SCSI_SYM53C8XX_MAX_TAGS
This value is used as a compiled-in hard limit.
config SCSI_SYM53C8XX_IOMAPPED
bool "use normal IO"
bool "use port IO"
depends on SCSI_SYM53C8XX_2
help
If you say Y here, the driver will preferently use normal IO rather than
memory mapped IO.
If you say Y here, the driver will use port IO to access
the card. This is significantly slower then using memory
mapped IO. Most people should answer N.
config SCSI_ZALON
tristate "Zalon SCSI support"
......@@ -1274,7 +1272,7 @@ config SCSI_DC395x
config SCSI_DC390T
tristate "Tekram DC390(T) and Am53/79C974 SCSI support"
depends on PCI && SCSI && BROKEN
depends on PCI && SCSI
---help---
This driver supports PCI SCSI host adapters based on the Am53C974A
chip, e.g. Tekram DC390(T), DawiControl 2974 and some onboard
......
......@@ -28,7 +28,8 @@ Supported Cards/Chipsets
People
-------------------------
Alan Cox <alan@redhat.com>
Christoph Hellwig <hch@infradead.org> (small cleanups/fixes)
Christoph Hellwig <hch@infradead.org> (updates for new-style PCI probing and SCSI host registration,
small cleanups/fixes)
Matt Domsch <matt_domsch@dell.com> (revision ioctl, adapter messages)
Deanna Bonds <deanna_bonds@adaptec.com> (non-DASD support, PAE fibs and 64 bit, added new adaptec controllers
added new ioctls, changed scsi interface to use new error handler,
......
......@@ -4,6 +4,7 @@
*
* based on the old aacraid driver that is..
* Adaptec aacraid device driver for Linux.
*
* Copyright (c) 2000 Adaptec, Inc. (aacraid@adaptec.com)
*
* This program is free software; you can redistribute it and/or modify
......@@ -22,7 +23,6 @@
*
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
......@@ -31,11 +31,14 @@
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/completion.h>
#include <linux/blkdev.h>
#include <asm/semaphore.h>
#include <asm/uaccess.h>
#include <linux/blkdev.h>
#include "scsi.h"
#include "hosts.h"
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include "aacraid.h"
......@@ -194,9 +197,9 @@ struct sense_data {
static struct fsa_scsi_hba *fsa_dev[MAXIMUM_NUM_ADAPTERS]; /* SCSI Device Instance Pointers */
static struct sense_data sense_data[MAXIMUM_NUM_CONTAINERS];
static unsigned long aac_build_sg(Scsi_Cmnd* scsicmd, struct sgmap* sgmap);
static unsigned long aac_build_sg64(Scsi_Cmnd* scsicmd, struct sgmap64* psg);
static int aac_send_srb_fib(Scsi_Cmnd* scsicmd);
static unsigned long aac_build_sg(struct scsi_cmnd* scsicmd, struct sgmap* sgmap);
static unsigned long aac_build_sg64(struct scsi_cmnd* scsicmd, struct sgmap64* psg);
static int aac_send_srb_fib(struct scsi_cmnd* scsicmd);
#ifdef AAC_DETAILED_STATUS_INFO
static char *aac_get_status_string(u32 status);
#endif
......@@ -444,7 +447,7 @@ void set_sense(u8 *sense_buf, u8 sense_key, u8 sense_code,
}
}
static void aac_io_done(Scsi_Cmnd * scsicmd)
static void aac_io_done(struct scsi_cmnd * scsicmd)
{
unsigned long cpu_flags;
struct Scsi_Host *host = scsicmd->device->host;
......@@ -453,7 +456,7 @@ static void aac_io_done(Scsi_Cmnd * scsicmd)
spin_unlock_irqrestore(host->host_lock, cpu_flags);
}
static void __aac_io_done(Scsi_Cmnd * scsicmd)
static void __aac_io_done(struct scsi_cmnd * scsicmd)
{
scsicmd->scsi_done(scsicmd);
}
......@@ -538,11 +541,11 @@ static void read_callback(void *context, struct fib * fibptr)
{
struct aac_dev *dev;
struct aac_read_reply *readreply;
Scsi_Cmnd *scsicmd;
struct scsi_cmnd *scsicmd;
u32 lba;
u32 cid;
scsicmd = (Scsi_Cmnd *) context;
scsicmd = (struct scsi_cmnd *) context;
dev = (struct aac_dev *)scsicmd->device->host->hostdata;
cid =TARGET_LUN_TO_CONTAINER(scsicmd->device->id, scsicmd->device->lun);
......@@ -557,11 +560,11 @@ static void read_callback(void *context, struct fib * fibptr)
pci_unmap_sg(dev->pdev,
(struct scatterlist *)scsicmd->buffer,
scsicmd->use_sg,
scsi_to_pci_dma_dir(scsicmd->sc_data_direction));
scsicmd->sc_data_direction);
else if(scsicmd->request_bufflen)
pci_unmap_single(dev->pdev, (dma_addr_t)(ulong)scsicmd->SCp.ptr,
scsicmd->request_bufflen,
scsi_to_pci_dma_dir(scsicmd->sc_data_direction));
scsicmd->sc_data_direction);
readreply = (struct aac_read_reply *)fib_data(fibptr);
if (le32_to_cpu(readreply->status) == ST_OK)
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
......@@ -584,11 +587,11 @@ static void write_callback(void *context, struct fib * fibptr)
{
struct aac_dev *dev;
struct aac_write_reply *writereply;
Scsi_Cmnd *scsicmd;
struct scsi_cmnd *scsicmd;
u32 lba;
u32 cid;
scsicmd = (Scsi_Cmnd *) context;
scsicmd = (struct scsi_cmnd *) context;
dev = (struct aac_dev *)scsicmd->device->host->hostdata;
cid = TARGET_LUN_TO_CONTAINER(scsicmd->device->id, scsicmd->device->lun);
......@@ -601,11 +604,11 @@ static void write_callback(void *context, struct fib * fibptr)
pci_unmap_sg(dev->pdev,
(struct scatterlist *)scsicmd->buffer,
scsicmd->use_sg,
scsi_to_pci_dma_dir(scsicmd->sc_data_direction));
scsicmd->sc_data_direction);
else if(scsicmd->request_bufflen)
pci_unmap_single(dev->pdev, (dma_addr_t)(ulong)scsicmd->SCp.ptr,
scsicmd->request_bufflen,
scsi_to_pci_dma_dir(scsicmd->sc_data_direction));
scsicmd->sc_data_direction);
writereply = (struct aac_write_reply *) fib_data(fibptr);
if (le32_to_cpu(writereply->status) == ST_OK)
......@@ -625,7 +628,7 @@ static void write_callback(void *context, struct fib * fibptr)
aac_io_done(scsicmd);
}
int aac_read(Scsi_Cmnd * scsicmd, int cid)
int aac_read(struct scsi_cmnd * scsicmd, int cid)
{
u32 lba;
u32 count;
......@@ -736,7 +739,7 @@ int aac_read(Scsi_Cmnd * scsicmd, int cid)
return -1;
}
static int aac_write(Scsi_Cmnd * scsicmd, int cid)
static int aac_write(struct scsi_cmnd * scsicmd, int cid)
{
u32 lba;
u32 count;
......@@ -853,7 +856,7 @@ static int aac_write(Scsi_Cmnd * scsicmd, int cid)
* aacraid firmware.
*/
int aac_scsi_cmd(Scsi_Cmnd * scsicmd)
int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
{
u32 cid = 0;
struct fsa_scsi_hba *fsa_dev_ptr;
......@@ -1215,9 +1218,9 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
{
struct aac_dev *dev;
struct aac_srb_reply *srbreply;
Scsi_Cmnd *scsicmd;
struct scsi_cmnd *scsicmd;
scsicmd = (Scsi_Cmnd *) context;
scsicmd = (struct scsi_cmnd *) context;
dev = (struct aac_dev *)scsicmd->device->host->hostdata;
if (fibptr == NULL)
......@@ -1233,10 +1236,10 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
pci_unmap_sg(dev->pdev,
(struct scatterlist *)scsicmd->buffer,
scsicmd->use_sg,
scsi_to_pci_dma_dir(scsicmd->sc_data_direction));
scsicmd->sc_data_direction);
else if(scsicmd->request_bufflen)
pci_unmap_single(dev->pdev, (ulong)scsicmd->SCp.ptr, scsicmd->request_bufflen,
scsi_to_pci_dma_dir(scsicmd->sc_data_direction));
scsicmd->sc_data_direction);
/*
* First check the fib status
......@@ -1396,7 +1399,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
* scsicmd passed in.
*/
static int aac_send_srb_fib(Scsi_Cmnd* scsicmd)
static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
{
struct fib* cmd_fibcontext;
struct aac_dev* dev;
......@@ -1414,17 +1417,16 @@ static int aac_send_srb_fib(Scsi_Cmnd* scsicmd)
dev = (struct aac_dev *)scsicmd->device->host->hostdata;
switch(scsicmd->sc_data_direction){
case SCSI_DATA_WRITE:
case DMA_TO_DEVICE:
flag = SRB_DataOut;
break;
case SCSI_DATA_UNKNOWN:
case DMA_BIDIRECTIONAL:
flag = SRB_DataIn | SRB_DataOut;
break;
case SCSI_DATA_READ:
case DMA_FROM_DEVICE:
flag = SRB_DataIn;
break;
case SCSI_DATA_NONE:
default:
case DMA_NONE:
flag = SRB_NoDataXfer;
break;
}
......@@ -1507,7 +1509,7 @@ static int aac_send_srb_fib(Scsi_Cmnd* scsicmd)
return -1;
}
static unsigned long aac_build_sg(Scsi_Cmnd* scsicmd, struct sgmap* psg)
static unsigned long aac_build_sg(struct scsi_cmnd* scsicmd, struct sgmap* psg)
{
struct aac_dev *dev;
unsigned long byte_count = 0;
......@@ -1524,7 +1526,7 @@ static unsigned long aac_build_sg(Scsi_Cmnd* scsicmd, struct sgmap* psg)
sg = (struct scatterlist *) scsicmd->request_buffer;
sg_count = pci_map_sg(dev->pdev, sg, scsicmd->use_sg,
scsi_to_pci_dma_dir(scsicmd->sc_data_direction));
scsicmd->sc_data_direction);
psg->count = cpu_to_le32(sg_count);
byte_count = 0;
......@@ -1551,7 +1553,7 @@ static unsigned long aac_build_sg(Scsi_Cmnd* scsicmd, struct sgmap* psg)
addr = pci_map_single(dev->pdev,
scsicmd->request_buffer,
scsicmd->request_bufflen,
scsi_to_pci_dma_dir(scsicmd->sc_data_direction));
scsicmd->sc_data_direction);
psg->count = cpu_to_le32(1);
psg->sg[0].addr = cpu_to_le32(addr);
psg->sg[0].count = cpu_to_le32(scsicmd->request_bufflen);
......@@ -1562,7 +1564,7 @@ static unsigned long aac_build_sg(Scsi_Cmnd* scsicmd, struct sgmap* psg)
}
static unsigned long aac_build_sg64(Scsi_Cmnd* scsicmd, struct sgmap64* psg)
static unsigned long aac_build_sg64(struct scsi_cmnd* scsicmd, struct sgmap64* psg)
{
struct aac_dev *dev;
unsigned long byte_count = 0;
......@@ -1581,7 +1583,7 @@ static unsigned long aac_build_sg64(Scsi_Cmnd* scsicmd, struct sgmap64* psg)
sg = (struct scatterlist *) scsicmd->request_buffer;
sg_count = pci_map_sg(dev->pdev, sg, scsicmd->use_sg,
scsi_to_pci_dma_dir(scsicmd->sc_data_direction));
scsicmd->sc_data_direction);
psg->count = cpu_to_le32(sg_count);
byte_count = 0;
......@@ -1610,7 +1612,7 @@ static unsigned long aac_build_sg64(Scsi_Cmnd* scsicmd, struct sgmap64* psg)
addr = pci_map_single(dev->pdev,
scsicmd->request_buffer,
scsicmd->request_bufflen,
scsi_to_pci_dma_dir(scsicmd->sc_data_direction));
scsicmd->sc_data_direction);
psg->count = cpu_to_le32(1);
le_addr = cpu_to_le64(addr);
psg->sg[0].addr[1] = (u32)(le_addr>>32);
......
......@@ -520,10 +520,6 @@ struct adapter_ops
struct aac_driver_ident
{
u16 vendor;
u16 device;
u16 subsystem_vendor;
u16 subsystem_device;
int (*init)(struct aac_dev *dev, unsigned long num);
char * name;
char * vname;
......@@ -1466,6 +1462,8 @@ static inline u32 cap_to_cyls(sector_t capacity, u32 divisor)
return (u32)capacity;
}
struct scsi_cmnd;
const char *aac_driverinfo(struct Scsi_Host *);
struct fib *fib_alloc(struct aac_dev *dev);
int fib_setup(struct aac_dev *dev);
......@@ -1480,10 +1478,9 @@ int aac_consumer_avail(struct aac_dev * dev, struct aac_queue * q);
void aac_consumer_free(struct aac_dev * dev, struct aac_queue * q, u32 qnum);
int fib_complete(struct fib * context);
#define fib_data(fibctx) ((void *)(fibctx)->hw_fib->data)
int aac_detach(struct aac_dev *dev);
struct aac_dev *aac_init_adapter(struct aac_dev *dev);
int aac_get_containers(struct aac_dev *dev);
int aac_scsi_cmd(Scsi_Cmnd *scsi_cmnd_ptr);
int aac_scsi_cmd(struct scsi_cmnd *cmd);
int aac_dev_ioctl(struct aac_dev *dev, int cmd, void *arg);
int aac_do_ioctl(struct aac_dev * dev, int cmd, void *arg);
int aac_rx_init(struct aac_dev *dev, unsigned long devNumber);
......@@ -1495,3 +1492,4 @@ int aac_close_fib_context(struct aac_dev * dev, struct aac_fib_context *fibctx);
int fib_adapter_complete(struct fib * fibptr, unsigned short size);
struct aac_driver_ident* aac_get_driver_ident(int devtype);
int aac_get_adapter_info(struct aac_dev* dev);
int aac_send_shutdown(struct aac_dev *dev);
......@@ -28,7 +28,6 @@
*
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
......@@ -37,11 +36,10 @@
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/completion.h>
#include <linux/dma-mapping.h>
#include <linux/blkdev.h>
#include <asm/semaphore.h>
#include <asm/uaccess.h>
#include "scsi.h"
#include "hosts.h"
#include "aacraid.h"
......@@ -439,16 +437,16 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
switch(srbcmd->flags){
case SRB_DataOut:
data_dir = SCSI_DATA_WRITE;
data_dir = DMA_TO_DEVICE;
break;
case (SRB_DataIn | SRB_DataOut):
data_dir = SCSI_DATA_UNKNOWN;
data_dir = DMA_BIDIRECTIONAL;
break;
case SRB_DataIn:
data_dir = SCSI_DATA_READ;
data_dir = DMA_FROM_DEVICE;
break;
default:
data_dir = SCSI_DATA_NONE;
data_dir = DMA_NONE;
}
if( dev->pae_support ==1 ) {
struct sgmap64* psg = (struct sgmap64*)&srbcmd->sg;
......@@ -484,7 +482,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
goto cleanup;
}
}
addr = pci_map_single(dev->pdev, p, psg->sg[i].count, scsi_to_pci_dma_dir(data_dir));
addr = pci_map_single(dev->pdev, p, psg->sg[i].count, data_dir);
le_addr = cpu_to_le64(addr);
psg->sg[i].addr[1] = (u32)(le_addr>>32);
......@@ -526,7 +524,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
goto cleanup;
}
}
addr = pci_map_single(dev->pdev, p, psg->sg[i].count, scsi_to_pci_dma_dir(data_dir));
addr = pci_map_single(dev->pdev, p, psg->sg[i].count, data_dir);
psg->sg[i].addr = cpu_to_le32(addr);
psg->sg[i].count = cpu_to_le32(psg->sg[i].count);
......
......@@ -29,7 +29,6 @@
*
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
......@@ -41,15 +40,11 @@
#include <linux/completion.h>
#include <linux/mm.h>
#include <asm/semaphore.h>
#include "scsi.h"
#include "hosts.h"
#include "aacraid.h"
struct aac_common aac_config;
static struct aac_dev *devices;
static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long commsize, unsigned long commalign)
{
unsigned char *base;
......@@ -163,7 +158,7 @@ static void aac_queue_init(struct aac_dev * dev, struct aac_queue * q, u32 *mem,
* This routine will send a VM_CloseAll (shutdown) request to the adapter.
*/
static int aac_send_shutdown(struct aac_dev * dev)
int aac_send_shutdown(struct aac_dev * dev)
{
struct fib * fibctx;
struct aac_close *cmd;
......@@ -190,35 +185,6 @@ static int aac_send_shutdown(struct aac_dev * dev)
return status;
}
/**
* aac_detach - detach adapter
* @detach: adapter to disconnect
*
* Disconnect and shutdown an AAC based adapter, freeing resources
* as we go.
*/
int aac_detach(struct aac_dev *detach)
{
struct aac_dev **dev = &devices;
while(*dev)
{
if(*dev == detach)
{
*dev = detach->next;
aac_send_shutdown(detach);
fib_map_free(detach);
pci_free_consistent(detach->pdev, detach->comm_size, detach->comm_addr, detach->comm_phys);
kfree(detach->queues);
return 1;
}
dev=&((*dev)->next);
}
BUG();
return 0;
}
/**
* aac_comm_init - Initialise FSA data structures
* @dev: Adapter to initialise
......@@ -344,11 +310,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
INIT_LIST_HEAD(&dev->fib_list);
init_completion(&dev->aif_completion);
/*
* Add this adapter in to our dev List.
*/
dev->next = devices;
devices = dev;
return dev;
}
......
......@@ -3,7 +3,6 @@
* (c) Copyright 2001 Red Hat Inc. <alan@redhat.com>
*
* based on the old aacraid driver that is..
* Adaptec aacraid device driver for Linux.
*
* Copyright (c) 2000 Adaptec, Inc. (aacraid@adaptec.com)
......@@ -28,10 +27,8 @@
* Abstract: Contain all routines that are required for FSA host/adapter
* commuication.
*
*
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
......@@ -40,10 +37,8 @@
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/completion.h>
#include <asm/semaphore.h>
#include <linux/blkdev.h>
#include "scsi.h"
#include "hosts.h"
#include <asm/semaphore.h>
#include "aacraid.h"
......
......@@ -29,7 +29,6 @@
*
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
......@@ -40,8 +39,6 @@
#include <linux/completion.h>
#include <linux/blkdev.h>
#include <asm/semaphore.h>
#include "scsi.h"
#include "hosts.h"
#include "aacraid.h"
......
This diff is collapsed.
......@@ -28,7 +28,6 @@
*
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
......@@ -41,8 +40,8 @@
#include <linux/completion.h>
#include <linux/interrupt.h>
#include <asm/semaphore.h>
#include "scsi.h"
#include "hosts.h"
#include <scsi/scsi_host.h>
#include "aacraid.h"
......
......@@ -28,7 +28,6 @@
*
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
......@@ -41,8 +40,8 @@
#include <linux/completion.h>
#include <linux/interrupt.h>
#include <asm/semaphore.h>
#include "scsi.h"
#include "hosts.h"
#include <scsi/scsi_host.h>
#include "aacraid.h"
......
This diff is collapsed.
......@@ -27,6 +27,9 @@
* Converted to EISA and generic DMA APIs by Marc Zyngier
* <maz@wild-wind.fr.eu.org>, 4/2003.
*
* Shared interrupt support added by Rask Ingemann Lambertsen
* <rask@sygehus.dk>, 10/2003
*
* For the avoidance of doubt the "preferred form" of this code is one which
* is in an open non patent encumbered format. Where cryptographic key signing
* forms part of the process of creating an executable the information
......@@ -518,15 +521,17 @@ static int aha1740_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))
return 0;
}
/* Query the board for its irq_level. Nothing else matters
/* Query the board for its irq_level and irq_type. Nothing else matters
in enhanced mode on an EISA bus. */
static void aha1740_getconfig(unsigned int base, unsigned int *irq_level,
unsigned int *irq_type,
unsigned int *translation)
{
static int intab[] = { 9, 10, 11, 12, 0, 14, 15, 0 };
*irq_level = intab[inb(INTDEF(base)) & 0x7];
*irq_type = (inb(INTDEF(base)) & 0x8) >> 3;
*translation = inb(RESV1(base)) & 0x1;
outb(inb(INTDEF(base)) | 0x10, INTDEF(base));
}
......@@ -583,7 +588,7 @@ static Scsi_Host_Template aha1740_template = {
static int aha1740_probe (struct device *dev)
{
int slotbase;
unsigned int irq_level, translation;
unsigned int irq_level, irq_type, translation;
struct Scsi_Host *shpnt;
struct aha1740_hostdata *host;
struct eisa_device *edev = to_eisa_device (dev);
......@@ -595,15 +600,15 @@ static int aha1740_probe (struct device *dev)
return -EBUSY;
if (!aha1740_test_port(slotbase))
goto err_release_region;
aha1740_getconfig(slotbase,&irq_level,&translation);
aha1740_getconfig(slotbase,&irq_level,&irq_type,&translation);
if ((inb(G2STAT(slotbase)) &
(G2STAT_MBXOUT|G2STAT_BUSY)) != G2STAT_MBXOUT) {
/* If the card isn't ready, hard reset it */
outb(G2CNTRL_HRST, G2CNTRL(slotbase));
outb(0, G2CNTRL(slotbase));
}
printk(KERN_INFO "Configuring slot %d at IO:%x, IRQ %d\n",
edev->slot, slotbase, irq_level);
printk(KERN_INFO "Configuring slot %d at IO:%x, IRQ %u (%s)\n",
edev->slot, slotbase, irq_level, irq_type ? "edge" : "level");
printk(KERN_INFO "aha174x: Extended translation %sabled.\n",
translation ? "en" : "dis");
shpnt = scsi_host_alloc(&aha1740_template,
......@@ -629,7 +634,8 @@ static int aha1740_probe (struct device *dev)
}
DEB(printk("aha1740_probe: enable interrupt channel %d\n",irq_level));
if (request_irq(irq_level,aha1740_intr_handle,0,"aha1740",shpnt)) {
if (request_irq(irq_level,aha1740_intr_handle,irq_type ? 0 : SA_SHIRQ,
"aha1740",shpnt)) {
printk(KERN_ERR "aha1740_probe: Unable to allocate IRQ %d.\n",
irq_level);
goto err_unmap;
......
......@@ -467,6 +467,7 @@ int cpqfcTS_detect(Scsi_Host_Template *ScsiHostTemplate)
return NumberOfAdapters;
}
#ifdef SUPPORT_RESET
static void my_ioctl_done (Scsi_Cmnd * SCpnt)
{
struct request * req;
......@@ -477,7 +478,7 @@ static void my_ioctl_done (Scsi_Cmnd * SCpnt)
if (req->CPQFC_WAITING != NULL)
CPQFC_COMPLETE(req->CPQFC_WAITING);
}
#endif
static int cpqfc_alloc_private_data_pool(CPQFCHBA *hba)
{
......@@ -1577,6 +1578,8 @@ int cpqfcTS_eh_abort(Scsi_Cmnd *Cmnd)
// See dpANS Fibre Channel Protocol for SCSI
// X3.269-199X revision 12, pg 25
#ifdef SUPPORT_RESET
int cpqfcTS_TargetDeviceReset( Scsi_Device *ScsiDev,
unsigned int reset_flags)
{
......@@ -1592,8 +1595,7 @@ int cpqfcTS_TargetDeviceReset( Scsi_Device *ScsiDev,
// around the 2.5.30 kernel. Scsi_Cmnd replaced with
// Scsi_Request, etc.
// For now, so people don't fall into a hole...
return -ENOTSUPP;
/*
// printk(" ENTERING cpqfcTS_TargetDeviceReset() - flag=%d \n",reset_flags);
if (ScsiDev->host->eh_active) return FAILED;
......@@ -1647,7 +1649,6 @@ return -ENOTSUPP;
SCpnt->sense_buffer[2] & 0xf);
};
*/
result = SCpnt->result;
SDpnt = SCpnt->device;
......@@ -1658,6 +1659,14 @@ return -ENOTSUPP;
return SUCCESS;
}
#else
int cpqfcTS_TargetDeviceReset( Scsi_Device *ScsiDev,
unsigned int reset_flags)
{
return -ENOTSUPP;
}
#endif /* SUPPORT_RESET */
int cpqfcTS_eh_device_reset(Scsi_Cmnd *Cmnd)
{
......
......@@ -36,14 +36,10 @@
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);
extern int DC390_reset(Scsi_Cmnd *cmd, unsigned int resetFlags);
extern int DC390_reset(Scsi_Cmnd *cmd);
extern int DC390_bios_param(struct scsi_device *sdev, struct block_device *dev,
sector_t capacity, int geom[]);
#ifdef MODULE
static int DC390_release(struct Scsi_Host *);
#else
# define DC390_release NULL
#endif
#endif /* DC390_H */
......@@ -108,9 +108,6 @@ ORC_SCB *orc_alloc_scb(ORC_HCS * hcsp);
/* ---- EXTERNAL FUNCTIONS ---- */
extern void inia100SCBPost(BYTE * pHcb, BYTE * pScb);
/* ---- INTERNAL VARIABLES ---- */
struct inia100_Adpt_Struc *inia100_adpt;
NVRAM nvram, *nvramp = &nvram;
static UCHAR dftNvRam[64] =
{
......@@ -702,83 +699,6 @@ void orc_release_dma(ORC_HCS * hcsp, Scsi_Cmnd * SCpnt)
}
}
/*****************************************************************************
Function name : Addinia100_into_Adapter_table
Description : This function will scan PCI bus to get all Orchid card
Input : None.
Output : None.
Return : SUCCESSFUL - Successful scan
ohterwise - No drives founded
*****************************************************************************/
int Addinia100_into_Adapter_table(WORD wBIOS, WORD wBASE, struct pci_dev *pdev,
int iAdapters)
{
unsigned int i, j;
for (i = 0; i < iAdapters; i++) {
if (inia100_adpt[i].ADPT_BIOS < wBIOS)
continue;
if (inia100_adpt[i].ADPT_BIOS == wBIOS) {
if (inia100_adpt[i].ADPT_BASE == wBASE) {
if (inia100_adpt[i].ADPT_pdev->bus->number != 0xFF)
return (FAILURE);
} else if (inia100_adpt[i].ADPT_BASE < wBASE)
continue;
}
for (j = iAdapters - 1; j > i; j--) {
inia100_adpt[j].ADPT_BASE = inia100_adpt[j - 1].ADPT_BASE;
inia100_adpt[j].ADPT_BIOS = inia100_adpt[j - 1].ADPT_BIOS;
inia100_adpt[j].ADPT_pdev = inia100_adpt[j - 1].ADPT_pdev;
}
inia100_adpt[i].ADPT_BASE = wBASE;
inia100_adpt[i].ADPT_BIOS = wBIOS;
inia100_adpt[i].ADPT_pdev = pdev;
return (SUCCESSFUL);
}
return (FAILURE);
}
/*****************************************************************************
Function name : init_inia100Adapter_table
Description : This function will scan PCI bus to get all Orchid card
Input : None.
Output : None.
Return : 0 on success, 1 on failure
*****************************************************************************/
int init_inia100Adapter_table(int iAdapters)
{
int i;
inia100_adpt = kmalloc(sizeof(INIA100_ADPT_STRUCT) * iAdapters,
GFP_KERNEL);
if(inia100_adpt == NULL)
return 1;
for (i = 0; i < iAdapters; i++) {/* Initialize adapter structure */
inia100_adpt[i].ADPT_BIOS = 0xffff;
inia100_adpt[i].ADPT_BASE = 0xffff;
inia100_adpt[i].ADPT_pdev = NULL;
}
return 0;
}
/*****************************************************************************
Function name : get_orcPCIConfig
Description :
Input : pHCB - Pointer to host adapter structure
Output : None.
Return : pSRB - Pointer to SCSI request block.
*****************************************************************************/
void get_orcPCIConfig(ORC_HCS * pCurHcb, int ch_idx)
{
pCurHcb->HCS_Base = inia100_adpt[ch_idx].ADPT_BASE; /* Supply base address */
pCurHcb->HCS_BIOS = inia100_adpt[ch_idx].ADPT_BIOS; /* Supply BIOS address */
pCurHcb->HCS_Intr = inia100_adpt[ch_idx].ADPT_pdev->irq; /* Supply interrupt line */
return;
}
/*****************************************************************************
Function name : abort_SCB
Description : Abort a queued command.
......
......@@ -104,12 +104,12 @@
* Now fixed.
* 05/07/99 bv - v1.03g
* - Changed the assumption that HZ = 100
* 10/17/03 mc - v1.04
* - added new DMA API support
**************************************************************************/
#define CVT_LINUX_VERSION(V,P,S) (V * 65536 + P * 256 + S)
#error Please convert me to Documentation/DMA-mapping.txt
#ifndef LINUX_VERSION_CODE
#include <linux/version.h>
#endif
......@@ -143,13 +143,12 @@ unsigned int i91u_debug = DEBUG_DEFAULT;
static Scsi_Host_Template driver_template = {
.proc_name = "INI9100U",
.proc_info = "INI9100U",
.name = i91u_REVID,
.detect = i91u_detect,
.release = i91u_release,
.queuecommand = i91u_queue,
.abort = i91u_abort,
.reset = i91u_reset,
// .abort = i91u_abort,
// .reset = i91u_reset,
.bios_param = i91u_biosparam,
.can_queue = 1,
.this_id = 1,
......@@ -162,7 +161,7 @@ static Scsi_Host_Template driver_template = {
char *i91uCopyright = "Copyright (C) 1996-98";
char *i91uInitioName = "by Initio Corporation";
char *i91uProductName = "INI-9X00U/UW";
char *i91uVersion = "v1.03g";
char *i91uVersion = "v1.04";
#define TULSZ(sz) (sizeof(sz) / sizeof(sz[0]))
#define TUL_RDWORD(x,y) (short)(inl((int)((ULONG)((ULONG)x+(UCHAR)y)) ))
......@@ -238,12 +237,12 @@ static void i91uAppendSRBToQueue(HCS * pHCB, Scsi_Cmnd * pSRB)
ULONG flags;
spin_lock_irqsave(&(pHCB->pSRB_lock), flags);
pSRB->next = NULL; /* Pointer to next */
pSRB->host_scribble = NULL; /* Pointer to next */
if (pHCB->pSRB_head == NULL)
pHCB->pSRB_head = pSRB;
else
pHCB->pSRB_tail->next = pSRB; /* Pointer to next */
pHCB->pSRB_tail->host_scribble = (char *)pSRB; /* Pointer to next */
pHCB->pSRB_tail = pSRB;
spin_unlock_irqrestore(&(pHCB->pSRB_lock), flags);
......@@ -265,8 +264,8 @@ static Scsi_Cmnd *i91uPopSRBFromQueue(HCS * pHCB)
spin_lock_irqsave(&(pHCB->pSRB_lock), flags);
if ((pSRB = pHCB->pSRB_head) != NULL) {
pHCB->pSRB_head = pHCB->pSRB_head->next;
pSRB->next = NULL;
pHCB->pSRB_head = (struct scsi_cmnd *)pHCB->pSRB_head->host_scribble;
pSRB->host_scribble = NULL;
}
spin_unlock_irqrestore(&(pHCB->pSRB_lock), flags);
......@@ -308,6 +307,12 @@ int tul_NewReturnNumberOfAdapters(void)
if (((dRegValue & 0xFF00) >> 8) == 0xFF)
dRegValue = 0;
wBIOS = (wBIOS << 8) + ((UWORD) ((dRegValue & 0xFF00) >> 8));
if (pci_set_dma_mask(pDev, 0xffffffff)) {
printk(KERN_WARNING
"i91u: Could not set 32 bit DMA mask\n");
continue;
}
if (Addi91u_into_Adapter_table(wBIOS,
(pDev->resource[0].start),
pDev->irq,
......@@ -323,7 +328,6 @@ int tul_NewReturnNumberOfAdapters(void)
int i91u_detect(Scsi_Host_Template * tpnt)
{
SCB *pSCB;
HCS *pHCB;
struct Scsi_Host *hreg;
unsigned long i; /* 01/14/98 */
......@@ -346,12 +350,7 @@ int i91u_detect(Scsi_Host_Template * tpnt)
#endif
}
/* Get total number of adapters in the motherboard */
#ifdef CONFIG_PCI
iAdapters = tul_NewReturnNumberOfAdapters();
#else
iAdapters = tul_ReturnNumberOfAdapters();
#endif
if (iAdapters == 0) /* If no tulip founded, return */
return (0);
......@@ -379,11 +378,6 @@ int i91u_detect(Scsi_Host_Template * tpnt)
}
memset((unsigned char *) tul_scb, 0, i);
pSCB = tul_scb;
for (i = 0; i < tul_num_ch * tul_num_scb; i++, pSCB++) {
pSCB->SCB_SGPAddr = (U32) VIRT_TO_BUS(&pSCB->SCB_SGList[0]);
}
for (i = 0, pHCB = &tul_hcs[0]; /* Get pointer for control block */
i < tul_num_ch;
i++, pHCB++) {
......@@ -476,6 +470,7 @@ static void i91uBuildSCB(HCS * pHCB, SCB * pSCB, Scsi_Cmnd * SCpnt)
SG *pSG; /* Pointer to SG list */
int i;
long TotalLen;
dma_addr_t dma_addr;
pSCB->SCB_Post = i91uSCBPost; /* i91u's callback routine */
pSCB->SCB_Srb = SCpnt;
......@@ -484,11 +479,13 @@ static void i91uBuildSCB(HCS * pHCB, SCB * pSCB, Scsi_Cmnd * SCpnt)
pSCB->SCB_Target = SCpnt->device->id;
pSCB->SCB_Lun = SCpnt->device->lun;
pSCB->SCB_Ident = SCpnt->device->lun | DISC_ALLOW;
pSCB->SCB_Flags |= SCF_SENSE; /* Turn on auto request sense */
pSCB->SCB_SensePtr = (U32) VIRT_TO_BUS(SCpnt->sense_buffer);
pSCB->SCB_Flags |= SCF_SENSE; /* Turn on auto request sense */
dma_addr = dma_map_single(&pHCB->pci_dev->dev, SCpnt->sense_buffer,
SENSE_SIZE, DMA_FROM_DEVICE);
pSCB->SCB_SensePtr = cpu_to_le32((u32)dma_addr);
pSCB->SCB_SenseLen = SENSE_SIZE;
SCpnt->SCp.ptr = (char *)(unsigned long)dma_addr;
pSCB->SCB_CDBLen = SCpnt->cmd_len;
pSCB->SCB_HaStat = 0;
......@@ -500,33 +497,39 @@ static void i91uBuildSCB(HCS * pHCB, SCB * pSCB, Scsi_Cmnd * SCpnt)
} else {
pSCB->SCB_TagMsg = 0; /* No tag support */
}
/* todo handle map_sg error */
if (SCpnt->use_sg) {
dma_addr = dma_map_single(&pHCB->pci_dev->dev, &pSCB->SCB_SGList[0],
sizeof(struct SG_Struc) * TOTAL_SG_ENTRY,
DMA_BIDIRECTIONAL);
pSCB->SCB_BufPtr = dma_addr;
SCpnt->SCp.dma_handle = dma_addr;
pSrbSG = (struct scatterlist *) SCpnt->request_buffer;
if (SCpnt->use_sg == 1) { /* If only one entry in the list *//* treat it as regular I/O */
pSCB->SCB_BufPtr = (U32) VIRT_TO_BUS(pSrbSG->address);
TotalLen = pSrbSG->length;
pSCB->SCB_SGLen = 0;
} else { /* Assign SG physical address */
pSCB->SCB_BufPtr = pSCB->SCB_SGPAddr;
pSCB->SCB_Flags |= SCF_SG; /* Turn on SG list flag */
for (i = 0, TotalLen = 0, pSG = &pSCB->SCB_SGList[0]; /* 1.01g */
i < SCpnt->use_sg;
i++, pSG++, pSrbSG++) {
pSG->SG_Ptr = (U32) VIRT_TO_BUS(pSrbSG->address);
TotalLen += pSG->SG_Len = pSrbSG->length;
}
pSCB->SCB_SGLen = i;
pSCB->SCB_SGLen = dma_map_sg(&pHCB->pci_dev->dev, pSrbSG,
SCpnt->use_sg, SCpnt->sc_data_direction);
pSCB->SCB_Flags |= SCF_SG; /* Turn on SG list flag */
for (i = 0, TotalLen = 0, pSG = &pSCB->SCB_SGList[0]; /* 1.01g */
i < pSCB->SCB_SGLen; i++, pSG++, pSrbSG++) {
pSG->SG_Ptr = (u32)sg_dma_address(pSrbSG);
TotalLen += pSG->SG_Len = (u32)sg_dma_len(pSrbSG);
}
pSCB->SCB_BufLen = (SCpnt->request_bufflen > TotalLen) ?
TotalLen : SCpnt->request_bufflen;
} else { /* Non SG */
pSCB->SCB_BufPtr = (U32) VIRT_TO_BUS(SCpnt->request_buffer);
pSCB->SCB_BufLen = SCpnt->request_bufflen;
} else if (SCpnt->request_bufflen) { /* Non SG */
dma_addr = dma_map_single(&pHCB->pci_dev->dev, SCpnt->request_buffer,
SCpnt->request_bufflen,
SCpnt->sc_data_direction);
SCpnt->SCp.dma_handle = dma_addr;
pSCB->SCB_BufPtr = (u32)dma_addr;
pSCB->SCB_BufLen = (u32)SCpnt->request_bufflen;
pSCB->SCB_SGLen = 0;
} else {
pSCB->SCB_BufLen = 0;
pSCB->SCB_SGLen = 0;
}
return;
}
/*
......@@ -623,6 +626,32 @@ int i91u_biosparam(struct scsi_device *sdev, struct block_device *dev,
return 0;
}
static void i91u_unmap_cmnd(struct pci_dev *pci_dev, struct scsi_cmnd *cmnd)
{
/* auto sense buffer */
if (cmnd->SCp.ptr) {
dma_unmap_single(&pci_dev->dev,
(dma_addr_t)((unsigned long)cmnd->SCp.ptr),
SENSE_SIZE, SCSI_DATA_READ);
cmnd->SCp.ptr = NULL;
}
/* request buffer */
if (cmnd->use_sg) {
dma_unmap_single(&pci_dev->dev, cmnd->SCp.dma_handle,
sizeof(struct SG_Struc) * TOTAL_SG_ENTRY,
DMA_BIDIRECTIONAL);
dma_unmap_sg(&pci_dev->dev, cmnd->request_buffer,
cmnd->use_sg,
cmnd->sc_data_direction);
} else if (cmnd->request_bufflen) {
dma_unmap_single(&pci_dev->dev, cmnd->SCp.dma_handle,
cmnd->request_bufflen,
cmnd->sc_data_direction);
}
}
/*****************************************************************************
Function name : i91uSCBPost
Description : This is callback routine be called when tulip finish one
......@@ -686,6 +715,8 @@ static void i91uSCBPost(BYTE * pHcb, BYTE * pScb)
if (pSRB == NULL) {
printk("pSRB is NULL\n");
}
i91u_unmap_cmnd(pHCB->pci_dev, pSRB);
pSRB->scsi_done(pSRB); /* Notify system DONE */
if ((pSRB = i91uPopSRBFromQueue(pHCB)) != NULL)
/* Find the next pending SRB */
......
This diff is collapsed.
......@@ -67,13 +67,6 @@
#include <linux/types.h>
#include <linux/pci.h>
static int inia100_detect(Scsi_Host_Template *);
static int inia100_release(struct Scsi_Host *);
static int inia100_queue(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
static int inia100_abort(Scsi_Cmnd *);
static int inia100_device_reset(Scsi_Cmnd *);
static int inia100_bus_reset(Scsi_Cmnd *);
#define inia100_REVID "Initio INI-A100U2W SCSI device driver; Revision: 1.02d"
#define ULONG unsigned long
......@@ -115,13 +108,6 @@ typedef struct ORC_SG_Struc {
U32 SG_Len; /* Data Length */
} ORC_SG;
typedef struct inia100_Adpt_Struc {
UWORD ADPT_BIOS; /* 0 */
UWORD ADPT_BASE; /* 1 */
struct pci_dev *ADPT_pdev; /* 2 */
} INIA100_ADPT_STRUCT;
/* SCSI related definition */
#define DISC_NOT_ALLOW 0x80 /* Disconnect is not allowed */
#define DISC_ALLOW 0xC0 /* Disconnect is allowed */
......@@ -211,7 +197,7 @@ typedef struct inia100_Adpt_Struc {
typedef struct orc_extended_scb { /* Extended SCB */
ORC_SG ESCB_SGList[TOTAL_SG_ENTRY]; /*0 Start of SG list */
Scsi_Cmnd *SCB_Srb; /*50 SRB Pointer */
struct scsi_cmnd *SCB_Srb; /*50 SRB Pointer */
} ESCB;
/***********************************************************************
......@@ -344,8 +330,8 @@ typedef struct ORC_Ha_Ctrl_Struc {
ORC_TCS HCS_Tcs[16]; /* 28 */
U32 BitAllocFlag[MAX_CHANNELS][8]; /* Max STB is 256, So 256/32 */
spinlock_t BitAllocFlagLock;
Scsi_Cmnd *pSRB_head;
Scsi_Cmnd *pSRB_tail;
struct scsi_cmnd *pSRB_head;
struct scsi_cmnd *pSRB_tail;
spinlock_t pSRB_lock;
struct pci_dev *pdev;
} ORC_HCS;
......
This diff is collapsed.
......@@ -989,8 +989,6 @@ typedef enum { LOCK_INT, LOCK_EXT } lockscope_t;
const char *megaraid_info (struct Scsi_Host *);
static int megaraid_detect(Scsi_Host_Template *);
static void mega_find_card(Scsi_Host_Template *, u16, u16);
static int mega_query_adapter(adapter_t *);
static inline int issue_scb(adapter_t *, scb_t *);
static int mega_setup_mailbox(adapter_t *);
......@@ -1007,7 +1005,6 @@ static irqreturn_t megaraid_isr_iomapped(int, void *, struct pt_regs *);
static void mega_free_scb(adapter_t *, scb_t *);
static int megaraid_release (struct Scsi_Host *);
static int megaraid_abort(Scsi_Cmnd *);
static int megaraid_reset(Scsi_Cmnd *);
static int megaraid_abort_and_reset(adapter_t *, Scsi_Cmnd *, int);
......@@ -1025,8 +1022,6 @@ static inline void mega_free_sgl (adapter_t *adapter);
static void mega_8_to_40ld (mraid_inquiry *inquiry,
mega_inquiry3 *enquiry3, mega_product_info *);
static int megaraid_reboot_notify (struct notifier_block *,
unsigned long, void *);
static int megadev_open (struct inode *, struct file *);
static int megadev_ioctl (struct inode *, struct file *, unsigned int,
unsigned long);
......
......@@ -7,7 +7,7 @@ menu "PCMCIA SCSI adapter support"
config PCMCIA_AHA152X
tristate "Adaptec AHA152X PCMCIA support"
depends on m
depends on m && !64BIT
help
Say Y here if you intend to attach this type of PCMCIA SCSI host
adapter to your computer.
......@@ -27,7 +27,7 @@ config PCMCIA_FDOMAIN
config PCMCIA_NINJA_SCSI
tristate "NinjaSCSI-3 / NinjaSCSI-32Bi (16bit) PCMCIA support"
depends on m
depends on m && !64BIT
help
If you intend to attach this type of PCMCIA SCSI host adapter to
your computer, say Y here and read
......
......@@ -351,6 +351,124 @@ void scsi_destroy_command_freelist(struct Scsi_Host *shost)
up(&host_cmd_pool_mutex);
}
#ifdef CONFIG_SCSI_LOGGING
void scsi_log_send(struct scsi_cmnd *cmd)
{
unsigned int level;
struct scsi_device *sdev;
/*
* If ML QUEUE log level is greater than or equal to:
*
* 1: nothing (match completion)
*
* 2: log opcode + command of all commands
*
* 3: same as 2 plus dump cmd address
*
* 4: same as 3 plus dump extra junk
*/
if (unlikely(scsi_logging_level)) {
level = SCSI_LOG_LEVEL(SCSI_LOG_MLQUEUE_SHIFT,
SCSI_LOG_MLQUEUE_BITS);
if (level > 1) {
sdev = cmd->device;
printk(KERN_INFO "scsi <%d:%d:%d:%d> send ",
sdev->host->host_no, sdev->channel, sdev->id,
sdev->lun);
if (level > 2)
printk("0x%p ", cmd);
/*
* spaces to match disposition and cmd->result
* output in scsi_log_completion.
*/
printk(" ");
print_command(cmd->cmnd);
if (level > 3) {
printk(KERN_INFO "buffer = 0x%p, bufflen = %d,"
" done = 0x%p, queuecommand 0x%p\n",
cmd->buffer, cmd->bufflen,
cmd->done,
sdev->host->hostt->queuecommand);
}
}
}
}
void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)
{
unsigned int level;
struct scsi_device *sdev;
/*
* If ML COMPLETE log level is greater than or equal to:
*
* 1: log disposition, result, opcode + command, and conditionally
* sense data for failures or non SUCCESS dispositions.
*
* 2: same as 1 but for all command completions.
*
* 3: same as 2 plus dump cmd address
*
* 4: same as 3 plus dump extra junk
*/
if (unlikely(scsi_logging_level)) {
level = SCSI_LOG_LEVEL(SCSI_LOG_MLCOMPLETE_SHIFT,
SCSI_LOG_MLCOMPLETE_BITS);
if (((level > 0) && (cmd->result || disposition != SUCCESS)) ||
(level > 1)) {
sdev = cmd->device;
printk(KERN_INFO "scsi <%d:%d:%d:%d> done ",
sdev->host->host_no, sdev->channel, sdev->id,
sdev->lun);
if (level > 2)
printk("0x%p ", cmd);
/*
* Dump truncated values, so we usually fit within
* 80 chars.
*/
switch (disposition) {
case SUCCESS:
printk("SUCCESS");
break;
case NEEDS_RETRY:
printk("RETRY ");
break;
case ADD_TO_MLQUEUE:
printk("MLQUEUE");
break;
case FAILED:
printk("FAILED ");
break;
case TIMEOUT:
/*
* If called via scsi_times_out.
*/
printk("TIMEOUT");
break;
default:
printk("UNKNOWN");
}
printk(" %8x ", cmd->result);
print_command(cmd->cmnd);
if (status_byte(cmd->result) & CHECK_CONDITION) {
/*
* XXX The print_sense formatting/prefix
* doesn't match this function.
*/
print_sense("", cmd);
}
if (level > 3) {
printk(KERN_INFO "scsi host busy %d failed %d\n",
sdev->host->host_busy,
sdev->host->host_failed);
}
}
}
}
#endif
/*
* Function: scsi_dispatch_command
*
......@@ -416,16 +534,12 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
scsi_add_timer(cmd, cmd->timeout_per_command, scsi_times_out);
scsi_log_send(cmd);
/*
* We will use a queued command if possible, otherwise we will
* emulate the queuing and calling of completion function ourselves.
*/
SCSI_LOG_MLQUEUE(3, printk("scsi_dispatch_cmnd (host = %d, "
"channel = %d, target = %d, command = %p, "
"buffer = %p, \nbufflen = %d, done = %p)\n",
host->host_no, cmd->device->channel,
cmd->device->id, cmd->cmnd, cmd->buffer,
cmd->bufflen, cmd->done));
cmd->state = SCSI_STATE_QUEUED;
cmd->owner = SCSI_OWNER_LOWLEVEL;
......@@ -445,9 +559,6 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
goto out;
}
SCSI_LOG_MLQUEUE(3, printk("queuecommand : routine at %p\n",
host->hostt->queuecommand));
spin_lock_irqsave(host->host_lock, flags);
if (unlikely(test_bit(SHOST_CANCEL, &host->shost_state))) {
cmd->result = (DID_NO_CONNECT << 16);
......@@ -604,6 +715,7 @@ void scsi_done(struct scsi_cmnd *cmd)
*/
static void scsi_softirq(struct softirq_action *h)
{
int disposition;
LIST_HEAD(local_q);
local_irq_disable();
......@@ -615,75 +727,19 @@ static void scsi_softirq(struct softirq_action *h)
struct scsi_cmnd, eh_entry);
list_del_init(&cmd->eh_entry);
switch (scsi_decide_disposition(cmd)) {
disposition = scsi_decide_disposition(cmd);
scsi_log_completion(cmd, disposition);
switch (disposition) {
case SUCCESS:
/*
* Add to BH queue.
*/
SCSI_LOG_MLCOMPLETE(3,
printk("Command finished %d %d "
"0x%x\n",
cmd->device->host->host_busy,
cmd->device->host->host_failed,
cmd->result));
scsi_finish_command(cmd);
break;
case NEEDS_RETRY:
/*
* 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.
*/
SCSI_LOG_MLCOMPLETE(3, printk("Command needs retry "
"%d %d 0x%x\n",
cmd->device->host->host_busy,
cmd->device->host->host_failed,
cmd->result));
scsi_retry_command(cmd);
break;
case ADD_TO_MLQUEUE:
/*
* This typically happens for a QUEUE_FULL
* message - typically only when the queue
* depth is only approximate for a given
* device. Adding a command to the queue for
* the device will prevent further commands
* from being sent to the device, so we
* shouldn't end up with tons of things being
* sent down that shouldn't be.
*/
SCSI_LOG_MLCOMPLETE(3, printk("Command rejected as "
"device queue full, "
"put on ml queue %p\n",
cmd));
scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY);
break;
default:
/*
* Here we have a fatal error of some sort.
* Turn it over to the error handler.
*/
SCSI_LOG_MLCOMPLETE(3,
printk("Command failed %p %x "
"busy=%d failed=%d\n",
cmd, cmd->result,
cmd->device->host->host_busy,
cmd->device->host->host_failed));
/*
* Dump the sense information too.
*/
if (status_byte(cmd->result) & CHECK_CONDITION)
SCSI_LOG_MLCOMPLETE(3, print_sense("bh", cmd));
/*
* We only fail here if the error recovery thread
* has died.
*/
if (!scsi_eh_scmd_add(cmd, 0))
scsi_finish_command(cmd);
}
......@@ -749,7 +805,7 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
if (SCSI_SENSE_VALID(cmd))
cmd->result |= (DRIVER_SENSE << 24);
SCSI_LOG_MLCOMPLETE(3, printk("Notifying upper driver of completion "
SCSI_LOG_MLCOMPLETE(4, printk("Notifying upper driver of completion "
"for device %d %x\n", sdev->id, cmd->result));
cmd->owner = SCSI_OWNER_HIGHLEVEL;
......
......@@ -55,7 +55,7 @@
#include "scsi_logging.h"
#include "scsi_debug.h"
static const char * scsi_debug_version_str = "Version: 1.70 (20030507)";
static const char * scsi_debug_version_str = "Version: 1.71 (20031007)";
/* Additional Sense Code (ASC) used */
#define NO_ADDED_SENSE 0x0
......@@ -1541,7 +1541,7 @@ static int __init scsi_debug_init(void)
}
if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) {
printk(KERN_INFO "scsi_debug: ... built %d host(s)\n",
printk(KERN_INFO "scsi_debug_init: built %d host(s)\n",
scsi_debug_add_host);
}
return 0;
......@@ -1565,8 +1565,15 @@ static void __exit scsi_debug_exit(void)
device_initcall(scsi_debug_init);
module_exit(scsi_debug_exit);
void pseudo_0_release(struct device * dev)
{
if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
printk(KERN_INFO "scsi_debug: pseudo_0_release() called\n");
}
static struct device pseudo_primary = {
.bus_id = "pseudo_0",
.release = pseudo_0_release,
};
static int pseudo_lld_bus_match(struct device *dev,
......
......@@ -164,14 +164,11 @@ int scsi_delete_timer(struct scsi_cmnd *scmd)
**/
void scsi_times_out(struct scsi_cmnd *scmd)
{
scsi_log_completion(scmd, TIMEOUT);
if (unlikely(!scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD))) {
panic("Error handler thread not present at %p %p %s %d",
scmd, scmd->device->host, __FILE__, __LINE__);
}
SCSI_LOG_TIMEOUT(3, printk("Command timed out busy=%d failed=%d\n",
scmd->device->host->host_busy,
scmd->device->host->host_failed));
}
/**
......@@ -446,10 +443,12 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
scmd->request->rq_status = RQ_SCSI_BUSY;
spin_lock_irqsave(scmd->device->host->host_lock, flags);
scsi_log_send(scmd);
host->hostt->queuecommand(scmd, scsi_eh_done);
spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
down(&sem);
scsi_log_completion(scmd, SUCCESS);
scmd->device->host->eh_action = NULL;
......
......@@ -40,10 +40,13 @@
extern unsigned int scsi_logging_level;
#ifdef CONFIG_SCSI_LOGGING
#define SCSI_LOG_LEVEL(SHIFT, BITS) \
((scsi_logging_level >> (SHIFT)) & ((1 << (BITS)) - 1))
#define SCSI_CHECK_LOGGING(SHIFT, BITS, LEVEL, CMD) \
{ \
unsigned int mask = (1 << (BITS)) - 1; \
if (((scsi_logging_level >> (SHIFT)) & mask) > (LEVEL)) \
if ((SCSI_LOG_LEVEL(SHIFT, BITS)) > (LEVEL)) \
(CMD); \
}
#else
......
......@@ -83,6 +83,15 @@ extern int scsi_insert_special_req(struct scsi_request *sreq, int);
extern void scsi_init_cmd_from_req(struct scsi_cmnd *cmd,
struct scsi_request *sreq);
extern void __scsi_release_request(struct scsi_request *sreq);
#ifdef CONFIG_SCSI_LOGGING
void scsi_log_send(struct scsi_cmnd *cmd);
void scsi_log_completion(struct scsi_cmnd *cmd, int disposition);
#else
static inline void scsi_log_send(struct scsi_cmnd *cmd)
{ };
static inline void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)
{ };
#endif
/* scsi_devinfo.c */
extern int scsi_get_device_flags(struct scsi_device *sdev,
......
This diff is collapsed.
This diff is collapsed.
......@@ -55,19 +55,7 @@
#include <linux/config.h>
/*
* Use normal IO if configured.
* Normal IO forced for alpha.
* Forced to MMIO for sparc.
*/
#if defined(__alpha__)
#define SYM_CONF_IOMAPPED
#elif defined(__sparc__)
#undef SYM_CONF_IOMAPPED
/* #elif defined(__powerpc__) */
/* #define SYM_CONF_IOMAPPED */
/* #define SYM_OPT_NO_BUS_MEMORY_MAPPING */
#elif defined(CONFIG_SCSI_SYM53C8XX_IOMAPPED)
#ifdef CONFIG_SCSI_SYM53C8XX_IOMAPPED
#define SYM_CONF_IOMAPPED
#endif
......@@ -93,8 +81,6 @@
*/
#if 1
#define SYM_CONF_NVRAM_SUPPORT (1)
#define SYM_SETUP_SYMBIOS_NVRAM (1)
#define SYM_SETUP_TEKRAM_NVRAM (1)
#endif
/*
......
This diff is collapsed.
......@@ -113,10 +113,6 @@ struct sym_fwb_ofs {
};
struct sym_fwz_ofs {
SYM_GEN_FW_Z(u_short)
#ifdef SYM_OPT_NO_BUS_MEMORY_MAPPING
SYM_GEN_Z(u_short, start_ram)
SYM_GEN_Z(u_short, start_ram64)
#endif
};
/*
......@@ -136,10 +132,6 @@ struct sym_fwb_ba {
};
struct sym_fwz_ba {
SYM_GEN_FW_Z(u32)
#ifdef SYM_OPT_NO_BUS_MEMORY_MAPPING
SYM_GEN_Z(u32, start_ram)
SYM_GEN_Z(u32, start_ram64)
#endif
};
#undef SYM_GEN_A
#undef SYM_GEN_B
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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