Lines Matching +full:0 +full:x72
58 if (type == 0x1e) in scsi_device_type()
60 if (type == 0x1f) in scsi_device_type()
85 return 0; in scsi_pr_type_to_block()
106 return 0; in block_pr_type_to_scsi()
123 * Given a struct scsi_lun of: d2 04 0b 03 00 00 00 00, this function
124 * returns the integer: 0x0b03d204
128 * addressing method 0.
135 lun = 0; in scsilun_to_int()
136 for (i = 0; i < sizeof(lun); i += 2) in scsilun_to_int()
154 * Given an integer : 0x0b03d204, this function returns a
155 * struct scsi_lun of: d2 04 0b 03 00 00 00 00
162 memset(scsilun->scsi_lun, 0, sizeof(scsilun->scsi_lun)); in int_to_scsilun()
164 for (i = 0; i < sizeof(lun); i += 2) { 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()
194 memset(sshdr, 0, sizeof(struct scsi_sense_hdr)); in scsi_normalize_sense()
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()
221 sshdr->sense_key = (sense_buffer[2] & 0xf); in scsi_normalize_sense()
240 * (e.g. 0 -> information)
254 if ((sb_len < 8) || (0 == (add_sen_len = sense_buffer[7]))) in scsi_sense_desc_find()
256 if ((sense_buffer[0] < 0x72) || (sense_buffer[0] > 0x73)) in scsi_sense_desc_find()
261 for (desc_len = 0, k = 0; k < add_sen_len; k += desc_len) { in scsi_sense_desc_find()
265 if (descp[0] == desc_type) in scsi_sense_desc_find()
267 if (add_len < 0) // short descriptor ?? in scsi_sense_desc_find()
277 * 0 == fixed format)
287 buf[0] = 0x72; /* descriptor, current */ in scsi_build_sense_buffer()
291 buf[7] = 0; in scsi_build_sense_buffer()
293 buf[0] = 0x70; /* fixed, current */ in scsi_build_sense_buffer()
295 buf[7] = 0xa; in scsi_build_sense_buffer()
310 * 0 on success or -EINVAL for invalid sense buffer length
314 if ((buf[0] & 0x7f) == 0x72) { in scsi_set_sense_information()
318 ucp = (char *)scsi_sense_desc_find(buf, len + 8, 0); in scsi_set_sense_information()
320 buf[7] = len + 0xc; in scsi_set_sense_information()
324 if (buf_len < len + 0xc) in scsi_set_sense_information()
328 ucp[0] = 0; in scsi_set_sense_information()
329 ucp[1] = 0xa; in scsi_set_sense_information()
330 ucp[2] = 0x80; /* Valid bit */ in scsi_set_sense_information()
331 ucp[3] = 0; in scsi_set_sense_information()
333 } else if ((buf[0] & 0x7f) == 0x70) { in scsi_set_sense_information()
339 if (info <= 0xffffffffUL) in scsi_set_sense_information()
340 buf[0] |= 0x80; in scsi_set_sense_information()
342 buf[0] &= 0x7f; in scsi_set_sense_information()
346 return 0; in scsi_set_sense_information()
360 * 0 on success or -EINVAL for invalid sense buffer length
366 if ((buf[0] & 0x7f) == 0x72) { in scsi_set_sense_field_pointer()
378 ucp[0] = 2; in scsi_set_sense_field_pointer()
380 ucp[4] = 0x80; /* Valid bit */ in scsi_set_sense_field_pointer()
382 ucp[4] |= 0x40; in scsi_set_sense_field_pointer()
383 if (bp < 0x8) in scsi_set_sense_field_pointer()
384 ucp[4] |= 0x8 | bp; in scsi_set_sense_field_pointer()
386 } else if ((buf[0] & 0x7f) == 0x70) { in scsi_set_sense_field_pointer()
391 buf[15] = 0x80; in scsi_set_sense_field_pointer()
393 buf[15] |= 0x40; in scsi_set_sense_field_pointer()
394 if (bp < 0x8) in scsi_set_sense_field_pointer()
395 buf[15] |= 0x8 | bp; in scsi_set_sense_field_pointer()
399 return 0; in scsi_set_sense_field_pointer()