Lines Matching refs:scmd
210 static int scsi_check_passthrough(struct scsi_cmnd *scmd, in scsi_check_passthrough() argument
217 if (!scmd->result) in scsi_check_passthrough()
228 if (host_byte(scmd->result) && in scsi_check_passthrough()
229 host_byte(scmd->result) == host_byte(failure->result)) in scsi_check_passthrough()
232 status = status_byte(scmd->result); in scsi_check_passthrough()
237 !scsi_status_is_good(scmd->result)) in scsi_check_passthrough()
247 if (!scsi_command_normalize_sense(scmd, &sshdr)) in scsi_check_passthrough()
301 struct scsi_cmnd *scmd; in scsi_execute_cmd() local
320 scmd = blk_mq_rq_to_pdu(req); in scsi_execute_cmd()
321 scmd->cmd_len = COMMAND_SIZE(cmd[0]); in scsi_execute_cmd()
322 memcpy(scmd->cmnd, cmd, scmd->cmd_len); in scsi_execute_cmd()
323 scmd->allowed = ml_retries; in scsi_execute_cmd()
324 scmd->flags |= args->scmd_flags; in scsi_execute_cmd()
333 if (scsi_check_passthrough(scmd, args->failures) == -EAGAIN) { in scsi_execute_cmd()
344 if (unlikely(scmd->resid_len > 0 && scmd->resid_len <= bufflen)) in scsi_execute_cmd()
345 memset(buffer + bufflen - scmd->resid_len, 0, scmd->resid_len); in scsi_execute_cmd()
348 *args->resid = scmd->resid_len; in scsi_execute_cmd()
350 memcpy(args->sense, scmd->sense_buffer, SCSI_SENSE_BUFFERSIZE); in scsi_execute_cmd()
352 scsi_normalize_sense(scmd->sense_buffer, scmd->sense_len, in scsi_execute_cmd()
355 ret = scmd->result; in scsi_execute_cmd()
3448 void scsi_build_sense(struct scsi_cmnd *scmd, int desc, u8 key, u8 asc, u8 ascq) in scsi_build_sense() argument
3450 scsi_build_sense_buffer(desc, scmd->sense_buffer, key, asc, ascq); in scsi_build_sense()
3451 scmd->result = SAM_STAT_CHECK_CONDITION; in scsi_build_sense()