Commit a4c91676 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-scsi.bkbits.net/scsi-for-linus-2.6

into home.osdl.org:/home/torvalds/v2.5/linux
parents 13d06909 14cf42d2
SUBJECT
-------
AM53/79C974 PC-SCSI Driver
DISCLAIMER
----------
*** THIS SHOULD BE CONSIDERED AS BETA SOFTWARE ***
*** USE AT YOUR OWN RISK! ***
Copyright
---------
The architecture and much of the code of this device driver was
originally developed by Drew Eckhardt for the NCR5380. The
following copyrights apply:
For the architecture and all pieces of code which can also be found
in the NCR5380 device driver:
Copyright 1993, Drew Eckhardt
Visionary Computing
(Unix and Linux consulting and custom programming)
drew@colorado.edu
+1 (303) 666-5836
The AM53C974_nobios_detect code was originally developed by
Robin Cutshaw (robin@xfree86.org) and is used here in a
slightly modified form.
For the remaining code:
Copyright 1994, D. Frieauff
EMail: fri@rsx42sun0.dofn.de
Phone: x49-7545-8-2256 , x49-7541-42305
Version
-------
AM53/79C974 (PC-SCSI) Linux driver ALPHA release 0.5, 19 November 1995
Changelog
---------
0.1 -> 0.2:
- Extended message handling re-written to eliminate 'invalid message 17' bug
- Parameters of AM53C974_intr adapted
- Debug messages structured
- Spelling improved
0.2 -> 0.3:
- README file updated -- please read this file up to the end!
- Automatic scanning of io_port and irq implemented; no need for BIOS32
anymore
- Improved configuration (now via LILO parameter string)
- Cleanup of probing and initialization code
- Improved sync. negotiation (can be setup individually for every device)
- Improved/ debugged code for reception of ext. messages
0.3 -> 0.4:
- Improved PCI probing and initialization code
- Compatibility changes for Linux 1.3.x
0.4 -> 0.5:
- Compatibility changes for Linux 1.3.42
Bugs & Todo
-----------
- Add proc info function
- Support SCSI-2 tagged queuing
- Finalize abort code
Features
--------
This driver supports asynchronous and synchronous SCSI-I and SCSI-II
devices. It is capable of transfer rate and synchronous negotiation
(see below). The driver supports scatter-gather. Transfers are DMA
based, but do not (yet) make use of the AM53/79C974 MDL mode.
Max. transfer rate is 10MHz (whatever this is in real life). The
transfer rate is negotiated with each device (see dmesg output). The
AM53/79C974 has a 96-byte DMA FIFO to the PCI bus and a 16-byte SCSI
FIFO. It provides active negation and glitch suppression functions.
Burst DMA transfer rate is 132 MBytes/sec.
Configuration
-------------
The following communication characteristics can be set individually
for every SCSI device on the bus:
- enable/disable sync. negotiation
- transfer rate
- asynchronous or synchronous communication
- in case of sync. communication, the sync. offset
The sync. offset specifies the number of bytes that can be sent or
received from the SCSI bus without ACK resp. REQ signal.
CAUTION: USING SYNCHRONOUS MODE ON LONG SCSI CABLES MAY CAUSE
COMMUNICATION PROBLEMS LEADING TO LOSS OF DATA.
The default setting of the SCSI communication parameters is as follows:
- no negotiation
- 5.0 MHz transfer rate
- asynchronous mode
- zero offset
The parameters can be modified by passing a string with the following
syntax to the kernel:
AM53C974=host-scsi-id,target-scsi-id,max-rate,max-offset
The parameters will be used by the driver as negotiation basis. The
range of the rate parameter is 3 to 10 MHz. The range of the
sync. offset parameter is 0 to 15 bytes. A value of 0 denotes
asynchronous comm. mode. If the target cannot cope with the specified
transfer rate, sync. mode or sync. offset, the negotiation result
will differ from the specified values. The negotiation result is
printed out at the end of the negotiation process (to read it, use the
dmesg program or the appropriate syslog). The parameter strings
(blank separated) can be passed to the kernel at the LILO prompt, or
as part of the LILO configuration file.
For example, the string "AM53C974=7,2,8,15" would be interpreted as
follows:
For communication between the controller with SCSI-ID 7 and the
device with SCSI-ID 2 a transfer rate of 8MHz in synchronous mode with
max. 15 bytes offset should be negotiated.
As an example, here my LILO configuration file:
boot = /dev/sda
compact
#prompt
delay = 50 # optional, for systems that boot very quickly
vga = normal # force sane state
ramdisk = 0 # paranoia setting
root = current # use "current" root
image = /usr/src/linux/arch/i386/boot/zImage
label = linux
append = "AM53C974=7,0,10,0 AM53C974=7,1,10,0 AM53C974=7,2,10,15 AM53C974=7,4,10,0 AM53C974=7,5,10,0"
read-only
other = /dev/sda4
label = os2
other = /dev/sdb3
loader = /boot/any_d.b
table = /dev/sdb
label = setup
The same parameters at the LILO prompt:
LILO boot: linux AM53C974=7,0,10,0 AM53C974=7,1,10,0 AM53C974=7,2,10,15 AM53C974=7,4,10,0 AM53C974=7,5,10,0
You can override parameters specified in the LILO configuration file
by parameters specified on the LILO command line.
BIOS usage
----------
Version 0.4 of the driver will use the BIOS, if available. Otherwise
it will try its internal PCI scan and access routines. The driver
assumes that the controller's SCSI-ID (usually 7) has been correctly
loaded by the BIOS into the controller's register during system
boot. If the driver detects that the controller's SCSI ID is not '7'
it will print out a warning. If this happens to you please correct
setting of the controller's SCSI-ID. If it is wrong, then edit the
AM53C974_SCSI_ID definition in file AM53C974.h accordingly.
Test environment
----------------
This driver was tested on a Compaq XL566 with the following SCSI configuration:
2 x HP C2247 fixed disk (internal, rate=10MHz, async.)
1 x Micropolis 1624 fixed disk (external, rate=8MHz, sync., offset=15 bytes)
1 x Wangtek W5525ES cartridge streamer (internal, rate=5MHz, async.)
1 x Toshiba XM-3301B CD-ROM (external, rate=5MHz, async.)
Known problems
--------------
- Compaq/Matsushita CD-ROM:
Use of this device with AM53C974 driver version 0.2 caused the kernel to
hang during Linux boot. If you encounter the problem, don't enable sync.
negotiation with the CD-ROM, i.e. simply don't specify comm. parameters
for this device on the LILO command line or configuration file.
The driver will thus use its default for the CD-ROM, which is 5MHz
transfer rate async and no sync. negotiation.
- Some disks cause problems.
What to do if there is a SCSI problem possibly related to the driver
--------------------------------------------------------------------
Read Klaus Liedl's WWW page (http://www-c724.uibk.ac.at/XL/). In case
this does not help: Send me a complete description of the problem,
including your SCSI configuration plus as much debugging information
as possible. Don't wait until I ask you for this information. To
enable the generation of debugging output, remove the comments from
the following definitions in the AM53C974.h file:
AM53C974_DEBUG
AM53C974_DEBUG_MSG
AM53C974_DEBUG_KEYWAIT
AM53C974_DEBUG_INFO
AM53C974_DEBUG_INTR
With these definitions enabled, the driver will enter single-step mode
during Linux boot. Use the spacebar for stepping. Take note of at
least the last 10 printout sections (marked by dashes) before the
crash/hangup or whatever happens and send me all of this information
via email. If the system can boot, use the syslogd daemon to record
the debugging output. Maybe you can use the ramdisk for this purpose
too (if necessary, kindly ask K. Liedl (Klaus.Liedl@uibk.ac.at) for
support, he knows how to do it -- I never tried). Stay in email
contact with me. Be aware that the following weeks/months could be the
worst of your life. Note: If single-stepping takes up too much time,
you can try to let the driver catch the problem by pressing the 'r'
key. The driver will automatically enter single-step mode if it has
detected something weird.
Author's Contact Address
-----------------------
Email: fri@rsx42sun0.dofn.de
Phone: x49-7545-2256 (office), x49-7541-42305 (home)
Home address: D. Frieauff, Stockerholzstr. 27, 88048 Friedrichshafen, Germany
!!!! Important Notice !!!!
-----------------------------
- Klaus Liedl maintains an excellent WWW page about Linux on Compaq XL.
It includes an FAQ, lots of tips & tricks as well as downloadable
boot disk images. The URL is: http://www-c724.uibk.ac.at/XL/
- Volunteer wanted for further maintenance of this driver software. I
don't have the time anymore to do serious support as some of you will know.
Literature
----------
- AMD AM53C974 PC-SCSI Technical Manual, publication #18624B
- Amendment to the AMD AM53C974 PC-SCSI Technical Manual
- AMD AM79C974 PC-NET Datasheet, publication #18681
- Amendment to the AMD AM79C974 PC-NET Datasheet
THANKS to
---------
- Drew Eckhardt, Robin Cutshaw, K. Liedl, Robert J. Pappas, A. Grenier,
Mark Stockton, David C. Niemi, Ben Craft, and many others who have helped
...@@ -40,10 +40,9 @@ My primary goals in writing this completely new BusLogic driver for Linux are ...@@ -40,10 +40,9 @@ My primary goals in writing this completely new BusLogic driver for Linux are
to achieve the full performance that BusLogic SCSI Host Adapters and modern to achieve the full performance that BusLogic SCSI Host Adapters and modern
SCSI peripherals are capable of, and to provide a highly robust driver that can SCSI peripherals are capable of, and to provide a highly robust driver that can
be depended upon for high performance mission critical applications. All of be depended upon for high performance mission critical applications. All of
the major performance and error recovery features can be configured from the the major performance features can be configured from the Linux kernel command
Linux kernel command line or at module initialization time, allowing individual line or at module initialization time, allowing individual installations to
installations to tune driver performance and error recovery to their particular tune driver performance and error recovery to their particular needs.
needs.
The latest information on Linux support for BusLogic SCSI Host Adapters, as The latest information on Linux support for BusLogic SCSI Host Adapters, as
well as the most recent release of this driver and the latest firmware for the well as the most recent release of this driver and the latest firmware for the
...@@ -95,10 +94,10 @@ o Configuration Reporting and Testing ...@@ -95,10 +94,10 @@ o Configuration Reporting and Testing
adapter hardware configuration, including the synchronous transfer parameters adapter hardware configuration, including the synchronous transfer parameters
requested and negotiated with each target device. AutoSCSI settings for requested and negotiated with each target device. AutoSCSI settings for
Synchronous Negotiation, Wide Negotiation, and Disconnect/Reconnect are Synchronous Negotiation, Wide Negotiation, and Disconnect/Reconnect are
reported for each target device, as well as the status of Tagged Queuing and reported for each target device, as well as the status of Tagged Queuing.
Error Recovery. If the same setting is in effect for all target devices, If the same setting is in effect for all target devices, then a single word
then a single word or phrase is used; otherwise, a letter is provided for or phrase is used; otherwise, a letter is provided for each target device to
each target device to indicate the individual status. The following examples indicate the individual status. The following examples
should clarify this reporting format: should clarify this reporting format:
Synchronous Negotiation: Ultra Synchronous Negotiation: Ultra
...@@ -131,9 +130,6 @@ o Configuration Reporting and Testing ...@@ -131,9 +130,6 @@ o Configuration Reporting and Testing
The status of Wide Negotiation, Disconnect/Reconnect, and Tagged Queuing The status of Wide Negotiation, Disconnect/Reconnect, and Tagged Queuing
are reported as "Enabled", Disabled", or a sequence of "Y" and "N" letters. are reported as "Enabled", Disabled", or a sequence of "Y" and "N" letters.
The Error Recovery option is reported as "Default", "Hard Reset",
"Bus Device Reset", "None" or a sequence of "D", "H", "B", and "N" letters.
o Performance Features o Performance Features
BusLogic SCSI Host Adapters directly implement SCSI-2 Tagged Queuing, and so BusLogic SCSI Host Adapters directly implement SCSI-2 Tagged Queuing, and so
...@@ -477,48 +473,6 @@ TaggedQueuing:<Target-Spec> ...@@ -477,48 +473,6 @@ TaggedQueuing:<Target-Spec>
does not cover all the Target Devices, unspecified characters are assumed does not cover all the Target Devices, unspecified characters are assumed
to be "X". to be "X".
The BusLogic Driver Error Recovery Option allows for explicitly specifying
the Error Recovery action to be performed when BusLogic_ResetCommand is
called due to a SCSI Command failing to complete successfully. The following
options are available:
ErrorRecovery:Default
The "ErrorRecovery:Default" or "ER:Default" option selects between the Hard
Reset and Bus Device Reset options based on the recommendation of the SCSI
Subsystem.
ErrorRecovery:HardReset
The "ErrorRecovery:HardReset" or "ER:HardReset" option will initiate a Host
Adapter Hard Reset which also causes a SCSI Bus Reset.
ErrorRecovery:BusDeviceReset
The "ErrorRecovery:BusDeviceReset" or "ER:BusDeviceReset" option will send
a Bus Device Reset message to the individual Target Device causing the
error. If Error Recovery is again initiated for this Target Device and no
SCSI Command to this Target Device has completed successfully since the Bus
Device Reset message was sent, then a Hard Reset will be attempted.
ErrorRecovery:None
The "ErrorRecovery:None" or "ER:None" option suppresses Error Recovery.
This option should only be selected if a SCSI Bus Reset or Bus Device Reset
will cause the Target Device or a critical operation to suffer a complete
and unrecoverable failure.
ErrorRecovery:<Target-Spec>
The "ErrorRecovery:<Target-Spec>" or "ER:<Target-Spec>" option controls
Error Recovery individually for each Target Device. <Target-Spec> is a
sequence of "D", "H", "B", and "N" characters. "D" selects Default, "H"
selects Hard Reset, "B" selects Bus Device Reset, and "N" selects None.
The first character refers to Target Device 0, the second to Target Device
1, and so on; if the sequence of "D", "H", "B", and "N" characters does not
cover all the possible Target Devices, unspecified characters are assumed
to be "D".
The BusLogic Driver Miscellaneous Options comprise the following: The BusLogic Driver Miscellaneous Options comprise the following:
BusSettleTime:<seconds> BusSettleTime:<seconds>
......
...@@ -1091,14 +1091,44 @@ Details: ...@@ -1091,14 +1091,44 @@ Details:
* @scp: pointer to scsi command object * @scp: pointer to scsi command object
* @done: function pointer to be invoked on completion * @done: function pointer to be invoked on completion
* *
* Returns 0 on success and 1 if the LLD or the HBA is busy (i.e. run * Returns 0 on success.
* out of resources to queue further commands). Other types of errors *
* that are detected immediately are flagged by setting scp->result * If there's a failure, return either:
* to an appropriate value, invoking the 'done' callback, and then *
* returning 0 from this function. If the command is not performed * SCSI_MLQUEUE_DEVICE_BUSY if the device queue is full, or
* immediately (and the LLD is starting (or will start) the given * SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full
* command) then this function should place 0 in scp->result and *
* return 0. * On both of these returns, the mid-layer will requeue the I/O
*
* - if the return is SCSI_MLQUEUE_DEVICE_BUSY, only that particular
* device will be paused, and it will be unpaused when a command to
* the device returns (or after a brief delay if there are no more
* outstanding commands to it). Commands to other devices continue
* to be processed normally.
*
* - if the return is SCSI_MLQUEUE_HOST_BUSY, all I/O to the host
* is paused and will be unpaused when any command returns from
* the host (or after a brief delay if there are no outstanding
* commands to the host).
*
* For compatibility with earlier versions of queuecommand, any
* other return value is treated the same as
* SCSI_MLQUEUE_HOST_BUSY.
*
* Other types of errors that are detected immediately may be
* flagged by setting scp->result to an appropriate value,
* invoking the 'done' callback, and then returning 0 from this
* function. If the command is not performed immediately (and the
* LLD is starting (or will start) the given command) then this
* function should place 0 in scp->result and return 0.
*
* Command ownership. If the driver returns zero, it owns the
* command and must take responsibility for ensuring the 'done'
* callback is executed. Note: the driver may call done before
* returning zero, but after it has called done, it may not
* return any value other than zero. If the driver makes a
* non-zero return, it must not execute the command's done
* callback at any time.
* *
* Locks: struct Scsi_Host::host_lock held on entry (with "irqsave") * Locks: struct Scsi_Host::host_lock held on entry (with "irqsave")
* and is expected to be held on return. * and is expected to be held on return.
......
...@@ -46,14 +46,14 @@ const unsigned char scsi_command_size[8] = ...@@ -46,14 +46,14 @@ const unsigned char scsi_command_size[8] =
#define SCSI_SENSE_BUFFERSIZE 64 #define SCSI_SENSE_BUFFERSIZE 64
#endif #endif
static int blk_do_rq(request_queue_t *q, struct block_device *bdev, static int blk_do_rq(request_queue_t *q, struct gendisk *bd_disk,
struct request *rq) struct request *rq)
{ {
char sense[SCSI_SENSE_BUFFERSIZE]; char sense[SCSI_SENSE_BUFFERSIZE];
DECLARE_COMPLETION(wait); DECLARE_COMPLETION(wait);
int err = 0; int err = 0;
rq->rq_disk = bdev->bd_disk; rq->rq_disk = bd_disk;
/* /*
* we need an extra reference to the request, so we can look at * we need an extra reference to the request, so we can look at
...@@ -142,7 +142,7 @@ static int sg_emulated_host(request_queue_t *q, int *p) ...@@ -142,7 +142,7 @@ static int sg_emulated_host(request_queue_t *q, int *p)
return put_user(1, p); return put_user(1, p);
} }
static int sg_io(request_queue_t *q, struct block_device *bdev, static int sg_io(request_queue_t *q, struct gendisk *bd_disk,
struct sg_io_hdr *hdr) struct sg_io_hdr *hdr)
{ {
unsigned long start_time; unsigned long start_time;
...@@ -190,7 +190,7 @@ static int sg_io(request_queue_t *q, struct block_device *bdev, ...@@ -190,7 +190,7 @@ static int sg_io(request_queue_t *q, struct block_device *bdev,
* first try to map it into a bio. reading from device will * first try to map it into a bio. reading from device will
* be a write to vm. * be a write to vm.
*/ */
bio = bio_map_user(bdev, (unsigned long) hdr->dxferp, bio = bio_map_user(q, NULL, (unsigned long) hdr->dxferp,
hdr->dxfer_len, reading); hdr->dxfer_len, reading);
/* /*
...@@ -246,7 +246,7 @@ static int sg_io(request_queue_t *q, struct block_device *bdev, ...@@ -246,7 +246,7 @@ static int sg_io(request_queue_t *q, struct block_device *bdev,
* (if he doesn't check that is his problem). * (if he doesn't check that is his problem).
* N.B. a non-zero SCSI status is _not_ necessarily an error. * N.B. a non-zero SCSI status is _not_ necessarily an error.
*/ */
blk_do_rq(q, bdev, rq); blk_do_rq(q, bd_disk, rq);
if (bio) if (bio)
bio_unmap_user(bio, reading); bio_unmap_user(bio, reading);
...@@ -296,7 +296,7 @@ static int sg_io(request_queue_t *q, struct block_device *bdev, ...@@ -296,7 +296,7 @@ static int sg_io(request_queue_t *q, struct block_device *bdev,
#define READ_DEFECT_DATA_TIMEOUT (60 * HZ ) #define READ_DEFECT_DATA_TIMEOUT (60 * HZ )
#define OMAX_SB_LEN 16 /* For backward compatibility */ #define OMAX_SB_LEN 16 /* For backward compatibility */
static int sg_scsi_ioctl(request_queue_t *q, struct block_device *bdev, static int sg_scsi_ioctl(request_queue_t *q, struct gendisk *bd_disk,
Scsi_Ioctl_Command *sic) Scsi_Ioctl_Command *sic)
{ {
struct request *rq; struct request *rq;
...@@ -369,7 +369,7 @@ static int sg_scsi_ioctl(request_queue_t *q, struct block_device *bdev, ...@@ -369,7 +369,7 @@ static int sg_scsi_ioctl(request_queue_t *q, struct block_device *bdev,
rq->data_len = bytes; rq->data_len = bytes;
rq->flags |= REQ_BLOCK_PC; rq->flags |= REQ_BLOCK_PC;
blk_do_rq(q, bdev, rq); blk_do_rq(q, bd_disk, rq);
err = rq->errors & 0xff; /* only 8 bit SCSI status */ err = rq->errors & 0xff; /* only 8 bit SCSI status */
if (err) { if (err) {
if (rq->sense_len && rq->sense) { if (rq->sense_len && rq->sense) {
...@@ -389,13 +389,13 @@ static int sg_scsi_ioctl(request_queue_t *q, struct block_device *bdev, ...@@ -389,13 +389,13 @@ static int sg_scsi_ioctl(request_queue_t *q, struct block_device *bdev,
return err; return err;
} }
int scsi_cmd_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long arg) int scsi_cmd_ioctl(struct gendisk *bd_disk, unsigned int cmd, unsigned long arg)
{ {
request_queue_t *q; request_queue_t *q;
struct request *rq; struct request *rq;
int close = 0, err; int close = 0, err;
q = bdev_get_queue(bdev); q = bd_disk->queue;
if (!q) if (!q)
return -ENXIO; return -ENXIO;
...@@ -446,7 +446,7 @@ int scsi_cmd_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long ar ...@@ -446,7 +446,7 @@ int scsi_cmd_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long ar
old_cdb = hdr.cmdp; old_cdb = hdr.cmdp;
hdr.cmdp = cdb; hdr.cmdp = cdb;
err = sg_io(q, bdev, &hdr); err = sg_io(q, bd_disk, &hdr);
hdr.cmdp = old_cdb; hdr.cmdp = old_cdb;
if (copy_to_user((struct sg_io_hdr *) arg, &hdr, sizeof(hdr))) if (copy_to_user((struct sg_io_hdr *) arg, &hdr, sizeof(hdr)))
...@@ -493,7 +493,7 @@ int scsi_cmd_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long ar ...@@ -493,7 +493,7 @@ int scsi_cmd_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long ar
hdr.timeout = cgc.timeout; hdr.timeout = cgc.timeout;
hdr.cmdp = cgc.cmd; hdr.cmdp = cgc.cmd;
hdr.cmd_len = sizeof(cgc.cmd); hdr.cmd_len = sizeof(cgc.cmd);
err = sg_io(q, bdev, &hdr); err = sg_io(q, bd_disk, &hdr);
if (hdr.status) if (hdr.status)
err = -EIO; err = -EIO;
...@@ -514,7 +514,8 @@ int scsi_cmd_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long ar ...@@ -514,7 +514,8 @@ int scsi_cmd_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long ar
if (!arg) if (!arg)
break; break;
err = sg_scsi_ioctl(q, bdev, (Scsi_Ioctl_Command *)arg); err = sg_scsi_ioctl(q, bd_disk,
(Scsi_Ioctl_Command *)arg);
break; break;
case CDROMCLOSETRAY: case CDROMCLOSETRAY:
close = 1; close = 1;
...@@ -528,7 +529,7 @@ int scsi_cmd_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long ar ...@@ -528,7 +529,7 @@ int scsi_cmd_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long ar
rq->cmd[0] = GPCMD_START_STOP_UNIT; rq->cmd[0] = GPCMD_START_STOP_UNIT;
rq->cmd[4] = 0x02 + (close != 0); rq->cmd[4] = 0x02 + (close != 0);
rq->cmd_len = 6; rq->cmd_len = 6;
err = blk_do_rq(q, bdev, rq); err = blk_do_rq(q, bd_disk, rq);
blk_put_request(rq); blk_put_request(rq);
break; break;
default: default:
......
...@@ -1799,7 +1799,7 @@ int cdrom_ioctl(struct cdrom_device_info *cdi, struct inode *ip, ...@@ -1799,7 +1799,7 @@ int cdrom_ioctl(struct cdrom_device_info *cdi, struct inode *ip,
int ret; int ret;
/* Try the generic SCSI command ioctl's first.. */ /* Try the generic SCSI command ioctl's first.. */
ret = scsi_cmd_ioctl(ip->i_bdev, cmd, arg); ret = scsi_cmd_ioctl(ip->i_bdev->bd_disk, cmd, arg);
if (ret != -ENOTTY) if (ret != -ENOTTY)
return ret; return ret;
......
...@@ -1689,7 +1689,7 @@ int generic_ide_ioctl(struct block_device *bdev, unsigned int cmd, ...@@ -1689,7 +1689,7 @@ int generic_ide_ioctl(struct block_device *bdev, unsigned int cmd,
case CDROMEJECT: case CDROMEJECT:
case CDROMCLOSETRAY: case CDROMCLOSETRAY:
return scsi_cmd_ioctl(bdev, cmd, arg); return scsi_cmd_ioctl(bdev->bd_disk, cmd, arg);
case HDIO_GET_BUSSTATE: case HDIO_GET_BUSSTATE:
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
......
This diff is collapsed.
...@@ -80,8 +80,8 @@ ...@@ -80,8 +80,8 @@
#define COPYRIGHT "Copyright (c) 1999-2003 " MODULEAUTHOR #define COPYRIGHT "Copyright (c) 1999-2003 " MODULEAUTHOR
#endif #endif
#define MPT_LINUX_VERSION_COMMON "2.05.00.06" #define MPT_LINUX_VERSION_COMMON "3.00.02"
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-2.05.00.06" #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.00.02"
#define WHAT_MAGIC_STRING "@" "(" "#" ")" #define WHAT_MAGIC_STRING "@" "(" "#" ")"
#define show_mptmod_ver(s,ver) \ #define show_mptmod_ver(s,ver) \
...@@ -180,6 +180,16 @@ typedef enum { ...@@ -180,6 +180,16 @@ typedef enum {
MPTUNKNOWN_DRIVER MPTUNKNOWN_DRIVER
} MPT_DRIVER_CLASS; } MPT_DRIVER_CLASS;
struct mpt_pci_driver{
int (*probe) (struct pci_dev *dev, const struct pci_device_id *id);
void (*remove) (struct pci_dev *dev);
void (*shutdown) (struct device * dev);
#ifdef CONFIG_PM
int (*suspend) (struct pci_dev *dev, u32 state);
int (*resume) (struct pci_dev *dev);
#endif
};
/* /*
* MPT adapter / port / bus / device info structures... * MPT adapter / port / bus / device info structures...
*/ */
...@@ -629,6 +639,9 @@ typedef struct _MPT_ADAPTER ...@@ -629,6 +639,9 @@ typedef struct _MPT_ADAPTER
FCPortPage0_t fc_port_page0[2]; FCPortPage0_t fc_port_page0[2];
LANPage0_t lan_cnfg_page0; LANPage0_t lan_cnfg_page0;
LANPage1_t lan_cnfg_page1; LANPage1_t lan_cnfg_page1;
#ifdef CONFIG_PM
u32 PciState[64]; /* save PCI state to this area */
#endif
u8 FirstWhoInit; u8 FirstWhoInit;
u8 upload_fw; /* If set, do a fw upload */ u8 upload_fw; /* If set, do a fw upload */
u8 reload_fw; /* Force a FW Reload on next reset */ u8 reload_fw; /* Force a FW Reload on next reset */
...@@ -1001,6 +1014,8 @@ extern int mpt_event_register(int cb_idx, MPT_EVHANDLER ev_cbfunc); ...@@ -1001,6 +1014,8 @@ extern int mpt_event_register(int cb_idx, MPT_EVHANDLER ev_cbfunc);
extern void mpt_event_deregister(int cb_idx); extern void mpt_event_deregister(int cb_idx);
extern int mpt_reset_register(int cb_idx, MPT_RESETHANDLER reset_func); extern int mpt_reset_register(int cb_idx, MPT_RESETHANDLER reset_func);
extern void mpt_reset_deregister(int cb_idx); extern void mpt_reset_deregister(int cb_idx);
extern int mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx);
extern void mpt_device_driver_deregister(int cb_idx);
extern int mpt_register_ascqops_strings(void *ascqTable, int ascqtbl_sz, const char **opsTable); extern int mpt_register_ascqops_strings(void *ascqTable, int ascqtbl_sz, const char **opsTable);
extern void mpt_deregister_ascqops_strings(void); extern void mpt_deregister_ascqops_strings(void);
extern MPT_FRAME_HDR *mpt_get_msg_frame(int handle, int iocid); extern MPT_FRAME_HDR *mpt_get_msg_frame(int handle, int iocid);
......
This diff is collapsed.
...@@ -98,13 +98,14 @@ ...@@ -98,13 +98,14 @@
#define MPT_SCSI_SG_DEPTH 40 #define MPT_SCSI_SG_DEPTH 40
#endif #endif
/* To disable domain validation, uncomment the /* To disable domain validation, comment the
* following line. No effect for FC devices. * following line. No effect for FC devices.
* For SCSI devices, driver will negotiate to * For SCSI devices, driver will negotiate to
* NVRAM settings (if available) or to maximum adapter * NVRAM settings (if available) or to maximum adapter
* capabilities. * capabilities.
*/ */
/* #define MPTSCSIH_DISABLE_DOMAIN_VALIDATION */
#define MPTSCSIH_ENABLE_DOMAIN_VALIDATION
/* SCSI driver setup structure. Settings can be overridden /* SCSI driver setup structure. Settings can be overridden
...@@ -137,15 +138,6 @@ struct mptscsih_driver_setup ...@@ -137,15 +138,6 @@ struct mptscsih_driver_setup
* So here are various HACKS to work around them. * So here are various HACKS to work around them.
*/ */
/*
* Conditionalizing with "#ifdef MODULE/#endif" around:
* static Scsi_Host_Template driver_template = XX;
* #include <../../scsi/scsi_module.c>
* lines was REMOVED @ lk-2.4.0-test9
* Issue discovered 20001213 by: sshirron
*/
#define MPT_SCSIHOST_NEED_ENTRY_EXIT_HOOKUPS 1
/* /*
* tq_scheduler disappeared @ lk-2.4.0-test12 * tq_scheduler disappeared @ lk-2.4.0-test12
* (right when <linux/sched.h> newly defined TQ_ACTIVE) * (right when <linux/sched.h> newly defined TQ_ACTIVE)
...@@ -160,8 +152,6 @@ struct mptscsih_driver_setup ...@@ -160,8 +152,6 @@ struct mptscsih_driver_setup
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#define x_scsi_detect mptscsih_detect
#define x_scsi_release mptscsih_release
#define x_scsi_info mptscsih_info #define x_scsi_info mptscsih_info
#define x_scsi_queuecommand mptscsih_qcmd #define x_scsi_queuecommand mptscsih_qcmd
#define x_scsi_abort mptscsih_abort #define x_scsi_abort mptscsih_abort
...@@ -170,9 +160,6 @@ struct mptscsih_driver_setup ...@@ -170,9 +160,6 @@ struct mptscsih_driver_setup
#define x_scsi_host_reset mptscsih_host_reset #define x_scsi_host_reset mptscsih_host_reset
#define x_scsi_bios_param mptscsih_bios_param #define x_scsi_bios_param mptscsih_bios_param
#define x_scsi_taskmgmt_bh mptscsih_taskmgmt_bh
#define x_scsi_old_abort mptscsih_old_abort
#define x_scsi_old_reset mptscsih_old_reset
#define x_scsi_slave_alloc mptscsih_slave_alloc #define x_scsi_slave_alloc mptscsih_slave_alloc
#define x_scsi_slave_configure mptscsih_slave_configure #define x_scsi_slave_configure mptscsih_slave_configure
#define x_scsi_slave_destroy mptscsih_slave_destroy #define x_scsi_slave_destroy mptscsih_slave_destroy
...@@ -182,8 +169,6 @@ struct mptscsih_driver_setup ...@@ -182,8 +169,6 @@ struct mptscsih_driver_setup
/* /*
* MPT SCSI Host / Initiator decls... * MPT SCSI Host / Initiator decls...
*/ */
extern int x_scsi_detect(Scsi_Host_Template *);
extern int x_scsi_release(struct Scsi_Host *host);
extern const char *x_scsi_info(struct Scsi_Host *); extern const char *x_scsi_info(struct Scsi_Host *);
extern int x_scsi_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); extern int x_scsi_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
extern int x_scsi_abort(Scsi_Cmnd *); extern int x_scsi_abort(Scsi_Cmnd *);
...@@ -191,8 +176,7 @@ extern int x_scsi_bus_reset(Scsi_Cmnd *); ...@@ -191,8 +176,7 @@ extern int x_scsi_bus_reset(Scsi_Cmnd *);
extern int x_scsi_dev_reset(Scsi_Cmnd *); extern int x_scsi_dev_reset(Scsi_Cmnd *);
extern int x_scsi_host_reset(Scsi_Cmnd *); extern int x_scsi_host_reset(Scsi_Cmnd *);
extern int x_scsi_bios_param(struct scsi_device * sdev, struct block_device *bdev, extern int x_scsi_bios_param(struct scsi_device * sdev, struct block_device *bdev,
sector_t capacity, int *ip); sector_t capacity, int geom[]);
extern void x_scsi_taskmgmt_bh(void *);
extern int x_scsi_slave_alloc(Scsi_Device *); extern int x_scsi_slave_alloc(Scsi_Device *);
extern int x_scsi_slave_configure(Scsi_Device *); extern int x_scsi_slave_configure(Scsi_Device *);
extern void x_scsi_slave_destroy(Scsi_Device *); extern void x_scsi_slave_destroy(Scsi_Device *);
......
This diff is collapsed.
/* AM53/79C974 (PCscsi) driver release 0.5
* The architecture and much of the code of this device
* driver was originally developed by Drew Eckhardt for
* the NCR5380. The following copyrights apply:
* For the architecture and all parts similar to the NCR5380:
* Copyright 1993, Drew Eckhardt
* Visionary Computing
* (Unix and Linux consulting and custom programming)
* drew@colorado.edu
* +1 (303) 666-5836
*
* The AM53C974_nobios_detect code was originally developed by
* Robin Cutshaw (robin@xfree86.org) and is used here in a
* modified form.
*
* For the other parts:
* Copyright 1994, D. Frieauff
* EMail: fri@rsx42sun0.dofn.de
* Phone: x49-7545-8-2256 , x49-7541-42305
*/
/*
* $Log: AM53C974.h,v $
*/
#ifndef AM53C974_H
#define AM53C974_H
#include <scsi/scsicam.h>
struct AM53C974_hostdata {
volatile unsigned in_reset:1; /* flag, says bus reset pending */
volatile unsigned aborted:1; /* flag, says aborted */
volatile unsigned selecting:1; /* selection started, but not yet finished */
volatile unsigned disconnecting: 1; /* disconnection started, but not yet finished */
volatile unsigned dma_busy:1; /* dma busy when service request for info transfer received */
volatile unsigned char msgout[10]; /* message to output in MSGOUT_PHASE */
volatile unsigned char last_message[10]; /* last message OUT */
volatile Scsi_Cmnd *issue_queue; /* waiting to be issued */
volatile Scsi_Cmnd *disconnected_queue; /* waiting for reconnect */
volatile Scsi_Cmnd *sel_cmd; /* command for selection */
volatile Scsi_Cmnd *connected; /* currently connected command */
volatile unsigned char busy[8]; /* index = target, bit = lun */
unsigned char sync_per[8]; /* synchronous transfer period (in effect) */
unsigned char sync_off[8]; /* synchronous offset (in effect) */
unsigned char sync_neg[8]; /* sync. negotiation performed (in effect) */
unsigned char sync_en[8]; /* sync. negotiation performed (in effect) */
unsigned char max_rate[8]; /* max. transfer rate (setup) */
unsigned char max_offset[8]; /* max. sync. offset (setup), only valid if corresponding sync_en is nonzero */
};
static int AM53C974_pci_detect(Scsi_Host_Template * tpnt);
static int AM53C974_release(struct Scsi_Host *shp);
static const char *AM53C974_info(struct Scsi_Host *);
static int AM53C974_command(Scsi_Cmnd * SCpnt);
static int AM53C974_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *));
static int AM53C974_abort(Scsi_Cmnd * cmd);
static int AM53C974_reset(Scsi_Cmnd * cmd, unsigned int);
#endif /* AM53C974_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -69,7 +69,6 @@ obj-$(CONFIG_SCSI_NCR_Q720) += NCR_Q720_mod.o ...@@ -69,7 +69,6 @@ obj-$(CONFIG_SCSI_NCR_Q720) += NCR_Q720_mod.o
obj-$(CONFIG_SCSI_SYM53C416) += sym53c416.o obj-$(CONFIG_SCSI_SYM53C416) += sym53c416.o
obj-$(CONFIG_SCSI_QLOGIC_FAS) += qlogicfas.o obj-$(CONFIG_SCSI_QLOGIC_FAS) += qlogicfas.o
obj-$(CONFIG_SCSI_QLOGIC_ISP) += qlogicisp.o obj-$(CONFIG_SCSI_QLOGIC_ISP) += qlogicisp.o
obj-$(CONFIG_SCSI_QLOGIC_FC) += qlogicfc.o
obj-$(CONFIG_SCSI_QLOGIC_1280) += qla1280.o obj-$(CONFIG_SCSI_QLOGIC_1280) += qla1280.o
obj-$(CONFIG_SCSI_QLA2XXX) += qla2xxx/ obj-$(CONFIG_SCSI_QLA2XXX) += qla2xxx/
obj-$(CONFIG_SCSI_PAS16) += pas16.o obj-$(CONFIG_SCSI_PAS16) += pas16.o
...@@ -87,7 +86,6 @@ obj-$(CONFIG_SCSI_IBMMCA) += ibmmca.o ...@@ -87,7 +86,6 @@ obj-$(CONFIG_SCSI_IBMMCA) += ibmmca.o
obj-$(CONFIG_SCSI_EATA) += eata.o obj-$(CONFIG_SCSI_EATA) += eata.o
obj-$(CONFIG_SCSI_DC395x) += dc395x.o obj-$(CONFIG_SCSI_DC395x) += dc395x.o
obj-$(CONFIG_SCSI_DC390T) += tmscsim.o obj-$(CONFIG_SCSI_DC390T) += tmscsim.o
obj-$(CONFIG_SCSI_AM53C974) += AM53C974.o
obj-$(CONFIG_SCSI_MEGARAID) += megaraid.o obj-$(CONFIG_SCSI_MEGARAID) += megaraid.o
obj-$(CONFIG_SCSI_ACARD) += atp870u.o obj-$(CONFIG_SCSI_ACARD) += atp870u.o
obj-$(CONFIG_SCSI_SUNESP) += esp.o obj-$(CONFIG_SCSI_SUNESP) += esp.o
......
This diff is collapsed.
This diff is collapsed.
...@@ -704,11 +704,14 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) ...@@ -704,11 +704,14 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
#endif #endif
int i; int i;
ccb[mbo].op = 2; /* SCSI Initiator Command w/scatter-gather */ ccb[mbo].op = 2; /* SCSI Initiator Command w/scatter-gather */
SCpnt->host_scribble = (unsigned char *) kmalloc(512, GFP_DMA); SCpnt->host_scribble = (unsigned char *) kmalloc(512, GFP_KERNEL | GFP_DMA);
sgpnt = (struct scatterlist *) SCpnt->request_buffer; sgpnt = (struct scatterlist *) SCpnt->request_buffer;
cptr = (struct chain *) SCpnt->host_scribble; cptr = (struct chain *) SCpnt->host_scribble;
if (cptr == NULL) if (cptr == NULL) {
panic("aha1542.c: unable to allocate DMA memory\n"); /* free the claimed mailbox slot */
HOSTDATA(SCpnt->device->host)->SCint[mbo] = NULL;
return SCSI_MLQUEUE_HOST_BUSY;
}
for (i = 0; i < SCpnt->use_sg; i++) { for (i = 0; i < SCpnt->use_sg; i++) {
if (sgpnt[i].length == 0 || SCpnt->use_sg > 16 || if (sgpnt[i].length == 0 || SCpnt->use_sg > 16 ||
(((int) sgpnt[i].offset) & 1) || (sgpnt[i].length & 1)) { (((int) sgpnt[i].offset) & 1) || (sgpnt[i].length & 1)) {
......
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.
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.
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.
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