Kernel Functions for Drivers scsicname(9F)
NAME
scsicname, scsidname, scsimname, scsirname, scsisname -
decode a SCSI name
SYNOPSIS
#include
char *scsicname(uchart cmd, char **cmdvec);
char *scsidname(int dtype);
char *scsimname(uchart msg);
char *scsirname(uchart reason);
char *scsisname(uchart sensekey);
INTERFACE LEVEL
Solaris DI specific (Solaris DI).
PARAMETERS
cmd A SCSI command value.
cmdvec Pointer to an array of command strings.
dtype Device type.
msg A message value.
reason A packet reason value.
sensekey A SCSI sense key value.
DESCRIPTION
The scsicname() function decodes SCSI commands. cmdvec is a
pointer to an array of strings. The first byte of the string
is the command value, and the remainder is the name of the
command.
SunOS 5.11 Last change: 16 Jan 2006 1
Kernel Functions for Drivers scsicname(9F)
The scsidname() function decodes the peripheral device type
(for example, direct access or sequential access) in the
inquiry data.
The scsimname() function decodes SCSI messages.
The scsirname() function decodes packet completion reasons.
The scsisname() function decodes SCSI sense keys.
RETURN VALUES
These functions return a pointer to a string. If an argument
is invalid, they return a string to that effect.
CONTEXT
These functions can be called from user, interrupt, or ker-
nel context.
EXAMPLES
Example 1 Decoding SCSI tape commands.
The scsicname() function decodes SCSI tape commands as fol-
lows:
static char *stcmds[] = {
"\000test unit ready",
"\001rewind",
"\003request sense",
"\010read",
"\012write",
"\020write file mark",
"\021space",
"\022inquiry",
"\025mode select",
"\031erase tape",
"\032mode sense",
"\033load tape",
NUL
};
..
cmnerr(CECONT, "st: cmd=%s", scsicname(cmd, stcmds));
SEE ALSO
Writing Device Drivers
SunOS 5.11 Last change: 16 Jan 2006 2
|