@@ -3017,8 +3017,8 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd)
3017
3017
if (err_type == BGS_GUARD_ERR_MASK ) {
3018
3018
scsi_build_sense_buffer (1 , cmd -> sense_buffer , ILLEGAL_REQUEST ,
3019
3019
0x10 , 0x1 );
3020
- cmd -> result = DRIVER_SENSE << 24
3021
- | ScsiResult ( DID_ABORT , SAM_STAT_CHECK_CONDITION ) ;
3020
+ cmd -> result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
3021
+ SAM_STAT_CHECK_CONDITION ;
3022
3022
phba -> bg_guard_err_cnt ++ ;
3023
3023
lpfc_printf_log (phba , KERN_WARNING , LOG_FCP | LOG_BG ,
3024
3024
"9069 BLKGRD: LBA %lx grd_tag error %x != %x\n" ,
@@ -3028,8 +3028,8 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd)
3028
3028
} else if (err_type == BGS_REFTAG_ERR_MASK ) {
3029
3029
scsi_build_sense_buffer (1 , cmd -> sense_buffer , ILLEGAL_REQUEST ,
3030
3030
0x10 , 0x3 );
3031
- cmd -> result = DRIVER_SENSE << 24
3032
- | ScsiResult ( DID_ABORT , SAM_STAT_CHECK_CONDITION ) ;
3031
+ cmd -> result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
3032
+ SAM_STAT_CHECK_CONDITION ;
3033
3033
3034
3034
phba -> bg_reftag_err_cnt ++ ;
3035
3035
lpfc_printf_log (phba , KERN_WARNING , LOG_FCP | LOG_BG ,
@@ -3040,8 +3040,8 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd)
3040
3040
} else if (err_type == BGS_APPTAG_ERR_MASK ) {
3041
3041
scsi_build_sense_buffer (1 , cmd -> sense_buffer , ILLEGAL_REQUEST ,
3042
3042
0x10 , 0x2 );
3043
- cmd -> result = DRIVER_SENSE << 24
3044
- | ScsiResult ( DID_ABORT , SAM_STAT_CHECK_CONDITION ) ;
3043
+ cmd -> result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
3044
+ SAM_STAT_CHECK_CONDITION ;
3045
3045
3046
3046
phba -> bg_apptag_err_cnt ++ ;
3047
3047
lpfc_printf_log (phba , KERN_WARNING , LOG_FCP | LOG_BG ,
@@ -3096,7 +3096,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd,
3096
3096
spin_unlock (& _dump_buf_lock );
3097
3097
3098
3098
if (lpfc_bgs_get_invalid_prof (bgstat )) {
3099
- cmd -> result = ScsiResult ( DID_ERROR , 0 ) ;
3099
+ cmd -> result = DID_ERROR << 16 ;
3100
3100
lpfc_printf_log (phba , KERN_WARNING , LOG_FCP | LOG_BG ,
3101
3101
"9072 BLKGRD: Invalid BG Profile in cmd"
3102
3102
" 0x%x lba 0x%llx blk cnt 0x%x "
@@ -3108,7 +3108,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd,
3108
3108
}
3109
3109
3110
3110
if (lpfc_bgs_get_uninit_dif_block (bgstat )) {
3111
- cmd -> result = ScsiResult ( DID_ERROR , 0 ) ;
3111
+ cmd -> result = DID_ERROR << 16 ;
3112
3112
lpfc_printf_log (phba , KERN_WARNING , LOG_FCP | LOG_BG ,
3113
3113
"9073 BLKGRD: Invalid BG PDIF Block in cmd"
3114
3114
" 0x%x lba 0x%llx blk cnt 0x%x "
@@ -3124,8 +3124,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd,
3124
3124
3125
3125
scsi_build_sense_buffer (1 , cmd -> sense_buffer , ILLEGAL_REQUEST ,
3126
3126
0x10 , 0x1 );
3127
- cmd -> result = DRIVER_SENSE << 24
3128
- | ScsiResult ( DID_ABORT , SAM_STAT_CHECK_CONDITION ) ;
3127
+ cmd -> result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
3128
+ SAM_STAT_CHECK_CONDITION ;
3129
3129
phba -> bg_guard_err_cnt ++ ;
3130
3130
lpfc_printf_log (phba , KERN_WARNING , LOG_FCP | LOG_BG ,
3131
3131
"9055 BLKGRD: Guard Tag error in cmd"
@@ -3140,8 +3140,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd,
3140
3140
3141
3141
scsi_build_sense_buffer (1 , cmd -> sense_buffer , ILLEGAL_REQUEST ,
3142
3142
0x10 , 0x3 );
3143
- cmd -> result = DRIVER_SENSE << 24
3144
- | ScsiResult ( DID_ABORT , SAM_STAT_CHECK_CONDITION ) ;
3143
+ cmd -> result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
3144
+ SAM_STAT_CHECK_CONDITION ;
3145
3145
3146
3146
phba -> bg_reftag_err_cnt ++ ;
3147
3147
lpfc_printf_log (phba , KERN_WARNING , LOG_FCP | LOG_BG ,
@@ -3157,8 +3157,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd,
3157
3157
3158
3158
scsi_build_sense_buffer (1 , cmd -> sense_buffer , ILLEGAL_REQUEST ,
3159
3159
0x10 , 0x2 );
3160
- cmd -> result = DRIVER_SENSE << 24
3161
- | ScsiResult ( DID_ABORT , SAM_STAT_CHECK_CONDITION ) ;
3160
+ cmd -> result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
3161
+ SAM_STAT_CHECK_CONDITION ;
3162
3162
3163
3163
phba -> bg_apptag_err_cnt ++ ;
3164
3164
lpfc_printf_log (phba , KERN_WARNING , LOG_FCP | LOG_BG ,
@@ -3874,7 +3874,7 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
3874
3874
}
3875
3875
3876
3876
out :
3877
- cmnd -> result = ScsiResult ( host_status , scsi_status ) ;
3877
+ cmnd -> result = host_status << 16 | scsi_status ;
3878
3878
lpfc_send_scsi_error_event (vport -> phba , vport , lpfc_cmd , rsp_iocb );
3879
3879
}
3880
3880
@@ -4027,7 +4027,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
4027
4027
break ;
4028
4028
case IOSTAT_NPORT_BSY :
4029
4029
case IOSTAT_FABRIC_BSY :
4030
- cmd -> result = ScsiResult ( DID_TRANSPORT_DISRUPTED , 0 ) ;
4030
+ cmd -> result = DID_TRANSPORT_DISRUPTED << 16 ;
4031
4031
fast_path_evt = lpfc_alloc_fast_evt (phba );
4032
4032
if (!fast_path_evt )
4033
4033
break ;
@@ -4061,14 +4061,14 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
4061
4061
lpfc_cmd -> result == IOERR_ELXSEC_CRYPTO_ERROR ||
4062
4062
lpfc_cmd -> result ==
4063
4063
IOERR_ELXSEC_CRYPTO_COMPARE_ERROR ) {
4064
- cmd -> result = ScsiResult ( DID_NO_CONNECT , 0 ) ;
4064
+ cmd -> result = DID_NO_CONNECT << 16 ;
4065
4065
break ;
4066
4066
}
4067
4067
if (lpfc_cmd -> result == IOERR_INVALID_RPI ||
4068
4068
lpfc_cmd -> result == IOERR_NO_RESOURCES ||
4069
4069
lpfc_cmd -> result == IOERR_ABORT_REQUESTED ||
4070
4070
lpfc_cmd -> result == IOERR_SLER_CMD_RCV_FAILURE ) {
4071
- cmd -> result = ScsiResult ( DID_REQUEUE , 0 ) ;
4071
+ cmd -> result = DID_REQUEUE << 16 ;
4072
4072
break ;
4073
4073
}
4074
4074
if ((lpfc_cmd -> result == IOERR_RX_DMA_FAILED ||
@@ -4102,16 +4102,16 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
4102
4102
}
4103
4103
/* else: fall through */
4104
4104
default :
4105
- cmd -> result = ScsiResult ( DID_ERROR , 0 ) ;
4105
+ cmd -> result = DID_ERROR << 16 ;
4106
4106
break ;
4107
4107
}
4108
4108
4109
4109
if (!pnode || !NLP_CHK_NODE_ACT (pnode )
4110
4110
|| (pnode -> nlp_state != NLP_STE_MAPPED_NODE ))
4111
- cmd -> result = ScsiResult ( DID_TRANSPORT_DISRUPTED ,
4112
- SAM_STAT_BUSY ) ;
4111
+ cmd -> result = DID_TRANSPORT_DISRUPTED << 16 |
4112
+ SAM_STAT_BUSY ;
4113
4113
} else
4114
- cmd -> result = ScsiResult ( DID_OK , 0 ) ;
4114
+ cmd -> result = DID_OK << 16 ;
4115
4115
4116
4116
if (cmd -> result || lpfc_cmd -> fcp_rsp -> rspSnsLen ) {
4117
4117
uint32_t * lp = (uint32_t * )cmd -> sense_buffer ;
0 commit comments