/** * zfcp_scsi_dif_sense_error - Report DIF/DIX error as driver sense error * @scmd: The SCSI command to report the error for * @ascq: The ASCQ to put in the sense buffer * * See the error handling in sd_done for the sense codes used here. * Set DID_SOFT_ERROR to retry the request, if possible. */ 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; set_host_byte(scmd, DID_SOFT_ERROR); }
static void stex_invalid_field(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; /* "Invalid field in cbd" */ scsi_build_sense_buffer(0, cmd->sense_buffer, ILLEGAL_REQUEST, 0x24, 0x0); done(cmd); }
void srd_make_sense_buffer(unsigned char *buf, int key, int asc, int ascq) { trace(); if (WARN_ON(!buf)) { return; } memset(buf, 0, SCSI_SENSE_BUFFERSIZE); scsi_build_sense_buffer(0, buf, key, asc, ascq); pr_err("%s : sense 0x%x, 0x%x, 0x%x\n", "my_dev", key, asc, ascq); }