1scsi_setup_cdb(9F)       Kernel Functions for Drivers       scsi_setup_cdb(9F)
2
3
4

NAME

6       scsi_setup_cdb - setup SCSI command descriptor block (CDB)
7

SYNOPSIS

9       int scsi_setup_cdb(union scsi_cdb *cdbp, uchar_t cmd, uint_t addr,
10            uint_t cnt, uint_t othr_cdb_data);
11
12

INTERFACE LEVEL

14       Solaris DDI specific (Solaris DDI).
15

PARAMETERS

17       cdbp             Pointer to command descriptor block.
18
19
20       cmd              The first byte of the SCSI group 0, 1, 2, 4, or 5 CDB.
21
22
23       addr             Pointer to the location of the data.
24
25
26       cnt              Data  transfer  length  in  units  defined by the SCSI
27                        device type. For sequential devices cnt is the  number
28                        of  bytes.  For  block  devices,  cnt is the number of
29                        blocks.
30
31
32       othr_cdb_data    Additional CDB data.
33
34

DESCRIPTION

36       The scsi_setup_cdb() function initializes a group 0, 1, 2, 4, or 5 type
37       of  command  descriptor block pointed to by  cdbp using cmd, addr, cnt,
38       othr_cdb_data.
39
40
41       addr should be set to 0 for commands having no  addressing  information
42       (for  example,  group  0  READ  command for sequential access devices).
43       othr_cdb_data should be additional CDB data for Group 4 commands;  oth‐
44       erwise, it should be set to 0.
45
46
47       The  scsi_setup_cdb()  function  does not set the LUN bits in CDB[1] as
48       the  makecom(9F) functions do.  Also,  the  fixed  bit  for  sequential
49       access device commands is not set.
50

RETURN VALUES

52       The scsi_setup_cdb() function returns:
53
54       1    Upon success.
55
56
57       0    Upon failure.
58
59

CONTEXT

61       These  functions  can  be called from a user, interrupt, or kernel con‐
62       text.
63

SEE ALSO

65       makecom(9F), scsi_pkt(9S)
66
67
68       Writing Device Drivers
69
70
71       American National Standard Small Computer System Interface-2 (SCSI-2)
72
73
74       American National Standard SCSI-3 Primary Commands (SPC)
75
76
77
78SunOS 5.11                        16 Jan 2006               scsi_setup_cdb(9F)
Impressum