scsi_log(9F) Kernel Functions for Drivers scsi_log(9F)NAME
scsi_log - display a SCSI-device-related message
SYNOPSIS
#include <sys/scsi/scsi.h>
#include <sys/cmn_err.h>
void scsi_log(dev_info_t *dip, char *drv_name, uint_t level,
const char *fmt, ...);
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI).
PARAMETERS
dip Pointer to the dev_info structure.
drv_name String naming the device.
level Error level.
fmt Display format.
DESCRIPTION
The scsi_log() function is a utility function that displays a message via the cmn_err(9F) routine. The error levels that can be passed in
to this function are CE_PANIC, CE_WARN, CE_NOTE, CE_CONT, and SCSI_DEBUG. The last level is used to assist in displaying debug messages to
the console only. drv_name is the short name by which this device is known; example disk driver names are sd and cmdk. If the dev_info_t
pointer is NULL, then the drv_name will be used with no unit or long name.
If the first character in format is:
o An exclamation mark (!), the message goes only to the system buffer.
o A caret (^), the message goes only to the console.
o A question mark (?) and level is CE_CONT, the message is always sent to the system buffer, but is written to the console only
when the system has been booted in verbose mode. See kernel(1M). If neither condition is met, the ? character has no effect and
is simply ignored.
All formatting conversions in use by cmn_err() also work with scsi_log().
CONTEXT
The scsi_log() function may be called from user, interrupt, or kernel context.
SEE ALSO kernel(1M), sd(7D), cmn_err(9F), scsi_errmsg(9F)
Writing Device Drivers
SunOS 5.11 16 Jan 2006 scsi_log(9F)
Check Out this Related Man Page
cmn_err(9F) Kernel Functions for Drivers cmn_err(9F)NAME
cmn_err, vcmn_err, zcmn_err - display an error message or panic the system
SYNOPSIS
#include <sys/cmn_err.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>
void cmn_err(int level, char *format...
#include <sys/varargs.h>
void vcmn_err(int level, char *format, va_list ap);
#include <sys/types.h>
void zcmn_err(zoneid_t zoneid, int level, char *format...);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
cmn_err()
level A constant indicating the severity of the error condition.
format Message to be displayed.
vcmn_err()
The vcmn_err() function takes level and format as described for cmn_err(), but its third argument is different:
ap Variable argument list passed to the function.
zcmn_err()
The zcmn_err() function works exactly like cmn_err(), but includes an additional argument:
zoneid Zone to which log messages should be directed. See zones(5).
DESCRIPTION
cmn_err()
The cmn_err() function displays a specified message on the console. cmn_err() can also panic the system. When the system panics, it
attempts to save recent changes to data, display a "panic message" on the console, attempt to write a core file, and halt system process-
ing. See the CE_PANIC level below.
level is a constant indicating the severity of the error condition. The four severity levels are:
CE_CONT Used to continue another message or to display an informative message not associated with an error. Note that multiple CE_CONT
messages without a newline may or may not appear on the system console or in the system log as a single line message. A single
line message may be produced by constructing the message with sprintf(9F) or vsprintf(9F) before calling cmn_err().
CE_NOTE Used to display a message preceded with NOTICE. This message is used to report system events that do not necessarily require
user action, but may interest the system administrator. For example, a message saying that a sector on a disk needs to be
accessed repeatedly before it can be accessed correctly might be noteworthy.
CE_WARN Used to display a message preceded with WARNING. This message is used to report system events that require immediate attention,
such as those where if an action is not taken, the system may panic. For example, when a peripheral device does not initialize
correctly, this level should be used.
CE_PANIC Used to display a message preceded with "panic", and to panic the system. Drivers should specify this level only under the most
severe conditions or when debugging a driver. A valid use of this level is when the system cannot continue to function. If the
error is recoverable, or not essential to continued system operation, do not panic the system.
format is the message to be displayed. It is a character string which may contain plain characters and conversion specifications. By
default, the message is sent both to the system console and to the system log.
Each conversion specification in format is introduced by the % character, after which the following appear in sequence:
An optional decimal digit specifying a minimum field width for numeric conversion. The converted value will be right-justified and padded
with leading zeroes if it has fewer characters than the minimum.
An optional l (ll) specifying that a following d, D, o, O, x, X, or u conversion character applies to a long (long long) integer argument.
An l (ll) before any other conversion character is ignored.
A character indicating the type of conversion to be applied:
d,D,o,O,x,X,u The integer argument is converted to signed decimal (d, D), unsigned octal (o, O), unsigned hexadecimal (x, X), or
unsigned decimal (u), respectively, and displayed. The letters abcdef are used for x and X conversion.
c The character value of the argument is displayed.
b The %b conversion specification allows bit values to be displayed meaningfully. Each %b takes an integer value and a for-
mat string from the argument list. The first character of the format string should be the output base encoded as a control
character. This base is used to display the integer argument. The remaining groups of characters in the format string con-
sist of a bit number (between 1 and 32, also encoded as a control character) and the next characters (up to the next con-
trol character or '