Group 5 Commands for Optical Memory Devices. The Group 5 commands for optical memory devices shall be as shown in Table 15-_. Group 5 Commands for Optical Memory Devices ============================================================================== Operation Code Type Command Name Section ------------------------------------------------------------------------------ A0h R A1h R A2h R A3h R A4h R A5h R A6h R A7h R A8h M READ 15._._ A9h R AAh M WRITE 15._._ ABh R ACh O ERASE 15._._ ADh O READ 15._._ AEh O WRITE AND VERIFY 15._._ AFh M VERIFY 15._._ B0h O SEARCH DATA HIGH 15._._._ B1h O SEARCH DATA EQUAL 15._._._ B2h O SEARCH DATA LOW 15._._._ B3h O SET LIMITS 15._._ B4h O PRE-FETCH 15._._ B5h O FLUSH CACHE 15._._ B6h O LOCK/UNLOCK CACHE 15._._ B7h O READ DEFECT DATA 15._._ B8h O MEDIA SCAN 15._._ B9h O BAh R BBh R BCh R BDh O UPDATE BLOCKS 15._._ BEh O READ LONG 15._._ BFh O WRITE LONG 15._._ =============================================================================== Key: M = Command implementation is mandatory. O = Command implementation is optional. R = Operation code is reserved for future standardization. READ Command Peripheral Device Type: Optical Memory Devices Operation Code Type: Mandatory READ Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (A8h) | -----|-----------------------------------------------------------------------| 1 | Reserved | DPO | FUA | Reserved | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Transfer Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The READ command (Table __-_) requests that the target transfer data to the initiator from the medium. 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). 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. 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. WRITE Command Peripheral Device Type: Optical Memory Devices Operation Code Type: Mandatory WRITE Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (AAh) | -----|-----------------------------------------------------------------------| 1 | Reserved | 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 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The WRITE command (Table __-__) requests that the target write the data transferred from the initiator to the medium. See section 6.2.4 for a description of the cache control bits (DPO and FUA). The Erase By-Pass (EBP) bit set to zero indicates that the device will default to the normal write operation ("normal" as defined by the vendor specification). For a two pass write operation, an erase pass will be performed before the write data operation on the second pass. This bit set to a one indicates that the target may by-pass the erase operation, if required, before writing. See section 6.2.5 for a description of the relative address bit (RelAdr). 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. 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. ERASE Command Peripheral Device Type: Optical Memory Devices Operation Code Type: Mandatory ERASE Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (ACh) | -----|-----------------------------------------------------------------------| 1 | Reserved | ERA |Reserved| RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Number of Blocks to Erase ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The ERASE command (Table 15-__) requests that the target erase the data on the medium specified by the initiator. The use of erase means that the medium shall be erased in preparation for writing, or a pattern shall be written on the medium that will appear to the target as no data present (deleted), or the target will detect the area as blank medium. The ERase All (ERA) bit equal to one indicates that all remaining blocks of the medium will be erased. If this bit is a one then the Number of Blocks to Erase must be equal to zero. The Logical Block Address specifies the logical block at which the erase operation shall begin. The Number of Blocks to Erase specifies the number of contiguous logical blocks that shall be erased. The Number of Blocks to Erase is valid if the ERA bit is equal to zero. A Number of Blocks to Erase of zero with an ERA equal to zero indicates that no blocks of data will be erased. 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. If the Erase command is sent to an any portion of the medium that is defined as non-erasable or write protected, the command will be terminated with a CHECK CONDITION status and no data shall be erased. If any reservation access conflict exists, this command shall be terminated with RESERVATION CONFLICT status and no data shall be erased. NOTE: This command allows the user some flexibility for increasing thru-put during a write operation when used in conjunction with a WRITE command with the EBP bit. WRITE AND VERIFY Command Peripheral Device Type: Optical Memory Devices Operation Code Type: Optional WRITE AND VERIFY Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (AEh) | -----|-----------------------------------------------------------------------| 1 | Reserved | 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 | Vendor Unique | Reserved | Flag | Link | ============================================================================== 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 section 6.2.4 for a description of the cache control bits (DPO and FUA). The Erase By-Pass (EBP) bit set to zero indicates that the device will default to the normal write operation ("normal" as defined by the vendor specification). For a two pass write operation, an erase pass will be performed before the write data operation on the second pass. This bit set to a one indicates that the target may by-pass the erase operation, if required, before writing. 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. See section 6.2.5 for a description of the relative address bit (RelAdr). 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. VERIFY Command Peripheral Device Type: Optical Memory Devices Operation Code Type: Optional VERIFY Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (AFh) | -----|-----------------------------------------------------------------------| 1 | Reserved | DPO | FUA | BlkVfy | BytChk | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Verification Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The VERIFY command (Table __-__) requests that the target verify the data on the medium. See section 6.2.4 for a description of the cache control bits (DPO and FUA). A blank verify (BlkVfy) bit of one causes a verification that the blocks are blank. 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. See section 6.2.5 for a description of the relative address bit (RelAdr). 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. SEARCH DATA Commands Peripheral Device Type: Write-Once Read-Multiple, Read-Only Direct Access, and Optical Memory Devices Operation Code Type: Optional SEARCH DATA Commands [Do we really need to repeat this entire command description? Also, this text needs work -- it is all terminated with hard carriage returns???] ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (B0h B1h B2h) | -----|-----------------------------------------------------------------------| 1 | Reserved | Invert | Reserved | SpnDat | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Transfer Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The SEARCH DATA commands (Table 15-__) search one or more logical blocks for equality or inequality to a data pattern. The concept of records within a logical block is used to allow multiple records within a logical block to be searched. The invert bit determines whether the search condition is to be inverted. See 15._._._ through 15._._._ for a description of the search conditions for the individual SEARCH DATA commands. A spanned data (SpnDat) bit of zero indicates that each record shall be wholly contained within a single block. Any space at the end of a block that is smaller than the record length is ignored by the SEARCH DATA commands. A SpnDat bit of one indicates that records span block boundaries. Thus, a record may start in one block and end in the next or a subsequent block. A transfer length of zero indicates that no data shall be searched. This condition shall be treated the same as an unsatisfied search. A link bit of zero indicates a nonlinked command and if the search is satisfied, the command shall be terminated with a CONDITION MET status. A REQUEST SENSE command can then be issued to determine the logical block address and record offset of the matching record. If the search 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 SEARCH DATA 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 search 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 SEARCH DATA command shall: (1) Return a sense key of EQUAL if the search was satisfied by an exact match. If the search was satisfied by an inequality then a sense key of NO SENSE shall be returned. (2) Return the valid bit set to one. (3) Return the logical block address of the logical block containing the first matching record in the information bytes. (4) Return the record offset of the matching record in the first four bytes of additional sense bytes. A REQUEST SENSE command following an unsatisfied SEARCH DATA 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. The SEARCH DATA parameter list (Table 15-__) contains a fourteen-byte header, followed by one or more search argument descriptors. Table 15-__: SEARCH DATA Parameter List ============================================================================== Byte | Parameter List Header | ============================================================================== 0 | (MSB) | - - -|- - Logical Record Length - -| 3 | (LSB) | -----|-----------------------------------------------------------------------| 4 | (MSB) | - - -|- - First Record Offset - -| 7 | (LSB) | -----|-----------------------------------------------------------------------| 8 | (MSB) | - - -|- - Number of Records - -| 11 | (LSB) | -----|-----------------------------------------------------------------------| 12 | (MSB) | -----|--- Search Argument Length ---| 13 | (LSB) | ============================================================================== | Search Argument Descriptor(s) | ============================================================================== 0 | (MSB) | - - -|- - Displacement - -| 3 | (LSB) | -----|-----------------------------------------------------------------------| 4 | (MSB) | -----|--- Pattern Length ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 - n| Pattern | ============================================================================== The logical record length field specifies the record length in bytes. The first record offset field specifies the number of bytes that shall be ignored in the first logical block before the search begins. The value in the first record offset field shall not exceed the length of the logical block. Subsequent logical blocks shall be searched beginning with the first byte in the logical block. This permits one or more records to be skipped initially. The number of records field specifies the maximum number of records that shall be searched by this command. An unsatisfied search shall terminate when the number of records or the number of blocks (from the command descriptor block) have been exhausted. The search argument length specifies the length in bytes of all the search argument descriptors that follow. Since the pattern length can vary, there is no fixed multiple of the search argument descriptor to determine the search argument length. The search argument descriptors specify one or more search conditions to execute within a single record in order to satisfy the search. Each search argument descriptor is made up of a displacement, a pattern length, and a pattern. The displacement field specifies the displacement in bytes of the first byte of the data to be compared from the start of the logical record. The pattern length field specifies the length in bytes of the pattern that follows. The pattern specifies the data to compare to the logical record. SEARCH DATA HIGH Command The SEARCH DATA HIGH command (Table 15-__, operation code B0h) shall be satisfied by the first logical record searched that contains data that satisfies all of the search argument descriptor(s). If the invert bit in the command descriptor block is zero, the search argument descriptor(s) shall be satisfied by data in the logical record being greater than the data in the pattern. If the invert bit is one, the search argument descriptor(s) shall be satisfied by data in the logical record being less than or equal to the data in the pattern. (See 8.2.7.) SEARCH DATA EQUAL Command The SEARCH DATA EQUAL command (Table 15-__, operation code B1h) shall be satisfied by the first logical record searched that contains data that satisfies all of the search argument descriptor(s). If the invert bit in the command descriptor block is zero, the search argument descriptor(s) shall be satisfied by data in the logical record being equal to the data in the pattern. If the invert bit is one, the search argument descriptor(s) shall be satisfied by data in the logical record being not equal to the data in the pattern. (See 8.2.7.) SEARCH DATA LOW Command The SEARCH DATA LOW command (Table 15-__, operation code B2h) shall be satisfied by the first logical record searched that contains data that satisfies all of the search argument descriptor(s). If the invert bit in the command descriptor block is zero, the search argument descriptor(s) shall be satisfied by data in the logical record being less than the data in the pattern. If the invert bit is one, the search argument descriptor(s) shall be satisfied by data in the logical record being greater than or equal to the data in the pattern. (See 8.2.7.) SET LIMITS Command Peripheral Device Type: Write-Once Read-Multiple, Read-Only Direct Access, and Optical Memory Devices Operation Code Type: Optional SET LIMITS Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (B3h) | -----|-----------------------------------------------------------------------| 1 | Reserved | RdInh | WrInh | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Number of Blocks ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The SET LIMITS command (Table 15-__) defines the range within which subsequent linked commands may operate. A second SET LIMITS command may not be linked to a chain of commands in which a SET LIMITS command has already been issued. A read inhibit (RdInh) bit of one indicates that read operations within the range are inhibited. A write inhibit (WrInh) bit of one indicates that write operations within the range are inhibited. The logical block address specifies the starting address for the range. The number of blocks specifies the number of logical blocks within the range. A number of blocks of zero indicates that the range shall extend to the last logical block on the logical unit. Any attempt to access outside of the restricted range or any attempt to perform an inhibited operation within the restricted range shall not be performed. The command shall be terminated with CHECK CONDITION status and, if extended sense is implemented, the sense key shall be set to DATA PROTECT. A second SET LIMITS command within a linked list of commands shall be rejected with CHECK CONDITION status and, if extended sense is implemented, the sense key shall be set to DATA PROTECT. PRE-FETCH Command Peripheral Device Type: Optical Memory Devices Operation Code Type: Optional PRE-FETCH Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (B4h) | -----|-----------------------------------------------------------------------| 1 | Reserved | Immed | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Transfer Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The PRE-FETCH command (Table 15-__) requests the target to transfer the specified logical blocks to the cache memory. No data shall be transferred to the initiator. The logical block address specifies the logical block at which the pre-fetch operation shall begin. The transfer length specifies the number of contiguous logical blocks of data that shall be transferred to the cache memory. A transfer length of zero indicates that all remaining 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. The target may elect to not transfer logical blocks that already are contained in the cache memory. An immediate (Immed) bit of one indicates that status shall be returned as soon as the operation is initiated. An immediate bit of zero indicates that status shall be returned after the operation is complete. CONDITION MET status shall indicate that all specified logical blocks were successfully transferred to the cache memory (or, if Immed is one, that the unlocked portion of the cache memory is sufficiently large to contain all of the specified logical blocks). GOOD status shall indicate that the unlocked portion of the cache memory is not sufficiently large to contain all of the specified logical blocks. In this case, the target shall transfer only the number of logical blocks that fit into the cache memory. FLUSH CACHE Command Peripheral Device Type: Optical Memory Devices Operation Code Type: Optional FLUSH CACHE Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (B5h) | -----|-----------------------------------------------------------------------| 1 | Reserved | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Number of Blocks ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The FLUSH CACHE command (Table 15-__) ensures that all logical blocks within the specified range have their most recent data value recorded on the physical medium. For each logical block within the specified range, if a more recent data value exists in the cache memory than on the physical medium, then the logical block from the cache memory shall be written to the physical medium. Logical blocks are not necessarily removed from the cache memory as a result of the flush operation. The logical block address specifies the first logical block of the range of logical blocks to be considered to be flushed. The number of blocks specifies the total number of contiguous logical blocks to be considered to be flushed. A number of blocks of zero indicates that all remaining logical blocks on the logical unit shall be considered. Any other value indicates the number of logical blocks that shall be considered. After attempting to flush all of the specified logical blocks, if any nonrecovered errors have occurred that have not been previously reported (possibly due to the FUA bit being zero), then the most recent nonrecovered error shall be reported. If all errors were recovered, then the most recent recovered error (if any) shall be reported. 15._.__. LOCK/UNLOCK CACHE Command Peripheral Device Type: Direct Access Operation Code Type: Optional Table 15-__: LOCK/UNLOCK CACHE Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (B6h) | -----|-----------------------------------------------------------------------| 1 | Reserved | Lock | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Number of Blocks ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The LOCK/UNLOCK CACHE command (Table 15-__) requests that the target disallow or allow logical blocks within the specified range to be removed from the cache memory by the target's cache replacement algorithm. Locked logical blocks may be written to the physical medium when modified, but a copy of the modified logical block shall remain in the cache memory. A lock bit of one indicates that any logical block in the specified range that is currently present in the cache memory shall be locked into cache memory. Only logical blocks that are already present in the cache memory are actually locked. A lock bit of zero indicates that all logical blocks in the specified range that are currently locked into the cache memory shall be unlocked, but not necessarily removed. The logical block address specifies the first logical block of the range of logical blocks to be locked or unlocked. The number of blocks specifies the total number of contiguous logical blocks to be considered for locking or unlocking. A number of blocks of zero indicates that all remaining logical blocks on the logical unit shall be considered. Any other value indicates the number of logical blocks that shall be considered. 15._.__. READ DEFECT DATA Command Peripheral Device Type: Direct Access Operation Code Type: Optional Table 15-__: READ DEFECT DATA Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (B7h) | -----|-----------------------------------------------------------------------| 1 | Reserved | -----|-----------------------------------------------------------------------| 2 | Reserved | P | G | Defect List Format | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | Reserved | -----|-----------------------------------------------------------------------| 5 | Reserved | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Allocation Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The READ DEFECT DATA command (Table 15-__) requests that the target transfer the medium defect data to the initiator. The meaning of bits 0 through 2 of byte 2 is similar to the bit definition of the bits 0 through 2 of the byte 1 of the FORMAT UNIT command. The initiator indicates with this field a preferred format for the defect list to be returned by the target. This Defect List Format field is intended for those targets capable of returning various formats. A target unable to return various formats may return its default format and create the CHECK CONDITION status with RECOVERED ERROR Sense Key at the end of the Read Defect Data data transfer. - The P bit set to one indicates that the initiator requests that the Primary list of defects be returned. The P bit of zero indicates that the target shall not return the Primary list of defects. - The G bit set to one indicates that the initiator requests that the Growing list of defects be returned. The target shall include the Certification list of defects, if implemented, to be returned with this selection. The G bit of zero indicates that the target shall not return the Growing list of defects. - With bits P and G both set to one, the target is requested to return the primary and the growing list of defects. The target shall determine the order in which the lists are to be returned and shall determine if the lists will be merged or not. - With bits P and G both set to zero, the Defect List Header is only to be returned. The Allocation Length specifies the number of bytes that the initiator has allocated for returned READ DEFECT DATA. An Allocation Length of zero indicates that no READ DEFECT DATA shall be transferred. Any other value indicates the maximum number of bytes that shall be transferred. The target shall terminate the DATA IN phase when the Allocation Length have been transferred or when all available READ DEFECT DATA have been transferred to the initiator, whichever is less. The READ DEFECT DATA contains a eight byte header, followed by zero or more defect descriptors. Table 15-__: DEFECT LIST HEADER ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved | -----|-----------------------------------------------------------------------| 1 | Reserved | P | G | Defect List Format | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | (MSB) | -----|--- ---| 5 | | -----|--- Defect List Length ---| 6 | | -----|--- ---| 7 | (LSB) | ============================================================================== The meanings of bits 0 through 2 of byte 1 are similar to the Defect List Format in Table 8-4 of the FORMAT UNIT command. The bits P, G and the Defect List Format indicate which defect list is actually returned by the target. The format of the defect descriptors, if the Defect list length is different than zero, are shown in Table 8-5, 8-6, 8-7 in the FORMAT UNIT command. The length of each defect descriptor may be four bytes or eight bytes depending upon the Defect List format code. The defect list length specifies the total length in bytes of the defect descriptors that follow. The Defect List Length is equal to four or eight times the number of defect descriptors. If the Allocation Length of the CDB is too small to transfer all of the defect descriptors, the Defect List Length shall not be adjusted to reflect the truncation. The target shall not create a CHECK CONDITION status. It is recommended that the initiator compares the Defect List Length to the Allocation Length to ensure that it did not receive a partial list due to a too small Allocation Length. The defect descriptors may or may not be sent in ascending order. The initiator may be informed about the exact number of defects by dividing the Defect List Length by the Defect Descriptor Length. MEDIA SCAN Command Peripheral Device Type: WORM, Optical Devices Operation Type Code: Optional Operation Code: Group 5, Op Code B8h ========================================================================= BIT | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | BYTE | | | | | | | | | ========================================================================= 0 | Operation Code (B8h) | --------|-----------------------|-------|-------|-------|-------|-------| | |Writtn |Assert |Revrs. |Part. | | 1 | Logical Unit Number |Block |Contig |Search |Result |RelAdr | | |Search | Data |Direct | OK | | --------|-----------------------|-------|-------|-------|-------|-------| 2 | (MSB) Beginning Logical Block Address | --------|--- ---| 3 | | --------|--- ---| 4 | | --------|--- ---| 5 | Beginning Logical Block Address (LSB) | --------|---------------------------------------------------------------| 6 | | --------|--- Reserved ---| 7 | | ________|___ ___| 8 | | ________|___ ___| 9 | | --------|---------------------------------------------------------------| 10 | Parameter List Length (0 or 8) | --------|---------------------------------------------------------------| 11 |Vendor Unique | Reserved | Flag | Link | ========================================================================= The Media Scan command will scan a defined range searching for a contiguous span of the media either empty or written. Results are posted in the Sense Data block. The area of the media to be scanned starts with the Beginning Logical Block Address and is Number of Blocks to Scan in length. The Command will terminate when this area has been scanned or when a suitable extent Number of Blocks to Verify in length has been located. A Number of Blocks to Scan of zero shall indicate that the scan shall continue to the end if the media, if necessary. A Number of Blocks to Verify of zero indicates that no scan shall take place. This shall not be considered an error condition. Number of Blocks to Scan and Number of Blocks to Verify are specified with an optional Parameter Block. If this block is omitted by a Parameter List Length setting of zero, the Number of Blocks to Scan shall default to zero (scan to end of media) and the Number of Blocks to Varify shall default to one. GOOD Completion Status will be returned if the scan completes without errors, but did not find the required extent. CONDITION MET Completion Status will be returned if the Number of Blocks to Verify extent has been located. A Written Block Search bit of zero indicates that the command is to search for and verify a series of empty blocks. (This is the default operation.) A one indicates that written blocks are to be searched for. An Assert Contiguous Data bit of zero specifies the default search algorithm. Logically, each block of the media shall be examined in turn. An Assert Contiguous Data bit of one directs the target to assume that all blocks being searched for (as specified by the Written Block Search bit, if any exist) form a contiguous extent extending to the limit of the area to be scanned. This is advisory to the target. Implementors Note: This definition is intended to allow any of a number of search algorithms of which the classic binary search is one example. Implementation of search algorithms beyond the default linear scan is optional. A Reverse Search Direction bit of zero selects scanning in the default forward direction scan. Upon success, a forward direction search shall return via the Sense Data Information Bytes the least address of an extent closest to the Beginning Logical Block Address of the type specified in the Written Block Search bit. A Reverse Search Direction bit of one selects a reverse direction search. Upon success, this shall return in the Sense Data Information Bytes the least address of an extent closest to the end of the area to be scanned Number of Blocks to Verify in length. The reverse direction search is an optional capability. Targets which do not support this option shall return a CHECK CONDITION and set an ILLEGAL REQUEST Sense Key if this bit is a one. A Partial Results OK bit of zero specifies that the scan shall continue after determining that a candidate extent did not meet the Number of Blocks to Verify criteria. A Partial Results OK bit of one specifies that the scan shall terminate as soon as one block meeting the criteria given by the Written Block Search bit specification is found. The number of consecutive blocks found (up to Number of Blocks to Verify) is returned as the first four Additional Sense Data bytes. The Sense Data Information Bytes shall have the least address of the consecutive extent found. If the length of the extent found is equal to Number of Blocks to Verify, CONDITION MET shall be returned. Otherwise, if the scan is completed without errors, GOOD completion status shall be returned. If no blocks meeting the Written Block Search bit specification are found, the Valid bit of the Sense Data block shall be zero. A Link bit of one indicates that a following command is linked to the Media Scan command. The linked command will be executed if the Media Scan terminated with CONDITION MET status. If this command has the Relative Address bit set, the Logical Block Address determined by the Media Scan command will be used as a base address to compute the linked commands effective address. Parameter Block ========================================================================== BIT | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | BYTE | | | | | | | | | ========================================================================== 0 | (MSB) Number of Blocks to Verify | ------------ ---| 1 | | ------------ ---| 2 | | ------------ ---| 3 | Number of Blocks to Verify (LSB) | -------------------------------------------------------------------------| 4 | (MSB) Number of Blocks to Scan | ------------ ---| 5 | | ------------ ---| 6 | | ------------ ---| 7 | Number of Blocks to Scan (LSB) | ========================================================================== UPDATE BLOCK Command Peripheral Device Type: WORM, Optical Devices Operation Type Code: Optional Operation Code: Group 5 Op Code BDh UPDATE BLOCK Command ========================================================================= BIT | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | BYTE | | | | | | | | | ========================================================================= 0 | Operation Code (BDh) | ------------------------------------------------------------------------| 1 | Logical Unit Number | Reserved |UserSp |RelAdr | --------|-----------------------|-----------------------|-------|-------| 2 | (MSB) Logical Block Address | --------|--- ---| 3 | | --------|--- ---| 4 | | --------|--- ---| 5 | Logical Block Address (LSB) | --------|---------------------------------------------------------------| 6 | (MSB) Replacement Block Address | --------|--- ---| 7 | | --------|--- ---| 8 | | --------|--- ---| 9 | Replacement Block Address (LSB) | --------|---------------------------------------------------------------| 10 | Transfer Length | --------|---------------------------------------------------------------| 11 | Vendor Unique | Reserved | Flag | Link | ========================================================================= The Update Block command logically replaces data on the media with new data. The Logical Block Address specifies the first block to be logically updated. The Transfer Length gives the number of consecutive blocks to be updated. A transfer length of zero results in no data transfer, but will not result in an error, and the media shall not be modified. Transfer lengths beyond one are optional. If the target does not support the requested Transfer Length, it shall respond with a CHECK CONDITION ending status and post an ILLEGAL REQUEST Sense Key without altering the media. A User Space (UserSp) bit of zero indicates that the User Address Space is not to be used to contain the replacement data for the updated blocks. The Update Blocks command shall be terminated with CHECK CONDITION and a Sense Key of MEDIA ERROR shall be posted if no more replacement sectors are available. A User Space bit of one indicates that User Address Space is to be used to contain the replacement data and that the Logical Block Address of the area is Replacement Block Address. The Replacement Block Address specifies the first address of an area of the User Address Space to be used to contain the replacement data for the overwritten blocks. Command termination with CHECK CONDITION status and a BLANK CHECK Sense Key results if the specified replacement area has non-blank blocks. [Check only if EBC set? If clear and non-blank then what??] Logical Block Addresses may be repeatedly updated. A Write command to a block previously updated shall post a BLANK CHECK Sense Key if EBC is set to one. If Enable Blank Check is set to one, the target shall ensure that only previously written blocks are updated. Command termination with CHECK CONDITION status and a BLANK CHECK Sense Key results from an Update command which addresses an updated sector. If Enable Blank Check is set to zero, the target may optionally restrict the update operation to previously written blocks. If this command is implemented by a target it shall also provide a means for the initiator to determine when replacement data is being transferred by a Read command via a RECOVERED ERROR Sense Key. This replacement announce function may be selected or suppressed with Mode Select. 15._.__. READ LONG Peripheral Device Type: Direct Access Operation Code Type: Optional Table 15-__: READ LONG Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (BEh) | -----|-----------------------------------------------------------------------| 1 | Reserved | Corrct | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Byte Transfer Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The READ LONG command (Table 15.__) requests that the target transfer data to the initiator. The data passed during the READ LONG command is implementation specific, but shall include the data bytes and the ECC bytes. Any other bytes that are correctable by ECC should be included too. For example, if the Sync ID is within the ECC area, it could be included also. It is not important for the ECC bytes to be at the end of the data bytes, however they should be in the same order as they are on the media. A corrected (CORRCT) bit of zero causes the logical block to be read without any correction made by the target. A Corrct bit of one causes the data to be corrected by ECC before transferring the data to the target. The logical block address specifies the logical block at which the read operation shall occur. The byte transfer length specifies the number of bytes of data that shall be transferred. A transfer length of zero indicates that no bytes shall be transferred. This condition shall not be considered as an error. Any other value indicates the number of bytes that shall be transferred. The most recent data value written in the addressed logical block shall be returned. If the incorrect amount of bytes are stated in the command block, this command shall be terminated with a CHECK CONDITION status. The correct amount of bytes can be determined from the information that is returned in the extended sense data bytes after issuing the Request Sense command. The Request Sense command shall result in the ILLEGAL FIELD IN CDB Condition with the ILLEGAL REQUEST Sense Key. The extended sense ILI bit shall be set. The extended sense information bytes contain the difference (residue) of the requested length minus the actual length in bytes. (Negative values are indicated by two's complement notation.) 15._.__. WRITE LONG Peripheral Device Type: Direct Access Operation Code Type: Optional Table 15-__: WRITE LONG Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (BFh) | -----|-----------------------------------------------------------------------| 1 | Reserved | EBP | | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Byte Transfer Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The WRITE LONG command (Table 15.__) requests that the target write the data transferred by the initiator to the medium. The data passed during the WRITE LONG command is implementation specific, but shall include the data bytes and the ECC bytes. Any other bytes that are correctable by ECC should be included too. For example, if the Sync ID is within the ECC area, it could be included also. The READ LONG command is usually issued before issuing a Write Long command. The WRITE LONG bytes passed should be in the same order and should be the same amount of bytes as the READ LONG command. The Erase By-Pass (EBP) bit set to zero indicates that the device will default to the normal write operation ("normal" as defined by the vendor specification). For a two pass write operation, an erase pass will be performed before the write data operation on the second pass. This bit set to a one indicates that the target may by-pass the erase operation, if required, before writing. The logical block address specifies the logical block at which the write operation shall begin. The byte 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. Any other value indicates the number of logical blocks that shall be transferred. If the incorrect amount of bytes are stated in the command block, this command shall be terminated with a CHECK CONDITION status. The correct amount of bytes can be determined from the information that is returned in the extended sense data bytes after issuing the Request Sense command. The Request Sense command shall result in the ILLEGAL FIELD IN CDB Condition with the ILLEGAL REQUEST Sense Key. The extended sense ILI bit shall be set. The extended sense information bytes contain the difference (residue) of the requested length minus the actual length in bytes. (Negative values are indicated by two's complement notation.)