Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
scsi_log(9F)


NAME

 scsi_log - display a SCSI-device-related message

 
#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).

 
dip
Pointer to the dev_info structure.
drv_name
String naming the device.
level
Error level.
fmt
Display format.

 

scsi_log() 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(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().

 

scsi_log() may be called from user or interrupt context.

 Example 1.
 

 
scsi_log(dev, "Disk Unit ", CE_PANIC, "Bad Value %d\n", foo);
generates:

 
PANIC: /eisa/aha@330,0/cmdk@0,0 (Disk Unit 0): Bad Value 5

This is followed by a PANIC.

Example 2.
 

 
scsi_log(dev, "sd", CE_WARN, "Label Bad\n");

generates:

 
WARNING: /sbus@1,f8000000/esp@0,8000000/sd@1,0 (sd1): Label Bad

Example 3.
 

 
scsi_log((dev_info_t *) NULL, "Disk Unit ", CE_NOTE, "Disk Ejected\n");
generates:
 
Disk Unit: Disk Ejected

Example 4.
 

 
scsi_log(cmdk_unit, "Disk Unit ", CE_CONT, "Disk Inserted\n");
generates:
 
Disk Inserted

Example 5.
 

 
scsi_log(sd_unit, "sd", SCSI_DEBUG, "We really got here\n");
generates (only to the console):
 
DEBUG: sd1: We really got here

 

kernel(1M), sd(7D), cmn_err(9F), scsi_errmsg(9F)


Go To TopLast Changed 7 Jun 1993

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.