提交 97d41e90 编写于 作者: L Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (54 commits)
  [SCSI] Initial Commit of qla4xxx
  [SCSI] raid class: handle component-add errors
  [SCSI] SCSI megaraid_sas: handle thrown errors
  [SCSI] SCSI aic94xx: handle sysfs errors
  [SCSI] SCSI st: fix error handling in module init, sysfs
  [SCSI] SCSI sd: fix module init/exit error handling
  [SCSI] SCSI osst: add error handling to module init, sysfs
  [SCSI] scsi: remove hosts.h
  [SCSI] scsi: Scsi_Cmnd convertion in aic7xxx_old.c
  [SCSI] megaraid_sas: sets ioctl timeout and updates version,changelog
  [SCSI] megaraid_sas: adds tasklet for cmd completion
  [SCSI] megaraid_sas: prints pending cmds before setting hw_crit_error
  [SCSI] megaraid_sas: function pointer for disable interrupt
  [SCSI] megaraid_sas: frame count optimization
  [SCSI] megaraid_sas: FW transition and q size changes
  [SCSI] qla2xxx: Update version number to 8.01.07-k2.
  [SCSI] qla2xxx: Stall mid-layer error handlers while rport is blocked.
  [SCSI] qla2xxx: Add MODULE_FIRMWARE tags.
  [SCSI] qla2xxx: Add support for host port state FC transport attribute.
  [SCSI] qla2xxx: Add support for fabric name FC transport attribute.
  ...
