Lines Matching +full:no +full:- +full:unaligned +full:- +full:direct +full:- +full:access

1 // SPDX-License-Identifier: GPL-2.0
11 #include <asm/unaligned.h>
27 "Direct-Access ",
28 "Sequential-Access",
32 "CD-ROM ",
41 "Direct-Access-RBC",
47 "Direct-Access-ZBC",
51 * scsi_device_type - Return 17-char string indicating device type.
57 return "Well-known LUN "; in scsi_device_type()
59 return "No Device "; in scsi_device_type()
67 * scsilun_to_int - convert a scsi_lun to an int
71 * Convert @scsilun from a struct scsi_lun to a four-byte host byte-ordered
76 * For a description of the LUN format, post SCSI-3 see the SCSI
77 * Architecture Model, for SCSI-3 see the SCSI Controller Commands.
93 lun = lun | (((u64)scsilun->scsi_lun[i] << ((i + 1) * 8)) | in scsilun_to_int()
94 ((u64)scsilun->scsi_lun[i + 1] << (i * 8))); in scsilun_to_int()
100 * int_to_scsilun - reverts an int into a scsi_lun
106 * an 8-byte lun value into an int. This routine unpacks the int
118 memset(scsilun->scsi_lun, 0, sizeof(scsilun->scsi_lun)); in int_to_scsilun()
121 scsilun->scsi_lun[i] = (lun >> 8) & 0xFF; in int_to_scsilun()
122 scsilun->scsi_lun[i+1] = lun & 0xFF; in int_to_scsilun()
129 * scsi_normalize_sense - normalize main elements from either fixed or
155 sshdr->response_code = (sense_buffer[0] & 0x7f); in scsi_normalize_sense()
160 if (sshdr->response_code >= 0x72) { in scsi_normalize_sense()
165 sshdr->sense_key = (sense_buffer[1] & 0xf); in scsi_normalize_sense()
167 sshdr->asc = sense_buffer[2]; in scsi_normalize_sense()
169 sshdr->ascq = sense_buffer[3]; in scsi_normalize_sense()
171 sshdr->additional_length = sense_buffer[7]; in scsi_normalize_sense()
177 sshdr->sense_key = (sense_buffer[2] & 0xf); in scsi_normalize_sense()
182 sshdr->asc = sense_buffer[12]; in scsi_normalize_sense()
184 sshdr->ascq = sense_buffer[13]; in scsi_normalize_sense()
193 * scsi_sense_desc_find - search for a given descriptor type in descriptor sense data format.
197 * (e.g. 0 -> information)
215 add_sen_len = (add_sen_len < (sb_len - 8)) ? in scsi_sense_desc_find()
216 add_sen_len : (sb_len - 8); in scsi_sense_desc_find()
220 add_len = (k < (add_sen_len - 1)) ? descp[1]: -1; in scsi_sense_desc_find()
232 * scsi_build_sense_buffer - build sense data in a buffer
233 * @desc: Sense format (non-zero == descriptor format,
260 * scsi_set_sense_information - set the information field in a
264 * @info: 64-bit information value to be set
267 * 0 on success or -EINVAL for invalid sense buffer length
283 return -EINVAL; in scsi_set_sense_information()
308 * scsi_set_sense_field_pointer - set the field pointer sense key
317 * 0 on success or -EINVAL for invalid sense buffer length
333 return -EINVAL; in scsi_set_sense_field_pointer()