mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
SCSI misc on 20140806
This patch set consists of the usual driver updates (ufs, storvsc, pm8001 hpsa). It also has removal of the user space target driver code (everyone is using LIO now), a partial PCI MSI-X update, more multi-queue updates, conversion to 64 bit LUNs (so we could theoretically cope with any LUN returned by a device) and placeholder support for the ZBC device type (Shingle drives), plus an assortment of minor updates and bug fixes. Signed-off-by: James Bottomley <[email protected]> -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAABAgAGBQJT4mS9AAoJEDeqqVYsXL0Mq34H/2AeXiM8GEVO3PIsBtF3TFZ9 poJvAyb8t//+VwAIVLHU9wrssIrIcyvNQmNHH/InGt5rOaXwGQRsnEc73bBtot4b aC1t+hAnp2Ddvu6phmyUg7iY2GmQhAoZmeaj7krGIu2XgtLGiPg26eSsgk4Yv/U9 cuULEuOc/UnTj3w5VK8SvpyXMybVF6oQhSrS1slOglfFwPTlTI/NHU9xo7Wc3qHT VifHXNphIvye5EH8zwtKX5p8qCrFW0pevJwyfPz7Hp2CTA9XYKx3SoeOh+n9F9ez udBBggg7Vb1tb4mPKUoZ78UrtCVdFSCmesBU/RJe7cIh8daKaO5MVr3WPSx2JhM= =yGai -----END PGP SIGNATURE----- Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI updates from James Bottomley: "This patch set consists of the usual driver updates (ufs, storvsc, pm8001 hpsa). It also has removal of the user space target driver code (everyone is using LIO now), a partial PCI MSI-X update, more multi-queue updates, conversion to 64 bit LUNs (so we could theoretically cope with any LUN returned by a device) and placeholder support for the ZBC device type (Shingle drives), plus an assortment of minor updates and bug fixes" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (143 commits) scsi: do not issue SCSI RSOC command to Promise Vtrak E610f vmw_pvscsi: Use pci_enable_msix_exact() instead of pci_enable_msix() pm8001: Fix invalid return when request_irq() failed lpfc: Remove superfluous call to pci_disable_msix() isci: Use pci_enable_msix_exact() instead of pci_enable_msix() bfa: Use pci_enable_msix_exact() instead of pci_enable_msix() bfa: Cleanup bfad_setup_intr() function bfa: Do not call pci_enable_msix() after it failed once fnic: Use pci_enable_msix_exact() instead of pci_enable_msix() scsi: use short driver name for per-driver cmd slab caches scsi_debug: support scsi-mq, queues and locks Drivers: add blist flags scsi: ufs: fix endianness sparse warnings scsi: ufs: make undeclared functions static bnx2i: Update driver version to 2.7.10.1 pm8001: fix a memory leak in nvmd_resp pm8001: fix update_flash pm8001: fix a memory leak in flash_update pm8001: Cleaning up uninitialized variables pm8001: Fix to remove null pointer checks that could never happen ...
This commit is contained in:
commit
6b22df74f7
231 changed files with 4936 additions and 6265 deletions
|
|
@ -392,6 +392,8 @@ typedef struct TAG_TW_Passthru
|
|||
unsigned char padding[12];
|
||||
} TW_Passthru;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
typedef struct TAG_TW_Device_Extension {
|
||||
u32 base_addr;
|
||||
unsigned long *alignment_virtual_address[TW_Q_LENGTH];
|
||||
|
|
@ -430,6 +432,4 @@ typedef struct TAG_TW_Device_Extension {
|
|||
wait_queue_head_t ioctl_wqueue;
|
||||
} TW_Device_Extension;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif /* _3W_XXXX_H */
|
||||
|
|
|
|||
|
|
@ -1005,7 +1005,7 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
|
|||
DMA_TO_DEVICE);
|
||||
|
||||
cmnd[0] = REQUEST_SENSE;
|
||||
cmnd[1] = (SCp->device->lun & 0x7) << 5;
|
||||
cmnd[1] = (lun & 0x7) << 5;
|
||||
cmnd[2] = 0;
|
||||
cmnd[3] = 0;
|
||||
cmnd[4] = SCSI_SENSE_BUFFERSIZE;
|
||||
|
|
@ -1396,7 +1396,8 @@ NCR_700_start_command(struct scsi_cmnd *SCp)
|
|||
struct NCR_700_Host_Parameters *hostdata =
|
||||
(struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0];
|
||||
__u16 count = 1; /* for IDENTIFY message */
|
||||
|
||||
u8 lun = SCp->device->lun;
|
||||
|
||||
if(hostdata->state != NCR_700_HOST_FREE) {
|
||||
/* keep this inside the lock to close the race window where
|
||||
* the running command finishes on another CPU while we don't
|
||||
|
|
@ -1415,7 +1416,7 @@ NCR_700_start_command(struct scsi_cmnd *SCp)
|
|||
|
||||
hostdata->msgout[0] = NCR_700_identify((SCp->cmnd[0] != REQUEST_SENSE &&
|
||||
slot->flags != NCR_700_FLAG_AUTOSENSE),
|
||||
SCp->device->lun);
|
||||
lun);
|
||||
/* for INQUIRY or REQUEST_SENSE commands, we cannot be sure
|
||||
* if the negotiated transfer parameters still hold, so
|
||||
* always renegotiate them */
|
||||
|
|
|
|||
|
|
@ -40,13 +40,6 @@ config SCSI_DMA
|
|||
bool
|
||||
default n
|
||||
|
||||
config SCSI_TGT
|
||||
tristate "SCSI target support"
|
||||
depends on SCSI
|
||||
---help---
|
||||
If you want to use SCSI target mode drivers enable this option.
|
||||
If you choose M, the module will be called scsi_tgt.
|
||||
|
||||
config SCSI_NETLINK
|
||||
bool
|
||||
default n
|
||||
|
|
@ -197,20 +190,6 @@ config SCSI_ENCLOSURE
|
|||
it has an enclosure device. Selecting this option will just allow
|
||||
certain enclosure conditions to be reported and is not required.
|
||||
|
||||
config SCSI_MULTI_LUN
|
||||
bool "Probe all LUNs on each SCSI device"
|
||||
depends on SCSI
|
||||
help
|
||||
Some devices support more than one LUN (Logical Unit Number) in order
|
||||
to allow access to several media, e.g. CD jukebox, USB card reader,
|
||||
mobile phone in mass storage mode. This option forces the kernel to
|
||||
probe for all LUNs by default. This setting can be overridden by
|
||||
max_luns boot/module parameter. Note that this option does not affect
|
||||
devices conforming to SCSI-3 or higher as they can explicitly report
|
||||
their number of LUNs. It is safe to say Y here unless you have one of
|
||||
those rare devices which reacts in an unexpected way when probed for
|
||||
multiple LUNs.
|
||||
|
||||
config SCSI_CONSTANTS
|
||||
bool "Verbose SCSI error reporting (kernel size +=12K)"
|
||||
depends on SCSI
|
||||
|
|
@ -285,13 +264,6 @@ config SCSI_FC_ATTRS
|
|||
each attached FiberChannel device to sysfs, say Y.
|
||||
Otherwise, say N.
|
||||
|
||||
config SCSI_FC_TGT_ATTRS
|
||||
bool "SCSI target support for FiberChannel Transport Attributes"
|
||||
depends on SCSI_FC_ATTRS
|
||||
depends on SCSI_TGT = y || SCSI_TGT = SCSI_FC_ATTRS
|
||||
help
|
||||
If you want to use SCSI target mode drivers enable this option.
|
||||
|
||||
config SCSI_ISCSI_ATTRS
|
||||
tristate "iSCSI Transport Attributes"
|
||||
depends on SCSI && NET
|
||||
|
|
@ -318,13 +290,6 @@ config SCSI_SRP_ATTRS
|
|||
If you wish to export transport-specific information about
|
||||
each attached SRP device to sysfs, say Y.
|
||||
|
||||
config SCSI_SRP_TGT_ATTRS
|
||||
bool "SCSI target support for SRP Transport Attributes"
|
||||
depends on SCSI_SRP_ATTRS
|
||||
depends on SCSI_TGT = y || SCSI_TGT = SCSI_SRP_ATTRS
|
||||
help
|
||||
If you want to use SCSI target mode drivers enable this option.
|
||||
|
||||
endmenu
|
||||
|
||||
menuconfig SCSI_LOWLEVEL
|
||||
|
|
@ -528,7 +493,7 @@ config SCSI_DPT_I2O
|
|||
|
||||
config SCSI_ADVANSYS
|
||||
tristate "AdvanSys SCSI support"
|
||||
depends on SCSI && VIRT_TO_BUS
|
||||
depends on SCSI && VIRT_TO_BUS && !ARM
|
||||
depends on ISA || EISA || PCI
|
||||
help
|
||||
This is a driver for all SCSI host adapters manufactured by
|
||||
|
|
@ -848,20 +813,6 @@ config SCSI_IBMVSCSI
|
|||
To compile this driver as a module, choose M here: the
|
||||
module will be called ibmvscsi.
|
||||
|
||||
config SCSI_IBMVSCSIS
|
||||
tristate "IBM Virtual SCSI Server support"
|
||||
depends on PPC_PSERIES && SCSI_SRP && SCSI_SRP_TGT_ATTRS
|
||||
help
|
||||
This is the SRP target driver for IBM pSeries virtual environments.
|
||||
|
||||
The userspace component needed to initialize the driver and
|
||||
documentation can be found:
|
||||
|
||||
http://stgt.berlios.de/
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called ibmvstgt.
|
||||
|
||||
config SCSI_IBMVFC
|
||||
tristate "IBM Virtual FC support"
|
||||
depends on PPC_PSERIES && SCSI
|
||||
|
|
@ -1750,16 +1701,6 @@ config SCSI_PM8001
|
|||
This driver supports PMC-Sierra PCIE SAS/SATA 8x6G SPC 8001 chip
|
||||
based host adapters.
|
||||
|
||||
config SCSI_SRP
|
||||
tristate "SCSI RDMA Protocol helper library"
|
||||
depends on SCSI && PCI
|
||||
select SCSI_TGT
|
||||
help
|
||||
If you wish to use SRP target drivers, say Y.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called libsrp.
|
||||
|
||||
config SCSI_BFA_FC
|
||||
tristate "Brocade BFA Fibre Channel Support"
|
||||
depends on PCI && SCSI
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ CFLAGS_gdth.o = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ -DGDTH_STATISTICS
|
|||
obj-$(CONFIG_PCMCIA) += pcmcia/
|
||||
|
||||
obj-$(CONFIG_SCSI) += scsi_mod.o
|
||||
obj-$(CONFIG_SCSI_TGT) += scsi_tgt.o
|
||||
|
||||
obj-$(CONFIG_RAID_ATTRS) += raid_class.o
|
||||
|
||||
|
|
@ -127,9 +126,7 @@ obj-$(CONFIG_SCSI_LASI700) += 53c700.o lasi700.o
|
|||
obj-$(CONFIG_SCSI_SNI_53C710) += 53c700.o sni_53c710.o
|
||||
obj-$(CONFIG_SCSI_NSP32) += nsp32.o
|
||||
obj-$(CONFIG_SCSI_IPR) += ipr.o
|
||||
obj-$(CONFIG_SCSI_SRP) += libsrp.o
|
||||
obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi/
|
||||
obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvscsi/
|
||||
obj-$(CONFIG_SCSI_IBMVFC) += ibmvscsi/
|
||||
obj-$(CONFIG_SCSI_HPTIOP) += hptiop.o
|
||||
obj-$(CONFIG_SCSI_STEX) += stex.o
|
||||
|
|
@ -173,8 +170,6 @@ scsi_mod-$(CONFIG_PM) += scsi_pm.o
|
|||
|
||||
hv_storvsc-y := storvsc_drv.o
|
||||
|
||||
scsi_tgt-y += scsi_tgt_lib.o scsi_tgt_if.o
|
||||
|
||||
sd_mod-objs := sd.o
|
||||
sd_mod-$(CONFIG_BLK_DEV_INTEGRITY) += sd_dif.o
|
||||
|
||||
|
|
|
|||
|
|
@ -762,7 +762,7 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m,
|
|||
|
||||
static void lprint_Scsi_Cmnd(Scsi_Cmnd * cmd, struct seq_file *m)
|
||||
{
|
||||
SPRINTF("scsi%d : destination target %d, lun %d\n", cmd->device->host->host_no, cmd->device->id, cmd->device->lun);
|
||||
SPRINTF("scsi%d : destination target %d, lun %llu\n", cmd->device->host->host_no, cmd->device->id, cmd->device->lun);
|
||||
SPRINTF(" command = ");
|
||||
lprint_command(cmd->cmnd, m);
|
||||
}
|
||||
|
|
@ -1039,9 +1039,10 @@ static void NCR5380_main(struct work_struct *work)
|
|||
for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, prev = NULL; tmp; prev = tmp, tmp = (Scsi_Cmnd *) tmp->host_scribble)
|
||||
{
|
||||
if (prev != tmp)
|
||||
dprintk(NDEBUG_LISTS, "MAIN tmp=%p target=%d busy=%d lun=%d\n", tmp, tmp->device->id, hostdata->busy[tmp->device->id], tmp->device->lun);
|
||||
dprintk(NDEBUG_LISTS, "MAIN tmp=%p target=%d busy=%d lun=%llu\n", tmp, tmp->device->id, hostdata->busy[tmp->device->id], tmp->device->lun);
|
||||
/* When we find one, remove it from the issue queue. */
|
||||
if (!(hostdata->busy[tmp->device->id] & (1 << tmp->device->lun))) {
|
||||
if (!(hostdata->busy[tmp->device->id] &
|
||||
(1 << (u8)(tmp->device->lun & 0xff)))) {
|
||||
if (prev) {
|
||||
REMOVE(prev, prev->host_scribble, tmp, tmp->host_scribble);
|
||||
prev->host_scribble = tmp->host_scribble;
|
||||
|
|
@ -1057,7 +1058,7 @@ static void NCR5380_main(struct work_struct *work)
|
|||
* On failure, we must add the command back to the
|
||||
* issue queue so we can keep trying.
|
||||
*/
|
||||
dprintk(NDEBUG_MAIN|NDEBUG_QUEUES, "scsi%d : main() : command for target %d lun %d removed from issue_queue\n", instance->host_no, tmp->device->id, tmp->device->lun);
|
||||
dprintk(NDEBUG_MAIN|NDEBUG_QUEUES, "scsi%d : main() : command for target %d lun %llu removed from issue_queue\n", instance->host_no, tmp->device->id, tmp->device->lun);
|
||||
|
||||
/*
|
||||
* A successful selection is defined as one that
|
||||
|
|
@ -1524,7 +1525,7 @@ part2:
|
|||
dprintk(NDEBUG_SELECTION, "scsi%d : nexus established.\n", instance->host_no);
|
||||
/* XXX need to handle errors here */
|
||||
hostdata->connected = cmd;
|
||||
hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun);
|
||||
hostdata->busy[cmd->device->id] |= (1 << (cmd->device->lun & 0xFF));
|
||||
|
||||
initialize_SCp(cmd);
|
||||
|
||||
|
|
@ -2210,14 +2211,14 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
|
|||
case LINKED_FLG_CMD_COMPLETE:
|
||||
/* Accept message by clearing ACK */
|
||||
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
|
||||
dprintk(NDEBUG_LINKED, "scsi%d : target %d lun %d linked command complete.\n", instance->host_no, cmd->device->id, cmd->device->lun);
|
||||
dprintk(NDEBUG_LINKED, "scsi%d : target %d lun %llu linked command complete.\n", instance->host_no, cmd->device->id, cmd->device->lun);
|
||||
/*
|
||||
* Sanity check : A linked command should only terminate with
|
||||
* one of these messages if there are more linked commands
|
||||
* available.
|
||||
*/
|
||||
if (!cmd->next_link) {
|
||||
printk("scsi%d : target %d lun %d linked command complete, no next_link\n" instance->host_no, cmd->device->id, cmd->device->lun);
|
||||
printk("scsi%d : target %d lun %llu linked command complete, no next_link\n" instance->host_no, cmd->device->id, cmd->device->lun);
|
||||
sink = 1;
|
||||
do_abort(instance);
|
||||
return;
|
||||
|
|
@ -2226,7 +2227,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
|
|||
/* The next command is still part of this process */
|
||||
cmd->next_link->tag = cmd->tag;
|
||||
cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8);
|
||||
dprintk(NDEBUG_LINKED, "scsi%d : target %d lun %d linked request done, calling scsi_done().\n", instance->host_no, cmd->device->id, cmd->device->lun);
|
||||
dprintk(NDEBUG_LINKED, "scsi%d : target %d lun %llu linked request done, calling scsi_done().\n", instance->host_no, cmd->device->id, cmd->device->lun);
|
||||
collect_stats(hostdata, cmd);
|
||||
cmd->scsi_done(cmd);
|
||||
cmd = hostdata->connected;
|
||||
|
|
@ -2238,8 +2239,8 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
|
|||
sink = 1;
|
||||
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
|
||||
hostdata->connected = NULL;
|
||||
dprintk(NDEBUG_QUEUES, "scsi%d : command for target %d, lun %d completed\n", instance->host_no, cmd->device->id, cmd->device->lun);
|
||||
hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun);
|
||||
dprintk(NDEBUG_QUEUES, "scsi%d : command for target %d, lun %llu completed\n", instance->host_no, cmd->device->id, cmd->device->lun);
|
||||
hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xFF));
|
||||
|
||||
/*
|
||||
* I'm not sure what the correct thing to do here is :
|
||||
|
|
@ -2304,7 +2305,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
|
|||
case ORDERED_QUEUE_TAG:
|
||||
case SIMPLE_QUEUE_TAG:
|
||||
cmd->device->simple_tags = 0;
|
||||
hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun);
|
||||
hostdata->busy[cmd->device->id] |= (1 << (cmd->device->lun & 0xFF));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -2318,7 +2319,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
|
|||
hostdata->disconnected_queue;
|
||||
hostdata->connected = NULL;
|
||||
hostdata->disconnected_queue = cmd;
|
||||
dprintk(NDEBUG_QUEUES, "scsi%d : command for target %d lun %d was moved from connected to" " the disconnected_queue\n", instance->host_no, cmd->device->id, cmd->device->lun);
|
||||
dprintk(NDEBUG_QUEUES, "scsi%d : command for target %d lun %llu was moved from connected to" " the disconnected_queue\n", instance->host_no, cmd->device->id, cmd->device->lun);
|
||||
/*
|
||||
* Restore phase bits to 0 so an interrupted selection,
|
||||
* arbitration can resume.
|
||||
|
|
@ -2426,7 +2427,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
|
|||
hostdata->last_message = msgout;
|
||||
NCR5380_transfer_pio(instance, &phase, &len, &data);
|
||||
if (msgout == ABORT) {
|
||||
hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun);
|
||||
hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xFF));
|
||||
hostdata->connected = NULL;
|
||||
cmd->result = DID_ERROR << 16;
|
||||
collect_stats(hostdata, cmd);
|
||||
|
|
@ -2562,7 +2563,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
|
|||
|
||||
|
||||
for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue, prev = NULL; tmp; prev = tmp, tmp = (Scsi_Cmnd *) tmp->host_scribble)
|
||||
if ((target_mask == (1 << tmp->device->id)) && (lun == tmp->device->lun)
|
||||
if ((target_mask == (1 << tmp->device->id)) && (lun == (u8)tmp->device->lun)
|
||||
) {
|
||||
if (prev) {
|
||||
REMOVE(prev, prev->host_scribble, tmp, tmp->host_scribble);
|
||||
|
|
@ -2588,7 +2589,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
|
|||
do_abort(instance);
|
||||
} else {
|
||||
hostdata->connected = tmp;
|
||||
dprintk(NDEBUG_RESELECTION, "scsi%d : nexus established, target = %d, lun = %d, tag = %d\n", instance->host_no, tmp->device->id, tmp->device->lun, tmp->tag);
|
||||
dprintk(NDEBUG_RESELECTION, "scsi%d : nexus established, target = %d, lun = %llu, tag = %d\n", instance->host_no, tmp->device->id, tmp->device->lun, tmp->tag);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -595,7 +595,7 @@ static int NCR53c406a_release(struct Scsi_Host *shost)
|
|||
{
|
||||
if (shost->irq)
|
||||
free_irq(shost->irq, NULL);
|
||||
#ifdef USE_DMA
|
||||
#if USE_DMA
|
||||
if (shost->dma_channel != 0xff)
|
||||
free_dma(shost->dma_channel);
|
||||
#endif
|
||||
|
|
@ -698,7 +698,7 @@ static int NCR53c406a_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
|
|||
int i;
|
||||
|
||||
VDEB(printk("NCR53c406a_queue called\n"));
|
||||
DEB(printk("cmd=%02x, cmd_len=%02x, target=%02x, lun=%02x, bufflen=%d\n", SCpnt->cmnd[0], SCpnt->cmd_len, SCpnt->target, SCpnt->lun, scsi_bufflen(SCpnt)));
|
||||
DEB(printk("cmd=%02x, cmd_len=%02x, target=%02x, lun=%02x, bufflen=%d\n", SCpnt->cmnd[0], SCpnt->cmd_len, SCpnt->device->target, (u8)SCpnt->device->lun, scsi_bufflen(SCpnt)));
|
||||
|
||||
#if 0
|
||||
VDEB(for (i = 0; i < SCpnt->cmd_len; i++)
|
||||
|
|
|
|||
|
|
@ -891,7 +891,7 @@ static int inia100_build_scb(struct orc_host * host, struct orc_scb * scb, struc
|
|||
printk("max cdb length= %x\b", cmd->cmd_len);
|
||||
scb->cdb_len = IMAX_CDB;
|
||||
}
|
||||
scb->ident = cmd->device->lun | DISC_ALLOW;
|
||||
scb->ident = (u8)(cmd->device->lun & 0xff) | DISC_ALLOW;
|
||||
if (cmd->device->tagged_supported) { /* Tag Support */
|
||||
scb->tag_msg = SIMPLE_QUEUE_TAG; /* Do simple tag only */
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -551,7 +551,7 @@ static int aac_eh_abort(struct scsi_cmnd* cmd)
|
|||
int count;
|
||||
int ret = FAILED;
|
||||
|
||||
printk(KERN_ERR "%s: Host adapter abort request (%d,%d,%d,%d)\n",
|
||||
printk(KERN_ERR "%s: Host adapter abort request (%d,%d,%d,%llu)\n",
|
||||
AAC_DRIVERNAME,
|
||||
host->host_no, sdev_channel(dev), sdev_id(dev), dev->lun);
|
||||
switch (cmd->cmnd[0]) {
|
||||
|
|
|
|||
|
|
@ -2512,7 +2512,7 @@ static void asc_prt_scsi_host(struct Scsi_Host *s)
|
|||
|
||||
printk("Scsi_Host at addr 0x%p, device %s\n", s, dev_name(boardp->dev));
|
||||
printk(" host_busy %u, host_no %d,\n",
|
||||
s->host_busy, s->host_no);
|
||||
atomic_read(&s->host_busy), s->host_no);
|
||||
|
||||
printk(" base 0x%lx, io_port 0x%lx, irq %d,\n",
|
||||
(ulong)s->base, (ulong)s->io_port, boardp->irq);
|
||||
|
|
@ -3345,8 +3345,8 @@ static void asc_prt_driver_conf(struct seq_file *m, struct Scsi_Host *shost)
|
|||
shost->host_no);
|
||||
|
||||
seq_printf(m,
|
||||
" host_busy %u, max_id %u, max_lun %u, max_channel %u\n",
|
||||
shost->host_busy, shost->max_id,
|
||||
" host_busy %u, max_id %u, max_lun %llu, max_channel %u\n",
|
||||
atomic_read(&shost->host_busy), shost->max_id,
|
||||
shost->max_lun, shost->max_channel);
|
||||
|
||||
seq_printf(m,
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ static LIST_HEAD(aha152x_host_list);
|
|||
#define CMDINFO(cmd) \
|
||||
(cmd) ? ((cmd)->device->host->host_no) : -1, \
|
||||
(cmd) ? ((cmd)->device->id & 0x0f) : -1, \
|
||||
(cmd) ? ((cmd)->device->lun & 0x07) : -1
|
||||
(cmd) ? ((u8)(cmd)->device->lun & 0x07) : -1
|
||||
|
||||
static inline void
|
||||
CMD_INC_RESID(struct scsi_cmnd *cmd, int inc)
|
||||
|
|
@ -1602,7 +1602,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
|
|||
#if defined(AHA152X_DEBUG)
|
||||
int hostno=DONE_SC->device->host->host_no;
|
||||
int id=DONE_SC->device->id & 0xf;
|
||||
int lun=DONE_SC->device->lun & 0x7;
|
||||
int lun=((u8)DONE_SC->device->lun) & 0x7;
|
||||
#endif
|
||||
Scsi_Cmnd *ptr = DONE_SC;
|
||||
DONE_SC=NULL;
|
||||
|
|
@ -2984,7 +2984,7 @@ static void get_command(struct seq_file *m, Scsi_Cmnd * ptr)
|
|||
int i;
|
||||
|
||||
SPRINTF("%p: target=%d; lun=%d; cmnd=( ",
|
||||
ptr, ptr->device->id, ptr->device->lun);
|
||||
ptr, ptr->device->id, (u8)ptr->device->lun);
|
||||
|
||||
for (i = 0; i < COMMAND_SIZE(ptr->cmnd[0]); i++)
|
||||
SPRINTF("0x%02x ", ptr->cmnd[i]);
|
||||
|
|
|
|||
|
|
@ -85,10 +85,9 @@ aic7770_probe(struct device *dev)
|
|||
int error;
|
||||
|
||||
sprintf(buf, "ahc_eisa:%d", eisaBase >> 12);
|
||||
name = kmalloc(strlen(buf) + 1, GFP_ATOMIC);
|
||||
name = kstrdup(buf, GFP_ATOMIC);
|
||||
if (name == NULL)
|
||||
return (ENOMEM);
|
||||
strcpy(name, buf);
|
||||
ahc = ahc_alloc(&aic7xxx_driver_template, name);
|
||||
if (ahc == NULL)
|
||||
return (ENOMEM);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ struct scb_platform_data;
|
|||
#endif
|
||||
|
||||
#define AHD_BUILD_COL_IDX(target, lun) \
|
||||
(((lun) << 4) | target)
|
||||
((((u8)lun) << 4) | target)
|
||||
|
||||
#define AHD_GET_SCB_COL_IDX(ahd, scb) \
|
||||
((SCB_GET_LUN(scb) << 4) | SCB_GET_TARGET(ahd, scb))
|
||||
|
|
|
|||
|
|
@ -2137,7 +2137,7 @@ ahd_linux_queue_cmd_complete(struct ahd_softc *ahd, struct scsi_cmnd *cmd)
|
|||
if (do_fallback) {
|
||||
printk("%s: device overrun (status %x) on %d:%d:%d\n",
|
||||
ahd_name(ahd), status, cmd->device->channel,
|
||||
cmd->device->id, cmd->device->lun);
|
||||
cmd->device->id, (u8)cmd->device->lun);
|
||||
}
|
||||
|
||||
ahd_cmd_set_transaction_status(cmd, new_status);
|
||||
|
|
@ -2253,13 +2253,13 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd)
|
|||
disconnected = TRUE;
|
||||
if (ahd_search_qinfifo(ahd, cmd->device->id,
|
||||
cmd->device->channel + 'A',
|
||||
cmd->device->lun,
|
||||
cmd->device->lun,
|
||||
pending_scb->hscb->tag,
|
||||
ROLE_INITIATOR, CAM_REQ_ABORTED,
|
||||
SEARCH_COMPLETE) > 0) {
|
||||
printk("%s:%d:%d:%d: Cmd aborted from QINFIFO\n",
|
||||
ahd_name(ahd), cmd->device->channel,
|
||||
cmd->device->id, cmd->device->lun);
|
||||
cmd->device->id, (u8)cmd->device->lun);
|
||||
retval = SUCCESS;
|
||||
goto done;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,10 +178,9 @@ ahd_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
ahd_get_pci_bus(pci),
|
||||
ahd_get_pci_slot(pci),
|
||||
ahd_get_pci_function(pci));
|
||||
name = kmalloc(strlen(buf) + 1, GFP_ATOMIC);
|
||||
name = kstrdup(buf, GFP_ATOMIC);
|
||||
if (name == NULL)
|
||||
return (-ENOMEM);
|
||||
strcpy(name, buf);
|
||||
ahd = ahd_alloc(NULL, name);
|
||||
if (ahd == NULL)
|
||||
return (-ENOMEM);
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ ahd_dump_device_state(struct seq_file *m, struct scsi_device *sdev)
|
|||
|
||||
seq_printf(m, "\tChannel %c Target %d Lun %d Settings\n",
|
||||
sdev->sdev_target->channel + 'A',
|
||||
sdev->sdev_target->id, sdev->lun);
|
||||
sdev->sdev_target->id, (u8)sdev->lun);
|
||||
|
||||
seq_printf(m, "\t\tCommands Queued %ld\n", dev->commands_issued);
|
||||
seq_printf(m, "\t\tCommands Active %d\n", dev->active);
|
||||
|
|
|
|||
|
|
@ -2110,7 +2110,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
|
|||
*/
|
||||
printk("%s:%d:%d:%d: Is not an active device\n",
|
||||
ahc_name(ahc), cmd->device->channel, cmd->device->id,
|
||||
cmd->device->lun);
|
||||
(u8)cmd->device->lun);
|
||||
retval = SUCCESS;
|
||||
goto no_cmd;
|
||||
}
|
||||
|
|
@ -2118,11 +2118,11 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
|
|||
if ((dev->flags & (AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED)) == 0
|
||||
&& ahc_search_untagged_queues(ahc, cmd, cmd->device->id,
|
||||
cmd->device->channel + 'A',
|
||||
cmd->device->lun,
|
||||
(u8)cmd->device->lun,
|
||||
CAM_REQ_ABORTED, SEARCH_COMPLETE) != 0) {
|
||||
printk("%s:%d:%d:%d: Command found on untagged queue\n",
|
||||
ahc_name(ahc), cmd->device->channel, cmd->device->id,
|
||||
cmd->device->lun);
|
||||
(u8)cmd->device->lun);
|
||||
retval = SUCCESS;
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -2188,13 +2188,14 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
|
|||
SEARCH_COMPLETE) > 0) {
|
||||
printk("%s:%d:%d:%d: Cmd aborted from QINFIFO\n",
|
||||
ahc_name(ahc), cmd->device->channel,
|
||||
cmd->device->id, cmd->device->lun);
|
||||
cmd->device->id, (u8)cmd->device->lun);
|
||||
retval = SUCCESS;
|
||||
goto done;
|
||||
}
|
||||
} else if (ahc_search_qinfifo(ahc, cmd->device->id,
|
||||
cmd->device->channel + 'A',
|
||||
cmd->device->lun, pending_scb->hscb->tag,
|
||||
cmd->device->lun,
|
||||
pending_scb->hscb->tag,
|
||||
ROLE_INITIATOR, /*status*/0,
|
||||
SEARCH_COUNT) > 0) {
|
||||
disconnected = FALSE;
|
||||
|
|
|
|||
|
|
@ -225,10 +225,9 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
ahc_get_pci_bus(pci),
|
||||
ahc_get_pci_slot(pci),
|
||||
ahc_get_pci_function(pci));
|
||||
name = kmalloc(strlen(buf) + 1, GFP_ATOMIC);
|
||||
name = kstrdup(buf, GFP_ATOMIC);
|
||||
if (name == NULL)
|
||||
return (-ENOMEM);
|
||||
strcpy(name, buf);
|
||||
ahc = ahc_alloc(NULL, name);
|
||||
if (ahc == NULL)
|
||||
return (-ENOMEM);
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ ahc_dump_device_state(struct seq_file *m, struct scsi_device *sdev)
|
|||
|
||||
seq_printf(m, "\tChannel %c Target %d Lun %d Settings\n",
|
||||
sdev->sdev_target->channel + 'A',
|
||||
sdev->sdev_target->id, sdev->lun);
|
||||
sdev->sdev_target->id, (u8)sdev->lun);
|
||||
|
||||
seq_printf(m, "\t\tCommands Queued %ld\n", dev->commands_issued);
|
||||
seq_printf(m, "\t\tCommands Active %d\n", dev->active);
|
||||
|
|
|
|||
|
|
@ -2335,7 +2335,7 @@ static int arcmsr_polling_hba_ccbdone(struct AdapterControlBlock *acb,
|
|||
" poll command abort successfully \n"
|
||||
, acb->host->host_no
|
||||
, ccb->pcmd->device->id
|
||||
, ccb->pcmd->device->lun
|
||||
, (u32)ccb->pcmd->device->lun
|
||||
, ccb);
|
||||
ccb->pcmd->result = DID_ABORT << 16;
|
||||
arcmsr_ccb_complete(ccb);
|
||||
|
|
@ -2399,7 +2399,7 @@ static int arcmsr_polling_hbb_ccbdone(struct AdapterControlBlock *acb,
|
|||
" poll command abort successfully \n"
|
||||
,acb->host->host_no
|
||||
,ccb->pcmd->device->id
|
||||
,ccb->pcmd->device->lun
|
||||
,(u32)ccb->pcmd->device->lun
|
||||
,ccb);
|
||||
ccb->pcmd->result = DID_ABORT << 16;
|
||||
arcmsr_ccb_complete(ccb);
|
||||
|
|
@ -2456,7 +2456,7 @@ polling_hbc_ccb_retry:
|
|||
" poll command abort successfully \n"
|
||||
, acb->host->host_no
|
||||
, pCCB->pcmd->device->id
|
||||
, pCCB->pcmd->device->lun
|
||||
, (u32)pCCB->pcmd->device->lun
|
||||
, pCCB);
|
||||
pCCB->pcmd->result = DID_ABORT << 16;
|
||||
arcmsr_ccb_complete(pCCB);
|
||||
|
|
@ -3058,7 +3058,7 @@ static int arcmsr_abort(struct scsi_cmnd *cmd)
|
|||
int rtn = FAILED;
|
||||
printk(KERN_NOTICE
|
||||
"arcmsr%d: abort device command of scsi id = %d lun = %d \n",
|
||||
acb->host->host_no, cmd->device->id, cmd->device->lun);
|
||||
acb->host->host_no, cmd->device->id, (u32)cmd->device->lun);
|
||||
acb->acb_flags |= ACB_F_ABORT;
|
||||
acb->num_aborts++;
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -760,7 +760,8 @@ intr_ret_t acornscsi_kick(AS_Host *host)
|
|||
SCpnt->tag = SCpnt->device->current_tag;
|
||||
} else
|
||||
#endif
|
||||
set_bit(SCpnt->device->id * 8 + SCpnt->device->lun, host->busyluns);
|
||||
set_bit(SCpnt->device->id * 8 +
|
||||
(u8)(SCpnt->device->lun & 0x07), host->busyluns);
|
||||
|
||||
host->stats.removes += 1;
|
||||
|
||||
|
|
@ -863,7 +864,8 @@ static void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp,
|
|||
if (!SCpnt->scsi_done)
|
||||
panic("scsi%d.H: null scsi_done function in acornscsi_done", host->host->host_no);
|
||||
|
||||
clear_bit(SCpnt->device->id * 8 + SCpnt->device->lun, host->busyluns);
|
||||
clear_bit(SCpnt->device->id * 8 +
|
||||
(u8)(SCpnt->device->lun & 0x7), host->busyluns);
|
||||
|
||||
SCpnt->scsi_done(SCpnt);
|
||||
} else
|
||||
|
|
@ -1576,7 +1578,8 @@ void acornscsi_message(AS_Host *host)
|
|||
printk(KERN_NOTICE "scsi%d.%c: disabling tagged queueing\n",
|
||||
host->host->host_no, acornscsi_target(host));
|
||||
host->SCpnt->device->simple_tags = 0;
|
||||
set_bit(host->SCpnt->device->id * 8 + host->SCpnt->device->lun, host->busyluns);
|
||||
set_bit(host->SCpnt->device->id * 8 +
|
||||
(u8)(host->SCpnt->device->lun & 0x7), host->busyluns);
|
||||
break;
|
||||
#endif
|
||||
case EXTENDED_MESSAGE | (EXTENDED_SDTR << 8):
|
||||
|
|
@ -2671,7 +2674,8 @@ int acornscsi_abort(struct scsi_cmnd *SCpnt)
|
|||
//#if (DEBUG & DEBUG_ABORT)
|
||||
printk("clear ");
|
||||
//#endif
|
||||
clear_bit(SCpnt->device->id * 8 + SCpnt->device->lun, host->busyluns);
|
||||
clear_bit(SCpnt->device->id * 8 +
|
||||
(u8)(SCpnt->device->lun & 0x7), host->busyluns);
|
||||
|
||||
/*
|
||||
* We found the command, and cleared it out. Either
|
||||
|
|
@ -2853,7 +2857,7 @@ static int acornscsi_show_info(struct seq_file *m, struct Scsi_Host *instance)
|
|||
|
||||
shost_for_each_device(scd, instance) {
|
||||
seq_printf(m, "Device/Lun TaggedQ Sync\n");
|
||||
seq_printf(m, " %d/%d ", scd->id, scd->lun);
|
||||
seq_printf(m, " %d/%llu ", scd->id, scd->lun);
|
||||
if (scd->tagged_supported)
|
||||
seq_printf(m, "%3sabled(%3d) ",
|
||||
scd->simple_tags ? "en" : "dis",
|
||||
|
|
|
|||
|
|
@ -1821,7 +1821,8 @@ static void fas216_allocate_tag(FAS216_Info *info, struct scsi_cmnd *SCpnt)
|
|||
SCpnt->tag = SCpnt->device->current_tag;
|
||||
} else
|
||||
#endif
|
||||
set_bit(SCpnt->device->id * 8 + SCpnt->device->lun, info->busyluns);
|
||||
set_bit(SCpnt->device->id * 8 +
|
||||
(u8)(SCpnt->device->lun & 0x7), info->busyluns);
|
||||
|
||||
info->stats.removes += 1;
|
||||
switch (SCpnt->cmnd[0]) {
|
||||
|
|
@ -2171,7 +2172,8 @@ static void fas216_done(FAS216_Info *info, unsigned int result)
|
|||
* status.
|
||||
*/
|
||||
info->device[SCpnt->device->id].parity_check = 0;
|
||||
clear_bit(SCpnt->device->id * 8 + SCpnt->device->lun, info->busyluns);
|
||||
clear_bit(SCpnt->device->id * 8 +
|
||||
(u8)(SCpnt->device->lun & 0x7), info->busyluns);
|
||||
|
||||
fn = (void (*)(FAS216_Info *, struct scsi_cmnd *, unsigned int))SCpnt->host_scribble;
|
||||
fn(info, SCpnt, result);
|
||||
|
|
@ -2398,7 +2400,8 @@ static enum res_find fas216_find_command(FAS216_Info *info,
|
|||
* been set.
|
||||
*/
|
||||
info->origSCpnt = NULL;
|
||||
clear_bit(SCpnt->device->id * 8 + SCpnt->device->lun, info->busyluns);
|
||||
clear_bit(SCpnt->device->id * 8 +
|
||||
(u8)(SCpnt->device->lun & 0x7), info->busyluns);
|
||||
printk("waiting for execution ");
|
||||
res = res_success;
|
||||
} else
|
||||
|
|
@ -3000,7 +3003,7 @@ void fas216_print_devices(FAS216_Info *info, struct seq_file *m)
|
|||
|
||||
shost_for_each_device(scd, info->host) {
|
||||
dev = &info->device[scd->id];
|
||||
seq_printf(m, " %d/%d ", scd->id, scd->lun);
|
||||
seq_printf(m, " %d/%llu ", scd->id, scd->lun);
|
||||
if (scd->tagged_supported)
|
||||
seq_printf(m, "%3sabled(%3d) ",
|
||||
scd->simple_tags ? "en" : "dis",
|
||||
|
|
|
|||
|
|
@ -167,7 +167,8 @@ struct scsi_cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude)
|
|||
spin_lock_irqsave(&queue->queue_lock, flags);
|
||||
list_for_each(l, &queue->head) {
|
||||
QE_t *q = list_entry(l, QE_t, list);
|
||||
if (!test_bit(q->SCpnt->device->id * 8 + q->SCpnt->device->lun, exclude)) {
|
||||
if (!test_bit(q->SCpnt->device->id * 8 +
|
||||
(u8)(q->SCpnt->device->lun & 0x7), exclude)) {
|
||||
SCpnt = __queue_remove(queue, l);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -361,17 +361,18 @@ static void __init init_tags(void)
|
|||
|
||||
static int is_lun_busy(Scsi_Cmnd *cmd, int should_be_tagged)
|
||||
{
|
||||
u8 lun = cmd->device->lun;
|
||||
SETUP_HOSTDATA(cmd->device->host);
|
||||
|
||||
if (hostdata->busy[cmd->device->id] & (1 << cmd->device->lun))
|
||||
if (hostdata->busy[cmd->device->id] & (1 << lun))
|
||||
return 1;
|
||||
if (!should_be_tagged ||
|
||||
!setup_use_tagged_queuing || !cmd->device->tagged_supported)
|
||||
return 0;
|
||||
if (TagAlloc[cmd->device->id][cmd->device->lun].nr_allocated >=
|
||||
TagAlloc[cmd->device->id][cmd->device->lun].queue_size) {
|
||||
if (TagAlloc[cmd->device->id][lun].nr_allocated >=
|
||||
TagAlloc[cmd->device->id][lun].queue_size) {
|
||||
dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d: no free tags\n",
|
||||
H_NO(cmd), cmd->device->id, cmd->device->lun);
|
||||
H_NO(cmd), cmd->device->id, lun);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -385,6 +386,7 @@ static int is_lun_busy(Scsi_Cmnd *cmd, int should_be_tagged)
|
|||
|
||||
static void cmd_get_tag(Scsi_Cmnd *cmd, int should_be_tagged)
|
||||
{
|
||||
u8 lun = cmd->device->lun;
|
||||
SETUP_HOSTDATA(cmd->device->host);
|
||||
|
||||
/* If we or the target don't support tagged queuing, allocate the LUN for
|
||||
|
|
@ -393,11 +395,11 @@ static void cmd_get_tag(Scsi_Cmnd *cmd, int should_be_tagged)
|
|||
if (!should_be_tagged ||
|
||||
!setup_use_tagged_queuing || !cmd->device->tagged_supported) {
|
||||
cmd->tag = TAG_NONE;
|
||||
hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun);
|
||||
hostdata->busy[cmd->device->id] |= (1 << lun);
|
||||
dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d now allocated by untagged "
|
||||
"command\n", H_NO(cmd), cmd->device->id, cmd->device->lun);
|
||||
"command\n", H_NO(cmd), cmd->device->id, lun);
|
||||
} else {
|
||||
TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun];
|
||||
TAG_ALLOC *ta = &TagAlloc[cmd->device->id][lun];
|
||||
|
||||
cmd->tag = find_first_zero_bit(ta->allocated, MAX_TAGS);
|
||||
set_bit(cmd->tag, ta->allocated);
|
||||
|
|
@ -405,7 +407,7 @@ static void cmd_get_tag(Scsi_Cmnd *cmd, int should_be_tagged)
|
|||
dprintk(NDEBUG_TAGS, "scsi%d: using tag %d for target %d lun %d "
|
||||
"(now %d tags in use)\n",
|
||||
H_NO(cmd), cmd->tag, cmd->device->id,
|
||||
cmd->device->lun, ta->nr_allocated);
|
||||
lun, ta->nr_allocated);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -416,21 +418,22 @@ static void cmd_get_tag(Scsi_Cmnd *cmd, int should_be_tagged)
|
|||
|
||||
static void cmd_free_tag(Scsi_Cmnd *cmd)
|
||||
{
|
||||
u8 lun = cmd->device->lun;
|
||||
SETUP_HOSTDATA(cmd->device->host);
|
||||
|
||||
if (cmd->tag == TAG_NONE) {
|
||||
hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun);
|
||||
hostdata->busy[cmd->device->id] &= ~(1 << lun);
|
||||
dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d untagged cmd finished\n",
|
||||
H_NO(cmd), cmd->device->id, cmd->device->lun);
|
||||
H_NO(cmd), cmd->device->id, lun);
|
||||
} else if (cmd->tag >= MAX_TAGS) {
|
||||
printk(KERN_NOTICE "scsi%d: trying to free bad tag %d!\n",
|
||||
H_NO(cmd), cmd->tag);
|
||||
} else {
|
||||
TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun];
|
||||
TAG_ALLOC *ta = &TagAlloc[cmd->device->id][lun];
|
||||
clear_bit(cmd->tag, ta->allocated);
|
||||
ta->nr_allocated--;
|
||||
dprintk(NDEBUG_TAGS, "scsi%d: freed tag %d for target %d lun %d\n",
|
||||
H_NO(cmd), cmd->tag, cmd->device->id, cmd->device->lun);
|
||||
H_NO(cmd), cmd->tag, cmd->device->id, lun);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -713,7 +716,7 @@ static void lprint_Scsi_Cmnd(Scsi_Cmnd *cmd)
|
|||
{
|
||||
int i, s;
|
||||
unsigned char *command;
|
||||
printk("scsi%d: destination target %d, lun %d\n",
|
||||
printk("scsi%d: destination target %d, lun %llu\n",
|
||||
H_NO(cmd), cmd->device->id, cmd->device->lun);
|
||||
printk(KERN_CONT " command = ");
|
||||
command = cmd->cmnd;
|
||||
|
|
@ -759,7 +762,7 @@ static void show_Scsi_Cmnd(Scsi_Cmnd *cmd, struct seq_file *m)
|
|||
{
|
||||
int i, s;
|
||||
unsigned char *command;
|
||||
seq_printf(m, "scsi%d: destination target %d, lun %d\n",
|
||||
seq_printf(m, "scsi%d: destination target %d, lun %llu\n",
|
||||
H_NO(cmd), cmd->device->id, cmd->device->lun);
|
||||
seq_printf(m, " command = ");
|
||||
command = cmd->cmnd;
|
||||
|
|
@ -1060,12 +1063,13 @@ static void NCR5380_main(struct work_struct *work)
|
|||
#endif
|
||||
for (tmp = (Scsi_Cmnd *) hostdata->issue_queue,
|
||||
prev = NULL; tmp; prev = tmp, tmp = NEXT(tmp)) {
|
||||
u8 lun = tmp->device->lun;
|
||||
|
||||
#if (NDEBUG & NDEBUG_LISTS)
|
||||
if (prev != tmp)
|
||||
printk("MAIN tmp=%p target=%d busy=%d lun=%d\n",
|
||||
printk("MAIN tmp=%p target=%d busy=%d lun=%llu\n",
|
||||
tmp, tmp->device->id, hostdata->busy[tmp->device->id],
|
||||
tmp->device->lun);
|
||||
lun);
|
||||
#endif
|
||||
/* When we find one, remove it from the issue queue. */
|
||||
/* ++guenther: possible race with Falcon locking */
|
||||
|
|
@ -1073,7 +1077,7 @@ static void NCR5380_main(struct work_struct *work)
|
|||
#ifdef SUPPORT_TAGS
|
||||
!is_lun_busy( tmp, tmp->cmnd[0] != REQUEST_SENSE)
|
||||
#else
|
||||
!(hostdata->busy[tmp->device->id] & (1 << tmp->device->lun))
|
||||
!(hostdata->busy[tmp->device->id] & (1 << lun))
|
||||
#endif
|
||||
) {
|
||||
/* ++guenther: just to be sure, this must be atomic */
|
||||
|
|
@ -1099,7 +1103,7 @@ static void NCR5380_main(struct work_struct *work)
|
|||
*/
|
||||
dprintk(NDEBUG_MAIN, "scsi%d: main(): command for target %d "
|
||||
"lun %d removed from issue_queue\n",
|
||||
HOSTNO, tmp->device->id, tmp->device->lun);
|
||||
HOSTNO, tmp->device->id, lun);
|
||||
/*
|
||||
* REQUEST SENSE commands are issued without tagged
|
||||
* queueing, even on SCSI-II devices because the
|
||||
|
|
@ -2061,7 +2065,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
|||
* accesses to this device will use the
|
||||
* polled-IO. */
|
||||
printk(KERN_NOTICE "scsi%d: switching target %d "
|
||||
"lun %d to slow handshake\n", HOSTNO,
|
||||
"lun %llu to slow handshake\n", HOSTNO,
|
||||
cmd->device->id, cmd->device->lun);
|
||||
cmd->device->borken = 1;
|
||||
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE |
|
||||
|
|
@ -2113,7 +2117,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
|||
/* Accept message by clearing ACK */
|
||||
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
|
||||
|
||||
dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %d linked command "
|
||||
dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %llu linked command "
|
||||
"complete.\n", HOSTNO, cmd->device->id, cmd->device->lun);
|
||||
|
||||
/* Enable reselect interrupts */
|
||||
|
|
@ -2125,7 +2129,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
|||
*/
|
||||
|
||||
if (!cmd->next_link) {
|
||||
printk(KERN_NOTICE "scsi%d: target %d lun %d "
|
||||
printk(KERN_NOTICE "scsi%d: target %d lun %llu "
|
||||
"linked command complete, no next_link\n",
|
||||
HOSTNO, cmd->device->id, cmd->device->lun);
|
||||
sink = 1;
|
||||
|
|
@ -2138,7 +2142,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
|||
* and don't free it! */
|
||||
cmd->next_link->tag = cmd->tag;
|
||||
cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8);
|
||||
dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %d linked request "
|
||||
dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %llu linked request "
|
||||
"done, calling scsi_done().\n",
|
||||
HOSTNO, cmd->device->id, cmd->device->lun);
|
||||
#ifdef NCR5380_STATS
|
||||
|
|
@ -2155,7 +2159,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
|||
/* ++guenther: possible race with Falcon locking */
|
||||
falcon_dont_release++;
|
||||
hostdata->connected = NULL;
|
||||
dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d, lun %d "
|
||||
dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d, lun %llu "
|
||||
"completed\n", HOSTNO, cmd->device->id, cmd->device->lun);
|
||||
#ifdef SUPPORT_TAGS
|
||||
cmd_free_tag(cmd);
|
||||
|
|
@ -2169,7 +2173,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
|||
/* ++Andreas: the mid level code knows about
|
||||
QUEUE_FULL now. */
|
||||
TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun];
|
||||
dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d returned "
|
||||
dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %llu returned "
|
||||
"QUEUE_FULL after %d commands\n",
|
||||
HOSTNO, cmd->device->id, cmd->device->lun,
|
||||
ta->nr_allocated);
|
||||
|
|
@ -2267,7 +2271,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
|||
cmd->device->tagged_supported = 0;
|
||||
hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun);
|
||||
cmd->tag = TAG_NONE;
|
||||
dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d rejected "
|
||||
dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %llu rejected "
|
||||
"QUEUE_TAG message; tagged queuing "
|
||||
"disabled\n",
|
||||
HOSTNO, cmd->device->id, cmd->device->lun);
|
||||
|
|
@ -2284,7 +2288,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
|||
hostdata->connected = NULL;
|
||||
hostdata->disconnected_queue = cmd;
|
||||
local_irq_restore(flags);
|
||||
dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d lun %d was "
|
||||
dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d lun %llu was "
|
||||
"moved from connected to the "
|
||||
"disconnected_queue\n", HOSTNO,
|
||||
cmd->device->id, cmd->device->lun);
|
||||
|
|
@ -2385,12 +2389,12 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
|||
printk("\n");
|
||||
} else if (tmp != EXTENDED_MESSAGE)
|
||||
printk(KERN_DEBUG "scsi%d: rejecting unknown "
|
||||
"message %02x from target %d, lun %d\n",
|
||||
"message %02x from target %d, lun %llu\n",
|
||||
HOSTNO, tmp, cmd->device->id, cmd->device->lun);
|
||||
else
|
||||
printk(KERN_DEBUG "scsi%d: rejecting unknown "
|
||||
"extended message "
|
||||
"code %02x, length %d from target %d, lun %d\n",
|
||||
"code %02x, length %d from target %d, lun %llu\n",
|
||||
HOSTNO, extended_msg[1], extended_msg[0],
|
||||
cmd->device->id, cmd->device->lun);
|
||||
|
||||
|
|
@ -2588,7 +2592,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
|
|||
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
|
||||
|
||||
hostdata->connected = tmp;
|
||||
dprintk(NDEBUG_RESELECTION, "scsi%d: nexus established, target = %d, lun = %d, tag = %d\n",
|
||||
dprintk(NDEBUG_RESELECTION, "scsi%d: nexus established, target = %d, lun = %llu, tag = %d\n",
|
||||
HOSTNO, tmp->device->id, tmp->device->lun, tmp->tag);
|
||||
falcon_dont_release--;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -914,7 +914,7 @@ void beiscsi_conn_get_stats(struct iscsi_cls_conn *cls_conn,
|
|||
stats->r2t_pdus = conn->r2t_pdus_cnt;
|
||||
stats->digest_err = 0;
|
||||
stats->timeout_err = 0;
|
||||
stats->custom_length = 0;
|
||||
stats->custom_length = 1;
|
||||
strcpy(stats->custom[0].desc, "eh_abort_cnt");
|
||||
stats->custom[0].value = conn->eh_abort_cnt;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1015,7 +1015,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
|
|||
if (if_info->dhcp_state) {
|
||||
beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
|
||||
"BG_%d : DHCP Already Enabled\n");
|
||||
return 0;
|
||||
goto exit;
|
||||
}
|
||||
/* The ip_param->len is 1 in DHCP case. Setting
|
||||
proper IP len as this it is used while
|
||||
|
|
@ -1033,7 +1033,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
|
|||
sizeof(*reldhcp));
|
||||
|
||||
if (rc)
|
||||
return rc;
|
||||
goto exit;
|
||||
|
||||
reldhcp = nonemb_cmd.va;
|
||||
reldhcp->interface_hndl = phba->interface_handle;
|
||||
|
|
@ -1044,7 +1044,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
|
|||
beiscsi_log(phba, KERN_WARNING,
|
||||
BEISCSI_LOG_CONFIG,
|
||||
"BG_%d : Failed to Delete existing dhcp\n");
|
||||
return rc;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1054,7 +1054,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
|
|||
rc = mgmt_static_ip_modify(phba, if_info, ip_param, NULL,
|
||||
IP_ACTION_DEL);
|
||||
if (rc)
|
||||
return rc;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* Delete the Gateway settings if mode change is to DHCP */
|
||||
|
|
@ -1064,7 +1064,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
|
|||
if (rc) {
|
||||
beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
|
||||
"BG_%d : Failed to Get Gateway Addr\n");
|
||||
return rc;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (gtway_addr_set.ip_addr.addr[0]) {
|
||||
|
|
@ -1076,7 +1076,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
|
|||
beiscsi_log(phba, KERN_WARNING,
|
||||
BEISCSI_LOG_CONFIG,
|
||||
"BG_%d : Failed to clear Gateway Addr Set\n");
|
||||
return rc;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1087,7 +1087,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
|
|||
OPCODE_COMMON_ISCSI_NTWK_CONFIG_STATELESS_IP_ADDR,
|
||||
sizeof(*dhcpreq));
|
||||
if (rc)
|
||||
return rc;
|
||||
goto exit;
|
||||
|
||||
dhcpreq = nonemb_cmd.va;
|
||||
dhcpreq->flags = BLOCKING;
|
||||
|
|
@ -1095,12 +1095,14 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
|
|||
dhcpreq->interface_hndl = phba->interface_handle;
|
||||
dhcpreq->ip_type = BE2_DHCP_V4;
|
||||
|
||||
return mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0);
|
||||
rc = mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0);
|
||||
} else {
|
||||
return mgmt_static_ip_modify(phba, if_info, ip_param,
|
||||
rc = mgmt_static_ip_modify(phba, if_info, ip_param,
|
||||
subnet_param, IP_ACTION_ADD);
|
||||
}
|
||||
|
||||
exit:
|
||||
kfree(if_info);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
|
|||
bfa->fcs = BFA_TRUE;
|
||||
fcbuild_init();
|
||||
|
||||
for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(fcs_modules); i++) {
|
||||
mod = &fcs_modules[i];
|
||||
if (mod->attach)
|
||||
mod->attach(fcs);
|
||||
|
|
@ -97,7 +97,7 @@ bfa_fcs_init(struct bfa_fcs_s *fcs)
|
|||
int i;
|
||||
struct bfa_fcs_mod_s *mod;
|
||||
|
||||
for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(fcs_modules); i++) {
|
||||
mod = &fcs_modules[i];
|
||||
if (mod->modinit)
|
||||
mod->modinit(fcs);
|
||||
|
|
@ -184,7 +184,7 @@ bfa_fcs_exit(struct bfa_fcs_s *fcs)
|
|||
|
||||
bfa_wc_init(&fcs->wc, bfa_fcs_exit_comp, fcs);
|
||||
|
||||
nmods = sizeof(fcs_modules) / sizeof(fcs_modules[0]);
|
||||
nmods = ARRAY_SIZE(fcs_modules);
|
||||
|
||||
for (i = 0; i < nmods; i++) {
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ struct bfa_sge_s {
|
|||
} while (0)
|
||||
|
||||
#define bfa_swap_words(_x) ( \
|
||||
((_x) << 32) | ((_x) >> 32))
|
||||
((u64)(_x) << 32) | ((u64)(_x) >> 32))
|
||||
|
||||
#ifdef __BIG_ENDIAN
|
||||
#define bfa_sge_to_be(_x)
|
||||
|
|
|
|||
|
|
@ -1219,7 +1219,7 @@ bfad_install_msix_handler(struct bfad_s *bfad)
|
|||
int
|
||||
bfad_setup_intr(struct bfad_s *bfad)
|
||||
{
|
||||
int error = 0;
|
||||
int error;
|
||||
u32 mask = 0, i, num_bit = 0, max_bit = 0;
|
||||
struct msix_entry msix_entries[MAX_MSIX_ENTRY];
|
||||
struct pci_dev *pdev = bfad->pcidev;
|
||||
|
|
@ -1234,34 +1234,24 @@ bfad_setup_intr(struct bfad_s *bfad)
|
|||
if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) ||
|
||||
(bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) {
|
||||
|
||||
error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec);
|
||||
if (error) {
|
||||
/* In CT1 & CT2, try to allocate just one vector */
|
||||
if (bfa_asic_id_ctc(pdev->device)) {
|
||||
printk(KERN_WARNING "bfa %s: trying one msix "
|
||||
"vector failed to allocate %d[%d]\n",
|
||||
bfad->pci_name, bfad->nvec, error);
|
||||
bfad->nvec = 1;
|
||||
error = pci_enable_msix(bfad->pcidev,
|
||||
msix_entries, bfad->nvec);
|
||||
}
|
||||
error = pci_enable_msix_exact(bfad->pcidev,
|
||||
msix_entries, bfad->nvec);
|
||||
/* In CT1 & CT2, try to allocate just one vector */
|
||||
if (error == -ENOSPC && bfa_asic_id_ctc(pdev->device)) {
|
||||
printk(KERN_WARNING "bfa %s: trying one msix "
|
||||
"vector failed to allocate %d[%d]\n",
|
||||
bfad->pci_name, bfad->nvec, error);
|
||||
bfad->nvec = 1;
|
||||
error = pci_enable_msix_exact(bfad->pcidev,
|
||||
msix_entries, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Only error number of vector is available.
|
||||
* We don't have a mechanism to map multiple
|
||||
* interrupts into one vector, so even if we
|
||||
* can try to request less vectors, we don't
|
||||
* know how to associate interrupt events to
|
||||
* vectors. Linux doesn't duplicate vectors
|
||||
* in the MSIX table for this case.
|
||||
*/
|
||||
if (error) {
|
||||
printk(KERN_WARNING "bfad%d: "
|
||||
"pci_enable_msix failed (%d), "
|
||||
"use line based.\n",
|
||||
bfad->inst_no, error);
|
||||
goto line_based;
|
||||
}
|
||||
if (error) {
|
||||
printk(KERN_WARNING "bfad%d: "
|
||||
"pci_enable_msix_exact failed (%d), "
|
||||
"use line based.\n",
|
||||
bfad->inst_no, error);
|
||||
goto line_based;
|
||||
}
|
||||
|
||||
/* Disable INTX in MSI-X mode */
|
||||
|
|
@ -1281,20 +1271,18 @@ bfad_setup_intr(struct bfad_s *bfad)
|
|||
|
||||
bfad->bfad_flags |= BFAD_MSIX_ON;
|
||||
|
||||
return error;
|
||||
return 0;
|
||||
}
|
||||
|
||||
line_based:
|
||||
error = 0;
|
||||
if (request_irq
|
||||
(bfad->pcidev->irq, (irq_handler_t) bfad_intx, BFAD_IRQ_FLAGS,
|
||||
BFAD_DRIVER_NAME, bfad) != 0) {
|
||||
/* Enable interrupt handler failed */
|
||||
return 1;
|
||||
}
|
||||
error = request_irq(bfad->pcidev->irq, (irq_handler_t)bfad_intx,
|
||||
BFAD_IRQ_FLAGS, BFAD_DRIVER_NAME, bfad);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
bfad->bfad_flags |= BFAD_INTX_ON;
|
||||
|
||||
return error;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ int
|
|||
bfad_iocmd_ioc_enable(struct bfad_s *bfad, void *cmd)
|
||||
{
|
||||
struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
|
||||
int rc = 0;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&bfad->bfad_lock, flags);
|
||||
|
|
@ -34,7 +33,7 @@ bfad_iocmd_ioc_enable(struct bfad_s *bfad, void *cmd)
|
|||
if (!bfa_ioc_is_disabled(&bfad->bfa.ioc)) {
|
||||
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
|
||||
iocmd->status = BFA_STATUS_OK;
|
||||
return rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
init_completion(&bfad->enable_comp);
|
||||
|
|
@ -43,21 +42,20 @@ bfad_iocmd_ioc_enable(struct bfad_s *bfad, void *cmd)
|
|||
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
|
||||
wait_for_completion(&bfad->enable_comp);
|
||||
|
||||
return rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
bfad_iocmd_ioc_disable(struct bfad_s *bfad, void *cmd)
|
||||
{
|
||||
struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
|
||||
int rc = 0;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&bfad->bfad_lock, flags);
|
||||
if (bfa_ioc_is_disabled(&bfad->bfa.ioc)) {
|
||||
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
|
||||
iocmd->status = BFA_STATUS_OK;
|
||||
return rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (bfad->disable_active) {
|
||||
|
|
@ -74,7 +72,7 @@ bfad_iocmd_ioc_disable(struct bfad_s *bfad, void *cmd)
|
|||
bfad->disable_active = BFA_FALSE;
|
||||
iocmd->status = BFA_STATUS_OK;
|
||||
|
||||
return rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -3270,13 +3268,13 @@ bfad_fcxp_map_sg(struct bfad_s *bfad, void *payload_kbuf,
|
|||
/* Allocate dma coherent memory */
|
||||
buf_info = buf_base;
|
||||
buf_info->size = payload_len;
|
||||
buf_info->virt = dma_alloc_coherent(&bfad->pcidev->dev, buf_info->size,
|
||||
&buf_info->phys, GFP_KERNEL);
|
||||
buf_info->virt = dma_zalloc_coherent(&bfad->pcidev->dev,
|
||||
buf_info->size, &buf_info->phys,
|
||||
GFP_KERNEL);
|
||||
if (!buf_info->virt)
|
||||
goto out_free_mem;
|
||||
|
||||
/* copy the linear bsg buffer to buf_info */
|
||||
memset(buf_info->virt, 0, buf_info->size);
|
||||
memcpy(buf_info->virt, payload_kbuf, buf_info->size);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,3 +1,16 @@
|
|||
/* 57xx_hsi_bnx2fc.h: QLogic NetXtreme II Linux FCoE offload driver.
|
||||
* Handles operations such as session offload/upload etc, and manages
|
||||
* session resources such as connection id and qp resources.
|
||||
*
|
||||
* Copyright (c) 2008 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __57XX_FCOE_HSI_LINUX_LE__
|
||||
#define __57XX_FCOE_HSI_LINUX_LE__
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
config SCSI_BNX2X_FCOE
|
||||
tristate "Broadcom NetXtreme II FCoE support"
|
||||
tristate "QLogic NetXtreme II FCoE support"
|
||||
depends on PCI
|
||||
select NETDEVICES
|
||||
select ETHERNET
|
||||
|
|
@ -8,5 +8,5 @@ config SCSI_BNX2X_FCOE
|
|||
select LIBFCOE
|
||||
select CNIC
|
||||
---help---
|
||||
This driver supports FCoE offload for the Broadcom NetXtreme II
|
||||
This driver supports FCoE offload for the QLogic NetXtreme II
|
||||
devices.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
#ifndef _BNX2FC_H_
|
||||
#define _BNX2FC_H_
|
||||
/* bnx2fc.h: Broadcom NetXtreme II Linux FCoE offload driver.
|
||||
/* bnx2fc.h: QLogic NetXtreme II Linux FCoE offload driver.
|
||||
*
|
||||
* Copyright (c) 2008 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* 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
|
||||
|
|
@ -11,6 +10,8 @@
|
|||
* Written by: Bhanu Prakash Gollapudi (bprakash@broadcom.com)
|
||||
*/
|
||||
|
||||
#ifndef _BNX2FC_H_
|
||||
#define _BNX2FC_H_
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,16 @@
|
|||
/* bnx2fc_constants.h: QLogic NetXtreme II Linux FCoE offload driver.
|
||||
* Handles operations such as session offload/upload etc, and manages
|
||||
* session resources such as connection id and qp resources.
|
||||
*
|
||||
* Copyright (c) 2008 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __BNX2FC_CONSTANTS_H_
|
||||
#define __BNX2FC_CONSTANTS_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,16 @@
|
|||
/* bnx2fc_debug.c: QLogic NetXtreme II Linux FCoE offload driver.
|
||||
* Handles operations such as session offload/upload etc, and manages
|
||||
* session resources such as connection id and qp resources.
|
||||
*
|
||||
* Copyright (c) 2008 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bnx2fc.h"
|
||||
|
||||
void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,16 @@
|
|||
/* bnx2fc_debug.h: QLogic NetXtreme II Linux FCoE offload driver.
|
||||
* Handles operations such as session offload/upload etc, and manages
|
||||
* session resources such as connection id and qp resources.
|
||||
*
|
||||
* Copyright (c) 2008 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __BNX2FC_DEBUG__
|
||||
#define __BNX2FC_DEBUG__
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
/*
|
||||
* bnx2fc_els.c: Broadcom NetXtreme II Linux FCoE offload driver.
|
||||
* bnx2fc_els.c: QLogic NetXtreme II Linux FCoE offload driver.
|
||||
* This file contains helper routines that handle ELS requests
|
||||
* and responses.
|
||||
*
|
||||
* Copyright (c) 2008 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
/* bnx2fc_fcoe.c: Broadcom NetXtreme II Linux FCoE offload driver.
|
||||
/* bnx2fc_fcoe.c: QLogic NetXtreme II Linux FCoE offload driver.
|
||||
* This file contains the code that interacts with libfc, libfcoe,
|
||||
* cnic modules to create FCoE instances, send/receive non-offloaded
|
||||
* FIP/FCoE packets, listen to link events etc.
|
||||
*
|
||||
* Copyright (c) 2008 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* 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
|
||||
|
|
@ -26,12 +27,12 @@ DEFINE_PER_CPU(struct bnx2fc_percpu_s, bnx2fc_percpu);
|
|||
|
||||
|
||||
static char version[] =
|
||||
"Broadcom NetXtreme II FCoE Driver " DRV_MODULE_NAME \
|
||||
"QLogic NetXtreme II FCoE Driver " DRV_MODULE_NAME \
|
||||
" v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
|
||||
|
||||
|
||||
MODULE_AUTHOR("Bhanu Prakash Gollapudi <[email protected]>");
|
||||
MODULE_DESCRIPTION("Broadcom NetXtreme II BCM57710 FCoE Driver");
|
||||
MODULE_DESCRIPTION("QLogic NetXtreme II BCM57710 FCoE Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(DRV_MODULE_VERSION);
|
||||
|
||||
|
|
@ -692,7 +693,7 @@ static int bnx2fc_shost_config(struct fc_lport *lport, struct device *dev)
|
|||
if (!lport->vport)
|
||||
fc_host_max_npiv_vports(lport->host) = USHRT_MAX;
|
||||
snprintf(fc_host_symbolic_name(lport->host), 256,
|
||||
"%s (Broadcom %s) v%s over %s",
|
||||
"%s (QLogic %s) v%s over %s",
|
||||
BNX2FC_NAME, hba->chip_num, BNX2FC_VERSION,
|
||||
interface->netdev->name);
|
||||
|
||||
|
|
@ -2775,7 +2776,7 @@ static struct fc_function_template bnx2fc_vport_xport_function = {
|
|||
*/
|
||||
static struct scsi_host_template bnx2fc_shost_template = {
|
||||
.module = THIS_MODULE,
|
||||
.name = "Broadcom Offload FCoE Initiator",
|
||||
.name = "QLogic Offload FCoE Initiator",
|
||||
.queuecommand = bnx2fc_queuecommand,
|
||||
.eh_abort_handler = bnx2fc_eh_abort, /* abts */
|
||||
.eh_device_reset_handler = bnx2fc_eh_device_reset, /* lun reset */
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
/* bnx2fc_hwi.c: Broadcom NetXtreme II Linux FCoE offload driver.
|
||||
/* bnx2fc_hwi.c: QLogic NetXtreme II Linux FCoE offload driver.
|
||||
* This file contains the code that low level functions that interact
|
||||
* with 57712 FCoE firmware.
|
||||
*
|
||||
* Copyright (c) 2008 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/* bnx2fc_io.c: Broadcom NetXtreme II Linux FCoE offload driver.
|
||||
/* bnx2fc_io.c: QLogic NetXtreme II Linux FCoE offload driver.
|
||||
* IO manager and SCSI IO processing.
|
||||
*
|
||||
* Copyright (c) 2008 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* 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
|
||||
|
|
@ -1450,9 +1451,9 @@ static void bnx2fc_lun_reset_cmpl(struct bnx2fc_cmd *io_req)
|
|||
struct scsi_cmnd *sc_cmd = io_req->sc_cmd;
|
||||
struct bnx2fc_rport *tgt = io_req->tgt;
|
||||
struct bnx2fc_cmd *cmd, *tmp;
|
||||
int tm_lun = sc_cmd->device->lun;
|
||||
u64 tm_lun = sc_cmd->device->lun;
|
||||
u64 lun;
|
||||
int rc = 0;
|
||||
int lun;
|
||||
|
||||
/* called with tgt_lock held */
|
||||
BNX2FC_IO_DBG(io_req, "Entered bnx2fc_lun_reset_cmpl\n");
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
/* bnx2fc_tgt.c: Broadcom NetXtreme II Linux FCoE offload driver.
|
||||
/* bnx2fc_tgt.c: QLogic NetXtreme II Linux FCoE offload driver.
|
||||
* Handles operations such as session offload/upload etc, and manages
|
||||
* session resources such as connection id and qp resources.
|
||||
*
|
||||
* Copyright (c) 2008 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
/* 57xx_iscsi_constants.h: Broadcom NetXtreme II iSCSI HSI
|
||||
/* 57xx_iscsi_constants.h: QLogic NetXtreme II iSCSI HSI
|
||||
*
|
||||
* Copyright (c) 2006 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation.
|
||||
*
|
||||
* Written by: Anil Veerabhadrappa (anilgv@broadcom.com)
|
||||
* Maintained by: Eddie Wai (eddie.wai@broadcom.com)
|
||||
* Previously Maintained by: Eddie Wai (eddie.wai@broadcom.com)
|
||||
* Maintained by: QLogic-Storage-Upstream@qlogic.com
|
||||
*/
|
||||
#ifndef __57XX_ISCSI_CONSTANTS_H_
|
||||
#define __57XX_ISCSI_CONSTANTS_H_
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
/* 57xx_iscsi_hsi.h: Broadcom NetXtreme II iSCSI HSI.
|
||||
/* 57xx_iscsi_hsi.h: QLogic NetXtreme II iSCSI HSI.
|
||||
*
|
||||
* Copyright (c) 2006 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation.
|
||||
*
|
||||
* Written by: Anil Veerabhadrappa (anilgv@broadcom.com)
|
||||
* Maintained by: Eddie Wai (eddie.wai@broadcom.com)
|
||||
* Previously Maintained by: Eddie Wai (eddie.wai@broadcom.com)
|
||||
* Maintained by: QLogic-Storage-Upstream@qlogic.com
|
||||
*/
|
||||
#ifndef __57XX_ISCSI_HSI_LINUX_LE__
|
||||
#define __57XX_ISCSI_HSI_LINUX_LE__
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
config SCSI_BNX2_ISCSI
|
||||
tristate "Broadcom NetXtreme II iSCSI support"
|
||||
tristate "QLogic NetXtreme II iSCSI support"
|
||||
depends on NET
|
||||
depends on PCI
|
||||
select SCSI_ISCSI_ATTRS
|
||||
|
|
@ -8,5 +8,5 @@ config SCSI_BNX2_ISCSI
|
|||
select NET_VENDOR_BROADCOM
|
||||
select CNIC
|
||||
---help---
|
||||
This driver supports iSCSI offload for the Broadcom NetXtreme II
|
||||
This driver supports iSCSI offload for the QLogic NetXtreme II
|
||||
devices.
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
/* bnx2i.h: Broadcom NetXtreme II iSCSI driver.
|
||||
/* bnx2i.h: QLogic NetXtreme II iSCSI driver.
|
||||
*
|
||||
* Copyright (c) 2006 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2007, 2008 Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2007, 2008 Mike Christie
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation.
|
||||
*
|
||||
* Written by: Anil Veerabhadrappa (anilgv@broadcom.com)
|
||||
* Maintained by: Eddie Wai (eddie.wai@broadcom.com)
|
||||
* Previously Maintained by: Eddie Wai (eddie.wai@broadcom.com)
|
||||
* Maintained by: QLogic-Storage-Upstream@qlogic.com
|
||||
*/
|
||||
|
||||
#ifndef _BNX2I_H_
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
/* bnx2i_hwi.c: Broadcom NetXtreme II iSCSI driver.
|
||||
/* bnx2i_hwi.c: QLogic NetXtreme II iSCSI driver.
|
||||
*
|
||||
* Copyright (c) 2006 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2007, 2008 Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2007, 2008 Mike Christie
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation.
|
||||
*
|
||||
* Written by: Anil Veerabhadrappa (anilgv@broadcom.com)
|
||||
* Maintained by: Eddie Wai (eddie.wai@broadcom.com)
|
||||
* Previously Maintained by: Eddie Wai (eddie.wai@broadcom.com)
|
||||
* Maintained by: QLogic-Storage-Upstream@qlogic.com
|
||||
*/
|
||||
|
||||
#include <linux/gfp.h>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
/* bnx2i.c: Broadcom NetXtreme II iSCSI driver.
|
||||
/* bnx2i.c: QLogic NetXtreme II iSCSI driver.
|
||||
*
|
||||
* Copyright (c) 2006 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2007, 2008 Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2007, 2008 Mike Christie
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation.
|
||||
*
|
||||
* Written by: Anil Veerabhadrappa (anilgv@broadcom.com)
|
||||
* Maintained by: Eddie Wai (eddie.wai@broadcom.com)
|
||||
* Previously Maintained by: Eddie Wai (eddie.wai@broadcom.com)
|
||||
* Maintained by: QLogic-Storage-Upstream@qlogic.com
|
||||
*/
|
||||
|
||||
#include "bnx2i.h"
|
||||
|
|
@ -18,18 +20,18 @@ static struct list_head adapter_list = LIST_HEAD_INIT(adapter_list);
|
|||
static u32 adapter_count;
|
||||
|
||||
#define DRV_MODULE_NAME "bnx2i"
|
||||
#define DRV_MODULE_VERSION "2.7.6.2"
|
||||
#define DRV_MODULE_RELDATE "Jun 06, 2013"
|
||||
#define DRV_MODULE_VERSION "2.7.10.1"
|
||||
#define DRV_MODULE_RELDATE "Jul 16, 2014"
|
||||
|
||||
static char version[] =
|
||||
"Broadcom NetXtreme II iSCSI Driver " DRV_MODULE_NAME \
|
||||
"QLogic NetXtreme II iSCSI Driver " DRV_MODULE_NAME \
|
||||
" v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
|
||||
|
||||
|
||||
MODULE_AUTHOR("Anil Veerabhadrappa <[email protected]> and "
|
||||
"Eddie Wai <[email protected]>");
|
||||
|
||||
MODULE_DESCRIPTION("Broadcom NetXtreme II BCM5706/5708/5709/57710/57711/57712"
|
||||
MODULE_DESCRIPTION("QLogic NetXtreme II BCM5706/5708/5709/57710/57711/57712"
|
||||
"/57800/57810/57840 iSCSI Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(DRV_MODULE_VERSION);
|
||||
|
|
|
|||
|
|
@ -1,16 +1,18 @@
|
|||
/*
|
||||
* bnx2i_iscsi.c: Broadcom NetXtreme II iSCSI driver.
|
||||
* bnx2i_iscsi.c: QLogic NetXtreme II iSCSI driver.
|
||||
*
|
||||
* Copyright (c) 2006 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2007, 2008 Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2007, 2008 Mike Christie
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation.
|
||||
*
|
||||
* Written by: Anil Veerabhadrappa (anilgv@broadcom.com)
|
||||
* Maintained by: Eddie Wai (eddie.wai@broadcom.com)
|
||||
* Previously Maintained by: Eddie Wai (eddie.wai@broadcom.com)
|
||||
* Maintained by: QLogic-Storage-Upstream@qlogic.com
|
||||
*/
|
||||
|
||||
#include <linux/slab.h>
|
||||
|
|
@ -1643,12 +1645,11 @@ static void bnx2i_conn_get_stats(struct iscsi_cls_conn *cls_conn,
|
|||
stats->r2t_pdus = conn->r2t_pdus_cnt;
|
||||
stats->tmfcmd_pdus = conn->tmfcmd_pdus_cnt;
|
||||
stats->tmfrsp_pdus = conn->tmfrsp_pdus_cnt;
|
||||
stats->custom_length = 3;
|
||||
strcpy(stats->custom[2].desc, "eh_abort_cnt");
|
||||
stats->custom[2].value = conn->eh_abort_cnt;
|
||||
stats->digest_err = 0;
|
||||
stats->timeout_err = 0;
|
||||
stats->custom_length = 0;
|
||||
strcpy(stats->custom[0].desc, "eh_abort_cnt");
|
||||
stats->custom[0].value = conn->eh_abort_cnt;
|
||||
stats->custom_length = 1;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2249,7 +2250,7 @@ static umode_t bnx2i_attr_is_visible(int param_type, int param)
|
|||
*/
|
||||
static struct scsi_host_template bnx2i_host_template = {
|
||||
.module = THIS_MODULE,
|
||||
.name = "Broadcom Offload iSCSI Initiator",
|
||||
.name = "QLogic Offload iSCSI Initiator",
|
||||
.proc_name = "bnx2i",
|
||||
.queuecommand = iscsi_queuecommand,
|
||||
.eh_abort_handler = iscsi_eh_abort,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
/* bnx2i_sysfs.c: Broadcom NetXtreme II iSCSI driver.
|
||||
/* bnx2i_sysfs.c: QLogic NetXtreme II iSCSI driver.
|
||||
*
|
||||
* Copyright (c) 2004 - 2013 Broadcom Corporation
|
||||
* Copyright (c) 2014, QLogic Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation.
|
||||
*
|
||||
* Written by: Anil Veerabhadrappa (anilgv@broadcom.com)
|
||||
* Maintained by: Eddie Wai (eddie.wai@broadcom.com)
|
||||
* Previously Maintained by: Eddie Wai (eddie.wai@broadcom.com)
|
||||
* Maintained by: QLogic-Storage-Upstream@qlogic.com
|
||||
*/
|
||||
|
||||
#include "bnx2i.h"
|
||||
|
|
|
|||
|
|
@ -84,15 +84,19 @@ static const char * vendor_labels[CH_TYPES-4] = {
|
|||
};
|
||||
// module_param_string_array(vendor_labels, NULL, 0444);
|
||||
|
||||
#define ch_printk(prefix, ch, fmt, a...) \
|
||||
sdev_printk(prefix, (ch)->device, "[%s] " fmt, \
|
||||
(ch)->name, ##a)
|
||||
|
||||
#define DPRINTK(fmt, arg...) \
|
||||
do { \
|
||||
if (debug) \
|
||||
printk(KERN_DEBUG "%s: " fmt, ch->name, ##arg); \
|
||||
ch_printk(KERN_DEBUG, ch, fmt, ##arg); \
|
||||
} while (0)
|
||||
#define VPRINTK(level, fmt, arg...) \
|
||||
do { \
|
||||
if (verbose) \
|
||||
printk(level "%s: " fmt, ch->name, ##arg); \
|
||||
ch_printk(level, ch, fmt, ##arg); \
|
||||
} while (0)
|
||||
|
||||
/* ------------------------------------------------------------------- */
|
||||
|
|
@ -196,7 +200,7 @@ ch_do_scsi(scsi_changer *ch, unsigned char *cmd,
|
|||
__scsi_print_command(cmd);
|
||||
}
|
||||
|
||||
result = scsi_execute_req(ch->device, cmd, direction, buffer,
|
||||
result = scsi_execute_req(ch->device, cmd, direction, buffer,
|
||||
buflength, &sshdr, timeout * HZ,
|
||||
MAX_RETRIES, NULL);
|
||||
|
||||
|
|
@ -247,7 +251,7 @@ ch_read_element_status(scsi_changer *ch, u_int elem, char *data)
|
|||
retry:
|
||||
memset(cmd,0,sizeof(cmd));
|
||||
cmd[0] = READ_ELEMENT_STATUS;
|
||||
cmd[1] = (ch->device->lun << 5) |
|
||||
cmd[1] = ((ch->device->lun & 0x7) << 5) |
|
||||
(ch->voltags ? 0x10 : 0) |
|
||||
ch_elem_to_typecode(ch,elem);
|
||||
cmd[2] = (elem >> 8) & 0xff;
|
||||
|
|
@ -283,7 +287,7 @@ ch_init_elem(scsi_changer *ch)
|
|||
VPRINTK(KERN_INFO, "INITIALIZE ELEMENT STATUS, may take some time ...\n");
|
||||
memset(cmd,0,sizeof(cmd));
|
||||
cmd[0] = INITIALIZE_ELEMENT_STATUS;
|
||||
cmd[1] = ch->device->lun << 5;
|
||||
cmd[1] = (ch->device->lun & 0x7) << 5;
|
||||
err = ch_do_scsi(ch, cmd, NULL, 0, DMA_NONE);
|
||||
VPRINTK(KERN_INFO, "... finished\n");
|
||||
return err;
|
||||
|
|
@ -303,7 +307,7 @@ ch_readconfig(scsi_changer *ch)
|
|||
|
||||
memset(cmd,0,sizeof(cmd));
|
||||
cmd[0] = MODE_SENSE;
|
||||
cmd[1] = ch->device->lun << 5;
|
||||
cmd[1] = (ch->device->lun & 0x7) << 5;
|
||||
cmd[2] = 0x1d;
|
||||
cmd[4] = 255;
|
||||
result = ch_do_scsi(ch, cmd, buffer, 255, DMA_FROM_DEVICE);
|
||||
|
|
@ -428,7 +432,7 @@ ch_position(scsi_changer *ch, u_int trans, u_int elem, int rotate)
|
|||
trans = ch->firsts[CHET_MT];
|
||||
memset(cmd,0,sizeof(cmd));
|
||||
cmd[0] = POSITION_TO_ELEMENT;
|
||||
cmd[1] = ch->device->lun << 5;
|
||||
cmd[1] = (ch->device->lun & 0x7) << 5;
|
||||
cmd[2] = (trans >> 8) & 0xff;
|
||||
cmd[3] = trans & 0xff;
|
||||
cmd[4] = (elem >> 8) & 0xff;
|
||||
|
|
@ -447,7 +451,7 @@ ch_move(scsi_changer *ch, u_int trans, u_int src, u_int dest, int rotate)
|
|||
trans = ch->firsts[CHET_MT];
|
||||
memset(cmd,0,sizeof(cmd));
|
||||
cmd[0] = MOVE_MEDIUM;
|
||||
cmd[1] = ch->device->lun << 5;
|
||||
cmd[1] = (ch->device->lun & 0x7) << 5;
|
||||
cmd[2] = (trans >> 8) & 0xff;
|
||||
cmd[3] = trans & 0xff;
|
||||
cmd[4] = (src >> 8) & 0xff;
|
||||
|
|
@ -470,7 +474,7 @@ ch_exchange(scsi_changer *ch, u_int trans, u_int src,
|
|||
trans = ch->firsts[CHET_MT];
|
||||
memset(cmd,0,sizeof(cmd));
|
||||
cmd[0] = EXCHANGE_MEDIUM;
|
||||
cmd[1] = ch->device->lun << 5;
|
||||
cmd[1] = (ch->device->lun & 0x7) << 5;
|
||||
cmd[2] = (trans >> 8) & 0xff;
|
||||
cmd[3] = trans & 0xff;
|
||||
cmd[4] = (src >> 8) & 0xff;
|
||||
|
|
@ -518,7 +522,7 @@ ch_set_voltag(scsi_changer *ch, u_int elem,
|
|||
elem, tag);
|
||||
memset(cmd,0,sizeof(cmd));
|
||||
cmd[0] = SEND_VOLUME_TAG;
|
||||
cmd[1] = (ch->device->lun << 5) |
|
||||
cmd[1] = ((ch->device->lun & 0x7) << 5) |
|
||||
ch_elem_to_typecode(ch,elem);
|
||||
cmd[2] = (elem >> 8) & 0xff;
|
||||
cmd[3] = elem & 0xff;
|
||||
|
|
@ -754,7 +758,7 @@ static long ch_ioctl(struct file *file,
|
|||
voltag_retry:
|
||||
memset(ch_cmd, 0, sizeof(ch_cmd));
|
||||
ch_cmd[0] = READ_ELEMENT_STATUS;
|
||||
ch_cmd[1] = (ch->device->lun << 5) |
|
||||
ch_cmd[1] = ((ch->device->lun & 0x7) << 5) |
|
||||
(ch->voltags ? 0x10 : 0) |
|
||||
ch_elem_to_typecode(ch,elem);
|
||||
ch_cmd[2] = (elem >> 8) & 0xff;
|
||||
|
|
@ -924,8 +928,8 @@ static int ch_probe(struct device *dev)
|
|||
MKDEV(SCSI_CHANGER_MAJOR, ch->minor), ch,
|
||||
"s%s", ch->name);
|
||||
if (IS_ERR(class_dev)) {
|
||||
printk(KERN_WARNING "ch%d: device_create failed\n",
|
||||
ch->minor);
|
||||
sdev_printk(KERN_WARNING, sd, "ch%d: device_create failed\n",
|
||||
ch->minor);
|
||||
ret = PTR_ERR(class_dev);
|
||||
goto remove_idr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1657,7 +1657,7 @@ csio_scsi_err_handler(struct csio_hw *hw, struct csio_ioreq *req)
|
|||
case FW_SCSI_UNDER_FLOW_ERR:
|
||||
csio_warn(hw,
|
||||
"Under-flow error,cmnd:0x%x expected"
|
||||
" len:0x%x resid:0x%x lun:0x%x ssn:0x%x\n",
|
||||
" len:0x%x resid:0x%x lun:0x%llx ssn:0x%x\n",
|
||||
cmnd->cmnd[0], scsi_bufflen(cmnd),
|
||||
scsi_get_resid(cmnd), cmnd->device->lun,
|
||||
rn->flowid);
|
||||
|
|
@ -1957,7 +1957,7 @@ csio_eh_abort_handler(struct scsi_cmnd *cmnd)
|
|||
|
||||
csio_dbg(hw,
|
||||
"Request to abort ioreq:%p cmd:%p cdb:%08llx"
|
||||
" ssni:0x%x lun:%d iq:0x%x\n",
|
||||
" ssni:0x%x lun:%llu iq:0x%x\n",
|
||||
ioreq, cmnd, *((uint64_t *)cmnd->cmnd), rn->flowid,
|
||||
cmnd->device->lun, csio_q_physiqid(hw, ioreq->iq_idx));
|
||||
|
||||
|
|
@ -2015,13 +2015,13 @@ inval_scmnd:
|
|||
/* FW successfully aborted the request */
|
||||
if (host_byte(cmnd->result) == DID_REQUEUE) {
|
||||
csio_info(hw,
|
||||
"Aborted SCSI command to (%d:%d) serial#:0x%lx\n",
|
||||
"Aborted SCSI command to (%d:%llu) serial#:0x%lx\n",
|
||||
cmnd->device->id, cmnd->device->lun,
|
||||
cmnd->serial_number);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
csio_info(hw,
|
||||
"Failed to abort SCSI command, (%d:%d) serial#:0x%lx\n",
|
||||
"Failed to abort SCSI command, (%d:%llu) serial#:0x%lx\n",
|
||||
cmnd->device->id, cmnd->device->lun,
|
||||
cmnd->serial_number);
|
||||
return FAILED;
|
||||
|
|
@ -2100,13 +2100,13 @@ csio_eh_lun_reset_handler(struct scsi_cmnd *cmnd)
|
|||
if (!rn)
|
||||
goto fail;
|
||||
|
||||
csio_dbg(hw, "Request to reset LUN:%d (ssni:0x%x tgtid:%d)\n",
|
||||
csio_dbg(hw, "Request to reset LUN:%llu (ssni:0x%x tgtid:%d)\n",
|
||||
cmnd->device->lun, rn->flowid, rn->scsi_id);
|
||||
|
||||
if (!csio_is_lnode_ready(ln)) {
|
||||
csio_err(hw,
|
||||
"LUN reset cannot be issued on non-ready"
|
||||
" local node vnpi:0x%x (LUN:%d)\n",
|
||||
" local node vnpi:0x%x (LUN:%llu)\n",
|
||||
ln->vnp_flowid, cmnd->device->lun);
|
||||
goto fail;
|
||||
}
|
||||
|
|
@ -2126,7 +2126,7 @@ csio_eh_lun_reset_handler(struct scsi_cmnd *cmnd)
|
|||
if (fc_remote_port_chkready(rn->rport)) {
|
||||
csio_err(hw,
|
||||
"LUN reset cannot be issued on non-ready"
|
||||
" remote node ssni:0x%x (LUN:%d)\n",
|
||||
" remote node ssni:0x%x (LUN:%llu)\n",
|
||||
rn->flowid, cmnd->device->lun);
|
||||
goto fail;
|
||||
}
|
||||
|
|
@ -2168,7 +2168,7 @@ csio_eh_lun_reset_handler(struct scsi_cmnd *cmnd)
|
|||
sld.level = CSIO_LEV_LUN;
|
||||
sld.lnode = ioreq->lnode;
|
||||
sld.rnode = ioreq->rnode;
|
||||
sld.oslun = (uint64_t)cmnd->device->lun;
|
||||
sld.oslun = cmnd->device->lun;
|
||||
|
||||
spin_lock_irqsave(&hw->lock, flags);
|
||||
/* Kick off TM SM on the ioreq */
|
||||
|
|
@ -2190,7 +2190,7 @@ csio_eh_lun_reset_handler(struct scsi_cmnd *cmnd)
|
|||
|
||||
/* LUN reset timed-out */
|
||||
if (((struct scsi_cmnd *)csio_scsi_cmnd(ioreq)) == cmnd) {
|
||||
csio_err(hw, "LUN reset (%d:%d) timed out\n",
|
||||
csio_err(hw, "LUN reset (%d:%llu) timed out\n",
|
||||
cmnd->device->id, cmnd->device->lun);
|
||||
|
||||
spin_lock_irq(&hw->lock);
|
||||
|
|
@ -2203,7 +2203,7 @@ csio_eh_lun_reset_handler(struct scsi_cmnd *cmnd)
|
|||
|
||||
/* LUN reset returned, check cached status */
|
||||
if (cmnd->SCp.Status != FW_SUCCESS) {
|
||||
csio_err(hw, "LUN reset failed (%d:%d), status: %d\n",
|
||||
csio_err(hw, "LUN reset failed (%d:%llu), status: %d\n",
|
||||
cmnd->device->id, cmnd->device->lun, cmnd->SCp.Status);
|
||||
goto fail;
|
||||
}
|
||||
|
|
@ -2223,7 +2223,7 @@ csio_eh_lun_reset_handler(struct scsi_cmnd *cmnd)
|
|||
/* Aborts may have timed out */
|
||||
if (retval != 0) {
|
||||
csio_err(hw,
|
||||
"Attempt to abort I/Os during LUN reset of %d"
|
||||
"Attempt to abort I/Os during LUN reset of %llu"
|
||||
" returned %d\n", cmnd->device->lun, retval);
|
||||
/* Return I/Os back to active_q */
|
||||
spin_lock_irq(&hw->lock);
|
||||
|
|
@ -2234,7 +2234,7 @@ csio_eh_lun_reset_handler(struct scsi_cmnd *cmnd)
|
|||
|
||||
CSIO_INC_STATS(rn, n_lun_rst);
|
||||
|
||||
csio_info(hw, "LUN reset occurred (%d:%d)\n",
|
||||
csio_info(hw, "LUN reset occurred (%d:%llu)\n",
|
||||
cmnd->device->id, cmnd->device->lun);
|
||||
|
||||
return SUCCESS;
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ void cxgbi_hbas_remove(struct cxgbi_device *cdev)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(cxgbi_hbas_remove);
|
||||
|
||||
int cxgbi_hbas_add(struct cxgbi_device *cdev, unsigned int max_lun,
|
||||
int cxgbi_hbas_add(struct cxgbi_device *cdev, u64 max_lun,
|
||||
unsigned int max_id, struct scsi_host_template *sht,
|
||||
struct scsi_transport_template *stt)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -709,7 +709,7 @@ void cxgbi_device_unregister(struct cxgbi_device *);
|
|||
void cxgbi_device_unregister_all(unsigned int flag);
|
||||
struct cxgbi_device *cxgbi_device_find_by_lldev(void *);
|
||||
struct cxgbi_device *cxgbi_device_find_by_netdev(struct net_device *, int *);
|
||||
int cxgbi_hbas_add(struct cxgbi_device *, unsigned int, unsigned int,
|
||||
int cxgbi_hbas_add(struct cxgbi_device *, u64, unsigned int,
|
||||
struct scsi_host_template *,
|
||||
struct scsi_transport_template *);
|
||||
void cxgbi_hbas_remove(struct cxgbi_device *);
|
||||
|
|
|
|||
|
|
@ -519,9 +519,7 @@ static struct ParameterData cfg_data[] = {
|
|||
CFG_PARAM_UNSET,
|
||||
0,
|
||||
0x2f,
|
||||
#ifdef CONFIG_SCSI_MULTI_LUN
|
||||
NAC_SCANLUN |
|
||||
#endif
|
||||
NAC_SCANLUN |
|
||||
NAC_GT2DRIVES | NAC_GREATER_1G | NAC_POWERON_SCSI_RESET
|
||||
/*| NAC_ACTIVE_NEG*/,
|
||||
NAC_GT2DRIVES | NAC_GREATER_1G | NAC_POWERON_SCSI_RESET | 0x08
|
||||
|
|
@ -1089,7 +1087,7 @@ static int dc395x_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct s
|
|||
struct AdapterCtlBlk *acb =
|
||||
(struct AdapterCtlBlk *)cmd->device->host->hostdata;
|
||||
dprintkdbg(DBG_0, "queue_command: (0x%p) <%02i-%i> cmnd=0x%02x\n",
|
||||
cmd, cmd->device->id, cmd->device->lun, cmd->cmnd[0]);
|
||||
cmd, cmd->device->id, (u8)cmd->device->lun, cmd->cmnd[0]);
|
||||
|
||||
/* Assume BAD_TARGET; will be cleared later */
|
||||
cmd->result = DID_BAD_TARGET << 16;
|
||||
|
|
@ -1104,7 +1102,7 @@ static int dc395x_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct s
|
|||
/* does the specified lun on the specified device exist */
|
||||
if (!(acb->dcb_map[cmd->device->id] & (1 << cmd->device->lun))) {
|
||||
dprintkl(KERN_INFO, "queue_command: Ignore target <%02i-%i>\n",
|
||||
cmd->device->id, cmd->device->lun);
|
||||
cmd->device->id, (u8)cmd->device->lun);
|
||||
goto complete;
|
||||
}
|
||||
|
||||
|
|
@ -1113,7 +1111,7 @@ static int dc395x_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct s
|
|||
if (!dcb) {
|
||||
/* should never happen */
|
||||
dprintkl(KERN_ERR, "queue_command: No such device <%02i-%i>",
|
||||
cmd->device->id, cmd->device->lun);
|
||||
cmd->device->id, (u8)cmd->device->lun);
|
||||
goto complete;
|
||||
}
|
||||
|
||||
|
|
@ -1209,7 +1207,7 @@ static void dump_register_info(struct AdapterCtlBlk *acb,
|
|||
"cmnd=0x%02x <%02i-%i>\n",
|
||||
srb, srb->cmd,
|
||||
srb->cmd->cmnd[0], srb->cmd->device->id,
|
||||
srb->cmd->device->lun);
|
||||
(u8)srb->cmd->device->lun);
|
||||
printk(" sglist=%p cnt=%i idx=%i len=%zu\n",
|
||||
srb->segment_x, srb->sg_count, srb->sg_index,
|
||||
srb->total_xfer_length);
|
||||
|
|
@ -1304,7 +1302,7 @@ static int __dc395x_eh_bus_reset(struct scsi_cmnd *cmd)
|
|||
(struct AdapterCtlBlk *)cmd->device->host->hostdata;
|
||||
dprintkl(KERN_INFO,
|
||||
"eh_bus_reset: (0%p) target=<%02i-%i> cmd=%p\n",
|
||||
cmd, cmd->device->id, cmd->device->lun, cmd);
|
||||
cmd, cmd->device->id, (u8)cmd->device->lun, cmd);
|
||||
|
||||
if (timer_pending(&acb->waiting_timer))
|
||||
del_timer(&acb->waiting_timer);
|
||||
|
|
@ -1371,7 +1369,7 @@ static int dc395x_eh_abort(struct scsi_cmnd *cmd)
|
|||
struct DeviceCtlBlk *dcb;
|
||||
struct ScsiReqBlk *srb;
|
||||
dprintkl(KERN_INFO, "eh_abort: (0x%p) target=<%02i-%i> cmd=%p\n",
|
||||
cmd, cmd->device->id, cmd->device->lun, cmd);
|
||||
cmd, cmd->device->id, (u8)cmd->device->lun, cmd);
|
||||
|
||||
dcb = find_dcb(acb, cmd->device->id, cmd->device->lun);
|
||||
if (!dcb) {
|
||||
|
|
@ -1607,7 +1605,7 @@ static u8 start_scsi(struct AdapterCtlBlk* acb, struct DeviceCtlBlk* dcb,
|
|||
dprintkl(KERN_WARNING, "start_scsi: (0x%p) "
|
||||
"Out of tags target=<%02i-%i>)\n",
|
||||
srb->cmd, srb->cmd->device->id,
|
||||
srb->cmd->device->lun);
|
||||
(u8)srb->cmd->device->lun);
|
||||
srb->state = SRB_READY;
|
||||
DC395x_write16(acb, TRM_S1040_SCSI_CONTROL,
|
||||
DO_HWRESELECT);
|
||||
|
|
@ -1625,7 +1623,7 @@ static u8 start_scsi(struct AdapterCtlBlk* acb, struct DeviceCtlBlk* dcb,
|
|||
/*polling:*/
|
||||
/* Send CDB ..command block ......... */
|
||||
dprintkdbg(DBG_KG, "start_scsi: (0x%p) <%02i-%i> cmnd=0x%02x tag=%i\n",
|
||||
srb->cmd, srb->cmd->device->id, srb->cmd->device->lun,
|
||||
srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun,
|
||||
srb->cmd->cmnd[0], srb->tag_number);
|
||||
if (srb->flag & AUTO_REQSENSE) {
|
||||
DC395x_write8(acb, TRM_S1040_SCSI_FIFO, REQUEST_SENSE);
|
||||
|
|
@ -2043,7 +2041,7 @@ static void data_out_phase0(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb,
|
|||
u16 scsi_status = *pscsi_status;
|
||||
u32 d_left_counter = 0;
|
||||
dprintkdbg(DBG_0, "data_out_phase0: (0x%p) <%02i-%i>\n",
|
||||
srb->cmd, srb->cmd->device->id, srb->cmd->device->lun);
|
||||
srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun);
|
||||
|
||||
/*
|
||||
* KG: We need to drain the buffers before we draw any conclusions!
|
||||
|
|
@ -2173,7 +2171,7 @@ static void data_out_phase1(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb,
|
|||
u16 *pscsi_status)
|
||||
{
|
||||
dprintkdbg(DBG_0, "data_out_phase1: (0x%p) <%02i-%i>\n",
|
||||
srb->cmd, srb->cmd->device->id, srb->cmd->device->lun);
|
||||
srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun);
|
||||
clear_fifo(acb, "data_out_phase1");
|
||||
/* do prepare before transfer when data out phase */
|
||||
data_io_transfer(acb, srb, XFERDATAOUT);
|
||||
|
|
@ -2185,7 +2183,7 @@ static void data_in_phase0(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb,
|
|||
u16 scsi_status = *pscsi_status;
|
||||
|
||||
dprintkdbg(DBG_0, "data_in_phase0: (0x%p) <%02i-%i>\n",
|
||||
srb->cmd, srb->cmd->device->id, srb->cmd->device->lun);
|
||||
srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun);
|
||||
|
||||
/*
|
||||
* KG: DataIn is much more tricky than DataOut. When the device is finished
|
||||
|
|
@ -2396,7 +2394,7 @@ static void data_in_phase1(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb,
|
|||
u16 *pscsi_status)
|
||||
{
|
||||
dprintkdbg(DBG_0, "data_in_phase1: (0x%p) <%02i-%i>\n",
|
||||
srb->cmd, srb->cmd->device->id, srb->cmd->device->lun);
|
||||
srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun);
|
||||
data_io_transfer(acb, srb, XFERDATAIN);
|
||||
}
|
||||
|
||||
|
|
@ -2408,7 +2406,7 @@ static void data_io_transfer(struct AdapterCtlBlk *acb,
|
|||
u8 bval;
|
||||
dprintkdbg(DBG_0,
|
||||
"data_io_transfer: (0x%p) <%02i-%i> %c len=%i, sg=(%i/%i)\n",
|
||||
srb->cmd, srb->cmd->device->id, srb->cmd->device->lun,
|
||||
srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun,
|
||||
((io_dir & DMACMD_DIR) ? 'r' : 'w'),
|
||||
srb->total_xfer_length, srb->sg_index, srb->sg_count);
|
||||
if (srb == acb->tmp_srb)
|
||||
|
|
@ -2581,7 +2579,7 @@ static void status_phase0(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb,
|
|||
u16 *pscsi_status)
|
||||
{
|
||||
dprintkdbg(DBG_0, "status_phase0: (0x%p) <%02i-%i>\n",
|
||||
srb->cmd, srb->cmd->device->id, srb->cmd->device->lun);
|
||||
srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun);
|
||||
srb->target_status = DC395x_read8(acb, TRM_S1040_SCSI_FIFO);
|
||||
srb->end_message = DC395x_read8(acb, TRM_S1040_SCSI_FIFO); /* get message */
|
||||
srb->state = SRB_COMPLETED;
|
||||
|
|
@ -2595,7 +2593,7 @@ static void status_phase1(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb,
|
|||
u16 *pscsi_status)
|
||||
{
|
||||
dprintkdbg(DBG_0, "status_phase1: (0x%p) <%02i-%i>\n",
|
||||
srb->cmd, srb->cmd->device->id, srb->cmd->device->lun);
|
||||
srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun);
|
||||
srb->state = SRB_STATUS;
|
||||
DC395x_write16(acb, TRM_S1040_SCSI_CONTROL, DO_DATALATCH); /* it's important for atn stop */
|
||||
DC395x_write8(acb, TRM_S1040_SCSI_COMMAND, SCMD_COMP);
|
||||
|
|
@ -3320,7 +3318,7 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
|
|||
int ckc_only = 1;
|
||||
|
||||
dprintkdbg(DBG_1, "srb_done: (0x%p) <%02i-%i>\n", srb->cmd,
|
||||
srb->cmd->device->id, srb->cmd->device->lun);
|
||||
srb->cmd->device->id, (u8)srb->cmd->device->lun);
|
||||
dprintkdbg(DBG_SG, "srb_done: srb=%p sg=%i(%i/%i) buf=%p\n",
|
||||
srb, scsi_sg_count(cmd), srb->sg_index, srb->sg_count,
|
||||
scsi_sgtalbe(cmd));
|
||||
|
|
@ -3500,7 +3498,7 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
|
|||
if (srb->total_xfer_length)
|
||||
dprintkdbg(DBG_KG, "srb_done: (0x%p) <%02i-%i> "
|
||||
"cmnd=0x%02x Missed %i bytes\n",
|
||||
cmd, cmd->device->id, cmd->device->lun,
|
||||
cmd, cmd->device->id, (u8)cmd->device->lun,
|
||||
cmd->cmnd[0], srb->total_xfer_length);
|
||||
}
|
||||
|
||||
|
|
@ -3540,7 +3538,7 @@ static void doing_srb_done(struct AdapterCtlBlk *acb, u8 did_flag,
|
|||
dir = p->sc_data_direction;
|
||||
result = MK_RES(0, did_flag, 0, 0);
|
||||
printk("G:%p(%02i-%i) ", p,
|
||||
p->device->id, p->device->lun);
|
||||
p->device->id, (u8)p->device->lun);
|
||||
srb_going_remove(dcb, srb);
|
||||
free_tag(dcb, srb);
|
||||
srb_free_insert(acb, srb);
|
||||
|
|
@ -3570,7 +3568,7 @@ static void doing_srb_done(struct AdapterCtlBlk *acb, u8 did_flag,
|
|||
|
||||
result = MK_RES(0, did_flag, 0, 0);
|
||||
printk("W:%p<%02i-%i>", p, p->device->id,
|
||||
p->device->lun);
|
||||
(u8)p->device->lun);
|
||||
srb_waiting_remove(dcb, srb);
|
||||
srb_free_insert(acb, srb);
|
||||
p->result = result;
|
||||
|
|
@ -3679,7 +3677,7 @@ static void request_sense(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
|
|||
{
|
||||
struct scsi_cmnd *cmd = srb->cmd;
|
||||
dprintkdbg(DBG_1, "request_sense: (0x%p) <%02i-%i>\n",
|
||||
cmd, cmd->device->id, cmd->device->lun);
|
||||
cmd, cmd->device->id, (u8)cmd->device->lun);
|
||||
|
||||
srb->flag |= AUTO_REQSENSE;
|
||||
srb->adapter_status = 0;
|
||||
|
|
@ -4434,15 +4432,10 @@ static void adapter_init_scsi_host(struct Scsi_Host *host)
|
|||
if (host->max_id - 1 == eeprom->scsi_id)
|
||||
host->max_id--;
|
||||
|
||||
#ifdef CONFIG_SCSI_MULTI_LUN
|
||||
if (eeprom->channel_cfg & NAC_SCANLUN)
|
||||
host->max_lun = 8;
|
||||
else
|
||||
host->max_lun = 1;
|
||||
#else
|
||||
host->max_lun = 1;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -4645,7 +4638,7 @@ static int dc395x_show_info(struct seq_file *m, struct Scsi_Host *host)
|
|||
SPRINTF("irq_level 0x%04x, ", acb->irq_level);
|
||||
SPRINTF(" SelTimeout %ims\n", (1638 * acb->sel_timeout) / 1000);
|
||||
|
||||
SPRINTF("MaxID %i, MaxLUN %i, ", host->max_id, host->max_lun);
|
||||
SPRINTF("MaxID %i, MaxLUN %llu, ", host->max_id, host->max_lun);
|
||||
SPRINTF("AdapterID %i\n", host->this_id);
|
||||
|
||||
SPRINTF("tag_max_num %i", acb->tag_max_num);
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd
|
|||
* to the device structure. This should be a TEST_UNIT_READY
|
||||
* command from scan_scsis_single.
|
||||
*/
|
||||
if ((pDev = adpt_find_device(pHba, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun)) == NULL) {
|
||||
if ((pDev = adpt_find_device(pHba, (u32)cmd->device->channel, (u32)cmd->device->id, cmd->device->lun)) == NULL) {
|
||||
// TODO: if any luns are at this bus, scsi id then fake a TEST_UNIT_READY and INQUIRY response
|
||||
// with type 7F (for all luns less than the max for this bus,id) so the lun scan will continue.
|
||||
cmd->result = (DID_NO_CONNECT << 16);
|
||||
|
|
@ -579,8 +579,8 @@ static int adpt_show_info(struct seq_file *m, struct Scsi_Host *host)
|
|||
seq_printf(m," Rev: %-8.8s\n", d->pScsi_dev->rev);
|
||||
|
||||
unit = d->pI2o_dev->lct_data.tid;
|
||||
seq_printf(m, "\tTID=%d, (Channel=%d, Target=%d, Lun=%d) (%s)\n\n",
|
||||
unit, (int)d->scsi_channel, (int)d->scsi_id, (int)d->scsi_lun,
|
||||
seq_printf(m, "\tTID=%d, (Channel=%d, Target=%d, Lun=%llu) (%s)\n\n",
|
||||
unit, (int)d->scsi_channel, (int)d->scsi_id, d->scsi_lun,
|
||||
scsi_device_online(d->pScsi_dev)? "online":"offline");
|
||||
d = d->next_lun;
|
||||
}
|
||||
|
|
@ -1162,7 +1162,7 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba)
|
|||
}
|
||||
}
|
||||
|
||||
static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun)
|
||||
static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u64 lun)
|
||||
{
|
||||
struct adpt_device* d;
|
||||
|
||||
|
|
@ -1462,7 +1462,7 @@ static int adpt_i2o_parse_lct(adpt_hba* pHba)
|
|||
i2o_lct *lct = pHba->lct;
|
||||
u8 bus_no = 0;
|
||||
s16 scsi_id;
|
||||
s16 scsi_lun;
|
||||
u64 scsi_lun;
|
||||
u32 buf[10]; // larger than 7, or 8 ...
|
||||
struct adpt_device* pDev;
|
||||
|
||||
|
|
@ -1496,7 +1496,7 @@ static int adpt_i2o_parse_lct(adpt_hba* pHba)
|
|||
}
|
||||
bus_no = buf[0]>>16;
|
||||
scsi_id = buf[1];
|
||||
scsi_lun = (buf[2]>>8 )&0xff;
|
||||
scsi_lun = scsilun_to_int((struct scsi_lun *)&buf[2]);
|
||||
if(bus_no >= MAX_CHANNEL) { // Something wrong skip it
|
||||
printk(KERN_WARNING"%s: Channel number %d out of range \n", pHba->name, bus_no);
|
||||
continue;
|
||||
|
|
@ -1571,7 +1571,7 @@ static int adpt_i2o_parse_lct(adpt_hba* pHba)
|
|||
if(adpt_i2o_query_scalar(pHba, tid, 0x8000, -1, buf, 32)>=0) {
|
||||
bus_no = buf[0]>>16;
|
||||
scsi_id = buf[1];
|
||||
scsi_lun = (buf[2]>>8 )&0xff;
|
||||
scsi_lun = scsilun_to_int((struct scsi_lun *)&buf[2]);
|
||||
if(bus_no >= MAX_CHANNEL) { // Something wrong skip it
|
||||
continue;
|
||||
}
|
||||
|
|
@ -2407,8 +2407,8 @@ static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd)
|
|||
case I2O_SCSI_DSC_COMMAND_TIMEOUT:
|
||||
case I2O_SCSI_DSC_NO_ADAPTER:
|
||||
case I2O_SCSI_DSC_RESOURCE_UNAVAILABLE:
|
||||
printk(KERN_WARNING"%s: SCSI Timeout-Device (%d,%d,%d) hba status=0x%x, dev status=0x%x, cmd=0x%x\n",
|
||||
pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun, hba_status, dev_status, cmd->cmnd[0]);
|
||||
printk(KERN_WARNING"%s: SCSI Timeout-Device (%d,%d,%llu) hba status=0x%x, dev status=0x%x, cmd=0x%x\n",
|
||||
pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, cmd->device->lun, hba_status, dev_status, cmd->cmnd[0]);
|
||||
cmd->result = (DID_TIME_OUT << 16);
|
||||
break;
|
||||
case I2O_SCSI_DSC_ADAPTER_BUSY:
|
||||
|
|
@ -2447,8 +2447,8 @@ static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd)
|
|||
case I2O_SCSI_DSC_QUEUE_FROZEN:
|
||||
case I2O_SCSI_DSC_REQUEST_INVALID:
|
||||
default:
|
||||
printk(KERN_WARNING"%s: SCSI error %0x-Device(%d,%d,%d) hba_status=0x%x, dev_status=0x%x, cmd=0x%x\n",
|
||||
pHba->name, detailed_status & I2O_SCSI_DSC_MASK, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun,
|
||||
printk(KERN_WARNING"%s: SCSI error %0x-Device(%d,%d,%llu) hba_status=0x%x, dev_status=0x%x, cmd=0x%x\n",
|
||||
pHba->name, detailed_status & I2O_SCSI_DSC_MASK, (u32)cmd->device->channel, (u32)cmd->device->id, cmd->device->lun,
|
||||
hba_status, dev_status, cmd->cmnd[0]);
|
||||
cmd->result = (DID_ERROR << 16);
|
||||
break;
|
||||
|
|
@ -2464,8 +2464,8 @@ static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd)
|
|||
cmd->sense_buffer[2] == DATA_PROTECT ){
|
||||
/* This is to handle an array failed */
|
||||
cmd->result = (DID_TIME_OUT << 16);
|
||||
printk(KERN_WARNING"%s: SCSI Data Protect-Device (%d,%d,%d) hba_status=0x%x, dev_status=0x%x, cmd=0x%x\n",
|
||||
pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun,
|
||||
printk(KERN_WARNING"%s: SCSI Data Protect-Device (%d,%d,%llu) hba_status=0x%x, dev_status=0x%x, cmd=0x%x\n",
|
||||
pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, cmd->device->lun,
|
||||
hba_status, dev_status, cmd->cmnd[0]);
|
||||
|
||||
}
|
||||
|
|
@ -2476,8 +2476,8 @@ static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd)
|
|||
* for a limitted number of retries.
|
||||
*/
|
||||
cmd->result = (DID_TIME_OUT << 16);
|
||||
printk(KERN_WARNING"%s: I2O MSG_FAIL - Device (%d,%d,%d) tid=%d, cmd=0x%x\n",
|
||||
pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun,
|
||||
printk(KERN_WARNING"%s: I2O MSG_FAIL - Device (%d,%d,%llu) tid=%d, cmd=0x%x\n",
|
||||
pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, cmd->device->lun,
|
||||
((struct adpt_device*)(cmd->device->hostdata))->tid, cmd->cmnd[0]);
|
||||
}
|
||||
|
||||
|
|
@ -2517,7 +2517,7 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba)
|
|||
i2o_lct *lct = pHba->lct;
|
||||
u8 bus_no = 0;
|
||||
s16 scsi_id;
|
||||
s16 scsi_lun;
|
||||
u64 scsi_lun;
|
||||
u32 buf[10]; // at least 8 u32's
|
||||
struct adpt_device* pDev = NULL;
|
||||
struct i2o_device* pI2o_dev = NULL;
|
||||
|
|
@ -2564,7 +2564,7 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba)
|
|||
}
|
||||
|
||||
scsi_id = buf[1];
|
||||
scsi_lun = (buf[2]>>8 )&0xff;
|
||||
scsi_lun = scsilun_to_int((struct scsi_lun *)&buf[2]);
|
||||
pDev = pHba->channel[bus_no].device[scsi_id];
|
||||
/* da lun */
|
||||
while(pDev) {
|
||||
|
|
@ -2633,7 +2633,7 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba)
|
|||
while(pDev) {
|
||||
if(pDev->scsi_lun == scsi_lun) {
|
||||
if(!scsi_device_online(pDev->pScsi_dev)) {
|
||||
printk(KERN_WARNING"%s: Setting device (%d,%d,%d) back online\n",
|
||||
printk(KERN_WARNING"%s: Setting device (%d,%d,%llu) back online\n",
|
||||
pHba->name,bus_no,scsi_id,scsi_lun);
|
||||
if (pDev->pScsi_dev) {
|
||||
scsi_device_set_state(pDev->pScsi_dev, SDEV_RUNNING);
|
||||
|
|
@ -2665,7 +2665,7 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba)
|
|||
// in the LCT table
|
||||
if (pDev->state & DPTI_DEV_UNSCANNED){
|
||||
pDev->state = DPTI_DEV_OFFLINE;
|
||||
printk(KERN_WARNING"%s: Device (%d,%d,%d) offline\n",pHba->name,pDev->scsi_channel,pDev->scsi_id,pDev->scsi_lun);
|
||||
printk(KERN_WARNING"%s: Device (%d,%d,%llu) offline\n",pHba->name,pDev->scsi_channel,pDev->scsi_id,pDev->scsi_lun);
|
||||
if (pDev->pScsi_dev) {
|
||||
scsi_device_set_state(pDev->pScsi_dev, SDEV_OFFLINE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ struct adpt_device {
|
|||
u32 block_size;
|
||||
u8 scsi_channel;
|
||||
u8 scsi_id;
|
||||
u8 scsi_lun;
|
||||
u64 scsi_lun;
|
||||
u8 state;
|
||||
u16 tid;
|
||||
struct i2o_device* pI2o_dev;
|
||||
|
|
@ -231,7 +231,7 @@ typedef struct _adpt_hba {
|
|||
u32 sg_tablesize; // Scatter/Gather List Size.
|
||||
u8 top_scsi_channel;
|
||||
u8 top_scsi_id;
|
||||
u8 top_scsi_lun;
|
||||
u64 top_scsi_lun;
|
||||
u8 dma64;
|
||||
|
||||
i2o_status_block* status_block;
|
||||
|
|
@ -300,7 +300,7 @@ static s32 adpt_send_nop(adpt_hba*pHba,u32 m);
|
|||
static void adpt_i2o_delete_hba(adpt_hba* pHba);
|
||||
static void adpt_inquiry(adpt_hba* pHba);
|
||||
static void adpt_fail_posted_scbs(adpt_hba* pHba);
|
||||
static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun);
|
||||
static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u64 lun);
|
||||
static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev) ;
|
||||
static int adpt_i2o_online_hba(adpt_hba* pHba);
|
||||
static void adpt_i2o_post_wait_complete(u32, int);
|
||||
|
|
|
|||
|
|
@ -1399,7 +1399,7 @@ static int port_detect(unsigned long port_base, unsigned int j,
|
|||
|
||||
if (shost->max_id > 8 || shost->max_lun > 8)
|
||||
printk
|
||||
("%s: wide SCSI support enabled, max_id %u, max_lun %u.\n",
|
||||
("%s: wide SCSI support enabled, max_id %u, max_lun %llu.\n",
|
||||
ha->board_name, shost->max_id, shost->max_lun);
|
||||
|
||||
for (i = 0; i <= shost->max_channel; i++)
|
||||
|
|
@ -2449,7 +2449,7 @@ static irqreturn_t ihdlr(struct Scsi_Host *shost)
|
|||
"target_status 0x%x, sense key 0x%x.\n",
|
||||
ha->board_name,
|
||||
SCpnt->device->channel, SCpnt->device->id,
|
||||
SCpnt->device->lun,
|
||||
(u8)SCpnt->device->lun,
|
||||
spp->target_status, SCpnt->sense_buffer[2]);
|
||||
|
||||
ha->target_to[SCpnt->device->id][SCpnt->device->channel] = 0;
|
||||
|
|
|
|||
|
|
@ -257,8 +257,8 @@ int fnic_set_intr_mode(struct fnic *fnic)
|
|||
fnic->raw_wq_count >= m &&
|
||||
fnic->wq_copy_count >= o &&
|
||||
fnic->cq_count >= n + m + o) {
|
||||
if (!pci_enable_msix(fnic->pdev, fnic->msix_entry,
|
||||
n + m + o + 1)) {
|
||||
if (!pci_enable_msix_exact(fnic->pdev, fnic->msix_entry,
|
||||
n + m + o + 1)) {
|
||||
fnic->rq_count = n;
|
||||
fnic->raw_wq_count = m;
|
||||
fnic->wq_copy_count = o;
|
||||
|
|
|
|||
|
|
@ -1753,7 +1753,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
|
|||
tag = sc->request->tag;
|
||||
FNIC_SCSI_DBG(KERN_DEBUG,
|
||||
fnic->lport->host,
|
||||
"Abort Cmd called FCID 0x%x, LUN 0x%x TAG %x flags %x\n",
|
||||
"Abort Cmd called FCID 0x%x, LUN 0x%llx TAG %x flags %x\n",
|
||||
rport->port_id, sc->device->lun, tag, CMD_FLAGS(sc));
|
||||
|
||||
CMD_FLAGS(sc) = FNIC_NO_FLAGS;
|
||||
|
|
@ -2207,7 +2207,7 @@ int fnic_device_reset(struct scsi_cmnd *sc)
|
|||
|
||||
rport = starget_to_rport(scsi_target(sc->device));
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
|
||||
"Device reset called FCID 0x%x, LUN 0x%x sc 0x%p\n",
|
||||
"Device reset called FCID 0x%x, LUN 0x%llx sc 0x%p\n",
|
||||
rport->port_id, sc->device->lun, sc);
|
||||
|
||||
if (lp->state != LPORT_ST_READY || !(lp->link_up))
|
||||
|
|
@ -2224,6 +2224,22 @@ int fnic_device_reset(struct scsi_cmnd *sc)
|
|||
|
||||
tag = sc->request->tag;
|
||||
if (unlikely(tag < 0)) {
|
||||
/*
|
||||
* XXX(hch): current the midlayer fakes up a struct
|
||||
* request for the explicit reset ioctls, and those
|
||||
* don't have a tag allocated to them. The below
|
||||
* code pokes into midlayer structures to paper over
|
||||
* this design issue, but that won't work for blk-mq.
|
||||
*
|
||||
* Either someone who can actually test the hardware
|
||||
* will have to come up with a similar hack for the
|
||||
* blk-mq case, or we'll have to bite the bullet and
|
||||
* fix the way the EH ioctls work for real, but until
|
||||
* that happens we fail these explicit requests here.
|
||||
*/
|
||||
if (shost_use_blk_mq(sc->device->host))
|
||||
goto fnic_device_reset_end;
|
||||
|
||||
tag = fnic_scsi_host_start_tag(fnic, sc);
|
||||
if (unlikely(tag == SCSI_NO_TAG))
|
||||
goto fnic_device_reset_end;
|
||||
|
|
|
|||
|
|
@ -768,7 +768,7 @@ static void sprint_command(struct seq_file *m, unsigned char *command)
|
|||
|
||||
static void sprint_Scsi_Cmnd(struct seq_file *m, Scsi_Cmnd * cmd)
|
||||
{
|
||||
PRINTP("host number %d destination target %d, lun %d\n" ANDP cmd->device->host->host_no ANDP cmd->device->id ANDP cmd->device->lun);
|
||||
PRINTP("host number %d destination target %d, lun %llu\n" ANDP cmd->device->host->host_no ANDP cmd->device->id ANDP cmd->device->lun);
|
||||
PRINTP(" command = ");
|
||||
sprint_command(m, cmd->cmnd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -204,18 +204,33 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
|
|||
struct scsi_host_template *sht = shost->hostt;
|
||||
int error = -EINVAL;
|
||||
|
||||
printk(KERN_INFO "scsi%d : %s\n", shost->host_no,
|
||||
shost_printk(KERN_INFO, shost, "%s\n",
|
||||
sht->info ? sht->info(shost) : sht->name);
|
||||
|
||||
if (!shost->can_queue) {
|
||||
printk(KERN_ERR "%s: can_queue = 0 no longer supported\n",
|
||||
sht->name);
|
||||
shost_printk(KERN_ERR, shost,
|
||||
"can_queue = 0 no longer supported\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (shost_use_blk_mq(shost)) {
|
||||
error = scsi_mq_setup_tags(shost);
|
||||
if (error)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note that we allocate the freelist even for the MQ case for now,
|
||||
* as we need a command set aside for scsi_reset_provider. Having
|
||||
* the full host freelist and one command available for that is a
|
||||
* little heavy-handed, but avoids introducing a special allocator
|
||||
* just for this. Eventually the structure of scsi_reset_provider
|
||||
* will need a major overhaul.
|
||||
*/
|
||||
error = scsi_setup_command_freelist(shost);
|
||||
if (error)
|
||||
goto fail;
|
||||
goto out_destroy_tags;
|
||||
|
||||
|
||||
if (!shost->shost_gendev.parent)
|
||||
shost->shost_gendev.parent = dev ? dev : &platform_bus;
|
||||
|
|
@ -226,7 +241,7 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
|
|||
|
||||
error = device_add(&shost->shost_gendev);
|
||||
if (error)
|
||||
goto out;
|
||||
goto out_destroy_freelist;
|
||||
|
||||
pm_runtime_set_active(&shost->shost_gendev);
|
||||
pm_runtime_enable(&shost->shost_gendev);
|
||||
|
|
@ -279,8 +294,11 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
|
|||
device_del(&shost->shost_dev);
|
||||
out_del_gendev:
|
||||
device_del(&shost->shost_gendev);
|
||||
out:
|
||||
out_destroy_freelist:
|
||||
scsi_destroy_command_freelist(shost);
|
||||
out_destroy_tags:
|
||||
if (shost_use_blk_mq(shost))
|
||||
scsi_mq_destroy_tags(shost);
|
||||
fail:
|
||||
return error;
|
||||
}
|
||||
|
|
@ -309,8 +327,13 @@ static void scsi_host_dev_release(struct device *dev)
|
|||
}
|
||||
|
||||
scsi_destroy_command_freelist(shost);
|
||||
if (shost->bqt)
|
||||
blk_free_tags(shost->bqt);
|
||||
if (shost_use_blk_mq(shost)) {
|
||||
if (shost->tag_set.tags)
|
||||
scsi_mq_destroy_tags(shost);
|
||||
} else {
|
||||
if (shost->bqt)
|
||||
blk_free_tags(shost->bqt);
|
||||
}
|
||||
|
||||
kfree(shost->shost_data);
|
||||
|
||||
|
|
@ -436,6 +459,8 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
|
|||
else
|
||||
shost->dma_boundary = 0xffffffff;
|
||||
|
||||
shost->use_blk_mq = scsi_use_blk_mq && !shost->hostt->disable_blk_mq;
|
||||
|
||||
device_initialize(&shost->shost_gendev);
|
||||
dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
|
||||
shost->shost_gendev.bus = &scsi_bus_type;
|
||||
|
|
@ -450,8 +475,9 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
|
|||
shost->ehandler = kthread_run(scsi_error_handler, shost,
|
||||
"scsi_eh_%d", shost->host_no);
|
||||
if (IS_ERR(shost->ehandler)) {
|
||||
printk(KERN_WARNING "scsi%d: error handler thread failed to spawn, error = %ld\n",
|
||||
shost->host_no, PTR_ERR(shost->ehandler));
|
||||
shost_printk(KERN_WARNING, shost,
|
||||
"error handler thread failed to spawn, error = %ld\n",
|
||||
PTR_ERR(shost->ehandler));
|
||||
goto fail_kfree;
|
||||
}
|
||||
|
||||
|
|
@ -584,7 +610,7 @@ EXPORT_SYMBOL(scsi_is_host_device);
|
|||
int scsi_queue_work(struct Scsi_Host *shost, struct work_struct *work)
|
||||
{
|
||||
if (unlikely(!shost->work_q)) {
|
||||
printk(KERN_ERR
|
||||
shost_printk(KERN_ERR, shost,
|
||||
"ERROR: Scsi host '%s' attempted to queue scsi-work, "
|
||||
"when no workqueue created.\n", shost->hostt->name);
|
||||
dump_stack();
|
||||
|
|
@ -603,7 +629,7 @@ EXPORT_SYMBOL_GPL(scsi_queue_work);
|
|||
void scsi_flush_work(struct Scsi_Host *shost)
|
||||
{
|
||||
if (!shost->work_q) {
|
||||
printk(KERN_ERR
|
||||
shost_printk(KERN_ERR, shost,
|
||||
"ERROR: Scsi host '%s' attempted to flush scsi-work, "
|
||||
"when no workqueue created.\n", shost->hostt->name);
|
||||
dump_stack();
|
||||
|
|
|
|||
|
|
@ -1708,7 +1708,14 @@ static void complete_scsi_command(struct CommandList *cp)
|
|||
|
||||
cmd->result |= ei->ScsiStatus;
|
||||
|
||||
/* copy the sense data whether we need to or not. */
|
||||
scsi_set_resid(cmd, ei->ResidualCnt);
|
||||
if (ei->CommandStatus == 0) {
|
||||
cmd_free(h, cp);
|
||||
cmd->scsi_done(cmd);
|
||||
return;
|
||||
}
|
||||
|
||||
/* copy the sense data */
|
||||
if (SCSI_SENSE_BUFFERSIZE < sizeof(ei->SenseInfo))
|
||||
sense_data_size = SCSI_SENSE_BUFFERSIZE;
|
||||
else
|
||||
|
|
@ -1717,13 +1724,6 @@ static void complete_scsi_command(struct CommandList *cp)
|
|||
sense_data_size = ei->SenseLen;
|
||||
|
||||
memcpy(cmd->sense_buffer, ei->SenseInfo, sense_data_size);
|
||||
scsi_set_resid(cmd, ei->ResidualCnt);
|
||||
|
||||
if (ei->CommandStatus == 0) {
|
||||
cmd_free(h, cp);
|
||||
cmd->scsi_done(cmd);
|
||||
return;
|
||||
}
|
||||
|
||||
/* For I/O accelerator commands, copy over some fields to the normal
|
||||
* CISS header used below for error handling.
|
||||
|
|
@ -3686,6 +3686,8 @@ static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h,
|
|||
(((u64) cmd->cmnd[2]) << 8) |
|
||||
cmd->cmnd[3];
|
||||
block_cnt = cmd->cmnd[4];
|
||||
if (block_cnt == 0)
|
||||
block_cnt = 256;
|
||||
break;
|
||||
case WRITE_10:
|
||||
is_write = 1;
|
||||
|
|
@ -3734,7 +3736,6 @@ static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h,
|
|||
default:
|
||||
return IO_ACCEL_INELIGIBLE; /* process via normal I/O path */
|
||||
}
|
||||
BUG_ON(block_cnt == 0);
|
||||
last_block = first_block + block_cnt - 1;
|
||||
|
||||
/* check for write to non-RAID-0 */
|
||||
|
|
@ -4590,7 +4591,7 @@ static int hpsa_eh_abort_handler(struct scsi_cmnd *sc)
|
|||
return FAILED;
|
||||
|
||||
memset(msg, 0, sizeof(msg));
|
||||
ml += sprintf(msg+ml, "ABORT REQUEST on C%d:B%d:T%d:L%d ",
|
||||
ml += sprintf(msg+ml, "ABORT REQUEST on C%d:B%d:T%d:L%llu ",
|
||||
h->scsi_host->host_no, sc->device->channel,
|
||||
sc->device->id, sc->device->lun);
|
||||
|
||||
|
|
@ -5092,7 +5093,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp)
|
|||
}
|
||||
if (ioc->Request.Type.Direction & XFER_WRITE) {
|
||||
if (copy_from_user(buff[sg_used], data_ptr, sz)) {
|
||||
status = -ENOMEM;
|
||||
status = -EFAULT;
|
||||
goto cleanup1;
|
||||
}
|
||||
} else
|
||||
|
|
@ -6365,9 +6366,9 @@ static inline void hpsa_set_driver_support_bits(struct ctlr_info *h)
|
|||
{
|
||||
u32 driver_support;
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
/* Need to enable prefetch in the SCSI core for 6400 in x86 */
|
||||
driver_support = readl(&(h->cfgtable->driver_support));
|
||||
/* Need to enable prefetch in the SCSI core for 6400 in x86 */
|
||||
#ifdef CONFIG_X86
|
||||
driver_support |= ENABLE_SCSI_PREFETCH;
|
||||
#endif
|
||||
driver_support |= ENABLE_UNIT_ATTN;
|
||||
|
|
@ -6913,8 +6914,12 @@ static int hpsa_offline_devices_ready(struct ctlr_info *h)
|
|||
d = list_entry(this, struct offline_device_entry,
|
||||
offline_list);
|
||||
spin_unlock_irqrestore(&h->offline_device_lock, flags);
|
||||
if (!hpsa_volume_offline(h, d->scsi3addr))
|
||||
if (!hpsa_volume_offline(h, d->scsi3addr)) {
|
||||
spin_lock_irqsave(&h->offline_device_lock, flags);
|
||||
list_del(&d->offline_list);
|
||||
spin_unlock_irqrestore(&h->offline_device_lock, flags);
|
||||
return 1;
|
||||
}
|
||||
spin_lock_irqsave(&h->offline_device_lock, flags);
|
||||
}
|
||||
spin_unlock_irqrestore(&h->offline_device_lock, flags);
|
||||
|
|
@ -6995,8 +7000,10 @@ reinit_after_soft_reset:
|
|||
|
||||
/* Allocate and clear per-cpu variable lockup_detected */
|
||||
h->lockup_detected = alloc_percpu(u32);
|
||||
if (!h->lockup_detected)
|
||||
if (!h->lockup_detected) {
|
||||
rc = -ENOMEM;
|
||||
goto clean1;
|
||||
}
|
||||
set_lockup_detected_for_all_cpus(h, 0);
|
||||
|
||||
rc = hpsa_pci_init(h);
|
||||
|
|
|
|||
|
|
@ -1024,7 +1024,7 @@ static int hptiop_queuecommand_lck(struct scsi_cmnd *scp,
|
|||
|
||||
_req->scp = scp;
|
||||
|
||||
dprintk("hptiop_queuecmd(scp=%p) %d/%d/%d/%d cdb=(%08x-%08x-%08x-%08x) "
|
||||
dprintk("hptiop_queuecmd(scp=%p) %d/%d/%d/%llu cdb=(%08x-%08x-%08x-%08x) "
|
||||
"req_index=%d, req=%p\n",
|
||||
scp,
|
||||
host->host_no, scp->device->channel,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsi.o
|
||||
obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvstgt.o
|
||||
obj-$(CONFIG_SCSI_IBMVFC) += ibmvfc.o
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
static unsigned int init_timeout = IBMVFC_INIT_TIMEOUT;
|
||||
static unsigned int default_timeout = IBMVFC_DEFAULT_TIMEOUT;
|
||||
static unsigned int max_lun = IBMVFC_MAX_LUN;
|
||||
static u64 max_lun = IBMVFC_MAX_LUN;
|
||||
static unsigned int max_targets = IBMVFC_MAX_TARGETS;
|
||||
static unsigned int max_requests = IBMVFC_MAX_REQUESTS_DEFAULT;
|
||||
static unsigned int disc_threads = IBMVFC_MAX_DISC_THREADS;
|
||||
|
|
@ -71,7 +71,7 @@ MODULE_PARM_DESC(default_timeout,
|
|||
module_param_named(max_requests, max_requests, uint, S_IRUGO);
|
||||
MODULE_PARM_DESC(max_requests, "Maximum requests for this adapter. "
|
||||
"[Default=" __stringify(IBMVFC_MAX_REQUESTS_DEFAULT) "]");
|
||||
module_param_named(max_lun, max_lun, uint, S_IRUGO);
|
||||
module_param_named(max_lun, max_lun, ullong, S_IRUGO);
|
||||
MODULE_PARM_DESC(max_lun, "Maximum allowed LUN. "
|
||||
"[Default=" __stringify(IBMVFC_MAX_LUN) "]");
|
||||
module_param_named(max_targets, max_targets, uint, S_IRUGO);
|
||||
|
|
@ -166,13 +166,13 @@ static void ibmvfc_trc_start(struct ibmvfc_event *evt)
|
|||
switch (entry->fmt) {
|
||||
case IBMVFC_CMD_FORMAT:
|
||||
entry->op_code = vfc_cmd->iu.cdb[0];
|
||||
entry->scsi_id = vfc_cmd->tgt_scsi_id;
|
||||
entry->scsi_id = be64_to_cpu(vfc_cmd->tgt_scsi_id);
|
||||
entry->lun = scsilun_to_int(&vfc_cmd->iu.lun);
|
||||
entry->tmf_flags = vfc_cmd->iu.tmf_flags;
|
||||
entry->u.start.xfer_len = vfc_cmd->iu.xfer_len;
|
||||
entry->u.start.xfer_len = be32_to_cpu(vfc_cmd->iu.xfer_len);
|
||||
break;
|
||||
case IBMVFC_MAD_FORMAT:
|
||||
entry->op_code = mad->opcode;
|
||||
entry->op_code = be32_to_cpu(mad->opcode);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -199,18 +199,18 @@ static void ibmvfc_trc_end(struct ibmvfc_event *evt)
|
|||
switch (entry->fmt) {
|
||||
case IBMVFC_CMD_FORMAT:
|
||||
entry->op_code = vfc_cmd->iu.cdb[0];
|
||||
entry->scsi_id = vfc_cmd->tgt_scsi_id;
|
||||
entry->scsi_id = be64_to_cpu(vfc_cmd->tgt_scsi_id);
|
||||
entry->lun = scsilun_to_int(&vfc_cmd->iu.lun);
|
||||
entry->tmf_flags = vfc_cmd->iu.tmf_flags;
|
||||
entry->u.end.status = vfc_cmd->status;
|
||||
entry->u.end.error = vfc_cmd->error;
|
||||
entry->u.end.status = be16_to_cpu(vfc_cmd->status);
|
||||
entry->u.end.error = be16_to_cpu(vfc_cmd->error);
|
||||
entry->u.end.fcp_rsp_flags = vfc_cmd->rsp.flags;
|
||||
entry->u.end.rsp_code = vfc_cmd->rsp.data.info.rsp_code;
|
||||
entry->u.end.scsi_status = vfc_cmd->rsp.scsi_status;
|
||||
break;
|
||||
case IBMVFC_MAD_FORMAT:
|
||||
entry->op_code = mad->opcode;
|
||||
entry->u.end.status = mad->status;
|
||||
entry->op_code = be32_to_cpu(mad->opcode);
|
||||
entry->u.end.status = be16_to_cpu(mad->status);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -270,14 +270,14 @@ static int ibmvfc_get_err_result(struct ibmvfc_cmd *vfc_cmd)
|
|||
{
|
||||
int err;
|
||||
struct ibmvfc_fcp_rsp *rsp = &vfc_cmd->rsp;
|
||||
int fc_rsp_len = rsp->fcp_rsp_len;
|
||||
int fc_rsp_len = be32_to_cpu(rsp->fcp_rsp_len);
|
||||
|
||||
if ((rsp->flags & FCP_RSP_LEN_VALID) &&
|
||||
((fc_rsp_len && fc_rsp_len != 4 && fc_rsp_len != 8) ||
|
||||
rsp->data.info.rsp_code))
|
||||
return DID_ERROR << 16;
|
||||
|
||||
err = ibmvfc_get_err_index(vfc_cmd->status, vfc_cmd->error);
|
||||
err = ibmvfc_get_err_index(be16_to_cpu(vfc_cmd->status), be16_to_cpu(vfc_cmd->error));
|
||||
if (err >= 0)
|
||||
return rsp->scsi_status | (cmd_status[err].result << 16);
|
||||
return rsp->scsi_status | (DID_ERROR << 16);
|
||||
|
|
@ -807,7 +807,7 @@ static void ibmvfc_fail_request(struct ibmvfc_event *evt, int error_code)
|
|||
evt->cmnd->result = (error_code << 16);
|
||||
evt->done = ibmvfc_scsi_eh_done;
|
||||
} else
|
||||
evt->xfer_iu->mad_common.status = IBMVFC_MAD_DRIVER_FAILED;
|
||||
evt->xfer_iu->mad_common.status = cpu_to_be16(IBMVFC_MAD_DRIVER_FAILED);
|
||||
|
||||
list_del(&evt->queue);
|
||||
del_timer(&evt->timer);
|
||||
|
|
@ -955,7 +955,7 @@ static void ibmvfc_get_host_speed(struct Scsi_Host *shost)
|
|||
|
||||
spin_lock_irqsave(shost->host_lock, flags);
|
||||
if (vhost->state == IBMVFC_ACTIVE) {
|
||||
switch (vhost->login_buf->resp.link_speed / 100) {
|
||||
switch (be64_to_cpu(vhost->login_buf->resp.link_speed) / 100) {
|
||||
case 1:
|
||||
fc_host_speed(shost) = FC_PORTSPEED_1GBIT;
|
||||
break;
|
||||
|
|
@ -976,7 +976,7 @@ static void ibmvfc_get_host_speed(struct Scsi_Host *shost)
|
|||
break;
|
||||
default:
|
||||
ibmvfc_log(vhost, 3, "Unknown port speed: %lld Gbit\n",
|
||||
vhost->login_buf->resp.link_speed / 100);
|
||||
be64_to_cpu(vhost->login_buf->resp.link_speed) / 100);
|
||||
fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1171,21 +1171,21 @@ static void ibmvfc_set_login_info(struct ibmvfc_host *vhost)
|
|||
|
||||
memset(login_info, 0, sizeof(*login_info));
|
||||
|
||||
login_info->ostype = IBMVFC_OS_LINUX;
|
||||
login_info->max_dma_len = IBMVFC_MAX_SECTORS << 9;
|
||||
login_info->max_payload = sizeof(struct ibmvfc_fcp_cmd_iu);
|
||||
login_info->max_response = sizeof(struct ibmvfc_fcp_rsp);
|
||||
login_info->partition_num = vhost->partition_number;
|
||||
login_info->vfc_frame_version = 1;
|
||||
login_info->fcp_version = 3;
|
||||
login_info->flags = IBMVFC_FLUSH_ON_HALT;
|
||||
login_info->ostype = cpu_to_be32(IBMVFC_OS_LINUX);
|
||||
login_info->max_dma_len = cpu_to_be64(IBMVFC_MAX_SECTORS << 9);
|
||||
login_info->max_payload = cpu_to_be32(sizeof(struct ibmvfc_fcp_cmd_iu));
|
||||
login_info->max_response = cpu_to_be32(sizeof(struct ibmvfc_fcp_rsp));
|
||||
login_info->partition_num = cpu_to_be32(vhost->partition_number);
|
||||
login_info->vfc_frame_version = cpu_to_be32(1);
|
||||
login_info->fcp_version = cpu_to_be16(3);
|
||||
login_info->flags = cpu_to_be16(IBMVFC_FLUSH_ON_HALT);
|
||||
if (vhost->client_migrated)
|
||||
login_info->flags |= IBMVFC_CLIENT_MIGRATED;
|
||||
login_info->flags |= cpu_to_be16(IBMVFC_CLIENT_MIGRATED);
|
||||
|
||||
login_info->max_cmds = max_requests + IBMVFC_NUM_INTERNAL_REQ;
|
||||
login_info->capabilities = IBMVFC_CAN_MIGRATE;
|
||||
login_info->async.va = vhost->async_crq.msg_token;
|
||||
login_info->async.len = vhost->async_crq.size * sizeof(*vhost->async_crq.msgs);
|
||||
login_info->max_cmds = cpu_to_be32(max_requests + IBMVFC_NUM_INTERNAL_REQ);
|
||||
login_info->capabilities = cpu_to_be64(IBMVFC_CAN_MIGRATE);
|
||||
login_info->async.va = cpu_to_be64(vhost->async_crq.msg_token);
|
||||
login_info->async.len = cpu_to_be32(vhost->async_crq.size * sizeof(*vhost->async_crq.msgs));
|
||||
strncpy(login_info->partition_name, vhost->partition_name, IBMVFC_MAX_NAME);
|
||||
strncpy(login_info->device_name,
|
||||
dev_name(&vhost->host->shost_gendev), IBMVFC_MAX_NAME);
|
||||
|
|
@ -1225,7 +1225,7 @@ static int ibmvfc_init_event_pool(struct ibmvfc_host *vhost)
|
|||
struct ibmvfc_event *evt = &pool->events[i];
|
||||
atomic_set(&evt->free, 1);
|
||||
evt->crq.valid = 0x80;
|
||||
evt->crq.ioba = pool->iu_token + (sizeof(*evt->xfer_iu) * i);
|
||||
evt->crq.ioba = cpu_to_be64(pool->iu_token + (sizeof(*evt->xfer_iu) * i));
|
||||
evt->xfer_iu = pool->iu_storage + i;
|
||||
evt->vhost = vhost;
|
||||
evt->ext_list = NULL;
|
||||
|
|
@ -1310,8 +1310,8 @@ static void ibmvfc_map_sg_list(struct scsi_cmnd *scmd, int nseg,
|
|||
struct scatterlist *sg;
|
||||
|
||||
scsi_for_each_sg(scmd, sg, nseg, i) {
|
||||
md[i].va = sg_dma_address(sg);
|
||||
md[i].len = sg_dma_len(sg);
|
||||
md[i].va = cpu_to_be64(sg_dma_address(sg));
|
||||
md[i].len = cpu_to_be32(sg_dma_len(sg));
|
||||
md[i].key = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -1337,7 +1337,7 @@ static int ibmvfc_map_sg_data(struct scsi_cmnd *scmd,
|
|||
|
||||
sg_mapped = scsi_dma_map(scmd);
|
||||
if (!sg_mapped) {
|
||||
vfc_cmd->flags |= IBMVFC_NO_MEM_DESC;
|
||||
vfc_cmd->flags |= cpu_to_be16(IBMVFC_NO_MEM_DESC);
|
||||
return 0;
|
||||
} else if (unlikely(sg_mapped < 0)) {
|
||||
if (vhost->log_level > IBMVFC_DEFAULT_LOG_LEVEL)
|
||||
|
|
@ -1346,10 +1346,10 @@ static int ibmvfc_map_sg_data(struct scsi_cmnd *scmd,
|
|||
}
|
||||
|
||||
if (scmd->sc_data_direction == DMA_TO_DEVICE) {
|
||||
vfc_cmd->flags |= IBMVFC_WRITE;
|
||||
vfc_cmd->flags |= cpu_to_be16(IBMVFC_WRITE);
|
||||
vfc_cmd->iu.add_cdb_len |= IBMVFC_WRDATA;
|
||||
} else {
|
||||
vfc_cmd->flags |= IBMVFC_READ;
|
||||
vfc_cmd->flags |= cpu_to_be16(IBMVFC_READ);
|
||||
vfc_cmd->iu.add_cdb_len |= IBMVFC_RDDATA;
|
||||
}
|
||||
|
||||
|
|
@ -1358,7 +1358,7 @@ static int ibmvfc_map_sg_data(struct scsi_cmnd *scmd,
|
|||
return 0;
|
||||
}
|
||||
|
||||
vfc_cmd->flags |= IBMVFC_SCATTERLIST;
|
||||
vfc_cmd->flags |= cpu_to_be16(IBMVFC_SCATTERLIST);
|
||||
|
||||
if (!evt->ext_list) {
|
||||
evt->ext_list = dma_pool_alloc(vhost->sg_pool, GFP_ATOMIC,
|
||||
|
|
@ -1374,8 +1374,8 @@ static int ibmvfc_map_sg_data(struct scsi_cmnd *scmd,
|
|||
|
||||
ibmvfc_map_sg_list(scmd, sg_mapped, evt->ext_list);
|
||||
|
||||
data->va = evt->ext_list_token;
|
||||
data->len = sg_mapped * sizeof(struct srp_direct_buf);
|
||||
data->va = cpu_to_be64(evt->ext_list_token);
|
||||
data->len = cpu_to_be32(sg_mapped * sizeof(struct srp_direct_buf));
|
||||
data->key = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1404,15 +1404,15 @@ static void ibmvfc_timeout(struct ibmvfc_event *evt)
|
|||
static int ibmvfc_send_event(struct ibmvfc_event *evt,
|
||||
struct ibmvfc_host *vhost, unsigned long timeout)
|
||||
{
|
||||
u64 *crq_as_u64 = (u64 *) &evt->crq;
|
||||
__be64 *crq_as_u64 = (__be64 *) &evt->crq;
|
||||
int rc;
|
||||
|
||||
/* Copy the IU into the transfer area */
|
||||
*evt->xfer_iu = evt->iu;
|
||||
if (evt->crq.format == IBMVFC_CMD_FORMAT)
|
||||
evt->xfer_iu->cmd.tag = (u64)evt;
|
||||
evt->xfer_iu->cmd.tag = cpu_to_be64((u64)evt);
|
||||
else if (evt->crq.format == IBMVFC_MAD_FORMAT)
|
||||
evt->xfer_iu->mad_common.tag = (u64)evt;
|
||||
evt->xfer_iu->mad_common.tag = cpu_to_be64((u64)evt);
|
||||
else
|
||||
BUG();
|
||||
|
||||
|
|
@ -1428,7 +1428,8 @@ static int ibmvfc_send_event(struct ibmvfc_event *evt,
|
|||
|
||||
mb();
|
||||
|
||||
if ((rc = ibmvfc_send_crq(vhost, crq_as_u64[0], crq_as_u64[1]))) {
|
||||
if ((rc = ibmvfc_send_crq(vhost, be64_to_cpu(crq_as_u64[0]),
|
||||
be64_to_cpu(crq_as_u64[1])))) {
|
||||
list_del(&evt->queue);
|
||||
del_timer(&evt->timer);
|
||||
|
||||
|
|
@ -1451,7 +1452,7 @@ static int ibmvfc_send_event(struct ibmvfc_event *evt,
|
|||
evt->cmnd->result = DID_ERROR << 16;
|
||||
evt->done = ibmvfc_scsi_eh_done;
|
||||
} else
|
||||
evt->xfer_iu->mad_common.status = IBMVFC_MAD_CRQ_ERROR;
|
||||
evt->xfer_iu->mad_common.status = cpu_to_be16(IBMVFC_MAD_CRQ_ERROR);
|
||||
|
||||
evt->done(evt);
|
||||
} else
|
||||
|
|
@ -1472,7 +1473,7 @@ static void ibmvfc_log_error(struct ibmvfc_event *evt)
|
|||
struct ibmvfc_fcp_rsp *rsp = &vfc_cmd->rsp;
|
||||
struct scsi_cmnd *cmnd = evt->cmnd;
|
||||
const char *err = unknown_error;
|
||||
int index = ibmvfc_get_err_index(vfc_cmd->status, vfc_cmd->error);
|
||||
int index = ibmvfc_get_err_index(be16_to_cpu(vfc_cmd->status), be16_to_cpu(vfc_cmd->error));
|
||||
int logerr = 0;
|
||||
int rsp_code = 0;
|
||||
|
||||
|
|
@ -1526,13 +1527,13 @@ static void ibmvfc_scsi_done(struct ibmvfc_event *evt)
|
|||
struct ibmvfc_fcp_rsp *rsp = &vfc_cmd->rsp;
|
||||
struct scsi_cmnd *cmnd = evt->cmnd;
|
||||
u32 rsp_len = 0;
|
||||
u32 sense_len = rsp->fcp_sense_len;
|
||||
u32 sense_len = be32_to_cpu(rsp->fcp_sense_len);
|
||||
|
||||
if (cmnd) {
|
||||
if (vfc_cmd->response_flags & IBMVFC_ADAPTER_RESID_VALID)
|
||||
scsi_set_resid(cmnd, vfc_cmd->adapter_resid);
|
||||
if (be16_to_cpu(vfc_cmd->response_flags) & IBMVFC_ADAPTER_RESID_VALID)
|
||||
scsi_set_resid(cmnd, be32_to_cpu(vfc_cmd->adapter_resid));
|
||||
else if (rsp->flags & FCP_RESID_UNDER)
|
||||
scsi_set_resid(cmnd, rsp->fcp_resid);
|
||||
scsi_set_resid(cmnd, be32_to_cpu(rsp->fcp_resid));
|
||||
else
|
||||
scsi_set_resid(cmnd, 0);
|
||||
|
||||
|
|
@ -1540,12 +1541,13 @@ static void ibmvfc_scsi_done(struct ibmvfc_event *evt)
|
|||
cmnd->result = ibmvfc_get_err_result(vfc_cmd);
|
||||
|
||||
if (rsp->flags & FCP_RSP_LEN_VALID)
|
||||
rsp_len = rsp->fcp_rsp_len;
|
||||
rsp_len = be32_to_cpu(rsp->fcp_rsp_len);
|
||||
if ((sense_len + rsp_len) > SCSI_SENSE_BUFFERSIZE)
|
||||
sense_len = SCSI_SENSE_BUFFERSIZE - rsp_len;
|
||||
if ((rsp->flags & FCP_SNS_LEN_VALID) && rsp->fcp_sense_len && rsp_len <= 8)
|
||||
memcpy(cmnd->sense_buffer, rsp->data.sense + rsp_len, sense_len);
|
||||
if ((vfc_cmd->status & IBMVFC_VIOS_FAILURE) && (vfc_cmd->error == IBMVFC_PLOGI_REQUIRED))
|
||||
if ((be16_to_cpu(vfc_cmd->status) & IBMVFC_VIOS_FAILURE) &&
|
||||
(be16_to_cpu(vfc_cmd->error) == IBMVFC_PLOGI_REQUIRED))
|
||||
ibmvfc_relogin(cmnd->device);
|
||||
|
||||
if (!cmnd->result && (!scsi_get_resid(cmnd) || (rsp->flags & FCP_RESID_OVER)))
|
||||
|
|
@ -1630,19 +1632,19 @@ static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd,
|
|||
cmnd->scsi_done = done;
|
||||
vfc_cmd = &evt->iu.cmd;
|
||||
memset(vfc_cmd, 0, sizeof(*vfc_cmd));
|
||||
vfc_cmd->resp.va = (u64)evt->crq.ioba + offsetof(struct ibmvfc_cmd, rsp);
|
||||
vfc_cmd->resp.len = sizeof(vfc_cmd->rsp);
|
||||
vfc_cmd->frame_type = IBMVFC_SCSI_FCP_TYPE;
|
||||
vfc_cmd->payload_len = sizeof(vfc_cmd->iu);
|
||||
vfc_cmd->resp_len = sizeof(vfc_cmd->rsp);
|
||||
vfc_cmd->cancel_key = (unsigned long)cmnd->device->hostdata;
|
||||
vfc_cmd->tgt_scsi_id = rport->port_id;
|
||||
vfc_cmd->iu.xfer_len = scsi_bufflen(cmnd);
|
||||
vfc_cmd->resp.va = cpu_to_be64(be64_to_cpu(evt->crq.ioba) + offsetof(struct ibmvfc_cmd, rsp));
|
||||
vfc_cmd->resp.len = cpu_to_be32(sizeof(vfc_cmd->rsp));
|
||||
vfc_cmd->frame_type = cpu_to_be32(IBMVFC_SCSI_FCP_TYPE);
|
||||
vfc_cmd->payload_len = cpu_to_be32(sizeof(vfc_cmd->iu));
|
||||
vfc_cmd->resp_len = cpu_to_be32(sizeof(vfc_cmd->rsp));
|
||||
vfc_cmd->cancel_key = cpu_to_be32((unsigned long)cmnd->device->hostdata);
|
||||
vfc_cmd->tgt_scsi_id = cpu_to_be64(rport->port_id);
|
||||
vfc_cmd->iu.xfer_len = cpu_to_be32(scsi_bufflen(cmnd));
|
||||
int_to_scsilun(cmnd->device->lun, &vfc_cmd->iu.lun);
|
||||
memcpy(vfc_cmd->iu.cdb, cmnd->cmnd, cmnd->cmd_len);
|
||||
|
||||
if (scsi_populate_tag_msg(cmnd, tag)) {
|
||||
vfc_cmd->task_tag = tag[1];
|
||||
vfc_cmd->task_tag = cpu_to_be64(tag[1]);
|
||||
switch (tag[0]) {
|
||||
case MSG_SIMPLE_TAG:
|
||||
vfc_cmd->iu.pri_task_attr = IBMVFC_SIMPLE_TASK;
|
||||
|
|
@ -1732,12 +1734,12 @@ static int ibmvfc_bsg_timeout(struct fc_bsg_job *job)
|
|||
|
||||
tmf = &evt->iu.tmf;
|
||||
memset(tmf, 0, sizeof(*tmf));
|
||||
tmf->common.version = 1;
|
||||
tmf->common.opcode = IBMVFC_TMF_MAD;
|
||||
tmf->common.length = sizeof(*tmf);
|
||||
tmf->scsi_id = port_id;
|
||||
tmf->cancel_key = IBMVFC_PASSTHRU_CANCEL_KEY;
|
||||
tmf->my_cancel_key = IBMVFC_INTERNAL_CANCEL_KEY;
|
||||
tmf->common.version = cpu_to_be32(1);
|
||||
tmf->common.opcode = cpu_to_be32(IBMVFC_TMF_MAD);
|
||||
tmf->common.length = cpu_to_be16(sizeof(*tmf));
|
||||
tmf->scsi_id = cpu_to_be64(port_id);
|
||||
tmf->cancel_key = cpu_to_be32(IBMVFC_PASSTHRU_CANCEL_KEY);
|
||||
tmf->my_cancel_key = cpu_to_be32(IBMVFC_INTERNAL_CANCEL_KEY);
|
||||
rc = ibmvfc_send_event(evt, vhost, default_timeout);
|
||||
|
||||
if (rc != 0) {
|
||||
|
|
@ -1789,10 +1791,10 @@ static int ibmvfc_bsg_plogi(struct ibmvfc_host *vhost, unsigned int port_id)
|
|||
ibmvfc_init_event(evt, ibmvfc_sync_completion, IBMVFC_MAD_FORMAT);
|
||||
plogi = &evt->iu.plogi;
|
||||
memset(plogi, 0, sizeof(*plogi));
|
||||
plogi->common.version = 1;
|
||||
plogi->common.opcode = IBMVFC_PORT_LOGIN;
|
||||
plogi->common.length = sizeof(*plogi);
|
||||
plogi->scsi_id = port_id;
|
||||
plogi->common.version = cpu_to_be32(1);
|
||||
plogi->common.opcode = cpu_to_be32(IBMVFC_PORT_LOGIN);
|
||||
plogi->common.length = cpu_to_be16(sizeof(*plogi));
|
||||
plogi->scsi_id = cpu_to_be64(port_id);
|
||||
evt->sync_iu = &rsp_iu;
|
||||
init_completion(&evt->comp);
|
||||
|
||||
|
|
@ -1904,26 +1906,26 @@ static int ibmvfc_bsg_request(struct fc_bsg_job *job)
|
|||
mad = &evt->iu.passthru;
|
||||
|
||||
memset(mad, 0, sizeof(*mad));
|
||||
mad->common.version = 1;
|
||||
mad->common.opcode = IBMVFC_PASSTHRU;
|
||||
mad->common.length = sizeof(*mad) - sizeof(mad->fc_iu) - sizeof(mad->iu);
|
||||
mad->common.version = cpu_to_be32(1);
|
||||
mad->common.opcode = cpu_to_be32(IBMVFC_PASSTHRU);
|
||||
mad->common.length = cpu_to_be16(sizeof(*mad) - sizeof(mad->fc_iu) - sizeof(mad->iu));
|
||||
|
||||
mad->cmd_ioba.va = (u64)evt->crq.ioba +
|
||||
offsetof(struct ibmvfc_passthru_mad, iu);
|
||||
mad->cmd_ioba.len = sizeof(mad->iu);
|
||||
mad->cmd_ioba.va = cpu_to_be64(be64_to_cpu(evt->crq.ioba) +
|
||||
offsetof(struct ibmvfc_passthru_mad, iu));
|
||||
mad->cmd_ioba.len = cpu_to_be32(sizeof(mad->iu));
|
||||
|
||||
mad->iu.cmd_len = job->request_payload.payload_len;
|
||||
mad->iu.rsp_len = job->reply_payload.payload_len;
|
||||
mad->iu.flags = fc_flags;
|
||||
mad->iu.cancel_key = IBMVFC_PASSTHRU_CANCEL_KEY;
|
||||
mad->iu.cmd_len = cpu_to_be32(job->request_payload.payload_len);
|
||||
mad->iu.rsp_len = cpu_to_be32(job->reply_payload.payload_len);
|
||||
mad->iu.flags = cpu_to_be32(fc_flags);
|
||||
mad->iu.cancel_key = cpu_to_be32(IBMVFC_PASSTHRU_CANCEL_KEY);
|
||||
|
||||
mad->iu.cmd.va = sg_dma_address(job->request_payload.sg_list);
|
||||
mad->iu.cmd.len = sg_dma_len(job->request_payload.sg_list);
|
||||
mad->iu.rsp.va = sg_dma_address(job->reply_payload.sg_list);
|
||||
mad->iu.rsp.len = sg_dma_len(job->reply_payload.sg_list);
|
||||
mad->iu.scsi_id = port_id;
|
||||
mad->iu.tag = (u64)evt;
|
||||
rsp_len = mad->iu.rsp.len;
|
||||
mad->iu.cmd.va = cpu_to_be64(sg_dma_address(job->request_payload.sg_list));
|
||||
mad->iu.cmd.len = cpu_to_be32(sg_dma_len(job->request_payload.sg_list));
|
||||
mad->iu.rsp.va = cpu_to_be64(sg_dma_address(job->reply_payload.sg_list));
|
||||
mad->iu.rsp.len = cpu_to_be32(sg_dma_len(job->reply_payload.sg_list));
|
||||
mad->iu.scsi_id = cpu_to_be64(port_id);
|
||||
mad->iu.tag = cpu_to_be64((u64)evt);
|
||||
rsp_len = be32_to_cpu(mad->iu.rsp.len);
|
||||
|
||||
evt->sync_iu = &rsp_iu;
|
||||
init_completion(&evt->comp);
|
||||
|
|
@ -1986,15 +1988,15 @@ static int ibmvfc_reset_device(struct scsi_device *sdev, int type, char *desc)
|
|||
|
||||
tmf = &evt->iu.cmd;
|
||||
memset(tmf, 0, sizeof(*tmf));
|
||||
tmf->resp.va = (u64)evt->crq.ioba + offsetof(struct ibmvfc_cmd, rsp);
|
||||
tmf->resp.len = sizeof(tmf->rsp);
|
||||
tmf->frame_type = IBMVFC_SCSI_FCP_TYPE;
|
||||
tmf->payload_len = sizeof(tmf->iu);
|
||||
tmf->resp_len = sizeof(tmf->rsp);
|
||||
tmf->cancel_key = (unsigned long)sdev->hostdata;
|
||||
tmf->tgt_scsi_id = rport->port_id;
|
||||
tmf->resp.va = cpu_to_be64(be64_to_cpu(evt->crq.ioba) + offsetof(struct ibmvfc_cmd, rsp));
|
||||
tmf->resp.len = cpu_to_be32(sizeof(tmf->rsp));
|
||||
tmf->frame_type = cpu_to_be32(IBMVFC_SCSI_FCP_TYPE);
|
||||
tmf->payload_len = cpu_to_be32(sizeof(tmf->iu));
|
||||
tmf->resp_len = cpu_to_be32(sizeof(tmf->rsp));
|
||||
tmf->cancel_key = cpu_to_be32((unsigned long)sdev->hostdata);
|
||||
tmf->tgt_scsi_id = cpu_to_be64(rport->port_id);
|
||||
int_to_scsilun(sdev->lun, &tmf->iu.lun);
|
||||
tmf->flags = (IBMVFC_NO_MEM_DESC | IBMVFC_TMF);
|
||||
tmf->flags = cpu_to_be16((IBMVFC_NO_MEM_DESC | IBMVFC_TMF));
|
||||
tmf->iu.tmf_flags = type;
|
||||
evt->sync_iu = &rsp_iu;
|
||||
|
||||
|
|
@ -2020,8 +2022,8 @@ static int ibmvfc_reset_device(struct scsi_device *sdev, int type, char *desc)
|
|||
rsp_code = fc_rsp->data.info.rsp_code;
|
||||
|
||||
sdev_printk(KERN_ERR, sdev, "%s reset failed: %s (%x:%x) "
|
||||
"flags: %x fcp_rsp: %x, scsi_status: %x\n",
|
||||
desc, ibmvfc_get_cmd_error(rsp_iu.cmd.status, rsp_iu.cmd.error),
|
||||
"flags: %x fcp_rsp: %x, scsi_status: %x\n", desc,
|
||||
ibmvfc_get_cmd_error(be16_to_cpu(rsp_iu.cmd.status), be16_to_cpu(rsp_iu.cmd.error)),
|
||||
rsp_iu.cmd.status, rsp_iu.cmd.error, fc_rsp->flags, rsp_code,
|
||||
fc_rsp->scsi_status);
|
||||
rsp_rc = -EIO;
|
||||
|
|
@ -2185,19 +2187,19 @@ static int ibmvfc_cancel_all(struct scsi_device *sdev, int type)
|
|||
|
||||
tmf = &evt->iu.tmf;
|
||||
memset(tmf, 0, sizeof(*tmf));
|
||||
tmf->common.version = 1;
|
||||
tmf->common.opcode = IBMVFC_TMF_MAD;
|
||||
tmf->common.length = sizeof(*tmf);
|
||||
tmf->scsi_id = rport->port_id;
|
||||
tmf->common.version = cpu_to_be32(1);
|
||||
tmf->common.opcode = cpu_to_be32(IBMVFC_TMF_MAD);
|
||||
tmf->common.length = cpu_to_be16(sizeof(*tmf));
|
||||
tmf->scsi_id = cpu_to_be64(rport->port_id);
|
||||
int_to_scsilun(sdev->lun, &tmf->lun);
|
||||
if (!(vhost->login_buf->resp.capabilities & IBMVFC_CAN_SUPPRESS_ABTS))
|
||||
if (!(be64_to_cpu(vhost->login_buf->resp.capabilities) & IBMVFC_CAN_SUPPRESS_ABTS))
|
||||
type &= ~IBMVFC_TMF_SUPPRESS_ABTS;
|
||||
if (vhost->state == IBMVFC_ACTIVE)
|
||||
tmf->flags = (type | IBMVFC_TMF_LUA_VALID);
|
||||
tmf->flags = cpu_to_be32((type | IBMVFC_TMF_LUA_VALID));
|
||||
else
|
||||
tmf->flags = ((type & IBMVFC_TMF_SUPPRESS_ABTS) | IBMVFC_TMF_LUA_VALID);
|
||||
tmf->cancel_key = (unsigned long)sdev->hostdata;
|
||||
tmf->my_cancel_key = (unsigned long)starget->hostdata;
|
||||
tmf->flags = cpu_to_be32(((type & IBMVFC_TMF_SUPPRESS_ABTS) | IBMVFC_TMF_LUA_VALID));
|
||||
tmf->cancel_key = cpu_to_be32((unsigned long)sdev->hostdata);
|
||||
tmf->my_cancel_key = cpu_to_be32((unsigned long)starget->hostdata);
|
||||
|
||||
evt->sync_iu = &rsp;
|
||||
init_completion(&evt->comp);
|
||||
|
|
@ -2217,7 +2219,7 @@ static int ibmvfc_cancel_all(struct scsi_device *sdev, int type)
|
|||
sdev_printk(KERN_INFO, sdev, "Cancelling outstanding commands.\n");
|
||||
|
||||
wait_for_completion(&evt->comp);
|
||||
status = rsp.mad_common.status;
|
||||
status = be16_to_cpu(rsp.mad_common.status);
|
||||
spin_lock_irqsave(vhost->host->host_lock, flags);
|
||||
ibmvfc_free_event(evt);
|
||||
spin_unlock_irqrestore(vhost->host->host_lock, flags);
|
||||
|
|
@ -2252,7 +2254,7 @@ static int ibmvfc_match_key(struct ibmvfc_event *evt, void *key)
|
|||
unsigned long cancel_key = (unsigned long)key;
|
||||
|
||||
if (evt->crq.format == IBMVFC_CMD_FORMAT &&
|
||||
evt->iu.cmd.cancel_key == cancel_key)
|
||||
be32_to_cpu(evt->iu.cmd.cancel_key) == cancel_key)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2316,15 +2318,15 @@ static int ibmvfc_abort_task_set(struct scsi_device *sdev)
|
|||
|
||||
tmf = &evt->iu.cmd;
|
||||
memset(tmf, 0, sizeof(*tmf));
|
||||
tmf->resp.va = (u64)evt->crq.ioba + offsetof(struct ibmvfc_cmd, rsp);
|
||||
tmf->resp.len = sizeof(tmf->rsp);
|
||||
tmf->frame_type = IBMVFC_SCSI_FCP_TYPE;
|
||||
tmf->payload_len = sizeof(tmf->iu);
|
||||
tmf->resp_len = sizeof(tmf->rsp);
|
||||
tmf->cancel_key = (unsigned long)sdev->hostdata;
|
||||
tmf->tgt_scsi_id = rport->port_id;
|
||||
tmf->resp.va = cpu_to_be64(be64_to_cpu(evt->crq.ioba) + offsetof(struct ibmvfc_cmd, rsp));
|
||||
tmf->resp.len = cpu_to_be32(sizeof(tmf->rsp));
|
||||
tmf->frame_type = cpu_to_be32(IBMVFC_SCSI_FCP_TYPE);
|
||||
tmf->payload_len = cpu_to_be32(sizeof(tmf->iu));
|
||||
tmf->resp_len = cpu_to_be32(sizeof(tmf->rsp));
|
||||
tmf->cancel_key = cpu_to_be32((unsigned long)sdev->hostdata);
|
||||
tmf->tgt_scsi_id = cpu_to_be64(rport->port_id);
|
||||
int_to_scsilun(sdev->lun, &tmf->iu.lun);
|
||||
tmf->flags = (IBMVFC_NO_MEM_DESC | IBMVFC_TMF);
|
||||
tmf->flags = cpu_to_be16((IBMVFC_NO_MEM_DESC | IBMVFC_TMF));
|
||||
tmf->iu.tmf_flags = IBMVFC_ABORT_TASK_SET;
|
||||
evt->sync_iu = &rsp_iu;
|
||||
|
||||
|
|
@ -2380,7 +2382,7 @@ static int ibmvfc_abort_task_set(struct scsi_device *sdev)
|
|||
|
||||
sdev_printk(KERN_ERR, sdev, "Abort failed: %s (%x:%x) "
|
||||
"flags: %x fcp_rsp: %x, scsi_status: %x\n",
|
||||
ibmvfc_get_cmd_error(rsp_iu.cmd.status, rsp_iu.cmd.error),
|
||||
ibmvfc_get_cmd_error(be16_to_cpu(rsp_iu.cmd.status), be16_to_cpu(rsp_iu.cmd.error)),
|
||||
rsp_iu.cmd.status, rsp_iu.cmd.error, fc_rsp->flags, rsp_code,
|
||||
fc_rsp->scsi_status);
|
||||
rsp_rc = -EIO;
|
||||
|
|
@ -2641,14 +2643,14 @@ static const char *ibmvfc_get_link_state(enum ibmvfc_ae_link_state state)
|
|||
static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq,
|
||||
struct ibmvfc_host *vhost)
|
||||
{
|
||||
const struct ibmvfc_async_desc *desc = ibmvfc_get_ae_desc(crq->event);
|
||||
const struct ibmvfc_async_desc *desc = ibmvfc_get_ae_desc(be64_to_cpu(crq->event));
|
||||
struct ibmvfc_target *tgt;
|
||||
|
||||
ibmvfc_log(vhost, desc->log_level, "%s event received. scsi_id: %llx, wwpn: %llx,"
|
||||
" node_name: %llx%s\n", desc->desc, crq->scsi_id, crq->wwpn, crq->node_name,
|
||||
ibmvfc_get_link_state(crq->link_state));
|
||||
|
||||
switch (crq->event) {
|
||||
switch (be64_to_cpu(crq->event)) {
|
||||
case IBMVFC_AE_RESUME:
|
||||
switch (crq->link_state) {
|
||||
case IBMVFC_AE_LS_LINK_DOWN:
|
||||
|
|
@ -2691,15 +2693,15 @@ static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq,
|
|||
list_for_each_entry(tgt, &vhost->targets, queue) {
|
||||
if (!crq->scsi_id && !crq->wwpn && !crq->node_name)
|
||||
break;
|
||||
if (crq->scsi_id && tgt->scsi_id != crq->scsi_id)
|
||||
if (crq->scsi_id && cpu_to_be64(tgt->scsi_id) != crq->scsi_id)
|
||||
continue;
|
||||
if (crq->wwpn && tgt->ids.port_name != crq->wwpn)
|
||||
if (crq->wwpn && cpu_to_be64(tgt->ids.port_name) != crq->wwpn)
|
||||
continue;
|
||||
if (crq->node_name && tgt->ids.node_name != crq->node_name)
|
||||
if (crq->node_name && cpu_to_be64(tgt->ids.node_name) != crq->node_name)
|
||||
continue;
|
||||
if (tgt->need_login && crq->event == IBMVFC_AE_ELS_LOGO)
|
||||
if (tgt->need_login && be64_to_cpu(crq->event) == IBMVFC_AE_ELS_LOGO)
|
||||
tgt->logo_rcvd = 1;
|
||||
if (!tgt->need_login || crq->event == IBMVFC_AE_ELS_PLOGI) {
|
||||
if (!tgt->need_login || be64_to_cpu(crq->event) == IBMVFC_AE_ELS_PLOGI) {
|
||||
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT);
|
||||
ibmvfc_reinit_host(vhost);
|
||||
}
|
||||
|
|
@ -2730,7 +2732,7 @@ static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq,
|
|||
static void ibmvfc_handle_crq(struct ibmvfc_crq *crq, struct ibmvfc_host *vhost)
|
||||
{
|
||||
long rc;
|
||||
struct ibmvfc_event *evt = (struct ibmvfc_event *)crq->ioba;
|
||||
struct ibmvfc_event *evt = (struct ibmvfc_event *)be64_to_cpu(crq->ioba);
|
||||
|
||||
switch (crq->valid) {
|
||||
case IBMVFC_CRQ_INIT_RSP:
|
||||
|
|
@ -3336,7 +3338,7 @@ static void ibmvfc_tgt_prli_done(struct ibmvfc_event *evt)
|
|||
struct ibmvfc_host *vhost = evt->vhost;
|
||||
struct ibmvfc_process_login *rsp = &evt->xfer_iu->prli;
|
||||
struct ibmvfc_prli_svc_parms *parms = &rsp->parms;
|
||||
u32 status = rsp->common.status;
|
||||
u32 status = be16_to_cpu(rsp->common.status);
|
||||
int index, level = IBMVFC_DEFAULT_LOG_LEVEL;
|
||||
|
||||
vhost->discovery_threads--;
|
||||
|
|
@ -3347,14 +3349,14 @@ static void ibmvfc_tgt_prli_done(struct ibmvfc_event *evt)
|
|||
parms->type, parms->flags, parms->service_parms);
|
||||
|
||||
if (parms->type == IBMVFC_SCSI_FCP_TYPE) {
|
||||
index = ibmvfc_get_prli_rsp(parms->flags);
|
||||
index = ibmvfc_get_prli_rsp(be16_to_cpu(parms->flags));
|
||||
if (prli_rsp[index].logged_in) {
|
||||
if (parms->flags & IBMVFC_PRLI_EST_IMG_PAIR) {
|
||||
if (be16_to_cpu(parms->flags) & IBMVFC_PRLI_EST_IMG_PAIR) {
|
||||
tgt->need_login = 0;
|
||||
tgt->ids.roles = 0;
|
||||
if (parms->service_parms & IBMVFC_PRLI_TARGET_FUNC)
|
||||
if (be32_to_cpu(parms->service_parms) & IBMVFC_PRLI_TARGET_FUNC)
|
||||
tgt->ids.roles |= FC_PORT_ROLE_FCP_TARGET;
|
||||
if (parms->service_parms & IBMVFC_PRLI_INITIATOR_FUNC)
|
||||
if (be32_to_cpu(parms->service_parms) & IBMVFC_PRLI_INITIATOR_FUNC)
|
||||
tgt->ids.roles |= FC_PORT_ROLE_FCP_INITIATOR;
|
||||
tgt->add_rport = 1;
|
||||
} else
|
||||
|
|
@ -3373,17 +3375,18 @@ static void ibmvfc_tgt_prli_done(struct ibmvfc_event *evt)
|
|||
break;
|
||||
case IBMVFC_MAD_FAILED:
|
||||
default:
|
||||
if ((rsp->status & IBMVFC_VIOS_FAILURE) && rsp->error == IBMVFC_PLOGI_REQUIRED)
|
||||
if ((be16_to_cpu(rsp->status) & IBMVFC_VIOS_FAILURE) &&
|
||||
be16_to_cpu(rsp->error) == IBMVFC_PLOGI_REQUIRED)
|
||||
level += ibmvfc_retry_tgt_init(tgt, ibmvfc_tgt_send_plogi);
|
||||
else if (tgt->logo_rcvd)
|
||||
level += ibmvfc_retry_tgt_init(tgt, ibmvfc_tgt_send_plogi);
|
||||
else if (ibmvfc_retry_cmd(rsp->status, rsp->error))
|
||||
else if (ibmvfc_retry_cmd(be16_to_cpu(rsp->status), be16_to_cpu(rsp->error)))
|
||||
level += ibmvfc_retry_tgt_init(tgt, ibmvfc_tgt_send_prli);
|
||||
else
|
||||
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT);
|
||||
|
||||
tgt_log(tgt, level, "Process Login failed: %s (%x:%x) rc=0x%02X\n",
|
||||
ibmvfc_get_cmd_error(rsp->status, rsp->error),
|
||||
ibmvfc_get_cmd_error(be16_to_cpu(rsp->status), be16_to_cpu(rsp->error)),
|
||||
rsp->status, rsp->error, status);
|
||||
break;
|
||||
};
|
||||
|
|
@ -3414,14 +3417,14 @@ static void ibmvfc_tgt_send_prli(struct ibmvfc_target *tgt)
|
|||
evt->tgt = tgt;
|
||||
prli = &evt->iu.prli;
|
||||
memset(prli, 0, sizeof(*prli));
|
||||
prli->common.version = 1;
|
||||
prli->common.opcode = IBMVFC_PROCESS_LOGIN;
|
||||
prli->common.length = sizeof(*prli);
|
||||
prli->scsi_id = tgt->scsi_id;
|
||||
prli->common.version = cpu_to_be32(1);
|
||||
prli->common.opcode = cpu_to_be32(IBMVFC_PROCESS_LOGIN);
|
||||
prli->common.length = cpu_to_be16(sizeof(*prli));
|
||||
prli->scsi_id = cpu_to_be64(tgt->scsi_id);
|
||||
|
||||
prli->parms.type = IBMVFC_SCSI_FCP_TYPE;
|
||||
prli->parms.flags = IBMVFC_PRLI_EST_IMG_PAIR;
|
||||
prli->parms.service_parms = IBMVFC_PRLI_INITIATOR_FUNC;
|
||||
prli->parms.flags = cpu_to_be16(IBMVFC_PRLI_EST_IMG_PAIR);
|
||||
prli->parms.service_parms = cpu_to_be32(IBMVFC_PRLI_INITIATOR_FUNC);
|
||||
|
||||
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_INIT_WAIT);
|
||||
if (ibmvfc_send_event(evt, vhost, default_timeout)) {
|
||||
|
|
@ -3442,7 +3445,7 @@ static void ibmvfc_tgt_plogi_done(struct ibmvfc_event *evt)
|
|||
struct ibmvfc_target *tgt = evt->tgt;
|
||||
struct ibmvfc_host *vhost = evt->vhost;
|
||||
struct ibmvfc_port_login *rsp = &evt->xfer_iu->plogi;
|
||||
u32 status = rsp->common.status;
|
||||
u32 status = be16_to_cpu(rsp->common.status);
|
||||
int level = IBMVFC_DEFAULT_LOG_LEVEL;
|
||||
|
||||
vhost->discovery_threads--;
|
||||
|
|
@ -3472,15 +3475,15 @@ static void ibmvfc_tgt_plogi_done(struct ibmvfc_event *evt)
|
|||
break;
|
||||
case IBMVFC_MAD_FAILED:
|
||||
default:
|
||||
if (ibmvfc_retry_cmd(rsp->status, rsp->error))
|
||||
if (ibmvfc_retry_cmd(be16_to_cpu(rsp->status), be16_to_cpu(rsp->error)))
|
||||
level += ibmvfc_retry_tgt_init(tgt, ibmvfc_tgt_send_plogi);
|
||||
else
|
||||
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT);
|
||||
|
||||
tgt_log(tgt, level, "Port Login failed: %s (%x:%x) %s (%x) %s (%x) rc=0x%02X\n",
|
||||
ibmvfc_get_cmd_error(rsp->status, rsp->error), rsp->status, rsp->error,
|
||||
ibmvfc_get_fc_type(rsp->fc_type), rsp->fc_type,
|
||||
ibmvfc_get_ls_explain(rsp->fc_explain), rsp->fc_explain, status);
|
||||
ibmvfc_get_cmd_error(be16_to_cpu(rsp->status), be16_to_cpu(rsp->error)), rsp->status, rsp->error,
|
||||
ibmvfc_get_fc_type(be16_to_cpu(rsp->fc_type)), rsp->fc_type,
|
||||
ibmvfc_get_ls_explain(be16_to_cpu(rsp->fc_explain)), rsp->fc_explain, status);
|
||||
break;
|
||||
};
|
||||
|
||||
|
|
@ -3512,10 +3515,10 @@ static void ibmvfc_tgt_send_plogi(struct ibmvfc_target *tgt)
|
|||
evt->tgt = tgt;
|
||||
plogi = &evt->iu.plogi;
|
||||
memset(plogi, 0, sizeof(*plogi));
|
||||
plogi->common.version = 1;
|
||||
plogi->common.opcode = IBMVFC_PORT_LOGIN;
|
||||
plogi->common.length = sizeof(*plogi);
|
||||
plogi->scsi_id = tgt->scsi_id;
|
||||
plogi->common.version = cpu_to_be32(1);
|
||||
plogi->common.opcode = cpu_to_be32(IBMVFC_PORT_LOGIN);
|
||||
plogi->common.length = cpu_to_be16(sizeof(*plogi));
|
||||
plogi->scsi_id = cpu_to_be64(tgt->scsi_id);
|
||||
|
||||
if (ibmvfc_send_event(evt, vhost, default_timeout)) {
|
||||
vhost->discovery_threads--;
|
||||
|
|
@ -3535,7 +3538,7 @@ static void ibmvfc_tgt_implicit_logout_done(struct ibmvfc_event *evt)
|
|||
struct ibmvfc_target *tgt = evt->tgt;
|
||||
struct ibmvfc_host *vhost = evt->vhost;
|
||||
struct ibmvfc_implicit_logout *rsp = &evt->xfer_iu->implicit_logout;
|
||||
u32 status = rsp->common.status;
|
||||
u32 status = be16_to_cpu(rsp->common.status);
|
||||
|
||||
vhost->discovery_threads--;
|
||||
ibmvfc_free_event(evt);
|
||||
|
|
@ -3585,10 +3588,10 @@ static void ibmvfc_tgt_implicit_logout(struct ibmvfc_target *tgt)
|
|||
evt->tgt = tgt;
|
||||
mad = &evt->iu.implicit_logout;
|
||||
memset(mad, 0, sizeof(*mad));
|
||||
mad->common.version = 1;
|
||||
mad->common.opcode = IBMVFC_IMPLICIT_LOGOUT;
|
||||
mad->common.length = sizeof(*mad);
|
||||
mad->old_scsi_id = tgt->scsi_id;
|
||||
mad->common.version = cpu_to_be32(1);
|
||||
mad->common.opcode = cpu_to_be32(IBMVFC_IMPLICIT_LOGOUT);
|
||||
mad->common.length = cpu_to_be16(sizeof(*mad));
|
||||
mad->old_scsi_id = cpu_to_be64(tgt->scsi_id);
|
||||
|
||||
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_INIT_WAIT);
|
||||
if (ibmvfc_send_event(evt, vhost, default_timeout)) {
|
||||
|
|
@ -3616,7 +3619,7 @@ static int ibmvfc_adisc_needs_plogi(struct ibmvfc_passthru_mad *mad,
|
|||
if (memcmp(&mad->fc_iu.response[4], &tgt->ids.node_name,
|
||||
sizeof(tgt->ids.node_name)))
|
||||
return 1;
|
||||
if (mad->fc_iu.response[6] != tgt->scsi_id)
|
||||
if (be32_to_cpu(mad->fc_iu.response[6]) != tgt->scsi_id)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -3631,7 +3634,7 @@ static void ibmvfc_tgt_adisc_done(struct ibmvfc_event *evt)
|
|||
struct ibmvfc_target *tgt = evt->tgt;
|
||||
struct ibmvfc_host *vhost = evt->vhost;
|
||||
struct ibmvfc_passthru_mad *mad = &evt->xfer_iu->passthru;
|
||||
u32 status = mad->common.status;
|
||||
u32 status = be16_to_cpu(mad->common.status);
|
||||
u8 fc_reason, fc_explain;
|
||||
|
||||
vhost->discovery_threads--;
|
||||
|
|
@ -3649,10 +3652,10 @@ static void ibmvfc_tgt_adisc_done(struct ibmvfc_event *evt)
|
|||
case IBMVFC_MAD_FAILED:
|
||||
default:
|
||||
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT);
|
||||
fc_reason = (mad->fc_iu.response[1] & 0x00ff0000) >> 16;
|
||||
fc_explain = (mad->fc_iu.response[1] & 0x0000ff00) >> 8;
|
||||
fc_reason = (be32_to_cpu(mad->fc_iu.response[1]) & 0x00ff0000) >> 16;
|
||||
fc_explain = (be32_to_cpu(mad->fc_iu.response[1]) & 0x0000ff00) >> 8;
|
||||
tgt_info(tgt, "ADISC failed: %s (%x:%x) %s (%x) %s (%x) rc=0x%02X\n",
|
||||
ibmvfc_get_cmd_error(mad->iu.status, mad->iu.error),
|
||||
ibmvfc_get_cmd_error(be16_to_cpu(mad->iu.status), be16_to_cpu(mad->iu.error)),
|
||||
mad->iu.status, mad->iu.error,
|
||||
ibmvfc_get_fc_type(fc_reason), fc_reason,
|
||||
ibmvfc_get_ls_explain(fc_explain), fc_explain, status);
|
||||
|
|
@ -3674,22 +3677,22 @@ static void ibmvfc_init_passthru(struct ibmvfc_event *evt)
|
|||
struct ibmvfc_passthru_mad *mad = &evt->iu.passthru;
|
||||
|
||||
memset(mad, 0, sizeof(*mad));
|
||||
mad->common.version = 1;
|
||||
mad->common.opcode = IBMVFC_PASSTHRU;
|
||||
mad->common.length = sizeof(*mad) - sizeof(mad->fc_iu) - sizeof(mad->iu);
|
||||
mad->cmd_ioba.va = (u64)evt->crq.ioba +
|
||||
offsetof(struct ibmvfc_passthru_mad, iu);
|
||||
mad->cmd_ioba.len = sizeof(mad->iu);
|
||||
mad->iu.cmd_len = sizeof(mad->fc_iu.payload);
|
||||
mad->iu.rsp_len = sizeof(mad->fc_iu.response);
|
||||
mad->iu.cmd.va = (u64)evt->crq.ioba +
|
||||
mad->common.version = cpu_to_be32(1);
|
||||
mad->common.opcode = cpu_to_be32(IBMVFC_PASSTHRU);
|
||||
mad->common.length = cpu_to_be16(sizeof(*mad) - sizeof(mad->fc_iu) - sizeof(mad->iu));
|
||||
mad->cmd_ioba.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) +
|
||||
offsetof(struct ibmvfc_passthru_mad, iu));
|
||||
mad->cmd_ioba.len = cpu_to_be32(sizeof(mad->iu));
|
||||
mad->iu.cmd_len = cpu_to_be32(sizeof(mad->fc_iu.payload));
|
||||
mad->iu.rsp_len = cpu_to_be32(sizeof(mad->fc_iu.response));
|
||||
mad->iu.cmd.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) +
|
||||
offsetof(struct ibmvfc_passthru_mad, fc_iu) +
|
||||
offsetof(struct ibmvfc_passthru_fc_iu, payload);
|
||||
mad->iu.cmd.len = sizeof(mad->fc_iu.payload);
|
||||
mad->iu.rsp.va = (u64)evt->crq.ioba +
|
||||
offsetof(struct ibmvfc_passthru_fc_iu, payload));
|
||||
mad->iu.cmd.len = cpu_to_be32(sizeof(mad->fc_iu.payload));
|
||||
mad->iu.rsp.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) +
|
||||
offsetof(struct ibmvfc_passthru_mad, fc_iu) +
|
||||
offsetof(struct ibmvfc_passthru_fc_iu, response);
|
||||
mad->iu.rsp.len = sizeof(mad->fc_iu.response);
|
||||
offsetof(struct ibmvfc_passthru_fc_iu, response));
|
||||
mad->iu.rsp.len = cpu_to_be32(sizeof(mad->fc_iu.response));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -3748,11 +3751,11 @@ static void ibmvfc_adisc_timeout(struct ibmvfc_target *tgt)
|
|||
evt->tgt = tgt;
|
||||
tmf = &evt->iu.tmf;
|
||||
memset(tmf, 0, sizeof(*tmf));
|
||||
tmf->common.version = 1;
|
||||
tmf->common.opcode = IBMVFC_TMF_MAD;
|
||||
tmf->common.length = sizeof(*tmf);
|
||||
tmf->scsi_id = tgt->scsi_id;
|
||||
tmf->cancel_key = tgt->cancel_key;
|
||||
tmf->common.version = cpu_to_be32(1);
|
||||
tmf->common.opcode = cpu_to_be32(IBMVFC_TMF_MAD);
|
||||
tmf->common.length = cpu_to_be16(sizeof(*tmf));
|
||||
tmf->scsi_id = cpu_to_be64(tgt->scsi_id);
|
||||
tmf->cancel_key = cpu_to_be32(tgt->cancel_key);
|
||||
|
||||
rc = ibmvfc_send_event(evt, vhost, default_timeout);
|
||||
|
||||
|
|
@ -3794,16 +3797,16 @@ static void ibmvfc_tgt_adisc(struct ibmvfc_target *tgt)
|
|||
|
||||
ibmvfc_init_passthru(evt);
|
||||
mad = &evt->iu.passthru;
|
||||
mad->iu.flags = IBMVFC_FC_ELS;
|
||||
mad->iu.scsi_id = tgt->scsi_id;
|
||||
mad->iu.cancel_key = tgt->cancel_key;
|
||||
mad->iu.flags = cpu_to_be32(IBMVFC_FC_ELS);
|
||||
mad->iu.scsi_id = cpu_to_be64(tgt->scsi_id);
|
||||
mad->iu.cancel_key = cpu_to_be32(tgt->cancel_key);
|
||||
|
||||
mad->fc_iu.payload[0] = IBMVFC_ADISC;
|
||||
mad->fc_iu.payload[0] = cpu_to_be32(IBMVFC_ADISC);
|
||||
memcpy(&mad->fc_iu.payload[2], &vhost->login_buf->resp.port_name,
|
||||
sizeof(vhost->login_buf->resp.port_name));
|
||||
memcpy(&mad->fc_iu.payload[4], &vhost->login_buf->resp.node_name,
|
||||
sizeof(vhost->login_buf->resp.node_name));
|
||||
mad->fc_iu.payload[6] = vhost->login_buf->resp.scsi_id & 0x00ffffff;
|
||||
mad->fc_iu.payload[6] = cpu_to_be32(be64_to_cpu(vhost->login_buf->resp.scsi_id) & 0x00ffffff);
|
||||
|
||||
if (timer_pending(&tgt->timer))
|
||||
mod_timer(&tgt->timer, jiffies + (IBMVFC_ADISC_TIMEOUT * HZ));
|
||||
|
|
@ -3834,7 +3837,7 @@ static void ibmvfc_tgt_query_target_done(struct ibmvfc_event *evt)
|
|||
struct ibmvfc_target *tgt = evt->tgt;
|
||||
struct ibmvfc_host *vhost = evt->vhost;
|
||||
struct ibmvfc_query_tgt *rsp = &evt->xfer_iu->query_tgt;
|
||||
u32 status = rsp->common.status;
|
||||
u32 status = be16_to_cpu(rsp->common.status);
|
||||
int level = IBMVFC_DEFAULT_LOG_LEVEL;
|
||||
|
||||
vhost->discovery_threads--;
|
||||
|
|
@ -3842,8 +3845,8 @@ static void ibmvfc_tgt_query_target_done(struct ibmvfc_event *evt)
|
|||
switch (status) {
|
||||
case IBMVFC_MAD_SUCCESS:
|
||||
tgt_dbg(tgt, "Query Target succeeded\n");
|
||||
tgt->new_scsi_id = rsp->scsi_id;
|
||||
if (rsp->scsi_id != tgt->scsi_id)
|
||||
tgt->new_scsi_id = be64_to_cpu(rsp->scsi_id);
|
||||
if (be64_to_cpu(rsp->scsi_id) != tgt->scsi_id)
|
||||
ibmvfc_init_tgt(tgt, ibmvfc_tgt_implicit_logout);
|
||||
else
|
||||
ibmvfc_init_tgt(tgt, ibmvfc_tgt_adisc);
|
||||
|
|
@ -3855,19 +3858,20 @@ static void ibmvfc_tgt_query_target_done(struct ibmvfc_event *evt)
|
|||
break;
|
||||
case IBMVFC_MAD_FAILED:
|
||||
default:
|
||||
if ((rsp->status & IBMVFC_FABRIC_MAPPED) == IBMVFC_FABRIC_MAPPED &&
|
||||
rsp->error == IBMVFC_UNABLE_TO_PERFORM_REQ &&
|
||||
rsp->fc_explain == IBMVFC_PORT_NAME_NOT_REG)
|
||||
if ((be16_to_cpu(rsp->status) & IBMVFC_FABRIC_MAPPED) == IBMVFC_FABRIC_MAPPED &&
|
||||
be16_to_cpu(rsp->error) == IBMVFC_UNABLE_TO_PERFORM_REQ &&
|
||||
be16_to_cpu(rsp->fc_explain) == IBMVFC_PORT_NAME_NOT_REG)
|
||||
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT);
|
||||
else if (ibmvfc_retry_cmd(rsp->status, rsp->error))
|
||||
else if (ibmvfc_retry_cmd(be16_to_cpu(rsp->status), be16_to_cpu(rsp->error)))
|
||||
level += ibmvfc_retry_tgt_init(tgt, ibmvfc_tgt_query_target);
|
||||
else
|
||||
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT);
|
||||
|
||||
tgt_log(tgt, level, "Query Target failed: %s (%x:%x) %s (%x) %s (%x) rc=0x%02X\n",
|
||||
ibmvfc_get_cmd_error(rsp->status, rsp->error), rsp->status, rsp->error,
|
||||
ibmvfc_get_fc_type(rsp->fc_type), rsp->fc_type,
|
||||
ibmvfc_get_gs_explain(rsp->fc_explain), rsp->fc_explain, status);
|
||||
ibmvfc_get_cmd_error(be16_to_cpu(rsp->status), be16_to_cpu(rsp->error)),
|
||||
rsp->status, rsp->error, ibmvfc_get_fc_type(be16_to_cpu(rsp->fc_type)),
|
||||
rsp->fc_type, ibmvfc_get_gs_explain(be16_to_cpu(rsp->fc_explain)),
|
||||
rsp->fc_explain, status);
|
||||
break;
|
||||
};
|
||||
|
||||
|
|
@ -3897,10 +3901,10 @@ static void ibmvfc_tgt_query_target(struct ibmvfc_target *tgt)
|
|||
ibmvfc_init_event(evt, ibmvfc_tgt_query_target_done, IBMVFC_MAD_FORMAT);
|
||||
query_tgt = &evt->iu.query_tgt;
|
||||
memset(query_tgt, 0, sizeof(*query_tgt));
|
||||
query_tgt->common.version = 1;
|
||||
query_tgt->common.opcode = IBMVFC_QUERY_TARGET;
|
||||
query_tgt->common.length = sizeof(*query_tgt);
|
||||
query_tgt->wwpn = tgt->ids.port_name;
|
||||
query_tgt->common.version = cpu_to_be32(1);
|
||||
query_tgt->common.opcode = cpu_to_be32(IBMVFC_QUERY_TARGET);
|
||||
query_tgt->common.length = cpu_to_be16(sizeof(*query_tgt));
|
||||
query_tgt->wwpn = cpu_to_be64(tgt->ids.port_name);
|
||||
|
||||
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_INIT_WAIT);
|
||||
if (ibmvfc_send_event(evt, vhost, default_timeout)) {
|
||||
|
|
@ -3971,7 +3975,8 @@ static int ibmvfc_alloc_targets(struct ibmvfc_host *vhost)
|
|||
|
||||
for (i = 0, rc = 0; !rc && i < vhost->num_targets; i++)
|
||||
rc = ibmvfc_alloc_target(vhost,
|
||||
vhost->disc_buf->scsi_id[i] & IBMVFC_DISC_TGT_SCSI_ID_MASK);
|
||||
be32_to_cpu(vhost->disc_buf->scsi_id[i]) &
|
||||
IBMVFC_DISC_TGT_SCSI_ID_MASK);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -3985,19 +3990,20 @@ static void ibmvfc_discover_targets_done(struct ibmvfc_event *evt)
|
|||
{
|
||||
struct ibmvfc_host *vhost = evt->vhost;
|
||||
struct ibmvfc_discover_targets *rsp = &evt->xfer_iu->discover_targets;
|
||||
u32 mad_status = rsp->common.status;
|
||||
u32 mad_status = be16_to_cpu(rsp->common.status);
|
||||
int level = IBMVFC_DEFAULT_LOG_LEVEL;
|
||||
|
||||
switch (mad_status) {
|
||||
case IBMVFC_MAD_SUCCESS:
|
||||
ibmvfc_dbg(vhost, "Discover Targets succeeded\n");
|
||||
vhost->num_targets = rsp->num_written;
|
||||
vhost->num_targets = be32_to_cpu(rsp->num_written);
|
||||
ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_ALLOC_TGTS);
|
||||
break;
|
||||
case IBMVFC_MAD_FAILED:
|
||||
level += ibmvfc_retry_host_init(vhost);
|
||||
ibmvfc_log(vhost, level, "Discover Targets failed: %s (%x:%x)\n",
|
||||
ibmvfc_get_cmd_error(rsp->status, rsp->error), rsp->status, rsp->error);
|
||||
ibmvfc_get_cmd_error(be16_to_cpu(rsp->status), be16_to_cpu(rsp->error)),
|
||||
rsp->status, rsp->error);
|
||||
break;
|
||||
case IBMVFC_MAD_DRIVER_FAILED:
|
||||
break;
|
||||
|
|
@ -4024,12 +4030,12 @@ static void ibmvfc_discover_targets(struct ibmvfc_host *vhost)
|
|||
ibmvfc_init_event(evt, ibmvfc_discover_targets_done, IBMVFC_MAD_FORMAT);
|
||||
mad = &evt->iu.discover_targets;
|
||||
memset(mad, 0, sizeof(*mad));
|
||||
mad->common.version = 1;
|
||||
mad->common.opcode = IBMVFC_DISC_TARGETS;
|
||||
mad->common.length = sizeof(*mad);
|
||||
mad->bufflen = vhost->disc_buf_sz;
|
||||
mad->buffer.va = vhost->disc_buf_dma;
|
||||
mad->buffer.len = vhost->disc_buf_sz;
|
||||
mad->common.version = cpu_to_be32(1);
|
||||
mad->common.opcode = cpu_to_be32(IBMVFC_DISC_TARGETS);
|
||||
mad->common.length = cpu_to_be16(sizeof(*mad));
|
||||
mad->bufflen = cpu_to_be32(vhost->disc_buf_sz);
|
||||
mad->buffer.va = cpu_to_be64(vhost->disc_buf_dma);
|
||||
mad->buffer.len = cpu_to_be32(vhost->disc_buf_sz);
|
||||
ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_INIT_WAIT);
|
||||
|
||||
if (!ibmvfc_send_event(evt, vhost, default_timeout))
|
||||
|
|
@ -4046,7 +4052,7 @@ static void ibmvfc_discover_targets(struct ibmvfc_host *vhost)
|
|||
static void ibmvfc_npiv_login_done(struct ibmvfc_event *evt)
|
||||
{
|
||||
struct ibmvfc_host *vhost = evt->vhost;
|
||||
u32 mad_status = evt->xfer_iu->npiv_login.common.status;
|
||||
u32 mad_status = be16_to_cpu(evt->xfer_iu->npiv_login.common.status);
|
||||
struct ibmvfc_npiv_login_resp *rsp = &vhost->login_buf->resp;
|
||||
unsigned int npiv_max_sectors;
|
||||
int level = IBMVFC_DEFAULT_LOG_LEVEL;
|
||||
|
|
@ -4056,12 +4062,13 @@ static void ibmvfc_npiv_login_done(struct ibmvfc_event *evt)
|
|||
ibmvfc_free_event(evt);
|
||||
break;
|
||||
case IBMVFC_MAD_FAILED:
|
||||
if (ibmvfc_retry_cmd(rsp->status, rsp->error))
|
||||
if (ibmvfc_retry_cmd(be16_to_cpu(rsp->status), be16_to_cpu(rsp->error)))
|
||||
level += ibmvfc_retry_host_init(vhost);
|
||||
else
|
||||
ibmvfc_link_down(vhost, IBMVFC_LINK_DEAD);
|
||||
ibmvfc_log(vhost, level, "NPIV Login failed: %s (%x:%x)\n",
|
||||
ibmvfc_get_cmd_error(rsp->status, rsp->error), rsp->status, rsp->error);
|
||||
ibmvfc_get_cmd_error(be16_to_cpu(rsp->status), be16_to_cpu(rsp->error)),
|
||||
rsp->status, rsp->error);
|
||||
ibmvfc_free_event(evt);
|
||||
return;
|
||||
case IBMVFC_MAD_CRQ_ERROR:
|
||||
|
|
@ -4078,7 +4085,7 @@ static void ibmvfc_npiv_login_done(struct ibmvfc_event *evt)
|
|||
|
||||
vhost->client_migrated = 0;
|
||||
|
||||
if (!(rsp->flags & IBMVFC_NATIVE_FC)) {
|
||||
if (!(be32_to_cpu(rsp->flags) & IBMVFC_NATIVE_FC)) {
|
||||
dev_err(vhost->dev, "Virtual adapter does not support FC. %x\n",
|
||||
rsp->flags);
|
||||
ibmvfc_link_down(vhost, IBMVFC_LINK_DEAD);
|
||||
|
|
@ -4086,7 +4093,7 @@ static void ibmvfc_npiv_login_done(struct ibmvfc_event *evt)
|
|||
return;
|
||||
}
|
||||
|
||||
if (rsp->max_cmds <= IBMVFC_NUM_INTERNAL_REQ) {
|
||||
if (be32_to_cpu(rsp->max_cmds) <= IBMVFC_NUM_INTERNAL_REQ) {
|
||||
dev_err(vhost->dev, "Virtual adapter supported queue depth too small: %d\n",
|
||||
rsp->max_cmds);
|
||||
ibmvfc_link_down(vhost, IBMVFC_LINK_DEAD);
|
||||
|
|
@ -4095,27 +4102,27 @@ static void ibmvfc_npiv_login_done(struct ibmvfc_event *evt)
|
|||
}
|
||||
|
||||
vhost->logged_in = 1;
|
||||
npiv_max_sectors = min((uint)(rsp->max_dma_len >> 9), IBMVFC_MAX_SECTORS);
|
||||
npiv_max_sectors = min((uint)(be64_to_cpu(rsp->max_dma_len) >> 9), IBMVFC_MAX_SECTORS);
|
||||
dev_info(vhost->dev, "Host partition: %s, device: %s %s %s max sectors %u\n",
|
||||
rsp->partition_name, rsp->device_name, rsp->port_loc_code,
|
||||
rsp->drc_name, npiv_max_sectors);
|
||||
|
||||
fc_host_fabric_name(vhost->host) = rsp->node_name;
|
||||
fc_host_node_name(vhost->host) = rsp->node_name;
|
||||
fc_host_port_name(vhost->host) = rsp->port_name;
|
||||
fc_host_port_id(vhost->host) = rsp->scsi_id;
|
||||
fc_host_fabric_name(vhost->host) = be64_to_cpu(rsp->node_name);
|
||||
fc_host_node_name(vhost->host) = be64_to_cpu(rsp->node_name);
|
||||
fc_host_port_name(vhost->host) = be64_to_cpu(rsp->port_name);
|
||||
fc_host_port_id(vhost->host) = be64_to_cpu(rsp->scsi_id);
|
||||
fc_host_port_type(vhost->host) = FC_PORTTYPE_NPIV;
|
||||
fc_host_supported_classes(vhost->host) = 0;
|
||||
if (rsp->service_parms.class1_parms[0] & 0x80000000)
|
||||
if (be32_to_cpu(rsp->service_parms.class1_parms[0]) & 0x80000000)
|
||||
fc_host_supported_classes(vhost->host) |= FC_COS_CLASS1;
|
||||
if (rsp->service_parms.class2_parms[0] & 0x80000000)
|
||||
if (be32_to_cpu(rsp->service_parms.class2_parms[0]) & 0x80000000)
|
||||
fc_host_supported_classes(vhost->host) |= FC_COS_CLASS2;
|
||||
if (rsp->service_parms.class3_parms[0] & 0x80000000)
|
||||
if (be32_to_cpu(rsp->service_parms.class3_parms[0]) & 0x80000000)
|
||||
fc_host_supported_classes(vhost->host) |= FC_COS_CLASS3;
|
||||
fc_host_maxframe_size(vhost->host) =
|
||||
rsp->service_parms.common.bb_rcv_sz & 0x0fff;
|
||||
be16_to_cpu(rsp->service_parms.common.bb_rcv_sz) & 0x0fff;
|
||||
|
||||
vhost->host->can_queue = rsp->max_cmds - IBMVFC_NUM_INTERNAL_REQ;
|
||||
vhost->host->can_queue = be32_to_cpu(rsp->max_cmds) - IBMVFC_NUM_INTERNAL_REQ;
|
||||
vhost->host->max_sectors = npiv_max_sectors;
|
||||
ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_QUERY);
|
||||
wake_up(&vhost->work_wait_q);
|
||||
|
|
@ -4138,11 +4145,11 @@ static void ibmvfc_npiv_login(struct ibmvfc_host *vhost)
|
|||
memcpy(vhost->login_buf, &vhost->login_info, sizeof(vhost->login_info));
|
||||
mad = &evt->iu.npiv_login;
|
||||
memset(mad, 0, sizeof(struct ibmvfc_npiv_login_mad));
|
||||
mad->common.version = 1;
|
||||
mad->common.opcode = IBMVFC_NPIV_LOGIN;
|
||||
mad->common.length = sizeof(struct ibmvfc_npiv_login_mad);
|
||||
mad->buffer.va = vhost->login_buf_dma;
|
||||
mad->buffer.len = sizeof(*vhost->login_buf);
|
||||
mad->common.version = cpu_to_be32(1);
|
||||
mad->common.opcode = cpu_to_be32(IBMVFC_NPIV_LOGIN);
|
||||
mad->common.length = cpu_to_be16(sizeof(struct ibmvfc_npiv_login_mad));
|
||||
mad->buffer.va = cpu_to_be64(vhost->login_buf_dma);
|
||||
mad->buffer.len = cpu_to_be32(sizeof(*vhost->login_buf));
|
||||
|
||||
ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_INIT_WAIT);
|
||||
|
||||
|
|
@ -4160,7 +4167,7 @@ static void ibmvfc_npiv_login(struct ibmvfc_host *vhost)
|
|||
static void ibmvfc_npiv_logout_done(struct ibmvfc_event *evt)
|
||||
{
|
||||
struct ibmvfc_host *vhost = evt->vhost;
|
||||
u32 mad_status = evt->xfer_iu->npiv_logout.common.status;
|
||||
u32 mad_status = be16_to_cpu(evt->xfer_iu->npiv_logout.common.status);
|
||||
|
||||
ibmvfc_free_event(evt);
|
||||
|
||||
|
|
@ -4199,9 +4206,9 @@ static void ibmvfc_npiv_logout(struct ibmvfc_host *vhost)
|
|||
|
||||
mad = &evt->iu.npiv_logout;
|
||||
memset(mad, 0, sizeof(*mad));
|
||||
mad->common.version = 1;
|
||||
mad->common.opcode = IBMVFC_NPIV_LOGOUT;
|
||||
mad->common.length = sizeof(struct ibmvfc_npiv_logout_mad);
|
||||
mad->common.version = cpu_to_be32(1);
|
||||
mad->common.opcode = cpu_to_be32(IBMVFC_NPIV_LOGOUT);
|
||||
mad->common.length = cpu_to_be16(sizeof(struct ibmvfc_npiv_logout_mad));
|
||||
|
||||
ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_LOGO_WAIT);
|
||||
|
||||
|
|
@ -4343,14 +4350,14 @@ static void ibmvfc_tgt_add_rport(struct ibmvfc_target *tgt)
|
|||
if (rport) {
|
||||
tgt_dbg(tgt, "rport add succeeded\n");
|
||||
tgt->rport = rport;
|
||||
rport->maxframe_size = tgt->service_parms.common.bb_rcv_sz & 0x0fff;
|
||||
rport->maxframe_size = be16_to_cpu(tgt->service_parms.common.bb_rcv_sz) & 0x0fff;
|
||||
rport->supported_classes = 0;
|
||||
tgt->target_id = rport->scsi_target_id;
|
||||
if (tgt->service_parms.class1_parms[0] & 0x80000000)
|
||||
if (be32_to_cpu(tgt->service_parms.class1_parms[0]) & 0x80000000)
|
||||
rport->supported_classes |= FC_COS_CLASS1;
|
||||
if (tgt->service_parms.class2_parms[0] & 0x80000000)
|
||||
if (be32_to_cpu(tgt->service_parms.class2_parms[0]) & 0x80000000)
|
||||
rport->supported_classes |= FC_COS_CLASS2;
|
||||
if (tgt->service_parms.class3_parms[0] & 0x80000000)
|
||||
if (be32_to_cpu(tgt->service_parms.class3_parms[0]) & 0x80000000)
|
||||
rport->supported_classes |= FC_COS_CLASS3;
|
||||
if (rport->rqst_q)
|
||||
blk_queue_max_segments(rport->rqst_q, 1);
|
||||
|
|
|
|||
|
|
@ -135,12 +135,12 @@ enum ibmvfc_mad_types {
|
|||
};
|
||||
|
||||
struct ibmvfc_mad_common {
|
||||
u32 version;
|
||||
u32 reserved;
|
||||
u32 opcode;
|
||||
u16 status;
|
||||
u16 length;
|
||||
u64 tag;
|
||||
__be32 version;
|
||||
__be32 reserved;
|
||||
__be32 opcode;
|
||||
__be16 status;
|
||||
__be16 length;
|
||||
__be64 tag;
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
struct ibmvfc_npiv_login_mad {
|
||||
|
|
@ -155,76 +155,76 @@ struct ibmvfc_npiv_logout_mad {
|
|||
#define IBMVFC_MAX_NAME 256
|
||||
|
||||
struct ibmvfc_npiv_login {
|
||||
u32 ostype;
|
||||
__be32 ostype;
|
||||
#define IBMVFC_OS_LINUX 0x02
|
||||
u32 pad;
|
||||
u64 max_dma_len;
|
||||
u32 max_payload;
|
||||
u32 max_response;
|
||||
u32 partition_num;
|
||||
u32 vfc_frame_version;
|
||||
u16 fcp_version;
|
||||
u16 flags;
|
||||
__be32 pad;
|
||||
__be64 max_dma_len;
|
||||
__be32 max_payload;
|
||||
__be32 max_response;
|
||||
__be32 partition_num;
|
||||
__be32 vfc_frame_version;
|
||||
__be16 fcp_version;
|
||||
__be16 flags;
|
||||
#define IBMVFC_CLIENT_MIGRATED 0x01
|
||||
#define IBMVFC_FLUSH_ON_HALT 0x02
|
||||
u32 max_cmds;
|
||||
u64 capabilities;
|
||||
__be32 max_cmds;
|
||||
__be64 capabilities;
|
||||
#define IBMVFC_CAN_MIGRATE 0x01
|
||||
u64 node_name;
|
||||
__be64 node_name;
|
||||
struct srp_direct_buf async;
|
||||
u8 partition_name[IBMVFC_MAX_NAME];
|
||||
u8 device_name[IBMVFC_MAX_NAME];
|
||||
u8 drc_name[IBMVFC_MAX_NAME];
|
||||
u64 reserved2[2];
|
||||
__be64 reserved2[2];
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
struct ibmvfc_common_svc_parms {
|
||||
u16 fcph_version;
|
||||
u16 b2b_credit;
|
||||
u16 features;
|
||||
u16 bb_rcv_sz; /* upper nibble is BB_SC_N */
|
||||
u32 ratov;
|
||||
u32 edtov;
|
||||
__be16 fcph_version;
|
||||
__be16 b2b_credit;
|
||||
__be16 features;
|
||||
__be16 bb_rcv_sz; /* upper nibble is BB_SC_N */
|
||||
__be32 ratov;
|
||||
__be32 edtov;
|
||||
}__attribute__((packed, aligned (4)));
|
||||
|
||||
struct ibmvfc_service_parms {
|
||||
struct ibmvfc_common_svc_parms common;
|
||||
u8 port_name[8];
|
||||
u8 node_name[8];
|
||||
u32 class1_parms[4];
|
||||
u32 class2_parms[4];
|
||||
u32 class3_parms[4];
|
||||
u32 obsolete[4];
|
||||
u32 vendor_version[4];
|
||||
u32 services_avail[2];
|
||||
u32 ext_len;
|
||||
u32 reserved[30];
|
||||
u32 clk_sync_qos[2];
|
||||
__be32 class1_parms[4];
|
||||
__be32 class2_parms[4];
|
||||
__be32 class3_parms[4];
|
||||
__be32 obsolete[4];
|
||||
__be32 vendor_version[4];
|
||||
__be32 services_avail[2];
|
||||
__be32 ext_len;
|
||||
__be32 reserved[30];
|
||||
__be32 clk_sync_qos[2];
|
||||
}__attribute__((packed, aligned (4)));
|
||||
|
||||
struct ibmvfc_npiv_login_resp {
|
||||
u32 version;
|
||||
u16 status;
|
||||
u16 error;
|
||||
u32 flags;
|
||||
__be32 version;
|
||||
__be16 status;
|
||||
__be16 error;
|
||||
__be32 flags;
|
||||
#define IBMVFC_NATIVE_FC 0x01
|
||||
u32 reserved;
|
||||
u64 capabilities;
|
||||
__be32 reserved;
|
||||
__be64 capabilities;
|
||||
#define IBMVFC_CAN_FLUSH_ON_HALT 0x08
|
||||
#define IBMVFC_CAN_SUPPRESS_ABTS 0x10
|
||||
u32 max_cmds;
|
||||
u32 scsi_id_sz;
|
||||
u64 max_dma_len;
|
||||
u64 scsi_id;
|
||||
u64 port_name;
|
||||
u64 node_name;
|
||||
u64 link_speed;
|
||||
__be32 max_cmds;
|
||||
__be32 scsi_id_sz;
|
||||
__be64 max_dma_len;
|
||||
__be64 scsi_id;
|
||||
__be64 port_name;
|
||||
__be64 node_name;
|
||||
__be64 link_speed;
|
||||
u8 partition_name[IBMVFC_MAX_NAME];
|
||||
u8 device_name[IBMVFC_MAX_NAME];
|
||||
u8 port_loc_code[IBMVFC_MAX_NAME];
|
||||
u8 drc_name[IBMVFC_MAX_NAME];
|
||||
struct ibmvfc_service_parms service_parms;
|
||||
u64 reserved2;
|
||||
__be64 reserved2;
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
union ibmvfc_npiv_login_data {
|
||||
|
|
@ -233,20 +233,20 @@ union ibmvfc_npiv_login_data {
|
|||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
struct ibmvfc_discover_targets_buf {
|
||||
u32 scsi_id[1];
|
||||
__be32 scsi_id[1];
|
||||
#define IBMVFC_DISC_TGT_SCSI_ID_MASK 0x00ffffff
|
||||
};
|
||||
|
||||
struct ibmvfc_discover_targets {
|
||||
struct ibmvfc_mad_common common;
|
||||
struct srp_direct_buf buffer;
|
||||
u32 flags;
|
||||
u16 status;
|
||||
u16 error;
|
||||
u32 bufflen;
|
||||
u32 num_avail;
|
||||
u32 num_written;
|
||||
u64 reserved[2];
|
||||
__be32 flags;
|
||||
__be16 status;
|
||||
__be16 error;
|
||||
__be32 bufflen;
|
||||
__be32 num_avail;
|
||||
__be32 num_written;
|
||||
__be64 reserved[2];
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
enum ibmvfc_fc_reason {
|
||||
|
|
@ -278,32 +278,32 @@ enum ibmvfc_gs_explain {
|
|||
|
||||
struct ibmvfc_port_login {
|
||||
struct ibmvfc_mad_common common;
|
||||
u64 scsi_id;
|
||||
u16 reserved;
|
||||
u16 fc_service_class;
|
||||
u32 blksz;
|
||||
u32 hdr_per_blk;
|
||||
u16 status;
|
||||
u16 error; /* also fc_reason */
|
||||
u16 fc_explain;
|
||||
u16 fc_type;
|
||||
u32 reserved2;
|
||||
__be64 scsi_id;
|
||||
__be16 reserved;
|
||||
__be16 fc_service_class;
|
||||
__be32 blksz;
|
||||
__be32 hdr_per_blk;
|
||||
__be16 status;
|
||||
__be16 error; /* also fc_reason */
|
||||
__be16 fc_explain;
|
||||
__be16 fc_type;
|
||||
__be32 reserved2;
|
||||
struct ibmvfc_service_parms service_parms;
|
||||
struct ibmvfc_service_parms service_parms_change;
|
||||
u64 reserved3[2];
|
||||
__be64 reserved3[2];
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
struct ibmvfc_prli_svc_parms {
|
||||
u8 type;
|
||||
#define IBMVFC_SCSI_FCP_TYPE 0x08
|
||||
u8 type_ext;
|
||||
u16 flags;
|
||||
__be16 flags;
|
||||
#define IBMVFC_PRLI_ORIG_PA_VALID 0x8000
|
||||
#define IBMVFC_PRLI_RESP_PA_VALID 0x4000
|
||||
#define IBMVFC_PRLI_EST_IMG_PAIR 0x2000
|
||||
u32 orig_pa;
|
||||
u32 resp_pa;
|
||||
u32 service_parms;
|
||||
__be32 orig_pa;
|
||||
__be32 resp_pa;
|
||||
__be32 service_parms;
|
||||
#define IBMVFC_PRLI_TASK_RETRY 0x00000200
|
||||
#define IBMVFC_PRLI_RETRY 0x00000100
|
||||
#define IBMVFC_PRLI_DATA_OVERLAY 0x00000040
|
||||
|
|
@ -315,47 +315,47 @@ struct ibmvfc_prli_svc_parms {
|
|||
|
||||
struct ibmvfc_process_login {
|
||||
struct ibmvfc_mad_common common;
|
||||
u64 scsi_id;
|
||||
__be64 scsi_id;
|
||||
struct ibmvfc_prli_svc_parms parms;
|
||||
u8 reserved[48];
|
||||
u16 status;
|
||||
u16 error; /* also fc_reason */
|
||||
u32 reserved2;
|
||||
u64 reserved3[2];
|
||||
__be16 status;
|
||||
__be16 error; /* also fc_reason */
|
||||
__be32 reserved2;
|
||||
__be64 reserved3[2];
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
struct ibmvfc_query_tgt {
|
||||
struct ibmvfc_mad_common common;
|
||||
u64 wwpn;
|
||||
u64 scsi_id;
|
||||
u16 status;
|
||||
u16 error;
|
||||
u16 fc_explain;
|
||||
u16 fc_type;
|
||||
u64 reserved[2];
|
||||
__be64 wwpn;
|
||||
__be64 scsi_id;
|
||||
__be16 status;
|
||||
__be16 error;
|
||||
__be16 fc_explain;
|
||||
__be16 fc_type;
|
||||
__be64 reserved[2];
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
struct ibmvfc_implicit_logout {
|
||||
struct ibmvfc_mad_common common;
|
||||
u64 old_scsi_id;
|
||||
u64 reserved[2];
|
||||
__be64 old_scsi_id;
|
||||
__be64 reserved[2];
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
struct ibmvfc_tmf {
|
||||
struct ibmvfc_mad_common common;
|
||||
u64 scsi_id;
|
||||
__be64 scsi_id;
|
||||
struct scsi_lun lun;
|
||||
u32 flags;
|
||||
__be32 flags;
|
||||
#define IBMVFC_TMF_ABORT_TASK 0x02
|
||||
#define IBMVFC_TMF_ABORT_TASK_SET 0x04
|
||||
#define IBMVFC_TMF_LUN_RESET 0x10
|
||||
#define IBMVFC_TMF_TGT_RESET 0x20
|
||||
#define IBMVFC_TMF_LUA_VALID 0x40
|
||||
#define IBMVFC_TMF_SUPPRESS_ABTS 0x80
|
||||
u32 cancel_key;
|
||||
u32 my_cancel_key;
|
||||
u32 pad;
|
||||
u64 reserved[2];
|
||||
__be32 cancel_key;
|
||||
__be32 my_cancel_key;
|
||||
__be32 pad;
|
||||
__be64 reserved[2];
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
enum ibmvfc_fcp_rsp_info_codes {
|
||||
|
|
@ -366,7 +366,7 @@ enum ibmvfc_fcp_rsp_info_codes {
|
|||
};
|
||||
|
||||
struct ibmvfc_fcp_rsp_info {
|
||||
u16 reserved;
|
||||
__be16 reserved;
|
||||
u8 rsp_code;
|
||||
u8 reserved2[4];
|
||||
}__attribute__((packed, aligned (2)));
|
||||
|
|
@ -388,13 +388,13 @@ union ibmvfc_fcp_rsp_data {
|
|||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
struct ibmvfc_fcp_rsp {
|
||||
u64 reserved;
|
||||
u16 retry_delay_timer;
|
||||
__be64 reserved;
|
||||
__be16 retry_delay_timer;
|
||||
u8 flags;
|
||||
u8 scsi_status;
|
||||
u32 fcp_resid;
|
||||
u32 fcp_sense_len;
|
||||
u32 fcp_rsp_len;
|
||||
__be32 fcp_resid;
|
||||
__be32 fcp_sense_len;
|
||||
__be32 fcp_rsp_len;
|
||||
union ibmvfc_fcp_rsp_data data;
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
|
|
@ -429,58 +429,58 @@ struct ibmvfc_fcp_cmd_iu {
|
|||
#define IBMVFC_RDDATA 0x02
|
||||
#define IBMVFC_WRDATA 0x01
|
||||
u8 cdb[IBMVFC_MAX_CDB_LEN];
|
||||
u32 xfer_len;
|
||||
__be32 xfer_len;
|
||||
}__attribute__((packed, aligned (4)));
|
||||
|
||||
struct ibmvfc_cmd {
|
||||
u64 task_tag;
|
||||
u32 frame_type;
|
||||
u32 payload_len;
|
||||
u32 resp_len;
|
||||
u32 adapter_resid;
|
||||
u16 status;
|
||||
u16 error;
|
||||
u16 flags;
|
||||
u16 response_flags;
|
||||
__be64 task_tag;
|
||||
__be32 frame_type;
|
||||
__be32 payload_len;
|
||||
__be32 resp_len;
|
||||
__be32 adapter_resid;
|
||||
__be16 status;
|
||||
__be16 error;
|
||||
__be16 flags;
|
||||
__be16 response_flags;
|
||||
#define IBMVFC_ADAPTER_RESID_VALID 0x01
|
||||
u32 cancel_key;
|
||||
u32 exchange_id;
|
||||
__be32 cancel_key;
|
||||
__be32 exchange_id;
|
||||
struct srp_direct_buf ext_func;
|
||||
struct srp_direct_buf ioba;
|
||||
struct srp_direct_buf resp;
|
||||
u64 correlation;
|
||||
u64 tgt_scsi_id;
|
||||
u64 tag;
|
||||
u64 reserved3[2];
|
||||
__be64 correlation;
|
||||
__be64 tgt_scsi_id;
|
||||
__be64 tag;
|
||||
__be64 reserved3[2];
|
||||
struct ibmvfc_fcp_cmd_iu iu;
|
||||
struct ibmvfc_fcp_rsp rsp;
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
struct ibmvfc_passthru_fc_iu {
|
||||
u32 payload[7];
|
||||
__be32 payload[7];
|
||||
#define IBMVFC_ADISC 0x52000000
|
||||
u32 response[7];
|
||||
__be32 response[7];
|
||||
};
|
||||
|
||||
struct ibmvfc_passthru_iu {
|
||||
u64 task_tag;
|
||||
u32 cmd_len;
|
||||
u32 rsp_len;
|
||||
u16 status;
|
||||
u16 error;
|
||||
u32 flags;
|
||||
__be64 task_tag;
|
||||
__be32 cmd_len;
|
||||
__be32 rsp_len;
|
||||
__be16 status;
|
||||
__be16 error;
|
||||
__be32 flags;
|
||||
#define IBMVFC_FC_ELS 0x01
|
||||
#define IBMVFC_FC_CT_IU 0x02
|
||||
u32 cancel_key;
|
||||
__be32 cancel_key;
|
||||
#define IBMVFC_PASSTHRU_CANCEL_KEY 0x80000000
|
||||
#define IBMVFC_INTERNAL_CANCEL_KEY 0x80000001
|
||||
u32 reserved;
|
||||
__be32 reserved;
|
||||
struct srp_direct_buf cmd;
|
||||
struct srp_direct_buf rsp;
|
||||
u64 correlation;
|
||||
u64 scsi_id;
|
||||
u64 tag;
|
||||
u64 reserved2[2];
|
||||
__be64 correlation;
|
||||
__be64 scsi_id;
|
||||
__be64 tag;
|
||||
__be64 reserved2[2];
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
struct ibmvfc_passthru_mad {
|
||||
|
|
@ -552,7 +552,7 @@ struct ibmvfc_crq {
|
|||
volatile u8 valid;
|
||||
volatile u8 format;
|
||||
u8 reserved[6];
|
||||
volatile u64 ioba;
|
||||
volatile __be64 ioba;
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
struct ibmvfc_crq_queue {
|
||||
|
|
@ -572,12 +572,12 @@ struct ibmvfc_async_crq {
|
|||
volatile u8 valid;
|
||||
u8 link_state;
|
||||
u8 pad[2];
|
||||
u32 pad2;
|
||||
volatile u64 event;
|
||||
volatile u64 scsi_id;
|
||||
volatile u64 wwpn;
|
||||
volatile u64 node_name;
|
||||
u64 reserved;
|
||||
__be32 pad2;
|
||||
volatile __be64 event;
|
||||
volatile __be64 scsi_id;
|
||||
volatile __be64 wwpn;
|
||||
volatile __be64 node_name;
|
||||
__be64 reserved;
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
struct ibmvfc_async_crq_queue {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -2251,14 +2251,14 @@ static int in2000_show_info(struct seq_file *m, struct Scsi_Host *instance)
|
|||
seq_printf(m, "\nconnected: ");
|
||||
if (hd->connected) {
|
||||
cmd = (Scsi_Cmnd *) hd->connected;
|
||||
seq_printf(m, " %d:%d(%02x)", cmd->device->id, cmd->device->lun, cmd->cmnd[0]);
|
||||
seq_printf(m, " %d:%llu(%02x)", cmd->device->id, cmd->device->lun, cmd->cmnd[0]);
|
||||
}
|
||||
}
|
||||
if (hd->proc & PR_INPUTQ) {
|
||||
seq_printf(m, "\ninput_Q: ");
|
||||
cmd = (Scsi_Cmnd *) hd->input_Q;
|
||||
while (cmd) {
|
||||
seq_printf(m, " %d:%d(%02x)", cmd->device->id, cmd->device->lun, cmd->cmnd[0]);
|
||||
seq_printf(m, " %d:%llu(%02x)", cmd->device->id, cmd->device->lun, cmd->cmnd[0]);
|
||||
cmd = (Scsi_Cmnd *) cmd->host_scribble;
|
||||
}
|
||||
}
|
||||
|
|
@ -2266,7 +2266,7 @@ static int in2000_show_info(struct seq_file *m, struct Scsi_Host *instance)
|
|||
seq_printf(m, "\ndisconnected_Q:");
|
||||
cmd = (Scsi_Cmnd *) hd->disconnected_Q;
|
||||
while (cmd) {
|
||||
seq_printf(m, " %d:%d(%02x)", cmd->device->id, cmd->device->lun, cmd->cmnd[0]);
|
||||
seq_printf(m, " %d:%llu(%02x)", cmd->device->id, cmd->device->lun, cmd->cmnd[0]);
|
||||
cmd = (Scsi_Cmnd *) cmd->host_scribble;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ static int isci_setup_interrupts(struct pci_dev *pdev)
|
|||
for (i = 0; i < num_msix; i++)
|
||||
pci_info->msix_entries[i].entry = i;
|
||||
|
||||
err = pci_enable_msix(pdev, pci_info->msix_entries, num_msix);
|
||||
err = pci_enable_msix_exact(pdev, pci_info->msix_entries, num_msix);
|
||||
if (err)
|
||||
goto intx;
|
||||
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ static int iscsi_check_tmf_restrictions(struct iscsi_task *task, int opcode)
|
|||
{
|
||||
struct iscsi_conn *conn = task->conn;
|
||||
struct iscsi_tm *tmf = &conn->tmhdr;
|
||||
unsigned int hdr_lun;
|
||||
u64 hdr_lun;
|
||||
|
||||
if (conn->tmf_state == TMF_INITIAL)
|
||||
return 0;
|
||||
|
|
@ -1859,8 +1859,7 @@ static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn,
|
|||
* Fail commands. session lock held and recv side suspended and xmit
|
||||
* thread flushed
|
||||
*/
|
||||
static void fail_scsi_tasks(struct iscsi_conn *conn, unsigned lun,
|
||||
int error)
|
||||
static void fail_scsi_tasks(struct iscsi_conn *conn, u64 lun, int error)
|
||||
{
|
||||
struct iscsi_task *task;
|
||||
int i;
|
||||
|
|
@ -2279,7 +2278,8 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc)
|
|||
cls_session = starget_to_session(scsi_target(sc->device));
|
||||
session = cls_session->dd_data;
|
||||
|
||||
ISCSI_DBG_EH(session, "LU Reset [sc %p lun %u]\n", sc, sc->device->lun);
|
||||
ISCSI_DBG_EH(session, "LU Reset [sc %p lun %llu]\n", sc,
|
||||
sc->device->lun);
|
||||
|
||||
mutex_lock(&session->eh_mutex);
|
||||
spin_lock_bh(&session->frwd_lock);
|
||||
|
|
@ -2971,7 +2971,7 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
|
|||
*/
|
||||
for (;;) {
|
||||
spin_lock_irqsave(session->host->host_lock, flags);
|
||||
if (!session->host->host_busy) { /* OK for ERL == 0 */
|
||||
if (!atomic_read(&session->host->host_busy)) { /* OK for ERL == 0 */
|
||||
spin_unlock_irqrestore(session->host->host_lock, flags);
|
||||
break;
|
||||
}
|
||||
|
|
@ -2979,7 +2979,7 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
|
|||
msleep_interruptible(500);
|
||||
iscsi_conn_printk(KERN_INFO, conn, "iscsi conn_destroy(): "
|
||||
"host_busy %d host_failed %d\n",
|
||||
session->host->host_busy,
|
||||
atomic_read(&session->host->host_busy),
|
||||
session->host->host_failed);
|
||||
/*
|
||||
* force eh_abort() to unblock
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@ static int sas_recover_lu(struct domain_device *dev, struct scsi_cmnd *cmd)
|
|||
|
||||
int_to_scsilun(cmd->device->lun, &lun);
|
||||
|
||||
SAS_DPRINTK("eh: device %llx LUN %x has the task\n",
|
||||
SAS_DPRINTK("eh: device %llx LUN %llx has the task\n",
|
||||
SAS_ADDR(dev->sas_addr),
|
||||
cmd->device->lun);
|
||||
|
||||
|
|
@ -490,7 +490,8 @@ static void sas_wait_eh(struct domain_device *dev)
|
|||
}
|
||||
EXPORT_SYMBOL(sas_wait_eh);
|
||||
|
||||
static int sas_queue_reset(struct domain_device *dev, int reset_type, int lun, int wait)
|
||||
static int sas_queue_reset(struct domain_device *dev, int reset_type,
|
||||
u64 lun, int wait)
|
||||
{
|
||||
struct sas_ha_struct *ha = dev->port->ha;
|
||||
int scheduled = 0, tries = 100;
|
||||
|
|
@ -689,7 +690,7 @@ static void sas_eh_handle_sas_errors(struct Scsi_Host *shost, struct list_head *
|
|||
reset:
|
||||
tmf_resp = sas_recover_lu(task->dev, cmd);
|
||||
if (tmf_resp == TMF_RESP_FUNC_COMPLETE) {
|
||||
SAS_DPRINTK("dev %016llx LU %x is "
|
||||
SAS_DPRINTK("dev %016llx LU %llx is "
|
||||
"recovered\n",
|
||||
SAS_ADDR(task->dev),
|
||||
cmd->device->lun);
|
||||
|
|
@ -742,7 +743,7 @@ static void sas_eh_handle_sas_errors(struct Scsi_Host *shost, struct list_head *
|
|||
* of effort could recover from errors. Quite
|
||||
* possibly the HA just disappeared.
|
||||
*/
|
||||
SAS_DPRINTK("error from device %llx, LUN %x "
|
||||
SAS_DPRINTK("error from device %llx, LUN %llx "
|
||||
"couldn't be recovered in any way\n",
|
||||
SAS_ADDR(task->dev->sas_addr),
|
||||
cmd->device->lun);
|
||||
|
|
@ -812,7 +813,7 @@ retry:
|
|||
spin_unlock_irq(shost->host_lock);
|
||||
|
||||
SAS_DPRINTK("Enter %s busy: %d failed: %d\n",
|
||||
__func__, shost->host_busy, shost->host_failed);
|
||||
__func__, atomic_read(&shost->host_busy), shost->host_failed);
|
||||
/*
|
||||
* Deal with commands that still have SAS tasks (i.e. they didn't
|
||||
* complete via the normal sas_task completion mechanism),
|
||||
|
|
@ -857,7 +858,8 @@ out:
|
|||
goto retry;
|
||||
|
||||
SAS_DPRINTK("--- Exit %s: busy: %d failed: %d tries: %d\n",
|
||||
__func__, shost->host_busy, shost->host_failed, tries);
|
||||
__func__, atomic_read(&shost->host_busy),
|
||||
shost->host_failed, tries);
|
||||
}
|
||||
|
||||
enum blk_eh_timer_return sas_scsi_timed_out(struct scsi_cmnd *cmd)
|
||||
|
|
@ -941,7 +943,7 @@ int sas_slave_configure(struct scsi_device *scsi_dev)
|
|||
scsi_set_tag_type(scsi_dev, MSG_SIMPLE_TAG);
|
||||
scsi_activate_tcq(scsi_dev, SAS_DEF_QD);
|
||||
} else {
|
||||
SAS_DPRINTK("device %llx, LUN %x doesn't support "
|
||||
SAS_DPRINTK("device %llx, LUN %llx doesn't support "
|
||||
"TCQ\n", SAS_ADDR(dev->sas_addr),
|
||||
scsi_dev->lun);
|
||||
scsi_dev->tagged_supported = 0;
|
||||
|
|
|
|||
|
|
@ -1,447 +0,0 @@
|
|||
/*
|
||||
* SCSI RDMA Protocol lib functions
|
||||
*
|
||||
* Copyright (C) 2006 FUJITA Tomonori <tomof@acm.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
#include <linux/err.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/kfifo.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/module.h>
|
||||
#include <scsi/scsi.h>
|
||||
#include <scsi/scsi_cmnd.h>
|
||||
#include <scsi/scsi_tcq.h>
|
||||
#include <scsi/scsi_tgt.h>
|
||||
#include <scsi/srp.h>
|
||||
#include <scsi/libsrp.h>
|
||||
|
||||
enum srp_task_attributes {
|
||||
SRP_SIMPLE_TASK = 0,
|
||||
SRP_HEAD_TASK = 1,
|
||||
SRP_ORDERED_TASK = 2,
|
||||
SRP_ACA_TASK = 4
|
||||
};
|
||||
|
||||
/* tmp - will replace with SCSI logging stuff */
|
||||
#define eprintk(fmt, args...) \
|
||||
do { \
|
||||
printk("%s(%d) " fmt, __func__, __LINE__, ##args); \
|
||||
} while (0)
|
||||
/* #define dprintk eprintk */
|
||||
#define dprintk(fmt, args...)
|
||||
|
||||
static int srp_iu_pool_alloc(struct srp_queue *q, size_t max,
|
||||
struct srp_buf **ring)
|
||||
{
|
||||
int i;
|
||||
struct iu_entry *iue;
|
||||
|
||||
q->pool = kcalloc(max, sizeof(struct iu_entry *), GFP_KERNEL);
|
||||
if (!q->pool)
|
||||
return -ENOMEM;
|
||||
q->items = kcalloc(max, sizeof(struct iu_entry), GFP_KERNEL);
|
||||
if (!q->items)
|
||||
goto free_pool;
|
||||
|
||||
spin_lock_init(&q->lock);
|
||||
kfifo_init(&q->queue, (void *) q->pool, max * sizeof(void *));
|
||||
|
||||
for (i = 0, iue = q->items; i < max; i++) {
|
||||
kfifo_in(&q->queue, (void *) &iue, sizeof(void *));
|
||||
iue->sbuf = ring[i];
|
||||
iue++;
|
||||
}
|
||||
return 0;
|
||||
|
||||
kfree(q->items);
|
||||
free_pool:
|
||||
kfree(q->pool);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
static void srp_iu_pool_free(struct srp_queue *q)
|
||||
{
|
||||
kfree(q->items);
|
||||
kfree(q->pool);
|
||||
}
|
||||
|
||||
static struct srp_buf **srp_ring_alloc(struct device *dev,
|
||||
size_t max, size_t size)
|
||||
{
|
||||
int i;
|
||||
struct srp_buf **ring;
|
||||
|
||||
ring = kcalloc(max, sizeof(struct srp_buf *), GFP_KERNEL);
|
||||
if (!ring)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < max; i++) {
|
||||
ring[i] = kzalloc(sizeof(struct srp_buf), GFP_KERNEL);
|
||||
if (!ring[i])
|
||||
goto out;
|
||||
ring[i]->buf = dma_alloc_coherent(dev, size, &ring[i]->dma,
|
||||
GFP_KERNEL);
|
||||
if (!ring[i]->buf)
|
||||
goto out;
|
||||
}
|
||||
return ring;
|
||||
|
||||
out:
|
||||
for (i = 0; i < max && ring[i]; i++) {
|
||||
if (ring[i]->buf)
|
||||
dma_free_coherent(dev, size, ring[i]->buf, ring[i]->dma);
|
||||
kfree(ring[i]);
|
||||
}
|
||||
kfree(ring);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void srp_ring_free(struct device *dev, struct srp_buf **ring, size_t max,
|
||||
size_t size)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < max; i++) {
|
||||
dma_free_coherent(dev, size, ring[i]->buf, ring[i]->dma);
|
||||
kfree(ring[i]);
|
||||
}
|
||||
kfree(ring);
|
||||
}
|
||||
|
||||
int srp_target_alloc(struct srp_target *target, struct device *dev,
|
||||
size_t nr, size_t iu_size)
|
||||
{
|
||||
int err;
|
||||
|
||||
spin_lock_init(&target->lock);
|
||||
INIT_LIST_HEAD(&target->cmd_queue);
|
||||
|
||||
target->dev = dev;
|
||||
dev_set_drvdata(target->dev, target);
|
||||
|
||||
target->srp_iu_size = iu_size;
|
||||
target->rx_ring_size = nr;
|
||||
target->rx_ring = srp_ring_alloc(target->dev, nr, iu_size);
|
||||
if (!target->rx_ring)
|
||||
return -ENOMEM;
|
||||
err = srp_iu_pool_alloc(&target->iu_queue, nr, target->rx_ring);
|
||||
if (err)
|
||||
goto free_ring;
|
||||
|
||||
return 0;
|
||||
|
||||
free_ring:
|
||||
srp_ring_free(target->dev, target->rx_ring, nr, iu_size);
|
||||
return -ENOMEM;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(srp_target_alloc);
|
||||
|
||||
void srp_target_free(struct srp_target *target)
|
||||
{
|
||||
srp_ring_free(target->dev, target->rx_ring, target->rx_ring_size,
|
||||
target->srp_iu_size);
|
||||
srp_iu_pool_free(&target->iu_queue);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(srp_target_free);
|
||||
|
||||
struct iu_entry *srp_iu_get(struct srp_target *target)
|
||||
{
|
||||
struct iu_entry *iue = NULL;
|
||||
|
||||
if (kfifo_out_locked(&target->iu_queue.queue, (void *) &iue,
|
||||
sizeof(void *), &target->iu_queue.lock) != sizeof(void *)) {
|
||||
WARN_ONCE(1, "unexpected fifo state");
|
||||
return NULL;
|
||||
}
|
||||
if (!iue)
|
||||
return iue;
|
||||
iue->target = target;
|
||||
INIT_LIST_HEAD(&iue->ilist);
|
||||
iue->flags = 0;
|
||||
return iue;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(srp_iu_get);
|
||||
|
||||
void srp_iu_put(struct iu_entry *iue)
|
||||
{
|
||||
kfifo_in_locked(&iue->target->iu_queue.queue, (void *) &iue,
|
||||
sizeof(void *), &iue->target->iu_queue.lock);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(srp_iu_put);
|
||||
|
||||
static int srp_direct_data(struct scsi_cmnd *sc, struct srp_direct_buf *md,
|
||||
enum dma_data_direction dir, srp_rdma_t rdma_io,
|
||||
int dma_map, int ext_desc)
|
||||
{
|
||||
struct iu_entry *iue = NULL;
|
||||
struct scatterlist *sg = NULL;
|
||||
int err, nsg = 0, len;
|
||||
|
||||
if (dma_map) {
|
||||
iue = (struct iu_entry *) sc->SCp.ptr;
|
||||
sg = scsi_sglist(sc);
|
||||
|
||||
dprintk("%p %u %u %d\n", iue, scsi_bufflen(sc),
|
||||
md->len, scsi_sg_count(sc));
|
||||
|
||||
nsg = dma_map_sg(iue->target->dev, sg, scsi_sg_count(sc),
|
||||
DMA_BIDIRECTIONAL);
|
||||
if (!nsg) {
|
||||
printk("fail to map %p %d\n", iue, scsi_sg_count(sc));
|
||||
return 0;
|
||||
}
|
||||
len = min(scsi_bufflen(sc), md->len);
|
||||
} else
|
||||
len = md->len;
|
||||
|
||||
err = rdma_io(sc, sg, nsg, md, 1, dir, len);
|
||||
|
||||
if (dma_map)
|
||||
dma_unmap_sg(iue->target->dev, sg, nsg, DMA_BIDIRECTIONAL);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int srp_indirect_data(struct scsi_cmnd *sc, struct srp_cmd *cmd,
|
||||
struct srp_indirect_buf *id,
|
||||
enum dma_data_direction dir, srp_rdma_t rdma_io,
|
||||
int dma_map, int ext_desc)
|
||||
{
|
||||
struct iu_entry *iue = NULL;
|
||||
struct srp_direct_buf *md = NULL;
|
||||
struct scatterlist dummy, *sg = NULL;
|
||||
dma_addr_t token = 0;
|
||||
int err = 0;
|
||||
int nmd, nsg = 0, len;
|
||||
|
||||
if (dma_map || ext_desc) {
|
||||
iue = (struct iu_entry *) sc->SCp.ptr;
|
||||
sg = scsi_sglist(sc);
|
||||
|
||||
dprintk("%p %u %u %d %d\n",
|
||||
iue, scsi_bufflen(sc), id->len,
|
||||
cmd->data_in_desc_cnt, cmd->data_out_desc_cnt);
|
||||
}
|
||||
|
||||
nmd = id->table_desc.len / sizeof(struct srp_direct_buf);
|
||||
|
||||
if ((dir == DMA_FROM_DEVICE && nmd == cmd->data_in_desc_cnt) ||
|
||||
(dir == DMA_TO_DEVICE && nmd == cmd->data_out_desc_cnt)) {
|
||||
md = &id->desc_list[0];
|
||||
goto rdma;
|
||||
}
|
||||
|
||||
if (ext_desc && dma_map) {
|
||||
md = dma_alloc_coherent(iue->target->dev, id->table_desc.len,
|
||||
&token, GFP_KERNEL);
|
||||
if (!md) {
|
||||
eprintk("Can't get dma memory %u\n", id->table_desc.len);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
sg_init_one(&dummy, md, id->table_desc.len);
|
||||
sg_dma_address(&dummy) = token;
|
||||
sg_dma_len(&dummy) = id->table_desc.len;
|
||||
err = rdma_io(sc, &dummy, 1, &id->table_desc, 1, DMA_TO_DEVICE,
|
||||
id->table_desc.len);
|
||||
if (err) {
|
||||
eprintk("Error copying indirect table %d\n", err);
|
||||
goto free_mem;
|
||||
}
|
||||
} else {
|
||||
eprintk("This command uses external indirect buffer\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rdma:
|
||||
if (dma_map) {
|
||||
nsg = dma_map_sg(iue->target->dev, sg, scsi_sg_count(sc),
|
||||
DMA_BIDIRECTIONAL);
|
||||
if (!nsg) {
|
||||
eprintk("fail to map %p %d\n", iue, scsi_sg_count(sc));
|
||||
err = -EIO;
|
||||
goto free_mem;
|
||||
}
|
||||
len = min(scsi_bufflen(sc), id->len);
|
||||
} else
|
||||
len = id->len;
|
||||
|
||||
err = rdma_io(sc, sg, nsg, md, nmd, dir, len);
|
||||
|
||||
if (dma_map)
|
||||
dma_unmap_sg(iue->target->dev, sg, nsg, DMA_BIDIRECTIONAL);
|
||||
|
||||
free_mem:
|
||||
if (token && dma_map)
|
||||
dma_free_coherent(iue->target->dev, id->table_desc.len, md, token);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int data_out_desc_size(struct srp_cmd *cmd)
|
||||
{
|
||||
int size = 0;
|
||||
u8 fmt = cmd->buf_fmt >> 4;
|
||||
|
||||
switch (fmt) {
|
||||
case SRP_NO_DATA_DESC:
|
||||
break;
|
||||
case SRP_DATA_DESC_DIRECT:
|
||||
size = sizeof(struct srp_direct_buf);
|
||||
break;
|
||||
case SRP_DATA_DESC_INDIRECT:
|
||||
size = sizeof(struct srp_indirect_buf) +
|
||||
sizeof(struct srp_direct_buf) * cmd->data_out_desc_cnt;
|
||||
break;
|
||||
default:
|
||||
eprintk("client error. Invalid data_out_format %x\n", fmt);
|
||||
break;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: this can be called multiple times for a single command if it
|
||||
* has very long data.
|
||||
*/
|
||||
int srp_transfer_data(struct scsi_cmnd *sc, struct srp_cmd *cmd,
|
||||
srp_rdma_t rdma_io, int dma_map, int ext_desc)
|
||||
{
|
||||
struct srp_direct_buf *md;
|
||||
struct srp_indirect_buf *id;
|
||||
enum dma_data_direction dir;
|
||||
int offset, err = 0;
|
||||
u8 format;
|
||||
|
||||
offset = cmd->add_cdb_len & ~3;
|
||||
|
||||
dir = srp_cmd_direction(cmd);
|
||||
if (dir == DMA_FROM_DEVICE)
|
||||
offset += data_out_desc_size(cmd);
|
||||
|
||||
if (dir == DMA_TO_DEVICE)
|
||||
format = cmd->buf_fmt >> 4;
|
||||
else
|
||||
format = cmd->buf_fmt & ((1U << 4) - 1);
|
||||
|
||||
switch (format) {
|
||||
case SRP_NO_DATA_DESC:
|
||||
break;
|
||||
case SRP_DATA_DESC_DIRECT:
|
||||
md = (struct srp_direct_buf *)
|
||||
(cmd->add_data + offset);
|
||||
err = srp_direct_data(sc, md, dir, rdma_io, dma_map, ext_desc);
|
||||
break;
|
||||
case SRP_DATA_DESC_INDIRECT:
|
||||
id = (struct srp_indirect_buf *)
|
||||
(cmd->add_data + offset);
|
||||
err = srp_indirect_data(sc, cmd, id, dir, rdma_io, dma_map,
|
||||
ext_desc);
|
||||
break;
|
||||
default:
|
||||
eprintk("Unknown format %d %x\n", dir, format);
|
||||
err = -EINVAL;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(srp_transfer_data);
|
||||
|
||||
static int vscsis_data_length(struct srp_cmd *cmd, enum dma_data_direction dir)
|
||||
{
|
||||
struct srp_direct_buf *md;
|
||||
struct srp_indirect_buf *id;
|
||||
int len = 0, offset = cmd->add_cdb_len & ~3;
|
||||
u8 fmt;
|
||||
|
||||
if (dir == DMA_TO_DEVICE)
|
||||
fmt = cmd->buf_fmt >> 4;
|
||||
else {
|
||||
fmt = cmd->buf_fmt & ((1U << 4) - 1);
|
||||
offset += data_out_desc_size(cmd);
|
||||
}
|
||||
|
||||
switch (fmt) {
|
||||
case SRP_NO_DATA_DESC:
|
||||
break;
|
||||
case SRP_DATA_DESC_DIRECT:
|
||||
md = (struct srp_direct_buf *) (cmd->add_data + offset);
|
||||
len = md->len;
|
||||
break;
|
||||
case SRP_DATA_DESC_INDIRECT:
|
||||
id = (struct srp_indirect_buf *) (cmd->add_data + offset);
|
||||
len = id->len;
|
||||
break;
|
||||
default:
|
||||
eprintk("invalid data format %x\n", fmt);
|
||||
break;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
int srp_cmd_queue(struct Scsi_Host *shost, struct srp_cmd *cmd, void *info,
|
||||
u64 itn_id, u64 addr)
|
||||
{
|
||||
enum dma_data_direction dir;
|
||||
struct scsi_cmnd *sc;
|
||||
int tag, len, err;
|
||||
|
||||
switch (cmd->task_attr) {
|
||||
case SRP_SIMPLE_TASK:
|
||||
tag = MSG_SIMPLE_TAG;
|
||||
break;
|
||||
case SRP_ORDERED_TASK:
|
||||
tag = MSG_ORDERED_TAG;
|
||||
break;
|
||||
case SRP_HEAD_TASK:
|
||||
tag = MSG_HEAD_TAG;
|
||||
break;
|
||||
default:
|
||||
eprintk("Task attribute %d not supported\n", cmd->task_attr);
|
||||
tag = MSG_ORDERED_TAG;
|
||||
}
|
||||
|
||||
dir = srp_cmd_direction(cmd);
|
||||
len = vscsis_data_length(cmd, dir);
|
||||
|
||||
dprintk("%p %x %lx %d %d %d %llx\n", info, cmd->cdb[0],
|
||||
cmd->lun, dir, len, tag, (unsigned long long) cmd->tag);
|
||||
|
||||
sc = scsi_host_get_command(shost, dir, GFP_KERNEL);
|
||||
if (!sc)
|
||||
return -ENOMEM;
|
||||
|
||||
sc->SCp.ptr = info;
|
||||
memcpy(sc->cmnd, cmd->cdb, MAX_COMMAND_SIZE);
|
||||
sc->sdb.length = len;
|
||||
sc->sdb.table.sgl = (void *) (unsigned long) addr;
|
||||
sc->tag = tag;
|
||||
err = scsi_tgt_queue_command(sc, itn_id, (struct scsi_lun *)&cmd->lun,
|
||||
cmd->tag);
|
||||
if (err)
|
||||
scsi_host_put_command(shost, sc);
|
||||
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(srp_cmd_queue);
|
||||
|
||||
MODULE_DESCRIPTION("SCSI RDMA Protocol lib functions");
|
||||
MODULE_AUTHOR("FUJITA Tomonori");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
@ -1998,6 +1998,14 @@ lpfc_vport_param_show(name)\
|
|||
lpfc_vport_param_init(name, defval, minval, maxval)\
|
||||
static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
|
||||
|
||||
#define LPFC_VPORT_ULL_ATTR_R(name, defval, minval, maxval, desc) \
|
||||
static uint64_t lpfc_##name = defval;\
|
||||
module_param(lpfc_##name, ullong, S_IRUGO);\
|
||||
MODULE_PARM_DESC(lpfc_##name, desc);\
|
||||
lpfc_vport_param_show(name)\
|
||||
lpfc_vport_param_init(name, defval, minval, maxval)\
|
||||
static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
|
||||
|
||||
#define LPFC_VPORT_ATTR_RW(name, defval, minval, maxval, desc) \
|
||||
static uint lpfc_##name = defval;\
|
||||
module_param(lpfc_##name, uint, S_IRUGO);\
|
||||
|
|
@ -4596,7 +4604,7 @@ LPFC_VPORT_ATTR(discovery_threads, 32, 1, 64, "Maximum number of ELS commands "
|
|||
# Value range is [0,65535]. Default value is 255.
|
||||
# NOTE: The SCSI layer might probe all allowed LUN on some old targets.
|
||||
*/
|
||||
LPFC_VPORT_ATTR_R(max_luns, 255, 0, 65535, "Maximum allowed LUN ID");
|
||||
LPFC_VPORT_ULL_ATTR_R(max_luns, 255, 0, 65535, "Maximum allowed LUN ID");
|
||||
|
||||
/*
|
||||
# lpfc_poll_tmo: .Milliseconds driver will wait between polling FCP ring.
|
||||
|
|
|
|||
|
|
@ -8242,7 +8242,7 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba)
|
|||
if (rc) {
|
||||
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
|
||||
"0420 PCI enable MSI-X failed (%d)\n", rc);
|
||||
goto msi_fail_out;
|
||||
goto vec_fail_out;
|
||||
}
|
||||
for (i = 0; i < LPFC_MSIX_VECTORS; i++)
|
||||
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
|
||||
|
|
@ -8320,6 +8320,8 @@ irq_fail_out:
|
|||
msi_fail_out:
|
||||
/* Unconfigure MSI-X capability structure */
|
||||
pci_disable_msix(phba->pcidev);
|
||||
|
||||
vec_fail_out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -8812,7 +8814,7 @@ enable_msix_vectors:
|
|||
} else if (rc) {
|
||||
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
|
||||
"0484 PCI enable MSI-X failed (%d)\n", rc);
|
||||
goto msi_fail_out;
|
||||
goto vec_fail_out;
|
||||
}
|
||||
|
||||
/* Log MSI-X vector assignment */
|
||||
|
|
@ -8875,9 +8877,10 @@ cfg_fail_out:
|
|||
&phba->sli4_hba.fcp_eq_hdl[index]);
|
||||
}
|
||||
|
||||
msi_fail_out:
|
||||
/* Unconfigure MSI-X capability structure */
|
||||
pci_disable_msix(phba->pcidev);
|
||||
|
||||
vec_fail_out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ static void
|
|||
lpfc_send_sdev_queuedepth_change_event(struct lpfc_hba *phba,
|
||||
struct lpfc_vport *vport,
|
||||
struct lpfc_nodelist *ndlp,
|
||||
uint32_t lun,
|
||||
uint64_t lun,
|
||||
uint32_t old_val,
|
||||
uint32_t new_val)
|
||||
{
|
||||
|
|
@ -3823,7 +3823,7 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
|
|||
if (rsplen != 0 && rsplen != 4 && rsplen != 8) {
|
||||
lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
|
||||
"2719 Invalid response length: "
|
||||
"tgt x%x lun x%x cmnd x%x rsplen x%x\n",
|
||||
"tgt x%x lun x%llx cmnd x%x rsplen x%x\n",
|
||||
cmnd->device->id,
|
||||
cmnd->device->lun, cmnd->cmnd[0],
|
||||
rsplen);
|
||||
|
|
@ -3834,7 +3834,7 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
|
|||
lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
|
||||
"2757 Protocol failure detected during "
|
||||
"processing of FCP I/O op: "
|
||||
"tgt x%x lun x%x cmnd x%x rspInfo3 x%x\n",
|
||||
"tgt x%x lun x%llx cmnd x%x rspInfo3 x%x\n",
|
||||
cmnd->device->id,
|
||||
cmnd->device->lun, cmnd->cmnd[0],
|
||||
fcprsp->rspInfo3);
|
||||
|
|
@ -4045,7 +4045,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
|
|||
else
|
||||
logit = LOG_FCP | LOG_FCP_UNDER;
|
||||
lpfc_printf_vlog(vport, KERN_WARNING, logit,
|
||||
"9030 FCP cmd x%x failed <%d/%d> "
|
||||
"9030 FCP cmd x%x failed <%d/%lld> "
|
||||
"status: x%x result: x%x "
|
||||
"sid: x%x did: x%x oxid: x%x "
|
||||
"Data: x%x x%x\n",
|
||||
|
|
@ -4157,7 +4157,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
|
|||
uint32_t *lp = (uint32_t *)cmd->sense_buffer;
|
||||
|
||||
lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
|
||||
"0710 Iodone <%d/%d> cmd %p, error "
|
||||
"0710 Iodone <%d/%llu> cmd %p, error "
|
||||
"x%x SNS x%x x%x Data: x%x x%x\n",
|
||||
cmd->device->id, cmd->device->lun, cmd,
|
||||
cmd->result, *lp, *(lp + 3), cmd->retries,
|
||||
|
|
@ -4390,7 +4390,7 @@ lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
|
|||
static int
|
||||
lpfc_scsi_prep_task_mgmt_cmd(struct lpfc_vport *vport,
|
||||
struct lpfc_scsi_buf *lpfc_cmd,
|
||||
unsigned int lun,
|
||||
uint64_t lun,
|
||||
uint8_t task_mgmt_cmd)
|
||||
{
|
||||
struct lpfc_iocbq *piocbq;
|
||||
|
|
@ -4719,12 +4719,12 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
|
|||
atomic_dec(&ndlp->cmd_pending);
|
||||
lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
|
||||
"3376 FCP could not issue IOCB err %x"
|
||||
"FCP cmd x%x <%d/%d> "
|
||||
"FCP cmd x%x <%d/%llu> "
|
||||
"sid: x%x did: x%x oxid: x%x "
|
||||
"Data: x%x x%x x%x x%x\n",
|
||||
err, cmnd->cmnd[0],
|
||||
cmnd->device ? cmnd->device->id : 0xffff,
|
||||
cmnd->device ? cmnd->device->lun : 0xffff,
|
||||
cmnd->device ? cmnd->device->lun : (u64) -1,
|
||||
vport->fc_myDID, ndlp->nlp_DID,
|
||||
phba->sli_rev == LPFC_SLI_REV4 ?
|
||||
lpfc_cmd->cur_iocbq.sli4_xritag : 0xffff,
|
||||
|
|
@ -4807,7 +4807,7 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
|
|||
spin_unlock_irqrestore(&phba->hbalock, flags);
|
||||
lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
|
||||
"2873 SCSI Layer I/O Abort Request IO CMPL Status "
|
||||
"x%x ID %d LUN %d\n",
|
||||
"x%x ID %d LUN %llu\n",
|
||||
SUCCESS, cmnd->device->id, cmnd->device->lun);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
|
@ -4924,7 +4924,7 @@ wait_for_cmpl:
|
|||
lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
|
||||
"0748 abort handler timed out waiting "
|
||||
"for abortng I/O (xri:x%x) to complete: "
|
||||
"ret %#x, ID %d, LUN %d\n",
|
||||
"ret %#x, ID %d, LUN %llu\n",
|
||||
iocb->sli4_xritag, ret,
|
||||
cmnd->device->id, cmnd->device->lun);
|
||||
}
|
||||
|
|
@ -4935,7 +4935,7 @@ out_unlock:
|
|||
out:
|
||||
lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
|
||||
"0749 SCSI Layer I/O Abort Request Status x%x ID %d "
|
||||
"LUN %d\n", ret, cmnd->device->id,
|
||||
"LUN %llu\n", ret, cmnd->device->id,
|
||||
cmnd->device->lun);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -5047,7 +5047,7 @@ lpfc_check_fcp_rsp(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd)
|
|||
**/
|
||||
static int
|
||||
lpfc_send_taskmgmt(struct lpfc_vport *vport, struct lpfc_rport_data *rdata,
|
||||
unsigned tgt_id, unsigned int lun_id,
|
||||
unsigned tgt_id, uint64_t lun_id,
|
||||
uint8_t task_mgmt_cmd)
|
||||
{
|
||||
struct lpfc_hba *phba = vport->phba;
|
||||
|
|
@ -5083,7 +5083,7 @@ lpfc_send_taskmgmt(struct lpfc_vport *vport, struct lpfc_rport_data *rdata,
|
|||
iocbq->iocb_cmpl = lpfc_tskmgmt_def_cmpl;
|
||||
|
||||
lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
|
||||
"0702 Issue %s to TGT %d LUN %d "
|
||||
"0702 Issue %s to TGT %d LUN %llu "
|
||||
"rpi x%x nlp_flag x%x Data: x%x x%x\n",
|
||||
lpfc_taskmgmt_name(task_mgmt_cmd), tgt_id, lun_id,
|
||||
pnode->nlp_rpi, pnode->nlp_flag, iocbq->sli4_xritag,
|
||||
|
|
@ -5094,7 +5094,7 @@ lpfc_send_taskmgmt(struct lpfc_vport *vport, struct lpfc_rport_data *rdata,
|
|||
if ((status != IOCB_SUCCESS) ||
|
||||
(iocbqrsp->iocb.ulpStatus != IOSTAT_SUCCESS)) {
|
||||
lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
|
||||
"0727 TMF %s to TGT %d LUN %d failed (%d, %d) "
|
||||
"0727 TMF %s to TGT %d LUN %llu failed (%d, %d) "
|
||||
"iocb_flag x%x\n",
|
||||
lpfc_taskmgmt_name(task_mgmt_cmd),
|
||||
tgt_id, lun_id, iocbqrsp->iocb.ulpStatus,
|
||||
|
|
@ -5238,7 +5238,7 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
|
|||
struct lpfc_rport_data *rdata;
|
||||
struct lpfc_nodelist *pnode;
|
||||
unsigned tgt_id = cmnd->device->id;
|
||||
unsigned int lun_id = cmnd->device->lun;
|
||||
uint64_t lun_id = cmnd->device->lun;
|
||||
struct lpfc_scsi_event_header scsi_event;
|
||||
int status;
|
||||
|
||||
|
|
@ -5273,7 +5273,7 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
|
|||
FCP_LUN_RESET);
|
||||
|
||||
lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
|
||||
"0713 SCSI layer issued Device Reset (%d, %d) "
|
||||
"0713 SCSI layer issued Device Reset (%d, %llu) "
|
||||
"return x%x\n", tgt_id, lun_id, status);
|
||||
|
||||
/*
|
||||
|
|
@ -5308,7 +5308,7 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd)
|
|||
struct lpfc_rport_data *rdata;
|
||||
struct lpfc_nodelist *pnode;
|
||||
unsigned tgt_id = cmnd->device->id;
|
||||
unsigned int lun_id = cmnd->device->lun;
|
||||
uint64_t lun_id = cmnd->device->lun;
|
||||
struct lpfc_scsi_event_header scsi_event;
|
||||
int status;
|
||||
|
||||
|
|
@ -5343,7 +5343,7 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd)
|
|||
FCP_TARGET_RESET);
|
||||
|
||||
lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
|
||||
"0723 SCSI layer issued Target Reset (%d, %d) "
|
||||
"0723 SCSI layer issued Target Reset (%d, %llu) "
|
||||
"return x%x\n", tgt_id, lun_id, status);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1860,7 +1860,7 @@ megaraid_info(struct Scsi_Host *host)
|
|||
"LSI Logic MegaRAID %s %d commands %d targs %d chans %d luns",
|
||||
adapter->fw_version, adapter->product_info.max_commands,
|
||||
adapter->host->max_id, adapter->host->max_channel,
|
||||
adapter->host->max_lun);
|
||||
(u32)adapter->host->max_lun);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
|
@ -1941,8 +1941,8 @@ megaraid_abort_and_reset(adapter_t *adapter, Scsi_Cmnd *cmd, int aor)
|
|||
|
||||
printk(KERN_WARNING "megaraid: %s cmd=%x <c=%d t=%d l=%d>\n",
|
||||
(aor == SCB_ABORT)? "ABORTING":"RESET",
|
||||
cmd->cmnd[0], cmd->device->channel,
|
||||
cmd->device->id, cmd->device->lun);
|
||||
cmd->cmnd[0], cmd->device->channel,
|
||||
cmd->device->id, (u32)cmd->device->lun);
|
||||
|
||||
if(list_empty(&adapter->pending_list))
|
||||
return FALSE;
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ typedef struct {
|
|||
#define SCP2HOSTDATA(scp) SCP2HOST(scp)->hostdata // to soft state
|
||||
#define SCP2CHANNEL(scp) (scp)->device->channel // to channel
|
||||
#define SCP2TARGET(scp) (scp)->device->id // to target
|
||||
#define SCP2LUN(scp) (scp)->device->lun // to LUN
|
||||
#define SCP2LUN(scp) (u32)(scp)->device->lun // to LUN
|
||||
|
||||
// generic macro to convert scsi command and host to controller's soft state
|
||||
#define SCSIHOST2ADAP(host) (((caddr_t *)(host->hostdata))[0])
|
||||
|
|
|
|||
|
|
@ -1690,7 +1690,7 @@ NonFastPath:
|
|||
MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT);
|
||||
}
|
||||
io_request->RaidContext.VirtualDiskTgtId = cpu_to_le16(device_id);
|
||||
io_request->LUN[1] = scmd->device->lun;
|
||||
int_to_scsilun(scmd->device->lun, (struct scsi_lun *)io_request->LUN);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1713,7 +1713,7 @@ megasas_build_io_fusion(struct megasas_instance *instance,
|
|||
device_id = MEGASAS_DEV_INDEX(instance, scp);
|
||||
|
||||
/* Zero out some fields so they don't get reused */
|
||||
io_request->LUN[1] = 0;
|
||||
memset(io_request->LUN, 0x0, 8);
|
||||
io_request->CDB.EEDP32.PrimaryReferenceTag = 0;
|
||||
io_request->CDB.EEDP32.PrimaryApplicationTagMask = 0;
|
||||
io_request->EEDPFlags = 0;
|
||||
|
|
|
|||
|
|
@ -1230,7 +1230,7 @@ static void handle_msgin(struct mesh_state *ms)
|
|||
ms->msgphase = msg_out;
|
||||
} else if (code != cmd->device->lun + IDENTIFY_BASE) {
|
||||
printk(KERN_WARNING "mesh: lun mismatch "
|
||||
"(%d != %d) on reselection from "
|
||||
"(%d != %llu) on reselection from "
|
||||
"target %d\n", code - IDENTIFY_BASE,
|
||||
cmd->device->lun, ms->conn_tgt);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ mpt2sas_base_stop_watchdog(struct MPT2SAS_ADAPTER *ioc)
|
|||
ioc->fault_reset_work_q = NULL;
|
||||
spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
|
||||
if (wq) {
|
||||
if (!cancel_delayed_work(&ioc->fault_reset_work))
|
||||
if (!cancel_delayed_work_sync(&ioc->fault_reset_work))
|
||||
flush_workqueue(wq);
|
||||
destroy_workqueue(wq);
|
||||
}
|
||||
|
|
@ -1332,53 +1332,35 @@ _base_request_irq(struct MPT2SAS_ADAPTER *ioc, u8 index, u32 vector)
|
|||
static void
|
||||
_base_assign_reply_queues(struct MPT2SAS_ADAPTER *ioc)
|
||||
{
|
||||
struct adapter_reply_queue *reply_q;
|
||||
int cpu_id;
|
||||
int cpu_grouping, loop, grouping, grouping_mod;
|
||||
unsigned int cpu, nr_cpus, nr_msix, index = 0;
|
||||
|
||||
if (!_base_is_controller_msix_enabled(ioc))
|
||||
return;
|
||||
|
||||
memset(ioc->cpu_msix_table, 0, ioc->cpu_msix_table_sz);
|
||||
/* when there are more cpus than available msix vectors,
|
||||
* then group cpus togeather on same irq
|
||||
*/
|
||||
if (ioc->cpu_count > ioc->msix_vector_count) {
|
||||
grouping = ioc->cpu_count / ioc->msix_vector_count;
|
||||
grouping_mod = ioc->cpu_count % ioc->msix_vector_count;
|
||||
if (grouping < 2 || (grouping == 2 && !grouping_mod))
|
||||
cpu_grouping = 2;
|
||||
else if (grouping < 4 || (grouping == 4 && !grouping_mod))
|
||||
cpu_grouping = 4;
|
||||
else if (grouping < 8 || (grouping == 8 && !grouping_mod))
|
||||
cpu_grouping = 8;
|
||||
else
|
||||
cpu_grouping = 16;
|
||||
} else
|
||||
cpu_grouping = 0;
|
||||
|
||||
loop = 0;
|
||||
reply_q = list_entry(ioc->reply_queue_list.next,
|
||||
struct adapter_reply_queue, list);
|
||||
for_each_online_cpu(cpu_id) {
|
||||
if (!cpu_grouping) {
|
||||
ioc->cpu_msix_table[cpu_id] = reply_q->msix_index;
|
||||
reply_q = list_entry(reply_q->list.next,
|
||||
struct adapter_reply_queue, list);
|
||||
} else {
|
||||
if (loop < cpu_grouping) {
|
||||
ioc->cpu_msix_table[cpu_id] =
|
||||
reply_q->msix_index;
|
||||
loop++;
|
||||
} else {
|
||||
reply_q = list_entry(reply_q->list.next,
|
||||
struct adapter_reply_queue, list);
|
||||
ioc->cpu_msix_table[cpu_id] =
|
||||
reply_q->msix_index;
|
||||
loop = 1;
|
||||
}
|
||||
nr_cpus = num_online_cpus();
|
||||
nr_msix = ioc->reply_queue_count = min(ioc->reply_queue_count,
|
||||
ioc->facts.MaxMSIxVectors);
|
||||
if (!nr_msix)
|
||||
return;
|
||||
|
||||
cpu = cpumask_first(cpu_online_mask);
|
||||
|
||||
do {
|
||||
unsigned int i, group = nr_cpus / nr_msix;
|
||||
|
||||
if (index < nr_cpus % nr_msix)
|
||||
group++;
|
||||
|
||||
for (i = 0 ; i < group ; i++) {
|
||||
ioc->cpu_msix_table[cpu] = index;
|
||||
cpu = cpumask_next(cpu, cpu_online_mask);
|
||||
}
|
||||
}
|
||||
|
||||
index++;
|
||||
|
||||
} while (cpu < nr_cpus);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -4295,12 +4277,13 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc)
|
|||
goto out_free_resources;
|
||||
|
||||
if (ioc->is_warpdrive) {
|
||||
ioc->reply_post_host_index[0] =
|
||||
(resource_size_t *)&ioc->chip->ReplyPostHostIndex;
|
||||
ioc->reply_post_host_index[0] = (resource_size_t __iomem *)
|
||||
&ioc->chip->ReplyPostHostIndex;
|
||||
|
||||
for (i = 1; i < ioc->cpu_msix_table_sz; i++)
|
||||
ioc->reply_post_host_index[i] = (resource_size_t *)
|
||||
((u8 *)&ioc->chip->Doorbell + (0x4000 + ((i - 1)
|
||||
ioc->reply_post_host_index[i] =
|
||||
(resource_size_t __iomem *)
|
||||
((u8 __iomem *)&ioc->chip->Doorbell + (0x4000 + ((i - 1)
|
||||
* 4)));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -837,7 +837,7 @@ struct MPT2SAS_ADAPTER {
|
|||
u8 msix_enable;
|
||||
u16 msix_vector_count;
|
||||
u8 *cpu_msix_table;
|
||||
resource_size_t **reply_post_host_index;
|
||||
resource_size_t __iomem **reply_post_host_index;
|
||||
u16 cpu_msix_table_sz;
|
||||
u32 ioc_reset_count;
|
||||
MPT2SAS_FLUSH_RUNNING_CMDS schedule_dead_ioc_flush_running_cmds;
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ struct fw_event_work {
|
|||
u8 VP_ID;
|
||||
u8 ignore;
|
||||
u16 event;
|
||||
void *event_data;
|
||||
char event_data[0] __aligned(4);
|
||||
};
|
||||
|
||||
/* raid transport support */
|
||||
|
|
@ -1292,7 +1292,8 @@ _scsih_target_alloc(struct scsi_target *starget)
|
|||
unsigned long flags;
|
||||
struct sas_rphy *rphy;
|
||||
|
||||
sas_target_priv_data = kzalloc(sizeof(struct scsi_target), GFP_KERNEL);
|
||||
sas_target_priv_data = kzalloc(sizeof(*sas_target_priv_data),
|
||||
GFP_KERNEL);
|
||||
if (!sas_target_priv_data)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -1406,7 +1407,8 @@ _scsih_slave_alloc(struct scsi_device *sdev)
|
|||
struct _sas_device *sas_device;
|
||||
unsigned long flags;
|
||||
|
||||
sas_device_priv_data = kzalloc(sizeof(struct scsi_device), GFP_KERNEL);
|
||||
sas_device_priv_data = kzalloc(sizeof(*sas_device_priv_data),
|
||||
GFP_KERNEL);
|
||||
if (!sas_device_priv_data)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -2832,7 +2834,6 @@ _scsih_fw_event_free(struct MPT2SAS_ADAPTER *ioc, struct fw_event_work
|
|||
|
||||
spin_lock_irqsave(&ioc->fw_event_lock, flags);
|
||||
list_del(&fw_event->list);
|
||||
kfree(fw_event->event_data);
|
||||
kfree(fw_event);
|
||||
spin_unlock_irqrestore(&ioc->fw_event_lock, flags);
|
||||
}
|
||||
|
|
@ -2899,11 +2900,10 @@ _scsih_fw_event_cleanup_queue(struct MPT2SAS_ADAPTER *ioc)
|
|||
return;
|
||||
|
||||
list_for_each_entry_safe(fw_event, next, &ioc->fw_event_list, list) {
|
||||
if (cancel_delayed_work(&fw_event->delayed_work)) {
|
||||
if (cancel_delayed_work_sync(&fw_event->delayed_work)) {
|
||||
_scsih_fw_event_free(ioc, fw_event);
|
||||
continue;
|
||||
}
|
||||
fw_event->cancel_pending_work = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3518,7 +3518,8 @@ _scsih_check_topo_delete_events(struct MPT2SAS_ADAPTER *ioc,
|
|||
if (fw_event->event != MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST ||
|
||||
fw_event->ignore)
|
||||
continue;
|
||||
local_event_data = fw_event->event_data;
|
||||
local_event_data = (Mpi2EventDataSasTopologyChangeList_t *)
|
||||
fw_event->event_data;
|
||||
if (local_event_data->ExpStatus ==
|
||||
MPI2_EVENT_SAS_TOPO_ES_ADDED ||
|
||||
local_event_data->ExpStatus ==
|
||||
|
|
@ -5502,7 +5503,9 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc,
|
|||
u64 sas_address;
|
||||
unsigned long flags;
|
||||
u8 link_rate, prev_link_rate;
|
||||
Mpi2EventDataSasTopologyChangeList_t *event_data = fw_event->event_data;
|
||||
Mpi2EventDataSasTopologyChangeList_t *event_data =
|
||||
(Mpi2EventDataSasTopologyChangeList_t *)
|
||||
fw_event->event_data;
|
||||
|
||||
#ifdef CONFIG_SCSI_MPT2SAS_LOGGING
|
||||
if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK)
|
||||
|
|
@ -5697,7 +5700,8 @@ _scsih_sas_device_status_change_event(struct MPT2SAS_ADAPTER *ioc,
|
|||
u64 sas_address;
|
||||
unsigned long flags;
|
||||
Mpi2EventDataSasDeviceStatusChange_t *event_data =
|
||||
fw_event->event_data;
|
||||
(Mpi2EventDataSasDeviceStatusChange_t *)
|
||||
fw_event->event_data;
|
||||
|
||||
#ifdef CONFIG_SCSI_MPT2SAS_LOGGING
|
||||
if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK)
|
||||
|
|
@ -5792,6 +5796,7 @@ _scsih_sas_enclosure_dev_status_change_event(struct MPT2SAS_ADAPTER *ioc,
|
|||
#ifdef CONFIG_SCSI_MPT2SAS_LOGGING
|
||||
if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK)
|
||||
_scsih_sas_enclosure_dev_status_change_event_debug(ioc,
|
||||
(Mpi2EventDataSasEnclDevStatusChange_t *)
|
||||
fw_event->event_data);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -5816,7 +5821,9 @@ _scsih_sas_broadcast_primitive_event(struct MPT2SAS_ADAPTER *ioc,
|
|||
u32 termination_count;
|
||||
u32 query_count;
|
||||
Mpi2SCSITaskManagementReply_t *mpi_reply;
|
||||
Mpi2EventDataSasBroadcastPrimitive_t *event_data = fw_event->event_data;
|
||||
Mpi2EventDataSasBroadcastPrimitive_t *event_data =
|
||||
(Mpi2EventDataSasBroadcastPrimitive_t *)
|
||||
fw_event->event_data;
|
||||
u16 ioc_status;
|
||||
unsigned long flags;
|
||||
int r;
|
||||
|
|
@ -5967,7 +5974,9 @@ static void
|
|||
_scsih_sas_discovery_event(struct MPT2SAS_ADAPTER *ioc,
|
||||
struct fw_event_work *fw_event)
|
||||
{
|
||||
Mpi2EventDataSasDiscovery_t *event_data = fw_event->event_data;
|
||||
Mpi2EventDataSasDiscovery_t *event_data =
|
||||
(Mpi2EventDataSasDiscovery_t *)
|
||||
fw_event->event_data;
|
||||
|
||||
#ifdef CONFIG_SCSI_MPT2SAS_LOGGING
|
||||
if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) {
|
||||
|
|
@ -6355,7 +6364,9 @@ _scsih_sas_ir_config_change_event(struct MPT2SAS_ADAPTER *ioc,
|
|||
Mpi2EventIrConfigElement_t *element;
|
||||
int i;
|
||||
u8 foreign_config;
|
||||
Mpi2EventDataIrConfigChangeList_t *event_data = fw_event->event_data;
|
||||
Mpi2EventDataIrConfigChangeList_t *event_data =
|
||||
(Mpi2EventDataIrConfigChangeList_t *)
|
||||
fw_event->event_data;
|
||||
|
||||
#ifdef CONFIG_SCSI_MPT2SAS_LOGGING
|
||||
if ((ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK)
|
||||
|
|
@ -6423,7 +6434,9 @@ _scsih_sas_ir_volume_event(struct MPT2SAS_ADAPTER *ioc,
|
|||
u16 handle;
|
||||
u32 state;
|
||||
int rc;
|
||||
Mpi2EventDataIrVolume_t *event_data = fw_event->event_data;
|
||||
Mpi2EventDataIrVolume_t *event_data =
|
||||
(Mpi2EventDataIrVolume_t *)
|
||||
fw_event->event_data;
|
||||
|
||||
if (ioc->shost_recovery)
|
||||
return;
|
||||
|
|
@ -6507,7 +6520,9 @@ _scsih_sas_ir_physical_disk_event(struct MPT2SAS_ADAPTER *ioc,
|
|||
Mpi2ConfigReply_t mpi_reply;
|
||||
Mpi2SasDevicePage0_t sas_device_pg0;
|
||||
u32 ioc_status;
|
||||
Mpi2EventDataIrPhysicalDisk_t *event_data = fw_event->event_data;
|
||||
Mpi2EventDataIrPhysicalDisk_t *event_data =
|
||||
(Mpi2EventDataIrPhysicalDisk_t *)
|
||||
fw_event->event_data;
|
||||
u64 sas_address;
|
||||
|
||||
if (ioc->shost_recovery)
|
||||
|
|
@ -6630,7 +6645,9 @@ static void
|
|||
_scsih_sas_ir_operation_status_event(struct MPT2SAS_ADAPTER *ioc,
|
||||
struct fw_event_work *fw_event)
|
||||
{
|
||||
Mpi2EventDataIrOperationStatus_t *event_data = fw_event->event_data;
|
||||
Mpi2EventDataIrOperationStatus_t *event_data =
|
||||
(Mpi2EventDataIrOperationStatus_t *)
|
||||
fw_event->event_data;
|
||||
static struct _raid_device *raid_device;
|
||||
unsigned long flags;
|
||||
u16 handle;
|
||||
|
|
@ -7401,7 +7418,7 @@ _firmware_event_work(struct work_struct *work)
|
|||
struct MPT2SAS_ADAPTER *ioc = fw_event->ioc;
|
||||
|
||||
/* the queue is being flushed so ignore this event */
|
||||
if (ioc->remove_host || fw_event->cancel_pending_work ||
|
||||
if (ioc->remove_host ||
|
||||
ioc->pci_error_recovery) {
|
||||
_scsih_fw_event_free(ioc, fw_event);
|
||||
return;
|
||||
|
|
@ -7590,23 +7607,15 @@ mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index,
|
|||
return;
|
||||
}
|
||||
|
||||
fw_event = kzalloc(sizeof(struct fw_event_work), GFP_ATOMIC);
|
||||
sz = le16_to_cpu(mpi_reply->EventDataLength) * 4;
|
||||
fw_event = kzalloc(sizeof(*fw_event) + sz, GFP_ATOMIC);
|
||||
if (!fw_event) {
|
||||
printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
|
||||
ioc->name, __FILE__, __LINE__, __func__);
|
||||
return;
|
||||
}
|
||||
sz = le16_to_cpu(mpi_reply->EventDataLength) * 4;
|
||||
fw_event->event_data = kzalloc(sz, GFP_ATOMIC);
|
||||
if (!fw_event->event_data) {
|
||||
printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
|
||||
ioc->name, __FILE__, __LINE__, __func__);
|
||||
kfree(fw_event);
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(fw_event->event_data, mpi_reply->EventData,
|
||||
sz);
|
||||
memcpy(fw_event->event_data, mpi_reply->EventData, sz);
|
||||
fw_event->ioc = ioc;
|
||||
fw_event->VF_ID = mpi_reply->VF_ID;
|
||||
fw_event->VP_ID = mpi_reply->VP_ID;
|
||||
|
|
@ -7857,9 +7866,9 @@ _scsih_remove(struct pci_dev *pdev)
|
|||
}
|
||||
|
||||
sas_remove_host(shost);
|
||||
scsi_remove_host(shost);
|
||||
mpt2sas_base_detach(ioc);
|
||||
list_del(&ioc->list);
|
||||
scsi_remove_host(shost);
|
||||
scsi_host_put(shost);
|
||||
}
|
||||
|
||||
|
|
@ -8200,13 +8209,6 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
|||
}
|
||||
}
|
||||
|
||||
if ((scsi_add_host(shost, &pdev->dev))) {
|
||||
printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
|
||||
ioc->name, __FILE__, __LINE__, __func__);
|
||||
list_del(&ioc->list);
|
||||
goto out_add_shost_fail;
|
||||
}
|
||||
|
||||
/* register EEDP capabilities with SCSI layer */
|
||||
if (prot_mask)
|
||||
scsi_host_set_prot(shost, prot_mask);
|
||||
|
|
@ -8248,16 +8250,23 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
|||
}
|
||||
} else
|
||||
ioc->hide_drives = 0;
|
||||
|
||||
if ((scsi_add_host(shost, &pdev->dev))) {
|
||||
printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
|
||||
ioc->name, __FILE__, __LINE__, __func__);
|
||||
goto out_add_shost_fail;
|
||||
}
|
||||
|
||||
scsi_scan_host(shost);
|
||||
|
||||
return 0;
|
||||
|
||||
out_add_shost_fail:
|
||||
mpt2sas_base_detach(ioc);
|
||||
out_attach_fail:
|
||||
destroy_workqueue(ioc->firmware_event_thread);
|
||||
out_thread_fail:
|
||||
list_del(&ioc->list);
|
||||
scsi_remove_host(shost);
|
||||
out_add_shost_fail:
|
||||
scsi_host_put(shost);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ mpt3sas_base_stop_watchdog(struct MPT3SAS_ADAPTER *ioc)
|
|||
ioc->fault_reset_work_q = NULL;
|
||||
spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
|
||||
if (wq) {
|
||||
if (!cancel_delayed_work(&ioc->fault_reset_work))
|
||||
if (!cancel_delayed_work_sync(&ioc->fault_reset_work))
|
||||
flush_workqueue(wq);
|
||||
destroy_workqueue(wq);
|
||||
}
|
||||
|
|
@ -1624,66 +1624,35 @@ _base_request_irq(struct MPT3SAS_ADAPTER *ioc, u8 index, u32 vector)
|
|||
static void
|
||||
_base_assign_reply_queues(struct MPT3SAS_ADAPTER *ioc)
|
||||
{
|
||||
struct adapter_reply_queue *reply_q;
|
||||
int cpu_id;
|
||||
int cpu_grouping, loop, grouping, grouping_mod;
|
||||
int reply_queue;
|
||||
unsigned int cpu, nr_cpus, nr_msix, index = 0;
|
||||
|
||||
if (!_base_is_controller_msix_enabled(ioc))
|
||||
return;
|
||||
|
||||
memset(ioc->cpu_msix_table, 0, ioc->cpu_msix_table_sz);
|
||||
|
||||
/* NUMA Hardware bug workaround - drop to less reply queues */
|
||||
if (ioc->reply_queue_count > ioc->facts.MaxMSIxVectors) {
|
||||
ioc->reply_queue_count = ioc->facts.MaxMSIxVectors;
|
||||
reply_queue = 0;
|
||||
list_for_each_entry(reply_q, &ioc->reply_queue_list, list) {
|
||||
reply_q->msix_index = reply_queue;
|
||||
if (++reply_queue == ioc->reply_queue_count)
|
||||
reply_queue = 0;
|
||||
}
|
||||
}
|
||||
nr_cpus = num_online_cpus();
|
||||
nr_msix = ioc->reply_queue_count = min(ioc->reply_queue_count,
|
||||
ioc->facts.MaxMSIxVectors);
|
||||
if (!nr_msix)
|
||||
return;
|
||||
|
||||
/* when there are more cpus than available msix vectors,
|
||||
* then group cpus togeather on same irq
|
||||
*/
|
||||
if (ioc->cpu_count > ioc->msix_vector_count) {
|
||||
grouping = ioc->cpu_count / ioc->msix_vector_count;
|
||||
grouping_mod = ioc->cpu_count % ioc->msix_vector_count;
|
||||
if (grouping < 2 || (grouping == 2 && !grouping_mod))
|
||||
cpu_grouping = 2;
|
||||
else if (grouping < 4 || (grouping == 4 && !grouping_mod))
|
||||
cpu_grouping = 4;
|
||||
else if (grouping < 8 || (grouping == 8 && !grouping_mod))
|
||||
cpu_grouping = 8;
|
||||
else
|
||||
cpu_grouping = 16;
|
||||
} else
|
||||
cpu_grouping = 0;
|
||||
cpu = cpumask_first(cpu_online_mask);
|
||||
|
||||
loop = 0;
|
||||
reply_q = list_entry(ioc->reply_queue_list.next,
|
||||
struct adapter_reply_queue, list);
|
||||
for_each_online_cpu(cpu_id) {
|
||||
if (!cpu_grouping) {
|
||||
ioc->cpu_msix_table[cpu_id] = reply_q->msix_index;
|
||||
reply_q = list_entry(reply_q->list.next,
|
||||
struct adapter_reply_queue, list);
|
||||
} else {
|
||||
if (loop < cpu_grouping) {
|
||||
ioc->cpu_msix_table[cpu_id] =
|
||||
reply_q->msix_index;
|
||||
loop++;
|
||||
} else {
|
||||
reply_q = list_entry(reply_q->list.next,
|
||||
struct adapter_reply_queue, list);
|
||||
ioc->cpu_msix_table[cpu_id] =
|
||||
reply_q->msix_index;
|
||||
loop = 1;
|
||||
}
|
||||
do {
|
||||
unsigned int i, group = nr_cpus / nr_msix;
|
||||
|
||||
if (index < nr_cpus % nr_msix)
|
||||
group++;
|
||||
|
||||
for (i = 0 ; i < group ; i++) {
|
||||
ioc->cpu_msix_table[cpu] = index;
|
||||
cpu = cpumask_next(cpu, cpu_online_mask);
|
||||
}
|
||||
}
|
||||
|
||||
index++;
|
||||
|
||||
} while (cpu < nr_cpus);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -112,8 +112,8 @@ MODULE_PARM_DESC(missing_delay, " device missing delay , io missing delay");
|
|||
|
||||
/* scsi-mid layer global parmeter is max_report_luns, which is 511 */
|
||||
#define MPT3SAS_MAX_LUN (16895)
|
||||
static int max_lun = MPT3SAS_MAX_LUN;
|
||||
module_param(max_lun, int, 0);
|
||||
static u64 max_lun = MPT3SAS_MAX_LUN;
|
||||
module_param(max_lun, ullong, 0);
|
||||
MODULE_PARM_DESC(max_lun, " max lun, default=16895 ");
|
||||
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ struct fw_event_work {
|
|||
u8 VP_ID;
|
||||
u8 ignore;
|
||||
u16 event;
|
||||
void *event_data;
|
||||
char event_data[0] __aligned(4);
|
||||
};
|
||||
|
||||
/* raid transport support */
|
||||
|
|
@ -1163,7 +1163,8 @@ _scsih_target_alloc(struct scsi_target *starget)
|
|||
unsigned long flags;
|
||||
struct sas_rphy *rphy;
|
||||
|
||||
sas_target_priv_data = kzalloc(sizeof(struct scsi_target), GFP_KERNEL);
|
||||
sas_target_priv_data = kzalloc(sizeof(*sas_target_priv_data),
|
||||
GFP_KERNEL);
|
||||
if (!sas_target_priv_data)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -1277,7 +1278,8 @@ _scsih_slave_alloc(struct scsi_device *sdev)
|
|||
struct _sas_device *sas_device;
|
||||
unsigned long flags;
|
||||
|
||||
sas_device_priv_data = kzalloc(sizeof(struct scsi_device), GFP_KERNEL);
|
||||
sas_device_priv_data = kzalloc(sizeof(*sas_device_priv_data),
|
||||
GFP_KERNEL);
|
||||
if (!sas_device_priv_data)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -2490,7 +2492,6 @@ _scsih_fw_event_free(struct MPT3SAS_ADAPTER *ioc, struct fw_event_work
|
|||
|
||||
spin_lock_irqsave(&ioc->fw_event_lock, flags);
|
||||
list_del(&fw_event->list);
|
||||
kfree(fw_event->event_data);
|
||||
kfree(fw_event);
|
||||
spin_unlock_irqrestore(&ioc->fw_event_lock, flags);
|
||||
}
|
||||
|
|
@ -2511,12 +2512,10 @@ mpt3sas_send_trigger_data_event(struct MPT3SAS_ADAPTER *ioc,
|
|||
|
||||
if (ioc->is_driver_loading)
|
||||
return;
|
||||
fw_event = kzalloc(sizeof(struct fw_event_work), GFP_ATOMIC);
|
||||
fw_event = kzalloc(sizeof(*fw_event) + sizeof(*event_data),
|
||||
GFP_ATOMIC);
|
||||
if (!fw_event)
|
||||
return;
|
||||
fw_event->event_data = kzalloc(sizeof(*event_data), GFP_ATOMIC);
|
||||
if (!fw_event->event_data)
|
||||
return;
|
||||
fw_event->event = MPT3SAS_PROCESS_TRIGGER_DIAG;
|
||||
fw_event->ioc = ioc;
|
||||
memcpy(fw_event->event_data, event_data, sizeof(*event_data));
|
||||
|
|
@ -2582,11 +2581,10 @@ _scsih_fw_event_cleanup_queue(struct MPT3SAS_ADAPTER *ioc)
|
|||
return;
|
||||
|
||||
list_for_each_entry_safe(fw_event, next, &ioc->fw_event_list, list) {
|
||||
if (cancel_delayed_work(&fw_event->delayed_work)) {
|
||||
if (cancel_delayed_work_sync(&fw_event->delayed_work)) {
|
||||
_scsih_fw_event_free(ioc, fw_event);
|
||||
continue;
|
||||
}
|
||||
fw_event->cancel_pending_work = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3211,7 +3209,8 @@ _scsih_check_topo_delete_events(struct MPT3SAS_ADAPTER *ioc,
|
|||
if (fw_event->event != MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST ||
|
||||
fw_event->ignore)
|
||||
continue;
|
||||
local_event_data = fw_event->event_data;
|
||||
local_event_data = (Mpi2EventDataSasTopologyChangeList_t *)
|
||||
fw_event->event_data;
|
||||
if (local_event_data->ExpStatus ==
|
||||
MPI2_EVENT_SAS_TOPO_ES_ADDED ||
|
||||
local_event_data->ExpStatus ==
|
||||
|
|
@ -5043,7 +5042,9 @@ _scsih_sas_topology_change_event(struct MPT3SAS_ADAPTER *ioc,
|
|||
u64 sas_address;
|
||||
unsigned long flags;
|
||||
u8 link_rate, prev_link_rate;
|
||||
Mpi2EventDataSasTopologyChangeList_t *event_data = fw_event->event_data;
|
||||
Mpi2EventDataSasTopologyChangeList_t *event_data =
|
||||
(Mpi2EventDataSasTopologyChangeList_t *)
|
||||
fw_event->event_data;
|
||||
|
||||
#ifdef CONFIG_SCSI_MPT3SAS_LOGGING
|
||||
if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK)
|
||||
|
|
@ -5241,7 +5242,8 @@ _scsih_sas_device_status_change_event(struct MPT3SAS_ADAPTER *ioc,
|
|||
u64 sas_address;
|
||||
unsigned long flags;
|
||||
Mpi2EventDataSasDeviceStatusChange_t *event_data =
|
||||
fw_event->event_data;
|
||||
(Mpi2EventDataSasDeviceStatusChange_t *)
|
||||
fw_event->event_data;
|
||||
|
||||
#ifdef CONFIG_SCSI_MPT3SAS_LOGGING
|
||||
if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK)
|
||||
|
|
@ -5337,6 +5339,7 @@ _scsih_sas_enclosure_dev_status_change_event(struct MPT3SAS_ADAPTER *ioc,
|
|||
#ifdef CONFIG_SCSI_MPT3SAS_LOGGING
|
||||
if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK)
|
||||
_scsih_sas_enclosure_dev_status_change_event_debug(ioc,
|
||||
(Mpi2EventDataSasEnclDevStatusChange_t *)
|
||||
fw_event->event_data);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -5361,7 +5364,9 @@ _scsih_sas_broadcast_primitive_event(struct MPT3SAS_ADAPTER *ioc,
|
|||
u32 termination_count;
|
||||
u32 query_count;
|
||||
Mpi2SCSITaskManagementReply_t *mpi_reply;
|
||||
Mpi2EventDataSasBroadcastPrimitive_t *event_data = fw_event->event_data;
|
||||
Mpi2EventDataSasBroadcastPrimitive_t *event_data =
|
||||
(Mpi2EventDataSasBroadcastPrimitive_t *)
|
||||
fw_event->event_data;
|
||||
u16 ioc_status;
|
||||
unsigned long flags;
|
||||
int r;
|
||||
|
|
@ -5513,7 +5518,8 @@ static void
|
|||
_scsih_sas_discovery_event(struct MPT3SAS_ADAPTER *ioc,
|
||||
struct fw_event_work *fw_event)
|
||||
{
|
||||
Mpi2EventDataSasDiscovery_t *event_data = fw_event->event_data;
|
||||
Mpi2EventDataSasDiscovery_t *event_data =
|
||||
(Mpi2EventDataSasDiscovery_t *) fw_event->event_data;
|
||||
|
||||
#ifdef CONFIG_SCSI_MPT3SAS_LOGGING
|
||||
if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) {
|
||||
|
|
@ -5999,7 +6005,9 @@ _scsih_sas_ir_config_change_event(struct MPT3SAS_ADAPTER *ioc,
|
|||
Mpi2EventIrConfigElement_t *element;
|
||||
int i;
|
||||
u8 foreign_config;
|
||||
Mpi2EventDataIrConfigChangeList_t *event_data = fw_event->event_data;
|
||||
Mpi2EventDataIrConfigChangeList_t *event_data =
|
||||
(Mpi2EventDataIrConfigChangeList_t *)
|
||||
fw_event->event_data;
|
||||
|
||||
#ifdef CONFIG_SCSI_MPT3SAS_LOGGING
|
||||
if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK)
|
||||
|
|
@ -6069,7 +6077,8 @@ _scsih_sas_ir_volume_event(struct MPT3SAS_ADAPTER *ioc,
|
|||
u16 handle;
|
||||
u32 state;
|
||||
int rc;
|
||||
Mpi2EventDataIrVolume_t *event_data = fw_event->event_data;
|
||||
Mpi2EventDataIrVolume_t *event_data =
|
||||
(Mpi2EventDataIrVolume_t *) fw_event->event_data;
|
||||
|
||||
if (ioc->shost_recovery)
|
||||
return;
|
||||
|
|
@ -6152,7 +6161,8 @@ _scsih_sas_ir_physical_disk_event(struct MPT3SAS_ADAPTER *ioc,
|
|||
Mpi2ConfigReply_t mpi_reply;
|
||||
Mpi2SasDevicePage0_t sas_device_pg0;
|
||||
u32 ioc_status;
|
||||
Mpi2EventDataIrPhysicalDisk_t *event_data = fw_event->event_data;
|
||||
Mpi2EventDataIrPhysicalDisk_t *event_data =
|
||||
(Mpi2EventDataIrPhysicalDisk_t *) fw_event->event_data;
|
||||
u64 sas_address;
|
||||
|
||||
if (ioc->shost_recovery)
|
||||
|
|
@ -6272,7 +6282,9 @@ static void
|
|||
_scsih_sas_ir_operation_status_event(struct MPT3SAS_ADAPTER *ioc,
|
||||
struct fw_event_work *fw_event)
|
||||
{
|
||||
Mpi2EventDataIrOperationStatus_t *event_data = fw_event->event_data;
|
||||
Mpi2EventDataIrOperationStatus_t *event_data =
|
||||
(Mpi2EventDataIrOperationStatus_t *)
|
||||
fw_event->event_data;
|
||||
static struct _raid_device *raid_device;
|
||||
unsigned long flags;
|
||||
u16 handle;
|
||||
|
|
@ -7026,7 +7038,7 @@ static void
|
|||
_mpt3sas_fw_work(struct MPT3SAS_ADAPTER *ioc, struct fw_event_work *fw_event)
|
||||
{
|
||||
/* the queue is being flushed so ignore this event */
|
||||
if (ioc->remove_host || fw_event->cancel_pending_work ||
|
||||
if (ioc->remove_host ||
|
||||
ioc->pci_error_recovery) {
|
||||
_scsih_fw_event_free(ioc, fw_event);
|
||||
return;
|
||||
|
|
@ -7034,7 +7046,9 @@ _mpt3sas_fw_work(struct MPT3SAS_ADAPTER *ioc, struct fw_event_work *fw_event)
|
|||
|
||||
switch (fw_event->event) {
|
||||
case MPT3SAS_PROCESS_TRIGGER_DIAG:
|
||||
mpt3sas_process_trigger_data(ioc, fw_event->event_data);
|
||||
mpt3sas_process_trigger_data(ioc,
|
||||
(struct SL_WH_TRIGGERS_EVENT_DATA_T *)
|
||||
fw_event->event_data);
|
||||
break;
|
||||
case MPT3SAS_REMOVE_UNRESPONDING_DEVICES:
|
||||
while (scsi_host_in_recovery(ioc->shost) || ioc->shost_recovery)
|
||||
|
|
@ -7192,20 +7206,13 @@ mpt3sas_scsih_event_callback(struct MPT3SAS_ADAPTER *ioc, u8 msix_index,
|
|||
return 1;
|
||||
}
|
||||
|
||||
fw_event = kzalloc(sizeof(struct fw_event_work), GFP_ATOMIC);
|
||||
sz = le16_to_cpu(mpi_reply->EventDataLength) * 4;
|
||||
fw_event = kzalloc(sizeof(*fw_event) + sz, GFP_ATOMIC);
|
||||
if (!fw_event) {
|
||||
pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
|
||||
ioc->name, __FILE__, __LINE__, __func__);
|
||||
return 1;
|
||||
}
|
||||
sz = le16_to_cpu(mpi_reply->EventDataLength) * 4;
|
||||
fw_event->event_data = kzalloc(sz, GFP_ATOMIC);
|
||||
if (!fw_event->event_data) {
|
||||
pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
|
||||
ioc->name, __FILE__, __LINE__, __func__);
|
||||
kfree(fw_event);
|
||||
return 1;
|
||||
}
|
||||
|
||||
memcpy(fw_event->event_data, mpi_reply->EventData, sz);
|
||||
fw_event->ioc = ioc;
|
||||
|
|
@ -7431,9 +7438,9 @@ static void _scsih_remove(struct pci_dev *pdev)
|
|||
}
|
||||
|
||||
sas_remove_host(shost);
|
||||
scsi_remove_host(shost);
|
||||
mpt3sas_base_detach(ioc);
|
||||
list_del(&ioc->list);
|
||||
scsi_remove_host(shost);
|
||||
scsi_host_put(shost);
|
||||
}
|
||||
|
||||
|
|
@ -7801,13 +7808,6 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
|||
}
|
||||
}
|
||||
|
||||
if ((scsi_add_host(shost, &pdev->dev))) {
|
||||
pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
|
||||
ioc->name, __FILE__, __LINE__, __func__);
|
||||
list_del(&ioc->list);
|
||||
goto out_add_shost_fail;
|
||||
}
|
||||
|
||||
/* register EEDP capabilities with SCSI layer */
|
||||
if (prot_mask > 0)
|
||||
scsi_host_set_prot(shost, prot_mask);
|
||||
|
|
@ -7835,15 +7835,21 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
|||
ioc->name, __FILE__, __LINE__, __func__);
|
||||
goto out_attach_fail;
|
||||
}
|
||||
if ((scsi_add_host(shost, &pdev->dev))) {
|
||||
pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
|
||||
ioc->name, __FILE__, __LINE__, __func__);
|
||||
list_del(&ioc->list);
|
||||
goto out_add_shost_fail;
|
||||
}
|
||||
|
||||
scsi_scan_host(shost);
|
||||
return 0;
|
||||
|
||||
out_add_shost_fail:
|
||||
mpt3sas_base_detach(ioc);
|
||||
out_attach_fail:
|
||||
destroy_workqueue(ioc->firmware_event_thread);
|
||||
out_thread_fail:
|
||||
list_del(&ioc->list);
|
||||
scsi_remove_host(shost);
|
||||
out_add_shost_fail:
|
||||
scsi_host_put(shost);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6633,7 +6633,7 @@ static void ncr_sir_to_redo(struct ncb *np, int num, struct ccb *cp)
|
|||
** patch requested size into sense command
|
||||
*/
|
||||
cp->sensecmd[0] = 0x03;
|
||||
cp->sensecmd[1] = cmd->device->lun << 5;
|
||||
cp->sensecmd[1] = (cmd->device->lun & 0x7) << 5;
|
||||
cp->sensecmd[4] = sizeof(cp->sense_buf);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -264,11 +264,7 @@
|
|||
#define SCSI_NCR_SG_TABLESIZE (SCSI_NCR_MAX_SCATTER)
|
||||
#define SCSI_NCR_TIMER_INTERVAL (HZ)
|
||||
|
||||
#if 1 /* defined CONFIG_SCSI_MULTI_LUN */
|
||||
#define SCSI_NCR_MAX_LUN (16)
|
||||
#else
|
||||
#define SCSI_NCR_MAX_LUN (1)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IO functions definition for big/little endian CPU support.
|
||||
|
|
|
|||
|
|
@ -915,7 +915,7 @@ static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct s
|
|||
int ret;
|
||||
|
||||
nsp32_dbg(NSP32_DEBUG_QUEUECOMMAND,
|
||||
"enter. target: 0x%x LUN: 0x%x cmnd: 0x%x cmndlen: 0x%x "
|
||||
"enter. target: 0x%x LUN: 0x%llu cmnd: 0x%x cmndlen: 0x%x "
|
||||
"use_sg: 0x%x reqbuf: 0x%lx reqlen: 0x%x",
|
||||
SCpnt->device->id, SCpnt->device->lun, SCpnt->cmnd[0], SCpnt->cmd_len,
|
||||
scsi_sg_count(SCpnt), scsi_sglist(SCpnt), scsi_bufflen(SCpnt));
|
||||
|
|
|
|||
|
|
@ -607,8 +607,6 @@ static int pas16_release(struct Scsi_Host *shost)
|
|||
if (shost->irq)
|
||||
free_irq(shost->irq, shost);
|
||||
NCR5380_exit(shost);
|
||||
if (shost->dma_channel != 0xff)
|
||||
free_dma(shost->dma_channel);
|
||||
if (shost->io_port && shost->n_io_port)
|
||||
release_region(shost->io_port, shost->n_io_port);
|
||||
scsi_unregister(shost);
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt,
|
|||
nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata;
|
||||
|
||||
nsp_dbg(NSP_DEBUG_QUEUECOMMAND,
|
||||
"SCpnt=0x%p target=%d lun=%d sglist=0x%p bufflen=%d sg_count=%d",
|
||||
"SCpnt=0x%p target=%d lun=%llu sglist=0x%p bufflen=%d sg_count=%d",
|
||||
SCpnt, target, SCpnt->device->lun, scsi_sglist(SCpnt),
|
||||
scsi_bufflen(SCpnt), scsi_sg_count(SCpnt));
|
||||
//nsp_dbg(NSP_DEBUG_QUEUECOMMAND, "before CurrentSC=0x%p", data->CurrentSC);
|
||||
|
|
|
|||
|
|
@ -558,7 +558,7 @@ SYM53C500_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
|
|||
|
||||
DEB(printk("cmd=%02x, cmd_len=%02x, target=%02x, lun=%02x, bufflen=%d\n",
|
||||
SCpnt->cmnd[0], SCpnt->cmd_len, SCpnt->device->id,
|
||||
SCpnt->device->lun, scsi_bufflen(SCpnt)));
|
||||
(u8)SCpnt->device->lun, scsi_bufflen(SCpnt)));
|
||||
|
||||
VDEB(for (i = 0; i < SCpnt->cmd_len; i++)
|
||||
printk("cmd[%d]=%02x ", i, SCpnt->cmnd[i]));
|
||||
|
|
|
|||
|
|
@ -397,7 +397,10 @@ static ssize_t pm8001_ctl_bios_version_show(struct device *cdev,
|
|||
payload.func_specific = kzalloc(4096, GFP_KERNEL);
|
||||
if (!payload.func_specific)
|
||||
return -ENOMEM;
|
||||
PM8001_CHIP_DISP->get_nvmd_req(pm8001_ha, &payload);
|
||||
if (PM8001_CHIP_DISP->get_nvmd_req(pm8001_ha, &payload)) {
|
||||
kfree(payload.func_specific);
|
||||
return -ENOMEM;
|
||||
}
|
||||
wait_for_completion(&completion);
|
||||
virt_addr = pm8001_ha->memoryMap.region[NVMD].virt_ptr;
|
||||
for (bios_index = BIOSOFFSET; bios_index < BIOS_OFFSET_LIMIT;
|
||||
|
|
@ -614,11 +617,11 @@ static int pm8001_update_flash(struct pm8001_hba_info *pm8001_ha)
|
|||
|
||||
pm8001_ha->nvmd_completion = &completion;
|
||||
ret = PM8001_CHIP_DISP->fw_flash_update_req(pm8001_ha, payload);
|
||||
if (ret)
|
||||
break;
|
||||
wait_for_completion(&completion);
|
||||
if (ret || (fwControl->retcode > FLASH_UPDATE_IN_PROGRESS)) {
|
||||
if (fwControl->retcode > FLASH_UPDATE_IN_PROGRESS) {
|
||||
ret = fwControl->retcode;
|
||||
kfree(ioctlbuffer);
|
||||
ioctlbuffer = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1346,7 +1346,7 @@ int pm8001_mpi_build_cmd(struct pm8001_hba_info *pm8001_ha,
|
|||
&pMessage) < 0) {
|
||||
PM8001_IO_DBG(pm8001_ha,
|
||||
pm8001_printk("No free mpi buffer\n"));
|
||||
return -1;
|
||||
return -ENOMEM;
|
||||
}
|
||||
BUG_ON(!payload);
|
||||
/*Copy to the payload*/
|
||||
|
|
@ -1751,6 +1751,8 @@ static void pm8001_send_abort_all(struct pm8001_hba_info *pm8001_ha,
|
|||
task_abort.tag = cpu_to_le32(ccb_tag);
|
||||
|
||||
ret = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &task_abort, 0);
|
||||
if (ret)
|
||||
pm8001_tag_free(pm8001_ha, ccb_tag);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1778,6 +1780,7 @@ static void pm8001_send_read_log(struct pm8001_hba_info *pm8001_ha,
|
|||
|
||||
res = pm8001_tag_alloc(pm8001_ha, &ccb_tag);
|
||||
if (res) {
|
||||
sas_free_task(task);
|
||||
PM8001_FAIL_DBG(pm8001_ha,
|
||||
pm8001_printk("cannot allocate tag !!!\n"));
|
||||
return;
|
||||
|
|
@ -1788,14 +1791,14 @@ static void pm8001_send_read_log(struct pm8001_hba_info *pm8001_ha,
|
|||
*/
|
||||
dev = kzalloc(sizeof(struct domain_device), GFP_ATOMIC);
|
||||
if (!dev) {
|
||||
sas_free_task(task);
|
||||
pm8001_tag_free(pm8001_ha, ccb_tag);
|
||||
PM8001_FAIL_DBG(pm8001_ha,
|
||||
pm8001_printk("Domain device cannot be allocated\n"));
|
||||
sas_free_task(task);
|
||||
return;
|
||||
} else {
|
||||
task->dev = dev;
|
||||
task->dev->lldd_dev = pm8001_ha_dev;
|
||||
}
|
||||
task->dev = dev;
|
||||
task->dev->lldd_dev = pm8001_ha_dev;
|
||||
|
||||
ccb = &pm8001_ha->ccb_info[ccb_tag];
|
||||
ccb->device = pm8001_ha_dev;
|
||||
|
|
@ -1821,7 +1824,11 @@ static void pm8001_send_read_log(struct pm8001_hba_info *pm8001_ha,
|
|||
memcpy(&sata_cmd.sata_fis, &fis, sizeof(struct host_to_dev_fis));
|
||||
|
||||
res = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &sata_cmd, 0);
|
||||
|
||||
if (res) {
|
||||
sas_free_task(task);
|
||||
pm8001_tag_free(pm8001_ha, ccb_tag);
|
||||
kfree(dev);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -3100,7 +3107,7 @@ void pm8001_mpi_set_dev_state_resp(struct pm8001_hba_info *pm8001_ha,
|
|||
complete(pm8001_dev->setds_completion);
|
||||
ccb->task = NULL;
|
||||
ccb->ccb_tag = 0xFFFFFFFF;
|
||||
pm8001_ccb_free(pm8001_ha, tag);
|
||||
pm8001_tag_free(pm8001_ha, tag);
|
||||
}
|
||||
|
||||
void pm8001_mpi_set_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
|
||||
|
|
@ -3119,13 +3126,12 @@ void pm8001_mpi_set_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
|
|||
}
|
||||
ccb->task = NULL;
|
||||
ccb->ccb_tag = 0xFFFFFFFF;
|
||||
pm8001_ccb_free(pm8001_ha, tag);
|
||||
pm8001_tag_free(pm8001_ha, tag);
|
||||
}
|
||||
|
||||
void
|
||||
pm8001_mpi_get_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
|
||||
{
|
||||
struct fw_control_ex *fw_control_context;
|
||||
struct get_nvm_data_resp *pPayload =
|
||||
(struct get_nvm_data_resp *)(piomb + 4);
|
||||
u32 tag = le32_to_cpu(pPayload->tag);
|
||||
|
|
@ -3134,7 +3140,6 @@ pm8001_mpi_get_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
|
|||
u32 ir_tds_bn_dps_das_nvm =
|
||||
le32_to_cpu(pPayload->ir_tda_bn_dps_das_nvm);
|
||||
void *virt_addr = pm8001_ha->memoryMap.region[NVMD].virt_ptr;
|
||||
fw_control_context = ccb->fw_control_context;
|
||||
|
||||
PM8001_MSG_DBG(pm8001_ha, pm8001_printk("Get nvm data complete!\n"));
|
||||
if ((dlen_status & NVMD_STAT) != 0) {
|
||||
|
|
@ -3175,13 +3180,11 @@ pm8001_mpi_get_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
|
|||
pm8001_printk("Get NVMD success, IR=0, dataLen=%d\n",
|
||||
(dlen_status & NVMD_LEN) >> 24));
|
||||
}
|
||||
memcpy(fw_control_context->usrAddr,
|
||||
pm8001_ha->memoryMap.region[NVMD].virt_ptr,
|
||||
fw_control_context->len);
|
||||
complete(pm8001_ha->nvmd_completion);
|
||||
kfree(ccb->fw_control_context);
|
||||
ccb->task = NULL;
|
||||
ccb->ccb_tag = 0xFFFFFFFF;
|
||||
pm8001_ccb_free(pm8001_ha, tag);
|
||||
pm8001_tag_free(pm8001_ha, tag);
|
||||
complete(pm8001_ha->nvmd_completion);
|
||||
}
|
||||
|
||||
int pm8001_mpi_local_phy_ctl(struct pm8001_hba_info *pm8001_ha, void *piomb)
|
||||
|
|
@ -3588,7 +3591,7 @@ int pm8001_mpi_reg_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
|
|||
complete(pm8001_dev->dcompletion);
|
||||
ccb->task = NULL;
|
||||
ccb->ccb_tag = 0xFFFFFFFF;
|
||||
pm8001_ccb_free(pm8001_ha, htag);
|
||||
pm8001_tag_free(pm8001_ha, htag);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -3617,15 +3620,11 @@ int pm8001_mpi_fw_flash_update_resp(struct pm8001_hba_info *pm8001_ha,
|
|||
void *piomb)
|
||||
{
|
||||
u32 status;
|
||||
struct fw_control_ex fw_control_context;
|
||||
struct fw_flash_Update_resp *ppayload =
|
||||
(struct fw_flash_Update_resp *)(piomb + 4);
|
||||
u32 tag = le32_to_cpu(ppayload->tag);
|
||||
struct pm8001_ccb_info *ccb = &pm8001_ha->ccb_info[tag];
|
||||
status = le32_to_cpu(ppayload->status);
|
||||
memcpy(&fw_control_context,
|
||||
ccb->fw_control_context,
|
||||
sizeof(fw_control_context));
|
||||
switch (status) {
|
||||
case FLASH_UPDATE_COMPLETE_PENDING_REBOOT:
|
||||
PM8001_MSG_DBG(pm8001_ha,
|
||||
|
|
@ -3668,11 +3667,11 @@ int pm8001_mpi_fw_flash_update_resp(struct pm8001_hba_info *pm8001_ha,
|
|||
pm8001_printk("No matched status = %d\n", status));
|
||||
break;
|
||||
}
|
||||
ccb->fw_control_context->fw_control->retcode = status;
|
||||
complete(pm8001_ha->nvmd_completion);
|
||||
kfree(ccb->fw_control_context);
|
||||
ccb->task = NULL;
|
||||
ccb->ccb_tag = 0xFFFFFFFF;
|
||||
pm8001_ccb_free(pm8001_ha, tag);
|
||||
pm8001_tag_free(pm8001_ha, tag);
|
||||
complete(pm8001_ha->nvmd_completion);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -4257,7 +4256,11 @@ static int pm8001_chip_smp_req(struct pm8001_hba_info *pm8001_ha,
|
|||
smp_cmd.long_smp_req.long_resp_size =
|
||||
cpu_to_le32((u32)sg_dma_len(&task->smp_task.smp_resp)-4);
|
||||
build_smp_cmd(pm8001_dev->device_id, smp_cmd.tag, &smp_cmd);
|
||||
pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, (u32 *)&smp_cmd, 0);
|
||||
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc,
|
||||
(u32 *)&smp_cmd, 0);
|
||||
if (rc)
|
||||
goto err_out_2;
|
||||
|
||||
return 0;
|
||||
|
||||
err_out_2:
|
||||
|
|
@ -4398,7 +4401,7 @@ static int pm8001_chip_sata_req(struct pm8001_hba_info *pm8001_ha,
|
|||
|
||||
/* Check for read log for failed drive and return */
|
||||
if (sata_cmd.sata_fis.command == 0x2f) {
|
||||
if (pm8001_ha_dev && ((pm8001_ha_dev->id & NCQ_READ_LOG_FLAG) ||
|
||||
if (((pm8001_ha_dev->id & NCQ_READ_LOG_FLAG) ||
|
||||
(pm8001_ha_dev->id & NCQ_ABORT_ALL_FLAG) ||
|
||||
(pm8001_ha_dev->id & NCQ_2ND_RLE_FLAG))) {
|
||||
struct task_status_struct *ts;
|
||||
|
|
@ -4789,6 +4792,10 @@ int pm8001_chip_get_nvmd_req(struct pm8001_hba_info *pm8001_ha,
|
|||
break;
|
||||
}
|
||||
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &nvmd_req, 0);
|
||||
if (rc) {
|
||||
kfree(fw_control_context);
|
||||
pm8001_tag_free(pm8001_ha, tag);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -4869,6 +4876,10 @@ int pm8001_chip_set_nvmd_req(struct pm8001_hba_info *pm8001_ha,
|
|||
break;
|
||||
}
|
||||
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &nvmd_req, 0);
|
||||
if (rc) {
|
||||
kfree(fw_control_context);
|
||||
pm8001_tag_free(pm8001_ha, tag);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -5061,7 +5072,7 @@ pm8001_chip_sas_re_initialization(struct pm8001_hba_info *pm8001_ha)
|
|||
memset(&payload, 0, sizeof(payload));
|
||||
rc = pm8001_tag_alloc(pm8001_ha, &tag);
|
||||
if (rc)
|
||||
return -1;
|
||||
return -ENOMEM;
|
||||
ccb = &pm8001_ha->ccb_info[tag];
|
||||
ccb->ccb_tag = tag;
|
||||
circularQ = &pm8001_ha->inbnd_q_tbl[0];
|
||||
|
|
@ -5070,6 +5081,8 @@ pm8001_chip_sas_re_initialization(struct pm8001_hba_info *pm8001_ha)
|
|||
payload.sata_hol_tmo = cpu_to_le32(80);
|
||||
payload.open_reject_cmdretries_data_retries = cpu_to_le32(0xff00ff);
|
||||
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
|
||||
if (rc)
|
||||
pm8001_tag_free(pm8001_ha, tag);
|
||||
return rc;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -246,6 +246,7 @@ static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha,
|
|||
{
|
||||
int i;
|
||||
spin_lock_init(&pm8001_ha->lock);
|
||||
spin_lock_init(&pm8001_ha->bitmap_lock);
|
||||
PM8001_INIT_DBG(pm8001_ha,
|
||||
pm8001_printk("pm8001_alloc: PHY:%x\n",
|
||||
pm8001_ha->chip->n_phy));
|
||||
|
|
@ -621,6 +622,8 @@ static void pm8001_init_sas_add(struct pm8001_hba_info *pm8001_ha)
|
|||
DECLARE_COMPLETION_ONSTACK(completion);
|
||||
struct pm8001_ioctl_payload payload;
|
||||
u16 deviceid;
|
||||
int rc;
|
||||
|
||||
pci_read_config_word(pm8001_ha->pdev, PCI_DEVICE_ID, &deviceid);
|
||||
pm8001_ha->nvmd_completion = &completion;
|
||||
|
||||
|
|
@ -638,7 +641,16 @@ static void pm8001_init_sas_add(struct pm8001_hba_info *pm8001_ha)
|
|||
}
|
||||
payload.offset = 0;
|
||||
payload.func_specific = kzalloc(payload.length, GFP_KERNEL);
|
||||
PM8001_CHIP_DISP->get_nvmd_req(pm8001_ha, &payload);
|
||||
if (!payload.func_specific) {
|
||||
PM8001_INIT_DBG(pm8001_ha, pm8001_printk("mem alloc fail\n"));
|
||||
return;
|
||||
}
|
||||
rc = PM8001_CHIP_DISP->get_nvmd_req(pm8001_ha, &payload);
|
||||
if (rc) {
|
||||
kfree(payload.func_specific);
|
||||
PM8001_INIT_DBG(pm8001_ha, pm8001_printk("nvmd failed\n"));
|
||||
return;
|
||||
}
|
||||
wait_for_completion(&completion);
|
||||
|
||||
for (i = 0, j = 0; i <= 7; i++, j++) {
|
||||
|
|
@ -661,6 +673,7 @@ static void pm8001_init_sas_add(struct pm8001_hba_info *pm8001_ha)
|
|||
pm8001_printk("phy %d sas_addr = %016llx\n", i,
|
||||
pm8001_ha->phy[i].dev_sas_addr));
|
||||
}
|
||||
kfree(payload.func_specific);
|
||||
#else
|
||||
for (i = 0; i < pm8001_ha->chip->n_phy; i++) {
|
||||
pm8001_ha->phy[i].dev_sas_addr = 0x50010c600047f9d0ULL;
|
||||
|
|
@ -684,6 +697,7 @@ static int pm8001_get_phy_settings_info(struct pm8001_hba_info *pm8001_ha)
|
|||
/*OPTION ROM FLASH read for the SPC cards */
|
||||
DECLARE_COMPLETION_ONSTACK(completion);
|
||||
struct pm8001_ioctl_payload payload;
|
||||
int rc;
|
||||
|
||||
pm8001_ha->nvmd_completion = &completion;
|
||||
/* SAS ADDRESS read from flash / EEPROM */
|
||||
|
|
@ -694,7 +708,12 @@ static int pm8001_get_phy_settings_info(struct pm8001_hba_info *pm8001_ha)
|
|||
if (!payload.func_specific)
|
||||
return -ENOMEM;
|
||||
/* Read phy setting values from flash */
|
||||
PM8001_CHIP_DISP->get_nvmd_req(pm8001_ha, &payload);
|
||||
rc = PM8001_CHIP_DISP->get_nvmd_req(pm8001_ha, &payload);
|
||||
if (rc) {
|
||||
kfree(payload.func_specific);
|
||||
PM8001_INIT_DBG(pm8001_ha, pm8001_printk("nvmd failed\n"));
|
||||
return -ENOMEM;
|
||||
}
|
||||
wait_for_completion(&completion);
|
||||
pm8001_set_phy_profile(pm8001_ha, sizeof(u8), payload.func_specific);
|
||||
kfree(payload.func_specific);
|
||||
|
|
@ -744,9 +763,10 @@ static u32 pm8001_setup_msix(struct pm8001_hba_info *pm8001_ha)
|
|||
pm8001_ha->irq_vector[i].irq_id = i;
|
||||
pm8001_ha->irq_vector[i].drv_inst = pm8001_ha;
|
||||
|
||||
if (request_irq(pm8001_ha->msix_entries[i].vector,
|
||||
rc = request_irq(pm8001_ha->msix_entries[i].vector,
|
||||
pm8001_interrupt_handler_msix, flag,
|
||||
intr_drvname[i], &(pm8001_ha->irq_vector[i]))) {
|
||||
intr_drvname[i], &(pm8001_ha->irq_vector[i]));
|
||||
if (rc) {
|
||||
for (j = 0; j < i; j++)
|
||||
free_irq(
|
||||
pm8001_ha->msix_entries[j].vector,
|
||||
|
|
@ -964,6 +984,7 @@ static int pm8001_pci_suspend(struct pci_dev *pdev, pm_message_t state)
|
|||
int i, j;
|
||||
u32 device_state;
|
||||
pm8001_ha = sha->lldd_ha;
|
||||
sas_suspend_ha(sha);
|
||||
flush_workqueue(pm8001_wq);
|
||||
scsi_block_requests(pm8001_ha->shost);
|
||||
if (!pdev->pm_cap) {
|
||||
|
|
@ -1013,6 +1034,7 @@ static int pm8001_pci_resume(struct pci_dev *pdev)
|
|||
int rc;
|
||||
u8 i = 0, j;
|
||||
u32 device_state;
|
||||
DECLARE_COMPLETION_ONSTACK(completion);
|
||||
pm8001_ha = sha->lldd_ha;
|
||||
device_state = pdev->current_state;
|
||||
|
||||
|
|
@ -1033,7 +1055,7 @@ static int pm8001_pci_resume(struct pci_dev *pdev)
|
|||
rc = pci_go_44(pdev);
|
||||
if (rc)
|
||||
goto err_out_disable;
|
||||
|
||||
sas_prep_resume_ha(sha);
|
||||
/* chip soft rst only for spc */
|
||||
if (pm8001_ha->chip_id == chip_8001) {
|
||||
PM8001_CHIP_DISP->chip_soft_rst(pm8001_ha);
|
||||
|
|
@ -1065,7 +1087,13 @@ static int pm8001_pci_resume(struct pci_dev *pdev)
|
|||
for (i = 1; i < pm8001_ha->number_of_intr; i++)
|
||||
PM8001_CHIP_DISP->interrupt_enable(pm8001_ha, i);
|
||||
}
|
||||
scsi_unblock_requests(pm8001_ha->shost);
|
||||
pm8001_ha->flags = PM8001F_RUN_TIME;
|
||||
for (i = 0; i < pm8001_ha->chip->n_phy; i++) {
|
||||
pm8001_ha->phy[i].enable_completion = &completion;
|
||||
PM8001_CHIP_DISP->phy_start_req(pm8001_ha, i);
|
||||
wait_for_completion(&completion);
|
||||
}
|
||||
sas_resume_ha(sha);
|
||||
return 0;
|
||||
|
||||
err_out_disable:
|
||||
|
|
|
|||
|
|
@ -58,27 +58,16 @@ static int pm8001_find_tag(struct sas_task *task, u32 *tag)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm8001_tag_clear - clear the tags bitmap
|
||||
* pm8001_tag_free - free the no more needed tag
|
||||
* @pm8001_ha: our hba struct
|
||||
* @tag: the found tag associated with the task
|
||||
*/
|
||||
static void pm8001_tag_clear(struct pm8001_hba_info *pm8001_ha, u32 tag)
|
||||
void pm8001_tag_free(struct pm8001_hba_info *pm8001_ha, u32 tag)
|
||||
{
|
||||
void *bitmap = pm8001_ha->tags;
|
||||
clear_bit(tag, bitmap);
|
||||
}
|
||||
|
||||
void pm8001_tag_free(struct pm8001_hba_info *pm8001_ha, u32 tag)
|
||||
{
|
||||
pm8001_tag_clear(pm8001_ha, tag);
|
||||
}
|
||||
|
||||
static void pm8001_tag_set(struct pm8001_hba_info *pm8001_ha, u32 tag)
|
||||
{
|
||||
void *bitmap = pm8001_ha->tags;
|
||||
set_bit(tag, bitmap);
|
||||
}
|
||||
|
||||
/**
|
||||
* pm8001_tag_alloc - allocate a empty tag for task used.
|
||||
* @pm8001_ha: our hba struct
|
||||
|
|
@ -86,14 +75,18 @@ static void pm8001_tag_set(struct pm8001_hba_info *pm8001_ha, u32 tag)
|
|||
*/
|
||||
inline int pm8001_tag_alloc(struct pm8001_hba_info *pm8001_ha, u32 *tag_out)
|
||||
{
|
||||
unsigned int index, tag;
|
||||
unsigned int tag;
|
||||
void *bitmap = pm8001_ha->tags;
|
||||
unsigned long flags;
|
||||
|
||||
index = find_first_zero_bit(bitmap, pm8001_ha->tags_num);
|
||||
tag = index;
|
||||
if (tag >= pm8001_ha->tags_num)
|
||||
spin_lock_irqsave(&pm8001_ha->bitmap_lock, flags);
|
||||
tag = find_first_zero_bit(bitmap, pm8001_ha->tags_num);
|
||||
if (tag >= pm8001_ha->tags_num) {
|
||||
spin_unlock_irqrestore(&pm8001_ha->bitmap_lock, flags);
|
||||
return -SAS_QUEUE_FULL;
|
||||
pm8001_tag_set(pm8001_ha, tag);
|
||||
}
|
||||
set_bit(tag, bitmap);
|
||||
spin_unlock_irqrestore(&pm8001_ha->bitmap_lock, flags);
|
||||
*tag_out = tag;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -102,7 +95,7 @@ void pm8001_tag_init(struct pm8001_hba_info *pm8001_ha)
|
|||
{
|
||||
int i;
|
||||
for (i = 0; i < pm8001_ha->tags_num; ++i)
|
||||
pm8001_tag_clear(pm8001_ha, i);
|
||||
pm8001_tag_free(pm8001_ha, i);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -501,11 +494,6 @@ int pm8001_queue_command(struct sas_task *task, const int num,
|
|||
return pm8001_task_exec(task, num, gfp_flags, 0, NULL);
|
||||
}
|
||||
|
||||
void pm8001_ccb_free(struct pm8001_hba_info *pm8001_ha, u32 ccb_idx)
|
||||
{
|
||||
pm8001_tag_clear(pm8001_ha, ccb_idx);
|
||||
}
|
||||
|
||||
/**
|
||||
* pm8001_ccb_task_free - free the sg for ssp and smp command, free the ccb.
|
||||
* @pm8001_ha: our hba card information
|
||||
|
|
@ -542,7 +530,7 @@ void pm8001_ccb_task_free(struct pm8001_hba_info *pm8001_ha,
|
|||
ccb->task = NULL;
|
||||
ccb->ccb_tag = 0xFFFFFFFF;
|
||||
ccb->open_retry = 0;
|
||||
pm8001_ccb_free(pm8001_ha, ccb_idx);
|
||||
pm8001_tag_free(pm8001_ha, ccb_idx);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -475,6 +475,7 @@ struct pm8001_hba_info {
|
|||
struct list_head list;
|
||||
unsigned long flags;
|
||||
spinlock_t lock;/* host-wide lock */
|
||||
spinlock_t bitmap_lock;
|
||||
struct pci_dev *pdev;/* our device */
|
||||
struct device *dev;
|
||||
struct pm8001_hba_memspace io_mem[6];
|
||||
|
|
@ -616,7 +617,6 @@ extern struct workqueue_struct *pm8001_wq;
|
|||
int pm8001_tag_alloc(struct pm8001_hba_info *pm8001_ha, u32 *tag_out);
|
||||
void pm8001_tag_init(struct pm8001_hba_info *pm8001_ha);
|
||||
u32 pm8001_get_ncq_tag(struct sas_task *task, u32 *tag);
|
||||
void pm8001_ccb_free(struct pm8001_hba_info *pm8001_ha, u32 ccb_idx);
|
||||
void pm8001_ccb_task_free(struct pm8001_hba_info *pm8001_ha,
|
||||
struct sas_task *task, struct pm8001_ccb_info *ccb, u32 ccb_idx);
|
||||
int pm8001_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func,
|
||||
|
|
|
|||
|
|
@ -856,6 +856,8 @@ pm80xx_set_thermal_config(struct pm8001_hba_info *pm8001_ha)
|
|||
payload.cfg_pg[1] = (LTEMPHIL << 24) | (RTEMPHIL << 8);
|
||||
|
||||
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
|
||||
if (rc)
|
||||
pm8001_tag_free(pm8001_ha, tag);
|
||||
return rc;
|
||||
|
||||
}
|
||||
|
|
@ -936,6 +938,8 @@ pm80xx_set_sas_protocol_timer_config(struct pm8001_hba_info *pm8001_ha)
|
|||
sizeof(SASProtocolTimerConfig_t));
|
||||
|
||||
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
|
||||
if (rc)
|
||||
pm8001_tag_free(pm8001_ha, tag);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -948,7 +952,7 @@ static int
|
|||
pm80xx_get_encrypt_info(struct pm8001_hba_info *pm8001_ha)
|
||||
{
|
||||
u32 scratch3_value;
|
||||
int ret;
|
||||
int ret = -1;
|
||||
|
||||
/* Read encryption status from SCRATCH PAD 3 */
|
||||
scratch3_value = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_3);
|
||||
|
|
@ -982,7 +986,7 @@ pm80xx_get_encrypt_info(struct pm8001_hba_info *pm8001_ha)
|
|||
pm8001_ha->encrypt_info.status = 0xFFFFFFFF;
|
||||
pm8001_ha->encrypt_info.cipher_mode = 0;
|
||||
pm8001_ha->encrypt_info.sec_mode = 0;
|
||||
return 0;
|
||||
ret = 0;
|
||||
} else if ((scratch3_value & SCRATCH_PAD3_ENC_MASK) ==
|
||||
SCRATCH_PAD3_ENC_DIS_ERR) {
|
||||
pm8001_ha->encrypt_info.status =
|
||||
|
|
@ -1004,7 +1008,6 @@ pm80xx_get_encrypt_info(struct pm8001_hba_info *pm8001_ha)
|
|||
scratch3_value, pm8001_ha->encrypt_info.cipher_mode,
|
||||
pm8001_ha->encrypt_info.sec_mode,
|
||||
pm8001_ha->encrypt_info.status));
|
||||
ret = -1;
|
||||
} else if ((scratch3_value & SCRATCH_PAD3_ENC_MASK) ==
|
||||
SCRATCH_PAD3_ENC_ENA_ERR) {
|
||||
|
||||
|
|
@ -1028,7 +1031,6 @@ pm80xx_get_encrypt_info(struct pm8001_hba_info *pm8001_ha)
|
|||
scratch3_value, pm8001_ha->encrypt_info.cipher_mode,
|
||||
pm8001_ha->encrypt_info.sec_mode,
|
||||
pm8001_ha->encrypt_info.status));
|
||||
ret = -1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -1059,6 +1061,8 @@ static int pm80xx_encrypt_update(struct pm8001_hba_info *pm8001_ha)
|
|||
KEK_MGMT_SUBOP_KEYCARDUPDATE);
|
||||
|
||||
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
|
||||
if (rc)
|
||||
pm8001_tag_free(pm8001_ha, tag);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1383,8 +1387,10 @@ static void pm80xx_send_abort_all(struct pm8001_hba_info *pm8001_ha,
|
|||
task->task_done = pm8001_task_done;
|
||||
|
||||
res = pm8001_tag_alloc(pm8001_ha, &ccb_tag);
|
||||
if (res)
|
||||
if (res) {
|
||||
sas_free_task(task);
|
||||
return;
|
||||
}
|
||||
|
||||
ccb = &pm8001_ha->ccb_info[ccb_tag];
|
||||
ccb->device = pm8001_ha_dev;
|
||||
|
|
@ -1399,7 +1405,10 @@ static void pm80xx_send_abort_all(struct pm8001_hba_info *pm8001_ha,
|
|||
task_abort.tag = cpu_to_le32(ccb_tag);
|
||||
|
||||
ret = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &task_abort, 0);
|
||||
|
||||
if (ret) {
|
||||
sas_free_task(task);
|
||||
pm8001_tag_free(pm8001_ha, ccb_tag);
|
||||
}
|
||||
}
|
||||
|
||||
static void pm80xx_send_read_log(struct pm8001_hba_info *pm8001_ha,
|
||||
|
|
@ -1426,6 +1435,7 @@ static void pm80xx_send_read_log(struct pm8001_hba_info *pm8001_ha,
|
|||
|
||||
res = pm8001_tag_alloc(pm8001_ha, &ccb_tag);
|
||||
if (res) {
|
||||
sas_free_task(task);
|
||||
PM8001_FAIL_DBG(pm8001_ha,
|
||||
pm8001_printk("cannot allocate tag !!!\n"));
|
||||
return;
|
||||
|
|
@ -1436,15 +1446,16 @@ static void pm80xx_send_read_log(struct pm8001_hba_info *pm8001_ha,
|
|||
*/
|
||||
dev = kzalloc(sizeof(struct domain_device), GFP_ATOMIC);
|
||||
if (!dev) {
|
||||
sas_free_task(task);
|
||||
pm8001_tag_free(pm8001_ha, ccb_tag);
|
||||
PM8001_FAIL_DBG(pm8001_ha,
|
||||
pm8001_printk("Domain device cannot be allocated\n"));
|
||||
sas_free_task(task);
|
||||
return;
|
||||
} else {
|
||||
task->dev = dev;
|
||||
task->dev->lldd_dev = pm8001_ha_dev;
|
||||
}
|
||||
|
||||
task->dev = dev;
|
||||
task->dev->lldd_dev = pm8001_ha_dev;
|
||||
|
||||
ccb = &pm8001_ha->ccb_info[ccb_tag];
|
||||
ccb->device = pm8001_ha_dev;
|
||||
ccb->ccb_tag = ccb_tag;
|
||||
|
|
@ -1469,7 +1480,11 @@ static void pm80xx_send_read_log(struct pm8001_hba_info *pm8001_ha,
|
|||
memcpy(&sata_cmd.sata_fis, &fis, sizeof(struct host_to_dev_fis));
|
||||
|
||||
res = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &sata_cmd, 0);
|
||||
|
||||
if (res) {
|
||||
sas_free_task(task);
|
||||
pm8001_tag_free(pm8001_ha, ccb_tag);
|
||||
kfree(dev);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -3815,7 +3830,10 @@ static int pm80xx_chip_smp_req(struct pm8001_hba_info *pm8001_ha,
|
|||
|
||||
build_smp_cmd(pm8001_dev->device_id, smp_cmd.tag,
|
||||
&smp_cmd, pm8001_ha->smp_exp_mode, length);
|
||||
pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, (u32 *)&smp_cmd, 0);
|
||||
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc,
|
||||
(u32 *)&smp_cmd, 0);
|
||||
if (rc)
|
||||
goto err_out_2;
|
||||
return 0;
|
||||
|
||||
err_out_2:
|
||||
|
|
@ -4406,6 +4424,8 @@ static int pm80xx_chip_reg_dev_req(struct pm8001_hba_info *pm8001_ha,
|
|||
SAS_ADDR_SIZE);
|
||||
|
||||
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
|
||||
if (rc)
|
||||
pm8001_tag_free(pm8001_ha, tag);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -4484,7 +4504,9 @@ void mpi_set_phy_profile_req(struct pm8001_hba_info *pm8001_ha,
|
|||
payload.reserved[j] = cpu_to_le32(*((u32 *)buf + i));
|
||||
j++;
|
||||
}
|
||||
pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
|
||||
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
|
||||
if (rc)
|
||||
pm8001_tag_free(pm8001_ha, tag);
|
||||
}
|
||||
|
||||
void pm8001_set_phy_profile(struct pm8001_hba_info *pm8001_ha,
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ static int pmcraid_slave_configure(struct scsi_device *scsi_dev)
|
|||
scsi_dev->host->unique_id,
|
||||
scsi_dev->channel,
|
||||
scsi_dev->id,
|
||||
scsi_dev->lun);
|
||||
(u8)scsi_dev->lun);
|
||||
|
||||
if (RES_IS_GSCSI(res->cfg_entry)) {
|
||||
scsi_dev->allow_restart = 1;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ static int ps3rom_slave_configure(struct scsi_device *scsi_dev)
|
|||
struct ps3rom_private *priv = shost_priv(scsi_dev->host);
|
||||
struct ps3_storage_device *dev = priv->dev;
|
||||
|
||||
dev_dbg(&dev->sbd.core, "%s:%u: id %u, lun %u, channel %u\n", __func__,
|
||||
dev_dbg(&dev->sbd.core, "%s:%u: id %u, lun %llu, channel %u\n", __func__,
|
||||
__LINE__, scsi_dev->id, scsi_dev->lun, scsi_dev->channel);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -320,8 +320,8 @@ struct srb_iocb {
|
|||
* defined in tsk_mgmt_entry struct
|
||||
* for control_flags field in qla_fw.h.
|
||||
*/
|
||||
uint64_t lun;
|
||||
uint32_t flags;
|
||||
uint32_t lun;
|
||||
uint32_t data;
|
||||
struct completion comp;
|
||||
__le16 comp_status;
|
||||
|
|
@ -2529,8 +2529,8 @@ struct isp_operations {
|
|||
void (*disable_intrs) (struct qla_hw_data *);
|
||||
|
||||
int (*abort_command) (srb_t *);
|
||||
int (*target_reset) (struct fc_port *, unsigned int, int);
|
||||
int (*lun_reset) (struct fc_port *, unsigned int, int);
|
||||
int (*target_reset) (struct fc_port *, uint64_t, int);
|
||||
int (*lun_reset) (struct fc_port *, uint64_t, int);
|
||||
int (*fabric_login) (struct scsi_qla_host *, uint16_t, uint8_t,
|
||||
uint8_t, uint8_t, uint16_t *, uint8_t);
|
||||
int (*fabric_logout) (struct scsi_qla_host *, uint16_t, uint8_t,
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ extern int ql2xenabledif;
|
|||
extern int ql2xenablehba_err_chk;
|
||||
extern int ql2xtargetreset;
|
||||
extern int ql2xdontresethba;
|
||||
extern unsigned int ql2xmaxlun;
|
||||
extern uint64_t ql2xmaxlun;
|
||||
extern int ql2xmdcapmask;
|
||||
extern int ql2xmdenable;
|
||||
|
||||
|
|
@ -212,7 +212,7 @@ extern void qla2x00_build_scsi_iocbs_64(srb_t *, cmd_entry_t *, uint16_t);
|
|||
extern int qla2x00_start_scsi(srb_t *sp);
|
||||
extern int qla24xx_start_scsi(srb_t *sp);
|
||||
int qla2x00_marker(struct scsi_qla_host *, struct req_que *, struct rsp_que *,
|
||||
uint16_t, uint16_t, uint8_t);
|
||||
uint16_t, uint64_t, uint8_t);
|
||||
extern int qla2x00_start_sp(srb_t *);
|
||||
extern int qla24xx_dif_start_scsi(srb_t *);
|
||||
extern int qla2x00_start_bidir(srb_t *, struct scsi_qla_host *, uint32_t);
|
||||
|
|
@ -262,10 +262,10 @@ extern int
|
|||
qla2x00_abort_command(srb_t *);
|
||||
|
||||
extern int
|
||||
qla2x00_abort_target(struct fc_port *, unsigned int, int);
|
||||
qla2x00_abort_target(struct fc_port *, uint64_t, int);
|
||||
|
||||
extern int
|
||||
qla2x00_lun_reset(struct fc_port *, unsigned int, int);
|
||||
qla2x00_lun_reset(struct fc_port *, uint64_t, int);
|
||||
|
||||
extern int
|
||||
qla2x00_get_adapter_id(scsi_qla_host_t *, uint16_t *, uint8_t *, uint8_t *,
|
||||
|
|
@ -339,12 +339,12 @@ qla24xx_get_isp_stats(scsi_qla_host_t *, struct link_statistics *,
|
|||
extern int qla24xx_abort_command(srb_t *);
|
||||
extern int qla24xx_async_abort_command(srb_t *);
|
||||
extern int
|
||||
qla24xx_abort_target(struct fc_port *, unsigned int, int);
|
||||
qla24xx_abort_target(struct fc_port *, uint64_t, int);
|
||||
extern int
|
||||
qla24xx_lun_reset(struct fc_port *, unsigned int, int);
|
||||
qla24xx_lun_reset(struct fc_port *, uint64_t, int);
|
||||
extern int
|
||||
qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *, unsigned int,
|
||||
unsigned int, enum nexus_wait_type);
|
||||
uint64_t, enum nexus_wait_type);
|
||||
extern int
|
||||
qla2x00_system_error(scsi_qla_host_t *);
|
||||
|
||||
|
|
@ -617,8 +617,8 @@ extern char *qlafx00_fw_version_str(struct scsi_qla_host *, char *);
|
|||
extern irqreturn_t qlafx00_intr_handler(int, void *);
|
||||
extern void qlafx00_enable_intrs(struct qla_hw_data *);
|
||||
extern void qlafx00_disable_intrs(struct qla_hw_data *);
|
||||
extern int qlafx00_abort_target(fc_port_t *, unsigned int, int);
|
||||
extern int qlafx00_lun_reset(fc_port_t *, unsigned int, int);
|
||||
extern int qlafx00_abort_target(fc_port_t *, uint64_t, int);
|
||||
extern int qlafx00_lun_reset(fc_port_t *, uint64_t, int);
|
||||
extern int qlafx00_start_scsi(srb_t *);
|
||||
extern int qlafx00_abort_isp(scsi_qla_host_t *);
|
||||
extern int qlafx00_iospace_config(struct qla_hw_data *);
|
||||
|
|
|
|||
|
|
@ -1526,8 +1526,8 @@ try_fce:
|
|||
FCE_SIZE, ha->fce, ha->fce_dma);
|
||||
|
||||
/* Allocate memory for Fibre Channel Event Buffer. */
|
||||
tc = dma_alloc_coherent(&ha->pdev->dev, FCE_SIZE, &tc_dma,
|
||||
GFP_KERNEL);
|
||||
tc = dma_zalloc_coherent(&ha->pdev->dev, FCE_SIZE, &tc_dma,
|
||||
GFP_KERNEL);
|
||||
if (!tc) {
|
||||
ql_log(ql_log_warn, vha, 0x00be,
|
||||
"Unable to allocate (%d KB) for FCE.\n",
|
||||
|
|
@ -1535,7 +1535,6 @@ try_fce:
|
|||
goto try_eft;
|
||||
}
|
||||
|
||||
memset(tc, 0, FCE_SIZE);
|
||||
rval = qla2x00_enable_fce_trace(vha, tc_dma, FCE_NUM_BUFFERS,
|
||||
ha->fce_mb, &ha->fce_bufs);
|
||||
if (rval) {
|
||||
|
|
@ -1560,8 +1559,8 @@ try_eft:
|
|||
EFT_SIZE, ha->eft, ha->eft_dma);
|
||||
|
||||
/* Allocate memory for Extended Trace Buffer. */
|
||||
tc = dma_alloc_coherent(&ha->pdev->dev, EFT_SIZE, &tc_dma,
|
||||
GFP_KERNEL);
|
||||
tc = dma_zalloc_coherent(&ha->pdev->dev, EFT_SIZE, &tc_dma,
|
||||
GFP_KERNEL);
|
||||
if (!tc) {
|
||||
ql_log(ql_log_warn, vha, 0x00c1,
|
||||
"Unable to allocate (%d KB) for EFT.\n",
|
||||
|
|
@ -1569,7 +1568,6 @@ try_eft:
|
|||
goto cont_alloc;
|
||||
}
|
||||
|
||||
memset(tc, 0, EFT_SIZE);
|
||||
rval = qla2x00_enable_eft_trace(vha, tc_dma, EFT_NUM_BUFFERS);
|
||||
if (rval) {
|
||||
ql_log(ql_log_warn, vha, 0x00c2,
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue