To: X3T9.2 SCSI Committee From: Dan Davies Cipher Subj: Proposed changes and corrections to SCSI-2 Revision 8, Section 9 [Document X3T9.2/89-050 was initially submitted at the April plenary, identifying errors in section 9 that were overlooked during the crunch to complete the document in time for the mailing deadline. This revision includes condensed wording for the new SILI bit definition (suggested by Kurt Chan), a revised density code table (which replaces QIC600 with the QIC1350 density definition), and an updated error reporting table in section 9.1.8 (which now includes recovered read and write errors).] 9.1.8. Error Reporting If any of the following conditions occur during the execution of a command, the target shall return CHECK CONDITION status and shall set the sense key as indicated in the following table. The table does not provide an exhaustive enumeration of all conditions that may cause CHECK CONDITION status. Condition Sense Key ---------------------------------------------------- --------------- Attempt a WRITE, READ, READ REVERSE, VERIFY, or ILLEGAL REQUEST RECOVER BUFFERED DATA command with the fixed bit set to zero and variable block mode is not supported Attempt a WRITE, READ, READ REVERSE, VERIFY, or ILLEGAL REQUEST RECOVER BUFFERED DATA command with a fixed bit of zero and requested block length is not supported Attempt a WRITE, READ, READ REVERSE, VERIFY, or ILLEGAL REQUEST RECOVER BUFFERED DATA command with a fixed bit of zero one and MODE SENSE block length set to zero Attempt to execute an erase or write-type operation DATA PROTECT on write protected medium Recovered read error RECOVERED ERROR Recovered write error RECOVERED ERROR Unrecovered read error MEDIUM ERROR HARDWARE ERROR Unrecovered write error MEDIUM ERROR HARDWARE ERROR Deferred write error MEDIUM ERROR HARDWARE ERROR VOLUME OVERFLOW RECOVERED ERROR In the case of a read or write error, if the read-write error recovery page (9.3.3.4) is implemented, the current values specify the target error recovery criteria. If this page is not implemented, the error recovery is vendor specific. In the case of an unrecovered read error, if the fixed bit is one, the valid bit shall be set to one and the information field shall be set to the difference (residue) of the requested transfer length minus the actual number of blocks read (not including the unrecovered block). If the fixed bit is zero, the valid bit shall be set to one and the information field shall be set to the requested transfer length. Upon termination, the logical position shall be after the unrecovered block. A successful READ command with a fixed bit of one shall transfer the requested transfer length times the current block length in bytes to the initiator. A successful READ command with a fixed bit of zero shall transfer the requested transfer length in bytes to the initiator. Upon completion, the logical position shall be after the last block transferred (end-of-partition side). If the suppress incorrect length indicator (SILI) bit is one and the fixed bit is zero, the target shall: (1) report CHECK CONDITION for an incorrect length condition only if the overlength condition exists (see 9.4) and the block length field in the mode parameter block descriptor is nonzero (see 7.3.3). (2) not report CHECK CONDITION if the only error is the underlength condition (see 9.4), or if the only error is the overlength condition and the block length field of the mode parameters block descriptor is zero. If the suppress incorrect length indicator (SILI) bit is one and the fixed bit is zero, the target shall not report CHECK CONDITION when an incorrect length block is read if the only error is that the requested transfer length does not match the actual block length. The target shall report CHECK CONDITION status for the incorrect length condition if the length of the block exceeds the current value of the block length field (in the mode parameters block descriptor, see 7.3.3). If the current value of the block length field is zero, the target shall not return CHECK CONDITION status for any incorrect length condition. IMPLEMENTORS NOTE: Since the residue information normally provided in the information field of the sense data may not be available when the SILI bit is set, other methods for determining the actual block length should be used (e.g., length information could be included in the data block). If the SILI bit is one and the fixed bit is one, the target shall terminate the command with CHECK CONDITION status and the sense key shall be set to ILLEGAL REQUEST with an additional sense code of INVALID FIELD IN CDB. If the SILI bit is zero and an incorrect length block is read, CHECK CONDITION status shall be returned and the ILI and valid bits shall be set to one in the sense data. Upon termination, the logical position shall be after the incorrect length block (end-of-partition side). If the fixed bit is one, the information field shall be set to the difference (residue) of the requested transfer length minus the actual number of blocks read (not including the incorrect length block). If the fixed bit is zero, the information field shall be set to the difference (residue) of the requested transfer length minus the actual block length. Targets that do not support negative residues shall set the information field to zero if the overlength condition exists (see 9.4). actual block length is larger than the requested length. The execution of this command is similar to the READ command except that medium motion is in the reverse direction. All block(s), and the byte(s) within the block(s), are transferred in the reverse order. The order of bits within each byte shall not be changed. Upon completion of a READ REVERSE command, the logical position shall be before the last block transferred (beginning-of-partition side). Refer to the READ command (9.2.4) for a description of the fixed bit, the SILI bit, the transfer length field, and any associated error conditions. Filemarks, setmarks, incorrect length blocks, and unrecovered read errors are handled the same as in the READ command, except that upon termination the logical position shall be before the filemark, setmark, incorrect length block, or unrecovered block (beginning-of-partition side). If the logical unit encounters beginning-of-partition during a READ REVERSE command, CHECK CONDITION status shall be returned and the EOM and valid bits shall be set to one in the sense data. The sense key shall be set to NO SENSE or RECOVERED ERROR, as appropriate. If the fixed bit is one, the information field shall be set to the difference (residue) of the requested transfer length minus the actual number of blocks transferred. If the fixed bit is zero, the information field shall be set to the requested transfer length. 9.2.8. RECOVER BUFFERED DATA Command Peripheral Device Type: Sequential-Access Operation Code Type: Optional Table 9-11: RECOVER BUFFERED DATA Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (14h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | SILI | Fixed | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | Transfer Length | -----|--- ---| 4 | (LSB) | -----|-----------------------------------------------------------------------| 5 | Control Byte | ============================================================================== The RECOVER BUFFERED DATA command (Table 9-11) is used to recover data that has been transferred to the target's buffer but has not been successfully written to the medium. It is normally used to recover from error or exception conditions that make it impossible to write the buffered data to the medium. One or more RECOVER BUFFERED DATA commands may be required to recover all unwritten buffered data. If beginning-of-partition is encountered while spacing over blocks, filemarks, or setmarks in the reverse direction, the target shall return CHECK CONDITION status and shall set the sense key to NO SENSE. The EOM and valid bits shall be set to one, and set the information field set to the total number of blocks, filemarks, or setmarks not spaced over difference (residue) of (the requested count number of blocks, filemarks, or setmarks minus the actual number of blocks, filemarks, or setmarks spaced over). When spacing over sequential filemarks (or setmarks), the count field is interpreted as follows: (1) A positive value N shall cause forward movement to the first occurrence of N or more consecutive filemarks (or setmarks) being logically positioned after the Nth filemark (or setmark). (2) A zero value shall cause no change in the logical position. (3) A negative value -N (2's complement notation) shall cause reverse movement to the first occurrence of N or more consecutive filemarks (or setmarks) being logically positioned on the beginning-of-partition side of the Nth filemark (or setmark). If a setmark is encountered while spacing to sequential filemarks and the RSmk bit is set to one in the device configuration page (9.3.3.1), CHECK CONDITION status shall be returned, the filemark bit shall be set to one, and the valid bit shall be set to zero. The sense key shall be set to NO SENSE and the additional sense code shall be set to SETMARK DETECTED. The target shall not return CHECK CONDITION status when a setmark is encountered if the RSmk bit is set to zero or if this option is not supported. If end-of-partition is encountered while spacing to sequential filemarks or setmarks, CHECK CONDITION status shall be returned, the sense key shall be set to MEDIUM ERROR, the EOM bit shall be set to one, and the valid bit shall be set to zero. If end-of-data is encountered while spacing to sequential filemarks or setmarks, CHECK CONDITION status shall be returned, the sense key shall be set to BLANK CHECK, and the valid bit shall be set to zero. Additionally, the EOM bit shall be set to one if end-of-data is encountered at or after early- warning. When spacing to end-of-data, the count field is ignored. Upon successful completion, the medium shall be positioned such that a subsequent write operation would append to the last logically recorded information. If end-of-partition is encountered while spacing to end-of-data, CHECK CONDITION status shall be returned, the sense key shall be set to MEDIUM ERROR, the EOM bit shall be set to one, and the valid bit shall be set to zero. For the MODE SELECT command, the density code field of the sequential-access device block descriptor (7.3.3) indicates the density selected by the initiator for use in subsequent read and write operations. For devices capable of automatic density recognition, the density code selected by the initiator may be overridden by the target for a subsequent read operation if the selected value does not match the current recorded density of the medium. For the MODE SENSE command, the density code field reflects the current operating density of the device. For some devices, the default density code value returned in response to a MODE SENSE command may change dynamically to match the most recently selected density. The density code value returned in response to a MODE SENSE command shall be as described below: (1) Following a UNIT ATTENTION condition for a power on or hard reset condition, while not ready, the target shall report the default or only density. (2) Following a UNIT ATTENTION condition for a not-ready-to-ready transition, the target shall: (a) report the default or only density if no attempt has been made by the target to determine the density. (b) report the default or only density if the target cannot automatically determine the density from the medium. (c) report the current recorded density if the target can automatically determine the density from the medium. (3) Following a successful read operation at or after beginning-of-medium, the target shall report a density code value reflecting the recorded density of the medium. For some implementations, the target may automatically determine this value from the medium. For devices not capable of automatic density determination, the default density is reported if the density code value is not provided by the a preceding MODE SELECT command. (4) Following an unsuccessful read operation or a successful write operation, while at beginning-of-partition, the target shall: (a) report a density code value as described for item (2) if no preceding MODE SELECT command has been issued for the currently mounted volume. (b) report a density code value as provided by the last successful MODE SELECT command for the currently mounted volume. (5) Following a successful unload operation, while not ready, the target shall report the most recent density code value as determined by items (2) through (4) above. Table 9-22 lists the sequential-access device density codes Table 9-22: Sequential-Access Density Codes ============================================================================== Code Value Density ---------- ------------------------------------------------------------------ 00h Default (target or peripheral device's default or only density) Magnetic Tapes Width Density mm (Inch) Tracks bpmm bpi Code Type Reference Note ---------- ------ ------------ ---- ---- ------------ ---- 01h 12.7 (0.5) 9 32 (800) NRZI R X3.22-1983 2 02h 12.7 (0.5) 9 63 (1 600) PE R X3.39-1986 2 03h 12.7 (0.5) 9 246 (6 250) GCR R X3.54-1986 2 04h 6.3 (0.25) 4/9 315 (8 000) GCR C X3.136-198 1,3 05h 6.3 (0.25) 4/9 315 (8 000) GCR C X3.136-1986 1 06h 12.7 (0.5) 9 126 (3 200) PE R X3.157-1987 2,4 07h 6.3 (0.25) 4 252 (6 400) IMFM C X3.116-1986 1 08h 3.81 (0.15) 4 315 (8 000) GCR CS X3.158-1987 1,4 09h 12.7 (0.5) 18 1491 (37 871) GCR C X3B5/87-099 2,4 0Ah 12.7 (0.5) 22 262 (6 667) MFM C X3B5/86-199 1,4 0Bh 6.3 (0.25) 4 63 (1 600) PE C X3.56-1986 1 0Ch 12.7 (0.5) 24 500 (12 690) GCR C HI-TC1 1,6 0Dh 12.7 (0.5) 24 999 (25 380) GCR C HI-TC2 1,6 0Eh Reserved for ECMA 0Fh 6.3 (.25) 15 394 (10 000) GCR C QIC120 1,6 10h 6.3 (.25) 18 394 (10 000) GCR C QIC150 1,6 11h 6.3 (.25) 26 630 (16 000) GCR C QIC320 1,6 12h 6.3 (.25) 24 1418 (36 000) NRZI C QIC600 1,6 12h 6.3 (.25) 30 2034 (51 667) RLL C QIC1350 1,6 13h 3.81 (0.15) 1 2400 (61 000) DDS CS X3B5/88-185A 5,6 14h 8.00 (0.315) 1 2126 (54 000) CS X3B5/88-036 5 15h - 7Eh Reserved 7Fh No change from previous density (NO-OP) 7 80h - FFh Vendor unique ============================================================================== Key: Code Type -------------------------------------------- ----------------------- NRZI Non Return to Zero, change on ones R Reel-to-Reel GCR Group Code Recording C Cartridge PE Phase Encoded CS Cassette IMFM Inverted Modified Frequency Modulation MFM Modified Frequency Modulation DDS DAT Data Storage RLL Run Length Limited The active format field indicates which recording format is in use for the selected density code when reading or writing data on a logical unit. If the default density is selected, the value of the active format field is vendor specific. An active format field of zero indicates that the default recording format shall be used. The active partition field indicates the current logical partition number in use on the medium. The write buffer full ratio, on WRITE commands, indicates to the target how full the buffer shall be before writing data to the medium. A value of zero indicates that the value is not specified. The read buffer empty ratio, on READ commands, indicates to the target how empty the buffer shall be before retrieving additional data from the medium. A value of zero indicates that the value is not specified. The write delay time indicates the maximum time, in 100 millisecond increments, that the target should wait before any buffered data that is to be written, is forced to the medium after the last buffered WRITE command that did not cause the buffer to exceed the buffer full ratio. A value of zero indicates that the target shall never force buffered data to the medium under these conditions. A data buffer recovery (DBR) bit of one indicates that the target supports data buffer recovery using the RECOVER BUFFERED DATA command. A DBR bit of zero indicates that the target does not support data buffer recovery. This bit is target-defined. A block identifiers supported (BIS) bit of zero indicates that block IDs are not supported in the format written on the medium. A BIS bit of one indicates that the format on the medium has recorded information about the block IDs relative to a partition. This bit is target-defined. A report setmarks (RSmk) bit of one indicates that the target shall recognize and report setmarks during appropriate read or space operations. A RSmk bit of zero indicates that the target shall not report setmarks. The automatic velocity control (AVC) bit of one, indicates that the device shall select the speed (if the device supports more than one speed) based on the data transfer rate that should optimize streaming activity and minimize medium repositioning. A An AVC bit of zero indicates the speed chosen should be the device's selected speed. The stop on consecutive filemarks field of 00b indicates that the device shall pre-read data from the medium in buffered mode to the limits of the buffer capacity without regard for filemarks. This implies that the device can differentiate between data blocks and filemarks in the buffer. Values 01b, 10b, and 11b specify that the device shall terminate the pre-read operation if 1, 2, or 3 consecutive filemarks are detected, respectively. If the RSmk bit is one, the target shall interpret this field as stop on consecutive setmarks. A recover buffer order (RBO) bit of one indicates that data blocks shall be returned from the target's buffer on a RECOVERED BUFFERED DATA command in LIFO order (last-in-first-out) from which they were written to the buffer. A RBO bit of zero indicates data blocks shall be returned in FIFO (first-in-first- out) order. A report early-warning (REW) bit of zero indicates that the target shall not report the early-warning condition for read operations and it shall report early-warning at or before any medium-defined early-warning position during write operations. A REW bit of one indicates that the target shall return CHECK CONDITION status with the EOM bit set in the sense data when the early-warning position is encountered during read and write operations. If the REW bit is one and the SEW bit is zero, the target shall return CHECK CONDITION status with the sense key set to VOLUME OVERFLOW when early-warning is encountered during buffered write operations. IMPLEMENTORS NOTE: A REW bit of one is intended for compatibility with those systems using old tape formats that require an early-warning indication during read operations. Other systems should set this bit to zero to avoid potential data loss when interchanging tapes between peripheral devices. The GapSize field value determines the size of the inter-block gap when writing data. A value of 00h specifies the device's defined gap size. A value of 01h specifies a device defined gap size sufficiently long to support update-in-place. Values of 02h through 0Fh are multipliers on the device's defined gap size. Values 10h through 7Fh are reserved. Values 80h through FFh are vendor specific. The end-of-data (EOD) defined field indicates which format type the logical unit shall use to detect and generate the EOD area. The types of EOD formats are specified below: Value Description --------- ----------------------------------------------- 000b Logical unit's default EOD definition 001b Format-defined erased area of medium 010b As specified in the SOCF field 011b EOD recognition and generation is not supported 100b-111b Reserved An enable EOD generation (EEG) bit set to one indicates that the logical unit shall generate the appropriate EOD area, as determined by the EOD defined field. A value of zero indicates that EOD generation is disabled. IMPLEMENTORS NOTE: Some logical units may not generate EOD at the completion of any write-type operation. The synchronize at early-warning (SEW) bit set to one indicates that the target shall cause any buffered write data, filemarks, or setmarks to be transferred to the medium when early-warning is encountered. An SEW bit of zero indicates that the target shall retain any unwritten buffered data, filemarks, or setmarks in the buffer when early-warning is encountered (see the WRITE command, 9.2.14, and the WRITE FILEMARKS command, 9.2.15). The additional partitions defined field specifies the number of additional partitions to be defined for a volume based on the settings of when the SDP and or IDP bit is set to one bits. The maximum value allowed is the value returned in the maximum additional partitions field. A fixed data partitions (FDP) bit of one indicates that the device assigns partitions based on its fixed definition of partitions. Setting this bit to one may only be valid at beginning-of-partition and it is mutually exclusive with the SDP and IDP bits. A select data partitions (SDP) bit of one indicates that the device is to partition the medium into the number of partitions as specified by in the additional partitions defined field in the format using partition size(s) defined by the device. Setting this bit to one may only be valid at beginning-of-partition and it is mutually exclusive with the FDP and IDP fields. An initiator-defined partitions (IDP) bit of one indicates that the initiator is defining the number and size of the data partitions using the additional partitions defined field and bytes 5 through 21 of this page. Setting this bit to one may only be valid at beginning-of-partition and it is mutually exclusive with the FDP and SDP fields. IMPLEMENTORS NOTE: Since defining partitions may require re-formatting the medium for some implementations, an implicit write to the medium may occur as a result of a MODE SELECT command that supplies any of these parameters. Partition size unit of measure (PSUM) field defines the units in which the partition size descriptors select the partition size. The values 00b, 01b, and 10b define the units as bytes, kilobytes, and megabytes, respectively. The value 11b is reserved. The medium format recognition field is a target-defined value indicating the device's capability to automatically identify the medium format and partition information when reading an unknown volume. Values for the medium format recognition field shall be assigned as follows: 00h Logical unit is incapable of format or partition recognition. 01h Logical unit is capable of format recognition only. 02h Logical unit is capable of partition recognition only. 03h Logical unit is capable of format and partition recognition. 04h-FFh Reserved. IMPLEMENTORS NOTE: If a target indicates that it is not capable of medium format recognition, the initiator must supply all necessary parameters for the device to identify the specific format. The value in this field may be different following a medium change. Partition size descriptors define the size of the respective partitions in the units specified in the PSUM field. Up to 64 partitions may be defined using this page. If additional partitions need to be defined, up to 64 partitions can be defined in each of the medium partition pages(2-4) defined in 9.3.3.3. 9.4. Sequential-Access Device Glossary beginning-of-partition. The position at the beginning of the permissible recording region of a partition. If only one partition is defined, this position is typically equivalent to the beginning-of-medium. beginning-of-medium. The extreme position along the medium in the direction away from the supply reel which can be accessed by the device. early-warning. A physical mark or device computed position near but logically before the end-of-partition (independent of physical direction). See the REW bit in the device configuration page in 9.3.3.1. end-of-data. End of data in a partition is denoted in a format-specific manner. See the EOD defined field in the device configuration page in 9.3.3.1. end-of-medium. The extreme position along the medium in the direction away from the take-up reel which can be accessed by the device. This position may be accessed by devices that support the LOAD/UNLOAD command with the EOT bit set to one. end-of-partition. The position at the end of the permissible recording region of a partition. overlength. The incorrect length condition that exists after executing a read command when the length of the actual block read exceeds the requested transfer length in the command descriptor block. partition. The entire usable region of recording and reading paths in a volume or in a portion of a volume, defined in a device-specific manner. If there is more than one partition, they shall be numbered starting with zero (i.e., beginning-of-partition-zero). setmark. A special recorded element within a partition, containing no user data, which provides a segmentation scheme hierarchically superior to filemarks for use in addressing or fast positioning on high capacity storage devices. underlength. The incorrect length condition that exists after executing a read command when the requested transfer length in the command descriptor block exceeds the length of the actual block read. volume. A recording medium together with its physical carrier.