Commit df31c021 authored by Steve French's avatar Steve French

Merge bk://linux.bkbits.net/linux-2.5

into hostme.bitkeeper.com:/repos/c/cifs/linux-2.5cifs
parents a97fe143 2ac5f852
Linux I2O Support (c) Copyright 1999 Red Hat Software
and others.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version
2 of the License, or (at your option) any later version.
AUTHORS (so far)
Alan Cox, Building Number Three Ltd.
Core code, SCSI and Block OSMs
Steve Ralston, LSI Logic Corp.
Debugging SCSI and Block OSM
Deepak Saxena, Intel Corp.
Various core/block extensions
/proc interface, bug fixes
Ioctl interfaces for control
Debugging LAN OSM
Philip Rumpf
Fixed assorted dumb SMP locking bugs
Juha Sievanen, University of Helsinki Finland
LAN OSM code
/proc interface to LAN class
Bug fixes
Core code extensions
Auvo Häkkinen, University of Helsinki Finland
LAN OSM code
/Proc interface to LAN class
Bug fixes
Core code extensions
Taneli Vähäkangas, University of Helsinki Finland
Fixes to i2o_config
CREDITS
This work was made possible by
Red Hat Software
Funding for the Building #3 part of the project
Symbios Logic (Now LSI)
Host adapters, hints, known to work platforms when I hit
compatibility problems
BoxHill Corporation
Loan of initial FibreChannel disk array used for development work.
European Comission
Funding the work done by the University of Helsinki
SysKonnect
Loan of FDDI and Gigabit Ethernet cards
ASUSTeK
Loan of I2O motherboard
This diff is collapsed.
### Version 2.00.3 Release Date : Tue Aug 24 09:43:35 EDT 2004 - Atul Mukker <atulm@lsil.com>
Wed Jan 29 09:13:44 EST 200 - Atul Mukker <atulm@lsil.com> Current Version : 2.20.3.1 (scsi module), 2.20.2.0 (cmm module)
i. Change the handshake in ISR while acknowledging interrupts. Write the Older Version : 2.20.3.0 (scsi module), 2.20.2.0 (cmm module)
valid interrupt pattern 0x10001234 as soon as it is read from the
outdoor register. In existing driver and on certain platform, invalid
command ids were being returned.
Also, do not wait on status be become 0xFF, since FW can return this i. Function reordering so that inline functions are defined before they
status in certain circumstances. are actually used. It is now mandatory for GCC 3.4.1 (current stable)
Initialize the numstatus field of mailbox to 0xFF so that we can wait Declare some heavy-weight functions to be non-inlined,
on this wait in next interrupt. Firmware does not change its value megaraid_mbox_build_cmd, megaraid_mbox_runpendq,
unless there are some status to be posted megaraid_mbox_prepare_pthru, megaraid_mbox_prepare_epthru,
megaraid_busywait_mbox
ii. Specify the logical drive number while issuing the RESERVATION_STATUS - Andrew Morton <akpm@osdl.org>, 08.19.2004
linux-scsi mailing list
iii. Reduce the default mailbox busy wait time from 300us to 10us. This is "Something else to clean up after inclusion: every instance of an
done to avaoid a possible deadlock in FW because of longer bust waits. inline function is actually rendered as a full function call, because
the function is always used before it is defined. Atul, please
re-arrange the code to eliminate the need for most (all) of the
function prototypes at the top of each file, and define (not just
declare with a prototype) each inline function before its first use"
iv. The max outstanding commands are reduced to 126 because that't the - Matt Domsch <Matt_Domsch@dell.com>, 07.27.2004
safest value on all FW. linux-scsi mailing list
v. Number of sectors per IO are reduced to 128 (64kb), becuase FW needs
resources in special circumstances like check consistency, rebuilds
etc.
vi. max_commands is no longer a module parameter because of iv. ii. Display elapsed time (countdown) while waiting for FW to boot.
### Version: 2.00.2 iii. Module compilation reorder in Makefile so that unresolved symbols do
i. Intermediate release with kernel specific code not occur when driver is compiled non-modular.
Patrick J. LoPresti <patl@users.sourceforge.net>, 8.22.2004
linux-scsi mailing list
### Version: 2.00.1i
Wed Dec 4 14:34:51 EST 2002 - Atul Mukker <atulm@lsil.com>
i. Making the older IO based controllers to work with this driver
Release Date : Thu Aug 19 09:58:33 EDT 2004 - Atul Mukker <atulm@lsil.com>
Current Version : 2.20.3.0 (scsi module), 2.20.2.0 (cmm module)
Older Version : 2.20.2.0 (scsi module), 2.20.1.0 (cmm module)
### Version 2.00.1 i. When copying the mailbox packets, copy only first 14 bytes (for 32-bit
Fri Nov 15 10:59:44 EST 2002 - Atul Mukker <atulm@lsil.com> mailboxes) and only first 22 bytes (for 64-bit mailboxes). This is to
i. Release host lock before issuing internal command to reset avoid getting the stale values for busy bit. We want to set the busy
reservations in megaraid_reset() and reacquire after internal command bit just before issuing command to the FW.
is completed.
ii. In the reset handling, if the reseted command is not owned by the
driver, do not (wrongly) print information for the "attached" driver
packet.
iii. Have extended wait when issuing command in synchronous mode. This is
required for the cases where the option ROM is disabled and there is
no BIOS to start the controller. The FW starts to boot after receiving
the first command from the driver. The current driver has 1 second
timeout for the synchronous commands, which is far less than what is
actually required. We now wait up to MBOX_RESET_TIME (180 seconds) for
FW boot process.
iv. In megaraid_mbox_product_info, clear the mailbox contents completely
before preparing the command for inquiry3. This is to ensure that the
FW does not get junk values in the command.
v. Do away with the redundant LSI_CONFIG_COMPAT redefinition for
CONFIG_COMPAT. Replace <asm/ioctl32.h> with <linux/ioctl32.h>
- James Bottomley <James.Bottomley@SteelEye.com>, 08.17.2004
linux-scsi mailing list
vi. Add support for 64-bit applications. Current drivers assume only
32-bit applications, even on 64-bit platforms. Use the "data" and
"buffer" fields of the mimd_t structure, instead of embedded 32-bit
addresses in application mailbox and passthru structures.
vii. Move the function declarations for the management module from
megaraid_mm.h to megaraid_mm.c
- Andrew Morton <akpm@osdl.org>, 08.19.2004
linux-scsi mailing list
viii. Change default values for MEGARAID_NEWGEN, MEGARAID_MM, and
MEGARAID_MAILBOX to 'n' in Kconfig.megaraid
- Andrew Morton <akpm@osdl.org>, 08.19.2004
linux-scsi mailing list
ix. replace udelay with msleep
x. Typos corrected in comments and whitespace adjustments, explicit
grouping of expressions.
Release Date : Fri Jul 23 15:22:07 EDT 2004 - Atul Mukker <atulm@lsil.com>
Current Version : 2.20.2.0 (scsi module), 2.20.1.0 (cmm module)
Older Version : 2.20.1.0 (scsi module), 2.20.0.0 (cmm module)
i. Add PCI ids for Acer ROMB 2E solution
ii. Add PCI ids for I4
iii. Typo corrected for subsys id for megaraid sata 300-4x
iv. Remove yield() while mailbox handshake in synchronous commands
"My other main gripe is things like this:
+ // wait for maximum 1 second for status to post
+ for (i = 0; i < 40000; i++) {
+ if (mbox->numstatus != 0xFF) break;
+ udelay(25); yield();
+ }
which litter the driver. Use of yield() in drivers is deprecated."
- James Bottomley <James.Bottomley@SteelEye.com>, 07.14.2004
linux-scsi mailing list
v. Remove redundant __megaraid_busywait_mbox routine
vi. Fix bug in the managment module, which causes a system lockup when the
IO module is loaded and then unloaded, followed by executing any
management utility. The current version of management module does not
handle the adapter unregister properly.
Specifically, it still keeps a reference to the unregistered
controllers. To avoid this, the static array adapters has been
replaced by a dynamic list, which gets updated every time an adapter
is added or removed.
Also, during unregistration of the IO module, the resources are
now released in the exact reverse order of the allocation time
sequence.
Release Date : Fri Jun 25 18:58:43 EDT 2004 - Atul Mukker <atulm@lsil.com>
Current Version : 2.20.1.0
Older Version : megaraid 2.20.0.1
i. Stale list pointer in adapter causes kernel panic when module
megaraid_mbox is unloaded
Release Date : Thu Jun 24 20:37:11 EDT 2004 - Atul Mukker <atulm@lsil.com>
Current Version : 2.20.0.1
Older Version : megaraid 2.20.0.00
i. Modules are not 'y' by default, but depend on current definition of
SCSI & PCI.
ii. Redundant structure mraid_driver_t removed.
iii. Miscellaneous indentation and goto/label fixes.
- Christoph Hellwig <hch@infradead.org>, 06.24.2004 linux-scsi
iv. scsi_host_put(), do just before completing HBA shutdown.
Release Date : Mon Jun 21 19:53:54 EDT 2004 - Atul Mukker <atulm@lsil.com>
Current Version : 2.20.0.0
Older Version : megaraid 2.20.0.rc2 and 2.00.3
i. Independent module to interact with userland applications and
multiplex command to low level RAID module(s).
"Shared code in a third module, a "library module", is an acceptable
solution. modprobe automatically loads dependent modules, so users
running "modprobe driver1" or "modprobe driver2" would automatically
load the shared library module."
- Jeff Garzik <jgarzik@pobox.com> 02.25.2004 LKML
"As Jeff hinted, if your userspace<->driver API is consistent between
your new MPT-based RAID controllers and your existing megaraid driver,
then perhaps you need a single small helper module (lsiioctl or some
better name), loaded by both mptraid and megaraid automatically, which
handles registering the /dev/megaraid node dynamically. In this case,
both mptraid and megaraid would register with lsiioctl for each
adapter discovered, and lsiioctl would essentially be a switch,
redirecting userspace tool ioctls to the appropriate driver."
- Matt Domsch <Matt_Domsch@dell.com> 02.25.2004 LKML
ii. Remove C99 initializations from pci_device id.
"pci_id_table_g would be much more readable when not using C99
initializers.
PCI table doesn't change, there's lots of users that prefer the more
readable variant. And it's really far less and much easier to grok
lines without C99 initializers."
- Christoph Hellwig <hch@infradead.org>, 05.28.2004 linux-scsi
iii. Many fixes as suggested by Christoph Hellwig <hch@infradead.org> on
linux-scsi, 05.28.2004
iv. We now support up to 32 parallel ioctl commands instead of current 1.
There is a conscious effort to let memory allocation not fail for ioctl
commands.
v. Do away with internal memory management. Use pci_pool_(create|alloc)
instead.
vi. Kill tasklet when unloading the driver.
vii. Do not use "host_lock', driver has fine-grain locks now to protect all
data structures.
viii. Optimize the build scatter-gather list routine. The callers already
know the data transfer address and length.
ix. Better implementation of error handling and recovery. Driver now
performs extended errors recovery for instances like scsi cable pull.
x. Disassociate the management commands with an overlaid scsi command.
Driver now treats the management packets as special packets and has a
dedicated callback routine.
Notes on Management Module
~~~~~~~~~~~~~~~~~~~~~~~~~~
Overview:
--------
Different classes of controllers from LSI Logic, accept and respond to the
user applications in a similar way. They understand the same firmware control
commands. Furthermore, the applications also can treat different classes of
the controllers uniformly. Hence it is logical to have a single module that
interefaces with the applications on one side and all the low level drivers
on the other.
The advantages, though obvious, are listed for completeness:
i. Avoid duplicate code from the low level drivers.
ii. Unburden the low level drivers from having to export the
character node device and related handling.
iii. Implement any policy mechanisms in one place.
iv. Applications have to interface with only module instead of
multiple low level drivers.
Currently this module (called Common Management Module) is used only to issue
ioctl commands. But this module is envisioned to handle all user space level
interactions. So any 'proc', 'sysfs' implementations will be localized in this
common module.
Credits:
-------
"Shared code in a third module, a "library module", is an acceptable
solution. modprobe automatically loads dependent modules, so users
running "modprobe driver1" or "modprobe driver2" would automatically
load the shared library module."
- Jeff Garzik (jgarzik@pobox.com), 02.25.2004 LKML
"As Jeff hinted, if your userspace<->driver API is consistent between
your new MPT-based RAID controllers and your existing megaraid driver,
then perhaps you need a single small helper module (lsiioctl or some
better name), loaded by both mptraid and megaraid automatically, which
handles registering the /dev/megaraid node dynamically. In this case,
both mptraid and megaraid would register with lsiioctl for each
adapter discovered, and lsiioctl would essentially be a switch,
redirecting userspace tool ioctls to the appropriate driver."
- Matt Domsch, (Matt_Domsch@dell.com), 02.25.2004 LKML
Design:
------
The Common Management Module is implemented in megaraid_mm.[ch] files. This
module acts as a registry for low level hba drivers. The low level drivers
(currently only megaraid) register each controller with the common module.
The applications interface with the common module via the character device
node exported by the module.
The lower level drivers now understand only a new improved ioctl packet called
uioc_t. The management module converts the older ioctl packets from the older
applications into uioc_t. After driver handles the uioc_t, the common module
will convert that back into the old format before returning to applications.
As new applications evolve and replace the old ones, the old packet format
will be retired.
Common module dedicates one uioc_t packet to each controller registered. This
can easily be more than one. But since megaraid is the only low level driver
today, and it can handle only one ioctl, there is no reason to have more. But
as new controller classes get added, this will be tuned appropriately.
This diff is collapsed.
...@@ -627,6 +627,8 @@ DC390/AM53C974 SCSI driver ...@@ -627,6 +627,8 @@ DC390/AM53C974 SCSI driver
P: Kurt Garloff P: Kurt Garloff
M: garloff@suse.de M: garloff@suse.de
W: http://www.garloff.de/kurt/linux/dc390/ W: http://www.garloff.de/kurt/linux/dc390/
P: Guennadi Liakhovetski
M: g.liakhovetski@gmx.de
S: Maintained S: Maintained
DECnet NETWORK LAYER DECnet NETWORK LAYER
...@@ -957,6 +959,12 @@ L: sensors@stimpy.netroedge.com ...@@ -957,6 +959,12 @@ L: sensors@stimpy.netroedge.com
W: http://www.lm-sensors.nu/ W: http://www.lm-sensors.nu/
S: Maintained S: Maintained
I2O
P: Markus Lidel
M: markus.lidel@shadowconnect.com
W: http://i2o.shadowconnect.com/
S: Maintained
i386 BOOT CODE i386 BOOT CODE
P: Riley H. Williams P: Riley H. Williams
M: Riley@Williams.Name M: Riley@Williams.Name
......
...@@ -538,6 +538,7 @@ int scsi_cmd_ioctl(struct file *file, struct gendisk *bd_disk, unsigned int cmd, ...@@ -538,6 +538,7 @@ int scsi_cmd_ioctl(struct file *file, struct gendisk *bd_disk, unsigned int cmd,
* old junk scsi send command ioctl * old junk scsi send command ioctl
*/ */
case SCSI_IOCTL_SEND_COMMAND: case SCSI_IOCTL_SEND_COMMAND:
printk(KERN_WARNING "program %s is using a deprecated SCSI ioctl, please convert it to SG_IO\n", current->comm);
err = -EINVAL; err = -EINVAL;
if (!arg) if (!arg)
break; break;
......
...@@ -595,39 +595,6 @@ config HVCS ...@@ -595,39 +595,6 @@ config HVCS
which will also be compiled when this driver is built as a which will also be compiled when this driver is built as a
module. module.
config QIC02_TAPE
tristate "QIC-02 tape support"
help
If you have a non-SCSI tape drive like that, say Y.
To compile this driver as a module, choose M here: the
module will be called tpqic02.
config QIC02_DYNCONF
bool "Do you want runtime configuration for QIC-02"
depends on QIC02_TAPE
help
You can either configure this driver once and for all by editing a
header file (<file:include/linux/tpqic02.h>), in which case you
should say N, or you can fetch a program via anonymous FTP which is
able to configure this driver during runtime. The program to do
this is called 'qic02conf' and it is part of the
tpqic02-support-X.Y.tar.gz support package.
If you want to use the qic02conf program, say Y.
comment "Edit configuration parameters in ./include/linux/tpqic02.h!"
depends on QIC02_TAPE && !QIC02_DYNCONF
comment "Setting runtime QIC-02 configuration is done with qic02conf"
depends on QIC02_TAPE && QIC02_DYNCONF
comment "from the tpqic02-support package. It is available at"
depends on QIC02_TAPE && QIC02_DYNCONF
comment "metalab.unc.edu or ftp://titus.cfw.com/pub/Linux/util/"
depends on QIC02_TAPE && QIC02_DYNCONF
source "drivers/char/ipmi/Kconfig" source "drivers/char/ipmi/Kconfig"
source "drivers/char/watchdog/Kconfig" source "drivers/char/watchdog/Kconfig"
......
...@@ -1809,11 +1809,9 @@ static int idedisk_attach(ide_drive_t *drive) ...@@ -1809,11 +1809,9 @@ static int idedisk_attach(ide_drive_t *drive)
if ((!drive->head || drive->head > 16) && !drive->select.b.lba) { if ((!drive->head || drive->head > 16) && !drive->select.b.lba) {
printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n", printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n",
drive->name, drive->head); drive->name, drive->head);
ide_cacheflush_p(drive); drive->attach = 0;
ide_unregister_subdriver(drive); } else
DRIVER(drive)->busy--; drive->attach = 1;
goto failed;
}
DRIVER(drive)->busy--; DRIVER(drive)->busy--;
g->minors = 1 << PARTN_BITS; g->minors = 1 << PARTN_BITS;
strcpy(g->devfs_name, drive->devfs_name); strcpy(g->devfs_name, drive->devfs_name);
...@@ -1821,7 +1819,6 @@ static int idedisk_attach(ide_drive_t *drive) ...@@ -1821,7 +1819,6 @@ static int idedisk_attach(ide_drive_t *drive)
g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0; g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0;
set_capacity(g, current_capacity(drive)); set_capacity(g, current_capacity(drive));
g->fops = &idedisk_ops; g->fops = &idedisk_ops;
drive->attach = 1;
add_disk(g); add_disk(g);
return 0; return 0;
failed: failed:
......
...@@ -635,12 +635,11 @@ static void hwif_register (ide_hwif_t *hwif) ...@@ -635,12 +635,11 @@ static void hwif_register (ide_hwif_t *hwif)
device_register(&hwif->gendev); device_register(&hwif->gendev);
} }
#ifdef CONFIG_PPC
static int wait_hwif_ready(ide_hwif_t *hwif) static int wait_hwif_ready(ide_hwif_t *hwif)
{ {
int rc; int rc;
printk(KERN_INFO "Probing IDE interface %s...\n", hwif->name); printk(KERN_DEBUG "Probing IDE interface %s...\n", hwif->name);
/* Let HW settle down a bit from whatever init state we /* Let HW settle down a bit from whatever init state we
* come from */ * come from */
...@@ -671,7 +670,6 @@ static int wait_hwif_ready(ide_hwif_t *hwif) ...@@ -671,7 +670,6 @@ static int wait_hwif_ready(ide_hwif_t *hwif)
return rc; return rc;
} }
#endif
/* /*
* This routine only knows how to look for drive units 0 and 1 * This routine only knows how to look for drive units 0 and 1
...@@ -717,7 +715,6 @@ static void probe_hwif(ide_hwif_t *hwif) ...@@ -717,7 +715,6 @@ static void probe_hwif(ide_hwif_t *hwif)
local_irq_set(flags); local_irq_set(flags);
#ifdef CONFIG_PPC
/* This is needed on some PPCs and a bunch of BIOS-less embedded /* This is needed on some PPCs and a bunch of BIOS-less embedded
* platforms. Typical cases are: * platforms. Typical cases are:
* *
...@@ -738,8 +735,7 @@ static void probe_hwif(ide_hwif_t *hwif) ...@@ -738,8 +735,7 @@ static void probe_hwif(ide_hwif_t *hwif)
* BenH. * BenH.
*/ */
if (wait_hwif_ready(hwif)) if (wait_hwif_ready(hwif))
printk(KERN_WARNING "%s: Wait for ready failed before probe !\n", hwif->name); printk(KERN_DEBUG "%s: Wait for ready failed before probe !\n", hwif->name);
#endif /* CONFIG_PPC */
/* /*
* Second drive should only exist if first drive was found, * Second drive should only exist if first drive was found,
...@@ -749,6 +745,18 @@ static void probe_hwif(ide_hwif_t *hwif) ...@@ -749,6 +745,18 @@ static void probe_hwif(ide_hwif_t *hwif)
ide_drive_t *drive = &hwif->drives[unit]; ide_drive_t *drive = &hwif->drives[unit];
drive->dn = (hwif->channel ? 2 : 0) + unit; drive->dn = (hwif->channel ? 2 : 0) + unit;
(void) probe_for_drive(drive); (void) probe_for_drive(drive);
if (drive->present && hwif->present && unit == 1) {
if (strcmp(hwif->drives[0].id->model, drive->id->model) == 0 &&
/* Don't do this for noprobe or non ATA */
strcmp(drive->id->model, "UNKNOWN") &&
/* And beware of confused Maxtor drives that go "M0000000000"
"The SN# is garbage in the ID block..." [Eric] */
strncmp(drive->id->serial_no, "M0000000000000000000", 20) &&
strncmp(hwif->drives[0].id->serial_no, drive->id->serial_no, 20) == 0) {
printk(KERN_WARNING "ide-probe: ignoring undecoded slave\n");
drive->present = 0;
}
}
if (drive->present && !hwif->present) { if (drive->present && !hwif->present) {
hwif->present = 1; hwif->present = 1;
if (hwif->chipset != ide_4drives || if (hwif->chipset != ide_4drives ||
......
...@@ -530,7 +530,6 @@ typedef struct os_dat_s { ...@@ -530,7 +530,6 @@ typedef struct os_dat_s {
*/ */
#define IDETAPE_DEBUG_INFO 0 #define IDETAPE_DEBUG_INFO 0
#define IDETAPE_DEBUG_LOG 0 #define IDETAPE_DEBUG_LOG 0
#define IDETAPE_DEBUG_LOG_VERBOSE 0
#define IDETAPE_DEBUG_BUGS 1 #define IDETAPE_DEBUG_BUGS 1
/* /*
...@@ -1260,70 +1259,6 @@ typedef struct { ...@@ -1260,70 +1259,6 @@ typedef struct {
*/ */
static idetape_chrdev_t idetape_chrdevs[MAX_HWIFS * MAX_DRIVES]; static idetape_chrdev_t idetape_chrdevs[MAX_HWIFS * MAX_DRIVES];
#if IDETAPE_DEBUG_LOG_VERBOSE
/*
* DO NOT REMOVE, BUILDING A VERBOSE DEBUG SCHEME FOR ATAPI
*/
char *idetape_sense_key_verbose(u8 idetape_sense_key)
{
switch (idetape_sense_key) {
default: {
char buf[22];
sprintf(buf, "IDETAPE_SENSE (0x%02x)", idetape_sense_key);
return(buf);
}
}
}
char *idetape_command_key_verbose(u8 idetape_command_key)
{
switch (idetape_command_key) {
case IDETAPE_TEST_UNIT_READY_CMD:
return("TEST_UNIT_READY_CMD");
case IDETAPE_REWIND_CMD:
return("REWIND_CMD");
case IDETAPE_REQUEST_SENSE_CMD:
return("REQUEST_SENSE_CMD");
case IDETAPE_READ_CMD:
return("READ_CMD");
case IDETAPE_WRITE_CMD:
return("WRITE_CMD");
case IDETAPE_WRITE_FILEMARK_CMD:
return("WRITE_FILEMARK_CMD");
case IDETAPE_SPACE_CMD:
return("SPACE_CMD");
case IDETAPE_INQUIRY_CMD:
return("INQUIRY_CMD");
case IDETAPE_ERASE_CMD:
return("ERASE_CMD");
case IDETAPE_MODE_SENSE_CMD:
return("MODE_SENSE_CMD");
case IDETAPE_MODE_SELECT_CMD:
return("MODE_SELECT_CMD");
case IDETAPE_LOAD_UNLOAD_CMD:
return("LOAD_UNLOAD_CMD");
case IDETAPE_PREVENT_CMD:
return("PREVENT_CMD");
case IDETAPE_LOCATE_CMD:
return("LOCATE_CMD");
case IDETAPE_READ_POSITION_CMD:
return("READ_POSITION_CMD");
case IDETAPE_READ_BUFFER_CMD:
return("READ_BUFFER_CMD");
case IDETAPE_SET_SPEED_CMD:
return("SET_SPEED_CMD");
default: {
char buf[20];
sprintf(buf, "CMD (0x%02x)", idetape_command_key);
return(buf);
}
}
}
#endif /* IDETAPE_DEBUG_LOG_VERBOSE */
/* /*
* Function declarations * Function declarations
* *
...@@ -1507,15 +1442,6 @@ static void idetape_analyze_error (ide_drive_t *drive, idetape_request_sense_res ...@@ -1507,15 +1442,6 @@ static void idetape_analyze_error (ide_drive_t *drive, idetape_request_sense_res
"asc = %x, ascq = %x\n", "asc = %x, ascq = %x\n",
pc->c[0], result->sense_key, pc->c[0], result->sense_key,
result->asc, result->ascq); result->asc, result->ascq);
#if IDETAPE_DEBUG_LOG_VERBOSE
if (tape->debug_level >= 1)
printk(KERN_INFO "ide-tape: pc = %s, sense key = %x, "
"asc = %x, ascq = %x\n",
idetape_command_key_verbose((byte) pc->c[0]),
result->sense_key,
result->asc,
result->ascq);
#endif /* IDETAPE_DEBUG_LOG_VERBOSE */
#endif /* IDETAPE_DEBUG_LOG */ #endif /* IDETAPE_DEBUG_LOG */
/* /*
......
...@@ -1348,23 +1348,6 @@ static int set_xfer_rate (ide_drive_t *drive, int arg) ...@@ -1348,23 +1348,6 @@ static int set_xfer_rate (ide_drive_t *drive, int arg)
return err; return err;
} }
int ide_atapi_to_scsi (ide_drive_t *drive, int arg)
{
if (drive->media == ide_disk) {
drive->scsi = 0;
return 0;
}
if (DRIVER(drive)->cleanup(drive)) {
drive->scsi = 0;
return 0;
}
drive->scsi = (u8) arg;
ata_attach(drive);
return 0;
}
void ide_add_generic_settings (ide_drive_t *drive) void ide_add_generic_settings (ide_drive_t *drive)
{ {
/* /*
...@@ -1379,8 +1362,6 @@ void ide_add_generic_settings (ide_drive_t *drive) ...@@ -1379,8 +1362,6 @@ void ide_add_generic_settings (ide_drive_t *drive)
ide_add_setting(drive, "init_speed", SETTING_RW, -1, -1, TYPE_BYTE, 0, 70, 1, 1, &drive->init_speed, NULL); ide_add_setting(drive, "init_speed", SETTING_RW, -1, -1, TYPE_BYTE, 0, 70, 1, 1, &drive->init_speed, NULL);
ide_add_setting(drive, "current_speed", SETTING_RW, -1, -1, TYPE_BYTE, 0, 70, 1, 1, &drive->current_speed, set_xfer_rate); ide_add_setting(drive, "current_speed", SETTING_RW, -1, -1, TYPE_BYTE, 0, 70, 1, 1, &drive->current_speed, set_xfer_rate);
ide_add_setting(drive, "number", SETTING_RW, -1, -1, TYPE_BYTE, 0, 3, 1, 1, &drive->dn, NULL); ide_add_setting(drive, "number", SETTING_RW, -1, -1, TYPE_BYTE, 0, 3, 1, 1, &drive->dn, NULL);
if (drive->media != ide_disk)
ide_add_setting(drive, "ide-scsi", SETTING_RW, -1, HDIO_SET_IDE_SCSI, TYPE_BYTE, 0, 1, 1, 1, &drive->scsi, ide_atapi_to_scsi);
} }
int system_bus_clock (void) int system_bus_clock (void)
......
...@@ -10,6 +10,5 @@ obj-$(CONFIG_BLK_DEV_IDECS) += ide-cs.o ...@@ -10,6 +10,5 @@ obj-$(CONFIG_BLK_DEV_IDECS) += ide-cs.o
# Last of all # Last of all
obj-$(CONFIG_BLK_DEV_HD) += hd.o obj-$(CONFIG_BLK_DEV_HD) += hd.o
obj-$(CONFIG_BLK_DEV_HD98) += hd98.o
EXTRA_CFLAGS := -Idrivers/ide EXTRA_CFLAGS := -Idrivers/ide
...@@ -354,15 +354,6 @@ static ide_startstop_t promise_read_intr (ide_drive_t *drive) ...@@ -354,15 +354,6 @@ static ide_startstop_t promise_read_intr (ide_drive_t *drive)
(unsigned long)rq->nr_sectors - nsect); (unsigned long)rq->nr_sectors - nsect);
#endif /* DEBUG_READ */ #endif /* DEBUG_READ */
#ifdef CONFIG_IDE_TASKFILE_IO
task_bio_sectors(drive, rq, nsect, IDE_PIO_IN);
/* FIXME: can we check status after transfer on pdc4030? */
/* Complete previously submitted bios. */
while (rq->bio != rq->cbio)
if (!DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->bio)))
return ide_stopped;
#else /* CONFIG_IDE_TASKFILE_IO */
HWIF(drive)->ata_input_data(drive, rq->buffer, nsect * SECTOR_WORDS); HWIF(drive)->ata_input_data(drive, rq->buffer, nsect * SECTOR_WORDS);
rq->buffer += nsect<<9; rq->buffer += nsect<<9;
rq->sector += nsect; rq->sector += nsect;
...@@ -370,7 +361,6 @@ static ide_startstop_t promise_read_intr (ide_drive_t *drive) ...@@ -370,7 +361,6 @@ static ide_startstop_t promise_read_intr (ide_drive_t *drive)
rq->nr_sectors -= nsect; rq->nr_sectors -= nsect;
if (!rq->current_nr_sectors) if (!rq->current_nr_sectors)
DRIVER(drive)->end_request(drive, 1, 0); DRIVER(drive)->end_request(drive, 1, 0);
#endif /* CONFIG_IDE_TASKFILE_IO */
/* /*
* Now the data has been read in, do the following: * Now the data has been read in, do the following:
...@@ -421,12 +411,8 @@ static ide_startstop_t promise_read_intr (ide_drive_t *drive) ...@@ -421,12 +411,8 @@ static ide_startstop_t promise_read_intr (ide_drive_t *drive)
static ide_startstop_t promise_complete_pollfunc(ide_drive_t *drive) static ide_startstop_t promise_complete_pollfunc(ide_drive_t *drive)
{ {
ide_hwgroup_t *hwgroup = HWGROUP(drive); ide_hwgroup_t *hwgroup = HWGROUP(drive);
#ifdef CONFIG_IDE_TASKFILE_IO
struct request *rq = hwgroup->rq;
#else
struct request *rq = &hwgroup->wrq; struct request *rq = &hwgroup->wrq;
struct bio *bio = rq->bio; struct bio *bio = rq->bio;
#endif
if ((HWIF(drive)->INB(IDE_STATUS_REG)) & BUSY_STAT) { if ((HWIF(drive)->INB(IDE_STATUS_REG)) & BUSY_STAT) {
if (time_before(jiffies, hwgroup->poll_timeout)) { if (time_before(jiffies, hwgroup->poll_timeout)) {
...@@ -450,15 +436,10 @@ static ide_startstop_t promise_complete_pollfunc(ide_drive_t *drive) ...@@ -450,15 +436,10 @@ static ide_startstop_t promise_complete_pollfunc(ide_drive_t *drive)
printk(KERN_DEBUG "%s: Write complete - end_request\n", drive->name); printk(KERN_DEBUG "%s: Write complete - end_request\n", drive->name);
#endif /* DEBUG_WRITE */ #endif /* DEBUG_WRITE */
#ifdef CONFIG_IDE_TASKFILE_IO
/* Complete previously submitted bios. */
while (rq->bio != rq->cbio)
(void) DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->bio));
#else
bio->bi_idx = bio->bi_vcnt - rq->nr_cbio_segments; bio->bi_idx = bio->bi_vcnt - rq->nr_cbio_segments;
rq = hwgroup->rq; rq = hwgroup->rq;
DRIVER(drive)->end_request(drive, 1, rq->hard_nr_sectors); DRIVER(drive)->end_request(drive, 1, rq->hard_nr_sectors);
#endif
return ide_stopped; return ide_stopped;
} }
...@@ -466,27 +447,6 @@ static ide_startstop_t promise_complete_pollfunc(ide_drive_t *drive) ...@@ -466,27 +447,6 @@ static ide_startstop_t promise_complete_pollfunc(ide_drive_t *drive)
* promise_multwrite() transfers a block of up to mcount sectors of data * promise_multwrite() transfers a block of up to mcount sectors of data
* to a drive as part of a disk multiple-sector write operation. * to a drive as part of a disk multiple-sector write operation.
*/ */
#ifdef CONFIG_IDE_TASKFILE_IO
static void promise_multwrite (ide_drive_t *drive, unsigned int msect)
{
struct request* rq = HWGROUP(drive)->rq;
unsigned int nsect;
rq->errors = 0;
do {
nsect = rq->current_nr_sectors;
if (nsect > msect)
nsect = msect;
task_bio_sectors(drive, rq, nsect, IDE_PIO_OUT);
if (!rq->nr_sectors)
msect = 0;
else
msect -= nsect;
} while (msect);
}
#else /* CONFIG_IDE_TASKFILE_IO */
static void promise_multwrite (ide_drive_t *drive, unsigned int mcount) static void promise_multwrite (ide_drive_t *drive, unsigned int mcount)
{ {
ide_hwgroup_t *hwgroup = HWGROUP(drive); ide_hwgroup_t *hwgroup = HWGROUP(drive);
...@@ -537,7 +497,6 @@ static void promise_multwrite (ide_drive_t *drive, unsigned int mcount) ...@@ -537,7 +497,6 @@ static void promise_multwrite (ide_drive_t *drive, unsigned int mcount)
taskfile_output_data(drive, buffer, nsect<<7); taskfile_output_data(drive, buffer, nsect<<7);
} while (mcount); } while (mcount);
} }
#endif
/* /*
* promise_write_pollfunc() is the handler for disk write completion polling. * promise_write_pollfunc() is the handler for disk write completion polling.
...@@ -545,12 +504,8 @@ static void promise_multwrite (ide_drive_t *drive, unsigned int mcount) ...@@ -545,12 +504,8 @@ static void promise_multwrite (ide_drive_t *drive, unsigned int mcount)
static ide_startstop_t promise_write_pollfunc (ide_drive_t *drive) static ide_startstop_t promise_write_pollfunc (ide_drive_t *drive)
{ {
ide_hwgroup_t *hwgroup = HWGROUP(drive); ide_hwgroup_t *hwgroup = HWGROUP(drive);
#ifdef CONFIG_IDE_TASKFILE_IO
struct request *rq = hwgroup->rq;
#else
struct request *rq = &hwgroup->wrq; struct request *rq = &hwgroup->wrq;
struct bio *bio = rq->bio; struct bio *bio = rq->bio;
#endif
if (HWIF(drive)->INB(IDE_NSECTOR_REG) != 0) { if (HWIF(drive)->INB(IDE_NSECTOR_REG) != 0) {
if (time_before(jiffies, hwgroup->poll_timeout)) { if (time_before(jiffies, hwgroup->poll_timeout)) {
...@@ -564,19 +519,11 @@ static ide_startstop_t promise_write_pollfunc (ide_drive_t *drive) ...@@ -564,19 +519,11 @@ static ide_startstop_t promise_write_pollfunc (ide_drive_t *drive)
} }
hwgroup->poll_timeout = 0; hwgroup->poll_timeout = 0;
printk(KERN_ERR "%s: write timed-out!\n",drive->name); printk(KERN_ERR "%s: write timed-out!\n",drive->name);
#ifndef CONFIG_IDE_TASKFILE_IO
bio->bi_idx = bio->bi_vcnt - rq->nr_cbio_segments; bio->bi_idx = bio->bi_vcnt - rq->nr_cbio_segments;
#endif
return DRIVER(drive)->error(drive, "write timeout", return DRIVER(drive)->error(drive, "write timeout",
HWIF(drive)->INB(IDE_STATUS_REG)); HWIF(drive)->INB(IDE_STATUS_REG));
} }
#ifdef CONFIG_IDE_TASKFILE_IO
/* Complete previously submitted bios. */
while (rq->bio != rq->cbio)
(void) DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->bio));
#endif
/* /*
* Now write out last 4 sectors and poll for not BUSY * Now write out last 4 sectors and poll for not BUSY
*/ */
...@@ -602,11 +549,7 @@ static ide_startstop_t promise_write_pollfunc (ide_drive_t *drive) ...@@ -602,11 +549,7 @@ static ide_startstop_t promise_write_pollfunc (ide_drive_t *drive)
static ide_startstop_t promise_write (ide_drive_t *drive) static ide_startstop_t promise_write (ide_drive_t *drive)
{ {
ide_hwgroup_t *hwgroup = HWGROUP(drive); ide_hwgroup_t *hwgroup = HWGROUP(drive);
#ifdef CONFIG_IDE_TASKFILE_IO
struct request *rq = hwgroup->rq;
#else
struct request *rq = &hwgroup->wrq; struct request *rq = &hwgroup->wrq;
#endif
#ifdef DEBUG_WRITE #ifdef DEBUG_WRITE
printk(KERN_DEBUG "%s: %s: sectors(%lu-%lu)\n", printk(KERN_DEBUG "%s: %s: sectors(%lu-%lu)\n",
...@@ -654,39 +597,14 @@ static ide_startstop_t promise_write (ide_drive_t *drive) ...@@ -654,39 +597,14 @@ static ide_startstop_t promise_write (ide_drive_t *drive)
* already set up. It issues a READ or WRITE command to the Promise * already set up. It issues a READ or WRITE command to the Promise
* controller, assuming LBA has been used to set up the block number. * controller, assuming LBA has been used to set up the block number.
*/ */
#ifndef CONFIG_IDE_TASKFILE_IO
ide_startstop_t do_pdc4030_io (ide_drive_t *drive, struct request *rq) ide_startstop_t do_pdc4030_io (ide_drive_t *drive, struct request *rq)
{ {
ide_startstop_t startstop; ide_startstop_t startstop;
unsigned long timeout; unsigned long timeout;
u8 stat = 0; u8 stat = 0;
#else
static ide_startstop_t do_pdc4030_io (ide_drive_t *drive, ide_task_t *task)
{
struct request *rq = HWGROUP(drive)->rq;
task_struct_t *taskfile = (task_struct_t *) task->tfRegister;
ide_startstop_t startstop;
unsigned long timeout;
u8 stat = 0;
if (IDE_CONTROL_REG)
HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG); /* clear nIEN */
SELECT_MASK(drive, 0);
HWIF(drive)->OUTB(taskfile->feature, IDE_FEATURE_REG);
HWIF(drive)->OUTB(taskfile->sector_count, IDE_NSECTOR_REG);
/* refers to number of sectors to transfer */
HWIF(drive)->OUTB(taskfile->sector_number, IDE_SECTOR_REG);
/* refers to sector offset or start sector */
HWIF(drive)->OUTB(taskfile->low_cylinder, IDE_LCYL_REG);
HWIF(drive)->OUTB(taskfile->high_cylinder, IDE_HCYL_REG);
HWIF(drive)->OUTB(taskfile->device_head, IDE_SELECT_REG);
HWIF(drive)->OUTB(taskfile->command, IDE_COMMAND_REG);
#endif
if (rq_data_dir(rq) == READ) { if (rq_data_dir(rq) == READ) {
#ifndef CONFIG_IDE_TASKFILE_IO
HWIF(drive)->OUTB(PROMISE_READ, IDE_COMMAND_REG); HWIF(drive)->OUTB(PROMISE_READ, IDE_COMMAND_REG);
#endif
/* /*
* The card's behaviour is odd at this point. If the data is * The card's behaviour is odd at this point. If the data is
* available, DRQ will be true, and no interrupt will be * available, DRQ will be true, and no interrupt will be
...@@ -722,9 +640,7 @@ static ide_startstop_t do_pdc4030_io (ide_drive_t *drive, ide_task_t *task) ...@@ -722,9 +640,7 @@ static ide_startstop_t do_pdc4030_io (ide_drive_t *drive, ide_task_t *task)
"waiting - Odd!\n", drive->name); "waiting - Odd!\n", drive->name);
return ide_stopped; return ide_stopped;
} else { } else {
#ifndef CONFIG_IDE_TASKFILE_IO
HWIF(drive)->OUTB(PROMISE_WRITE, IDE_COMMAND_REG); HWIF(drive)->OUTB(PROMISE_WRITE, IDE_COMMAND_REG);
#endif
if (ide_wait_stat(&startstop, drive, DATA_READY, if (ide_wait_stat(&startstop, drive, DATA_READY,
drive->bad_wstat, WAIT_DRQ)) { drive->bad_wstat, WAIT_DRQ)) {
printk(KERN_ERR "%s: no DRQ after issuing " printk(KERN_ERR "%s: no DRQ after issuing "
...@@ -733,9 +649,7 @@ static ide_startstop_t do_pdc4030_io (ide_drive_t *drive, ide_task_t *task) ...@@ -733,9 +649,7 @@ static ide_startstop_t do_pdc4030_io (ide_drive_t *drive, ide_task_t *task)
} }
if (!drive->unmask) if (!drive->unmask)
local_irq_disable(); local_irq_disable();
#ifndef CONFIG_IDE_TASKFILE_IO
HWGROUP(drive)->wrq = *rq; /* scratchpad */ HWGROUP(drive)->wrq = *rq; /* scratchpad */
#endif
return promise_write(drive); return promise_write(drive);
} }
} }
...@@ -749,14 +663,9 @@ static ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq, ...@@ -749,14 +663,9 @@ static ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq,
*/ */
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
int drive_number = (hwif->channel << 1) + drive->select.b.unit; int drive_number = (hwif->channel << 1) + drive->select.b.unit;
#ifdef CONFIG_IDE_TASKFILE_IO
struct hd_drive_task_hdr taskfile;
ide_task_t args;
#endif
BUG_ON(rq->nr_sectors > 127); BUG_ON(rq->nr_sectors > 127);
#ifndef CONFIG_IDE_TASKFILE_IO
if (IDE_CONTROL_REG) if (IDE_CONTROL_REG)
hwif->OUTB(drive->ctl, IDE_CONTROL_REG); hwif->OUTB(drive->ctl, IDE_CONTROL_REG);
hwif->OUTB(drive_number, IDE_FEATURE_REG); hwif->OUTB(drive_number, IDE_FEATURE_REG);
...@@ -767,27 +676,4 @@ static ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq, ...@@ -767,27 +676,4 @@ static ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq,
hwif->OUTB(((block>>8)&0x0f)|drive->select.all,IDE_SELECT_REG); hwif->OUTB(((block>>8)&0x0f)|drive->select.all,IDE_SELECT_REG);
return do_pdc4030_io(drive, rq); return do_pdc4030_io(drive, rq);
#else /* !CONFIG_IDE_TASKFILE_IO */
memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr));
taskfile.feature = drive_number;
taskfile.sector_count = rq->nr_sectors;
taskfile.sector_number = block;
taskfile.low_cylinder = (block>>=8);
taskfile.high_cylinder = (block>>=8);
taskfile.device_head = ((block>>8)&0x0f)|drive->select.all;
taskfile.command = (rq->cmd==READ)?PROMISE_READ:PROMISE_WRITE;
memcpy(args.tfRegister, &taskfile, sizeof(struct hd_drive_task_hdr));
memset(args.hobRegister, 0, sizeof(struct hd_drive_hob_hdr));
/*
* Setup the bits of args that we do need.
* Note that we don't use the generic interrupt handlers.
*/
args.handler = NULL;
args.rq = (struct request *) rq;
rq->special = (ide_task_t *)&args;
return do_pdc4030_io(drive, &args);
#endif /* !CONFIG_IDE_TASKFILE_IO */
} }
...@@ -290,7 +290,10 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic ...@@ -290,7 +290,10 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
return 1; return 1;
} }
pci_set_master(dev); pci_set_master(dev);
pci_set_dma_mask(dev, 0xFFFFFFFF); if (pci_set_dma_mask(dev, 0xFFFFFFFF)) {
printk(KERN_WARNING "cs5520: No suitable DMA available.\n");
return -ENODEV;
}
init_chipset_cs5520(dev, d->name); init_chipset_cs5520(dev, d->name);
index.all = 0xf0f0; index.all = 0xf0f0;
......
...@@ -27,39 +27,6 @@ config FUSION_MAX_SGE ...@@ -27,39 +27,6 @@ config FUSION_MAX_SGE
necessary (or recommended) unless the user will be running necessary (or recommended) unless the user will be running
large I/O's via the raw interface. large I/O's via the raw interface.
config FUSION_ISENSE
tristate "Enhanced SCSI error reporting"
depends on MODULES && FUSION && m
---help---
The isense module (roughly stands for Interpret SENSE data) is
completely optional. It simply provides extra English readable
strings in SCSI Error Report(s) that might be generated from the
Fusion MPT SCSI Host driver, for example when a target device
returns a SCSI check condition on a I/O. Without this module
loaded you might see:
SCSI Error Report =-=-= (ioc0,scsi5:0)
SCSI_Status=02h (CHECK_CONDITION)
Original_CDB[]: 2A 00 00 00 00 41 00 00 02 00
SenseData[12h]: 70 00 02 00 00 00 00 0A 00 00 00 00 04 02 02 00 00 00
SenseKey=2h (NOT READY); FRU=02h
ASC/ASCQ=29h/00h
Where otherwise, if this module had been loaded, you would see:
SCSI Error Report =-=-= (ioc0,scsi5:0)
SCSI_Status=02h (CHECK_CONDITION)
Original_CDB[]: 2A 00 00 00 00 41 00 00 02 00 - "WRITE(10)"
SenseData[12h]: 70 00 02 00 00 00 00 0A 00 00 00 00 04 02 02 00 00 00
SenseKey=2h (NOT READY); FRU=02h
ASC/ASCQ=29h/00h "LOGICAL UNIT NOT READY, INITIALIZING CMD. REQUIRED"
Say M for "Enhanced SCSI error reporting" to compile this optional module,
creating a driver named: isense.
NOTE: Support for building this feature into the kernel is not
available, due to kernel size considerations.
config FUSION_CTL config FUSION_CTL
tristate "Fusion MPT misc device (ioctl) driver" tristate "Fusion MPT misc device (ioctl) driver"
depends on MODULES && FUSION && m depends on MODULES && FUSION && m
......
...@@ -48,6 +48,5 @@ EXTRA_CFLAGS += ${MPT_CFLAGS} ...@@ -48,6 +48,5 @@ EXTRA_CFLAGS += ${MPT_CFLAGS}
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC
obj-$(CONFIG_FUSION) += mptbase.o mptscsih.o obj-$(CONFIG_FUSION) += mptbase.o mptscsih.o
obj-$(CONFIG_FUSION_ISENSE) += isense.o
obj-$(CONFIG_FUSION_CTL) += mptctl.o obj-$(CONFIG_FUSION_CTL) += mptctl.o
obj-$(CONFIG_FUSION_LAN) += mptlan.o obj-$(CONFIG_FUSION_LAN) += mptlan.o
This diff is collapsed.
#!/bin/sh
#
# ascq_tbl.sh - Translate SCSI t10.org's "asc-num.txt" file of
# SCSI Additional Sense Code & Qualifiers (ASC/ASCQ's)
# into something useful in C, creating "ascq_tbl.c" file.
#
#*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*#
PREF_INFILE="t10.org/asc-num.txt" # From SCSI t10.org
PREF_OUTFILE="ascq_tbl.c"
#*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*#
xlate_ascq() {
cat | awk '
BEGIN {
DQ = "\042";
OUTFILE = "'"${PREF_OUTFILE}"'";
TRUE = 1;
FALSE = 0;
#debug = TRUE;
# read and discard all lines up to and including the one that begins
# with the "magic token" of "------- -------------- ---"...
headers_gone = FALSE;
while (!headers_gone) {
if (getline <= 0)
exit 1;
header_line[++hdrs] = $0;
if (debug)
printf("header_line[%d] = :%s:\n", ++hdrs, $0);
if ($0 ~ /^------- -------------- ---/) {
headers_gone = TRUE;
}
}
outcount = 0;
}
(NF > 1) {
++outcount;
if (debug)
printf( "DBG: %s\n", $0 );
ASC[outcount] = substr($0,1,2);
ASCQ[outcount] = substr($0,5,2);
devtypes = substr($0,10,14);
gsub(/ /, ".", devtypes);
DESCRIP[outcount] = substr($0,26);
if (!(devtypes in DevTypesVoodoo)) {
DevTypesVoodoo[devtypes] = ++voodoo;
DevTypesIdx[voodoo] = devtypes;
}
DEVTYPES[outcount] = DevTypesVoodoo[devtypes];
# Handle 0xNN exception stuff...
if (ASCQ[outcount] == "NN" || ASCQ[outcount] == "nn")
ASCQ[outcount] = "FF";
}
END {
printf("#ifndef SCSI_ASCQ_TBL_C_INCLUDED\n") > OUTFILE;
printf("#define SCSI_ASCQ_TBL_C_INCLUDED\n") >> OUTFILE;
printf("\n/* AuToMaGiCaLlY generated from: %s'"${FIN}"'%s\n", DQ, DQ) >> OUTFILE;
printf(" *******************************************************************************\n") >> OUTFILE;
for (i=1; i<=hdrs; i++) {
printf(" * %s\n", header_line[i]) >> OUTFILE;
}
printf(" */\n") >> OUTFILE;
printf("\n") >> OUTFILE;
for (i=1; i<=voodoo; i++) {
printf("static char SenseDevTypes%03d[] = %s%s%s;\n", i, DQ, DevTypesIdx[i], DQ) >> OUTFILE;
}
printf("\nstatic ASCQ_Table_t ASCQ_Table[] = {\n") >> OUTFILE;
for (i=1; i<=outcount; i++) {
printf(" {\n") >> OUTFILE;
printf(" 0x%s, 0x%s,\n", ASC[i], ASCQ[i]) >> OUTFILE;
printf(" SenseDevTypes%03d,\n", DEVTYPES[i]) >> OUTFILE;
printf(" %s%s%s\n", DQ, DESCRIP[i], DQ) >> OUTFILE;
printf(" },\n") >> OUTFILE;
}
printf( "};\n\n" ) >> OUTFILE;
printf( "static int ASCQ_TableSize = %d;\n\n", outcount ) >> OUTFILE;
printf( "Total of %d ASC/ASCQ records generated\n", outcount );
printf("\n#endif\n") >> OUTFILE;
close(OUTFILE);
}'
return
}
#*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*#
# main()
if [ $# -lt 1 ]; then
echo "INFO: No input filename supplied - using: $PREF_INFILE" >&2
FIN=$PREF_INFILE
else
FIN="$1"
if [ "$FIN" != "$PREF_INFILE" ]; then
echo "INFO: Ok, I'll try chewing on '$FIN' for SCSI ASC/ASCQ combos..." >&2
fi
shift
fi
cat $FIN | xlate_ascq
exit 0
/*
* linux/drivers/message/fusion/isense.c
* Little linux driver / shim that interfaces with the Fusion MPT
* Linux base driver to provide english readable strings in SCSI
* Error Report logging output. This module implements SCSI-3
* Opcode lookup and a sorted table of SCSI-3 ASC/ASCQ strings.
*
* Copyright (c) 1991-2004 Steven J. Ralston
* Written By: Steven J. Ralston
* (yes I wrote some of the orig. code back in 1991!)
* (mailto:sjralston1@netscape.net)
* (mailto:mpt_linux_developer@lsil.com)
*
* $Id: isense.c,v 1.33 2002/02/27 18:44:19 sralston 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; version 2 of the License.
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.
NO WARRANTY
THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
solely responsible for determining the appropriateness of using and
distributing the Program and assumes all risks associated with its
exercise of rights under this Agreement, including but not limited to
the risks and costs of program errors, damage to or loss of data,
programs or equipment, and unavailability or interruption of operations.
DISCLAIMER OF LIABILITY
NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <asm/io.h>
#define MODULEAUTHOR "Steven J. Ralston"
#define COPYRIGHT "Copyright (c) 2001-2004 " MODULEAUTHOR
#include "mptbase.h"
#include "isense.h"
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
* Private data...
*/
/*
* YIKES! I don't usually #include C source files, but..
* The following #include's pulls in our needed ASCQ_Table[] array,
* ASCQ_TableSz integer, and ScsiOpcodeString[] array!
*/
#include "ascq_tbl.c"
#include "scsiops.c"
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#define my_NAME "SCSI-3 Opcodes & ASC/ASCQ Strings"
#define my_VERSION MPT_LINUX_VERSION_COMMON
#define MYNAM "isense"
MODULE_AUTHOR(MODULEAUTHOR);
MODULE_DESCRIPTION(my_NAME);
MODULE_LICENSE("GPL");
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
int __init isense_init(void)
{
show_mptmod_ver(my_NAME, my_VERSION);
/*
* Install our handler
*/
if (mpt_register_ascqops_strings(&ASCQ_Table[0], ASCQ_TableSize, ScsiOpcodeString) != 1)
{
printk(KERN_ERR MYNAM ": ERROR: Can't register with Fusion MPT base driver!\n");
return -EBUSY;
}
printk(KERN_INFO MYNAM ": Registered SCSI-3 Opcodes & ASC/ASCQ Strings\n");
return 0;
}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
static void isense_exit(void)
{
#ifdef MODULE
mpt_deregister_ascqops_strings();
#endif
printk(KERN_INFO MYNAM ": Deregistered SCSI-3 Opcodes & ASC/ASCQ Strings\n");
}
module_init(isense_init);
module_exit(isense_exit);
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#ifndef ISENSE_H_INCLUDED
#define ISENSE_H_INCLUDED
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#ifdef __KERNEL__
#include <linux/types.h> /* needed for u8, etc. */
#include <linux/string.h> /* needed for strcat */
#include <linux/kernel.h> /* needed for sprintf */
#else
#ifndef U_STUFF_DEFINED
#define U_STUFF_DEFINED
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
#endif
#endif
#include "scsi3.h" /* needed for all things SCSI */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
* Defines and typedefs...
*/
#ifdef __KERNEL__
#define PrintF(x) printk x
#else
#define PrintF(x) printf x
#endif
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#define RETRY_STATUS ((int) 1)
#define PUT_STATUS ((int) 0)
/*
* A generic structure to hold info about IO request that caused
* a Request Sense to be performed, and the resulting Sense Data.
*/
typedef struct IO_Info
{
char *DevIDStr; /* String of chars which identifies the device. */
u8 *cdbPtr; /* Pointer (Virtual/Logical addr) to CDB bytes of
IO request that caused ContAllegianceCond. */
u8 *sensePtr; /* Pointer (Virtual/Logical addr) to Sense Data
returned by Request Sense operation. */
u8 *dataPtr; /* Pointer (Virtual/Logical addr) to Data buffer
of IO request caused ContAllegianceCondition. */
u8 *inqPtr; /* Pointer (Virtual/Logical addr) to Inquiry Data for
IO *Device* that caused ContAllegianceCondition. */
u8 SCSIStatus; /* SCSI status byte of IO request that caused
Contingent Allegiance Condition. */
u8 DoDisplay; /* Shall we display any messages? */
u16 rsvd_align1;
u32 ComplCode; /* Four-byte OS-dependent completion code. */
u32 NotifyL; /* Four-byte OS-dependent notification field. */
} IO_Info_t;
/*
* SCSI Additional Sense Code and Additional Sense Code Qualifier table.
*/
typedef struct ASCQ_Table
{
u8 ASC;
u8 ASCQ;
char *DevTypes;
char *Description;
} ASCQ_Table_t;
#if 0
/*
* SCSI Opcodes table.
*/
typedef struct SCSI_OPS_Table
{
u8 OpCode;
char *DevTypes;
char *ScsiCmndStr;
} SCSI_OPS_Table_t;
#endif
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
* Public entry point prototypes
*/
/* in scsiherr.c, needed by mptscsih.c */
extern int mpt_ScsiHost_ErrorReport(IO_Info_t *ioop);
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#endif
This diff is collapsed.
This diff is collapsed.
...@@ -111,7 +111,6 @@ MODULE_LICENSE("GPL"); ...@@ -111,7 +111,6 @@ MODULE_LICENSE("GPL");
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
static int mptctl_id = -1; static int mptctl_id = -1;
static struct semaphore mptctl_syscall_sem_ioc[MPT_MAX_ADAPTERS];
static DECLARE_WAIT_QUEUE_HEAD ( mptctl_wait ); static DECLARE_WAIT_QUEUE_HEAD ( mptctl_wait );
...@@ -140,6 +139,9 @@ static int mptctl_do_reset(unsigned long arg); ...@@ -140,6 +139,9 @@ static int mptctl_do_reset(unsigned long arg);
static int mptctl_hp_hostinfo(unsigned long arg, unsigned int cmd); static int mptctl_hp_hostinfo(unsigned long arg, unsigned int cmd);
static int mptctl_hp_targetinfo(unsigned long arg); static int mptctl_hp_targetinfo(unsigned long arg);
static int mptctl_probe(struct pci_dev *, const struct pci_device_id *);
static void mptctl_remove(struct pci_dev *);
/* /*
* Private function calls. * Private function calls.
*/ */
...@@ -208,10 +210,10 @@ mptctl_syscall_down(MPT_ADAPTER *ioc, int nonblock) ...@@ -208,10 +210,10 @@ mptctl_syscall_down(MPT_ADAPTER *ioc, int nonblock)
} }
if (nonblock) { if (nonblock) {
if (down_trylock(&mptctl_syscall_sem_ioc[ioc->id])) if (down_trylock(&ioc->ioctl->sem_ioc))
rc = -EAGAIN; rc = -EAGAIN;
} else { } else {
if (down_interruptible(&mptctl_syscall_sem_ioc[ioc->id])) if (down_interruptible(&ioc->ioctl->sem_ioc))
rc = -ERESTARTSYS; rc = -ERESTARTSYS;
} }
dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down return %d\n", rc)); dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down return %d\n", rc));
...@@ -445,7 +447,7 @@ static int mptctl_bus_reset(MPT_IOCTL *ioctl) ...@@ -445,7 +447,7 @@ static int mptctl_bus_reset(MPT_IOCTL *ioctl)
mptctl_free_tm_flags(ioctl->ioc); mptctl_free_tm_flags(ioctl->ioc);
del_timer(&ioctl->TMtimer); del_timer(&ioctl->TMtimer);
mpt_free_msg_frame(mptctl_id, ioctl->ioc, mf); mpt_free_msg_frame(ioctl->ioc, mf);
ioctl->tmPtr = NULL; ioctl->tmPtr = NULL;
} }
...@@ -482,7 +484,7 @@ mptctl_free_tm_flags(MPT_ADAPTER *ioc) ...@@ -482,7 +484,7 @@ mptctl_free_tm_flags(MPT_ADAPTER *ioc)
spin_lock_irqsave(&ioc->FreeQlock, flags); spin_lock_irqsave(&ioc->FreeQlock, flags);
hd->tmState = TM_STATE_ERROR; hd->tmState = TM_STATE_NONE;
hd->tmPending = 0; hd->tmPending = 0;
spin_unlock_irqrestore(&ioc->FreeQlock, flags); spin_unlock_irqrestore(&ioc->FreeQlock, flags);
...@@ -520,7 +522,7 @@ mptctl_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) ...@@ -520,7 +522,7 @@ mptctl_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
if (ioctl && (ioctl->status & MPT_IOCTL_STATUS_TMTIMER_ACTIVE)){ if (ioctl && (ioctl->status & MPT_IOCTL_STATUS_TMTIMER_ACTIVE)){
ioctl->status &= ~MPT_IOCTL_STATUS_TMTIMER_ACTIVE; ioctl->status &= ~MPT_IOCTL_STATUS_TMTIMER_ACTIVE;
del_timer(&ioctl->TMtimer); del_timer(&ioctl->TMtimer);
mpt_free_msg_frame(mptctl_id, ioc, ioctl->tmPtr); mpt_free_msg_frame(ioc, ioctl->tmPtr);
} }
} else { } else {
...@@ -630,8 +632,7 @@ mptctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned ...@@ -630,8 +632,7 @@ mptctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
else else
ret = -EINVAL; ret = -EINVAL;
up(&iocp->ioctl->sem_ioc);
up(&mptctl_syscall_sem_ioc[iocp->id]);
return ret; return ret;
} }
...@@ -1807,7 +1808,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) ...@@ -1807,7 +1808,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
struct buflist bufOut; /* data Out buffer */ struct buflist bufOut; /* data Out buffer */
dma_addr_t dma_addr_in; dma_addr_t dma_addr_in;
dma_addr_t dma_addr_out; dma_addr_t dma_addr_out;
int dir; /* PCI data direction */
int sgSize = 0; /* Num SG elements */ int sgSize = 0; /* Num SG elements */
int iocnum, flagsLength; int iocnum, flagsLength;
int sz, rc = 0; int sz, rc = 0;
...@@ -2117,9 +2117,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) ...@@ -2117,9 +2117,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
/* Set up the dataOut memory allocation */ /* Set up the dataOut memory allocation */
if (karg.dataOutSize > 0) { if (karg.dataOutSize > 0) {
dir = PCI_DMA_TODEVICE;
if (karg.dataInSize > 0) { if (karg.dataInSize > 0) {
flagsLength = ( MPI_SGE_FLAGS_SIMPLE_ELEMENT | flagsLength = ( MPI_SGE_FLAGS_SIMPLE_ELEMENT |
MPI_SGE_FLAGS_END_OF_BUFFER |
MPI_SGE_FLAGS_DIRECTION | MPI_SGE_FLAGS_DIRECTION |
mpt_addr_size() ) mpt_addr_size() )
<< MPI_SGE_FLAGS_SHIFT; << MPI_SGE_FLAGS_SHIFT;
...@@ -2158,7 +2158,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) ...@@ -2158,7 +2158,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
} }
if (karg.dataInSize > 0) { if (karg.dataInSize > 0) {
dir = PCI_DMA_FROMDEVICE;
flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ; flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ;
flagsLength |= karg.dataInSize; flagsLength |= karg.dataInSize;
...@@ -2196,6 +2195,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) ...@@ -2196,6 +2195,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
add_timer(&ioc->ioctl->timer); add_timer(&ioc->ioctl->timer);
if (hdr->Function == MPI_FUNCTION_SCSI_TASK_MGMT) { if (hdr->Function == MPI_FUNCTION_SCSI_TASK_MGMT) {
DBG_DUMP_TM_REQUEST_FRAME((u32 *)mf);
rc = mpt_send_handshake_request(mptctl_id, ioc, rc = mpt_send_handshake_request(mptctl_id, ioc,
sizeof(SCSITaskMgmt_t), (u32*)mf, CAN_SLEEP); sizeof(SCSITaskMgmt_t), (u32*)mf, CAN_SLEEP);
if (rc == 0) { if (rc == 0) {
...@@ -2206,7 +2206,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) ...@@ -2206,7 +2206,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
del_timer(&ioc->ioctl->timer); del_timer(&ioc->ioctl->timer);
ioc->ioctl->status &= ~MPT_IOCTL_STATUS_TIMER_ACTIVE; ioc->ioctl->status &= ~MPT_IOCTL_STATUS_TIMER_ACTIVE;
ioc->ioctl->status |= MPT_IOCTL_STATUS_TM_FAILED; ioc->ioctl->status |= MPT_IOCTL_STATUS_TM_FAILED;
mpt_free_msg_frame(mptctl_id, ioc, mf); mpt_free_msg_frame(ioc, mf);
} }
} else { } else {
mpt_put_msg_frame(mptctl_id, ioc, mf); mpt_put_msg_frame(mptctl_id, ioc, mf);
...@@ -2324,7 +2324,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) ...@@ -2324,7 +2324,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
* otherwise, failure occured after mf acquired. * otherwise, failure occured after mf acquired.
*/ */
if (mf) if (mf)
mpt_free_msg_frame(mptctl_id, ioc, mf); mpt_free_msg_frame(ioc, mf);
return rc; return rc;
} }
...@@ -2738,7 +2738,7 @@ compat_mptfwxfer_ioctl(unsigned int fd, unsigned int cmd, ...@@ -2738,7 +2738,7 @@ compat_mptfwxfer_ioctl(unsigned int fd, unsigned int cmd,
ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen); ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen);
up(&mptctl_syscall_sem_ioc[iocp->id]); up(&iocp->ioctl->sem_ioc);
return ret; return ret;
} }
...@@ -2792,36 +2792,32 @@ compat_mpt_command(unsigned int fd, unsigned int cmd, ...@@ -2792,36 +2792,32 @@ compat_mpt_command(unsigned int fd, unsigned int cmd,
*/ */
ret = mptctl_do_mpt_command (karg, &uarg->MF); ret = mptctl_do_mpt_command (karg, &uarg->MF);
up(&mptctl_syscall_sem_ioc[iocp->id]); up(&iocp->ioctl->sem_ioc);
return ret; return ret;
} }
#endif #endif
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
int __init mptctl_init(void) /*
* mptctl_probe - Installs ioctl devices per bus.
* @pdev: Pointer to pci_dev structure
*
* Returns 0 for success, non-zero for failure.
*
*/
static int
mptctl_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{ {
int err; int err;
int i;
int where = 1;
int sz; int sz;
u8 *mem; u8 *mem;
MPT_ADAPTER *ioc = NULL; MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
int iocnum;
show_mptmod_ver(my_NAME, my_VERSION); /*
for (i=0; i<MPT_MAX_ADAPTERS; i++) {
sema_init(&mptctl_syscall_sem_ioc[i], 1);
ioc = NULL;
if (((iocnum = mpt_verify_adapter(i, &ioc)) < 0) ||
(ioc == NULL)) {
continue;
}
else {
/* This adapter instance is found.
* Allocate and inite a MPT_IOCTL structure * Allocate and inite a MPT_IOCTL structure
*/ */
sz = sizeof (MPT_IOCTL); sz = sizeof (MPT_IOCTL);
...@@ -2840,7 +2836,47 @@ int __init mptctl_init(void) ...@@ -2840,7 +2836,47 @@ int __init mptctl_init(void)
init_timer (&ioc->ioctl->TMtimer); init_timer (&ioc->ioctl->TMtimer);
ioc->ioctl->TMtimer.data = (unsigned long) ioc->ioctl; ioc->ioctl->TMtimer.data = (unsigned long) ioc->ioctl;
ioc->ioctl->TMtimer.function = mptctl_timer_expired; ioc->ioctl->TMtimer.function = mptctl_timer_expired;
} sema_init(&ioc->ioctl->sem_ioc, 1);
return 0;
out_fail:
mptctl_remove(pdev);
return err;
}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
* mptctl_remove - Removed ioctl devices
* @pdev: Pointer to pci_dev structure
*
*
*/
static void
mptctl_remove(struct pci_dev *pdev)
{
MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
kfree ( ioc->ioctl );
}
static struct mpt_pci_driver mptctl_driver = {
.probe = mptctl_probe,
.remove = mptctl_remove,
};
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
static int __init mptctl_init(void)
{
int err;
int where = 1;
show_mptmod_ver(my_NAME, my_VERSION);
if(mpt_device_driver_register(&mptctl_driver,
MPTCTL_DRIVER) != 0 ) {
dprintk((KERN_INFO MYNAM
": failed to register dd callbacks\n"));
} }
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
...@@ -2922,29 +2958,14 @@ int __init mptctl_init(void) ...@@ -2922,29 +2958,14 @@ int __init mptctl_init(void)
unregister_ioctl32_conversion(HP_GETTARGETINFO); unregister_ioctl32_conversion(HP_GETTARGETINFO);
#endif #endif
for (i=0; i<MPT_MAX_ADAPTERS; i++) { mpt_device_driver_deregister(MPTCTL_DRIVER);
ioc = NULL;
if (((iocnum = mpt_verify_adapter(i, &ioc)) < 0) ||
(ioc == NULL)) {
continue;
}
else {
if (ioc->ioctl) {
kfree ( ioc->ioctl );
ioc->ioctl = NULL;
}
}
}
return err; return err;
} }
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
void mptctl_exit(void) static void mptctl_exit(void)
{ {
int i;
MPT_ADAPTER *ioc;
int iocnum;
misc_deregister(&mptctl_miscdev); misc_deregister(&mptctl_miscdev);
printk(KERN_INFO MYNAM ": Deregistered /dev/%s @ (major,minor=%d,%d)\n", printk(KERN_INFO MYNAM ": Deregistered /dev/%s @ (major,minor=%d,%d)\n",
mptctl_miscdev.name, MISC_MAJOR, mptctl_miscdev.minor); mptctl_miscdev.name, MISC_MAJOR, mptctl_miscdev.minor);
...@@ -2957,6 +2978,8 @@ void mptctl_exit(void) ...@@ -2957,6 +2978,8 @@ void mptctl_exit(void)
mpt_deregister(mptctl_id); mpt_deregister(mptctl_id);
printk(KERN_INFO MYNAM ": Deregistered from Fusion MPT base driver\n"); printk(KERN_INFO MYNAM ": Deregistered from Fusion MPT base driver\n");
mpt_device_driver_deregister(MPTCTL_DRIVER);
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
unregister_ioctl32_conversion(MPTIOCINFO); unregister_ioctl32_conversion(MPTIOCINFO);
unregister_ioctl32_conversion(MPTIOCINFO1); unregister_ioctl32_conversion(MPTIOCINFO1);
...@@ -2973,20 +2996,6 @@ void mptctl_exit(void) ...@@ -2973,20 +2996,6 @@ void mptctl_exit(void)
unregister_ioctl32_conversion(HP_GETTARGETINFO); unregister_ioctl32_conversion(HP_GETTARGETINFO);
#endif #endif
/* Free allocated memory */
for (i=0; i<MPT_MAX_ADAPTERS; i++) {
ioc = NULL;
if (((iocnum = mpt_verify_adapter(i, &ioc)) < 0) ||
(ioc == NULL)) {
continue;
}
else {
if (ioc->ioctl) {
kfree ( ioc->ioctl );
ioc->ioctl = NULL;
}
}
}
} }
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# In the future, some of these should be built conditionally. # In the future, some of these should be built conditionally.
# #
i2o_core-y += iop.o driver.o device.o debug.o pci.o exec-osm.o
obj-$(CONFIG_I2O) += i2o_core.o obj-$(CONFIG_I2O) += i2o_core.o
obj-$(CONFIG_I2O_CONFIG)+= i2o_config.o obj-$(CONFIG_I2O_CONFIG)+= i2o_config.o
obj-$(CONFIG_I2O_BLOCK) += i2o_block.o obj-$(CONFIG_I2O_BLOCK) += i2o_block.o
......
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.
...@@ -95,7 +95,8 @@ obj-$(CONFIG_SCSI_IBMMCA) += ibmmca.o ...@@ -95,7 +95,8 @@ 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_MEGARAID) += megaraid.o obj-$(CONFIG_MEGARAID_LEGACY) += megaraid.o
obj-$(CONFIG_MEGARAID_NEWGEN) += megaraid/
obj-$(CONFIG_SCSI_ACARD) += atp870u.o obj-$(CONFIG_SCSI_ACARD) += atp870u.o
obj-$(CONFIG_SCSI_SUNESP) += esp.o obj-$(CONFIG_SCSI_SUNESP) += esp.o
obj-$(CONFIG_SCSI_GDTH) += gdth.o obj-$(CONFIG_SCSI_GDTH) += gdth.o
...@@ -119,6 +120,7 @@ obj-$(CONFIG_SCSI_CPQFCTS) += cpqfc.o ...@@ -119,6 +120,7 @@ obj-$(CONFIG_SCSI_CPQFCTS) += cpqfc.o
obj-$(CONFIG_SCSI_LASI700) += 53c700.o lasi700.o obj-$(CONFIG_SCSI_LASI700) += 53c700.o lasi700.o
obj-$(CONFIG_SCSI_NSP32) += nsp32.o obj-$(CONFIG_SCSI_NSP32) += nsp32.o
obj-$(CONFIG_SCSI_IPR) += ipr.o obj-$(CONFIG_SCSI_IPR) += ipr.o
obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi/
obj-$(CONFIG_SCSI_SATA_SVW) += libata.o sata_svw.o obj-$(CONFIG_SCSI_SATA_SVW) += libata.o sata_svw.o
obj-$(CONFIG_SCSI_ATA_PIIX) += libata.o ata_piix.o obj-$(CONFIG_SCSI_ATA_PIIX) += libata.o ata_piix.o
obj-$(CONFIG_SCSI_SATA_PROMISE) += libata.o sata_promise.o obj-$(CONFIG_SCSI_SATA_PROMISE) += libata.o sata_promise.o
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -480,7 +480,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) ...@@ -480,7 +480,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
default: default:
data_dir = DMA_NONE; data_dir = DMA_NONE;
} }
if (dev->pae_support == 1) { if (dev->dac_support == 1) {
struct sgmap64* psg = (struct sgmap64*)&srbcmd->sg; struct sgmap64* psg = (struct sgmap64*)&srbcmd->sg;
byte_count = 0; byte_count = 0;
......
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.
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.
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