int scsi_deverr(request_ptr, name, msg, type, flags, dev, a0, a1)
REQ_IO request_ptr;
char *name;
char *msg;
char *type;
unsigned flags;
dev_t dev;
int a0;
int a1;
int scsi_get_gen_cmd(request_ptr, command, arrayp, nelements)
REQ_IO request_ptr;
int command, nelements;
paddr_t *arrayp;
DEVCFG *scsi_getdev(unit, config-tbl, dev_open, name)
int unit;
DEVCFG *config-tbl;
int (*dev_open)();
char *name;
int scsi_mkadr3(str, adr)
char str[];
char adr[];
short scsi_s2tos(adr)
char *adr;
long
scsi_s3tol(adr)
char adr[];
caddr_t scsi_stok(adr)
char adr[];
long scsi_stol(adr)
char adr[ ];
int scsi_swap4(adr)
char *adr;
Description
These routines are used when converting between different SCSI
addressing schemes, and for miscellaneous tasks.
Arguments
scsi_deverr
request_ptr
pointer to an instance of the
scsi_io_req(D4osdi)
structure (SCSI I/O request block).
dev
the peripheral driver name (for example, ``Stp'').
msg
an error message which may be NULL.
type
type of peripheral (for example, ``tape'').
flags
peripheral physical unit number.
dev
UNIX device number,
which may be NODEV.
a0 and a1
arguments to be printed using optional format specifiers
within msg in the manner of
sprintf(S).
Set a0 and a1 to NULL if not used.
scsi_get_gen_cmd
request_ptr
pointer to an instance of the
scsi_io_req(D4osdi)
structure (SCSI I/O request block).
command
TEST_CMD, SENSE_CMD, or INQUIRY_CMD which are
defined in scsi.h.
arrayp
pointer to an array containing the arguments to command.
nelements
indicates the number of elements in the array
pointed to by arrayp.
scsi_getdev
unit
the zero-based index of the device
in the configuration table pointed to by config-tbl.
The configuration table is an array
that stores device information
used to build a block or character
device switch table entry.
The configuration table is an instance
of the
scsi_dev_cfg(D4osdi)
structure defined in scsi.h
and must be NULL terminated.
The index member of this structure
is filled in by the operating system
and contains the major number of the device.
address of an array
containing the name of the disk.
For example, for the SCSI disk driver
supplied with your system, ``Sdsk'' is used.
scsi_mkadr3
str
pointer to a three-byte array.
adr
points to a three-byte array for the address to be created.
The most significant byte of adr is not used.
scsi_s2tos
adr
pointer to a two-byte array.
scsi_s3tol
adr
pointer to a three-byte array.
scsi_stok
adr
pointer to a three-byte array.
scsi_stol
adr
pointer to a four-byte array.
scsi_swap4
adr
pointer to a four-byte array.
Return values
scsi_get_gen_cmd( )
has no return value under normal conditions,
but -1 can be returned
if command is not one of the three permissible values.
scsi_getdev( )
returns a pointer to the configuration table entry
for the device
or NULL if the device cannot be found
in the configuration table.
In addition to returning NULL,
the following message is displayed on the console
and stored in the putbuf array in memory:
WARNING: No configuration information for device name
Where device is the major device number and name is the
argument to the routine.
scsi_s2tos( )
returns a short integer.
scsi_s3tol( )
and
scsi_stol( )
returns long integers.
scsi_stok( )
returns a kernel address.
Usage
scsi_deverr( )
prints a SCSI sense error message,
identifying the SCSI device
by the hardware configuration (<ha, id, lun>),
and by the software configuration
(UNIX device number and SCSI physical unit number).
scsi_get_gen_cmd( )
is used to fill a command block.