1 Release Date : Mon Oct 02 11:21:32 PDT 2006 - Sumant Patro <Sumant.Patro@lsil.com>
2 Current Version : 00.00.03.05
3 Older Version : 00.00.03.04
i. PCI_DEVICE macro used
Convert the pci_device_id-table of the megaraid_sas-driver to the PCI_DEVICE-macro, to safe some lines.
- Henrik Kretzschmar <henne@nachtwindheim.de>
ii. All compiler warnings removed
iii. megasas_ctrl_info struct reverted to 3.02 release
iv. Default value of megasas_dbg_lvl set to 0
v. Removing in megasas_exit the sysfs entry created for megasas_dbg_lvl
vi. In megasas_teardown_frame_pool(), cmd->frame was passed instead of
cmd->sense to pci_pool_free. Fixed. Bug was pointed out by
Eric Sesterhenn
1 Release Date : Wed Sep 13 14:22:51 PDT 2006 - Sumant Patro <Sumant.Patro@lsil.com>
2 Current Version : 00.00.03.04
3 Older Version : 00.00.03.03
i. Added Reboot notify
ii. Reduced by 1 max cmds sent to FW from Driver to make the reply_q_sz same
as Max Cmds FW can support
1 Release Date : Tue Aug 22 16:33:14 PDT 2006 - Sumant Patro <Sumant.Patro@lsil.com>
2 Current Version : 00.00.03.03
3 Older Version : 00.00.03.02
i. Send stop adapter to FW & Dump pending FW cmds before declaring adapter dead.
New varible added to set dbg level.
ii. Disable interrupt made as fn pointer as they are different for 1068 / 1078
iii. Frame count optimization. Main frame can contain 2 SGE for 64 bit SGLs and
3 SGE for 32 bit SGL
iv. Tasklet added for cmd completion
v. If FW in operational state before firing INIT, now we send RESET Flag to FW instead of just READY. This is used to do soft reset.
vi. megasas_ctrl_prop structure updated (based on FW struct)
vii. Added print : FW now in Ready State during initialization
1 Release Date : Sun Aug 06 22:49:52 PDT 2006 - Sumant Patro <Sumant.Patro@lsil.com>
2 Current Version : 00.00.03.02
3 Older Version : 00.00.03.01
i. Added FW tranistion state for Hotplug scenario
1 Release Date : Sun May 14 22:49:52 PDT 2006 - Sumant Patro <Sumant.Patro@lsil.com>
2 Current Version : 00.00.03.01
3 Older Version : 00.00.02.04
......
......@@ -6,13 +6,4 @@
#include <linux/version.h>
#include <scsi/scsi_device.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,6))
static int inline scsi_device_online(struct scsi_device *sdev)
{
return sdev->online;
}
#endif
/*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#endif /* _LINUX_COMPAT_H */
......@@ -2211,7 +2211,7 @@ static int __init twa_init(void)
{
printk(KERN_WARNING "3ware 9000 Storage Controller device driver for Linux v%s.\n", TW_DRIVER_VERSION);
return pci_module_init(&twa_driver);
return pci_register_driver(&twa_driver);
} /* End twa_init() */
/* This function is called on driver exit */
......
......@@ -2486,7 +2486,7 @@ static int __init tw_init(void)
{
printk(KERN_WARNING "3ware Storage Controller device driver for Linux v%s.\n", TW_DRIVER_VERSION);
return pci_module_init(&tw_driver);
return pci_register_driver(&tw_driver);
} /* End tw_init() */
/* This function is called on driver exit */
......
......@@ -74,7 +74,7 @@ static char *tw_aen_string[] = {
[0x00D] = "ERROR: Logical unit deleted: Unit #",
[0x00F] = "WARNING: SMART threshold exceeded: Port #",
[0x021] = "WARNING: ATA UDMA downgrade: Port #",
[0x021] = "WARNING: ATA UDMA upgrade: Port #",
[0x022] = "WARNING: ATA UDMA upgrade: Port #",
[0x023] = "WARNING: Sector repair occurred: Port #",
[0x024] = "ERROR: SBUF integrity check failure",
[0x025] = "ERROR: Lost cached write: Port #",
......
......@@ -1016,7 +1016,7 @@ config SCSI_SYM53C8XX_MMIO
config SCSI_IPR
tristate "IBM Power Linux RAID adapter support"
depends on PCI && SCSI
depends on PCI && SCSI && ATA
select FW_LOADER
---help---
This driver supports the IBM Power Linux family RAID adapters.
......@@ -1246,6 +1246,7 @@ config SCSI_QLOGICPTI
module will be called qlogicpti.
source "drivers/scsi/qla2xxx/Kconfig"
source "drivers/scsi/qla4xxx/Kconfig"
config SCSI_LPFC
tristate "Emulex LightPulse Fibre Channel Support"
......@@ -1262,8 +1263,8 @@ config SCSI_SEAGATE
These are 8-bit SCSI controllers; the ST-01 is also supported by
this driver. It is explained in section 3.9 of the SCSI-HOWTO,
available from <http://www.tldp.org/docs.html#howto>. If it
doesn't work out of the box, you may have to change some settings in
<file:drivers/scsi/seagate.h>.
doesn't work out of the box, you may have to change some macros at
compiletime, which are described in <file:drivers/scsi/seagate.c>.
To compile this driver as a module, choose M here: the
module will be called seagate.
......
......@@ -84,6 +84,7 @@ obj-$(CONFIG_SCSI_QLOGIC_FAS) += qlogicfas408.o qlogicfas.o
obj-$(CONFIG_PCMCIA_QLOGIC) += qlogicfas408.o
obj-$(CONFIG_SCSI_QLOGIC_1280) += qla1280.o
obj-$(CONFIG_SCSI_QLA_FC) += qla2xxx/
obj-$(CONFIG_SCSI_QLA_ISCSI) += qla4xxx/
obj-$(CONFIG_SCSI_LPFC) += lpfc/
obj-$(CONFIG_SCSI_PAS16) += pas16.o
obj-$(CONFIG_SCSI_SEAGATE) += seagate.o
......
......@@ -1187,7 +1187,7 @@ static struct pci_driver inia100_pci_driver = {
static int __init inia100_init(void)
{
return pci_module_init(&inia100_pci_driver);
return pci_register_driver(&inia100_pci_driver);
}
static void __exit inia100_exit(void)
......
......@@ -527,7 +527,8 @@ ahd_inw(struct ahd_softc *ahd, u_int port)
* or have other side effects when the low byte is
* read.
*/
return ((ahd_inb(ahd, port+1) << 8) | ahd_inb(ahd, port));
uint16_t r = ahd_inb(ahd, port+1) << 8;
return r | ahd_inb(ahd, port);
}
static __inline void
......
......@@ -198,7 +198,7 @@ ahd_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
int
ahd_linux_pci_init(void)
{
return (pci_module_init(&aic79xx_pci_driver));
return pci_register_driver(&aic79xx_pci_driver);
}
void
......
......@@ -300,7 +300,8 @@ ahc_fetch_transinfo(struct ahc_softc *ahc, char channel, u_int our_id,
static __inline uint16_t
ahc_inw(struct ahc_softc *ahc, u_int port)
{
return ((ahc_inb(ahc, port+1) << 8) | ahc_inb(ahc, port));
uint16_t r = ahc_inb(ahc, port+1) << 8;
return r | ahc_inb(ahc, port);
}
static __inline void
......
......@@ -246,8 +246,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
int
ahc_linux_pci_init(void)
{
/* Translate error or zero return into zero or one */
return pci_module_init(&aic7xxx_pci_driver) ? 0 : 1;
return pci_register_driver(&aic7xxx_pci_driver);
}
void
......
......@@ -780,24 +780,26 @@ typedef enum {
} ahc_bugs;
struct aic7xxx_scb {
struct aic7xxx_hwscb *hscb; /* corresponding hardware scb */
Scsi_Cmnd *cmd; /* Scsi_Cmnd for this scb */
struct aic7xxx_scb *q_next; /* next scb in queue */
volatile scb_flag_type flags; /* current state of scb */
struct hw_scatterlist *sg_list; /* SG list in adapter format */
unsigned char tag_action;
unsigned char sg_count;
unsigned char *sense_cmd; /*
* Allocate 6 characters for
* sense command.
*/
unsigned char *cmnd;
unsigned int sg_length; /* We init this during buildscb so we
* don't have to calculate anything
* during underflow/overflow/stat code
*/
void *kmalloc_ptr;
struct aic7xxx_scb_dma *scb_dma;
struct aic7xxx_hwscb *hscb; /* corresponding hardware scb */
struct scsi_cmnd *cmd; /* scsi_cmnd for this scb */
struct aic7xxx_scb *q_next; /* next scb in queue */
volatile scb_flag_type flags; /* current state of scb */
struct hw_scatterlist *sg_list; /* SG list in adapter format */
unsigned char tag_action;
unsigned char sg_count;
unsigned char *sense_cmd; /*
* Allocate 6 characters for
* sense command.
*/
unsigned char *cmnd;
unsigned int sg_length; /*
* We init this during
* buildscb so we don't have
* to calculate anything during
* underflow/overflow/stat code
*/
void *kmalloc_ptr;
struct aic7xxx_scb_dma *scb_dma;
};
/*
......@@ -918,79 +920,77 @@ struct aic7xxx_host {
* We are grouping things here....first, items that get either read or
* written with nearly every interrupt
*/
volatile long flags;
ahc_feature features; /* chip features */
unsigned long base; /* card base address */
volatile unsigned char __iomem *maddr; /* memory mapped address */
unsigned long isr_count; /* Interrupt count */
unsigned long spurious_int;
scb_data_type *scb_data;
struct aic7xxx_cmd_queue {
Scsi_Cmnd *head;
Scsi_Cmnd *tail;
} completeq;
volatile long flags;
ahc_feature features; /* chip features */
unsigned long base; /* card base address */
volatile unsigned char __iomem *maddr; /* memory mapped address */
unsigned long isr_count; /* Interrupt count */
unsigned long spurious_int;
scb_data_type *scb_data;
struct aic7xxx_cmd_queue {
struct scsi_cmnd *head;
struct scsi_cmnd *tail;
} completeq;
/*
* Things read/written on nearly every entry into aic7xxx_queue()
*/
volatile scb_queue_type waiting_scbs;
unsigned char unpause; /* unpause value for HCNTRL */
unsigned char pause; /* pause value for HCNTRL */
volatile unsigned char qoutfifonext;
volatile unsigned char activescbs; /* active scbs */
volatile unsigned char max_activescbs;
volatile unsigned char qinfifonext;
volatile unsigned char *untagged_scbs;
volatile unsigned char *qoutfifo;
volatile unsigned char *qinfifo;
unsigned char dev_last_queue_full[MAX_TARGETS];
unsigned char dev_last_queue_full_count[MAX_TARGETS];
unsigned short ultraenb; /* Gets downloaded to card as a
bitmap */
unsigned short discenable; /* Gets downloaded to card as a
bitmap */
transinfo_type user[MAX_TARGETS];
unsigned char msg_buf[13]; /* The message for the target */
unsigned char msg_type;
/*
* Things read/written on nearly every entry into aic7xxx_queue()
*/
volatile scb_queue_type waiting_scbs;
unsigned char unpause; /* unpause value for HCNTRL */
unsigned char pause; /* pause value for HCNTRL */
volatile unsigned char qoutfifonext;
volatile unsigned char activescbs; /* active scbs */
volatile unsigned char max_activescbs;
volatile unsigned char qinfifonext;
volatile unsigned char *untagged_scbs;
volatile unsigned char *qoutfifo;
volatile unsigned char *qinfifo;
unsigned char dev_last_queue_full[MAX_TARGETS];
unsigned char dev_last_queue_full_count[MAX_TARGETS];
unsigned short ultraenb; /* Gets downloaded to card as a bitmap */
unsigned short discenable; /* Gets downloaded to card as a bitmap */
transinfo_type user[MAX_TARGETS];
unsigned char msg_buf[13]; /* The message for the target */
unsigned char msg_type;
#define MSG_TYPE_NONE 0x00
#define MSG_TYPE_INITIATOR_MSGOUT 0x01
#define MSG_TYPE_INITIATOR_MSGIN 0x02
unsigned char msg_len; /* Length of message */
unsigned char msg_index; /* Index into msg_buf array */
unsigned char msg_len; /* Length of message */
unsigned char msg_index; /* Index into msg_buf array */
/*
* We put the less frequently used host structure items after the more
* frequently used items to try and ease the burden on the cache subsystem.
* These entries are not *commonly* accessed, whereas the preceding entries
* are accessed very often.
*/
unsigned int irq; /* IRQ for this adapter */
int instance; /* aic7xxx instance number */
int scsi_id; /* host adapter SCSI ID */
int scsi_id_b; /* channel B for twin adapters */
unsigned int bios_address;
int board_name_index;
unsigned short bios_control; /* bios control - SEEPROM */
unsigned short adapter_control; /* adapter control - SEEPROM */
struct pci_dev *pdev;
unsigned char pci_bus;
unsigned char pci_device_fn;
struct seeprom_config sc;
unsigned short sc_type;
unsigned short sc_size;
struct aic7xxx_host *next; /* allow for multiple IRQs */
struct Scsi_Host *host; /* pointer to scsi host */
struct list_head aic_devs; /* all aic_dev structs on host */
int host_no; /* SCSI host number */
unsigned long mbase; /* I/O memory address */
ahc_chip chip; /* chip type */
ahc_bugs bugs;
dma_addr_t fifo_dma; /* DMA handle for fifo arrays */
/*
* We put the less frequently used host structure items
* after the more frequently used items to try and ease
* the burden on the cache subsystem.
* These entries are not *commonly* accessed, whereas
* the preceding entries are accessed very often.
*/
unsigned int irq; /* IRQ for this adapter */
int instance; /* aic7xxx instance number */
int scsi_id; /* host adapter SCSI ID */
int scsi_id_b; /* channel B for twin adapters */
unsigned int bios_address;
int board_name_index;
unsigned short bios_control; /* bios control - SEEPROM */
unsigned short adapter_control; /* adapter control - SEEPROM */
struct pci_dev *pdev;
unsigned char pci_bus;
unsigned char pci_device_fn;
struct seeprom_config sc;
unsigned short sc_type;
unsigned short sc_size;
struct aic7xxx_host *next; /* allow for multiple IRQs */
struct Scsi_Host *host; /* pointer to scsi host */
struct list_head aic_devs; /* all aic_dev structs on host */
int host_no; /* SCSI host number */
unsigned long mbase; /* I/O memory address */
ahc_chip chip; /* chip type */
ahc_bugs bugs;
dma_addr_t fifo_dma; /* DMA handle for fifo arrays */
};
/*
......@@ -1271,7 +1271,7 @@ static void aic7xxx_set_syncrate(struct aic7xxx_host *p,
static void aic7xxx_set_width(struct aic7xxx_host *p, int target, int channel,
int lun, unsigned int width, unsigned int type,
struct aic_dev_data *aic_dev);
static void aic7xxx_panic_abort(struct aic7xxx_host *p, Scsi_Cmnd *cmd);
static void aic7xxx_panic_abort(struct aic7xxx_host *p, struct scsi_cmnd *cmd);
static void aic7xxx_print_card(struct aic7xxx_host *p);
static void aic7xxx_print_scratch_ram(struct aic7xxx_host *p);
static void aic7xxx_print_sequencer(struct aic7xxx_host *p, int downloaded);
......@@ -2626,7 +2626,7 @@ aic7xxx_allocate_scb(struct aic7xxx_host *p)
* we're finished. This function queues the completed commands.
*-F*************************************************************************/
static void
aic7xxx_queue_cmd_complete(struct aic7xxx_host *p, Scsi_Cmnd *cmd)
aic7xxx_queue_cmd_complete(struct aic7xxx_host *p, struct scsi_cmnd *cmd)
{
aic7xxx_position(cmd) = SCB_LIST_NULL;
cmd->host_scribble = (char *)p->completeq.head;
......@@ -2640,18 +2640,16 @@ aic7xxx_queue_cmd_complete(struct aic7xxx_host *p, Scsi_Cmnd *cmd)
* Description:
* Process the completed command queue.
*-F*************************************************************************/
static void
aic7xxx_done_cmds_complete(struct aic7xxx_host *p)
static void aic7xxx_done_cmds_complete(struct aic7xxx_host *p)
{
Scsi_Cmnd *cmd;
while (p->completeq.head != NULL)
{
cmd = p->completeq.head;
p->completeq.head = (Scsi_Cmnd *)cmd->host_scribble;
cmd->host_scribble = NULL;
cmd->scsi_done(cmd);
}
struct scsi_cmnd *cmd;
while (p->completeq.head != NULL) {
cmd = p->completeq.head;
p->completeq.head = (struct scsi_Cmnd *) cmd->host_scribble;
cmd->host_scribble = NULL;
cmd->scsi_done(cmd);
}
}
/*+F*************************************************************************
......@@ -2687,11 +2685,11 @@ aic7xxx_free_scb(struct aic7xxx_host *p, struct aic7xxx_scb *scb)
static void
aic7xxx_done(struct aic7xxx_host *p, struct aic7xxx_scb *scb)
{
Scsi_Cmnd *cmd = scb->cmd;
struct aic_dev_data *aic_dev = cmd->device->hostdata;
int tindex = TARGET_INDEX(cmd);
struct aic7xxx_scb *scbp;
unsigned char queue_depth;
struct scsi_cmnd *cmd = scb->cmd;
struct aic_dev_data *aic_dev = cmd->device->hostdata;
int tindex = TARGET_INDEX(cmd);
struct aic7xxx_scb *scbp;
unsigned char queue_depth;
if (cmd->use_sg > 1)
{
......@@ -2891,7 +2889,7 @@ aic7xxx_done(struct aic7xxx_host *p, struct aic7xxx_scb *scb)
* aic7xxx_run_done_queue
*
* Description:
* Calls the aic7xxx_done() for the Scsi_Cmnd of each scb in the
* Calls the aic7xxx_done() for the scsi_cmnd of each scb in the
* aborted list, and adds each scb to the free list. If complete
* is TRUE, we also process the commands complete list.
*-F*************************************************************************/
......@@ -3826,9 +3824,9 @@ aic7xxx_construct_wdtr(struct aic7xxx_host *p, unsigned char bus_width)
static void
aic7xxx_calculate_residual (struct aic7xxx_host *p, struct aic7xxx_scb *scb)
{
struct aic7xxx_hwscb *hscb;
Scsi_Cmnd *cmd;
int actual, i;
struct aic7xxx_hwscb *hscb;
struct scsi_cmnd *cmd;
int actual, i;
cmd = scb->cmd;
hscb = scb->hscb;
......@@ -4219,20 +4217,20 @@ aic7xxx_handle_seqint(struct aic7xxx_host *p, unsigned char intstat)
case BAD_STATUS:
{
unsigned char scb_index;
struct aic7xxx_hwscb *hscb;
Scsi_Cmnd *cmd;
/* The sequencer will notify us when a command has an error that
* would be of interest to the kernel. This allows us to leave
* the sequencer running in the common case of command completes
* without error. The sequencer will have DMA'd the SCB back
* up to us, so we can reference the drivers SCB array.
*
* Set the default return value to 0 indicating not to send
* sense. The sense code will change this if needed and this
* reduces code duplication.
*/
unsigned char scb_index;
struct aic7xxx_hwscb *hscb;
struct scsi_cmnd *cmd;
/* The sequencer will notify us when a command has an error that
* would be of interest to the kernel. This allows us to leave
* the sequencer running in the common case of command completes
* without error. The sequencer will have DMA'd the SCB back
* up to us, so we can reference the drivers SCB array.
*
* Set the default return value to 0 indicating not to send
* sense. The sense code will change this if needed and this
* reduces code duplication.
*/
aic_outb(p, 0, RETURN_1);
scb_index = aic_inb(p, SCB_TAG);
if (scb_index > p->scb_data->numscbs)
......@@ -5800,9 +5798,9 @@ aic7xxx_handle_scsiint(struct aic7xxx_host *p, unsigned char intstat)
}
else if ((status & SELTO) != 0)
{
unsigned char scbptr;
unsigned char nextscb;
Scsi_Cmnd *cmd;
unsigned char scbptr;
unsigned char nextscb;
struct scsi_cmnd *cmd;
scbptr = aic_inb(p, WAITING_SCBH);
if (scbptr > p->scb_data->maxhscbs)
......@@ -5941,11 +5939,11 @@ aic7xxx_handle_scsiint(struct aic7xxx_host *p, unsigned char intstat)
/*
* Determine the bus phase and queue an appropriate message.
*/
char *phase;
Scsi_Cmnd *cmd;
unsigned char mesg_out = MSG_NOOP;
unsigned char lastphase = aic_inb(p, LASTPHASE);
unsigned char sstat2 = aic_inb(p, SSTAT2);
char *phase;
struct scsi_cmnd *cmd;
unsigned char mesg_out = MSG_NOOP;
unsigned char lastphase = aic_inb(p, LASTPHASE);
unsigned char sstat2 = aic_inb(p, SSTAT2);
cmd = scb->cmd;
switch (lastphase)
......@@ -6248,10 +6246,10 @@ aic7xxx_check_scbs(struct aic7xxx_host *p, char *buffer)
static void
aic7xxx_handle_command_completion_intr(struct aic7xxx_host *p)
{
struct aic7xxx_scb *scb = NULL;
struct aic_dev_data *aic_dev;
Scsi_Cmnd *cmd;
unsigned char scb_index, tindex;
struct aic7xxx_scb *scb = NULL;
struct aic_dev_data *aic_dev;
struct scsi_cmnd *cmd;
unsigned char scb_index, tindex;
#ifdef AIC7XXX_VERBOSE_DEBUGGING
if( (p->isr_count < 16) && (aic7xxx_verbose > 0xffff) )
......@@ -10131,9 +10129,8 @@ aic7xxx_detect(struct scsi_host_template *template)
* Description:
* Build a SCB.
*-F*************************************************************************/
static void
aic7xxx_buildscb(struct aic7xxx_host *p, Scsi_Cmnd *cmd,
struct aic7xxx_scb *scb)
static void aic7xxx_buildscb(struct aic7xxx_host *p, struct scsi_cmnd *cmd,
struct aic7xxx_scb *scb)
{
unsigned short mask;
struct aic7xxx_hwscb *hscb;
......@@ -10285,8 +10282,7 @@ aic7xxx_buildscb(struct aic7xxx_host *p, Scsi_Cmnd *cmd,
* Description:
* Queue a SCB to the controller.
*-F*************************************************************************/
static int
aic7xxx_queue(Scsi_Cmnd *cmd, void (*fn)(Scsi_Cmnd *))
static int aic7xxx_queue(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
{
struct aic7xxx_host *p;
struct aic7xxx_scb *scb;
......@@ -10319,11 +10315,11 @@ aic7xxx_queue(Scsi_Cmnd *cmd, void (*fn)(Scsi_Cmnd *))
}
scb->cmd = cmd;
/*
* Make sure the Scsi_Cmnd pointer is saved, the struct it points to
* is set up properly, and the parity error flag is reset, then send
* the SCB to the sequencer and watch the fun begin.
*/
/*
* Make sure the scsi_cmnd pointer is saved, the struct it points to
* is set up properly, and the parity error flag is reset, then send
* the SCB to the sequencer and watch the fun begin.
*/
aic7xxx_position(cmd) = scb->hscb->tag;
cmd->scsi_done = fn;
cmd->result = DID_OK;
......@@ -10356,8 +10352,7 @@ aic7xxx_queue(Scsi_Cmnd *cmd, void (*fn)(Scsi_Cmnd *))
* aborted, then we will reset the channel and have all devices renegotiate.
* Returns an enumerated type that indicates the status of the operation.
*-F*************************************************************************/
static int
__aic7xxx_bus_device_reset(Scsi_Cmnd *cmd)
static int __aic7xxx_bus_device_reset(struct scsi_cmnd *cmd)
{
struct aic7xxx_host *p;
struct aic7xxx_scb *scb;
......@@ -10550,8 +10545,7 @@ __aic7xxx_bus_device_reset(Scsi_Cmnd *cmd)
return SUCCESS;
}
static int
aic7xxx_bus_device_reset(Scsi_Cmnd *cmd)
static int aic7xxx_bus_device_reset(struct scsi_cmnd *cmd)
{
int rc;
......@@ -10570,8 +10564,7 @@ aic7xxx_bus_device_reset(Scsi_Cmnd *cmd)
* Description:
* Abort the current SCSI command(s).
*-F*************************************************************************/
static void
aic7xxx_panic_abort(struct aic7xxx_host *p, Scsi_Cmnd *cmd)
static void aic7xxx_panic_abort(struct aic7xxx_host *p, struct scsi_cmnd *cmd)
{
printk("aic7xxx driver version %s\n", AIC7XXX_C_VERSION);
......@@ -10595,8 +10588,7 @@ aic7xxx_panic_abort(struct aic7xxx_host *p, Scsi_Cmnd *cmd)
* Description:
* Abort the current SCSI command(s).
*-F*************************************************************************/
static int
__aic7xxx_abort(Scsi_Cmnd *cmd)
static int __aic7xxx_abort(struct scsi_cmnd *cmd)
{
struct aic7xxx_scb *scb = NULL;
struct aic7xxx_host *p;
......@@ -10813,8 +10805,7 @@ __aic7xxx_abort(Scsi_Cmnd *cmd)
return SUCCESS;
}
static int
aic7xxx_abort(Scsi_Cmnd *cmd)
static int aic7xxx_abort(struct scsi_cmnd *cmd)
{
int rc;
......@@ -10836,8 +10827,7 @@ aic7xxx_abort(Scsi_Cmnd *cmd)
* DEVICE RESET message - on the offending target before pulling
* the SCSI bus reset line.
*-F*************************************************************************/
static int
aic7xxx_reset(Scsi_Cmnd *cmd)
static int aic7xxx_reset(struct scsi_cmnd *cmd)
{
struct aic7xxx_scb *scb;
struct aic7xxx_host *p;
......
......@@ -28,6 +28,7 @@ config SCSI_AIC94XX
tristate "Adaptec AIC94xx SAS/SATA support"
depends on PCI
select SCSI_SAS_LIBSAS
select FW_LOADER
help
This driver supports Adaptec's SAS/SATA 3Gb/s 64 bit PCI-X
AIC94xx chip based host adapters.
......
......@@ -309,11 +309,29 @@ static ssize_t asd_show_dev_pcba_sn(struct device *dev,
}
static DEVICE_ATTR(pcba_sn, S_IRUGO, asd_show_dev_pcba_sn, NULL);
static void asd_create_dev_attrs(struct asd_ha_struct *asd_ha)
static int asd_create_dev_attrs(struct asd_ha_struct *asd_ha)
{
device_create_file(&asd_ha->pcidev->dev, &dev_attr_revision);
device_create_file(&asd_ha->pcidev->dev, &dev_attr_bios_build);
device_create_file(&asd_ha->pcidev->dev, &dev_attr_pcba_sn);
int err;
err = device_create_file(&asd_ha->pcidev->dev, &dev_attr_revision);
if (err)
return err;
err = device_create_file(&asd_ha->pcidev->dev, &dev_attr_bios_build);
if (err)
goto err_rev;
err = device_create_file(&asd_ha->pcidev->dev, &dev_attr_pcba_sn);
if (err)
goto err_biosb;
return 0;
err_biosb:
device_remove_file(&asd_ha->pcidev->dev, &dev_attr_bios_build);
err_rev:
device_remove_file(&asd_ha->pcidev->dev, &dev_attr_revision);
return err;
}
static void asd_remove_dev_attrs(struct asd_ha_struct *asd_ha)
......@@ -645,7 +663,9 @@ static int __devinit asd_pci_probe(struct pci_dev *dev,
}
ASD_DPRINTK("escbs posted\n");
asd_create_dev_attrs(asd_ha);
err = asd_create_dev_attrs(asd_ha);
if (err)
goto Err_dev_attrs;
err = asd_register_sas_ha(asd_ha);
if (err)
......@@ -668,6 +688,7 @@ static int __devinit asd_pci_probe(struct pci_dev *dev,
asd_unregister_sas_ha(asd_ha);
Err_reg_sas:
asd_remove_dev_attrs(asd_ha);
Err_dev_attrs:
Err_escbs:
asd_disable_ints(asd_ha);
free_irq(dev->irq, asd_ha);
......@@ -754,9 +775,9 @@ static ssize_t asd_version_show(struct device_driver *driver, char *buf)
}
static DRIVER_ATTR(version, S_IRUGO, asd_version_show, NULL);
static void asd_create_driver_attrs(struct device_driver *driver)
static int asd_create_driver_attrs(struct device_driver *driver)
{
driver_create_file(driver, &driver_attr_version);
return driver_create_file(driver, &driver_attr_version);
}
static void asd_remove_driver_attrs(struct device_driver *driver)
......@@ -834,10 +855,14 @@ static int __init aic94xx_init(void)
if (err)
goto out_release_transport;
asd_create_driver_attrs(&aic94xx_pci_driver.driver);
err = asd_create_driver_attrs(&aic94xx_pci_driver.driver);
if (err)
goto out_unregister_pcidrv;
return err;
out_unregister_pcidrv:
pci_unregister_driver(&aic94xx_pci_driver);
out_release_transport:
sas_release_transport(aic94xx_transport_template);
out_destroy_caches:
......
......@@ -194,7 +194,8 @@
unsigned int sdtr_period = SDTR_PERIOD;
unsigned int sdtr_size = SDTR_SIZE;
static void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result);
static void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp,
unsigned int result);
static int acornscsi_reconnect_finish(AS_Host *host);
static void acornscsi_dma_cleanup(AS_Host *host);
static void acornscsi_abortcmd(AS_Host *host, unsigned char tag);
......@@ -712,7 +713,7 @@ static
intr_ret_t acornscsi_kick(AS_Host *host)
{
int from_queue = 0;
Scsi_Cmnd *SCpnt;
struct scsi_cmnd *SCpnt;
/* first check to see if a command is waiting to be executed */
SCpnt = host->origSCpnt;
......@@ -796,15 +797,15 @@ intr_ret_t acornscsi_kick(AS_Host *host)
}
/*
* Function: void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result)
* Function: void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp, unsigned int result)
* Purpose : complete processing for command
* Params : host - interface that completed
* result - driver byte of result
*/
static
void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result)
static void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp,
unsigned int result)
{
Scsi_Cmnd *SCpnt = *SCpntp;
struct scsi_cmnd *SCpnt = *SCpntp;
/* clean up */
sbic_arm_write(host->scsi.io_port, SBIC_SOURCEID, SOURCEID_ER | SOURCEID_DSP);
......@@ -1318,7 +1319,7 @@ acornscsi_write_pio(AS_Host *host, char *bytes, int *ptr, int len, unsigned int
static void
acornscsi_sendcommand(AS_Host *host)
{
Scsi_Cmnd *SCpnt = host->SCpnt;
struct scsi_cmnd *SCpnt = host->SCpnt;
sbic_arm_write(host->scsi.io_port, SBIC_TRANSCNTH, 0);
sbic_arm_writenext(host->scsi.io_port, 0);
......@@ -1693,7 +1694,7 @@ void acornscsi_message(AS_Host *host)
acornscsi_sbic_issuecmd(host, CMND_ASSERTATN);
msgqueue_addmsg(&host->scsi.msgs, 1, ABORT);
} else {
Scsi_Cmnd *SCpnt = host->SCpnt;
struct scsi_cmnd *SCpnt = host->SCpnt;
acornscsi_dma_cleanup(host);
......@@ -2509,13 +2510,14 @@ acornscsi_intr(int irq, void *dev_id, struct pt_regs *regs)
*/
/*
* Function : acornscsi_queuecmd(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
* Function : acornscsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
* Purpose : queues a SCSI command
* Params : cmd - SCSI command
* done - function called on completion, with pointer to command descriptor
* Returns : 0, or < 0 on error.
*/
int acornscsi_queuecmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
int acornscsi_queuecmd(struct scsi_cmnd *SCpnt,
void (*done)(struct scsi_cmnd *))
{
AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata;
......@@ -2565,17 +2567,18 @@ int acornscsi_queuecmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
}
/*
* Prototype: void acornscsi_reportstatus(Scsi_Cmnd **SCpntp1, Scsi_Cmnd **SCpntp2, int result)
* Prototype: void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, struct scsi_cmnd **SCpntp2, int result)
* Purpose : pass a result to *SCpntp1, and check if *SCpntp1 = *SCpntp2
* Params : SCpntp1 - pointer to command to return
* SCpntp2 - pointer to command to check
* result - result to pass back to mid-level done function
* Returns : *SCpntp2 = NULL if *SCpntp1 is the same command structure as *SCpntp2.
*/
static inline
void acornscsi_reportstatus(Scsi_Cmnd **SCpntp1, Scsi_Cmnd **SCpntp2, int result)
static inline void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1,
struct scsi_cmnd **SCpntp2,
int result)
{
Scsi_Cmnd *SCpnt = *SCpntp1;
struct scsi_cmnd *SCpnt = *SCpntp1;
if (SCpnt) {
*SCpntp1 = NULL;
......@@ -2591,13 +2594,12 @@ void acornscsi_reportstatus(Scsi_Cmnd **SCpntp1, Scsi_Cmnd **SCpntp2, int result
enum res_abort { res_not_running, res_success, res_success_clear, res_snooze };
/*
* Prototype: enum res acornscsi_do_abort(Scsi_Cmnd *SCpnt)
* Prototype: enum res acornscsi_do_abort(struct scsi_cmnd *SCpnt)
* Purpose : abort a command on this host
* Params : SCpnt - command to abort
* Returns : our abort status
*/
static enum res_abort
acornscsi_do_abort(AS_Host *host, Scsi_Cmnd *SCpnt)
static enum res_abort acornscsi_do_abort(AS_Host *host, struct scsi_cmnd *SCpnt)
{
enum res_abort res = res_not_running;
......@@ -2684,12 +2686,12 @@ acornscsi_do_abort(AS_Host *host, Scsi_Cmnd *SCpnt)
}
/*
* Prototype: int acornscsi_abort(Scsi_Cmnd *SCpnt)
* Prototype: int acornscsi_abort(struct scsi_cmnd *SCpnt)
* Purpose : abort a command on this host
* Params : SCpnt - command to abort
* Returns : one of SCSI_ABORT_ macros
*/
int acornscsi_abort(Scsi_Cmnd *SCpnt)
int acornscsi_abort(struct scsi_cmnd *SCpnt)
{
AS_Host *host = (AS_Host *) SCpnt->device->host->hostdata;
int result;
......@@ -2770,16 +2772,16 @@ int acornscsi_abort(Scsi_Cmnd *SCpnt)
}
/*
* Prototype: int acornscsi_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags)
* Prototype: int acornscsi_reset(struct scsi_cmnd *SCpnt, unsigned int reset_flags)
* Purpose : reset a command on this host/reset this host
* Params : SCpnt - command causing reset
* result - what type of reset to perform
* Returns : one of SCSI_RESET_ macros
*/
int acornscsi_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags)
int acornscsi_reset(struct scsi_cmnd *SCpnt, unsigned int reset_flags)
{
AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata;
Scsi_Cmnd *SCptr;
AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata;
struct scsi_cmnd *SCptr;
host->stats.resets += 1;
......
......@@ -277,8 +277,8 @@ struct status_entry {
typedef struct acornscsi_hostdata {
/* miscellaneous */
struct Scsi_Host *host; /* host */
Scsi_Cmnd *SCpnt; /* currently processing command */
Scsi_Cmnd *origSCpnt; /* original connecting command */
struct scsi_cmnd *SCpnt; /* currently processing command */
struct scsi_cmnd *origSCpnt; /* original connecting command */
/* driver information */
struct {
......
......@@ -297,8 +297,8 @@ fas216_do_log(FAS216_Info *info, char target, char *fmt, va_list ap)
printk("scsi%d.%c: %s", info->host->host_no, target, buf);
}
static void
fas216_log_command(FAS216_Info *info, int level, Scsi_Cmnd *SCpnt, char *fmt, ...)
static void fas216_log_command(FAS216_Info *info, int level,
struct scsi_cmnd *SCpnt, char *fmt, ...)
{
va_list args;
......@@ -1662,7 +1662,7 @@ irqreturn_t fas216_intr(FAS216_Info *info)
return handled;
}
static void __fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt)
static void __fas216_start_command(FAS216_Info *info, struct scsi_cmnd *SCpnt)
{
int tot_msglen;
......@@ -1754,7 +1754,7 @@ static int parity_test(FAS216_Info *info, int target)
return info->device[target].parity_check;
}
static void fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt)
static void fas216_start_command(FAS216_Info *info, struct scsi_cmnd *SCpnt)
{
int disconnect_ok;
......@@ -1808,7 +1808,7 @@ static void fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt)
__fas216_start_command(info, SCpnt);
}
static void fas216_allocate_tag(FAS216_Info *info, Scsi_Cmnd *SCpnt)
static void fas216_allocate_tag(FAS216_Info *info, struct scsi_cmnd *SCpnt)
{
#ifdef SCSI2_TAG
/*
......@@ -1842,7 +1842,8 @@ static void fas216_allocate_tag(FAS216_Info *info, Scsi_Cmnd *SCpnt)
}
}
static void fas216_do_bus_device_reset(FAS216_Info *info, Scsi_Cmnd *SCpnt)
static void fas216_do_bus_device_reset(FAS216_Info *info,
struct scsi_cmnd *SCpnt)
{
struct message *msg;
......@@ -1890,7 +1891,7 @@ static void fas216_do_bus_device_reset(FAS216_Info *info, Scsi_Cmnd *SCpnt)
*/
static void fas216_kick(FAS216_Info *info)
{
Scsi_Cmnd *SCpnt = NULL;
struct scsi_cmnd *SCpnt = NULL;
#define TYPE_OTHER 0
#define TYPE_RESET 1
#define TYPE_QUEUE 2
......@@ -1978,8 +1979,8 @@ static void fas216_kick(FAS216_Info *info)
/*
* Clean up from issuing a BUS DEVICE RESET message to a device.
*/
static void
fas216_devicereset_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
static void fas216_devicereset_done(FAS216_Info *info, struct scsi_cmnd *SCpnt,
unsigned int result)
{
fas216_log(info, LOG_ERROR, "fas216 device reset complete");
......@@ -1996,8 +1997,8 @@ fas216_devicereset_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result
*
* Finish processing automatic request sense command
*/
static void
fas216_rq_sns_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
static void fas216_rq_sns_done(FAS216_Info *info, struct scsi_cmnd *SCpnt,
unsigned int result)
{
fas216_log_target(info, LOG_CONNECT, SCpnt->device->id,
"request sense complete, result=0x%04x%02x%02x",
......@@ -2030,7 +2031,7 @@ fas216_rq_sns_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
* Finish processing of standard command
*/
static void
fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result)
{
info->stats.fins += 1;
......@@ -2142,8 +2143,8 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
*/
static void fas216_done(FAS216_Info *info, unsigned int result)
{
void (*fn)(FAS216_Info *, Scsi_Cmnd *, unsigned int);
Scsi_Cmnd *SCpnt;
void (*fn)(FAS216_Info *, struct scsi_cmnd *, unsigned int);
struct scsi_cmnd *SCpnt;
unsigned long flags;
fas216_checkmagic(info);
......@@ -2182,7 +2183,7 @@ static void fas216_done(FAS216_Info *info, unsigned int result)
info->device[SCpnt->device->id].parity_check = 0;
clear_bit(SCpnt->device->id * 8 + SCpnt->device->lun, info->busyluns);
fn = (void (*)(FAS216_Info *, Scsi_Cmnd *, unsigned int))SCpnt->host_scribble;
fn = (void (*)(FAS216_Info *, struct scsi_cmnd *, unsigned int))SCpnt->host_scribble;
fn(info, SCpnt, result);
if (info->scsi.irq != NO_IRQ) {
......@@ -2207,7 +2208,8 @@ static void fas216_done(FAS216_Info *info, unsigned int result)
* Returns: 0 on success, else error.
* Notes: io_request_lock is held, interrupts are disabled.
*/
int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
int fas216_queue_command(struct scsi_cmnd *SCpnt,
void (*done)(struct scsi_cmnd *))
{
FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
int result;
......@@ -2254,7 +2256,7 @@ int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
*
* Trigger restart of a waiting thread in fas216_command
*/
static void fas216_internal_done(Scsi_Cmnd *SCpnt)
static void fas216_internal_done(struct scsi_cmnd *SCpnt)
{
FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
......@@ -2271,7 +2273,8 @@ static void fas216_internal_done(Scsi_Cmnd *SCpnt)
* Returns: scsi result code.
* Notes: io_request_lock is held, interrupts are disabled.
*/
int fas216_noqueue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
int fas216_noqueue_command(struct scsi_cmnd *SCpnt,
void (*done)(struct scsi_cmnd *))
{
FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
......@@ -2350,7 +2353,8 @@ enum res_find {
* Decide how to abort a command.
* Returns: abort status
*/
static enum res_find fas216_find_command(FAS216_Info *info, Scsi_Cmnd *SCpnt)
static enum res_find fas216_find_command(FAS216_Info *info,
struct scsi_cmnd *SCpnt)
{
enum res_find res = res_failed;
......@@ -2417,7 +2421,7 @@ static enum res_find fas216_find_command(FAS216_Info *info, Scsi_Cmnd *SCpnt)
* Returns: FAILED if unable to abort
* Notes: io_request_lock is taken, and irqs are disabled
*/
int fas216_eh_abort(Scsi_Cmnd *SCpnt)
int fas216_eh_abort(struct scsi_cmnd *SCpnt)
{
FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
int result = FAILED;
......@@ -2474,7 +2478,7 @@ int fas216_eh_abort(Scsi_Cmnd *SCpnt)
* Notes: We won't be re-entered, so we'll only have one device
* reset on the go at one time.
*/
int fas216_eh_device_reset(Scsi_Cmnd *SCpnt)
int fas216_eh_device_reset(struct scsi_cmnd *SCpnt)
{
FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
unsigned long flags;
......@@ -2555,7 +2559,7 @@ int fas216_eh_device_reset(Scsi_Cmnd *SCpnt)
* Returns: FAILED if unable to reset.
* Notes: Further commands are blocked.
*/
int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt)
int fas216_eh_bus_reset(struct scsi_cmnd *SCpnt)
{
FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
unsigned long flags;
......@@ -2655,7 +2659,7 @@ static void fas216_init_chip(FAS216_Info *info)
* Returns: FAILED if unable to reset.
* Notes: io_request_lock is taken, and irqs are disabled
*/
int fas216_eh_host_reset(Scsi_Cmnd *SCpnt)
int fas216_eh_host_reset(struct scsi_cmnd *SCpnt)
{
FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
......
......@@ -218,11 +218,11 @@ typedef struct {
unsigned long magic_start;
spinlock_t host_lock;
struct Scsi_Host *host; /* host */
Scsi_Cmnd *SCpnt; /* currently processing command */
Scsi_Cmnd *origSCpnt; /* original connecting command */
Scsi_Cmnd *reqSCpnt; /* request sense command */
Scsi_Cmnd *rstSCpnt; /* reset command */
Scsi_Cmnd *pending_SCpnt[8]; /* per-device pending commands */
struct scsi_cmnd *SCpnt; /* currently processing command */
struct scsi_cmnd *origSCpnt; /* original connecting command */
struct scsi_cmnd *reqSCpnt; /* request sense command */
struct scsi_cmnd *rstSCpnt; /* reset command */
struct scsi_cmnd *pending_SCpnt[8]; /* per-device pending commands */
int next_pending; /* next pending device */
/*
......@@ -328,21 +328,23 @@ extern int fas216_init (struct Scsi_Host *instance);
*/
extern int fas216_add (struct Scsi_Host *instance, struct device *dev);
/* Function: int fas216_queue_command (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
/* Function: int fas216_queue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
* Purpose : queue a command for adapter to process.
* Params : SCpnt - Command to queue
* done - done function to call once command is complete
* Returns : 0 - success, else error
*/
extern int fas216_queue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
extern int fas216_queue_command(struct scsi_cmnd *,
void (*done)(struct scsi_cmnd *));
/* Function: int fas216_noqueue_command (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
/* Function: int fas216_noqueue_command(istruct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
* Purpose : queue a command for adapter to process, and process it to completion.
* Params : SCpnt - Command to queue
* done - done function to call once command is complete
* Returns : 0 - success, else error
*/
extern int fas216_noqueue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
extern int fas216_noqueue_command(struct scsi_cmnd *,
void (*done)(struct scsi_cmnd *));
/* Function: irqreturn_t fas216_intr (FAS216_Info *info)
* Purpose : handle interrupts from the interface to progress a command
......@@ -363,32 +365,32 @@ extern int fas216_print_host(FAS216_Info *info, char *buffer);
extern int fas216_print_stats(FAS216_Info *info, char *buffer);
extern int fas216_print_devices(FAS216_Info *info, char *buffer);
/* Function: int fas216_eh_abort(Scsi_Cmnd *SCpnt)
/* Function: int fas216_eh_abort(struct scsi_cmnd *SCpnt)
* Purpose : abort this command
* Params : SCpnt - command to abort
* Returns : FAILED if unable to abort
*/
extern int fas216_eh_abort(Scsi_Cmnd *SCpnt);
extern int fas216_eh_abort(struct scsi_cmnd *SCpnt);
/* Function: int fas216_eh_device_reset(Scsi_Cmnd *SCpnt)
/* Function: int fas216_eh_device_reset(struct scsi_cmnd *SCpnt)
* Purpose : Reset the device associated with this command
* Params : SCpnt - command specifing device to reset
* Returns : FAILED if unable to reset
*/
extern int fas216_eh_device_reset(Scsi_Cmnd *SCpnt);
extern int fas216_eh_device_reset(struct scsi_cmnd *SCpnt);
/* Function: int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt)
/* Function: int fas216_eh_bus_reset(struct scsi_cmnd *SCpnt)
* Purpose : Reset the complete bus associated with this command
* Params : SCpnt - command specifing bus to reset
* Returns : FAILED if unable to reset
*/
extern int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt);
extern int fas216_eh_bus_reset(struct scsi_cmnd *SCpnt);
/* Function: int fas216_eh_host_reset(Scsi_Cmnd *SCpnt)
/* Function: int fas216_eh_host_reset(struct scsi_cmnd *SCpnt)
* Purpose : Reset the host associated with this command
* Params : SCpnt - command specifing host to reset
* Returns : FAILED if unable to reset
*/
extern int fas216_eh_host_reset(Scsi_Cmnd *SCpnt);
extern int fas216_eh_host_reset(struct scsi_cmnd *SCpnt);
#endif /* FAS216_H */
......@@ -29,7 +29,7 @@
typedef struct queue_entry {
struct list_head list;
Scsi_Cmnd *SCpnt;
struct scsi_cmnd *SCpnt;
#ifdef DEBUG
unsigned long magic;
#endif
......@@ -96,14 +96,14 @@ void queue_free (Queue_t *queue)
/*
* Function: int queue_add_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt, int head)
* Function: int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head)
* Purpose : Add a new command onto a queue, adding REQUEST_SENSE to head.
* Params : queue - destination queue
* SCpnt - command to add
* head - add command to head of queue
* Returns : 0 on error, !0 on success
*/
int __queue_add(Queue_t *queue, Scsi_Cmnd *SCpnt, int head)
int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head)
{
unsigned long flags;
struct list_head *l;
......@@ -134,7 +134,7 @@ int __queue_add(Queue_t *queue, Scsi_Cmnd *SCpnt, int head)
return ret;
}
static Scsi_Cmnd *__queue_remove(Queue_t *queue, struct list_head *ent)
static struct scsi_cmnd *__queue_remove(Queue_t *queue, struct list_head *ent)
{
QE_t *q;
......@@ -152,17 +152,17 @@ static Scsi_Cmnd *__queue_remove(Queue_t *queue, struct list_head *ent)
}
/*
* Function: Scsi_Cmnd *queue_remove_exclude (queue, exclude)
* Function: struct scsi_cmnd *queue_remove_exclude (queue, exclude)
* Purpose : remove a SCSI command from a queue
* Params : queue - queue to remove command from
* exclude - bit array of target&lun which is busy
* Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available
* Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available
*/
Scsi_Cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude)
struct scsi_cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude)
{
unsigned long flags;
struct list_head *l;
Scsi_Cmnd *SCpnt = NULL;
struct scsi_cmnd *SCpnt = NULL;
spin_lock_irqsave(&queue->queue_lock, flags);
list_for_each(l, &queue->head) {
......@@ -178,15 +178,15 @@ Scsi_Cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude)
}
/*
* Function: Scsi_Cmnd *queue_remove (queue)
* Function: struct scsi_cmnd *queue_remove (queue)
* Purpose : removes first SCSI command from a queue
* Params : queue - queue to remove command from
* Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available
* Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available
*/
Scsi_Cmnd *queue_remove(Queue_t *queue)
struct scsi_cmnd *queue_remove(Queue_t *queue)
{
unsigned long flags;
Scsi_Cmnd *SCpnt = NULL;
struct scsi_cmnd *SCpnt = NULL;
spin_lock_irqsave(&queue->queue_lock, flags);
if (!list_empty(&queue->head))
......@@ -197,19 +197,20 @@ Scsi_Cmnd *queue_remove(Queue_t *queue)
}
/*
* Function: Scsi_Cmnd *queue_remove_tgtluntag (queue, target, lun, tag)
* Function: struct scsi_cmnd *queue_remove_tgtluntag (queue, target, lun, tag)
* Purpose : remove a SCSI command from the queue for a specified target/lun/tag
* Params : queue - queue to remove command from
* target - target that we want
* lun - lun on device
* tag - tag on device
* Returns : Scsi_Cmnd if successful, or NULL if no command satisfies requirements
* Returns : struct scsi_cmnd if successful, or NULL if no command satisfies requirements
*/
Scsi_Cmnd *queue_remove_tgtluntag (Queue_t *queue, int target, int lun, int tag)
struct scsi_cmnd *queue_remove_tgtluntag(Queue_t *queue, int target, int lun,
int tag)
{
unsigned long flags;
struct list_head *l;
Scsi_Cmnd *SCpnt = NULL;
struct scsi_cmnd *SCpnt = NULL;
spin_lock_irqsave(&queue->queue_lock, flags);
list_for_each(l, &queue->head) {
......@@ -275,13 +276,13 @@ int queue_probetgtlun (Queue_t *queue, int target, int lun)
}
/*
* Function: int queue_remove_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt)
* Function: int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt)
* Purpose : remove a specific command from the queues
* Params : queue - queue to look in
* SCpnt - command to find
* Returns : 0 if not found
*/
int queue_remove_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt)
int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt)
{
unsigned long flags;
struct list_head *l;
......
......@@ -32,46 +32,48 @@ extern int queue_initialise (Queue_t *queue);
extern void queue_free (Queue_t *queue);
/*
* Function: Scsi_Cmnd *queue_remove (queue)
* Function: struct scsi_cmnd *queue_remove (queue)
* Purpose : removes first SCSI command from a queue
* Params : queue - queue to remove command from
* Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available
* Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available
*/
extern Scsi_Cmnd *queue_remove (Queue_t *queue);
extern struct scsi_cmnd *queue_remove (Queue_t *queue);
/*
* Function: Scsi_Cmnd *queue_remove_exclude_ref (queue, exclude)
* Function: struct scsi_cmnd *queue_remove_exclude_ref (queue, exclude)
* Purpose : remove a SCSI command from a queue
* Params : queue - queue to remove command from
* exclude - array of busy LUNs
* Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available
* Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available
*/
extern Scsi_Cmnd *queue_remove_exclude (Queue_t *queue, unsigned long *exclude);
extern struct scsi_cmnd *queue_remove_exclude(Queue_t *queue,
unsigned long *exclude);
#define queue_add_cmd_ordered(queue,SCpnt) \
__queue_add(queue,SCpnt,(SCpnt)->cmnd[0] == REQUEST_SENSE)
#define queue_add_cmd_tail(queue,SCpnt) \
__queue_add(queue,SCpnt,0)
/*
* Function: int __queue_add(Queue_t *queue, Scsi_Cmnd *SCpnt, int head)
* Function: int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head)
* Purpose : Add a new command onto a queue
* Params : queue - destination queue
* SCpnt - command to add
* head - add command to head of queue
* Returns : 0 on error, !0 on success
*/
extern int __queue_add(Queue_t *queue, Scsi_Cmnd *SCpnt, int head);
extern int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head);
/*
* Function: Scsi_Cmnd *queue_remove_tgtluntag (queue, target, lun, tag)
* Function: struct scsi_cmnd *queue_remove_tgtluntag (queue, target, lun, tag)
* Purpose : remove a SCSI command from the queue for a specified target/lun/tag
* Params : queue - queue to remove command from
* target - target that we want
* lun - lun on device
* tag - tag on device
* Returns : Scsi_Cmnd if successful, or NULL if no command satisfies requirements
* Returns : struct scsi_cmnd if successful, or NULL if no command satisfies requirements
*/
extern Scsi_Cmnd *queue_remove_tgtluntag (Queue_t *queue, int target, int lun, int tag);
extern struct scsi_cmnd *queue_remove_tgtluntag(Queue_t *queue, int target,
int lun, int tag);
/*
* Function: queue_remove_all_target(queue, target)
......@@ -94,12 +96,12 @@ extern void queue_remove_all_target(Queue_t *queue, int target);
extern int queue_probetgtlun (Queue_t *queue, int target, int lun);
/*
* Function: int queue_remove_cmd (Queue_t *queue, Scsi_Cmnd *SCpnt)
* Function: int queue_remove_cmd (Queue_t *queue, struct scsi_cmnd *SCpnt)
* Purpose : remove a specific command from the queues
* Params : queue - queue to look in
* SCpnt - command to find
* Returns : 0 if not found
*/
int queue_remove_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt);
int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt);
#endif /* QUEUE_H */
......@@ -66,7 +66,7 @@ static inline void put_next_SCp_byte(struct scsi_pointer *SCp, unsigned char c)
SCp->this_residual -= 1;
}
static inline void init_SCp(Scsi_Cmnd *SCpnt)
static inline void init_SCp(struct scsi_cmnd *SCpnt)
{
memset(&SCpnt->SCp, 0, sizeof(struct scsi_pointer));
......
......@@ -1219,7 +1219,7 @@ static void dump_register_info(struct AdapterCtlBlk *acb,
srb, srb->cmd, srb->cmd->pid,
srb->cmd->cmnd[0], srb->cmd->device->id,
srb->cmd->device->lun);
printk(" sglist=%p cnt=%i idx=%i len=%i\n",
printk(" sglist=%p cnt=%i idx=%i len=%Zd\n",
srb->segment_x, srb->sg_count, srb->sg_index,
srb->total_xfer_length);
printk(" state=0x%04x status=0x%02x phase=0x%02x (%sconn.)\n",
......@@ -4949,7 +4949,7 @@ static struct pci_driver dc395x_driver = {
**/
static int __init dc395x_module_init(void)
{
return pci_module_init(&dc395x_driver);
return pci_register_driver(&dc395x_driver);
}
......
......@@ -155,7 +155,7 @@ static struct pci_driver dmx3191d_pci_driver = {
static int __init dmx3191d_init(void)
{
return pci_module_init(&dmx3191d_pci_driver);
return pci_register_driver(&dmx3191d_pci_driver);
}
static void __exit dmx3191d_exit(void)
......
......@@ -47,21 +47,11 @@
* I2O Interface Objects
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
#define DECLARE_MUTEX(name) struct semaphore name=MUTEX
typedef struct wait_queue *adpt_wait_queue_head_t;
#define ADPT_DECLARE_WAIT_QUEUE_HEAD(wait) adpt_wait_queue_head_t wait = NULL
typedef struct wait_queue adpt_wait_queue_t;
#else
#include <linux/wait.h>
typedef wait_queue_head_t adpt_wait_queue_head_t;
#define ADPT_DECLARE_WAIT_QUEUE_HEAD(wait) DECLARE_WAIT_QUEUE_HEAD(wait)
typedef wait_queue_t adpt_wait_queue_t;
#endif
/*
* message structures
*/
......
......@@ -2212,7 +2212,7 @@ static s32 adpt_scsi_register(adpt_hba* pHba,struct scsi_host_template * sht)
*/
host->io_port = 0;
host->n_io_port = 0;
/* see comments in hosts.h */
/* see comments in scsi_host.h */
host->max_id = 16;
host->max_lun = 256;
host->max_channel = pHba->top_scsi_channel + 1;
......
......@@ -44,7 +44,7 @@ static int adpt_device_reset(struct scsi_cmnd* cmd);
/*
* struct scsi_host_template (see hosts.h)
* struct scsi_host_template (see scsi/scsi_host.h)
*/
#define DPT_DRIVER_NAME "Adaptec I2O RAID"
......
......@@ -936,18 +936,12 @@ typedef struct {
gdth_binfo_str binfo; /* controller info */
gdth_evt_data dvr; /* event structure */
spinlock_t smp_lock;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
struct pci_dev *pdev;
#endif
char oem_name[8];
#ifdef GDTH_DMA_STATISTICS
ulong dma32_cnt, dma64_cnt; /* statistics: DMA buffer */
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
struct scsi_device *sdev;
#else
struct scsi_device sdev;
#endif
} gdth_ha_str;
/* structure for scsi_register(), SCSI bus != 0 */
......@@ -1029,10 +1023,6 @@ typedef struct {
/* function prototyping */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
int gdth_proc_info(struct Scsi_Host *, char *,char **,off_t,int,int);
#else
int gdth_proc_info(char *,char **,off_t,int,int,int);
#endif
#endif
#warning "This file is obsolete, please use <scsi/scsi_host.h> instead"
#include <scsi/scsi_host.h>
此差异已折叠。
......@@ -28,6 +28,7 @@
#include <linux/types.h>
#include <linux/completion.h>
#include <linux/libata.h>
#include <linux/list.h>
#include <linux/kref.h>
#include <scsi/scsi.h>
......@@ -36,8 +37,8 @@
/*
* Literals
*/
#define IPR_DRIVER_VERSION "2.1.4"
#define IPR_DRIVER_DATE "(August 2, 2006)"
#define IPR_DRIVER_VERSION "2.2.0"
#define IPR_DRIVER_DATE "(September 25, 2006)"
/*
* IPR_MAX_CMD_PER_LUN: This defines the maximum number of outstanding
......@@ -849,6 +850,13 @@ struct ipr_bus_attributes {
u32 max_xfer_rate;
};
struct ipr_sata_port {
struct ipr_ioa_cfg *ioa_cfg;
struct ata_port *ap;
struct ipr_resource_entry *res;
struct ipr_ioasa_gata ioasa;
};
struct ipr_resource_entry {
struct ipr_config_table_entry cfgte;
u8 needs_sync_complete:1;
......@@ -858,6 +866,7 @@ struct ipr_resource_entry {
u8 resetting_device:1;
struct scsi_device *sdev;
struct ipr_sata_port *sata_port;
struct list_head queue;
};
......@@ -928,10 +937,11 @@ struct ipr_trace_entry {
u32 time;
u8 op_code;
u8 ata_op_code;
u8 type;
#define IPR_TRACE_START 0x00
#define IPR_TRACE_FINISH 0xff
u16 cmd_index;
u8 cmd_index;
__be32 res_handle;
union {
......@@ -1073,6 +1083,7 @@ struct ipr_ioa_cfg {
struct ipr_cmnd *reset_cmd;
struct ata_host ata_host;
char ipr_cmd_label[8];
#define IPR_CMD_LABEL "ipr_cmnd"
struct ipr_cmnd *ipr_cmnd_list[IPR_NUM_CMD_BLKS];
......@@ -1085,6 +1096,7 @@ struct ipr_cmnd {
struct ipr_ioadl_desc ioadl[IPR_NUM_IOADL_ENTRIES];
struct list_head queue;
struct scsi_cmnd *scsi_cmd;
struct ata_queued_cmd *qc;
struct completion completion;
struct timer_list timer;
void (*done) (struct ipr_cmnd *);
......
......@@ -182,14 +182,8 @@
#include <linux/dma-mapping.h>
#include <scsi/sg.h>
#include "scsi.h"
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
#include "hosts.h"
#else
#include <scsi/scsi_host.h>
#endif
#include "ips.h"
......@@ -250,9 +244,9 @@ module_param(ips, charp, 0);
*/
static int ips_detect(struct scsi_host_template *);
static int ips_release(struct Scsi_Host *);
static int ips_eh_abort(Scsi_Cmnd *);
static int ips_eh_reset(Scsi_Cmnd *);
static int ips_queue(Scsi_Cmnd *, void (*)(Scsi_Cmnd *));
static int ips_eh_abort(struct scsi_cmnd *);
static int ips_eh_reset(struct scsi_cmnd *);
static int ips_queue(struct scsi_cmnd *, void (*)(struct scsi_cmnd *));
static const char *ips_info(struct Scsi_Host *);
static irqreturn_t do_ipsintr(int, void *, struct pt_regs *);
static int ips_hainit(ips_ha_t *);
......@@ -325,24 +319,26 @@ static uint32_t ips_statupd_copperhead_memio(ips_ha_t *);
static uint32_t ips_statupd_morpheus(ips_ha_t *);
static ips_scb_t *ips_getscb(ips_ha_t *);
static void ips_putq_scb_head(ips_scb_queue_t *, ips_scb_t *);
static void ips_putq_wait_tail(ips_wait_queue_t *, Scsi_Cmnd *);
static void ips_putq_wait_tail(ips_wait_queue_t *, struct scsi_cmnd *);
static void ips_putq_copp_tail(ips_copp_queue_t *,
ips_copp_wait_item_t *);
static ips_scb_t *ips_removeq_scb_head(ips_scb_queue_t *);
static ips_scb_t *ips_removeq_scb(ips_scb_queue_t *, ips_scb_t *);
static Scsi_Cmnd *ips_removeq_wait_head(ips_wait_queue_t *);
static Scsi_Cmnd *ips_removeq_wait(ips_wait_queue_t *, Scsi_Cmnd *);
static struct scsi_cmnd *ips_removeq_wait_head(ips_wait_queue_t *);
static struct scsi_cmnd *ips_removeq_wait(ips_wait_queue_t *,
struct scsi_cmnd *);
static ips_copp_wait_item_t *ips_removeq_copp(ips_copp_queue_t *,
ips_copp_wait_item_t *);
static ips_copp_wait_item_t *ips_removeq_copp_head(ips_copp_queue_t *);
static int ips_is_passthru(Scsi_Cmnd *);
static int ips_make_passthru(ips_ha_t *, Scsi_Cmnd *, ips_scb_t *, int);
static int ips_is_passthru(struct scsi_cmnd *);
static int ips_make_passthru(ips_ha_t *, struct scsi_cmnd *, ips_scb_t *, int);
static int ips_usrcmd(ips_ha_t *, ips_passthru_t *, ips_scb_t *);
static void ips_cleanup_passthru(ips_ha_t *, ips_scb_t *);
static void ips_scmd_buf_write(Scsi_Cmnd * scmd, void *data,
static void ips_scmd_buf_write(struct scsi_cmnd * scmd, void *data,
unsigned int count);
static void ips_scmd_buf_read(Scsi_Cmnd * scmd, void *data, unsigned int count);
static void ips_scmd_buf_read(struct scsi_cmnd * scmd, void *data,
unsigned int count);
static int ips_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int);
static int ips_host_info(ips_ha_t *, char *, off_t, int);
......@@ -812,8 +808,7 @@ ips_halt(struct notifier_block *nb, ulong event, void *buf)
/* Abort a command (using the new error code stuff) */
/* Note: this routine is called under the io_request_lock */
/****************************************************************************/
int
ips_eh_abort(Scsi_Cmnd * SC)
int ips_eh_abort(struct scsi_cmnd *SC)
{
ips_ha_t *ha;
ips_copp_wait_item_t *item;
......@@ -871,8 +866,7 @@ ips_eh_abort(Scsi_Cmnd * SC)
/* NOTE: this routine is called under the io_request_lock spinlock */
/* */
/****************************************************************************/
static int
__ips_eh_reset(Scsi_Cmnd * SC)
static int __ips_eh_reset(struct scsi_cmnd *SC)
{
int ret;
int i;
......@@ -968,7 +962,7 @@ __ips_eh_reset(Scsi_Cmnd * SC)
ret = (*ha->func.reset) (ha);
if (!ret) {
Scsi_Cmnd *scsi_cmd;
struct scsi_cmnd *scsi_cmd;
IPS_PRINTK(KERN_NOTICE, ha->pcidev,
"Controller reset failed - controller now offline.\n");
......@@ -997,7 +991,7 @@ __ips_eh_reset(Scsi_Cmnd * SC)
}
if (!ips_clear_adapter(ha, IPS_INTR_IORL)) {
Scsi_Cmnd *scsi_cmd;
struct scsi_cmnd *scsi_cmd;
IPS_PRINTK(KERN_NOTICE, ha->pcidev,
"Controller reset failed - controller now offline.\n");
......@@ -1059,8 +1053,7 @@ __ips_eh_reset(Scsi_Cmnd * SC)
}
static int
ips_eh_reset(Scsi_Cmnd * SC)
static int ips_eh_reset(struct scsi_cmnd *SC)
{
int rc;
......@@ -1083,8 +1076,7 @@ ips_eh_reset(Scsi_Cmnd * SC)
/* Linux obtains io_request_lock before calling this function */
/* */
/****************************************************************************/
static int
ips_queue(Scsi_Cmnd * SC, void (*done) (Scsi_Cmnd *))
static int ips_queue(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *))
{
ips_ha_t *ha;
ips_passthru_t *pt;
......@@ -1602,8 +1594,7 @@ ips_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset,
/* Determine if the specified SCSI command is really a passthru command */
/* */
/****************************************************************************/
static int
ips_is_passthru(Scsi_Cmnd * SC)
static int ips_is_passthru(struct scsi_cmnd *SC)
{
unsigned long flags;
......@@ -1685,7 +1676,7 @@ ips_alloc_passthru_buffer(ips_ha_t * ha, int length)
/* */
/****************************************************************************/
static int
ips_make_passthru(ips_ha_t * ha, Scsi_Cmnd * SC, ips_scb_t * scb, int intr)
ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr)
{
ips_passthru_t *pt;
int length = 0;
......@@ -2734,9 +2725,9 @@ static void
ips_next(ips_ha_t * ha, int intr)
{
ips_scb_t *scb;
Scsi_Cmnd *SC;
Scsi_Cmnd *p;
Scsi_Cmnd *q;
struct scsi_cmnd *SC;
struct scsi_cmnd *p;
struct scsi_cmnd *q;
ips_copp_wait_item_t *item;
int ret;
unsigned long cpu_flags = 0;
......@@ -2847,7 +2838,7 @@ ips_next(ips_ha_t * ha, int intr)
dcdb_active[scmd_channel(p) -
1] & (1 << scmd_id(p)))) {
ips_freescb(ha, scb);
p = (Scsi_Cmnd *) p->host_scribble;
p = (struct scsi_cmnd *) p->host_scribble;
continue;
}
......@@ -2962,7 +2953,7 @@ ips_next(ips_ha_t * ha, int intr)
break;
} /* end case */
p = (Scsi_Cmnd *) p->host_scribble;
p = (struct scsi_cmnd *) p->host_scribble;
} /* end while */
......@@ -3090,8 +3081,7 @@ ips_removeq_scb(ips_scb_queue_t * queue, ips_scb_t * item)
/* ASSUMED to be called from within the HA lock */
/* */
/****************************************************************************/
static void
ips_putq_wait_tail(ips_wait_queue_t * queue, Scsi_Cmnd * item)
static void ips_putq_wait_tail(ips_wait_queue_t *queue, struct scsi_cmnd *item)
{
METHOD_TRACE("ips_putq_wait_tail", 1);
......@@ -3122,10 +3112,9 @@ ips_putq_wait_tail(ips_wait_queue_t * queue, Scsi_Cmnd * item)
/* ASSUMED to be called from within the HA lock */
/* */
/****************************************************************************/
static Scsi_Cmnd *
ips_removeq_wait_head(ips_wait_queue_t * queue)
static struct scsi_cmnd *ips_removeq_wait_head(ips_wait_queue_t *queue)
{
Scsi_Cmnd *item;
struct scsi_cmnd *item;
METHOD_TRACE("ips_removeq_wait_head", 1);
......@@ -3135,7 +3124,7 @@ ips_removeq_wait_head(ips_wait_queue_t * queue)
return (NULL);
}
queue->head = (Scsi_Cmnd *) item->host_scribble;
queue->head = (struct scsi_cmnd *) item->host_scribble;
item->host_scribble = NULL;
if (queue->tail == item)
......@@ -3157,10 +3146,10 @@ ips_removeq_wait_head(ips_wait_queue_t * queue)
/* ASSUMED to be called from within the HA lock */
/* */
/****************************************************************************/
static Scsi_Cmnd *
ips_removeq_wait(ips_wait_queue_t * queue, Scsi_Cmnd * item)
static struct scsi_cmnd *ips_removeq_wait(ips_wait_queue_t *queue,
struct scsi_cmnd *item)
{
Scsi_Cmnd *p;
struct scsi_cmnd *p;
METHOD_TRACE("ips_removeq_wait", 1);
......@@ -3173,8 +3162,8 @@ ips_removeq_wait(ips_wait_queue_t * queue, Scsi_Cmnd * item)
p = queue->head;
while ((p) && (item != (Scsi_Cmnd *) p->host_scribble))
p = (Scsi_Cmnd *) p->host_scribble;
while ((p) && (item != (struct scsi_cmnd *) p->host_scribble))
p = (struct scsi_cmnd *) p->host_scribble;
if (p) {
/* found a match */
......@@ -3659,11 +3648,10 @@ ips_send_wait(ips_ha_t * ha, ips_scb_t * scb, int timeout, int intr)
/* Routine Name: ips_scmd_buf_write */
/* */
/* Routine Description: */
/* Write data to Scsi_Cmnd request_buffer at proper offsets */
/* Write data to struct scsi_cmnd request_buffer at proper offsets */
/****************************************************************************/
static void
ips_scmd_buf_write(Scsi_Cmnd * scmd, void *data, unsigned
int count)
ips_scmd_buf_write(struct scsi_cmnd *scmd, void *data, unsigned int count)
{
if (scmd->use_sg) {
int i;
......@@ -3698,11 +3686,10 @@ ips_scmd_buf_write(Scsi_Cmnd * scmd, void *data, unsigned
/* Routine Name: ips_scmd_buf_read */
/* */
/* Routine Description: */
/* Copy data from a Scsi_Cmnd to a new, linear buffer */
/* Copy data from a struct scsi_cmnd to a new, linear buffer */
/****************************************************************************/
static void
ips_scmd_buf_read(Scsi_Cmnd * scmd, void *data, unsigned
int count)
ips_scmd_buf_read(struct scsi_cmnd *scmd, void *data, unsigned int count)
{
if (scmd->use_sg) {
int i;
......@@ -7078,7 +7065,7 @@ ips_remove_device(struct pci_dev *pci_dev)
static int __init
ips_module_init(void)
{
if (pci_module_init(&ips_pci_driver) < 0)
if (pci_register_driver(&ips_pci_driver) < 0)
return -ENODEV;
ips_driver_template.module = THIS_MODULE;
ips_order_controllers();
......
......@@ -6,7 +6,7 @@
/* David Jeffery, Adaptec, Inc. */
/* */
/* Copyright (C) 1999 IBM Corporation */
/* Copyright (C) 2003 Adaptec, Inc. */
/* Copyright (C) 2003 Adaptec, Inc. */
/* */
/* 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 */
......@@ -1033,14 +1033,14 @@ typedef struct ips_scb_queue {
* Wait queue_format
*/
typedef struct ips_wait_queue {
Scsi_Cmnd *head;
Scsi_Cmnd *tail;
int count;
struct scsi_cmnd *head;
struct scsi_cmnd *tail;
int count;
} ips_wait_queue_t;
typedef struct ips_copp_wait_item {
Scsi_Cmnd *scsi_cmd;
struct ips_copp_wait_item *next;
struct scsi_cmnd *scsi_cmd;
struct ips_copp_wait_item *next;
} ips_copp_wait_item_t;
typedef struct ips_copp_queue {
......@@ -1149,7 +1149,7 @@ typedef struct ips_scb {
uint32_t flags;
uint32_t op_code;
IPS_SG_LIST sg_list;
Scsi_Cmnd *scsi_cmd;
struct scsi_cmnd *scsi_cmd;
struct ips_scb *q_next;
ips_scb_callback callback;
uint32_t sg_busaddr;
......@@ -1175,7 +1175,7 @@ typedef struct ips_scb_pt {
uint32_t flags;
uint32_t op_code;
IPS_SG_LIST *sg_list;
Scsi_Cmnd *scsi_cmd;
struct scsi_cmnd *scsi_cmd;
struct ips_scb *q_next;
ips_scb_callback callback;
} ips_scb_pt_t;
......
......@@ -389,7 +389,8 @@ lpfc_config_port_post(struct lpfc_hba * phba)
lpfc_init_link(phba, pmb, phba->cfg_topology, phba->cfg_link_speed);
pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
if (lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT) != MBX_SUCCESS) {
rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
if (rc != MBX_SUCCESS) {
lpfc_printf_log(phba,
KERN_ERR,
LOG_INIT,
......@@ -406,7 +407,8 @@ lpfc_config_port_post(struct lpfc_hba * phba)
readl(phba->HAregaddr); /* flush */
phba->hba_state = LPFC_HBA_ERROR;
mempool_free(pmb, phba->mbox_mem_pool);
if (rc != MBX_BUSY)
mempool_free(pmb, phba->mbox_mem_pool);
return -EIO;
}
/* MBOX buffer will be freed in mbox compl */
......
......@@ -175,7 +175,7 @@ typedef struct {
uint8_t max_lun;
uint32_t unique_id;
uint8_t irq;
int irq;
uint8_t ito;
caddr_t ibuf;
dma_addr_t ibuf_dma_h;
......
......@@ -18,9 +18,9 @@
/**
* MegaRAID SAS Driver meta data
*/
#define MEGASAS_VERSION "00.00.03.01"
#define MEGASAS_RELDATE "May 14, 2006"
#define MEGASAS_EXT_VERSION "Sun May 14 22:49:52 PDT 2006"
#define MEGASAS_VERSION "00.00.03.05"
#define MEGASAS_RELDATE "Oct 02, 2006"
#define MEGASAS_EXT_VERSION "Mon Oct 02 11:21:32 PDT 2006"
/*
* Device IDs
......@@ -50,6 +50,7 @@
#define MFI_STATE_WAIT_HANDSHAKE 0x60000000
#define MFI_STATE_FW_INIT_2 0x70000000
#define MFI_STATE_DEVICE_SCAN 0x80000000
#define MFI_STATE_BOOT_MESSAGE_PENDING 0x90000000
#define MFI_STATE_FLUSH_CACHE 0xA0000000
#define MFI_STATE_READY 0xB0000000
#define MFI_STATE_OPERATIONAL 0xC0000000
......@@ -64,12 +65,18 @@
* READY : Move from OPERATIONAL to READY state; discard queue info
* MFIMODE : Discard (possible) low MFA posted in 64-bit mode (??)
* CLR_HANDSHAKE: FW is waiting for HANDSHAKE from BIOS or Driver
* HOTPLUG : Resume from Hotplug
* MFI_STOP_ADP : Send signal to FW to stop processing
*/
#define MFI_INIT_ABORT 0x00000000
#define MFI_INIT_ABORT 0x00000001
#define MFI_INIT_READY 0x00000002
#define MFI_INIT_MFIMODE 0x00000004
#define MFI_INIT_CLEAR_HANDSHAKE 0x00000008
#define MFI_RESET_FLAGS MFI_INIT_READY|MFI_INIT_MFIMODE
#define MFI_INIT_HOTPLUG 0x00000010
#define MFI_STOP_ADP 0x00000020
#define MFI_RESET_FLAGS MFI_INIT_READY| \
MFI_INIT_MFIMODE| \
MFI_INIT_ABORT
/**
* MFI frame flags
......@@ -530,6 +537,8 @@ struct megasas_ctrl_info {
#define MEGASAS_MAX_LUN 8
#define MEGASAS_MAX_LD 64
#define MEGASAS_DBG_LVL 1
/*
* When SCSI mid-layer calls driver's reset routine, driver waits for
* MEGASAS_RESET_WAIT_TIME seconds for all outstanding IO to complete. Note
......@@ -538,6 +547,7 @@ struct megasas_ctrl_info {
* every MEGASAS_RESET_NOTICE_INTERVAL seconds
*/
#define MEGASAS_RESET_WAIT_TIME 180
#define MEGASAS_INTERNAL_CMD_WAIT_TIME 180
#define MEGASAS_RESET_NOTICE_INTERVAL 5
#define MEGASAS_IOCTL_CMD 0
......@@ -1042,6 +1052,7 @@ struct megasas_evt_detail {
void (*fire_cmd)(dma_addr_t ,u32 ,struct megasas_register_set __iomem *);
void (*enable_intr)(struct megasas_register_set __iomem *) ;
void (*disable_intr)(struct megasas_register_set __iomem *);
int (*clear_intr)(struct megasas_register_set __iomem *);
......@@ -1092,6 +1103,7 @@ struct megasas_instance {
u32 hw_crit_error;
struct megasas_instance_template *instancet;
struct tasklet_struct isr_tasklet;
};
#define MEGASAS_IS_LOGICAL(scp) \
......
......@@ -3581,7 +3581,7 @@ static struct pci_driver nsp32_driver = {
*/
static int __init init_nsp32(void) {
nsp32_msg(KERN_INFO, "loading...");
return pci_module_init(&nsp32_driver);
return pci_register_driver(&nsp32_driver);
}
static void __exit exit_nsp32(void) {
......
......@@ -619,47 +619,5 @@ typedef struct _nsp32_hw_data {
#define REQSACK_TIMEOUT_TIME 10000 /* max wait time for REQ/SACK assertion
or negation, 10000us == 10ms */
/**************************************************************************
* Compatibility functions
*/
/* for Kernel 2.4 */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
# define scsi_register_host(template) scsi_register_module(MODULE_SCSI_HA, template)
# define scsi_unregister_host(template) scsi_unregister_module(MODULE_SCSI_HA, template)
# define scsi_host_put(host) scsi_unregister(host)
# define pci_name(pci_dev) ((pci_dev)->slot_name)
typedef void irqreturn_t;
# define IRQ_NONE /* */
# define IRQ_HANDLED /* */
# define IRQ_RETVAL(x) /* */
/* This is ad-hoc version of scsi_host_get_next() */
static inline struct Scsi_Host *scsi_host_get_next(struct Scsi_Host *host)
{
if (host == NULL) {
return scsi_hostlist;
} else {
return host->next;
}
}
/* This is ad-hoc version of scsi_host_hn_get() */
static inline struct Scsi_Host *scsi_host_hn_get(unsigned short hostno)
{
struct Scsi_Host *host;
for (host = scsi_host_get_next(NULL); host != NULL;
host = scsi_host_get_next(host)) {
if (host->host_no == hostno) {
break;
}
}
return host;
}
#endif
#endif /* _NSP32_H */
/* end */
......@@ -4843,8 +4843,7 @@ static int os_scsi_tape_close(struct inode * inode, struct file * filp)
static int osst_ioctl(struct inode * inode,struct file * file,
unsigned int cmd_in, unsigned long arg)
{
int i, cmd_nr, cmd_type, retval = 0;
unsigned int blk;
int i, cmd_nr, cmd_type, blk, retval = 0;
struct st_modedef * STm;
struct st_partstat * STps;
struct osst_request * SRpnt = NULL;
......@@ -5207,12 +5206,12 @@ static struct osst_buffer * new_tape_buffer( int from_initialization, int need_d
priority = GFP_KERNEL;
i = sizeof(struct osst_buffer) + (osst_max_sg_segs - 1) * sizeof(struct scatterlist);
tb = (struct osst_buffer *)kmalloc(i, priority);
tb = kzalloc(i, priority);
if (!tb) {
printk(KERN_NOTICE "osst :I: Can't allocate new tape buffer.\n");
return NULL;
}
memset(tb, 0, i);
tb->sg_segs = tb->orig_sg_segs = 0;
tb->use_sg = max_sg;
tb->in_use = 1;
......@@ -5575,9 +5574,9 @@ static ssize_t osst_version_show(struct device_driver *ddd, char *buf)
static DRIVER_ATTR(version, S_IRUGO, osst_version_show, NULL);
static void osst_create_driverfs_files(struct device_driver *driverfs)
static int osst_create_driverfs_files(struct device_driver *driverfs)
{
driver_create_file(driverfs, &driver_attr_version);
return driver_create_file(driverfs, &driver_attr_version);
}
static void osst_remove_driverfs_files(struct device_driver *driverfs)
......@@ -5663,50 +5662,70 @@ CLASS_DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL);
static struct class *osst_sysfs_class;
static int osst_sysfs_valid = 0;
static void osst_sysfs_init(void)
static int osst_sysfs_init(void)
{
osst_sysfs_class = class_create(THIS_MODULE, "onstream_tape");
if ( IS_ERR(osst_sysfs_class) )
printk(KERN_WARNING "osst :W: Unable to register sysfs class\n");
else
osst_sysfs_valid = 1;
if (IS_ERR(osst_sysfs_class)) {
printk(KERN_ERR "osst :W: Unable to register sysfs class\n");
return PTR_ERR(osst_sysfs_class);
}
return 0;
}
static void osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape * STp, char * name)
static void osst_sysfs_destroy(dev_t dev)
{
struct class_device *osst_class_member;
class_device_destroy(osst_sysfs_class, dev);
}
if (!osst_sysfs_valid) return;
static int osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape * STp, char * name)
{
struct class_device *osst_class_member;
int err;
osst_class_member = class_device_create(osst_sysfs_class, NULL, dev, device, "%s", name);
osst_class_member = class_device_create(osst_sysfs_class, NULL, dev,
device, "%s", name);
if (IS_ERR(osst_class_member)) {
printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name);
return;
return PTR_ERR(osst_class_member);
}
class_set_devdata(osst_class_member, STp);
class_device_create_file(osst_class_member, &class_device_attr_ADR_rev);
class_device_create_file(osst_class_member, &class_device_attr_media_version);
class_device_create_file(osst_class_member, &class_device_attr_capacity);
class_device_create_file(osst_class_member, &class_device_attr_BOT_frame);
class_device_create_file(osst_class_member, &class_device_attr_EOD_frame);
class_device_create_file(osst_class_member, &class_device_attr_file_count);
}
err = class_device_create_file(osst_class_member,
&class_device_attr_ADR_rev);
if (err)
goto err_out;
err = class_device_create_file(osst_class_member,
&class_device_attr_media_version);
if (err)
goto err_out;
err = class_device_create_file(osst_class_member,
&class_device_attr_capacity);
if (err)
goto err_out;
err = class_device_create_file(osst_class_member,
&class_device_attr_BOT_frame);
if (err)
goto err_out;
err = class_device_create_file(osst_class_member,
&class_device_attr_EOD_frame);
if (err)
goto err_out;
err = class_device_create_file(osst_class_member,
&class_device_attr_file_count);
if (err)
goto err_out;
static void osst_sysfs_destroy(dev_t dev)
{
if (!osst_sysfs_valid) return;
return 0;
class_device_destroy(osst_sysfs_class, dev);
err_out:
osst_sysfs_destroy(dev);
return err;
}
static void osst_sysfs_cleanup(void)
{
if (osst_sysfs_valid) {
class_destroy(osst_sysfs_class);
osst_sysfs_valid = 0;
}
class_destroy(osst_sysfs_class);
}
/*
......@@ -5721,7 +5740,7 @@ static int osst_probe(struct device *dev)
struct st_partstat * STps;
struct osst_buffer * buffer;
struct gendisk * drive;
int i, dev_num;
int i, dev_num, err = -ENODEV;
if (SDp->type != TYPE_TAPE || !osst_supports(SDp))
return -ENODEV;
......@@ -5849,13 +5868,20 @@ static int osst_probe(struct device *dev)
init_MUTEX(&tpnt->lock);
osst_nr_dev++;
write_unlock(&os_scsi_tapes_lock);
{
char name[8];
/* Rewind entry */
osst_sysfs_add(MKDEV(OSST_MAJOR, dev_num), dev, tpnt, tape_name(tpnt));
err = osst_sysfs_add(MKDEV(OSST_MAJOR, dev_num), dev, tpnt, tape_name(tpnt));
if (err)
goto out_free_buffer;
/* No-rewind entry */
snprintf(name, 8, "%s%s", "n", tape_name(tpnt));
osst_sysfs_add(MKDEV(OSST_MAJOR, dev_num + 128), dev, tpnt, name);
err = osst_sysfs_add(MKDEV(OSST_MAJOR, dev_num + 128), dev, tpnt, name);
if (err)
goto out_free_sysfs1;
}
sdev_printk(KERN_INFO, SDp,
......@@ -5864,9 +5890,13 @@ static int osst_probe(struct device *dev)
return 0;
out_free_sysfs1:
osst_sysfs_destroy(MKDEV(OSST_MAJOR, dev_num));
out_free_buffer:
kfree(buffer);
out_put_disk:
put_disk(drive);
return -ENODEV;
return err;
};
static int osst_remove(struct device *dev)
......@@ -5903,19 +5933,39 @@ static int osst_remove(struct device *dev)
static int __init init_osst(void)
{
int err;
printk(KERN_INFO "osst :I: Tape driver with OnStream support version %s\nosst :I: %s\n", osst_version, cvsid);
validate_options();
osst_sysfs_init();
if ((register_chrdev(OSST_MAJOR,"osst", &osst_fops) < 0) || scsi_register_driver(&osst_template.gendrv)) {
err = osst_sysfs_init();
if (err)
return err;
err = register_chrdev(OSST_MAJOR, "osst", &osst_fops);
if (err < 0) {
printk(KERN_ERR "osst :E: Unable to register major %d for OnStream tapes\n", OSST_MAJOR);
osst_sysfs_cleanup();
return 1;
goto err_out;
}
osst_create_driverfs_files(&osst_template.gendrv);
err = scsi_register_driver(&osst_template.gendrv);
if (err)
goto err_out_chrdev;
err = osst_create_driverfs_files(&osst_template.gendrv);
if (err)
goto err_out_scsidrv;
return 0;
err_out_scsidrv:
scsi_unregister_driver(&osst_template.gendrv);
err_out_chrdev:
unregister_chrdev(OSST_MAJOR, "osst");
err_out:
osst_sysfs_cleanup();
return err;
}
static void __exit exit_osst (void)
......
......@@ -80,7 +80,6 @@ static int free_ports = 0;
module_param(free_ports, bool, 0);
MODULE_PARM_DESC(free_ports, "Release IO ports after configuration? (default: 0 (=no))");
/* /usr/src/linux/drivers/scsi/hosts.h */
static struct scsi_host_template nsp_driver_template = {
.proc_name = "nsp_cs",
.proc_info = nsp_proc_info,
......
......@@ -2862,7 +2862,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
memset(((char *)pkt + 8), 0, (REQUEST_ENTRY_SIZE - 8));
/* Set ISP command timeout. */
pkt->timeout = cpu_to_le16(30);
pkt->timeout = cpu_to_le16(cmd->timeout_per_command/HZ);
/* Set device target ID and LUN */
pkt->lun = SCSI_LUN_32(cmd);
......@@ -3161,7 +3161,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
memset(((char *)pkt + 8), 0, (REQUEST_ENTRY_SIZE - 8));
/* Set ISP command timeout. */
pkt->timeout = cpu_to_le16(30);
pkt->timeout = cpu_to_le16(cmd->timeout_per_command/HZ);
/* Set device target ID and LUN */
pkt->lun = SCSI_LUN_32(cmd);
......@@ -4484,7 +4484,7 @@ qla1280_init(void)
qla1280_setup(qla1280);
#endif
return pci_module_init(&qla1280_pci_driver);
return pci_register_driver(&qla1280_pci_driver);
}
static void __exit
......
......@@ -691,13 +691,13 @@ qla2x00_get_host_speed(struct Scsi_Host *shost)
uint32_t speed = 0;
switch (ha->link_data_rate) {
case LDR_1GB:
case PORT_SPEED_1GB:
speed = 1;
break;
case LDR_2GB:
case PORT_SPEED_2GB:
speed = 2;
break;
case LDR_4GB:
case PORT_SPEED_4GB:
speed = 4;
break;
}
......@@ -849,6 +849,49 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
return pfc_host_stat;
}
static void
qla2x00_get_host_symbolic_name(struct Scsi_Host *shost)
{
scsi_qla_host_t *ha = to_qla_host(shost);
qla2x00_get_sym_node_name(ha, fc_host_symbolic_name(shost));
}
static void
qla2x00_set_host_system_hostname(struct Scsi_Host *shost)
{
scsi_qla_host_t *ha = to_qla_host(shost);
set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags);
}
static void
qla2x00_get_host_fabric_name(struct Scsi_Host *shost)
{
scsi_qla_host_t *ha = to_qla_host(shost);
u64 node_name;
if (ha->device_flags & SWITCH_FOUND)
node_name = wwn_to_u64(ha->fabric_node_name);
else
node_name = wwn_to_u64(ha->node_name);
fc_host_fabric_name(shost) = node_name;
}
static void
qla2x00_get_host_port_state(struct Scsi_Host *shost)
{
scsi_qla_host_t *ha = to_qla_host(shost);
if (!ha->flags.online)
fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE;
else if (atomic_read(&ha->loop_state) == LOOP_TIMEOUT)
fc_host_port_state(shost) = FC_PORTSTATE_UNKNOWN;
else
fc_host_port_state(shost) = FC_PORTSTATE_ONLINE;
}
struct fc_function_template qla2xxx_transport_functions = {
.show_host_node_name = 1,
......@@ -861,6 +904,14 @@ struct fc_function_template qla2xxx_transport_functions = {
.show_host_speed = 1,
.get_host_port_type = qla2x00_get_host_port_type,
.show_host_port_type = 1,
.get_host_symbolic_name = qla2x00_get_host_symbolic_name,
.show_host_symbolic_name = 1,
.set_host_system_hostname = qla2x00_set_host_system_hostname,
.show_host_system_hostname = 1,
.get_host_fabric_name = qla2x00_get_host_fabric_name,
.show_host_fabric_name = 1,
.get_host_port_state = qla2x00_get_host_port_state,
.show_host_port_state = 1,
.dd_fcrport_size = sizeof(struct fc_port *),
.show_rport_supported_classes = 1,
......
......@@ -608,6 +608,7 @@ typedef struct {
*/
#define MBC_SERDES_PARAMS 0x10 /* Serdes Tx Parameters. */
#define MBC_GET_IOCB_STATUS 0x12 /* Get IOCB status command. */
#define MBC_PORT_PARAMS 0x1A /* Port iDMA Parameters. */
#define MBC_GET_TIMEOUT_PARAMS 0x22 /* Get FW timeouts. */
#define MBC_TRACE_CONTROL 0x27 /* Trace control command. */
#define MBC_GEN_SYSTEM_ERROR 0x2a /* Generate System Error. */
......@@ -1497,6 +1498,9 @@ typedef struct {
port_id_t d_id;
uint8_t node_name[WWN_SIZE];
uint8_t port_name[WWN_SIZE];
uint8_t fabric_port_name[WWN_SIZE];
uint16_t fp_speeds;
uint16_t fp_speed;
} sw_info_t;
/*
......@@ -1524,6 +1528,9 @@ typedef struct fc_port {
uint16_t loop_id;
uint16_t old_loop_id;
uint8_t fabric_port_name[WWN_SIZE];
uint16_t fp_speed;
fc_port_type_t port_type;
atomic_t state;
......@@ -1635,6 +1642,15 @@ typedef struct fc_port {
#define RSNN_NN_REQ_SIZE (16 + 8 + 1 + 255)
#define RSNN_NN_RSP_SIZE 16
#define GFPN_ID_CMD 0x11C
#define GFPN_ID_REQ_SIZE (16 + 4)
#define GFPN_ID_RSP_SIZE (16 + 8)
#define GPSC_CMD 0x127
#define GPSC_REQ_SIZE (16 + 8)
#define GPSC_RSP_SIZE (16 + 2 + 2)
/*
* HBA attribute types.
*/
......@@ -1748,7 +1764,7 @@ struct ct_sns_req {
uint8_t reserved[3];
union {
/* GA_NXT, GPN_ID, GNN_ID, GFT_ID */
/* GA_NXT, GPN_ID, GNN_ID, GFT_ID, GFPN_ID */
struct {
uint8_t reserved;
uint8_t port_id[3];
......@@ -1823,6 +1839,10 @@ struct ct_sns_req {
struct {
uint8_t port_name[8];
} dpa;
struct {
uint8_t port_name[8];
} gpsc;
} req;
};
......@@ -1886,6 +1906,15 @@ struct ct_sns_rsp {
uint8_t port_name[8];
struct ct_fdmi_hba_attributes attrs;
} ghat;
struct {
uint8_t port_name[8];
} gfpn_id;
struct {
uint16_t speeds;
uint16_t speed;
} gpsc;
} rsp;
};
......@@ -2182,11 +2211,11 @@ typedef struct scsi_qla_host {
uint16_t max_public_loop_ids;
uint16_t min_external_loopid; /* First external loop Id */
#define PORT_SPEED_UNKNOWN 0xFFFF
#define PORT_SPEED_1GB 0x00
#define PORT_SPEED_2GB 0x01
#define PORT_SPEED_4GB 0x03
uint16_t link_data_rate; /* F/W operating speed */
#define LDR_1GB 0
#define LDR_2GB 1
#define LDR_4GB 3
#define LDR_UNKNOWN 0xFFFF
uint8_t current_topology;
uint8_t prev_topology;
......@@ -2333,6 +2362,7 @@ typedef struct scsi_qla_host {
uint8_t *node_name;
uint8_t *port_name;
uint8_t fabric_node_name[WWN_SIZE];
uint32_t isp_abort_cnt;
/* Option ROM information. */
......
......@@ -208,6 +208,12 @@ qla2x00_trace_control(scsi_qla_host_t *, uint16_t, dma_addr_t, uint16_t);
extern int
qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t, uint16_t);
extern int
qla2x00_get_idma_speed(scsi_qla_host_t *, uint16_t, uint16_t *, uint16_t *);
extern int
qla2x00_set_idma_speed(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t *);
/*
* Global Function Prototypes in qla_isr.c source file.
*/
......@@ -279,6 +285,9 @@ extern int qla2x00_rsnn_nn(scsi_qla_host_t *);
extern void *qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
extern void *qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
extern int qla2x00_fdmi_register(scsi_qla_host_t *);
extern int qla2x00_gfpn_id(scsi_qla_host_t *, sw_info_t *);
extern int qla2x00_gpsc(scsi_qla_host_t *, sw_info_t *);
extern void qla2x00_get_sym_node_name(scsi_qla_host_t *, uint8_t *);
/*
* Global Function Prototypes in qla_attr.c source file.
......
......@@ -612,6 +612,14 @@ qla2x00_rnn_id(scsi_qla_host_t *ha)
return (rval);
}
void
qla2x00_get_sym_node_name(scsi_qla_host_t *ha, uint8_t *snn)
{
sprintf(snn, "%s FW:v%d.%02d.%02d DVR:v%s",ha->model_number,
ha->fw_major_version, ha->fw_minor_version,
ha->fw_subminor_version, qla2x00_version_str);
}
/**
* qla2x00_rsnn_nn() - SNS Register Symbolic Node Name (RSNN_NN) of the HBA.
* @ha: HA context
......@@ -622,9 +630,6 @@ int
qla2x00_rsnn_nn(scsi_qla_host_t *ha)
{
int rval;
uint8_t *snn;
uint8_t version[20];
ms_iocb_entry_t *ms_pkt;
struct ct_sns_req *ct_req;
struct ct_sns_rsp *ct_rsp;
......@@ -649,20 +654,11 @@ qla2x00_rsnn_nn(scsi_qla_host_t *ha)
memcpy(ct_req->req.rsnn_nn.node_name, ha->node_name, WWN_SIZE);
/* Prepare the Symbolic Node Name */
/* Board type */
snn = ct_req->req.rsnn_nn.sym_node_name;
strcpy(snn, ha->model_number);
/* Firmware version */
strcat(snn, " FW:v");
sprintf(version, "%d.%02d.%02d", ha->fw_major_version,
ha->fw_minor_version, ha->fw_subminor_version);
strcat(snn, version);
/* Driver version */
strcat(snn, " DVR:v");
strcat(snn, qla2x00_version_str);
qla2x00_get_sym_node_name(ha, ct_req->req.rsnn_nn.sym_node_name);
/* Calculate SNN length */
ct_req->req.rsnn_nn.name_len = (uint8_t)strlen(snn);
ct_req->req.rsnn_nn.name_len =
(uint8_t)strlen(ct_req->req.rsnn_nn.sym_node_name);
/* Update MS IOCB request */
ms_pkt->req_bytecount =
......@@ -687,7 +683,6 @@ qla2x00_rsnn_nn(scsi_qla_host_t *ha)
return (rval);
}
/**
* qla2x00_prep_sns_cmd() - Prepare common SNS command request fields for query.
* @ha: HA context
......@@ -1585,6 +1580,21 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *ha)
DEBUG13(printk("%s(%ld): OS_DEVICE_NAME=%s.\n", __func__, ha->host_no,
eiter->a.os_dev_name));
/* Hostname. */
if (strlen(fc_host_system_hostname(ha->host))) {
eiter = (struct ct_fdmi_port_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_PORT_HOST_NAME);
snprintf(eiter->a.host_name, sizeof(eiter->a.host_name),
"%s", fc_host_system_hostname(ha->host));
alen = strlen(eiter->a.host_name);
alen += (alen & 3) ? (4 - (alen & 3)) : 4;
eiter->len = cpu_to_be16(4 + alen);
size += 4 + alen;
DEBUG13(printk("%s(%ld): HOSTNAME=%s.\n", __func__,
ha->host_no, eiter->a.host_name));
}
/* Update MS request size. */
qla2x00_update_ms_fdmi_iocb(ha, size + 16);
......@@ -1647,3 +1657,189 @@ qla2x00_fdmi_register(scsi_qla_host_t *ha)
return rval;
}
/**
* qla2x00_gfpn_id() - SNS Get Fabric Port Name (GFPN_ID) query.
* @ha: HA context
* @list: switch info entries to populate
*
* Returns 0 on success.
*/
int
qla2x00_gfpn_id(scsi_qla_host_t *ha, sw_info_t *list)
{
int rval;
uint16_t i;
ms_iocb_entry_t *ms_pkt;
struct ct_sns_req *ct_req;
struct ct_sns_rsp *ct_rsp;
if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
return QLA_FUNCTION_FAILED;
for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
/* Issue GFPN_ID */
memset(list[i].fabric_port_name, 0, WWN_SIZE);
/* Prepare common MS IOCB */
ms_pkt = qla2x00_prep_ms_iocb(ha, GFPN_ID_REQ_SIZE,
GFPN_ID_RSP_SIZE);
/* Prepare CT request */
ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GFPN_ID_CMD,
GFPN_ID_RSP_SIZE);
ct_rsp = &ha->ct_sns->p.rsp;
/* Prepare CT arguments -- port_id */
ct_req->req.port_id.port_id[0] = list[i].d_id.b.domain;
ct_req->req.port_id.port_id[1] = list[i].d_id.b.area;
ct_req->req.port_id.port_id[2] = list[i].d_id.b.al_pa;
/* Execute MS IOCB */
rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma,
sizeof(ms_iocb_entry_t));
if (rval != QLA_SUCCESS) {
/*EMPTY*/
DEBUG2_3(printk("scsi(%ld): GFPN_ID issue IOCB "
"failed (%d).\n", ha->host_no, rval));
} else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp,
"GFPN_ID") != QLA_SUCCESS) {
rval = QLA_FUNCTION_FAILED;
} else {
/* Save fabric portname */
memcpy(list[i].fabric_port_name,
ct_rsp->rsp.gfpn_id.port_name, WWN_SIZE);
}
/* Last device exit. */
if (list[i].d_id.b.rsvd_1 != 0)
break;
}
return (rval);
}
static inline void *
qla24xx_prep_ms_fm_iocb(scsi_qla_host_t *ha, uint32_t req_size,
uint32_t rsp_size)
{
struct ct_entry_24xx *ct_pkt;
ct_pkt = (struct ct_entry_24xx *)ha->ms_iocb;
memset(ct_pkt, 0, sizeof(struct ct_entry_24xx));
ct_pkt->entry_type = CT_IOCB_TYPE;
ct_pkt->entry_count = 1;
ct_pkt->nport_handle = cpu_to_le16(ha->mgmt_svr_loop_id);
ct_pkt->timeout = __constant_cpu_to_le16(59);
ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1);
ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size);
ct_pkt->cmd_byte_count = cpu_to_le32(req_size);
ct_pkt->dseg_0_address[0] = cpu_to_le32(LSD(ha->ct_sns_dma));
ct_pkt->dseg_0_address[1] = cpu_to_le32(MSD(ha->ct_sns_dma));
ct_pkt->dseg_0_len = ct_pkt->cmd_byte_count;
ct_pkt->dseg_1_address[0] = cpu_to_le32(LSD(ha->ct_sns_dma));
ct_pkt->dseg_1_address[1] = cpu_to_le32(MSD(ha->ct_sns_dma));
ct_pkt->dseg_1_len = ct_pkt->rsp_byte_count;
return ct_pkt;
}
static inline struct ct_sns_req *
qla24xx_prep_ct_fm_req(struct ct_sns_req *ct_req, uint16_t cmd,
uint16_t rsp_size)
{
memset(ct_req, 0, sizeof(struct ct_sns_pkt));
ct_req->header.revision = 0x01;
ct_req->header.gs_type = 0xFA;
ct_req->header.gs_subtype = 0x01;
ct_req->command = cpu_to_be16(cmd);
ct_req->max_rsp_size = cpu_to_be16((rsp_size - 16) / 4);
return ct_req;
}
/**
* qla2x00_gpsc() - FCS Get Port Speed Capabilities (GPSC) query.
* @ha: HA context
* @list: switch info entries to populate
*
* Returns 0 on success.
*/
int
qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list)
{
int rval;
uint16_t i;
ms_iocb_entry_t *ms_pkt;
struct ct_sns_req *ct_req;
struct ct_sns_rsp *ct_rsp;
if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
return QLA_FUNCTION_FAILED;
rval = qla2x00_mgmt_svr_login(ha);
if (rval)
return rval;
for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
/* Issue GFPN_ID */
list[i].fp_speeds = list[i].fp_speed = 0;
/* Prepare common MS IOCB */
ms_pkt = qla24xx_prep_ms_fm_iocb(ha, GPSC_REQ_SIZE,
GPSC_RSP_SIZE);
/* Prepare CT request */
ct_req = qla24xx_prep_ct_fm_req(&ha->ct_sns->p.req,
GPSC_CMD, GPSC_RSP_SIZE);
ct_rsp = &ha->ct_sns->p.rsp;
/* Prepare CT arguments -- port_name */
memcpy(ct_req->req.gpsc.port_name, list[i].fabric_port_name,
WWN_SIZE);
/* Execute MS IOCB */
rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma,
sizeof(ms_iocb_entry_t));
if (rval != QLA_SUCCESS) {
/*EMPTY*/
DEBUG2_3(printk("scsi(%ld): GPSC issue IOCB "
"failed (%d).\n", ha->host_no, rval));
} else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp,
"GPSC") != QLA_SUCCESS) {
rval = QLA_FUNCTION_FAILED;
} else {
/* Save portname */
list[i].fp_speeds = ct_rsp->rsp.gpsc.speeds;
list[i].fp_speed = ct_rsp->rsp.gpsc.speed;
DEBUG2_3(printk("scsi(%ld): GPSC ext entry - "
"fpn %02x%02x%02x%02x%02x%02x%02x%02x speeds=%04x "
"speed=%04x.\n", ha->host_no,
list[i].fabric_port_name[0],
list[i].fabric_port_name[1],
list[i].fabric_port_name[2],
list[i].fabric_port_name[3],
list[i].fabric_port_name[4],
list[i].fabric_port_name[5],
list[i].fabric_port_name[6],
list[i].fabric_port_name[7],
be16_to_cpu(list[i].fp_speeds),
be16_to_cpu(list[i].fp_speed)));
}
/* Last device exit. */
if (list[i].d_id.b.rsvd_1 != 0)
break;
}
return (rval);
}
......@@ -2074,6 +2074,19 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha)
new_fcport->flags &= ~FCF_FABRIC_DEVICE;
}
/* Base iIDMA settings on HBA port speed. */
switch (ha->link_data_rate) {
case PORT_SPEED_1GB:
fcport->fp_speed = cpu_to_be16(BIT_15);
break;
case PORT_SPEED_2GB:
fcport->fp_speed = cpu_to_be16(BIT_14);
break;
case PORT_SPEED_4GB:
fcport->fp_speed = cpu_to_be16(BIT_13);
break;
}
qla2x00_update_fcport(ha, fcport);
found_devs++;
......@@ -2109,6 +2122,62 @@ qla2x00_probe_for_all_luns(scsi_qla_host_t *ha)
}
}
static void
qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport)
{
#define LS_UNKNOWN 2
static char *link_speeds[5] = { "1", "2", "?", "4" };
int rval;
uint16_t port_speed, mb[6];
if (!IS_QLA24XX(ha))
return;
switch (be16_to_cpu(fcport->fp_speed)) {
case BIT_15:
port_speed = PORT_SPEED_1GB;
break;
case BIT_14:
port_speed = PORT_SPEED_2GB;
break;
case BIT_13:
port_speed = PORT_SPEED_4GB;
break;
default:
DEBUG2(printk("scsi(%ld): %02x%02x%02x%02x%02x%02x%02x%02x -- "
"unsupported FM port operating speed (%04x).\n",
ha->host_no, fcport->port_name[0], fcport->port_name[1],
fcport->port_name[2], fcport->port_name[3],
fcport->port_name[4], fcport->port_name[5],
fcport->port_name[6], fcport->port_name[7],
be16_to_cpu(fcport->fp_speed)));
port_speed = PORT_SPEED_UNKNOWN;
break;
}
if (port_speed == PORT_SPEED_UNKNOWN)
return;
rval = qla2x00_set_idma_speed(ha, fcport->loop_id, port_speed, mb);
if (rval != QLA_SUCCESS) {
DEBUG2(printk("scsi(%ld): Unable to adjust iIDMA "
"%02x%02x%02x%02x%02x%02x%02x%02x -- %04x %x %04x %04x.\n",
ha->host_no, fcport->port_name[0], fcport->port_name[1],
fcport->port_name[2], fcport->port_name[3],
fcport->port_name[4], fcport->port_name[5],
fcport->port_name[6], fcport->port_name[7], rval,
port_speed, mb[0], mb[1]));
} else {
DEBUG2(qla_printk(KERN_INFO, ha,
"iIDMA adjusted to %s GB/s on "
"%02x%02x%02x%02x%02x%02x%02x%02x.\n",
link_speeds[port_speed], fcport->port_name[0],
fcport->port_name[1], fcport->port_name[2],
fcport->port_name[3], fcport->port_name[4],
fcport->port_name[5], fcport->port_name[6],
fcport->port_name[7]));
}
}
/*
* qla2x00_update_fcport
* Updates device on list.
......@@ -2135,6 +2204,8 @@ qla2x00_update_fcport(scsi_qla_host_t *ha, fc_port_t *fcport)
PORT_RETRY_TIME);
fcport->flags &= ~FCF_LOGIN_NEEDED;
qla2x00_iidma_fcport(ha, fcport);
atomic_set(&fcport->state, FCS_ONLINE);
if (ha->flags.init_done)
......@@ -2209,7 +2280,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *ha)
loop_id = NPH_F_PORT;
else
loop_id = SNS_FL_PORT;
rval = qla2x00_get_port_name(ha, loop_id, NULL, 0);
rval = qla2x00_get_port_name(ha, loop_id, ha->fabric_node_name, 1);
if (rval != QLA_SUCCESS) {
DEBUG2(printk("scsi(%ld): MBC_GET_PORT_NAME Failed, No FL "
"Port\n", ha->host_no));
......@@ -2217,6 +2288,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *ha)
ha->device_flags &= ~SWITCH_FOUND;
return (QLA_SUCCESS);
}
ha->device_flags |= SWITCH_FOUND;
/* Mark devices that need re-synchronization. */
rval2 = qla2x00_device_resync(ha);
......@@ -2416,6 +2488,8 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
} else if (qla2x00_gnn_id(ha, swl) != QLA_SUCCESS) {
kfree(swl);
swl = NULL;
} else if (qla2x00_gfpn_id(ha, swl) == QLA_SUCCESS) {
qla2x00_gpsc(ha, swl);
}
}
swl_idx = 0;
......@@ -2450,6 +2524,9 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
swl[swl_idx].node_name, WWN_SIZE);
memcpy(new_fcport->port_name,
swl[swl_idx].port_name, WWN_SIZE);
memcpy(new_fcport->fabric_port_name,
swl[swl_idx].fabric_port_name, WWN_SIZE);
new_fcport->fp_speed = swl[swl_idx].fp_speed;
if (swl[swl_idx].d_id.b.rsvd_1 != 0) {
last_dev = 1;
......@@ -2507,6 +2584,11 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
found++;
/* Update port state. */
memcpy(fcport->fabric_port_name,
new_fcport->fabric_port_name, WWN_SIZE);
fcport->fp_speed = new_fcport->fp_speed;
/*
* If address the same and state FCS_ONLINE, nothing
* changed.
......
......@@ -400,7 +400,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
case MBA_LOOP_UP: /* Loop Up Event */
if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
link_speed = link_speeds[0];
ha->link_data_rate = LDR_1GB;
ha->link_data_rate = PORT_SPEED_1GB;
} else {
link_speed = link_speeds[LS_UNKNOWN];
if (mb[1] < 5)
......@@ -429,7 +429,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
}
ha->flags.management_server_logged_in = 0;
ha->link_data_rate = LDR_UNKNOWN;
ha->link_data_rate = PORT_SPEED_UNKNOWN;
if (ql2xfdmienable)
set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags);
break;
......
......@@ -2540,3 +2540,89 @@ qla2x00_read_sfp(scsi_qla_host_t *ha, dma_addr_t sfp_dma, uint16_t addr,
return rval;
}
int
qla2x00_get_idma_speed(scsi_qla_host_t *ha, uint16_t loop_id,
uint16_t *port_speed, uint16_t *mb)
{
int rval;
mbx_cmd_t mc;
mbx_cmd_t *mcp = &mc;
if (!IS_QLA24XX(ha))
return QLA_FUNCTION_FAILED;
DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
mcp->mb[0] = MBC_PORT_PARAMS;
mcp->mb[1] = loop_id;
mcp->mb[2] = mcp->mb[3] = mcp->mb[4] = mcp->mb[5] = 0;
mcp->out_mb = MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
mcp->in_mb = MBX_5|MBX_4|MBX_3|MBX_1|MBX_0;
mcp->tov = 30;
mcp->flags = 0;
rval = qla2x00_mailbox_command(ha, mcp);
/* Return mailbox statuses. */
if (mb != NULL) {
mb[0] = mcp->mb[0];
mb[1] = mcp->mb[1];
mb[3] = mcp->mb[3];
mb[4] = mcp->mb[4];
mb[5] = mcp->mb[5];
}
if (rval != QLA_SUCCESS) {
DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__,
ha->host_no, rval));
} else {
DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
if (port_speed)
*port_speed = mcp->mb[3];
}
return rval;
}
int
qla2x00_set_idma_speed(scsi_qla_host_t *ha, uint16_t loop_id,
uint16_t port_speed, uint16_t *mb)
{
int rval;
mbx_cmd_t mc;
mbx_cmd_t *mcp = &mc;
if (!IS_QLA24XX(ha))
return QLA_FUNCTION_FAILED;
DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
mcp->mb[0] = MBC_PORT_PARAMS;
mcp->mb[1] = loop_id;
mcp->mb[2] = BIT_0;
mcp->mb[3] = port_speed & (BIT_2|BIT_1|BIT_0);
mcp->mb[4] = mcp->mb[5] = 0;
mcp->out_mb = MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
mcp->in_mb = MBX_5|MBX_4|MBX_3|MBX_1|MBX_0;
mcp->tov = 30;
mcp->flags = 0;
rval = qla2x00_mailbox_command(ha, mcp);
/* Return mailbox statuses. */
if (mb != NULL) {
mb[0] = mcp->mb[0];
mb[1] = mcp->mb[1];
mb[3] = mcp->mb[3];
mb[4] = mcp->mb[4];
mb[5] = mcp->mb[5];
}
if (rval != QLA_SUCCESS) {
DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__,
ha->host_no, rval));
} else {
DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
}
return rval;
}
......@@ -589,6 +589,23 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
return (return_status);
}
static void
qla2x00_block_error_handler(struct scsi_cmnd *cmnd)
{
struct Scsi_Host *shost = cmnd->device->host;
struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device));
unsigned long flags;
spin_lock_irqsave(shost->host_lock, flags);
while (rport->port_state == FC_PORTSTATE_BLOCKED) {
spin_unlock_irqrestore(shost->host_lock, flags);
msleep(1000);
spin_lock_irqsave(shost->host_lock, flags);
}
spin_unlock_irqrestore(shost->host_lock, flags);
return;
}
/**************************************************************************
* qla2xxx_eh_abort
*
......@@ -615,6 +632,8 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
unsigned long flags;
int wait = 0;
qla2x00_block_error_handler(cmd);
if (!CMD_SP(cmd))
return SUCCESS;
......@@ -748,6 +767,8 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
unsigned int id, lun;
unsigned long serial;
qla2x00_block_error_handler(cmd);
ret = FAILED;
id = cmd->device->id;
......@@ -877,6 +898,8 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
unsigned int id, lun;
unsigned long serial;
qla2x00_block_error_handler(cmd);
ret = FAILED;
id = cmd->device->id;
......@@ -936,6 +959,8 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
unsigned int id, lun;
unsigned long serial;
qla2x00_block_error_handler(cmd);
ret = FAILED;
id = cmd->device->id;
......@@ -1385,7 +1410,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
ha->prev_topology = 0;
ha->init_cb_size = sizeof(init_cb_t);
ha->mgmt_svr_loop_id = MANAGEMENT_SERVER;
ha->link_data_rate = LDR_UNKNOWN;
ha->link_data_rate = PORT_SPEED_UNKNOWN;
ha->optrom_size = OPTROM_SIZE_2300;
/* Assign ISP specific operations. */
......@@ -2564,14 +2589,20 @@ qla2x00_down_timeout(struct semaphore *sema, unsigned long timeout)
#define FW_ISP2322 3
#define FW_ISP24XX 4
#define FW_FILE_ISP21XX "ql2100_fw.bin"
#define FW_FILE_ISP22XX "ql2200_fw.bin"
#define FW_FILE_ISP2300 "ql2300_fw.bin"
#define FW_FILE_ISP2322 "ql2322_fw.bin"
#define FW_FILE_ISP24XX "ql2400_fw.bin"
static DECLARE_MUTEX(qla_fw_lock);
static struct fw_blob qla_fw_blobs[FW_BLOBS] = {
{ .name = "ql2100_fw.bin", .segs = { 0x1000, 0 }, },
{ .name = "ql2200_fw.bin", .segs = { 0x1000, 0 }, },
{ .name = "ql2300_fw.bin", .segs = { 0x800, 0 }, },
{ .name = "ql2322_fw.bin", .segs = { 0x800, 0x1c000, 0x1e000, 0 }, },
{ .name = "ql2400_fw.bin", },
{ .name = FW_FILE_ISP21XX, .segs = { 0x1000, 0 }, },
{ .name = FW_FILE_ISP22XX, .segs = { 0x1000, 0 }, },
{ .name = FW_FILE_ISP2300, .segs = { 0x800, 0 }, },
{ .name = FW_FILE_ISP2322, .segs = { 0x800, 0x1c000, 0x1e000, 0 }, },
{ .name = FW_FILE_ISP24XX, },
};
struct fw_blob *
......@@ -2702,3 +2733,8 @@ MODULE_AUTHOR("QLogic Corporation");
MODULE_DESCRIPTION("QLogic Fibre Channel HBA Driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(QLA2XXX_VERSION);
MODULE_FIRMWARE(FW_FILE_ISP21XX);
MODULE_FIRMWARE(FW_FILE_ISP22XX);
MODULE_FIRMWARE(FW_FILE_ISP2300);
MODULE_FIRMWARE(FW_FILE_ISP2322);
MODULE_FIRMWARE(FW_FILE_ISP24XX);
......@@ -7,7 +7,7 @@
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.01.07-k1"
#define QLA2XXX_VERSION "8.01.07-k2"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 1
......
config SCSI_QLA_ISCSI
tristate "QLogic ISP4XXX host adapter family support"
depends on PCI && SCSI
select SCSI_ISCSI_ATTRS
---help---
This driver supports the QLogic 40xx (ISP4XXX) iSCSI host
adapter family.
qla4xxx-y := ql4_os.o ql4_init.o ql4_mbx.o ql4_iocb.o ql4_isr.o \
ql4_nvram.o ql4_dbg.o
obj-$(CONFIG_SCSI_QLA_ISCSI) += qla4xxx.o
/*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2006 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#include "ql4_def.h"
#include <scsi/scsi_dbg.h>
static void qla4xxx_print_srb_info(struct srb * srb)
{
printk("%s: srb = 0x%p, flags=0x%02x\n", __func__, srb, srb->flags);
printk("%s: cmd = 0x%p, saved_dma_handle = 0x%lx\n",
__func__, srb->cmd, (unsigned long) srb->dma_handle);
printk("%s: fw_ddb_index = %d, lun = %d\n",
__func__, srb->fw_ddb_index, srb->cmd->device->lun);
printk("%s: iocb_tov = %d\n",
__func__, srb->iocb_tov);
printk("%s: cc_stat = 0x%x, r_start = 0x%lx, u_start = 0x%lx\n\n",
__func__, srb->cc_stat, srb->r_start, srb->u_start);
}
void qla4xxx_print_scsi_cmd(struct scsi_cmnd *cmd)
{
printk("SCSI Command = 0x%p, Handle=0x%p\n", cmd, cmd->host_scribble);
printk(" b=%d, t=%02xh, l=%02xh, cmd_len = %02xh\n",
cmd->device->channel, cmd->device->id, cmd->device->lun,
cmd->cmd_len);
scsi_print_command(cmd);
printk(" seg_cnt = %d\n", cmd->use_sg);
printk(" request buffer = 0x%p, request buffer len = 0x%x\n",
cmd->request_buffer, cmd->request_bufflen);
if (cmd->use_sg) {
struct scatterlist *sg;
sg = (struct scatterlist *)cmd->request_buffer;
printk(" SG buffer: \n");
qla4xxx_dump_buffer((caddr_t) sg,
(cmd->use_sg * sizeof(*sg)));
}
printk(" tag = %d, transfersize = 0x%x \n", cmd->tag,
cmd->transfersize);
printk(" Pid = %d, SP = 0x%p\n", (int)cmd->pid, cmd->SCp.ptr);
printk(" underflow size = 0x%x, direction=0x%x\n", cmd->underflow,
cmd->sc_data_direction);
printk(" Current time (jiffies) = 0x%lx, "
"timeout expires = 0x%lx\n", jiffies, cmd->eh_timeout.expires);
qla4xxx_print_srb_info((struct srb *) cmd->SCp.ptr);
}
void __dump_registers(struct scsi_qla_host *ha)
{
uint8_t i;
for (i = 0; i < MBOX_REG_COUNT; i++) {
printk(KERN_INFO "0x%02X mailbox[%d] = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg, mailbox[i]), i,
readw(&ha->reg->mailbox[i]));
}
printk(KERN_INFO "0x%02X flash_address = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg, flash_address),
readw(&ha->reg->flash_address));
printk(KERN_INFO "0x%02X flash_data = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg, flash_data),
readw(&ha->reg->flash_data));
printk(KERN_INFO "0x%02X ctrl_status = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg, ctrl_status),
readw(&ha->reg->ctrl_status));
if (is_qla4010(ha)) {
printk(KERN_INFO "0x%02X nvram = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg, u1.isp4010.nvram),
readw(&ha->reg->u1.isp4010.nvram));
}
else if (is_qla4022(ha)) {
printk(KERN_INFO "0x%02X intr_mask = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg,
u1.isp4022.intr_mask),
readw(&ha->reg->u1.isp4022.intr_mask));
printk(KERN_INFO "0x%02X nvram = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg, u1.isp4022.nvram),
readw(&ha->reg->u1.isp4022.nvram));
printk(KERN_INFO "0x%02X semaphore = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg,
u1.isp4022.semaphore),
readw(&ha->reg->u1.isp4022.semaphore));
}
printk(KERN_INFO "0x%02X req_q_in = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg, req_q_in),
readw(&ha->reg->req_q_in));
printk(KERN_INFO "0x%02X rsp_q_out = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg, rsp_q_out),
readw(&ha->reg->rsp_q_out));
if (is_qla4010(ha)) {
printk(KERN_INFO "0x%02X ext_hw_conf = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg,
u2.isp4010.ext_hw_conf),
readw(&ha->reg->u2.isp4010.ext_hw_conf));
printk(KERN_INFO "0x%02X port_ctrl = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg,
u2.isp4010.port_ctrl),
readw(&ha->reg->u2.isp4010.port_ctrl));
printk(KERN_INFO "0x%02X port_status = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg,
u2.isp4010.port_status),
readw(&ha->reg->u2.isp4010.port_status));
printk(KERN_INFO "0x%02X req_q_out = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg,
u2.isp4010.req_q_out),
readw(&ha->reg->u2.isp4010.req_q_out));
printk(KERN_INFO "0x%02X gp_out = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg, u2.isp4010.gp_out),
readw(&ha->reg->u2.isp4010.gp_out));
printk(KERN_INFO "0x%02X gp_in = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg, u2.isp4010.gp_in),
readw(&ha->reg->u2.isp4010.gp_in));
printk(KERN_INFO "0x%02X port_err_status = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg,
u2.isp4010.port_err_status),
readw(&ha->reg->u2.isp4010.port_err_status));
}
else if (is_qla4022(ha)) {
printk(KERN_INFO "Page 0 Registers:\n");
printk(KERN_INFO "0x%02X ext_hw_conf = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg,
u2.isp4022.p0.ext_hw_conf),
readw(&ha->reg->u2.isp4022.p0.ext_hw_conf));
printk(KERN_INFO "0x%02X port_ctrl = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg,
u2.isp4022.p0.port_ctrl),
readw(&ha->reg->u2.isp4022.p0.port_ctrl));
printk(KERN_INFO "0x%02X port_status = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg,
u2.isp4022.p0.port_status),
readw(&ha->reg->u2.isp4022.p0.port_status));
printk(KERN_INFO "0x%02X gp_out = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg,
u2.isp4022.p0.gp_out),
readw(&ha->reg->u2.isp4022.p0.gp_out));
printk(KERN_INFO "0x%02X gp_in = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg, u2.isp4022.p0.gp_in),
readw(&ha->reg->u2.isp4022.p0.gp_in));
printk(KERN_INFO "0x%02X port_err_status = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg,
u2.isp4022.p0.port_err_status),
readw(&ha->reg->u2.isp4022.p0.port_err_status));
printk(KERN_INFO "Page 1 Registers:\n");
writel(HOST_MEM_CFG_PAGE & set_rmask(CSR_SCSI_PAGE_SELECT),
&ha->reg->ctrl_status);
printk(KERN_INFO "0x%02X req_q_out = 0x%08X\n",
(uint8_t) offsetof(struct isp_reg,
u2.isp4022.p1.req_q_out),
readw(&ha->reg->u2.isp4022.p1.req_q_out));
writel(PORT_CTRL_STAT_PAGE & set_rmask(CSR_SCSI_PAGE_SELECT),
&ha->reg->ctrl_status);
}
}
void qla4xxx_dump_mbox_registers(struct scsi_qla_host *ha)
{
unsigned long flags = 0;
int i = 0;
spin_lock_irqsave(&ha->hardware_lock, flags);
for (i = 1; i < MBOX_REG_COUNT; i++)
printk(KERN_INFO " Mailbox[%d] = %08x\n", i,
readw(&ha->reg->mailbox[i]));
spin_unlock_irqrestore(&ha->hardware_lock, flags);
}
void qla4xxx_dump_registers(struct scsi_qla_host *ha)
{
unsigned long flags = 0;
spin_lock_irqsave(&ha->hardware_lock, flags);
__dump_registers(ha);
spin_unlock_irqrestore(&ha->hardware_lock, flags);
}
void qla4xxx_dump_buffer(void *b, uint32_t size)
{
uint32_t cnt;
uint8_t *c = b;
printk(" 0 1 2 3 4 5 6 7 8 9 Ah Bh Ch Dh Eh "
"Fh\n");
printk("------------------------------------------------------------"
"--\n");
for (cnt = 0; cnt < size; cnt++, c++) {
printk(KERN_DEBUG "%02x", *c);
if (!(cnt % 16))
printk(KERN_DEBUG "\n");
else
printk(KERN_DEBUG " ");
}
if (cnt % 16)
printk(KERN_DEBUG "\n");
}
/*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2006 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
/*
* Driver debug definitions.
*/
/* #define QL_DEBUG */ /* DEBUG messages */
/* #define QL_DEBUG_LEVEL_3 */ /* Output function tracing */
/* #define QL_DEBUG_LEVEL_4 */
/* #define QL_DEBUG_LEVEL_5 */
/* #define QL_DEBUG_LEVEL_9 */
#define QL_DEBUG_LEVEL_2 /* ALways enable error messagess */
#if defined(QL_DEBUG)
#define DEBUG(x) do {x;} while (0);
#else
#define DEBUG(x) do {} while (0);
#endif
#if defined(QL_DEBUG_LEVEL_2)
#define DEBUG2(x) do {if(extended_error_logging == 2) x;} while (0);
#define DEBUG2_3(x) do {x;} while (0);
#else /* */
#define DEBUG2(x) do {} while (0);
#endif /* */
#if defined(QL_DEBUG_LEVEL_3)
#define DEBUG3(x) do {if(extended_error_logging == 3) x;} while (0);
#else /* */
#define DEBUG3(x) do {} while (0);
#if !defined(QL_DEBUG_LEVEL_2)
#define DEBUG2_3(x) do {} while (0);
#endif /* */
#endif /* */
#if defined(QL_DEBUG_LEVEL_4)
#define DEBUG4(x) do {x;} while (0);
#else /* */
#define DEBUG4(x) do {} while (0);
#endif /* */
#if defined(QL_DEBUG_LEVEL_5)
#define DEBUG5(x) do {x;} while (0);
#else /* */
#define DEBUG5(x) do {} while (0);
#endif /* */
#if defined(QL_DEBUG_LEVEL_9)
#define DEBUG9(x) do {x;} while (0);
#else /* */
#define DEBUG9(x) do {} while (0);
#endif /* */
此差异已折叠。
此差异已折叠。
/*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2006 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#ifndef __QLA4x_GBL_H
#define __QLA4x_GBL_H
int qla4xxx_send_tgts(struct scsi_qla_host *ha, char *ip, uint16_t port);
int qla4xxx_send_command_to_isp(struct scsi_qla_host *ha, struct srb * srb);
int qla4xxx_initialize_adapter(struct scsi_qla_host * ha,
uint8_t renew_ddb_list);
int qla4xxx_soft_reset(struct scsi_qla_host *ha);
irqreturn_t qla4xxx_intr_handler(int irq, void *dev_id, struct pt_regs *regs);
void qla4xxx_free_ddb_list(struct scsi_qla_host * ha);
void qla4xxx_process_aen(struct scsi_qla_host * ha, uint8_t process_aen);
int qla4xxx_get_dhcp_ip_address(struct scsi_qla_host * ha);
int qla4xxx_relogin_device(struct scsi_qla_host * ha,
struct ddb_entry * ddb_entry);
int qla4xxx_reset_lun(struct scsi_qla_host * ha, struct ddb_entry * ddb_entry,
int lun);
int qla4xxx_get_flash(struct scsi_qla_host * ha, dma_addr_t dma_addr,
uint32_t offset, uint32_t len);
int qla4xxx_get_firmware_status(struct scsi_qla_host * ha);
int qla4xxx_get_firmware_state(struct scsi_qla_host * ha);
int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha);
/* FIXME: Goodness! this really wants a small struct to hold the
* parameters. On x86 the args will get passed on the stack! */
int qla4xxx_get_fwddb_entry(struct scsi_qla_host *ha,
uint16_t fw_ddb_index,
struct dev_db_entry *fw_ddb_entry,
dma_addr_t fw_ddb_entry_dma,
uint32_t *num_valid_ddb_entries,
uint32_t *next_ddb_index,
uint32_t *fw_ddb_device_state,
uint32_t *conn_err_detail,
uint16_t *tcp_source_port_num,
uint16_t *connection_id);
struct ddb_entry * qla4xxx_alloc_ddb(struct scsi_qla_host * ha,
uint32_t fw_ddb_index);
int qla4xxx_set_ddb_entry(struct scsi_qla_host * ha, uint16_t fw_ddb_index,
dma_addr_t fw_ddb_entry_dma);
void qla4xxx_mark_device_missing(struct scsi_qla_host *ha,
struct ddb_entry *ddb_entry);
u16 rd_nvram_word(struct scsi_qla_host * ha, int offset);
void qla4xxx_get_crash_record(struct scsi_qla_host * ha);
struct ddb_entry *qla4xxx_alloc_sess(struct scsi_qla_host *ha);
int qla4xxx_add_sess(struct ddb_entry *);
void qla4xxx_destroy_sess(struct ddb_entry *ddb_entry);
int qla4xxx_conn_close_sess_logout(struct scsi_qla_host * ha,
uint16_t fw_ddb_index,
uint16_t connection_id,
uint16_t option);
int qla4xxx_clear_database_entry(struct scsi_qla_host * ha,
uint16_t fw_ddb_index);
int qla4xxx_is_nvram_configuration_valid(struct scsi_qla_host * ha);
int qla4xxx_get_fw_version(struct scsi_qla_host * ha);
void qla4xxx_interrupt_service_routine(struct scsi_qla_host * ha,
uint32_t intr_status);
int qla4xxx_init_rings(struct scsi_qla_host * ha);
void qla4xxx_dump_buffer(void *b, uint32_t size);
struct srb * qla4xxx_del_from_active_array(struct scsi_qla_host *ha, uint32_t index);
void qla4xxx_srb_compl(struct scsi_qla_host *ha, struct srb *srb);
int qla4xxx_reinitialize_ddb_list(struct scsi_qla_host * ha);
int qla4xxx_process_ddb_changed(struct scsi_qla_host * ha,
uint32_t fw_ddb_index, uint32_t state);
extern int extended_error_logging;
extern int ql4xdiscoverywait;
extern int ql4xdontresethba;
#endif /* _QLA4x_GBL_H */
此差异已折叠。
/*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2006 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
/*
*
* qla4xxx_lookup_ddb_by_fw_index
* This routine locates a device handle given the firmware device
* database index. If device doesn't exist, returns NULL.
*
* Input:
* ha - Pointer to host adapter structure.
* fw_ddb_index - Firmware's device database index
*
* Returns:
* Pointer to the corresponding internal device database structure
*/
static inline struct ddb_entry *
qla4xxx_lookup_ddb_by_fw_index(struct scsi_qla_host *ha, uint32_t fw_ddb_index)
{
struct ddb_entry *ddb_entry = NULL;
if ((fw_ddb_index < MAX_DDB_ENTRIES) &&
(ha->fw_ddb_index_map[fw_ddb_index] !=
(struct ddb_entry *) INVALID_ENTRY)) {
ddb_entry = ha->fw_ddb_index_map[fw_ddb_index];
}
DEBUG3(printk("scsi%d: %s: index [%d], ddb_entry = %p\n",
ha->host_no, __func__, fw_ddb_index, ddb_entry));
return ddb_entry;
}
static inline void
__qla4xxx_enable_intrs(struct scsi_qla_host *ha)
{
if (is_qla4022(ha)) {
writel(set_rmask(IMR_SCSI_INTR_ENABLE),
&ha->reg->u1.isp4022.intr_mask);
readl(&ha->reg->u1.isp4022.intr_mask);
} else {
writel(set_rmask(CSR_SCSI_INTR_ENABLE), &ha->reg->ctrl_status);
readl(&ha->reg->ctrl_status);
}
set_bit(AF_INTERRUPTS_ON, &ha->flags);
}
static inline void
__qla4xxx_disable_intrs(struct scsi_qla_host *ha)
{
if (is_qla4022(ha)) {
writel(clr_rmask(IMR_SCSI_INTR_ENABLE),
&ha->reg->u1.isp4022.intr_mask);
readl(&ha->reg->u1.isp4022.intr_mask);
} else {
writel(clr_rmask(CSR_SCSI_INTR_ENABLE), &ha->reg->ctrl_status);
readl(&ha->reg->ctrl_status);
}
clear_bit(AF_INTERRUPTS_ON, &ha->flags);
}
static inline void
qla4xxx_enable_intrs(struct scsi_qla_host *ha)
{
unsigned long flags;
spin_lock_irqsave(&ha->hardware_lock, flags);
__qla4xxx_enable_intrs(ha);
spin_unlock_irqrestore(&ha->hardware_lock, flags);
}
static inline void
qla4xxx_disable_intrs(struct scsi_qla_host *ha)
{
unsigned long flags;
spin_lock_irqsave(&ha->hardware_lock, flags);
__qla4xxx_disable_intrs(ha);
spin_unlock_irqrestore(&ha->hardware_lock, flags);
}
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
/*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2006 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.00.05b9-k"
#define QL4_DRIVER_MAJOR_VER 5
#define QL4_DRIVER_MINOR_VER 0
#define QL4_DRIVER_PATCH_VER 5
#define QL4_DRIVER_BETA_VER 9
......@@ -215,18 +215,19 @@ static void raid_component_release(struct class_device *cdev)
kfree(rc);
}
void raid_component_add(struct raid_template *r,struct device *raid_dev,
struct device *component_dev)
int raid_component_add(struct raid_template *r,struct device *raid_dev,
struct device *component_dev)
{
struct class_device *cdev =
attribute_container_find_class_device(&r->raid_attrs.ac,
raid_dev);
struct raid_component *rc;
struct raid_data *rd = class_get_devdata(cdev);
int err;
rc = kzalloc(sizeof(*rc), GFP_KERNEL);
if (!rc)
return;
return -ENOMEM;
INIT_LIST_HEAD(&rc->node);
class_device_initialize(&rc->cdev);
......@@ -239,7 +240,18 @@ void raid_component_add(struct raid_template *r,struct device *raid_dev,
list_add_tail(&rc->node, &rd->component_list);
rc->cdev.parent = cdev;
rc->cdev.class = &raid_class.class;
class_device_add(&rc->cdev);
err = class_device_add(&rc->cdev);
if (err)
goto err_out;
return 0;
err_out:
list_del(&rc->node);
rd->component_count--;
put_device(component_dev);
kfree(rc);
return err;
}
EXPORT_SYMBOL(raid_component_add);
......
......@@ -128,7 +128,7 @@ const char * scsi_device_type(unsigned type)
return "Well-known LUN ";
if (type == 0x1f)
return "No Device ";
if (type > ARRAY_SIZE(scsi_device_types))
if (type >= ARRAY_SIZE(scsi_device_types))
return "Unknown ";
return scsi_device_types[type];
}
......
......@@ -150,6 +150,7 @@ static struct {
{"DELL", "PERCRAID", NULL, BLIST_FORCELUN},
{"DGC", "RAID", NULL, BLIST_SPARSELUN}, /* Dell PV 650F, storage on LUN 0 */
{"DGC", "DISK", NULL, BLIST_SPARSELUN}, /* Dell PV 650F, no storage on LUN 0 */
{"EMC", "Invista", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"EMC", "SYMMETRIX", NULL, BLIST_SPARSELUN | BLIST_LARGELUN | BLIST_FORCELUN},
{"EMULEX", "MD21/S2 ESDI", NULL, BLIST_SINGLELUN},
{"FSC", "CentricStor", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
......@@ -161,6 +162,11 @@ static struct {
{"HITACHI", "DF600", "*", BLIST_SPARSELUN},
{"HITACHI", "DISK-SUBSYSTEM", "*", BLIST_ATTACH_PQ3 | BLIST_SPARSELUN | BLIST_LARGELUN},
{"HITACHI", "OPEN-E", "*", BLIST_ATTACH_PQ3 | BLIST_SPARSELUN | BLIST_LARGELUN},
{"HITACHI", "OP-C-", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"HITACHI", "3380-", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"HITACHI", "3390-", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"HITACHI", "6586-", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"HITACHI", "6588-", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"HP", "A6189A", NULL, BLIST_SPARSELUN | BLIST_LARGELUN}, /* HP VA7400 */
{"HP", "OPEN-", "*", BLIST_REPORTLUN2}, /* HP XP Arrays */
{"HP", "NetRAID-4M", NULL, BLIST_FORCELUN},
......@@ -168,6 +174,14 @@ static struct {
{"HP", "C1557A", NULL, BLIST_FORCELUN},
{"HP", "C3323-300", "4269", BLIST_NOTQ},
{"HP", "C5713A", NULL, BLIST_NOREPORTLUN},
{"HP", "DF400", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"HP", "DF500", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"HP", "DF600", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"HP", "OP-C-", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"HP", "3380-", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"HP", "3390-", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"HP", "6586-", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"HP", "6588-", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"IBM", "AuSaV1S2", NULL, BLIST_FORCELUN},
{"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{"IBM", "2105", NULL, BLIST_RETRY_HWERROR},
......@@ -188,6 +202,7 @@ static struct {
{"NAKAMICH", "MJ-4.8S", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
{"NAKAMICH", "MJ-5.16S", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
{"NEC", "PD-1 ODX654P", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
{"NEC", "iStorage", NULL, BLIST_REPORTLUN2},
{"NRC", "MBR-7", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
{"NRC", "MBR-7.4", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
{"PIONEER", "CD-ROM DRM-600", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
......@@ -210,6 +225,7 @@ static struct {
{"SUN", "T300", "*", BLIST_SPARSELUN},
{"SUN", "T4", "*", BLIST_SPARSELUN},
{"TEXEL", "CD-ROM", "1.06", BLIST_BORKEN},
{"Tornado-", "F4", "*", BLIST_NOREPORTLUN},
{"TOSHIBA", "CDROM", NULL, BLIST_ISROM},
{"TOSHIBA", "CD-ROM", NULL, BLIST_ISROM},
{"USB2.0", "SMARTMEDIA/XD", NULL, BLIST_FORCELUN | BLIST_INQUIRY_36},
......
......@@ -426,7 +426,7 @@ int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd,
free_req:
blk_put_request(req);
free_sense:
kfree(sioc);
kmem_cache_free(scsi_io_context_cache, sioc);
return DRIVER_ERROR << 24;
}
EXPORT_SYMBOL_GPL(scsi_execute_async);
......
......@@ -1794,7 +1794,7 @@ static void sd_shutdown(struct device *dev)
**/
static int __init init_sd(void)
{
int majors = 0, i;
int majors = 0, i, err;
SCSI_LOG_HLQUEUE(3, printk("init_sd: sd driver entry point\n"));
......@@ -1805,9 +1805,22 @@ static int __init init_sd(void)
if (!majors)
return -ENODEV;
class_register(&sd_disk_class);
err = class_register(&sd_disk_class);
if (err)
goto err_out;
return scsi_register_driver(&sd_template.gendrv);
err = scsi_register_driver(&sd_template.gendrv);
if (err)
goto err_out_class;
return 0;
err_out_class:
class_unregister(&sd_disk_class);
err_out:
for (i = 0; i < SD_MAJORS; i++)
unregister_blkdev(sd_major(i), "sd");
return err;
}
/**
......@@ -1822,10 +1835,10 @@ static void __exit exit_sd(void)
SCSI_LOG_HLQUEUE(3, printk("exit_sd: exiting sd driver\n"));
scsi_unregister_driver(&sd_template.gendrv);
class_unregister(&sd_disk_class);
for (i = 0; i < SD_MAJORS; i++)
unregister_blkdev(sd_major(i), "sd");
class_unregister(&sd_disk_class);
}
module_init(init_sd);
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册