From 3f653a0515e027eea27a386bad8ea1a2e85135c3 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 9 Apr 2021 20:49:55 -0700 Subject: [PATCH] Introduce struct scsi_status Change the type of scsi_cmnd.result from 'int' into 'struct scsi_status'. Modify scsi_status_is_good(), status_byte(), msg_byte(), host_byte() and driver_byte() such that these support the current 'int' argument type and also the new 'struct scsi_status' argument type. Cc: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Cc: John Garry Signed-off-by: Bart Van Assche --- block/bsg.c | 2 +- block/scsi_ioctl.c | 6 +- drivers/ata/libata-sata.c | 2 +- drivers/ata/libata-scsi.c | 60 ++++---- drivers/block/pktcdvd.c | 2 +- drivers/cdrom/cdrom.c | 2 +- drivers/firewire/sbp2.c | 2 +- drivers/ide/ide-atapi.c | 10 +- drivers/ide/ide-cd.c | 20 +-- drivers/ide/ide-cd_ioctl.c | 2 +- drivers/ide/ide-devsets.c | 4 +- drivers/ide/ide-dma.c | 2 +- drivers/ide/ide-eh.c | 36 ++--- drivers/ide/ide-floppy.c | 10 +- drivers/ide/ide-io.c | 10 +- drivers/ide/ide-ioctls.c | 4 +- drivers/ide/ide-park.c | 2 +- drivers/ide/ide-pm.c | 6 +- drivers/ide/ide-tape.c | 4 +- drivers/ide/ide-taskfile.c | 6 +- drivers/infiniband/ulp/srp/ib_srp.c | 16 +- drivers/message/fusion/mptfc.c | 6 +- drivers/message/fusion/mptsas.c | 2 +- drivers/message/fusion/mptscsih.c | 70 ++++----- drivers/message/fusion/mptspi.c | 4 +- drivers/s390/scsi/zfcp_dbf.h | 2 +- drivers/s390/scsi/zfcp_fc.c | 4 +- drivers/s390/scsi/zfcp_fc.h | 2 +- drivers/s390/scsi/zfcp_scsi.c | 6 +- drivers/scsi/3w-9xxx.c | 12 +- drivers/scsi/3w-sas.c | 8 +- drivers/scsi/3w-xxxx.c | 20 +-- drivers/scsi/53c700.c | 4 +- drivers/scsi/BusLogic.c | 21 +-- drivers/scsi/NCR5380.c | 26 ++-- drivers/scsi/a100u2w.c | 2 +- drivers/scsi/aacraid/aachba.c | 142 +++++++++--------- drivers/scsi/advansys.c | 4 +- drivers/scsi/aha152x.c | 4 +- drivers/scsi/aha1542.c | 4 +- drivers/scsi/aha1740.c | 4 +- drivers/scsi/aic7xxx/aic79xx_osm.c | 10 +- drivers/scsi/aic7xxx/aic79xx_osm.h | 16 +- drivers/scsi/aic7xxx/aic7xxx_osm.c | 8 +- drivers/scsi/aic7xxx/aic7xxx_osm.h | 16 +- drivers/scsi/arcmsr/arcmsr_hba.c | 38 ++--- drivers/scsi/arm/acornscsi.c | 12 +- drivers/scsi/arm/fas216.c | 9 +- drivers/scsi/atp870u.c | 14 +- drivers/scsi/be2iscsi/be_main.c | 12 +- drivers/scsi/bfa/bfad_im.c | 30 ++-- drivers/scsi/bnx2fc/bnx2fc_io.c | 12 +- drivers/scsi/csiostor/csio_scsi.c | 10 +- drivers/scsi/cxlflash/main.c | 31 ++-- drivers/scsi/dc395x.c | 32 ++-- drivers/scsi/dpt_i2o.c | 28 ++-- drivers/scsi/esas2r/esas2r_main.c | 10 +- drivers/scsi/esp_scsi.c | 10 +- drivers/scsi/fdomain.c | 4 +- drivers/scsi/fnic/fnic_scsi.c | 38 ++--- drivers/scsi/hosts.c | 2 +- drivers/scsi/hpsa.c | 74 ++++----- drivers/scsi/hptiop.c | 20 +-- drivers/scsi/ibmvscsi/ibmvfc.c | 24 +-- drivers/scsi/ibmvscsi/ibmvscsi.c | 16 +- drivers/scsi/imm.c | 10 +- drivers/scsi/initio.c | 2 +- drivers/scsi/ipr.c | 34 ++--- drivers/scsi/ips.c | 72 ++++----- drivers/scsi/libfc/fc_fcp.c | 34 ++--- drivers/scsi/libiscsi.c | 46 +++--- drivers/scsi/libsas/sas_scsi_host.c | 8 +- drivers/scsi/lpfc/lpfc_scsi.c | 70 ++++----- drivers/scsi/mac53c94.c | 2 +- drivers/scsi/megaraid.c | 42 +++--- drivers/scsi/megaraid/megaraid_mbox.c | 54 +++---- drivers/scsi/megaraid/megaraid_sas_base.c | 30 ++-- drivers/scsi/megaraid/megaraid_sas_fusion.c | 20 +-- drivers/scsi/mesh.c | 11 +- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 78 +++++----- drivers/scsi/mvumi.c | 18 +-- drivers/scsi/myrb.c | 48 +++--- drivers/scsi/myrs.c | 14 +- drivers/scsi/ncr53c8xx.c | 2 +- drivers/scsi/nsp32.c | 38 ++--- drivers/scsi/pcmcia/nsp_cs.c | 17 ++- drivers/scsi/pcmcia/sym53c500_cs.c | 12 +- drivers/scsi/pmcraid.c | 28 ++-- drivers/scsi/ppa.c | 12 +- drivers/scsi/ps3rom.c | 10 +- drivers/scsi/qedf/qedf_io.c | 25 +-- drivers/scsi/qedi/qedi_fw.c | 2 +- drivers/scsi/qla1280.c | 2 +- drivers/scsi/qla2xxx/qla_iocb.c | 4 +- drivers/scsi/qla2xxx/qla_isr.c | 14 +- drivers/scsi/qla2xxx/qla_mr.c | 4 +- drivers/scsi/qla2xxx/qla_os.c | 26 ++-- drivers/scsi/qla4xxx/ql4_bsg.c | 76 +++++----- drivers/scsi/qla4xxx/ql4_isr.c | 32 ++-- drivers/scsi/qla4xxx/ql4_os.c | 14 +- drivers/scsi/qlogicfas408.c | 4 +- drivers/scsi/qlogicpti.c | 6 +- drivers/scsi/scsi.c | 9 +- drivers/scsi/scsi_debug.c | 26 ++-- drivers/scsi/scsi_debugfs.c | 2 +- drivers/scsi/scsi_error.c | 12 +- drivers/scsi/scsi_lib.c | 20 +-- drivers/scsi/scsi_logging.c | 4 +- drivers/scsi/scsi_transport_iscsi.c | 2 +- drivers/scsi/sd.c | 4 +- drivers/scsi/sd_zbc.c | 4 +- drivers/scsi/sg.c | 2 +- drivers/scsi/smartpqi/smartpqi_init.c | 10 +- drivers/scsi/snic/snic_scsi.c | 14 +- drivers/scsi/sr.c | 2 +- drivers/scsi/st.c | 12 +- drivers/scsi/st.h | 5 +- drivers/scsi/stex.c | 20 +-- drivers/scsi/storvsc_drv.c | 6 +- drivers/scsi/sym53c8xx_2/sym_glue.c | 2 +- drivers/scsi/sym53c8xx_2/sym_glue.h | 6 +- drivers/scsi/ufs/ufshcd.c | 2 +- drivers/scsi/virtio_scsi.c | 2 +- drivers/scsi/vmw_pvscsi.c | 32 ++-- drivers/scsi/wd33c93.c | 30 ++-- drivers/scsi/wd719x.c | 4 +- drivers/scsi/xen-scsifront.c | 6 +- .../staging/unisys/visorhba/visorhba_main.c | 12 +- drivers/target/loopback/tcm_loop.c | 4 +- drivers/target/target_core_pscsi.c | 2 +- drivers/usb/image/microtek.c | 4 +- drivers/usb/storage/cypress_atacb.c | 12 +- drivers/usb/storage/datafab.c | 4 +- drivers/usb/storage/isd200.c | 34 ++--- drivers/usb/storage/jumpshot.c | 4 +- drivers/usb/storage/realtek_cr.c | 10 +- drivers/usb/storage/scsiglue.c | 4 +- drivers/usb/storage/transport.c | 30 ++-- drivers/usb/storage/uas.c | 8 +- drivers/usb/storage/usb.c | 14 +- drivers/xen/xen-scsiback.c | 8 +- fs/nfsd/blocklayout.c | 4 +- include/scsi/scsi.h | 24 ++- include/scsi/scsi_bsg_iscsi.h | 3 +- include/scsi/scsi_cmnd.h | 11 +- include/scsi/scsi_dbg.h | 2 + include/scsi/scsi_eh.h | 4 +- include/scsi/scsi_request.h | 3 +- include/scsi/scsi_status.h | 28 ++++ include/trace/events/scsi.h | 2 +- 150 files changed, 1240 insertions(+), 1181 deletions(-) diff --git a/block/bsg.c b/block/bsg.c index bd10922d5cbb42..7ae74135c87ae6 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -94,7 +94,7 @@ static int bsg_scsi_complete_rq(struct request *rq, struct sg_io_v4 *hdr) /* * fill in all the output members */ - hdr->device_status = sreq->result & 0xff; + hdr->device_status = sreq->result.combined & 0xff; hdr->transport_status = host_byte(sreq->result); hdr->driver_status = driver_byte(sreq->result); hdr->info = 0; diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 6599bac0a78cb0..a421689e133abd 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c @@ -252,7 +252,7 @@ static int blk_complete_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr, /* * fill in all the output members */ - hdr->status = req->result & 0xff; + hdr->status = req->result.combined & 0xff; hdr->masked_status = status_byte(req->result); hdr->msg_status = msg_byte(req->result); hdr->host_status = host_byte(req->result); @@ -495,7 +495,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode, blk_execute_rq(disk, rq, 0); - err = req->result & 0xff; /* only 8 bit SCSI status */ + err = req->result.combined & 0xff; /* only 8 bit SCSI status */ if (err) { if (req->sense_len && req->sense) { bytes = (OMAX_SB_LEN > req->sense_len) ? @@ -533,7 +533,7 @@ static int __blk_send_generic(struct request_queue *q, struct gendisk *bd_disk, scsi_req(rq)->cmd[4] = data; scsi_req(rq)->cmd_len = 6; blk_execute_rq(bd_disk, rq, 0); - err = scsi_req(rq)->result ? -EIO : 0; + err = scsi_req(rq)->result.combined ? -EIO : 0; blk_put_request(rq); return err; diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c index 8adeab76dd382b..893a81f21c7ef0 100644 --- a/drivers/ata/libata-sata.c +++ b/drivers/ata/libata-sata.c @@ -1245,7 +1245,7 @@ int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap) if (likely(ata_dev_enabled(ap->link.device))) rc = __ata_scsi_queuecmd(cmd, ap->link.device); else { - cmd->result = (DID_BAD_TARGET << 16); + cmd->result.combined = (DID_BAD_TARGET << 16); cmd->scsi_done(cmd); } return rc; diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 48b8934970f36a..7fd7f1863dffb6 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -196,7 +196,7 @@ void ata_scsi_set_sense(struct ata_device *dev, struct scsi_cmnd *cmd, if (!cmd) return; - cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; + cmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; scsi_build_sense_buffer(d_sense, cmd->sense_buffer, sk, asc, ascq); } @@ -362,7 +362,7 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg) int argsize = 0; enum dma_data_direction data_dir; struct scsi_sense_hdr sshdr; - int cmd_result; + struct scsi_status cmd_result; if (arg == NULL) return -EINVAL; @@ -406,19 +406,19 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg) /* Good values for timeout and retries? Values below from scsi_ioctl_send_command() for default case... */ - cmd_result = scsi_execute(scsidev, scsi_cmd, data_dir, argbuf, argsize, + cmd_result.combined = scsi_execute(scsidev, scsi_cmd, data_dir, argbuf, argsize, sensebuf, &sshdr, (10*HZ), 5, 0, 0, NULL); if (driver_byte(cmd_result) == DRIVER_SENSE) {/* sense data available */ u8 *desc = sensebuf + 8; - cmd_result &= ~(0xFF<<24); /* DRIVER_SENSE is not an error */ + cmd_result.combined &= ~(0xFF<<24); /* DRIVER_SENSE is not an error */ /* If we set cc then ATA pass-through will cause a * check condition even if no error. Filter that. */ - if (cmd_result & SAM_STAT_CHECK_CONDITION) { + if (cmd_result.combined & SAM_STAT_CHECK_CONDITION) { if (sshdr.sense_key == RECOVERED_ERROR && sshdr.asc == 0 && sshdr.ascq == 0x1d) - cmd_result &= ~SAM_STAT_CHECK_CONDITION; + cmd_result.combined &= ~SAM_STAT_CHECK_CONDITION; } /* Send userspace a few ATA registers (same as drivers/ide) */ @@ -433,7 +433,7 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg) } - if (cmd_result) { + if (cmd_result.combined) { rc = -EIO; goto error; } @@ -464,7 +464,7 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) u8 scsi_cmd[MAX_COMMAND_SIZE]; u8 args[7]; struct scsi_sense_hdr sshdr; - int cmd_result; + struct scsi_status cmd_result; if (arg == NULL) return -EINVAL; @@ -487,19 +487,19 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) /* Good values for timeout and retries? Values below from scsi_ioctl_send_command() for default case... */ - cmd_result = scsi_execute(scsidev, scsi_cmd, DMA_NONE, NULL, 0, + cmd_result.combined = scsi_execute(scsidev, scsi_cmd, DMA_NONE, NULL, 0, sensebuf, &sshdr, (10*HZ), 5, 0, 0, NULL); if (driver_byte(cmd_result) == DRIVER_SENSE) {/* sense data available */ u8 *desc = sensebuf + 8; - cmd_result &= ~(0xFF<<24); /* DRIVER_SENSE is not an error */ + cmd_result.combined &= ~(0xFF<<24); /* DRIVER_SENSE is not an error */ /* If we set cc then ATA pass-through will cause a * check condition even if no error. Filter that. */ - if (cmd_result & SAM_STAT_CHECK_CONDITION) { + if (cmd_result.combined & SAM_STAT_CHECK_CONDITION) { if (sshdr.sense_key == RECOVERED_ERROR && sshdr.asc == 0 && sshdr.ascq == 0x1d) - cmd_result &= ~SAM_STAT_CHECK_CONDITION; + cmd_result.combined &= ~SAM_STAT_CHECK_CONDITION; } /* Send userspace ATA registers */ @@ -517,7 +517,7 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) } } - if (cmd_result) { + if (cmd_result.combined) { rc = -EIO; goto error; } @@ -638,7 +638,7 @@ static struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev, if (cmd->request->rq_flags & RQF_QUIET) qc->flags |= ATA_QCFLAG_QUIET; } else { - cmd->result = (DID_OK << 16) | (QUEUE_FULL << 1); + cmd->result.combined = (DID_OK << 16) | (QUEUE_FULL << 1); cmd->scsi_done(cmd); } @@ -858,7 +858,7 @@ static void ata_gen_passthru_sense(struct ata_queued_cmd *qc) memset(sb, 0, SCSI_SENSE_BUFFERSIZE); - cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; + cmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; /* * Use ata_to_sense_error() to map status register bits @@ -957,7 +957,7 @@ static void ata_gen_ata_sense(struct ata_queued_cmd *qc) memset(sb, 0, SCSI_SENSE_BUFFERSIZE); - cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; + cmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; if (ata_dev_disabled(dev)) { /* Device disabled after error recovery */ @@ -1241,7 +1241,7 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc) ata_scsi_set_invalid_field(qc->dev, scmd, fp, bp); return 1; skip: - scmd->result = SAM_STAT_GOOD; + scmd->result.combined = SAM_STAT_GOOD; return 1; } @@ -1492,7 +1492,7 @@ static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc) return 1; nothing_to_do: - scmd->result = SAM_STAT_GOOD; + scmd->result.combined = SAM_STAT_GOOD; return 1; } @@ -1625,7 +1625,7 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc) return 1; nothing_to_do: - scmd->result = SAM_STAT_GOOD; + scmd->result.combined = SAM_STAT_GOOD; return 1; } @@ -1658,11 +1658,11 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) ((cdb[2] & 0x20) || need_sense)) ata_gen_passthru_sense(qc); else if (qc->flags & ATA_QCFLAG_SENSE_VALID) - cmd->result = SAM_STAT_CHECK_CONDITION; + cmd->result.combined = SAM_STAT_CHECK_CONDITION; else if (need_sense) ata_gen_ata_sense(qc); else - cmd->result = SAM_STAT_GOOD; + cmd->result.combined = SAM_STAT_GOOD; if (need_sense && !ap->ops->error_handler) ata_dump_status(ap->print_id, &qc->result_tf); @@ -1746,7 +1746,7 @@ static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd, err_did: ata_qc_free(qc); - cmd->result = (DID_ERROR << 16); + cmd->result.combined = (DID_ERROR << 16); cmd->scsi_done(cmd); err_mem: DPRINTK("EXIT - internal\n"); @@ -1842,7 +1842,7 @@ static void ata_scsi_rbuf_fill(struct ata_scsi_args *args, ata_scsi_rbuf_put(cmd, rc == 0, &flags); if (rc == 0) - cmd->result = SAM_STAT_GOOD; + cmd->result.combined = SAM_STAT_GOOD; } /** @@ -2623,14 +2623,14 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc) if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL && qc->dev->sdev) qc->dev->sdev->locked = 0; - qc->scsicmd->result = SAM_STAT_CHECK_CONDITION; + qc->scsicmd->result.combined = SAM_STAT_CHECK_CONDITION; ata_qc_done(qc); return; } /* successful completion or old EH failure path */ if (unlikely(err_mask & AC_ERR_DEV)) { - cmd->result = SAM_STAT_CHECK_CONDITION; + cmd->result.combined = SAM_STAT_CHECK_CONDITION; atapi_request_sense(qc); return; } else if (unlikely(err_mask)) { @@ -2643,7 +2643,7 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc) } else { if (cmd->cmnd[0] == INQUIRY && (cmd->cmnd[1] & 0x03) == 0) atapi_fixup_inquiry(cmd); - cmd->result = SAM_STAT_GOOD; + cmd->result.combined = SAM_STAT_GOOD; } ata_qc_done(qc); @@ -3833,7 +3833,7 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc) return 1; skip: - scmd->result = SAM_STAT_GOOD; + scmd->result.combined = SAM_STAT_GOOD; return 1; } @@ -4061,7 +4061,7 @@ int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, struct ata_device *dev) bad_cdb_len: DPRINTK("bad CDB len=%u, scsi_op=0x%02x, max=%u\n", scmd->cmd_len, scsi_op, dev->cdb_len); - scmd->result = DID_ERROR << 16; + scmd->result.combined = DID_ERROR << 16; scmd->scsi_done(scmd); return 0; } @@ -4103,7 +4103,7 @@ int ata_scsi_queuecmd(struct Scsi_Host *shost, struct scsi_cmnd *cmd) if (likely(dev)) rc = __ata_scsi_queuecmd(cmd, dev); else { - cmd->result = (DID_BAD_TARGET << 16); + cmd->result.combined = (DID_BAD_TARGET << 16); cmd->scsi_done(cmd); } @@ -4197,7 +4197,7 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd) case REQUEST_SENSE: ata_scsi_set_sense(dev, cmd, 0, 0, 0); - cmd->result = (DRIVER_SENSE << 24); + cmd->result.combined = (DRIVER_SENSE << 24); break; /* if we reach this, then writeback caching is disabled, diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index fc4b0f1aa86dfb..e4722eb4d665bb 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -723,7 +723,7 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command * rq->rq_flags |= RQF_QUIET; blk_execute_rq(pd->bdev->bd_disk, rq, 0); - if (scsi_req(rq)->result) + if (scsi_req(rq)->result.combined) ret = -EIO; out: blk_put_request(rq); diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 90ad34c6ef8e0a..461f1ea2d2175c 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -2215,7 +2215,7 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf, bio = rq->bio; blk_execute_rq(cdi->disk, rq, 0); - if (scsi_req(rq)->result) { + if (scsi_req(rq)->result.combined) { struct scsi_sense_hdr sshdr; ret = -EIO; diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c index 4d5054211550b9..79de5e0bf5a8a7 100644 --- a/drivers/firewire/sbp2.c +++ b/drivers/firewire/sbp2.c @@ -1374,7 +1374,7 @@ static void complete_command_orb(struct sbp2_orb *base_orb, sizeof(orb->request), DMA_TO_DEVICE); sbp2_unmap_scatterlist(device->card->device, orb); - orb->cmd->result = result; + orb->cmd->result.combined = result; orb->cmd->scsi_done(orb->cmd); } diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index a1ce9f5ac3aa1d..565a06aa6d3b61 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c @@ -108,7 +108,7 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk, if (drive->media == ide_tape) scsi_req(rq)->cmd[13] = REQ_IDETAPE_PC1; blk_execute_rq(disk, rq, 0); - error = scsi_req(rq)->result ? -EIO : 0; + error = scsi_req(rq)->result.combined ? -EIO : 0; put_req: blk_put_request(rq); return error; @@ -471,7 +471,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive) debug_log("%s: I/O error\n", drive->name); if (drive->media != ide_tape) - scsi_req(pc->rq)->result++; + scsi_req(pc->rq)->result.combined++; if (scsi_req(rq)->cmd[0] == REQUEST_SENSE) { printk(KERN_ERR PFX "%s: I/O error in request " @@ -505,13 +505,13 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive) drive->failed_pc = NULL; if (ata_misc_request(rq)) { - scsi_req(rq)->result = 0; + scsi_req(rq)->result.combined = 0; error = BLK_STS_OK; } else { if (blk_rq_is_passthrough(rq) && uptodate <= 0) { - if (scsi_req(rq)->result == 0) - scsi_req(rq)->result = -EIO; + if (scsi_req(rq)->result.combined == 0) + scsi_req(rq)->result.combined = -EIO; } error = uptodate ? BLK_STS_OK : BLK_STS_IOERR; diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index cffbcc27a34ccd..73a88f7190abc9 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -248,10 +248,10 @@ static int ide_cd_breathe(ide_drive_t *drive, struct request *rq) struct cdrom_info *info = drive->driver_data; - if (!scsi_req(rq)->result) + if (!scsi_req(rq)->result.combined) info->write_timeout = jiffies + ATAPI_WAIT_WRITE_BUSY; - scsi_req(rq)->result = 1; + scsi_req(rq)->result.combined = 1; if (time_after(jiffies, info->write_timeout)) return 0; @@ -306,8 +306,8 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat) } /* if we have an error, pass CHECK_CONDITION as the SCSI status byte */ - if (blk_rq_is_scsi(rq) && !scsi_req(rq)->result) - scsi_req(rq)->result = SAM_STAT_CHECK_CONDITION; + if (blk_rq_is_scsi(rq) && !scsi_req(rq)->result.combined) + scsi_req(rq)->result.combined = SAM_STAT_CHECK_CONDITION; if (blk_noretry_request(rq)) do_end_request = 1; @@ -337,7 +337,7 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat) * Arrange to retry the request but be sure to give up if we've * retried too many times. */ - if (++scsi_req(rq)->result > ERROR_MAX) + if (++scsi_req(rq)->result.combined > ERROR_MAX) do_end_request = 1; break; case ILLEGAL_REQUEST: @@ -384,7 +384,7 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat) /* go to the default handler for other errors */ ide_error(drive, "cdrom_decode_status", stat); return 1; - } else if (++scsi_req(rq)->result > ERROR_MAX) + } else if (++scsi_req(rq)->result.combined > ERROR_MAX) /* we've racked up too many retries, abort */ do_end_request = 1; } @@ -468,7 +468,7 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd, } blk_execute_rq(info->disk, rq, 0); - error = scsi_req(rq)->result ? -EIO : 0; + error = scsi_req(rq)->result.combined ? -EIO : 0; if (buffer) *bufflen = scsi_req(rq)->resid_len; @@ -585,7 +585,7 @@ static bool ide_cdrom_prep_pc(struct request *rq) * appropriate action */ if (c[0] == MODE_SENSE || c[0] == MODE_SELECT) { - scsi_req(rq)->result = ILLEGAL_REQUEST; + scsi_req(rq)->result.combined = ILLEGAL_REQUEST; return false; } @@ -773,8 +773,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) if (cmd->nleft == 0) uptodate = 1; } else { - if (uptodate <= 0 && scsi_req(rq)->result == 0) - scsi_req(rq)->result = -EIO; + if (uptodate <= 0 && scsi_req(rq)->result.combined == 0) + scsi_req(rq)->result.combined = -EIO; } if (uptodate == 0 && rq->bio) diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c index 011eab9c69b7eb..edaa3282d40198 100644 --- a/drivers/ide/ide-cd_ioctl.c +++ b/drivers/ide/ide-cd_ioctl.c @@ -300,7 +300,7 @@ int ide_cdrom_reset(struct cdrom_device_info *cdi) ide_req(rq)->type = ATA_PRIV_MISC; rq->rq_flags = RQF_QUIET; blk_execute_rq(cd->disk, rq, 0); - ret = scsi_req(rq)->result ? -EIO : 0; + ret = scsi_req(rq)->result.combined ? -EIO : 0; blk_put_request(rq); /* * A reset will unlock the door. If it was previously locked, diff --git a/drivers/ide/ide-devsets.c b/drivers/ide/ide-devsets.c index ca1d4b3d387860..291e31bd4edd84 100644 --- a/drivers/ide/ide-devsets.c +++ b/drivers/ide/ide-devsets.c @@ -174,7 +174,7 @@ int ide_devset_execute(ide_drive_t *drive, const struct ide_devset *setting, ide_req(rq)->special = setting->set; blk_execute_rq(NULL, rq, 0); - ret = scsi_req(rq)->result; + ret = scsi_req(rq)->result.combined; blk_put_request(rq); return ret; @@ -186,7 +186,7 @@ ide_startstop_t ide_do_devset(ide_drive_t *drive, struct request *rq) err = setfunc(drive, *(int *)&scsi_req(rq)->cmd[1]); if (err) - scsi_req(rq)->result = err; + scsi_req(rq)->result.combined = err; ide_complete_rq(drive, 0, blk_rq_bytes(rq)); return ide_stopped; } diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 6f344654ef2297..0ffef5c3587e64 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -488,7 +488,7 @@ ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) * make sure request is sane */ if (hwif->rq) - scsi_req(hwif->rq)->result = 0; + scsi_req(hwif->rq)->result.combined = 0; return ret; } diff --git a/drivers/ide/ide-eh.c b/drivers/ide/ide-eh.c index 2f378213e9b5f6..7cd72f6b049ab4 100644 --- a/drivers/ide/ide-eh.c +++ b/drivers/ide/ide-eh.c @@ -13,7 +13,7 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, if ((stat & ATA_BUSY) || ((stat & ATA_DF) && (drive->dev_flags & IDE_DFLAG_NOWERR) == 0)) { /* other bits are useless when BUSY */ - scsi_req(rq)->result |= ERROR_RESET; + scsi_req(rq)->result.combined |= ERROR_RESET; } else if (stat & ATA_ERR) { /* err has different meaning on cdrom and tape */ if (err == ATA_ABORTED) { @@ -26,10 +26,10 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, drive->crc_count++; } else if (err & (ATA_BBK | ATA_UNC)) { /* retries won't help these */ - scsi_req(rq)->result = ERROR_MAX; + scsi_req(rq)->result.combined = ERROR_MAX; } else if (err & ATA_TRK0NF) { /* help it find track zero */ - scsi_req(rq)->result |= ERROR_RECAL; + scsi_req(rq)->result.combined |= ERROR_RECAL; } } @@ -40,23 +40,23 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, ide_pad_transfer(drive, READ, nsect * SECTOR_SIZE); } - if (scsi_req(rq)->result >= ERROR_MAX || blk_noretry_request(rq)) { + if (scsi_req(rq)->result.combined >= ERROR_MAX || blk_noretry_request(rq)) { ide_kill_rq(drive, rq); return ide_stopped; } if (hwif->tp_ops->read_status(hwif) & (ATA_BUSY | ATA_DRQ)) - scsi_req(rq)->result |= ERROR_RESET; + scsi_req(rq)->result.combined |= ERROR_RESET; - if ((scsi_req(rq)->result & ERROR_RESET) == ERROR_RESET) { - ++scsi_req(rq)->result; + if ((scsi_req(rq)->result.combined & ERROR_RESET) == ERROR_RESET) { + ++scsi_req(rq)->result.combined; return ide_do_reset(drive); } - if ((scsi_req(rq)->result & ERROR_RECAL) == ERROR_RECAL) + if ((scsi_req(rq)->result.combined & ERROR_RECAL) == ERROR_RECAL) drive->special_flags |= IDE_SFLAG_RECALIBRATE; - ++scsi_req(rq)->result; + ++scsi_req(rq)->result.combined; return ide_stopped; } @@ -69,7 +69,7 @@ static ide_startstop_t ide_atapi_error(ide_drive_t *drive, struct request *rq, if ((stat & ATA_BUSY) || ((stat & ATA_DF) && (drive->dev_flags & IDE_DFLAG_NOWERR) == 0)) { /* other bits are useless when BUSY */ - scsi_req(rq)->result |= ERROR_RESET; + scsi_req(rq)->result.combined |= ERROR_RESET; } else { /* add decoding error stuff */ } @@ -78,14 +78,14 @@ static ide_startstop_t ide_atapi_error(ide_drive_t *drive, struct request *rq, /* force an abort */ hwif->tp_ops->exec_command(hwif, ATA_CMD_IDLEIMMEDIATE); - if (scsi_req(rq)->result >= ERROR_MAX) { + if (scsi_req(rq)->result.combined >= ERROR_MAX) { ide_kill_rq(drive, rq); } else { - if ((scsi_req(rq)->result & ERROR_RESET) == ERROR_RESET) { - ++scsi_req(rq)->result; + if ((scsi_req(rq)->result.combined & ERROR_RESET) == ERROR_RESET) { + ++scsi_req(rq)->result.combined; return ide_do_reset(drive); } - ++scsi_req(rq)->result; + ++scsi_req(rq)->result.combined; } return ide_stopped; @@ -131,11 +131,11 @@ ide_startstop_t ide_error(ide_drive_t *drive, const char *msg, u8 stat) if (cmd) ide_complete_cmd(drive, cmd, stat, err); } else if (ata_pm_request(rq)) { - scsi_req(rq)->result = 1; + scsi_req(rq)->result.combined = 1; ide_complete_pm_rq(drive, rq); return ide_stopped; } - scsi_req(rq)->result = err; + scsi_req(rq)->result.combined = err; ide_complete_rq(drive, err ? BLK_STS_IOERR : BLK_STS_OK, blk_rq_bytes(rq)); return ide_stopped; } @@ -150,8 +150,8 @@ static inline void ide_complete_drive_reset(ide_drive_t *drive, blk_status_t err if (rq && ata_misc_request(rq) && scsi_req(rq)->cmd[0] == REQ_DRIVE_RESET) { - if (err <= 0 && scsi_req(rq)->result == 0) - scsi_req(rq)->result = -EIO; + if (err <= 0 && scsi_req(rq)->result.combined == 0) + scsi_req(rq)->result.combined = -EIO; ide_complete_rq(drive, err, blk_rq_bytes(rq)); } } diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index f5a2870aaf54bb..959ce1484718c1 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c @@ -100,7 +100,7 @@ static int ide_floppy_callback(ide_drive_t *drive, int dsc) } if (ata_misc_request(rq)) - scsi_req(rq)->result = uptodate ? 0 : IDE_DRV_ERROR_GENERAL; + scsi_req(rq)->result.combined = uptodate ? 0 : IDE_DRV_ERROR_GENERAL; return uptodate; } @@ -241,7 +241,7 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive, ? rq->rq_disk->disk_name : "dev?")); - if (scsi_req(rq)->result >= ERROR_MAX) { + if (scsi_req(rq)->result.combined >= ERROR_MAX) { if (drive->failed_pc) { ide_floppy_report_error(floppy, drive->failed_pc); drive->failed_pc = NULL; @@ -249,7 +249,7 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive, printk(KERN_ERR PFX "%s: I/O error\n", drive->name); if (ata_misc_request(rq)) { - scsi_req(rq)->result = 0; + scsi_req(rq)->result.combined = 0; ide_complete_rq(drive, BLK_STS_OK, blk_rq_bytes(rq)); return ide_stopped; } else @@ -303,8 +303,8 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive, return ide_floppy_issue_pc(drive, &cmd, pc); out_end: drive->failed_pc = NULL; - if (blk_rq_is_passthrough(rq) && scsi_req(rq)->result == 0) - scsi_req(rq)->result = -EIO; + if (blk_rq_is_passthrough(rq) && scsi_req(rq)->result.combined == 0) + scsi_req(rq)->result.combined = -EIO; ide_complete_rq(drive, BLK_STS_IOERR, blk_rq_bytes(rq)); return ide_stopped; } diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 4867b67b60d698..867c24a65fe3c6 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -151,12 +151,12 @@ void ide_kill_rq(ide_drive_t *drive, struct request *rq) drive->failed_pc = NULL; if ((media == ide_floppy || media == ide_tape) && drv_req) { - scsi_req(rq)->result = 0; + scsi_req(rq)->result.combined = 0; } else { if (media == ide_tape) - scsi_req(rq)->result = IDE_DRV_ERROR_GENERAL; - else if (blk_rq_is_passthrough(rq) && scsi_req(rq)->result == 0) - scsi_req(rq)->result = -EIO; + scsi_req(rq)->result.combined = IDE_DRV_ERROR_GENERAL; + else if (blk_rq_is_passthrough(rq) && scsi_req(rq)->result.combined == 0) + scsi_req(rq)->result.combined = -EIO; } ide_complete_rq(drive, BLK_STS_IOERR, blk_rq_bytes(rq)); @@ -284,7 +284,7 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, #ifdef DEBUG printk("%s: DRIVE_CMD (null)\n", drive->name); #endif - scsi_req(rq)->result = 0; + scsi_req(rq)->result.combined = 0; ide_complete_rq(drive, BLK_STS_OK, blk_rq_bytes(rq)); return ide_stopped; diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c index 43fbc37d85c34a..7e477aedc34eb3 100644 --- a/drivers/ide/ide-ioctls.c +++ b/drivers/ide/ide-ioctls.c @@ -138,7 +138,7 @@ static int ide_cmd_ioctl(ide_drive_t *drive, void __user *argp) rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0); ide_req(rq)->type = ATA_PRIV_TASKFILE; blk_execute_rq(NULL, rq, 0); - err = scsi_req(rq)->result ? -EIO : 0; + err = scsi_req(rq)->result.combined ? -EIO : 0; blk_put_request(rq); return err; @@ -236,7 +236,7 @@ static int generic_drive_reset(ide_drive_t *drive) scsi_req(rq)->cmd_len = 1; scsi_req(rq)->cmd[0] = REQ_DRIVE_RESET; blk_execute_rq(NULL, rq, 1); - ret = scsi_req(rq)->result; + ret = scsi_req(rq)->result.combined; blk_put_request(rq); return ret; } diff --git a/drivers/ide/ide-park.c b/drivers/ide/ide-park.c index a80a0f28f7b9e3..d177811057d796 100644 --- a/drivers/ide/ide-park.c +++ b/drivers/ide/ide-park.c @@ -38,7 +38,7 @@ static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout) ide_req(rq)->type = ATA_PRIV_MISC; ide_req(rq)->special = &timeout; blk_execute_rq(NULL, rq, 1); - rc = scsi_req(rq)->result ? -EIO : 0; + rc = scsi_req(rq)->result.combined ? -EIO : 0; blk_put_request(rq); if (rc) goto out; diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c index d680b3e3295faa..a82c944ff7900f 100644 --- a/drivers/ide/ide-pm.c +++ b/drivers/ide/ide-pm.c @@ -28,7 +28,7 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg) rqpm.pm_state = mesg.event; blk_execute_rq(NULL, rq, 0); - ret = scsi_req(rq)->result ? -EIO : 0; + ret = scsi_req(rq)->result.combined ? -EIO : 0; blk_put_request(rq); if (ret == 0 && ide_port_acpi(hwif)) { @@ -46,13 +46,13 @@ static int ide_pm_execute_rq(struct request *rq) if (unlikely(blk_queue_dying(q))) { rq->rq_flags |= RQF_QUIET; - scsi_req(rq)->result = -ENXIO; + scsi_req(rq)->result.combined = -ENXIO; blk_mq_end_request(rq, BLK_STS_OK); return -ENXIO; } blk_execute_rq(NULL, rq, true); - return scsi_req(rq)->result ? -EIO : 0; + return scsi_req(rq)->result.combined ? -EIO : 0; } int generic_ide_resume(struct device *dev) diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index fa05e7e7d6090b..9946468fae4c24 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c @@ -367,7 +367,7 @@ static int ide_tape_callback(ide_drive_t *drive, int dsc) err = pc->error; } } - scsi_req(rq)->result = err; + scsi_req(rq)->result.combined = err; return uptodate; } @@ -879,7 +879,7 @@ static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int size) tape->valid = 0; ret = size; - if (scsi_req(rq)->result == IDE_DRV_ERROR_GENERAL) + if (scsi_req(rq)->result.combined == IDE_DRV_ERROR_GENERAL) ret = -EIO; out_put: blk_put_request(rq); diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 6665fc4724b996..564b6b3e0faa0d 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c @@ -279,7 +279,7 @@ static void ide_pio_datablock(ide_drive_t *drive, struct ide_cmd *cmd, u8 saved_io_32bit = drive->io_32bit; if (cmd->tf_flags & IDE_TFLAG_FS) - scsi_req(cmd->rq)->result = 0; + scsi_req(cmd->rq)->result.combined = 0; if (cmd->tf_flags & IDE_TFLAG_IO_16BIT) drive->io_32bit = 0; @@ -321,7 +321,7 @@ void ide_finish_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat) u8 set_xfer = !!(cmd->tf_flags & IDE_TFLAG_SET_XFER); ide_complete_cmd(drive, cmd, stat, err); - scsi_req(rq)->result = err; + scsi_req(rq)->result.combined = err; if (err == 0 && set_xfer) { ide_set_xfer_rate(drive, nsect); @@ -444,7 +444,7 @@ int ide_raw_taskfile(ide_drive_t *drive, struct ide_cmd *cmd, u8 *buf, cmd->rq = rq; blk_execute_rq(NULL, rq, 0); - error = scsi_req(rq)->result ? -EIO : 0; + error = scsi_req(rq)->result.combined ? -EIO : 0; put_req: blk_put_request(rq); return error; diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 31f8aa2c40ed8f..58ef3d9875617a 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1285,7 +1285,7 @@ static void srp_finish_req(struct srp_rdma_ch *ch, struct srp_request *req, if (scmnd) { srp_free_req(ch, req, scmnd, 0); - scmnd->result = result; + scmnd->result.combined = result; scmnd->scsi_done(scmnd); } } @@ -1980,7 +1980,7 @@ static void srp_process_rsp(struct srp_rdma_ch *ch, struct srp_rsp *rsp) return; } - scmnd->result = rsp->status; + scmnd->result.combined = rsp->status; if (rsp->flags & SRP_RSP_FLAG_SNSVALID) { memcpy(scmnd->sense_buffer, rsp->data + @@ -2178,8 +2178,8 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd) u16 idx; int len, ret; - scmnd->result = srp_chkready(target->rport); - if (unlikely(scmnd->result)) + scmnd->result.combined = srp_chkready(target->rport); + if (unlikely(scmnd->result.combined)) goto err; WARN_ON_ONCE(scmnd->request->tag < 0); @@ -2231,7 +2231,7 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd) * max_pages_per_mr sg-list elements, tell the SCSI mid-layer * to reduce queue depth temporarily. */ - scmnd->result = len == -ENOMEM ? + scmnd->result.combined = len == -ENOMEM ? DID_OK << 16 | QUEUE_FULL << 1 : DID_ERROR << 16; goto err_iu; } @@ -2241,7 +2241,7 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd) if (srp_post_send(ch, iu, len)) { shost_printk(KERN_ERR, target->scsi_host, PFX "Send failed\n"); - scmnd->result = DID_ERROR << 16; + scmnd->result.combined = DID_ERROR << 16; goto err_unmap; } @@ -2260,7 +2260,7 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd) req->scmnd = NULL; err: - if (scmnd->result) { + if (scmnd->result.combined) { scmnd->scsi_done(scmnd); ret = 0; } else { @@ -2832,7 +2832,7 @@ static int srp_abort(struct scsi_cmnd *scmnd) ret = FAILED; if (ret == SUCCESS) { srp_free_req(ch, req, scmnd, 0); - scmnd->result = DID_ABORT << 16; + scmnd->result.combined = DID_ABORT << 16; scmnd->scsi_done(scmnd); } diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index 0484e9c15c0973..14fd3539dcf18a 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c @@ -648,14 +648,14 @@ mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt) VirtDevice *vdevice = SCpnt->device->hostdata; if (!vdevice || !vdevice->vtarget) { - SCpnt->result = DID_NO_CONNECT << 16; + SCpnt->result.combined = DID_NO_CONNECT << 16; SCpnt->scsi_done(SCpnt); return 0; } err = fc_remote_port_chkready(rport); if (unlikely(err)) { - SCpnt->result = err; + SCpnt->result.combined = err; SCpnt->scsi_done(SCpnt); return 0; } @@ -663,7 +663,7 @@ mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt) /* dd_data is null until finished adding target */ ri = *((struct mptfc_rport_info **)rport->dd_data); if (unlikely(!ri)) { - SCpnt->result = DID_IMM_RETRY << 16; + SCpnt->result.combined = DID_IMM_RETRY << 16; SCpnt->scsi_done(SCpnt); return 0; } diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 1857869e7e8d57..f778c91b8d087d 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -1925,7 +1925,7 @@ mptsas_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt) VirtDevice *vdevice = SCpnt->device->hostdata; if (!vdevice || !vdevice->vtarget || vdevice->vtarget->deleted) { - SCpnt->result = DID_NO_CONNECT << 16; + SCpnt->result.combined = DID_NO_CONNECT << 16; SCpnt->scsi_done(SCpnt); return 0; } diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index ce2e5b21978e21..ebb099fec393c5 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c @@ -541,7 +541,7 @@ mptscsih_info_scsiio(MPT_ADAPTER *ioc, struct scsi_cmnd *sc, SCSIIOReply_t * pSc scsi_get_resid(sc)); printk(MYIOC_s_DEBUG_FMT "\ttag = %d, transfer_count = %d, " "sc->result = %08X\n", ioc->name, le16_to_cpu(pScsiReply->TaskTag), - le32_to_cpu(pScsiReply->TransferCount), sc->result); + le32_to_cpu(pScsiReply->TransferCount), sc->result.combined); printk(MYIOC_s_DEBUG_FMT "\tiocstatus = %s (0x%04x), " "scsi_status = %s (0x%02x), scsi_state = (0x%02x)\n", @@ -632,13 +632,13 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) if (!vdevice || !vdevice->vtarget || vdevice->vtarget->deleted) { - sc->result = DID_NO_CONNECT << 16; + sc->result.combined = DID_NO_CONNECT << 16; goto out; } } sc->host_scribble = NULL; - sc->result = DID_OK << 16; /* Set default reply as OK */ + sc->result.combined = DID_OK << 16; /* Set default reply as OK */ pScsiReq = (SCSIIORequest_t *) mf; pScsiReply = (SCSIIOReply_t *) mr; @@ -705,21 +705,21 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) * But not: DID_BUS_BUSY lest one risk * killing interrupt handler:-( */ - sc->result = SAM_STAT_BUSY; + sc->result.combined = SAM_STAT_BUSY; break; case MPI_IOCSTATUS_SCSI_INVALID_BUS: /* 0x0041 */ case MPI_IOCSTATUS_SCSI_INVALID_TARGETID: /* 0x0042 */ - sc->result = DID_BAD_TARGET << 16; + sc->result.combined = DID_BAD_TARGET << 16; break; case MPI_IOCSTATUS_SCSI_DEVICE_NOT_THERE: /* 0x0043 */ /* Spoof to SCSI Selection Timeout! */ if (ioc->bus_type != FC) - sc->result = DID_NO_CONNECT << 16; + sc->result.combined = DID_NO_CONNECT << 16; /* else fibre, just stall until rescan event */ else - sc->result = DID_REQUEUE << 16; + sc->result.combined = DID_REQUEUE << 16; if (hd->sel_timeout[pScsiReq->TargetID] < 0xFFFF) hd->sel_timeout[pScsiReq->TargetID]++; @@ -763,7 +763,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) vdevice->vtarget-> inDMD = 1; - sc->result = + sc->result.combined = (DID_TRANSPORT_DISRUPTED << 16); break; @@ -777,7 +777,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) * DID_RESET to permit retry of the command, * just not an infinite number of them */ - sc->result = DID_ERROR << 16; + sc->result.combined = DID_ERROR << 16; break; } @@ -790,25 +790,25 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) /* Linux handles an unsolicited DID_RESET better * than an unsolicited DID_ABORT. */ - sc->result = DID_RESET << 16; + sc->result.combined = DID_RESET << 16; break; case MPI_IOCSTATUS_SCSI_EXT_TERMINATED: /* 0x004C */ if (ioc->bus_type == FC) - sc->result = DID_ERROR << 16; + sc->result.combined = DID_ERROR << 16; else - sc->result = DID_RESET << 16; + sc->result.combined = DID_RESET << 16; break; case MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: /* 0x0049 */ scsi_set_resid(sc, scsi_bufflen(sc) - xfer_cnt); if((xfer_cnt==0)||(sc->underflow > xfer_cnt)) - sc->result=DID_SOFT_ERROR << 16; + sc->result.combined=DID_SOFT_ERROR << 16; else /* Sufficient data transfer occurred */ - sc->result = (DID_OK << 16) | scsi_status; + sc->result.combined = (DID_OK << 16) | scsi_status; dreplyprintk(ioc, printk(MYIOC_s_DEBUG_FMT "RESIDUAL_MISMATCH: result=%x on channel=%d id=%d\n", - ioc->name, sc->result, sc->device->channel, sc->device->id)); + ioc->name, sc->result.combined, sc->device->channel, sc->device->id)); break; case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ @@ -816,7 +816,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) * Do upfront check for valid SenseData and give it * precedence! */ - sc->result = (DID_OK << 16) | scsi_status; + sc->result.combined = (DID_OK << 16) | scsi_status; if (!(scsi_state & MPI_SCSI_STATE_AUTOSENSE_VALID)) { /* @@ -836,7 +836,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) pScsiReq->CDB[0] == VERIFY_16) { if (scsi_bufflen(sc) != xfer_cnt) { - sc->result = + sc->result.combined = DID_SOFT_ERROR << 16; printk(KERN_WARNING "Errata" "on LSI53C1030 occurred." @@ -850,18 +850,18 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) if (xfer_cnt < sc->underflow) { if (scsi_status == SAM_STAT_BUSY) - sc->result = SAM_STAT_BUSY; + sc->result.combined = SAM_STAT_BUSY; else - sc->result = DID_SOFT_ERROR << 16; + sc->result.combined = DID_SOFT_ERROR << 16; } if (scsi_state & (MPI_SCSI_STATE_AUTOSENSE_FAILED | MPI_SCSI_STATE_NO_SCSI_STATUS)) { /* What to do? */ - sc->result = DID_SOFT_ERROR << 16; + sc->result.combined = DID_SOFT_ERROR << 16; } else if (scsi_state & MPI_SCSI_STATE_TERMINATED) { /* Not real sure here either... */ - sc->result = DID_RESET << 16; + sc->result.combined = DID_RESET << 16; } } @@ -884,7 +884,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) fallthrough; case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ case MPI_IOCSTATUS_SUCCESS: /* 0x0000 */ - sc->result = (DID_OK << 16) | scsi_status; + sc->result.combined = (DID_OK << 16) | scsi_status; if (scsi_state == 0) { ; } else if (scsi_state & @@ -955,11 +955,11 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) /* * What to do? */ - sc->result = DID_SOFT_ERROR << 16; + sc->result.combined = DID_SOFT_ERROR << 16; } else if (scsi_state & MPI_SCSI_STATE_TERMINATED) { /* Not real sure here either... */ - sc->result = DID_RESET << 16; + sc->result.combined = DID_RESET << 16; } else if (scsi_state & MPI_SCSI_STATE_QUEUE_TAG_REJECTED) { /* Device Inq. data indicates that it supports @@ -969,7 +969,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) * Not real sure here either so do nothing... */ } - if (sc->result == MPI_SCSI_STATUS_TASK_SET_FULL) + if (sc->result.combined == MPI_SCSI_STATUS_TASK_SET_FULL) mptscsih_report_queue_full(sc, pScsiReply, pScsiReq); /* Add handling of: @@ -979,7 +979,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) break; case MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR: /* 0x0047 */ - sc->result = DID_SOFT_ERROR << 16; + sc->result.combined = DID_SOFT_ERROR << 16; break; case MPI_IOCSTATUS_INVALID_FUNCTION: /* 0x0001 */ @@ -994,13 +994,13 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) /* * What to do? */ - sc->result = DID_SOFT_ERROR << 16; + sc->result.combined = DID_SOFT_ERROR << 16; break; } /* switch(status) */ #ifdef CONFIG_FUSION_LOGGING - if (sc->result && (ioc->debug_level & MPT_DEBUG_REPLY)) + if (sc->result.combined && (ioc->debug_level & MPT_DEBUG_REPLY)) mptscsih_info_scsiio(ioc, sc, pScsiReply); #endif @@ -1049,7 +1049,7 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd) if ((unsigned char *)mf != sc->host_scribble) continue; scsi_dma_unmap(sc); - sc->result = DID_RESET << 16; + sc->result.combined = DID_RESET << 16; sc->host_scribble = NULL; dtmprintk(ioc, sdev_printk(KERN_INFO, sc->device, MYIOC_s_FMT "completing cmds: fw_channel %d, fw_id %d, sc=%p, mf = %p, " @@ -1112,7 +1112,7 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice) mpt_free_msg_frame(ioc, (MPT_FRAME_HDR *)mf); scsi_dma_unmap(sc); sc->host_scribble = NULL; - sc->result = DID_NO_CONNECT << 16; + sc->result.combined = DID_NO_CONNECT << 16; dtmprintk(ioc, sdev_printk(KERN_INFO, sc->device, MYIOC_s_FMT "completing cmds: fw_channel %d, " "fw_id %d, sc=%p, mf = %p, idx=%x\n", ioc->name, @@ -1692,7 +1692,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) /* If we can't locate our host adapter structure, return FAILED status. */ if ((hd = shost_priv(SCpnt->device->host)) == NULL) { - SCpnt->result = DID_RESET << 16; + SCpnt->result.combined = DID_RESET << 16; SCpnt->scsi_done(SCpnt); printk(KERN_ERR MYNAM ": task abort: " "can't locate host! (sc=%p)\n", SCpnt); @@ -1709,7 +1709,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT "task abort: device has been deleted (sc=%p)\n", ioc->name, SCpnt)); - SCpnt->result = DID_NO_CONNECT << 16; + SCpnt->result.combined = DID_NO_CONNECT << 16; SCpnt->scsi_done(SCpnt); retval = SUCCESS; goto out; @@ -1721,7 +1721,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT "task abort: hidden raid component (sc=%p)\n", ioc->name, SCpnt)); - SCpnt->result = DID_RESET << 16; + SCpnt->result.combined = DID_RESET << 16; retval = FAILED; goto out; } @@ -1732,7 +1732,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT "task abort: raid volume (sc=%p)\n", ioc->name, SCpnt)); - SCpnt->result = DID_RESET << 16; + SCpnt->result.combined = DID_RESET << 16; retval = FAILED; goto out; } @@ -1743,7 +1743,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) /* Cmd not found in ScsiLookup. * Do OS callback. */ - SCpnt->result = DID_RESET << 16; + SCpnt->result.combined = DID_RESET << 16; dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT "task abort: " "Command not in the active list! (sc=%p)\n", ioc->name, SCpnt)); diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index af0ce5611e4acc..60ad7b73d91ba7 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c @@ -781,14 +781,14 @@ mptspi_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt) MPT_ADAPTER *ioc = hd->ioc; if (!vdevice || !vdevice->vtarget) { - SCpnt->result = DID_NO_CONNECT << 16; + SCpnt->result.combined = DID_NO_CONNECT << 16; SCpnt->scsi_done(SCpnt); return 0; } if (SCpnt->device->channel == 1 && mptscsih_is_phys_disk(ioc, 0, SCpnt->device->id) == 0) { - SCpnt->result = DID_NO_CONNECT << 16; + SCpnt->result.combined = DID_NO_CONNECT << 16; SCpnt->scsi_done(SCpnt); return 0; } diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h index 4d1435c573bc60..c3dde06c0568dd 100644 --- a/drivers/s390/scsi/zfcp_dbf.h +++ b/drivers/s390/scsi/zfcp_dbf.h @@ -402,7 +402,7 @@ void _zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *scmd, static inline void zfcp_dbf_scsi_result(struct scsi_cmnd *scmd, struct zfcp_fsf_req *req) { - if (scmd->result != 0) + if (scmd->result.combined != 0) _zfcp_dbf_scsi("rsl_err", 3, scmd, req); else if (scmd->retries > 0) _zfcp_dbf_scsi("rsl_ret", 4, scmd, req); diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index d24cafe02708fa..76f19716803fc1 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c @@ -951,8 +951,8 @@ static void zfcp_fc_ct_els_job_handler(void *data) jr->reply_payload_rcv_len = job->reply_payload.payload_len; jr->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK; - jr->result = zfcp_ct_els->status ? -EIO : 0; - bsg_job_done(job, jr->result, jr->reply_payload_rcv_len); + jr->result.combined = zfcp_ct_els->status ? -EIO : 0; + bsg_job_done(job, jr->result.combined, jr->reply_payload_rcv_len); } static struct zfcp_fc_wka_port *zfcp_fc_job_wka_port(struct bsg_job *job) diff --git a/drivers/s390/scsi/zfcp_fc.h b/drivers/s390/scsi/zfcp_fc.h index 8aaf409ce9cbae..b311d8d20304c5 100644 --- a/drivers/s390/scsi/zfcp_fc.h +++ b/drivers/s390/scsi/zfcp_fc.h @@ -275,7 +275,7 @@ void zfcp_fc_eval_fcp_rsp(struct fcp_resp_with_ext *fcp_rsp, u32 sense_len, resid; u8 rsp_flags; - scsi->result |= fcp_rsp->resp.fr_status; + scsi->result.combined |= fcp_rsp->resp.fr_status; rsp_flags = fcp_rsp->resp.fr_flags; diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index d58bf79892f20c..426b4535b0d14d 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -71,12 +71,12 @@ int zfcp_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scpnt) int status, scsi_result, ret; /* reset the status for this request */ - scpnt->result = 0; + scpnt->result.combined = 0; scpnt->host_scribble = NULL; scsi_result = fc_remote_port_chkready(rport); if (unlikely(scsi_result)) { - scpnt->result = scsi_result; + scpnt->result.combined = scsi_result; zfcp_dbf_scsi_fail_send(scpnt); scpnt->scsi_done(scpnt); return 0; @@ -859,7 +859,7 @@ void zfcp_scsi_dif_sense_error(struct scsi_cmnd *scmd, int ascq) scsi_build_sense_buffer(1, scmd->sense_buffer, ILLEGAL_REQUEST, 0x10, ascq); set_driver_byte(scmd, DRIVER_SENSE); - scmd->result |= SAM_STAT_CHECK_CONDITION; + scmd->result.combined |= SAM_STAT_CHECK_CONDITION; set_host_byte(scmd, DID_SOFT_ERROR); } diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index 47028f5e57abd3..77d4711e527423 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -1018,7 +1018,7 @@ static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_ if (copy_sense) { memcpy(tw_dev->srb[request_id]->sense_buffer, full_command_packet->header.sense_data, TW_SENSE_DATA_LENGTH); - tw_dev->srb[request_id]->result = (full_command_packet->command.newcommand.status << 1); + tw_dev->srb[request_id]->result.combined = (full_command_packet->command.newcommand.status << 1); retval = TW_ISR_DONT_RESULT; goto out; } @@ -1336,13 +1336,13 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance) twa_scsiop_execute_scsi_complete(tw_dev, request_id); /* If no error command was a success */ if (error == 0) { - cmd->result = (DID_OK << 16); + cmd->result.combined = (DID_OK << 16); } /* If error, command failed */ if (error == 1) { /* Ask for a host reset */ - cmd->result = (DID_OK << 16) | (CHECK_CONDITION << 1); + cmd->result.combined = (DID_OK << 16) | (CHECK_CONDITION << 1); } /* Report residual bytes for single sgl */ @@ -1595,7 +1595,7 @@ static int twa_reset_device_extension(TW_Device_Extension *tw_dev) if (tw_dev->srb[i]) { struct scsi_cmnd *cmd = tw_dev->srb[i]; - cmd->result = (DID_RESET << 16); + cmd->result.combined = (DID_RESET << 16); if (twa_command_mapped(cmd)) scsi_dma_unmap(cmd); cmd->scsi_done(cmd); @@ -1759,7 +1759,7 @@ static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_ /* Check if this FW supports luns */ if ((SCpnt->device->lun != 0) && (tw_dev->tw_compat_info.working_srl < TW_FW_SRL_LUNS_SUPPORTED)) { - SCpnt->result = (DID_BAD_TARGET << 16); + SCpnt->result.combined = (DID_BAD_TARGET << 16); done(SCpnt); retval = 0; goto out; @@ -1782,7 +1782,7 @@ static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_ twa_free_request_id(tw_dev, request_id); break; case 1: - SCpnt->result = (DID_ERROR << 16); + SCpnt->result.combined = (DID_ERROR << 16); if (twa_command_mapped(SCpnt)) scsi_dma_unmap(SCpnt); done(SCpnt); diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c index 4fde39da54e4ea..be544155de5cf2 100644 --- a/drivers/scsi/3w-sas.c +++ b/drivers/scsi/3w-sas.c @@ -887,7 +887,7 @@ static int twl_fill_sense(TW_Device_Extension *tw_dev, int i, int request_id, in if (copy_sense) { memcpy(tw_dev->srb[request_id]->sense_buffer, header->sense_data, TW_SENSE_DATA_LENGTH); - tw_dev->srb[request_id]->result = (full_command_packet->command.newcommand.status << 1); + tw_dev->srb[request_id]->result.combined = (full_command_packet->command.newcommand.status << 1); goto out; } out: @@ -1206,7 +1206,7 @@ static irqreturn_t twl_interrupt(int irq, void *dev_instance) cmd = tw_dev->srb[request_id]; if (!error) - cmd->result = (DID_OK << 16); + cmd->result.combined = (DID_OK << 16); /* Report residual bytes for single sgl */ if ((scsi_sg_count(cmd) <= 1) && (full_command_packet->command.newcommand.status == 0)) { @@ -1367,7 +1367,7 @@ static int twl_reset_device_extension(TW_Device_Extension *tw_dev, int ioctl_res struct scsi_cmnd *cmd = tw_dev->srb[i]; if (cmd) { - cmd->result = (DID_RESET << 16); + cmd->result.combined = (DID_RESET << 16); scsi_dma_unmap(cmd); cmd->scsi_done(cmd); } @@ -1474,7 +1474,7 @@ static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_ if (retval) { tw_dev->state[request_id] = TW_S_COMPLETED; twl_free_request_id(tw_dev, request_id); - SCpnt->result = (DID_ERROR << 16); + SCpnt->result.combined = (DID_ERROR << 16); done(SCpnt); retval = 0; } diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index a7292883b72bc5..fee0021aba0de2 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c @@ -429,7 +429,7 @@ static int tw_decode_sense(TW_Device_Extension *tw_dev, int request_id, int fill /* Additional sense code qualifier */ tw_dev->srb[request_id]->sense_buffer[13] = tw_sense_table[i][3]; - tw_dev->srb[request_id]->result = (DID_OK << 16) | (CHECK_CONDITION << 1); + tw_dev->srb[request_id]->result.combined = (DID_OK << 16) | (CHECK_CONDITION << 1); return TW_ISR_DONT_RESULT; /* Special case for isr to not over-write result */ } } @@ -1159,7 +1159,7 @@ static int tw_setfeature(TW_Device_Extension *tw_dev, int parm, int param_size, printk(KERN_WARNING "3w-xxxx: tw_setfeature(): Bad alignment physical address.\n"); tw_dev->state[request_id] = TW_S_COMPLETED; tw_state_request_finish(tw_dev, request_id); - tw_dev->srb[request_id]->result = (DID_OK << 16); + tw_dev->srb[request_id]->result.combined = (DID_OK << 16); tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]); } command_packet->byte8.param.sgl[0].address = param_value; @@ -1303,7 +1303,7 @@ static int tw_reset_device_extension(TW_Device_Extension *tw_dev) (tw_dev->state[i] != TW_S_COMPLETED)) { srb = tw_dev->srb[i]; if (srb != NULL) { - srb->result = (DID_RESET << 16); + srb->result.combined = (DID_RESET << 16); scsi_dma_unmap(srb); srb->scsi_done(srb); } @@ -1483,7 +1483,7 @@ static int tw_scsiop_inquiry_complete(TW_Device_Extension *tw_dev, int request_i tw_dev->is_unit_present[tw_dev->srb[request_id]->device->id] = 1; } else { tw_dev->is_unit_present[tw_dev->srb[request_id]->device->id] = 0; - tw_dev->srb[request_id]->result = (DID_BAD_TARGET << 16); + tw_dev->srb[request_id]->result.combined = (DID_BAD_TARGET << 16); return TW_ISR_DONT_RESULT; } @@ -1504,7 +1504,7 @@ static int tw_scsiop_mode_sense(TW_Device_Extension *tw_dev, int request_id) if (tw_dev->srb[request_id]->cmnd[2] != 0x8) { tw_dev->state[request_id] = TW_S_COMPLETED; tw_state_request_finish(tw_dev, request_id); - tw_dev->srb[request_id]->result = (DID_OK << 16); + tw_dev->srb[request_id]->result.combined = (DID_OK << 16); tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]); return 0; } @@ -1795,7 +1795,7 @@ static int tw_scsiop_request_sense(TW_Device_Extension *tw_dev, int request_id) tw_state_request_finish(tw_dev, request_id); /* If we got a request_sense, we probably want a reset, return error */ - tw_dev->srb[request_id]->result = (DID_ERROR << 16); + tw_dev->srb[request_id]->result.combined = (DID_ERROR << 16); tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]); return 0; @@ -1910,7 +1910,7 @@ static int tw_scsiop_test_unit_ready_complete(TW_Device_Extension *tw_dev, int r tw_dev->is_unit_present[tw_dev->srb[request_id]->device->id] = 1; } else { tw_dev->is_unit_present[tw_dev->srb[request_id]->device->id] = 0; - tw_dev->srb[request_id]->result = (DID_BAD_TARGET << 16); + tw_dev->srb[request_id]->result.combined = (DID_BAD_TARGET << 16); return TW_ISR_DONT_RESULT; } @@ -1984,7 +1984,7 @@ static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_c if (retval) { tw_dev->state[request_id] = TW_S_COMPLETED; tw_state_request_finish(tw_dev, request_id); - SCpnt->result = (DID_ERROR << 16); + SCpnt->result.combined = (DID_ERROR << 16); done(SCpnt); retval = 0; } @@ -2153,13 +2153,13 @@ static irqreturn_t tw_interrupt(int irq, void *dev_instance) /* If no error command was a success */ if (error == 0) { - tw_dev->srb[request_id]->result = (DID_OK << 16); + tw_dev->srb[request_id]->result.combined = (DID_OK << 16); } /* If error, command failed */ if (error == 1) { /* Ask for a host reset */ - tw_dev->srb[request_id]->result = (DID_OK << 16) | (CHECK_CONDITION << 1); + tw_dev->srb[request_id]->result.combined = (DID_OK << 16) | (CHECK_CONDITION << 1); } /* Now complete the io */ diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c index 4fd91f81244d26..cd5b95dcb35323 100644 --- a/drivers/scsi/53c700.c +++ b/drivers/scsi/53c700.c @@ -634,7 +634,7 @@ NCR_700_scsi_done(struct NCR_700_Host_Parameters *hostdata, NCR_700_set_depth(SCp->device, NCR_700_get_depth(SCp->device) - 1); SCp->host_scribble = NULL; - SCp->result = result; + SCp->result.combined = result; SCp->scsi_done(SCp); } else { printk(KERN_ERR "53c700: SCSI DONE HAS NULL SCp\n"); @@ -1571,7 +1571,7 @@ NCR_700_intr(int irq, void *dev_id) * command again otherwise we'll * deadlock on the * hostdata->state_lock */ - SCp->result = DID_RESET << 16; + SCp->result.combined = DID_RESET << 16; SCp->scsi_done(SCp); } mdelay(25); diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index 0ac3f713fc212a..209a0089dbcc8c 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c @@ -2775,7 +2775,7 @@ static void blogic_process_ccbs(struct blogic_adapter *adapter) struct scsi_cmnd *nxt_cmd = command->reset_chain; command->reset_chain = NULL; - command->result = DID_RESET << 16; + command->result.combined = DID_RESET << 16; command->scsi_done(command); command = nxt_cmd; } @@ -2792,7 +2792,7 @@ static void blogic_process_ccbs(struct blogic_adapter *adapter) command = ccb->command; blogic_dealloc_ccb(ccb, 1); adapter->active_cmds[tgt_id]--; - command->result = DID_RESET << 16; + command->result.combined = DID_RESET << 16; command->scsi_done(command); } adapter->bdr_pend[tgt_id] = NULL; @@ -2813,16 +2813,16 @@ static void blogic_process_ccbs(struct blogic_adapter *adapter) .cmds_complete++; adapter->tgt_flags[ccb->tgt_id] .cmd_good = true; - command->result = DID_OK << 16; + command->result.combined = DID_OK << 16; break; case BLOGIC_CMD_ABORT_BY_HOST: blogic_warn("CCB #%ld to Target %d Aborted\n", adapter, ccb->serial, ccb->tgt_id); blogic_inc_count(&adapter->tgt_stats[ccb->tgt_id].aborts_done); - command->result = DID_ABORT << 16; + command->result.combined = DID_ABORT << 16; break; case BLOGIC_CMD_COMPLETE_ERROR: - command->result = blogic_resultcode(adapter, + command->result.combined = blogic_resultcode(adapter, ccb->adapter_status, ccb->tgt_status); if (ccb->adapter_status != BLOGIC_SELECT_TIMEOUT) { adapter->tgt_stats[ccb->tgt_id] @@ -2830,7 +2830,10 @@ static void blogic_process_ccbs(struct blogic_adapter *adapter) if (blogic_global_options.trace_err) { int i; blogic_notice("CCB #%ld Target %d: Result %X Host " - "Adapter Status %02X Target Status %02X\n", adapter, ccb->serial, ccb->tgt_id, command->result, ccb->adapter_status, ccb->tgt_status); + "Adapter Status %02X Target Status %02X\n", adapter, ccb->serial, ccb->tgt_id, + command->result.combined, + ccb->adapter_status, + ccb->tgt_status); blogic_notice("CDB ", adapter); for (i = 0; i < ccb->cdblen; i++) blogic_notice(" %02X", adapter, ccb->cdb[i]); @@ -3042,7 +3045,7 @@ static int blogic_qcmd_lck(struct scsi_cmnd *command, occurred. */ if (cdb[0] == REQUEST_SENSE && command->sense_buffer[0] != 0) { - command->result = DID_OK << 16; + command->result.combined = DID_OK << 16; comp_cb(command); return 0; } @@ -3060,7 +3063,7 @@ static int blogic_qcmd_lck(struct scsi_cmnd *command, spin_lock_irq(adapter->scsi_host->host_lock); ccb = blogic_alloc_ccb(adapter); if (ccb == NULL) { - command->result = DID_ERROR << 16; + command->result.combined = DID_ERROR << 16; comp_cb(command); return 0; } @@ -3211,7 +3214,7 @@ static int blogic_qcmd_lck(struct scsi_cmnd *command, ccb)) { blogic_warn("Still unable to write Outgoing Mailbox - Host Adapter Dead?\n", adapter); blogic_dealloc_ccb(ccb, 1); - command->result = DID_ERROR << 16; + command->result.combined = DID_ERROR << 16; command->scsi_done(command); } } diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index 2ddbcaa667d1e8..c9f449f7a4c8e1 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -572,13 +572,13 @@ static int NCR5380_queue_command(struct Scsi_Host *instance, case WRITE_6: case WRITE_10: shost_printk(KERN_DEBUG, instance, "WRITE attempted with NDEBUG_NO_WRITE set\n"); - cmd->result = (DID_ERROR << 16); + cmd->result.combined = (DID_ERROR << 16); cmd->scsi_done(cmd); return 0; } #endif /* (NDEBUG & NDEBUG_NO_WRITE) */ - cmd->result = 0; + cmd->result.combined = 0; spin_lock_irqsave(&hostdata->lock, flags); @@ -1154,7 +1154,7 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd) if (!hostdata->selecting) return false; - cmd->result = DID_BAD_TARGET << 16; + cmd->result.combined = DID_BAD_TARGET << 16; complete_cmd(instance, cmd); dsprintk(NDEBUG_SELECTION, instance, "target did not respond within 250ms\n"); @@ -1203,7 +1203,7 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd) NCR5380_transfer_pio(instance, &phase, &len, &data, 0); if (len) { NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; complete_cmd(instance, cmd); dsprintk(NDEBUG_SELECTION, instance, "IDENTIFY message transfer failed\n"); ret = false; @@ -1743,7 +1743,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) shost_printk(KERN_DEBUG, instance, "NDEBUG_NO_DATAOUT set, attempted DATAOUT aborted\n"); sink = 1; do_abort(instance, 0); - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; complete_cmd(instance, cmd); hostdata->connected = NULL; hostdata->busy[scmd_id(cmd)] &= ~(1 << cmd->device->lun); @@ -1826,9 +1826,9 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) hostdata->connected = NULL; hostdata->busy[scmd_id(cmd)] &= ~(1 << cmd->device->lun); - cmd->result &= ~0xffff; - cmd->result |= cmd->SCp.Status; - cmd->result |= cmd->SCp.Message << 8; + cmd->result.combined &= ~0xffff; + cmd->result.combined |= cmd->SCp.Status; + cmd->result.combined |= cmd->SCp.Message << 8; set_resid_from_SCp(cmd); @@ -1980,7 +1980,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) if (msgout == ABORT) { hostdata->connected = NULL; hostdata->busy[scmd_id(cmd)] &= ~(1 << cmd->device->lun); - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; complete_cmd(instance, cmd); return; } @@ -2261,7 +2261,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) if (list_del_cmd(&hostdata->unissued, cmd)) { dsprintk(NDEBUG_ABORT, instance, "abort: removed %p from issue queue\n", cmd); - cmd->result = DID_ABORT << 16; + cmd->result.combined = DID_ABORT << 16; cmd->scsi_done(cmd); /* No tag or busy flag to worry about */ goto out; } @@ -2270,7 +2270,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) dsprintk(NDEBUG_ABORT, instance, "abort: cmd %p == selecting\n", cmd); hostdata->selecting = NULL; - cmd->result = DID_ABORT << 16; + cmd->result.combined = DID_ABORT << 16; complete_cmd(instance, cmd); goto out; } @@ -2341,7 +2341,7 @@ static void bus_reset_cleanup(struct Scsi_Host *instance) */ if (hostdata->selecting) { - hostdata->selecting->result = DID_RESET << 16; + hostdata->selecting->result.combined = DID_RESET << 16; complete_cmd(instance, hostdata->selecting); hostdata->selecting = NULL; } @@ -2399,7 +2399,7 @@ static int NCR5380_host_reset(struct scsi_cmnd *cmd) list_for_each_entry(ncmd, &hostdata->unissued, list) { struct scsi_cmnd *scmd = NCR5380_to_scmd(ncmd); - scmd->result = DID_RESET << 16; + scmd->result.combined = DID_RESET << 16; scmd->scsi_done(scmd); } INIT_LIST_HEAD(&hostdata->unissued); diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c index 028af6b1057c60..36768df5656aee 100644 --- a/drivers/scsi/a100u2w.c +++ b/drivers/scsi/a100u2w.c @@ -1040,7 +1040,7 @@ static void inia100_scb_handler(struct orc_host *host, struct orc_scb *scb) memcpy((unsigned char *) &cmd->sense_buffer[0], (unsigned char *) &escb->sglist[0], SENSE_SIZE); } - cmd->result = scb->tastat | (scb->hastat << 16); + cmd->result.combined = scb->tastat | (scb->hastat << 16); scsi_dma_unmap(cmd); cmd->scsi_done(cmd); /* Notify system DONE */ orc_release_scb(host, scb); /* Release SCB for current channel */ diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index f1f62b5da8b709..74eeaf997c91dc 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -556,7 +556,7 @@ static void get_container_name_callback(void *context, struct fib * fibptr) } } - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; aac_fib_complete(fibptr); scsicmd->scsi_done(scsicmd); @@ -614,7 +614,7 @@ static int aac_probe_container_callback2(struct scsi_cmnd * scsicmd) if ((fsa_dev_ptr[scmd_id(scsicmd)].valid & 1)) return aac_scsi_cmd(scsicmd); - scsicmd->result = DID_NO_CONNECT << 16; + scsicmd->result.combined = DID_NO_CONNECT << 16; scsicmd->scsi_done(scsicmd); return 0; } @@ -1092,7 +1092,7 @@ static void get_container_serial_callback(void *context, struct fib * fibptr) } } - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; aac_fib_complete(fibptr); scsicmd->scsi_done(scsicmd); @@ -1191,7 +1191,7 @@ static int aac_bounds_32(struct aac_dev * dev, struct scsi_cmnd * cmd, u64 lba) if (lba & 0xffffffff00000000LL) { int cid = scmd_id(cmd); dprintk((KERN_DEBUG "aacraid: Illegal lba\n")); - cmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; + cmd->result.combined = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; set_sense(&dev->fsa_dev[cid].sense_data, HARDWARE_ERROR, SENCODE_INTERNAL_TARGET_FAILURE, ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0); @@ -2358,11 +2358,11 @@ static void io_callback(void *context, struct fib * fibptr) readreply = (struct aac_read_reply *)fib_data(fibptr); switch (le32_to_cpu(readreply->status)) { case ST_OK: - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; dev->fsa_dev[cid].sense_data.sense_key = NO_SENSE; break; case ST_NOT_READY: - scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; set_sense(&dev->fsa_dev[cid].sense_data, NOT_READY, SENCODE_BECOMING_READY, ASENCODE_BECOMING_READY, 0, 0); memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data, @@ -2370,7 +2370,7 @@ static void io_callback(void *context, struct fib * fibptr) SCSI_SENSE_BUFFERSIZE)); break; case ST_MEDERR: - scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; set_sense(&dev->fsa_dev[cid].sense_data, MEDIUM_ERROR, SENCODE_UNRECOVERED_READ_ERROR, ASENCODE_NO_SENSE, 0, 0); memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data, @@ -2382,7 +2382,7 @@ static void io_callback(void *context, struct fib * fibptr) printk(KERN_WARNING "io_callback: io failed, status = %d\n", le32_to_cpu(readreply->status)); #endif - scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; set_sense(&dev->fsa_dev[cid].sense_data, HARDWARE_ERROR, SENCODE_INTERNAL_TARGET_FAILURE, ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0); @@ -2457,7 +2457,7 @@ static int aac_read(struct scsi_cmnd * scsicmd) if ((lba + count) > (dev->fsa_dev[scmd_id(scsicmd)].size)) { cid = scmd_id(scsicmd); dprintk((KERN_DEBUG "aacraid: Illegal lba\n")); - scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; set_sense(&dev->fsa_dev[cid].sense_data, ILLEGAL_REQUEST, SENCODE_LBA_OUT_OF_RANGE, ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0); @@ -2489,7 +2489,7 @@ static int aac_read(struct scsi_cmnd * scsicmd) /* * For some reason, the Fib didn't queue, return QUEUE_FULL */ - scsicmd->result = DID_OK << 16 | SAM_STAT_TASK_SET_FULL; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_TASK_SET_FULL; scsicmd->scsi_done(scsicmd); aac_fib_complete(cmd_fibcontext); aac_fib_free(cmd_fibcontext); @@ -2548,7 +2548,7 @@ static int aac_write(struct scsi_cmnd * scsicmd) if ((lba + count) > (dev->fsa_dev[scmd_id(scsicmd)].size)) { cid = scmd_id(scsicmd); dprintk((KERN_DEBUG "aacraid: Illegal lba\n")); - scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; set_sense(&dev->fsa_dev[cid].sense_data, ILLEGAL_REQUEST, SENCODE_LBA_OUT_OF_RANGE, ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0); @@ -2580,7 +2580,7 @@ static int aac_write(struct scsi_cmnd * scsicmd) /* * For some reason, the Fib didn't queue, return QUEUE_FULL */ - scsicmd->result = DID_OK << 16 | SAM_STAT_TASK_SET_FULL; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_TASK_SET_FULL; scsicmd->scsi_done(scsicmd); aac_fib_complete(cmd_fibcontext); @@ -2603,7 +2603,7 @@ static void synchronize_callback(void *context, struct fib *fibptr) synchronizereply = fib_data(fibptr); if (le32_to_cpu(synchronizereply->status) == CT_OK) - cmd->result = DID_OK << 16 | SAM_STAT_GOOD; + cmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; else { struct scsi_device *sdev = cmd->device; struct aac_dev *dev = fibptr->dev; @@ -2611,7 +2611,7 @@ static void synchronize_callback(void *context, struct fib *fibptr) printk(KERN_WARNING "synchronize_callback: synchronize failed, status = %d\n", le32_to_cpu(synchronizereply->status)); - cmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; + cmd->result.combined = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; set_sense(&dev->fsa_dev[cid].sense_data, HARDWARE_ERROR, SENCODE_INTERNAL_TARGET_FAILURE, ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0); @@ -2685,7 +2685,7 @@ static void aac_start_stop_callback(void *context, struct fib *fibptr) BUG_ON(fibptr == NULL); - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; aac_fib_complete(fibptr); aac_fib_free(fibptr); @@ -2702,7 +2702,7 @@ static int aac_start_stop(struct scsi_cmnd *scsicmd) if (!(aac->supplement_adapter_info.supported_options2 & AAC_OPTION_POWER_MANAGEMENT)) { - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; scsicmd->scsi_done(scsicmd); return 0; } @@ -2777,7 +2777,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) if (scmd_channel(scsicmd) == CONTAINER_CHANNEL) { if((cid >= dev->maximum_num_containers) || (scsicmd->device->lun != 0)) { - scsicmd->result = DID_NO_CONNECT << 16; + scsicmd->result.combined = DID_NO_CONNECT << 16; goto scsi_done_ret; } @@ -2821,7 +2821,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) return -1; return aac_send_srb_fib(scsicmd); } else { - scsicmd->result = DID_NO_CONNECT << 16; + scsicmd->result.combined = DID_NO_CONNECT << 16; goto scsi_done_ret; } } @@ -2833,7 +2833,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) (scsicmd->cmnd[0] != TEST_UNIT_READY)) { dprintk((KERN_WARNING "Only INQUIRY & TUR command supported for controller, rcvd = 0x%x.\n", scsicmd->cmnd[0])); - scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; set_sense(&dev->fsa_dev[cid].sense_data, ILLEGAL_REQUEST, SENCODE_INVALID_COMMAND, ASENCODE_INVALID_COMMAND, 0, 0); @@ -2862,7 +2862,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) case SYNCHRONIZE_CACHE: if (((aac_cache & 6) == 6) && dev->cache_protected) { - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; break; } /* Issue FIB to tell Firmware to flush it's cache */ @@ -2891,7 +2891,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) arr[1] = scsicmd->cmnd[2]; scsi_sg_copy_from_buffer(scsicmd, &inq_data, sizeof(inq_data)); - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; } else if (scsicmd->cmnd[2] == 0x80) { /* unit serial number page */ arr[3] = setinqserial(dev, &arr[4], @@ -2902,7 +2902,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) if (aac_wwn != 2) return aac_get_container_serial( scsicmd); - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; } else if (scsicmd->cmnd[2] == 0x83) { /* vpd page 0x83 - Device Identification Page */ char *sno = (char *)&inq_data; @@ -2911,10 +2911,10 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) if (aac_wwn != 2) return aac_get_container_serial( scsicmd); - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; } else { /* vpd page not implemented */ - scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; set_sense(&dev->fsa_dev[cid].sense_data, ILLEGAL_REQUEST, SENCODE_INVALID_CDB_FIELD, ASENCODE_NO_SENSE, 7, 2); @@ -2940,7 +2940,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) inq_data.inqd_pdt = INQD_PDT_PROC; /* Processor device */ scsi_sg_copy_from_buffer(scsicmd, &inq_data, sizeof(inq_data)); - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; break; } if (dev->in_reset) @@ -2989,7 +2989,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) /* Do not cache partition table for arrays */ scsicmd->device->removable = 1; - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; break; } @@ -3015,7 +3015,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) scsi_sg_copy_from_buffer(scsicmd, cp, sizeof(cp)); /* Do not cache partition table for arrays */ scsicmd->device->removable = 1; - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; break; } @@ -3094,7 +3094,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) scsi_sg_copy_from_buffer(scsicmd, (char *)&mpd, mode_buf_length); - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; break; } case MODE_SENSE_10: @@ -3171,7 +3171,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) (char *)&mpd10, mode_buf_length); - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; break; } case REQUEST_SENSE: @@ -3180,7 +3180,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) sizeof(struct sense_data)); memset(&dev->fsa_dev[cid].sense_data, 0, sizeof(struct sense_data)); - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; break; case ALLOW_MEDIUM_REMOVAL: @@ -3190,14 +3190,14 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) else fsa_dev_ptr[cid].locked = 0; - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; break; /* * These commands are all No-Ops */ case TEST_UNIT_READY: if (fsa_dev_ptr[cid].sense_data.sense_key == NOT_READY) { - scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; set_sense(&dev->fsa_dev[cid].sense_data, NOT_READY, SENCODE_BECOMING_READY, ASENCODE_BECOMING_READY, 0, 0); @@ -3214,7 +3214,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) case REZERO_UNIT: case REASSIGN_BLOCKS: case SEEK_10: - scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; break; case START_STOP: @@ -3226,7 +3226,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) */ dprintk((KERN_WARNING "Unhandled SCSI Command: 0x%x.\n", scsicmd->cmnd[0])); - scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_CHECK_CONDITION; set_sense(&dev->fsa_dev[cid].sense_data, ILLEGAL_REQUEST, SENCODE_INVALID_COMMAND, ASENCODE_INVALID_COMMAND, 0, 0); @@ -3407,7 +3407,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr) le32_to_cpu(srbreply->status)); len = min_t(u32, le32_to_cpu(srbreply->sense_data_size), SCSI_SENSE_BUFFERSIZE); - scsicmd->result = DID_ERROR << 16 | SAM_STAT_CHECK_CONDITION; + scsicmd->result.combined = DID_ERROR << 16 | SAM_STAT_CHECK_CONDITION; memcpy(scsicmd->sense_buffer, srbreply->sense_data, len); } @@ -3419,7 +3419,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr) case SRB_STATUS_ERROR_RECOVERY: case SRB_STATUS_PENDING: case SRB_STATUS_SUCCESS: - scsicmd->result = DID_OK << 16; + scsicmd->result.combined = DID_OK << 16; break; case SRB_STATUS_DATA_OVERRUN: switch (scsicmd->cmnd[0]) { @@ -3436,52 +3436,52 @@ static void aac_srb_callback(void *context, struct fib * fibptr) pr_warn("aacraid: SCSI CMD underflow\n"); else pr_warn("aacraid: SCSI CMD Data Overrun\n"); - scsicmd->result = DID_ERROR << 16; + scsicmd->result.combined = DID_ERROR << 16; break; case INQUIRY: - scsicmd->result = DID_OK << 16; + scsicmd->result.combined = DID_OK << 16; break; default: - scsicmd->result = DID_OK << 16; + scsicmd->result.combined = DID_OK << 16; break; } break; case SRB_STATUS_ABORTED: - scsicmd->result = DID_ABORT << 16; + scsicmd->result.combined = DID_ABORT << 16; break; case SRB_STATUS_ABORT_FAILED: /* * Not sure about this one - but assuming the * hba was trying to abort for some reason */ - scsicmd->result = DID_ERROR << 16; + scsicmd->result.combined = DID_ERROR << 16; break; case SRB_STATUS_PARITY_ERROR: - scsicmd->result = DID_PARITY << 16; + scsicmd->result.combined = DID_PARITY << 16; break; case SRB_STATUS_NO_DEVICE: case SRB_STATUS_INVALID_PATH_ID: case SRB_STATUS_INVALID_TARGET_ID: case SRB_STATUS_INVALID_LUN: case SRB_STATUS_SELECTION_TIMEOUT: - scsicmd->result = DID_NO_CONNECT << 16; + scsicmd->result.combined = DID_NO_CONNECT << 16; break; case SRB_STATUS_COMMAND_TIMEOUT: case SRB_STATUS_TIMEOUT: - scsicmd->result = DID_TIME_OUT << 16; + scsicmd->result.combined = DID_TIME_OUT << 16; break; case SRB_STATUS_BUSY: - scsicmd->result = DID_BUS_BUSY << 16; + scsicmd->result.combined = DID_BUS_BUSY << 16; break; case SRB_STATUS_BUS_RESET: - scsicmd->result = DID_RESET << 16; + scsicmd->result.combined = DID_RESET << 16; break; case SRB_STATUS_MESSAGE_REJECTED: - scsicmd->result = DID_ERROR << 16; + scsicmd->result.combined = DID_ERROR << 16; break; case SRB_STATUS_REQUEST_FLUSHED: case SRB_STATUS_ERROR: @@ -3517,12 +3517,12 @@ static void aac_srb_callback(void *context, struct fib * fibptr) || (scsicmd->cmnd[0] == ATA_16)) { if (scsicmd->cmnd[2] & (0x01 << 5)) { - scsicmd->result = DID_OK << 16; + scsicmd->result.combined = DID_OK << 16; } else { - scsicmd->result = DID_ERROR << 16; + scsicmd->result.combined = DID_ERROR << 16; } } else { - scsicmd->result = DID_ERROR << 16; + scsicmd->result.combined = DID_ERROR << 16; } break; } @@ -3530,7 +3530,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr) == SAM_STAT_CHECK_CONDITION) { int len; - scsicmd->result |= SAM_STAT_CHECK_CONDITION; + scsicmd->result.combined |= SAM_STAT_CHECK_CONDITION; len = min_t(u32, le32_to_cpu(srbreply->sense_data_size), SCSI_SENSE_BUFFERSIZE); #ifdef AAC_DETAILED_STATUS_INFO @@ -3544,7 +3544,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr) /* * OR in the scsi status (already shifted up a bit) */ - scsicmd->result |= le32_to_cpu(srbreply->scsi_status); + scsicmd->result.combined |= le32_to_cpu(srbreply->scsi_status); aac_fib_complete(fibptr); scsicmd->scsi_done(scsicmd); @@ -3554,13 +3554,13 @@ static void hba_resp_task_complete(struct aac_dev *dev, struct scsi_cmnd *scsicmd, struct aac_hba_resp *err) { - scsicmd->result = err->status; + scsicmd->result.combined = err->status; /* set residual count */ scsi_set_resid(scsicmd, le32_to_cpu(err->residual_count)); switch (err->status) { case SAM_STAT_GOOD: - scsicmd->result |= DID_OK << 16; + scsicmd->result.combined |= DID_OK << 16; break; case SAM_STAT_CHECK_CONDITION: { @@ -3571,19 +3571,19 @@ static void hba_resp_task_complete(struct aac_dev *dev, if (len) memcpy(scsicmd->sense_buffer, err->sense_response_buf, len); - scsicmd->result |= DID_OK << 16; + scsicmd->result.combined |= DID_OK << 16; break; } case SAM_STAT_BUSY: - scsicmd->result |= DID_BUS_BUSY << 16; + scsicmd->result.combined |= DID_BUS_BUSY << 16; break; case SAM_STAT_TASK_ABORTED: - scsicmd->result |= DID_ABORT << 16; + scsicmd->result.combined |= DID_ABORT << 16; break; case SAM_STAT_RESERVATION_CONFLICT: case SAM_STAT_TASK_SET_FULL: default: - scsicmd->result |= DID_ERROR << 16; + scsicmd->result.combined |= DID_ERROR << 16; break; } } @@ -3603,26 +3603,26 @@ static void hba_resp_task_failure(struct aac_dev *dev, dev->hba_map[bus][cid].devtype = AAC_DEVTYPE_ARC_RAW; dev->hba_map[bus][cid].rmw_nexus = 0xffffffff; } - scsicmd->result = DID_NO_CONNECT << 16; + scsicmd->result.combined = DID_NO_CONNECT << 16; break; } case HBA_RESP_STAT_IO_ERROR: case HBA_RESP_STAT_NO_PATH_TO_DEVICE: - scsicmd->result = DID_OK << 16 | SAM_STAT_BUSY; + scsicmd->result.combined = DID_OK << 16 | SAM_STAT_BUSY; break; case HBA_RESP_STAT_IO_ABORTED: - scsicmd->result = DID_ABORT << 16; + scsicmd->result.combined = DID_ABORT << 16; break; case HBA_RESP_STAT_INVALID_DEVICE: - scsicmd->result = DID_NO_CONNECT << 16; + scsicmd->result.combined = DID_NO_CONNECT << 16; break; case HBA_RESP_STAT_UNDERRUN: /* UNDERRUN is OK */ - scsicmd->result = DID_OK << 16; + scsicmd->result.combined = DID_OK << 16; break; case HBA_RESP_STAT_OVERRUN: default: - scsicmd->result = DID_ERROR << 16; + scsicmd->result.combined = DID_ERROR << 16; break; } } @@ -3655,7 +3655,7 @@ void aac_hba_callback(void *context, struct fib *fibptr) if (fibptr->flags & FIB_CONTEXT_FLAG_FASTRESP) { /* fast response */ - scsicmd->result = DID_OK << 16; + scsicmd->result.combined = DID_OK << 16; goto out; } @@ -3667,17 +3667,17 @@ void aac_hba_callback(void *context, struct fib *fibptr) hba_resp_task_failure(dev, scsicmd, err); break; case HBA_RESP_SVCRES_TMF_REJECTED: - scsicmd->result = DID_ERROR << 16; + scsicmd->result.combined = DID_ERROR << 16; break; case HBA_RESP_SVCRES_TMF_LUN_INVALID: - scsicmd->result = DID_NO_CONNECT << 16; + scsicmd->result.combined = DID_NO_CONNECT << 16; break; case HBA_RESP_SVCRES_TMF_COMPLETE: case HBA_RESP_SVCRES_TMF_SUCCEEDED: - scsicmd->result = DID_OK << 16; + scsicmd->result.combined = DID_OK << 16; break; default: - scsicmd->result = DID_ERROR << 16; + scsicmd->result.combined = DID_ERROR << 16; break; } @@ -3706,7 +3706,7 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd) dev = (struct aac_dev *)scsicmd->device->host->hostdata; if (scmd_id(scsicmd) >= dev->maximum_num_physicals || scsicmd->device->lun > 7) { - scsicmd->result = DID_NO_CONNECT << 16; + scsicmd->result.combined = DID_NO_CONNECT << 16; scsicmd->scsi_done(scsicmd); return 0; } @@ -3747,7 +3747,7 @@ static int aac_send_hba_fib(struct scsi_cmnd *scsicmd) dev = shost_priv(scsicmd->device->host); if (scmd_id(scsicmd) >= dev->maximum_num_physicals || scsicmd->device->lun > AAC_MAX_LUN - 1) { - scsicmd->result = DID_NO_CONNECT << 16; + scsicmd->result.combined = DID_NO_CONNECT << 16; scsicmd->scsi_done(scsicmd); return 0; } diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index e9516de8c18bdb..d05b0df2ad2e7c 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -5980,7 +5980,7 @@ static void adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp) /* * 'done_status' contains the command's ending status. */ - scp->result = 0; + scp->result.combined = 0; switch (scsiqp->done_status) { case QD_NO_ERROR: ASC_DBG(2, "QD_NO_ERROR\n"); @@ -6732,7 +6732,7 @@ static void asc_isr_callback(ASC_DVC_VAR *asc_dvc_varp, ASC_QDONE_INFO *qdonep) /* * 'qdonep' contains the command's ending status. */ - scp->result = 0; + scp->result.combined = 0; switch (qdonep->d3.done_stat) { case QD_NO_ERROR: ASC_DBG(2, "QD_NO_ERROR\n"); diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index d8e19afa7a1407..cc0fdb6877933b 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -1281,7 +1281,7 @@ static void done(struct Scsi_Host *shpnt, int error) DONE_SC = CURRENT_SC; CURRENT_SC = NULL; - DONE_SC->result = error; + DONE_SC->result.combined = error; } else printk(KERN_ERR "aha152x: done() called outside of command\n"); } @@ -2254,7 +2254,7 @@ static void rsti_run(struct Scsi_Host *shpnt) kfree(ptr->host_scribble); ptr->host_scribble=NULL; - ptr->result = DID_RESET << 16; + ptr->result.combined = DID_RESET << 16; ptr->scsi_done(ptr); } diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index 21aab9f5b1172a..f3bcd070625cf6 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c @@ -398,7 +398,7 @@ static irqreturn_t aha1542_interrupt(int irq, void *dev_id) if (errstatus) printk("aha1542_intr_handle: returning %6x\n", errstatus); #endif - tmp_cmd->result = errstatus; + tmp_cmd->result.combined = errstatus; aha1542->int_cmds[mbo] = NULL; /* This effectively frees up the mailbox slot, as * far as queuecommand is concerned */ @@ -422,7 +422,7 @@ static int aha1542_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *cmd) if (*cmd->cmnd == REQUEST_SENSE) { /* Don't do the command - we have the sense data already */ - cmd->result = 0; + cmd->result.combined = 0; cmd->scsi_done(cmd); return 0; } diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c index 0dc831026e9e16..e3efd81dfb341b 100644 --- a/drivers/scsi/aha1740.c +++ b/drivers/scsi/aha1740.c @@ -275,7 +275,7 @@ static irqreturn_t aha1740_intr_handle(int irq, void *dev_id) DEB(if (errstatus) printk("aha1740_intr_handle: returning %6x\n", errstatus)); - SCtmp->result = errstatus; + SCtmp->result.combined = errstatus; my_done = ecbptr->done; memset(ecbptr,0,sizeof(struct ecb)); if ( my_done ) @@ -326,7 +326,7 @@ static int aha1740_queuecommand_lck(struct scsi_cmnd * SCpnt, DEB(int i); if(*cmd == REQUEST_SENSE) { - SCpnt->result = 0; + SCpnt->result.combined = 0; done(SCpnt); return 0; } diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 4f7102f8eeb0a9..8ea3b119742ae1 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -582,7 +582,7 @@ ahd_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd ahd = *(struct ahd_softc **)cmd->device->host->hostdata; cmd->scsi_done = scsi_done; - cmd->result = CAM_REQ_INPROG << 16; + cmd->result.combined = CAM_REQ_INPROG << 16; rtn = ahd_linux_run_command(ahd, dev, cmd); return rtn; @@ -1772,8 +1772,8 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb) dev = scb->platform_data->dev; dev->active--; dev->openings++; - if ((cmd->result & (CAM_DEV_QFRZN << 16)) != 0) { - cmd->result &= ~(CAM_DEV_QFRZN << 16); + if ((cmd->result.combined & (CAM_DEV_QFRZN << 16)) != 0) { + cmd->result.combined &= ~(CAM_DEV_QFRZN << 16); dev->qfrozen--; } ahd_linux_unmap_scb(ahd, scb); @@ -1928,7 +1928,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd, memcpy(cmd->sense_buffer, ahd_get_sense_buf(ahd, scb) + sense_offset, sense_size); - cmd->result |= (DRIVER_SENSE << 24); + cmd->result.combined |= (DRIVER_SENSE << 24); #ifdef AHD_DEBUG if (ahd_debug & AHD_SHOW_SENSE) { @@ -2041,7 +2041,7 @@ ahd_linux_queue_cmd_complete(struct ahd_softc *ahd, struct scsi_cmnd *cmd) switch(scsi_status) { case SAM_STAT_COMMAND_TERMINATED: case SAM_STAT_CHECK_CONDITION: - if ((cmd->result >> 24) != DRIVER_SENSE) { + if ((cmd->result.combined >> 24) != DRIVER_SENSE) { do_fallback = 1; } else { struct scsi_sense_data *sense; diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h index 35ec24f28d2c2d..45e8628879c3bf 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.h +++ b/drivers/scsi/aic7xxx/aic79xx_osm.h @@ -501,8 +501,8 @@ int ahd_linux_show_info(struct seq_file *,struct Scsi_Host *); static inline void ahd_cmd_set_transaction_status(struct scsi_cmnd *cmd, uint32_t status) { - cmd->result &= ~(CAM_STATUS_MASK << 16); - cmd->result |= status << 16; + cmd->result.combined &= ~(CAM_STATUS_MASK << 16); + cmd->result.combined |= status << 16; } static inline @@ -514,8 +514,8 @@ void ahd_set_transaction_status(struct scb *scb, uint32_t status) static inline void ahd_cmd_set_scsi_status(struct scsi_cmnd *cmd, uint32_t status) { - cmd->result &= ~0xFFFF; - cmd->result |= status; + cmd->result.combined &= ~0xFFFF; + cmd->result.combined |= status; } static inline @@ -527,7 +527,7 @@ void ahd_set_scsi_status(struct scb *scb, uint32_t status) static inline uint32_t ahd_cmd_get_transaction_status(struct scsi_cmnd *cmd) { - return ((cmd->result >> 16) & CAM_STATUS_MASK); + return ((cmd->result.combined >> 16) & CAM_STATUS_MASK); } static inline @@ -539,7 +539,7 @@ uint32_t ahd_get_transaction_status(struct scb *scb) static inline uint32_t ahd_cmd_get_scsi_status(struct scsi_cmnd *cmd) { - return (cmd->result & 0xFFFF); + return (cmd->result.combined & 0xFFFF); } static inline @@ -631,8 +631,8 @@ void ahd_platform_freeze_devq(struct ahd_softc *ahd, struct scb *scb); static inline void ahd_freeze_scb(struct scb *scb) { - if ((scb->io_ctx->result & (CAM_DEV_QFRZN << 16)) == 0) { - scb->io_ctx->result |= CAM_DEV_QFRZN << 16; + if ((scb->io_ctx->result.combined & (CAM_DEV_QFRZN << 16)) == 0) { + scb->io_ctx->result.combined |= CAM_DEV_QFRZN << 16; scb->platform_data->dev->qfrozen++; } } diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index d33f5a00bf0b06..3cb5bbc90560bc 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -531,7 +531,7 @@ ahc_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd ahc_lock(ahc, &flags); if (ahc->platform_data->qfrozen == 0) { cmd->scsi_done = scsi_done; - cmd->result = CAM_REQ_INPROG << 16; + cmd->result.combined = CAM_REQ_INPROG << 16; rtn = ahc_linux_run_command(ahc, dev, cmd); } ahc_unlock(ahc, &flags); @@ -1698,8 +1698,8 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb) dev = scb->platform_data->dev; dev->active--; dev->openings++; - if ((cmd->result & (CAM_DEV_QFRZN << 16)) != 0) { - cmd->result &= ~(CAM_DEV_QFRZN << 16); + if ((cmd->result.combined & (CAM_DEV_QFRZN << 16)) != 0) { + cmd->result.combined &= ~(CAM_DEV_QFRZN << 16); dev->qfrozen--; } ahc_linux_unmap_scb(ahc, scb); @@ -1838,7 +1838,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc, if (sense_size < SCSI_SENSE_BUFFERSIZE) memset(&cmd->sense_buffer[sense_size], 0, SCSI_SENSE_BUFFERSIZE - sense_size); - cmd->result |= (DRIVER_SENSE << 24); + cmd->result.combined |= (DRIVER_SENSE << 24); #ifdef AHC_DEBUG if (ahc_debug & AHC_SHOW_SENSE) { int i; diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h index 53240f53b65469..5a022f715cba23 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.h +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h @@ -519,8 +519,8 @@ int ahc_linux_show_info(struct seq_file *, struct Scsi_Host *); static inline void ahc_cmd_set_transaction_status(struct scsi_cmnd *cmd, uint32_t status) { - cmd->result &= ~(CAM_STATUS_MASK << 16); - cmd->result |= status << 16; + cmd->result.combined &= ~(CAM_STATUS_MASK << 16); + cmd->result.combined |= status << 16; } static inline @@ -532,8 +532,8 @@ void ahc_set_transaction_status(struct scb *scb, uint32_t status) static inline void ahc_cmd_set_scsi_status(struct scsi_cmnd *cmd, uint32_t status) { - cmd->result &= ~0xFFFF; - cmd->result |= status; + cmd->result.combined &= ~0xFFFF; + cmd->result.combined |= status; } static inline @@ -545,7 +545,7 @@ void ahc_set_scsi_status(struct scb *scb, uint32_t status) static inline uint32_t ahc_cmd_get_transaction_status(struct scsi_cmnd *cmd) { - return ((cmd->result >> 16) & CAM_STATUS_MASK); + return ((cmd->result.combined >> 16) & CAM_STATUS_MASK); } static inline @@ -557,7 +557,7 @@ uint32_t ahc_get_transaction_status(struct scb *scb) static inline uint32_t ahc_cmd_get_scsi_status(struct scsi_cmnd *cmd) { - return (cmd->result & 0xFFFF); + return (cmd->result.combined & 0xFFFF); } static inline @@ -647,8 +647,8 @@ void ahc_platform_freeze_devq(struct ahc_softc *ahc, struct scb *scb); static inline void ahc_freeze_scb(struct scb *scb) { - if ((scb->io_ctx->result & (CAM_DEV_QFRZN << 16)) == 0) { - scb->io_ctx->result |= CAM_DEV_QFRZN << 16; + if ((scb->io_ctx->result.combined & (CAM_DEV_QFRZN << 16)) == 0) { + scb->io_ctx->result.combined |= CAM_DEV_QFRZN << 16; scb->platform_data->dev->qfrozen++; } } diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index 4b79661275c904..ef35f960b8ef88 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -1326,7 +1326,7 @@ static void arcmsr_report_sense_info(struct CommandControlBlock *ccb) struct scsi_cmnd *pcmd = ccb->pcmd; struct SENSE_DATA *sensebuffer = (struct SENSE_DATA *)pcmd->sense_buffer; - pcmd->result = (DID_OK << 16) | (CHECK_CONDITION << 1); + pcmd->result.combined = (DID_OK << 16) | (CHECK_CONDITION << 1); if (sensebuffer) { int sense_data_length = sizeof(struct SENSE_DATA) < SCSI_SENSE_BUFFERSIZE @@ -1335,7 +1335,7 @@ static void arcmsr_report_sense_info(struct CommandControlBlock *ccb) memcpy(sensebuffer, ccb->arcmsr_cdb.SenseData, sense_data_length); sensebuffer->ErrorCode = SCSI_SENSE_CURRENT_ERRORS; sensebuffer->Valid = 1; - pcmd->result |= (DRIVER_SENSE << 24); + pcmd->result.combined |= (DRIVER_SENSE << 24); } } @@ -1390,13 +1390,13 @@ static void arcmsr_report_ccb_state(struct AdapterControlBlock *acb, if (!error) { if (acb->devstate[id][lun] == ARECA_RAID_GONE) acb->devstate[id][lun] = ARECA_RAID_GOOD; - ccb->pcmd->result = DID_OK << 16; + ccb->pcmd->result.combined = DID_OK << 16; arcmsr_ccb_complete(ccb); }else{ switch (ccb->arcmsr_cdb.DeviceStatus) { case ARCMSR_DEV_SELECT_TIMEOUT: { acb->devstate[id][lun] = ARECA_RAID_GONE; - ccb->pcmd->result = DID_NO_CONNECT << 16; + ccb->pcmd->result.combined = DID_NO_CONNECT << 16; arcmsr_ccb_complete(ccb); } break; @@ -1405,7 +1405,7 @@ static void arcmsr_report_ccb_state(struct AdapterControlBlock *acb, case ARCMSR_DEV_INIT_FAIL: { acb->devstate[id][lun] = ARECA_RAID_GONE; - ccb->pcmd->result = DID_BAD_TARGET << 16; + ccb->pcmd->result.combined = DID_BAD_TARGET << 16; arcmsr_ccb_complete(ccb); } break; @@ -1426,7 +1426,7 @@ static void arcmsr_report_ccb_state(struct AdapterControlBlock *acb, , lun , ccb->arcmsr_cdb.DeviceStatus); acb->devstate[id][lun] = ARECA_RAID_GONE; - ccb->pcmd->result = DID_NO_CONNECT << 16; + ccb->pcmd->result.combined = DID_NO_CONNECT << 16; arcmsr_ccb_complete(ccb); break; } @@ -1439,7 +1439,7 @@ static void arcmsr_drain_donequeue(struct AdapterControlBlock *acb, struct Comma if (pCCB->startdone == ARCMSR_CCB_ABORTED) { struct scsi_cmnd *abortcmd = pCCB->pcmd; if (abortcmd) { - abortcmd->result |= DID_ABORT << 16; + abortcmd->result.combined |= DID_ABORT << 16; arcmsr_ccb_complete(pCCB); printk(KERN_NOTICE "arcmsr%d: pCCB ='0x%p' isr got aborted command \n", acb->host->host_no, pCCB); @@ -1594,7 +1594,7 @@ static void arcmsr_remove_scsi_devices(struct AdapterControlBlock *acb) for (i = 0; i < acb->maxFreeCCB; i++) { ccb = acb->pccb_pool[i]; if (ccb->startdone == ARCMSR_CCB_START) { - ccb->pcmd->result = DID_NO_CONNECT << 16; + ccb->pcmd->result.combined = DID_NO_CONNECT << 16; arcmsr_pci_unmap_dma(ccb); ccb->pcmd->scsi_done(ccb->pcmd); } @@ -1686,7 +1686,7 @@ static void arcmsr_remove(struct pci_dev *pdev) struct CommandControlBlock *ccb = acb->pccb_pool[i]; if (ccb->startdone == ARCMSR_CCB_START) { ccb->startdone = ARCMSR_CCB_ABORTED; - ccb->pcmd->result = DID_ABORT << 16; + ccb->pcmd->result.combined = DID_ABORT << 16; arcmsr_ccb_complete(ccb); } } @@ -3178,7 +3178,7 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb, struct scatterlist *sg; if (cmd->device->lun) { - cmd->result = (DID_TIME_OUT << 16); + cmd->result.combined = (DID_TIME_OUT << 16); cmd->scsi_done(cmd); return; } @@ -3209,7 +3209,7 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb, case WRITE_BUFFER: case READ_BUFFER: { if (arcmsr_iop_message_xfer(acb, cmd)) - cmd->result = (DID_ERROR << 16); + cmd->result.combined = (DID_ERROR << 16); cmd->scsi_done(cmd); } break; @@ -3227,13 +3227,13 @@ static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, int target = cmd->device->id; if (acb->acb_flags & ACB_F_ADAPTER_REMOVED) { - cmd->result = (DID_NO_CONNECT << 16); + cmd->result.combined = (DID_NO_CONNECT << 16); cmd->scsi_done(cmd); return 0; } cmd->scsi_done = done; cmd->host_scribble = NULL; - cmd->result = 0; + cmd->result.combined = 0; if (target == 16) { /* virtual device for iop message transfer */ arcmsr_handle_virtual_command(acb, cmd); @@ -3243,7 +3243,7 @@ static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, if (!ccb) return SCSI_MLQUEUE_HOST_BUSY; if (arcmsr_build_ccb( acb, ccb, cmd ) == FAILED) { - cmd->result = (DID_ERROR << 16) | (RESERVATION_CONFLICT << 1); + cmd->result.combined = (DID_ERROR << 16) | (RESERVATION_CONFLICT << 1); cmd->scsi_done(cmd); return 0; } @@ -3516,7 +3516,7 @@ static int arcmsr_hbaA_polling_ccbdone(struct AdapterControlBlock *acb, , ccb->pcmd->device->id , (u32)ccb->pcmd->device->lun , ccb); - ccb->pcmd->result = DID_ABORT << 16; + ccb->pcmd->result.combined = DID_ABORT << 16; arcmsr_ccb_complete(ccb); continue; } @@ -3585,7 +3585,7 @@ static int arcmsr_hbaB_polling_ccbdone(struct AdapterControlBlock *acb, ,ccb->pcmd->device->id ,(u32)ccb->pcmd->device->lun ,ccb); - ccb->pcmd->result = DID_ABORT << 16; + ccb->pcmd->result.combined = DID_ABORT << 16; arcmsr_ccb_complete(ccb); continue; } @@ -3647,7 +3647,7 @@ static int arcmsr_hbaC_polling_ccbdone(struct AdapterControlBlock *acb, , pCCB->pcmd->device->id , (u32)pCCB->pcmd->device->lun , pCCB); - pCCB->pcmd->result = DID_ABORT << 16; + pCCB->pcmd->result.combined = DID_ABORT << 16; arcmsr_ccb_complete(pCCB); continue; } @@ -3722,7 +3722,7 @@ static int arcmsr_hbaD_polling_ccbdone(struct AdapterControlBlock *acb, , pCCB->pcmd->device->id , (u32)pCCB->pcmd->device->lun , pCCB); - pCCB->pcmd->result = DID_ABORT << 16; + pCCB->pcmd->result.combined = DID_ABORT << 16; arcmsr_ccb_complete(pCCB); continue; } @@ -3790,7 +3790,7 @@ static int arcmsr_hbaE_polling_ccbdone(struct AdapterControlBlock *acb, , pCCB->pcmd->device->id , (u32)pCCB->pcmd->device->lun , pCCB); - pCCB->pcmd->result = DID_ABORT << 16; + pCCB->pcmd->result.combined = DID_ABORT << 16; arcmsr_ccb_complete(pCCB); continue; } diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c index 248a5bfad153a7..c39556ff40c18e 100644 --- a/drivers/scsi/arm/acornscsi.c +++ b/drivers/scsi/arm/acornscsi.c @@ -794,7 +794,7 @@ static void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp, acornscsi_dma_cleanup(host); - SCpnt->result = result << 16 | host->scsi.SCp.Message << 8 | host->scsi.SCp.Status; + SCpnt->result.combined = result << 16 | host->scsi.SCp.Message << 8 | host->scsi.SCp.Status; /* * In theory, this should not happen. In practice, it seems to. @@ -844,7 +844,7 @@ static void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp, default: scmd_printk(KERN_ERR, SCpnt, "incomplete data transfer detected: " - "result=%08X", SCpnt->result); + "result=%08X", SCpnt->result.combined); scsi_print_command(SCpnt); acornscsi_dumpdma(host, "done"); acornscsi_dumplog(host, SCpnt->device->id); @@ -2470,7 +2470,7 @@ static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt, if (acornscsi_cmdtype(SCpnt->cmnd[0]) == CMD_WRITE && (NO_WRITE & (1 << SCpnt->device->id))) { printk(KERN_CRIT "scsi%d.%c: WRITE attempted with NO_WRITE flag set\n", host->host->host_no, '0' + SCpnt->device->id); - SCpnt->result = DID_NO_CONNECT << 16; + SCpnt->result.combined = DID_NO_CONNECT << 16; done(SCpnt); return 0; } @@ -2478,7 +2478,7 @@ static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt, SCpnt->scsi_done = done; SCpnt->host_scribble = NULL; - SCpnt->result = 0; + SCpnt->result.combined = 0; SCpnt->tag = 0; SCpnt->SCp.phase = (int)acornscsi_datadirection(SCpnt->cmnd[0]); SCpnt->SCp.sent_command = 0; @@ -2492,7 +2492,7 @@ static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt, unsigned long flags; if (!queue_add_cmd_ordered(&host->queues.issue, SCpnt)) { - SCpnt->result = DID_ERROR << 16; + SCpnt->result.combined = DID_ERROR << 16; done(SCpnt); return 0; } @@ -2523,7 +2523,7 @@ static inline void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, if (SCpnt) { *SCpntp1 = NULL; - SCpnt->result = result; + SCpnt->result.combined = result; SCpnt->scsi_done(SCpnt); } diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c index 2e687ce6075383..56061643c9fa1e 100644 --- a/drivers/scsi/arm/fas216.c +++ b/drivers/scsi/arm/fas216.c @@ -2042,11 +2042,11 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result) { info->stats.fins += 1; - SCpnt->result = result << 16 | info->scsi.SCp.Message << 8 | + SCpnt->result.combined = result << 16 | info->scsi.SCp.Message << 8 | info->scsi.SCp.Status; fas216_log_command(info, LOG_CONNECT, SCpnt, - "command complete, result=0x%08x", SCpnt->result); + "command complete, result=0x%08x", SCpnt->result.combined); /* * If the driver detected an error, we're all done. @@ -2087,7 +2087,8 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result) default: scmd_printk(KERN_ERR, SCpnt, "incomplete data transfer detected: res=%08X ptr=%p len=%X\n", - SCpnt->result, info->scsi.SCp.ptr, + SCpnt->result.combined, + info->scsi.SCp.ptr, info->scsi.SCp.this_residual); scsi_print_command(SCpnt); set_host_byte(SCpnt, DID_ERROR); @@ -2216,7 +2217,7 @@ static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt, SCpnt->scsi_done = done; SCpnt->host_scribble = (void *)fas216_std_done; - SCpnt->result = 0; + SCpnt->result.combined = 0; init_SCp(SCpnt); diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 9d179cd15bb848..7625d5ff3cdf3b 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers/scsi/atp870u.c @@ -494,13 +494,13 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id) dev->last_cmd[c] = 0xff; } if (i == 0x16) { - workreq->result = atp_readb_io(dev, c, 0x0f); + workreq->result.combined = atp_readb_io(dev, c, 0x0f); if (((dev->r1f[c][target_id] & 0x10) != 0) && is885(dev)) { printk(KERN_WARNING "AEC67162 CRC ERROR !\n"); - workreq->result = SAM_STAT_CHECK_CONDITION; + workreq->result.combined = SAM_STAT_CHECK_CONDITION; } } else - workreq->result = SAM_STAT_CHECK_CONDITION; + workreq->result.combined = SAM_STAT_CHECK_CONDITION; if (is885(dev)) { j = atp_readb_base(dev, 0x29) | 0x01; @@ -630,7 +630,7 @@ static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p, req_p->sense_buffer[0]=0; scsi_set_resid(req_p, 0); if (scmd_channel(req_p) > 1) { - req_p->result = DID_BAD_TARGET << 16; + req_p->result.combined = DID_BAD_TARGET << 16; done(req_p); #ifdef ED_DBGP printk("atp870u_queuecommand : req_p->device->channel > 1\n"); @@ -649,7 +649,7 @@ static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p, */ if ((m & dev->active_id[c]) == 0) { - req_p->result = DID_BAD_TARGET << 16; + req_p->result.combined = DID_BAD_TARGET << 16; done(req_p); return 0; } @@ -660,7 +660,7 @@ static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p, #ifdef ED_DBGP printk( "atp870u_queuecommand: done can't be NULL\n"); #endif - req_p->result = 0; + req_p->result.combined = 0; done(req_p); return 0; } @@ -684,7 +684,7 @@ static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p, printk("atp870u_queuecommand : dev->quhd[c] == dev->quend[c]\n"); #endif dev->quend[c]--; - req_p->result = DID_BUS_BUSY << 16; + req_p->result.combined = DID_BUS_BUSY << 16; done(req_p); return 0; } diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 22cf7f4b8d8c80..3284f5b5981249 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -1125,22 +1125,22 @@ be_complete_io(struct beiscsi_conn *beiscsi_conn, return; } - task->sc->result = (DID_OK << 16) | status; + task->sc->result.combined = (DID_OK << 16) | status; if (rsp != ISCSI_STATUS_CMD_COMPLETED) { - task->sc->result = DID_ERROR << 16; + task->sc->result.combined = DID_ERROR << 16; goto unmap; } /* bidi not initially supported */ if (flags & (ISCSI_FLAG_CMD_UNDERFLOW | ISCSI_FLAG_CMD_OVERFLOW)) { if (!status && (flags & ISCSI_FLAG_CMD_OVERFLOW)) - task->sc->result = DID_ERROR << 16; + task->sc->result.combined = DID_ERROR << 16; if (flags & ISCSI_FLAG_CMD_UNDERFLOW) { scsi_set_resid(task->sc, resid); if (!status && (scsi_bufflen(task->sc) - resid < task->sc->underflow)) - task->sc->result = DID_ERROR << 16; + task->sc->result.combined = DID_ERROR << 16; } } @@ -4877,8 +4877,8 @@ static int beiscsi_bsg_request(struct bsg_job *job) nonemb_cmd.va, (resp->response_length + sizeof(*resp))); bsg_reply->reply_payload_rcv_len = resp->response_length; - bsg_reply->result = status; - bsg_job_done(job, bsg_reply->result, + bsg_reply->result.combined = status; + bsg_job_done(job, bsg_reply->result.combined, bsg_reply->reply_payload_rcv_len); dma_free_coherent(&phba->ctrl.pdev->dev, nonemb_cmd.size, nonemb_cmd.va, nonemb_cmd.dma); diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index 6b5841b1c06e8e..168908acb4de2a 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c @@ -62,18 +62,18 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio, host_status = DID_ERROR; } } - cmnd->result = host_status << 16 | scsi_status; + cmnd->result.combined = host_status << 16 | scsi_status; break; case BFI_IOIM_STS_TIMEDOUT: - cmnd->result = DID_TIME_OUT << 16; + cmnd->result.combined = DID_TIME_OUT << 16; break; case BFI_IOIM_STS_PATHTOV: - cmnd->result = DID_TRANSPORT_DISRUPTED << 16; + cmnd->result.combined = DID_TRANSPORT_DISRUPTED << 16; break; default: - cmnd->result = DID_ERROR << 16; + cmnd->result.combined = DID_ERROR << 16; } /* Unmap DMA, if host is NULL, it means a scsi passthru cmd */ @@ -81,16 +81,16 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio, scsi_dma_unmap(cmnd); cmnd->host_scribble = NULL; - bfa_trc(bfad, cmnd->result); + bfa_trc(bfad, cmnd->result.combined); itnim_data = cmnd->device->hostdata; if (itnim_data) { itnim = itnim_data->itnim; - if (!cmnd->result && itnim && + if (!cmnd->result.combined && itnim && (bfa_lun_queue_depth > cmnd->device->queue_depth)) { /* Queue depth adjustment for good status completion */ bfad_ramp_up_qdepth(itnim, cmnd->device); - } else if (cmnd->result == SAM_STAT_TASK_SET_FULL && itnim) { + } else if (cmnd->result.combined == SAM_STAT_TASK_SET_FULL && itnim) { /* qfull handling */ bfad_handle_qfull(itnim, cmnd->device); } @@ -106,7 +106,7 @@ bfa_cb_ioim_good_comp(void *drv, struct bfad_ioim_s *dio) struct bfad_itnim_data_s *itnim_data; struct bfad_itnim_s *itnim; - cmnd->result = DID_OK << 16 | SAM_STAT_GOOD; + cmnd->result.combined = DID_OK << 16 | SAM_STAT_GOOD; /* Unmap DMA, if host is NULL, it means a scsi passthru cmd */ if (cmnd->device->host != NULL) @@ -133,13 +133,13 @@ bfa_cb_ioim_abort(void *drv, struct bfad_ioim_s *dio) struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio; struct bfad_s *bfad = drv; - cmnd->result = DID_ERROR << 16; + cmnd->result.combined = DID_ERROR << 16; /* Unmap DMA, if host is NULL, it means a scsi passthru cmd */ if (cmnd->device->host != NULL) scsi_dma_unmap(cmnd); - bfa_trc(bfad, cmnd->result); + bfa_trc(bfad, cmnd->result.combined); cmnd->host_scribble = NULL; } @@ -1215,16 +1215,16 @@ bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd rc = fc_remote_port_chkready(rport); if (rc) { - cmnd->result = rc; + cmnd->result.combined = rc; done(cmnd); return 0; } if (bfad->bfad_flags & BFAD_EEH_BUSY) { if (bfad->bfad_flags & BFAD_EEH_PCI_CHANNEL_IO_PERM_FAILURE) - cmnd->result = DID_NO_CONNECT << 16; + cmnd->result.combined = DID_NO_CONNECT << 16; else - cmnd->result = DID_REQUEUE << 16; + cmnd->result.combined = DID_REQUEUE << 16; done(cmnd); return 0; } @@ -1240,14 +1240,14 @@ bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd printk(KERN_WARNING "bfad%d, queuecommand %p %x failed, BFA stopped\n", bfad->inst_no, cmnd, cmnd->cmnd[0]); - cmnd->result = DID_NO_CONNECT << 16; + cmnd->result.combined = DID_NO_CONNECT << 16; goto out_fail_cmd; } itnim = itnim_data->itnim; if (!itnim) { - cmnd->result = DID_IMM_RETRY << 16; + cmnd->result.combined = DID_IMM_RETRY << 16; goto out_fail_cmd; } diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c index 1a0dc18d691556..97a3d3e6fd67f0 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_io.c +++ b/drivers/scsi/bnx2fc/bnx2fc_io.c @@ -198,7 +198,7 @@ static void bnx2fc_scsi_done(struct bnx2fc_cmd *io_req, int err_code) return; } - sc_cmd->result = err_code << 16; + sc_cmd->result.combined = err_code << 16; BNX2FC_IO_DBG(io_req, "sc=%p, result=0x%x, retries=%d, allowed=%d\n", sc_cmd, host_byte(sc_cmd->result), sc_cmd->retries, @@ -1579,10 +1579,10 @@ void bnx2fc_process_tm_compl(struct bnx2fc_cmd *io_req, case FC_GOOD: if (io_req->cdb_status == 0) { /* Good IO completion */ - sc_cmd->result = DID_OK << 16; + sc_cmd->result.combined = DID_OK << 16; } else { /* Transport status is good, SCSI status not good */ - sc_cmd->result = (DID_OK << 16) | io_req->cdb_status; + sc_cmd->result.combined = (DID_OK << 16) | io_req->cdb_status; } if (io_req->fcp_resid) scsi_set_resid(sc_cmd, io_req->fcp_resid); @@ -1851,7 +1851,7 @@ int bnx2fc_queuecommand(struct Scsi_Host *host, rval = fc_remote_port_chkready(rport); if (rval) { - sc_cmd->result = rval; + sc_cmd->result.combined = rval; sc_cmd->scsi_done(sc_cmd); return 0; } @@ -1974,13 +1974,13 @@ void bnx2fc_process_scsi_cmd_compl(struct bnx2fc_cmd *io_req, case FC_GOOD: if (io_req->cdb_status == 0) { /* Good IO completion */ - sc_cmd->result = DID_OK << 16; + sc_cmd->result.combined = DID_OK << 16; } else { /* Transport status is good, SCSI status not good */ BNX2FC_IO_DBG(io_req, "scsi_cmpl: cdb_status = %d" " fcp_resid = 0x%x\n", io_req->cdb_status, io_req->fcp_resid); - sc_cmd->result = (DID_OK << 16) | io_req->cdb_status; + sc_cmd->result.combined = (DID_OK << 16) | io_req->cdb_status; if (io_req->cdb_status == SAM_STAT_TASK_SET_FULL || io_req->cdb_status == SAM_STAT_BUSY) { diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c index 56b9ad0a1ca08f..fd2d3d4ec3732f 100644 --- a/drivers/scsi/csiostor/csio_scsi.c +++ b/drivers/scsi/csiostor/csio_scsi.c @@ -1719,7 +1719,7 @@ csio_scsi_err_handler(struct csio_hw *hw, struct csio_ioreq *req) host_status = csio_scsi_copy_to_sgl(hw, req); } - cmnd->result = (((host_status) << 16) | scsi_status); + cmnd->result.combined = (((host_status) << 16) | scsi_status); cmnd->scsi_done(cmnd); /* Wake up waiting threads */ @@ -1747,7 +1747,7 @@ csio_scsi_cbfn(struct csio_hw *hw, struct csio_ioreq *req) host_status = csio_scsi_copy_to_sgl(hw, req); } - cmnd->result = (((host_status) << 16) | scsi_status); + cmnd->result.combined = (((host_status) << 16) | scsi_status); cmnd->scsi_done(cmnd); csio_scsi_cmnd(req) = NULL; CSIO_INC_STATS(csio_hw_to_scsim(hw), n_tot_success); @@ -1790,13 +1790,13 @@ csio_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmnd) nr = fc_remote_port_chkready(rport); if (nr) { - cmnd->result = nr; + cmnd->result.combined = nr; CSIO_INC_STATS(scsim, n_rn_nr_error); goto err_done; } if (unlikely(!csio_is_hw_ready(hw))) { - cmnd->result = (DID_REQUEUE << 16); + cmnd->result.combined = (DID_REQUEUE << 16); CSIO_INC_STATS(scsim, n_hw_nr_error); goto err_done; } @@ -1978,7 +1978,7 @@ csio_eh_abort_handler(struct scsi_cmnd *cmnd) csio_scsi_cmnd(ioreq) = NULL; spin_unlock_irq(&hw->lock); - cmnd->result = (DID_ERROR << 16); + cmnd->result.combined = (DID_ERROR << 16); cmnd->scsi_done(cmnd); return FAILED; diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index dc36531d589e28..e7b6b5cfbef6bc 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash/main.c @@ -59,7 +59,7 @@ static void process_cmd_err(struct afu_cmd *cmd, struct scsi_cmnd *scp) if (ioasa->rc.flags & SISL_RC_FLAGS_OVERRUN) { dev_dbg(dev, "%s: cmd underrun cmd = %p scp = %p\n", __func__, cmd, scp); - scp->result = (DID_ERROR << 16); + scp->result.combined = (DID_ERROR << 16); } dev_dbg(dev, "%s: cmd failed afu_rc=%02x scsi_rc=%02x fc_rc=%02x " @@ -72,9 +72,9 @@ static void process_cmd_err(struct afu_cmd *cmd, struct scsi_cmnd *scp) if (ioasa->rc.flags & SISL_RC_FLAGS_SENSE_VALID) { memcpy(scp->sense_buffer, ioasa->sense_data, SISL_SENSE_DATA_LEN); - scp->result = ioasa->rc.scsi_rc; + scp->result.combined = ioasa->rc.scsi_rc; } else - scp->result = ioasa->rc.scsi_rc | (DID_ERROR << 16); + scp->result.combined = ioasa->rc.scsi_rc | (DID_ERROR << 16); } /* @@ -85,7 +85,7 @@ static void process_cmd_err(struct afu_cmd *cmd, struct scsi_cmnd *scp) /* We have an FC status */ switch (ioasa->rc.fc_rc) { case SISL_FC_RC_LINKDOWN: - scp->result = (DID_REQUEUE << 16); + scp->result.combined = (DID_REQUEUE << 16); break; case SISL_FC_RC_RESID: /* This indicates an FCP resid underrun */ @@ -95,7 +95,7 @@ static void process_cmd_err(struct afu_cmd *cmd, struct scsi_cmnd *scp) * If not then we must handle it here. * This is probably an AFU bug. */ - scp->result = (DID_ERROR << 16); + scp->result.combined = (DID_ERROR << 16); } break; case SISL_FC_RC_RESIDERR: @@ -108,7 +108,7 @@ static void process_cmd_err(struct afu_cmd *cmd, struct scsi_cmnd *scp) case SISL_FC_RC_WRABORTPEND: case SISL_FC_RC_NOEXP: case SISL_FC_RC_INUSE: - scp->result = (DID_ERROR << 16); + scp->result.combined = (DID_ERROR << 16); break; } } @@ -117,25 +117,25 @@ static void process_cmd_err(struct afu_cmd *cmd, struct scsi_cmnd *scp) /* We have an AFU error */ switch (ioasa->rc.afu_rc) { case SISL_AFU_RC_NO_CHANNELS: - scp->result = (DID_NO_CONNECT << 16); + scp->result.combined = (DID_NO_CONNECT << 16); break; case SISL_AFU_RC_DATA_DMA_ERR: switch (ioasa->afu_extra) { case SISL_AFU_DMA_ERR_PAGE_IN: /* Retry */ - scp->result = (DID_IMM_RETRY << 16); + scp->result.combined = (DID_IMM_RETRY << 16); break; case SISL_AFU_DMA_ERR_INVALID_EA: default: - scp->result = (DID_ERROR << 16); + scp->result.combined = (DID_ERROR << 16); } break; case SISL_AFU_RC_OUT_OF_DATA_BUFS: /* Retry */ - scp->result = (DID_ALLOC_FAILURE << 16); + scp->result.combined = (DID_ALLOC_FAILURE << 16); break; default: - scp->result = (DID_ERROR << 16); + scp->result.combined = (DID_ERROR << 16); } } } @@ -167,10 +167,11 @@ static void cmd_complete(struct afu_cmd *cmd) if (unlikely(cmd->sa.ioasc)) process_cmd_err(cmd, scp); else - scp->result = (DID_OK << 16); + scp->result.combined = (DID_OK << 16); dev_dbg_ratelimited(dev, "%s:scp=%p result=%08x ioasc=%08x\n", - __func__, scp, scp->result, cmd->sa.ioasc); + __func__, scp, scp->result.combined, + cmd->sa.ioasc); scp->scsi_done(scp); } else if (cmd->cmd_tmf) { spin_lock_irqsave(&cfg->tmf_slock, lock_flags); @@ -204,7 +205,7 @@ static void flush_pending_cmds(struct hwq *hwq) if (cmd->scp) { scp = cmd->scp; - scp->result = (DID_IMM_RETRY << 16); + scp->result.combined = (DID_IMM_RETRY << 16); scp->scsi_done(scp); } else { cmd->cmd_aborted = true; @@ -600,7 +601,7 @@ static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp) goto out; case STATE_FAILTERM: dev_dbg_ratelimited(dev, "%s: device has failed\n", __func__); - scp->result = (DID_NO_CONNECT << 16); + scp->result.combined = (DID_NO_CONNECT << 16); scp->scsi_done(scp); rc = 0; goto out; diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 6f95176c6f85c0..438590c0022515 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -170,11 +170,11 @@ #define MK_RES(drv,did,msg,tgt) ((int)(drv)<<24 | (int)(did)<<16 | (int)(msg)<<8 | (int)(tgt)) #define MK_RES_LNX(drv,did,msg,tgt) ((int)(drv)<<24 | (int)(did)<<16 | (int)(msg)<<8 | (int)(tgt)<<1) -#define SET_RES_TARGET(who,tgt) { who &= ~RES_TARGET; who |= (int)(tgt); } +#define SET_RES_TARGET(who,tgt) { who.combined &= ~RES_TARGET; who.combined |= (int)(tgt); } #define SET_RES_TARGET_LNX(who,tgt) { who &= ~RES_TARGET_LNX; who |= (int)(tgt) << 1; } -#define SET_RES_MSG(who,msg) { who &= ~RES_ENDMSG; who |= (int)(msg) << 8; } -#define SET_RES_DID(who,did) { who &= ~RES_DID; who |= (int)(did) << 16; } -#define SET_RES_DRV(who,drv) { who &= ~RES_DRV; who |= (int)(drv) << 24; } +#define SET_RES_MSG(who,msg) { who.combined &= ~RES_ENDMSG; who.combined |= (int)(msg) << 8; } +#define SET_RES_DID(who,did) { who.combined &= ~RES_DID; who.combined |= (int)(did) << 16; } +#define SET_RES_DRV(who,drv) { who.combined &= ~RES_DRV; who.combined |= (int)(drv) << 24; } #define TAG_NONE 255 @@ -986,7 +986,7 @@ static int dc395x_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct s cmd, cmd->device->id, (u8)cmd->device->lun, cmd->cmnd[0]); /* Assume BAD_TARGET; will be cleared later */ - cmd->result = DID_BAD_TARGET << 16; + cmd->result.combined = DID_BAD_TARGET << 16; /* ignore invalid targets */ if (cmd->device->id >= acb->scsi_host->max_id || @@ -1013,7 +1013,7 @@ static int dc395x_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct s /* set callback and clear result in the command */ cmd->scsi_done = done; - cmd->result = 0; + cmd->result.combined = 0; srb = list_first_entry_or_null(&acb->srb_free_list, struct ScsiReqBlk, list); @@ -1250,7 +1250,7 @@ static int dc395x_eh_abort(struct scsi_cmnd *cmd) free_tag(dcb, srb); list_add_tail(&srb->list, &acb->srb_free_list); dprintkl(KERN_DEBUG, "eh_abort: Command was waiting\n"); - cmd->result = DID_ABORT << 16; + cmd->result.combined = DID_ABORT << 16; return SUCCESS; } srb = find_cmd(cmd, &dcb->srb_going_list); @@ -3234,19 +3234,19 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, } if (status == (CHECK_CONDITION << 1)) { - cmd->result = DID_BAD_TARGET << 16; + cmd->result.combined = DID_BAD_TARGET << 16; goto ckc_e; } dprintkdbg(DBG_0, "srb_done: AUTO_REQSENSE2\n"); if (srb->total_xfer_length && srb->total_xfer_length >= cmd->underflow) - cmd->result = + cmd->result.combined = MK_RES_LNX(DRIVER_SENSE, DID_OK, srb->end_message, CHECK_CONDITION); /*SET_RES_DID(cmd->result,DID_OK) */ else - cmd->result = + cmd->result.combined = MK_RES_LNX(DRIVER_SENSE, DID_OK, srb->end_message, CHECK_CONDITION); @@ -3277,7 +3277,7 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, } else if (status == SCSI_STAT_SEL_TIMEOUT) { srb->adapter_status = H_SEL_TIMEOUT; srb->target_status = 0; - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; } else { srb->adapter_status = 0; SET_RES_DID(cmd->result, DID_ERROR); @@ -3322,14 +3322,14 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, base = scsi_kmap_atomic_sg(sg, scsi_sg_count(cmd), &offset, &len); ptr = (struct ScsiInqData *)(base + offset); - if (!ckc_only && (cmd->result & RES_DID) == 0 + if (!ckc_only && (cmd->result.combined & RES_DID) == 0 && cmd->cmnd[2] == 0 && scsi_bufflen(cmd) >= 8 && dir != DMA_NONE && ptr && (ptr->Vers & 0x07) >= 2) dcb->inquiry7 = ptr->Flags; /*if( srb->cmd->cmnd[0] == INQUIRY && */ /* (host_byte(cmd->result) == DID_OK || status_byte(cmd->result) & CHECK_CONDITION) ) */ - if ((cmd->result == (DID_OK << 16) || + if ((cmd->result.combined == (DID_OK << 16) || status_byte(cmd->result) == CHECK_CONDITION)) { if (!dcb->init_tcq_flag) { add_dev(acb, dcb, ptr); @@ -3357,7 +3357,7 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, if (srb != acb->tmp_srb) { /* Add to free list */ dprintkdbg(DBG_0, "srb_done: (0x%p) done result=0x%08x\n", - cmd, cmd->result); + cmd, cmd->result.combined); list_move_tail(&srb->list, &acb->srb_free_list); } else { dprintkl(KERN_ERR, "srb_done: ERROR! Completed cmd with tmp_srb\n"); @@ -3390,7 +3390,7 @@ static void doing_srb_done(struct AdapterCtlBlk *acb, u8 did_flag, list_del(&srb->list); free_tag(dcb, srb); list_add_tail(&srb->list, &acb->srb_free_list); - p->result = result; + p->result.combined = result; pci_unmap_srb_sense(acb, srb); pci_unmap_srb(acb, srb); if (force) { @@ -3418,7 +3418,7 @@ static void doing_srb_done(struct AdapterCtlBlk *acb, u8 did_flag, printk("W:%p<%02i-%i>", p, p->device->id, (u8)p->device->lun); list_move_tail(&srb->list, &acb->srb_free_list); - p->result = result; + p->result.combined = result; pci_unmap_srb_sense(acb, srb); pci_unmap_srb(acb, srb); if (force) { diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index a18a4a08f049ac..c6ee0221584b4d 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c @@ -430,7 +430,7 @@ static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd */ if ((cmd->cmnd[0] == REQUEST_SENSE) && (cmd->sense_buffer[0] != 0)) { - cmd->result = (DID_OK << 16); + cmd->result.combined = (DID_OK << 16); cmd->scsi_done(cmd); return 0; } @@ -455,7 +455,7 @@ static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd 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); + cmd->result.combined = (DID_NO_CONNECT << 16); cmd->scsi_done(cmd); return 0; } @@ -2226,7 +2226,7 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d default: printk(KERN_WARNING"%s: scsi opcode 0x%x not supported.\n", pHba->name, cmd->cmnd[0]); - cmd->result = (DID_ERROR <<16); + cmd->result.combined = (DID_ERROR <<16); cmd->scsi_done(cmd); return 0; } @@ -2359,15 +2359,15 @@ static void adpt_i2o_scsi_complete(void __iomem *reply, struct scsi_cmnd *cmd) if(!(reply_flags & MSG_FAIL)) { switch(detailed_status & I2O_SCSI_DSC_MASK) { case I2O_SCSI_DSC_SUCCESS: - cmd->result = (DID_OK << 16); + cmd->result.combined = (DID_OK << 16); // handle underflow if (readl(reply+20) < cmd->underflow) { - cmd->result = (DID_ERROR <<16); + cmd->result.combined = (DID_ERROR <<16); printk(KERN_WARNING"%s: SCSI CMD underflow\n",pHba->name); } break; case I2O_SCSI_DSC_REQUEST_ABORTED: - cmd->result = (DID_ABORT << 16); + cmd->result.combined = (DID_ABORT << 16); break; case I2O_SCSI_DSC_PATH_INVALID: case I2O_SCSI_DSC_DEVICE_NOT_PRESENT: @@ -2377,19 +2377,19 @@ static void adpt_i2o_scsi_complete(void __iomem *reply, struct scsi_cmnd *cmd) case I2O_SCSI_DSC_RESOURCE_UNAVAILABLE: 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); + cmd->result.combined = (DID_TIME_OUT << 16); break; case I2O_SCSI_DSC_ADAPTER_BUSY: case I2O_SCSI_DSC_BUS_BUSY: - cmd->result = (DID_BUS_BUSY << 16); + cmd->result.combined = (DID_BUS_BUSY << 16); break; case I2O_SCSI_DSC_SCSI_BUS_RESET: case I2O_SCSI_DSC_BDR_MESSAGE_SENT: - cmd->result = (DID_RESET << 16); + cmd->result.combined = (DID_RESET << 16); break; case I2O_SCSI_DSC_PARITY_ERROR_FAILURE: printk(KERN_WARNING"%s: SCSI CMD parity error\n",pHba->name); - cmd->result = (DID_PARITY << 16); + cmd->result.combined = (DID_PARITY << 16); break; case I2O_SCSI_DSC_UNABLE_TO_ABORT: case I2O_SCSI_DSC_COMPLETE_WITH_ERROR: @@ -2418,7 +2418,7 @@ static void adpt_i2o_scsi_complete(void __iomem *reply, struct scsi_cmnd *cmd) 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); + cmd->result.combined = (DID_ERROR << 16); break; } @@ -2431,7 +2431,7 @@ static void adpt_i2o_scsi_complete(void __iomem *reply, struct scsi_cmnd *cmd) if(cmd->sense_buffer[0] == 0x70 /* class 7 */ && cmd->sense_buffer[2] == DATA_PROTECT ){ /* This is to handle an array failed */ - cmd->result = (DID_TIME_OUT << 16); + cmd->result.combined = (DID_TIME_OUT << 16); 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]); @@ -2443,13 +2443,13 @@ static void adpt_i2o_scsi_complete(void __iomem *reply, struct scsi_cmnd *cmd) * the card rejected it. We should signal a retry * for a limitted number of retries. */ - cmd->result = (DID_TIME_OUT << 16); + cmd->result.combined = (DID_TIME_OUT << 16); 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]); } - cmd->result |= (dev_status); + cmd->result.combined |= (dev_status); if(cmd->scsi_done != NULL){ cmd->scsi_done(cmd); diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c index a9dd6345f064c9..01ba91738bcb27 100644 --- a/drivers/scsi/esas2r/esas2r_main.c +++ b/drivers/scsi/esas2r/esas2r_main.c @@ -824,10 +824,10 @@ int esas2r_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) unsigned bufflen; /* Assume success, if it fails we will fix the result later. */ - cmd->result = DID_OK << 16; + cmd->result.combined = DID_OK << 16; if (unlikely(test_bit(AF_DEGRADED_MODE, &a->flags))) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; cmd->scsi_done(cmd); return 0; } @@ -984,7 +984,7 @@ int esas2r_eh_abort(struct scsi_cmnd *cmd) esas2r_log(ESAS2R_LOG_INFO, "eh_abort (%p)", cmd); if (test_bit(AF_DEGRADED_MODE, &a->flags)) { - cmd->result = DID_ABORT << 16; + cmd->result.combined = DID_ABORT << 16; scsi_set_resid(cmd, 0); @@ -1050,7 +1050,7 @@ int esas2r_eh_abort(struct scsi_cmnd *cmd) * freed it, or we didn't find it at all. Either way, success! */ - cmd->result = DID_ABORT << 16; + cmd->result.combined = DID_ABORT << 16; scsi_set_resid(cmd, 0); @@ -1523,7 +1523,7 @@ void esas2r_complete_request_cb(struct esas2r_adapter *a, rq->func_rsp.scsi_rsp.scsi_stat, rq->cmd); - rq->cmd->result = + rq->cmd->result.combined = ((esas2r_req_status_to_error(rq->req_stat) << 16) | (rq->func_rsp.scsi_rsp.scsi_stat & STATUS_MASK)); diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index 342535ac0570a1..14f437211284d3 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c @@ -905,7 +905,7 @@ static void esp_cmd_is_done(struct esp *esp, struct esp_cmd_entry *ent, esp->active_cmd = NULL; esp_unmap_dma(esp, cmd); esp_free_lun_tag(ent, dev->hostdata); - cmd->result = 0; + cmd->result.combined = 0; set_host_byte(cmd, host_byte); if (host_byte == DID_OK) set_status_byte(cmd, ent->status); @@ -922,7 +922,7 @@ static void esp_cmd_is_done(struct esp *esp, struct esp_cmd_entry *ent, * saw originally. Also, report that we are providing * the sense data. */ - cmd->result = ((DRIVER_SENSE << 24) | + cmd->result.combined = ((DRIVER_SENSE << 24) | (DID_OK << 16) | (SAM_STAT_CHECK_CONDITION << 0)); @@ -2035,7 +2035,7 @@ static void esp_reset_cleanup_one(struct esp *esp, struct esp_cmd_entry *ent) esp_unmap_dma(esp, cmd); esp_free_lun_tag(ent, cmd->device->hostdata); - cmd->result = DID_RESET << 16; + cmd->result.combined = DID_RESET << 16; if (ent->flags & ESP_CMD_FLAG_AUTOSENSE) esp_unmap_sense(esp, ent); @@ -2062,7 +2062,7 @@ static void esp_reset_cleanup(struct esp *esp) struct scsi_cmnd *cmd = ent->cmd; list_del(&ent->list); - cmd->result = DID_RESET << 16; + cmd->result.combined = DID_RESET << 16; cmd->scsi_done(cmd); esp_put_ent(esp, ent); } @@ -2536,7 +2536,7 @@ static int esp_eh_abort_handler(struct scsi_cmnd *cmd) */ list_del(&ent->list); - cmd->result = DID_ABORT << 16; + cmd->result.combined = DID_ABORT << 16; cmd->scsi_done(cmd); esp_put_ent(esp, ent); diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index 772bdc93930ac6..35b9a9ba706610 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c @@ -206,7 +206,7 @@ static void fdomain_finish_cmd(struct fdomain *fd, int result) { outb(0, fd->base + REG_ICTL); fdomain_make_bus_idle(fd); - fd->cur_cmd->result = result; + fd->cur_cmd->result.combined = result; fd->cur_cmd->scsi_done(fd->cur_cmd); fd->cur_cmd = NULL; } @@ -439,7 +439,7 @@ static int fdomain_abort(struct scsi_cmnd *cmd) fdomain_make_bus_idle(fd); fd->cur_cmd->SCp.phase |= aborted; - fd->cur_cmd->result = DID_ABORT << 16; + fd->cur_cmd->result.combined = DID_ABORT << 16; /* Aborts are not done well. . . */ fdomain_finish_cmd(fd, DID_ABORT << 16); diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index e619a82f921b19..22e55bb162ed0c 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -447,7 +447,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ if (!rport) { FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, "returning DID_NO_CONNECT for IO as rport is NULL\n"); - sc->result = DID_NO_CONNECT << 16; + sc->result.combined = DID_NO_CONNECT << 16; done(sc); return 0; } @@ -457,7 +457,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, "rport is not ready\n"); atomic64_inc(&fnic_stats->misc_stats.rport_not_ready); - sc->result = ret; + sc->result.combined = ret; done(sc); return 0; } @@ -469,7 +469,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ rport->port_id); atomic64_inc(&fnic_stats->misc_stats.rport_not_ready); - sc->result = DID_NO_CONNECT<<16; + sc->result.combined = DID_NO_CONNECT<<16; done(sc); return 0; } @@ -479,7 +479,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ "rport 0x%x in state 0x%x, returning DID_IMM_RETRY\n", rport->port_id, rp->rp_state); - sc->result = DID_IMM_RETRY << 16; + sc->result.combined = DID_IMM_RETRY << 16; done(sc); return 0; } @@ -919,7 +919,7 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic, switch (hdr_status) { case FCPIO_SUCCESS: - sc->result = (DID_OK << 16) | icmnd_cmpl->scsi_status; + sc->result.combined = (DID_OK << 16) | icmnd_cmpl->scsi_status; xfer_len = scsi_bufflen(sc); if (icmnd_cmpl->flags & FCPIO_ICMND_CMPL_RESID_UNDER) { @@ -936,50 +936,50 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic, case FCPIO_TIMEOUT: /* request was timed out */ atomic64_inc(&fnic_stats->misc_stats.fcpio_timeout); - sc->result = (DID_TIME_OUT << 16) | icmnd_cmpl->scsi_status; + sc->result.combined = (DID_TIME_OUT << 16) | icmnd_cmpl->scsi_status; break; case FCPIO_ABORTED: /* request was aborted */ atomic64_inc(&fnic_stats->misc_stats.fcpio_aborted); - sc->result = (DID_ERROR << 16) | icmnd_cmpl->scsi_status; + sc->result.combined = (DID_ERROR << 16) | icmnd_cmpl->scsi_status; break; case FCPIO_DATA_CNT_MISMATCH: /* recv/sent more/less data than exp. */ atomic64_inc(&fnic_stats->misc_stats.data_count_mismatch); scsi_set_resid(sc, icmnd_cmpl->residual); - sc->result = (DID_ERROR << 16) | icmnd_cmpl->scsi_status; + sc->result.combined = (DID_ERROR << 16) | icmnd_cmpl->scsi_status; break; case FCPIO_OUT_OF_RESOURCE: /* out of resources to complete request */ atomic64_inc(&fnic_stats->fw_stats.fw_out_of_resources); - sc->result = (DID_REQUEUE << 16) | icmnd_cmpl->scsi_status; + sc->result.combined = (DID_REQUEUE << 16) | icmnd_cmpl->scsi_status; break; case FCPIO_IO_NOT_FOUND: /* requested I/O was not found */ atomic64_inc(&fnic_stats->io_stats.io_not_found); - sc->result = (DID_ERROR << 16) | icmnd_cmpl->scsi_status; + sc->result.combined = (DID_ERROR << 16) | icmnd_cmpl->scsi_status; break; case FCPIO_SGL_INVALID: /* request was aborted due to sgl error */ atomic64_inc(&fnic_stats->misc_stats.sgl_invalid); - sc->result = (DID_ERROR << 16) | icmnd_cmpl->scsi_status; + sc->result.combined = (DID_ERROR << 16) | icmnd_cmpl->scsi_status; break; case FCPIO_FW_ERR: /* request was terminated due fw error */ atomic64_inc(&fnic_stats->fw_stats.io_fw_errs); - sc->result = (DID_ERROR << 16) | icmnd_cmpl->scsi_status; + sc->result.combined = (DID_ERROR << 16) | icmnd_cmpl->scsi_status; break; case FCPIO_MSS_INVALID: /* request was aborted due to mss error */ atomic64_inc(&fnic_stats->misc_stats.mss_invalid); - sc->result = (DID_ERROR << 16) | icmnd_cmpl->scsi_status; + sc->result.combined = (DID_ERROR << 16) | icmnd_cmpl->scsi_status; break; case FCPIO_INVALID_HEADER: /* header contains invalid data */ case FCPIO_INVALID_PARAM: /* some parameter in request invalid */ case FCPIO_REQ_NOT_SUPPORTED:/* request type is not supported */ default: - sc->result = (DID_ERROR << 16) | icmnd_cmpl->scsi_status; + sc->result.combined = (DID_ERROR << 16) | icmnd_cmpl->scsi_status; break; } @@ -1188,7 +1188,7 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic *fnic, FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, "abts cmpl, completing IO\n"); CMD_SP(sc) = NULL; - sc->result = (DID_ERROR << 16); + sc->result.combined = (DID_ERROR << 16); spin_unlock_irqrestore(io_lock, flags); @@ -1418,7 +1418,7 @@ static void fnic_cleanup_io(struct fnic *fnic, int exclude_id) fnic_release_ioreq_buf(fnic, io_req, sc); mempool_free(io_req, fnic->io_req_pool); - sc->result = DID_TRANSPORT_DISRUPTED << 16; + sc->result.combined = DID_TRANSPORT_DISRUPTED << 16; FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, "%s: tag:0x%x : sc:0x%p duration = %lu DID_TRANSPORT_DISRUPTED\n", __func__, sc->request->tag, sc, @@ -1494,7 +1494,7 @@ void fnic_wq_copy_cleanup_handler(struct vnic_wq_copy *wq, mempool_free(io_req, fnic->io_req_pool); wq_copy_cleanup_scsi_cmd: - sc->result = DID_NO_CONNECT << 16; + sc->result.combined = DID_NO_CONNECT << 16; FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, "wq_copy_cleanup_handler:" " DID_NO_CONNECT\n"); @@ -2039,7 +2039,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc) if (sc->scsi_done) { /* Call SCSI completion function to complete the IO */ - sc->result = (DID_ABORT << 16); + sc->result.combined = (DID_ABORT << 16); sc->scsi_done(sc); atomic64_dec(&fnic_stats->io_stats.active_ios); if (atomic64_read(&fnic->io_cmpl_skip)) @@ -2272,7 +2272,7 @@ static int fnic_clean_pending_aborts(struct fnic *fnic, */ if (sc->scsi_done) { /* Set result to let upper SCSI layer retry */ - sc->result = DID_RESET << 16; + sc->result.combined = DID_RESET << 16; sc->scsi_done(sc); } } diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index b551e0ee2271eb..b90321f2f9e3b2 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -660,7 +660,7 @@ static bool complete_all_cmds_iter(struct request *rq, void *data, bool rsvd) enum host_status status = *(enum host_status *)data; scsi_dma_unmap(scmd); - scmd->result = 0; + scmd->result.combined = 0; set_host_byte(scmd, status); scmd->scsi_done(scmd); return true; diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 38369766511c4c..cc05b2b3d93aa7 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -2352,10 +2352,10 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h, switch (c2->error_data.status) { case IOACCEL2_STATUS_SR_TASK_COMP_GOOD: if (cmd) - cmd->result = 0; + cmd->result.combined = 0; break; case IOACCEL2_STATUS_SR_TASK_COMP_CHK_COND: - cmd->result |= SAM_STAT_CHECK_CONDITION; + cmd->result.combined |= SAM_STAT_CHECK_CONDITION; if (c2->error_data.data_present != IOACCEL2_SENSE_DATA_PRESENT) { memset(cmd->sense_buffer, 0, @@ -2398,7 +2398,7 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h, retry = 1; break; case IOACCEL2_STATUS_SR_UNDERRUN: - cmd->result = (DID_OK << 16); /* host byte */ + cmd->result.combined = (DID_OK << 16); /* host byte */ ioaccel2_resid = get_unaligned_le32( &c2->error_data.resid_cnt[0]); scsi_set_resid(cmd, ioaccel2_resid); @@ -2415,7 +2415,7 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h, * of the disk to get the same device node. */ if (dev->physical_device && dev->expose_device) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; dev->removed = 1; h->drv_req_rescan = 1; dev_warn(&h->pdev->dev, @@ -2502,7 +2502,7 @@ static void process_ioaccel2_completion(struct ctlr_info *h, /* check for good status */ if (likely(c2->error_data.serv_response == 0 && c2->error_data.status == 0)) { - cmd->result = 0; + cmd->result.combined = 0; return hpsa_cmd_free_and_done(h, c, cmd); } @@ -2520,7 +2520,7 @@ static void process_ioaccel2_completion(struct ctlr_info *h, } if (dev->in_reset) { - cmd->result = DID_RESET << 16; + cmd->result.combined = DID_RESET << 16; return hpsa_cmd_free_and_done(h, c, cmd); } @@ -2579,13 +2579,13 @@ static void complete_scsi_command(struct CommandList *cp) h = cp->h; if (!cmd->device) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; return hpsa_cmd_free_and_done(h, cp, cmd); } dev = cmd->device->hostdata; if (!dev) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; return hpsa_cmd_free_and_done(h, cp, cmd); } c2 = &h->ioaccel2_cmd_pool[cp->cmdindex]; @@ -2599,7 +2599,7 @@ static void complete_scsi_command(struct CommandList *cp) (c2->sg[0].chain_indicator == IOACCEL2_CHAIN)) hpsa_unmap_ioaccel2_sg_chain_block(h, c2); - cmd->result = (DID_OK << 16); /* host byte */ + cmd->result.combined = (DID_OK << 16); /* host byte */ /* SCSI command has already been cleaned up in SML */ if (dev->was_removed) { @@ -2610,7 +2610,7 @@ static void complete_scsi_command(struct CommandList *cp) if (cp->cmd_type == CMD_IOACCEL2 || cp->cmd_type == CMD_IOACCEL1) { if (dev->physical_device && dev->expose_device && dev->removed) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; return hpsa_cmd_free_and_done(h, cp, cmd); } if (likely(cp->phys_disk != NULL)) @@ -2624,7 +2624,7 @@ static void complete_scsi_command(struct CommandList *cp) */ if (unlikely(ei->CommandStatus == CMD_CTLR_LOCKUP)) { /* DID_NO_CONNECT will prevent a retry */ - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; return hpsa_cmd_free_and_done(h, cp, cmd); } @@ -2663,7 +2663,7 @@ static void complete_scsi_command(struct CommandList *cp) switch (ei->CommandStatus) { case CMD_TARGET_STATUS: - cmd->result |= ei->ScsiStatus; + cmd->result.combined |= ei->ScsiStatus; /* copy the sense data */ if (SCSI_SENSE_BUFFERSIZE < sizeof(ei->SenseInfo)) sense_data_size = SCSI_SENSE_BUFFERSIZE; @@ -2678,7 +2678,7 @@ static void complete_scsi_command(struct CommandList *cp) if (ei->ScsiStatus == SAM_STAT_CHECK_CONDITION) { switch (sense_key) { case ABORTED_COMMAND: - cmd->result |= DID_SOFT_ERROR << 16; + cmd->result.combined |= DID_SOFT_ERROR << 16; break; case UNIT_ATTENTION: if (asc == 0x3F && ascq == 0x0E) @@ -2687,7 +2687,7 @@ static void complete_scsi_command(struct CommandList *cp) case ILLEGAL_REQUEST: if (asc == 0x25 && ascq == 0x00) { dev->removed = 1; - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; } break; } @@ -2702,7 +2702,7 @@ static void complete_scsi_command(struct CommandList *cp) "Returning result: 0x%x\n", cp, ei->ScsiStatus, sense_key, asc, ascq, - cmd->result); + cmd->result.combined); } else { /* scsi status is zero??? How??? */ dev_warn(&h->pdev->dev, "cp %p SCSI status was 0. " "Returning no connection.\n", cp), @@ -2719,7 +2719,7 @@ static void complete_scsi_command(struct CommandList *cp) * and it's severe enough. */ - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; } break; @@ -2738,60 +2738,60 @@ static void complete_scsi_command(struct CommandList *cp) * This is kind of a shame because it means that any other * CMD_INVALID (e.g. driver bug) will get interpreted as a * missing target. */ - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; } break; case CMD_PROTOCOL_ERR: - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; dev_warn(&h->pdev->dev, "CDB %16phN : protocol error\n", cp->Request.CDB); break; case CMD_HARDWARE_ERR: - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; dev_warn(&h->pdev->dev, "CDB %16phN : hardware error\n", cp->Request.CDB); break; case CMD_CONNECTION_LOST: - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; dev_warn(&h->pdev->dev, "CDB %16phN : connection lost\n", cp->Request.CDB); break; case CMD_ABORTED: - cmd->result = DID_ABORT << 16; + cmd->result.combined = DID_ABORT << 16; break; case CMD_ABORT_FAILED: - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; dev_warn(&h->pdev->dev, "CDB %16phN : abort failed\n", cp->Request.CDB); break; case CMD_UNSOLICITED_ABORT: - cmd->result = DID_SOFT_ERROR << 16; /* retry the command */ + cmd->result.combined = DID_SOFT_ERROR << 16; /* retry the command */ dev_warn(&h->pdev->dev, "CDB %16phN : unsolicited abort\n", cp->Request.CDB); break; case CMD_TIMEOUT: - cmd->result = DID_TIME_OUT << 16; + cmd->result.combined = DID_TIME_OUT << 16; dev_warn(&h->pdev->dev, "CDB %16phN timed out\n", cp->Request.CDB); break; case CMD_UNABORTABLE: - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; dev_warn(&h->pdev->dev, "Command unabortable\n"); break; case CMD_TMF_STATUS: if (hpsa_evaluate_tmf_status(h, cp)) /* TMF failed? */ - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; break; case CMD_IOACCEL_DISABLED: /* This only handles the direct pass-through case since RAID * offload is handled above. Just attempt a retry. */ - cmd->result = DID_SOFT_ERROR << 16; + cmd->result.combined = DID_SOFT_ERROR << 16; dev_warn(&h->pdev->dev, "cp %p had HP SSD Smart Path error\n", cp); break; default: - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; dev_warn(&h->pdev->dev, "cp %p returned unknown status %x\n", cp, ei->CommandStatus); } @@ -5029,7 +5029,7 @@ static int hpsa_scsi_ioaccel2_queue_command(struct ctlr_info *h, cp->sg_count = (u8) use_sg; if (phys_disk->in_reset) { - cmd->result = DID_RESET << 16; + cmd->result.combined = DID_RESET << 16; return -1; } @@ -5620,12 +5620,12 @@ static void hpsa_command_resubmit_worker(struct work_struct *work) cmd = c->scsi_cmd; dev = cmd->device->hostdata; if (!dev) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; return hpsa_cmd_free_and_done(c->h, c, cmd); } if (dev->in_reset) { - cmd->result = DID_RESET << 16; + cmd->result.combined = DID_RESET << 16; return hpsa_cmd_free_and_done(c->h, c, cmd); } @@ -5646,7 +5646,7 @@ static void hpsa_command_resubmit_worker(struct work_struct *work) * Try again via scsi mid layer, which will * then get SCSI_MLQUEUE_HOST_BUSY. */ - cmd->result = DID_IMM_RETRY << 16; + cmd->result.combined = DID_IMM_RETRY << 16; return hpsa_cmd_free_and_done(h, c, cmd); } /* else, fall thru and resubmit down CISS path */ @@ -5671,7 +5671,7 @@ static void hpsa_command_resubmit_worker(struct work_struct *work) * hpsa_ciss_submit will have already freed c * if it encountered a dma mapping failure. */ - cmd->result = DID_IMM_RETRY << 16; + cmd->result.combined = DID_IMM_RETRY << 16; cmd->scsi_done(cmd); } } @@ -5691,19 +5691,19 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd) dev = cmd->device->hostdata; if (!dev) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; cmd->scsi_done(cmd); return 0; } if (dev->removed) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; cmd->scsi_done(cmd); return 0; } if (unlikely(lockup_detected(h))) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; cmd->scsi_done(cmd); return 0; } @@ -5719,7 +5719,7 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd) * This is necessary because the SML doesn't zero out this field during * error recovery. */ - cmd->result = 0; + cmd->result.combined = 0; /* * Call alternate submit routine for I/O accelerated commands. diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c index db4c7a7ff4dd50..79e55185cfcd9d 100644 --- a/drivers/scsi/hptiop.c +++ b/drivers/scsi/hptiop.c @@ -735,32 +735,32 @@ static void hptiop_finish_scsi_req(struct hptiop_hba *hba, u32 tag, case IOP_RESULT_SUCCESS: scsi_set_resid(scp, scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length)); - scp->result = (DID_OK<<16); + scp->result.combined = (DID_OK<<16); break; case IOP_RESULT_BAD_TARGET: - scp->result = (DID_BAD_TARGET<<16); + scp->result.combined = (DID_BAD_TARGET<<16); break; case IOP_RESULT_BUSY: - scp->result = (DID_BUS_BUSY<<16); + scp->result.combined = (DID_BUS_BUSY<<16); break; case IOP_RESULT_RESET: - scp->result = (DID_RESET<<16); + scp->result.combined = (DID_RESET<<16); break; case IOP_RESULT_FAIL: - scp->result = (DID_ERROR<<16); + scp->result.combined = (DID_ERROR<<16); break; case IOP_RESULT_INVALID_REQUEST: - scp->result = (DID_ABORT<<16); + scp->result.combined = (DID_ABORT<<16); break; case IOP_RESULT_CHECK_CONDITION: scsi_set_resid(scp, scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length)); - scp->result = SAM_STAT_CHECK_CONDITION; + scp->result.combined = SAM_STAT_CHECK_CONDITION; memcpy(scp->sense_buffer, &req->sg_list, SCSI_SENSE_BUFFERSIZE); goto skip_resid; default: - scp->result = DRIVER_INVALID << 24 | DID_ABORT << 16; + scp->result.combined = DRIVER_INVALID << 24 | DID_ABORT << 16; break; } @@ -1024,12 +1024,12 @@ static int hptiop_queuecommand_lck(struct scsi_cmnd *scp, cpu_to_be32(((u32 *)scp->cmnd)[3]), _req->index, _req->req_virt); - scp->result = 0; + scp->result.combined = 0; if (scp->device->channel || (scp->device->id > hba->max_devices) || ((scp->device->id == (hba->max_devices-1)) && scp->device->lun)) { - scp->result = DID_BAD_TARGET << 16; + scp->result.combined = DID_BAD_TARGET << 16; free_req(hba, _req); goto cmd_done; } diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 067c7c45a654e7..016c3add9fc742 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -345,7 +345,7 @@ static int ibmvfc_get_err_result(struct ibmvfc_host *vhost, struct ibmvfc_cmd *v 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 | (cmd_status[err].result.combined << 16); return rsp->scsi_status | (DID_ERROR << 16); } @@ -1070,7 +1070,7 @@ static void ibmvfc_complete_purge(struct list_head *purge_list) static void ibmvfc_fail_request(struct ibmvfc_event *evt, int error_code) { if (evt->cmnd) { - evt->cmnd->result = (error_code << 16); + evt->cmnd->result.combined = (error_code << 16); evt->done = ibmvfc_scsi_eh_done; } else evt->xfer_iu->mad_common.status = cpu_to_be16(IBMVFC_MAD_DRIVER_FAILED); @@ -1713,7 +1713,7 @@ static int ibmvfc_send_event(struct ibmvfc_event *evt, dev_err(vhost->dev, "Send error (rc=%d)\n", rc); if (evt->cmnd) { - evt->cmnd->result = DID_ERROR << 16; + evt->cmnd->result.combined = DID_ERROR << 16; evt->done = ibmvfc_scsi_eh_done; } else evt->xfer_iu->mad_common.status = cpu_to_be16(IBMVFC_MAD_CRQ_ERROR); @@ -1807,7 +1807,7 @@ static void ibmvfc_scsi_done(struct ibmvfc_event *evt) scsi_set_resid(cmnd, 0); if (vfc_cmd->status) { - cmnd->result = ibmvfc_get_err_result(evt->vhost, vfc_cmd); + cmnd->result.combined = ibmvfc_get_err_result(evt->vhost, vfc_cmd); if (rsp->flags & FCP_RSP_LEN_VALID) rsp_len = be32_to_cpu(rsp->fcp_rsp_len); @@ -1819,15 +1819,15 @@ static void ibmvfc_scsi_done(struct ibmvfc_event *evt) (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))) - cmnd->result = (DID_ERROR << 16); + if (!cmnd->result.combined && (!scsi_get_resid(cmnd) || (rsp->flags & FCP_RESID_OVER))) + cmnd->result.combined = (DID_ERROR << 16); ibmvfc_log_error(evt); } - if (!cmnd->result && + if (!cmnd->result.combined && (scsi_bufflen(cmnd) - scsi_get_resid(cmnd) < cmnd->underflow)) - cmnd->result = (DID_ERROR << 16); + cmnd->result.combined = (DID_ERROR << 16); scsi_dma_unmap(cmnd); cmnd->scsi_done(cmnd); @@ -1915,12 +1915,12 @@ static int ibmvfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) if (unlikely((rc = fc_remote_port_chkready(rport))) || unlikely((rc = ibmvfc_host_chkready(vhost)))) { - cmnd->result = rc; + cmnd->result.combined = rc; cmnd->scsi_done(cmnd); return 0; } - cmnd->result = (DID_OK << 16); + cmnd->result.combined = (DID_OK << 16); if (vhost->using_channels) { scsi_channel = hwq % vhost->scsi_scrqs.active_queues; evt = ibmvfc_get_event(&vhost->scsi_scrqs.scrqs[scsi_channel]); @@ -1955,7 +1955,7 @@ static int ibmvfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) scmd_printk(KERN_ERR, cmnd, "Failed to map DMA buffer for command. rc=%d\n", rc); - cmnd->result = DID_ERROR << 16; + cmnd->result.combined = DID_ERROR << 16; cmnd->scsi_done(cmnd); return 0; } @@ -2235,7 +2235,7 @@ static int ibmvfc_bsg_request(struct bsg_job *job) spin_lock_irqsave(vhost->host->host_lock, flags); ibmvfc_free_event(evt); spin_unlock_irqrestore(vhost->host->host_lock, flags); - bsg_reply->result = rc; + bsg_reply->result.combined = rc; bsg_job_done(job, bsg_reply->result, bsg_reply->reply_payload_rcv_len); rc = 0; diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index f33f56680c5925..731fd8d31bb5cb 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -793,7 +793,7 @@ static void purge_requests(struct ibmvscsi_host_data *hostdata, int error_code) spin_unlock_irqrestore(hostdata->host->host_lock, flags); if (evt->cmnd) { - evt->cmnd->result = (error_code << 16); + evt->cmnd->result.combined = (error_code << 16); unmap_cmd_data(&evt->iu.srp.cmd, evt, evt->hostdata->dev); if (evt->cmnd_done) @@ -976,7 +976,7 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct, unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev); if (evt_struct->cmnd != NULL) { - evt_struct->cmnd->result = DID_ERROR << 16; + evt_struct->cmnd->result.combined = DID_ERROR << 16; evt_struct->cmnd_done(evt_struct->cmnd); } else if (evt_struct->done) evt_struct->done(evt_struct); @@ -1004,8 +1004,8 @@ static void handle_cmd_rsp(struct srp_event_struct *evt_struct) } if (cmnd) { - cmnd->result |= rsp->status; - if (((cmnd->result >> 1) & 0x1f) == CHECK_CONDITION) + cmnd->result.combined |= rsp->status; + if (((cmnd->result.combined >> 1) & 0x1f) == CHECK_CONDITION) memcpy(cmnd->sense_buffer, rsp->data, be32_to_cpu(rsp->sense_data_len)); @@ -1049,7 +1049,7 @@ static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd, u16 lun = lun_from_dev(cmnd->device); u8 out_fmt, in_fmt; - cmnd->result = (DID_OK << 16); + cmnd->result.combined = (DID_OK << 16); evt_struct = get_event_struct(&hostdata->pool); if (!evt_struct) return SCSI_MLQUEUE_HOST_BUSY; @@ -1608,7 +1608,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) sdev_printk(KERN_INFO, cmd->device, "successfully aborted task tag 0x%llx\n", tsk_mgmt->task_tag); - cmd->result = (DID_ABORT << 16); + cmd->result.combined = (DID_ABORT << 16); list_del(&found_evt->list); unmap_cmd_data(&found_evt->iu.srp.cmd, found_evt, found_evt->hostdata->dev); @@ -1713,7 +1713,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd) list_for_each_entry_safe(tmp_evt, pos, &hostdata->sent, list) { if ((tmp_evt->cmnd) && (tmp_evt->cmnd->device == cmd->device)) { if (tmp_evt->cmnd) - tmp_evt->cmnd->result = (DID_RESET << 16); + tmp_evt->cmnd->result.combined = (DID_RESET << 16); list_del(&tmp_evt->list); unmap_cmd_data(&tmp_evt->iu.srp.cmd, tmp_evt, tmp_evt->hostdata->dev); @@ -1842,7 +1842,7 @@ static void ibmvscsi_handle_crq(struct viosrp_crq *crq, del_timer(&evt_struct->timer); if ((crq->status != VIOSRP_OK && crq->status != VIOSRP_OK2) && evt_struct->cmnd) - evt_struct->cmnd->result = DID_ERROR << 16; + evt_struct->cmnd->result.combined = DID_ERROR << 16; if (evt_struct->done) evt_struct->done(evt_struct); else diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index 862d35a098cf3c..3dfdce84ea65c5 100644 --- a/drivers/scsi/imm.c +++ b/drivers/scsi/imm.c @@ -158,7 +158,7 @@ imm_fail(imm_struct *dev, int error_code) { /* If we fail a device then we trash status / message bytes */ if (dev->cur_cmd) { - dev->cur_cmd->result = error_code << 16; + dev->cur_cmd->result.combined = error_code << 16; dev->failed = 1; } } @@ -729,7 +729,7 @@ static void imm_interrupt(struct work_struct *work) } /* Command must of completed hence it is safe to let go... */ #if IMM_DEBUG > 0 - switch ((cmd->result >> 16) & 0xff) { + switch ((cmd->result.combined >> 16) & 0xff) { case DID_OK: break; case DID_NO_CONNECT: @@ -758,7 +758,7 @@ static void imm_interrupt(struct work_struct *work) break; default: printk("imm: bad return code (%02x)\n", - (cmd->result >> 16) & 0xff); + (cmd->result.combined >> 16) & 0xff); } #endif @@ -894,7 +894,7 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd) /* Check for optional message byte */ if (imm_wait(dev) == (unsigned char) 0xb8) imm_in(dev, &h, 1); - cmd->result = (DID_OK << 16) | (l & STATUS_MASK); + cmd->result.combined = (DID_OK << 16) | (l & STATUS_MASK); } if ((dev->mode == IMM_NIBBLE) || (dev->mode == IMM_PS2)) { w_ctr(ppb, 0x4); @@ -923,7 +923,7 @@ static int imm_queuecommand_lck(struct scsi_cmnd *cmd, dev->jstart = jiffies; dev->cur_cmd = cmd; cmd->scsi_done = done; - cmd->result = DID_ERROR << 16; /* default return code */ + cmd->result.combined = DID_ERROR << 16; /* default return code */ cmd->SCp.phase = 0; /* bus free */ schedule_delayed_work(&dev->imm_tq, 0); diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index 9b75e19a9bab1e..2046a4a3aabe2e 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c @@ -2786,7 +2786,7 @@ static void i91uSCBPost(u8 * host_mem, u8 * cblk_mem) break; } - cmnd->result = cblk->tastat | (cblk->hastat << 16); + cmnd->result.combined = cblk->tastat | (cblk->hastat << 16); i91u_unmap_scb(host->pci_dev, cmnd); cmnd->scsi_done(cmnd); /* Notify system DONE */ initio_release_scb(host, cblk); /* Release SCB for current channel */ diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 30c30a1db5b1aa..41886035f55aa7 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -863,7 +863,7 @@ static void __ipr_scsi_eh_done(struct ipr_cmnd *ipr_cmd) { struct scsi_cmnd *scsi_cmd = ipr_cmd->scsi_cmd; - scsi_cmd->result |= (DID_ERROR << 16); + scsi_cmd->result.combined |= (DID_ERROR << 16); scsi_dma_unmap(ipr_cmd->scsi_cmd); scsi_cmd->scsi_done(scsi_cmd); @@ -6051,7 +6051,7 @@ static void __ipr_erp_done(struct ipr_cmnd *ipr_cmd) u32 ioasc = be32_to_cpu(ipr_cmd->s.ioasa.hdr.ioasc); if (IPR_IOASC_SENSE_KEY(ioasc) > 0) { - scsi_cmd->result |= (DID_ERROR << 16); + scsi_cmd->result.combined |= (DID_ERROR << 16); scmd_printk(KERN_ERR, scsi_cmd, "Request Sense failed with IOASC: 0x%08X\n", ioasc); } else { @@ -6301,7 +6301,7 @@ static void ipr_gen_sense(struct ipr_cmnd *ipr_cmd) if (ioasc >= IPR_FIRST_DRIVER_IOASC) return; - ipr_cmd->scsi_cmd->result = SAM_STAT_CHECK_CONDITION; + ipr_cmd->scsi_cmd->result.combined = SAM_STAT_CHECK_CONDITION; if (ipr_is_vset_device(res) && ioasc == IPR_IOASC_MED_DO_NOT_REALLOC && @@ -6432,23 +6432,23 @@ static void ipr_erp_start(struct ipr_ioa_cfg *ioa_cfg, switch (masked_ioasc) { case IPR_IOASC_ABORTED_CMD_TERM_BY_HOST: if (ipr_is_naca_model(res)) - scsi_cmd->result |= (DID_ABORT << 16); + scsi_cmd->result.combined |= (DID_ABORT << 16); else - scsi_cmd->result |= (DID_IMM_RETRY << 16); + scsi_cmd->result.combined |= (DID_IMM_RETRY << 16); break; case IPR_IOASC_IR_RESOURCE_HANDLE: case IPR_IOASC_IR_NO_CMDS_TO_2ND_IOA: - scsi_cmd->result |= (DID_NO_CONNECT << 16); + scsi_cmd->result.combined |= (DID_NO_CONNECT << 16); break; case IPR_IOASC_HW_SEL_TIMEOUT: - scsi_cmd->result |= (DID_NO_CONNECT << 16); + scsi_cmd->result.combined |= (DID_NO_CONNECT << 16); if (!ipr_is_naca_model(res)) res->needs_sync_complete = 1; break; case IPR_IOASC_SYNC_REQUIRED: if (!res->in_erp) res->needs_sync_complete = 1; - scsi_cmd->result |= (DID_IMM_RETRY << 16); + scsi_cmd->result.combined |= (DID_IMM_RETRY << 16); break; case IPR_IOASC_MED_DO_NOT_REALLOC: /* prevent retries */ case IPR_IOASA_IR_DUAL_IOA_DISABLED: @@ -6456,8 +6456,8 @@ static void ipr_erp_start(struct ipr_ioa_cfg *ioa_cfg, * exception: do not set DID_PASSTHROUGH on CHECK CONDITION * so SCSI mid-layer and upper layers handle it accordingly. */ - if (scsi_cmd->result != SAM_STAT_CHECK_CONDITION) - scsi_cmd->result |= (DID_PASSTHROUGH << 16); + if (scsi_cmd->result.combined != SAM_STAT_CHECK_CONDITION) + scsi_cmd->result.combined |= (DID_PASSTHROUGH << 16); break; case IPR_IOASC_BUS_WAS_RESET: case IPR_IOASC_BUS_WAS_RESET_BY_OTHER: @@ -6467,12 +6467,12 @@ static void ipr_erp_start(struct ipr_ioa_cfg *ioa_cfg, */ if (!res->resetting_device) scsi_report_bus_reset(ioa_cfg->host, scsi_cmd->device->channel); - scsi_cmd->result |= (DID_ERROR << 16); + scsi_cmd->result.combined |= (DID_ERROR << 16); if (!ipr_is_naca_model(res)) res->needs_sync_complete = 1; break; case IPR_IOASC_HW_DEV_BUS_STATUS: - scsi_cmd->result |= IPR_IOASC_SENSE_STATUS(ioasc); + scsi_cmd->result.combined |= IPR_IOASC_SENSE_STATUS(ioasc); if (IPR_IOASC_SENSE_STATUS(ioasc) == SAM_STAT_CHECK_CONDITION) { if (!ipr_get_autosense(ipr_cmd)) { if (!ipr_is_naca_model(res)) { @@ -6489,13 +6489,13 @@ static void ipr_erp_start(struct ipr_ioa_cfg *ioa_cfg, case IPR_IOASC_IR_NON_OPTIMIZED: if (res->raw_mode) { res->raw_mode = 0; - scsi_cmd->result |= (DID_IMM_RETRY << 16); + scsi_cmd->result.combined |= (DID_IMM_RETRY << 16); } else - scsi_cmd->result |= (DID_ERROR << 16); + scsi_cmd->result.combined |= (DID_ERROR << 16); break; default: if (IPR_IOASC_SENSE_KEY(ioasc) > RECOVERED_ERROR) - scsi_cmd->result |= (DID_ERROR << 16); + scsi_cmd->result.combined |= (DID_ERROR << 16); if (!ipr_is_vset_device(res) && !ipr_is_naca_model(res)) res->needs_sync_complete = 1; break; @@ -6571,7 +6571,7 @@ static int ipr_queuecommand(struct Scsi_Host *shost, ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata; - scsi_cmd->result = (DID_OK << 16); + scsi_cmd->result.combined = (DID_OK << 16); res = scsi_cmd->device->hostdata; if (ipr_is_gata(res) && res->sata_port) { @@ -6684,7 +6684,7 @@ static int ipr_queuecommand(struct Scsi_Host *shost, err_nodev: spin_lock_irqsave(hrrq->lock, hrrq_flags); memset(scsi_cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); - scsi_cmd->result = (DID_NO_CONNECT << 16); + scsi_cmd->result.combined = (DID_NO_CONNECT << 16); scsi_cmd->scsi_done(scsi_cmd); spin_unlock_irqrestore(hrrq->lock, hrrq_flags); return 0; diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index 1a3c534826ba1e..d589db559a44d3 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -935,7 +935,7 @@ static int __ips_eh_reset(struct scsi_cmnd *SC) ips_name, ha->host_num); while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->result.combined = DID_ERROR << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); ips_freescb(ha, scb); } @@ -945,7 +945,7 @@ static int __ips_eh_reset(struct scsi_cmnd *SC) ips_name, ha->host_num); while ((scsi_cmd = ips_removeq_wait_head(&ha->scb_waitlist))) { - scsi_cmd->result = DID_ERROR; + scsi_cmd->result.combined = DID_ERROR; scsi_cmd->scsi_done(scsi_cmd); } @@ -964,7 +964,7 @@ static int __ips_eh_reset(struct scsi_cmnd *SC) ips_name, ha->host_num); while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->result.combined = DID_ERROR << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); ips_freescb(ha, scb); } @@ -974,7 +974,7 @@ static int __ips_eh_reset(struct scsi_cmnd *SC) ips_name, ha->host_num); while ((scsi_cmd = ips_removeq_wait_head(&ha->scb_waitlist))) { - scsi_cmd->result = DID_ERROR << 16; + scsi_cmd->result.combined = DID_ERROR << 16; scsi_cmd->scsi_done(scsi_cmd); } @@ -993,7 +993,7 @@ static int __ips_eh_reset(struct scsi_cmnd *SC) DEBUG_VAR(1, "(%s%d) Failing active commands", ips_name, ha->host_num); while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { - scb->scsi_cmd->result = DID_RESET << 16; + scb->scsi_cmd->result.combined = DID_RESET << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); ips_freescb(ha, scb); } @@ -1052,13 +1052,13 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *) if (ips_is_passthru(SC)) { if (ha->copp_waitlist.count == IPS_MAX_IOCTL_QUEUE) { - SC->result = DID_BUS_BUSY << 16; + SC->result.combined = DID_BUS_BUSY << 16; done(SC); return (0); } } else if (ha->scb_waitlist.count == IPS_MAX_QUEUE) { - SC->result = DID_BUS_BUSY << 16; + SC->result.combined = DID_BUS_BUSY << 16; done(SC); return (0); @@ -1075,7 +1075,7 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *) /* Check for command to initiator IDs */ if ((scmd_channel(SC) > 0) && (scmd_id(SC) == ha->ha_id[scmd_channel(SC)])) { - SC->result = DID_NO_CONNECT << 16; + SC->result.combined = DID_NO_CONNECT << 16; done(SC); return (0); @@ -1092,13 +1092,13 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *) if ((pt->CoppCP.cmd.reset.op_code == IPS_CMD_RESET_CHANNEL) && (pt->CoppCP.cmd.reset.adapter_flag == 1)) { if (ha->scb_activelist.count != 0) { - SC->result = DID_BUS_BUSY << 16; + SC->result.combined = DID_BUS_BUSY << 16; done(SC); return (0); } ha->ioctl_reset = 1; /* This reset request is from an IOCTL */ __ips_eh_reset(SC); - SC->result = DID_OK << 16; + SC->result.combined = DID_OK << 16; SC->scsi_done(SC); return (0); } @@ -1107,7 +1107,7 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *) scratch = kmalloc(sizeof (ips_copp_wait_item_t), GFP_ATOMIC); if (!scratch) { - SC->result = DID_ERROR << 16; + SC->result.combined = DID_ERROR << 16; done(SC); return (0); @@ -1125,7 +1125,7 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *) return (0); out_error: - SC->result = DID_ERROR << 16; + SC->result.combined = DID_ERROR << 16; done(SC); return (0); @@ -1610,7 +1610,7 @@ ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr) &ips_num_controllers, sizeof (int)); ips_scmd_buf_write(SC, ha->ioctl_data, sizeof (ips_passthru_t) + sizeof (int)); - SC->result = DID_OK << 16; + SC->result.combined = DID_OK << 16; return (IPS_SUCCESS_IMM); @@ -1667,7 +1667,7 @@ ips_flash_copperhead(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) } pt->BasicStatus = 0x0B; pt->ExtendedStatus = 0; - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->result.combined = DID_OK << 16; /* IF it's OK to Use the "CD BOOT" Flash Buffer, then you can */ /* avoid allocating a huge buffer per adapter ( which can fail ). */ if (pt->CoppCP.cmd.flashfw.type == IPS_BIOS_IMAGE && @@ -1869,7 +1869,7 @@ ips_flash_firmware(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) scb->cmd.flashfw.buffer_addr = cpu_to_le32(scb->data_busaddr); if (pt->TimeOut) scb->timeout = pt->TimeOut; - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->result.combined = DID_OK << 16; return IPS_SUCCESS; } @@ -1971,7 +1971,7 @@ ips_usrcmd(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) } /* assume success */ - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->result.combined = DID_OK << 16; /* success */ return (1); @@ -2578,7 +2578,7 @@ ips_next(ips_ha_t * ha, int intr) switch (ret) { case IPS_FAILURE: if (scb->scsi_cmd) { - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->result.combined = DID_ERROR << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); } @@ -2586,7 +2586,7 @@ ips_next(ips_ha_t * ha, int intr) break; case IPS_SUCCESS_IMM: if (scb->scsi_cmd) { - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->result.combined = DID_OK << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); } @@ -2611,7 +2611,7 @@ ips_next(ips_ha_t * ha, int intr) switch (ret) { case IPS_FAILURE: if (scb->scsi_cmd) { - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->result.combined = DID_ERROR << 16; } ips_freescb(ha, scb); @@ -2646,7 +2646,7 @@ ips_next(ips_ha_t * ha, int intr) if (intr == IPS_INTR_ON) spin_unlock(host->host_lock); /* Unlock HA after command is taken off queue */ - SC->result = DID_OK; + SC->result.combined = DID_OK; SC->host_scribble = NULL; scb->target_id = SC->device->id; @@ -2711,7 +2711,7 @@ ips_next(ips_ha_t * ha, int intr) break; case IPS_FAILURE: if (scb->scsi_cmd) { - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->result.combined = DID_ERROR << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); } @@ -3205,7 +3205,7 @@ ips_done(ips_ha_t * ha, ips_scb_t * scb) switch (ret) { case IPS_FAILURE: if (scb->scsi_cmd) { - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->result.combined = DID_ERROR << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); } @@ -3213,7 +3213,7 @@ ips_done(ips_ha_t * ha, ips_scb_t * scb) break; case IPS_SUCCESS_IMM: if (scb->scsi_cmd) { - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->result.combined = DID_ERROR << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); } @@ -3366,7 +3366,7 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) } /* end switch */ } /* end switch */ - scb->scsi_cmd->result = device_error | (errcode << 16); + scb->scsi_cmd->result.combined = device_error | (errcode << 16); return (1); } @@ -3484,11 +3484,11 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) case ERASE: case WRITE_FILEMARKS: case SPACE: - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->result.combined = DID_ERROR << 16; break; case START_STOP: - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->result.combined = DID_OK << 16; break; case TEST_UNIT_READY: @@ -3499,7 +3499,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) * or we have a SCSI inquiry */ if (scb->scsi_cmd->cmnd[0] == TEST_UNIT_READY) - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->result.combined = DID_OK << 16; if (scb->scsi_cmd->cmnd[0] == INQUIRY) { IPS_SCSI_INQ_DATA inquiry; @@ -3531,7 +3531,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) &inquiry, sizeof (inquiry)); - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->result.combined = DID_OK << 16; } } else { scb->cmd.logical_info.op_code = IPS_CMD_GET_LD_INFO; @@ -3549,7 +3549,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) case REQUEST_SENSE: ips_reqsen(ha, scb); - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->result.combined = DID_OK << 16; break; case READ_6: @@ -3645,7 +3645,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) * we don't have to do anything * so just return */ - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->result.combined = DID_OK << 16; } else ret = IPS_SUCCESS; @@ -3653,7 +3653,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) case RESERVE: case RELEASE: - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->result.combined = DID_OK << 16; break; case MODE_SENSE: @@ -3687,7 +3687,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) case READ_DEFECT_DATA: case READ_BUFFER: case WRITE_BUFFER: - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->result.combined = DID_OK << 16; break; default: @@ -3703,7 +3703,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) sp[13] = 0x00; /* ASCQ */ device_error = 2; /* Indicate Check Condition */ - scb->scsi_cmd->result = device_error | (DID_OK << 16); + scb->scsi_cmd->result.combined = device_error | (DID_OK << 16); break; } /* end switch */ } @@ -3717,7 +3717,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) /* If we already know the Device is Not there, no need to attempt a Command */ /* This also protects an NT FailOver Controller from getting CDB's sent to it */ if (ha->conf->dev[scb->bus - 1][scb->target_id].ucState == 0) { - scb->scsi_cmd->result = DID_NO_CONNECT << 16; + scb->scsi_cmd->result.combined = DID_NO_CONNECT << 16; return (IPS_SUCCESS_IMM); } @@ -3957,14 +3957,14 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus) errcode = DID_ERROR; } /* end switch */ - scb->scsi_cmd->result = errcode << 16; + scb->scsi_cmd->result.combined = errcode << 16; } else { /* bus == 0 */ /* restrict access to physical drives */ if (scb->scsi_cmd->cmnd[0] == INQUIRY) { ips_scmd_buf_read(scb->scsi_cmd, &inquiryData, sizeof (inquiryData)); if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK) - scb->scsi_cmd->result = DID_TIME_OUT << 16; + scb->scsi_cmd->result.combined = DID_TIME_OUT << 16; } } /* else */ } else { /* recovered error / success */ diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index 509eacd7893d75..b46529f64cf124 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c @@ -1869,7 +1869,7 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd) rval = fc_remote_port_chkready(rport); if (rval) { - sc_cmd->result = rval; + sc_cmd->result.combined = rval; sc_cmd->scsi_done(sc_cmd); return 0; } @@ -1879,7 +1879,7 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd) * rport is transitioning from blocked/deleted to * online */ - sc_cmd->result = DID_IMM_RETRY << 16; + sc_cmd->result.combined = DID_IMM_RETRY << 16; sc_cmd->scsi_done(sc_cmd); goto out; } @@ -1990,7 +1990,7 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp) /* * good I/O status */ - sc_cmd->result = DID_OK << 16; + sc_cmd->result.combined = DID_OK << 16; if (fsp->scsi_resid) CMD_RESID_LEN(sc_cmd) = fsp->scsi_resid; } else { @@ -1998,13 +1998,13 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp) * transport level I/O was ok but scsi * has non zero status */ - sc_cmd->result = (DID_OK << 16) | fsp->cdb_status; + sc_cmd->result.combined = (DID_OK << 16) | fsp->cdb_status; } break; case FC_ERROR: FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml " "due to FC_ERROR\n"); - sc_cmd->result = DID_ERROR << 16; + sc_cmd->result.combined = DID_ERROR << 16; break; case FC_DATA_UNDRUN: if ((fsp->cdb_status == 0) && !(fsp->req_flags & FC_SRB_READ)) { @@ -2013,11 +2013,11 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp) * underrun. */ if (fsp->state & FC_SRB_RCV_STATUS) { - sc_cmd->result = DID_OK << 16; + sc_cmd->result.combined = DID_OK << 16; } else { FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml" " due to FC_DATA_UNDRUN (trans)\n"); - sc_cmd->result = DID_ERROR << 16; + sc_cmd->result.combined = DID_ERROR << 16; } } else { /* @@ -2026,7 +2026,7 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp) FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml " "due to FC_DATA_UNDRUN (scsi)\n"); CMD_RESID_LEN(sc_cmd) = fsp->scsi_resid; - sc_cmd->result = (DID_ERROR << 16) | fsp->cdb_status; + sc_cmd->result.combined = (DID_ERROR << 16) | fsp->cdb_status; } break; case FC_DATA_OVRRUN: @@ -2035,7 +2035,7 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp) */ FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml " "due to FC_DATA_OVRRUN\n"); - sc_cmd->result = (DID_ERROR << 16) | fsp->cdb_status; + sc_cmd->result.combined = (DID_ERROR << 16) | fsp->cdb_status; break; case FC_CMD_ABORTED: if (host_byte(sc_cmd->result) == DID_TIME_OUT) @@ -2046,42 +2046,42 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp) "due to FC_CMD_ABORTED\n"); set_host_byte(sc_cmd, DID_ERROR); } - sc_cmd->result |= fsp->io_status; + sc_cmd->result.combined |= fsp->io_status; break; case FC_CMD_RESET: FC_FCP_DBG(fsp, "Returning DID_RESET to scsi-ml " "due to FC_CMD_RESET\n"); - sc_cmd->result = (DID_RESET << 16); + sc_cmd->result.combined = (DID_RESET << 16); break; case FC_TRANS_RESET: FC_FCP_DBG(fsp, "Returning DID_SOFT_ERROR to scsi-ml " "due to FC_TRANS_RESET\n"); - sc_cmd->result = (DID_SOFT_ERROR << 16); + sc_cmd->result.combined = (DID_SOFT_ERROR << 16); break; case FC_HRD_ERROR: FC_FCP_DBG(fsp, "Returning DID_NO_CONNECT to scsi-ml " "due to FC_HRD_ERROR\n"); - sc_cmd->result = (DID_NO_CONNECT << 16); + sc_cmd->result.combined = (DID_NO_CONNECT << 16); break; case FC_CRC_ERROR: FC_FCP_DBG(fsp, "Returning DID_PARITY to scsi-ml " "due to FC_CRC_ERROR\n"); - sc_cmd->result = (DID_PARITY << 16); + sc_cmd->result.combined = (DID_PARITY << 16); break; case FC_TIMED_OUT: FC_FCP_DBG(fsp, "Returning DID_BUS_BUSY to scsi-ml " "due to FC_TIMED_OUT\n"); - sc_cmd->result = (DID_BUS_BUSY << 16) | fsp->io_status; + sc_cmd->result.combined = (DID_BUS_BUSY << 16) | fsp->io_status; break; default: FC_FCP_DBG(fsp, "Returning DID_ERROR to scsi-ml " "due to unknown error\n"); - sc_cmd->result = (DID_ERROR << 16); + sc_cmd->result.combined = (DID_ERROR << 16); break; } if (lport->state != LPORT_ST_READY && fsp->status_code != FC_COMPLETE) - sc_cmd->result = (DID_TRANSPORT_DISRUPTED << 16); + sc_cmd->result.combined = (DID_TRANSPORT_DISRUPTED << 16); spin_lock_irqsave(&si->scsi_queue_lock, flags); list_del(&fsp->list); diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 0c3082d097121b..91241e746d8484 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -616,7 +616,7 @@ static void fail_scsi_task(struct iscsi_task *task, int err) state = ISCSI_TASK_ABRT_TMF; sc = task->sc; - sc->result = err << 16; + sc->result.combined = err << 16; scsi_set_resid(sc, scsi_bufflen(sc)); iscsi_complete_task(task, state); spin_unlock_bh(&conn->session->back_lock); @@ -814,7 +814,7 @@ static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr, iscsi_update_cmdsn(session, (struct iscsi_nopin*)rhdr); conn->exp_statsn = be32_to_cpu(rhdr->statsn) + 1; - sc->result = (DID_OK << 16) | rhdr->cmd_status; + sc->result.combined = (DID_OK << 16) | rhdr->cmd_status; if (task->protected) { sector_t sector; @@ -829,7 +829,7 @@ static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr, ascq = session->tt->check_protection(task, §or); if (ascq) { - sc->result = DRIVER_SENSE << 24 | + sc->result.combined = DRIVER_SENSE << 24 | SAM_STAT_CHECK_CONDITION; scsi_build_sense_buffer(1, sc->sense_buffer, ILLEGAL_REQUEST, 0x10, ascq); @@ -841,7 +841,7 @@ static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr, } if (rhdr->response != ISCSI_STATUS_CMD_COMPLETED) { - sc->result = DID_ERROR << 16; + sc->result.combined = DID_ERROR << 16; goto out; } @@ -853,7 +853,7 @@ static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr, iscsi_conn_printk(KERN_ERR, conn, "Got CHECK_CONDITION but invalid data " "buffer size of %d\n", datalen); - sc->result = DID_BAD_TARGET << 16; + sc->result.combined = DID_BAD_TARGET << 16; goto out; } @@ -870,7 +870,7 @@ static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr, if (rhdr->flags & (ISCSI_FLAG_CMD_BIDI_UNDERFLOW | ISCSI_FLAG_CMD_BIDI_OVERFLOW)) { - sc->result = (DID_BAD_TARGET << 16) | rhdr->cmd_status; + sc->result.combined = (DID_BAD_TARGET << 16) | rhdr->cmd_status; } if (rhdr->flags & (ISCSI_FLAG_CMD_UNDERFLOW | @@ -883,11 +883,11 @@ static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr, /* write side for bidi or uni-io set_resid */ scsi_set_resid(sc, res_count); else - sc->result = (DID_BAD_TARGET << 16) | rhdr->cmd_status; + sc->result.combined = (DID_BAD_TARGET << 16) | rhdr->cmd_status; } out: ISCSI_DBG_SESSION(session, "cmd rsp done [sc %p res %d itt 0x%x]\n", - sc, sc->result, task->itt); + sc, sc->result.combined, task->itt); conn->scsirsp_pdus_cnt++; iscsi_complete_task(task, ISCSI_TASK_COMPLETED); } @@ -912,7 +912,7 @@ iscsi_data_in_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr, return; iscsi_update_cmdsn(conn->session, (struct iscsi_nopin *)hdr); - sc->result = (DID_OK << 16) | rhdr->cmd_status; + sc->result.combined = (DID_OK << 16) | rhdr->cmd_status; conn->exp_statsn = be32_to_cpu(rhdr->statsn) + 1; if (rhdr->flags & (ISCSI_FLAG_DATA_UNDERFLOW | ISCSI_FLAG_DATA_OVERFLOW)) { @@ -923,12 +923,12 @@ iscsi_data_in_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr, res_count <= sc->sdb.length)) scsi_set_resid(sc, res_count); else - sc->result = (DID_BAD_TARGET << 16) | rhdr->cmd_status; + sc->result.combined = (DID_BAD_TARGET << 16) | rhdr->cmd_status; } ISCSI_DBG_SESSION(conn->session, "data in with status done " "[sc %p res %d itt 0x%x]\n", - sc, sc->result, task->itt); + sc, sc->result.combined, task->itt); conn->scsirsp_pdus_cnt++; iscsi_complete_task(task, ISCSI_TASK_COMPLETED); } @@ -1678,7 +1678,7 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc) struct iscsi_conn *conn; struct iscsi_task *task = NULL; - sc->result = 0; + sc->result.combined = 0; sc->SCp.ptr = NULL; ihost = shost_priv(host); @@ -1689,7 +1689,7 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc) reason = iscsi_session_chkready(cls_session); if (reason) { - sc->result = reason; + sc->result.combined = reason; goto fault; } @@ -1708,29 +1708,29 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc) */ if (unlikely(system_state != SYSTEM_RUNNING)) { reason = FAILURE_SESSION_FAILED; - sc->result = DID_NO_CONNECT << 16; + sc->result.combined = DID_NO_CONNECT << 16; break; } fallthrough; case ISCSI_STATE_IN_RECOVERY: reason = FAILURE_SESSION_IN_RECOVERY; - sc->result = DID_IMM_RETRY << 16; + sc->result.combined = DID_IMM_RETRY << 16; break; case ISCSI_STATE_LOGGING_OUT: reason = FAILURE_SESSION_LOGGING_OUT; - sc->result = DID_IMM_RETRY << 16; + sc->result.combined = DID_IMM_RETRY << 16; break; case ISCSI_STATE_RECOVERY_FAILED: reason = FAILURE_SESSION_RECOVERY_TIMEOUT; - sc->result = DID_TRANSPORT_FAILFAST << 16; + sc->result.combined = DID_TRANSPORT_FAILFAST << 16; break; case ISCSI_STATE_TERMINATE: reason = FAILURE_SESSION_TERMINATE; - sc->result = DID_NO_CONNECT << 16; + sc->result.combined = DID_NO_CONNECT << 16; break; default: reason = FAILURE_SESSION_FREED; - sc->result = DID_NO_CONNECT << 16; + sc->result.combined = DID_NO_CONNECT << 16; } goto fault; } @@ -1738,13 +1738,13 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc) conn = session->leadconn; if (!conn) { reason = FAILURE_SESSION_FREED; - sc->result = DID_NO_CONNECT << 16; + sc->result.combined = DID_NO_CONNECT << 16; goto fault; } if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx)) { reason = FAILURE_SESSION_IN_RECOVERY; - sc->result = DID_REQUEUE << 16; + sc->result.combined = DID_REQUEUE << 16; goto fault; } @@ -1766,7 +1766,7 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc) reason = FAILURE_OOM; goto prepd_reject; } else { - sc->result = DID_ABORT << 16; + sc->result.combined = DID_ABORT << 16; goto prepd_fault; } } @@ -2016,7 +2016,7 @@ enum blk_eh_timer_return iscsi_eh_cmd_timed_out(struct scsi_cmnd *sc) * upper layer to deal with the result. */ if (unlikely(system_state != SYSTEM_RUNNING)) { - sc->result = DID_NO_CONNECT << 16; + sc->result.combined = DID_NO_CONNECT << 16; ISCSI_DBG_EH(session, "sc on shutdown, handled\n"); rc = BLK_EH_DONE; goto done; diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index 1bf939818c9818..b2d5f3d49c4df2 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -93,7 +93,7 @@ static void sas_end_task(struct scsi_cmnd *sc, struct sas_task *task) } } - sc->result = (hs << 16) | stat; + sc->result.combined = (hs << 16) | stat; ASSIGN_SAS_TASK(sc, NULL); sas_free_task(task); } @@ -169,7 +169,7 @@ int sas_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) /* If the device fell off, no sense in issuing commands */ if (test_bit(SAS_DEV_GONE, &dev->state)) { - cmd->result = DID_BAD_TARGET << 16; + cmd->result.combined = DID_BAD_TARGET << 16; goto out_done; } @@ -194,9 +194,9 @@ int sas_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) ASSIGN_SAS_TASK(cmd, NULL); sas_free_task(task); if (res == -SAS_QUEUE_FULL) - cmd->result = DID_SOFT_ERROR << 16; /* retry */ + cmd->result.combined = DID_SOFT_ERROR << 16; /* retry */ else - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; out_done: cmd->scsi_done(cmd); return 0; diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 85f6a066de5a8a..9f56e0aff3844a 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -156,7 +156,7 @@ lpfc_update_stats(struct lpfc_vport *vport, struct lpfc_io_buf *lpfc_cmd) if (!vport->stat_data_enabled || vport->stat_data_blocked || - (cmd->result)) + (cmd->result.combined)) return; latency = jiffies_to_msecs((long)jiffies - (long)lpfc_cmd->start_time); @@ -2871,7 +2871,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) if (err_type == BGS_GUARD_ERR_MASK) { scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x1); - cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + cmd->result.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 | SAM_STAT_CHECK_CONDITION; phba->bg_guard_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, @@ -2882,7 +2882,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) } else if (err_type == BGS_REFTAG_ERR_MASK) { scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x3); - cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + cmd->result.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 | SAM_STAT_CHECK_CONDITION; phba->bg_reftag_err_cnt++; @@ -2894,7 +2894,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) } else if (err_type == BGS_APPTAG_ERR_MASK) { scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x2); - cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + cmd->result.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 | SAM_STAT_CHECK_CONDITION; phba->bg_apptag_err_cnt++; @@ -2956,7 +2956,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x1); - cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + cmd->result.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 | SAM_STAT_CHECK_CONDITION; phba->bg_guard_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, @@ -2972,7 +2972,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x3); - cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + cmd->result.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 | SAM_STAT_CHECK_CONDITION; phba->bg_reftag_err_cnt++; @@ -2989,7 +2989,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x2); - cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + cmd->result.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 | SAM_STAT_CHECK_CONDITION; phba->bg_apptag_err_cnt++; @@ -3074,7 +3074,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, uint64_t failing_sector = 0; if (lpfc_bgs_get_invalid_prof(bgstat)) { - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, "9072 BLKGRD: Invalid BG Profile in cmd " "0x%x reftag 0x%x blk cnt 0x%x " @@ -3086,7 +3086,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, } if (lpfc_bgs_get_uninit_dif_block(bgstat)) { - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, "9073 BLKGRD: Invalid BG PDIF Block in cmd " "0x%x reftag 0x%x blk cnt 0x%x " @@ -3102,7 +3102,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x1); - cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + cmd->result.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 | SAM_STAT_CHECK_CONDITION; phba->bg_guard_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, @@ -3118,7 +3118,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x3); - cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + cmd->result.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 | SAM_STAT_CHECK_CONDITION; phba->bg_reftag_err_cnt++; @@ -3135,7 +3135,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST, 0x10, 0x2); - cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 | + cmd->result.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 | SAM_STAT_CHECK_CONDITION; phba->bg_apptag_err_cnt++; @@ -3741,15 +3741,15 @@ lpfc_send_scsi_error_event(struct lpfc_hba *phba, struct lpfc_vport *vport, return; /* If there is queuefull or busy condition send a scsi event */ - if ((cmnd->result == SAM_STAT_TASK_SET_FULL) || - (cmnd->result == SAM_STAT_BUSY)) { + if ((cmnd->result.combined == SAM_STAT_TASK_SET_FULL) || + (cmnd->result.combined == SAM_STAT_BUSY)) { fast_path_evt = lpfc_alloc_fast_evt(phba); if (!fast_path_evt) return; fast_path_evt->un.scsi_evt.event_type = FC_REG_SCSI_EVENT; fast_path_evt->un.scsi_evt.subcategory = - (cmnd->result == SAM_STAT_TASK_SET_FULL) ? + (cmnd->result.combined == SAM_STAT_TASK_SET_FULL) ? LPFC_EVENT_QFULL : LPFC_EVENT_DEVBSY; fast_path_evt->un.scsi_evt.lun = cmnd->device->lun; memcpy(&fast_path_evt->un.scsi_evt.wwpn, @@ -4015,7 +4015,7 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_io_buf *lpfc_cmd, } out: - cmnd->result = host_status << 16 | scsi_status; + cmnd->result.combined = host_status << 16 | scsi_status; lpfc_send_scsi_error_event(vport->phba, vport, lpfc_cmd, fcpi_parm); } @@ -4161,7 +4161,7 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, switch (lpfc_cmd->status) { case IOSTAT_SUCCESS: - cmd->result = DID_OK << 16; + cmd->result.combined = DID_OK << 16; break; case IOSTAT_FCP_RSP_ERROR: lpfc_handle_fcp_err(vport, lpfc_cmd, @@ -4170,7 +4170,7 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, break; case IOSTAT_NPORT_BSY: case IOSTAT_FABRIC_BSY: - cmd->result = DID_TRANSPORT_DISRUPTED << 16; + cmd->result.combined = DID_TRANSPORT_DISRUPTED << 16; fast_path_evt = lpfc_alloc_fast_evt(phba); if (!fast_path_evt) break; @@ -4232,14 +4232,14 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, lpfc_cmd->result == IOERR_ELXSEC_CRYPTO_ERROR || lpfc_cmd->result == IOERR_ELXSEC_CRYPTO_COMPARE_ERROR) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; break; } if (lpfc_cmd->result == IOERR_INVALID_RPI || lpfc_cmd->result == IOERR_NO_RESOURCES || lpfc_cmd->result == IOERR_ABORT_REQUESTED || lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) { - cmd->result = DID_REQUEUE << 16; + cmd->result.combined = DID_REQUEUE << 16; break; } if ((lpfc_cmd->result == IOERR_RX_DMA_FAILED || @@ -4278,7 +4278,7 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, default: if (lpfc_cmd->status >= IOSTAT_CNT) lpfc_cmd->status = IOSTAT_DEFAULT; - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_IOERR, "9037 FCP Completion Error: xri %x " "status x%x result x%x [x%x] " @@ -4288,15 +4288,15 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, wcqe->parameter, wcqe->total_data_placed); } - if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) { + if (cmd->result.combined || lpfc_cmd->fcp_rsp->rspSnsLen) { u32 *lp = (u32 *)cmd->sense_buffer; lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, "9039 Iodone <%d/%llu> cmd x%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, - scsi_get_resid(cmd)); + cmd->result.combined, *lp, *(lp + 3), + cmd->retries, scsi_get_resid(cmd)); } lpfc_update_stats(vport, lpfc_cmd); @@ -4473,7 +4473,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, break; case IOSTAT_NPORT_BSY: case IOSTAT_FABRIC_BSY: - cmd->result = DID_TRANSPORT_DISRUPTED << 16; + cmd->result.combined = DID_TRANSPORT_DISRUPTED << 16; fast_path_evt = lpfc_alloc_fast_evt(phba); if (!fast_path_evt) break; @@ -4507,14 +4507,14 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, lpfc_cmd->result == IOERR_ELXSEC_CRYPTO_ERROR || lpfc_cmd->result == IOERR_ELXSEC_CRYPTO_COMPARE_ERROR) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; break; } if (lpfc_cmd->result == IOERR_INVALID_RPI || lpfc_cmd->result == IOERR_NO_RESOURCES || lpfc_cmd->result == IOERR_ABORT_REQUESTED || lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) { - cmd->result = DID_REQUEUE << 16; + cmd->result.combined = DID_REQUEUE << 16; break; } if ((lpfc_cmd->result == IOERR_RX_DMA_FAILED || @@ -4548,25 +4548,25 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, } fallthrough; default: - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; break; } if (!pnode || (pnode->nlp_state != NLP_STE_MAPPED_NODE)) - cmd->result = DID_TRANSPORT_DISRUPTED << 16 | + cmd->result.combined = DID_TRANSPORT_DISRUPTED << 16 | SAM_STAT_BUSY; } else - cmd->result = DID_OK << 16; + cmd->result.combined = DID_OK << 16; - if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) { + if (cmd->result.combined || lpfc_cmd->fcp_rsp->rspSnsLen) { uint32_t *lp = (uint32_t *)cmd->sense_buffer; lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, "0710 Iodone <%d/%llu> cmd x%px, 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, - scsi_get_resid(cmd)); + cmd->result.combined, *lp, *(lp + 3), + cmd->retries, scsi_get_resid(cmd)); } lpfc_update_stats(vport, lpfc_cmd); @@ -5183,7 +5183,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) err = fc_remote_port_chkready(rport); if (err) { - cmnd->result = err; + cmnd->result.combined = err; goto out_fail_command; } ndlp = rdata->pnode; @@ -5290,7 +5290,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) if (unlikely(err)) { if (err == 2) { - cmnd->result = DID_ERROR << 16; + cmnd->result.combined = DID_ERROR << 16; goto out_fail_command_release_buf; } goto out_host_busy_free_buf; diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c index ec9840d322e5c2..ba9b9079d5752b 100644 --- a/drivers/scsi/mac53c94.c +++ b/drivers/scsi/mac53c94.c @@ -347,7 +347,7 @@ static void cmd_done(struct fsc_state *state, int result) cmd = state->current_req; if (cmd) { - cmd->result = result; + cmd->result.combined = result; (*cmd->scsi_done)(cmd); state->current_req = NULL; } diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 80f546976c7e17..aebafa19c83960 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -585,7 +585,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) /* have just LUN 0 for each target on virtual channels */ if (cmd->device->lun) { - cmd->result = (DID_BAD_TARGET << 16); + cmd->result.combined = (DID_BAD_TARGET << 16); cmd->scsi_done(cmd); return NULL; } @@ -604,7 +604,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) max_ldrv_num += 0x80; if(ldrv_num > max_ldrv_num ) { - cmd->result = (DID_BAD_TARGET << 16); + cmd->result.combined = (DID_BAD_TARGET << 16); cmd->scsi_done(cmd); return NULL; } @@ -616,7 +616,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) * Do not support lun >7 for physically accessed * devices */ - cmd->result = (DID_BAD_TARGET << 16); + cmd->result.combined = (DID_BAD_TARGET << 16); cmd->scsi_done(cmd); return NULL; } @@ -636,7 +636,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) * If no, return success always */ if( !adapter->has_cluster ) { - cmd->result = (DID_OK << 16); + cmd->result.combined = (DID_OK << 16); cmd->scsi_done(cmd); return NULL; } @@ -654,7 +654,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) return scb; #else - cmd->result = (DID_OK << 16); + cmd->result.combined = (DID_OK << 16); cmd->scsi_done(cmd); return NULL; #endif @@ -669,7 +669,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) memset(buf, 0, cmd->cmnd[4]); kunmap_atomic(buf - sg->offset); - cmd->result = (DID_OK << 16); + cmd->result.combined = (DID_OK << 16); cmd->scsi_done(cmd); return NULL; } @@ -865,7 +865,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) */ if( ! adapter->has_cluster ) { - cmd->result = (DID_BAD_TARGET << 16); + cmd->result.combined = (DID_BAD_TARGET << 16); cmd->scsi_done(cmd); return NULL; } @@ -888,7 +888,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) #endif default: - cmd->result = (DID_BAD_TARGET << 16); + cmd->result.combined = (DID_BAD_TARGET << 16); cmd->scsi_done(cmd); return NULL; } @@ -1472,7 +1472,7 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) "aborted cmd [%x] complete\n", scb->idx); - scb->cmd->result = (DID_ABORT << 16); + scb->cmd->result.combined = (DID_ABORT << 16); list_add_tail(SCSI_LIST(scb->cmd), &adapter->completed_list); @@ -1491,7 +1491,7 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) "reset cmd [%x] complete\n", scb->idx); - scb->cmd->result = (DID_RESET << 16); + scb->cmd->result.combined = (DID_RESET << 16); list_add_tail(SCSI_LIST(scb->cmd), &adapter->completed_list); @@ -1565,12 +1565,12 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) } /* clear result; otherwise, success returns corrupt value */ - cmd->result = 0; + cmd->result.combined = 0; /* Convert MegaRAID status to Linux error code */ switch (status) { case 0x00: /* SUCCESS , i.e. SCSI_STATUS_GOOD */ - cmd->result |= (DID_OK << 16); + cmd->result.combined |= (DID_OK << 16); break; case 0x02: /* ERROR_ABORTED, i.e. @@ -1583,7 +1583,7 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) memcpy(cmd->sense_buffer, pthru->reqsensearea, 14); - cmd->result = (DRIVER_SENSE << 24) | + cmd->result.combined = (DRIVER_SENSE << 24) | (DID_OK << 16) | (CHECK_CONDITION << 1); } @@ -1593,20 +1593,20 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) memcpy(cmd->sense_buffer, epthru->reqsensearea, 14); - cmd->result = (DRIVER_SENSE << 24) | + cmd->result.combined = (DRIVER_SENSE << 24) | (DID_OK << 16) | (CHECK_CONDITION << 1); } else { cmd->sense_buffer[0] = 0x70; cmd->sense_buffer[2] = ABORTED_COMMAND; - cmd->result |= (CHECK_CONDITION << 1); + cmd->result.combined |= (CHECK_CONDITION << 1); } } break; case 0x08: /* ERR_DEST_DRIVE_FAILED, i.e. SCSI_STATUS_BUSY */ - cmd->result |= (DID_BUS_BUSY << 16) | status; + cmd->result.combined |= (DID_BUS_BUSY << 16) | status; break; default: @@ -1616,7 +1616,7 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) * MEGA_RESERVATION_STATUS failed */ if( cmd->cmnd[0] == TEST_UNIT_READY ) { - cmd->result |= (DID_ERROR << 16) | + cmd->result.combined |= (DID_ERROR << 16) | (RESERVATION_CONFLICT << 1); } else @@ -1628,12 +1628,12 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) (cmd->cmnd[0] == RESERVE || cmd->cmnd[0] == RELEASE) ) { - cmd->result |= (DID_ERROR << 16) | + cmd->result.combined |= (DID_ERROR << 16) | (RESERVATION_CONFLICT << 1); } else #endif - cmd->result |= (DID_BAD_TARGET << 16)|status; + cmd->result.combined |= (DID_BAD_TARGET << 16)|status; } mega_free_scb(adapter, scb); @@ -1983,10 +1983,10 @@ megaraid_abort_and_reset(adapter_t *adapter, struct scsi_cmnd *cmd, int aor) mega_free_scb(adapter, scb); if( aor == SCB_ABORT ) { - cmd->result = (DID_ABORT << 16); + cmd->result.combined = (DID_ABORT << 16); } else { - cmd->result = (DID_RESET << 16); + cmd->result.combined = (DID_RESET << 16); } list_add_tail(SCSI_LIST(cmd), diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index b1a2d3536add60..353c10d8130671 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -1442,7 +1442,7 @@ megaraid_queue_command_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd adapter = SCP2ADAPTER(scp); scp->scsi_done = done; - scp->result = 0; + scp->result.combined = 0; /* * Allocate and build a SCB request @@ -1510,12 +1510,12 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) * If no, return success always */ if (!adapter->ha) { - scp->result = (DID_OK << 16); + scp->result.combined = (DID_OK << 16); return NULL; } if (!(scb = megaraid_alloc_scb(adapter, scp))) { - scp->result = (DID_ERROR << 16); + scp->result.combined = (DID_ERROR << 16); *busy = 1; return NULL; } @@ -1552,7 +1552,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) __LINE__)); } } - scp->result = (DID_OK << 16); + scp->result.combined = (DID_OK << 16); return NULL; case INQUIRY: @@ -1577,7 +1577,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) scp->sense_buffer[0] = 0x70; scp->sense_buffer[2] = ILLEGAL_REQUEST; scp->sense_buffer[12] = MEGA_INVALID_FIELD_IN_CDB; - scp->result = CHECK_CONDITION << 1; + scp->result.combined = CHECK_CONDITION << 1; return NULL; } @@ -1589,18 +1589,18 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) * requests for more than 40 logical drives */ if (SCP2LUN(scp)) { - scp->result = (DID_BAD_TARGET << 16); + scp->result.combined = (DID_BAD_TARGET << 16); return NULL; } if ((target % 0x80) >= MAX_LOGICAL_DRIVES_40LD) { - scp->result = (DID_BAD_TARGET << 16); + scp->result.combined = (DID_BAD_TARGET << 16); return NULL; } /* Allocate a SCB and initialize passthru */ if (!(scb = megaraid_alloc_scb(adapter, scp))) { - scp->result = (DID_ERROR << 16); + scp->result.combined = (DID_ERROR << 16); *busy = 1; return NULL; } @@ -1645,7 +1645,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) * Allocate a SCB and initialize mailbox */ if (!(scb = megaraid_alloc_scb(adapter, scp))) { - scp->result = (DID_ERROR << 16); + scp->result.combined = (DID_ERROR << 16); *busy = 1; return NULL; } @@ -1712,7 +1712,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) megaraid_dealloc_scb(adapter, scb); - scp->result = (DID_ERROR << 16); + scp->result.combined = (DID_ERROR << 16); return NULL; } @@ -1733,7 +1733,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) * Do we support clustering and is the support enabled */ if (!adapter->ha) { - scp->result = (DID_BAD_TARGET << 16); + scp->result.combined = (DID_BAD_TARGET << 16); return NULL; } @@ -1741,7 +1741,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) * Allocate a SCB and initialize mailbox */ if (!(scb = megaraid_alloc_scb(adapter, scp))) { - scp->result = (DID_ERROR << 16); + scp->result.combined = (DID_ERROR << 16); *busy = 1; return NULL; } @@ -1759,7 +1759,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) return scb; default: - scp->result = (DID_BAD_TARGET << 16); + scp->result.combined = (DID_BAD_TARGET << 16); return NULL; } } @@ -1767,7 +1767,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) // Do not allow access to target id > 15 or LUN > 7 if (target > 15 || SCP2LUN(scp) > 7) { - scp->result = (DID_BAD_TARGET << 16); + scp->result.combined = (DID_BAD_TARGET << 16); return NULL; } @@ -1803,13 +1803,13 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) // disable channel sweep if fast load option given if (rdev->fast_load) { - scp->result = (DID_BAD_TARGET << 16); + scp->result.combined = (DID_BAD_TARGET << 16); return NULL; } // Allocate a SCB and initialize passthru if (!(scb = megaraid_alloc_scb(adapter, scp))) { - scp->result = (DID_ERROR << 16); + scp->result.combined = (DID_ERROR << 16); *busy = 1; return NULL; } @@ -2289,7 +2289,7 @@ megaraid_mbox_dpc(unsigned long devp) case 0x00: - scp->result = (DID_OK << 16); + scp->result.combined = (DID_OK << 16); break; case 0x02: @@ -2301,7 +2301,7 @@ megaraid_mbox_dpc(unsigned long devp) memcpy(scp->sense_buffer, pthru->reqsensearea, 14); - scp->result = DRIVER_SENSE << 24 | + scp->result.combined = DRIVER_SENSE << 24 | DID_OK << 16 | CHECK_CONDITION << 1; } else { @@ -2310,20 +2310,20 @@ megaraid_mbox_dpc(unsigned long devp) memcpy(scp->sense_buffer, epthru->reqsensearea, 14); - scp->result = DRIVER_SENSE << 24 | + scp->result.combined = DRIVER_SENSE << 24 | DID_OK << 16 | CHECK_CONDITION << 1; } else { scp->sense_buffer[0] = 0x70; scp->sense_buffer[2] = ABORTED_COMMAND; - scp->result = CHECK_CONDITION << 1; + scp->result.combined = CHECK_CONDITION << 1; } } break; case 0x08: - scp->result = DID_BUS_BUSY << 16 | status; + scp->result.combined = DID_BUS_BUSY << 16 | status; break; default: @@ -2333,7 +2333,7 @@ megaraid_mbox_dpc(unsigned long devp) * failed */ if (scp->cmnd[0] == TEST_UNIT_READY) { - scp->result = DID_ERROR << 16 | + scp->result.combined = DID_ERROR << 16 | RESERVATION_CONFLICT << 1; } else @@ -2344,11 +2344,11 @@ megaraid_mbox_dpc(unsigned long devp) if (status == 1 && (scp->cmnd[0] == RESERVE || scp->cmnd[0] == RELEASE)) { - scp->result = DID_ERROR << 16 | + scp->result.combined = DID_ERROR << 16 | RESERVATION_CONFLICT << 1; } else { - scp->result = DID_BAD_TARGET << 16 | status; + scp->result.combined = DID_BAD_TARGET << 16 | status; } } @@ -2423,7 +2423,7 @@ megaraid_abort_handler(struct scsi_cmnd *scp) "megaraid: %d[%d:%d], abort from completed list\n", scb->sno, scb->dev_channel, scb->dev_target)); - scp->result = (DID_ABORT << 16); + scp->result.combined = (DID_ABORT << 16); scp->scsi_done(scp); megaraid_dealloc_scb(adapter, scb); @@ -2453,7 +2453,7 @@ megaraid_abort_handler(struct scsi_cmnd *scp) "megaraid abort: [%d:%d], driver owner\n", scb->dev_channel, scb->dev_target)); - scp->result = (DID_ABORT << 16); + scp->result.combined = (DID_ABORT << 16); scp->scsi_done(scp); megaraid_dealloc_scb(adapter, scb); @@ -2573,7 +2573,7 @@ megaraid_reset_handler(struct scsi_cmnd *scp) scb->sno, scb->dev_channel, scb->dev_target)); } - scb->scp->result = (DID_RESET << 16); + scb->scp->result.combined = (DID_RESET << 16); scb->scp->scsi_done(scb->scp); megaraid_dealloc_scb(adapter, scb); diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 4d4e9dbe5193fe..2dbaa3db9c38c4 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -1784,7 +1784,7 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd) scmd->device->host->hostdata; if (instance->unload == 1) { - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; scmd->scsi_done(scmd); return 0; } @@ -1799,21 +1799,21 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd) (DID_REQUEUE << 16)) { return SCSI_MLQUEUE_HOST_BUSY; } else { - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; scmd->scsi_done(scmd); return 0; } } if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) { - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; scmd->scsi_done(scmd); return 0; } mr_device_priv_data = scmd->device->hostdata; if (!mr_device_priv_data) { - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; scmd->scsi_done(scmd); return 0; } @@ -1825,19 +1825,19 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd) return SCSI_MLQUEUE_DEVICE_BUSY; - scmd->result = 0; + scmd->result.combined = 0; if (MEGASAS_IS_LOGICAL(scmd->device) && (scmd->device->id >= instance->fw_supported_vd_count || scmd->device->lun)) { - scmd->result = DID_BAD_TARGET << 16; + scmd->result.combined = DID_BAD_TARGET << 16; goto out_done; } if ((scmd->cmnd[0] == SYNCHRONIZE_CACHE) && MEGASAS_IS_LOGICAL(scmd->device) && (!instance->fw_sync_cache_support)) { - scmd->result = DID_OK << 16; + scmd->result.combined = DID_OK << 16; goto out_done; } @@ -2744,7 +2744,7 @@ static int megasas_wait_for_outstanding(struct megasas_instance *instance) struct megasas_cmd, list); list_del_init(&reset_cmd->list); if (reset_cmd->scmd) { - reset_cmd->scmd->result = DID_REQUEUE << 16; + reset_cmd->scmd->result.combined = DID_REQUEUE << 16; dev_notice(&instance->pdev->dev, "%d:%p reset [%02x]\n", reset_index, reset_cmd, reset_cmd->scmd->cmnd[0]); @@ -3581,7 +3581,7 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd, case MFI_CMD_LD_WRITE: if (alt_status) { - cmd->scmd->result = alt_status << 16; + cmd->scmd->result.combined = alt_status << 16; exception = 1; } @@ -3599,18 +3599,18 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd, switch (hdr->cmd_status) { case MFI_STAT_OK: - cmd->scmd->result = DID_OK << 16; + cmd->scmd->result.combined = DID_OK << 16; break; case MFI_STAT_SCSI_IO_FAILED: case MFI_STAT_LD_INIT_IN_PROGRESS: - cmd->scmd->result = + cmd->scmd->result.combined = (DID_ERROR << 16) | hdr->scsi_status; break; case MFI_STAT_SCSI_DONE_WITH_ERROR: - cmd->scmd->result = (DID_OK << 16) | hdr->scsi_status; + cmd->scmd->result.combined = (DID_OK << 16) | hdr->scsi_status; if (hdr->scsi_status == SAM_STAT_CHECK_CONDITION) { memset(cmd->scmd->sense_buffer, 0, @@ -3618,20 +3618,20 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd, memcpy(cmd->scmd->sense_buffer, cmd->sense, hdr->sense_len); - cmd->scmd->result |= DRIVER_SENSE << 24; + cmd->scmd->result.combined |= DRIVER_SENSE << 24; } break; case MFI_STAT_LD_OFFLINE: case MFI_STAT_DEVICE_NOT_FOUND: - cmd->scmd->result = DID_BAD_TARGET << 16; + cmd->scmd->result.combined = DID_BAD_TARGET << 16; break; default: dev_printk(KERN_DEBUG, &instance->pdev->dev, "MFI FW status %#x\n", hdr->cmd_status); - cmd->scmd->result = DID_ERROR << 16; + cmd->scmd->result.combined = DID_ERROR << 16; break; } diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 2221175ae051fe..1608bd2606665a 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -2035,23 +2035,23 @@ map_cmd_status(struct fusion_context *fusion, switch (status) { case MFI_STAT_OK: - scmd->result = DID_OK << 16; + scmd->result.combined = DID_OK << 16; break; case MFI_STAT_SCSI_IO_FAILED: case MFI_STAT_LD_INIT_IN_PROGRESS: - scmd->result = (DID_ERROR << 16) | ext_status; + scmd->result.combined = (DID_ERROR << 16) | ext_status; break; case MFI_STAT_SCSI_DONE_WITH_ERROR: - scmd->result = (DID_OK << 16) | ext_status; + scmd->result.combined = (DID_OK << 16) | ext_status; if (ext_status == SAM_STAT_CHECK_CONDITION) { memset(scmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); memcpy(scmd->sense_buffer, sense, SCSI_SENSE_BUFFERSIZE); - scmd->result |= DRIVER_SENSE << 24; + scmd->result.combined |= DRIVER_SENSE << 24; } /* @@ -2073,13 +2073,13 @@ map_cmd_status(struct fusion_context *fusion, case MFI_STAT_LD_OFFLINE: case MFI_STAT_DEVICE_NOT_FOUND: - scmd->result = DID_BAD_TARGET << 16; + scmd->result.combined = DID_BAD_TARGET << 16; break; case MFI_STAT_CONFIG_SEQ_MISMATCH: - scmd->result = DID_IMM_RETRY << 16; + scmd->result.combined = DID_IMM_RETRY << 16; break; default: - scmd->result = DID_ERROR << 16; + scmd->result.combined = DID_ERROR << 16; break; } } @@ -4699,7 +4699,7 @@ int megasas_task_abort_fusion(struct scsi_cmnd *scmd) if (!mr_device_priv_data) { sdev_printk(KERN_INFO, scmd->device, "device been deleted! " "scmd(%p)\n", scmd); - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; ret = SUCCESS; goto out; } @@ -4780,7 +4780,7 @@ int megasas_reset_target_fusion(struct scsi_cmnd *scmd) if (!mr_device_priv_data) { sdev_printk(KERN_INFO, scmd->device, "device been deleted! scmd: (0x%p)\n", scmd); - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; ret = SUCCESS; goto out; } @@ -4959,7 +4959,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason) MPI2_FUNCTION_SCSI_IO_REQUEST) fpio_count++; - scmd_local->result = + scmd_local->result.combined = megasas_check_mpio_paths(instance, scmd_local); if (instance->ldio_threshold && diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c index 0a9f4e44ab2cb9..197806616622bb 100644 --- a/drivers/scsi/mesh.c +++ b/drivers/scsi/mesh.c @@ -595,12 +595,13 @@ static void mesh_done(struct mesh_state *ms, int start_next) ms->current_req = NULL; tp->current_req = NULL; if (cmd) { - cmd->result = (ms->stat << 16) | cmd->SCp.Status; + cmd->result.combined = (ms->stat << 16) | cmd->SCp.Status; if (ms->stat == DID_OK) - cmd->result |= cmd->SCp.Message << 8; + cmd->result.combined |= cmd->SCp.Message << 8; if (DEBUG_TARGET(cmd)) { printk(KERN_DEBUG "mesh_done: result = %x, data_ptr=%d, buflen=%d\n", - cmd->result, ms->data_ptr, scsi_bufflen(cmd)); + cmd->result.combined, ms->data_ptr, + scsi_bufflen(cmd)); #if 0 /* needs to use sg? */ if ((cmd->cmnd[0] == 0 || cmd->cmnd[0] == 0x12 || cmd->cmnd[0] == 3) @@ -993,7 +994,7 @@ static void handle_reset(struct mesh_state *ms) for (tgt = 0; tgt < 8; ++tgt) { tp = &ms->tgts[tgt]; if ((cmd = tp->current_req) != NULL) { - cmd->result = DID_RESET << 16; + cmd->result.combined = DID_RESET << 16; tp->current_req = NULL; mesh_completed(ms, cmd); } @@ -1003,7 +1004,7 @@ static void handle_reset(struct mesh_state *ms) ms->current_req = NULL; while ((cmd = ms->request_q) != NULL) { ms->request_q = (struct scsi_cmnd *) cmd->host_scribble; - cmd->result = DID_RESET << 16; + cmd->result.combined = DID_RESET << 16; mesh_completed(ms, cmd); } ms->phase = idle; diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index d00aca3c77cec2..1a7e37ec46ef8d 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -3311,7 +3311,7 @@ scsih_abort(struct scsi_cmnd *scmd) ioc->remove_host) { sdev_printk(KERN_INFO, scmd->device, "device been deleted! scmd(0x%p)\n", scmd); - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; scmd->scsi_done(scmd); r = SUCCESS; goto out; @@ -3321,7 +3321,7 @@ scsih_abort(struct scsi_cmnd *scmd) if (st == NULL || st->cb_idx == 0xFF) { sdev_printk(KERN_INFO, scmd->device, "No reference found at " "driver, assuming scmd(0x%p) might have completed\n", scmd); - scmd->result = DID_RESET << 16; + scmd->result.combined = DID_RESET << 16; r = SUCCESS; goto out; } @@ -3330,7 +3330,7 @@ scsih_abort(struct scsi_cmnd *scmd) if (sas_device_priv_data->sas_target->flags & MPT_TARGET_FLAGS_RAID_COMPONENT || sas_device_priv_data->sas_target->flags & MPT_TARGET_FLAGS_VOLUME) { - scmd->result = DID_RESET << 16; + scmd->result.combined = DID_RESET << 16; r = FAILED; goto out; } @@ -3387,7 +3387,7 @@ scsih_dev_reset(struct scsi_cmnd *scmd) ioc->remove_host) { sdev_printk(KERN_INFO, scmd->device, "device been deleted! scmd(0x%p)\n", scmd); - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; scmd->scsi_done(scmd); r = SUCCESS; goto out; @@ -3405,7 +3405,7 @@ scsih_dev_reset(struct scsi_cmnd *scmd) handle = sas_device_priv_data->sas_target->handle; if (!handle) { - scmd->result = DID_RESET << 16; + scmd->result.combined = DID_RESET << 16; r = FAILED; goto out; } @@ -3467,7 +3467,7 @@ scsih_target_reset(struct scsi_cmnd *scmd) ioc->remove_host) { starget_printk(KERN_INFO, starget, "target been deleted! scmd(0x%p)\n", scmd); - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; scmd->scsi_done(scmd); r = SUCCESS; goto out; @@ -3485,7 +3485,7 @@ scsih_target_reset(struct scsi_cmnd *scmd) handle = sas_device_priv_data->sas_target->handle; if (!handle) { - scmd->result = DID_RESET << 16; + scmd->result.combined = DID_RESET << 16; r = FAILED; goto out; } @@ -4984,9 +4984,9 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc) mpt3sas_base_clear_st(ioc, st); scsi_dma_unmap(scmd); if (ioc->pci_error_recovery || ioc->remove_host) - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; else - scmd->result = DID_RESET << 16; + scmd->result.combined = DID_RESET << 16; scmd->scsi_done(scmd); } dtmprintk(ioc, ioc_info(ioc, "completing %d cmds\n", count)); @@ -5079,7 +5079,7 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status) } scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x10, ascq); - scmd->result = DRIVER_SENSE << 24 | (DID_ABORT << 16) | + scmd->result.combined = DRIVER_SENSE << 24 | (DID_ABORT << 16) | SAM_STAT_CHECK_CONDITION; } @@ -5114,13 +5114,13 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd) sas_device_priv_data = scmd->device->hostdata; if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; scmd->scsi_done(scmd); return 0; } if (!(_scsih_allow_scmd_to_device(ioc, scmd))) { - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; scmd->scsi_done(scmd); return 0; } @@ -5130,7 +5130,7 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd) /* invalid device handle */ handle = sas_target_priv_data->handle; if (handle == MPT3SAS_INVALID_DEVICE_HANDLE) { - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; scmd->scsi_done(scmd); return 0; } @@ -5141,7 +5141,7 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd) return SCSI_MLQUEUE_HOST_BUSY; } else if (sas_target_priv_data->deleted) { /* device has been deleted */ - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; scmd->scsi_done(scmd); return 0; } else if (sas_target_priv_data->tm_busy || @@ -5460,7 +5460,7 @@ _scsih_scsi_ioc_info(struct MPT3SAS_ADAPTER *ioc, struct scsi_cmnd *scmd, scsi_bufflen(scmd), scmd->underflow, scsi_get_resid(scmd)); ioc_warn(ioc, "\ttag(%d), transfer_count(%d), sc->result(0x%08x)\n", le16_to_cpu(mpi_reply->TaskTag), - le32_to_cpu(mpi_reply->TransferCount), scmd->result); + le32_to_cpu(mpi_reply->TransferCount), scmd->result.combined); ioc_warn(ioc, "\tscsi_status(%s)(0x%02x), scsi_state(%s)(0x%02x)\n", desc_scsi_status, scsi_status, desc_scsi_state, scsi_state); @@ -5688,14 +5688,14 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); if (mpi_reply == NULL) { - scmd->result = DID_OK << 16; + scmd->result.combined = DID_OK << 16; goto out; } sas_device_priv_data = scmd->device->hostdata; if (!sas_device_priv_data || !sas_device_priv_data->sas_target || sas_device_priv_data->sas_target->deleted) { - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; goto out; } ioc_status = le16_to_cpu(mpi_reply->IOCStatus); @@ -5773,71 +5773,71 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) switch (ioc_status) { case MPI2_IOCSTATUS_BUSY: case MPI2_IOCSTATUS_INSUFFICIENT_RESOURCES: - scmd->result = SAM_STAT_BUSY; + scmd->result.combined = SAM_STAT_BUSY; break; case MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE: - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; break; case MPI2_IOCSTATUS_SCSI_IOC_TERMINATED: if (sas_device_priv_data->block) { - scmd->result = DID_TRANSPORT_DISRUPTED << 16; + scmd->result.combined = DID_TRANSPORT_DISRUPTED << 16; goto out; } if (log_info == 0x31110630) { if (scmd->retries > 2) { - scmd->result = DID_NO_CONNECT << 16; + scmd->result.combined = DID_NO_CONNECT << 16; scsi_device_set_state(scmd->device, SDEV_OFFLINE); } else { - scmd->result = DID_SOFT_ERROR << 16; + scmd->result.combined = DID_SOFT_ERROR << 16; scmd->device->expecting_cc_ua = 1; } break; } else if (log_info == VIRTUAL_IO_FAILED_RETRY) { - scmd->result = DID_RESET << 16; + scmd->result.combined = DID_RESET << 16; break; } else if ((scmd->device->channel == RAID_CHANNEL) && (scsi_state == (MPI2_SCSI_STATE_TERMINATED | MPI2_SCSI_STATE_NO_SCSI_STATUS))) { - scmd->result = DID_RESET << 16; + scmd->result.combined = DID_RESET << 16; break; } - scmd->result = DID_SOFT_ERROR << 16; + scmd->result.combined = DID_SOFT_ERROR << 16; break; case MPI2_IOCSTATUS_SCSI_TASK_TERMINATED: case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED: - scmd->result = DID_RESET << 16; + scmd->result.combined = DID_RESET << 16; break; case MPI2_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: if ((xfer_cnt == 0) || (scmd->underflow > xfer_cnt)) - scmd->result = DID_SOFT_ERROR << 16; + scmd->result.combined = DID_SOFT_ERROR << 16; else - scmd->result = (DID_OK << 16) | scsi_status; + scmd->result.combined = (DID_OK << 16) | scsi_status; break; case MPI2_IOCSTATUS_SCSI_DATA_UNDERRUN: - scmd->result = (DID_OK << 16) | scsi_status; + scmd->result.combined = (DID_OK << 16) | scsi_status; if ((scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID)) break; if (xfer_cnt < scmd->underflow) { if (scsi_status == SAM_STAT_BUSY) - scmd->result = SAM_STAT_BUSY; + scmd->result.combined = SAM_STAT_BUSY; else - scmd->result = DID_SOFT_ERROR << 16; + scmd->result.combined = DID_SOFT_ERROR << 16; } else if (scsi_state & (MPI2_SCSI_STATE_AUTOSENSE_FAILED | MPI2_SCSI_STATE_NO_SCSI_STATUS)) - scmd->result = DID_SOFT_ERROR << 16; + scmd->result.combined = DID_SOFT_ERROR << 16; else if (scsi_state & MPI2_SCSI_STATE_TERMINATED) - scmd->result = DID_RESET << 16; + scmd->result.combined = DID_RESET << 16; else if (!xfer_cnt && scmd->cmnd[0] == REPORT_LUNS) { mpi_reply->SCSIState = MPI2_SCSI_STATE_AUTOSENSE_VALID; mpi_reply->SCSIStatus = SAM_STAT_CHECK_CONDITION; - scmd->result = (DRIVER_SENSE << 24) | + scmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; scmd->sense_buffer[0] = 0x70; scmd->sense_buffer[2] = ILLEGAL_REQUEST; @@ -5851,14 +5851,14 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) fallthrough; case MPI2_IOCSTATUS_SCSI_RECOVERED_ERROR: case MPI2_IOCSTATUS_SUCCESS: - scmd->result = (DID_OK << 16) | scsi_status; + scmd->result.combined = (DID_OK << 16) | scsi_status; if (response_code == MPI2_SCSITASKMGMT_RSP_INVALID_FRAME || (scsi_state & (MPI2_SCSI_STATE_AUTOSENSE_FAILED | MPI2_SCSI_STATE_NO_SCSI_STATUS))) - scmd->result = DID_SOFT_ERROR << 16; + scmd->result.combined = DID_SOFT_ERROR << 16; else if (scsi_state & MPI2_SCSI_STATE_TERMINATED) - scmd->result = DID_RESET << 16; + scmd->result.combined = DID_RESET << 16; break; case MPI2_IOCSTATUS_EEDP_GUARD_ERROR: @@ -5877,12 +5877,12 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) case MPI2_IOCSTATUS_SCSI_TASK_MGMT_FAILED: case MPI2_IOCSTATUS_INSUFFICIENT_POWER: default: - scmd->result = DID_SOFT_ERROR << 16; + scmd->result.combined = DID_SOFT_ERROR << 16; break; } - if (scmd->result && (ioc->logging_level & MPT_DEBUG_REPLY)) + if (scmd->result.combined && (ioc->logging_level & MPT_DEBUG_REPLY)) _scsih_scsi_ioc_info(ioc , scmd, mpi_reply, smid); out: diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c index 9d5743627604dc..d3008add66f5cc 100644 --- a/drivers/scsi/mvumi.c +++ b/drivers/scsi/mvumi.c @@ -1303,25 +1303,25 @@ static void mvumi_complete_cmd(struct mvumi_hba *mhba, struct mvumi_cmd *cmd, struct scsi_cmnd *scmd = cmd->scmd; cmd->scmd->SCp.ptr = NULL; - scmd->result = ob_frame->req_status; + scmd->result.combined = ob_frame->req_status; switch (ob_frame->req_status) { case SAM_STAT_GOOD: - scmd->result |= DID_OK << 16; + scmd->result.combined |= DID_OK << 16; break; case SAM_STAT_BUSY: - scmd->result |= DID_BUS_BUSY << 16; + scmd->result.combined |= DID_BUS_BUSY << 16; break; case SAM_STAT_CHECK_CONDITION: - scmd->result |= (DID_OK << 16); + scmd->result.combined |= (DID_OK << 16); if (ob_frame->rsp_flag & CL_RSP_FLAG_SENSEDATA) { memcpy(cmd->scmd->sense_buffer, ob_frame->payload, sizeof(struct mvumi_sense_data)); - scmd->result |= (DRIVER_SENSE << 24); + scmd->result.combined |= (DRIVER_SENSE << 24); } break; default: - scmd->result |= (DRIVER_INVALID << 24) | (DID_ABORT << 16); + scmd->result.combined |= (DRIVER_INVALID << 24) | (DID_ABORT << 16); break; } @@ -2068,7 +2068,7 @@ static unsigned char mvumi_build_frame(struct mvumi_hba *mhba, return 0; error: - scmd->result = (DID_OK << 16) | (DRIVER_SENSE << 24) | + scmd->result.combined = (DID_OK << 16) | (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x24, 0); @@ -2090,7 +2090,7 @@ static int mvumi_queue_command(struct Scsi_Host *shost, spin_lock_irqsave(shost->host_lock, irq_flags); mhba = (struct mvumi_hba *) shost->hostdata; - scmd->result = 0; + scmd->result.combined = 0; cmd = mvumi_get_cmd(mhba); if (unlikely(!cmd)) { spin_unlock_irqrestore(shost->host_lock, irq_flags); @@ -2131,7 +2131,7 @@ static enum blk_eh_timer_return mvumi_timed_out(struct scsi_cmnd *scmd) else atomic_dec(&mhba->fw_outstanding); - scmd->result = (DRIVER_INVALID << 24) | (DID_ABORT << 16); + scmd->result.combined = (DRIVER_INVALID << 24) | (DID_ABORT << 16); scmd->SCp.ptr = NULL; if (scsi_bufflen(scmd)) { dma_unmap_sg(&mhba->pdev->dev, scsi_sglist(scmd), diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c index d9c82e211ae706..baf08119b27867 100644 --- a/drivers/scsi/myrb.c +++ b/drivers/scsi/myrb.c @@ -1280,7 +1280,7 @@ static int myrb_pthru_queuecommand(struct Scsi_Host *shost, nsge = scsi_dma_map(scmd); if (nsge > 1) { dma_pool_free(cb->dcdb_pool, dcdb, dcdb_addr); - scmd->result = (DID_ERROR << 16); + scmd->result.combined = (DID_ERROR << 16); scmd->scsi_done(scmd); return 0; } @@ -1435,13 +1435,13 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost, ldev_info->state != MYRB_DEVICE_WO) { dev_dbg(&shost->shost_gendev, "ldev %u in state %x, skip\n", sdev->id, ldev_info ? ldev_info->state : 0xff); - scmd->result = (DID_BAD_TARGET << 16); + scmd->result.combined = (DID_BAD_TARGET << 16); scmd->scsi_done(scmd); return 0; } switch (scmd->cmnd[0]) { case TEST_UNIT_READY: - scmd->result = (DID_OK << 16); + scmd->result.combined = (DID_OK << 16); scmd->scsi_done(scmd); return 0; case INQUIRY: @@ -1449,16 +1449,16 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost, /* Illegal request, invalid field in CDB */ scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x24, 0); - scmd->result = (DRIVER_SENSE << 24) | + scmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; } else { myrb_inquiry(cb, scmd); - scmd->result = (DID_OK << 16); + scmd->result.combined = (DID_OK << 16); } scmd->scsi_done(scmd); return 0; case SYNCHRONIZE_CACHE: - scmd->result = (DID_OK << 16); + scmd->result.combined = (DID_OK << 16); scmd->scsi_done(scmd); return 0; case MODE_SENSE: @@ -1467,11 +1467,11 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost, /* Illegal request, invalid field in CDB */ scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x24, 0); - scmd->result = (DRIVER_SENSE << 24) | + scmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; } else { myrb_mode_sense(cb, scmd, ldev_info); - scmd->result = (DID_OK << 16); + scmd->result.combined = (DID_OK << 16); } scmd->scsi_done(scmd); return 0; @@ -1481,7 +1481,7 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost, /* Illegal request, invalid field in CDB */ scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x24, 0); - scmd->result = (DRIVER_SENSE << 24) | + scmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; scmd->scsi_done(scmd); return 0; @@ -1491,7 +1491,7 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost, /* Illegal request, invalid field in CDB */ scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x24, 0); - scmd->result = (DRIVER_SENSE << 24) | + scmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; scmd->scsi_done(scmd); return 0; @@ -1501,18 +1501,18 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost, return 0; case REQUEST_SENSE: myrb_request_sense(cb, scmd); - scmd->result = (DID_OK << 16); + scmd->result.combined = (DID_OK << 16); return 0; case SEND_DIAGNOSTIC: if (scmd->cmnd[1] != 0x04) { /* Illegal request, invalid field in CDB */ scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x24, 0); - scmd->result = (DRIVER_SENSE << 24) | + scmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; } else { /* Assume good status */ - scmd->result = (DID_OK << 16); + scmd->result.combined = (DID_OK << 16); } scmd->scsi_done(scmd); return 0; @@ -1521,7 +1521,7 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost, /* Data protect, attempt to read invalid data */ scsi_build_sense_buffer(0, scmd->sense_buffer, DATA_PROTECT, 0x21, 0x06); - scmd->result = (DRIVER_SENSE << 24) | + scmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; scmd->scsi_done(scmd); return 0; @@ -1538,7 +1538,7 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost, /* Data protect, attempt to read invalid data */ scsi_build_sense_buffer(0, scmd->sense_buffer, DATA_PROTECT, 0x21, 0x06); - scmd->result = (DRIVER_SENSE << 24) | + scmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; scmd->scsi_done(scmd); return 0; @@ -1555,7 +1555,7 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost, /* Data protect, attempt to read invalid data */ scsi_build_sense_buffer(0, scmd->sense_buffer, DATA_PROTECT, 0x21, 0x06); - scmd->result = (DRIVER_SENSE << 24) | + scmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; scmd->scsi_done(scmd); return 0; @@ -1571,7 +1571,7 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost, /* Illegal request, invalid opcode */ scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x20, 0); - scmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; + scmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; scmd->scsi_done(scmd); return 0; } @@ -1635,7 +1635,7 @@ static int myrb_queuecommand(struct Scsi_Host *shost, struct scsi_device *sdev = scmd->device; if (sdev->channel > myrb_logical_channel(shost)) { - scmd->result = (DID_BAD_TARGET << 16); + scmd->result.combined = (DID_BAD_TARGET << 16); scmd->scsi_done(scmd); return 0; } @@ -2345,7 +2345,7 @@ static void myrb_handle_scsi(struct myrb_hba *cb, struct myrb_cmdblk *cmd_blk, switch (status) { case MYRB_STATUS_SUCCESS: case MYRB_STATUS_DEVICE_BUSY: - scmd->result = (DID_OK << 16) | status; + scmd->result.combined = (DID_OK << 16) | status; break; case MYRB_STATUS_BAD_DATA: dev_dbg(&scmd->device->sdev_gendev, @@ -2358,7 +2358,7 @@ static void myrb_handle_scsi(struct myrb_hba *cb, struct myrb_cmdblk *cmd_blk, /* Write error */ scsi_build_sense_buffer(0, scmd->sense_buffer, MEDIUM_ERROR, 0x0C, 0); - scmd->result = (DID_OK << 16) | SAM_STAT_CHECK_CONDITION; + scmd->result.combined = (DID_OK << 16) | SAM_STAT_CHECK_CONDITION; break; case MYRB_STATUS_IRRECOVERABLE_DATA_ERROR: scmd_printk(KERN_ERR, scmd, "Irrecoverable Data Error\n"); @@ -2370,12 +2370,12 @@ static void myrb_handle_scsi(struct myrb_hba *cb, struct myrb_cmdblk *cmd_blk, /* Write error, auto-reallocation failed */ scsi_build_sense_buffer(0, scmd->sense_buffer, MEDIUM_ERROR, 0x0C, 0x02); - scmd->result = (DID_OK << 16) | SAM_STAT_CHECK_CONDITION; + scmd->result.combined = (DID_OK << 16) | SAM_STAT_CHECK_CONDITION; break; case MYRB_STATUS_LDRV_NONEXISTENT_OR_OFFLINE: dev_dbg(&scmd->device->sdev_gendev, "Logical Drive Nonexistent or Offline"); - scmd->result = (DID_BAD_TARGET << 16); + scmd->result.combined = (DID_BAD_TARGET << 16); break; case MYRB_STATUS_ACCESS_BEYOND_END_OF_LDRV: dev_dbg(&scmd->device->sdev_gendev, @@ -2386,12 +2386,12 @@ static void myrb_handle_scsi(struct myrb_hba *cb, struct myrb_cmdblk *cmd_blk, break; case MYRB_STATUS_DEVICE_NONRESPONSIVE: dev_dbg(&scmd->device->sdev_gendev, "Device nonresponsive\n"); - scmd->result = (DID_BAD_TARGET << 16); + scmd->result.combined = (DID_BAD_TARGET << 16); break; default: scmd_printk(KERN_ERR, scmd, "Unexpected Error Status %04X", status); - scmd->result = (DID_ERROR << 16); + scmd->result.combined = (DID_ERROR << 16); break; } scmd->scsi_done(scmd); diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c index 3b68c68d171620..f45c0963be5820 100644 --- a/drivers/scsi/myrs.c +++ b/drivers/scsi/myrs.c @@ -1593,7 +1593,7 @@ static int myrs_queuecommand(struct Scsi_Host *shost, int nsge; if (!scmd->device->hostdata) { - scmd->result = (DID_NO_CONNECT << 16); + scmd->result.combined = (DID_NO_CONNECT << 16); scmd->scsi_done(scmd); return 0; } @@ -1602,7 +1602,7 @@ static int myrs_queuecommand(struct Scsi_Host *shost, case REPORT_LUNS: scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x20, 0x0); - scmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; + scmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; scmd->scsi_done(scmd); return 0; case MODE_SENSE: @@ -1614,11 +1614,11 @@ static int myrs_queuecommand(struct Scsi_Host *shost, /* Illegal request, invalid field in CDB */ scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x24, 0); - scmd->result = (DRIVER_SENSE << 24) | + scmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; } else { myrs_mode_sense(cs, scmd, ldev_info); - scmd->result = (DID_OK << 16); + scmd->result.combined = (DID_OK << 16); } scmd->scsi_done(scmd); return 0; @@ -1759,7 +1759,7 @@ static int myrs_queuecommand(struct Scsi_Host *shost, scsi_for_each_sg(scmd, sgl, nsge, i) { if (WARN_ON(!hw_sgl)) { scsi_dma_unmap(scmd); - scmd->result = (DID_ERROR << 16); + scmd->result.combined = (DID_ERROR << 16); scmd->scsi_done(scmd); return 0; } @@ -2084,9 +2084,9 @@ static void myrs_handle_scsi(struct myrs_hba *cs, struct myrs_cmdblk *cmd_blk, scsi_set_resid(scmd, cmd_blk->residual); if (status == MYRS_STATUS_DEVICE_NON_RESPONSIVE || status == MYRS_STATUS_DEVICE_NON_RESPONSIVE2) - scmd->result = (DID_BAD_TARGET << 16); + scmd->result.combined = (DID_BAD_TARGET << 16); else - scmd->result = (DID_OK << 16) | status; + scmd->result.combined = (DID_OK << 16) | status; scmd->scsi_done(scmd); } diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index c76e9f05d04239..75a977884788d8 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c @@ -4909,7 +4909,7 @@ void ncr_complete (struct ncb *np, struct ccb *cp) /* ** Check the status. */ - cmd->result = 0; + cmd->result.combined = 0; if ( (cp->host_status == HS_COMPLETE) && (cp->scsi_status == SAM_STAT_GOOD || cp->scsi_status == SAM_STAT_CONDITION_MET)) { diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c index 134bbd2d8b6673..c17c9bfa78e443 100644 --- a/drivers/scsi/nsp32.c +++ b/drivers/scsi/nsp32.c @@ -461,7 +461,7 @@ static int nsp32_selection_autopara(struct scsi_cmnd *SCpnt) if (phase != BUSMON_BUS_FREE) { nsp32_msg(KERN_WARNING, "bus busy"); show_busphase(phase & BUSMON_PHASE_MASK); - SCpnt->result = DID_BUS_BUSY << 16; + SCpnt->result.combined = DID_BUS_BUSY << 16; return FALSE; } @@ -473,7 +473,7 @@ static int nsp32_selection_autopara(struct scsi_cmnd *SCpnt) */ if (data->msgout_len == 0) { nsp32_msg(KERN_ERR, "SCSI MsgOut without any message!"); - SCpnt->result = DID_ERROR << 16; + SCpnt->result.combined = DID_ERROR << 16; return FALSE; } else if (data->msgout_len > 0 && data->msgout_len <= 3) { msgout = 0; @@ -596,7 +596,7 @@ static int nsp32_selection_autoscsi(struct scsi_cmnd *SCpnt) phase = nsp32_read1(base, SCSI_BUS_MONITOR); if ((phase & BUSMON_BSY) || (phase & BUSMON_SEL)) { nsp32_msg(KERN_WARNING, "bus busy"); - SCpnt->result = DID_BUS_BUSY << 16; + SCpnt->result.combined = DID_BUS_BUSY << 16; status = 1; goto out; } @@ -632,7 +632,7 @@ static int nsp32_selection_autoscsi(struct scsi_cmnd *SCpnt) */ if (data->msgout_len == 0) { nsp32_msg(KERN_ERR, "SCSI MsgOut without any message!"); - SCpnt->result = DID_ERROR << 16; + SCpnt->result.combined = DID_ERROR << 16; status = 1; goto out; } else if (data->msgout_len > 0 && data->msgout_len <= 3) { @@ -762,11 +762,11 @@ static int nsp32_arbitration(struct scsi_cmnd *SCpnt, unsigned int base) if (arbit & ARBIT_WIN) { /* Arbitration succeeded */ - SCpnt->result = DID_OK << 16; + SCpnt->result.combined = DID_OK << 16; nsp32_index_write1(base, EXT_PORT, LED_ON); /* PCI LED on */ } else if (arbit & ARBIT_FAIL) { /* Arbitration failed */ - SCpnt->result = DID_BUS_BUSY << 16; + SCpnt->result.combined = DID_BUS_BUSY << 16; status = FALSE; } else { /* @@ -774,7 +774,7 @@ static int nsp32_arbitration(struct scsi_cmnd *SCpnt, unsigned int base) * something lock up! guess no connection. */ nsp32_dbg(NSP32_DEBUG_AUTOSCSI, "arbit timeout"); - SCpnt->result = DID_NO_CONNECT << 16; + SCpnt->result.combined = DID_NO_CONNECT << 16; status = FALSE; } @@ -910,7 +910,7 @@ static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct s if (data->CurrentSC != NULL) { nsp32_msg(KERN_ERR, "Currentsc != NULL. Cancel this command request"); data->CurrentSC = NULL; - SCpnt->result = DID_NO_CONNECT << 16; + SCpnt->result.combined = DID_NO_CONNECT << 16; done(SCpnt); return 0; } @@ -918,7 +918,7 @@ static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct s /* check target ID is not same as this initiator ID */ if (scmd_id(SCpnt) == SCpnt->device->host->this_id) { nsp32_dbg(NSP32_DEBUG_QUEUECOMMAND, "target==host???"); - SCpnt->result = DID_BAD_TARGET << 16; + SCpnt->result.combined = DID_BAD_TARGET << 16; done(SCpnt); return 0; } @@ -926,7 +926,7 @@ static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct s /* check target LUN is allowable value */ if (SCpnt->device->lun >= MAX_LUN) { nsp32_dbg(NSP32_DEBUG_QUEUECOMMAND, "no more lun"); - SCpnt->result = DID_BAD_TARGET << 16; + SCpnt->result.combined = DID_BAD_TARGET << 16; done(SCpnt); return 0; } @@ -958,7 +958,7 @@ static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct s ret = nsp32_setup_sg_table(SCpnt); if (ret == FALSE) { nsp32_msg(KERN_ERR, "SGT fail"); - SCpnt->result = DID_ERROR << 16; + SCpnt->result.combined = DID_ERROR << 16; nsp32_scsi_done(SCpnt); return 0; } @@ -1181,7 +1181,7 @@ static irqreturn_t do_nsp32_isr(int irq, void *dev_id) nsp32_msg(KERN_INFO, "card disconnect"); if (data->CurrentSC != NULL) { nsp32_msg(KERN_INFO, "clean up current SCSI command"); - SCpnt->result = DID_BAD_TARGET << 16; + SCpnt->result.combined = DID_BAD_TARGET << 16; nsp32_scsi_done(SCpnt); } goto out; @@ -1199,7 +1199,7 @@ static irqreturn_t do_nsp32_isr(int irq, void *dev_id) nsp32_msg(KERN_INFO, "detected someone do bus reset"); nsp32_do_bus_reset(data); if (SCpnt != NULL) { - SCpnt->result = DID_RESET << 16; + SCpnt->result.combined = DID_RESET << 16; nsp32_scsi_done(SCpnt); } goto out; @@ -1227,7 +1227,7 @@ static irqreturn_t do_nsp32_isr(int irq, void *dev_id) nsp32_dbg(NSP32_DEBUG_INTR, "selection timeout occurred"); - SCpnt->result = DID_TIME_OUT << 16; + SCpnt->result.combined = DID_TIME_OUT << 16; nsp32_scsi_done(SCpnt); goto out; } @@ -1309,7 +1309,7 @@ static irqreturn_t do_nsp32_isr(int irq, void *dev_id) * low level driver to indicate status), then checks * status_byte (SCSI status byte). */ - SCpnt->result = (int)nsp32_read1(base, SCSI_CSB_IN); + SCpnt->result.combined = (int)nsp32_read1(base, SCSI_CSB_IN); } if (auto_stat & ILLEGAL_PHASE) { @@ -1505,7 +1505,7 @@ static int nsp32_show_info(struct seq_file *m, struct Scsi_Host *host) /* * Reset parameters and call scsi_done for data->cur_lunt. - * Be careful setting SCpnt->result = DID_* before calling this function. + * Be careful setting SCpnt->result.combined = DID_* before calling this function. */ static void nsp32_scsi_done(struct scsi_cmnd *SCpnt) { @@ -1670,7 +1670,7 @@ static int nsp32_busfree_occur(struct scsi_cmnd *SCpnt, unsigned short execph) nsp32_dbg(NSP32_DEBUG_BUSFREE, "normal end stat=0x%x resid=0x%x\n", SCpnt->SCp.Status, scsi_get_resid(SCpnt)); - SCpnt->result = (DID_OK << 16) | + SCpnt->result.combined = (DID_OK << 16) | (SCpnt->SCp.Message << 8) | (SCpnt->SCp.Status << 0); nsp32_scsi_done(SCpnt); @@ -1689,7 +1689,7 @@ static int nsp32_busfree_occur(struct scsi_cmnd *SCpnt, unsigned short execph) /* DID_ERROR? */ //SCpnt->result = (DID_OK << 16) | (SCpnt->SCp.Message << 8) | (SCpnt->SCp.Status << 0); - SCpnt->result = DID_ERROR << 16; + SCpnt->result.combined = DID_ERROR << 16; nsp32_scsi_done(SCpnt); return TRUE; } @@ -2812,7 +2812,7 @@ static int nsp32_eh_abort(struct scsi_cmnd *SCpnt) nsp32_write2(base, TRANSFER_CONTROL, 0); nsp32_write2(base, BM_CNT, 0); - SCpnt->result = DID_ABORT << 16; + SCpnt->result.combined = DID_ABORT << 16; nsp32_scsi_done(SCpnt); nsp32_dbg(NSP32_DEBUG_BUSRESET, "abort success"); diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index 5d5f50d6a02d7c..3a7c8dd1bd5227 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c @@ -202,7 +202,7 @@ static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt, if (data->CurrentSC != NULL) { nsp_msg(KERN_DEBUG, "CurrentSC!=NULL this can't be happen"); - SCpnt->result = DID_BAD_TARGET << 16; + SCpnt->result.combined = DID_BAD_TARGET << 16; nsp_scsi_done(SCpnt); return 0; } @@ -249,7 +249,7 @@ static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt, if (nsphw_start_selection(SCpnt) == FALSE) { nsp_dbg(NSP_DEBUG_QUEUECOMMAND, "selection fail"); - SCpnt->result = DID_BUS_BUSY << 16; + SCpnt->result.combined = DID_BUS_BUSY << 16; nsp_scsi_done(SCpnt); return 0; } @@ -1034,7 +1034,7 @@ static irqreturn_t nspintr(int irq, void *dev_id) if(data->CurrentSC != NULL) { tmpSC = data->CurrentSC; - tmpSC->result = (DID_RESET << 16) | + tmpSC->result.combined = (DID_RESET << 16) | ((tmpSC->SCp.Message & 0xff) << 8) | ((tmpSC->SCp.Status & 0xff) << 0); nsp_scsi_done(tmpSC); @@ -1083,7 +1083,7 @@ static irqreturn_t nspintr(int irq, void *dev_id) data->SelectionTimeOut = 0; nsp_index_write(base, SCSIBUSCTRL, 0); - tmpSC->result = DID_TIME_OUT << 16; + tmpSC->result.combined = DID_TIME_OUT << 16; nsp_scsi_done(tmpSC); return IRQ_HANDLED; @@ -1107,7 +1107,7 @@ static irqreturn_t nspintr(int irq, void *dev_id) // *sync_neg = SYNC_NOT_YET; if ((phase & BUSMON_PHASE_MASK) != BUSPHASE_MESSAGE_IN) { - tmpSC->result = DID_ABORT << 16; + tmpSC->result.combined = DID_ABORT << 16; nsp_scsi_done(tmpSC); return IRQ_HANDLED; } @@ -1133,10 +1133,11 @@ static irqreturn_t nspintr(int irq, void *dev_id) /* all command complete and return status */ if (tmpSC->SCp.Message == COMMAND_COMPLETE) { - tmpSC->result = (DID_OK << 16) | + tmpSC->result.combined = (DID_OK << 16) | ((tmpSC->SCp.Message & 0xff) << 8) | ((tmpSC->SCp.Status & 0xff) << 0); - nsp_dbg(NSP_DEBUG_INTR, "command complete result=0x%x", tmpSC->result); + nsp_dbg(NSP_DEBUG_INTR, "command complete result=0x%x", + tmpSC->result.combined); nsp_scsi_done(tmpSC); return IRQ_HANDLED; @@ -1151,7 +1152,7 @@ static irqreturn_t nspintr(int irq, void *dev_id) nsp_msg(KERN_DEBUG, "unexpected bus free. irq_status=0x%x, phase=0x%x, irq_phase=0x%x", irq_status, phase, irq_phase); *sync_neg = SYNC_NG; - tmpSC->result = DID_ERROR << 16; + tmpSC->result.combined = DID_ERROR << 16; nsp_scsi_done(tmpSC); return IRQ_HANDLED; } diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index a366ff1a3959de..3b60ee7814a64d 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c @@ -373,34 +373,34 @@ SYM53C500_intr(int irq, void *dev_id) if (int_reg & 0x80) { /* SCSI reset intr */ DEB(printk("SYM53C500: reset intr received\n")); - curSC->result = DID_RESET << 16; + curSC->result.combined = DID_RESET << 16; goto idle_out; } if (pio_status & 0x80) { printk("SYM53C500: Warning: PIO error!\n"); - curSC->result = DID_ERROR << 16; + curSC->result.combined = DID_ERROR << 16; goto idle_out; } if (status & 0x20) { /* Parity error */ printk("SYM53C500: Warning: parity error!\n"); - curSC->result = DID_PARITY << 16; + curSC->result.combined = DID_PARITY << 16; goto idle_out; } if (status & 0x40) { /* Gross error */ printk("SYM53C500: Warning: gross error!\n"); - curSC->result = DID_ERROR << 16; + curSC->result.combined = DID_ERROR << 16; goto idle_out; } if (int_reg & 0x20) { /* Disconnect */ DEB(printk("SYM53C500: disconnect intr received\n")); if (curSC->SCp.phase != message_in) { /* Unexpected disconnect */ - curSC->result = DID_NO_CONNECT << 16; + curSC->result.combined = DID_NO_CONNECT << 16; } else { /* Command complete, return status and message */ - curSC->result = (curSC->SCp.Status & 0xff) + curSC->result.combined = (curSC->SCp.Status & 0xff) | ((curSC->SCp.Message & 0xff) << 8) | (DID_OK << 16); } goto idle_out; diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index bffd9a9349e724..da42609e7c8cc9 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -822,7 +822,7 @@ static void pmcraid_erp_done(struct pmcraid_cmd *cmd) u32 ioasc = le32_to_cpu(cmd->ioa_cb->ioasa.ioasc); if (PMCRAID_IOASC_SENSE_KEY(ioasc) > 0) { - scsi_cmd->result |= (DID_ERROR << 16); + scsi_cmd->result.combined |= (DID_ERROR << 16); scmd_printk(KERN_INFO, scsi_cmd, "command CDB[0] = %x failed with IOASC: 0x%08X\n", cmd->ioa_cb->ioarcb.cdb[0], ioasc); @@ -2008,7 +2008,7 @@ static void pmcraid_fail_outstanding_cmds(struct pmcraid_instance *pinstance) struct scsi_cmnd *scsi_cmd = cmd->scsi_cmd; __le32 resp = cmd->ioa_cb->ioarcb.response_handle; - scsi_cmd->result |= DID_ERROR << 16; + scsi_cmd->result.combined |= DID_ERROR << 16; scsi_dma_unmap(scsi_cmd); pmcraid_return_cmd(cmd); @@ -2016,7 +2016,7 @@ static void pmcraid_fail_outstanding_cmds(struct pmcraid_instance *pinstance) pmcraid_info("failing(%d) CDB[0] = %x result: %x\n", le32_to_cpu(resp) >> 2, cmd->ioa_cb->ioarcb.cdb[0], - scsi_cmd->result); + scsi_cmd->result.combined); scsi_cmd->scsi_done(scsi_cmd); } else if (cmd->cmd_done == pmcraid_internal_done || cmd->cmd_done == pmcraid_erp_done) { @@ -2510,7 +2510,7 @@ static void pmcraid_frame_auto_sense(struct pmcraid_cmd *cmd) u32 failing_lba = 0; memset(sense_buf, 0, SCSI_SENSE_BUFFERSIZE); - cmd->scsi_cmd->result = SAM_STAT_CHECK_CONDITION; + cmd->scsi_cmd->result.combined = SAM_STAT_CHECK_CONDITION; if (RES_IS_VSET(res->cfg_entry) && ioasc == PMCRAID_IOASC_ME_READ_ERROR_NO_REALLOC && @@ -2605,21 +2605,21 @@ static int pmcraid_error_handler(struct pmcraid_cmd *cmd) switch (masked_ioasc) { case PMCRAID_IOASC_AC_TERMINATED_BY_HOST: - scsi_cmd->result |= (DID_ABORT << 16); + scsi_cmd->result.combined |= (DID_ABORT << 16); break; case PMCRAID_IOASC_IR_INVALID_RESOURCE_HANDLE: case PMCRAID_IOASC_HW_CANNOT_COMMUNICATE: - scsi_cmd->result |= (DID_NO_CONNECT << 16); + scsi_cmd->result.combined |= (DID_NO_CONNECT << 16); break; case PMCRAID_IOASC_NR_SYNC_REQUIRED: res->sync_reqd = 1; - scsi_cmd->result |= (DID_IMM_RETRY << 16); + scsi_cmd->result.combined |= (DID_IMM_RETRY << 16); break; case PMCRAID_IOASC_ME_READ_ERROR_NO_REALLOC: - scsi_cmd->result |= (DID_PASSTHROUGH << 16); + scsi_cmd->result.combined |= (DID_PASSTHROUGH << 16); break; case PMCRAID_IOASC_UA_BUS_WAS_RESET: @@ -2627,11 +2627,11 @@ static int pmcraid_error_handler(struct pmcraid_cmd *cmd) if (!res->reset_progress) scsi_report_bus_reset(pinstance->host, scsi_cmd->device->channel); - scsi_cmd->result |= (DID_ERROR << 16); + scsi_cmd->result.combined |= (DID_ERROR << 16); break; case PMCRAID_IOASC_HW_DEVICE_BUS_STATUS_ERROR: - scsi_cmd->result |= PMCRAID_IOASC_SENSE_STATUS(ioasc); + scsi_cmd->result.combined |= PMCRAID_IOASC_SENSE_STATUS(ioasc); res->sync_reqd = 1; /* if check_condition is not active return with error otherwise @@ -2670,7 +2670,7 @@ static int pmcraid_error_handler(struct pmcraid_cmd *cmd) default: if (PMCRAID_IOASC_SENSE_KEY(ioasc) > RECOVERED_ERROR) - scsi_cmd->result |= (DID_ERROR << 16); + scsi_cmd->result.combined |= (DID_ERROR << 16); break; } return 0; @@ -2807,7 +2807,7 @@ static int _pmcraid_io_done(struct pmcraid_cmd *cmd, int reslen, int ioasc) pmcraid_info("response(%d) CDB[0] = %x ioasc:result: %x:%x\n", le32_to_cpu(cmd->ioa_cb->ioarcb.response_handle) >> 2, cmd->ioa_cb->ioarcb.cdb[0], - ioasc, scsi_cmd->result); + ioasc, scsi_cmd->result.combined); if (PMCRAID_IOASC_SENSE_KEY(ioasc) != 0) rc = pmcraid_error_handler(cmd); @@ -3330,14 +3330,14 @@ static int pmcraid_queuecommand_lck( fw_version = be16_to_cpu(pinstance->inq_data->fw_version); scsi_cmd->scsi_done = done; res = scsi_cmd->device->hostdata; - scsi_cmd->result = (DID_OK << 16); + scsi_cmd->result.combined = (DID_OK << 16); /* if adapter is marked as dead, set result to DID_NO_CONNECT complete * the command */ if (pinstance->ioa_state == IOA_STATE_DEAD) { pmcraid_info("IOA is dead, but queuecommand is scheduled\n"); - scsi_cmd->result = (DID_NO_CONNECT << 16); + scsi_cmd->result.combined = (DID_NO_CONNECT << 16); scsi_cmd->scsi_done(scsi_cmd); return 0; } diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index aa41f7ac91cb7b..002490e0d8804c 100644 --- a/drivers/scsi/ppa.c +++ b/drivers/scsi/ppa.c @@ -164,7 +164,7 @@ static inline void ppa_fail(ppa_struct *dev, int error_code) { /* If we fail a device then we trash status / message bytes */ if (dev->cur_cmd) { - dev->cur_cmd->result = error_code << 16; + dev->cur_cmd->result.combined = error_code << 16; dev->failed = 1; } } @@ -625,7 +625,7 @@ static void ppa_interrupt(struct work_struct *work) } /* Command must of completed hence it is safe to let go... */ #if PPA_DEBUG > 0 - switch ((cmd->result >> 16) & 0xff) { + switch ((cmd->result.combined >> 16) & 0xff) { case DID_OK: break; case DID_NO_CONNECT: @@ -654,7 +654,7 @@ static void ppa_interrupt(struct work_struct *work) break; default: printk(KERN_WARNING "ppa: bad return code (%02x)\n", - (cmd->result >> 16) & 0xff); + (cmd->result.combined >> 16) & 0xff); } #endif @@ -765,7 +765,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd) fallthrough; case 6: /* Phase 6 - Read status/message */ - cmd->result = DID_OK << 16; + cmd->result.combined = DID_OK << 16; /* Check for data overrun */ if (ppa_wait(dev) != (unsigned char) 0xf0) { ppa_fail(dev, DID_ERROR); @@ -775,7 +775,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd) /* Check for optional message byte */ if (ppa_wait(dev) == (unsigned char) 0xf0) ppa_in(dev, &h, 1); - cmd->result = + cmd->result.combined = (DID_OK << 16) + (h << 8) + (l & STATUS_MASK); } return 0; /* Finished */ @@ -799,7 +799,7 @@ static int ppa_queuecommand_lck(struct scsi_cmnd *cmd, dev->jstart = jiffies; dev->cur_cmd = cmd; cmd->scsi_done = done; - cmd->result = DID_ERROR << 16; /* default return code */ + cmd->result.combined = DID_ERROR << 16; /* default return code */ cmd->SCp.phase = 0; /* bus free */ schedule_delayed_work(&dev->ppa_tq, 0); diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c index ccb5771f1cb714..0a9329505613ab 100644 --- a/drivers/scsi/ps3rom.c +++ b/drivers/scsi/ps3rom.c @@ -235,7 +235,7 @@ static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd, if (res) { memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); - cmd->result = res; + cmd->result.combined = res; cmd->sense_buffer[0] = 0x70; cmd->sense_buffer[2] = ILLEGAL_REQUEST; priv->curr_cmd = NULL; @@ -302,7 +302,7 @@ static irqreturn_t ps3rom_interrupt(int irq, void *data) scsi_set_resid(cmd, scsi_bufflen(cmd) - len); } - cmd->result = DID_OK << 16; + cmd->result.combined = DID_OK << 16; goto done; } @@ -310,17 +310,17 @@ static irqreturn_t ps3rom_interrupt(int irq, void *data) /* SCSI spec says request sense should never get error */ dev_err(&dev->sbd.core, "%s:%u: end error without autosense\n", __func__, __LINE__); - cmd->result = DID_ERROR << 16 | SAM_STAT_CHECK_CONDITION; + cmd->result.combined = DID_ERROR << 16 | SAM_STAT_CHECK_CONDITION; goto done; } if (decode_lv1_status(status, &sense_key, &asc, &ascq)) { - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; goto done; } scsi_build_sense_buffer(0, cmd->sense_buffer, sense_key, asc, ascq); - cmd->result = SAM_STAT_CHECK_CONDITION; + cmd->result.combined = SAM_STAT_CHECK_CONDITION; done: priv->curr_cmd = NULL; diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c index 4869ef813dc4ff..28c3a4ff78295e 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -825,7 +825,7 @@ static void qedf_trace_io(struct qedf_rport *fcport, struct qedf_ioreq *io_req, io_log->lba[3] = sc_cmd->cmnd[5]; io_log->bufflen = scsi_bufflen(sc_cmd); io_log->sg_count = scsi_sg_count(sc_cmd); - io_log->result = sc_cmd->result; + io_log->result.combined = sc_cmd->result; io_log->jiffies = jiffies; io_log->refcount = kref_read(&io_req->refcount); @@ -951,7 +951,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd) QEDF_ERR(&qedf->dbg_ctx, "Number of SG elements %d exceeds what hardware limitation of %d.\n", num_sgs, QEDF_MAX_BDS_PER_CMD); - sc_cmd->result = DID_ERROR; + sc_cmd->result.combined = DID_ERROR; sc_cmd->scsi_done(sc_cmd); return 0; } @@ -961,7 +961,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd) QEDF_INFO(&qedf->dbg_ctx, QEDF_LOG_IO, "Returning DNC as unloading or stop io, flags 0x%lx.\n", qedf->flags); - sc_cmd->result = DID_NO_CONNECT << 16; + sc_cmd->result.combined = DID_NO_CONNECT << 16; sc_cmd->scsi_done(sc_cmd); return 0; } @@ -970,7 +970,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd) QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, "Completing sc_cmd=%p DID_NO_CONNECT as MSI-X is not enabled.\n", sc_cmd); - sc_cmd->result = DID_NO_CONNECT << 16; + sc_cmd->result.combined = DID_NO_CONNECT << 16; sc_cmd->scsi_done(sc_cmd); return 0; } @@ -980,7 +980,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd) QEDF_INFO(&qedf->dbg_ctx, QEDF_LOG_IO, "fc_remote_port_chkready failed=0x%x for port_id=0x%06x.\n", rval, rport->port_id); - sc_cmd->result = rval; + sc_cmd->result.combined = rval; sc_cmd->scsi_done(sc_cmd); return 0; } @@ -1204,7 +1204,7 @@ void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe, "FCP I/O protocol failure xid=0x%x fcp_rsp_len=%d " "fcp_rsp_code=%d.\n", io_req->xid, io_req->fcp_rsp_len, io_req->fcp_rsp_code); - sc_cmd->result = DID_BUS_BUSY << 16; + sc_cmd->result.combined = DID_BUS_BUSY << 16; goto out; } @@ -1219,9 +1219,9 @@ void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe, sc_cmd->cmnd[3], sc_cmd->cmnd[4], sc_cmd->cmnd[5]); if (io_req->cdb_status == 0) - sc_cmd->result = (DID_ERROR << 16) | io_req->cdb_status; + sc_cmd->result.combined = (DID_ERROR << 16) | io_req->cdb_status; else - sc_cmd->result = (DID_OK << 16) | io_req->cdb_status; + sc_cmd->result.combined = (DID_OK << 16) | io_req->cdb_status; /* * Set resid to the whole buffer length so we won't try to resue @@ -1235,7 +1235,7 @@ void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe, case FC_GOOD: if (io_req->cdb_status == 0) { /* Good I/O completion */ - sc_cmd->result = DID_OK << 16; + sc_cmd->result.combined = DID_OK << 16; } else { refcount = kref_read(&io_req->refcount); QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, @@ -1248,7 +1248,7 @@ void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe, sc_cmd->cmnd[4], sc_cmd->cmnd[5], io_req->cdb_status, io_req->fcp_resid, refcount); - sc_cmd->result = (DID_OK << 16) | io_req->cdb_status; + sc_cmd->result.combined = (DID_OK << 16) | io_req->cdb_status; if (io_req->cdb_status == SAM_STAT_TASK_SET_FULL || io_req->cdb_status == SAM_STAT_BUSY) { @@ -1406,13 +1406,14 @@ void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req, qedf_unmap_sg_list(qedf, io_req); - sc_cmd->result = result << 16; + sc_cmd->result.combined = result << 16; refcount = kref_read(&io_req->refcount); QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, "%d:0:%d:%lld: Completing " "sc_cmd=%p result=0x%08x op=0x%02x lba=0x%02x%02x%02x%02x, " "allowed=%d retries=%d refcount=%d.\n", qedf->lport->host->host_no, sc_cmd->device->id, - sc_cmd->device->lun, sc_cmd, sc_cmd->result, sc_cmd->cmnd[0], + sc_cmd->device->lun, sc_cmd, sc_cmd->result.combined, + sc_cmd->cmnd[0], sc_cmd->cmnd[2], sc_cmd->cmnd[3], sc_cmd->cmnd[4], sc_cmd->cmnd[5], sc_cmd->allowed, sc_cmd->retries, refcount); diff --git a/drivers/scsi/qedi/qedi_fw.c b/drivers/scsi/qedi/qedi_fw.c index 440ddd2309f1dd..c37dd54c9c94fc 100644 --- a/drivers/scsi/qedi/qedi_fw.c +++ b/drivers/scsi/qedi/qedi_fw.c @@ -2016,7 +2016,7 @@ void qedi_trace_io(struct qedi_ctx *qedi, struct iscsi_task *task, io_log->cached_sge = qedi->use_cached_sge; io_log->slow_sge = qedi->use_slow_sge; io_log->fast_sge = qedi->use_fast_sge; - io_log->result = sc_cmd->result; + io_log->result.combined = sc_cmd->result; io_log->jiffies = jiffies; io_log->blk_req_cpu = smp_processor_id(); diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index 8f35174a1f9aff..0720b549b03b91 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c @@ -488,7 +488,7 @@ __setup("qla1280=", qla1280_setup); #define CMD_CDBP(Cmnd) Cmnd->cmnd #define CMD_SNSP(Cmnd) Cmnd->sense_buffer #define CMD_SNSLEN(Cmnd) SCSI_SENSE_BUFFERSIZE -#define CMD_RESULT(Cmnd) Cmnd->result +#define CMD_RESULT(Cmnd) Cmnd->result.combined #define CMD_HANDLE(Cmnd) Cmnd->host_scribble #define CMD_REQUEST(Cmnd) Cmnd->request->cmd diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 38b5bdde240553..e2a6d3a8711ca0 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -2123,13 +2123,13 @@ qla2xxx_dif_start_scsi_mq(srb_t *sp) /* Check for host side state */ if (!qpair->online) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; return QLA_INTERFACE_ERROR; } if (!qpair->difdix_supported && scsi_get_prot_op(cmd) != SCSI_PROT_NORMAL) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; return QLA_INTERFACE_ERROR; } diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 11d6e0db07fedc..41bec0b5ce542b 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -2578,7 +2578,7 @@ qla2x00_handle_sense(srb_t *sp, uint8_t *sense_data, uint32_t par_sense_len, if (track_sense_len != 0) { rsp->status_srb = sp; - cp->result = res; + cp->result.combined = res; } if (sense_len) { @@ -2653,7 +2653,7 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24) cmd->device->sector_size); scsi_set_resid(cmd, resid); - cmd->result = DID_OK << 16; + cmd->result.combined = DID_OK << 16; /* Update protection tag */ if (scsi_prot_sg_count(cmd)) { @@ -2698,7 +2698,7 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24) 0x10, 0x1); set_driver_byte(cmd, DRIVER_SENSE); set_host_byte(cmd, DID_ABORT); - cmd->result |= SAM_STAT_CHECK_CONDITION; + cmd->result.combined |= SAM_STAT_CHECK_CONDITION; return 1; } @@ -2708,7 +2708,7 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24) 0x10, 0x3); set_driver_byte(cmd, DRIVER_SENSE); set_host_byte(cmd, DID_ABORT); - cmd->result |= SAM_STAT_CHECK_CONDITION; + cmd->result.combined |= SAM_STAT_CHECK_CONDITION; return 1; } @@ -2718,7 +2718,7 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24) 0x10, 0x2); set_driver_byte(cmd, DRIVER_SENSE); set_host_byte(cmd, DID_ABORT); - cmd->result |= SAM_STAT_CHECK_CONDITION; + cmd->result.combined |= SAM_STAT_CHECK_CONDITION; return 1; } @@ -3216,7 +3216,7 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) case CS_DIF_ERROR: logit = qla2x00_handle_dif_error(sp, sts24); - res = cp->result; + res = cp->result.combined; break; case CS_TRANSPORT: @@ -3317,7 +3317,7 @@ qla2x00_status_cont_entry(struct rsp_que *rsp, sts_cont_entry_t *pkt) /* Place command on done queue. */ if (sense_len == 0) { rsp->status_srb = NULL; - sp->done(sp, cp->result); + sp->done(sp, cp->result.combined); } } diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c index 6e920da64863ee..c1ad2b6655c261 100644 --- a/drivers/scsi/qla2xxx/qla_mr.c +++ b/drivers/scsi/qla2xxx/qla_mr.c @@ -2154,7 +2154,7 @@ qlafx00_handle_sense(srb_t *sp, uint8_t *sense_data, uint32_t par_sense_len, sense_len, par_sense_len, track_sense_len); if (GET_FW_SENSE_LEN(sp) > 0) { rsp->status_srb = sp; - cp->result = res; + cp->result.combined = res; } if (sense_len) { @@ -2612,7 +2612,7 @@ qlafx00_status_cont_entry(struct rsp_que *rsp, sts_cont_entry_t *pkt) /* Place command on done queue. */ if (sense_len == 0) { rsp->status_srb = NULL; - sp->done(sp, cp->result); + sp->done(sp, cp->result.combined); } else { WARN_ON_ONCE(true); } diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 12959e3874cb3d..885e7bd384117b 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -729,7 +729,7 @@ void qla2x00_sp_compl(srb_t *sp, int res) struct completion *comp = sp->comp; sp->free(sp); - cmd->result = res; + cmd->result.combined = res; CMD_SP(cmd) = NULL; cmd->scsi_done(cmd); if (comp) @@ -820,7 +820,7 @@ void qla2xxx_qpair_sp_compl(srb_t *sp, int res) struct completion *comp = sp->comp; sp->free(sp); - cmd->result = res; + cmd->result.combined = res; CMD_SP(cmd) = NULL; cmd->scsi_done(cmd); if (comp) @@ -840,7 +840,7 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) if (unlikely(test_bit(UNLOADING, &base_vha->dpc_flags)) || WARN_ON_ONCE(!rport)) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; goto qc24_fail_command; } @@ -862,18 +862,18 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) ql_dbg(ql_dbg_aer, vha, 0x9010, "PCI Channel IO permanent failure, exiting " "cmd=%p.\n", cmd); - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; } else { ql_dbg(ql_dbg_aer, vha, 0x9011, "EEH_Busy, Requeuing the cmd=%p.\n", cmd); - cmd->result = DID_REQUEUE << 16; + cmd->result.combined = DID_REQUEUE << 16; } goto qc24_fail_command; } rval = fc_remote_port_chkready(rport); if (rval) { - cmd->result = rval; + cmd->result.combined = rval; ql_dbg(ql_dbg_io + ql_dbg_verbose, vha, 0x3003, "fc_remote_port_chkready failed for cmd=%p, rval=0x%x.\n", cmd, rval); @@ -885,12 +885,12 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) ql_dbg(ql_dbg_io, vha, 0x3004, "DIF Cap not reg, fail DIF capable cmd's:%p.\n", cmd); - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; goto qc24_fail_command; } if (!fcport || fcport->deleted) { - cmd->result = DID_IMM_RETRY << 16; + cmd->result.combined = DID_IMM_RETRY << 16; goto qc24_fail_command; } @@ -901,7 +901,7 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) "Returning DNC, fcport_state=%d loop_state=%d.\n", atomic_read(&fcport->state), atomic_read(&base_vha->loop_state)); - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; goto qc24_fail_command; } goto qc24_target_busy; @@ -964,7 +964,7 @@ qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd, rval = rport ? fc_remote_port_chkready(rport) : (DID_NO_CONNECT << 16); if (rval) { - cmd->result = rval; + cmd->result.combined = rval; ql_dbg(ql_dbg_io + ql_dbg_verbose, vha, 0x3076, "fc_remote_port_chkready failed for cmd=%p, rval=0x%x.\n", cmd, rval); @@ -974,12 +974,12 @@ qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd, if (!qpair->online) { ql_dbg(ql_dbg_io, vha, 0x3077, "qpair not online. eeh_busy=%d.\n", ha->flags.eeh_busy); - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; goto qc24_fail_command; } if (!fcport || fcport->deleted) { - cmd->result = DID_IMM_RETRY << 16; + cmd->result.combined = DID_IMM_RETRY << 16; goto qc24_fail_command; } @@ -990,7 +990,7 @@ qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd, "Returning DNC, fcport_state=%d loop_state=%d.\n", atomic_read(&fcport->state), atomic_read(&base_vha->loop_state)); - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; goto qc24_fail_command; } goto qc24_target_busy; diff --git a/drivers/scsi/qla4xxx/ql4_bsg.c b/drivers/scsi/qla4xxx/ql4_bsg.c index c447a9d598a172..5f7074da9643ce 100644 --- a/drivers/scsi/qla4xxx/ql4_bsg.c +++ b/drivers/scsi/qla4xxx/ql4_bsg.c @@ -55,17 +55,17 @@ qla4xxx_read_flash(struct bsg_job *bsg_job) rval = qla4xxx_get_flash(ha, flash_dma, offset, length); if (rval) { ql4_printk(KERN_ERR, ha, "%s: get flash failed\n", __func__); - bsg_reply->result = DID_ERROR << 16; + bsg_reply->result.combined = DID_ERROR << 16; rval = -EIO; } else { bsg_reply->reply_payload_rcv_len = sg_copy_from_buffer(bsg_job->reply_payload.sg_list, bsg_job->reply_payload.sg_cnt, flash, length); - bsg_reply->result = DID_OK << 16; + bsg_reply->result.combined = DID_OK << 16; } - bsg_job_done(bsg_job, bsg_reply->result, + bsg_job_done(bsg_job, bsg_reply->result.combined, bsg_reply->reply_payload_rcv_len); dma_free_coherent(&ha->pdev->dev, length, flash, flash_dma); leave: @@ -125,12 +125,12 @@ qla4xxx_update_flash(struct bsg_job *bsg_job) rval = qla4xxx_set_flash(ha, flash_dma, offset, length, options); if (rval) { ql4_printk(KERN_ERR, ha, "%s: set flash failed\n", __func__); - bsg_reply->result = DID_ERROR << 16; + bsg_reply->result.combined = DID_ERROR << 16; rval = -EIO; } else - bsg_reply->result = DID_OK << 16; + bsg_reply->result.combined = DID_OK << 16; - bsg_job_done(bsg_job, bsg_reply->result, + bsg_job_done(bsg_job, bsg_reply->result.combined, bsg_reply->reply_payload_rcv_len); dma_free_coherent(&ha->pdev->dev, length, flash, flash_dma); leave: @@ -179,17 +179,17 @@ qla4xxx_get_acb_state(struct bsg_job *bsg_job) if (rval) { ql4_printk(KERN_ERR, ha, "%s: get ip state failed\n", __func__); - bsg_reply->result = DID_ERROR << 16; + bsg_reply->result.combined = DID_ERROR << 16; rval = -EIO; } else { bsg_reply->reply_payload_rcv_len = sg_copy_from_buffer(bsg_job->reply_payload.sg_list, bsg_job->reply_payload.sg_cnt, status, sizeof(status)); - bsg_reply->result = DID_OK << 16; + bsg_reply->result.combined = DID_OK << 16; } - bsg_job_done(bsg_job, bsg_reply->result, + bsg_job_done(bsg_job, bsg_reply->result.combined, bsg_reply->reply_payload_rcv_len); leave: return rval; @@ -250,17 +250,17 @@ qla4xxx_read_nvram(struct bsg_job *bsg_job) rval = qla4xxx_get_nvram(ha, nvram_dma, offset, len); if (rval) { ql4_printk(KERN_ERR, ha, "%s: get nvram failed\n", __func__); - bsg_reply->result = DID_ERROR << 16; + bsg_reply->result.combined = DID_ERROR << 16; rval = -EIO; } else { bsg_reply->reply_payload_rcv_len = sg_copy_from_buffer(bsg_job->reply_payload.sg_list, bsg_job->reply_payload.sg_cnt, nvram, len); - bsg_reply->result = DID_OK << 16; + bsg_reply->result.combined = DID_OK << 16; } - bsg_job_done(bsg_job, bsg_reply->result, + bsg_job_done(bsg_job, bsg_reply->result.combined, bsg_reply->reply_payload_rcv_len); dma_free_coherent(&ha->pdev->dev, len, nvram, nvram_dma); leave: @@ -324,12 +324,12 @@ qla4xxx_update_nvram(struct bsg_job *bsg_job) rval = qla4xxx_set_nvram(ha, nvram_dma, offset, len); if (rval) { ql4_printk(KERN_ERR, ha, "%s: set nvram failed\n", __func__); - bsg_reply->result = DID_ERROR << 16; + bsg_reply->result.combined = DID_ERROR << 16; rval = -EIO; } else - bsg_reply->result = DID_OK << 16; + bsg_reply->result.combined = DID_OK << 16; - bsg_job_done(bsg_job, bsg_reply->result, + bsg_job_done(bsg_job, bsg_reply->result.combined, bsg_reply->reply_payload_rcv_len); dma_free_coherent(&ha->pdev->dev, len, nvram, nvram_dma); leave: @@ -369,12 +369,12 @@ qla4xxx_restore_defaults(struct bsg_job *bsg_job) rval = qla4xxx_restore_factory_defaults(ha, region, field0, field1); if (rval) { ql4_printk(KERN_ERR, ha, "%s: set nvram failed\n", __func__); - bsg_reply->result = DID_ERROR << 16; + bsg_reply->result.combined = DID_ERROR << 16; rval = -EIO; } else - bsg_reply->result = DID_OK << 16; + bsg_reply->result.combined = DID_OK << 16; - bsg_job_done(bsg_job, bsg_reply->result, + bsg_job_done(bsg_job, bsg_reply->result.combined, bsg_reply->reply_payload_rcv_len); leave: return rval; @@ -428,17 +428,17 @@ qla4xxx_bsg_get_acb(struct bsg_job *bsg_job) rval = qla4xxx_get_acb(ha, acb_dma, acb_type, len); if (rval) { ql4_printk(KERN_ERR, ha, "%s: get acb failed\n", __func__); - bsg_reply->result = DID_ERROR << 16; + bsg_reply->result.combined = DID_ERROR << 16; rval = -EIO; } else { bsg_reply->reply_payload_rcv_len = sg_copy_from_buffer(bsg_job->reply_payload.sg_list, bsg_job->reply_payload.sg_cnt, acb, len); - bsg_reply->result = DID_OK << 16; + bsg_reply->result.combined = DID_OK << 16; } - bsg_job_done(bsg_job, bsg_reply->result, + bsg_job_done(bsg_job, bsg_reply->result.combined, bsg_reply->reply_payload_rcv_len); dma_free_coherent(&ha->pdev->dev, len, acb, acb_dma); leave: @@ -461,7 +461,7 @@ static void ql4xxx_execute_diag_cmd(struct bsg_job *bsg_job) if (test_bit(DPC_RESET_HA, &ha->dpc_flags)) { ql4_printk(KERN_INFO, ha, "%s: Adapter reset in progress. Invalid Request\n", __func__); - bsg_reply->result = DID_ERROR << 16; + bsg_reply->result.combined = DID_ERROR << 16; goto exit_diag_mem_test; } @@ -485,9 +485,9 @@ static void ql4xxx_execute_diag_cmd(struct bsg_job *bsg_job) mbox_sts[7])); if (status == QLA_SUCCESS) - bsg_reply->result = DID_OK << 16; + bsg_reply->result.combined = DID_OK << 16; else - bsg_reply->result = DID_ERROR << 16; + bsg_reply->result.combined = DID_ERROR << 16; /* Send mbox_sts to application */ bsg_job->reply_len = sizeof(struct iscsi_bsg_reply) + sizeof(mbox_sts); @@ -497,9 +497,9 @@ static void ql4xxx_execute_diag_cmd(struct bsg_job *bsg_job) exit_diag_mem_test: DEBUG2(ql4_printk(KERN_INFO, ha, "%s: bsg_reply->result = x%x, status = %s\n", - __func__, bsg_reply->result, STATUS(status))); + __func__, bsg_reply->result.combined, STATUS(status))); - bsg_job_done(bsg_job, bsg_reply->result, + bsg_job_done(bsg_job, bsg_reply->result.combined, bsg_reply->reply_payload_rcv_len); } @@ -668,14 +668,14 @@ static void qla4xxx_execute_diag_loopback_cmd(struct bsg_job *bsg_job) if (test_bit(AF_LOOPBACK, &ha->flags)) { ql4_printk(KERN_INFO, ha, "%s: Loopback Diagnostics already in progress. Invalid Request\n", __func__); - bsg_reply->result = DID_ERROR << 16; + bsg_reply->result.combined = DID_ERROR << 16; goto exit_loopback_cmd; } if (test_bit(DPC_RESET_HA, &ha->dpc_flags)) { ql4_printk(KERN_INFO, ha, "%s: Adapter reset in progress. Invalid Request\n", __func__); - bsg_reply->result = DID_ERROR << 16; + bsg_reply->result.combined = DID_ERROR << 16; goto exit_loopback_cmd; } @@ -685,14 +685,14 @@ static void qla4xxx_execute_diag_loopback_cmd(struct bsg_job *bsg_job) if (is_qla8032(ha) || is_qla8042(ha)) { status = qla4_83xx_pre_loopback_config(ha, mbox_cmd); if (status != QLA_SUCCESS) { - bsg_reply->result = DID_ERROR << 16; + bsg_reply->result.combined = DID_ERROR << 16; goto exit_loopback_cmd; } status = qla4_83xx_wait_for_loopback_config_comp(ha, wait_for_link); if (status != QLA_SUCCESS) { - bsg_reply->result = DID_TIME_OUT << 16; + bsg_reply->result.combined = DID_TIME_OUT << 16; goto restore; } } @@ -707,9 +707,9 @@ static void qla4xxx_execute_diag_loopback_cmd(struct bsg_job *bsg_job) &mbox_sts[0]); if (status == QLA_SUCCESS) - bsg_reply->result = DID_OK << 16; + bsg_reply->result.combined = DID_OK << 16; else - bsg_reply->result = DID_ERROR << 16; + bsg_reply->result.combined = DID_ERROR << 16; DEBUG2(ql4_printk(KERN_INFO, ha, "%s: mbox_sts: %08X %08X %08X %08X %08X %08X %08X %08X\n", @@ -725,7 +725,7 @@ static void qla4xxx_execute_diag_loopback_cmd(struct bsg_job *bsg_job) if (is_qla8032(ha) || is_qla8042(ha)) { status = qla4_83xx_post_loopback_config(ha, mbox_cmd); if (status != QLA_SUCCESS) { - bsg_reply->result = DID_ERROR << 16; + bsg_reply->result.combined = DID_ERROR << 16; goto exit_loopback_cmd; } @@ -737,15 +737,15 @@ static void qla4xxx_execute_diag_loopback_cmd(struct bsg_job *bsg_job) status = qla4_83xx_wait_for_loopback_config_comp(ha, wait_for_link); if (status != QLA_SUCCESS) { - bsg_reply->result = DID_TIME_OUT << 16; + bsg_reply->result.combined = DID_TIME_OUT << 16; goto exit_loopback_cmd; } } exit_loopback_cmd: DEBUG2(ql4_printk(KERN_INFO, ha, "%s: bsg_reply->result = x%x, status = %s\n", - __func__, bsg_reply->result, STATUS(status))); - bsg_job_done(bsg_job, bsg_reply->result, + __func__, bsg_reply->result.combined, STATUS(status))); + bsg_job_done(bsg_job, bsg_reply->result.combined, bsg_reply->reply_payload_rcv_len); } @@ -841,9 +841,9 @@ int qla4xxx_process_vendor_specific(struct bsg_job *bsg_job) default: ql4_printk(KERN_ERR, ha, "%s: invalid BSG vendor command: " "0x%x\n", __func__, bsg_req->msgcode); - bsg_reply->result = (DID_ERROR << 16); + bsg_reply->result.combined = (DID_ERROR << 16); bsg_reply->reply_payload_rcv_len = 0; - bsg_job_done(bsg_job, bsg_reply->result, + bsg_job_done(bsg_job, bsg_reply->result.combined, bsg_reply->reply_payload_rcv_len); return -ENOSYS; } diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c index 6f0e77dc2a3408..7a3ee6ec09c8cd 100644 --- a/drivers/scsi/qla4xxx/ql4_isr.c +++ b/drivers/scsi/qla4xxx/ql4_isr.c @@ -145,7 +145,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha, ddb_entry = srb->ddb; if (ddb_entry == NULL) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; goto status_entry_exit; } @@ -157,7 +157,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha, case SCS_COMPLETE: if (sts_entry->iscsiFlags & ISCSI_FLAG_RESIDUAL_OVER) { - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; break; } @@ -166,7 +166,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha, if (!scsi_status && ((scsi_bufflen(cmd) - residual) < cmd->underflow)) { - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; DEBUG2(printk("scsi%ld:%d:%d:%llu: %s: " "Mid-layer Data underrun0, " @@ -180,7 +180,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha, } } - cmd->result = DID_OK << 16 | scsi_status; + cmd->result.combined = DID_OK << 16 | scsi_status; if (scsi_status != SAM_STAT_CHECK_CONDITION) break; @@ -192,7 +192,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha, case SCS_INCOMPLETE: /* Always set the status to DID_ERROR, since * all conditions result in that status anyway */ - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; break; case SCS_RESET_OCCURRED: @@ -200,7 +200,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha, ha->host_no, cmd->device->channel, cmd->device->id, cmd->device->lun, __func__)); - cmd->result = DID_RESET << 16; + cmd->result.combined = DID_RESET << 16; break; case SCS_ABORTED: @@ -208,7 +208,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha, ha->host_no, cmd->device->channel, cmd->device->id, cmd->device->lun, __func__)); - cmd->result = DID_RESET << 16; + cmd->result.combined = DID_RESET << 16; break; case SCS_TIMEOUT: @@ -216,7 +216,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha, ha->host_no, cmd->device->channel, cmd->device->id, cmd->device->lun)); - cmd->result = DID_TRANSPORT_DISRUPTED << 16; + cmd->result.combined = DID_TRANSPORT_DISRUPTED << 16; /* * Mark device missing so that we won't continue to send @@ -236,7 +236,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha, cmd->device->channel, cmd->device->id, cmd->device->lun, __func__)); - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; break; } @@ -266,7 +266,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha, scsi_bufflen(cmd), residual)); - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; break; } @@ -298,11 +298,11 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha, residual, scsi_bufflen(cmd))); - cmd->result = DID_ERROR << 16 | scsi_status; + cmd->result.combined = DID_ERROR << 16 | scsi_status; goto check_scsi_status; } - cmd->result = DID_OK << 16 | scsi_status; + cmd->result.combined = DID_OK << 16 | scsi_status; check_scsi_status: if (scsi_status == SAM_STAT_CHECK_CONDITION) @@ -324,14 +324,14 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha, if (iscsi_is_session_online(ddb_entry->sess)) qla4xxx_mark_device_missing(ddb_entry->sess); - cmd->result = DID_TRANSPORT_DISRUPTED << 16; + cmd->result.combined = DID_TRANSPORT_DISRUPTED << 16; break; case SCS_QUEUE_FULL: /* * SCSI Mid-Layer handles device queue full */ - cmd->result = DID_OK << 16 | sts_entry->scsiStatus; + cmd->result.combined = DID_OK << 16 | sts_entry->scsiStatus; DEBUG2(printk("scsi%ld:%d:%llu: %s: QUEUE FULL detected " "compl=%02x, scsi=%02x, state=%02x, iFlags=%02x," " iResp=%02x\n", ha->host_no, cmd->device->id, @@ -343,7 +343,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha, break; default: - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; break; } @@ -529,7 +529,7 @@ void qla4xxx_process_response_queue(struct scsi_qla_host *ha) /* ETRY normally by sending it back with * DID_BUS_BUSY */ - srb->cmd->result = DID_BUS_BUSY << 16; + srb->cmd->result.combined = DID_BUS_BUSY << 16; kref_put(&srb->srb_ref, qla4xxx_srb_compl); break; diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 867730ed21f7ec..363dc6a3908da0 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -4106,20 +4106,20 @@ static int qla4xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) if (test_bit(AF_EEH_BUSY, &ha->flags)) { if (test_bit(AF_PCI_CHANNEL_IO_PERM_FAILURE, &ha->flags)) - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; else - cmd->result = DID_REQUEUE << 16; + cmd->result.combined = DID_REQUEUE << 16; goto qc_fail_command; } if (!sess) { - cmd->result = DID_IMM_RETRY << 16; + cmd->result.combined = DID_IMM_RETRY << 16; goto qc_fail_command; } rval = iscsi_session_chkready(sess); if (rval) { - cmd->result = rval; + cmd->result.combined = rval; goto qc_fail_command; } @@ -4805,7 +4805,7 @@ static void qla4xxx_abort_active_cmds(struct scsi_qla_host *ha, int res) for (i = 0; i < ha->host->can_queue; i++) { srb = qla4xxx_del_from_active_array(ha, i); if (srb != NULL) { - srb->cmd->result = res; + srb->cmd->result.combined = res; kref_put(&srb->srb_ref, qla4xxx_srb_compl); } } @@ -9292,7 +9292,7 @@ static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd) "scsi%ld: DEVICE_RESET cmd=%p jiffies = 0x%lx, to=%x," "dpc_flags=%lx, status=%x allowed=%d\n", ha->host_no, cmd, jiffies, cmd->request->timeout / HZ, - ha->dpc_flags, cmd->result, cmd->allowed)); + ha->dpc_flags, cmd->result.combined, cmd->allowed)); rval = qla4xxx_isp_check_reg(ha); if (rval != QLA_SUCCESS) { @@ -9359,7 +9359,7 @@ static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd) "scsi%ld: TARGET_DEVICE_RESET cmd=%p jiffies = 0x%lx, " "to=%x,dpc_flags=%lx, status=%x allowed=%d\n", ha->host_no, cmd, jiffies, cmd->request->timeout / HZ, - ha->dpc_flags, cmd->result, cmd->allowed)); + ha->dpc_flags, cmd->result.combined, cmd->allowed)); rval = qla4xxx_isp_check_reg(ha); if (rval != QLA_SUCCESS) { diff --git a/drivers/scsi/qlogicfas408.c b/drivers/scsi/qlogicfas408.c index 136681ad18a5e9..4bca5302a4209f 100644 --- a/drivers/scsi/qlogicfas408.c +++ b/drivers/scsi/qlogicfas408.c @@ -415,7 +415,7 @@ static void ql_ihandl(void *dev_id) return; } icmd = priv->qlcmd; - icmd->result = ql_pcmd(icmd); + icmd->result.combined = ql_pcmd(icmd); priv->qlcmd = NULL; /* * If result is CHECK CONDITION done calls qcommand to request @@ -444,7 +444,7 @@ static int qlogicfas408_queuecommand_lck(struct scsi_cmnd *cmd, { struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd); if (scmd_id(cmd) == priv->qinitid) { - cmd->result = DID_BAD_TARGET << 16; + cmd->result.combined = DID_BAD_TARGET << 16; done(cmd); return 0; } diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c index d84e218d32cbaf..ab257b8716a339 100644 --- a/drivers/scsi/qlogicpti.c +++ b/drivers/scsi/qlogicpti.c @@ -1057,7 +1057,7 @@ static int qlogicpti_queuecommand_lck(struct scsi_cmnd *Cmnd, void (*done)(struc * we don't, the midlayer will ignore the return value, * which is insane. We pick up the pieces like this. */ - Cmnd->result = DID_BUS_BUSY; + Cmnd->result.combined = DID_BUS_BUSY; done(Cmnd); return 1; } @@ -1180,10 +1180,10 @@ static struct scsi_cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti) SCSI_SENSE_BUFFERSIZE); if (sts->hdr.entry_type == ENTRY_STATUS) - Cmnd->result = + Cmnd->result.combined = qlogicpti_return_status(sts, qpti->qpti_id); else - Cmnd->result = DID_ERROR << 16; + Cmnd->result.combined = DID_ERROR << 16; if (scsi_bufflen(Cmnd)) dma_unmap_sg(&qpti->op->dev, diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index e9e2f0e15ac85e..4f538a9a6fc4f2 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -140,7 +140,7 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition) if (unlikely(scsi_logging_level)) { level = SCSI_LOG_LEVEL(SCSI_LOG_MLCOMPLETE_SHIFT, SCSI_LOG_MLCOMPLETE_BITS); - if (((level > 0) && (cmd->result || disposition != SUCCESS)) || + if (((level > 0) && (cmd->result.combined || disposition != SUCCESS)) || (level > 1)) { scsi_print_result(cmd, "Done", disposition); scsi_print_command(cmd); @@ -190,11 +190,11 @@ void scsi_finish_command(struct scsi_cmnd *cmd) * must have taken place. Make a note of this. */ if (SCSI_SENSE_VALID(cmd)) - cmd->result |= (DRIVER_SENSE << 24); + cmd->result.combined |= (DRIVER_SENSE << 24); SCSI_LOG_MLCOMPLETE(4, sdev_printk(KERN_INFO, sdev, "Notifying upper driver of completion " - "(result %x)\n", cmd->result)); + "(result %x)\n", cmd->result.combined)); good_bytes = scsi_bufflen(cmd); if (!blk_rq_is_passthrough(cmd->request)) { @@ -767,6 +767,9 @@ static int __init init_scsi(void) { int error; + BUILD_BUG_ON(sizeof(struct scsi_status) != 4); + BUILD_BUG_ON(((struct scsi_status){.b = {.status = 4, .msg = 3, + .host = 2, .driver = 1}}.combined != 0x01020304)); error = scsi_init_procfs(); if (error) goto cleanup_queue; diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 70165be10f008e..85c4d46431996a 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -5458,24 +5458,24 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, ns_from_boot = ktime_get_boottime_ns(); /* one of the resp_*() response functions is called here */ - cmnd->result = pfp ? pfp(cmnd, devip) : 0; - if (cmnd->result & SDEG_RES_IMMED_MASK) { - cmnd->result &= ~SDEG_RES_IMMED_MASK; + cmnd->result.combined = pfp ? pfp(cmnd, devip) : 0; + if (cmnd->result.combined & SDEG_RES_IMMED_MASK) { + cmnd->result.combined &= ~SDEG_RES_IMMED_MASK; delta_jiff = ndelay = 0; } - if (cmnd->result == 0 && scsi_result != 0) - cmnd->result = scsi_result; - if (cmnd->result == 0 && unlikely(sdebug_opts & SDEBUG_OPT_TRANSPORT_ERR)) { + if (cmnd->result.combined == 0 && scsi_result != 0) + cmnd->result.combined = scsi_result; + if (cmnd->result.combined == 0 && unlikely(sdebug_opts & SDEBUG_OPT_TRANSPORT_ERR)) { if (atomic_read(&sdeb_inject_pending)) { mk_sense_buffer(cmnd, ABORTED_COMMAND, TRANSPORT_PROBLEM, ACK_NAK_TO); atomic_set(&sdeb_inject_pending, 0); - cmnd->result = check_condition_result; + cmnd->result.combined = check_condition_result; } } - if (unlikely(sdebug_verbose && cmnd->result)) + if (unlikely(sdebug_verbose && cmnd->result.combined)) sdev_printk(KERN_INFO, sdp, "%s: non-zero result=0x%x\n", - __func__, cmnd->result); + __func__, cmnd->result.combined); if (delta_jiff > 0 || ndelay > 0) { ktime_t kt; @@ -5582,10 +5582,10 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, return 0; respond_in_thread: /* call back to mid-layer using invocation thread */ - cmnd->result = pfp != NULL ? pfp(cmnd, devip) : 0; - cmnd->result &= ~SDEG_RES_IMMED_MASK; - if (cmnd->result == 0 && scsi_result != 0) - cmnd->result = scsi_result; + cmnd->result.combined = pfp != NULL ? pfp(cmnd, devip) : 0; + cmnd->result.combined &= ~SDEG_RES_IMMED_MASK; + if (cmnd->result.combined == 0 && scsi_result != 0) + cmnd->result.combined = scsi_result; cmnd->scsi_done(cmnd); return 0; } diff --git a/drivers/scsi/scsi_debugfs.c b/drivers/scsi/scsi_debugfs.c index c19ea7ab54cbd2..e8ceda0b356717 100644 --- a/drivers/scsi/scsi_debugfs.c +++ b/drivers/scsi/scsi_debugfs.c @@ -42,7 +42,7 @@ void scsi_show_rq(struct seq_file *m, struct request *rq) if (cdb) __scsi_format_command(buf, sizeof(buf), cdb, cmd->cmd_len); seq_printf(m, ", .cmd=%s, .retries=%d, .result = %#x, .flags=", buf, - cmd->retries, cmd->result); + cmd->retries, cmd->result.combined); scsi_flags_show(m, cmd->flags, scsi_cmd_flags, ARRAY_SIZE(scsi_cmd_flags)); seq_printf(m, ", .timeout=%d.%03d, allocated %d.%03d s ago", diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 08c06c56331c82..f0346c95a87312 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -793,7 +793,7 @@ static void scsi_eh_done(struct scsi_cmnd *scmd) struct completion *eh_action; SCSI_LOG_ERROR_RECOVERY(3, scmd_printk(KERN_INFO, scmd, - "%s result: %x\n", __func__, scmd->result)); + "%s result: %x\n", __func__, scmd->result.combined)); eh_action = scmd->device->host->eh_action; if (eh_action) @@ -997,7 +997,7 @@ void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd, struct scsi_eh_save *ses, scmd->cmnd = ses->eh_cmnd; memset(scmd->cmnd, 0, BLK_MAX_CDB); memset(&scmd->sdb, 0, sizeof(scmd->sdb)); - scmd->result = 0; + scmd->result.combined = 0; scmd->req.resid_len = 0; if (sense_bytes) { @@ -1274,7 +1274,7 @@ int scsi_eh_get_sense(struct list_head *work_q, continue; SCSI_LOG_ERROR_RECOVERY(3, scmd_printk(KERN_INFO, scmd, - "sense requested, result %x\n", scmd->result)); + "sense requested, result %x\n", scmd->result.combined)); SCSI_LOG_ERROR_RECOVERY(3, scsi_print_sense(scmd)); rtn = scsi_decide_disposition(scmd); @@ -1825,7 +1825,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) * nuke this special code so that it looks like we are saying * did_ok. */ - scmd->result &= 0xff00ffff; + scmd->result.combined &= 0xff00ffff; return SUCCESS; case DID_OK: /* @@ -2136,8 +2136,8 @@ void scsi_eh_flush_done_q(struct list_head *done_q) * scsi_eh_get_sense), scmd->result is already * set, do not set DRIVER_TIMEOUT. */ - if (!scmd->result) - scmd->result |= (DRIVER_TIMEOUT << 24); + if (!scmd->result.combined) + scmd->result.combined |= (DRIVER_TIMEOUT << 24); SCSI_LOG_ERROR_RECOVERY(3, scmd_printk(KERN_INFO, scmd, "%s: flush finish cmd\n", diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 4bcd744a5c8556..3d15d5d71008ae 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -196,7 +196,7 @@ static void __scsi_queue_insert(struct scsi_cmnd *cmd, int reason, bool unbusy) * lock such that the kblockd_schedule_work() call happens * before blk_cleanup_queue() finishes. */ - cmd->result = 0; + cmd->result.combined = 0; blk_mq_requeue_request(cmd->request, true); } @@ -286,7 +286,7 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, memcpy(sense, rq->sense, SCSI_SENSE_BUFFERSIZE); if (sshdr) scsi_normalize_sense(rq->sense, rq->sense_len, sshdr); - ret = rq->result; + ret = rq->result.combined; out: blk_put_request(req); @@ -940,7 +940,7 @@ static int scsi_io_completion_nz_result(struct scsi_cmnd *cmd, int result, */ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) { - int result = cmd->result; + int result = cmd->result.combined; struct request_queue *q = cmd->device->request_queue; struct request *req = cmd->request; blk_status_t blk_stat = BLK_STS_OK; @@ -1439,7 +1439,7 @@ static void scsi_softirq_done(struct request *rq) INIT_LIST_HEAD(&cmd->eh_entry); atomic_inc(&cmd->device->iodone_cnt); - if (cmd->result) + if (cmd->result.combined) atomic_inc(&cmd->device->ioerr_cnt); disposition = scsi_decide_disposition(cmd); @@ -1483,7 +1483,7 @@ static int scsi_dispatch_cmd(struct scsi_cmnd *cmd) /* in SDEV_DEL we error all commands. DID_NO_CONNECT * returns an immediate error upwards, and signals * that the device is no longer present */ - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; goto done; } @@ -1517,12 +1517,12 @@ static int scsi_dispatch_cmd(struct scsi_cmnd *cmd) "queuecommand : command too long. " "cdb_size=%d host->max_cmd_len=%d\n", cmd->cmd_len, cmd->device->host->max_cmd_len)); - cmd->result = (DID_ABORT << 16); + cmd->result.combined = (DID_ABORT << 16); goto done; } if (unlikely(host->shost_state == SHOST_DEL)) { - cmd->result = (DID_NO_CONNECT << 16); + cmd->result.combined = (DID_NO_CONNECT << 16); goto done; } @@ -1735,15 +1735,15 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx, ret = BLK_STS_DEV_RESOURCE; break; case BLK_STS_AGAIN: - scsi_req(req)->result = DID_BUS_BUSY << 16; + scsi_req(req)->result.combined = DID_BUS_BUSY << 16; if (req->rq_flags & RQF_DONTPREP) scsi_mq_uninit_cmd(cmd); break; default: if (unlikely(!scsi_device_online(sdev))) - scsi_req(req)->result = DID_NO_CONNECT << 16; + scsi_req(req)->result.combined = DID_NO_CONNECT << 16; else - scsi_req(req)->result = DID_ERROR << 16; + scsi_req(req)->result.combined = DID_ERROR << 16; /* * Make sure to release all allocated resources when * we hit an error, as we will never see this command diff --git a/drivers/scsi/scsi_logging.c b/drivers/scsi/scsi_logging.c index 8ea44c6595efa7..8dfb220e53e671 100644 --- a/drivers/scsi/scsi_logging.c +++ b/drivers/scsi/scsi_logging.c @@ -384,8 +384,8 @@ void scsi_print_result(const struct scsi_cmnd *cmd, const char *msg, char *logbuf; size_t off, logbuf_len; const char *mlret_string = scsi_mlreturn_string(disposition); - const char *hb_string = scsi_hostbyte_string(cmd->result); - const char *db_string = scsi_driverbyte_string(cmd->result); + const char *hb_string = scsi_hostbyte_string(cmd->result.combined); + const char *db_string = scsi_driverbyte_string(cmd->result.combined); unsigned long cmd_age = (jiffies - cmd->jiffies_at_alloc) / HZ; logbuf = scsi_log_reserve_buffer(&logbuf_len); diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index bebfb355abdf74..8d75e843f9e0d1 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -1534,7 +1534,7 @@ static int iscsi_bsg_host_dispatch(struct bsg_job *job) /* return the errno failure code as the only status */ BUG_ON(job->reply_len < sizeof(uint32_t)); reply->reply_payload_rcv_len = 0; - reply->result = ret; + reply->result.combined = ret; job->reply_len = sizeof(uint32_t); bsg_job_done(job, ret, 0); return 0; diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index cb3c37d1e0091c..309e88a5a9e5d1 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2017,7 +2017,7 @@ static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd) **/ static int sd_done(struct scsi_cmnd *SCpnt) { - int result = SCpnt->result; + int result = SCpnt->result.combined; unsigned int good_bytes = result ? 0 : scsi_bufflen(SCpnt); unsigned int sector_size = SCpnt->device->sector_size; unsigned int resid; @@ -2086,7 +2086,7 @@ static int sd_done(struct scsi_cmnd *SCpnt) * unknown amount of data was transferred so treat it as an * error. */ - SCpnt->result = 0; + SCpnt->result.combined = 0; memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); break; case ABORTED_COMMAND: diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index e45d8d94574ca7..32da8edfe884af 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c @@ -442,7 +442,7 @@ static bool sd_zbc_need_zone_wp_update(struct request *rq) static unsigned int sd_zbc_zone_wp_update(struct scsi_cmnd *cmd, unsigned int good_bytes) { - int result = cmd->result; + int result = cmd->result.combined; struct request *rq = cmd->request; struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); unsigned int zno = blk_rq_zone_no(rq); @@ -516,7 +516,7 @@ static unsigned int sd_zbc_zone_wp_update(struct scsi_cmnd *cmd, unsigned int sd_zbc_complete(struct scsi_cmnd *cmd, unsigned int good_bytes, struct scsi_sense_hdr *sshdr) { - int result = cmd->result; + int result = cmd->result.combined; struct request *rq = cmd->request; if (op_is_zone_mgmt(req_op(rq)) && diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 737cea9d908e36..2dc630146352ad 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1358,7 +1358,7 @@ sg_rq_end_io(struct request *rq, blk_status_t status) pr_info("%s: device detaching\n", __func__); sense = req->sense; - result = req->result; + result = req->result.combined; resid = req->resid_len; SCSI_LOG_TIMEOUT(4, sg_printk(KERN_INFO, sdp, diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 80d5c00379ee32..4d70e982270fa4 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -2997,7 +2997,7 @@ static void pqi_process_raid_io_error(struct pqi_io_request *io_request) sense_data_length); } - scmd->result = scsi_status; + scmd->result.combined = scsi_status; set_host_byte(scmd, host_byte); } @@ -3087,7 +3087,7 @@ static void pqi_process_aio_io_error(struct pqi_io_request *io_request) scsi_build_sense_buffer(0, scmd->sense_buffer, HARDWARE_ERROR, 0x3e, 0x1); - scmd->result = scsi_status; + scmd->result.combined = scsi_status; set_host_byte(scmd, host_byte); } @@ -3184,7 +3184,7 @@ static int pqi_process_io_intr(struct pqi_ctrl_info *ctrl_info, struct pqi_queue case PQI_RESPONSE_IU_RAID_PATH_IO_SUCCESS: case PQI_RESPONSE_IU_AIO_PATH_IO_SUCCESS: if (io_request->scmd) - io_request->scmd->result = 0; + io_request->scmd->result.combined = 0; fallthrough; case PQI_RESPONSE_IU_GENERAL_MANAGEMENT: break; @@ -5329,7 +5329,7 @@ static bool pqi_raid_bypass_retry_needed(struct pqi_io_request *io_request) return false; scmd = io_request->scmd; - if ((scmd->result & 0xff) == SAM_STAT_GOOD) + if ((scmd->result.combined & 0xff) == SAM_STAT_GOOD) return false; if (host_byte(scmd->result) == DID_NO_CONNECT) return false; @@ -5715,7 +5715,7 @@ static int pqi_scsi_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scm * This is necessary because the SML doesn't zero out this field during * error recovery. */ - scmd->result = 0; + scmd->result.combined = 0; hw_queue = pqi_get_hw_queue(ctrl_info, scmd); queue_group = &ctrl_info->queue_groups[hw_queue]; diff --git a/drivers/scsi/snic/snic_scsi.c b/drivers/scsi/snic/snic_scsi.c index 6dd0ff188bb49f..831084215f2458 100644 --- a/drivers/scsi/snic/snic_scsi.c +++ b/drivers/scsi/snic/snic_scsi.c @@ -341,7 +341,7 @@ snic_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc) if (ret) { SNIC_HOST_ERR(shost, "Tgt %p id %d Not Ready.\n", tgt, tgt->id); atomic64_inc(&snic->s_stats.misc.tgt_not_rdy); - sc->result = ret; + sc->result.combined = ret; sc->scsi_done(sc); return 0; @@ -475,7 +475,7 @@ snic_process_io_failed_state(struct snic *snic, snic_io_status_to_str(cmpl_stat), CMD_FLAGS(sc)); /* Set sc->result */ - sc->result = (res << 16) | icmnd_cmpl->scsi_status; + sc->result.combined = (res << 16) | icmnd_cmpl->scsi_status; } /* end of snic_process_io_failed_state */ /* @@ -508,7 +508,7 @@ snic_process_icmnd_cmpl_status(struct snic *snic, CMD_STATE(sc) = SNIC_IOREQ_COMPLETE; if (likely(cmpl_stat == SNIC_STAT_IO_SUCCESS)) { - sc->result = (DID_OK << 16) | scsi_stat; + sc->result.combined = (DID_OK << 16) | scsi_stat; xfer_len = scsi_bufflen(sc); @@ -846,7 +846,7 @@ snic_process_itmf_cmpl(struct snic *snic, } CMD_SP(sc) = NULL; - sc->result = (DID_ERROR << 16); + sc->result.combined = (DID_ERROR << 16); SNIC_SCSI_DBG(snic->shost, "itmf_cmpl: Completing IO. sc %p flags 0x%llx\n", sc, CMD_FLAGS(sc)); @@ -1474,7 +1474,7 @@ snic_abort_finish(struct snic *snic, struct scsi_cmnd *sc) * the # IO timeouts == 2, will cause the LUN offline. * Call scsi_done to complete the IO. */ - sc->result = (DID_ERROR << 16); + sc->result.combined = (DID_ERROR << 16); sc->scsi_done(sc); break; @@ -1854,7 +1854,7 @@ snic_dr_clean_single_req(struct snic *snic, snic_release_req_buf(snic, rqi, sc); - sc->result = (DID_ERROR << 16); + sc->result.combined = (DID_ERROR << 16); sc->scsi_done(sc); ret = 0; @@ -2491,7 +2491,7 @@ snic_scsi_cleanup(struct snic *snic, int ex_tag) snic_release_req_buf(snic, rqi, sc); cleanup: - sc->result = DID_TRANSPORT_DISRUPTED << 16; + sc->result.combined = DID_TRANSPORT_DISRUPTED << 16; SNIC_HOST_INFO(snic->shost, "sc_clean: DID_TRANSPORT_DISRUPTED for sc %p, Tag %d flags 0x%llx rqi %p duration %u msecs\n", sc, sc->request->tag, CMD_FLAGS(sc), rqi, diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index e4633b84c556a9..f11ffadefabebe 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -321,7 +321,7 @@ static unsigned int sr_check_events(struct cdrom_device_info *cdi, */ static int sr_done(struct scsi_cmnd *SCpnt) { - int result = SCpnt->result; + int result = SCpnt->result.combined; int this_count = scsi_bufflen(SCpnt); int good_bytes = (result == 0 ? this_count : 0); int block_sectors = 0; diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 9ca536aae78491..1185d75af44c8d 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -360,7 +360,7 @@ static void st_analyze_sense(struct st_request *SRpnt, struct st_cmdstatus *s) /* Convert the result to success code */ static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt) { - int result = SRpnt->result; + int result = SRpnt->result.combined; u8 scode; DEB(const char *stp;) char *name = tape_name(STp); @@ -484,7 +484,7 @@ static void st_do_stats(struct scsi_tape *STp, struct request *req) atomic64_add(ktime_to_ns(now), &STp->stats->tot_write_time); atomic64_add(ktime_to_ns(now), &STp->stats->tot_io_time); atomic64_inc(&STp->stats->write_cnt); - if (scsi_req(req)->result) { + if (scsi_req(req)->result.combined) { atomic64_add(atomic_read(&STp->stats->last_write_size) - STp->buffer->cmdstat.residual, &STp->stats->write_byte_cnt); @@ -498,7 +498,7 @@ static void st_do_stats(struct scsi_tape *STp, struct request *req) atomic64_add(ktime_to_ns(now), &STp->stats->tot_read_time); atomic64_add(ktime_to_ns(now), &STp->stats->tot_io_time); atomic64_inc(&STp->stats->read_cnt); - if (scsi_req(req)->result) { + if (scsi_req(req)->result.combined) { atomic64_add(atomic_read(&STp->stats->last_read_size) - STp->buffer->cmdstat.residual, &STp->stats->read_byte_cnt); @@ -718,7 +718,7 @@ static int write_behind_check(struct scsi_tape * STp) DEB(if (debugging && retval) st_printk(ST_DEB_MSG, STp, "Async write error %x, return value %d.\n", - STbuffer->cmdstat.midlevel_result, retval);) /* end DEB */ + STbuffer->cmdstat.midlevel_result.combined, retval);) /* end DEB */ return retval; } @@ -752,7 +752,7 @@ static int cross_eof(struct scsi_tape * STp, int forward) st_release_request(SRpnt); SRpnt = NULL; - if ((STp->buffer)->cmdstat.midlevel_result != 0) + if ((STp->buffer)->cmdstat.midlevel_result.combined != 0) st_printk(KERN_ERR, STp, "Stepping over filemark %s failed.\n", forward ? "forward" : "backward"); @@ -1118,7 +1118,7 @@ static int check_tape(struct scsi_tape *STp, struct file *filp) goto err_out; } - if (!SRpnt->result && !STp->buffer->cmdstat.have_sense) { + if (!SRpnt->result.combined && !STp->buffer->cmdstat.have_sense) { STp->max_block = ((STp->buffer)->b_data[1] << 16) | ((STp->buffer)->b_data[2] << 8) | (STp->buffer)->b_data[3]; STp->min_block = ((STp->buffer)->b_data[4] << 8) | diff --git a/drivers/scsi/st.h b/drivers/scsi/st.h index 95d2e7a7988dea..323eba6d421359 100644 --- a/drivers/scsi/st.h +++ b/drivers/scsi/st.h @@ -7,10 +7,11 @@ #include #include #include +#include /* Descriptor for analyzed sense data */ struct st_cmdstatus { - int midlevel_result; + struct scsi_status midlevel_result; struct scsi_sense_hdr sense_hdr; int have_sense; int residual; @@ -27,7 +28,7 @@ struct scsi_tape; struct st_request { unsigned char cmd[MAX_COMMAND_SIZE]; unsigned char sense[SCSI_SENSE_BUFFERSIZE]; - int result; + struct scsi_status result; struct scsi_tape *stp; struct completion *waiting; struct bio *bio; diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c index 12471208c7a8e2..d6debf9d0dc22a 100644 --- a/drivers/scsi/stex.c +++ b/drivers/scsi/stex.c @@ -398,7 +398,7 @@ static struct status_msg *stex_get_status(struct st_hba *hba) static void stex_invalid_field(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { - cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; + cmd->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; /* "Invalid field in cdb" */ scsi_build_sense_buffer(0, cmd->sense_buffer, ILLEGAL_REQUEST, 0x24, @@ -576,7 +576,7 @@ static void return_abnormal_state(struct st_hba *hba, int status) ccb->req = NULL; if (ccb->cmd) { scsi_dma_unmap(ccb->cmd); - ccb->cmd->result = status << 16; + ccb->cmd->result.combined = status << 16; ccb->cmd->scsi_done(ccb->cmd); ccb->cmd = NULL; } @@ -607,7 +607,7 @@ stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) lun = cmd->device->lun; hba = (struct st_hba *) &host->hostdata[0]; if (hba->mu_status == MU_STATE_NOCONNECT) { - cmd->result = DID_NO_CONNECT; + cmd->result.combined = DID_NO_CONNECT; done(cmd); return 0; } @@ -625,7 +625,7 @@ stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) if (page == 0x8 || page == 0x3f) { scsi_sg_copy_from_buffer(cmd, ms10_caching_page, sizeof(ms10_caching_page)); - cmd->result = DID_OK << 16; + cmd->result.combined = DID_OK << 16; done(cmd); } else stex_invalid_field(cmd, done); @@ -644,14 +644,14 @@ stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) break; case TEST_UNIT_READY: if (id == host->max_id - 1) { - cmd->result = DID_OK << 16; + cmd->result.combined = DID_OK << 16; done(cmd); return 0; } break; case INQUIRY: if (lun >= host->max_lun) { - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; done(cmd); return 0; } @@ -661,7 +661,7 @@ stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) (cmd->cmnd[1] & INQUIRY_EVPD) == 0) { scsi_sg_copy_from_buffer(cmd, (void *)console_inq_page, sizeof(console_inq_page)); - cmd->result = DID_OK << 16; + cmd->result.combined = DID_OK << 16; done(cmd); } else stex_invalid_field(cmd, done); @@ -680,9 +680,9 @@ stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) ver.host_no = hba->host->host_no; cp_len = scsi_sg_copy_from_buffer(cmd, &ver, cp_len); if (sizeof(ver) == cp_len) - cmd->result = DID_OK << 16; + cmd->result.combined = DID_OK << 16; else - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; done(cmd); return 0; } @@ -766,7 +766,7 @@ static void stex_scsi_done(struct st_ccb *ccb) break; } - cmd->result = result; + cmd->result.combined = result; cmd->scsi_done(cmd); } diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index e6718a74e5daea..2fa110e3cc4a71 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1096,9 +1096,9 @@ static void storvsc_command_completion(struct storvsc_cmd_request *cmd_request, vm_srb = &cmd_request->vstor_packet.vm_srb; data_transfer_length = vm_srb->data_transfer_length; - scmnd->result = vm_srb->scsi_status; + scmnd->result.combined = vm_srb->scsi_status; - if (scmnd->result) { + if (scmnd->result.combined) { if (scsi_normalize_sense(scmnd->sense_buffer, SCSI_SENSE_BUFFERSIZE, &sense_hdr) && !(sense_hdr.sense_key == NOT_READY && @@ -1675,7 +1675,7 @@ static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd) * this. So, don't send it. */ case SET_WINDOW: - scmnd->result = DID_ERROR << 16; + scmnd->result.combined = DID_ERROR << 16; allowed = false; break; default: diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c index d9a045f9858c7d..0facd06c2c1fb0 100644 --- a/drivers/scsi/sym53c8xx_2/sym_glue.c +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c @@ -235,7 +235,7 @@ void sym_set_cam_result_error(struct sym_hcb *np, struct sym_ccb *cp, int resid) cam_status = sym_xerr_cam_status(DID_ERROR, cp->xerr_status); } scsi_set_resid(cmd, resid); - cmd->result = (drv_status << 24) | (cam_status << 16) | scsi_status; + cmd->result.combined = (drv_status << 24) | (cam_status << 16) | scsi_status; } static int sym_scatter(struct sym_hcb *np, struct sym_ccb *cp, struct scsi_cmnd *cmd) diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.h b/drivers/scsi/sym53c8xx_2/sym_glue.h index 7d5c9b988b5bdf..9d4e624926a120 100644 --- a/drivers/scsi/sym53c8xx_2/sym_glue.h +++ b/drivers/scsi/sym53c8xx_2/sym_glue.h @@ -224,8 +224,8 @@ static inline struct sym_hcb * sym_get_hcb(struct Scsi_Host *host) static inline void sym_set_cam_status(struct scsi_cmnd *cmd, int status) { - cmd->result &= ~(0xff << 16); - cmd->result |= (status << 16); + cmd->result.combined &= ~(0xff << 16); + cmd->result.combined |= (status << 16); } /* @@ -243,7 +243,7 @@ sym_get_cam_status(struct scsi_cmnd *cmd) static inline void sym_set_cam_result_ok(struct sym_ccb *cp, struct scsi_cmnd *cmd, int resid) { scsi_set_resid(cmd, resid); - cmd->result = (DID_OK << 16) | (cp->ssss_status & 0x7f); + cmd->result.combined = (DID_OK << 16) | (cp->ssss_status & 0x7f); } void sym_set_cam_result_error(struct sym_hcb *np, struct sym_ccb *cp, int resid); diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 58d7f264c6649d..4d81c36cf88ac2 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5093,7 +5093,7 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba, ufshcd_add_command_trace(hba, index, UFS_CMD_COMP); result = ufshcd_transfer_rsp_status(hba, lrbp); scsi_dma_unmap(cmd); - cmd->result = result; + cmd->result.combined = result; /* Mark completed command as NULL in LRB */ lrbp->cmd = NULL; /* Do not touch lrbp after scsi done */ diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index b9c86a7e3b97d6..ff253e34e8612f 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -115,7 +115,7 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) "cmd %p response %u status %#02x sense_len %u\n", sc, resp->response, resp->status, resp->sense_len); - sc->result = resp->status; + sc->result.combined = resp->status; virtscsi_compute_resid(sc, virtio32_to_cpu(vscsi->vdev, resp->resid)); switch (resp->response) { case VIRTIO_SCSI_S_OK: diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c index 8a79605d965215..c0f110d8d6a5df 100644 --- a/drivers/scsi/vmw_pvscsi.c +++ b/drivers/scsi/vmw_pvscsi.c @@ -567,18 +567,18 @@ static void pvscsi_complete_request(struct pvscsi_adapter *adapter, return; } - cmd->result = 0; + cmd->result.combined = 0; if (sdstat != SAM_STAT_GOOD && (btstat == BTSTAT_SUCCESS || btstat == BTSTAT_LINKED_COMMAND_COMPLETED || btstat == BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG)) { if (sdstat == SAM_STAT_COMMAND_TERMINATED) { - cmd->result = (DID_RESET << 16); + cmd->result.combined = (DID_RESET << 16); } else { - cmd->result = (DID_OK << 16) | sdstat; + cmd->result.combined = (DID_OK << 16) | sdstat; if (sdstat == SAM_STAT_CHECK_CONDITION && cmd->sense_buffer) - cmd->result |= (DRIVER_SENSE << 24); + cmd->result.combined |= (DRIVER_SENSE << 24); } } else switch (btstat) { @@ -586,25 +586,25 @@ static void pvscsi_complete_request(struct pvscsi_adapter *adapter, case BTSTAT_LINKED_COMMAND_COMPLETED: case BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG: /* If everything went fine, let's move on.. */ - cmd->result = (DID_OK << 16); + cmd->result.combined = (DID_OK << 16); break; case BTSTAT_DATARUN: case BTSTAT_DATA_UNDERRUN: /* Report residual data in underruns */ scsi_set_resid(cmd, scsi_bufflen(cmd) - e->dataLen); - cmd->result = (DID_ERROR << 16); + cmd->result.combined = (DID_ERROR << 16); break; case BTSTAT_SELTIMEO: /* Our emulation returns this for non-connected devs */ - cmd->result = (DID_BAD_TARGET << 16); + cmd->result.combined = (DID_BAD_TARGET << 16); break; case BTSTAT_LUNMISMATCH: case BTSTAT_TAGREJECT: case BTSTAT_BADMSG: - cmd->result = (DRIVER_INVALID << 24); + cmd->result.combined = (DRIVER_INVALID << 24); fallthrough; case BTSTAT_HAHARDWARE: @@ -615,25 +615,25 @@ static void pvscsi_complete_request(struct pvscsi_adapter *adapter, case BTSTAT_HASOFTWARE: case BTSTAT_BUSFREE: case BTSTAT_SENSFAILED: - cmd->result |= (DID_ERROR << 16); + cmd->result.combined |= (DID_ERROR << 16); break; case BTSTAT_SENTRST: case BTSTAT_RECVRST: case BTSTAT_BUSRESET: - cmd->result = (DID_RESET << 16); + cmd->result.combined = (DID_RESET << 16); break; case BTSTAT_ABORTQUEUE: - cmd->result = (DID_BUS_BUSY << 16); + cmd->result.combined = (DID_BUS_BUSY << 16); break; case BTSTAT_SCSIPARITY: - cmd->result = (DID_PARITY << 16); + cmd->result.combined = (DID_PARITY << 16); break; default: - cmd->result = (DID_ERROR << 16); + cmd->result.combined = (DID_ERROR << 16); scmd_printk(KERN_DEBUG, cmd, "Unknown completion status: 0x%x\n", btstat); @@ -641,7 +641,7 @@ static void pvscsi_complete_request(struct pvscsi_adapter *adapter, dev_dbg(&cmd->device->sdev_gendev, "cmd=%p %x ctx=%p result=0x%x status=0x%x,%x\n", - cmd, cmd->cmnd[0], ctx, cmd->result, btstat, sdstat); + cmd, cmd->cmnd[0], ctx, cmd->result.combined, btstat, sdstat); cmd->scsi_done(cmd); } @@ -859,7 +859,7 @@ static int pvscsi_abort(struct scsi_cmnd *cmd) /* * Successfully aborted the command. */ - cmd->result = (DID_ABORT << 16); + cmd->result.combined = (DID_ABORT << 16); cmd->scsi_done(cmd); out: @@ -886,7 +886,7 @@ static void pvscsi_reset_all(struct pvscsi_adapter *adapter) pvscsi_unmap_buffers(adapter, ctx); pvscsi_patch_sense(cmd); pvscsi_release_context(adapter, ctx); - cmd->result = (DID_RESET << 16); + cmd->result.combined = (DID_RESET << 16); cmd->scsi_done(cmd); } } diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c index a23277bb870e36..020694c3746cbc 100644 --- a/drivers/scsi/wd33c93.c +++ b/drivers/scsi/wd33c93.c @@ -381,7 +381,7 @@ wd33c93_queuecommand_lck(struct scsi_cmnd *cmd, */ cmd->host_scribble = NULL; cmd->scsi_done = done; - cmd->result = 0; + cmd->result.combined = 0; /* We use the Scsi_Pointer structure that's included with each command * as a scratchpad (as it's intended to be used!). The handy thing about @@ -853,7 +853,7 @@ wd33c93_intr(struct Scsi_Host *instance) hostdata->selecting = NULL; } - cmd->result = DID_NO_CONNECT << 16; + cmd->result.combined = DID_NO_CONNECT << 16; hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); hostdata->state = S_UNCONNECTED; cmd->scsi_done(cmd); @@ -1177,11 +1177,10 @@ wd33c93_intr(struct Scsi_Host *instance) cmd->SCp.Status = lun; if (cmd->cmnd[0] == REQUEST_SENSE && cmd->SCp.Status != SAM_STAT_GOOD) - cmd->result = - (cmd-> - result & 0x00ffff) | (DID_ERROR << 16); + cmd->result.combined = + (cmd->result.combined & 0x00ffff) | (DID_ERROR << 16); else - cmd->result = + cmd->result.combined = cmd->SCp.Status | (cmd->SCp.Message << 8); cmd->scsi_done(cmd); @@ -1263,10 +1262,10 @@ wd33c93_intr(struct Scsi_Host *instance) hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); hostdata->state = S_UNCONNECTED; if (cmd->cmnd[0] == REQUEST_SENSE && cmd->SCp.Status != SAM_STAT_GOOD) - cmd->result = - (cmd->result & 0x00ffff) | (DID_ERROR << 16); + cmd->result.combined = + (cmd->result.combined & 0x00ffff) | (DID_ERROR << 16); else - cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); + cmd->result.combined = cmd->SCp.Status | (cmd->SCp.Message << 8); cmd->scsi_done(cmd); /* We are no longer connected to a target - check to see if @@ -1297,11 +1296,10 @@ wd33c93_intr(struct Scsi_Host *instance) DB(DB_INTR, printk(":%d", cmd->SCp.Status)) if (cmd->cmnd[0] == REQUEST_SENSE && cmd->SCp.Status != SAM_STAT_GOOD) - cmd->result = - (cmd-> - result & 0x00ffff) | (DID_ERROR << 16); + cmd->result.combined = + (cmd->result.combined & 0x00ffff) | (DID_ERROR << 16); else - cmd->result = + cmd->result.combined = cmd->SCp.Status | (cmd->SCp.Message << 8); cmd->scsi_done(cmd); break; @@ -1593,7 +1591,7 @@ wd33c93_host_reset(struct scsi_cmnd * SCpnt) hostdata->outgoing_len = 0; reset_wd33c93(instance); - SCpnt->result = DID_RESET << 16; + SCpnt->result.combined = DID_RESET << 16; enable_irq(instance->irq); spin_unlock_irq(instance->host_lock); return SUCCESS; @@ -1628,7 +1626,7 @@ wd33c93_abort(struct scsi_cmnd * cmd) hostdata->input_Q = (struct scsi_cmnd *) cmd->host_scribble; cmd->host_scribble = NULL; - cmd->result = DID_ABORT << 16; + cmd->result.combined = DID_ABORT << 16; printk ("scsi%d: Abort - removing command from input_Q. ", instance->host_no); @@ -1702,7 +1700,7 @@ wd33c93_abort(struct scsi_cmnd * cmd) hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); hostdata->connected = NULL; hostdata->state = S_UNCONNECTED; - cmd->result = DID_ABORT << 16; + cmd->result.combined = DID_ABORT << 16; /* sti();*/ wd33c93_execute(instance); diff --git a/drivers/scsi/wd719x.c b/drivers/scsi/wd719x.c index edc8a139a60d71..75a8f9685d158d 100644 --- a/drivers/scsi/wd719x.c +++ b/drivers/scsi/wd719x.c @@ -199,7 +199,7 @@ static void wd719x_finish_cmd(struct wd719x_scb *scb, int result) dma_unmap_single(&wd->pdev->dev, cmd->SCp.dma_handle, SCSI_SENSE_BUFFERSIZE, DMA_FROM_DEVICE); - cmd->result = result << 16; + cmd->result.combined = result << 16; cmd->scsi_done(cmd); } @@ -294,7 +294,7 @@ static int wd719x_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *cmd) dma_unmap_single(&wd->pdev->dev, scb->phys, sizeof(*scb), DMA_BIDIRECTIONAL); out_error: - cmd->result = DID_ERROR << 16; + cmd->result.combined = DID_ERROR << 16; cmd->scsi_done(cmd); return 0; } diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c index 259fc248d06cff..b33d5c7d9a60b1 100644 --- a/drivers/scsi/xen-scsifront.c +++ b/drivers/scsi/xen-scsifront.c @@ -261,7 +261,7 @@ static void scsifront_cdb_cmd_done(struct vscsifrnt_info *info, scsifront_gnttab_done(info, shadow); scsifront_put_rqid(info, id); - sc->result = ring_rsp->rslt; + sc->result.combined = ring_rsp->rslt; scsi_set_resid(sc, ring_rsp->residual_len); sense_len = min_t(uint8_t, VSCSIIF_SENSE_BUFFERSIZE, @@ -533,7 +533,7 @@ static int scsifront_queuecommand(struct Scsi_Host *shost, unsigned long flags; int err; - sc->result = 0; + sc->result.combined = 0; shadow->sc = sc; shadow->act = VSCSIIF_ACT_SCSI_CDB; @@ -551,7 +551,7 @@ static int scsifront_queuecommand(struct Scsi_Host *shost, spin_unlock_irqrestore(shost->host_lock, flags); if (err == -ENOMEM) return SCSI_MLQUEUE_HOST_BUSY; - sc->result = DID_ERROR << 16; + sc->result.combined = DID_ERROR << 16; sc->scsi_done(sc); return 0; } diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index 4455d26f7c96b3..4a43109e82b194 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -343,7 +343,7 @@ static int visorhba_abort_handler(struct scsi_cmnd *scsicmd) atomic_set(&vdisk->ios_threshold, IOS_ERROR_THRESHOLD); rtn = forward_taskmgmt_command(TASK_MGMT_ABORT_TASK, scsidev); if (rtn == SUCCESS) { - scsicmd->result = DID_ABORT << 16; + scsicmd->result.combined = DID_ABORT << 16; scsicmd->scsi_done(scsicmd); } return rtn; @@ -370,7 +370,7 @@ static int visorhba_device_reset_handler(struct scsi_cmnd *scsicmd) atomic_set(&vdisk->ios_threshold, IOS_ERROR_THRESHOLD); rtn = forward_taskmgmt_command(TASK_MGMT_LUN_RESET, scsidev); if (rtn == SUCCESS) { - scsicmd->result = DID_RESET << 16; + scsicmd->result.combined = DID_RESET << 16; scsicmd->scsi_done(scsicmd); } return rtn; @@ -399,7 +399,7 @@ static int visorhba_bus_reset_handler(struct scsi_cmnd *scsicmd) } rtn = forward_taskmgmt_command(TASK_MGMT_BUS_RESET, scsidev); if (rtn == SUCCESS) { - scsicmd->result = DID_RESET << 16; + scsicmd->result.combined = DID_RESET << 16; scsicmd->scsi_done(scsicmd); } return rtn; @@ -702,7 +702,7 @@ static void visorhba_serverdown_complete(struct visorhba_devdata *devdata) switch (pendingdel->cmdtype) { case CMD_SCSI_TYPE: scsicmd = pendingdel->sent; - scsicmd->result = DID_RESET << 16; + scsicmd->result.combined = DID_RESET << 16; if (scsicmd->scsi_done) scsicmd->scsi_done(scsicmd); break; @@ -864,7 +864,7 @@ static void complete_scsi_command(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd) { /* take what we need out of cmdrsp and complete the scsicmd */ - scsicmd->result = cmdrsp->scsi.linuxstat; + scsicmd->result.combined = cmdrsp->scsi.linuxstat; if (cmdrsp->scsi.linuxstat) do_scsi_linuxstat(cmdrsp, scsicmd); else @@ -906,7 +906,7 @@ static void drain_queue(struct uiscmdrsp *cmdrsp, cmdrsp->scsitaskmgmt.handle)) break; complete_taskmgmt_command(&devdata->idr, cmdrsp, - cmdrsp->scsitaskmgmt.result); + cmdrsp->scsitaskmgmt.result.combined); } else if (cmdrsp->cmdtype == CMD_NOTIFYGUEST_TYPE) dev_err_once(&devdata->dev->device, "ignoring unsupported NOTIFYGUEST\n"); diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 2687fd7d45db0f..35b0dd2e27cf77 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c @@ -565,10 +565,10 @@ static int tcm_loop_queue_data_or_status(const char *func, memcpy(sc->sense_buffer, se_cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE); - sc->result = SAM_STAT_CHECK_CONDITION; + sc->result.combined = SAM_STAT_CHECK_CONDITION; set_driver_byte(sc, DRIVER_SENSE); } else - sc->result = scsi_status; + sc->result.combined = scsi_status; set_host_byte(sc, DID_OK); if ((se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) || diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index e128705ec2ec0a..878aa8862630a0 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -1043,7 +1043,7 @@ static void pscsi_req_done(struct request *req, blk_status_t status) { struct se_cmd *cmd = req->end_io_data; struct pscsi_plugin_task *pt = cmd->priv; - int result = scsi_req(req)->result; + int result = scsi_req(req)->result.combined; enum sam_status scsi_status = status_byte(result) << 1; if (scsi_status != SAM_STAT_GOOD) { diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c index 59b02a539963bc..0f98438ecf9b51 100644 --- a/drivers/usb/image/microtek.c +++ b/drivers/usb/image/microtek.c @@ -408,8 +408,8 @@ static void mts_transfer_done( struct urb *transfer ) { MTS_INT_INIT(); - context->srb->result &= MTS_SCSI_ERR_MASK; - context->srb->result |= (unsigned)(*context->scsi_status)<<1; + context->srb->result.combined &= MTS_SCSI_ERR_MASK; + context->srb->result.combined |= (unsigned)(*context->scsi_status)<<1; mts_transfer_cleanup(transfer); } diff --git a/drivers/usb/storage/cypress_atacb.c b/drivers/usb/storage/cypress_atacb.c index a6f3267bbef6d9..a63be65bf25e02 100644 --- a/drivers/usb/storage/cypress_atacb.c +++ b/drivers/usb/storage/cypress_atacb.c @@ -148,7 +148,7 @@ static void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us) usb_stor_transparent_scsi_command(srb, us); /* if the device doesn't support ATACB */ - if (srb->result == SAM_STAT_CHECK_CONDITION && + if (srb->result.combined == SAM_STAT_CHECK_CONDITION && memcmp(srb->sense_buffer, usb_stor_sense_invalidCDB, sizeof(usb_stor_sense_invalidCDB)) == 0) { usb_stor_dbg(us, "cypress atacb not supported ???\n"); @@ -159,8 +159,8 @@ static void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us) * if ck_cond flags is set, and there wasn't critical error, * build the special sense */ - if ((srb->result != (DID_ERROR << 16) && - srb->result != (DID_ABORT << 16)) && + if ((srb->result.combined != (DID_ERROR << 16) && + srb->result.combined != (DID_ABORT << 16)) && save_cmnd[2] & 0x20) { struct scsi_eh_save ses; unsigned char regs[8]; @@ -182,7 +182,7 @@ static void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us) usb_stor_transparent_scsi_command(srb, us); memcpy(regs, srb->sense_buffer, sizeof(regs)); - tmp_result = srb->result; + tmp_result = srb->result.combined; scsi_eh_restore_cmnd(srb, &ses); /* we fail to get registers, report invalid command */ if (tmp_result != SAM_STAT_GOOD) @@ -221,11 +221,11 @@ static void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us) desc[12] = regs[6]; /* device */ desc[13] = regs[7]; /* command */ - srb->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; + srb->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; } goto end; invalid_fld: - srb->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; + srb->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; memcpy(srb->sense_buffer, usb_stor_sense_invalidCDB, diff --git a/drivers/usb/storage/datafab.c b/drivers/usb/storage/datafab.c index 588818483f4bd9..fe443b659ef19c 100644 --- a/drivers/usb/storage/datafab.c +++ b/drivers/usb/storage/datafab.c @@ -702,10 +702,10 @@ static int datafab_transport(struct scsi_cmnd *srb, struct us_data *us) rc = datafab_id_device(us, info); if (rc == USB_STOR_TRANSPORT_GOOD) { info->sense_key = NO_SENSE; - srb->result = SUCCESS; + srb->result.combined = SUCCESS; } else { info->sense_key = UNIT_ATTENTION; - srb->result = SAM_STAT_CHECK_CONDITION; + srb->result.combined = SAM_STAT_CHECK_CONDITION; } return rc; } diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c index 3c76336e43bb2d..e40d52c31c32a5 100644 --- a/drivers/usb/storage/isd200.c +++ b/drivers/usb/storage/isd200.c @@ -630,12 +630,12 @@ static void isd200_invoke_transport( struct us_data *us, case USB_STOR_TRANSPORT_GOOD: /* Indicate a good result */ - srb->result = SAM_STAT_GOOD; + srb->result.combined = SAM_STAT_GOOD; break; case USB_STOR_TRANSPORT_NO_SENSE: usb_stor_dbg(us, "-- transport indicates protocol failure\n"); - srb->result = SAM_STAT_CHECK_CONDITION; + srb->result.combined = SAM_STAT_CHECK_CONDITION; return; case USB_STOR_TRANSPORT_FAILED: @@ -645,13 +645,13 @@ static void isd200_invoke_transport( struct us_data *us, case USB_STOR_TRANSPORT_ERROR: usb_stor_dbg(us, "-- transport indicates transport error\n"); - srb->result = DID_ERROR << 16; + srb->result.combined = DID_ERROR << 16; /* Need reset here */ return; default: usb_stor_dbg(us, "-- transport indicates unknown error\n"); - srb->result = DID_ERROR << 16; + srb->result.combined = DID_ERROR << 16; /* Need reset here */ return; } @@ -674,13 +674,13 @@ static void isd200_invoke_transport( struct us_data *us, } if (result == ISD200_GOOD) { isd200_build_sense(us, srb); - srb->result = SAM_STAT_CHECK_CONDITION; + srb->result.combined = SAM_STAT_CHECK_CONDITION; /* If things are really okay, then let's show that */ if ((srb->sense_buffer[2] & 0xf) == 0x0) - srb->result = SAM_STAT_GOOD; + srb->result.combined = SAM_STAT_GOOD; } else { - srb->result = DID_ERROR << 16; + srb->result.combined = DID_ERROR << 16; /* Need reset here */ } } @@ -690,7 +690,7 @@ static void isd200_invoke_transport( struct us_data *us, * condition, show that in the result code */ if (transferStatus == USB_STOR_TRANSPORT_FAILED) - srb->result = SAM_STAT_CHECK_CONDITION; + srb->result.combined = SAM_STAT_CHECK_CONDITION; return; /* @@ -698,7 +698,7 @@ static void isd200_invoke_transport( struct us_data *us, * following an abort */ Handle_Abort: - srb->result = DID_ABORT << 16; + srb->result.combined = DID_ABORT << 16; /* permit the reset transfer to take place */ clear_bit(US_FLIDX_ABORTING, &us->dflags); @@ -1238,7 +1238,7 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, /* copy InquiryData */ usb_stor_set_xfer_buf((unsigned char *) &info->InquiryData, sizeof(info->InquiryData), srb); - srb->result = SAM_STAT_GOOD; + srb->result.combined = SAM_STAT_GOOD; sendToTransport = 0; break; @@ -1258,7 +1258,7 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, isd200_srb_set_bufflen(srb, 0); } else { usb_stor_dbg(us, " Media Status not supported, just report okay\n"); - srb->result = SAM_STAT_GOOD; + srb->result.combined = SAM_STAT_GOOD; sendToTransport = 0; } break; @@ -1276,7 +1276,7 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, isd200_srb_set_bufflen(srb, 0); } else { usb_stor_dbg(us, " Media Status not supported, just report okay\n"); - srb->result = SAM_STAT_GOOD; + srb->result.combined = SAM_STAT_GOOD; sendToTransport = 0; } break; @@ -1299,7 +1299,7 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, usb_stor_set_xfer_buf((unsigned char *) &readCapacityData, sizeof(readCapacityData), srb); - srb->result = SAM_STAT_GOOD; + srb->result.combined = SAM_STAT_GOOD; sendToTransport = 0; } break; @@ -1384,7 +1384,7 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, isd200_srb_set_bufflen(srb, 0); } else { usb_stor_dbg(us, " Not removable media, just report okay\n"); - srb->result = SAM_STAT_GOOD; + srb->result.combined = SAM_STAT_GOOD; sendToTransport = 0; } break; @@ -1410,7 +1410,7 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, isd200_srb_set_bufflen(srb, 0); } else { usb_stor_dbg(us, " Nothing to do, just report okay\n"); - srb->result = SAM_STAT_GOOD; + srb->result.combined = SAM_STAT_GOOD; sendToTransport = 0; } break; @@ -1418,7 +1418,7 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us, default: usb_stor_dbg(us, "Unsupported SCSI command - 0x%X\n", srb->cmnd[0]); - srb->result = DID_ERROR << 16; + srb->result.combined = DID_ERROR << 16; sendToTransport = 0; break; } @@ -1519,7 +1519,7 @@ static void isd200_ata_command(struct scsi_cmnd *srb, struct us_data *us) if (us->extra == NULL) { usb_stor_dbg(us, "ERROR Driver not initialized\n"); - srb->result = DID_ERROR << 16; + srb->result.combined = DID_ERROR << 16; return; } diff --git a/drivers/usb/storage/jumpshot.c b/drivers/usb/storage/jumpshot.c index 229bf0c1afc91f..12e58764bb2f87 100644 --- a/drivers/usb/storage/jumpshot.c +++ b/drivers/usb/storage/jumpshot.c @@ -627,10 +627,10 @@ static int jumpshot_transport(struct scsi_cmnd *srb, struct us_data *us) rc = jumpshot_id_device(us, info); if (rc == USB_STOR_TRANSPORT_GOOD) { info->sense_key = NO_SENSE; - srb->result = SUCCESS; + srb->result.combined = SUCCESS; } else { info->sense_key = UNIT_ATTENTION; - srb->result = SAM_STAT_CHECK_CONDITION; + srb->result.combined = SAM_STAT_CHECK_CONDITION; } return rc; } diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c index 3789698d9d3c64..8bb99a650917e5 100644 --- a/drivers/usb/storage/realtek_cr.c +++ b/drivers/usb/storage/realtek_cr.c @@ -822,9 +822,9 @@ static void rts51x_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) if ((srb->cmnd[0] == TEST_UNIT_READY) && (chip->pwr_state == US_SUSPEND)) { if (TST_LUN_READY(chip, srb->device->lun)) { - srb->result = SAM_STAT_GOOD; + srb->result.combined = SAM_STAT_GOOD; } else { - srb->result = SAM_STAT_CHECK_CONDITION; + srb->result.combined = SAM_STAT_CHECK_CONDITION; memcpy(srb->sense_buffer, media_not_present, US_SENSE_SIZE); @@ -835,12 +835,12 @@ static void rts51x_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) if (srb->cmnd[0] == ALLOW_MEDIUM_REMOVAL) { int prevent = srb->cmnd[4] & 0x1; if (prevent) { - srb->result = SAM_STAT_CHECK_CONDITION; + srb->result.combined = SAM_STAT_CHECK_CONDITION; memcpy(srb->sense_buffer, invalid_cmd_field, US_SENSE_SIZE); } else { - srb->result = SAM_STAT_GOOD; + srb->result.combined = SAM_STAT_GOOD; } usb_stor_dbg(us, "ALLOW_MEDIUM_REMOVAL\n"); goto out; @@ -850,7 +850,7 @@ static void rts51x_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) chip->proto_handler_backup(srb, us); /* Check whether card is plugged in */ if (srb->cmnd[0] == TEST_UNIT_READY) { - if (srb->result == SAM_STAT_GOOD) { + if (srb->result.combined == SAM_STAT_GOOD) { SET_LUN_READY(chip, srb->device->lun); if (card_first_show) { card_first_show = 0; diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index e5a971b83e3f56..3d5fd046c1479c 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@ -378,7 +378,7 @@ static int queuecommand_lck(struct scsi_cmnd *srb, /* fail the command if we are disconnecting */ if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) { usb_stor_dbg(us, "Fail command during disconnect\n"); - srb->result = DID_NO_CONNECT << 16; + srb->result.combined = DID_NO_CONNECT << 16; done(srb); return 0; } @@ -387,7 +387,7 @@ static int queuecommand_lck(struct scsi_cmnd *srb, (srb->cmnd[0] == ATA_12 || srb->cmnd[0] == ATA_16)) { memcpy(srb->sense_buffer, usb_stor_sense_invalidCDB, sizeof(usb_stor_sense_invalidCDB)); - srb->result = SAM_STAT_CHECK_CONDITION; + srb->result.combined = SAM_STAT_CHECK_CONDITION; done(srb); return 0; } diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index 5eb895b19c5584..810fd3993fb534 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c @@ -560,7 +560,7 @@ static void last_sector_hacks(struct us_data *us, struct scsi_cmnd *srb) if (sector + 1 != sdkp->capacity) goto done; - if (srb->result == SAM_STAT_GOOD && scsi_get_resid(srb) == 0) { + if (srb->result.combined == SAM_STAT_GOOD && scsi_get_resid(srb) == 0) { /* * The command succeeded. We know this device doesn't @@ -580,7 +580,7 @@ static void last_sector_hacks(struct us_data *us, struct scsi_cmnd *srb) */ if (++us->last_sector_retries < 3) return; - srb->result = SAM_STAT_CHECK_CONDITION; + srb->result.combined = SAM_STAT_CHECK_CONDITION; memcpy(srb->sense_buffer, record_not_found, sizeof(record_not_found)); } @@ -616,25 +616,25 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) */ if (test_bit(US_FLIDX_TIMED_OUT, &us->dflags)) { usb_stor_dbg(us, "-- command was aborted\n"); - srb->result = DID_ABORT << 16; + srb->result.combined = DID_ABORT << 16; goto Handle_Errors; } /* if there is a transport error, reset and don't auto-sense */ if (result == USB_STOR_TRANSPORT_ERROR) { usb_stor_dbg(us, "-- transport indicates error, resetting\n"); - srb->result = DID_ERROR << 16; + srb->result.combined = DID_ERROR << 16; goto Handle_Errors; } /* if the transport provided its own sense data, don't auto-sense */ if (result == USB_STOR_TRANSPORT_NO_SENSE) { - srb->result = SAM_STAT_CHECK_CONDITION; + srb->result.combined = SAM_STAT_CHECK_CONDITION; last_sector_hacks(us, srb); return; } - srb->result = SAM_STAT_GOOD; + srb->result.combined = SAM_STAT_GOOD; /* * Determine if we need to auto-sense @@ -727,7 +727,7 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) if (test_bit(US_FLIDX_TIMED_OUT, &us->dflags)) { usb_stor_dbg(us, "-- auto-sense aborted\n"); - srb->result = DID_ABORT << 16; + srb->result.combined = DID_ABORT << 16; /* If SANE_SENSE caused this problem, disable it */ if (sense_size != US_SENSE_SIZE) { @@ -761,7 +761,7 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) * multi-target device, since failure of an * auto-sense is perfectly valid */ - srb->result = DID_ERROR << 16; + srb->result.combined = DID_ERROR << 16; if (!(us->fflags & US_FL_SCM_MULT_TARG)) goto Handle_Errors; return; @@ -802,7 +802,7 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) #endif /* set the result so the higher layers expect this data */ - srb->result = SAM_STAT_CHECK_CONDITION; + srb->result.combined = SAM_STAT_CHECK_CONDITION; scdd = scsi_sense_desc_find(srb->sense_buffer, SCSI_SENSE_BUFFERSIZE, 4); @@ -821,7 +821,7 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) * won't realize we did an unsolicited auto-sense. */ if (result == USB_STOR_TRANSPORT_GOOD) { - srb->result = SAM_STAT_GOOD; + srb->result.combined = SAM_STAT_GOOD; srb->sense_buffer[0] = 0x0; } @@ -842,7 +842,7 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) * entering an infinite retry loop. */ else { - srb->result = DID_ERROR << 16; + srb->result.combined = DID_ERROR << 16; if ((sshdr.response_code & 0x72) == 0x72) srb->sense_buffer[1] = HARDWARE_ERROR; else @@ -861,7 +861,7 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) */ if (unlikely((us->fflags & US_FL_INITIAL_READ10) && srb->cmnd[0] == READ_10)) { - if (srb->result == SAM_STAT_GOOD) { + if (srb->result.combined == SAM_STAT_GOOD) { set_bit(US_FLIDX_READ10_WORKED, &us->dflags); } else if (test_bit(US_FLIDX_READ10_WORKED, &us->dflags)) { clear_bit(US_FLIDX_READ10_WORKED, &us->dflags); @@ -875,15 +875,15 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) */ if (test_bit(US_FLIDX_REDO_READ10, &us->dflags)) { clear_bit(US_FLIDX_REDO_READ10, &us->dflags); - srb->result = DID_IMM_RETRY << 16; + srb->result.combined = DID_IMM_RETRY << 16; srb->sense_buffer[0] = 0; } } /* Did we transfer less than the minimum amount required? */ - if ((srb->result == SAM_STAT_GOOD || srb->sense_buffer[2] == 0) && + if ((srb->result.combined == SAM_STAT_GOOD || srb->sense_buffer[2] == 0) && scsi_bufflen(srb) - scsi_get_resid(srb) < srb->underflow) - srb->result = DID_ERROR << 16; + srb->result.combined = DID_ERROR << 16; last_sector_hacks(us, srb); return; diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index bef89c6bd1d7fa..ed21dad78d5d37 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c @@ -167,7 +167,7 @@ static void uas_zap_pending(struct uas_dev_info *devinfo, int result) uas_log_cmd_state(cmnd, __func__, 0); /* Sense urbs were killed, clear COMMAND_INFLIGHT manually */ cmdinfo->state &= ~COMMAND_INFLIGHT; - cmnd->result = result << 16; + cmnd->result.combined = result << 16; err = uas_try_complete(cmnd, __func__); WARN_ON(err != 0); } @@ -194,7 +194,7 @@ static void uas_sense(struct urb *urb, struct scsi_cmnd *cmnd) memcpy(cmnd->sense_buffer, sense_iu->sense, len); } - cmnd->result = sense_iu->status; + cmnd->result.combined = sense_iu->status; } static void uas_log_cmd_state(struct scsi_cmnd *cmnd, const char *prefix, @@ -339,7 +339,7 @@ static void uas_stat_cmplt(struct urb *urb) switch (iu->iu_id) { case IU_ID_STATUS: uas_sense(urb, cmnd); - if (cmnd->result != 0) { + if (cmnd->result.combined != 0) { /* cancel data transfers on error */ data_in_urb = usb_get_urb(cmdinfo->data_in_urb); data_out_urb = usb_get_urb(cmdinfo->data_out_urb); @@ -652,7 +652,7 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd, (cmnd->cmnd[0] == ATA_12 || cmnd->cmnd[0] == ATA_16)) { memcpy(cmnd->sense_buffer, usb_stor_sense_invalidCDB, sizeof(usb_stor_sense_invalidCDB)); - cmnd->result = SAM_STAT_CHECK_CONDITION; + cmnd->result.combined = SAM_STAT_CHECK_CONDITION; cmnd->scsi_done(cmnd); return 0; } diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 90aa9c12ffac5f..79b2c73ec4f840 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -325,7 +325,7 @@ static int usb_stor_control_thread(void * __us) /* has the command timed out *already* ? */ if (test_bit(US_FLIDX_TIMED_OUT, &us->dflags)) { - srb->result = DID_ABORT << 16; + srb->result.combined = DID_ABORT << 16; goto SkipForAbort; } @@ -337,7 +337,7 @@ static int usb_stor_control_thread(void * __us) */ if (srb->sc_data_direction == DMA_BIDIRECTIONAL) { usb_stor_dbg(us, "UNKNOWN data direction\n"); - srb->result = DID_ERROR << 16; + srb->result.combined = DID_ERROR << 16; } /* @@ -349,14 +349,14 @@ static int usb_stor_control_thread(void * __us) usb_stor_dbg(us, "Bad target number (%d:%llu)\n", srb->device->id, srb->device->lun); - srb->result = DID_BAD_TARGET << 16; + srb->result.combined = DID_BAD_TARGET << 16; } else if (srb->device->lun > us->max_lun) { usb_stor_dbg(us, "Bad LUN (%d:%llu)\n", srb->device->id, srb->device->lun); - srb->result = DID_BAD_TARGET << 16; + srb->result.combined = DID_BAD_TARGET << 16; } /* @@ -371,7 +371,7 @@ static int usb_stor_control_thread(void * __us) usb_stor_dbg(us, "Faking INQUIRY command\n"); fill_inquiry_response(us, data_ptr, 36); - srb->result = SAM_STAT_GOOD; + srb->result.combined = SAM_STAT_GOOD; } /* we've got a command, let's do it! */ @@ -385,7 +385,7 @@ static int usb_stor_control_thread(void * __us) scsi_lock(host); /* was the command aborted? */ - if (srb->result == DID_ABORT << 16) { + if (srb->result.combined == DID_ABORT << 16) { SkipForAbort: usb_stor_dbg(us, "scsi command aborted\n"); srb = NULL; /* Don't call srb->scsi_done() */ @@ -416,7 +416,7 @@ static int usb_stor_control_thread(void * __us) /* now that the locks are released, notify the SCSI core */ if (srb) { usb_stor_dbg(us, "scsi cmd done, result=0x%x\n", - srb->result); + srb->result.combined); srb->scsi_done(srb); } } /* for (;;) */ diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index 55a4763da05e7c..b2af3ef0988ca2 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c @@ -340,7 +340,7 @@ static void scsiback_cmd_done(struct vscsibk_pend *pending_req) sense_buffer = pending_req->sense_buffer; resid = pending_req->se_cmd.residual_count; - errors = pending_req->result; + errors = pending_req->result.combined; if (errors && log_print_stat) scsiback_print_status(sense_buffer, errors, pending_req); @@ -1388,7 +1388,7 @@ static int scsiback_queue_data_in(struct se_cmd *se_cmd) struct vscsibk_pend *pending_req = container_of(se_cmd, struct vscsibk_pend, se_cmd); - pending_req->result = SAM_STAT_GOOD; + pending_req->result.combined = SAM_STAT_GOOD; scsiback_cmd_done(pending_req); return 0; } @@ -1401,10 +1401,10 @@ static int scsiback_queue_status(struct se_cmd *se_cmd) if (se_cmd->sense_buffer && ((se_cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) || (se_cmd->se_cmd_flags & SCF_EMULATED_TASK_SENSE))) - pending_req->result = (DRIVER_SENSE << 24) | + pending_req->result.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; else - pending_req->result = se_cmd->scsi_status; + pending_req->result.combined = se_cmd->scsi_status; scsiback_cmd_done(pending_req); return 0; diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c index 1058659a8d31af..40dbe7c8c9d771 100644 --- a/fs/nfsd/blocklayout.c +++ b/fs/nfsd/blocklayout.c @@ -255,9 +255,9 @@ static int nfsd4_scsi_identify_device(struct block_device *bdev, req->cmd_len = COMMAND_SIZE(INQUIRY); blk_execute_rq(NULL, rq, 1); - if (req->result) { + if (req->result.combined) { pr_err("pNFS: INQUIRY 0x83 failed with: %x\n", - req->result); + req->result.combined); error = -EIO; goto out_put_request; } diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index b2624c5ba82eeb..c6464971687eec 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -39,7 +39,7 @@ enum scsi_timeouts { * This returns true for known good conditions that may be treated as * command completed normally */ -static inline int scsi_status_is_good(int status) +static inline bool __scsi_status_is_good(int status) { /* * FIXME: bit0 is listed as reserved in SCSI-2, but is @@ -56,6 +56,20 @@ static inline int scsi_status_is_good(int status) (status == SAM_STAT_COMMAND_TERMINATED)); } +/* + * If the 'status' argument has type int, unsigned int or struct scsi_status, + * return the combined SCSI status. If the 'status' argument has another type, + * trigger a compiler error by passing a struct to a context where an integer + * is expected. + */ +#define scsi_status_to_int(status) \ + __builtin_choose_expr(sizeof(status) == 4, \ + *(int32_t *)(&(status)), \ + (struct scsi_status){}) + +#define scsi_status_is_good(status) \ + __scsi_status_is_good(scsi_status_to_int(status)) + /* * standard mode-select header prepended to all mode-select commands @@ -132,10 +146,10 @@ static inline int scsi_is_wlun(u64 lun) * host_byte = set by low-level driver to indicate status. * driver_byte = set by mid-level. */ -#define status_byte(result) (((result) >> 1) & 0x7f) -#define msg_byte(result) (((result) >> 8) & 0xff) -#define host_byte(result) (((result) >> 16) & 0xff) -#define driver_byte(result) (((result) >> 24) & 0xff) +#define status_byte(result) ((scsi_status_to_int((result)) >> 1) & 0x7f) +#define msg_byte(result) ((scsi_status_to_int((result)) >> 8) & 0xff) +#define host_byte(result) ((scsi_status_to_int((result)) >> 16) & 0xff) +#define driver_byte(result) ((scsi_status_to_int((result)) >> 24) & 0xff) #define sense_class(sense) (((sense) >> 4) & 0x7) #define sense_error(sense) ((sense) & 0xf) diff --git a/include/scsi/scsi_bsg_iscsi.h b/include/scsi/scsi_bsg_iscsi.h index 6b8128005af8f4..9f2b149a18a680 100644 --- a/include/scsi/scsi_bsg_iscsi.h +++ b/include/scsi/scsi_bsg_iscsi.h @@ -13,6 +13,7 @@ */ #include +#include /* * iSCSI Transport SGIO v4 BSG Message Support @@ -82,7 +83,7 @@ struct iscsi_bsg_reply { * msg and status fields. The per-msgcode reply structure * will contain valid data. */ - uint32_t result; + struct scsi_status result; /* If there was reply_payload, how much was recevied ? */ uint32_t reply_payload_rcv_len; diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 83f7e520be48e6..2cffaffa781d45 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -12,6 +12,7 @@ #include #include #include +#include struct Scsi_Host; struct scsi_driver; @@ -139,7 +140,7 @@ struct scsi_cmnd { * obtained by scsi_malloc is guaranteed * to be at an address < 16Mb). */ - int result; /* Status code from lower level driver */ + struct scsi_status result; /* Status code from lower level driver */ int flags; /* Command flags */ unsigned long state; /* Command completion state */ @@ -313,22 +314,22 @@ static inline struct scsi_data_buffer *scsi_prot(struct scsi_cmnd *cmd) static inline void set_status_byte(struct scsi_cmnd *cmd, char status) { - cmd->result = (cmd->result & 0xffffff00) | status; + cmd->result.b.status = status; } static inline void set_msg_byte(struct scsi_cmnd *cmd, char status) { - cmd->result = (cmd->result & 0xffff00ff) | (status << 8); + cmd->result.b.msg = status; } static inline void set_host_byte(struct scsi_cmnd *cmd, char status) { - cmd->result = (cmd->result & 0xff00ffff) | (status << 16); + cmd->result.b.host = status; } static inline void set_driver_byte(struct scsi_cmnd *cmd, char status) { - cmd->result = (cmd->result & 0x00ffffff) | (status << 24); + cmd->result.b.driver = status; } static inline unsigned scsi_transfer_length(struct scsi_cmnd *scmd) diff --git a/include/scsi/scsi_dbg.h b/include/scsi/scsi_dbg.h index 7b196d23462646..e9dad3d73d17e0 100644 --- a/include/scsi/scsi_dbg.h +++ b/include/scsi/scsi_dbg.h @@ -2,6 +2,8 @@ #ifndef _SCSI_SCSI_DBG_H #define _SCSI_SCSI_DBG_H +#include + struct scsi_cmnd; struct scsi_device; struct scsi_sense_hdr; diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h index 6bd5ed695a5e8c..ca8a656f3a0de2 100644 --- a/include/scsi/scsi_eh.h +++ b/include/scsi/scsi_eh.h @@ -6,6 +6,8 @@ #include #include +#include + struct scsi_device; struct Scsi_Host; @@ -31,7 +33,7 @@ extern int scsi_ioctl_reset(struct scsi_device *, int __user *); struct scsi_eh_save { /* saved state */ - int result; + struct scsi_status result; unsigned int resid_len; int eh_eflags; enum dma_data_direction data_direction; diff --git a/include/scsi/scsi_request.h b/include/scsi/scsi_request.h index b06f28c749085b..703466f15d58c8 100644 --- a/include/scsi/scsi_request.h +++ b/include/scsi/scsi_request.h @@ -3,6 +3,7 @@ #define _SCSI_SCSI_REQUEST_H #include +#include #define BLK_MAX_CDB 16 @@ -10,7 +11,7 @@ struct scsi_request { unsigned char __cmd[BLK_MAX_CDB]; unsigned char *cmd; unsigned short cmd_len; - int result; + struct scsi_status result; unsigned int sense_len; unsigned int resid_len; /* residual count */ int retries; diff --git a/include/scsi/scsi_status.h b/include/scsi/scsi_status.h index 405e620f90c7f2..0601a51540061b 100644 --- a/include/scsi/scsi_status.h +++ b/include/scsi/scsi_status.h @@ -84,4 +84,32 @@ enum driver_status { DRIVER_SENSE = 0x08, }; +/** + * SCSI status passed by LLDs to the midlayer. + * @combined: One of the following: + * - A (driver, host, msg, status) quadruplet encoded as a 32-bit integer. + * - A negative Unix error code. + * - In the IDE code, a positive value that represents an error code, an + * error counter or a bitfield. + * @b: SCSI status code. + */ +struct scsi_status { + union { + int32_t combined; + struct { +#if defined(__LITTLE_ENDIAN_BITFIELD) + enum sam_status status : 8; + enum msg_byte msg : 8; + enum host_status host : 8; + enum driver_status driver : 8; +#elif defined(__BIG_ENDIAN_BITFIELD) + enum driver_status driver : 8; + enum host_status host : 8; + enum msg_byte msg : 8; + enum sam_status status : 8; +#endif + } b; + }; +}; + #endif /* _SCSI_SCSI_STATUS_H */ diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h index f624969a4f14a3..d3c058a816c37a 100644 --- a/include/trace/events/scsi.h +++ b/include/trace/events/scsi.h @@ -309,7 +309,7 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template, __entry->channel = cmd->device->channel; __entry->id = cmd->device->id; __entry->lun = cmd->device->lun; - __entry->result = cmd->result; + __entry->result = cmd->result.combined; __entry->opcode = cmd->cmnd[0]; __entry->cmd_len = cmd->cmd_len; __entry->data_sglen = scsi_sg_count(cmd);