Make better use of static type checking
Subsystems (72)
Bart Van Assche
maintainercover Make better use of static type checking
Hi Martin,
This patch series improves static checking inside the SCSI subsystem as follows:
- Introduce enumeration types for the SCSI status, message, host and driver bytes.
- Change 'int' into 'union scsi_status' in case of SCSI results. This helps the compiler and humans to tell the difference between a scalar and a SCSI result.
This patch series is long because it touches all SCSI drivers and because it has been split into one patch per SCSI driver.
This patch series introduces a backwards-incompatible change in the API between SCSI core and drivers. A possible strategy is to postpone the patch that removes backwards compatibility to a later kernel version.
Please consider this patch series for kernel version v5.14.
Thanks,
Bart.
Bart Van Assche (117):
libsas: Introduce more SAM status code aliases in enum exec_status Introduce enums for the SAM, message, host and driver status codes Change the type of the second argument of
scsi_host_complete_all_commands()
libiscsi: Use the host_status enum
libsas: Use the host_status and sam_status enums
target: Use enum sam_status instead of u8
lpfc: Reformat four comparisons
fc: Add a compile-time structure size check
iscsi: Add a compile-time structure size check
ufs: Add a compile-time structure size check
Introduce the scsi_status union
block: Convert SCSI and bsg code to the scsi_status union
core: Convert to the scsi_status union
ch: Pass union scsi_status to driver_byte()
sd: Convert to the scsi_status union
sr: Convert to the scsi_status union
st: Convert to the scsi_status union
sg: Convert to the scsi_status union
3w*: Convert to the scsi_status union
53c700: Convert to the scsi_status union
BusLogic: Convert to the scsi_status union
NCR5380: Convert to the scsi_status union
a100u2w: Convert to the scsi_status union
aacraid: Convert to the scsi_status union
acornscsi: Annotate fallthrough
acornscsi: Convert to the scsi_status union
advansys: Convert to the scsi_status union
aha*: Convert to the scsi_status union
aic*: Convert to the scsi_status union
arcmsr: Convert to the scsi_status union
ata: Convert to the scsi_status union
atp870u: Convert to the scsi_status union
be2iscsi: Convert to the scsi_status union
bfa: Use type int32_t to represent a signed integer
bfa: Convert to the scsi_status union
bnx2fc: Convert to the scsi_status union
cdrom: Convert to the scsi_status union
csiostor: Convert to the scsi_status union
cxlflash: Convert to the scsi_status union
dc395x: Use the set_{host,msg,status}_byte() functions
dc395x: Convert to the scsi_status union
dpt_i2o: Convert to the scsi_status union
esas2r: Convert to the scsi_status union
esp_scsi: Convert to the scsi_status union
fas216: Fix two source code comments
fas216: Convert to the scsi_status union
fc: Convert to the scsi_status union
fdomain: Convert to the scsi_status union
firewire: sbp2: Convert to the scsi_status union
fnic: Convert to the scsi_status union
hpsa: Convert to the scsi_status union
hptiop: Convert to the scsi_status union
ib_srp: Convert to the scsi_status union
ibmvfc: Fix the documentation of the return value of
ibmvfc_host_chkready()
ibmvfc: Convert to the scsi_status union
ibmvscsi: Convert to the scsi_status union
ide: Convert to the scsi_status union
imm: Convert to the scsi_status union
initio: Convert to the scsi_status union
ipr: Convert to the scsi_status union
ips: Convert to the scsi_status union
iscsi: Convert to the scsi_status union
libfc: Convert to the scsi_status union
sas: Convert to the scsi_status union
lpfc: Convert to the scsi_status union
mac53c94: Convert to the scsi_status union
megaraid: Convert to the scsi_status union
mesh: Convert to the scsi_status union
message: fusion: Convert to the scsi_status union
mpt3sas: Convert to the scsi_status union
mvumi: Convert to the scsi_status union
myrb: Convert to the scsi_status union
myrs: Convert to the scsi_status union
ncr53c8xx: Convert to the scsi_status union
nfsd: Convert to the scsi_status union
nsp32: Convert to the scsi_status union
pcmcia: Convert to the scsi_status union
pktcdvd: Convert to the scsi_status union
pmcraid: Convert to the scsi_status union
ppa: Convert to the scsi_status union
ps3rom: Convert to the scsi_status union
qedf: Convert to the scsi_status union
qedi: Convert to the scsi_status union
qla1280: Convert to the scsi_status union
qla2xxx: Convert to the scsi_status union
qla4xxx: Convert to the scsi_status union
qlogicfas408: Convert to the scsi_status union
qlogicpti: Convert to the scsi_status union
s390/zfcp: Convert to the scsi_status union
scsi_debug: Convert to the scsi_status union
smartpqi: Convert to the scsi_status union
snic: Convert to the scsi_status union
staging: Convert to the scsi_status union
stex: Convert to the scsi_status union
storvsc: Convert to the scsi_status union
sym53c8xx_2: Convert to the scsi_status union
target: Convert to the scsi_status union
ufs: Remove an unused structure member
ufs: Remove a local variable
ufs: Use enum sam_status where appropriate
ufs: Remove an assignment from ufshcd_transfer_rsp_status()
ufs: Convert to the scsi_status union
usb: Convert to the scsi_status union
virtio-scsi: Convert to the scsi_status union
vmw_pvscsi: Convert to the scsi_status union
wd33c93: Convert to the scsi_status union
wd719x: Convert to the scsi_status union
xen-scsiback: Pass union status to the {status,msg,host,driver}_byte()
macros
xen-scsifront: Convert to the scsi_status union
Finalize the switch from 'int' to 'union scsi_status'
Use the scsi_status union more widely
Change the return type of scsi_execute() into union scsi_status Change the return type of scsi_execute_req() into union scsi_status Change the return type of scsi_test_unit_ready() into union
scsi_status
Change the return types of scsi_mode_sense() and sd_do_mode_sense() Change the return type of scsi_mode_select() into union scsi_status Change the return type of ioctl_internal_command() into union
scsi_status
block/bsg-lib.c | 16 +- block/bsg.c | 6 +- block/scsi_ioctl.c | 14 +- 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/hwmon/drivetemp.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 | 27 ++-- 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.c | 2 +- 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 | 25 +-- drivers/scsi/NCR5380.c | 30 ++-- 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/aic94xx/aic94xx_task.c | 2 +- drivers/scsi/arcmsr/arcmsr_hba.c | 38 ++--- drivers/scsi/arm/acornscsi.c | 30 ++-- drivers/scsi/arm/fas216.c | 44 +++--- drivers/scsi/atp870u.c | 14 +- drivers/scsi/be2iscsi/be_main.c | 12 +- drivers/scsi/bfa/bfad_bsg.c | 14 +- drivers/scsi/bfa/bfad_im.c | 30 ++-- drivers/scsi/bnx2fc/bnx2fc_io.c | 14 +- drivers/scsi/ch.c | 3 +- drivers/scsi/constants.c | 8 +- drivers/scsi/csiostor/csio_scsi.c | 18 ++- drivers/scsi/cxlflash/main.c | 32 ++-- drivers/scsi/cxlflash/superpipe.c | 14 +- drivers/scsi/cxlflash/vlun.c | 8 +- drivers/scsi/dc395x.c | 73 ++++----- drivers/scsi/device_handler/scsi_dh_alua.c | 28 ++-- drivers/scsi/device_handler/scsi_dh_emc.c | 7 +- drivers/scsi/device_handler/scsi_dh_hp_sw.c | 12 +- drivers/scsi/device_handler/scsi_dh_rdac.c | 2 +- drivers/scsi/dpt_i2o.c | 28 ++-- drivers/scsi/esas2r/esas2r.h | 2 +- drivers/scsi/esas2r/esas2r_main.c | 12 +- drivers/scsi/esp_scsi.c | 10 +- drivers/scsi/fdomain.c | 4 +- drivers/scsi/fnic/fnic_scsi.c | 38 ++--- drivers/scsi/hosts.c | 8 +- drivers/scsi/hpsa.c | 74 ++++----- drivers/scsi/hptiop.c | 20 +-- drivers/scsi/ibmvscsi/ibmvfc.c | 26 +-- 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/isci/request.c | 10 +- drivers/scsi/isci/task.c | 2 +- drivers/scsi/libfc/fc_fcp.c | 36 ++--- drivers/scsi/libfc/fc_lport.c | 8 +- drivers/scsi/libiscsi.c | 51 +++--- drivers/scsi/libsas/sas_ata.c | 5 +- drivers/scsi/libsas/sas_expander.c | 2 +- drivers/scsi/libsas/sas_scsi_host.c | 13 +- drivers/scsi/libsas/sas_task.c | 4 +- drivers/scsi/lpfc/lpfc_bsg.c | 114 +++++++------- drivers/scsi/lpfc/lpfc_scsi.c | 78 +++++---- drivers/scsi/mac53c94.c | 2 +- drivers/scsi/megaraid.c | 50 +++--- drivers/scsi/megaraid/megaraid_mbox.c | 62 ++++---- drivers/scsi/megaraid/megaraid_sas_base.c | 30 ++-- drivers/scsi/megaraid/megaraid_sas_fusion.c | 20 +-- drivers/scsi/mesh.c | 10 +- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 78 ++++----- drivers/scsi/mvsas/mv_sas.c | 10 +- drivers/scsi/mvumi.c | 18 +-- drivers/scsi/myrb.c | 48 +++--- drivers/scsi/myrs.c | 14 +- drivers/scsi/ncr53c8xx.c | 2 +- drivers/scsi/nsp32.c | 40 ++--- drivers/scsi/pcmcia/nsp_cs.c | 18 ++- drivers/scsi/pcmcia/sym53c500_cs.c | 12 +- drivers/scsi/pm8001/pm8001_hwi.c | 16 +- drivers/scsi/pm8001/pm8001_sas.c | 4 +- drivers/scsi/pm8001/pm80xx_hwi.c | 14 +- drivers/scsi/pmcraid.c | 28 ++-- drivers/scsi/ppa.c | 12 +- drivers/scsi/ps3rom.c | 10 +- drivers/scsi/qedf/qedf_io.c | 24 +-- drivers/scsi/qedi/qedi_fw.c | 2 +- drivers/scsi/qla1280.c | 2 +- drivers/scsi/qla2xxx/qla_bsg.c | 148 +++++++++--------- drivers/scsi/qla2xxx/qla_iocb.c | 4 +- drivers/scsi/qla2xxx/qla_isr.c | 14 +- drivers/scsi/qla2xxx/qla_mr.c | 6 +- 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 | 25 ++- drivers/scsi/scsi_debug.c | 26 +-- drivers/scsi/scsi_debugfs.c | 2 +- drivers/scsi/scsi_error.c | 46 +++--- drivers/scsi/scsi_ioctl.c | 24 +-- drivers/scsi/scsi_lib.c | 84 +++++----- drivers/scsi/scsi_logging.c | 8 +- drivers/scsi/scsi_scan.c | 22 +-- drivers/scsi/scsi_transport_fc.c | 10 +- drivers/scsi/scsi_transport_iscsi.c | 5 +- drivers/scsi/scsi_transport_sas.c | 3 +- drivers/scsi/scsi_transport_spi.c | 5 +- drivers/scsi/sd.c | 83 +++++----- drivers/scsi/sd.h | 3 +- drivers/scsi/sd_zbc.c | 12 +- drivers/scsi/ses.c | 4 +- drivers/scsi/sg.c | 11 +- drivers/scsi/smartpqi/smartpqi_init.c | 12 +- drivers/scsi/snic/snic_scsi.c | 14 +- drivers/scsi/sr.c | 20 +-- drivers/scsi/sr_ioctl.c | 6 +- drivers/scsi/st.c | 23 +-- 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 | 8 +- drivers/scsi/ufs/ufs_bsg.c | 2 +- drivers/scsi/ufs/ufshcd.c | 51 +++--- drivers/scsi/ufs/ufshcd.h | 1 - drivers/scsi/virtio_scsi.c | 14 +- drivers/scsi/vmw_pvscsi.c | 32 ++-- drivers/scsi/wd33c93.c | 30 ++-- drivers/scsi/wd719x.c | 4 +- drivers/scsi/xen-scsifront.c | 6 +- drivers/staging/rts5208/rtsx.c | 14 +- drivers/staging/rts5208/rtsx_transport.c | 8 +- drivers/staging/unisys/include/iochannel.h | 3 +- .../staging/unisys/visorhba/visorhba_main.c | 12 +- drivers/target/loopback/tcm_loop.c | 6 +- drivers/target/target_core_alua.c | 6 +- drivers/target/target_core_iblock.c | 2 +- drivers/target/target_core_pr.c | 8 +- drivers/target/target_core_pscsi.c | 16 +- drivers/target/target_core_sbc.c | 10 +- drivers/target/target_core_spc.c | 14 +- drivers/target/target_core_transport.c | 5 +- drivers/target/target_core_xcopy.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 | 11 +- fs/nfsd/blocklayout.c | 4 +- include/linux/bsg-lib.h | 3 +- include/scsi/libsas.h | 3 + include/scsi/scsi.h | 96 ++---------- include/scsi/scsi_bsg_iscsi.h | 5 +- include/scsi/scsi_cmnd.h | 22 +-- include/scsi/scsi_dbg.h | 10 +- include/scsi/scsi_device.h | 26 +-- include/scsi/scsi_eh.h | 4 +- include/scsi/scsi_host.h | 2 +- include/scsi/scsi_proto.h | 53 ++++--- include/scsi/scsi_request.h | 3 +- include/scsi/scsi_status.h | 120 ++++++++++++++ include/scsi/scsi_transport_srp.h | 15 +- include/target/target_core_backend.h | 4 +- include/target/target_core_base.h | 3 +- include/trace/events/scsi.h | 2 +- include/uapi/scsi/scsi_bsg_fc.h | 7 + include/uapi/scsi/scsi_bsg_ufs.h | 10 +- 206 files changed, 1995 insertions(+), 1861 deletions(-) create mode 100644 include/scsi/scsi_status.h
Bart Van Assche
maintainerPATCH 1/117 libsas: Introduce more SAM status code aliases in enum exec_status
This patch prepares for converting SAM status codes into an enum. Without this patch, converting SAM status codes into an enumeration type would trigger complaints about enum type mismatches for the SAS code.
--- drivers/scsi/aic94xx/aic94xx_task.c | 2 +- drivers/scsi/isci/request.c | 10 +++++----- drivers/scsi/isci/task.c | 2 +- drivers/scsi/libsas/sas_ata.c | 5 +++-- drivers/scsi/libsas/sas_expander.c | 2 +- drivers/scsi/libsas/sas_task.c | 4 ++-- drivers/scsi/mvsas/mv_sas.c | 10 +++++----- drivers/scsi/pm8001/pm8001_hwi.c | 16 ++++++++-------- drivers/scsi/pm8001/pm8001_sas.c | 4 ++-- drivers/scsi/pm8001/pm80xx_hwi.c | 14 +++++++------- include/scsi/libsas.h | 3 +++ 11 files changed, 38 insertions(+), 34 deletions(-)
drivers/scsi/aic94xx/aic94xx_task.c +1 -1
@@ -205,7 +205,7 @@ static void asd_task_tasklet_complete(struct asd_ascb *ascb,switch (opcode) {case TC_NO_ERROR : ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_GOOD ; + ts->stat = __SAM_STAT_GOOD;break ;case TC_UNDERRUN : ts->resp =SAS_TASK_COMPLETE ;
drivers/scsi/isci/request.c +5 -5
@@ -2566,7 +2566,7 @@ static void isci_request_handle_controller_specific_errors(if (!idev) *status_ptr =SAS_DEVICE_UNKNOWN ;else - *status_ptr =SAM_STAT_TASK_ABORTED ; + *status_ptr = __SAM_STAT_TASK_ABORTED;clear_bit (IREQ_COMPLETE_IN_TARGET , &request->flags); }
@@ -2696,7 +2696,7 @@ static void isci_request_handle_controller_specific_errors(default :/* Task in the target is not done. */ *response_ptr =SAS_TASK_UNDELIVERED ; - *status_ptr =SAM_STAT_TASK_ABORTED ; + *status_ptr = __SAM_STAT_TASK_ABORTED;if (task->task_proto ==SAS_PROTOCOL_SMP )set_bit (IREQ_COMPLETE_IN_TARGET , &request->flags);
@@ -2719,7 +2719,7 @@ static void isci_process_stp_response(struct sas_task *task, struct dev_to_host_if (ac_err_mask (fis->status)) ts->stat =SAS_PROTO_RESPONSE ;else - ts->stat =SAM_STAT_GOOD ; + ts->stat = __SAM_STAT_GOOD; ts->resp =SAS_TASK_COMPLETE ; }
@@ -2782,7 +2782,7 @@ static void isci_request_io_request_complete(struct isci_host *ihost,case SCI_IO_SUCCESS_IO_DONE_EARLY : response =SAS_TASK_COMPLETE ; - status =SAM_STAT_GOOD ; + status = __SAM_STAT_GOOD;set_bit (IREQ_COMPLETE_IN_TARGET , &request->flags);if (completion_status ==SCI_IO_SUCCESS_IO_DONE_EARLY ) {
@@ -2852,7 +2852,7 @@ static void isci_request_io_request_complete(struct isci_host *ihost,/* Fail the I/O. */ response =SAS_TASK_UNDELIVERED ; - status =SAM_STAT_TASK_ABORTED ; + status = __SAM_STAT_TASK_ABORTED;clear_bit (IREQ_COMPLETE_IN_TARGET , &request->flags);break ;
drivers/scsi/isci/task.c +1 -1
@@ -160,7 +160,7 @@ int isci_task_execute_task(struct sas_task *task, gfp_t gfp_flags)isci_task_refuse (ihost, task,SAS_TASK_UNDELIVERED , -SAM_STAT_TASK_ABORTED ); + __SAM_STAT_TASK_ABORTED); }else { task->task_state_flags |=SAS_TASK_AT_INITIATOR ;spin_unlock_irqrestore (&task->task_state_lock, flags);
drivers/scsi/libsas/sas_ata.c +3 -2
@@ -116,8 +116,9 @@ static void sas_ata_task_done(struct sas_task *task) } } -if (stat->stat ==SAS_PROTO_RESPONSE || stat->stat ==SAM_STAT_GOOD || - ((stat->stat ==SAM_STAT_CHECK_CONDITION && +if (stat->stat ==SAS_PROTO_RESPONSE || + stat->stat == __SAM_STAT_GOOD || + ((stat->stat == __SAM_STAT_CHECK_CONDITION && dev->sata_dev.class ==ATA_DEV_ATAPI ))) {memcpy (dev->sata_dev.fis, resp->ending_fis,ATA_RESP_FIS_SIZE );
drivers/scsi/libsas/sas_expander.c +1 -1
@@ -101,7 +101,7 @@ static int smp_execute_task_sg(struct domain_device *dev, } }if (task->task_status.resp ==SAS_TASK_COMPLETE && - task->task_status.stat ==SAM_STAT_GOOD ) { + task->task_status.stat == __SAM_STAT_GOOD) { res =0 ;break ; }
drivers/scsi/libsas/sas_task.c +2 -2
@@ -20,7 +20,7 @@ void sas_ssp_task_response(struct device *dev, struct sas_task *task,else if (iu->datapres ==1 ) tstat->stat = iu->resp_data[3 ];else if (iu->datapres ==2 ) { - tstat->stat =SAM_STAT_CHECK_CONDITION ; + tstat->stat = __SAM_STAT_CHECK_CONDITION; tstat->buf_valid_size =min_t (int,SAS_STATUS_BUF_SIZE ,be32_to_cpu (iu->sense_data_len));
@@ -32,7 +32,7 @@ void sas_ssp_task_response(struct device *dev, struct sas_task *task, }else /* when datapres contains corrupt/unknown value... */ - tstat->stat =SAM_STAT_CHECK_CONDITION ; + tstat->stat = __SAM_STAT_CHECK_CONDITION; }EXPORT_SYMBOL_GPL (sas_ssp_task_response);
drivers/scsi/mvsas/mv_sas.c +5 -5
@@ -1314,7 +1314,7 @@ static int mvs_exec_internal_tmf_task(struct domain_device *dev, }if (task->task_status.resp ==SAS_TASK_COMPLETE && - task->task_status.stat ==SAM_STAT_GOOD ) { + task->task_status.stat == __SAM_STAT_GOOD) { res =TMF_RESP_FUNC_COMPLETE ;break ; }
@@ -1764,7 +1764,7 @@ int mvs_slot_complete(struct mvs_info *mvi, u32 rx_desc, u32 flags)case SAS_PROTOCOL_SSP :/* hw says status == 0, datapres == 0 */ if (rx_desc &RXQ_GOOD ) { - tstat->stat =SAM_STAT_GOOD ; + tstat->stat = __SAM_STAT_GOOD; tstat->resp =SAS_TASK_COMPLETE ; }/* response frame present */
@@ -1773,12 +1773,12 @@ int mvs_slot_complete(struct mvs_info *mvi, u32 rx_desc, u32 flags)sizeof (struct mvs_err_info );sas_ssp_task_response (mvi->dev, task, iu); }else - tstat->stat =SAM_STAT_CHECK_CONDITION ; + tstat->stat = __SAM_STAT_CHECK_CONDITION;break ;case SAS_PROTOCOL_SMP : {struct scatterlist *sg_resp = &task->smp_task.smp_resp; - tstat->stat =SAM_STAT_GOOD ; + tstat->stat = __SAM_STAT_GOOD; to =kmap_atomic (sg_page (sg_resp)); memcpy(to + sg_resp->offset, slot->response + sizeof(struct mvs_err_info),
@@ -1795,7 +1795,7 @@ int mvs_slot_complete(struct mvs_info *mvi, u32 rx_desc, u32 flags) }default : - tstat->stat =SAM_STAT_CHECK_CONDITION ; + tstat->stat = __SAM_STAT_CHECK_CONDITION;break ; }if (!slot->port->port_attached) {
drivers/scsi/pm8001/pm8001_hwi.c +8 -8
@@ -1930,7 +1930,7 @@ mpi_ssp_completion(struct pm8001_hba_info *pm8001_ha, void *piomb) param);if (param ==0 ) { ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_GOOD ; + ts->stat = __SAM_STAT_GOOD; }else { ts->resp =SAS_TASK_COMPLETE ; ts->stat =SAS_PROTO_RESPONSE ;
@@ -2390,7 +2390,7 @@ mpi_sata_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)pm8001_dbg (pm8001_ha,IO ,"IO_SUCCESS\n" );if (param ==0 ) { ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_GOOD ; + ts->stat = __SAM_STAT_GOOD;/* check if response is for SEND READ LOG */ if (pm8001_dev && (pm8001_dev->id &NCQ_READ_LOG_FLAG )) {
@@ -2912,7 +2912,7 @@ mpi_smp_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)case IO_SUCCESS :pm8001_dbg (pm8001_ha,IO ,"IO_SUCCESS\n" ); ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_GOOD ; + ts->stat = __SAM_STAT_GOOD;if (pm8001_dev)atomic_dec (&pm8001_dev->running_req);break ;
@@ -2939,17 +2939,17 @@ mpi_smp_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)case IO_ERROR_HW_TIMEOUT :pm8001_dbg (pm8001_ha,IO ,"IO_ERROR_HW_TIMEOUT\n" ); ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_BUSY ; + ts->stat = __SAM_STAT_BUSY;break ;case IO_XFER_ERROR_BREAK :pm8001_dbg (pm8001_ha,IO ,"IO_XFER_ERROR_BREAK\n" ); ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_BUSY ; + ts->stat = __SAM_STAT_BUSY;break ;case IO_XFER_ERROR_PHY_NOT_READY :pm8001_dbg (pm8001_ha,IO ,"IO_XFER_ERROR_PHY_NOT_READY\n" ); ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_BUSY ; + ts->stat = __SAM_STAT_BUSY;break ;case IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED : pm8001_dbg(pm8001_ha, IO,
@@ -3710,7 +3710,7 @@ int pm8001_mpi_task_abort_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)case IO_SUCCESS :pm8001_dbg (pm8001_ha,EH ,"IO_SUCCESS\n" ); ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_GOOD ; + ts->stat = __SAM_STAT_GOOD;break ;case IO_NOT_VALID :pm8001_dbg (pm8001_ha,EH ,"IO_NOT_VALID\n" );
@@ -4355,7 +4355,7 @@ static int pm8001_chip_sata_req(struct pm8001_hba_info *pm8001_ha,spin_lock_irqsave (&task->task_state_lock, flags); ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_GOOD ; + ts->stat = __SAM_STAT_GOOD; task->task_state_flags &= ~SAS_TASK_STATE_PENDING ; task->task_state_flags &= ~SAS_TASK_AT_INITIATOR ; task->task_state_flags |=SAS_TASK_STATE_DONE ;
drivers/scsi/pm8001/pm8001_sas.c +2 -2
@@ -753,7 +753,7 @@ static int pm8001_exec_internal_tmf_task(struct domain_device *dev, }if (task->task_status.resp ==SAS_TASK_COMPLETE && - task->task_status.stat ==SAM_STAT_GOOD ) { + task->task_status.stat == __SAM_STAT_GOOD) { res =TMF_RESP_FUNC_COMPLETE ;break ; }
@@ -838,7 +838,7 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha, }if (task->task_status.resp ==SAS_TASK_COMPLETE && - task->task_status.stat ==SAM_STAT_GOOD ) { + task->task_status.stat == __SAM_STAT_GOOD) { res =TMF_RESP_FUNC_COMPLETE ;break ;
drivers/scsi/pm8001/pm80xx_hwi.c +7 -7
@@ -1952,7 +1952,7 @@ mpi_ssp_completion(struct pm8001_hba_info *pm8001_ha, void *piomb) param);if (param ==0 ) { ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_GOOD ; + ts->stat = __SAM_STAT_GOOD; }else { ts->resp =SAS_TASK_COMPLETE ; ts->stat =SAS_PROTO_RESPONSE ;
@@ -2487,7 +2487,7 @@ mpi_sata_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)pm8001_dbg (pm8001_ha,IO ,"IO_SUCCESS\n" );if (param ==0 ) { ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_GOOD ; + ts->stat = __SAM_STAT_GOOD;/* check if response is for SEND READ LOG */ if (pm8001_dev && (pm8001_dev->id &NCQ_READ_LOG_FLAG )) {
@@ -3042,7 +3042,7 @@ mpi_smp_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)case IO_SUCCESS :pm8001_dbg (pm8001_ha,IO ,"IO_SUCCESS\n" ); ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_GOOD ; + ts->stat = __SAM_STAT_GOOD;if (pm8001_dev)atomic_dec (&pm8001_dev->running_req);if (pm8001_ha->smp_exp_mode ==SMP_DIRECT ) {
@@ -3084,17 +3084,17 @@ mpi_smp_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)case IO_ERROR_HW_TIMEOUT :pm8001_dbg (pm8001_ha,IO ,"IO_ERROR_HW_TIMEOUT\n" ); ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_BUSY ; + ts->stat = __SAM_STAT_BUSY;break ;case IO_XFER_ERROR_BREAK :pm8001_dbg (pm8001_ha,IO ,"IO_XFER_ERROR_BREAK\n" ); ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_BUSY ; + ts->stat = __SAM_STAT_BUSY;break ;case IO_XFER_ERROR_PHY_NOT_READY :pm8001_dbg (pm8001_ha,IO ,"IO_XFER_ERROR_PHY_NOT_READY\n" ); ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_BUSY ; + ts->stat = __SAM_STAT_BUSY;break ;case IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED : pm8001_dbg(pm8001_ha, IO,
@@ -4699,7 +4699,7 @@ static int pm80xx_chip_sata_req(struct pm8001_hba_info *pm8001_ha,spin_lock_irqsave (&task->task_state_lock, flags); ts->resp =SAS_TASK_COMPLETE ; - ts->stat =SAM_STAT_GOOD ; + ts->stat = __SAM_STAT_GOOD; task->task_state_flags &= ~SAS_TASK_STATE_PENDING ; task->task_state_flags &= ~SAS_TASK_AT_INITIATOR ; task->task_state_flags |=SAS_TASK_STATE_DONE ;
include/scsi/libsas.h +3 -0
@@ -477,6 +477,9 @@ enum exec_status {/* The SAM_STAT_.. codes fit in the lower 6 bits, alias some of * them here to silence 'case value not in enumerated type' warnings */ + __SAM_STAT_GOOD =SAM_STAT_GOOD , + __SAM_STAT_BUSY =SAM_STAT_BUSY , + __SAM_STAT_TASK_ABORTED =SAM_STAT_TASK_ABORTED , __SAM_STAT_CHECK_CONDITION =SAM_STAT_CHECK_CONDITION , SAS_DEV_NO_RESPONSE = 0x80,
Bart Van Assche
maintainerPATCH 2/117 Introduce enums for the SAM, message, host and driver status codes
In reply to Bart Van AsscheAllow the compiler to verify whether SAM, message, host and driver status codes are used correctly. Add the attribute "__packed" to these enum definitions such that instances of the new enum types only occupy a single byte.
--- drivers/scsi/scsi_error.c | 2 + include/scsi/scsi.h | 84 ++--------------------------------- include/scsi/scsi_cmnd.h | 11 +++-- include/scsi/scsi_proto.h | 53 ++++++++++++---------- include/scsi/scsi_status.h | 91 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 133 insertions(+), 108 deletions(-) create mode 100644 include/scsi/scsi_status.h
drivers/scsi/scsi_error.c +2 -0
@@ -1775,6 +1775,8 @@ int scsi_noretry_cmd(struct scsi_cmnd *scmd) fallthrough;case DID_SOFT_ERROR :return (scmd->request->cmd_flags &REQ_FAILFAST_DRIVER ); +default : +break ; }if (status_byte (scmd->result) !=CHECK_CONDITION )
include/scsi/scsi.h +4 -80
109 lines not on this page · raw message
include/scsi/scsi_cmnd.h +7 -4
@@ -12,6 +12,7 @@#include <scsi/scsi_device.h> #include <scsi/scsi_host.h> #include <scsi/scsi_request.h> +#include <scsi/scsi_status.h> struct Scsi_Host ;struct scsi_driver ;
@@ -313,22 +314,24 @@ static inline struct scsi_data_buffer *scsi_prot(struct scsi_cmnd *cmd)#define scsi_for_each_prot_sg (cmd, sg, nseg, __i) \ for_each_sg(scsi_prot_sglist(cmd), sg, nseg, __i) -static inline void set_status_byte (struct scsi_cmnd *cmd,char status) +static inline void set_status_byte (struct scsi_cmnd *cmd, +enum sam_status status) { cmd->result = (cmd->result &0xffffff00 ) | status; } -static inline void set_msg_byte (struct scsi_cmnd *cmd,char status) +static inline void set_msg_byte (struct scsi_cmnd *cmd,enum msg_byte status) { cmd->result = (cmd->result &0xffff00ff ) | (status <<8 ); } -static inline void set_host_byte (struct scsi_cmnd *cmd,char status) +static inline void set_host_byte (struct scsi_cmnd *cmd,enum host_status status) { cmd->result = (cmd->result &0xff00ffff ) | (status <<16 ); } -static inline void set_driver_byte (struct scsi_cmnd *cmd,char status) +static inline void set_driver_byte (struct scsi_cmnd *cmd, +enum driver_status status) { cmd->result = (cmd->result &0x00ffffff ) | (status <<24 ); }
include/scsi/scsi_proto.h +29 -24
72 lines not on this page · raw message
include/scsi/scsi_status.h new file +91 -0
91 lines not on this page · raw message
Bart Van Assche
maintainerPATCH 3/117 Change the type of the second argument of scsi_host_complete_all_commands()
In reply to Bart Van AsscheAllow the compiler to verify the type of the second argument passed to scsi_host_complete_all_commands().
--- drivers/scsi/hosts.c | 8 +++++--- include/scsi/scsi_host.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/scsi/hosts.c +5 -3
@@ -657,10 +657,11 @@ EXPORT_SYMBOL_GPL(scsi_flush_work);static bool complete_all_cmds_iter (struct request *rq,void *data,bool rsvd) {struct scsi_cmnd *scmd =blk_mq_rq_to_pdu (rq); -int status = *(int *)data; +enum host_status status = *(enum host_status *)data;scsi_dma_unmap (scmd); - scmd->result = status <<16 ; + scmd->result =0 ; +set_host_byte (scmd, status); scmd->scsi_done (scmd);return true; }
@@ -675,7 +676,8 @@ static bool complete_all_cmds_iter(struct request *rq, void *data, bool rsvd)* caller to ensure that concurrent I/O submission and/or * completion is stopped when calling this function. */ -void scsi_host_complete_all_commands (struct Scsi_Host *shost,int status) +void scsi_host_complete_all_commands (struct Scsi_Host *shost, +enum host_status status) {blk_mq_tagset_busy_iter (&shost->tag_set, complete_all_cmds_iter, &status);
include/scsi/scsi_host.h +1 -1
@@ -770,7 +770,7 @@ extern void scsi_host_put(struct Scsi_Host *t);extern struct Scsi_Host *scsi_host_lookup (unsigned short );extern const char *scsi_host_state_name (enum scsi_host_state );extern void scsi_host_complete_all_commands (struct Scsi_Host *shost, -int status); +enum host_status status);static inline int __must_check scsi_add_host (struct Scsi_Host *host,struct device *dev)
Bart Van Assche
maintainerPATCH 4/117 libiscsi: Use the host_status enum
In reply to Bart Van AsscheAllow the compiler to verify the type of the last argument passed to fail_scsi_task() and fail_scsi_tasks().
--- drivers/scsi/libiscsi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/libiscsi.c +3 -2
@@ -590,7 +590,7 @@ static bool cleanup_queued_task(struct iscsi_task *task)* session frwd lock must be held and if not called for a task that is still * pending or from the xmit thread, then xmit thread must be suspended */ -static void fail_scsi_task (struct iscsi_task *task,int err) +static void fail_scsi_task (struct iscsi_task *task,enum host_status err) {struct iscsi_conn *conn = task->conn;struct scsi_cmnd *sc;
@@ -1885,7 +1885,8 @@ static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn,/* * Fail commands. session frwd lock held and xmit thread flushed. */ -static void fail_scsi_tasks (struct iscsi_conn *conn,u64 lun,int error) +static void fail_scsi_tasks (struct iscsi_conn *conn,u64 lun, +enum host_status error) {struct iscsi_session *session = conn->session;struct iscsi_task *task;
Bart Van Assche
maintainerPATCH 5/117 libsas: Use the host_status and sam_status enums
In reply to Bart Van AsscheAllow the compiler to verify the type of the values assigned to the ' hs' and 'stat' variables.
--- drivers/scsi/libsas/sas_scsi_host.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/libsas/sas_scsi_host.c +3 -2
@@ -37,7 +37,8 @@static void sas_end_task (struct scsi_cmnd *sc,struct sas_task *task) {struct task_status_struct *ts = &task->task_status; -int hs =0 , stat =0 ; +enum host_status hs =0 ; +enum sam_status stat =0 ;if (ts->resp ==SAS_TASK_UNDELIVERED ) {/* transport error */
@@ -88,7 +89,7 @@ static void sas_end_task(struct scsi_cmnd *sc, struct sas_task *task) stat =SAM_STAT_CHECK_CONDITION ;break ;default : - stat = ts->stat; + stat = (enum sam_status )ts->stat;break ; } }
Bart Van Assche
maintainerPATCH 6/117 target: Use enum sam_status instead of u8
In reply to Bart Van AsscheAllow the compiler to verify whether a SAM status code has been specified where such a code is expected. This patch does not change any functionality since SAM_STAT_GOOD and GOOD are both symbolic names for the numerical value 0.
--- drivers/target/loopback/tcm_loop.c | 2 +- drivers/target/target_core_alua.c | 6 +++--- drivers/target/target_core_iblock.c | 2 +- drivers/target/target_core_pr.c | 8 ++++---- drivers/target/target_core_pscsi.c | 4 ++-- drivers/target/target_core_sbc.c | 10 +++++----- drivers/target/target_core_spc.c | 14 +++++++------- drivers/target/target_core_transport.c | 5 +++-- drivers/target/target_core_xcopy.c | 2 +- include/target/target_core_backend.h | 4 ++-- include/target/target_core_base.h | 3 ++- 11 files changed, 31 insertions(+), 29 deletions(-)
drivers/target/loopback/tcm_loop.c +1 -1
@@ -550,7 +550,7 @@ static int tcm_loop_write_pending(struct se_cmd *se_cmd) }static int tcm_loop_queue_data_or_status (const char *func, -struct se_cmd *se_cmd,u8 scsi_status) +struct se_cmd *se_cmd,enum sam_status scsi_status) {struct tcm_loop_cmd *tl_cmd =container_of (se_cmd, struct tcm_loop_cmd, tl_se_cmd);
drivers/target/target_core_alua.c +3 -3
@@ -123,7 +123,7 @@ target_emulate_report_referrals(struct se_cmd *cmd)transport_kunmap_data_sg (cmd); -target_complete_cmd (cmd,GOOD ); +target_complete_cmd (cmd,SAM_STAT_GOOD );return 0 ; }
@@ -255,7 +255,7 @@ target_emulate_report_target_port_groups(struct se_cmd *cmd) }transport_kunmap_data_sg (cmd); -target_complete_cmd_with_length (cmd,GOOD , rd_len +4 ); +target_complete_cmd_with_length (cmd,SAM_STAT_GOOD , rd_len +4 );return 0 ; }
@@ -424,7 +424,7 @@ target_emulate_set_target_port_groups(struct se_cmd *cmd) out:transport_kunmap_data_sg (cmd);if (!rc) -target_complete_cmd (cmd,GOOD ); +target_complete_cmd (cmd,SAM_STAT_GOOD );return rc; }
drivers/target/target_core_iblock.c +1 -1
@@ -474,7 +474,7 @@ iblock_execute_zero_out(struct block_device *bdev, struct se_cmd *cmd)if (ret)return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE ; -target_complete_cmd (cmd,GOOD ); +target_complete_cmd (cmd,SAM_STAT_GOOD );return 0 ; }
drivers/target/target_core_pr.c +4 -4
@@ -234,7 +234,7 @@ target_scsi2_reservation_release(struct se_cmd *cmd) out_unlock:spin_unlock (&dev->dev_reservation_lock); out: -target_complete_cmd (cmd,GOOD ); +target_complete_cmd (cmd,SAM_STAT_GOOD );return 0 ; }
@@ -297,7 +297,7 @@ target_scsi2_reservation_reserve(struct se_cmd *cmd)spin_unlock (&dev->dev_reservation_lock); out:if (!ret) -target_complete_cmd (cmd,GOOD ); +target_complete_cmd (cmd,SAM_STAT_GOOD );return ret; }
@@ -3676,7 +3676,7 @@ target_scsi3_emulate_pr_out(struct se_cmd *cmd) }if (!ret) -target_complete_cmd (cmd,GOOD ); +target_complete_cmd (cmd,SAM_STAT_GOOD );return ret; }
@@ -4073,7 +4073,7 @@ target_scsi3_emulate_pr_in(struct se_cmd *cmd) }if (!ret) -target_complete_cmd (cmd,GOOD ); +target_complete_cmd (cmd,SAM_STAT_GOOD );return ret; }
drivers/target/target_core_pscsi.c +2 -2
@@ -588,7 +588,7 @@ static void pscsi_destroy_device(struct se_device *dev) } } -static void pscsi_complete_cmd (struct se_cmd *cmd,u8 scsi_status, +static void pscsi_complete_cmd (struct se_cmd *cmd,enum sam_status scsi_status,unsigned char *req_sense) {struct pscsi_dev_virt *pdv =PSCSI_DEV (cmd->se_dev);
@@ -1044,7 +1044,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; -u8 scsi_status =status_byte (result) <<1 ; +enum sam_status scsi_status =status_byte (result) <<1 ;if (scsi_status !=SAM_STAT_GOOD ) { pr_debug("PSCSI Status Byte exception at cmd: %p CDB:"
drivers/target/target_core_sbc.c +5 -5
@@ -67,7 +67,7 @@ sbc_emulate_readcapacity(struct se_cmd *cmd)transport_kunmap_data_sg (cmd); } -target_complete_cmd_with_length (cmd,GOOD ,8 ); +target_complete_cmd_with_length (cmd,SAM_STAT_GOOD ,8 );return 0 ; }
@@ -130,7 +130,7 @@ sbc_emulate_readcapacity_16(struct se_cmd *cmd)transport_kunmap_data_sg (cmd); } -target_complete_cmd_with_length (cmd,GOOD ,32 ); +target_complete_cmd_with_length (cmd,SAM_STAT_GOOD ,32 );return 0 ; }
@@ -202,14 +202,14 @@ sbc_execute_write_same_unmap(struct se_cmd *cmd)return ret; } -target_complete_cmd (cmd,GOOD ); +target_complete_cmd (cmd,SAM_STAT_GOOD );return 0 ; }static sense_reason_t sbc_emulate_noop (struct se_cmd *cmd) { -target_complete_cmd (cmd,GOOD ); +target_complete_cmd (cmd,SAM_STAT_GOOD );return 0 ; }
@@ -1245,7 +1245,7 @@ sbc_execute_unmap(struct se_cmd *cmd) err:transport_kunmap_data_sg (cmd);if (!ret) -target_complete_cmd (cmd,GOOD ); +target_complete_cmd (cmd,SAM_STAT_GOOD );return ret; }
drivers/target/target_core_spc.c +7 -7
@@ -750,7 +750,7 @@ spc_emulate_inquiry(struct se_cmd *cmd)kfree (buf);if (!ret) -target_complete_cmd_with_length (cmd,GOOD , len); +target_complete_cmd_with_length (cmd,SAM_STAT_GOOD , len);return ret; }
@@ -1104,7 +1104,7 @@ static sense_reason_t spc_emulate_modesense(struct se_cmd *cmd)transport_kunmap_data_sg (cmd); } -target_complete_cmd_with_length (cmd,GOOD , length); +target_complete_cmd_with_length (cmd,SAM_STAT_GOOD , length);return 0 ; }
@@ -1122,7 +1122,7 @@ static sense_reason_t spc_emulate_modeselect(struct se_cmd *cmd)int i;if (!cmd->data_length) { -target_complete_cmd (cmd,GOOD ); +target_complete_cmd (cmd,SAM_STAT_GOOD );return 0 ; }
@@ -1165,7 +1165,7 @@ static sense_reason_t spc_emulate_modeselect(struct se_cmd *cmd)transport_kunmap_data_sg (cmd);if (!ret) -target_complete_cmd (cmd,GOOD ); +target_complete_cmd (cmd,SAM_STAT_GOOD );return ret; }
@@ -1198,7 +1198,7 @@ static sense_reason_t spc_emulate_request_sense(struct se_cmd *cmd)memcpy (rbuf, buf,min_t (u32,sizeof (buf), cmd->data_length));transport_kunmap_data_sg (cmd); -target_complete_cmd (cmd,GOOD ); +target_complete_cmd (cmd,SAM_STAT_GOOD );return 0 ; }
@@ -1265,7 +1265,7 @@ sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd)transport_kunmap_data_sg (cmd); } -target_complete_cmd_with_length (cmd,GOOD ,8 + lun_count *8 ); +target_complete_cmd_with_length (cmd,SAM_STAT_GOOD ,8 + lun_count *8 );return 0 ; }EXPORT_SYMBOL (spc_emulate_report_luns);
@@ -1273,7 +1273,7 @@ EXPORT_SYMBOL(spc_emulate_report_luns);static sense_reason_t spc_emulate_testunitready (struct se_cmd *cmd) { -target_complete_cmd (cmd,GOOD ); +target_complete_cmd (cmd,SAM_STAT_GOOD );return 0 ; }
drivers/target/target_core_transport.c +3 -2
@@ -855,7 +855,7 @@ static bool target_cmd_interrupted(struct se_cmd *cmd) }/* May be called from interrupt context so must not sleep. */ -void target_complete_cmd (struct se_cmd *cmd,u8 scsi_status) +void target_complete_cmd (struct se_cmd *cmd,enum sam_status scsi_status) {struct se_wwn *wwn = cmd->se_sess->se_tpg->se_tpg_wwn;int success, cpu;
@@ -910,7 +910,8 @@ void target_set_cmd_data_length(struct se_cmd *cmd, int length) }EXPORT_SYMBOL (target_set_cmd_data_length); -void target_complete_cmd_with_length (struct se_cmd *cmd,u8 scsi_status,int length) +void target_complete_cmd_with_length (struct se_cmd *cmd, +enum sam_status scsi_status,int length) {if (scsi_status ==SAM_STAT_GOOD || cmd->se_cmd_flags &SCF_TREAT_READ_AS_NORMAL ) {
drivers/target/target_core_xcopy.c +1 -1
@@ -1011,7 +1011,7 @@ static sense_reason_t target_rcr_operating_parameters(struct se_cmd *se_cmd)put_unaligned_be32 (42 , &p[0 ]);transport_kunmap_data_sg (se_cmd); -target_complete_cmd (se_cmd,GOOD ); +target_complete_cmd (se_cmd,SAM_STAT_GOOD );return TCM_NO_SENSE ; }
include/target/target_core_backend.h +2 -2
@@ -73,9 +73,9 @@ struct sbc_ops {int transport_backend_register (const struct target_backend_ops *);void target_backend_unregister (const struct target_backend_ops *); -void target_complete_cmd (struct se_cmd *,u8 ); +void target_complete_cmd (struct se_cmd *,enum sam_status );void target_set_cmd_data_length (struct se_cmd *,int ); -void target_complete_cmd_with_length (struct se_cmd *,u8 ,int ); +void target_complete_cmd_with_length (struct se_cmd *,enum sam_status ,int );void transport_copy_sense_to_cmd (struct se_cmd *,unsigned char *);
include/target/target_core_base.h +2 -1
@@ -8,6 +8,7 @@#include <linux/percpu-refcount.h> #include <linux/semaphore.h> /* struct semaphore */ #include <linux/completion.h> +#include <scsi/scsi_proto.h> #define TARGET_CORE_VERSION "v5.0"
@@ -453,7 +454,7 @@ enum target_core_dif_check {struct se_cmd {/* SAM response code being sent to initiator */ -u8 scsi_status; +enum sam_status scsi_status;u8 scsi_asc;u8 scsi_ascq;u16 scsi_sense_length;
Bart Van Assche
maintainerPATCH 7/117 lpfc: Reformat four comparisons
In reply to Bart Van AsscheReformat four comparisons because otherwise Coccinelle would make the formatting of these comparisons look weird.
--- drivers/scsi/lpfc/lpfc_scsi.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/scsi/lpfc/lpfc_scsi.c +4 -8
@@ -4227,11 +4227,9 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,if (lpfc_cmd->result &IOERR_DRVR_MASK ) lpfc_cmd->status =IOSTAT_DRIVER_REJECT ;if (lpfc_cmd->result ==IOERR_ELXSEC_KEY_UNWRAP_ERROR || - lpfc_cmd->result == -IOERR_ELXSEC_KEY_UNWRAP_COMPARE_ERROR || + lpfc_cmd->result ==IOERR_ELXSEC_KEY_UNWRAP_COMPARE_ERROR || lpfc_cmd->result ==IOERR_ELXSEC_CRYPTO_ERROR || - lpfc_cmd->result == -IOERR_ELXSEC_CRYPTO_COMPARE_ERROR ) { + lpfc_cmd->result ==IOERR_ELXSEC_CRYPTO_COMPARE_ERROR ) { cmd->result =DID_NO_CONNECT <<16 ;break ; }
@@ -4502,11 +4500,9 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,case IOSTAT_LOCAL_REJECT :case IOSTAT_REMOTE_STOP :if (lpfc_cmd->result ==IOERR_ELXSEC_KEY_UNWRAP_ERROR || - lpfc_cmd->result == -IOERR_ELXSEC_KEY_UNWRAP_COMPARE_ERROR || + lpfc_cmd->result ==IOERR_ELXSEC_KEY_UNWRAP_COMPARE_ERROR || lpfc_cmd->result ==IOERR_ELXSEC_CRYPTO_ERROR || - lpfc_cmd->result == -IOERR_ELXSEC_CRYPTO_COMPARE_ERROR ) { + lpfc_cmd->result ==IOERR_ELXSEC_CRYPTO_COMPARE_ERROR ) { cmd->result =DID_NO_CONNECT <<16 ;break ; }
Bart Van Assche
maintainerPATCH 8/117 fc: Add a compile-time structure size check
In reply to Bart Van AsscheBefore changing the definition of struct fc_bsg_reply, add a compile-time structure size check.
--- drivers/scsi/scsi_transport_fc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/scsi_transport_fc.c +2 -0
@@ -948,6 +948,8 @@ static __init int fc_transport_init(void) {int error; +BUILD_BUG_ON (offsetof(struct fc_bsg_reply , reply_data) !=8 ); +atomic_set (&fc_event_seq,0 ); error =transport_class_register (&fc_host_class);
Bart Van Assche
maintainerPATCH 9/117 iscsi: Add a compile-time structure size check
In reply to Bart Van AsscheBefore modifying the struct iscsi_bsg_reply definition, add a compile-time structure size check.
--- drivers/scsi/scsi_transport_iscsi.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/scsi/scsi_transport_iscsi.c +3 -0
@@ -4729,6 +4729,9 @@ static __init int iscsi_transport_init(void) .groups = 1, .input = iscsi_if_rx, }; + +BUILD_BUG_ON (offsetof(struct iscsi_bsg_reply , reply_data) !=8 ); +printk (KERN_INFO "Loading iSCSI transport class v%s.\n" ,ISCSI_TRANSPORT_VERSION );
Bart Van Assche
maintainerPATCH 10/117 ufs: Add a compile-time structure size check
In reply to Bart Van AsscheBefore modifying the definition of struct ufs_bsg_reply, add a compile-time structure size check.
--- drivers/scsi/ufs/ufshcd.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/ufs/ufshcd.c +2 -0
@@ -9455,6 +9455,8 @@ EXPORT_SYMBOL_GPL(ufshcd_init);static int __init ufshcd_core_init (void ) { +BUILD_BUG_ON (offsetof(struct ufs_bsg_reply , upiu_rsp) !=8 ); +ufs_debugfs_init ();return 0 ; }
Bart Van Assche
maintainerPATCH 11/117 Introduce the scsi_status union
In reply to Bart Van AsscheIntroduce the scsi_status union, a data structure that will be used in the next patches to replace SCSI status codes represented as an integer. Define that data structure as follows:
union scsi_status {
int32_t combined;
struct {
#if defined(__BIG_ENDIAN)
enum driver_status driver;
enum host_status host;
enum msg_byte msg;
enum sam_status status;
#elif defined(__LITTLE_ENDIAN)
enum sam_status status;
enum msg_byte msg;
enum host_status host;
enum driver_status driver;
#else
#error Endianness?
#endif
} b;
};The 'combined' member makes it easy to convert existing SCSI code. The 'status', 'msg', 'host' and 'driver' enable access of individual SCSI status fields in a type-safe fashion.
Change 'int result;' into the following to enable converting one driver at a time:
union {
int result;
union scsi_status status;
};A later patch will remove the outer union and 'int result;'.
Also to enable converting one driver at a time, make scsi_status_is_good(), status_byte(), msg_byte(), host_byte() and driver_byte() accept an int or union scsi_status as argument. A later patch will make this function and these macros accept the scsi_status union only.
--- drivers/scsi/scsi.c | 9 +++++++++ include/linux/bsg-lib.h | 6 +++++- include/scsi/scsi.h | 24 +++++++++++++++++++----- include/scsi/scsi_bsg_iscsi.h | 6 +++++- include/scsi/scsi_cmnd.h | 14 +++++++++----- include/scsi/scsi_eh.h | 7 ++++++- include/scsi/scsi_request.h | 6 +++++- include/scsi/scsi_status.h | 29 +++++++++++++++++++++++++++++ include/uapi/scsi/scsi_bsg_fc.h | 10 ++++++++++ include/uapi/scsi/scsi_bsg_ufs.h | 11 +++++++++++ 10 files changed, 108 insertions(+), 14 deletions(-)
drivers/scsi/scsi.c +9 -0
@@ -763,10 +763,19 @@ MODULE_LICENSE("GPL");module_param (scsi_logging_level, int,S_IRUGO |S_IWUSR );MODULE_PARM_DESC (scsi_logging_level,"a bit mask of logging levels" ); +#define TEST_STATUS ((union scsi_status){.combined = 0x01020308}) +static int __init init_scsi (void ) {int error; +BUILD_BUG_ON (sizeof (union scsi_status ) !=4 ); +BUILD_BUG_ON (TEST_STATUS .combined !=0x01020308 ); +BUILD_BUG_ON (driver_byte (TEST_STATUS ) !=1 ); +BUILD_BUG_ON (host_byte (TEST_STATUS ) !=2 ); +BUILD_BUG_ON (msg_byte (TEST_STATUS ) !=3 ); +BUILD_BUG_ON (status_byte (TEST_STATUS ) !=4 ); + error =scsi_init_procfs ();if (error) goto cleanup_queue;
include/linux/bsg-lib.h +5 -1
@@ -11,6 +11,7 @@#include <linux/blkdev.h> #include <scsi/scsi_request.h> +#include <scsi/scsi_status.h> struct request ;struct device ;
@@ -52,7 +53,10 @@ struct bsg_job {struct bsg_buffer request_payload;struct bsg_buffer reply_payload; -int result; +union { +int result;/* do not use in new code */ +union scsi_status status; + };unsigned int reply_payload_rcv_len;/* BIDI support */
include/scsi/scsi.h +19 -5
@@ -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 union 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), \ + (union 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
@@ -134,10 +148,10 @@ enum scsi_disposition {* driver_byte = set by mid-level. */ #define status_byte (result) ((enum sam_status_divided_by_two) \ - (((result) >> 1) & 0x7f)) -#define msg_byte (result) (((result) >> 8) & 0xff) -#define host_byte (result) (((result) >> 16) & 0xff) -#define driver_byte (result) (((result) >> 24) & 0xff) + ((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)
include/scsi/scsi_bsg_iscsi.h +5 -1
@@ -13,6 +13,7 @@*/ #include <scsi/scsi.h> +#include <scsi/scsi_status.h> /* * iSCSI Transport SGIO v4 BSG Message Support
@@ -82,7 +83,10 @@ struct iscsi_bsg_reply {* msg and status fields. The per-msgcode reply structure * will contain valid data. */ -uint32_t result; +union { +uint32_t result;/* do not use in new code */ +union scsi_status status; + };/* If there was reply_payload, how much was recevied ? */ uint32_t reply_payload_rcv_len;
include/scsi/scsi_cmnd.h +9 -5
@@ -140,7 +140,11 @@ struct scsi_cmnd {* obtained by scsi_malloc is guaranteed * to be at an address < 16Mb). */ -int result;/* Status code from lower level driver */ +/* Status code from lower level driver */ +union { +int result;/* do not use in new code. */ +union scsi_status status; + };int flags;/* Command flags */ unsigned long state;/* Command completion state */
@@ -317,23 +321,23 @@ static inline struct scsi_data_buffer *scsi_prot(struct scsi_cmnd *cmd)static inline void set_status_byte (struct scsi_cmnd *cmd,enum sam_status status) { - cmd->result = (cmd->result &0xffffff00 ) | status; + cmd->status.b.status = status; }static inline void set_msg_byte (struct scsi_cmnd *cmd,enum msg_byte status) { - cmd->result = (cmd->result &0xffff00ff ) | (status <<8 ); + cmd->status.b.msg = status; }static inline void set_host_byte (struct scsi_cmnd *cmd,enum host_status status) { - cmd->result = (cmd->result &0xff00ffff ) | (status <<16 ); + cmd->status.b.host = status; }static inline void set_driver_byte (struct scsi_cmnd *cmd,enum driver_status status) { - cmd->result = (cmd->result &0x00ffffff ) | (status <<24 ); + cmd->status.b.driver = status; }static inline unsigned scsi_transfer_length (struct scsi_cmnd *scmd)
include/scsi/scsi_eh.h +6 -1
@@ -6,6 +6,8 @@#include <scsi/scsi_cmnd.h> #include <scsi/scsi_common.h> +#include <scsi/scsi_status.h> +struct scsi_device ;struct Scsi_Host ;
@@ -31,7 +33,10 @@ extern int scsi_ioctl_reset(struct scsi_device *, int __user *);struct scsi_eh_save {/* saved state */ -int result; +union { +int result;/* do not use in new code */ +union scsi_status status; + };unsigned int resid_len;int eh_eflags;enum dma_data_direction data_direction;
include/scsi/scsi_request.h +5 -1
@@ -3,6 +3,7 @@#define _SCSI_SCSI_REQUEST_H#include <linux/blk-mq.h> +#include <scsi/scsi_status.h> #define BLK_MAX_CDB 16
@@ -10,7 +11,10 @@ struct scsi_request {unsigned char __cmd[BLK_MAX_CDB ];unsigned char *cmd;unsigned short cmd_len; -int result; +union { +int result;/* do not use in new code */ +union scsi_status status; + };unsigned int sense_len;unsigned int resid_len;/* residual count */ int retries;
include/scsi/scsi_status.h +29 -0
@@ -3,6 +3,7 @@#include <linux/types.h> #include <linux/compiler_attributes.h> +#include <asm/byteorder.h> #include <scsi/scsi_proto.h> /*
@@ -88,4 +89,32 @@ enum driver_status {DRIVER_SENSE =0x08 , } __packed; +/** +* 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. +*/ +union scsi_status { +int32_t combined; +struct { +#if defined(__BIG_ENDIAN) +enum driver_status driver; +enum host_status host; +enum msg_byte msg; +enum sam_status status; +#elif defined(__LITTLE_ENDIAN) +enum sam_status status; +enum msg_byte msg; +enum host_status host; +enum driver_status driver; +#else +#error Endianness? +#endif + } b; +}; +#endif /* _SCSI_SCSI_STATUS_H */
include/uapi/scsi/scsi_bsg_fc.h +10 -0
@@ -9,6 +9,9 @@#define SCSI_BSG_FC_H #include <linux/types.h> +#ifdef __KERNEL__ +#include <scsi/scsi_status.h> +#endif /* * This file intended to be included by both kernel and user space
@@ -291,7 +294,14 @@ struct fc_bsg_reply {* msg and status fields. The per-msgcode reply structure * will contain valid data. */ +#ifdef __KERNEL__ +union { +__u32 result;/* do not use in new kernel code */ +union scsi_status status; + }; +#else __u32 result; +#endif /* If there was reply_payload, how much was recevied ? */ __u32 reply_payload_rcv_len;
include/uapi/scsi/scsi_bsg_ufs.h +11 -0
@@ -9,6 +9,10 @@#define SCSI_BSG_UFS_H #include <linux/types.h> +#ifdef __KERNEL__ +#include <scsi/scsi_status.h> +#endif +/* * This file intended to be included by both kernel and user space */
@@ -95,7 +99,14 @@ struct ufs_bsg_reply {* msg and status fields. The per-msgcode reply structure * will contain valid data. */ +#ifdef __KERNEL__ +union { +__u32 result;/* do not use in new kernel code */ +union scsi_status status; + }; +#else __u32 result; +#endif /* If there was reply_payload, how much was received? */ __u32 reply_payload_rcv_len;
Bart Van Assche
maintainerPATCH 12/117 block: Convert SCSI and bsg code to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- block/bsg-lib.c | 16 ++++++++-------- block/bsg.c | 6 +++--- block/scsi_ioctl.c | 14 +++++++------- 3 files changed, 18 insertions(+), 18 deletions(-)
block/bsg-lib.c +8 -8
@@ -82,18 +82,18 @@ static int bsg_transport_complete_rq(struct request *rq, struct sg_io_v4 *hdr)* The assignments below don't make much sense, but are kept for * bug by bug backwards compatibility: */ - hdr->device_status = job->result &0xff ; - hdr->transport_status =host_byte (job->result); - hdr->driver_status =driver_byte (job->result); + hdr->device_status = job->status.b.status; + hdr->transport_status =host_byte (job->status); + hdr->driver_status =driver_byte (job->status); hdr->info =0 ;if (hdr->device_status || hdr->transport_status || hdr->driver_status) hdr->info |=SG_INFO_CHECK ; hdr->response_len =0 ; -if (job->result <0 ) { +if (job->status.combined <0 ) {/* we're only returning the result field in the reply */ job->reply_len =sizeof (u32); - ret = job->result; + ret = job->status.combined; }if (job->reply_len && hdr->response) {
@@ -183,7 +183,7 @@ void bsg_job_done(struct bsg_job *job, int result, {struct request *rq =blk_mq_rq_from_pdu (job); - job->result = result; + job->status.combined = result; job->reply_payload_rcv_len = reply_payload_rcv_len;if (likely (!blk_should_fake_timeout (rq->q)))blk_mq_complete_request (rq);
@@ -247,7 +247,7 @@ static bool bsg_prepare_job(struct device *dev, struct request *req) failjob_rls_rqst_payload:kfree (job->request_payload.sg_list); failjob_rls_job: - job->result = -ENOMEM ; + job->status.combined = -ENOMEM ;return false; }
@@ -257,7 +257,7 @@ static bool bsg_prepare_job(struct device *dev, struct request *req)* @bd: queue data * * On error the create_bsg_job function should return a -Exyz error value -* that will be set to ->result. +* that will be set to ->status. * * Drivers/subsys should pass this to the queue init function. */
block/bsg.c +3 -3
@@ -94,9 +94,9 @@ 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->transport_status =host_byte (sreq->result); - hdr->driver_status =driver_byte (sreq->result); + hdr->device_status = sreq->status.b.status; + hdr->transport_status =host_byte (sreq->status); + hdr->driver_status =driver_byte (sreq->status); hdr->info =0 ;if (hdr->device_status || hdr->transport_status || hdr->driver_status) hdr->info |=SG_INFO_CHECK ;
block/scsi_ioctl.c +7 -7
@@ -252,11 +252,11 @@ 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->masked_status =status_byte (req->result); - hdr->msg_status =msg_byte (req->result); - hdr->host_status =host_byte (req->result); - hdr->driver_status =driver_byte (req->result); + hdr->status = req->status.b.status; + hdr->masked_status =status_byte (req->status); + hdr->msg_status =msg_byte (req->status); + hdr->host_status =host_byte (req->status); + hdr->driver_status =driver_byte (req->status); hdr->info =0 ;if (hdr->masked_status || hdr->host_status || hdr->driver_status) hdr->info |=SG_INFO_CHECK ;
@@ -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->status.b.status;/* 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)->status.combined ? -EIO :0 ;blk_put_request (rq);return err;
Bart Van Assche
maintainerPATCH 13/117 core: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/device_handler/scsi_dh_alua.c | 20 ++++---- drivers/scsi/hosts.c | 2 +- drivers/scsi/scsi.c | 8 +-- drivers/scsi/scsi_debugfs.c | 2 +- drivers/scsi/scsi_error.c | 44 ++++++++-------- drivers/scsi/scsi_ioctl.c | 12 ++--- drivers/scsi/scsi_lib.c | 59 ++++++++++++---------- drivers/scsi/scsi_logging.c | 8 +-- drivers/scsi/scsi_scan.c | 15 +++--- drivers/scsi/scsi_transport_spi.c | 8 +-- include/trace/events/scsi.h | 2 +- 11 files changed, 96 insertions(+), 84 deletions(-)
drivers/scsi/device_handler/scsi_dh_alua.c +11 -9
@@ -517,7 +517,8 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)int len, k, off, bufflen =ALUA_RTPG_SIZE ;int group_id_old, state_old, pref_old, valid_states_old;unsigned char *desc, *buff; -unsigned err, retval; +unsigned err; +union scsi_status retval;unsigned int tpg_desc_tbl_off;unsigned char orig_transition_tmo;unsigned long flags;
@@ -543,9 +544,10 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg) retry: err =0 ; - retval =submit_rtpg (sdev, buff, bufflen, &sense_hdr, pg->flags); + retval.combined =submit_rtpg (sdev, buff, bufflen, &sense_hdr, + pg->flags); -if (retval) { +if (retval.combined) {/* * Some (broken) implementations have a habit of returning * an error during things like firmware update etc.
@@ -558,14 +560,14 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)if ((pg->valid_states & ~TPGS_SUPPORT_OPTIMIZED ) ==0 ) {sdev_printk (KERN_INFO , sdev,"%s: ignoring rtpg result %d\n" , -ALUA_DH_NAME , retval); +ALUA_DH_NAME , retval.combined);kfree (buff);return SCSI_DH_OK ; }if (!scsi_sense_valid (&sense_hdr)) {sdev_printk (KERN_INFO , sdev,"%s: rtpg failed, result %d\n" , -ALUA_DH_NAME , retval); +ALUA_DH_NAME , retval.combined);kfree (buff);if (driver_byte (retval) ==DRIVER_ERROR )return SCSI_DH_DEV_TEMP_BUSY ;
@@ -759,7 +761,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)*/ static unsigned alua_stpg (struct scsi_device *sdev,struct alua_port_group *pg) { -int retval; +union scsi_status retval;struct scsi_sense_hdr sense_hdr;if (!(pg->tpgs &TPGS_MODE_EXPLICIT )) {
@@ -788,13 +790,13 @@ static unsigned alua_stpg(struct scsi_device *sdev, struct alua_port_group *pg) ALUA_DH_NAME, pg->state);return SCSI_DH_NOSYS ; } - retval =submit_stpg (sdev, pg->group_id, &sense_hdr); + retval.combined =submit_stpg (sdev, pg->group_id, &sense_hdr); -if (retval) { +if (retval.combined) {if (!scsi_sense_valid (&sense_hdr)) {sdev_printk (KERN_INFO , sdev,"%s: stpg failed, result %d" , -ALUA_DH_NAME , retval); +ALUA_DH_NAME , retval.combined);if (driver_byte (retval) ==DRIVER_ERROR )return SCSI_DH_DEV_TEMP_BUSY ; }else {
drivers/scsi/hosts.c +1 -1
@@ -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->status.combined =0 ;set_host_byte (scmd, status); scmd->scsi_done (scmd);return true;
drivers/scsi/scsi.c +4 -4
@@ -140,11 +140,11 @@ 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->status.combined || disposition !=SUCCESS )) || (level >1 )) {scsi_print_result (cmd,"Done" , disposition);scsi_print_command (cmd); -if (status_byte (cmd->result) ==CHECK_CONDITION ) +if (status_byte (cmd->status) ==CHECK_CONDITION )scsi_print_sense (cmd);if (level >3 ) scmd_printk(KERN_INFO, 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->status.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->status.combined)); good_bytes =scsi_bufflen (cmd);if (!blk_rq_is_passthrough (cmd->request)) {
drivers/scsi/scsi_debugfs.c +1 -1
@@ -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->status.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",
drivers/scsi/scsi_error.c +22 -22
156 lines not on this page · raw message
drivers/scsi/scsi_ioctl.c +6 -6
@@ -89,17 +89,17 @@ static int ioctl_probe(struct Scsi_Host *host, void __user *buffer)static int ioctl_internal_command (struct scsi_device *sdev,char *cmd,int timeout,int retries) { -int result; +union scsi_status result;struct scsi_sense_hdr sshdr;SCSI_LOG_IOCTL (1 ,sdev_printk (KERN_INFO , sdev,"Trying ioctl with scsi command %d\n" , *cmd)); - result =scsi_execute_req (sdev, cmd,DMA_NONE ,NULL ,0 , + result.combined =scsi_execute_req (sdev, cmd,DMA_NONE ,NULL ,0 , &sshdr, timeout, retries,NULL );SCSI_LOG_IOCTL (2 ,sdev_printk (KERN_INFO , sdev, -"Ioctl returned 0x%x\n" , result)); +"Ioctl returned 0x%x\n" , result.combined));if (driver_byte (result) ==DRIVER_SENSE &&scsi_sense_valid (&sshdr)) {
@@ -121,14 +121,14 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,case UNIT_ATTENTION :if (sdev->removable) { sdev->changed =1 ; - result =0 ;/* This is no longer considered an error */ + result.combined =0 ;/* This is no longer considered an error */ break ; } fallthrough;/* for non-removable media */ default :sdev_printk (KERN_INFO , sdev,"ioctl_internal_command return code = %x\n" , - result); + result.combined);scsi_print_sense_hdr (sdev,NULL , &sshdr);break ; }
@@ -136,7 +136,7 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,SCSI_LOG_IOCTL (2 ,sdev_printk (KERN_INFO , sdev,"IOCTL Releasing command\n" )); -return result; +return result.combined; }int scsi_set_medium_removal (struct scsi_device *sdev,char state)
drivers/scsi/scsi_lib.c +32 -27
191 lines not on this page · raw message
drivers/scsi/scsi_logging.c +4 -4
@@ -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->status.combined); +const char *db_string =scsi_driverbyte_string (cmd->status.combined);unsigned long cmd_age = (jiffies - cmd->jiffies_at_alloc) /HZ ; logbuf =scsi_log_reserve_buffer (&logbuf_len);
@@ -422,7 +422,7 @@ void scsi_print_result(const struct scsi_cmnd *cmd, const char *msg, "hostbyte=%s ", hb_string); else off += scnprintf(logbuf + off, logbuf_len - off, - "hostbyte=0x%02x ", host_byte(cmd->result)); + "hostbyte=0x%02x ", host_byte(cmd->status));if (WARN_ON (off >= logbuf_len)) goto out_printk;
@@ -432,7 +432,7 @@ void scsi_print_result(const struct scsi_cmnd *cmd, const char *msg,else off +=scnprintf (logbuf + off, logbuf_len - off,"driverbyte=0x%02x " , -driver_byte (cmd->result)); +driver_byte (cmd->status)); off +=scnprintf (logbuf + off, logbuf_len - off,"cmd_age=%lus" , cmd_age);
drivers/scsi/scsi_scan.c +9 -6
@@ -580,7 +580,8 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,unsigned char scsi_cmd[MAX_COMMAND_SIZE ];int first_inquiry_len, try_inquiry_len, next_inquiry_len;int response_len =0 ; -int pass, count, result; +int pass, count; +union scsi_status result;struct scsi_sense_hdr sshdr; *bflags =0 ;
@@ -607,16 +608,18 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,memset (inq_result,0 , try_inquiry_len); - result =scsi_execute_req (sdev, scsi_cmd,DMA_FROM_DEVICE , + result.combined = +scsi_execute_req (sdev, scsi_cmd,DMA_FROM_DEVICE , inq_result, try_inquiry_len, &sshdr,HZ /2 +HZ * scsi_inq_timeout,3 , &resid);SCSI_LOG_SCAN_BUS (3 ,sdev_printk (KERN_INFO , sdev,"scsi scan: INQUIRY %s with code 0x%x\n" , - result ?"failed" :"successful" , result)); + result.combined ?"failed" :"successful" , + result.combined)); -if (result) { +if (result.combined) {/* * not-ready to ready transition [asc/ascq=0x28/0x0] * or power-on, reset [asc/ascq=0x29/0x0], continue.
@@ -643,7 +646,7 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,break ; } -if (result ==0 ) { +if (result.combined ==0 ) {scsi_sanitize_inquiry_string (&inq_result[8 ],8 );scsi_sanitize_inquiry_string (&inq_result[16 ],16 );scsi_sanitize_inquiry_string (&inq_result[32 ],4 );
@@ -695,7 +698,7 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,/* If the last transfer attempt got an error, assume the * peripheral doesn't exist or is dead. */ -if (result) +if (result.combined)return -EIO ;/* Don't report any more data than the device says is valid */
drivers/scsi/scsi_transport_spi.c +5 -3
@@ -109,7 +109,8 @@ static int spi_execute(struct scsi_device *sdev, const void *cmd, void *buffer, unsigned bufflen, struct scsi_sense_hdr *sshdr) { - int i, result; + int i; +union scsi_status result;unsigned char sense[SCSI_SENSE_BUFFERSIZE ];struct scsi_sense_hdr sshdr_tmp;
@@ -121,7 +122,8 @@ static int spi_execute(struct scsi_device *sdev, const void *cmd,* The purpose of the RQF_PM flag below is to bypass the * SDEV_QUIESCE state. */ - result = scsi_execute(sdev, cmd, dir, buffer, bufflen, sense, + result.combined = + scsi_execute(sdev, cmd, dir, buffer, bufflen, sense, sshdr, DV_TIMEOUT, /* retries */ 1, REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
@@ -131,7 +133,7 @@ static int spi_execute(struct scsi_device *sdev, const void *cmd, sshdr->sense_key != UNIT_ATTENTION)break ; } -return result; +return result.combined; } static struct {
include/trace/events/scsi.h +1 -1
@@ -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->status.combined; __entry->opcode = cmd->cmnd[0 ]; __entry->cmd_len = cmd->cmd_len; __entry->data_sglen =scsi_sg_count (cmd);
Bart Van Assche
maintainerPATCH 14/117 ch: Pass union scsi_status to driver_byte()
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/ch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/ch.c +3 -2
@@ -187,7 +187,8 @@ ch_do_scsi(scsi_changer *ch, unsigned char *cmd, int cmd_len, void *buffer, unsigned buflength, enum dma_data_direction direction) { - int errno, retries = 0, timeout, result; + int errno, retries = 0, timeout; +union scsi_status result;struct scsi_sense_hdr sshdr; timeout = (cmd[0 ] ==INITIALIZE_ELEMENT_STATUS )
@@ -195,7 +196,7 @@ ch_do_scsi(scsi_changer *ch, unsigned char *cmd, int cmd_len, retry: errno =0 ; - result =scsi_execute_req (ch->device, cmd, direction, buffer, + result.combined =scsi_execute_req (ch->device, cmd, direction, buffer, buflength, &sshdr, timeout *HZ ,MAX_RETRIES ,NULL );
Bart Van Assche
maintainerPATCH 15/117 sd: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/sd.c | 103 ++++++++++++++++++++++-------------------- drivers/scsi/sd.h | 3 +- drivers/scsi/sd_zbc.c | 14 +++--- 3 files changed, 64 insertions(+), 56 deletions(-)
drivers/scsi/sd.c +55 -48
@@ -1622,7 +1622,7 @@ static unsigned int sd_check_events(struct gendisk *disk, unsigned int clearing) {struct scsi_disk *sdkp =scsi_disk_get (disk);struct scsi_device *sdp; -int retval; +union scsi_status retval;bool disk_changed;if (!sdkp)
@@ -1654,7 +1654,8 @@ static unsigned int sd_check_events(struct gendisk *disk, unsigned int clearing)if (scsi_block_when_processing_errors (sdp)) {struct scsi_sense_hdr sshdr = {0 , }; - retval =scsi_test_unit_ready (sdp,SD_TIMEOUT , sdkp->max_retries, + retval.combined = +scsi_test_unit_ready (sdp,SD_TIMEOUT , sdkp->max_retries, &sshdr);/* failed to execute TUR, assume media not present */
@@ -1689,7 +1690,8 @@ static unsigned int sd_check_events(struct gendisk *disk, unsigned int clearing)static int sd_sync_cache (struct scsi_disk *sdkp,struct scsi_sense_hdr *sshdr) { -int retries, res; +int retries; +union scsi_status res;struct scsi_device *sdp = sdkp->device;const int timeout = sdp->request_queue->rq_timeout *SD_FLUSH_TIMEOUT_MULTIPLIER ;
@@ -1710,13 +1712,13 @@ static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr)* Leave the rest of the command zero to indicate * flush everything. */ - res =scsi_execute (sdp, cmd,DMA_NONE ,NULL ,0 ,NULL , sshdr, + res.combined =scsi_execute (sdp, cmd,DMA_NONE ,NULL ,0 ,NULL , sshdr, timeout, sdkp->max_retries,0 ,RQF_PM ,NULL ); -if (res ==0 ) +if (res.combined ==0 )break ; } -if (res) { +if (res.combined) {sd_print_result (sdkp,"Synchronize Cache(10) failed" , res);if (driver_byte (res) ==DRIVER_SENSE )
@@ -1809,7 +1811,7 @@ static int sd_pr_command(struct block_device *bdev, u8 sa,struct scsi_disk *sdkp =scsi_disk (bdev->bd_disk);struct scsi_device *sdev = sdkp->device;struct scsi_sense_hdr sshdr; -int result; +union scsi_status result;u8 cmd[16 ] = {0 , };u8 data[24 ] = {0 , };
@@ -1822,16 +1824,18 @@ static int sd_pr_command(struct block_device *bdev, u8 sa,put_unaligned_be64 (sa_key, &data[8 ]); data[20 ] = flags; - result =scsi_execute_req (sdev, cmd,DMA_TO_DEVICE , &data,sizeof (data), + result.combined = +scsi_execute_req (sdev, cmd,DMA_TO_DEVICE , &data,sizeof (data), &sshdr,SD_TIMEOUT , sdkp->max_retries,NULL );if (driver_byte (result) ==DRIVER_SENSE &&scsi_sense_valid (&sshdr)) { -sdev_printk (KERN_INFO , sdev,"PR command failed: %d\n" , result); +sdev_printk (KERN_INFO , sdev,"PR command failed: %d\n" , + result.combined);scsi_print_sense_hdr (sdev,NULL , &sshdr); } -return result; +return result.combined; } static int sd_pr_register(struct block_device *bdev, u64 old_key, u64 new_key,
@@ -1931,7 +1935,7 @@ static int sd_eh_action(struct scsi_cmnd *scmd, int eh_disp)if (!scsi_device_online (sdev) || !scsi_medium_access_command (scmd) || -host_byte (scmd->result) !=DID_TIME_OUT || +host_byte (scmd->status) !=DID_TIME_OUT || eh_disp !=SUCCESS )return eh_disp;
@@ -2017,8 +2021,8 @@ static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd)**/ static int sd_done (struct scsi_cmnd *SCpnt) { -int result = SCpnt->result; -unsigned int good_bytes = result ?0 :scsi_bufflen (SCpnt); +union scsi_status result = SCpnt->status; +unsigned int good_bytes = result.combined ?0 :scsi_bufflen (SCpnt);unsigned int sector_size = SCpnt->device->sector_size;unsigned int resid;struct scsi_sense_hdr sshdr;
@@ -2036,7 +2040,7 @@ static int sd_done(struct scsi_cmnd *SCpnt)case REQ_OP_ZONE_OPEN :case REQ_OP_ZONE_CLOSE :case REQ_OP_ZONE_FINISH : -if (!result) { +if (!result.combined) { good_bytes =blk_rq_bytes (req);scsi_set_resid (SCpnt,0 ); }else {
@@ -2062,7 +2066,7 @@ static int sd_done(struct scsi_cmnd *SCpnt) } } -if (result) { +if (result.combined) { sense_valid =scsi_command_normalize_sense (SCpnt, &sshdr);if (sense_valid) sense_deferred =scsi_sense_is_deferred (&sshdr);
@@ -2086,7 +2090,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->status.combined =0 ;memset (SCpnt->sense_buffer,0 ,SCSI_SENSE_BUFFERSIZE );break ;case ABORTED_COMMAND :
@@ -2141,7 +2145,7 @@ sd_spinup_disk(struct scsi_disk *sdkp)unsigned char cmd[10 ];unsigned long spintime_expire =0 ;int retries, spintime; -unsigned int the_result; +union scsi_status the_result;struct scsi_sense_hdr sshdr;int sense_valid =0 ;
@@ -2156,7 +2160,7 @@ sd_spinup_disk(struct scsi_disk *sdkp) cmd[0 ] =TEST_UNIT_READY ;memset ((void *) &cmd[1 ],0 ,9 ); - the_result =scsi_execute_req (sdkp->device, cmd, + the_result.combined =scsi_execute_req (sdkp->device, cmd,DMA_NONE ,NULL ,0 , &sshdr,SD_TIMEOUT , sdkp->max_retries,NULL );
@@ -2169,7 +2173,7 @@ sd_spinup_disk(struct scsi_disk *sdkp)if (media_not_present (sdkp, &sshdr))return ; -if (the_result) +if (the_result.combined) sense_valid =scsi_sense_valid (&sshdr); retries++; } while (retries < 3 &&
@@ -2303,7 +2307,7 @@ static int sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *bufferstatic void read_capacity_error (struct scsi_disk *sdkp,struct scsi_device *sdp,struct scsi_sense_hdr *sshdr,int sense_valid, -int the_result) +union scsi_status the_result) {if (driver_byte (the_result) ==DRIVER_SENSE )sd_print_sense_hdr (sdkp, sshdr);
@@ -2339,7 +2343,7 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp,unsigned char cmd[16 ];struct scsi_sense_hdr sshdr;int sense_valid =0 ; -int the_result; +union scsi_status the_result;int retries =3 , reset_retries =READ_CAPACITY_RETRIES_ON_RESET ;unsigned int alignment;unsigned long long lba;
@@ -2355,14 +2359,14 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp, cmd[13 ] =RC16_LEN ;memset (buffer,0 ,RC16_LEN ); - the_result =scsi_execute_req (sdp, cmd,DMA_FROM_DEVICE , + the_result.combined =scsi_execute_req (sdp, cmd,DMA_FROM_DEVICE , buffer,RC16_LEN , &sshdr,SD_TIMEOUT , sdkp->max_retries,NULL );if (media_not_present (sdkp, &sshdr))return -ENODEV ; -if (the_result) { +if (the_result.combined) { sense_valid =scsi_sense_valid (&sshdr); if (sense_valid && sshdr.sense_key == ILLEGAL_REQUEST &&
@@ -2382,9 +2386,9 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp, } retries--; - }while (the_result && retries); + }while (the_result.combined && retries); -if (the_result) { +if (the_result.combined) {sd_print_result (sdkp,"Read Capacity(16) failed" , the_result);read_capacity_error (sdkp, sdp, &sshdr, sense_valid, the_result);return -EINVAL ;
@@ -2430,7 +2434,7 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp,unsigned char cmd[16 ];struct scsi_sense_hdr sshdr;int sense_valid =0 ; -int the_result; +union scsi_status the_result;int retries =3 , reset_retries =READ_CAPACITY_RETRIES_ON_RESET ;sector_t lba;unsigned sector_size;
@@ -2440,14 +2444,14 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp,memset (&cmd[1 ],0 ,9 );memset (buffer,0 ,8 ); - the_result =scsi_execute_req (sdp, cmd,DMA_FROM_DEVICE , + the_result.combined =scsi_execute_req (sdp, cmd,DMA_FROM_DEVICE , buffer,8 , &sshdr,SD_TIMEOUT , sdkp->max_retries,NULL );if (media_not_present (sdkp, &sshdr))return -ENODEV ; -if (the_result) { +if (the_result.combined) { sense_valid =scsi_sense_valid (&sshdr); if (sense_valid && sshdr.sense_key == UNIT_ATTENTION &&
@@ -2459,9 +2463,9 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp, } retries--; - }while (the_result && retries); + }while (the_result.combined && retries); -if (the_result) { +if (the_result.combined) {sd_print_result (sdkp,"Read Capacity(10) failed" , the_result);read_capacity_error (sdkp, sdp, &sshdr, sense_valid, the_result);return -EINVAL ;
@@ -2643,7 +2647,7 @@ sd_do_mode_sense(struct scsi_disk *sdkp, int dbd, int modepage,static void sd_read_write_protect_flag (struct scsi_disk *sdkp,unsigned char *buffer) { -int res; +union scsi_status res;struct scsi_device *sdp = sdkp->device;struct scsi_mode_data data;int old_wp = sdkp->write_prot;
@@ -2655,14 +2659,14 @@ sd_read_write_protect_flag(struct scsi_disk *sdkp, unsigned char *buffer) }if (sdp->use_192_bytes_for_3f) { - res =sd_do_mode_sense (sdkp,0 ,0x3F , buffer,192 , &data,NULL ); + res.combined =sd_do_mode_sense (sdkp,0 ,0x3F , buffer,192 , &data,NULL ); }else {/* * First attempt: ask for all pages (0x3F), but only 4 bytes. * We have to start carefully: some devices hang if we ask * for more than is available. */ - res =sd_do_mode_sense (sdkp,0 ,0x3F , buffer,4 , &data,NULL ); + res.combined =sd_do_mode_sense (sdkp,0 ,0x3F , buffer,4 , &data,NULL );/* * Second attempt: ask for page 0 When only page 0 is
@@ -2671,13 +2675,13 @@ sd_read_write_protect_flag(struct scsi_disk *sdkp, unsigned char *buffer)* CDB. */ if (!scsi_status_is_good (res)) - res =sd_do_mode_sense (sdkp,0 ,0 , buffer,4 , &data,NULL ); + res.combined =sd_do_mode_sense (sdkp,0 ,0 , buffer,4 , &data,NULL );/* * Third attempt: ask 255 bytes, as we did earlier. */ if (!scsi_status_is_good (res)) - res =sd_do_mode_sense (sdkp,0 ,0x3F , buffer,255 , + res.combined =sd_do_mode_sense (sdkp,0 ,0x3F , buffer,255 , &data,NULL ); }
@@ -2702,7 +2706,8 @@ sd_read_write_protect_flag(struct scsi_disk *sdkp, unsigned char *buffer)static void sd_read_cache_type (struct scsi_disk *sdkp,unsigned char *buffer) { -int len =0 , res; +int len =0 ; +union scsi_status res;struct scsi_device *sdp = sdkp->device;int dbd;
@@ -2739,7 +2744,7 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer) }/* cautiously ask */ - res =sd_do_mode_sense (sdkp, dbd, modepage, buffer, first_len, + res.combined =sd_do_mode_sense (sdkp, dbd, modepage, buffer, first_len, &data, &sshdr);if (!scsi_status_is_good (res))
@@ -2771,7 +2776,7 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)/* Get the data */ if (len > first_len) - res =sd_do_mode_sense (sdkp, dbd, modepage, buffer, len, + res.combined =sd_do_mode_sense (sdkp, dbd, modepage, buffer, len, &data, &sshdr);if (scsi_status_is_good (res)) {
@@ -2878,7 +2883,8 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)*/ static void sd_read_app_tag_own (struct scsi_disk *sdkp,unsigned char *buffer) { -int res, offset; +union scsi_status res; +int offset;struct scsi_device *sdp = sdkp->device;struct scsi_mode_data data;struct scsi_sense_hdr sshdr;
@@ -2889,7 +2895,7 @@ static void sd_read_app_tag_own(struct scsi_disk *sdkp, unsigned char *buffer)if (sdkp->protection_type ==0 )return ; - res =scsi_mode_sense (sdp,1 ,0x0a , buffer,36 ,SD_TIMEOUT , + res.combined =scsi_mode_sense (sdp,1 ,0x0a , buffer,36 ,SD_TIMEOUT , sdkp->max_retries, &data, &sshdr); if (!scsi_status_is_good(res) || !data.header_length ||
@@ -3576,7 +3582,7 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start)unsigned char cmd[6 ] = {START_STOP };/* START_VALID */ struct scsi_sense_hdr sshdr;struct scsi_device *sdp = sdkp->device; -int res; +union scsi_status res;if (start) cmd[4 ] |=1 ;/* START */
@@ -3587,20 +3593,20 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start)if (!scsi_device_online (sdp))return -ENODEV ; - res =scsi_execute (sdp, cmd,DMA_NONE ,NULL ,0 ,NULL , &sshdr, + res.combined =scsi_execute (sdp, cmd,DMA_NONE ,NULL ,0 ,NULL , &sshdr,SD_TIMEOUT , sdkp->max_retries,0 ,RQF_PM ,NULL ); -if (res) { +if (res.combined) {sd_print_result (sdkp,"Start/Stop Unit failed" , res);if (driver_byte (res) ==DRIVER_SENSE )sd_print_sense_hdr (sdkp, &sshdr);if (scsi_sense_valid (&sshdr) &&/* 0x3a is medium not present */ sshdr.asc ==0x3a ) - res =0 ; + res.combined =0 ; }/* SCSI error codes must not go to the generic layer */ -if (res) +if (res.combined)return -EIO ;return 0 ;
@@ -3803,10 +3809,11 @@ void sd_print_sense_hdr(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr) sdkp->disk ? sdkp->disk->disk_name : NULL, sshdr); } -void sd_print_result (const struct scsi_disk *sdkp,const char *msg,int result) +void sd_print_result (const struct scsi_disk *sdkp,const char *msg, +union scsi_status result) { -const char *hb_string =scsi_hostbyte_string (result); -const char *db_string =scsi_driverbyte_string (result); +const char *hb_string =scsi_hostbyte_string (result.combined); +const char *db_string =scsi_driverbyte_string (result.combined);if (hb_string || db_string) sd_printk(KERN_INFO, sdkp,
drivers/scsi/sd.h +2 -1
@@ -237,6 +237,7 @@ static inline blk_status_t sd_zbc_prepare_zone_append(struct scsi_cmnd *cmd,#endif /* CONFIG_BLK_DEV_ZONED */ void sd_print_sense_hdr (struct scsi_disk *sdkp,struct scsi_sense_hdr *sshdr); -void sd_print_result (const struct scsi_disk *sdkp,const char *msg,int result); +void sd_print_result (const struct scsi_disk *sdkp,const char *msg, +union scsi_status result);#endif /* _SCSI_DISK_H */
drivers/scsi/sd_zbc.c +7 -7
@@ -99,7 +99,7 @@ static int sd_zbc_do_report_zones(struct scsi_disk *sdkp, unsigned char *buf,struct scsi_sense_hdr sshdr;unsigned char cmd[16 ];unsigned int rep_len; -int result; +union scsi_status result;memset (cmd,0 ,16 ); cmd[0 ] =ZBC_IN ;
@@ -109,10 +109,10 @@ static int sd_zbc_do_report_zones(struct scsi_disk *sdkp, unsigned char *buf,if (partial) cmd[14 ] =ZBC_REPORT_ZONE_PARTIAL ; - result =scsi_execute_req (sdp, cmd,DMA_FROM_DEVICE , + result.combined =scsi_execute_req (sdp, cmd,DMA_FROM_DEVICE , buf, buflen, &sshdr, timeout,SD_MAX_RETRIES ,NULL ); -if (result) { +if (result.combined) {sd_printk (KERN_ERR , sdkp,"REPORT ZONES start lba %llu failed\n" , lba);sd_print_result (sdkp,"REPORT ZONES" , result);
@@ -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; +const union scsi_status result = cmd->status;struct request *rq = cmd->request;struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);unsigned int zno =blk_rq_zone_no (rq);
@@ -457,7 +457,7 @@ static unsigned int sd_zbc_zone_wp_update(struct scsi_cmnd *cmd,*/ spin_lock_irqsave (&sdkp->zones_wp_offset_lock, flags); -if (result && op !=REQ_OP_ZONE_RESET_ALL ) { +if (result.combined && op !=REQ_OP_ZONE_RESET_ALL ) {if (op ==REQ_OP_ZONE_APPEND ) {/* Force complete completion (no retry) */ good_bytes =0 ;
@@ -516,11 +516,11 @@ 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; +const union scsi_status result = cmd->status;struct request *rq = cmd->request;if (op_is_zone_mgmt (req_op (rq)) && - result && + result.combined && sshdr->sense_key ==ILLEGAL_REQUEST && sshdr->asc ==0x24 ) {/*
Bart Van Assche
maintainerPATCH 16/117 sr: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/sr.c | 16 +++++++++------- drivers/scsi/sr_ioctl.c | 5 +++-- 2 files changed, 12 insertions(+), 9 deletions(-)
drivers/scsi/sr.c +9 -7
@@ -237,7 +237,7 @@ static unsigned int sr_check_events(struct cdrom_device_info *cdi,bool last_present;struct scsi_sense_hdr sshdr;unsigned int events; -int ret; +union scsi_status ret;/* no changer support */ if (CDSL_CURRENT != slot)
@@ -273,7 +273,8 @@ static unsigned int sr_check_events(struct cdrom_device_info *cdi, do_tur:/* let's see whether the media is there with TUR */ last_present = cd->media_present; - ret =scsi_test_unit_ready (cd->device,SR_TIMEOUT ,MAX_RETRIES , &sshdr); + ret.combined =scsi_test_unit_ready (cd->device,SR_TIMEOUT ,MAX_RETRIES , + &sshdr);/* * Media is considered to be present if TUR succeeds or fails with
@@ -321,15 +322,15 @@ static unsigned int sr_check_events(struct cdrom_device_info *cdi,*/ static int sr_done (struct scsi_cmnd *SCpnt) { -int result = SCpnt->result; +const union scsi_status result = SCpnt->status;int this_count =scsi_bufflen (SCpnt); -int good_bytes = (result ==0 ? this_count :0 ); +int good_bytes = result.combined ==0 ? this_count :0 ;int block_sectors =0 ;long error_sector;struct scsi_cd *cd =scsi_cd (SCpnt->request->rq_disk);#ifdef DEBUG -scmd_printk (KERN_INFO , SCpnt,"done: %x\n" , result); +scmd_printk (KERN_INFO , SCpnt,"done: %x\n" , result.combined);#endif /*
@@ -882,7 +883,8 @@ static void get_capabilities(struct scsi_cd *cd)struct scsi_mode_data data;struct scsi_sense_hdr sshdr;unsigned int ms_len =128 ; -int rc, n; +union scsi_status rc; +int n;static const char *loadmech[] = {
@@ -908,7 +910,7 @@ static void get_capabilities(struct scsi_cd *cd)scsi_test_unit_ready (cd->device,SR_TIMEOUT ,MAX_RETRIES , &sshdr);/* ask for mode page 0x2a */ - rc =scsi_mode_sense (cd->device,0 ,0x2a , buffer, ms_len, + rc.combined =scsi_mode_sense (cd->device,0 ,0x2a , buffer, ms_len,SR_TIMEOUT ,3 , &data,NULL ); if (!scsi_status_is_good(rc) || data.length > ms_len ||
drivers/scsi/sr_ioctl.c +3 -2
@@ -187,7 +187,8 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) {struct scsi_device *SDev;struct scsi_sense_hdr local_sshdr, *sshdr = &local_sshdr; -int result, err =0 , retries =0 ; +union scsi_status result; +int err =0 , retries =0 ; SDev = cd->device;
@@ -200,7 +201,7 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) goto out; } - result =scsi_execute (SDev, cgc->cmd, cgc->data_direction, + result.combined =scsi_execute (SDev, cgc->cmd, cgc->data_direction, cgc->buffer, cgc->buflen,NULL , sshdr, cgc->timeout,IOCTL_RETRIES ,0 ,0 ,NULL );
Bart Van Assche
maintainerPATCH 17/117 st: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/st.c | 23 ++++++++++++----------- drivers/scsi/st.h | 5 +++-- 2 files changed, 15 insertions(+), 13 deletions(-)
drivers/scsi/st.c +12 -11
@@ -360,13 +360,13 @@ 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; +union scsi_status result = SRpnt->status;u8 scode; DEB(const char *stp;)char *name =tape_name (STp);struct st_cmdstatus *cmdstatp; -if (!result) +if (!result.combined)return 0 ; cmdstatp = &STp->buffer->cmdstat;
@@ -380,7 +380,7 @@ static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt) DEB( if (debugging) {st_printk (ST_DEB_MSG , STp, -"Error: %x, cmd: %x %x %x %x %x %x\n" , result, +"Error: %x, cmd: %x %x %x %x %x %x\n" , result.combined, SRpnt->cmd[0 ], SRpnt->cmd[1 ], SRpnt->cmd[2 ], SRpnt->cmd[3 ], SRpnt->cmd[4 ], SRpnt->cmd[5 ]);if (cmdstatp->have_sense)
@@ -390,8 +390,9 @@ static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt)if (!debugging) {/* Abnormal conditions for tape */ if (!cmdstatp->have_sense)st_printk (KERN_WARNING , STp, -"Error %x (driver bt 0x%x, host bt 0x%x).\n" , - result,driver_byte (result),host_byte (result)); +"Error %x (driver bt 0x%x, host bt 0x%x).\n" , + result.combined,driver_byte (result), +host_byte (result)); else if (cmdstatp->have_sense && scode != NO_SENSE && scode != RECOVERED_ERROR &&
@@ -484,7 +485,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)->status.combined) {atomic64_add (atomic_read (&STp->stats->last_write_size) - STp->buffer->cmdstat.residual, &STp->stats->write_byte_cnt);
@@ -498,7 +499,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)->status.combined) {atomic64_add (atomic_read (&STp->stats->last_read_size) - STp->buffer->cmdstat.residual, &STp->stats->read_byte_cnt);
@@ -522,7 +523,7 @@ static void st_scsi_execute_end(struct request *req, blk_status_t status)struct scsi_tape *STp = SRpnt->stp;struct bio *tmp; - STp->buffer->cmdstat.midlevel_result = SRpnt->result = rq->result; + STp->buffer->cmdstat.midlevel_status = SRpnt->status = rq->status; STp->buffer->cmdstat.residual = rq->resid_len;st_do_stats (STp, req);
@@ -718,7 +719,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_status.combined, retval);) /* end DEB */return retval; }
@@ -752,7 +753,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_status.combined !=0 )st_printk (KERN_ERR , STp,"Stepping over filemark %s failed.\n" , forward ?"forward" :"backward" );
@@ -1118,7 +1119,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->status.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) |
drivers/scsi/st.h +3 -2
@@ -7,10 +7,11 @@#include <linux/mutex.h> #include <linux/kref.h> #include <scsi/scsi_cmnd.h> +#include <scsi/scsi_status.h> /* Descriptor for analyzed sense data */ struct st_cmdstatus { -int midlevel_result; +union scsi_status midlevel_status;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; +union scsi_status status;struct scsi_tape *stp;struct completion *waiting;struct bio *bio;
Bart Van Assche
maintainerPATCH 18/117 sg: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/sg.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/scsi/sg.c +6 -5
@@ -1344,7 +1344,8 @@ sg_rq_end_io(struct request *rq, blk_status_t status)unsigned long iflags;unsigned int ms;char *sense; -int result, resid, done =1 ; +union scsi_status result; +int resid, done =1 ;if (WARN_ON (srp->done !=0 ))return ;
@@ -1358,20 +1359,20 @@ 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->status; resid = req->resid_len;SCSI_LOG_TIMEOUT (4 ,sg_printk (KERN_INFO , sdp,"sg_cmd_done: pack_id=%d, res=0x%x\n" , - srp->header.pack_id, result)); + srp->header.pack_id, result.combined)); srp->header.resid = resid; ms =jiffies_to_msecs (jiffies); srp->header.duration = (ms > srp->header.duration) ? (ms - srp->header.duration) :0 ; -if (0 != result) { +if (0 != result.combined) {struct scsi_sense_hdr sshdr; - srp->header.status =0xff & result; + srp->header.status =0xff & result.combined; srp->header.masked_status =status_byte (result); srp->header.msg_status =msg_byte (result); srp->header.host_status =host_byte (result);
Bart Van Assche
maintainerPATCH 19/117 3w*: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/3w-9xxx.c | 12 ++++++------ drivers/scsi/3w-sas.c | 8 ++++---- drivers/scsi/3w-xxxx.c | 20 ++++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-)
drivers/scsi/3w-9xxx.c +6 -6
@@ -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]->status.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->status.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->status.combined = (DID_OK <<16 ) |SAM_STAT_CHECK_CONDITION ; }/* 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->status.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->status.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->status.combined = (DID_ERROR <<16 );if (twa_command_mapped (SCpnt))scsi_dma_unmap (SCpnt);done (SCpnt);
drivers/scsi/3w-sas.c +4 -4
@@ -887,7 +887,7 @@ static int twl_fill_sense(TW_Device_Extension *tw_dev, int i, int request_id, inif (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]->status.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->status.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_resstruct scsi_cmnd *cmd = tw_dev->srb[i];if (cmd) { - cmd->result = (DID_RESET <<16 ); + cmd->status.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->status.combined = (DID_ERROR <<16 );done (SCpnt); retval =0 ; }
drivers/scsi/3w-xxxx.c +10 -10
@@ -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]->status.combined = (DID_OK <<16 ) |SAM_STAT_CHECK_CONDITION ;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]->status.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->status.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]->status.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]->status.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]->status.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]->status.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_cif (retval) { tw_dev->state[request_id] =TW_S_COMPLETED ;tw_state_request_finish (tw_dev, request_id); - SCpnt->result = (DID_ERROR <<16 ); + SCpnt->status.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]->status.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]->status.combined = (DID_OK <<16 ) |SAM_STAT_CHECK_CONDITION ; }/* Now complete the io */
Bart Van Assche
maintainerPATCH 20/117 53c700: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/53c700.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/53c700.c +2 -2
@@ -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->status.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->status.combined =DID_RESET <<16 ; SCp->scsi_done (SCp); }mdelay (25 );
Bart Van Assche
maintainerPATCH 21/117 BusLogic: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/BusLogic.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-)
drivers/scsi/BusLogic.c +13 -12
@@ -2615,11 +2615,11 @@ static void blogic_qcompleted_ccb(struct blogic_ccb *ccb)the Host Adapter Status and Target Device Status. */ -static int blogic_resultcode (struct blogic_adapter *adapter, +static union scsi_status blogic_resultcode (struct blogic_adapter *adapter,enum blogic_adapter_status adapter_status,enum blogic_tgt_status tgt_status) { -int hoststatus; +enum host_status hoststatus;switch (adapter_status) {case BLOGIC_CMD_CMPLT_NORMAL :
@@ -2664,7 +2664,8 @@ static int blogic_resultcode(struct blogic_adapter *adapter, hoststatus =DID_ERROR ;break ; } -return (hoststatus <<16 ) | tgt_status; +return (union scsi_status ){ + .b.host = hoststatus, .b.status = (enum sam_status )tgt_status}; }
@@ -2775,7 +2776,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->status.combined =DID_RESET <<16 ; command->scsi_done (command); command = nxt_cmd; }
@@ -2792,7 +2793,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->status.combined =DID_RESET <<16 ; command->scsi_done (command); } adapter->bdr_pend[tgt_id] =NULL ;
@@ -2813,16 +2814,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->status.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->status.combined =DID_ABORT <<16 ;break ;case BLOGIC_CMD_COMPLETE_ERROR : - command->result =blogic_resultcode (adapter, + command->status =blogic_resultcode (adapter, ccb->adapter_status, ccb->tgt_status);if (ccb->adapter_status !=BLOGIC_SELECT_TIMEOUT ) { adapter->tgt_stats[ccb->tgt_id]
@@ -2830,7 +2831,7 @@ 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->status.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 +3043,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->status.combined =DID_OK <<16 ;comp_cb (command);return 0 ; }
@@ -3060,7 +3061,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->status.combined =DID_ERROR <<16 ;comp_cb (command);return 0 ; }
@@ -3211,7 +3212,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->status.combined =DID_ERROR <<16 ; command->scsi_done (command); } }
Bart Van Assche
maintainerPATCH 22/117 NCR5380: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/NCR5380.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/scsi/NCR5380.c +15 -15
@@ -538,7 +538,7 @@ static void complete_cmd(struct Scsi_Host *instance,if (hostdata->sensing == cmd) {/* Autosense processing ends here */ -if (status_byte (cmd->result) !=GOOD ) { +if (status_byte (cmd->status) !=GOOD ) {scsi_eh_restore_cmnd (cmd, &hostdata->ses); }else {scsi_eh_restore_cmnd (cmd, &hostdata->ses);
@@ -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->status.combined = (DID_ERROR <<16 ); cmd->scsi_done (cmd); return 0; }#endif /* (NDEBUG & NDEBUG_NO_WRITE) */ - cmd->result =0 ; + cmd->status.combined =0 ;spin_lock_irqsave (&hostdata->lock, flags);
@@ -961,7 +961,7 @@ static irqreturn_t __maybe_unused NCR5380_intr(int irq, void *dev_id)* SELECT interrupt will be disabled. * * If failed (no target) : cmd->scsi_done() will be called, and the -* cmd->result host byte set to DID_BAD_TARGET. +* cmd->status host byte set to DID_BAD_TARGET. */ static bool NCR5380_select (struct Scsi_Host *instance,struct scsi_cmnd *cmd)
@@ -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->status.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->status.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->status.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->status.combined &= ~0xffff ; + cmd->status.combined |= cmd->SCp.Status; + cmd->status.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->status.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->status.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->status.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->status.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->status.combined =DID_RESET <<16 ; scmd->scsi_done (scmd); }INIT_LIST_HEAD (&hostdata->unissued);
Bart Van Assche
maintainerPATCH 23/117 a100u2w: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/a100u2w.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/a100u2w.c +1 -1
@@ -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->status.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 */
Bart Van Assche
maintainerPATCH 24/117 aacraid: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/aacraid/aachba.c | 142 +++++++++++++++++----------------- 1 file changed, 71 insertions(+), 71 deletions(-)
drivers/scsi/aacraid/aachba.c +71 -71
@@ -556,7 +556,7 @@ static void get_container_name_callback(void *context, struct fib * fibptr) } } - scsicmd->result =DID_OK <<16 |SAM_STAT_GOOD ; + scsicmd->status.combined =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->status.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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.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->status.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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =SAM_STAT_GOOD ; }else {/* vpd page not implemented */ - scsicmd->result =DID_OK <<16 |SAM_STAT_CHECK_CONDITION ; + scsicmd->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.combined =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->status.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->status.combined =0 ;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->status.combined =DID_ERROR <<16 ;break ;case INQUIRY : - scsicmd->result =DID_OK <<16 ; + scsicmd->status.combined =0 ;break ;default : - scsicmd->result =DID_OK <<16 ; + scsicmd->status.combined =0 ;break ; }break ;case SRB_STATUS_ABORTED : - scsicmd->result =DID_ABORT <<16 ; + scsicmd->status.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->status.combined =DID_ERROR <<16 ;break ;case SRB_STATUS_PARITY_ERROR : - scsicmd->result =DID_PARITY <<16 ; + scsicmd->status.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->status.combined =DID_NO_CONNECT <<16 ;break ;case SRB_STATUS_COMMAND_TIMEOUT :case SRB_STATUS_TIMEOUT : - scsicmd->result =DID_TIME_OUT <<16 ; + scsicmd->status.combined =DID_TIME_OUT <<16 ;break ;case SRB_STATUS_BUSY : - scsicmd->result =DID_BUS_BUSY <<16 ; + scsicmd->status.combined =DID_BUS_BUSY <<16 ;break ;case SRB_STATUS_BUS_RESET : - scsicmd->result =DID_RESET <<16 ; + scsicmd->status.combined =DID_RESET <<16 ;break ;case SRB_STATUS_MESSAGE_REJECTED : - scsicmd->result =DID_ERROR <<16 ; + scsicmd->status.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->status.combined = 0; } else { - scsicmd->result = DID_ERROR << 16; + scsicmd->status.combined = DID_ERROR << 16; } } else { - scsicmd->result =DID_ERROR <<16 ; + scsicmd->status.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->status.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->status.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->status.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->status.combined |=0 ;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->status.combined |=0 ;break ; }case SAM_STAT_BUSY : - scsicmd->result |=DID_BUS_BUSY <<16 ; + scsicmd->status.combined |=DID_BUS_BUSY <<16 ;break ;case SAM_STAT_TASK_ABORTED : - scsicmd->result |=DID_ABORT <<16 ; + scsicmd->status.combined |=DID_ABORT <<16 ;break ;case SAM_STAT_RESERVATION_CONFLICT :case SAM_STAT_TASK_SET_FULL :default : - scsicmd->result |=DID_ERROR <<16 ; + scsicmd->status.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->status.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->status.combined =SAM_STAT_BUSY ;break ;case HBA_RESP_STAT_IO_ABORTED : - scsicmd->result =DID_ABORT <<16 ; + scsicmd->status.combined =DID_ABORT <<16 ;break ;case HBA_RESP_STAT_INVALID_DEVICE : - scsicmd->result =DID_NO_CONNECT <<16 ; + scsicmd->status.combined =DID_NO_CONNECT <<16 ;break ;case HBA_RESP_STAT_UNDERRUN :/* UNDERRUN is OK */ - scsicmd->result =DID_OK <<16 ; + scsicmd->status.combined =0 ;break ;case HBA_RESP_STAT_OVERRUN :default : - scsicmd->result =DID_ERROR <<16 ; + scsicmd->status.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->status.combined =0 ; 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->status.combined =DID_ERROR <<16 ;break ;case HBA_RESP_SVCRES_TMF_LUN_INVALID : - scsicmd->result =DID_NO_CONNECT <<16 ; + scsicmd->status.combined =DID_NO_CONNECT <<16 ;break ;case HBA_RESP_SVCRES_TMF_COMPLETE :case HBA_RESP_SVCRES_TMF_SUCCEEDED : - scsicmd->result =DID_OK <<16 ; + scsicmd->status.combined =0 ;break ;default : - scsicmd->result =DID_ERROR <<16 ; + scsicmd->status.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->status.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->status.combined =DID_NO_CONNECT <<16 ; scsicmd->scsi_done (scsicmd);return 0 ; }
Bart Van Assche
maintainerPATCH 25/117 acornscsi: Annotate fallthrough
In reply to Bart Van AsscheThis patch suppresses the following compiler warning:
In file included from ./include/linux/bitops.h:32:0,
from ./include/linux/kernel.h:11,
from ./include/linux/list.h:9,
from ./include/linux/module.h:12,
from drivers/scsi/arm/acornscsi.c:116:drivers/scsi/arm/acornscsi.c: In function 'acornscsi_abort':./arch/arm/include/asm/bitops.h:181:55: warning: this statement may fall through [-Wimplicit-fallthrough=]
(__builtin_constant_p(nr) ? ____atomic_##name(nr, p) : _##name(nr,p)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~./arch/arm/include/asm/bitops.h:190:27: note: in expansion of macro 'ATOMIC_BITOP'
#define clear_bit(nr,p) ATOMIC_BITOP(clear_bit,nr,p)
^~~~~~~~~~~~drivers/scsi/arm/acornscsi.c:2667:3: note: in expansion of macro 'clear_bit'
clear_bit(SCpnt->device->id * 8 +
^~~~~~~~~drivers/scsi/arm/acornscsi.c:2675:2: note: here
case res_success:
^~~~
--- drivers/scsi/arm/acornscsi.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/arm/acornscsi.c +1 -0
@@ -2664,6 +2664,7 @@ int acornscsi_abort(struct scsi_cmnd *SCpnt)//#endif clear_bit (SCpnt->device->id *8 + (u8)(SCpnt->device->lun &0x7 ), host->busyluns); + fallthrough;/* * We found the command, and cleared it out. Either
Bart Van Assche
maintainerPATCH 26/117 acornscsi: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/arm/acornscsi.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-)
drivers/scsi/arm/acornscsi.c +15 -14
@@ -168,7 +168,7 @@ unsigned int sdtr_period = SDTR_PERIOD;unsigned int sdtr_size =SDTR_SIZE ;static void acornscsi_done (AS_Host *host,struct scsi_cmnd **SCpntp, -unsigned int result); +enum host_status result);static int acornscsi_reconnect_finish (AS_Host *host);static void acornscsi_dma_cleanup (AS_Host *host);static void acornscsi_abortcmd (AS_Host *host,unsigned char tag);
@@ -773,14 +773,13 @@ intr_ret_t acornscsi_kick(AS_Host *host)return INTR_PROCESSING ; } -/* -* Function: void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp, unsigned int result) -* Purpose : complete processing for command -* Params : host - interface that completed -* result - driver byte of result +/** +* acornscsi_done - complete processing for command +* @host: interface that completed +* @result: host status byte (DID_...) */ static void acornscsi_done (AS_Host *host,struct scsi_cmnd **SCpntp, -unsigned int result) +enum host_status result) {struct scsi_cmnd *SCpnt = *SCpntp;
@@ -794,7 +793,9 @@ 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->status = (union scsi_status ){ + .b.host = result, .b.msg = host->scsi.SCp.Message, + .b.status = host->scsi.SCp.Status};/* * In theory, this should not happen. In practice, it seems to.
@@ -833,7 +834,7 @@ static void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp, xfer_warn =0 ;if (xfer_warn) { -switch (status_byte (SCpnt->result)) { +switch (status_byte (SCpnt->status)) {case CHECK_CONDITION :case COMMAND_TERMINATED :case BUSY :
@@ -844,7 +845,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->status.combined);scsi_print_command (SCpnt);acornscsi_dumpdma (host,"done" );acornscsi_dumplog (host, SCpnt->device->id);
@@ -2470,7 +2471,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->status.combined =DID_NO_CONNECT <<16 ;done (SCpnt);return 0 ; }
@@ -2478,7 +2479,7 @@ static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt, SCpnt->scsi_done = done; SCpnt->host_scribble =NULL ; - SCpnt->result =0 ; + SCpnt->status.combined =0 ; SCpnt->tag =0 ; SCpnt->SCp.phase = (int )acornscsi_datadirection (SCpnt->cmnd[0 ]); SCpnt->SCp.sent_command =0 ;
@@ -2492,7 +2493,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->status.combined =DID_ERROR <<16 ;done (SCpnt);return 0 ; }
@@ -2523,7 +2524,7 @@ static inline void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1,if (SCpnt) { *SCpntp1 =NULL ; - SCpnt->result = result; + SCpnt->status.combined = result; SCpnt->scsi_done (SCpnt); }
Bart Van Assche
maintainerPATCH 27/117 advansys: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/advansys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/advansys.c +2 -2
@@ -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->status.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->status.combined =0 ;switch (qdonep->d3.done_stat) {case QD_NO_ERROR :ASC_DBG (2 ,"QD_NO_ERROR\n" );
Bart Van Assche
maintainerPATCH 28/117 aha*: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/aha152x.c | 4 ++-- drivers/scsi/aha1542.c | 4 ++-- drivers/scsi/aha1740.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/scsi/aha152x.c +2 -2
@@ -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 ->status.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->status.combined =DID_RESET <<16 ; ptr->scsi_done (ptr); }
drivers/scsi/aha1542.c +2 -2
@@ -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->status.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->status.combined =0 ; cmd->scsi_done (cmd);return 0 ; }
drivers/scsi/aha1740.c +2 -2
@@ -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->status.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->status.combined =0 ;done (SCpnt);return 0 ; }
Bart Van Assche
maintainerPATCH 29/117 aic*: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- 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 ++++++++-------- 4 files changed, 25 insertions(+), 25 deletions(-)
drivers/scsi/aic7xxx/aic79xx_osm.c +5 -5
@@ -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->status.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->status.combined & (CAM_DEV_QFRZN <<16 )) !=0 ) { + cmd->status.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->status.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->status.b.driver !=DRIVER_SENSE ) { do_fallback =1 ; }else {struct scsi_sense_data *sense;
drivers/scsi/aic7xxx/aic79xx_osm.h +8 -8
@@ -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->status.combined &= ~(CAM_STATUS_MASK <<16 ); + cmd->status.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->status.combined &= ~0xFFFF ; + cmd->status.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->status.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->status.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->status.combined & (CAM_DEV_QFRZN <<16 )) ==0 ) { + scb->io_ctx->status.combined |=CAM_DEV_QFRZN <<16 ; scb->platform_data->dev->qfrozen++; } }
drivers/scsi/aic7xxx/aic7xxx_osm.c +4 -4
@@ -531,7 +531,7 @@ ahc_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmndahc_lock (ahc, &flags);if (ahc->platform_data->qfrozen ==0 ) { cmd->scsi_done = scsi_done; - cmd->result =CAM_REQ_INPROG <<16 ; + cmd->status.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->status.combined & (CAM_DEV_QFRZN <<16 )) !=0 ) { + cmd->status.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->status.b.driver =DRIVER_SENSE ;#ifdef AHC_DEBUG if (ahc_debug &AHC_SHOW_SENSE ) {int i;
drivers/scsi/aic7xxx/aic7xxx_osm.h +8 -8
@@ -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->status.combined &= ~(CAM_STATUS_MASK <<16 ); + cmd->status.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->status.combined &= ~0xFFFF ; + cmd->status.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->status.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->status.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->status.combined & (CAM_DEV_QFRZN <<16 )) ==0 ) { + scb->io_ctx->status.combined |=CAM_DEV_QFRZN <<16 ; scb->platform_data->dev->qfrozen++; } }
Bart Van Assche
maintainerPATCH 30/117 arcmsr: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/arcmsr/arcmsr_hba.c | 38 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-)
drivers/scsi/arcmsr/arcmsr_hba.c +19 -19
@@ -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->status.combined = (DID_OK <<16 ) |SAM_STAT_CHECK_CONDITION ;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->status.b.driver =DRIVER_SENSE ; } }
@@ -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->status.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->status.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->status.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->status.combined =DID_NO_CONNECT <<16 ;arcmsr_ccb_complete (ccb);break ; }
@@ -1439,7 +1439,7 @@ static void arcmsr_drain_donequeue(struct AdapterControlBlock *acb, struct Commaif (pCCB->startdone ==ARCMSR_CCB_ABORTED ) {struct scsi_cmnd *abortcmd = pCCB->pcmd;if (abortcmd) { - abortcmd->result |=DID_ABORT <<16 ; + abortcmd->status.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->status.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->status.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->status.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->status.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->status.combined = (DID_NO_CONNECT <<16 ); cmd->scsi_done (cmd);return 0 ; } cmd->scsi_done = done; cmd->host_scribble =NULL ; - cmd->result =0 ; + cmd->status.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->status.combined = (DID_ERROR <<16 ) |SAM_STAT_RESERVATION_CONFLICT ; 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->status.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->status.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->status.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->status.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->status.combined =DID_ABORT <<16 ;arcmsr_ccb_complete (pCCB);continue ; }
Bart Van Assche
maintainerPATCH 32/117 atp870u: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/atp870u.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/scsi/atp870u.c +7 -7
@@ -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->status.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->status.combined =SAM_STAT_CHECK_CONDITION ; } }else - workreq->result =SAM_STAT_CHECK_CONDITION ; + workreq->status.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->status.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->status.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->status.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->status.combined =DID_BUS_BUSY <<16 ;done (req_p);return 0 ; }
Bart Van Assche
maintainerPATCH 33/117 be2iscsi: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/be2iscsi/be_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/scsi/be2iscsi/be_main.c +6 -6
@@ -1125,22 +1125,22 @@ be_complete_io(struct beiscsi_conn *beiscsi_conn,return ; } - task->sc->result = (DID_OK <<16 ) | status; + task->sc->status.combined = (DID_OK <<16 ) | status;if (rsp !=ISCSI_STATUS_CMD_COMPLETED ) { - task->sc->result =DID_ERROR <<16 ; + task->sc->status.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->status.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->status.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->status.combined = status; +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);dma_free_coherent (&phba->ctrl.pdev->dev, nonemb_cmd.size, nonemb_cmd.va, nonemb_cmd.dma);
Bart Van Assche
maintainerPATCH 31/117 ata: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/ata/libata-sata.c | 2 +- drivers/ata/libata-scsi.c | 64 +++++++++++++++++++++------------------ 2 files changed, 35 insertions(+), 31 deletions(-)
drivers/ata/libata-sata.c +1 -1
@@ -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->status = (union scsi_status ){ .b.host =DID_BAD_TARGET }; cmd->scsi_done (cmd); }return rc;
drivers/ata/libata-scsi.c +34 -30
223 lines not on this page · raw message
Bart Van Assche
maintainerPATCH 34/117 bfa: Use type int32_t to represent a signed integer
In reply to Bart Van AsscheSince a negative value may be assigned to 'rc', use a signed type for that variable.
--- drivers/scsi/bfa/bfad_bsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/bfa/bfad_bsg.c +1 -1
@@ -3552,7 +3552,7 @@ bfad_im_bsg_request(struct bsg_job *job) {struct fc_bsg_request *bsg_request = job->request;struct fc_bsg_reply *bsg_reply = job->reply; -uint32_t rc =BFA_STATUS_OK ; +int32_t rc =BFA_STATUS_OK ;switch (bsg_request->msgcode) {case FC_BSG_HST_VENDOR :
Bart Van Assche
maintainerPATCH 35/117 bfa: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/bfa/bfad_bsg.c | 12 ++++++------ drivers/scsi/bfa/bfad_im.c | 30 +++++++++++++++--------------- 2 files changed, 21 insertions(+), 21 deletions(-)
drivers/scsi/bfa/bfad_bsg.c +6 -6
@@ -3161,16 +3161,16 @@ bfad_im_bsg_vendor_request(struct bsg_job *job)/* Fill the BSG job reply data */ job->reply_len = job->reply_payload.payload_len; bsg_reply->reply_payload_rcv_len = job->reply_payload.payload_len; - bsg_reply->result = rc; + bsg_reply->status.combined = rc; -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rc; error:/* free the command buffer */ kfree (payload_kbuf); out: - bsg_reply->result = rc; + bsg_reply->status.combined = rc; job->reply_len =sizeof (uint32_t ); bsg_reply->reply_payload_rcv_len =0 ;return rc;
@@ -3538,10 +3538,10 @@ bfad_im_bsg_els_ct_request(struct bsg_job *job)kfree (bsg_fcpt);kfree (drv_fcxp); out: - bsg_reply->result = rc; + bsg_reply->status.combined = rc;if (rc ==BFA_STATUS_OK ) -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rc;
@@ -3567,7 +3567,7 @@ bfad_im_bsg_request(struct bsg_job *job) rc =bfad_im_bsg_els_ct_request (job);break ;default : - bsg_reply->result = rc = -EINVAL ; + bsg_reply->status.combined = rc = -EINVAL ; bsg_reply->reply_payload_rcv_len =0 ;break ; }
drivers/scsi/bfa/bfad_im.c +15 -15
@@ -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->status.combined = host_status <<16 | scsi_status;break ;case BFI_IOIM_STS_TIMEDOUT : - cmnd->result =DID_TIME_OUT <<16 ; + cmnd->status.combined =DID_TIME_OUT <<16 ;break ;case BFI_IOIM_STS_PATHTOV : - cmnd->result =DID_TRANSPORT_DISRUPTED <<16 ; + cmnd->status.combined =DID_TRANSPORT_DISRUPTED <<16 ;break ;default : - cmnd->result =DID_ERROR <<16 ; + cmnd->status.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->status.combined); itnim_data = cmnd->device->hostdata;if (itnim_data) { itnim = itnim_data->itnim; -if (!cmnd->result && itnim && +if (!cmnd->status.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->status.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->status.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->status.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->status.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->status.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->status.combined =DID_NO_CONNECT <<16 ;else - cmnd->result =DID_REQUEUE <<16 ; + cmnd->status.combined =DID_REQUEUE <<16 ;done (cmnd);return 0 ; }
@@ -1240,14 +1240,14 @@ bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmndprintk (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->status.combined =DID_NO_CONNECT <<16 ; goto out_fail_cmd; } itnim = itnim_data->itnim;if (!itnim) { - cmnd->result =DID_IMM_RETRY <<16 ; + cmnd->status.combined =DID_IMM_RETRY <<16 ; goto out_fail_cmd; }
Bart Van Assche
maintainerPATCH 36/117 bnx2fc: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/bnx2fc/bnx2fc_io.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/scsi/bnx2fc/bnx2fc_io.c +7 -7
@@ -198,10 +198,10 @@ static void bnx2fc_scsi_done(struct bnx2fc_cmd *io_req, int err_code)return ; } - sc_cmd->result = err_code <<16 ; + sc_cmd->status.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, + sc_cmd,host_byte (sc_cmd->status), sc_cmd->retries, sc_cmd->allowed);scsi_set_resid (sc_cmd,scsi_bufflen (sc_cmd)); sc_cmd->SCp.ptr =NULL ;
@@ -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->status.combined =0 ; }else {/* Transport status is good, SCSI status not good */ - sc_cmd->result = (DID_OK <<16 ) | io_req->cdb_status; + sc_cmd->status.combined = 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->status.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->status.combined =0 ; }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->status.combined = io_req->cdb_status;if (io_req->cdb_status ==SAM_STAT_TASK_SET_FULL || io_req->cdb_status ==SAM_STAT_BUSY ) {
Bart Van Assche
maintainerPATCH 37/117 cdrom: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/cdrom/cdrom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cdrom/cdrom.c +1 -1
@@ -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)->status.combined) {struct scsi_sense_hdr sshdr; ret = -EIO ;
Bart Van Assche
maintainerPATCH 38/117 csiostor: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/csiostor/csio_scsi.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/scsi/csiostor/csio_scsi.c +10 -8
@@ -1562,8 +1562,9 @@ csio_scsi_err_handler(struct csio_hw *hw, struct csio_ioreq *req)struct fcp_resp_with_ext *fcp_resp;struct fcp_resp_rsp_info *rsp_info;struct csio_dma_buf *dma_buf; -uint8_t flags, scsi_status =0 ; -uint32_t host_status =DID_OK ; +uint8_t flags; +enum sam_status scsi_status =SAM_STAT_GOOD ; +enum host_status host_status =DID_OK ;uint32_t rsp_len =0 , sns_len =0 ;struct csio_rnode *rn = (struct csio_rnode *)(cmnd->device->hostdata);
@@ -1719,7 +1720,8 @@ 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->status = (union scsi_status ){.b.host = host_status, + .b.status = scsi_status}; cmnd->scsi_done (cmnd);/* Wake up waiting threads */
@@ -1747,7 +1749,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->status.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 +1792,13 @@ csio_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmnd) nr =fc_remote_port_chkready (rport);if (nr) { - cmnd->result = nr; + cmnd->status.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->status.combined = (DID_REQUEUE <<16 );CSIO_INC_STATS (scsim, n_hw_nr_error); goto err_done; }
@@ -1978,14 +1980,14 @@ csio_eh_abort_handler(struct scsi_cmnd *cmnd)csio_scsi_cmnd (ioreq) =NULL ;spin_unlock_irq (&hw->lock); - cmnd->result = (DID_ERROR <<16 ); + cmnd->status.combined = (DID_ERROR <<16 ); cmnd->scsi_done (cmnd);return FAILED ; }/* FW successfully aborted the request */ -if (host_byte (cmnd->result) ==DID_REQUEUE ) { +if (host_byte (cmnd->status) ==DID_REQUEUE ) { csio_info(hw, "Aborted SCSI command to (%d:%llu) tag %u\n", cmnd->device->id, cmnd->device->lun,
Bart Van Assche
maintainerPATCH 39/117 cxlflash: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/cxlflash/main.c | 32 +++++++++++++++---------------- drivers/scsi/cxlflash/superpipe.c | 16 ++++++++-------- 2 files changed, 24 insertions(+), 24 deletions(-)
drivers/scsi/cxlflash/main.c +16 -16
@@ -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->status.combined = (DID_ERROR <<16 ); } dev_dbg(dev, "%s: cmd failed afu_rc=%02x scsi_rc=%02x fc_rc=%02x "
@@ -72,20 +72,20 @@ 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->status.combined = ioasa->rc.scsi_rc; }else - scp->result = ioasa->rc.scsi_rc | (DID_ERROR <<16 ); + scp->status.combined = ioasa->rc.scsi_rc | (DID_ERROR <<16 ); }/* -* We encountered an error. Set scp->result based on nature +* We encountered an error. Set scp->status based on nature * of error. */ if (ioasa->rc.fc_rc) {/* We have an FC status */ switch (ioasa->rc.fc_rc) {case SISL_FC_RC_LINKDOWN : - scp->result = (DID_REQUEUE <<16 ); + scp->status.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->status.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->status.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->status.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->status.combined = (DID_IMM_RETRY <<16 );break ;case SISL_AFU_DMA_ERR_INVALID_EA :default : - scp->result = (DID_ERROR <<16 ); + scp->status.combined = (DID_ERROR <<16 ); }break ;case SISL_AFU_RC_OUT_OF_DATA_BUFS :/* Retry */ - scp->result = (DID_ALLOC_FAILURE <<16 ); + scp->status.combined = (DID_ALLOC_FAILURE <<16 );break ;default : - scp->result = (DID_ERROR <<16 ); + scp->status.combined = (DID_ERROR <<16 ); } } }
@@ -167,10 +167,10 @@ 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->status.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->status.combined, cmd->sa.ioasc); scp->scsi_done (scp); }else if (cmd->cmd_tmf) {spin_lock_irqsave (&cfg->tmf_slock, lock_flags);
@@ -204,7 +204,7 @@ static void flush_pending_cmds(struct hwq *hwq)if (cmd->scp) { scp = cmd->scp; - scp->result = (DID_IMM_RETRY <<16 ); + scp->status.combined = (DID_IMM_RETRY <<16 ); scp->scsi_done (scp); }else { cmd->cmd_aborted = true;
@@ -600,7 +600,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->status.combined = (DID_NO_CONNECT <<16 ); scp->scsi_done (scp); rc =0 ; goto out;
drivers/scsi/cxlflash/superpipe.c +8 -8
@@ -336,7 +336,7 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli)u8 *cmd_buf =NULL ;u8 *scsi_cmd =NULL ;int rc =0 ; -int result =0 ; +union scsi_status result;int retry_cnt =0 ;u32 to =CMD_TIMEOUT *HZ ;
@@ -357,26 +357,26 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli)/* Drop the ioctl read semahpore across lengthy call */ up_read (&cfg->ioctl_rwsem); - result =scsi_execute (sdev, scsi_cmd,DMA_FROM_DEVICE , cmd_buf, + result.combined =scsi_execute (sdev, scsi_cmd,DMA_FROM_DEVICE , cmd_buf,CMD_BUFSIZE ,NULL , &sshdr, to,CMD_RETRIES ,0 ,0 ,NULL );down_read (&cfg->ioctl_rwsem); rc =check_state (cfg);if (rc) {dev_err (dev,"%s: Failed state result=%08x\n" , - __func__, result); + __func__, result.combined); rc = -ENODEV ; goto out; }if (driver_byte (result) ==DRIVER_SENSE ) { - result &= ~(0xFF <<24 );/* DRIVER_SENSE is not an error */ -if (result &SAM_STAT_CHECK_CONDITION ) { + result.b.driver =DRIVER_OK ;/* DRIVER_SENSE is not an error */ +if (result.b.status &SAM_STAT_CHECK_CONDITION ) {switch (sshdr.sense_key) {case NO_SENSE :case RECOVERED_ERROR :case NOT_READY : - result &= ~SAM_STAT_CHECK_CONDITION ; + result.b.status &= ~SAM_STAT_CHECK_CONDITION ;break ;case UNIT_ATTENTION :switch (sshdr.asc) {
@@ -398,9 +398,9 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli) } } -if (result) { +if (result.combined) {dev_err (dev,"%s: command failed, result=%08x\n" , - __func__, result); + __func__, result.combined); rc = -EIO ; goto out; }
Bart Van Assche
maintainerPATCH 40/117 dc395x: Use the set_{host,msg,status}_byte() functions
In reply to Bart Van AsscheUse the set_{host,msg,status}_byte() functions instead of the SET_RES_*() macros. This patch does not change any functionality.
--- drivers/scsi/dc395x.c | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-)
drivers/scsi/dc395x.c +9 -20
@@ -160,22 +160,11 @@#define DC395x_write16 (acb,address,value) outw((value), acb->io_port_base + (address))#define DC395x_write32 (acb,address,value) outl((value), acb->io_port_base + (address)) -/* cmd->result */ -#define RES_TARGET 0x000000FF/* Target State */ -#define RES_TARGET_LNX STATUS_MASK/* Only official ... */ -#define RES_ENDMSG 0x0000FF00/* End Message */ #define RES_DID 0x00FF0000/* DID_ codes */ -#define RES_DRV 0xFF000000/* DRIVER_ codes */ #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_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 TAG_NONE 255/*
@@ -3244,7 +3233,7 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, cmd->result =MK_RES_LNX (DRIVER_SENSE ,DID_OK , srb->end_message,CHECK_CONDITION ); -/*SET_RES_DID(cmd->result,DID_OK) */ +/*set_host_byte(cmd,DID_OK) */ else cmd->result = MK_RES_LNX(DRIVER_SENSE, DID_OK,
@@ -3280,9 +3269,9 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, cmd->result =DID_NO_CONNECT <<16 ; }else { srb->adapter_status =0 ; -SET_RES_DID (cmd->result,DID_ERROR ); -SET_RES_MSG (cmd->result, srb->end_message); -SET_RES_TARGET (cmd->result, status); +set_host_byte (cmd,DID_ERROR ); +set_msg_byte (cmd, srb->end_message); +set_status_byte (cmd, status); } }else {
@@ -3292,16 +3281,16 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, status = srb->adapter_status;if (status &H_OVER_UNDER_RUN ) { srb->target_status =0 ; -SET_RES_DID (cmd->result,DID_OK ); -SET_RES_MSG (cmd->result, srb->end_message); +set_host_byte (cmd,DID_OK ); +set_msg_byte (cmd, srb->end_message); }else if (srb->status &PARITY_ERROR ) { -SET_RES_DID (cmd->result,DID_PARITY ); -SET_RES_MSG (cmd->result, srb->end_message); +set_host_byte (cmd,DID_PARITY ); +set_msg_byte (cmd, srb->end_message); }else {/* No error */ srb->adapter_status =0 ; srb->target_status =0 ; -SET_RES_DID (cmd->result,DID_OK ); +set_host_byte (cmd,DID_OK ); } }
Bart Van Assche
maintainerPATCH 41/117 dc395x: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/dc395x.c | 44 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 23 deletions(-)
drivers/scsi/dc395x.c +21 -23
@@ -160,10 +160,8 @@#define DC395x_write16 (acb,address,value) outw((value), acb->io_port_base + (address))#define DC395x_write32 (acb,address,value) outl((value), acb->io_port_base + (address)) -#define RES_DID 0x00FF0000/* DID_ codes */ - -#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 MK_RES (drv,did,msg_byte,tgt) ((union scsi_status){.b={.driver = (drv), .host = (did), .msg = (msg_byte), .status = (tgt)}}) +#define MK_RES_LNX (drv,did,msg,tgt) MK_RES((drv),(did),(msg),(tgt)<<1)#define TAG_NONE 255
@@ -975,7 +973,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->status.combined =DID_BAD_TARGET <<16 ;/* ignore invalid targets */ if (cmd->device->id >= acb->scsi_host->max_id ||
@@ -1002,7 +1000,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->status.combined =0 ; srb =list_first_entry_or_null (&acb->srb_free_list, struct ScsiReqBlk, list);
@@ -1239,7 +1237,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->status.combined =DID_ABORT <<16 ;return SUCCESS ; } srb =find_cmd (cmd, &dcb->srb_going_list);
@@ -3175,7 +3173,7 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,*/ srb->flag &= ~AUTO_REQSENSE ; srb->adapter_status =0 ; - srb->target_status =CHECK_CONDITION <<1 ; + srb->target_status =SAM_STAT_CHECK_CONDITION ;if (debug_enabled (DBG_1 )) {switch (cmd->sense_buffer[2 ] &0x0f ) {case NOT_READY :
@@ -3222,20 +3220,20 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, *((unsigned int *)(cmd->sense_buffer + 3))); } -if (status == (CHECK_CONDITION <<1 )) { - cmd->result =DID_BAD_TARGET <<16 ; +if (status ==SAM_STAT_CHECK_CONDITION ) { + cmd->status.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->status =MK_RES_LNX (DRIVER_SENSE ,DID_OK , srb->end_message,CHECK_CONDITION );/*set_host_byte(cmd,DID_OK) */ else - cmd->result = + cmd->status =MK_RES_LNX (DRIVER_SENSE ,DID_OK , srb->end_message,CHECK_CONDITION );
@@ -3266,13 +3264,13 @@ 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->status = (union scsi_status ){ + .b.host =DID_NO_CONNECT }; }else { srb->adapter_status =0 ;set_host_byte (cmd,DID_ERROR );set_msg_byte (cmd, srb->end_message);set_status_byte (cmd, status); - } }else {/*
@@ -3311,15 +3309,15 @@ 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->status.b.host ==DID_OK && 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 ) || -status_byte (cmd->result) ==CHECK_CONDITION )) { +/* (host_byte(cmd->status) == DID_OK || status_byte(cmd->status) & CHECK_CONDITION) ) */ +if ((cmd->status.combined == (DID_OK <<16 ) || +status_byte (cmd->status) ==CHECK_CONDITION )) {if (!dcb->init_tcq_flag) {add_dev (acb, dcb, ptr); dcb->init_tcq_flag =1 ;
@@ -3346,7 +3344,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->status.combined);list_move_tail (&srb->list, &acb->srb_free_list); }else {dprintkl (KERN_ERR ,"srb_done: ERROR! Completed cmd with tmp_srb\n" );
@@ -3370,7 +3368,7 @@ static void doing_srb_done(struct AdapterCtlBlk *acb, u8 did_flag,struct scsi_cmnd *p;list_for_each_entry_safe (srb, tmp, &dcb->srb_going_list, list) { -int result; +union scsi_status result; p = srb->cmd; result =MK_RES (0 , did_flag,0 ,0 );
@@ -3379,7 +3377,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->status = result;pci_unmap_srb_sense (acb, srb);pci_unmap_srb (acb, srb);if (force) {
@@ -3400,14 +3398,14 @@ static void doing_srb_done(struct AdapterCtlBlk *acb, u8 did_flag,/* Waiting queue */ list_for_each_entry_safe (srb, tmp, &dcb->srb_waiting_list, list) { -int result; +union scsi_status result; p = srb->cmd; result =MK_RES (0 , did_flag,0 ,0 );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->status = result;pci_unmap_srb_sense (acb, srb);pci_unmap_srb (acb, srb);if (force) {
Bart Van Assche
maintainerPATCH 42/117 dpt_i2o: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/dpt_i2o.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/scsi/dpt_i2o.c +14 -14
@@ -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->status.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_cmndif ((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->status.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_ddefault :printk (KERN_WARNING "%s: scsi opcode 0x%x not supported.\n" , pHba->name, cmd->cmnd[0 ]); - cmd->result = (DID_ERROR <<16 ); + cmd->status.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->status.combined = (DID_OK <<16 );// handle underflow if (readl (reply+20 ) < cmd->underflow) { - cmd->result = (DID_ERROR <<16 ); + cmd->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined |= (dev_status);if (cmd->scsi_done !=NULL ){ cmd->scsi_done (cmd);
Bart Van Assche
maintainerPATCH 43/117 esas2r: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/esas2r/esas2r.h | 2 +- drivers/scsi/esas2r/esas2r_main.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/scsi/esas2r/esas2r.h +1 -1
@@ -1010,7 +1010,7 @@ void esas2r_complete_request_cb(struct esas2r_adapter *a,void esas2r_reset_detected (struct esas2r_adapter *a);void esas2r_target_state_changed (struct esas2r_adapter *ha,u16 targ_id,u8 state); -int esas2r_req_status_to_error (u8 req_stat); +enum host_status esas2r_req_status_to_error (u8 req_stat);void esas2r_kill_adapter (int i);void esas2r_free_request (struct esas2r_adapter *a,struct esas2r_request *rq);struct esas2r_request *esas2r_alloc_request (struct esas2r_adapter *a);
drivers/scsi/esas2r/esas2r_main.c +6 -6
@@ -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->status.combined =DID_OK <<16 ;if (unlikely (test_bit (AF_DEGRADED_MODE , &a->flags))) { - cmd->result =DID_NO_CONNECT <<16 ; + cmd->status.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->status.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->status.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->status.combined = ((esas2r_req_status_to_error (rq->req_stat) <<16 ) | (rq->func_rsp.scsi_rsp.scsi_stat &STATUS_MASK ));
@@ -1873,7 +1873,7 @@ void esas2r_target_state_changed(struct esas2r_adapter *a, u16 targ_id, }/* Translate status to a Linux SCSI mid-layer error code */ -int esas2r_req_status_to_error (u8 req_stat) +enum host_status esas2r_req_status_to_error (u8 req_stat) {switch (req_stat) {case RS_OVERRUN :
Bart Van Assche
maintainerPATCH 44/117 esp_scsi: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/esp_scsi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/esp_scsi.c +5 -5
@@ -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->status.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->status.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->status.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->status.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->status.combined =DID_ABORT <<16 ; cmd->scsi_done (cmd);esp_put_ent (esp, ent);
Bart Van Assche
maintainerPATCH 45/117 fas216: Fix two source code comments
In reply to Bart Van AsscheAll fas216_done() callers pass a host byte (DID_*) as argument. Additionally, fas216_done() passes its second argument 'result' to functions that interpret it as a host byte. Hence change the description of the second fas216*_done() argument from "driver byte" into "host byte".
--- drivers/scsi/arm/fas216.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/arm/fas216.c +2 -2
@@ -1999,7 +1999,7 @@ static void fas216_devicereset_done(FAS216_Info *info, struct scsi_cmnd *SCpnt,* fas216_rq_sns_done - Finish processing automatic request sense command * @info: interface that completed * @SCpnt: command that completed -* @result: driver byte of result +* @result: host byte of result * * Finish processing automatic request sense command */
@@ -2033,7 +2033,7 @@ static void fas216_rq_sns_done(FAS216_Info *info, struct scsi_cmnd *SCpnt,* fas216_std_done - finish processing of standard command * @info: interface that completed * @SCpnt: command that completed -* @result: driver byte of result +* @result: host byte of result * * Finish processing of standard command */
Bart Van Assche
maintainerPATCH 46/117 fas216: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/arm/fas216.c | 40 ++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-)
drivers/scsi/arm/fas216.c +21 -19
@@ -399,7 +399,7 @@ static void print_debug_list(void)printk ("\n" ); } -static void fas216_done (FAS216_Info *info,unsigned int result); +static void fas216_done (FAS216_Info *info,enum host_status result);/** * fas216_get_last_msg - retrive last message from the list
@@ -1986,7 +1986,7 @@ static void fas216_kick(FAS216_Info *info)* Clean up from issuing a BUS DEVICE RESET message to a device. */ static void fas216_devicereset_done (FAS216_Info *info,struct scsi_cmnd *SCpnt, -unsigned int result) +enum host_status result) {fas216_log (info,LOG_ERROR ,"fas216 device reset complete" );
@@ -2004,7 +2004,7 @@ static void fas216_devicereset_done(FAS216_Info *info, struct scsi_cmnd *SCpnt,* Finish processing automatic request sense command */ static void fas216_rq_sns_done (FAS216_Info *info,struct scsi_cmnd *SCpnt, -unsigned int result) +enum host_status result) { fas216_log_target(info, LOG_CONNECT, SCpnt->device->id, "request sense complete, result=0x%04x%02x%02x",
@@ -2020,7 +2020,7 @@ static void fas216_rq_sns_done(FAS216_Info *info, struct scsi_cmnd *SCpnt,//printk("scsi%d.%c: sense buffer: ", info->host->host_no, '0' + SCpnt->device->id); //{ int i; for (i = 0; i < 32; i++) printk("%02x ", SCpnt->sense_buffer[i]); printk("\n"); } /* -* Note that we don't set SCpnt->result, since that should +* Note that we don't set SCpnt->status since that should * reflect the status of the command that we were asked by * the upper layers to process. This would have been set * correctly by fas216_std_done.
@@ -2038,36 +2038,38 @@ static void fas216_rq_sns_done(FAS216_Info *info, struct scsi_cmnd *SCpnt,* Finish processing of standard command */ static void -fas216_std_done (FAS216_Info *info,struct scsi_cmnd *SCpnt,unsigned int result) +fas216_std_done (FAS216_Info *info,struct scsi_cmnd *SCpnt, +enum host_status result) { info->stats.fins +=1 ; - SCpnt->result = result <<16 | info->scsi.SCp.Message <<8 | - info->scsi.SCp.Status; + SCpnt->status = (union scsi_status ){.b.host = result, + .b.msg = info->scsi.SCp.Message, + .b.status = info->scsi.SCp.Status};fas216_log_command (info,LOG_CONNECT , SCpnt, -"command complete, result=0x%08x" , SCpnt->result); +"command complete, result=0x%08x" , SCpnt->status.combined);/* * If the driver detected an error, we're all done. */ -if (host_byte (SCpnt->result) !=DID_OK || -msg_byte (SCpnt->result) !=COMMAND_COMPLETE ) +if (host_byte (SCpnt->status) !=DID_OK || +msg_byte (SCpnt->status) !=COMMAND_COMPLETE ) goto done;/* * If the command returned CHECK_CONDITION or COMMAND_TERMINATED * status, request the sense information. */ -if (status_byte (SCpnt->result) ==CHECK_CONDITION || -status_byte (SCpnt->result) ==COMMAND_TERMINATED ) +if (status_byte (SCpnt->status) ==CHECK_CONDITION || +status_byte (SCpnt->status) ==COMMAND_TERMINATED ) goto request_sense;/* * If the command did not complete with GOOD status, * we are all done here. */ -if (status_byte (SCpnt->result) !=GOOD ) +if (status_byte (SCpnt->status) !=GOOD ) goto done;/*
@@ -2087,7 +2089,7 @@ 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->status.combined, info->scsi.SCp.ptr, info->scsi.SCp.this_residual);scsi_print_command (SCpnt);set_host_byte (SCpnt,DID_ERROR );
@@ -2132,13 +2134,13 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result)/** * fas216_done - complete processing for current command * @info: interface that completed -* @result: driver byte of result +* @result: host byte of result * * Complete processing for current command */ -static void fas216_done (FAS216_Info *info,unsigned int result) +static void fas216_done (FAS216_Info *info,enum host_status result) { -void (*fn)(FAS216_Info *,struct scsi_cmnd *,unsigned int ); +void (*fn)(FAS216_Info *,struct scsi_cmnd *,enum host_status );struct scsi_cmnd *SCpnt;unsigned long flags;
@@ -2178,7 +2180,7 @@ static void fas216_done(FAS216_Info *info, unsigned int result)clear_bit (SCpnt->device->id *8 + (u8)(SCpnt->device->lun &0x7 ), info->busyluns); - fn = (void (*)(FAS216_Info *,struct scsi_cmnd *,unsigned int ))SCpnt->host_scribble; + fn = (void *)SCpnt->host_scribble;fn (info, SCpnt, result);if (info->scsi.irq) {
@@ -2216,7 +2218,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->status.combined =0 ;init_SCp (SCpnt);
Bart Van Assche
maintainerPATCH 47/117 fc: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/scsi_transport_fc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/scsi_transport_fc.c +4 -4
@@ -4153,9 +4153,9 @@ static int fc_bsg_host_dispatch(struct Scsi_Host *shost, struct bsg_job *job)/* return the errno failure code as the only status */ BUG_ON (job->reply_len <sizeof (uint32_t )); bsg_reply->reply_payload_rcv_len =0 ; - bsg_reply->result = ret; + bsg_reply->status.combined = ret; job->reply_len =sizeof (uint32_t ); -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return 0 ; }
@@ -4222,9 +4222,9 @@ static int fc_bsg_rport_dispatch(struct Scsi_Host *shost, struct bsg_job *job)/* return the errno failure code as the only status */ BUG_ON (job->reply_len <sizeof (uint32_t )); bsg_reply->reply_payload_rcv_len =0 ; - bsg_reply->result = ret; + bsg_reply->status.combined = ret; job->reply_len =sizeof (uint32_t ); -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return 0 ; }
Bart Van Assche
maintainerPATCH 48/117 fdomain: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/fdomain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/fdomain.c +2 -2
@@ -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->status.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->status.combined =DID_ABORT <<16 ;/* Aborts are not done well. . . */ fdomain_finish_cmd (fd,DID_ABORT <<16 );
Bart Van Assche
maintainerPATCH 49/117 firewire: sbp2: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/firewire/sbp2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firewire/sbp2.c +1 -1
@@ -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->status.combined = result; orb->cmd->scsi_done (orb->cmd); }
Bart Van Assche
maintainerPATCH 50/117 fnic: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/fnic/fnic_scsi.c | 38 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-)
drivers/scsi/fnic/fnic_scsi.c +19 -19
@@ -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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined =DID_RESET <<16 ; sc->scsi_done (sc); } }
Bart Van Assche
maintainerPATCH 51/117 hpsa: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/hpsa.c | 74 ++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 37 deletions(-)
drivers/scsi/hpsa.c +37 -37
@@ -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->status.combined =0 ;break ;case IOACCEL2_STATUS_SR_TASK_COMP_CHK_COND : - cmd->result |=SAM_STAT_CHECK_CONDITION ; + cmd->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined =DID_NO_CONNECT <<16 ; }break ;case CMD_PROTOCOL_ERR : - cmd->result =DID_ERROR <<16 ; + cmd->status.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->status.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->status.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->status.combined =DID_ABORT <<16 ;break ;case CMD_ABORT_FAILED : - cmd->result =DID_ERROR <<16 ; + cmd->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined =DID_NO_CONNECT <<16 ; cmd->scsi_done (cmd);return 0 ; }if (dev->removed) { - cmd->result =DID_NO_CONNECT <<16 ; + cmd->status.combined =DID_NO_CONNECT <<16 ; cmd->scsi_done (cmd);return 0 ; }if (unlikely (lockup_detected (h))) { - cmd->result =DID_NO_CONNECT <<16 ; + cmd->status.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->status.combined =0 ;/* * Call alternate submit routine for I/O accelerated commands.
Bart Van Assche
maintainerPATCH 52/117 hptiop: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/hptiop.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/scsi/hptiop.c +10 -10
@@ -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->status.combined = (DID_OK <<16 );break ;case IOP_RESULT_BAD_TARGET : - scp->result = (DID_BAD_TARGET <<16 ); + scp->status.combined = (DID_BAD_TARGET <<16 );break ;case IOP_RESULT_BUSY : - scp->result = (DID_BUS_BUSY <<16 ); + scp->status.combined = (DID_BUS_BUSY <<16 );break ;case IOP_RESULT_RESET : - scp->result = (DID_RESET <<16 ); + scp->status.combined = (DID_RESET <<16 );break ;case IOP_RESULT_FAIL : - scp->result = (DID_ERROR <<16 ); + scp->status.combined = (DID_ERROR <<16 );break ;case IOP_RESULT_INVALID_REQUEST : - scp->result = (DID_ABORT <<16 ); + scp->status.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->status.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->status.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->status.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->status.combined =DID_BAD_TARGET <<16 ;free_req (hba, _req); goto cmd_done; }
Bart Van Assche
maintainerPATCH 53/117 ib_srp: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/infiniband/ulp/srp/ib_srp.c | 27 ++++++++++++++------------- include/scsi/scsi_transport_srp.h | 15 +++++++++++---- 2 files changed, 25 insertions(+), 17 deletions(-)
drivers/infiniband/ulp/srp/ib_srp.c +14 -13
@@ -1279,13 +1279,14 @@ static void srp_free_req(struct srp_rdma_ch *ch, struct srp_request *req, }static void srp_finish_req (struct srp_rdma_ch *ch,struct srp_request *req, -struct scsi_device *sdev,int result) +struct scsi_device *sdev, +enum host_status host_status) {struct scsi_cmnd *scmnd =srp_claim_req (ch, req, sdev,NULL );if (scmnd) {srp_free_req (ch, req, scmnd,0 ); - scmnd->result = result; + scmnd->status = (union scsi_status ){.b.host = host_status}; scmnd->scsi_done (scmnd); } }
@@ -1302,8 +1303,7 @@ static void srp_terminate_io(struct srp_rport *rport)for (j =0 ; j < target->req_ring_size; ++j) {struct srp_request *req = &ch->req_ring[j]; -srp_finish_req (ch, req,NULL , -DID_TRANSPORT_FAILFAST <<16 ); +srp_finish_req (ch, req,NULL ,DID_TRANSPORT_FAILFAST ); } } }
@@ -1366,7 +1366,7 @@ static int srp_rport_reconnect(struct srp_rport *rport)for (j =0 ; j < target->req_ring_size; ++j) {struct srp_request *req = &ch->req_ring[j]; -srp_finish_req (ch, req,NULL ,DID_RESET <<16 ); +srp_finish_req (ch, req,NULL ,DID_RESET ); } }for (i =0 ; i < target->ch_count; i++) {
@@ -1980,7 +1980,7 @@ static void srp_process_rsp(struct srp_rdma_ch *ch, struct srp_rsp *rsp)return ; } - scmnd->result = rsp->status; + scmnd->status = (union scsi_status ){.b.status = 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->status =srp_chkready (target->rport); +if (unlikely (scmnd->status.combined)) goto err;WARN_ON_ONCE (scmnd->request->tag <0 );
@@ -2231,8 +2231,9 @@ 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 ? -DID_OK <<16 |QUEUE_FULL <<1 :DID_ERROR <<16 ; + scmnd->status = len == -ENOMEM ? + (union scsi_status ){.b.status =SAM_STAT_TASK_SET_FULL }: + (union scsi_status ){.b.host =DID_ERROR }; goto err_iu; }
@@ -2241,7 +2242,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->status = (union scsi_status ){.b.host =DID_ERROR }; goto err_unmap; }
@@ -2260,7 +2261,7 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd) req->scmnd =NULL ; err: -if (scmnd->result) { +if (scmnd->status.combined) { scmnd->scsi_done (scmnd); ret =0 ; }else {
@@ -2832,7 +2833,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->status = (union scsi_status ){.b.host =DID_ABORT }; scmnd->scsi_done (scmnd); }
include/scsi/scsi_transport_srp.h +11 -4
@@ -5,6 +5,7 @@#include <linux/transport_class.h> #include <linux/types.h> #include <linux/mutex.h> +#include <scsi/scsi_status.h> #define SRP_RPORT_ROLE_INITIATOR 0#define SRP_RPORT_ROLE_TARGET 1
@@ -128,18 +129,24 @@ enum blk_eh_timer_return srp_timed_out(struct scsi_cmnd *scmd);* implementation. The role of this function is similar to that of * fc_remote_port_chkready(). */ -static inline int srp_chkready (struct srp_rport *rport) +static inline union scsi_status srp_chkready (struct srp_rport *rport) { +enum host_status status =0 ; +switch (rport->state) {case SRP_RPORT_RUNNING :case SRP_RPORT_BLOCKED :default : -return 0 ; +break ;case SRP_RPORT_FAIL_FAST : -return DID_TRANSPORT_FAILFAST <<16 ; + status =DID_TRANSPORT_FAILFAST ; +break ;case SRP_RPORT_LOST : -return DID_NO_CONNECT <<16 ; + status =DID_NO_CONNECT ; +break ; } + +return (union scsi_status ){.b.host = status}; }#endif
Bart Van Assche
maintainerPATCH 54/117 ibmvfc: Fix the documentation of the return value of ibmvfc_host_chkready()
In reply to Bart Van Assche--- drivers/scsi/ibmvscsi/ibmvfc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ibmvscsi/ibmvfc.c +1 -1
@@ -1841,7 +1841,7 @@ static void ibmvfc_scsi_done(struct ibmvfc_event *evt)* @vhost: struct ibmvfc host * * Returns: -* 1 if host can accept command / 0 if not +* 0 if host can accept command; a value != 0 if not **/ static inline int ibmvfc_host_chkready (struct ibmvfc_host *vhost) {
Bart Van Assche
maintainerPATCH 55/117 ibmvfc: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/ibmvscsi/ibmvfc.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/scsi/ibmvscsi/ibmvfc.c +12 -12
@@ -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->status.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->status.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->status.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->status.combined && (!scsi_get_resid (cmnd) || (rsp->flags &FCP_RESID_OVER ))) + cmnd->status.combined = (DID_ERROR <<16 );ibmvfc_log_error (evt); } -if (!cmnd->result && +if (!cmnd->status.combined && (scsi_bufflen (cmnd) -scsi_get_resid (cmnd) < cmnd->underflow)) - cmnd->result = (DID_ERROR <<16 ); + cmnd->status.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->status.combined = rc; cmnd->scsi_done (cmnd);return 0 ; } - cmnd->result = (DID_OK <<16 ); + cmnd->status.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->status.combined =DID_ERROR <<16 ; cmnd->scsi_done (cmnd);return 0 ; }
@@ -2235,8 +2235,8 @@ 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_job_done (job, bsg_reply->result, + bsg_reply->status.combined = rc; +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); rc =0 ; out:
Bart Van Assche
maintainerPATCH 56/117 ibmvscsi: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/ibmvscsi/ibmvscsi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/scsi/ibmvscsi/ibmvscsi.c +8 -8
@@ -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->status.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->status.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->status.combined |= rsp->status; +if (((cmnd->status.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->status.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->status.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->status.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->status.combined =DID_ERROR <<16 ;if (evt_struct->done) evt_struct->done (evt_struct);else
Bart Van Assche
maintainerPATCH 57/117 ide: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- 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 +++--- 13 files changed, 58 insertions(+), 58 deletions(-)
drivers/ide/ide-atapi.c +5 -5
@@ -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)->status.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)->status.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)->status.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)->status.combined ==0 ) +scsi_req (rq)->status.combined = -EIO ; } error = uptodate ?BLK_STS_OK :BLK_STS_IOERR ;
drivers/ide/ide-cd.c +10 -10
@@ -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)->status.combined) info->write_timeout = jiffies +ATAPI_WAIT_WRITE_BUSY ; -scsi_req (rq)->result =1 ; +scsi_req (rq)->status.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)->status.combined) +scsi_req (rq)->status.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)->status.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)->status.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)->status.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)->status.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)->status.combined ==0 ) +scsi_req (rq)->status.combined = -EIO ; }if (uptodate ==0 && rq->bio)
drivers/ide/ide-cd_ioctl.c +1 -1
@@ -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)->status.combined ? -EIO :0 ;blk_put_request (rq);/* * A reset will unlock the door. If it was previously locked,
drivers/ide/ide-devsets.c +2 -2
@@ -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)->status.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)->status.combined = err;ide_complete_rq (drive,0 ,blk_rq_bytes (rq));return ide_stopped; }
drivers/ide/ide-dma.c +1 -1
@@ -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)->status.combined =0 ;return ret; }
drivers/ide/ide-eh.c +18 -18
@@ -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)->status.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)->status.combined =ERROR_MAX ; }else if (err &ATA_TRK0NF ) {/* help it find track zero */ -scsi_req (rq)->result |=ERROR_RECAL ; +scsi_req (rq)->status.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)->status.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)->status.combined |=ERROR_RESET ; -if ((scsi_req (rq)->result &ERROR_RESET ) ==ERROR_RESET ) { - ++scsi_req (rq)->result; +if ((scsi_req (rq)->status.combined &ERROR_RESET ) ==ERROR_RESET ) { + ++scsi_req (rq)->status.combined;return ide_do_reset (drive); } -if ((scsi_req (rq)->result &ERROR_RECAL ) ==ERROR_RECAL ) +if ((scsi_req (rq)->status.combined &ERROR_RECAL ) ==ERROR_RECAL ) drive->special_flags |=IDE_SFLAG_RECALIBRATE ; - ++scsi_req (rq)->result; + ++scsi_req (rq)->status.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)->status.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)->status.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)->status.combined &ERROR_RESET ) ==ERROR_RESET ) { + ++scsi_req (rq)->status.combined;return ide_do_reset (drive); } - ++scsi_req (rq)->result; + ++scsi_req (rq)->status.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)->status.combined =1 ;ide_complete_pm_rq (drive, rq);return ide_stopped; } -scsi_req (rq)->result = err; +scsi_req (rq)->status.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 errif (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)->status.combined ==0 ) +scsi_req (rq)->status.combined = -EIO ;ide_complete_rq (drive, err,blk_rq_bytes (rq)); } }
drivers/ide/ide-floppy.c +5 -5
@@ -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)->status.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)->status.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)->status.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)->status.combined ==0 ) +scsi_req (rq)->status.combined = -EIO ;ide_complete_rq (drive,BLK_STS_IOERR ,blk_rq_bytes (rq));return ide_stopped; }
drivers/ide/ide-io.c +5 -5
@@ -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)->status.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)->status.combined =IDE_DRV_ERROR_GENERAL ; +else if (blk_rq_is_passthrough (rq) &&scsi_req (rq)->status.combined ==0 ) +scsi_req (rq)->status.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)->status.combined =0 ;ide_complete_rq (drive,BLK_STS_OK ,blk_rq_bytes (rq));return ide_stopped;
drivers/ide/ide-ioctls.c +2 -2
@@ -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)->status.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)->status.combined;blk_put_request (rq);return ret; }
drivers/ide/ide-park.c +1 -1
@@ -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)->status.combined ? -EIO :0 ;blk_put_request (rq);if (rc) goto out;
drivers/ide/ide-pm.c +3 -3
@@ -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)->status.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)->status.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)->status.combined ? -EIO :0 ; }int generic_ide_resume (struct device *dev)
drivers/ide/ide-tape.c +2 -2
@@ -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)->status.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)->status.combined ==IDE_DRV_ERROR_GENERAL ) ret = -EIO ; out_put:blk_put_request (rq);
drivers/ide/ide-taskfile.c +3 -3
@@ -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)->status.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)->status.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)->status.combined ? -EIO :0 ; put_req:blk_put_request (rq);return error;
Bart Van Assche
maintainerPATCH 58/117 imm: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/imm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/imm.c +5 -5
@@ -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->status.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->status.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->status.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->status.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->status.combined =DID_ERROR <<16 ;/* default return code */ cmd->SCp.phase =0 ;/* bus free */ schedule_delayed_work (&dev->imm_tq,0 );
Bart Van Assche
maintainerPATCH 59/117 initio: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/initio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/initio.c +1 -1
@@ -2786,7 +2786,7 @@ static void i91uSCBPost(u8 * host_mem, u8 * cblk_mem)break ; } - cmnd->result = cblk->tastat | (cblk->hastat <<16 ); + cmnd->status.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 */
Bart Van Assche
maintainerPATCH 60/117 ipr: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/ipr.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)
drivers/scsi/ipr.c +17 -17
@@ -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->status.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->status.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->status.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->status.combined |= (DID_ABORT <<16 );else - scsi_cmd->result |= (DID_IMM_RETRY <<16 ); + scsi_cmd->status.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->status.combined |= (DID_NO_CONNECT <<16 );break ;case IPR_IOASC_HW_SEL_TIMEOUT : - scsi_cmd->result |= (DID_NO_CONNECT <<16 ); + scsi_cmd->status.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->status.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->status.combined !=SAM_STAT_CHECK_CONDITION ) + scsi_cmd->status.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->status.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->status.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->status.combined |= (DID_IMM_RETRY <<16 ); }else - scsi_cmd->result |= (DID_ERROR <<16 ); + scsi_cmd->status.combined |= (DID_ERROR <<16 );break ;default :if (IPR_IOASC_SENSE_KEY (ioasc) >RECOVERED_ERROR ) - scsi_cmd->result |= (DID_ERROR <<16 ); + scsi_cmd->status.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->status.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->status.combined = (DID_NO_CONNECT <<16 ); scsi_cmd->scsi_done (scsi_cmd);spin_unlock_irqrestore (hrrq->lock, hrrq_flags);return 0 ;
Bart Van Assche
maintainerPATCH 61/117 ips: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/ips.c | 72 +++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 36 deletions(-)
drivers/scsi/ips.c +36 -36
@@ -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->status.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->status.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->status.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->status.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->status.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 ->status.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 ->status.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 ->status.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 ->status.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 ->status.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 ->status.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 ->status.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 ->status.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->status.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->status.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->status.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->status.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->status.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->status.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 ->status.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->status.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->status.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->status.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->status.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->status.combined =DID_ERROR <<16 ;break ;case START_STOP : - scb->scsi_cmd->result =DID_OK <<16 ; + scb->scsi_cmd->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined =DID_TIME_OUT <<16 ; } }/* else */ }else {/* recovered error / success */
Bart Van Assche
maintainerPATCH 62/117 iscsi: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/libiscsi.c | 46 ++++++++++++++--------------- drivers/scsi/scsi_transport_iscsi.c | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-)
drivers/scsi/libiscsi.c +23 -23
@@ -616,7 +616,7 @@ static void fail_scsi_task(struct iscsi_task *task, enum host_status err) state =ISCSI_TASK_ABRT_TMF ; sc = task->sc; - sc->result = err <<16 ; + sc->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined =DID_NO_CONNECT <<16 ;break ; } fallthrough;case ISCSI_STATE_IN_RECOVERY : reason =FAILURE_SESSION_IN_RECOVERY ; - sc->result =DID_IMM_RETRY <<16 ; + sc->status.combined =DID_IMM_RETRY <<16 ;break ;case ISCSI_STATE_LOGGING_OUT : reason =FAILURE_SESSION_LOGGING_OUT ; - sc->result =DID_IMM_RETRY <<16 ; + sc->status.combined =DID_IMM_RETRY <<16 ;break ;case ISCSI_STATE_RECOVERY_FAILED : reason =FAILURE_SESSION_RECOVERY_TIMEOUT ; - sc->result =DID_TRANSPORT_FAILFAST <<16 ; + sc->status.combined =DID_TRANSPORT_FAILFAST <<16 ;break ;case ISCSI_STATE_TERMINATE : reason =FAILURE_SESSION_TERMINATE ; - sc->result =DID_NO_CONNECT <<16 ; + sc->status.combined =DID_NO_CONNECT <<16 ;break ;default : reason =FAILURE_SESSION_FREED ; - sc->result =DID_NO_CONNECT <<16 ; + sc->status.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->status.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->status.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->status.combined =DID_ABORT <<16 ; goto prepd_fault; } }
@@ -2017,7 +2017,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->status.combined =DID_NO_CONNECT <<16 ;ISCSI_DBG_EH (session,"sc on shutdown, handled\n" ); rc =BLK_EH_DONE ; goto done;
drivers/scsi/scsi_transport_iscsi.c +1 -1
@@ -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->status.combined = ret; job->reply_len =sizeof (uint32_t );bsg_job_done (job, ret,0 );return 0 ;
Bart Van Assche
maintainerPATCH 63/117 libfc: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/libfc/fc_fcp.c | 36 +++++++++++++++++------------------ drivers/scsi/libfc/fc_lport.c | 8 ++++---- 2 files changed, 22 insertions(+), 22 deletions(-)
drivers/scsi/libfc/fc_fcp.c +18 -18
@@ -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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined = (DID_ERROR <<16 ) | fsp->cdb_status; }break ;case FC_DATA_OVRRUN :
@@ -2035,10 +2035,10 @@ 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->status.combined = (DID_ERROR <<16 ) | fsp->cdb_status;break ;case FC_CMD_ABORTED : -if (host_byte (sc_cmd->result) ==DID_TIME_OUT ) +if (host_byte (sc_cmd->status) ==DID_TIME_OUT )FC_FCP_DBG (fsp,"Returning DID_TIME_OUT to scsi-ml " "due to FC_CMD_ABORTED\n" );else {
@@ -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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined = (DID_TRANSPORT_DISRUPTED <<16 );spin_lock_irqsave (&si->scsi_queue_lock, flags);list_del (&fsp->list);
drivers/scsi/libfc/fc_lport.c +4 -4
@@ -1883,10 +1883,10 @@ static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp,void *buf;if (IS_ERR (fp)) { - bsg_reply->result = (PTR_ERR (fp) == -FC_EX_CLOSED ) ? + bsg_reply->status.combined = (PTR_ERR (fp) == -FC_EX_CLOSED ) ? -ECONNABORTED : -ETIMEDOUT ; job->reply_len =sizeof (uint32_t ); -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);kfree (info);return ;
@@ -1920,8 +1920,8 @@ static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp, job->reply_payload.payload_len) bsg_reply->reply_payload_rcv_len = job->reply_payload.payload_len; - bsg_reply->result =0 ; -bsg_job_done (job, bsg_reply->result, + bsg_reply->status.combined =0 ; +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);kfree (info); }
Bart Van Assche
maintainerPATCH 64/117 sas: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/libsas/sas_scsi_host.c | 8 ++++---- drivers/scsi/scsi_transport_sas.c | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-)
drivers/scsi/libsas/sas_scsi_host.c +4 -4
@@ -94,7 +94,7 @@ static void sas_end_task(struct scsi_cmnd *sc, struct sas_task *task) } } - sc->result = (hs <<16 ) | stat; + sc->status.combined = (hs <<16 ) | stat;ASSIGN_SAS_TASK (sc,NULL );sas_free_task (task); }
@@ -170,7 +170,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->status.combined =DID_BAD_TARGET <<16 ; goto out_done; }
@@ -195,9 +195,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->status.combined =DID_SOFT_ERROR <<16 ;/* retry */ else - cmd->result =DID_ERROR <<16 ; + cmd->status.combined =DID_ERROR <<16 ; out_done: cmd->scsi_done (cmd);return 0 ;
drivers/scsi/scsi_transport_sas.c +4 -3
@@ -1229,13 +1229,14 @@ int sas_read_port_mode_page(struct scsi_device *sdev)char *buffer =kzalloc (BUF_SIZE ,GFP_KERNEL ), *msdata;struct sas_end_device *rdev =sas_sdev_to_rdev (sdev);struct scsi_mode_data mode_data; -int res, error; +union scsi_status res; +int error;if (!buffer)return -ENOMEM ; - res =scsi_mode_sense (sdev,1 ,0x19 , buffer,BUF_SIZE ,30 *HZ ,3 , - &mode_data,NULL ); + res.combined =scsi_mode_sense (sdev,1 ,0x19 , buffer,BUF_SIZE ,30 *HZ , +3 , &mode_data,NULL ); error = -EINVAL ;if (!scsi_status_is_good (res))
Bart Van Assche
maintainerPATCH 66/117 mac53c94: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/mac53c94.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/mac53c94.c +1 -1
@@ -347,7 +347,7 @@ static void cmd_done(struct fsc_state *state, int result) cmd = state->current_req;if (cmd) { - cmd->result = result; + cmd->status.combined = result; (*cmd->scsi_done)(cmd); state->current_req =NULL ; }
Bart Van Assche
maintainerPATCH 65/117 lpfc: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/lpfc/lpfc_bsg.c | 114 +++++++++++++++++----------------- drivers/scsi/lpfc/lpfc_scsi.c | 66 ++++++++++---------- 2 files changed, 90 insertions(+), 90 deletions(-)
drivers/scsi/lpfc/lpfc_bsg.c +57 -57
@@ -373,8 +373,8 @@ lpfc_bsg_send_mgmt_cmd_cmp(struct lpfc_hba *phba,/* Complete the job if the job is still active */ if (job) { - bsg_reply->result = rc; -bsg_job_done (job, bsg_reply->result, + bsg_reply->status.combined = rc; +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); }return ;
@@ -545,7 +545,7 @@ lpfc_bsg_send_mgmt_cmd(struct bsg_job *job)kfree (dd_data); no_dd_data:/* make error code available to userspace */ - bsg_reply->result = rc; + bsg_reply->status.combined = rc; job->dd_data =NULL ;return rc; }
@@ -643,8 +643,8 @@ lpfc_bsg_rport_els_cmp(struct lpfc_hba *phba,/* Complete the job if the job is still active */ if (job) { - bsg_reply->result = rc; -bsg_job_done (job, bsg_reply->result, + bsg_reply->status.combined = rc; +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); }return ;
@@ -782,7 +782,7 @@ lpfc_bsg_rport_els(struct bsg_job *job) no_dd_data:/* make error code available to userspace */ - bsg_reply->result = rc; + bsg_reply->status.combined = rc; job->dd_data =NULL ;return rc; }
@@ -1113,11 +1113,11 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, bsg_reply = job->reply; bsg_reply->reply_payload_rcv_len = size;/* make error code available to userspace */ - bsg_reply->result =0 ; + bsg_reply->status.combined =0 ; job->dd_data =NULL ;/* complete the job back to userspace */ spin_unlock_irqrestore (&phba->ct_ev_lock, flags); -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);spin_lock_irqsave (&phba->ct_ev_lock, flags); }
@@ -1340,14 +1340,14 @@ lpfc_bsg_hba_get_event(struct bsg_job *job)lpfc_bsg_event_unref (evt);spin_unlock_irqrestore (&phba->ct_ev_lock, flags); job->dd_data =NULL ; - bsg_reply->result =0 ; -bsg_job_done (job, bsg_reply->result, + bsg_reply->status.combined =0 ; +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return 0 ; job_error: job->dd_data =NULL ; - bsg_reply->result = rc; + bsg_reply->status.combined = rc;return rc; }
@@ -1438,8 +1438,8 @@ lpfc_issue_ct_rsp_cmp(struct lpfc_hba *phba,/* Complete the job if the job is still active */ if (job) { - bsg_reply->result = rc; -bsg_job_done (job, bsg_reply->result, + bsg_reply->status.combined = rc; +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); }return ;
@@ -1670,7 +1670,7 @@ lpfc_bsg_send_mgmt_rsp(struct bsg_job *job)kfree (bmp); send_mgmt_rsp_exit:/* make error code available to userspace */ - bsg_reply->result = rc; + bsg_reply->status.combined = rc; job->dd_data =NULL ;return rc; }
@@ -1878,10 +1878,10 @@ lpfc_sli3_bsg_diag_loopback_mode(struct lpfc_hba *phba, struct bsg_job *job) job_error:/* make error code available to userspace */ - bsg_reply->result = rc; + bsg_reply->status.combined = rc;/* complete the job back to userspace if no error */ if (rc ==0 ) -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rc; }
@@ -2243,10 +2243,10 @@ lpfc_sli4_bsg_diag_loopback_mode(struct lpfc_hba *phba, struct bsg_job *job) job_done:/* make error code available to userspace */ - bsg_reply->result = rc; + bsg_reply->status.combined = rc;/* complete the job back to userspace if no error */ if (rc ==0 ) -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rc; }
@@ -2358,10 +2358,10 @@ lpfc_sli4_bsg_diag_mode_end(struct bsg_job *job) loopback_mode_end_exit:/* make return code available to userspace */ - bsg_reply->result = rc; + bsg_reply->status.combined = rc;/* complete the job back to userspace if no error */ if (rc ==0 ) -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rc; }
@@ -2507,10 +2507,10 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_job *job)/* make error code available to userspace */ if (rc1 && !rc) rc = rc1; - bsg_reply->result = rc; + bsg_reply->status.combined = rc;/* complete the job back to userspace if no error */ if (rc ==0 ) -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rc; }
@@ -3369,11 +3369,11 @@ lpfc_bsg_diag_loopback_run(struct bsg_job *job) loopback_test_exit:kfree (dataout);/* make error code available to userspace */ - bsg_reply->result = rc; + bsg_reply->status.combined = rc; job->dd_data =NULL ;/* complete the job back to userspace if no error */ if (rc ==IOCB_SUCCESS ) -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rc; }
@@ -3414,9 +3414,9 @@ lpfc_bsg_get_dfc_rev(struct bsg_job *job) event_reply->info.a_Major =MANAGEMENT_MAJOR_REV ; event_reply->info.a_Minor =MANAGEMENT_MINOR_REV ; job_error: - bsg_reply->result = rc; + bsg_reply->status.combined = rc;if (rc ==0 ) -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rc; }
@@ -3481,8 +3481,8 @@ lpfc_bsg_issue_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq)/* Complete the job if the job is still active */ if (job) { - bsg_reply->result =0 ; -bsg_job_done (job, bsg_reply->result, + bsg_reply->status.combined =0 ; +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); }return ;
@@ -3671,7 +3671,7 @@ lpfc_bsg_issue_mbox_ext_handle_job(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq) pmb_buf, size);/* result for successful */ - bsg_reply->result =0 ; + bsg_reply->status.combined =0 ;lpfc_printf_log (phba,KERN_INFO ,LOG_LIBDFC , "2937 SLI_CONFIG ext-buffer mailbox command "
@@ -3732,7 +3732,7 @@ lpfc_bsg_issue_read_mbox_ext_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq)/* if the job is still active, call job done */ if (job) { bsg_reply = job->reply; -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); }return ;
@@ -3770,7 +3770,7 @@ lpfc_bsg_issue_write_mbox_ext_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq)/* if the job is still active, call job done */ if (job) { bsg_reply = job->reply; -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); }
@@ -4213,8 +4213,8 @@ lpfc_bsg_sli_cfg_write_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job,/* wait for additional external buffers */ - bsg_reply->result =0 ; -bsg_job_done (job, bsg_reply->result, + bsg_reply->status.combined =0 ; +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return SLI_CONFIG_HANDLED ;
@@ -4441,8 +4441,8 @@ lpfc_bsg_read_ebuf_get(struct lpfc_hba *phba, struct bsg_job *job)lpfc_bsg_mbox_ext_session_reset (phba); } - bsg_reply->result =0 ; -bsg_job_done (job, bsg_reply->result, + bsg_reply->status.combined =0 ; +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return SLI_CONFIG_HANDLED ;
@@ -4560,8 +4560,8 @@ lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct bsg_job *job, }/* wait for additional external buffers */ - bsg_reply->result =0 ; -bsg_job_done (job, bsg_reply->result, + bsg_reply->status.combined =0 ; +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return SLI_CONFIG_HANDLED ;
@@ -5030,16 +5030,16 @@ lpfc_bsg_mbox_cmd(struct bsg_job *job)if (rc ==0 ) {/* job done */ - bsg_reply->result =0 ; + bsg_reply->status.combined =0 ; job->dd_data =NULL ; -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); }else if (rc ==1 )/* job submitted, will complete later*/ rc =0 ;/* return zero, no error */ else {/* some error occurred */ - bsg_reply->result = rc; + bsg_reply->status.combined = rc; job->dd_data =NULL ; }
@@ -5142,8 +5142,8 @@ lpfc_bsg_menlo_cmd_cmp(struct lpfc_hba *phba,/* Complete the job if active */ if (job) { - bsg_reply->result = rc; -bsg_job_done (job, bsg_reply->result, + bsg_reply->status.combined = rc; +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); }
@@ -5318,7 +5318,7 @@ lpfc_menlo_cmd(struct bsg_job *job)kfree (dd_data); no_dd_data:/* make error code available to userspace */ - bsg_reply->result = rc; + bsg_reply->status.combined = rc; job->dd_data =NULL ;return rc; }
@@ -5358,9 +5358,9 @@ lpfc_forced_link_speed(struct bsg_job *job) ? LPFC_FORCED_LINK_SPEED_SUPPORTED :LPFC_FORCED_LINK_SPEED_NOT_SUPPORTED ; job_error: - bsg_reply->result = rc; + bsg_reply->status.combined = rc;if (rc ==0 ) -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rc; }
@@ -5434,11 +5434,11 @@ lpfc_bsg_get_ras_config(struct bsg_job *job) ras_job_error:/* make error code available to userspace */ - bsg_reply->result = rc; + bsg_reply->status.combined = rc;/* complete the job back to userspace */ if (!rc) -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rc; }
@@ -5520,11 +5520,11 @@ lpfc_bsg_set_ras_config(struct bsg_job *job) } ras_job_error:/* make error code available to userspace */ - bsg_reply->result = rc; + bsg_reply->status.combined = rc;/* complete the job back to userspace */ if (!rc) -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rc;
@@ -5582,11 +5582,11 @@ lpfc_bsg_get_ras_lwpd(struct bsg_job *job) ras_job_error:/* make error code available to userspace */ - bsg_reply->result = rc; + bsg_reply->status.combined = rc;/* complete the job back to userspace */ if (!rc) -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rc;
@@ -5671,9 +5671,9 @@ lpfc_bsg_get_ras_fwlog(struct bsg_job *job)vfree (fwlog_buff); ras_job_error: - bsg_reply->result = rc; + bsg_reply->status.combined = rc;if (!rc) -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rc;
@@ -5743,9 +5743,9 @@ lpfc_get_trunk_info(struct bsg_job *job) event_reply->logical_speed = phba->sli4_hba.link_state.logical_speed /1000 ; job_error: - bsg_reply->result = rc; + bsg_reply->status.combined = rc;if (!rc) -bsg_job_done (job, bsg_reply->result, +bsg_job_done (job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rc;
@@ -5817,7 +5817,7 @@ lpfc_bsg_hst_vendor(struct bsg_job *job) rc = -EINVAL ; bsg_reply->reply_payload_rcv_len =0 ;/* make error code available to userspace */ - bsg_reply->result = rc; + bsg_reply->status.combined = rc;break ; }
@@ -5851,7 +5851,7 @@ lpfc_bsg_request(struct bsg_job *job) rc = -EINVAL ; bsg_reply->reply_payload_rcv_len =0 ;/* make error code available to userspace */ - bsg_reply->result = rc; + bsg_reply->status.combined = rc;break ; }
drivers/scsi/lpfc/lpfc_scsi.c +33 -33
247 lines not on this page · raw message
Bart Van Assche
maintainerPATCH 67/117 megaraid: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/megaraid.c | 50 ++++++++--------- drivers/scsi/megaraid/megaraid_mbox.c | 62 ++++++++++----------- drivers/scsi/megaraid/megaraid_sas_base.c | 30 +++++----- drivers/scsi/megaraid/megaraid_sas_fusion.c | 20 +++---- 4 files changed, 81 insertions(+), 81 deletions(-)
drivers/scsi/megaraid.c +25 -25
@@ -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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined |= (DID_OK <<16 );break ;case 0x02 :/* ERROR_ABORTED, i.e.
@@ -1583,9 +1583,9 @@ 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->status.combined = (DRIVER_SENSE <<24 ) | (DID_OK <<16 ) | - (CHECK_CONDITION <<1 ); +SAM_STAT_CHECK_CONDITION ; }else {if (mbox->m_out.cmd ==MEGA_MBOXCMD_EXTPTHRU ) {
@@ -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->status.combined = (DRIVER_SENSE <<24 ) | (DID_OK <<16 ) | - (CHECK_CONDITION <<1 ); +SAM_STAT_CHECK_CONDITION ; }else { cmd->sense_buffer[0 ] =0x70 ; cmd->sense_buffer[2 ] =ABORTED_COMMAND ; - cmd->result |= (CHECK_CONDITION <<1 ); + cmd->status.b.status =SAM_STAT_CHECK_CONDITION ; } }break ;case 0x08 :/* ERR_DEST_DRIVE_FAILED, i.e. SCSI_STATUS_BUSY */ - cmd->result |= (DID_BUS_BUSY <<16 ) | status; + cmd->status.combined |= (DID_BUS_BUSY <<16 ) | status;break ;default :
@@ -1616,8 +1616,8 @@ 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 ) | - (RESERVATION_CONFLICT <<1 ); + cmd->status.combined |= (DID_ERROR <<16 ) | +SAM_STAT_RESERVATION_CONFLICT ; }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) | - (RESERVATION_CONFLICT << 1); + cmd->status.combined |= (DID_ERROR << 16) | + SAM_STAT_RESERVATION_CONFLICT; } else#endif - cmd->result |= (DID_BAD_TARGET <<16 )|status; + cmd->status.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->status.combined = (DID_ABORT <<16 ); }else { - cmd->result = (DID_RESET <<16 ); + cmd->status.combined = (DID_RESET <<16 ); } list_add_tail(SCSI_LIST(cmd),
drivers/scsi/megaraid/megaraid_mbox.c +31 -31
212 lines not on this page · raw message
drivers/scsi/megaraid/megaraid_sas_base.c +15 -15
@@ -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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined =DID_OK <<16 ;break ;case MFI_STAT_SCSI_IO_FAILED :case MFI_STAT_LD_INIT_IN_PROGRESS : - cmd->scmd->result = + cmd->scmd->status.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->status.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->status.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->status.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->status.combined =DID_ERROR <<16 ;break ; }
drivers/scsi/megaraid/megaraid_sas_fusion.c +10 -10
@@ -2035,23 +2035,23 @@ map_cmd_status(struct fusion_context *fusion,switch (status) {case MFI_STAT_OK : - scmd->result =DID_OK <<16 ; + scmd->status.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->status.combined = (DID_ERROR <<16 ) | ext_status;break ;case MFI_STAT_SCSI_DONE_WITH_ERROR : - scmd->result = (DID_OK <<16 ) | ext_status; + scmd->status.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->status.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->status.combined =DID_BAD_TARGET <<16 ;break ;case MFI_STAT_CONFIG_SEQ_MISMATCH : - scmd->result =DID_IMM_RETRY <<16 ; + scmd->status.combined =DID_IMM_RETRY <<16 ;break ;default : - scmd->result =DID_ERROR <<16 ; + scmd->status.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->status.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->status.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->status.combined =megasas_check_mpio_paths (instance, scmd_local); if (instance->ldio_threshold &&
Bart Van Assche
maintainerPATCH 68/117 mesh: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/mesh.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/mesh.c +5 -5
@@ -595,12 +595,12 @@ 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->status.combined = (ms->stat <<16 ) | cmd->SCp.Status;if (ms->stat ==DID_OK ) - cmd->result |= cmd->SCp.Message <<8 ; + cmd->status.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->status.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 +993,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->status.combined =DID_RESET <<16 ; tp->current_req =NULL ;mesh_completed (ms, cmd); }
@@ -1003,7 +1003,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->status.combined =DID_RESET <<16 ;mesh_completed (ms, cmd); } ms->phase = idle;
Bart Van Assche
maintainerPATCH 69/117 message: fusion: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/message/fusion/mptfc.c | 6 +-- drivers/message/fusion/mptsas.c | 2 +- drivers/message/fusion/mptscsih.c | 70 +++++++++++++++---------------- drivers/message/fusion/mptspi.c | 4 +- 4 files changed, 41 insertions(+), 41 deletions(-)
drivers/message/fusion/mptfc.c +3 -3
@@ -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->status.combined =DID_NO_CONNECT <<16 ; SCpnt->scsi_done (SCpnt);return 0 ; } err =fc_remote_port_chkready (rport);if (unlikely (err)) { - SCpnt->result = err; + SCpnt->status.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->status.combined =DID_IMM_RETRY <<16 ; SCpnt->scsi_done (SCpnt);return 0 ; }
drivers/message/fusion/mptsas.c +1 -1
@@ -1923,7 +1923,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->status.combined =DID_NO_CONNECT <<16 ; SCpnt->scsi_done (SCpnt);return 0 ; }
drivers/message/fusion/mptscsih.c +35 -35
241 lines not on this page · raw message
drivers/message/fusion/mptspi.c +2 -2
@@ -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->status.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->status.combined =DID_NO_CONNECT <<16 ; SCpnt->scsi_done (SCpnt);return 0 ; }
Bart Van Assche
maintainerPATCH 70/117 mpt3sas: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 78 ++++++++++++++-------------- 1 file changed, 39 insertions(+), 39 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_scsih.c +39 -39
@@ -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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined =DID_NO_CONNECT <<16 ;else - scmd->result =DID_RESET <<16 ; + scmd->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined =SAM_STAT_BUSY ;break ;case MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE : - scmd->result =DID_NO_CONNECT <<16 ; + scmd->status.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->status.combined =DID_TRANSPORT_DISRUPTED <<16 ; goto out; }if (log_info ==0x31110630 ) {if (scmd->retries >2 ) { - scmd->result =DID_NO_CONNECT <<16 ; + scmd->status.combined =DID_NO_CONNECT <<16 ;scsi_device_set_state (scmd->device,SDEV_OFFLINE ); }else { - scmd->result =DID_SOFT_ERROR <<16 ; + scmd->status.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->status.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->status.combined =DID_RESET <<16 ;break ; } - scmd->result =DID_SOFT_ERROR <<16 ; + scmd->status.combined =DID_SOFT_ERROR <<16 ;break ;case MPI2_IOCSTATUS_SCSI_TASK_TERMINATED :case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED : - scmd->result =DID_RESET <<16 ; + scmd->status.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->status.combined =DID_SOFT_ERROR <<16 ;else - scmd->result = (DID_OK <<16 ) | scsi_status; + scmd->status.combined = (DID_OK <<16 ) | scsi_status;break ;case MPI2_IOCSTATUS_SCSI_DATA_UNDERRUN : - scmd->result = (DID_OK <<16 ) | scsi_status; + scmd->status.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->status.combined =SAM_STAT_BUSY ;else - scmd->result =DID_SOFT_ERROR <<16 ; + scmd->status.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->status.combined =DID_SOFT_ERROR <<16 ;else if (scsi_state &MPI2_SCSI_STATE_TERMINATED ) - scmd->result =DID_RESET <<16 ; + scmd->status.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->status.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->status.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->status.combined =DID_SOFT_ERROR <<16 ;else if (scsi_state &MPI2_SCSI_STATE_TERMINATED ) - scmd->result =DID_RESET <<16 ; + scmd->status.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->status.combined =DID_SOFT_ERROR <<16 ;break ; } -if (scmd->result && (ioc->logging_level &MPT_DEBUG_REPLY )) +if (scmd->status.combined && (ioc->logging_level &MPT_DEBUG_REPLY ))_scsih_scsi_ioc_info (ioc , scmd, mpi_reply, smid); out:
Bart Van Assche
maintainerPATCH 71/117 mvumi: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/mvumi.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/scsi/mvumi.c +9 -9
@@ -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->status.combined = ob_frame->req_status;switch (ob_frame->req_status) {case SAM_STAT_GOOD : - scmd->result |=DID_OK <<16 ; + scmd->status.combined |=DID_OK <<16 ;break ;case SAM_STAT_BUSY : - scmd->result |=DID_BUS_BUSY <<16 ; + scmd->status.combined |=DID_BUS_BUSY <<16 ;break ;case SAM_STAT_CHECK_CONDITION : - scmd->result |= (DID_OK <<16 ); + scmd->status.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->status.combined |= (DRIVER_SENSE <<24 ); }break ;default : - scmd->result |= (DRIVER_INVALID <<24 ) | (DID_ABORT <<16 ); + scmd->status.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->status.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->status.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->status.combined = (DRIVER_INVALID <<24 ) | (DID_ABORT <<16 ); scmd->SCp.ptr =NULL ;if (scsi_bufflen (scmd)) { dma_unmap_sg(&mhba->pdev->dev, scsi_sglist(scmd),
Bart Van Assche
maintainerPATCH 72/117 myrb: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/myrb.c | 48 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-)
drivers/scsi/myrb.c +24 -24
@@ -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->status.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->status.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->status.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->status.combined = (DRIVER_SENSE <<24 ) |SAM_STAT_CHECK_CONDITION ; }else {myrb_inquiry (cb, scmd); - scmd->result = (DID_OK <<16 ); + scmd->status.combined = (DID_OK <<16 ); } scmd->scsi_done (scmd);return 0 ;case SYNCHRONIZE_CACHE : - scmd->result = (DID_OK <<16 ); + scmd->status.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->status.combined = (DRIVER_SENSE <<24 ) |SAM_STAT_CHECK_CONDITION ; }else {myrb_mode_sense (cb, scmd, ldev_info); - scmd->result = (DID_OK <<16 ); + scmd->status.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->status.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->status.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->status.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->status.combined = (DRIVER_SENSE <<24 ) |SAM_STAT_CHECK_CONDITION ; }else {/* Assume good status */ - scmd->result = (DID_OK <<16 ); + scmd->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined = (DID_BAD_TARGET <<16 );break ;default :scmd_printk (KERN_ERR , scmd,"Unexpected Error Status %04X" , status); - scmd->result = (DID_ERROR <<16 ); + scmd->status.combined = (DID_ERROR <<16 );break ; } scmd->scsi_done (scmd);
Bart Van Assche
maintainerPATCH 73/117 myrs: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/myrs.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/scsi/myrs.c +7 -7
@@ -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->status.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->status.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->status.combined = (DRIVER_SENSE <<24 ) |SAM_STAT_CHECK_CONDITION ; }else {myrs_mode_sense (cs, scmd, ldev_info); - scmd->result = (DID_OK <<16 ); + scmd->status.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->status.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->status.combined = (DID_BAD_TARGET <<16 );else - scmd->result = (DID_OK <<16 ) | status; + scmd->status.combined = (DID_OK <<16 ) | status; scmd->scsi_done (scmd); }
Bart Van Assche
maintainerPATCH 74/117 ncr53c8xx: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/ncr53c8xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ncr53c8xx.c +1 -1
@@ -4909,7 +4909,7 @@ void ncr_complete (struct ncb *np, struct ccb *cp)/* ** Check the status. */ - cmd->result =0 ; + cmd->status.combined =0 ;if ( (cp->host_status ==HS_COMPLETE ) && (cp->scsi_status ==SAM_STAT_GOOD || cp->scsi_status ==SAM_STAT_CONDITION_MET )) {
Bart Van Assche
maintainerPATCH 75/117 nfsd: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- fs/nfsd/blocklayout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nfsd/blocklayout.c +2 -2
@@ -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->status.combined) {pr_err ("pNFS: INQUIRY 0x83 failed with: %x\n" , - req->result); + req->status.combined); error = -EIO ; goto out_put_request; }
Bart Van Assche
maintainerPATCH 76/117 nsp32: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/nsp32.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/scsi/nsp32.c +20 -20
@@ -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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined =DID_NO_CONNECT <<16 ; status = FALSE; }
@@ -910,7 +910,7 @@ static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct sif (data->CurrentSC !=NULL ) {nsp32_msg (KERN_ERR ,"Currentsc != NULL. Cancel this command request" ); data->CurrentSC =NULL ; - SCpnt->result =DID_NO_CONNECT <<16 ; + SCpnt->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined = (int )nsp32_read1 (base,SCSI_CSB_IN ); }if (auto_stat &ILLEGAL_PHASE ) {
@@ -1504,8 +1504,8 @@ 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. +* Reset parameters and call scsi_done for data->cur_lunt. Be careful setting +* SCpnt->status.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->status.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->status.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->status.combined =DID_ABORT <<16 ;nsp32_scsi_done (SCpnt);nsp32_dbg (NSP32_DEBUG_BUSRESET ,"abort success" );
Bart Van Assche
maintainerPATCH 77/117 pcmcia: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/pcmcia/nsp_cs.c | 18 ++++++++++-------- drivers/scsi/pcmcia/sym53c500_cs.c | 12 ++++++------ 2 files changed, 16 insertions(+), 14 deletions(-)
drivers/scsi/pcmcia/nsp_cs.c +10 -8
@@ -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->status.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->status.combined =DID_BUS_BUSY <<16 ;nsp_scsi_done (SCpnt);return 0 ; }
@@ -1034,7 +1034,8 @@ static irqreturn_t nspintr(int irq, void *dev_id)if (data->CurrentSC !=NULL ) { tmpSC = data->CurrentSC; - tmpSC->result = (DID_RESET <<16 ) | + tmpSC->status.combined = + (DID_RESET <<16 ) | ((tmpSC->SCp.Message &0xff ) <<8 ) | ((tmpSC->SCp.Status &0xff ) <<0 );nsp_scsi_done (tmpSC);
@@ -1083,7 +1084,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->status.combined =DID_TIME_OUT <<16 ;nsp_scsi_done (tmpSC);return IRQ_HANDLED ;
@@ -1107,7 +1108,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->status.combined =DID_ABORT <<16 ;nsp_scsi_done (tmpSC);return IRQ_HANDLED ; }
@@ -1133,10 +1134,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->status.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->status.combined);nsp_scsi_done (tmpSC);return IRQ_HANDLED ;
@@ -1151,7 +1153,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->status.combined =DID_ERROR <<16 ;nsp_scsi_done (tmpSC);return IRQ_HANDLED ; }
drivers/scsi/pcmcia/sym53c500_cs.c +6 -6
@@ -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->status.combined =DID_RESET <<16 ; goto idle_out; }if (pio_status &0x80 ) {printk ("SYM53C500: Warning: PIO error!\n" ); - curSC->result =DID_ERROR <<16 ; + curSC->status.combined =DID_ERROR <<16 ; goto idle_out; }if (status &0x20 ) {/* Parity error */ printk ("SYM53C500: Warning: parity error!\n" ); - curSC->result =DID_PARITY <<16 ; + curSC->status.combined =DID_PARITY <<16 ; goto idle_out; }if (status &0x40 ) {/* Gross error */ printk ("SYM53C500: Warning: gross error!\n" ); - curSC->result =DID_ERROR <<16 ; + curSC->status.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->status.combined =DID_NO_CONNECT <<16 ; }else {/* Command complete, return status and message */ - curSC->result = (curSC->SCp.Status &0xff ) + curSC->status.combined = (curSC->SCp.Status &0xff ) | ((curSC->SCp.Message &0xff ) <<8 ) | (DID_OK <<16 ); } goto idle_out;
Bart Van Assche
maintainerPATCH 78/117 pktcdvd: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/block/pktcdvd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/pktcdvd.c +1 -1
@@ -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)->status.combined) ret = -EIO ; out:blk_put_request (rq);
Bart Van Assche
maintainerPATCH 79/117 pmcraid: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/pmcraid.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/scsi/pmcraid.c +14 -14
@@ -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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined |= (DID_IMM_RETRY <<16 );break ;case PMCRAID_IOASC_ME_READ_ERROR_NO_REALLOC : - scsi_cmd->result |= (DID_PASSTHROUGH <<16 ); + scsi_cmd->status.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->status.combined |= (DID_ERROR <<16 );break ;case PMCRAID_IOASC_HW_DEVICE_BUS_STATUS_ERROR : - scsi_cmd->result |=PMCRAID_IOASC_SENSE_STATUS (ioasc); + scsi_cmd->status.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->status.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->status.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->status.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->status.combined = (DID_NO_CONNECT <<16 ); scsi_cmd->scsi_done (scsi_cmd);return 0 ; }
Bart Van Assche
maintainerPATCH 81/117 ps3rom: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/ps3rom.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/ps3rom.c +5 -5
@@ -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->status.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->status.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->status.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->status.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->status.combined =SAM_STAT_CHECK_CONDITION ; done: priv->curr_cmd =NULL ;
Bart Van Assche
maintainerPATCH 80/117 ppa: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/ppa.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/scsi/ppa.c +6 -6
@@ -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->status.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->status.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->status.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->status.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->status.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->status.combined =DID_ERROR <<16 ;/* default return code */ cmd->SCp.phase =0 ;/* bus free */ schedule_delayed_work (&dev->ppa_tq,0 );
Bart Van Assche
maintainerPATCH 82/117 qedf: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/qedf/qedf_io.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/scsi/qedf/qedf_io.c +12 -12
@@ -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 = sc_cmd->status.combined; 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->status.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->status.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->status.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->status.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->status.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->status.combined = (DID_ERROR <<16 ) | io_req->cdb_status;else - sc_cmd->result = (DID_OK <<16 ) | io_req->cdb_status; + sc_cmd->status.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->status.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->status.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,13 @@ 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->status.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->status.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);
Bart Van Assche
maintainerPATCH 83/117 qedi: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/qedi/qedi_fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qedi/qedi_fw.c +1 -1
@@ -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 = sc_cmd->status.combined; io_log->jiffies = jiffies; io_log->blk_req_cpu =smp_processor_id ();
Bart Van Assche
maintainerPATCH 84/117 qla1280: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/qla1280.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla1280.c +1 -1
@@ -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->status.combined#define CMD_HANDLE (Cmnd) Cmnd->host_scribble#define CMD_REQUEST (Cmnd) Cmnd->request->cmd
Bart Van Assche
maintainerPATCH 85/117 qla2xxx: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/qla2xxx/qla_bsg.c | 148 ++++++++++++++++---------------- drivers/scsi/qla2xxx/qla_iocb.c | 4 +- drivers/scsi/qla2xxx/qla_isr.c | 14 +-- drivers/scsi/qla2xxx/qla_mr.c | 6 +- drivers/scsi/qla2xxx/qla_os.c | 26 +++--- 5 files changed, 99 insertions(+), 99 deletions(-)
drivers/scsi/qla2xxx/qla_bsg.c +74 -74
@@ -27,8 +27,8 @@ void qla2x00_bsg_job_done(srb_t *sp, int res) sp->free (sp); - bsg_reply->result = res; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined = res; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); }
@@ -156,10 +156,10 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job) ha->fcp_prio_cfg->attributes &= ~FCP_PRIO_ATTR_ENABLE ;qla24xx_update_all_fcp_prio (vha); - bsg_reply->result =DID_OK ; + bsg_reply->status.combined =DID_OK ; }else { ret = -EINVAL ; - bsg_reply->result = (DID_ERROR <<16 ); + bsg_reply->status.combined = (DID_ERROR <<16 ); goto exit_fcp_prio_cfg; }break ;
@@ -171,10 +171,10 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job) ha->fcp_prio_cfg->attributes |=FCP_PRIO_ATTR_ENABLE ;qla24xx_update_all_fcp_prio (vha); - bsg_reply->result =DID_OK ; + bsg_reply->status.combined =DID_OK ; }else { ret = -EINVAL ; - bsg_reply->result = (DID_ERROR <<16 ); + bsg_reply->status.combined = (DID_ERROR <<16 ); goto exit_fcp_prio_cfg; } }
@@ -184,11 +184,11 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job) len = bsg_job->reply_payload.payload_len;if (!len || len >FCP_PRIO_CFG_SIZE ) { ret = -EINVAL ; - bsg_reply->result = (DID_ERROR <<16 ); + bsg_reply->status.combined = (DID_ERROR <<16 ); goto exit_fcp_prio_cfg; } - bsg_reply->result =DID_OK ; + bsg_reply->status.combined =DID_OK ; bsg_reply->reply_payload_rcv_len = sg_copy_from_buffer( bsg_job->reply_payload.sg_list,
@@ -200,7 +200,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)case QLFC_FCP_PRIO_SET_CONFIG : len = bsg_job->request_payload.payload_len;if (!len || len >FCP_PRIO_CFG_SIZE ) { - bsg_reply->result = (DID_ERROR <<16 ); + bsg_reply->status.combined = (DID_ERROR <<16 ); ret = -EINVAL ; goto exit_fcp_prio_cfg; }
@@ -211,7 +211,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)ql_log (ql_log_warn, vha,0x7050 ,"Unable to allocate memory for fcp prio " "config data (%x).\n" ,FCP_PRIO_CFG_SIZE ); - bsg_reply->result = (DID_ERROR <<16 ); + bsg_reply->status.combined = (DID_ERROR <<16 ); ret = -ENOMEM ; goto exit_fcp_prio_cfg; }
@@ -225,7 +225,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)/* validate fcp priority data */ if (!qla24xx_fcp_prio_cfg_valid (vha, ha->fcp_prio_cfg,1 )) { - bsg_reply->result = (DID_ERROR <<16 ); + bsg_reply->status.combined = (DID_ERROR <<16 ); ret = -EINVAL ;/* If buffer was invalidatic int * fcp_prio_cfg is of no use
@@ -239,7 +239,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)if (ha->fcp_prio_cfg->attributes &FCP_PRIO_ATTR_ENABLE ) ha->flags.fcp_prio_enabled =1 ;qla24xx_update_all_fcp_prio (vha); - bsg_reply->result =DID_OK ; + bsg_reply->status.combined =DID_OK ;break ;default : ret = -EINVAL ;
@@ -247,7 +247,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job) } exit_fcp_prio_cfg:if (!ret) -bsg_job_done (bsg_job, bsg_reply->result, +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return ret; }
@@ -917,12 +917,12 @@ qla2x00_process_loopback(struct bsg_job *bsg_job) "Vendor request %s failed.\n", type); rval =0 ; - bsg_reply->result = (DID_ERROR <<16 ); + bsg_reply->status.combined = (DID_ERROR <<16 ); bsg_reply->reply_payload_rcv_len =0 ; }else {ql_dbg (ql_dbg_user, vha,0x702d ,"Vendor request %s completed.\n" , type); - bsg_reply->result = (DID_OK <<16 ); + bsg_reply->status.combined = (DID_OK <<16 );sg_copy_from_buffer (bsg_job->reply_payload.sg_list, bsg_job->reply_payload.sg_cnt, rsp_data, rsp_data_len);
@@ -951,7 +951,7 @@ qla2x00_process_loopback(struct bsg_job *bsg_job) bsg_job->request_payload.sg_list, bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE);if (!rval) -bsg_job_done (bsg_job, bsg_reply->result, +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rval; }
@@ -984,8 +984,8 @@ qla84xx_reset(struct bsg_job *bsg_job) }else {ql_dbg (ql_dbg_user, vha,0x7031 ,"Vendor request 84xx reset completed.\n" ); - bsg_reply->result =DID_OK ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); }
@@ -1084,7 +1084,7 @@ qla84xx_updatefw(struct bsg_job *bsg_job) "Vendor request 84xx updatefw completed.\n"); bsg_job->reply_len =sizeof (struct fc_bsg_reply ); - bsg_reply->result =DID_OK ; + bsg_reply->status.combined =DID_OK ; }dma_pool_free (ha->s_dma_pool, mn, mn_dma);
@@ -1097,7 +1097,7 @@ qla84xx_updatefw(struct bsg_job *bsg_job) bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE);if (!rval) -bsg_job_done (bsg_job, bsg_reply->result, +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rval; }
@@ -1265,7 +1265,7 @@ qla84xx_mgmt_cmd(struct bsg_job *bsg_job) "Vendor request 84xx mgmt completed.\n"); bsg_job->reply_len =sizeof (struct fc_bsg_reply ); - bsg_reply->result =DID_OK ; + bsg_reply->status.combined =DID_OK ;if ((ql84_mgmt->mgmt.cmd ==QLA84_MGMT_READ_MEM ) || (ql84_mgmt->mgmt.cmd ==QLA84_MGMT_GET_INFO )) {
@@ -1293,7 +1293,7 @@ qla84xx_mgmt_cmd(struct bsg_job *bsg_job)dma_pool_free (ha->s_dma_pool, mn, mn_dma);if (!rval) -bsg_job_done (bsg_job, bsg_reply->result, +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rval; }
@@ -1379,8 +1379,8 @@ qla24xx_iidma(struct bsg_job *bsg_job) sizeof(struct qla_port_param)); } - bsg_reply->result =DID_OK ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); }
@@ -1484,12 +1484,12 @@ qla2x00_read_optrom(struct bsg_job *bsg_job) ha->optrom_region_size); bsg_reply->reply_payload_rcv_len = ha->optrom_region_size; - bsg_reply->result =DID_OK ; + bsg_reply->status.combined =DID_OK ;vfree (ha->optrom_buffer); ha->optrom_buffer =NULL ; ha->optrom_state =QLA_SWAITING ;mutex_unlock (&ha->optrom_mutex); -bsg_job_done (bsg_job, bsg_reply->result, +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rval; }
@@ -1521,16 +1521,16 @@ qla2x00_update_optrom(struct bsg_job *bsg_job) ha->optrom_region_start, ha->optrom_region_size);if (rval) { - bsg_reply->result = -EINVAL ; + bsg_reply->status.combined = -EINVAL ; rval = -EINVAL ; }else { - bsg_reply->result =DID_OK ; + bsg_reply->status.combined =DID_OK ; }vfree (ha->optrom_buffer); ha->optrom_buffer =NULL ; ha->optrom_state =QLA_SWAITING ;mutex_unlock (&ha->optrom_mutex); -bsg_job_done (bsg_job, bsg_reply->result, +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return rval; }
@@ -1581,8 +1581,8 @@ qla2x00_update_fru_versions(struct bsg_job *bsg_job) done: bsg_job->reply_len =sizeof (struct fc_bsg_reply ); - bsg_reply->result =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK <<16 ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return 0 ;
@@ -1632,8 +1632,8 @@ qla2x00_read_fru_status(struct bsg_job *bsg_job) done: bsg_job->reply_len =sizeof (struct fc_bsg_reply ); bsg_reply->reply_payload_rcv_len =sizeof (*sr); - bsg_reply->result =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK <<16 ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return 0 ;
@@ -1679,8 +1679,8 @@ qla2x00_write_fru_status(struct bsg_job *bsg_job) done: bsg_job->reply_len =sizeof (struct fc_bsg_reply ); - bsg_reply->result =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK <<16 ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return 0 ;
@@ -1725,8 +1725,8 @@ qla2x00_write_i2c(struct bsg_job *bsg_job) done: bsg_job->reply_len =sizeof (struct fc_bsg_reply ); - bsg_reply->result =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK <<16 ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return 0 ;
@@ -1775,8 +1775,8 @@ qla2x00_read_i2c(struct bsg_job *bsg_job) done: bsg_job->reply_len =sizeof (struct fc_bsg_reply ); bsg_reply->reply_payload_rcv_len =sizeof (*i2c); - bsg_reply->result =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK <<16 ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return 0 ;
@@ -1953,8 +1953,8 @@ qla24xx_process_bidir_cmd(struct bsg_job *bsg_job) bsg_reply->reply_data.vendor_reply.vendor_rsp[0 ] = rval; bsg_job->reply_len =sizeof (struct fc_bsg_reply ); bsg_reply->reply_payload_rcv_len =0 ; - bsg_reply->result = (DID_OK ) <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined = (DID_OK ) <<16 ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);/* Always return success, vendor rsp carries correct status */ return 0 ;
@@ -2119,8 +2119,8 @@ qla26xx_serdes_op(struct bsg_job *bsg_job) rval ?EXT_STATUS_MAILBOX :0 ; bsg_job->reply_len =sizeof (struct fc_bsg_reply ); - bsg_reply->result =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK <<16 ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return 0 ; }
@@ -2161,8 +2161,8 @@ qla8044_serdes_op(struct bsg_job *bsg_job) rval ?EXT_STATUS_MAILBOX :0 ; bsg_job->reply_len =sizeof (struct fc_bsg_reply ); - bsg_reply->result =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK <<16 ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return 0 ; }
@@ -2193,8 +2193,8 @@ qla27xx_get_flash_upd_cap(struct bsg_job *bsg_job)EXT_STATUS_OK ; bsg_job->reply_len =sizeof (struct fc_bsg_reply ); - bsg_reply->result =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK <<16 ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return 0 ; }
@@ -2239,8 +2239,8 @@ qla27xx_set_flash_upd_cap(struct bsg_job *bsg_job)EXT_STATUS_OK ; bsg_job->reply_len =sizeof (struct fc_bsg_reply ); - bsg_reply->result =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK <<16 ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return 0 ; }
@@ -2298,8 +2298,8 @@ qla27xx_get_bbcr_data(struct bsg_job *bsg_job) bsg_reply->reply_data.vendor_reply.vendor_rsp[0 ] =EXT_STATUS_OK ; bsg_job->reply_len =sizeof (struct fc_bsg_reply ); - bsg_reply->result =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK <<16 ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return 0 ; }
@@ -2353,8 +2353,8 @@ qla2x00_get_priv_stats(struct bsg_job *bsg_job) rval ?EXT_STATUS_MAILBOX :EXT_STATUS_OK ; bsg_job->reply_len =sizeof (*bsg_reply); - bsg_reply->result =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK <<16 ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); dma_free_coherent(&ha->pdev->dev, sizeof(*stats),
@@ -2398,8 +2398,8 @@ qla2x00_do_dport_diagnostics(struct bsg_job *bsg_job) rval ?EXT_STATUS_MAILBOX :EXT_STATUS_OK ; bsg_job->reply_len =sizeof (*bsg_reply); - bsg_reply->result =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK <<16 ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);kfree (dd);
@@ -2438,10 +2438,10 @@ qla2x00_get_flash_image_status(struct bsg_job *bsg_job) bsg_reply->reply_data.vendor_reply.vendor_rsp[0 ] =EXT_STATUS_OK ; bsg_reply->reply_payload_rcv_len =sizeof (regions); - bsg_reply->result =DID_OK <<16 ; + bsg_reply->status.combined =DID_OK <<16 ; bsg_job->reply_len =sizeof (struct fc_bsg_reply ); -bsg_job_done (bsg_job, bsg_reply->result, - bsg_reply->reply_payload_rcv_len); +bsg_job_done (bsg_job, bsg_reply->status.combined, + bsg_reply->reply_payload_rcv_len);return 0 ; }
@@ -2508,8 +2508,8 @@ qla2x00_manage_host_stats(struct bsg_job *bsg_job) &rsp_data, sizeof(struct ql_vnd_mng_host_stats_resp)); - bsg_reply->result =DID_OK ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return ret;
@@ -2577,8 +2577,8 @@ qla2x00_get_host_stats(struct bsg_job *bsg_job) bsg_job->reply_payload.sg_cnt, &rsp_data, sizeof(struct ql_vnd_mng_host_stats_resp)); - bsg_reply->result =DID_OK ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); goto host_stat_out; }
@@ -2598,8 +2598,8 @@ qla2x00_get_host_stats(struct bsg_job *bsg_job) bsg_reply->reply_payload_rcv_len =sg_copy_from_buffer (bsg_job->reply_payload.sg_list, bsg_job->reply_payload.sg_cnt, data, response_len); - bsg_reply->result =DID_OK ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);kfree (data);
@@ -2675,8 +2675,8 @@ qla2x00_get_tgt_stats(struct bsg_job *bsg_job) bsg_job->reply_payload.sg_cnt, data, sizeof(struct ql_vnd_tgt_stats_resp)); - bsg_reply->result =DID_OK ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); goto tgt_stat_out; }
@@ -2698,8 +2698,8 @@ qla2x00_get_tgt_stats(struct bsg_job *bsg_job)sg_copy_from_buffer (bsg_job->reply_payload.sg_list, bsg_job->reply_payload.sg_cnt, data, response_len); - bsg_reply->result =DID_OK ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len); tgt_stat_out:
@@ -2760,8 +2760,8 @@ qla2x00_manage_host_port(struct bsg_job *bsg_job)sg_copy_from_buffer (bsg_job->reply_payload.sg_list, bsg_job->reply_payload.sg_cnt, &rsp_data,sizeof (struct ql_vnd_mng_host_port_resp )); - bsg_reply->result =DID_OK ; -bsg_job_done (bsg_job, bsg_reply->result, + bsg_reply->status.combined =DID_OK ; +bsg_job_done (bsg_job, bsg_reply->status.combined, bsg_reply->reply_payload_rcv_len);return ret;
@@ -2888,7 +2888,7 @@ qla24xx_bsg_request(struct bsg_job *bsg_job) goto skip_chip_chk;if (vha->hw->flags.port_isolated) { - bsg_reply->result =DID_ERROR ; + bsg_reply->status.combined =DID_ERROR ;/* operation not permitted */ return -EPERM ; }
@@ -2956,12 +2956,12 @@ qla24xx_bsg_timeout(struct bsg_job *bsg_job)ql_log (ql_log_warn, vha,0x7089 ,"mbx abort_command " "failed.\n" ); - bsg_reply->result = -EIO ; + bsg_reply->status.combined = -EIO ; }else {ql_dbg (ql_dbg_user, vha,0x708a ,"mbx abort_command " "success.\n" ); - bsg_reply->result =0 ; + bsg_reply->status.combined =0 ; }spin_lock_irqsave (&ha->hardware_lock, flags); goto done;
@@ -2971,7 +2971,7 @@ qla24xx_bsg_timeout(struct bsg_job *bsg_job) }spin_unlock_irqrestore (&ha->hardware_lock, flags);ql_log (ql_log_info, vha,0x708b ,"SRB not found to abort.\n" ); - bsg_reply->result = -ENXIO ; + bsg_reply->status.combined = -ENXIO ;return 0 ; done:
drivers/scsi/qla2xxx/qla_iocb.c +2 -2
@@ -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->status.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->status.combined =DID_NO_CONNECT <<16 ;return QLA_INTERFACE_ERROR ; }
drivers/scsi/qla2xxx/qla_isr.c +7 -7
@@ -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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined); } }
drivers/scsi/qla2xxx/qla_mr.c +3 -3
@@ -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->status.combined = res; }if (sense_len) {
@@ -2255,7 +2255,7 @@ qlafx00_ioctl_iosb_entry(scsi_qla_host_t *vha, struct req_que *req, sp->vha,0x5074 , fw_sts_ptr, sizeof(fstatus)); - res = bsg_reply->result =DID_OK <<16 ; + res = bsg_reply->status.combined =DID_OK <<16 ; bsg_reply->reply_payload_rcv_len = bsg_job->reply_payload.payload_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->status.combined); }else {WARN_ON_ONCE (true); }
drivers/scsi/qla2xxx/qla_os.c +13 -13
@@ -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->status.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->status.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->status.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->status.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->status.combined =DID_REQUEUE <<16 ; } goto qc24_fail_command; } rval =fc_remote_port_chkready (rport);if (rval) { - cmd->result = rval; + cmd->status.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->status.combined =DID_NO_CONNECT <<16 ; goto qc24_fail_command; }if (!fcport || fcport->deleted) { - cmd->result =DID_IMM_RETRY <<16 ; + cmd->status.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->status.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->status.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->status.combined =DID_NO_CONNECT <<16 ; goto qc24_fail_command; }if (!fcport || fcport->deleted) { - cmd->result =DID_IMM_RETRY <<16 ; + cmd->status.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->status.combined =DID_NO_CONNECT <<16 ; goto qc24_fail_command; } goto qc24_target_busy;
Bart Van Assche
maintainerPATCH 86/117 qla4xxx: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/qla4xxx/ql4_bsg.c | 76 +++++++++++++++++----------------- drivers/scsi/qla4xxx/ql4_isr.c | 32 +++++++------- drivers/scsi/qla4xxx/ql4_os.c | 14 +++---- 3 files changed, 61 insertions(+), 61 deletions(-)
drivers/scsi/qla4xxx/ql4_bsg.c +38 -38
@@ -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->status.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->status.combined =DID_OK <<16 ; } -bsg_job_done (bsg_job, bsg_reply->result, +bsg_job_done (bsg_job, bsg_reply->status.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->status.combined =DID_ERROR <<16 ; rval = -EIO ; }else - bsg_reply->result =DID_OK <<16 ; + bsg_reply->status.combined =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, +bsg_job_done (bsg_job, bsg_reply->status.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->status.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->status.combined =DID_OK <<16 ; } -bsg_job_done (bsg_job, bsg_reply->result, +bsg_job_done (bsg_job, bsg_reply->status.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->status.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->status.combined =DID_OK <<16 ; } -bsg_job_done (bsg_job, bsg_reply->result, +bsg_job_done (bsg_job, bsg_reply->status.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->status.combined =DID_ERROR <<16 ; rval = -EIO ; }else - bsg_reply->result =DID_OK <<16 ; + bsg_reply->status.combined =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, +bsg_job_done (bsg_job, bsg_reply->status.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->status.combined =DID_ERROR <<16 ; rval = -EIO ; }else - bsg_reply->result =DID_OK <<16 ; + bsg_reply->status.combined =DID_OK <<16 ; -bsg_job_done (bsg_job, bsg_reply->result, +bsg_job_done (bsg_job, bsg_reply->status.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->status.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->status.combined =DID_OK <<16 ; } -bsg_job_done (bsg_job, bsg_reply->result, +bsg_job_done (bsg_job, bsg_reply->status.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->status.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->status.combined =DID_OK <<16 ;else - bsg_reply->result =DID_ERROR <<16 ; + bsg_reply->status.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->status.combined,STATUS (status))); -bsg_job_done (bsg_job, bsg_reply->result, +bsg_job_done (bsg_job, bsg_reply->status.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->status.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->status.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->status.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->status.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->status.combined =DID_OK <<16 ;else - bsg_reply->result =DID_ERROR <<16 ; + bsg_reply->status.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->status.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->status.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->status.combined,STATUS (status))); +bsg_job_done (bsg_job, bsg_reply->status.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->status.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->status.combined, bsg_reply->reply_payload_rcv_len);return -ENOSYS ; }
drivers/scsi/qla4xxx/ql4_isr.c +16 -16
@@ -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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.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->status.combined =DID_ERROR <<16 | scsi_status; goto check_scsi_status; } - cmd->result =DID_OK <<16 | scsi_status; + cmd->status.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->status.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->status.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->status.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->status.combined =DID_BUS_BUSY <<16 ;kref_put (&srb->srb_ref, qla4xxx_srb_compl);break ;
drivers/scsi/qla4xxx/ql4_os.c +7 -7
@@ -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->status.combined =DID_NO_CONNECT <<16 ;else - cmd->result =DID_REQUEUE <<16 ; + cmd->status.combined =DID_REQUEUE <<16 ; goto qc_fail_command; }if (!sess) { - cmd->result =DID_IMM_RETRY <<16 ; + cmd->status.combined =DID_IMM_RETRY <<16 ; goto qc_fail_command; } rval =iscsi_session_chkready (sess);if (rval) { - cmd->result = rval; + cmd->status.combined = rval; goto qc_fail_command; }
@@ -4802,7 +4802,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->status.combined = res;kref_put (&srb->srb_ref, qla4xxx_srb_compl); } }
@@ -9283,7 +9283,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->status.combined, cmd->allowed)); rval =qla4xxx_isp_check_reg (ha);if (rval !=QLA_SUCCESS ) {
@@ -9350,7 +9350,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->status.combined, cmd->allowed)); rval =qla4xxx_isp_check_reg (ha);if (rval !=QLA_SUCCESS ) {
Bart Van Assche
maintainerPATCH 87/117 qlogicfas408: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/qlogicfas408.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/qlogicfas408.c +2 -2
@@ -415,7 +415,7 @@ static void ql_ihandl(void *dev_id)return ; } icmd = priv->qlcmd; - icmd->result =ql_pcmd (icmd); + icmd->status.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->status.combined =DID_BAD_TARGET <<16 ;done (cmd);return 0 ; }
Bart Van Assche
maintainerPATCH 88/117 qlogicpti: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/qlogicpti.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qlogicpti.c +3 -3
@@ -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->status.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->status.combined =qlogicpti_return_status (sts, qpti->qpti_id);else - Cmnd->result =DID_ERROR <<16 ; + Cmnd->status.combined =DID_ERROR <<16 ;if (scsi_bufflen (Cmnd)) dma_unmap_sg(&qpti->op->dev,
Bart Van Assche
maintainerPATCH 89/117 s390/zfcp: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/s390/scsi/zfcp_dbf.c | 2 +- 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 +++--- 5 files changed, 8 insertions(+), 8 deletions(-)
drivers/s390/scsi/zfcp_dbf.c +1 -1
@@ -643,7 +643,7 @@ void zfcp_dbf_scsi_common(char *tag, int level, struct scsi_device *sdev,memcpy (rec->tag, tag,ZFCP_DBF_TAG_LEN ); rec->id =ZFCP_DBF_SCSI_CMND ;if (sc) { - rec->scsi_result = sc->result; + rec->scsi_result = sc->status.combined; rec->scsi_retries = sc->retries; rec->scsi_allowed = sc->allowed; rec->scsi_id = sc->device->id;
drivers/s390/scsi/zfcp_dbf.h +1 -1
@@ -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->status.combined !=0 )_zfcp_dbf_scsi ("rsl_err" ,3 , scmd, req);else if (scmd->retries >0 )_zfcp_dbf_scsi ("rsl_ret" ,4 , scmd, req);
drivers/s390/scsi/zfcp_fc.c +2 -2
@@ -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->status.combined = zfcp_ct_els->status ? -EIO :0 ; +bsg_job_done (job, jr->status.combined, jr->reply_payload_rcv_len); }static struct zfcp_fc_wka_port *zfcp_fc_job_wka_port (struct bsg_job *job)
drivers/s390/scsi/zfcp_fc.h +1 -1
@@ -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->status.combined |= fcp_rsp->resp.fr_status; rsp_flags = fcp_rsp->resp.fr_flags;
drivers/s390/scsi/zfcp_scsi.c +3 -3
@@ -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->status.combined =0 ; scpnt->host_scribble =NULL ; scsi_result =fc_remote_port_chkready (rport);if (unlikely (scsi_result)) { - scpnt->result = scsi_result; + scpnt->status.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->status.combined |=SAM_STAT_CHECK_CONDITION ;set_host_byte (scmd,DID_SOFT_ERROR ); }
Bart Van Assche
maintainerPATCH 90/117 scsi_debug: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/scsi_debug.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/scsi/scsi_debug.c +13 -13
@@ -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->status.combined = pfp ?pfp (cmnd, devip) :0 ; +if (cmnd->status.combined &SDEG_RES_IMMED_MASK ) { + cmnd->status.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->status.combined ==0 && scsi_result !=0 ) + cmnd->status.combined = scsi_result; +if (cmnd->status.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->status.combined = check_condition_result; } } -if (unlikely (sdebug_verbose && cmnd->result)) +if (unlikely (sdebug_verbose && cmnd->status.combined))sdev_printk (KERN_INFO , sdp,"%s: non-zero result=0x%x\n" , - __func__, cmnd->result); + __func__, cmnd->status.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->status.combined = pfp !=NULL ?pfp (cmnd, devip) :0 ; + cmnd->status.combined &= ~SDEG_RES_IMMED_MASK ; +if (cmnd->status.combined ==0 && scsi_result !=0 ) + cmnd->status.combined = scsi_result; cmnd->scsi_done (cmnd);return 0 ; }
Matthew Wilcox
maintainerRe: [PATCH 027/117] advansys: Convert to the scsi_status union
In reply to Bart Van AsscheQuoted 2 lines · Bart Van Assche
An explanation of the purpose of this patch is available in the patch "scsi: Introduce the
scsi_statusunion".
That is not the correct way to write a changelog.
Bart Van Assche
maintainerPATCH 91/117 smartpqi: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/smartpqi/smartpqi_init.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/scsi/smartpqi/smartpqi_init.c +6 -6
@@ -3001,7 +3001,7 @@ static void pqi_process_raid_io_error(struct pqi_io_request *io_request) sense_data_length); } - scmd->result = scsi_status; + scmd->status.combined = scsi_status;set_host_byte (scmd, host_byte); }
@@ -3091,7 +3091,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->status.combined = scsi_status;set_host_byte (scmd, host_byte); }
@@ -3188,7 +3188,7 @@ static int pqi_process_io_intr(struct pqi_ctrl_info *ctrl_info, struct pqi_queuecase 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->status.combined =0 ; fallthrough;case PQI_RESPONSE_IU_GENERAL_MANAGEMENT :break ;
@@ -5333,9 +5333,9 @@ 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->status.combined &0xff ) ==SAM_STAT_GOOD )return false; -if (host_byte (scmd->result) ==DID_NO_CONNECT ) +if (host_byte (scmd->status) ==DID_NO_CONNECT )return false; device = scmd->device->hostdata;
@@ -5719,7 +5719,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->status.combined =0 ; hw_queue =pqi_get_hw_queue (ctrl_info, scmd); queue_group = &ctrl_info->queue_groups[hw_queue];
Bart Van Assche
maintainerPATCH 92/117 snic: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/scsi/snic/snic_scsi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/scsi/snic/snic_scsi.c +7 -7
@@ -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->status.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->status.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->status.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->status.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->status.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->status.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->status.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,
Bart Van Assche
maintainerPATCH 93/117 staging: Convert to the scsi_status union
In reply to Bart Van AsscheAn explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union".
--- drivers/staging/rts5208/rtsx.c | 14 +++++++------- drivers/staging/rts5208/rtsx_transport.c | 8 ++++---- drivers/staging/unisys/include/iochannel.h | 3 ++- drivers/staging/unisys/visorhba/visorhba_main.c | 12 ++++++------ 4 files changed, 19 insertions(+), 18 deletions(-)
drivers/staging/rts5208/rtsx.c +7 -7
@@ -134,7 +134,7 @@ static int queuecommand_lck(struct scsi_cmnd *srb,/* fail the command if we are disconnecting */ if (rtsx_chk_stat (chip,RTSX_STAT_DISCONNECT )) {dev_info (&dev->pci->dev,"Fail command during disconnect\n" ); - srb->result =DID_NO_CONNECT <<16 ; + srb->status.combined =DID_NO_CONNECT <<16 ;done (srb);return 0 ; }
@@ -377,7 +377,7 @@ static int rtsx_control_thread(void *__dev)/* has the command aborted ? */ if (rtsx_chk_stat (chip,RTSX_STAT_ABORT )) { - chip->srb->result =DID_ABORT <<16 ; + chip->srb->status.combined =DID_ABORT <<16 ; goto skip_for_abort; }
@@ -388,7 +388,7 @@ static int rtsx_control_thread(void *__dev)*/ if (chip->srb->sc_data_direction ==DMA_BIDIRECTIONAL ) {dev_err (&dev->pci->dev,"UNKNOWN data direction\n" ); - chip->srb->result =DID_ERROR <<16 ; + chip->srb->status.combined =DID_ERROR <<16 ; }/* reject if target != 0 or if LUN is higher than
@@ -398,14 +398,14 @@ static int rtsx_control_thread(void *__dev)dev_err (&dev->pci->dev,"Bad target number (%d:%d)\n" , chip->srb->device->id, (u8 )chip->srb->device->lun); - chip->srb->result =DID_BAD_TARGET <<16 ; + chip->srb->status.combined =DID_BAD_TARGET <<16 ; }else if (chip->srb->device->lun > chip->max_lun) {dev_err (&dev->pci->dev,"Bad LUN (%d:%d)\n" , chip->srb->device->id, (u8 )chip->srb->device->lun); - chip->srb->result =DID_BAD_TARGET <<16 ; + chip->srb->status.combined =DID_BAD_TARGET <<16 ; }/* we've got a command, let's do it! */
@@ -422,7 +422,7 @@ static int rtsx_control_thread(void *__dev) ;/* nothing to do */ /* indicate that the command is done */ - else if (chip->srb->result != DID_ABORT << 16) { + else if (chip->srb->status.combined != DID_ABORT << 16) { chip->srb->scsi_done (chip->srb); } else { skip_for_abort:
@@ -633,7 +633,7 @@ static void quiesce_and_remove_host(struct rtsx_dev *dev)*/ mutex_lock (&dev->dev_mutex);if (chip->srb) { - chip->srb->result =DID_NO_CONNECT <<16 ; + chip->srb->status.combined =DID_NO_CONNECT <<16 ;scsi_lock (host); chip->srb->scsi_done (dev->chip->srb); chip->srb =NULL ;
drivers/staging/rts5208/rtsx_transport.c +4 -4
@@ -160,18 +160,18 @@ void rtsx_invoke_transport(struct scsi_cmnd *srb, struct rtsx_chip *chip)*/ if (rtsx_chk_stat (chip,RTSX_STAT_ABORT )) {dev_dbg (rtsx_dev (chip),"-- command was aborted\n" ); - srb->result =DID_ABORT <<16 ; + srb->status.combined =DID_ABORT <<16 ; goto handle_errors; }/* if there is a transport error, reset and don't auto-sense */ if (result ==TRANSPORT_ERROR ) {dev_dbg (rtsx_dev (chip),"-- transport indicates error, resetting\n" ); - srb->result =DID_ERROR <<16 ; + srb->status.combined =DID_ERROR <<16 ; goto handle_errors; } - srb->result =SAM_STAT_GOOD ; + srb->status.combined =SAM_STAT_GOOD ;/* * If we have a failure, we're going to do a REQUEST_SENSE
@@ -180,7 +180,7 @@ void rtsx_invoke_transport(struct scsi_cmnd *srb, struct rtsx_chip *chip)*/ if (result ==TRANSPORT_FAILED ) {/* set the result so the higher layers expect this data */ - srb->result =SAM_STAT_CHECK_CONDITION ; + srb->status.combined =SAM_STAT_CHECK_CONDITION ;memcpy (srb->sense_buffer, (unsigned char *)&chip->sense_buffer[SCSI_LUN (srb)],sizeof (struct sense_data_t ));
drivers/staging/unisys/include/iochannel.h +2 -1
@@ -34,6 +34,7 @@#include <linux/uuid.h> #include <linux/skbuff.h> #include <linux/visorbus.h> +#include <scsi/scsi_status.h> /* * Must increment these whenever you insert or delete fields within this channel
@@ -217,7 +218,7 @@ struct uiscmdrsp_scsi {u32 data_dir;struct uisscsi_dest vdest;/* Needed to queue the rsp back to cmd originator. */ -int linuxstat; +union scsi_status linuxstat;u8 scsistat;u8 addlstat;#define ADDL_SEL_TIMEOUT 4
drivers/staging/unisys/visorhba/visorhba_main.c +6 -6
@@ -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->status.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->status.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->status.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->status.combined =DID_RESET <<16 ;if (scsicmd->scsi_done) scsicmd->scsi_done (scsicmd);break ;
@@ -864,8 +864,8 @@ 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; -if (cmdrsp->scsi.linuxstat) + scsicmd->status = cmdrsp->scsi.linuxstat; +if (cmdrsp->scsi.linuxstat.combined)do_scsi_linuxstat (cmdrsp, scsicmd);else do_scsi_nolinuxstat (cmdrsp, scsicmd);