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

1 // SPDX-License-Identifier: GPL-2.0
12 #include <linux/unaligned.h>
29 "Direct-Access ",
30 "Sequential-Access",
34 "CD-ROM ",
43 "Direct-Access-RBC",
49 "Direct-Access-ZBC",
53 * scsi_device_type - Return 17-char string indicating device type.
59 return "Well-known LUN "; in scsi_device_type()
61 return "No Device "; in scsi_device_type()
111 * scsilun_to_int - convert a scsi_lun to an int
115 * Convert @scsilun from a struct scsi_lun to a four-byte host byte-ordered
120 * For a description of the LUN format, post SCSI-3 see the SCSI
121 * Architecture Model, for SCSI-3 see the SCSI Controller Commands.
137 lun = lun | (((u64)scsilun->scsi_lun[i] << ((i + 1) * 8)) | in scsilun_to_int()
138 ((u64)scsilun->scsi_lun[i + 1] << (i * 8))); in scsilun_to_int()
144 * int_to_scsilun - reverts an int into a scsi_lun
150 * an 8-byte lun value into an int. This routine unpacks the int
162 memset(scsilun->scsi_lun, 0, sizeof(scsilun->scsi_lun)); in int_to_scsilun()
165 scsilun->scsi_lun[i] = (lun >> 8) & 0xFF; in int_to_scsilun()
166 scsilun->scsi_lun[i+1] = lun & 0xFF; in int_to_scsilun()
173 * scsi_normalize_sense - normalize main elements from either fixed or
199 sshdr->response_code = (sense_buffer[0] & 0x7f); in scsi_normalize_sense()
204 if (sshdr->response_code >= 0x72) { in scsi_normalize_sense()
209 sshdr->sense_key = (sense_buffer[1] & 0xf); in scsi_normalize_sense()
211 sshdr->asc = sense_buffer[2]; in scsi_normalize_sense()
213 sshdr->ascq = sense_buffer[3]; in scsi_normalize_sense()
215 sshdr->additional_length = sense_buffer[7]; in scsi_normalize_sense()
221 sshdr->sense_key = (sense_buffer[2] & 0xf); in scsi_normalize_sense()
225 sshdr->asc = sense_buffer[12]; in scsi_normalize_sense()
227 sshdr->ascq = sense_buffer[13]; in scsi_normalize_sense()
236 * scsi_sense_desc_find - search for a given descriptor type in descriptor sense data format.
240 * (e.g. 0 -> information)
258 add_sen_len = (add_sen_len < (sb_len - 8)) ? in scsi_sense_desc_find()
259 add_sen_len : (sb_len - 8); in scsi_sense_desc_find()
263 add_len = (k < (add_sen_len - 1)) ? descp[1]: -1; in scsi_sense_desc_find()
275 * scsi_build_sense_buffer - build sense data in a buffer
276 * @desc: Sense format (non-zero == descriptor format,
303 * scsi_set_sense_information - set the information field in a
307 * @info: 64-bit information value to be set
310 * 0 on success or -EINVAL for invalid sense buffer length
326 return -EINVAL; in scsi_set_sense_information()
351 * scsi_set_sense_field_pointer - set the field pointer sense key
360 * 0 on success or -EINVAL for invalid sense buffer length
376 return -EINVAL; in scsi_set_sense_field_pointer()