DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

scsi_cdb(D4osdi)


scsi_cdb -- SCSI command descriptor block

Syntax

#include "scsi.h"

Description

The command information (scsi_cdb) structure is referenced by a pointer in the scsi_io_req(D4osdi) structure. It is defined as follows:
union scsi_cdb {
        struct SixCmd {
                unsigned char opcode;
                unsigned char misc:5;
                unsigned char lun:3;
                unsigned char data[3];
                unsigned char control;
        } six;
        struct TenCmd {
                unsigned char opcode;
                unsigned char misc:5;
                unsigned char lun:3;
                unsigned long block;
                unsigned char reserved;
                unsigned short length;
                unsigned char control;
        } ten;
        struct TwelveCmd {
                unsigned char opcode;
                unsigned char misc:5;
                unsigned char lun:3;
                unsigned long block;
                unsigned long length;
                unsigned char reserved;
                unsigned char control;
        } twelve;
        unsigned char raw[12+sizeof(struct scsi_sense)];
};
A request to a peripheral device is performed by sending a command descriptor block (CDB) to the target. The CDB consists of an operation code byte, a logical unit number (LUN), command parameters, if any, and a control byte.

The operation code byte has a group code field and a command code field. There are eight different group codes and thirty-two different commands per group yielding 256 different operation codes.

Group codes are divided as follows:

struct scsi_sense indicates the default location to write SCSI sense information.

See also

scsi_io_req(D4osdi)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005