Kernel Functions for Drivers makecom(9F)
NAME
makecom, makecomg0, makecomg0s, makecomg1, makecomg5 -
make a packet for SCSI commands
SYNOPSIS
#include
void makecomg0(struct scsipkt *pkt, struct scsidevice *devp,
int flag, int cmd, int addr, int cnt);
void makecomg0s(struct scsipkt *pkt, struct scsidevice *devp,
int flag, int cmd, int cnt, int fixbit);
void makecomg1(struct scsipkt *pkt, struct scsidevice *devp,
int flag, int cmd, int addr, int cnt);
void makecomg5(struct scsipkt *pkt, struct scsidevice *devp,
int flag, int cmd, int addr, int cnt);
INTERFACE LEVEL
These interfaces are obsolete. scsisetupcdb(9F) should be
used instead.
PARAMETERS
pkt Pointer to an allocated scsipkt(9S) structure.
devp Pointer to the target's scsidevice(9S) structure.
flag Flags for the pktflags member.
cmd First byte of a group 0 or 1 or 5 SCSI CDB.
addr Pointer to the location of the data.
cnt Data transfer length in units defined by the SCSI
device type. For sequential devices cnt is the
number of bytes. For block devices, cnt is the
number of blocks.
fixbit Fixed bit in sequential access device commands.
SunOS 5.11 Last change: 16 Jan 2006 1
Kernel Functions for Drivers makecom(9F)
DESCRIPTION
The makecom functions initialize a packet with the specified
command descriptor block, devp and transport flags. The
pktaddress, pktflags, and the command descriptor block
pointed to by pktcdbp are initialized using the remaining
arguments. Target drivers may use makecomg0() for Group 0
commands (except for sequential access devices), or
makecomg0s() for Group 0 commands for sequential access
devices, or makecomg1() for Group 1 commands, or
makecomg5() for Group 5 commands. fixbit is used by sequen-
tial access devices for accessing fixed block sizes and sets
the tag portion of the SCSI CDB.
CONTEXT
These functions can be called from user, interrupt, or ker-
nel context.
EXAMPLES
Example 1 Using makecom Functions
if (blkno >= (1<<20)) {
makecomg1(pkt, SDSCSIDEVP, pflag, SCMDWRITEG1,
(int) blkno, nblk);
} else {
makecomg0(pkt, SDSCSIDEVP, pflag, SCMDWRITE,
(int) blkno, nblk);
}
ATRIBUTES
See attributes(5) for a description of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Stability Level Obsolete
SEE ALSO
attributes(5), scsisetupcdb(9F), scsidevice(9S),
scsipkt(9S)
ANSI Small Computer System Interface-2 (SCSI-2)
Writing Device Drivers
SunOS 5.11 Last change: 16 Jan 2006 2
Kernel Functions for Drivers makecom(9F)
NOTES
The makecomg0(), makecomg0s(), makecomg1(), and
makecomg5() functions are obsolete and will be discontinued
in a future release. These functions have been replaced by
the scsisetupcdb() function. See scsisetupcdb(9F).
SunOS 5.11 Last change: 16 Jan 2006 3
|