Lines Matching +full:no +full:- +full:unaligned +full:- +full:direct +full:- +full:access
1 // SPDX-License-Identifier: GPL-2.0
12 #include <asm/unaligned.h>
28 "Direct-Access ",
29 "Sequential-Access",
33 "CD-ROM ",
42 "Direct-Access-RBC",
48 "Direct-Access-ZBC",
52 * scsi_device_type - Return 17-char string indicating device type.
58 return "Well-known LUN "; in scsi_device_type()
60 return "No Device "; in scsi_device_type()
110 * scsilun_to_int - convert a scsi_lun to an int
114 * Convert @scsilun from a struct scsi_lun to a four-byte host byte-ordered
119 * For a description of the LUN format, post SCSI-3 see the SCSI
120 * Architecture Model, for SCSI-3 see the SCSI Controller Commands.
136 lun = lun | (((u64)scsilun->scsi_lun[i] << ((i + 1) * 8)) | in scsilun_to_int()
137 ((u64)scsilun->scsi_lun[i + 1] << (i * 8))); in scsilun_to_int()
143 * int_to_scsilun - reverts an int into a scsi_lun
149 * an 8-byte lun value into an int. This routine unpacks the int
161 memset(scsilun->scsi_lun, 0, sizeof(scsilun->scsi_lun)); in int_to_scsilun()
164 scsilun->scsi_lun[i] = (lun >> 8) & 0xFF; in int_to_scsilun()
165 scsilun->scsi_lun[i+1] = lun & 0xFF; in int_to_scsilun()
172 * scsi_normalize_sense - normalize main elements from either fixed or
198 sshdr->response_code = (sense_buffer[0] & 0x7f); in scsi_normalize_sense()
203 if (sshdr->response_code >= 0x72) { in scsi_normalize_sense()
208 sshdr->sense_key = (sense_buffer[1] & 0xf); in scsi_normalize_sense()
210 sshdr->asc = sense_buffer[2]; in scsi_normalize_sense()
212 sshdr->ascq = sense_buffer[3]; in scsi_normalize_sense()
214 sshdr->additional_length = sense_buffer[7]; in scsi_normalize_sense()
220 sshdr->sense_key = (sense_buffer[2] & 0xf); in scsi_normalize_sense()
224 sshdr->asc = sense_buffer[12]; in scsi_normalize_sense()
226 sshdr->ascq = sense_buffer[13]; in scsi_normalize_sense()
235 * scsi_sense_desc_find - search for a given descriptor type in descriptor sense data format.
239 * (e.g. 0 -> information)
257 add_sen_len = (add_sen_len < (sb_len - 8)) ? in scsi_sense_desc_find()
258 add_sen_len : (sb_len - 8); in scsi_sense_desc_find()
262 add_len = (k < (add_sen_len - 1)) ? descp[1]: -1; in scsi_sense_desc_find()
274 * scsi_build_sense_buffer - build sense data in a buffer
275 * @desc: Sense format (non-zero == descriptor format,
302 * scsi_set_sense_information - set the information field in a
306 * @info: 64-bit information value to be set
309 * 0 on success or -EINVAL for invalid sense buffer length
325 return -EINVAL; in scsi_set_sense_information()
350 * scsi_set_sense_field_pointer - set the field pointer sense key
359 * 0 on success or -EINVAL for invalid sense buffer length
375 return -EINVAL; in scsi_set_sense_field_pointer()