#include <sys/scsi/scsi.h>
void makecom_g0(struct scsi_pkt *pkt, struct scsi_device *devp, int flag, int cmd, int addr, int cnt);
void makecom_g0_s(struct scsi_pkt *pkt, struct scsi_device *devp, int flag, int cmd, int cnt, int fixbit);
void makecom_g1(struct scsi_pkt *pkt, struct scsi_device *devp, int flag, int cmd, int addr, int cnt);
void makecom_g5(struct scsi_pkt *pkt, struct scsi_device *devp, int flag, int cmd, int addr, int cnt);
Solaris DDI specific (Solaris DDI).
makecom functions initialize a packet with the specified command descriptor block, devp and transport flags. The pkt_address, pkt_flags, and the command descriptor block pointed to by pkt_cdbp are initialized using the remaining arguments. Target drivers may use makecom_g0() for Group 0 commands (except for sequential access devices), or makecom_g0_s() for Group 0 commands for sequential access devices, or makecom_g1() for Group 1 commands, or makecom_g5() for Group 5 commands. fixbit is used by sequential access devices for accessing fixed block sizes and sets the the tag portion of the SCSI CDB.
if (blkno >= (1<<20)) { makecom_g1(pkt, SD_SCSI_DEVP, pflag, SCMD_WRITE_G1, (int) blkno, nblk); } else { makecom_g0(pkt, SD_SCSI_DEVP, pflag, SCMD_WRITE, (int) blkno, nblk); }
ANSI Small Computer System Interface-2 (SCSI-2)