1、ANSI INCITS 232-1996 (R2001)(formerly ANSI X3.232-1996 (R2001)Information Technology SCSI-2 Common AccessMethod Transport andSCSI Interface ModuleANSI X3.232-l 996 American National Standard for Information Technology - SCSI-2 Common Access Method Transport and SCSI Interface Module Secretariat Info
2、rmation Technology Industry Council Approved February 5, 1996 American National Standards Institute, Inc. AmericanNationalStandardApproval of an American National Standard requires review by ANSI that therequirements for due process, consensus, and other criteria for approval havebeen met by the sta
3、ndards developer.Consensus is established when, in the judgment of the ANSI Board of StandardsReview, substantial agreement has been reached by directly and materiallyaffected interests. Substantial agreement means much more than a simplemajority, but not necessarily unanimity. Consensus requires th
4、at all views andobjections be considered, and that a concerted effort be made toward theirresolution.The use of American National Standards is completely voluntary; their existencedoes not in any respect preclude anyone, whether he has approved the standardsor not, from manufacturing, marketing, pur
5、chasing, or using products, processes,or procedures not conforming to the standards.The American National Standards Institute does not develop standards and will inno circumstances give an interpretation of any American National Standard.Moreover, no person shall have the right or authority to issue
6、 an interpretation ofan American National Standard in the name of the American National StandardsInstitute. Requests for interpretations should be addressed to the secretariat orsponsor whose name appears on the title page of this standard.CAUTION NOTICE: This American National Standard may be revis
7、ed orwithdrawn at any time. The procedures of the American National StandardsInstitute require that action be taken periodically to reaffirm, revise, or withdrawthis standard. Purchasers of American National Standards may receive currentinformation on all standards by calling or writing the American
8、 National StandardsInstitute.CAUTION: The developers of this standard have requested that holders of patents that may be required for theimplementation of the standard disclose such patents to the publisher. However, neither the developers nor the publisherhave undertaken a patent search in order to
9、 identify which, if any, patents may apply to this standard. As of the date ofpublication of this standard and following calls for the identification of patents that may be required for the implementationof the standard, no such claims have been made. No further patent search is conducted by the dev
10、eloper or publisher inrespect to any standard it processes. No representation is made or implied that licenses are not required to avoidinfringement in the use of this standard.Published byAmerican National Standards Institute11 West 42nd Street, New York, New York 10036Copyright 1996 by Information
11、 Technology Industry Council (ITI)All rights reserved.No part of this publication may be reproduced in anyform, in an electronic retrieval system or otherwise,without prior written permission of ITI, 1250 Eye Street NW,Washington, DC 20005.Printed in the United States of AmericaContents Page Forewor
12、d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13、. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*. VIII Scope . .l Normative references .l Definitions and conventions . .l 3.1 Definitions 1 3.2 Conventions . .2 Conformance .2 General description . .3 5.1 Environment . 3 5.2 Peripheral driver functions
14、.4 5.3 XPT functions .5 5.4 SIM functions . .5 Background .5 6.1 Software . 6.2 CAM (Common Access Method) . .5 6.3 OSD (Operating System Dependencies) . .6 6.4 Architectural considerations . .6 Principles of operation . 7 7.1 Accessing the XPT .7 7.2 Initialization 7 7.3 CCB completion . .8 7.3.1 C
15、ompletion of immediate CCB 8 7.3.2 Completion of queued CCB .9 7.4 SCSI request queues . .9 7.4.1 The logical unit and the peripheral driver . .9 7.4.2 SIM queuing .10 7.4.2.1 SIM queue priority . .10 7.4.2.2 Tag recognition . .10 7.4.2.3 Error conditions and queues within the subsystem . .10 7.5 SI
16、M handling of SCSI resets 11 7.6 Asynchronous event callback .12 7.7 Autosense .14 7.8 Loadable modules . 15 OSD (operating system dependent) operation:. .16 8.1 UNIVOS operating system . .16 8.1 .l Initialization .16 8.1.2 Accessing the XPT .17 8.1.2.1 From the peripheral driver . .17 8.1.2.2 From
17、the SIM . .17 8.1.3 Callback on completion . .18 8.1.4 Pointer definition in the UNIVOS environment .18 8.1.5 Request mapping information .18 8.1.6 XPT interface .18 i Page 8.1.6.1 Functions for peripheral driver support . .18 8.1.6.2 Functions for SIM module support .19 8.1.7 SIM interface . .19 8.
18、2 LANOS .19 8.2.1 lnitialization .20 8.2.2 SIM and peripheral driver unloading . .21 8.2.3 Accessing the XPT .21 8.2.4 Hardware registration .21 8.2.5 Miscellaneous . .22 8.3 DOS (disk operating system) .22 8.3.1 Initialization . .22 8.3.1 .l Multiple XPTs . .22 8.3.1.2 Device table handling . .23 8
19、.3.2 Accessing the XPT .23 8.3.2.1 Testing for the presence of the XPT/SIM . .23 8.3.2.2 Sending a CCB to the XPT .24 8.3.3 Callback on completion . .24 8.3.4 Asynchronous event callbacks .24 8.3.5 Pointer definition .25 9 CAM control blocks . .26 9.1 CCB header fields .27 9.1 .l Address of this CCB
20、 . .27 9.1.2 CAM control block length . .27 9.1 .3 XPT function code . .27 9.1.4 CAM status . .28 9.1 5 Connect ID . .31 9.1.6 CAM flags 3 1 9.2 Function codes . .31 9.2.1 NOP .31 9.2.2 Get device type . ,31 9.2.3 Path inquiry .32 9.2.4 Release SIM queue . 35 9.2.5 Scan SCSI bus . .36 9.2.6 Scan log
21、ical unit ,37 9.2.7 Set asynchronous callback .37 9.2.8 Set device type . .38 9.3 SCSI control functions .39 9.3.1 Abort SCSI command .39 9.3.2 Reset SCSI bus .40 9.3.3 Reset SCSI device .40 9.3.4 Terminate I/O process . .41 10 CAM control block to request I/O .42 10.1 Field descriptions for CAM con
22、trol blocks to request l/O.4 2 10.1 .l Autosense Residual Length . .42 10.1.2 Callback on completion .43 10.1.3 CAM flags . .43 10.1.3.1 Byte 1 bits .45 10.1.3.2 Byte 2 bits .46 10.1.3.3 Byte 3 bits .46 10.1.3.4 Byte 4 bits for phase-cognizant mode .46 10.1.3.5 Byte 4 bits for host target mode . .47
23、 ii Page 10.1.4 CDB 47 10.15 CDB length .47 10.1.6 Data transfer length . .47 10.1.7 Function code .47 10.1.8 Initiator ID . .47 10.1.9 Message buffer length (target-only). . .48 10.1 .lO Message buffer pointer (target-only) .48 10.1.11 Next CCB pointer .48 10.1.12 Number of scatter/gather entries .
24、48 10.1.13 Peripheral driver pointer .48 10.1.14 Private data .48 10.1.15 Request mapping information .48 10.1.16 Residual length . .48 10.1.17 SCSI status . .48 10.1.18 Sense info buffer length . .48 10.1.19 Sense info buffer pointer . .49 10.1.20 SG list/data buffer pointer .49 10.1.21 Tag ID .49
25、10.1.22 Tagged queue action . .49 10.1.23 Timeout value . .49 10.1.24 VU field . .49 10.1.25 VU flags .49 10.2 Execute SCSI I/O .49 10.3 Command linking (optional) . .51 11 Target mode (optional) .52 11.1 Target mode overview 5 3 11.2 Phase-cognizant mode .53 11.2.1 Enable LUN for phase cognizant mo
26、de . .54 11.2.2 I/O process creation for phase cognizant mode . .56 11.2.3 Continuation and completion of an I/O process for phase cognizant mode . .57 11.2.4 Non-transparent event handling for phase cognizant mode 5 9 11.2.5 EXECUTE TARGET I/O CCB . .60 11.3 Host target mode . .62 11.3.1 Host targe
27、t mode functionality not specified .62 11.3.2 Host target mode messages . .62 11.3.3 Use of the IMMEDIATE NOTIFY CCB . .63 11.3.3.1 The events/messages that use the immediate notify mechanism . .64 11.3.3.1 .l Sense data preservation where no nexus has been established . .64 11.3.3.1.2 Mandatory mes
28、sages . .65 11.3.3.1.2.1 ABORT message . .65 11.3.3.1.3 Optional messages .66 11.3.3.1.3.1 Optional messages that are not supported .66 11.3.3.1.3.2 ABORT TAG message . .66 11.3.3.1.3.3 CLEAR QUEUE message . .67 11.3.3.1.3.4 HEAD OF QUEUE, ORDERED QUEUE and SIMPLE QUEUE TAG messages . .68 11.3.3.1.3
29、.5 TERMINATE I/O PROCESS message . .68 11.3.3.1.4 Resource unavailable to SIM/HBA .69 . . . III Page 11.3.3.1.5 HBA faults . 69 11.3.4 IMMEDIATE NOTIFY CCB . 71 11.3.5 NOTIFY ACKNOWLEDGE CCB 72 11.3.6 Enable target mode LUN for host target mode .72 11.3.7 ENABLE LUN CCB for host target mode .75 11.3
30、.8 ACCEPT TARGET l/O and CONTINUE TARGET I/O CCB operation . 76 11.3.8.1 SIM/HBA ACCEPT TARGET I/O CCB acceptance 7 8 11.3.8.2 SIM/HBA CDB reception .76 11.3.8.3 Host peripheral driver CDB Received Completion callback function . 78 11.3.8.4 SIM/HBA CONTINUE TARGET I/O CCB acceptance7 8 11.3.8.5 Host
31、 target mode peripheral driver continue target l/O callback 79 11.3.8.6 Command reception errors and data phase errors handling . 79 11.3.8.7 ACCEPT and CONTINUE TARGET I/O CCB timeouts 8 1 11.3.9 ACCEPT TARGET I/O CCB 83 11.3.10 CONTINUE TARGET I/O CCB .84 11.3.11 Disable of a host target mode LUN
32、. .85 11.3.12 Exception conditions .86 11.3.12.1 BUS RESET 86 11.3.12.2 BUS DEVICE RESET message . .87 11.3.13 CDB reception on a non enabled LUN . .88 11.3.14 Retrieving unused ACCEPT TARGET I/O CCBs from the SIM . 88 12 HBA engines . .88 12.1 Engine inquiry .89 12.2 Execute engine (optional). . .8
33、9 Tables 1 2 3 4 5 6 7 8 9 10 11 12 13 14 iv Asynchronous event callback opcode data requirements .I4 CAM control block header .26 Support of SCSI messages .27 XPT function codes . .28 CAM status . .29 NOP CCB . .31 Get device type CCB . .32 PATH INQUIRY CCB . .33 Release SIM queue . .36 SCAN SCSI B
34、US CCB . .36 SCAN LOGICAL UNIT CCB . .37 SET ASYNCHRONOUS CALLBACK CCB .38 SET DEVICE TYPE CCB . .38 ABORT SCSI COMMAND CCB .40 15 16 17 16 19 20 21 22 23 24 25 26 27 26 29 30 Page RESET SCSI BUS CCB . .40 RESET SCSI DEVICE CCB . .41 TERMINATE I/O PROCESS CCB .41 CAM flags . .44 Scatter Gather List
35、.45 EXECUTE SCSI I/O REQUEST CCB . .50 ENABLE LUN CCB for phase cognizant mode .54 CCB List . .55 EXECUTE TARGET I/O CCB 61 IMMEDIATE NOTIFY CCB . .71 NOTIFY ACKNOWLEDGE CCB . .72 ENABLE LUN CCB for host target mode . .75 ACCEPT TARGET l/O CCB . .83 CONTINUE TARGET I/O CCB 84 ENGINE INQUIRY CCB .89
36、EXECUTE ENGINE REQUEST CCB .90 Figures 1 CAM environment model . 4 2 CAM layers 20 Annexes A Physical/logical translation in 80 x 88 environment . .92 B Target peripheral driver example . .96 C UNIVOS OSD data structures .98 V Foreword (This foreword is not part of American National Standard X3.232-
37、l 996.) The purpose of this standard is to define a software architecture for soft- ware peripheral device drivers, the transport, and the software interface modules to the host hardware (e.g., host bus adaptor), for control of SCSI peripheral devices in a common environment. Peripheral device drive
38、rs and software interface modules developed to this standard may easily be ported between different operating systems that have implemented this standard. As with any other technical document, there may arise questions of inter- pretation of this standard. The X3 Committee has established procedures
39、 to issue technical opinions.concerning the standards developed by the X3 organization. These procedures may result in SCSI Technical Information Bulletins (TIBs) being published by X3. These Technical Information Bulletins, while reflecting the opinion of the Technical Committee which developed the
40、 standard, are intended solely as supplementary information to other users of the standard. This stan- dard, ANSI X3.232-1996, as approved through the publication and voting procedures of the American National Standards Institute, is not altered by these bulletins. Any subsequent revision to this st
41、andard may or may not reflect the contents of these Technical Information Bulletins. This standard contains three annexes which are for information only and are not considered part of this standard. Requests for interpretation, suggestions for improvement or addenda, or defect reports are welcome. T
42、hey should be sent to the X3 Secretariat, Infor- mation Technology Industry Council, 1250 Eye Street, NW, Washington DC 200053922. This standard was processed and approved for submittal to ANSI by the Accredited Standards Committee on Information Technology, X3. Committee approval of this standard d
43、oes not necessarily imply that all committee members voted for its approval. At the time it approved this standard, the X3 Committee had the following members: James D. Converse, Chair Donald C. Loughry, Vice-Chair Kate McMillan, Secretary Organization Represented Name of Representative American Nuc
44、lear Society . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Geraldine C. Main Sally Hartzell (Alt.) AMP, Inc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
45、 . . . . . Edward Kelly Charles Brill (Alt.) Apple Computer, Inc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . David K. Michael Jerry Kellenbenz (Alt.) AT the bits, bytes, fields, and code values are set aside for future standardiz
46、ation. The default value shall be zero. The originator is required to define a resewed field or bit as zero, but the receiver should not check reserved fields or bits for zero. 3.1.14 SIM (SCSI interface module): A module designed to accept the CAM control blocks routed through the XPT in order to e
47、xecute SCSI commands and perform other functions. 3.1.15 VU (vendor unique): This term is used to describe bits, bytes, fields, code values, and features which are not described in this standard, and may be used in a way that varies among vendors. 3.1.16 XPT (transport): A layer of software which pe
48、ripheral drivers use to originate the execution of CAM functions. 3.2 Conventions Within the tables, there is a direction bit which indicates in or out. The direction is from the view point of the peripheral driver (i.e., information is out to the SIM from the peripheral driver and in to the periphe
49、ral driver from the SIM). Certain terms used herein are the proper names of signals. These are printed in uppercase to avoid possible confusion with other uses of the same words (e.g., ATTENTION. Any lower-case uses of these words have the normal American-English meaning). There are places in this standard where programming language is used to define or express a concept in order to assist the reader. These are not copyrighted program steps and implementors are encouraged to use the code wherever it suits their application. 4 Conformance An implementation claiming conformance to the transp