1scsi_ext_sense_fields(9F)Kernel Functions for Driversscsi_ext_sense_fields(9F)
2
3
4
6 scsi_ext_sense_fields, scsi_sense_info_uint64, scsi_sense_cmdspe‐
7 cific_uint64 - retrieve fields from SCSI sense data
8
10 #include <sys/scsi/scsi.h>
11
12
13
14 void scsi_ext_sense_fields(uint8_t *sense_buffer, int *sense_buf_len,
15 uint8_t **information, uint8_t **cmd_spec_info, uint8_t **fru_code,
16 uint8_t **sk_specific, uint8_t **stream_flags);
17
18
19 boolean_t scsi_sense_info_uint64(uint8_t *sense_buffer, int sense_buf_len,
20 uint64_t *information);
21
22
23 boolean_t scsi_sense_cmdspecific_uint64(uint8_t *sense_buffer,
24 int sense_buf_len, uint64_t *cmd_spec_info);
25
26
28 Solaris DDI specific (Solaris DDI).
29
31 sense_buffer Pointer to a buffer containing SCSI sense data. The
32 sense data is expected in wire format starting at the
33 response code. It can be in either a fixed or descrip‐
34 tor format.
35
36
37 information For scsi_ext_sense_fields(), this is a call-by-refer‐
38 ence pointer to uint8_t. A pointer to the INFORMATION
39 field in the sense data may be returned in this param‐
40 eter.
41
42 The scsi_sense_info_uint64() function requires a
43 pointer to uint64_t. The data in the information field
44 is returned as a 64 bit integer. If the sense data
45 information field is 32 bits, fixed format, the most
46 significant 32-bits are 0.
47
48
49 cmd_spec_info For scsi_ext_sense_fields(), this is a call-by-refer‐
50 ence pointer to uint8_t. A pointer to the COMMAND_SPE‐
51 CIFIC INFORMATION field in the sense data can be
52 returned in this parameter.
53
54 The scsi_sense_cmdspecific_uint64() function requires
55 a pointer to uint64_t. The data in the command spe‐
56 cific information field is returned as a 64 bit inte‐
57 ger. If the sense data command specific information
58 field is 32 bits, fixed format, the most significant
59 32-bits are 0.
60
61
62 fru_code Call-by-reference pointer to uint8_t. A pointer to the
63 FIELD REPLACEABLE UNIT CODE field in the sense data
64 can be returned in this parameter.
65
66
67 sk_specific Call-by-reference pointer to uint8_t. A pointer to the
68 SENSE KEY SPECIFIC field in the sense data can be
69 returned in this parameter.
70
71
72 stream_flags Call-by-reference pointer to uint8_t. A pointer to the
73 byte containing the ILI, EOM, and FILEMARK flags can
74 be returned in this parameter.
75
76
78 The scsi_ext_sense_fields() function can be used to retrieve any of the
79 extended sense data fields from a sense data buffer, regardless of
80 whether the sense data is in fixed format or in descriptor format.
81
82
83 The information, cmd_spec_info, fru_code, sk_specific, and stream_spe‐
84 cific parameters are all call-by-reference output parameters. Each
85 parameter corresponds to one or more of the extended sense data fields.
86 Any of these parameters can be passed as NULL if the caller is not
87 interested in the associated data.
88
89
90 If the requested data is present and valid for each output parameter,
91 the pointer passed in is set to point to the relevant location in the
92 sense buffer. If the data is not present or invalid, the pointer is set
93 to NULL. For example, a caller that requests a pointer to the informa‐
94 tion field would get NULL when an information descriptor is not present
95 for descriptor format sense data or when the valid bit is not set for
96 fixed format sense data.
97
98
99 The information and command specific information fields can be 4 bytes
100 or 8 bytes in length, depending on whether the sense data is in fixed
101 or descriptor format respectively. Drivers can use scsi_vali‐
102 date_sense(9F) to determine the sense data format and, by extension,
103 the length of the information and command specific information fields.
104
105
106 A driver can determine whether integer data is included in the informa‐
107 tion or command specific information fields based on the asc and ascq
108 sense keys, such as the LBA of a failed disk request. The
109 scsi_sense_info_uint64() function retrieves the contents of the infor‐
110 mation field as a 64 bit integer and the scsi_sense_cmdspe‐
111 cific_uint64() retrieves the command specific information field as a 64
112 bit integer.
113
114
115 Drivers should use scsi_validate_sense(9F) to ensure that the sense
116 buffer contains valid sense data.
117
119 The scsi_sense_info_uint64() function returns TRUE if the information
120 field is present and valid. Otherwise it returns FALSE.
121
122
123 The scsi_sense_cmdspecific_uint64() function returns TRUE if the com‐
124 mand specific information field is present and valid. Otherwise it
125 returns FALSE.
126
128 The scsi_ext_sense_fields(), scsi_sense_info_uint64() and
129 scsi_sense_cmdspecific_uint64()() functions can be called from user or
130 interrupt context.
131
133 scsi_find_sense_descr(9F), scsi_sense_asc(9F), scsi_sense_ascq(9F),
134 scsi_sense_key(9F), scsi_validate_sense(9F)
135
136
137
138SunOS 5.11 29 Jun 2006 scsi_ext_sense_fields(9F)