W E S T E R N D I G I T A L C O R P O R A T I O N Doc: X3T9.2/87-146 Revision 1 September 10, 1987 To: X3T9.2 Members From: Jeff Stai, Optical Sections Editor Subject: Revised Sections 12,13,15 This document represents my second pass at revising and cleaning up the optical sections. Revision 0 of this document was modified at the September working group meeting in Wichita. This document also has the results of several action items assigned at that meeting. To reiterate, my goal in this revision was to bring all meaningful data into Section 15, and leave Sections 12 and 13 as command tables. Also, I tried to find ways of reducing the number of commands described in these sections, to save paper and increase understanding. It seemed particularly pointless to have a complete definition of the READ command so that the BLANK CHECK sense key could be described. I would also favor the inclusion in section 7 of a MODE SELECT/SENSE generic definition, with the pages described as necessary under the device types. In summary, the changes to these sections are (revision 0 of this document): - deletion of all text in Section 12, leaving only a command table; - folding the remaining substance of Section 12 into Section 15; - addition of cache commands and other new optical commands to the Section 12 and Section 13 command tables; - repairing all 12 byte CDBs to reflect the correct format (this change must be folded into section 6); - bringing Mode Select/Sense into line with generic Section 8 definitions; - bringing Media Scan into line with the similar Search commands; - in several places I have reworded some field/bit descriptions in an attempt to match the editorial style of the rest of the draft; - I have eliminated the Write Same bit from all commands that had it in Section 15, in favor of the Erase By-Pass bit; - since I now refer to the group 0 and group 1 read/write type commands in section 8, some words must be added there to retain the descriptions of the BLANK CHECK sense key usage (see next page); - addition of several new 12 byte commands that are appropriate to optical environments: READ DEFECT DATA, READ UPDATED BLOCK, SEARCH DATA, SET LIMITS, and UPDATE BLOCK. Changes in this document are relative to revision 2 of the draft standard SCSI-2. Additions are shown as italics. Deletions are shown as strikeouts. Edits for revision 1 of this document: - Update ASA bit of the MEDIA SCAN command to contain the concept of contiguous written and blank areas; - clarify purpose of PRA bit of MEDIA SCAN; - added Disable Block Descriptor bit to MODE SENSE, and deleted the Block Desc. page; - revised Peripheral Device Parameters page to be more generic, and moved interface specific data to an appendix (just what we need, another appendix); - added text to describe the MAXGEN=1 case of READ UPDATED BLOCK; - better wording to describe Enable Blank Check behavior during UPDATE BLOCK command; - first pass at an Optical Sense Code list; - Note: Larry Lamers will be writing a description of the models for each device type (WORM, ROM, and MO). PROPOSED ADDITIONS TO DIRECT ACCESS COMMAND SECTION 8: Add the following words to the check condition table for both READ commands: Attempt to read a blank or previously unwritten block BLANK CHECK (see note 2) NOTES: (1) The extended sense information bytes shall be set to the logical block address of the first invalid address. (2) The extended sense information bytes shall be set to the logical block address of the first blank block encountered. The data read up to that block shall be transferred. Add the following words to the check condition table for both WRITE commands: Attempt to write a previously written block and blank checking is enabled (see 15.1._) BLANK CHECK (see note 2) Attempt to write on read only medium or DATA PROTECT attempt to write on write protected medium. NOTES: (1) The extended sense information bytes shall be set to the logical Block Address of the first invalid address. (2) The extended sense information bytes shall be set to the logical block address of the first non-blank block encountered. PROPOSED NEW TABLE SHOWING 12 BYTE GROUP 5 CDB: Table 6-4: Typical Command Descriptor Block for Twelve-byte Commands ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | DPO | FUA | Reserved | RelAdr | -----|-----------------------------------------------------------------------| 2 | Logical Block Address (if required) (MSB) | -----|-----------------------------------------------------------------------| 3 | Logical Block Address (if required) | -----|-----------------------------------------------------------------------| 4 | Logical Block Address (if required) | -----|-----------------------------------------------------------------------| 5 | Logical Block Address (if required) (LSB) | -----|-----------------------------------------------------------------------| 6 | Transfer Length (if required) (MSB) | -----|-----------------------------------------------------------------------| 7 | Transfer Length (if required) | -----|-----------------------------------------------------------------------| 8 | Transfer Length (if required) | -----|-----------------------------------------------------------------------| 9 | Transfer Length (if required) (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Control Byte | ============================================================================== Command Descriptions for Write-Once Read-Multiple Devices Group 0 and 1 Commands for Write-Once Read-Multiple Devices The Group 0 and 1 commands for write-once read-multiple devices shall be as shown in Table 12-1. Group 0 & 1 & 5 Commands for Write-Once Read-Multiple Devices ============================================================================== Command Name Code Type Section ------------------------------------------------------------------------------ COMPARE 39h O 7.1.1 COPY 18h O 7.1.2 COPY AND VERIFY 3Ah O 7.1.3 FLUSH CACHE 35h O 8.1.2 INQUIRY 12h M 7.1.4 LOCK/UNLOCK CACHE 36h O 8.1.3 MEDIA SCAN 38h O 15.1. MODE SELECT 15h O 15.1. MODE SENSE 1Ah O 15.1. PRE-FETCH 34h O 8.1.6 PREVENT/ALLOW MEDIUM REMOVAL 1Eh O 8.1.7 READ (GROUP 0) 08h O 8.1.8 READ (GROUP 1) 28h M 8.1.9 READ (GROUP 5) A8h O 15.1. READ BUFFER 3Ch O 7.1.5 READ CAPACITY 25h M 8.1.10 READ LONG 3Eh O 8.1.12 READ UPDATED BLOCK (GROUP 1) 2Dh O 15.1. READ UPDATED BLOCK (GROUP 5) ADh O 15.1. REASSIGN BLOCKS 07h O 8.1.13 RECEIVE DIAGNOSTIC RESULTS 1Ch O 7.1.7 RELEASE 17h O 8.1.14 REQUEST SENSE 03h M 7.1.8 ============================================================================== Group 0 & 1 & 5 Commands for Write-Once Read-Multiple Devices Continued ============================================================================== Command Name Code Type Section ------------------------------------------------------------------------------ RESERVE 16h O 8.1.15 REZERO UNIT 01h O 8.1.16 SEARCH DATA EQUAL (GROUP 1) 31h O 8.1.17.1 SEARCH DATA EQUAL (GROUP 5) B1h O 15.1. SEARCH DATA HIGH (GROUP 1) 30h O 8.1.17.2 SEARCH DATA HIGH (GROUP 5) B0h O 15.1. SEARCH DATA LOW (GROUP 1) 32h O 8.1.17.3 SEARCH DATA LOW (GROUP 5) B2h O 15.1. SEEK (GROUP 0) 0Bh O 8.1.18 SEEK (GROUP 1) 2Bh O 8.1.19 SEND DIAGNOSTIC 1Dh O 7.1.9 SET LIMITS (GROUP 1) 33h O 8.1.20 SET LIMITS (GROUP 5) B3h O 15.1. START/STOP UNIT 1Bh O 8.1.21 TEST UNIT READY 00h O 7.1.10 UPDATE BLOCK (GROUP 1) 3Dh O 15.1. UPDATE BLOCK (GROUP 5) BDh O 15.1. VERIFY (GROUP 1) 2Fh O 15.1. VERIFY (GROUP 5) AFh O 15.1. WRITE (GROUP 0) 0Ah O 8.1.23 WRITE (GROUP 1) 2Ah M 8.1.24 WRITE (GROUP 5) AAh O 15.1. WRITE AND VERIFY (GROUP 1) 2Eh O 8.1.25 WRITE AND VERIFY (GROUP 5) AEh O 15.1. WRITE BUFFER 3Bh O 7.1.11 WRITE LONG 3Fh O 8.1.26 ============================================================================== Key: M = Command implementation is mandatory. O = Command implementation is optional. The following command codes are Vendor Unique: 02h,05h,06h,09h,0Ch,0Dh,0Eh,0Fh,10h,11h,13h,14h,19h, 20h,21h,22h,23h,24h,26h,27h,29h,2Ch,2Dh and C0h thru FFh. All remaining command codes are reserved for future standardization. [NOTE: All text in Section 12 after this point has been deleted for Revision 3 of this draft standard. I have not attempted to show complete strikeouts... Jeff Stai, ed. ] Command Descriptions for Read-Only Direct-Access Devices Group 0 Commands for Read-Only Direct-Access Devices The Group 0 commands for read-only direct-access devices shall be as shown in Table 13-1. Group 0 & 1 & 5 Commands for Read-Only Direct Access Devices ============================================================================== Command Name Code Type Section ------------------------------------------------------------------------------ COMPARE 39h O 7.1.1 COPY 18h O 7.1.2 COPY AND VERIFY 3Ah O 7.1.3 INQUIRY 12h M 7.1.4 LOCK/UNLOCK CACHE 36h O 8.1.3 MODE SELECT 15h O 15.1. MODE SENSE 1Ah O 15.1. PRE-FETCH 34h O 8.1.6 PREVENT/ALLOW MEDIUM REMOVAL 1Eh O 8.1.7 READ (GROUP 0) 08h O 8.1.8 READ (GROUP 1) 28h M 8.1.9 READ (GROUP 5) A8h O 15.1. READ BUFFER 3Ch O 7.1.5 READ CAPACITY 25h M 8.1.10 RECEIVE DIAGNOSTIC RESULTS 1Ch O 7.1.7 RELEASE 17h O 8.1.14 REQUEST SENSE 03h M 7.1.8 ============================================================================== Group 0 & 1 & 5 Commands for Read-Only Direct-Access Devices Continued ============================================================================== Command Name Code Type Section ------------------------------------------------------------------------------ RESERVE 16h O 8.1.15 REZERO UNIT 01h O 8.1.16 SEARCH DATA EQUAL (GROUP 1) 31h O 8.1.17.1 SEARCH DATA EQUAL (GROUP 5) B1h O 15.1. SEARCH DATA HIGH (GROUP 1) 30h O 8.1.17.2 SEARCH DATA HIGH (GROUP 5) B0h O 15.1. SEARCH DATA LOW (GROUP 1) 32h O 8.1.17.3 SEARCH DATA LOW (GROUP 5) B2h O 15.1. SEEK (GROUP 0) 0Bh O 8.1.18 SEEK (GROUP 1) 2Bh O 8.1.19 SEND DIAGNOSTIC 1Dh O 7.1.9 SET LIMITS (GROUP 1) 33h O 8.1.20 SET LIMITS (GROUP 5) B3h O 15.1. START/STOP UNIT 1Bh O 8.1.21 TEST UNIT READY 00h O 7.1.10 VERIFY (GROUP 1) 2Fh O 8.1.22 VERIFY (GROUP 5) AFh O 15.1. WRITE BUFFER 3Bh O 7.1.11 ============================================================================== Key: M = Command implementation is mandatory. O = Command implementation is optional. The following command codes are Vendor Unique: 02h,05,06h,09,0Ch,0Dh,0Eh,0Fh,10h,11h,13h,14h,19h, 20h,21h,22h,23h,24h,26h,27h,29h,2Ch,2Dh. All remaining command codes are reserved for future standardization. Command Descriptions for Optical Memory Devices Group 0 & 1 & 5 Commands for Optical Memory Devices. The Group 0 & 1 & 5 commands for optical memory devices shall be as shown in Table 15-1. Group 0 & 1 & 5 Commands for Optical Memory Devices ============================================================================== Command Name Code Type Section ------------------------------------------------------------------------------ COMPARE 39h O 7.1.1 COPY 18h O 7.1.2 COPY AND VERIFY 3Ah O 7.1.3 ERASE (GROUP 1) 2Ch O 15.1. ERASE (GROUP 5) ACh O 15.1. FLUSH CACHE 35h O 8.1.2 FORMAT UNIT 04h O 8.1.1 INQUIRY 12h M 7.1.4 LOCK/UNLOCK CACHE 36h O 8.1.3 MEDIA SCAN 38h O 15.1. MODE SELECT 15h O 15.1. MODE SENSE 1Ah O 15.1. PRE-FETCH 34h O 8.1.6 PREVENT/ALLOW MEDIUM REMOVAL 1Eh O 8.1.7 READ (GROUP 0) 08h O 8.1.8 READ (GROUP 1) 28h O 8.1.9 READ (GROUP 5) A8h M 15.1. READ BUFFER 3Ch O 7.1.5 READ CAPACITY 25h M 8.1.10 READ DEFECT DATA 37h O 8.1.11 READ DEFECT DATA (GROUP 5) B7h O 15.1. READ LONG 3Eh O 8.1.12 READ UPDATED BLOCK (GROUP 1) 2Dh O 15.1. READ UPDATED BLOCK (GROUP 5) ADh O 15.1. REASSIGN BLOCKS 07h O 8.1.13 RECEIVE DIAGNOSTIC RESULTS 1Ch O 7.1.6 RELEASE 17h M 8.1.14 REQUEST SENSE 03h M 7.1.7 ============================================================================== Group 0 & 1 & 5 Commands for Optical Memory Devices Continued ============================================================================== Command Name Code Type Section ------------------------------------------------------------------------------ RESERVE 16h M 8.1.16 REZERO UNIT 01h O 8.1.15 SEARCH DATA EQUAL (GROUP 1) 31h O 8.1.17.1 SEARCH DATA EQUAL (GROUP 5) B1h O 15.1. SEARCH DATA HIGH (GROUP 1) 30h O 8.1.17.2 SEARCH DATA HIGH (GROUP 5) B0h O 15.1. SEARCH DATA LOW (GROUP 1) 32h O 8.1.17.3 SEARCH DATA LOW (GROUP 5) B2h O 15.1. SEEK (GROUP 0) 0Bh O 8.1.18 SEEK (GROUP 1) 2Bh O 8.1.19 SEND DIAGNOSTIC 1Dh M 7.1.8 SET LIMITS (GROUP 1) 33h O 8.1.20 SET LIMITS (GROUP 5) B3h O 15.1. START/STOP UNIT 1Bh O 8.1.21 TEST UNIT READY 00h M 7.1.9 UPDATE BLOCK (GROUP 1) 3Dh O 15.1. UPDATE BLOCK (GROUP 5) BDh O 15.1. VERIFY (GROUP 1) 2Fh O 15.1. VERIFY (GROUP 5) AFh O 15.1. WRITE (GROUP 0) 0Ah O 8.1.23 WRITE (GROUP 1) 2Ah O 15.1. WRITE (GROUP 5) AAh M 15.1. WRITE AND VERIFY (GROUP 1) 2Eh O 15.1. WRITE AND VERIFY (GROUP 5) AEh O 15.1. WRITE BUFFER 3Bh O 7.1.10 WRITE LONG 3Fh O 8.1.26 ============================================================================== Key: M = Command implementation is mandatory. O = Command implementation is optional. All remaining command codes are reserved for future standardization. ERASE Command Peripheral Device Type: Optical Memory Operation Code Type: Optional ERASE Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (2Ch) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | ERA |Reserved| RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | (MSB) | -----|--- Transfer Length ---| 8 | (LSB) | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The ERASE command requests that the target erase the specified number of blocks starting at the specified logical block address on the medium. As used here, "erased" means either the medium shall be erased, or a pattern shall be written on the medium that appears to the target as no data present. The previous data recorded on the medium, if any, shall not be recoverable. The target shall alter the medium to prevent recovery of the previous data, if any, written to the medium. [Why is there no IMMED bit? Shouldn't this command correlate with the Sequential Access ERASE command?] [not necessarily... if I hear no input on this matter at the Oct plenary, I will drop it...ed.] The erase all (ERA) bit set to one indicates that all remaining blocks on the medium shall be erased. If the ERA bit is set to one and if the number of blocks is not zero, the target shall return CHECK CONDITION, and the sense key shall be set to ILLEGAL REQUEST. The logical block address specifies the logical block at which the erase operation shall begin. The number of blocks specifies the number of contiguous logical blocks that shall be erased. A number of blocks to erase of zero indicates that no blocks shall be erased if the ERA bit is set to zero. This condition shall not be considered as an error and no data shall be erased. Any other value indicates the number of logical blocks that shall be erased. This command shall be terminated with a status of RESERVATION CONFLICT if any reservation access conflict (see 8.1.8) exists and no data shall be erased. IMPLEMENTORS NOTE: This command allows the user to separate the Erase and Write functions into two operations. This may increase system performance in certain applications. Caution must be used when implementing the ERASE command in an environment that uses the UPDATE BLOCK and READ UPDATED BLOCK commands as pointer information may be inadvertently erased in a bulk erase process. ERASE Command Peripheral Device Type: Optical Memory Operation Code Type: Optional ERASE Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (ACh) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | ERA |Reserved| RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Transfer Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Control Byte | ============================================================================== The ERASE command requests that the target erase the specified number of blocks starting at the specified logical block address on the medium. See the Group 1 ERASE command (Section 15.1._) for a description of the fields in this command. MEDIA SCAN Command Peripheral Device Type: Optical Memory and Write-Once Read-Multiple Operation Type Code: Optional MEDIA SCAN Command ============================================================================== Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (38h) | ------|----------------------------------------------------------------------| 1 | Logical Unit Number | WBS | ASA | RSD | PRA | RelAdr | ------|----------------------------------------------------------------------| 2 | (MSB) | ------|--- ---| 3 | | ------|--- Logical Block Address ---| 4 | | ------|--- ---| 5 | (LSB) | ------|----------------------------------------------------------------------| 6 | Reserved | ------|----------------------------------------------------------------------| 7 | Reserved | ------|----------------------------------------------------------------------| 8 | Parameter List Length | ------|----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The MEDIA SCAN command requests the target to scan the medium for a contiguous set of written or blank logical blocks. A written block search (WBS) bit of zero indicates that the scan is for blank blocks. A WBS bit of one indicates that the scan is for written blocks. An advanced scan algorithm (ASA) bit of zero indicates that the scan area is scanned in sequential order (as selected by the RSD bit). An ASA bit of one indicates to the target that the written and blank areas within the scan area form contiguous extents (as opposed to scattered blocks). This indication is advisory to the target. IMPLEMENTOR'S NOTE: The purpose of this bit is to allow the target to use a more advanced algorithm (such as a binary search) to locate the requested blocks. An assert contiguous data (ACD) bit of zero indicates that the blocks are scanned in logical order. An ACD bit of one indicates that the blocks being scanned form a contiguous extent; this is advisory to the target. IMPLEMENTORS Note: This intention is to allow any of a number of search algorithms, the classic binary search is one example. The use of search algorithms beyond the default linear scan is optional. A reverse search direction (RSD) bit of zero indicates the scan shall be in the forward direction. A RSD bit of one indicates the scan shall be in the reverse direction (i.e. the starting logical address of the scan is the sum of the logical block address and the number of blocks to scan). Implementation of this bit is optional. A reverse search direction (RSD) bit of zero indicates the scan shall begin with the first logical block of the scan area. A RSD bit of one indicates the scan shall begin with the last logical block of the scan area. A partial results acceptable (PRA) bit of zero indicates that the scan shall continue after determining that a candidate extent did not meet the number of blocks requested. A PRA bit of one indicates that the scan shall terminate as soon as one block meeting the criteria given by the WBS bit specification is found. A partial results acceptable (PRA) bit of zero indicates that the scan shall not be considered satisfied until a contiguous set of blocks is found within the scan area which is greater than or equal in size to the number of blocks requested, and meets the other criteria specified in the command descriptor block. A PRA bit of one indicates that the scan may be satisfied by a contiguous set of blocks within the scan area which is less than the number of blocks requested, and meets the other criteria specified in the command descriptor block. In this case, the target shall determine the largest contiguous set of blocks in the scan area for reporting to the initiator. The parameter list length specifies the length in bytes of the parameter list that shall be transferred during the DATA OUT phase. A parameter list length of zero indicates that the number of blocks requested field has a value of one, and the number of blocks to scan field has a value of zero. This condition shall not be considered an error. The contents of the parameter list are specified in Table 15._._. A link bit of zero indicates a non-linked command and if the scan is satisfied, the command shall be terminated with a CONDITION MET status. A REQUEST SENSE command can then be issued to determine the starting logical block address of the area that meets the request. If the scan is not satisfied and no error occurs, the command shall be terminated with GOOD status. A link bit of one indicates a command is linked to the MEDIA SCAN command and if the search is satisfied, CONDITION MET status is returned and the next command is executed. If the RelAdr bit in the next command is one, the logical block address of the next command is used as a displacement from the logical block address at which the search was satisfied. If a linked scan is not satisfied, the command is terminated with a CHECK CONDITION status. A REQUEST SENSE command may then be issued. A REQUEST SENSE command following a satisfied MEDIA SCAN command shall: (1) Return a sense key of EQUAL if the scan was satisfied by an exact match. a contiguous set of blocks equal in size to the number of blocks requested. If the scan was satisfied by a contiguous set of blocks not equal in size to the number of blocks requested, then a sense key of NO SENSE shall be returned. (2) Return the valid bit set to one. (3) Return the first logical block address of the area meeting first logical block of the contiguous set of blocks that satisfied the scan criteria nearest the starting logical block address in the information bytes. (4) Return the number of contiguous logical blocks meeting the scan criteria in the command specific information bytes. A REQUEST SENSE command following an unsatisfied MEDIA SCAN command shall: (1) Return a sense key of NO SENSE if no errors occurred during the command execution. (2) Return the valid bit set to zero. MEDIA SCAN Parameter List ============================================================================== Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | (MSB) | ------|--- ---| 1 | | ------|--- Number of Blocks Requested ---| 2 | | ------|--- ---| 3 | (LSB) | ------|----------------------------------------------------------------------| 4 | (MSB) | ------|--- ---| 5 | | ------|--- Number of Blocks to Scan ---| 6 | | ------|--- ---| 7 | (LSB) | ============================================================================== The number of blocks requested field specifies the number of blocks that meet the specified requirements. The number of blocks requested field, if set to zero, indicates that the scan shall not take place. This shall not be considered an error condition. The number of blocks to scan field specifies the length in blocks of the area to be scanned on the media. The number of blocks to scan field, if set to zero, indicates that the scan may shall continue for all remaining blocks on the media. MODE SELECT Command Peripheral Device Type: Optical Memory, Write-Once Read-Multiple, and Read-Only Direct-Access Operation Code Type: Optional MODE SELECT Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (15h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | PF | Reserve | SP | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | Parameter List Length | -----|-----------------------------------------------------------------------| 5 | Control Byte | ============================================================================== [all revision 2 changes to section 8 have been included here...ed.] The MODE SELECT command (Table _-_) provides a means for the initiator to specify medium, logical unit, or peripheral device parameters to the target. Targets that implement the MODE SELECT command shall also implement the MODE SENSE command. Initiators should issue MODE SENSE prior to MODE SELECT to determine supported pages, page lengths, and other parameters. After the MODE SELECT command has been completed successfully, and the target changed any parameters that affect another initiator, the target shall generate a Unit Attention condition for all initiators except the one that issued the MODE SELECT command (see section 6.1.3). The Unit Attention condition shall be set to Mode Select Parameters Changed. [words will be added here for targets that save parameters by initiator... ed.] A page format (PF) bit of zero indicates that the MODE SELECT parameters are as specified in ANSI X3.131-1986 (i.e., all parameters after the block descriptors are vendor unique). A PF bit of one indicates that the MODE SELECT parameters are structured as pages of related parameters and are as specified in this standard. The target shall return CHECK CONDITION status with a sense key of ILLEGAL REQUEST and an additional sense code of Invalid Field in Parameter List if the initiator attempts to change any field that is not changeable by the target. If the initiator sends a value for a parameter that is outside the range supported by the target and rounding is not allowed for that parameter, the target shall return a CHECK CONDITION status with a sense key of ILLEGAL REQUEST and an additional sense code of Invalid Field in Parameter List. If the initiator sends a value for a parameter that is outside the range supported by the target and rounding is allowed for that parameter, the target may either: (1) round the value to an acceptable value and terminate the command as described in section 6._._. (2) return a CHECK CONDITION status with a sense key of ILLEGAL REQUEST and an additional sense code of Invalid Field in Parameter List. A save parameters (SP) bit of zero indicates the target shall not save any parameters. the saveable pages sent during the DATA OUT phase to nonvolatile memory. A SP bit of one indicates that the target shall save to non-volatile memory all the savable parameters pages (if any) including any sent during the DATA OUT phase. to nonvolatile memory. (Savable pages are optional and identified by the PS bit that is returned in the page header by the MODE SENSE command.) If the target does not support saved parameters and the SP bit is one, CHECK CONDITION status shall be returned and the sense key shall be set to ILLEGAL REQUEST with an additional sense code of Illegal Field in command descriptor block (see 8.1.4.4, Saved Values). The parameter list length specifies the length in bytes of the MODE SELECT parameter list that shall be transferred from the initiator to the target. A parameter list length of zero indicates that no data shall be transferred. This condition shall not be considered as an error. Certain combinations of parameters and pages must be defined to a particular boundary. Truncation of such a parameter list by an incorrect length shall be considered an error. The sense key is set to INVALID REQUEST and the Additional Sense Code is set to Invalid Field in Parameter List The MODE SELECT parameter list (Table _-_) contains a four-byte header, followed by zero or more eight-byte block descriptors, followed by zero or more pages. MODE SELECT Parameter List ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved | -----|-----------------------------------------------------------------------| 1 | Medium Type | -----|-----------------------------------------------------------------------| 2 | Reserved | EBC | -----|-----------------------------------------------------------------------| 3 | Block Descriptor(s) Length | ============================================================================== | Block Descriptor(s) | ============================================================================== 0 | Reserved | -----|-----------------------------------------------------------------------| 1 | (MSB) | -----|--- ---| 2 | Number of Blocks | -----|--- ---| 3 | (LSB) | -----|-----------------------------------------------------------------------| 4 | Reserved | -----|-----------------------------------------------------------------------| 5 | (MSB) | -----|--- ---| 6 | Block Length | -----|--- ---| 7 | (LSB) | ============================================================================== | Page(s) | ============================================================================== 0 |Reserved|Reserved| Page Code | -----|-----------------------------------------------------------------------| 1 | Page-Specific Parameter Length | -----|-----------------------------------------------------------------------| 2 | | - - -|- - Page-Specific Parameters - -| n | | ============================================================================== Code values for the medium type field are defined in Table _-_. Optical Memory Medium-Type Codes ============================================================================== Code Value Medium Type ---------- ------------------------------------------------------------------ 00h Default (only one medium type supported) 01h Optical read only medium 02h Optical write once medium 03h Optical Reversible / Erasable medium 04h Read only / Write Once medium [how is this different than 02?] 05h Read only / Erasable medium [ditto for 03] 06h Write Once / Erasable medium [etc] 07h - 7Fh RESERVED 80h - FFh Vendor unique ============================================================================== n enable blank check (EBC) bit of zero disables blank checking of the medium during write operations or an UPDATE BLOCK command. An EBC bit of one enables blank checking. If a non-blank block is found during a write operation, the command shall be terminated with a CHECK CONDITION status and the sense key shall be set to BLANK CHECK. If a blank block is found during an UPDATE BLOCK command, the command shall be terminated with a CHECK CONDITION status and the sense key shall be set to BLANK CHECK. For read-only direct-access devices, the EBC bit is reserved. The block descriptor length specifies the length in bytes of all the block descriptors. It is equal to the number of block descriptors times eight and does not include the page parameters, if any. A block descriptor length of zero indicates that no block descriptors shall be included in the parameter list. This condition shall not be considered as an error. Each block descriptor specifies the medium characteristics for all or part of a logical unit. Each block descriptor contains a number of blocks and a block length. The number of blocks field specifies the number of logical blocks on the medium that meet the density code and block length in the block descriptor. A number of blocks of zero indicates that all of the remaining logical blocks of the logical unit shall have the medium characteristics specified by the block descriptor. The block length specifies the length in bytes of each logical block described by the block descriptor. Each page descriptor specifies parameters for the target to use for subsequent operations on the specific logical unit. The format of each page descriptor depends on the peripheral device type but is always a multiple of four. The page codes for direct-access devices are given in Table _-_. The parameter length field specifies the length in bytes of the parameters that follow for the specified page. The initiator should set this value to the value that is returned in the parameter length field for the same page by the MODE SENSE command. If this condition is not met, the target may shall return CHECK CONDITION status and set the sense key to ILLEGAL REQUEST. (Note that the parameter length value returned by the MODE SENSE command may be less than the full page.) Page Codes for Optical Memory Devices ============================================================================== Page Code Description Section ---------- -------------------------------------------- ------- 00h Vendor Unique (does not require page format) 01h Error Recovery Parameters 8._._ 02h Disconnect/Reconnect Control Parameters 8._._ 03h -06h Reserved 07 Verify Error Recovery Parameters 8._._ 08 Block Descriptors 15._._ 08 Reserved 09 Peripheral Device Parameters 15._._ 0Ah Reserved 0Bh Medium Types Supported 8._._ 0Ch - 1Fh Reserved 20h - 3Eh Vendor Unique 3Fh (Defined for MODE SENSE only) ============================================================================== [this page has been modified to be generic for all interfaces. the information specific to ESDI that was shown in revision 2 is moved to an appendix. strikeouts have not been used to show the mods to this table...ed.] [it is likely that this page will move to section 7 as part of the generic MODE SELECT/SENSE commands...ed.] Peripheral Device Parameters ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Page Code (09h) | -----|-----------------------------------------------------------------------| 1 | Number of bytes in this page (n-1) | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- Interface Identifier ---| 3 | (LSB) | -----|-----------------------------------------------------------------------| 4 | Reserved | -----|-----------------------------------------------------------------------| 5 | Reserved | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | Reserved | -----|-----------------------------------------------------------------------| 8 - n| Interface Specific Parameters | ============================================================================== The purpose of this page is to report parameters related to the peripheral device interface that may be of interest to the initiator. This page is given as an example for the ESDI interface. This page is used to pass interface specific information between an initiator and an interface beyond the target. This standard does not address the format of this data, except to provide a standard header. Examples of Interface Specific Parameters for several common interfaces are shown in the Appendix. The Interface Identifier codes are given in the following table: Interface Identifier Codes ============================================================================== Reference Code Value Interface Standard ---------- ------------------------------------------------- ------------- 0000h Small Computer System Interface X3.131-1986 0001h Storage Module Interface X3.91-1987 0002h Enhanced Small Device Interface X3T9.3/87-005 0003h Intelligent Peripheral Interface - Magnetic Disk X3.130-1986 0004h-7fffh Reserved 8000h-FFFFh Vendor Unique ============================================================================== MODE SENSE Command Peripheral Device Type: Optical Memory, Write-Once Read-Multiple, and Read-Only Direct-Access Operation Code Type: Optional MODE SENSE Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (1Ah) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | PF | DBD | Reserved | -----|-----------------------------------------------------------------------| 2 | PC | Page Code | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | Parameter List Length | -----|-----------------------------------------------------------------------| 5 | Control Byte | ============================================================================== [all revision 2 changes from section 8 have been included here...ed.] The MODE SENSE command (Table __-__) provides a means for a target to report parameters to the initiator. It is a complementary command to the MODE SELECT command. If the MODE SELECT command is implemented the MODE SENSE command shall be implemented. [the following paragraph will likely show up as a generic feature...ed.] A disable block descriptors (DBD) bit of zero indicates that the target may return zero or more block descriptors in the returned MODE SENSE data (see Table 15-_), at its discretion. A DBD bit of one specifies that the target shall return zero block descriptors in the returned MODE SENSE data. A page format (PF) bit of zero indicates the MODE SENSE data format is as specified in ANSI X3.131-1986. A PF bit of one indicates the MODE SENSE data format is as specified in this document. The page control (PC) field defines the type of parameter values to be returned as shown below. DB(7) DB(6) Type of Parameter Values Section ----- ----- ------------------------ ------- 0 0 Current Values 15._._._ 0 1 Changeable Values 15._._._ 1 0 Default Values 15._._._ 1 1 Saved Values 15._._._ The page code specifies which page or pages to return. The page codes are defined in Table __-__. Page Codes for Optical Memory Devices ============================================================================== Page Code Description Section ------------------------------------------------------------------------------ 00 Vendor Unique (does not require page format) 01 Error Recovery parameters 8._._ 02 Disconnect/Reconnect Control parameters 8._._ 03 - 06 Reserved 07 Verify Error Recovery parameters 08 Device Block Descriptor(s) 15._._ 08 Reserved 09 Peripheral Device Parameters 15._._ 0A Reserved 0B Medium Types supported 15._._ 0C - 1F Reserved 20 - 3E Reserved 3F Defined for mode sense only 15._._ ============================================================================== The allocation length specifies the number of bytes that the initiator has allocated for returned MODE SENSE data. An allocation length of zero indicates that no MODE SENSE data shall be transferred. This condition shall not be considered as an error. Any other value indicates the maximum number of bytes that shall be transferred. The target shall terminate the DATA IN phase when allocation length bytes have been transferred or when all available MODE SENSE data have been transferred to the initiator, whichever is less. Current Values The PF bit set to one and a PC field value of 0h requests the target return the current values for the page code specified. The current values returned are: 1) The parameters set in the last successful MODE SELECT command. 2) The saved values if a MODE SELECT command has not been executed. 3) The default values if saved values are not available or not supported. If the page code is 3Fh, all implemented pages are requested to be returned by the target. Implementors note: Page code 0h is vendor unique and may be returned as the last page if it is returned at all during a page code 3Fh request. Normally the pages are returned in ascending order. [what if length exceeds 256 bytes?] Parameters not supported by the target shall be set to zero. The parameter length of each page indicates the length of the parameters that are supported. [IMPLEMENTORS NOTE: Some targets may not support an entire page as defined in this document.] [discuss applicability of 3Fh and foreshortened pages] Changeable Values The PF bit set to one and a PC field value of 1h requests the target return the changeable values for the page code specified. The page requested shall be returned with the bits that are allowed to be changed set to one. Parameters that are not changeable shall be set to zero. If any part of a field is changeable all bits in that field are set to one. If the page code is 3Fh, the changeable values for all implemented pages are requested to be returned by the target. If none of parameters are changeable within a page, the target may or may not return bytes 0 and 1 of the page. If the target returns these two bytes, the page length value shall be set to zero by the target. Default Values The PF bit set to one and a PC field value of 2h requests the target return the default values for the page code specified. The page requested shall be returned with the default parameters set. Parameters not supported by the target shall be set to zero. (Implementors note: The value of the parameters returned is intended to avoid confusion over whether the value of zero is the default or the unsupported value.) If the page code is 3Fh, the default parameters for all implemented pages are requested to be returned by the target. Saved Values The PF bit set to one and a PC field value of 3h requests the target return the saved values for the page code specified. The page requested shall be returned with the saved parameters set. Parameters not supported by the target shall be set to zero. (Implementors note: The value of the parameters returned is intended to avoid confusion over whether the value of zero is the default or the unsupported value.) If saved values are not available or not supported a CHECK CONDITION status shall be returned with the sense key set to ILLEGAL REQUEST and the Additional Sense Code set to Save Parameters Not Supported. If the page code is 3Fh, the saved values for all implemented pages are requested to be returned by the target. IMPLEMENTORS NOTE: The method of saving parameters is vendor unique. The parameters must be preserved in such a manner that they are retained when the target is powered down. Pages 3,4, and 5 are considered to be saved only after a successful execution of a subsequent Format command. Other All pages can be considered saved when the Mode Select command with the Save Parameters bit set has returned a status of GOOD or after the successful completion of a FORMAT UNIT command. Devices which use removable media generally do may not support saving parameters. The target shall return the same page length value in each page that it supports with the 3Fh page code whatever the value of each bit of the PC field is. [HUH?] The MODE SENSE data (TABLE 8-19) contains a four-byte header, followed by zero or more eight-byte block descriptors, followed by zero or more pages. MODE SENSE Data ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Sense Data Length | -----|-----------------------------------------------------------------------| 1 | Medium Type | -----|-----------------------------------------------------------------------| 2 | WP | Reserved | Cache | Reserved | EBC | -----|-----------------------------------------------------------------------| 3 | Block Descriptor(s) Length | ============================================================================== | Block Descriptor(s) | ============================================================================== 0 | Density Code Reserved | -----|-----------------------------------------------------------------------| 1 | (MSB) | -----|--- ---| 2 | Number of Blocks | -----|--- ---| 3 | (LSB) | -----|-----------------------------------------------------------------------| 4 | Reserved | -----|-----------------------------------------------------------------------| 5 | (MSB) | -----|--- ---| 6 | Block Length | -----|--- ---| 7 | (LSB) | ============================================================================== | Page(s) | ============================================================================== 0 | PS |Reserved| Page Code | -----|-----------------------------------------------------------------------| 1 | Page-Specific Parameter Length | -----|-----------------------------------------------------------------------| 2 | | - - -|- - Page-Specific Parameters - -| n | | ============================================================================== Code values for the medium type field are defined in Table __-__. The sense data length specifies the length in bytes of the following MODE SENSE data that is available to be transferred during the DATA IN phase. The sense data length does not include itself. Code values for the medium type field are defined in Table 8-14.1. A write protected (WP) bit of zero indicates that the medium is write enabled. A WP bit of one indicates that the medium is write protected. For read-only direct-access devices, the WP bit is reserved. A cache bit of zero indicates that the target does not contain a cache memory. A cache bit of one indicates that the target contains a cache memory and supports the cache control bits (see 6.2.4). An enable blank check (EBC) bit of zero indicates that blank checking of the medium during write operations is disabled. An EBC bit of one indicates that blank checking during write and update operations is enabled. For read-only direct-access devices, the EBC bit is reserved. The block descriptor length specifies the length in bytes of all the block descriptors. It is equal to the number of block descriptors times eight and does not include the page parameters, if any. A block descriptor length of zero indicates that no block descriptors shall be included in the parameter list. This condition shall not be considered as an error. Each block descriptor specifies the medium characteristics for all or part of a logical unit. Each block descriptor contains a density code, a number of blocks, and a block length. Code values for the density code field shall be assigned as follows: 00h Default (only one density supported) 01h Flexible disk, single density 02h Flexible disk, double density 03h - 7Fh Reserved 80h - FFh Vendor unique The number of blocks field specifies the number of logical blocks of the medium that meets the density code and block length in the block descriptor. A number of blocks of zero indicates that all of the remaining logical blocks of the logical unit have the medium characteristics specified by the block descriptor. The block length specifies the length in bytes of each logical block. Optional additional blocks of parameters called pages may be sent to the target in the DATA phase of the MODE SELECT command, following the MODE SELECT header if the block descriptor length is set to zero, or all block descriptors, if the block descriptor length is different than zero. Each defined Page is preceded by a Header of two bytes defining the Page Code and the length of the page. Following the Header the Pages are separated into sub-blocks containing a list of related flags and/or values. The Parameters Savable (PS) bit of each Page Header are set to one by the target to indicate that the supported parameters can be saved by the target. PS bits set to zero indicates that the supported parameters cannot be saved by the target. The Page Code identifies the meaning of the following bytes in the Page. The parameters in the defined Pages are classified in priority to ease implementation by the target. The Page Length indicates the number of bytes that the target supports in each Page. The Page Length value of each defined page, shall not include the Page Length byte. The target may return in the pages of the MODE SENSE commands as many consecutive bytes that it supports, for each page that it supports, without splitting fields of multiple bytes. The page length shall be set in the pages of the MODE SELECT commands to the value returned by the target in the MODE SENSE page length bytes. Otherwise, the target shall create CHECK CONDITION status with the sense key of ILLEGAL REQUEST. IMPLEMENTORS NOTE: The initiator should issue a MODE SENSE command requesting the target to return all changeable values (PCF field configuration 0 1 and page code 3Fh in byte 2 of the MODE SENSE command descriptor block) prior to issuing any MODE SELECT commands, in order to find out which pages are implemented by the target and the length of each page for that particular logical unit. After a power up condition or hard SCSI reset condition, the following is required of the target in response to a MODE SENSE command: (1) If Default Values are requested report the default values. (2) If Saved Values are requested, report the valid restored parameters, or restore the parameters and report them. If the saved parameters are not able to be accessed in non-volatile memory terminate the command with a CHECK CONDITION status and the sense key set to NOT READY. (3) If the current values are requested report a valid set of saved parameters, or restore the saved parameters and report them. If the current saved parameters are not able to cannot be accessed in non-volatile memory, then the target shall terminate the command with a CHECK CONDITION status and the sense key set to NOT READY. An attempt to may be made to identify the return valid parameters if the target is unable to save parameters. At the target's option it may report default values. [The group 0 and group 1 READ command blocks have been deleted from this section. Refer to section 8 for those commands...ed.] READ Command Peripheral Device Type: Optical Memory Operation Code Type: Mandatory READ Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (A8h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | DPO | FUA | Reserved | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Transfer Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Control Byte | ============================================================================== The READ command (Table __-__) requests that the target transfer data to the initiator from the medium. See the Group 1 READ command (section 8.1._) for a complete description of the fields in this command. The logical block address specifies the logical block at which the read operation shall begin. The transfer length specifies the number of contiguous logical blocks of data that shall be transferred. A transfer length of zero indicates that no data shall be transferred. This condition shall not be considered as an error. Any other value indicates the number of logical blocks that shall be transferred. See section 6.2.4 for a description of the cache control bits (DPO and FUA). See section 6.2.5 for a description of the relative address bit (RelAdr). This command shall be terminated with a status of RESERVATION CONFLICT if any reservation access conflict (see 8.1.8) exists and no data shall be transferred. If any of the following conditions occur, this command shall be terminated with a CHECK CONDITION status and, if extended sense is implemented, the sense key shall be set as indicated in the following table. This table does not provide an exhaustive enumeration of all conditions that may cause the CHECK CONDITION status. Condition Sense Key ---------------------------------------------- ---------------------------- Invalid logical block address ILLEGAL REQUEST (see note 1) Target reset or medium change since the last command from this initiator UNIT ATTENTION Overrun or other error that might be resolved by repeating the command ABORTED COMMAND Attempt to read a blank or previously unwritten block BLANK CHECK (see note 2) NOTES: (1) The extended sense information bytes shall be set to the logical block address of the first invalid address. (2) The extended sense information bytes shall be set to the logical block address of the first blank block encountered. The data read up to that block shall be transferred. [the following command is new, I have not shown italics here...ed.] READ DEFECT DATA Command Peripheral Device Type: Optical Memory Operation Code Type: Optional READ DEFECT DATA Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (B7h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Plist | GList | Defect List Format | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | Reserved | -----|-----------------------------------------------------------------------| 5 | Reserved | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Allocation Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Control Byte | ============================================================================== The READ DEFECT DATA command requests that the target transfer the medium defect data to the initiator. See the Group 1 READ DEFECT DATA command (Section 8.1._) for a description of the fields in this command. The READ DEFECT DATA for the Group 5 command contains an eight byte header, followed by zero or more defect descriptors. GROUP 5 DEFECT LIST HEADER ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved | -----|-----------------------------------------------------------------------| 1 | Reserved | PList | GList | Defect List Format | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | (MSB) | -----|--- ---| 5 | | -----|--- Defect List Length | 6 | | -----|--- ---| 7 | (LSB) | ============================================================================== Defect Descriptors ============================================================================== 0-n | | ============================================================================== See the description of the Group 1 DEFECT LIST HEADER (Table 8-_) for a description of the fields in this header. READ UPDATED BLOCK Command Peripheral Device Type: Optical Memory Operation Code Type: Optional READ UPDATED BLOCK Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (2Dh) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | DPO | FUA | RUBD | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | Latest | (MSB) | -----|------------ Generation Address | 7 | (LSB) | -----|-----------------------------------------------------------------------| 8 | Transfer Length | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== [note: Don't get excited, but I rearranged some words here for clarity. I did not change them; I did not italicize them...ed.] The READ UPDATED BLOCK command (Table __-__) requests that the target transfer data for the logical block specified from the alternate area medium to the initiator. The logical block address specifies the logical block at which the read operation shall begin. The transfer length specifies the number of contiguous logical blocks of data that shall be transferred. A transfer length of zero indicates that no data shall be transferred. This condition shall not be considered as an error. Any other value indicates the number of logical blocks that shall be transferred. If the transfer length and generation address specified results in exceeding the number of existing generations for the logical block specified, the command shall be terminated with a CHECK CONDITION status. The sense key shall be set to ILLEGAL REQUEST. The Latest bit determines the meaning of the generation address field. A Latest bit of zero indicates that the generation address is specified relative to the first generation of the block; generation address zero specifies the first generation. Increasing generation addresses specify later generations. A Latest bit of one indicates that the generation address is specified relative to the latest generation of the block; generation address zero specifies the most recent generation. Increasing generation addresses specify earlier generations. [editorial comment: I have changed the MaxGen and XfrLBA bits to a single encoded field. This will make it easier to define, and will save a bit combination for future standardization. I have not changed the functions relative to bit settings...ed.] A MaxGen bit of zero and a XfrLBA bit of zero requests the target to transfer the data from each generation of the single logical block specified. The transfer begins at the generation address of the logical block address specified and continues transferring each generation of the logical block address specified. The transfer ends when the transfer length is exhausted. A MaxGen bit of zero and a XfrLBA bit of one requests the target to transfer the data from each logical block of the single generation specified. The transfer begins at the logical block address of the generation address specified and continues transferring each logical block of the generation address specified. The transfer ends when the transfer length is exhausted. The read updated blocks data (RUBD) field defines the type of data to be returned, as shown below. DB(2) DB(1) Returned Data Section ----- ----- -------------------------------------- -------- 0 0 Multiple Generation Data 15.1._.1 0 1 Single Generation Data 15.1._.2 1 0 Maximum Generation Data Block 15.1._.3 1 1 Reserved ----- ----- -------------------------------------- -------- This command shall be terminated with a status of RESERVATION CONFLICT if any reservation access conflict (see 8.1.8) exists and no data shall be transferred. See section 6.2.4 for a description of the cache control bits (DPO and FUA). See section 6.2.5 for a description of the relative address bit (RelAdr). Multiple Generation Data A RUBD field value of 0 requests requests the target to transfer the data from multiple generations of the single logical block specified. The transfer begins at the generation address of the logical block address specified and continues transferring increasing generations of the logical block address specified, as defined by the Latest bit. Single Generation Data A RUBD field value of 1 requests the target to transfer the data from each logical block of the single generation specified. The transfer begins at the logical block address of the generation address specified and continues transferring increasing logical block addresses of the generation address specified. Maximum Generation Data Block A RUBD field value of 2 requests the target to transfer the maximum generation data block shown in Table 15-_. Maximum Generation Data Block ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | (MSB) | -----|--- Maximum Generation Address ---| 1 | (LSB) | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | ============================================================================== The maximum generation address field defines the maximum generation address available for the logical block address specified. [ the following words seemed redundant... If anyone really thinks they are necessary, we can undelete them (maybe we could refer to the READ command or something)...ed.] If any of the following conditions occur, this command shall be terminated with a CHECK CONDITION status and, if extended sense is implemented, the sense key shall be set as indicated in the following table. This table does not provide an exhaustive enumeration of all conditions that may cause the CHECK CONDITION status. Condition Sense Key ---------------------------------------------- ---------------------------- Invalid logical block address ILLEGAL REQUEST (see note 1) Target reset or medium change since the last command from this initiator UNIT ATTENTION Overrun or other error that might be resolved by repeating the command ABORTED COMMAND Attempt to read a blank or previously unwritten block BLANK CHECK (see note 2) NOTES: (1) The extended sense information bytes shall be set to the logical block address of the first invalid address. (2) The extended sense information bytes shall be set to the logical block address of the first blank block encountered. The data read up to that block shall be transferred. [the following command is new, I have not shown italics here...ed.] READ UPDATED BLOCK Command Peripheral Device Type: Optical Memory Operation Code Type: Optional READ UPDATED BLOCK Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (ADh) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | DPO | FUA | RUDB | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | Latest | (MSB) | -----|------------ Generation Address | 7 | (LSB) | -----|-----------------------------------------------------------------------| 8 | (MSB) | -----|--- Transfer Length ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Control Byte | ============================================================================== The READ UPDATED BLOCK command (Table __-__) requests that the target transfer data for the logical block specified from the alternate area medium to the initiator. See the Group 1 READ UPDATED BLOCK command (section 15.1._) for a definition of the fields in this command. [the following commands are new, I have not shown italics here...ed.] SEARCH DATA Commands Peripheral Device Type: Optical Memory, Write-Once Read-Multiple, and Read-Only Direct Access Operation Code Type: Optional SEARCH DATA Commands ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (B0h, B1h, B2h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Invert | Reserved | SpnDat | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Transfer Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Control Byte | ============================================================================== The SEARCH DATA commands search one or more logical blocks for equality or inequality to a data pattern. See the Group 1 SEARCH DATA commands (Section 8.1._) for a description of the fields in this command. [the new LBA list stuff will appear in here in the next rev...ed.] [the following command is new, I have not shown italics here...ed.] SET LIMITS Command Peripheral Device Type: Optical Memory, Write-Once Read-Multiple, and Read-Only Direct Access Operation Code Type: Optional SET LIMITS Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (B3h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | RdInh | WrInh | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Number of Blocks ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Control Byte | ============================================================================== The SET LIMITS command defines the range within which subsequent linked commands may operate. See the Group 1 SET LIMITS command (Section 8.1._) for a description of the fields in this command. [is a note or something required here as to the utility of this command relative to MEDIA SCAN; then again, we say nothing about SEARCH either...ed.] UPDATE BLOCK Command Peripheral Device Type: Optical Memory and Write-Once Read-Multiple Operation Code Type: Optional UPDATE BLOCK Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (3Dh) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | (MSB) | -----|--- Transfer Length ---| 8 | (LSB) | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== [this concept of update operation as well as several others in the optical section need a theory or model to provide a framework for consistent implementation. a glossary of terms with definitions is also needed.] [now soliciting input...ed.] The UPDATE BLOCK command requests that the target logically replace data on the medium with the data sent during the DATA OUT phase. The logical block address specifies the logical block address at which the update operation shall begin. The transfer length specifies the number of contiguous logical blocks of data to transfer. A transfer length of zero indicates that no logical blocks shall be transferred. This condition shall not be considered as an error. Any other value indicates the number of logical blocks that shall be transferred. Support of transfer lengths greater than one is optional. If the target does not support the requested transfer length, it shall terminate the command with a CHECK CONDITION status. The sense key shall be set to ILLEGAL REQUEST. This standard does not define the result of a WRITE command issued to a block previously updated by an UPDATE BLOCK command. [Note: The behavior of this command relative to the Enable Blank Check bit in MODE SELECT is defined there...ed.] A WRITE command to a block previously updated shall post a BLANK CHECK Sense Key if EBC is set to one. [shouldn't this requirement should be in the WRITE commands] [ what about an update to a block not previously written?] If the enable blank check bit is one, and if an update operation is requested for an unwritten block the command shall be terminated with a CHECK CONDITION status. The sense key is set to BLANK CHECK and the additional sense code is set to [______________________________________.] [does this conflict with any other requirements on the EBC bit?] If enable blank check is zero, the the restrictions on a update operation are vendor specific. [this is not a good way to specify a consistent implementation] A logical block may be updated until the alternate block area is exhausted. The alternate blocks used for the update operation shall not be reported in the READ CAPACITY data. If the alternate block area is exhausted the command shall be terminated with CHECK CONDITION and the sense key shall be set to MEDIUM ERROR. [what does the following mean? why would you want to know this if the update was successful and you are doing a subsequent read???...ed.] If the error recovery parameter specifies posting of recovered errors and if a read operation of a logical block that has had a successful update operation performed occurs the command shall terminate with a CHECK CONDITION status. The sense key shall be set to RECOVERED ERROR and the additional sense code set to [__________________________]. [the following command is new, I have not shown italics here...ed.] UPDATE BLOCK Command Peripheral Device Type: Optical Memory and Write-Once Read-Multiple Operation Code Type: Optional UPDATE BLOCK Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (BDh) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Transfer Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Control Byte | ============================================================================== The UPDATE BLOCK command requests that the target logically replace data on the medium with the data sent during the DATA OUT phase. See the Group 1 UPDATE BLOCK command (section 15.1._) for a definition of the fields in this command. VERIFY Command Peripheral Device Type: Optical Memory and Write-Once Read-Multiple Operation Code Type: Optional VERIFY Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (2Fh) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | DPO |Reserved| BlkVfy | BytChk | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | (MSB) | -----|--- Verification Length | 8 | (LSB) | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The VERIFY command (Table __-__) requests that the target verify the data on the medium. If the MODE SELECT command is implemented, and the Verify Error Recovery Parameters page is also implemented, then the current settings in that page define the verification criteria. If the Verify Error Recovery Parameters page is not implemented, then the verification criteria is vendor unique. A byte check (BytChk) bit of zero causes the verification to be simply a medium verification (CRC, ECC, etc.). a medium verification to be performed with no data comparison. A BytChk bit of one causes a byte-by-byte compare of the data written on the medium and the data transferred from the initiator. The data shall be transferred as it would be for a WRITE command. If the compare is unsuccessful, the command shall be terminated with a CHECK CONDITION status and the sense key shall be set to MISCOMPARE. for any reason, the target shall return CHECK CONDITION status and the sense key shall be set to MISCOMPARE. A blank verify (BlkVfy) bit of one causes a verification that the blocks are blank. The logical block address specifies the logical block at which the verify operation shall begin. The verification length specifies the number of contiguous logical blocks of data or blanks that shall be verified. A verification length of zero indicates that no logical blocks shall be verified. This condition shall not be considered as an error. Any other value indicates the number of logical blocks that shall be verified. See section 6.2.4 for a description of the cache control bits (DPO). See section 6.2.5 for a description of the relative address bit (RelAdr) VERIFY Command Peripheral Device Type: Optical Memory and Write-Once Read-Multiple Operation Code Type: Optional VERIFY Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (AFh) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | DPO |Reserved| BlkVfy | BytChk | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Verification Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Control Byte | ============================================================================== The VERIFY command (Table __-__) requests that the target verify the data on the medium. See the Group 1 VERIFY command (section 15.1._) for a description of the fields in this command. A byte check (BytChk) bit of zero causes the verification to be simply a medium verification (CRC, ECC, etc.). A BytChk bit of one causes a byte-by- byte compare of the data on the medium and the data transferred from the initiator. The data shall be transferred as it would be for a WRITE command. If the compare is unsuccessful, the command shall be terminated with a CHECK CONDITION status and the sense key shall be set to MISCOMPARE. A blank verify (BlkVfy) bit of one causes a verification that the blocks are blank. The logical block address specifies the logical block at which the verify operation shall begin. The verification length specifies the number of contiguous logical blocks of data or blanks that shall be verified. A verification length of zero indicates that no logical blocks shall be verified. This condition shall not be considered as an error. Any other value indicates the number of logical blocks that shall be verified. See section 6.2.4 for a description of the cache control bits (DPO). See section 6.2.5 for a description of the relative address bit (RelAdr) [group 0 WRITE is deleted as redundant. I am leaving group 1 WRITE because the EBP bit is defined there...ed.] WRITE Command Peripheral Device Type: Optical Memory Operation Code Type: Optional WRITE Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (2Ah) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | DPO | FUA | EBP |Reserved| RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | (MSB) | -----|--- Transfer Length | 8 | (LSB) | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The WRITE command (Table __-__) requests that the target write the data transferred from the initiator to the medium. A Write Same (WRTSME) bit of zero causes the command to be done as a normal WRITE. A WRTSME bit of one causes a Write Same capability to occur. Only one logical block of data shall be sent during the Data Out Phase, regardless of the transfer length. The transfer length specifies the number of contiguous logical blocks to be written. All logical blocks written shall be written with the same data as the first logical block. A transfer length of zero shall be handled different when the WRTSME bit is one. A transfer length of zero shall represent that the data be continuously written from the logical block address specified in the command block until the last logical block addressable. An Erase By-Pass (EBP) bit of zero indicates that the device will default to the normal write operation. An EBP bit of one indicates that the target is allowed to by-pass the erase operation prior to writing the data. [This bit now replaces the Write Same bit; that function seems less useful on optical media (or any media that does not rewrite easily). Proposals will be made concerning where the Write Same bit may be moved to...ed.] The logical block address specifies the logical block at which the write operation shall begin. The transfer length specifies the number of contiguous logical blocks of data that shall be transferred. A transfer length of zero indicates that no data shall be transferred. This condition shall not be considered as an error and no data shall be written. Any other value indicates the number of logical blocks that shall be transferred. See section 6.2.4 for a description of the cache control bits (DPO and FUA). See section 6.2.5 for a description of the relative address bit (RelAdr). This command shall be terminated with a status of RESERVATION CONFLICT if any reservation access conflict (see 8.1.8) exists and no data shall be written. If any of the following conditions occur, this command shall be terminated with a CHECK CONDITION status and, if extended sense is implemented, the sense key shall be set as indicated in the following table. This table does not provide an exhaustive enumeration of all conditions that may cause the CHECK CONDITION status. Condition Sense Key ---------------------------------------------- ---------------------------- Invalid logical block address ILLEGAL REQUEST (see note 1) Target reset or medium change since the last command from this initiator UNIT ATTENTION Overrun or other error that might be resolved by repeating the command ABORTED COMMAND Attempt to write a previously written block and blank checking is enabled (see __._._) BLANK CHECK (see note 2) Attempt to write on read only medium or DATA PROTECT attempt to write on write protected medium. NOTES: (1) The extended sense information bytes shall be set to the logical block address of the first invalid address. (2) The extended sense information bytes shall be set to the logical block address of the first non-blank block encountered. WRITE Command Peripheral Device Type: Optical Memory Operation Code Type: Mandatory WRITE Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (AAh) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | DPO | FUA | EBP |Reserved| RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Transfer Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Control Byte | ============================================================================== The WRITE command (Table __-__) requests that the target write the data transferred from the initiator to the medium. See the Group 1 WRITE command (Section 15.1._) for a description of the fields in this command. For Write- Once Read-Multiple devices, the EBP bit is reserved. A Write Same (WRTSME) bit of zero causes the command to be done as a normal WRITE. A WRTSME bit of one causes a Write Same capability to occur. Only one logical block of data shall be sent during the Data Out Phase, regardless of the transfer length. The transfer length specifies the number of contiguous logical blocks to be written. All logical blocks written shall be written with the same data as the first logical block. A transfer length of zero shall be handled different when the WRTSME bit is one. A transfer length of zero shall represent that the data be continuously written from the logical block address specified in the command block until the last logical block addressable. An Erase By-Pass (EBP) bit of zero indicates that the device will default to the normal write operation. An EBP bit of one indicates that the target is allowed to by-pass the erase operation prior to writing the data. [This bit does not have a location in the command descriptor block]. The logical block address specifies the logical block at which the write operation shall begin. The transfer length specifies the number of contiguous logical blocks of data that shall be transferred. A transfer length of zero indicates that no data shall be transferred. This condition shall not be considered as an error and no data shall be written. Any other value indicates the number of logical blocks that shall be transferred. See section 6.2.4 for a description of the cache control bits (DPO and FUA). See section 6.2.5 for a description of the relative address bit (RelAdr). This command shall be terminated with a status of RESERVATION CONFLICT if any reservation access conflict (see 8.1.8) exists and no data shall be written. If any of the following conditions occur, this command shall be terminated with a CHECK CONDITION status and, if extended sense is implemented, the sense key shall be set as indicated in the following table. This table does not provide an exhaustive enumeration of all conditions that may cause the CHECK CONDITION status. Condition Sense Key ---------------------------------------------- ---------------------------- Invalid logical block address ILLEGAL REQUEST (see note 1) Target reset or medium change since the last command from this initiator UNIT ATTENTION Overrun or other error that might be resolved by repeating the command ABORTED COMMAND Attempt to write a previously written block and blank checking is enabled (see __._._) BLANK CHECK (see note 2) Attempt to write on read only medium or DATA PROTECT attempt to write on write protected medium. NOTES: (1) The extended sense information bytes shall be set to the logical block address of the first invalid address. (2) The extended sense information bytes shall be set to the logical block address of the first non-blank block encountered. WRITE AND VERIFY Command Peripheral Device Type: Optical Memory Operation Code Type: Optional WRITE AND VERIFY Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (2Eh) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | DPO |Reserved| EBP | BytChk | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | (MSB) | -----|--- Transfer Length | 8 | (LSB) | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The WRITE AND VERIFY command (Table __-__) requests that the target write the data transferred from the initiator to the medium and then verify that the data is correctly written. A Write Same (WRTSME) bit of zero causes the command to be done as a normal WRITE. A WRTSME bit of one causes a Write Same capability to occur. Only one logical block of data shall be sent during the Data Out Phase, regardless of the transfer length. The transfer length specifies the number of contiguous logical blocks to be written. All logical blocks written shall be written with the same data as the first logical block. A transfer length of zero shall be handled different when the WRTSME bit is one. A transfer length of zero shall represent that the data be continuously written from the logical block address specified in the command block until the last logical block addressable. If the MODE SELECT command is implemented, and the Verify Error Recovery Parameters page is also implemented, then the current settings in that page define the verification criteria. If the Verify Error Recovery Parameters page is not implemented, then the verification criteria is vendor unique. A byte check (BytChk) bit of zero causes the verification to be simply a medium verification (CRC, ECC, etc.). a medium verification to be performed with no data comparison. A BytChk bit of one causes a byte-by-byte compare of the data written on the medium and the data transferred from the initiator. The data shall be transferred as it would be for a WRITE command. If the compare is unsuccessful, the command shall be terminated with a CHECK CONDITION status and the sense key shall be set to MISCOMPARE. for any reason, the target shall return CHECK CONDITION status and the sense key shall be set to MISCOMPARE. An Erase By-Pass (EBP) bit of zero indicates that the device will default to the normal write operation. An EBP bit of one indicates that the target is allowed to by-pass the erase operation prior to writing the data. The logical block address specifies the logical block at which the write operation shall begin. The transfer length specifies the number of contiguous logical blocks of data that shall be transferred. A transfer length of zero indicates that no logical blocks shall be transferred. This condition shall not be considered as an error and no data shall be written. Any other value indicates the number of logical blocks that shall be transferred. See section 6.2.4 for a description of the cache control bit (DPO). See section 6.2.5 for a description of the relative address bit (RelAdr). WRITE AND VERIFY Command Peripheral Device Type: Optical Memory Operation Code Type: Optional WRITE AND VERIFY Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (AEh) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | DPO |Reserved| EBP | BytChk | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Transfer Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Control Byte | ============================================================================== The WRITE AND VERIFY command (Table __-__) requests that the target write the data transferred from the initiator to the medium and then verify that the data is correctly written. See the Group 1 WRITE AND VERIFY command (Section 15.1._) for a description of the bits in this command. For Write-Once Read-Multiple devices, the EBP bit is zero. A Write Same (WRTSME) bit of zero causes the command to be done as a normal WRITE. A WRTSME bit of one causes a Write Same capability to occur. Only one logical block of data shall be sent during the Data Out Phase, regardless of the transfer length. The transfer length specifies the number of contiguous logical blocks to be written. All logical blocks written shall be written with the same data as the first logical block. A transfer length of zero shall be handled different when the WRTSME bit is one. A transfer length of zero shall represent that the data be continuously written from the logical block address specified in the command block until the last logical block addressable. A byte check (BytChk) bit of zero causes the verification to be simply a medium verification (CRC, ECC, etc.). A BytChk bit of one causes a byte-by- byte compare of data written to the peripheral device and the data transferred from the initiator. If the compare is unsuccessful, the command shall be terminated with a CHECK CONDITION status and the sense key shall be set to MISCOMPARE. An Erase By-Pass (EBP) bit of zero indicates that the device will default to the normal write operation. An EBP bit of one indicates that the target is allowed to by-pass the erase operation prior to writing the data. [This bit does not have a location in the command descriptor block]. The logical block address specifies the logical block at which the write operation shall begin. The transfer length specifies the number of contiguous logical blocks of data that shall be transferred. A transfer length of zero indicates that no logical blocks shall be transferred. This condition shall not be considered as an error and no data shall be written. Any other value indicates the number of logical blocks that shall be transferred. See section 6.2.4 for a description of the cache control bit (DPO). See section 6.2.5 for a description of the relative address bit (RelAdr). [this is a new addition from here to the end...ed.] Additional Sense Codes for Optical Memory Devices The following matrix defines the sense key, additional sense code (byte 12 of extended sense and additional sense code qualifier (byte 13 of extended sense) for the types of errors and exception conditions described in the Description column. It is recommended that these values be returned for error and exception conditions which relate to the description. The relationship between the three fields is hierarchical; where the sense key is the most general error and exception condition value and the additional sense code qualifier is the most specific value related to an error or exception condition. [The matrix is not 100% correct. Needs review for accuracy. Needs to be coordinated with other device types (e.g. disks)] [ljl - I have some concerns on the presenation of this table in the body of the document. Multi- page tables are difficult to deal with editorially. Also maintenance of tables like this is very time consuming. Abbreviating command names is not acceptable technical writing practice. Also putting this in the body of the document implies it is required for compliance. This sort of thing is a great reference tool, but we need a better way to document it within SCSI-2.] The (*) indicates for which optical memory commands the values of sense key, additional sense code and additional sense code qualifier are defined. [I have made no effort to add anything optical to this table (which came from document X3T9.2/87-158). Frankly, I have no idea how I will fit all of the extra opcodes in here for the new functions and group 5 stuff. The spaced out columns in section 9 are much easier to read; this is a mess... so much for editorial comment, but I am an editor, after all...ed.] |CCCFFILMM|PPRRRRRRRR|RRRRRSSSSS|SSSTVWWWWW --+-----+-------------------------|OOPMLN/DD|R/EEDDDDEE|EEQEECCCEE|NE/UERRRRR S | | |MPYTCQUSS|FAAABCDLAB|CLSSZHHHEE|DTSRRIT&BT eK| | |PY& CEN|CMDDUADODL|DSNVRDDDKK|DLU TXVUL ne| | | V LS|HR XFP GLK|RES OEHL X|GM E F sy|BYTES| Error Code |313031311|3102323130|1101033302|1310202233 e |12|13| Description |88945265A|4E88B57FE7|C7361102BB|D3B0FAAEAF ============================================================================== 0|00|00|NO SENSE |*********|**********|**********|********** ============================================================================== 1|00|00|RECOVERED ERROR | *** **| ***** **| ******| * ***** |--+--+-------------------------+---------+----------+----------+----------- |03|00|Write fault | *** * | *|* |* *** * |08|00|Logical Unit communi- |**** **|**** *****|**********|* ****** * | | | cation failure | | | | |09|00|Track following error |* * | ** *****|* ******| **** * |10|00|ID CRC or ECC error |* | ** *****|* *** | **** * |--+--+-------------------------+---------+----------+----------+----------- |12|00|No address mark found |* | ** *****|* *** | **** * | | | in ID field | | | | |13|00|No address mark found |* | ** *****|* *** | **** * | | | in data field | | | | |14|00|No record found |* | ** *****|* *** | **** * |15|00|Seek positioning error |* * | ** *****|* ******| **** * |--+--+-------------------------+---------+----------+----------+----------- |17|00|Recovered read data with | *| ** *** |* | | | | read retries | | | | |18|00|Recovered read data with | *| ** *** |* | | | | ECC procedure | | | | |19|00|Defect list error | * | * *| | |1E|00|Recovered ID with ECC |* | ** *****|* *** | **** * |--+--+-------------------------+---------+----------+----------+----------- |44|00|Target internal parity/ |*********|**********|**********|********** | | | hardware error | | | | |37|00|Rounded parameter | * | | | |3D|00|Defect list not available| * | * | | ============================================================================== 2|00|00|NOT READY | | | | |--+--+-------------------------+---------+----------+----------+----------- |04|00|Drive not ready (offline)|**** **|* ** *****|** *******|** ***** * |05|00|Drive not selected |**** **|* ** *****|** *******|** ***** * |3E|00|Logical Unit hasn't self-|*********|**********|**********|********** | | | configured yet | | | | ============================================================================== 3|00|00|MEDIUM ERROR | | | | |--+--+-------------------------+---------+----------+----------+----------- |10|00|ID CRC or ECC error |**** **|* ** *****| *** |* **** * |11|00|Unrecovered read error |**** |* ** *****| *** |* * |12|00|No address mark found |**** **|* ** *****| *** |* **** * | | | in ID field | | | | |13|00|No address mark found |**** **|* ** *****| *** |* **** * | | | in data field | | | | |--+--+-------------------------+---------+----------+----------+----------- |CCCFFILMM|PPRRRRRRRR|RRRRRSSSSS|SSSTVWWWWW --+-----+-------------------------|OOPMLN/DD|R/EEDDDDEE|EEQEECCCEE|NE/UERRRRR S | | |MPYTCQUSS|FAAABCDLAB|CLSSZHHHEE|DTSRRIT&BT eK| | |PY& CEN|CMDDUADODL|DSNVRDDDKK|DLU TXVUL ne| | | V LS|HR XFP GLK|RES OEHL X|GM E F sy|BYTES| Error Code |313031311|3102323130|1101033302|1310202233 e |12|13| Description |88945265A|4E88B57FE7|C7361102BB|D3B0FAAEAF ============================================================================== 3|14|00|No record found |**** **|* ** *****| *** |* **** * |15|00|Seek positioning error |**** **|* ** *****| ******|* **** * |16|00|Data Synchronization |**** **|* ** *****| *** |* **** * | | | mark error | | | | |19|00|Defect list error | * | * *| | |--+--+-------------------------+---------+----------+----------+----------- |1C|00|Primary defect list | * | * | | | | | not found | | | | |30|00|Incompatible cartridge |**** **|* ** *****| ******|* **** * |31|00|Medium format corrupted |**** **|* ** *****| ******|* **** * |32|00|No defect spare location | * | ** *| |* *** | | | available | | | | |3D|00|Defect list not available| * | * | | ============================================================================== 4|00|00|HARDWARE ERROR | | | | |--+--+-------------------------+---------+----------+----------+----------- |01|00|No index/sector signal |**** **|* ** *****| ******|* ***** * |02|00|No seek complete |**** **|* ** *****| ******|* **** * |03|00|Write fault | *** * | *| |* *** * |06|00|No track zero found | | | * |* |07|00|Multiple drives selected |**** **|* ** *****| ******|* ***** * |08|00|Logical Unit communi- |**** **|**** *****|**********|* ****** * | | | cation failure | | | | |--+--+-------------------------+---------+----------+----------+----------- |09|00|Track following error |**** **|* ** *****| ******|* **** * |10|00|ID CRC or ECC error |**** **|* ** *****| ******|* **** * |15|00|Seek positioning error |**** **|* ** *****| ******|* **** * |1B|00|Synchronous transfer eror| ** * **| ********|* * *** |* ****** |3E|00|Logical Unit failed self-|*********|**********|**********|********** | | | configuration | | | | |40|00|RAM failure |*********|**********|**********|********** |41|00|Data path diagnostic | | | |* | | | failure | | | | |--+--+-------------------------+---------+----------+----------+----------- |42|00|Power on failure |***** ***|**********|** *******|********** |44|00|Target internal parity/ |*********|**********|**********|********** | | | hardware failure | | | | |45|00|Select/reselect failure |*********|**********|**********|********** |46|00|Unsuccessful soft reset |*********|**********|**********|********** |47|00|Interface parity error |*********|**********|**********|********** ============================================================================== |CCCFFILMM|PPRRRRRRRR|RRRRRSSSSS|SSSTVWWWWW --+-----+-------------------------|OOPMLN/DD|R/EEDDDDEE|EEQEECCCEE|NE/UERRRRR S | | |MPYTCQUSS|FAAABCDLAB|CLSSZHHHEE|DTSRRIT&BT eK| | |PY& CEN|CMDDUADODL|DSNVRDDDKK|DLU TXVUL ne| | | V LS|HR XFP GLK|RES OEHL X|GM E F sy|BYTES| Error Code |313031311|3102323130|1101033302|1310202233 e |12|13| Description |88945265A|4E88B57FE7|C7361102BB|D3B0FAAEAF ============================================================================== 5|00|00|ILLEGAL REQUEST | | | | |--+--+-------------------------+---------+----------+----------+----------- |1A|00|Parameter overrun | | | | |20|00|Invalid command op code |*********|**********|**********|********** |21|00|Logical Block Address |* | **** * | * *****| * ****** | | | out of range | | | | |22|00|Illegal function for | ** | | | | | | device type | | | | |--+--+-------------------------+---------+----------+----------+----------- |24|00|Illegal field in CDB |*********|**********|**********|********** |25|00|Invalid LUN |***** ***|**********|**********|********** |26|00|Invalid field in | *** * | *| *** |* * | | | parameter list | | | | |2B|00|Copy cannot execute since| ** | | | | | | host can't disconnect | | | | |2C|00|Command sequence error | | | | | | | (from section 9) | | | | ============================================================================== 6|00|00|UNIT ATTENTION | | | | |--+--+-------------------------+---------+----------+----------+----------- |28|00|Not ready to ready tran- |***** ***|**********|**********|********** | | | sition (Medium changed)| | | | |29|00|Power on, reset, or BUS |***** ***|**********|**********|********** | | | DEVICE RESET msg occured| | | | |2A|00|Mode Select parameters |***** ***|**********|**********|********** | | changed by other initiator| | | | |3F|00|Microcode has been |***** ***|**********|**********|********** | | | reloaded | | | | ============================================================================== 7|00|00|DATA PROTECT | | | | |--+--+-------------------------+---------+----------+----------+----------- |27|00|Write protected | * * | *| |* *** * ============================================================================== 8|00|00|BLANK CHECK | | | | |--+--+-------------------------+---------+----------+----------+----------- | |00| | | | | ============================================================================== |CCCFFILMM|PPRRRRRRRR|RRRRRSSSSS|SSSTVWWWWW --+-----+-------------------------|OOPMLN/DD|R/EEDDDDEE|EEQEECCCEE|NE/UERRRRR S | | |MPYTCQUSS|FAAABCDLAB|CLSSZHHHEE|DTSRRIT&BT eK| | |PY& CEN|CMDDUADODL|DSNVRDDDKK|DLU TXVUL ne| | | V LS|HR XFP GLK|RES OEHL X|GM E F sy|BYTES| Error Code |313031311|3102323130|1101033302|1310202233 e |12|13| Description |88945265A|4E88B57FE7|C7361102BB|D3B0FAAEAF ============================================================================== A|00|00|COPY ABORTED | | | | |--+--+-------------------------+---------+----------+----------+----------- |60|00|Status error from 2nd | ** | | | | | | party during COPY | | | | ============================================================================== B|00|00|ABORTED COMMAND | | | | |--+--+-------------------------+---------+----------+----------+----------- |43|00|Message retry failure |*********|**********|**********|********** |47|00|Interface parity error |*********|**********|**********|********** |48|00|INITIATOR DETECTED ERROR |*********|**********|**********|********** | | |recvd but can't retry cmd| | | | |49|00|Message out error |*********|**********|**********|********** |4B|00|Data error (from sect. 9)| | | | ============================================================================== C|00|00|EQUAL | | | | |--+--+-------------------------+---------+----------+----------+----------- | |00| | | | | ============================================================================== E|00|00|MISCOMPARE | | | | |--+--+-------------------------+---------+----------+----------+----------- |1D|00|Miscompare during Verify | * | | | * * ============================================================================== [optional header, arranged in op code order] |TRRFRRWSI|MRRCMSRSPR|RRWSWVSSSS|PFLRCCWRRW --+-----+-------------------------|UEQMEEREN|DEEOD/EN/D|DERERECCCE|RL/DOPRDER S | | |RZSTBAIEQ|SSLPSSCDAL|CATE&RHHHT|FCUDMYBBAT eK| | | RN LDTK |ERSYNUDDMO|ADXKV DDDL|C CDP&UUDL ne| | | OS K E |LVE S RGRG|PX X HELM|H VFFL sy|BYTES| Error Code |000000001|1111111111|2222223333|3333333333 e |12|13| Description |013478AB2|5678ABCDEF|58ABEF0123|456789ABEF ==============================================================================