xref: /illumos-gate/usr/src/man/man9f/scsi_log.9f (revision b8052df9f609edb713f6828c9eecc3d7be19dfb3)
te
Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
SCSI_LOG 9F "Jan 16, 2006"
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
illumos DDI specific (illumos 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:

An exclamation mark (!), the message goes only to the system buffer.

A caret (^), the message goes only to the console.

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(8). 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
sd (4D), kernel (8), cmn_err (9F), scsi_errmsg (9F)

Writing Device Drivers