Kernel Functions for Drivers scsiextsensefields(9F)
NAME
scsiextsensefields, scsisenseinfouint64,
scsisensecmdspecificuint64 - retrieve fields from SCSI
sense data
SYNOPSIS
#include
void scsiextsensefields(uint8t *sensebuffer, int *sensebuflen,
uint8t **information, uint8t **cmdspecinfo, uint8t **frucode,
uint8t **skspecific, uint8t **streamflags);
booleant scsisenseinfouint64(uint8t *sensebuffer, int sensebuflen,
uint64t *information);
booleant scsisensecmdspecificuint64(uint8t *sensebuffer,
int sensebuflen, uint64t *cmdspecinfo);
INTERFACE LEVEL
Solaris DI specific (Solaris DI).
PARAMETERS
sensebuffer Pointer to a buffer containing SCSI sense
data. The sense data is expected in wire
format starting at the response code. It
can be in either a fixed or descriptor for-
mat.
information For scsiextsensefields(), this is a
call-by-reference pointer to uint8t. A
pointer to the INFORMATION field in the
sense data may be returned in this parame-
ter.
The scsisenseinfouint64() function
requires a pointer to uint64t. The data in
the information field is returned as a 64
bit integer. If the sense data information
field is 32 bits, fixed format, the most
significant 32-bits are 0.
cmdspecinfo For scsiextsensefields(), this is a
call-by-reference pointer to uint8t. A
pointer to the COMANDSPECIFIC INFORMATION
field in the sense data can be returned in
SunOS 5.11 Last change: 29 Jun 2006 1
Kernel Functions for Drivers scsiextsensefields(9F)
this parameter.
The scsisensecmdspecificuint64() func-
tion requires a pointer to uint64t. The
data in the command specific information
field is returned as a 64 bit integer. If
the sense data command specific information
field is 32 bits, fixed format, the most
significant 32-bits are 0.
frucode Call-by-reference pointer to uint8t. A
pointer to the FIELD REPLACEABLE UNIT CODE
field in the sense data can be returned in
this parameter.
skspecific Call-by-reference pointer to uint8t. A
pointer to the SENSE KEY SPECIFIC field in
the sense data can be returned in this
parameter.
streamflags Call-by-reference pointer to uint8t. A
pointer to the byte containing the ILI,
EOM, and FILEMARK flags can be returned in
this parameter.
DESCRIPTION
The scsiextsensefields() function can be used to retrieve
any of the extended sense data fields from a sense data
buffer, regardless of whether the sense data is in fixed
format or in descriptor format.
The information, cmdspecinfo, frucode, skspecific, and
streamspecific parameters are all call-by-reference output
parameters. Each parameter corresponds to one or more of the
extended sense data fields. Any of these parameters can be
passed as NUL if the caller is not interested in the asso-
ciated data.
If the requested data is present and valid for each output
parameter, the pointer passed in is set to point to the
relevant location in the sense buffer. If the data is not
present or invalid, the pointer is set to NUL. For example,
a caller that requests a pointer to the information field
would get NUL when an information descriptor is not present
for descriptor format sense data or when the valid bit is
not set for fixed format sense data.
SunOS 5.11 Last change: 29 Jun 2006 2
Kernel Functions for Drivers scsiextsensefields(9F)
The information and command specific information fields can
be 4 bytes or 8 bytes in length, depending on whether the
sense data is in fixed or descriptor format respectively.
Drivers can use scsivalidatesense(9F) to determine the
sense data format and, by extension, the length of the
information and command specific information fields.
A driver can determine whether integer data is included in
the information or command specific information fields based
on the asc and ascq sense keys, such as the LBA of a failed
disk request. The scsisenseinfouint64() function
retrieves the contents of the information field as a 64 bit
integer and the scsisensecmdspecificuint64() retrieves
the command specific information field as a 64 bit integer.
Drivers should use scsivalidatesense(9F) to ensure that
the sense buffer contains valid sense data.
RETURN VALUES
The scsisenseinfouint64() function returns TRUE if the
information field is present and valid. Otherwise it returns
FALSE.
The scsisensecmdspecificuint64() function returns TRUE if
the command specific information field is present and valid.
Otherwise it returns FALSE.
CONTEXT
The scsiextsensefields(), scsisenseinfouint64() and
scsisensecmdspecificuint64()() functions can be called
from user or interrupt context.
SEE ALSO
scsifindsensedescr(9F), scsisenseasc(9F),
scsisenseascq(9F), scsisensekey(9F),
scsivalidatesense(9F)
SunOS 5.11 Last change: 29 Jun 2006 3
|