home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Standards 1993 July / Disc.iso / ieee / scsi / scsi1_7.3 / text0000.txt < prev   
Encoding:
Text File  |  1990-03-24  |  64.0 KB  |  1,176 lines

  1.  
  2. .fo Section 7                            #
  3. 7. Command Descriptions for All Device Types
  4.  
  5. 7.1 Group 0 Commands for All Device Types.  These commands shall be as listed 
  6. in Table 7-1.
  7.  
  8.                                   Table 7-1
  9.                  Group 0 Common Commands for All Device Types
  10.  
  11. ==============================================================================
  12. Operation
  13.   Code      Type   Command Name                       Section
  14. ------------------------------------------------------------------------------
  15.    00H       O     TEST UNIT READY                    7.1.1
  16.    01H       *
  17.    02H       V
  18.    03H       M     REQUEST SENSE                      7.1.2
  19.    04H       *
  20.    05H       *
  21.    06H       V
  22.    07H       *
  23.    08H       *
  24.    09H       V
  25.    0AH       *
  26.    0BH       *
  27.    0CH       V
  28.    0DH       V
  29.    0EH       V
  30.    0FH       *
  31.    10H       *
  32.    11H       *
  33.    12H       E     INQUIRY                            7.1.3
  34.    13H       *
  35.    14H       *
  36.    15H       *
  37.    16H       *
  38.    17H       *
  39.    18H       O     COPY                               7.1.4
  40.    19H       *
  41.    1AH       *
  42.    1BH       *
  43.    1CH       O     RECEIVE DIAGNOSTIC RESULTS         7.1.5
  44.    1DH       O     SEND DIAGNOSTIC                    7.1.6
  45.    1EH       *
  46.    1FH       R
  47. ==============================================================================
  48.  
  49. Key: M  =  Command implementation is mandatory.
  50.      E  =  Command implementation is required for SCSI devices that support 
  51.            device-independent self-configuring software.
  52.      O  =  Command implementation is optional.
  53.      R  =  Operation code is reserved for future standardization.
  54.      V  =  Operation code is available for vendor unique commands.
  55.      *  =  These operation codes may have different meanings for specific 
  56.            types of peripheral devices.  (See the appropriate section for 
  57.            further information.)
  58. .pa
  59.  
  60.   7.1.1 TEST UNIT READY Command
  61.  
  62.      Peripheral Device Type:  All
  63.         Operation Code Type:  Optional
  64.              Operation Code:  00H
  65.  
  66.                                   Table 7-2
  67.                            TEST UNIT READY Command
  68.  
  69. ==============================================================================
  70.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  71. Byte |        |        |        |        |        |        |        |        |
  72. ==============================================================================
  73.  0   |                           Operation Code                              | 
  74. -----|-----------------------------------------------------------------------|
  75.  1   | Logical Unit Number      |                  Reserved                  |
  76. -----|-----------------------------------------------------------------------|
  77.  2   |                           Reserved                                    |
  78. -----|-----------------------------------------------------------------------|
  79.  3   |                           Reserved                                    |
  80. -----|-----------------------------------------------------------------------|
  81.  4   |                           Reserved                                    |
  82. -----|-----------------------------------------------------------------------|
  83.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  84. ==============================================================================
  85.  
  86.   The TEST UNIT READY command (Table 7-2) provides a means to check if the 
  87. logical unit is ready.  This is not a request for a self test.  If the logical 
  88. unit would accept an appropriate medium-access command without returning CHECK 
  89. CONDITION status, this command shall return a GOOD status.
  90.  
  91.   7.1.2 REQUEST SENSE Command
  92.  
  93.      Peripheral Device Type:  All
  94.         Operation Code Type:  Mandatory
  95.              Operation Code:  03H
  96.  
  97.                                   Table 7-3
  98.                             REQUEST SENSE Command
  99.  
  100. ==============================================================================
  101.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  102. Byte |        |        |        |        |        |        |        |        |
  103. ==============================================================================
  104.  0   |                           Operation Code                              | 
  105. -----|-----------------------------------------------------------------------|
  106.  1   | Logical Unit Number      |                  Reserved                  |
  107. -----|-----------------------------------------------------------------------|
  108.  2   |                           Reserved                                    |
  109. -----|-----------------------------------------------------------------------|
  110.  3   |                           Reserved                                    |
  111. -----|-----------------------------------------------------------------------|
  112.  4   |                           Allocation Length                           |
  113. -----|-----------------------------------------------------------------------|
  114.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  115. ==============================================================================
  116.  
  117.   The REQUEST SENSE command (Table 7-3) requests that the target transfer 
  118. sense data to the initiator.
  119.  
  120.   The sense data shall be valid for a CHECK CONDITION status returned on the 
  121. prior command.  This sense data shall be preserved by the target for the 
  122. initiator until retrieved by the REQUEST SENSE command or until the receipt of 
  123. any other command for the same logical unit from the initiator that issued the 
  124. command resulting in the CHECK CONDITION status.  Sense data shall be cleared 
  125. upon receipt of any subsequent command to the logical unit from the initiator 
  126. receiving the CHECK CONDITION status.  In the case of the single initiator 
  127. option (see 5.1.3.4), the target shall assume that the REQUEST SENSE command 
  128. is from the same initiator.
  129.  
  130.   The allocation length specifies the number of bytes that the initiator has 
  131. allocated for returned sense data.  An allocation length of zero indicates 
  132. that four bytes of sense data shall be transferred.  Any other value indicates 
  133. the maximum number of bytes that shall be transferred.  The target shall 
  134. terminate the DATA IN phase when allocation length bytes have been transferred 
  135. or when all available sense data have been transferred to the initiator, 
  136. whichever is less.
  137.  
  138.   The REQUEST SENSE command shall return the CHECK CONDITION status only to 
  139. report fatal errors for the REQUEST SENSE command.  For example:
  140.  
  141.   (1) The target receives a nonzero reserved bit in the command descriptor 
  142. block.
  143.   (2) An unrecovered parity error occurs on the DATA BUS. 
  144.   (3) A target malfunction prevents return of the sense data.
  145.  
  146. If any nonfatal error occurs during the execution of the REQUEST SENSE 
  147. command, the target shall return the sense data with GOOD status.
  148.  
  149.   Following a fatal error on a REQUEST SENSE command, sense data may be 
  150. invalid. 
  151.  
  152.   A target may implement the nonextended, the extended, or both sense data 
  153. formats.  (Implementors note:  Targets that implement both sense data formats 
  154. may select the nonextended sense data format in response to an allocation 
  155. length of zero.  Other methods of selection are also feasible.)
  156.  
  157.      7.1.2.1 Nonextended Sense.  The format of the sense data is determined by 
  158. the error class.   Error classes 0 through 6 use the nonextended sense data 
  159. format (Table 7-4).  Error class 7 is described in Section 7.1.2.2.
  160. .pa
  161.  
  162.                                   Table 7-4
  163.                         Nonextended Sense Data Format
  164.  
  165. ==============================================================================
  166.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  167. Byte |        |        |        |        |        |        |        |        |
  168. ==============================================================================
  169.  0   | AdValid|        Error Class       |        Error Code                 |
  170. -----|-----------------------------------------------------------------------|
  171.  1   | Vendor Unique            |Logical Block Address (MSB)                 |
  172. -----|-----------------------------------------------------------------------|
  173.  2   |                           Logical Block Address                       |
  174. -----|-----------------------------------------------------------------------|
  175.  3   |                           Logical Block Address (LSB)                 |
  176. ==============================================================================
  177.  
  178.   The address valid (AdValid) bit indicates that the logical block address 
  179. field contains valid information related to the error code.
  180.  
  181.   The error class specifies a class of errors with error classes 0 through 6 
  182. being vendor unique.  For these classes, the error code is vendor unique.
  183.  
  184.      7.1.2.2 Extended Sense.  Error class 7 specifies extended sense.  Error 
  185. code zero specifies the extended sense data format.  Error code FH specifies a 
  186. vendor unique data format for extended sense.  Error codes 1H through EH are 
  187. reserved.
  188.  
  189.   The extended sense data format is shown in Table 7-5.
  190.  
  191.                                   Table 7-5
  192.                           Extended Sense Data Format
  193.  
  194. ==============================================================================
  195.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  196. Byte |        |        |        |        |        |        |        |        |
  197. ==============================================================================
  198.  0   | Valid  |   Error Class (7)        |         Error Code (0)            |
  199. -----|-----------------------------------------------------------------------|
  200.  1   |                           Segment Number                              |
  201. -----|-----------------------------------------------------------------------|
  202.  2   |Filemark|  EOM   |  ILI   |Reserved|         Sense Key                 |
  203. -----|-----------------------------------------------------------------------|
  204.  3   |                           Information Byte (MSB)                      |
  205. -----|-----------------------------------------------------------------------|
  206.  4   |                           Information Byte                            |
  207. -----|-----------------------------------------------------------------------|
  208.  5   |                           Information Byte                            |
  209. -----|-----------------------------------------------------------------------|
  210.  6   |                           Information Byte (LSB)                      |
  211. -----|-----------------------------------------------------------------------|
  212.  7   |                           Additional Sense Length (n)                 |
  213. -----|-----------------------------------------------------------------------|
  214.  8 _ |                           Additional Sense Bytes                      |
  215.  n+7 |                                                                       |
  216. ==============================================================================
  217.  
  218.  
  219.   The information bytes are not defined if the valid bit is zero.  If the 
  220. valid bit is one, the information bytes contain valid information as follows:
  221.  
  222.   (1) The unsigned logical block address associated with the sense key, for 
  223. direct-access devices (Type 0), write-once read-multiple devices (Type 4), and 
  224. read-only direct-access devices (Type 5).
  225.  
  226.   (2) The difference (residue) of the requested length minus the actual length 
  227. in either bytes or blocks, as determined by the command, for sequential-access 
  228. devices (Type 1), printer devices (Type 2), and processor devices (Type 3).  
  229. (Negative values are indicated by two's complement notation.)
  230.  
  231.   (3) The difference (residue) of the requested number of blocks minus the
  232. actual number of blocks copied or compared for the current segment descriptor 
  233. of a COPY, COMPARE, or COPY AND VERIFY command.
  234.  
  235.   The segment number contains the number of the current segment descriptor if 
  236. the extended sense is in response to a COPY, COMPARE, or COPY AND VERIFY 
  237. command.  Up to 256 segments are supported beginning with segment zero.
  238.  
  239.   The filemark bit indicates that the current command has read a filemark.  
  240. This bit is only used for sequential-access devices.
  241.  
  242.   The end-of-medium (EOM) bit indicates that an end-of-medium condition (end-
  243. of-tape, beginning-of-tape, out-of-paper, etc) exists on a sequential access 
  244. device or printer device.  For sequential-access devices, this bit indicates 
  245. that the unit is at or past the early-warning end-of-tape if the direction was 
  246. forward or that the command could not be completed because beginning-of-tape 
  247. was encountered if the direction was reverse.  Direct-access devices shall not 
  248. use this bit; instead, these devices shall report attempts to access beyond 
  249. the end-of-medium as ILLEGAL REQUEST sense key (see Table 7-6).
  250.  
  251.   The incorrect length indicator (ILI) bit indicates that the requested 
  252. logical block length did not match the logical block length of the data on the 
  253. medium.
  254.  
  255.   The sense keys are described in Tables 7-6 and 7-7.
  256.  
  257.   The additional sense length specifies the number of additional sense bytes 
  258. to follow.  If the allocation length of the command descriptor block is too 
  259. small to transfer all of the additional sense bytes, the additional sense 
  260. length is not adjusted to reflect the truncation.
  261.  
  262.   The additional sense bytes contain command-specific, peripheral-device-
  263. specific data, or both kinds of data that further define the nature of the 
  264. CHECK CONDITION status.  The COPY, COMPARE, COPY AND VERIFY, and SEARCH DATA 
  265. commands define a standard purpose for some of these bytes.  Except as 
  266. described in these commands, the additional sense bytes are vendor unique.
  267. .pa
  268.  
  269.                                   Table 7-6
  270.                         Sense Key (0H-7H) Descriptions
  271.  
  272. ==============================================================================
  273. Sense Key  Description
  274. ---------  -------------------------------------------------------------------
  275.    0H      NO SENSE.  Indicates that there is no specific sense key 
  276.            information to be reported for the designated logical unit.  This 
  277.            would be the case for a successful command or a command that 
  278.            received a CHECK CONDITION status because one of the filemark, EOM, 
  279.            or ILI bits is set to one.
  280.  
  281.    1H      RECOVERED ERROR.  Indicates that the last command completed 
  282.            successfully with some recovery action performed by the target.  
  283.            Details may be determinable by examining the additional sense bytes 
  284.            and the information bytes.
  285.  
  286.    2H      NOT READY.  Indicates that the logical unit addressed cannot be 
  287.            accessed.  Operator intervention may be required to correct this 
  288.            condition.
  289.  
  290.    3H      MEDIUM ERROR.  Indicates that the command terminated with a 
  291.            nonrecovered error condition that was probably caused by a flaw in 
  292.            the medium or an error in the recorded data.
  293.  
  294.    4H      HARDWARE ERROR.  Indicates that the target detected a 
  295.            nonrecoverable hardware failure (for example, controller failure, 
  296.            device failure, parity error, etc) while performing the command or 
  297.            during a self test.
  298.  
  299.    5H      ILLEGAL REQUEST.  Indicates that there was an illegal parameter in 
  300.            the command descriptor block or in the additional parameters 
  301.            supplied as data for some commands (FORMAT UNIT, SEARCH DATA, etc).  
  302.            If the target detects an invalid parameter in the command 
  303.            descriptor block, then it shall terminate the command without 
  304.            altering the medium.  If the target detects an invalid parameter in 
  305.            the additional parameters supplied as data, then the target may 
  306.            have already altered the medium.
  307.  
  308.    6H      UNIT ATTENTION.  Indicates that the removable medium may have been 
  309.            changed or the target has been reset.  See 6.1.3 for more detailed 
  310.            information about the unit attention condition.
  311.  
  312.    7H      DATA PROTECT.  Indicates that a command that reads or writes the 
  313.            medium was attempted on a block that is protected from this 
  314.            operation.  The read or write operation is not performed.
  315. ==============================================================================
  316. .pa
  317.  
  318.                                   Table 7-7
  319.                         Sense Key (8H-FH) Descriptions
  320.  
  321. ==============================================================================
  322. Sense Key  Description
  323. ---------  -------------------------------------------------------------------
  324.    8H      BLANK CHECK.  Indicates that a write-once read-multiple device or a 
  325.            sequential-access device encountered a blank block while reading or 
  326.            a write-once read-multiple device encountered a nonblank block 
  327.            while writing.
  328.  
  329.    9H      Vendor unique.  This sense key is available for reporting vendor 
  330.            unique conditions.
  331.  
  332.    AH      COPY ABORTED.  Indicates a COPY, COMPARE, or COPY AND VERIFY 
  333.            command was aborted due to an error condition on the source device, 
  334.            the destination device, or both.  (See 7.1.4.2 for additional 
  335.            information about this sense key.)
  336.  
  337.    BH      ABORTED COMMAND.  Indicates that the target aborted the command.  
  338.            The initiator may be able to recover by trying the command again.
  339.  
  340.    CH      EQUAL.  Indicates a SEARCH DATA command has satisfied an equal 
  341.            comparison.
  342.  
  343.    DH      VOLUME OVERFLOW.  Indicates that a buffered peripheral device has 
  344.            reached the end-of-medium and data remains in the buffer that has 
  345.            not been written to the medium.  A RECOVER BUFFERED DATA command(s) 
  346.            may be issued to read the unwritten data from the buffer.
  347.  
  348.    EH      MISCOMPARE.  Indicates that the source data did not match the data 
  349.            read from the medium.
  350.  
  351.    FH      This sense key is reserved.
  352. ==============================================================================
  353. .pa
  354.  
  355. 7.1.3 INQUIRY Command
  356.  
  357.      Peripheral Device Type:  All
  358.         Operation Code Type:  Extended
  359.              Operation Code:  12H
  360.  
  361.                                   Table 7-8
  362.                                INQUIRY Command
  363.  
  364. ==============================================================================
  365.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  366. Byte |        |        |        |        |        |        |        |        |
  367. ==============================================================================
  368.  0   |                           Operation Code                              | 
  369. -----|-----------------------------------------------------------------------|
  370.  1   | Logical Unit Number      |                  Reserved                  |
  371. -----|-----------------------------------------------------------------------|
  372.  2   |                           Reserved                                    |
  373. -----|-----------------------------------------------------------------------|
  374.  3   |                           Reserved                                    |
  375. -----|-----------------------------------------------------------------------|
  376.  4   |                           Allocation Length                           |
  377. -----|-----------------------------------------------------------------------|
  378.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  379. ==============================================================================
  380.  
  381.   The INQUIRY command (Table 7-8) requests that information regarding 
  382. parameters of the target and its attached peripheral device(s) be sent to the 
  383. initiator.
  384.  
  385.   The allocation length specifies the number of bytes that the initiator has 
  386. allocated for returned INQUIRY data.  An allocation length of zero indicates 
  387. that no INQUIRY data shall be transferred.  This condition shall not be 
  388. considered as an error.  Any other value indicates the maximum number of bytes 
  389. that shall be transferred.  The target shall terminate the DATA IN phase when 
  390. allocation length bytes have been transferred or when all available INQUIRY 
  391. data have been transferred to the initiator, whichever is less.
  392.  
  393.   The INQUIRY command shall return a CHECK CONDITION status only when the 
  394. target cannot return the requested INQUIRY data.  (Implementors note:  It is 
  395. recommended that the INQUIRY data be returned even though the peripheral 
  396. device may not be ready for other commands.)
  397.  
  398.   If an INQUIRY command is received from an initiator with a pending unit 
  399. attention condition (before the target reports CHECK CONDITION status), the 
  400. target shall perform the INQUIRY command and shall not clear the unit 
  401. attention condition.  (See 6.1.3.)
  402.  
  403.   The INQUIRY data (Table 7-9) contains a five byte header, followed by the 
  404. vendor unique parameters, if any.
  405. .pa
  406.  
  407.                                   Table 7-9
  408.                                  INQUIRY Data
  409.  
  410. ==============================================================================
  411.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  412. Byte |        |        |        |        |        |        |        |        |
  413. ==============================================================================
  414.  0   |                           Peripheral Device Type                      | 
  415. -----|-----------------------------------------------------------------------|
  416.  1   |  RMB   |                  Device-Type Qualifier                       |
  417. -----|-----------------------------------------------------------------------|
  418.  2   |   ISO Version   |       ECMA Version       |       ANSI Version       |
  419. -----|-----------------------------------------------------------------------|
  420.  3   |                           Reserved                                    |
  421. -----|-----------------------------------------------------------------------|
  422.  4   |                           Additional Length (n)                       |
  423. ==============================================================================
  424.      |                       Vendor Unique Parameters                        |
  425. ==============================================================================
  426. 5 _  |                           Vendor Unique                               |
  427. n+4  |                           Parameter Bytes                             |
  428. ==============================================================================
  429.  
  430. The peripheral device type is shown in Table 7-10.
  431.  
  432.                                   Table 7-10
  433.                             Peripheral Device Type
  434.  
  435. ==============================================================================
  436.   Code         Description
  437. ------------------------------------------------------------------------------
  438.   00H          Direct-access device (e.g., magnetic disk)
  439.   01H          Sequential-access device (e.g., magnetic tape)
  440.   02H          Printer device
  441.   03H          Processor device
  442.   04H          Write-once read-multiple device (e.g., some optical disks)
  443.   05H          Read-only direct-access device (e.g., some optical disks)
  444.   06H _ 7EH    Reserved
  445.   7FH          Logical unit not present
  446.   80H _ FFH    Vendor unique
  447. ==============================================================================
  448.  
  449.   A removable medium (RMB) bit of zero indicates that the medium is not 
  450. removable.  A RMB bit of one indicates that the medium is removable.
  451.  
  452.   The device-type qualifier is a seven bit user specified code.  This code may 
  453. be set with switches or by some other means by the target or peripheral 
  454. device.   SCSI devices that do not support this feature shall return all zero 
  455. bits.  This feature allows each user to assign unique codes to each specific 
  456. type of peripheral device that is supported on the system being used.  These 
  457. codes may then be used by self-configuring software to determine what specific 
  458. peripheral device is at each logical unit number.  This is especially valuable 
  459. for systems that support multiple types of removable medium.
  460.  
  461.   The usage of nonzero code values in the ISO version and ECMA version fields 
  462. are defined by the International Standards Organization and the European 
  463.  
  464. Computer Manufacturers Association, respectively.  A zero code value in these 
  465. fields shall indicate that the target does not claim compliance to the ISO or 
  466. ECMA versions of SCSI.  Note that it is possible to claim compliance to more 
  467. than one of these SCSI standards.
  468.  
  469.   The ANSI version indicates the implemented version of this standard and is 
  470. defined as shown in Table 7-11.
  471.  
  472.                                   Table 7-11
  473.                                  ANSI Version
  474.  
  475. ==============================================================================
  476.   Code        Description
  477. ------------------------------------------------------------------------------
  478.    0H         Version is unspecified.  (Use this code if you are implementing 
  479.               to this document - it is not published, yet.)
  480.    1H         This version.  This code shall be used by SCSI devices that 
  481.               claim to comply with this standard (upon ANSI publication)
  482.    2H _ 7H    Reserved
  483. ==============================================================================
  484.  
  485.   The additional length shall specify the length in bytes of the vendor unique 
  486. parameters.  If the allocation length of the command descriptor block is too 
  487. small to transfer all of the vendor unique parameters, the additional length 
  488. shall not be adjusted to reflect the truncation.
  489.  
  490.   7.1.4 COPY Command
  491.  
  492.      Peripheral Device Type:  All
  493.         Operation Code Type:  Optional
  494.              Operation Code:  18H
  495.  
  496.                                   Table 7-12
  497.                                  COPY Command
  498.  
  499. ==============================================================================
  500.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  501. Byte |        |        |        |        |        |        |        |        |
  502. ==============================================================================
  503.  0   |                           Operation Code                              | 
  504. -----|-----------------------------------------------------------------------|
  505.  1   | Logical Unit Number      |                  Reserved                  |
  506. -----|-----------------------------------------------------------------------|
  507.  2   |                           Parameter List Length (MSB)                 |
  508. -----|-----------------------------------------------------------------------|
  509.  3   |                           Parameter List Length                       |
  510. -----|-----------------------------------------------------------------------|
  511.  4   |                           Parameter List Length (LSB)                 |
  512. -----|-----------------------------------------------------------------------|
  513.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  514. ==============================================================================
  515.  
  516.   The COPY command (Table 7-12) provides a means to copy data from one logical 
  517. unit to another or the same logical unit.  The logical units may reside on the 
  518. same SCSI device or different SCSI devices.  Some SCSI devices that implement 
  519. this command may not support copies to or from another SCSI device or third 
  520.  
  521. party copies (both logical units reside on other SCSI devices).
  522.  
  523.   The parameter list length specifies the length in bytes of the parameters 
  524. that shall be sent during the DATA OUT phase of the command.  A parameter list 
  525. length of zero indicates that no data shall be transferred.  This condition 
  526. shall not be considered as an error.
  527.  
  528.   The COPY parameter list (Table 7-13) begins with a four-byte header that 
  529. contains the COPY function code and priority.  Following the header is one or 
  530. more segment descriptors.
  531.  
  532.                                   Table 7-13
  533.                              COPY Parameter List
  534.  
  535. ==============================================================================
  536.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  537. Byte |        |        |        |        |        |        |        |        |
  538. ==============================================================================
  539.  0   |         COPY Function Code                 |         Priority         |
  540. -----|-----------------------------------------------------------------------|
  541.  1   |                           Vendor Unique                               |
  542. -----|-----------------------------------------------------------------------|
  543.  2   |                           Reserved                                    |
  544. -----|-----------------------------------------------------------------------|
  545.  3   |                           Reserved                                    |
  546. ==============================================================================
  547.      |                         Segment Descriptor(s)                         |
  548. ==============================================================================
  549.  0 _ |                           Segment Descriptor 0                        |
  550.  xx  |                     (See specific table for length.)                  |
  551. -----|-----------------------------------------------------------------------|
  552.      |                                 .                                     |
  553.      |                                 .                                     |
  554.      |                                 .                                     |
  555. -----|-----------------------------------------------------------------------|
  556.  0 _ |                           Segment Descriptor n                        |
  557.  xx  |                     (See specific table for length.)                  |
  558. ==============================================================================
  559.  
  560.   The COPY function code defines a specific format for the segment 
  561. descriptors.  The COPY function codes are defined in Table 7-14.
  562.  
  563.   The priority field of the COPY parameter list establishes the relative 
  564. priority of this COPY command to other commands being executed by the same 
  565. target.  All other commands are assumed to have a priority of 1.  Priority0 
  566. is the highest priority with increasing values indicating lower priorities.
  567.  
  568.   The segment descriptor formats are determined by the COPY function code. 
  569. The segment descriptor format used for write-once read-multiple devices and 
  570. for read-only direct-access devices shall be the same as for direct-access 
  571. devices.  The segment descriptor format used for printer devices and for 
  572. processor devices shall be the same as for sequential-access devices.  Thus a 
  573. COPY from a write-once read-multiple device to a printer device uses the same 
  574. segment descriptor format as for a COPY from a direct-access device to a 
  575. sequential-access device.  (See Table 7-14.)  The segment descriptor formats 
  576. are described in Tables 7-15 through 7-17.  A maximum of 256 segment 
  577.  
  578. descriptors are permitted.  The segment descriptors are identified by 
  579. ascending numbers beginning with zero.
  580.  
  581.  
  582.                                   Table 7-14
  583.                                 COPY Functions
  584.  
  585. ==============================================================================
  586. Peripheral Device Type     COPY      Segment
  587. ----------------------   Function   Descriptor
  588. Source     Destination     Code       Table               Comment
  589. ------------------------------------------------------------------------------
  590.  00H           01H         00H      Table 7-15
  591.  00H           02H         00H      Table 7-15
  592.  00H           03H         00H      Table 7-15
  593.  04H           01H         00H      Table 7-15          Direct Access
  594.  04H           02H         00H      Table 7-15               to
  595.  04H           03H         00H      Table 7-15        Sequential Access
  596.  05H           01H         00H      Table 7-15
  597.  05H           02H         00H      Table 7-15
  598.  05H           03H         00H      Table 7-15
  599.  
  600.  01H           00H         01H      Table 7-15        Sequential Access
  601.  01H           04H         01H      Table 7-15               to
  602.  03H           00H         01H      Table 7-15          Direct Access
  603.  03H           04H         01H      Table 7-15
  604.  
  605.  00H           00H         02H      Table 7-16
  606.  00H           04H         02H      Table 7-16          Direct Access
  607.  04H           00H         02H      Table 7-16               to
  608.  04H           04H         02H      Table 7-16          Direct Access
  609.  05H           00H         02H      Table 7-16
  610.  05H           04H         02H      Table 7-16
  611.  
  612.  01H           01H         03H      Table 7-17
  613.  01H           02H         03H      Table 7-17        Sequential Access
  614.  01H           03H         03H      Table 7-17               to
  615.  03H           01H         03H      Table 7-17        Sequential Access
  616.  03H           02H         03H      Table 7-17
  617.  03H           03H         03H      Table 7-17
  618. ==============================================================================
  619.  
  620. Peripheral device type:  00H  Direct-access device
  621.                          01H  Sequential-access device
  622.                          02H  Printer device
  623.                          03H  Processor device
  624.                          04H  Write-once read-multiple device
  625.                          05H  Read-only direct-access device
  626.  
  627. COPY function code:  00H        Direct access to sequential access
  628.                      01H        Sequential access to direct access
  629.                      02H        Direct access to direct access
  630.                      03H        Sequential access to sequential access
  631.                      04H _ 0FH  Reserved
  632.                      10H _ 1FH  Vendor unique
  633. .pa
  634.  
  635.      7.1.4.1 Errors Detected by the Managing SCSI Device.  Two classes of 
  636. unusual conditions may occur during execution of a COPY command.  The first 
  637. class consists of those unusual conditions detected by the SCSI device that 
  638. received the COPY command and is managing the execution of the command.  These 
  639. conditions include parity errors while transferring the COPY command and 
  640. status byte, invalid parameters in the COPY command, invalid segment 
  641. descriptors, and inability of the SCSI device controlling the COPY functions 
  642. to continue operating.  In the event of such an unusual condition, the SCSI 
  643. device managing the COPY shall:
  644.  
  645.   (1) Terminate the COPY command with a CHECK CONDITION status.
  646.  
  647.   (2) Return the sense data in the extended sense format.  The valid bit shall 
  648. be set to one.  The segment number shall contain the number of the segment 
  649. descriptor being processed at the time the unusual condition is detected.  The 
  650. sense key shall contain the sense key code describing the unusual condition.  
  651. The information bytes shall contain the difference between the number of 
  652. blocks field in the segment descriptor being processed at the time of the 
  653. failure and the number of blocks successfully copied.  This number is the 
  654. residue of unprocessed blocks remaining for the segment descriptor.
  655.  
  656.      7.1.4.2 Errors Detected by a Target.  The second class of errors consists 
  657. of unusual conditions detected by the SCSI device transferring data at the 
  658. request of the SCSI device managing the transfer.  The SCSI device managing 
  659. the COPY command detects unusual conditions by receiving a CHECK CONDITION 
  660. status from one of the SCSI devices it is managing.  It then shall recover the 
  661. sense data associated with the unusual condition.
  662.  
  663.   The SCSI device managing the COPY command may also be the source or 
  664. destination SCSI device (or both).  It shall distinguish between a failure of 
  665. the management of the COPY and a failure of the data transfer being requested.  
  666. It shall then create the appropriate sense data internally.
  667.  
  668.   After recovering the sense data associated with the detected error, the SCSI 
  669. device managing the COPY command shall:
  670.  
  671.   (1) Terminate the COPY command with a CHECK CONDITION status.
  672.  
  673.   (2) Return the sense data in the extended sense format.  The valid bit shall 
  674. be set to one.  The segment number shall contain the number of the segment 
  675. descriptor being processed at the time the unusual condition is detected.  The 
  676. sense key shall be set to COPY ABORTED.  The information bytes shall contain 
  677. the difference between the number of blocks field in the segment descriptor 
  678. being processed at the time of the failure and the number of blocks 
  679. successfully copied.  This number is the residue of unprocessed blocks 
  680. remaining for the segment descriptor.  The additional sense length shall 
  681. specify the number of additional sense bytes.
  682.  
  683.   The first additional sense byte shall specify the byte number, relative to 
  684. the first byte of sense data of the beginning of the source logical unit's 
  685. status byte and sense data.  A zero value indicates that no status byte or 
  686. sense data is being returned for the source logical unit.  The first byte of 
  687. the area pointed to by the first additional sense byte shall contain the 
  688. status byte from the source logical unit.  The subsequent bytes shall contain, 
  689. unchanged, the sense data recovered from the source logical unit.
  690.  
  691.  
  692.   The second additional sense byte shall specify the byte number, relative to 
  693. the first byte of sense data of the beginning of the destination logical 
  694. unit's status byte and sense data.  A zero value indicates that no status byte 
  695. or sense data is being returned for the destination logical unit.  The first 
  696. byte of the area pointed to by the second additional sense byte shall contain 
  697. the status byte from the destination logical unit.  The subsequent bytes shall 
  698. contain, unchanged, the sense data recovered from the destination logical 
  699. unit.
  700.  
  701.      7.1.4.3 COPY Function Code 00H and 01H.  The format for the segment 
  702. descriptors for COPY transfers between direct-access and sequential-access 
  703. devices is specified in Table 7-15.  This format is required for COPY function 
  704. codes 00H or 01H.  The segment descriptor may be repeated up to 256 times 
  705. within the parameter list length specified in the command descriptor block.
  706.  
  707.  
  708.                                   Table 7-15
  709.             Segment Descriptor for COPY Function Codes 00H and 01H
  710.  
  711. ==============================================================================
  712.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  713. Byte |        |        |        |        |        |        |        |        |
  714. ==============================================================================
  715.  0   | Source Address           |   Reserved      | Source LUN               |
  716. -----|-----------------------------------------------------------------------|
  717.  1   | Destination Address      |   Reserved      | Destination LUN          |
  718. -----|-----------------------------------------------------------------------|
  719.  2   |           Sequential-Access Device Block-Length (MSB)                 | 
  720. -----|-----------------------------------------------------------------------|
  721.  3   |           Sequential-Access Device Block-Length (LSB)                 |
  722. -----|-----------------------------------------------------------------------|
  723.  4   |           Direct-Access Device Number of Blocks (MSB)                 |
  724. -----|-----------------------------------------------------------------------|
  725.  5   |           Direct-Access Device Number of Blocks                       |
  726. -----|-----------------------------------------------------------------------|
  727.  6   |           Direct-Access Device Number of Blocks                       |
  728. -----|-----------------------------------------------------------------------|
  729.  7   |           Direct-Access Device Number of Blocks (LSB)                 |
  730. -----|-----------------------------------------------------------------------|
  731.  8   |           Direct-Access Device Logical Block Address (MSB)            |
  732. -----|-----------------------------------------------------------------------|
  733.  9   |           Direct-Access Device Logical Block Address                  |
  734. -----|-----------------------------------------------------------------------|
  735. 10   |           Direct-Access Device Logical Block Address                  |
  736. -----|-----------------------------------------------------------------------|
  737. 11   |           Direct-Access Device Logical Block Address (LSB)            |
  738. ==============================================================================
  739.  
  740.   Source address and destination address fields specify the SCSI devices and 
  741. the source LUN and destination LUN fields specify the logical units to use for 
  742. this segment of the COPY command.  Some SCSI devices may not support "third-
  743. party" COPY in which the copying SCSI device is not the source or destination 
  744. device.  Some SCSI devices only support COPY within the SCSI device and not to 
  745. other SCSI devices.  If an unsupported COPY operation is requested, the 
  746. command shall be terminated with a CHECK CONDITION status and the sense key 
  747. shall be set to ILLEGAL REQUEST.
  748.  
  749.  
  750.   The sequential-access device block-length field specifies the block-length 
  751. to be used on the sequential-access logical unit during this segment of the 
  752. COPY command.  If this block-length is known by the SCSI device managing the 
  753. COPY to be not supported, the command shall be terminated with a CHECK 
  754. CONDITION status and the sense key shall be set to ILLEGAL REQUEST.  If the 
  755. block-length is found to be invalid while executing a read or write operation 
  756. to the sequential-access device, the command shall be terminated with a CHECK 
  757. CONDITION status and the sense key shall be set to COPY ABORTED.
  758.  
  759.   The direct-access device number of blocks field specifies the number of 
  760. blocks in the current segment.  A value of zero indicates that no blocks shall 
  761. be transferred in this segment.  The direct-access device logical block 
  762. address specifies the starting logical block address on the logical unit for 
  763. this segment.
  764.  
  765.      7.1.4.4 COPY Function Code 02H.  The format for the segment descriptors 
  766. for COPY transfers among direct-access devices is specified by Table 7-16.  
  767. This format is required for COPY function code 02H.  The segment descriptor 
  768. may be repeated up to 256 times within the parameter list length specified in 
  769. the command descriptor block.
  770. .pa
  771.  
  772.                                   Table 7-16
  773.                 Segment Descriptor for COPY Function Code 02H
  774.  
  775. ==============================================================================
  776.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  777. Byte |        |        |        |        |        |        |        |        |
  778. ==============================================================================
  779.  0   | Source Address           |   Reserved      | Source LUN               |
  780. -----|-----------------------------------------------------------------------|
  781.  1   | Destination Address      |   Reserved      | Destination LUN          |
  782. -----|-----------------------------------------------------------------------|
  783.  2   |                              Reserved                                 |
  784. -----|-----------------------------------------------------------------------|
  785.  3   |                              Reserved                                 |
  786. -----|-----------------------------------------------------------------------|
  787.  4   |                   Source Number of Blocks (MSB)                       |
  788. -----|-----------------------------------------------------------------------|
  789.  5   |                   Source Number of Blocks                             |
  790. -----|-----------------------------------------------------------------------|
  791.  6   |                   Source Number of Blocks                             |
  792. -----|-----------------------------------------------------------------------|
  793.  7   |                   Source Number of Blocks (LSB)                       |
  794. -----|-----------------------------------------------------------------------|
  795.  8   |                   Source Logical Block Address (MSB)                  |
  796. -----|-----------------------------------------------------------------------|
  797.  9   |                   Source Logical Block Address                        |
  798. -----|-----------------------------------------------------------------------|
  799. 10   |                   Source Logical Block Address                        |
  800. -----|-----------------------------------------------------------------------|
  801. 11   |                   Source Logical Block Address (LSB)                  |
  802. -----|-----------------------------------------------------------------------|
  803. 12   |              Destination Logical Block Address (MSB)                  |
  804. -----|-----------------------------------------------------------------------|
  805. 13   |              Destination Logical Block Address                        |
  806. -----|-----------------------------------------------------------------------|
  807. 14   |              Destination Logical Block Address                        |
  808. -----|-----------------------------------------------------------------------|
  809. 15   |              Destination Logical Block Address (LSB)                  |
  810. ==============================================================================
  811.  
  812.   The source address and destination address fields specify the SCSI devices 
  813. and the source LUN and destination LUN specify the logical units to use for 
  814. this segment of the COPY command.  Some SCSI devices may not support "third-
  815. party" COPY in which the copying SCSI device is not the source or destination 
  816. device.  Some SCSI devices only support COPY within the SCSI device and not to 
  817. other SCSI devices.  If an unsupported COPY operation is requested, the 
  818. command shall be terminated with a CHECK CONDITION status and the sense key 
  819. shall be set to ILLEGAL REQUEST.
  820.  
  821.   The source number of blocks field specifies the number of blocks to be 
  822. transferred from the source device during command execution.  The source 
  823. logical block address field specifies the starting logical block address on 
  824. the source device.   The destination logical block address field specifies the 
  825. starting logical block address on the destination device.
  826. .pa
  827.  
  828.      7.1.4.5 COPY Function Code 03H.  The format for the segment descriptors 
  829. for COPY transfers among sequential-access devices is specified by Table 7-17.  
  830. This format is required for COPY function code 03H.  The segment descriptor 
  831. may be repeated up to 256 times within the parameter list length specified in 
  832. the command descriptor block.
  833.  
  834.                                   Table 7-17
  835.                 Segment Descriptor for COPY Function Code 03H
  836.  
  837. ==============================================================================
  838.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  839. Byte |        |        |        |        |        |        |        |        |
  840. ==============================================================================
  841.  0   | Source Address           |   Reserved      | Source LUN               |
  842. -----|-----------------------------------------------------------------------|
  843.  1   | Destination Address      |   Reserved      | Destination LUN          |
  844. -----|-----------------------------------------------------------------------|
  845.  2   |                              Reserved                                 |
  846. -----|-----------------------------------------------------------------------|
  847.  3   |                              Reserved                                 |
  848. -----|-----------------------------------------------------------------------|
  849.  4   |                           Source Block Length (MSB)                   |
  850. -----|-----------------------------------------------------------------------|
  851.  5   |                           Source Block Length (LSB)                   |
  852. -----|-----------------------------------------------------------------------|
  853.  6   |                           Destination Block Length (MSB)              |
  854. -----|-----------------------------------------------------------------------|
  855.  7   |                           Destination Block Length (LSB)              |
  856. -----|-----------------------------------------------------------------------|
  857.  8   |                           Source Number of Blocks (MSB)               |
  858. -----|-----------------------------------------------------------------------|
  859.  9   |                           Source Number of Blocks                     |
  860. -----|-----------------------------------------------------------------------|
  861. 10   |                           Source Number of Blocks                     |
  862. -----|-----------------------------------------------------------------------|
  863. 11   |                           Source Number of Blocks (LSB)               |
  864. ==============================================================================
  865.  
  866.   Source address and destination address fields specify the SCSI devices and 
  867. the source LUN and destination LUN fields specify the logical units to use for 
  868. this segment of the COPY command.  Some SCSI devices may not support "third-
  869. party" COPY in which the copying SCSI device is not the source or destination 
  870. device.  Some SCSI devices only support COPY within the SCSI device and not to 
  871. other SCSI devices.  If an unsupported COPY operation is requested, the 
  872. command shall be terminated with a CHECK CONDITION status and the sense key 
  873. shall be set to ILLEGAL REQUEST.
  874.  
  875.   The source block-length field specifies the block-length of the source 
  876. device for this segment of the COPY.  A zero in this field indicates variable 
  877. block-length.  For nonzero values, this field shall match the logical unit's 
  878. actual block-length.  If block-length mismatches are detected by the SCSI 
  879. device managing the COPY, the command shall be terminated with a CHECK 
  880. CONDITION status and the sense key shall be set to ILLEGAL REQUEST.  If the 
  881. mismatches are detected during the read operation by the COPY manager, the 
  882. command shall be terminated with a CHECK CONDITION status and the sense key 
  883. shall be set to COPY ABORTED.
  884.  
  885.  
  886.   The destination block-length field specifies the block-length to be used on 
  887. the destination logical unit during the COPY.  Destination block-length 
  888. mismatches are handled in the same manner as source block-length mismatches.
  889.  
  890.   The source number of blocks field specifies the number of blocks to be 
  891. transferred from the source device during this segment.  A value of zero 
  892. indicates that no blocks shall be transferred.
  893.  
  894.   7.1.5 RECEIVE DIAGNOSTIC RESULTS Command
  895.  
  896.      Peripheral Device Type:  All
  897.         Operation Code Type:  Optional
  898.              Operation Code:  1CH
  899.  
  900.                                   Table 7-18
  901.                       RECEIVE DIAGNOSTIC RESULTS Command
  902.  
  903. ==============================================================================
  904.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  905. Byte |        |        |        |        |        |        |        |        |
  906. ==============================================================================
  907.  0   |                           Operation Code                              | 
  908. -----|-----------------------------------------------------------------------|
  909.  1   | Logical Unit Number      |                  Reserved                  |
  910. -----|-----------------------------------------------------------------------|
  911.  2   |                           Reserved                                    |
  912. -----|-----------------------------------------------------------------------|
  913.  3   |                           Allocation Length (MSB)                     |
  914. -----|-----------------------------------------------------------------------|
  915.  4   |                           Allocation Length (LSB)                     |
  916. -----|-----------------------------------------------------------------------|
  917.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  918. ==============================================================================
  919.  
  920.   The RECEIVE DIAGNOSTIC RESULTS command (Table 7-18) requests analysis data 
  921. be sent to the initiator after completion of a SEND DIAGNOSTIC command (see 
  922. 7.1.6).
  923.  
  924.   The allocation length shall specify the number of bytes that the initiator 
  925. has allocated for returned diagnostic data.  An allocation length of zero 
  926. indicates that no diagnostic data shall be transferred.  Any other value 
  927. indicates the maximum number of bytes that shall be transferred.  The target 
  928. terminates the DATA IN phase when allocation length bytes have been 
  929. transferred or when all available diagnostic data have been transferred to the 
  930. initiator, whichever is less.
  931.  
  932.   The diagnostic data returned is vendor unique.
  933.  
  934. NOTE:  Although diagnostic software is generally device-specific, this command 
  935. and the SEND DIAGNOSTIC command provide a means to isolate the operating 
  936. system software from the device-specific diagnostic software.  Hence the 
  937. operating system can remain device-independent.  This also allows diagnostic 
  938. software to be more easily ported to other operating systems.
  939. .pa
  940.  
  941.   7.1.6 SEND DIAGNOSTIC Command
  942.  
  943.      Peripheral Device Type:  All
  944.         Operation Code Type:  Optional
  945.              Operation Code:  1DH
  946.  
  947.                                   Table 7-19
  948.                            SEND DIAGNOSTIC Command
  949.  
  950. ==============================================================================
  951.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  952. Byte |        |        |        |        |        |        |        |        |
  953. ==============================================================================
  954.  0   |                           Operation Code                              | 
  955. -----|-----------------------------------------------------------------------|
  956.  1   | Logical Unit Number      |      Reserved   |SelfTest| DevOfL | UnitOfL|
  957. -----|-----------------------------------------------------------------------|
  958.  2   |                           Reserved                                    |
  959. -----|-----------------------------------------------------------------------|
  960.  3   |                           Parameter List Length (MSB)                 |
  961. -----|-----------------------------------------------------------------------|
  962.  4   |                           Parameter List Length (LSB)                 |
  963. -----|-----------------------------------------------------------------------|
  964.  5   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  965. ==============================================================================
  966.  
  967.   The SEND DIAGNOSTIC command (Table 7-19) requests the target to perform 
  968. diagnostic tests on itself, on the attached peripheral devices, or on both.  
  969. This command is usually followed by a RECEIVE DIAGNOSTIC RESULTS command, 
  970. except when the self test (SelfTest) bit is one.
  971.  
  972.   The parameter list length specifies the length in bytes of the parameter 
  973. list that shall be transferred during the DATA OUT phase.  A parameter list 
  974. length of zero indicates that no data shall be transferred.  This condition 
  975. shall not be considered as an error.  The parameter list is vendor unique.
  976.  
  977.   A logical unit off-line (UnitOfL) bit of one enables write operations on 
  978. user medium or operations that affect user visible medium positioning.  An 
  979. SCSI device off-line (DevOfL) bit of one enables diagnostic operations that 
  980. may adversely affect operations to other logical units on the same target.
  981.  
  982.   The logical unit off-line and SCSI device off-line bits are generally set by 
  983. operating system software, while the parameter list is prepared by diagnostic 
  984. application software.  Thus, by preventing operations that are not enabled by 
  985. these bits, the target assists the operating system in protecting its 
  986. resources.
  987.  
  988.   A self test bit of one directs the target to complete its default self test.  
  989. If the self test is requested, the parameter list length shall be set to zero 
  990. and no data shall be transferred.  If the self test successfully passes, the 
  991. command shall be terminated with a GOOD status; otherwise, the command shall 
  992. be terminated with a CHECK CONDITION status and, if extended sense is 
  993. implemented, the sense key shall be set to HARDWARE ERROR.
  994.  
  995. NOTE: See the note under the RECEIVE DIAGNOSTIC RESULTS command (7.1.5).
  996. .pa
  997.  
  998. 7.2 Group 1 Commands for All Device Types.  These commands shall be as listed 
  999. in Table 7-20.
  1000.  
  1001.                                   Table 7-20
  1002.                     Group 1 Commands for All Device Types
  1003.  
  1004. ==============================================================================
  1005. Operation
  1006.   Code      Type   Command Name                       Section
  1007. ------------------------------------------------------------------------------
  1008.    20H       V
  1009.    21H       V
  1010.    22H       V
  1011.    23H       V
  1012.    24H       V
  1013.    25H       *
  1014.    26H       V
  1015.    27H       V
  1016.    28H       *
  1017.    29H       V
  1018.    2AH       *
  1019.    2BH       *
  1020.    2CH       V
  1021.    2DH       V
  1022.    2EH       *
  1023.    2FH       *
  1024.    30H       *
  1025.    31H       *
  1026.    32H       *
  1027.    33H       *
  1028.    34H       R
  1029.    35H       R
  1030.    36H       R
  1031.    37H       R
  1032.    38H       R
  1033.    39H       O     COMPARE                            7.2.1
  1034.    3AH       O     COPY AND VERIFY                    7.2.2
  1035.    3BH       R
  1036.    3CH       R
  1037.    3DH       R
  1038.    3EH       R
  1039.    3FH       R
  1040. ==============================================================================
  1041.  
  1042. Key: O  =  Command implementation is optional.
  1043.      R  =  Operation code is reserved for future standardization.
  1044.      V  =  Operation code is available for vendor unique commands.
  1045.      *  =  These operation codes may have different meanings for specific 
  1046.            types of peripheral devices.  (See the appropriate section for 
  1047.            further information.)
  1048. .pa
  1049.  
  1050.   7.2.1 COMPARE Command
  1051.  
  1052.      Peripheral Device Type:  All
  1053.         Operation Code Type:  Optional
  1054.              Operation Code:  39H
  1055.  
  1056.                                   Table 7-21
  1057.                                COMPARE Command
  1058.  
  1059. ==============================================================================
  1060.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1061. Byte |        |        |        |        |        |        |        |        |
  1062. ==============================================================================
  1063.  0   |                           Operation Code                              | 
  1064. -----|-----------------------------------------------------------------------|
  1065.  1   | Logical Unit Number      |                   Reserved                 |
  1066. -----|-----------------------------------------------------------------------|
  1067.  2   |                           Reserved                                    |
  1068. -----|-----------------------------------------------------------------------|
  1069.  3   |                           Parameter List Length (MSB)                 |
  1070. -----|-----------------------------------------------------------------------|
  1071.  4   |                           Parameter List Length                       |
  1072. -----|-----------------------------------------------------------------------|
  1073.  5   |                           Parameter List Length (LSB)                 |
  1074. -----|-----------------------------------------------------------------------|
  1075.  6   |                           Reserved                                    |
  1076. -----|-----------------------------------------------------------------------|
  1077.  7   |                           Reserved                                    |
  1078. -----|-----------------------------------------------------------------------|
  1079.  8   |                           Reserved                                    |
  1080. -----|-----------------------------------------------------------------------|
  1081.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1082. ==============================================================================
  1083.  
  1084.   The COMPARE command (Table 7-21) provides the means to compare data from one 
  1085. logical unit with another or the same logical unit in a manner similar to the 
  1086. COPY command. 
  1087.  
  1088.   This command functions in the same manner as the COPY command, except that 
  1089. the data from the source is compared on a byte-by-byte basis with the data 
  1090. >From the destination.  The parameter list transferred to the target is the 
  1091. same as for the COPY command.  This parameter list contains the information to 
  1092. identify the logical units involved in the comparison and the length of the 
  1093. comparison.  (See 7.1.4 for additional information about the COPY command.)
  1094.  
  1095.   If the comparison is unsuccessful, the command shall be terminated with a 
  1096. CHECK CONDITION status and the sense key shall be set to MISCOMPARE.  The 
  1097. remaining fields in the extended sense shall be set as documented in the COPY 
  1098. command.
  1099. .pa
  1100.  
  1101.   7.2.2 COPY AND VERIFY Command
  1102.  
  1103.      Peripheral Device Type:  All
  1104.         Operation Code Type:  Optional
  1105.              Operation Code:  3AH
  1106.  
  1107.                                   Table 7-22
  1108.                            COPY AND VERIFY Command
  1109.  
  1110. ==============================================================================
  1111.   Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    | 
  1112. Byte |        |        |        |        |        |        |        |        |
  1113. ==============================================================================
  1114.  0   |                           Operation Code                              | 
  1115. -----|-----------------------------------------------------------------------|
  1116.  1   | Logical Unit Number      |        Reserved          | BytChk |Reserved|
  1117. -----|-----------------------------------------------------------------------|
  1118.  2   |                           Reserved                                    |
  1119. -----|-----------------------------------------------------------------------|
  1120.  3   |                           Parameter List Length (MSB)                 |
  1121. -----|-----------------------------------------------------------------------|
  1122.  4   |                           Parameter List Length                       |
  1123. -----|-----------------------------------------------------------------------|
  1124.  5   |                           Parameter List Length (LSB)                 |
  1125. -----|-----------------------------------------------------------------------|
  1126.  6   |                           Reserved                                    |
  1127. -----|-----------------------------------------------------------------------|
  1128.  7   |                           Reserved                                    |
  1129. -----|-----------------------------------------------------------------------|
  1130.  8   |                           Reserved                                    |
  1131. -----|-----------------------------------------------------------------------|
  1132.  9   | Vendor Unique   |         Reserved                  |  Flag  |  Link  |
  1133. ==============================================================================
  1134.  
  1135.   The COPY AND VERIFY command (Table 7-22) performs the same function as the 
  1136. COPY command, except that a verification of the data written to the 
  1137. destination logical unit is performed after the data is written.  The 
  1138. parameter list transferred to the target is the same as for the COPY command.  
  1139. This parameter list contains the information to identify the logical units 
  1140. involved in the copy and the length of the copy.  (See 7.1.4 for additional 
  1141. information about the COPY command.)
  1142.  
  1143.   A byte check (BytChk) bit of zero causes the verification to be simply a 
  1144. medium verification (CRC, ECC, etc).  A BytChk bit of one causes a byte-by-
  1145. byte comparison of data written to the destination logical unit and the data 
  1146. read from the source logical unit.
  1147.  
  1148.   If the comparison is unsuccessful, the command shall be terminated with a 
  1149. CHECK CONDITION status and the sense key shall be set to MISCOMPARE.  The 
  1150. remaining fields in the extended sense shall be set as documented in the COPY 
  1151. command.
  1152. .pa
  1153.  
  1154. 7.3 Group 2 Commands for All Device Types.  The Group 2 commands (operation 
  1155. codes 40H through 5FH) are all reserved for future standardization.
  1156.  
  1157. 7.4 Group 3 Commands for All Device Types.  The Group 3 commands (operation 
  1158. codes 60H through 7FH) are all reserved for future standardization.
  1159.  
  1160. 7.5 Group 4 Commands for All Device Types.  The Group 4 commands (operation 
  1161. codes 80H through 9FH) are all reserved for future standardization.
  1162.  
  1163. 7.6 Group 5 Commands for All Device Types.  The Group 5 commands with 
  1164. operation codes A0H through AFH are vendor unique.  The Group 5 commands with 
  1165. operation codes B0H through BFH are reserved for future standardization.
  1166.  
  1167. 7.7 Group 6 Commands for All Device Types.  The Group 6 commands (operation 
  1168. codes C0H through DFH) are all vendor unique.
  1169.  
  1170. 7.8 Group 7 Commands for All Device Types.  The Group 7 commands (operation 
  1171. codes E0H through FFH) are all vendor unique.
  1172. .pa
  1173.  
  1174. 
  1175.  
  1176.