Lines Matching refs:sense

98     SCSISense sense;  in scsi_parse_sense_buf()  local
106 sense.key = in_buf[2]; in scsi_parse_sense_buf()
107 sense.asc = in_buf[12]; in scsi_parse_sense_buf()
108 sense.ascq = in_buf[13]; in scsi_parse_sense_buf()
113 sense.key = in_buf[1]; in scsi_parse_sense_buf()
114 sense.asc = in_buf[2]; in scsi_parse_sense_buf()
115 sense.ascq = in_buf[3]; in scsi_parse_sense_buf()
118 return sense; in scsi_parse_sense_buf()
121 int scsi_build_sense_buf(uint8_t *out_buf, size_t size, SCSISense sense, in scsi_build_sense_buf() argument
129 buf[2] = sense.key; in scsi_build_sense_buf()
131 buf[12] = sense.asc; in scsi_build_sense_buf()
132 buf[13] = sense.ascq; in scsi_build_sense_buf()
136 buf[1] = sense.key; in scsi_build_sense_buf()
137 buf[2] = sense.asc; in scsi_build_sense_buf()
138 buf[3] = sense.ascq; in scsi_build_sense_buf()
146 int scsi_build_sense(uint8_t *buf, SCSISense sense) in scsi_build_sense() argument
148 return scsi_build_sense_buf(buf, SCSI_SENSE_LEN, sense, true); in scsi_build_sense()
338 SCSISense sense; in scsi_convert_sense() local
350 sense = scsi_parse_sense_buf(in_buf, in_len); in scsi_convert_sense()
351 return scsi_build_sense_buf(buf, len, sense, fixed); in scsi_convert_sense()
437 SCSISense sense; in scsi_sense_buf_to_errno() local
442 sense = scsi_parse_sense_buf(in_buf, in_len); in scsi_sense_buf_to_errno()
443 return scsi_sense_to_errno(sense.key, sense.asc, sense.ascq); in scsi_sense_buf_to_errno()
448 SCSISense sense; in scsi_sense_buf_is_guest_recoverable() local
453 sense = scsi_parse_sense_buf(in_buf, in_len); in scsi_sense_buf_is_guest_recoverable()
454 return scsi_sense_is_guest_recoverable(sense.key, sense.asc, sense.ascq); in scsi_sense_buf_is_guest_recoverable()
583 int scsi_sense_from_errno(int errno_value, SCSISense *sense) in scsi_sense_from_errno() argument
599 *sense = SENSE_CODE(READ_ERROR); in scsi_sense_from_errno()
602 *sense = SENSE_CODE(TARGET_FAILURE); in scsi_sense_from_errno()
606 *sense = SENSE_CODE(NO_MEDIUM); in scsi_sense_from_errno()
609 *sense = SENSE_CODE(TARGET_FAILURE); in scsi_sense_from_errno()
612 *sense = SENSE_CODE(INVALID_FIELD); in scsi_sense_from_errno()
615 *sense = SENSE_CODE(SPACE_ALLOC_FAILED); in scsi_sense_from_errno()
618 *sense = SENSE_CODE(IO_ERROR); in scsi_sense_from_errno()
624 SCSISense *sense) in scsi_sense_from_host_status() argument
628 *sense = SENSE_CODE(LUN_NOT_RESPONDING); in scsi_sense_from_host_status()
633 *sense = SENSE_CODE(COMMAND_TIMEOUT); in scsi_sense_from_host_status()
636 *sense = SENSE_CODE(LUN_COMM_FAILURE); in scsi_sense_from_host_status()
639 *sense = SENSE_CODE(COMMAND_ABORTED); in scsi_sense_from_host_status()
642 *sense = SENSE_CODE(RESET); in scsi_sense_from_host_status()
645 *sense = SENSE_CODE(I_T_NEXUS_LOSS); in scsi_sense_from_host_status()
648 *sense = SENSE_CODE(TARGET_FAILURE); in scsi_sense_from_host_status()
653 *sense = SENSE_CODE(SPACE_ALLOC_FAILED); in scsi_sense_from_host_status()
656 *sense = SENSE_CODE(READ_ERROR); in scsi_sense_from_host_status()