sdi_errmsg(D3sdi)
sdi_errmsg --
format and print an error message
Synopsis
#include <sys/sdi.h>
void sdi_errmsg(char *dev_id, struct scsi_ad *addr,
struct sb *sbp, struct sense *sense,
int type, int err_code);
Description
sdi_errmsg formats and prints
cmn_err(D3)
warning messages.
The format and content of the messages changes depending on
the message type argument.
When the sense data is valid,
sdi_errmsg also expands the sense data
and extended sense data into meaningful phrases.
When the sense key indicates a recovered error
or a ``not ready'' condition,
the messages go to putbuf instead of the system console.
An optional err_code can be used to
uniquely identify messages.
No validity checking is performed on
any of the values specified.
Arguments
dev_id-
pointer to a character string giving the device name
addr-
pointer to the SCSI address structure for the
device returning the error
sbp-
pointer to the SCSI block for the request
that generated the error
sense-
pointer to the sense data structure for the
request that generated the error
type-
a code indicating the type of condition that generated the error
err_code-
a code used to uniquely identify this
invocation of sdi_errmsg
Return values
None.
Usage
sdi_errmsg
is used in the existing target drivers to format and
print error messages.
It supports the production of messages in a common format.
It should be used whenever a non-fatal
error condition is to be presented
at the system console.
This routine produces CE_WARN error messages.
The argument dev_id should
point to a string which will be
used to identify the target returning an error.
Typically, this is a single word like ``Disk'' or ``Tape.''
The argument addr is used along
with the LUN contained in the
structure pointed to by
sbp to construct a SCSI-like name for
the device returning the error.
This combination results in a string like
``HA x TC x LU x,'' where the
xs are replaced by HBA number,
target numbers and logical unit number.
The four supported values for type are:
SDI_SFB_ERR-
Interprets the sbp as an SFB
and extracts only the logical unit and
SDI completion code from the sbp.
The other values for type cause the routine
to interpret the sbp as an SCB.
This allows the routine to extract and print the relevant information
from the sbp.
SDI_CKCON_ERR-
Expands the available sense
information into phrases.
This allows the production of meaningful error messages.
SDI_CKSTAT_ERR-
Prints the target
status information available in the SCB as part of the text.
SDI_DEFAULT_ERR-
Prints the SDI completion
code as part of the message text.
If err_code, defined by the target driver,
is non-zero, it is printed as a hexadecimal number
on the end of the first line of the error output.
This may be useful to identify exactly
where in a driver the call
to sdi_errmsg occurred, if all the invocations
are uniquely numbered.
Context and synchronization
Blockable
context.
Applicable hardware
x86/Pentium compatible architectures
Version applicability
sdi:
1, 2, 3, 4
target drivers.
References
sb(D4sdi),
scb(D4sdi),
scsi_ad(D4sdi),
sfb(D4sdi)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005