SCSI_FIND_SENSE_DESCR(9F) | Kernel Functions for Drivers | SCSI_FIND_SENSE_DESCR(9F) |
scsi_find_sense_descr - find descriptor in SCSI sense data
#include <sys/scsi/scsi.h> uint8_t *scsi_find_sense_descr(uint8_t *sense_buffer, int sense_buf_len,
int req_descr_type);
illumos DDI specific (illumos DDI).
sense_buffer
sense_buf_len
req_descr_type
The scsi_find_sense_descr() function is used to obtain a pointer to a specific descriptor type, specified by req_descr_type, within a descriptor sense buffer. Before returning the pointer, scsi_find_sense_descr() verifies that the entire descriptor is present based on the length provided in sense_buf_len.
Any value for req_descr_type can be requested. The following descriptor types are already defined:
#define DESCR_INFORMATION 0x00 #define DESCR_COMMAND_SPECIFIC 0x01 #define DESCR_SENSE_KEY_SPECIFIC 0x02 #define DESCR_FRU 0x03 #define DESCR_STREAM_COMMANDS 0x04 #define DESCR_BLOCK_COMMANDS 0x05 #define DESCR_OSD_OID 0x06 #define DESCR_OSD_RESP_INTEGRITY 0x07 #define DESCR_OSD_ATTR_ID 0x08
Drivers should use scsi_validate_sense(9F) to ensure that the sense buffer contains valid descriptor sense data.
The scsi_find_sense_descr() function returns a pointer to a sense descriptor of the requested type if a descriptor of that type exists. If no such descriptor exists, scsi_find_sense_descr() returns NULL.
The scsi_find_sense_descr() function can be called from user or interrupt context.
scsi_ext_sense_fields(9F), scsi_sense_asc(9F), scsi_sense_ascq(9F), scsi_sense_cmdspecific_uint64(9F), scsi_sense_info_uint64(9F), scsi_sense_key(9F), scsi_validate_sense(9F)
June 30, 2006 | OmniOS |