ftp.nice.ch/pub/next/tools/scsi/SCSI2_ToolBox.941207.NI.bs.gnutar.gz#/SCSI2_ToolBox/SCSI2_Kit/Documentation/SCSI2_Spec/s2r10c07.txt

This is s2r10c07.txt in view mode; [Download] [Up]

7. All Device Types

7.1. Model for All Device Types

  This model describes some of the general characteristics expected of most 
SCSI devices.  It is not intended to define any requirements nor is it 
intended to alter any requirements defined elsewhere in this standard.  
Section 6 of this standard also contains model information pertaining to all 
device types.

7.1.1. SCSI Addresses

  There are two levels of addresses within the SCSI architecture: the SCSI 
device address and the logical unit number or target routine number.

7.1.1.1. SCSI Device Address
  SCSI devices occupy (i.e., respond to) one address on the SCSI bus.  
Generally the SCSI device provides a means (e.g., switches, jumpers) to select 
one of the eight available addresses (0 through 7).  This address is used 
during bus arbitration and selection or reselection of SCSI devices.  Each 
device on the SCSI bus is assigned an unique address.

  Normally, the SCSI device address is set when the system is configured and 
it remains static thereafter.  Some systems and devices provide vendor-
specific means to alter this address at other times.

7.1.1.2. Logical Units
  Each target has one or more logical units, beginning with logical unit zero.  
There is a maximum of eight logical units.  These logical units are usually 
mapped directly to peripheral devices, but they may be a portion of a 
peripheral device or may comprise multiple peripheral devices.

  An initiator can determine whether a target implements a logical unit by 
issuing an INQUIRY command and examining the returned peripheral qualifier and 
peripheral device type.

  The concept of a logical unit is not defined for an initiator.  (An SCSI 
device may implement both the initiator role and the target role.  In this 
case logical unit(s) are defined only for the target role.)

7.1.1.3. Target Routines
  An optional feature of the SCSI architecture permits each target to have one 
or more target routines, beginning with target routine number zero.  There is 
a maximum of eight target routines.  These target routines are processes that 
execute directly on the target and are not associated with a particular 
logical unit or peripheral device.  Target routines are addressed using the 
LUNTAR bit of the IDENTIFY message (see 5.6.7).

  Target routines are principally intended to return information about the 
target and the only valid commands are INQUIRY and REQUEST SENSE.





7.1.2. Commands Implemented by all SCSI Devices

  This standard defines four commands that all SCSI-2 targets implement: 
INQUIRY, REQUEST SENSE, SEND DIAGNOSTIC, and TEST UNIT READY.  These commands 
are used to configure the system, to test targets, and to return important 
information concerning errors and exception conditions.

7.1.2.1. Using the INQUIRY Command
  The INQUIRY command may be used by a system to determine the configuration 
of the SCSI bus.  Target devices respond with information that includes their 
type and standard level and may include the vendor's identification, model 
number and other useful information.  It is recommended that SCSI targets be 
capable of returning this information (or whatever part of it that is 
available) upon completing power-on initialization.  An SCSI device may take 
longer to get certain portions of this information, especially if it retrieves 
the information from the medium.

7.1.2.2. Using the REQUEST SENSE Command
  Whenever a contingent allegiance condition (6.6) is established, the 
initiator that received the error should issue a REQUEST SENSE command to 
receive the sense data describing what caused the contingent allegiance 
condition.  If the initiator issues some other command, the sense data is 
lost.

7.1.2.3. Using the SEND DIAGNOSTIC Command
  The SEND DIAGNOSTIC command provides a means to request the target to 
perform a self test.  While the test is target specific, the means of 
requesting the test is standardized and the response is simply GOOD status if 
all is well or CHECK CONDITION status if the test fails.

  The SEND DIAGNOSTIC command also provides other powerful features when used 
in conjunction with the RECEIVE DIAGNOSTIC RESULTS command, but this 
capability is optional.

7.1.2.4. Using the TEST UNIT READY Command
  The TEST UNIT READY command is useful in that it allows an initiator to poll 
a logical unit until it is ready without the need to allocate space for 
returned data.  It is especially useful to check cartridge status of logical 
units with removable media.  Targets are expected to respond promptly to 
indicate the current status of the device (i.e., a target should avoid lengthy 
disconnections in an attempt to respond with GOOD status).  














7.2. Commands for All Device Types

  The operation codes for commands that apply to all device types are listed 
in Table 7-1.

                  Table 7-1: Commands for All Device Types

==============================================================================
                                   Operation         
Command Name                         Code       Type    Section
------------------------------------------------------------------------------
CHANGE DEFINITION                     40h        O       7.2.1
COMPARE                               39h        O       7.2.2
COPY                                  18h        O       7.2.3
COPY AND VERIFY                       3Ah        O       7.2.4
INQUIRY                               12h        M       7.2.5
LOG SELECT                            4Ch        O       7.2.6
LOG SENSE                             4Dh        O       7.2.7
MODE SELECT(6)                        15h        Z       7.2.8
MODE SELECT(10)                       55h        Z       7.2.9
MODE SENSE(6)                         1Ah        Z       7.2.10
MODE SENSE(10)                        5Ah        Z       7.2.11
READ BUFFER                           3Ch        O       7.2.12
RECEIVE DIAGNOSTIC RESULTS            1Ch        O       7.2.13
REQUEST SENSE                         03h        M       7.2.14
SEND DIAGNOSTIC                       1Dh        O       7.2.15
TEST UNIT READY                       00h        M       7.2.16
WRITE BUFFER                          3Bh        O       7.2.17
==============================================================================

  Key:  M = Command implementation is mandatory.
        O = Command implementation is optional.
        Z = Command implementation is device type specific.






















7.2.1. CHANGE DEFINITION Command


                    Table 7-2: CHANGE DEFINITION Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (40h)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |              Reserved                      |
-----|-----------------------------------------------------------------------|
 2   |                  Reserved                                    |  Save  |
-----|-----------------------------------------------------------------------|
 3   |Reserved|                  Definition Parameter                        |
-----|-----------------------------------------------------------------------|
 4   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 5   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 6   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 7   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 8   |                           Parameter Data Length                       |
-----|-----------------------------------------------------------------------|
 9   |                           Control                                     |
==============================================================================


  The CHANGE DEFINITION command (Table 7-2) modifies the operating definition 
of the selected logical unit or target with respect to commands from the 
selecting initiator or for all initiators. 

  A save control bit (Save) of zero indicates that the target shall not save 
the operating definition.  A Save bit of one indicates that the target shall 
save the operating definition to non-volatile memory. 

  The definition parameter field is defined in Table 7-3.

                    Table 7-3: Definition Parameter Field

              =================================================
              Value     Meaning of Definition Parameter
              -----     ---------------------------------------
               00h      Use Current Operating Definition 
               01h      SCSI-1 Operating Definition
               02h      CCS Operating Definition
               03h      SCSI-2 Operating Definition
              04-3Fh    Reserved
              40-7Fh    Vendor Specific
              =================================================


  IMPLEMENTORS NOTE: The current operating definition parameter values 
  establish operating definitions compatible with the appropriate SCSI 
  specification.  Vendor-specific values are available for those applications 
  where more complex operation definition changes are required. Definitions 
  supported by a device are returned in the implemented operating definition 
  page (see 7.3.4.3).

  The parameter data length field specifies the length in bytes of the 
parameter data that shall be transferred from the initiator to the target.  A 
parameter data length of zero indicates that no data shall be transferred.  
This condition shall not be considered as an error.  Parameter data lengths 
greater than zero indicate the number of bytes of parameter data that shall be 
transferred.

  The parameter data is vendor specific.

  IMPLEMENTORS NOTE:  The parameter data may be used to specify a password to 
  validate an operating definition change.  

  The CHANGE DEFINITION command causes one of the operating definition 
modifications listed below:
  (1) Change the operating definition of a logical unit relative to the 
initiator that issued the command.  In this case, the target is capable of 
maintaining an unique operating definition for each logical unit relative to 
each initiator in the system.
  (2) Change the operating definition of the target relative to the initiator 
that issued the command.  In this case, the target is capable of maintaining 
an unique operating definition, for each initiator in the system, that applies 
to all logical units of the target.
  (3) The operating definition of a logical unit relative to all initiators in 
the system.  In this case, the target is capable of maintaining an unique 
operating definition for each logical unit relative to all initiators in the 
system.
  (4) The operating definition of the target relative to all initiators in the 
system.  In this case, the target is capable of maintaining only one operating 
definition.

  IMPLEMENTORS NOTE:
  (1) This standard does not provide a direct means to determine which of the 
  above four methods has been implemented by the target.  An indirect means of 
  determining which method is implemented exists in that the target is 
  required to inform affected initiators of operating definition changes via 
  the unit attention condition.  
  (2) Cases (3) and (4), above, may result in incompatibilities if there are 
  other initiators in the system operated below the SCSI-2 level.  

  The operating definition is modified after successful completion of the 
command.  A target shall consider the command successfully completed when it 
detects the assertion of the ACK signal for the COMMAND COMPLETE message.  The 
initiator should verify the new operating definition by issuing an INQUIRY 
command requesting the implemented operating definition page (see Table 7-75). 

  It is permissible for an SCSI-2 device that has its definition changed to an 
SCSI-1 device to accept a CHANGE DEFINITION command.


  IMPLEMENTORS NOTE:  The method of changing the operating definition is 
  implementation dependent.  Some implementations may require the target's 
  operating mode be re-initialized as if a power-up or hard-reset had 
  occurred.  Other implementations may modify only those operating definitions 
  that are affected by the CHANGE DEFINITION command.

  If the CHANGE DEFINITION command is not executed successfully for any 
reason, the operating definition shall remain the same as it was before the 
CHANGE DEFINITION command was attempted.  If it is impossible to return to the 
previous operating definition, an unit attention condition shall be generated 
by the target.  

  IMPLEMENTORS NOTE:  The present operating definition of the target may 
  always be interrogated through the INQUIRY command.  When an SCSI-2 target 
  has its operating definition changed to CCS or SCSI-1, certain changes are 
  needed to promote compatibility with pre-existing SCSI-1 initiators.  The 
  recommended changes are as follows:
  (1) The target should not initiate selections to other SCSI devices to 
  determine if any initiators support AEN.  The target should assume that none 
  are capable of receiving AEN and not issue an AEN.
  (2) The target should not generate extended contigent allegiance conditions 
  by issuing an INITIATE RECOVERY message.
  (3) If a REQUEST SENSE command with an allocation length of zero is 
  received, the target should return four bytes of sense data.
  (4) If an INQUIRY command is received, the returned data should have 
  appropriate values in the ANSI version and response data format fields.  The 
  features supported bits should be zero.
  (5) A change in the operating definition may change the vendor identifier, 
  the device type, the device model, the SCSI implementation level, the 
  command set, and any other operating characteristics.  

  After a power-on condition or a hard RESET condition, the target shall set 
its initial operating definition to the last saved value, if saving is 
implemented, or its default value, if saving is not implemented.




















7.2.2. COMPARE Command


                         Table 7-4: COMPARE Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (39h)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |              Reserved             |  Pad   |
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   | (MSB)                                                                 |
- - -|- -                        Parameter List Length                    - -|
 5   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 6   |                                                                       |
- - -|- -                        Reserved                                 - -|
 8   |                                                                       |
-----|-----------------------------------------------------------------------|
 9   |                           Control                                     |
==============================================================================


  The COMPARE command (Table 7-4) provides the means to compare data from one 
logical unit with another or the same logical unit in a manner similar to the 
COPY command. 

  This command functions in the same manner as the COPY command, except that 
the data from the source is compared on a byte-by-byte basis with the data 
from the destination.  The parameter list transferred to the target is the 
same as for the COPY command.  This parameter list contains the information to 
identify the logical units involved in the comparison and the length of the 
comparison.  (See 7.2.3 for additional information about the COPY command.)

  If the comparison is unsuccessful, the command shall be terminated with 
CHECK CONDITION status and the sense key shall be set to MISCOMPARE.  The 
remaining fields in the sense data shall be set as documented in the COPY 
command.













7.2.3. COPY Command


                           Table 7-5: COPY Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (18h)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |              Reserved             |  Pad   |
-----|-----------------------------------------------------------------------|
 2   | (MSB)                                                                 |
- - -|- -                        Parameter List Length                    - -|
 4   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 5   |                           Control                                     |
==============================================================================


  The COPY command (Table 7-5) provides a means to copy data from one logical 
unit to another or the same logical unit.  The logical unit that receives and 
performs the COPY command is called the copy manager.  The copy manager is 
responsible for copying data from a logical unit (source device) to a logical 
unit (destination device).  These logical units may reside on different SCSI 
devices or the same SCSI device (in fact all three may be the same logical 
unit).  Some SCSI devices that implement this command may not support copies 
to or from another SCSI device, or may not support third party copies (i.e., 
both the source and the destination logical units reside on other SCSI 
devices).

  The pad bit (7.2.3.7) is used in conjunction with the Cat bit (7.2.3.7) in 
the segment descriptors to define what action should be taken when a segment 
of the copy does not fit exactly into an integer number of destination blocks. 
  The parameter list length field specifies the length in bytes of the 
parameters that shall be sent during the DATA OUT phase of the command.  A 
parameter list length of zero indicates that no data shall be transferred. 
This condition shall not be considered as an error.

  The COPY parameter list (Table 7-6) begins with a four-byte header that 
contains the COPY function code and priority.  Following the header is one or 
more segment descriptors. 












                       Table 7-6: COPY Parameter List

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |         COPY Function Code                 |         Priority         |
-----|-----------------------------------------------------------------------|
 1   |                           Vendor Specific                             |
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   |                           Reserved                                    |
==============================================================================
     |                         Segment Descriptor(s)                         |
==============================================================================
 0 - |                           Segment Descriptor 0                        |
 xx  |                     (See specific table for length.)                  |
-----|-----------------------------------------------------------------------|
     |                                 .                                     |
     |                                 .                                     |
     |                                 .                                     |
-----|-----------------------------------------------------------------------|
 0 - |                           Segment Descriptor n                        |
 xx  |                     (See specific table for length.)                  |
==============================================================================


  The COPY function code field defines a specific format for the segment 
descriptors.  The COPY function codes are defined in Table 7-7.  A target need 
not support all function codes for its device type.

  The priority field of the COPY parameter list establishes the relative 
priority of this COPY command to other commands being executed by the same 
target.  All other commands are assumed to have a priority of 1.  Priority 0 
is the highest priority with increasing values indicating lower priorities.

  The segment descriptor formats are determined by the COPY function code.  
The segment descriptor format used for block devices (i.e., write-once, CD-
ROM, optical-memory, and direct-access devices) shall be the same.  The 
segment descriptor format used for stream devices (i.e., printer, processor, 
communications, and sequential-access devices), shall be the same.  Thus a 
copy operation from a write-once device to a printer device uses the same 
segment descriptor format as a copy operation from a direct-access device to a 
sequential-access device (see Table 7-7).  The segment descriptor formats are 
described in Tables 7-8 through 7-11.  A maximum of 256 segment descriptors 
are permitted.  The segment descriptors are identified by ascending numbers 
beginning with zero.







                       Table 7-7: COPY Function Codes

==============================================================================
       Peripheral Device Type                   COPY      Segment             
       ----------------------                 Function   Descriptor           
Source                  Destination             Code       Table    Comments 
------------------------------------------------------------------------------
Block Devices           Stream Devices            0         7-8               
(Device types 0,4,5,7)  (Device types 1,2,3,9)                                
Stream Devices          Block Devices             1         7-8     (Note 3)  
(Device types 1,3,9)    (Device types 0,4,5,7)                                
Block Devices           Block Devices             2         7-9     (Note 3)  
(Device types 0,4,5,7)  (Device types 0,4,5,7)                                
Stream Devices          Stream Devices            3         7-10              
(Device types 1,3,9)    (Device types 1,2,3,9)                                
Sequential-Access       Sequential-Access         4         7-11    Image Copy
(Device type 1)         (Device type 1)                                       
==============================================================================

  NOTES:
  (1) COPY function codes 05h - 0Fh are reserved.
  (2) COPY function codes 10h - 1Fh are vendor specific.
  (3) When using the COMPARE command the destination block device may be a CD-
  ROM device or an optical-memory device that uses read-only media. 

7.2.3.1. Errors Detected by the Managing SCSI Device
  Two classes of exception conditions may occur during execution of a COPY 
command.  The first class consists of those exception conditions detected by 
the SCSI device that received the COPY command and is managing the execution 
of the command.  These conditions include parity errors while transferring the 
COPY command and status byte, invalid parameters in the COPY command, invalid 
segment descriptors, and inability of the SCSI device controlling the COPY 
functions to continue operating.  In the event of such an exception condition, 
the SCSI device managing the COPY shall:
  (1) Terminate the COPY command with CHECK CONDITION status.
  (2) The valid bit in the sense data shall be set to one.  The segment number 
shall contain the number of the segment descriptor being processed at the time 
the exception condition is detected.  The sense key shall contain the sense 
key code describing the exception condition (i.e., not COPY ABORTED).  The 
information field shall contain the difference between the number of blocks 
field in the segment descriptor being processed at the time of the failure and 
the number of blocks successfully copied.  This number is the residue of 
unprocessed blocks remaining for the segment descriptor.

7.2.3.2. Errors Detected by a Target
  The second class of errors consists of exception conditions detected by the 
SCSI device transferring data at the request of the SCSI device managing the 
transfer.  The SCSI device managing the COPY command detects exception 
conditions by receiving CHECK CONDITION status from one of the SCSI devices it 
is managing.  It then shall recover the sense data associated with the 
exception condition.




  The SCSI device managing the COPY command may also be the source or 
destination SCSI device (or both).  It shall distinguish between a failure of 
the management of the COPY and a failure of the data transfer being requested. 
It shall then create the appropriate sense data internally.

  After recovering the sense data associated with the detected error, the SCSI 
device managing the COPY command shall:
  (1) Terminate the COPY command with CHECK CONDITION status.
  (2) The valid bit in the sense data shall be set to one.  The segment number 
shall contain the number of the segment descriptor being processed at the time 
the exception condition is detected.  The sense key shall be set to COPY 
ABORTED.  The information field shall contain the difference between the 
number of blocks field in the segment descriptor being processed at the time 
of the failure and the number of blocks successfully copied.  This number is 
the residue of unprocessed blocks remaining for the segment descriptor.

  The first byte of the command-specific information field shall specify the 
starting byte number, relative to the first byte of sense data, of an area 
that contains (unchanged) the source logical unit's status byte and sense 
data.  A zero value indicates that no status byte or sense data is being 
returned for the source logical unit.

  The second byte of the command-specific information field shall specify the 
starting byte number, relative to the first byte of sense data, of an area 
that contains (unchanged) the destination logical unit's status byte and sense 
data.  A zero value indicates that no status byte or sense data is being 
returned for the destination logical unit.

7.2.3.3. COPY Function Code 00h and 01h
  The format for the segment descriptors for COPY transfers between block and 
stream devices is specified in Table 7-8.  This format is required for COPY 
function codes 00h or 01h.  The segment descriptor may be repeated up to 256 
times within the parameter list length specified in the command descriptor 
block.





















      Table 7-8: Segment Descriptor for COPY Function Codes 00h and 01h

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   | Source Address           |Reserved|  Cat   |     Source LUN           |
-----|-----------------------------------------------------------------------|
 1   | Destination Address      |   Reserved      |     Destination LUN      |
-----|-----------------------------------------------------------------------|
 2   | (MSB)                                                                 |
-----|---                        Stream Device Block Length               ---|
 3   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 4   | (MSB)                                                                 |
- - -|- -                        Block Device Number of Blocks            - -|
 7   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 8   | (MSB)                                                                 |
- - -|- -                        Block Device Logical Block Address       - -|
11   |                                                                 (LSB) |
==============================================================================


  The source address and source LUN fields specify the SCSI bus ID and logical 
unit of the device to copy the data from for this segment of the COPY command. 
The destination address and destination LUN fields specify the SCSI bus ID and 
logical unit to copy the data to for this segment of the COPY command.  Some 
SCSI devices may not support third-party COPY in which the copying SCSI device 
is not the source or destination device.  Some SCSI devices only support COPY 
within the SCSI device and not to other SCSI devices.  If an unsupported COPY 
operation is requested, the command shall be terminated with CHECK CONDITION 
status and the sense key shall be set to ILLEGAL REQUEST with an additional 
sense code of INVALID FIELD IN PARAMETER LIST (see 7.2.3.1).

  A catenate (Cat) bit (optional) of one indicates that the COPY manager shall 
catenate the last source block of a segment with the first source block of the 
next segment if the last source block does not end exactly at the end of the 
destination block.  The definition of a cat bit of zero depends on the setting 
of the pad bit in the command descriptor block  (see 7.2.3.7).

  The stream device block-length field specifies the block length to be used 
on the stream device logical unit during this segment of the COPY command.  If 
the SCSI device managing the COPY knows this block length is not supported, 
the command shall be terminated with CHECK CONDITION status and the sense key 
shall be set to ILLEGAL REQUEST with an additional sense code of INVALID FIELD 
IN PARAMETER LIST . If the block length is found to be invalid while executing 
a read or write operation to the stream device, the command shall be 
terminated with CHECK CONDITION status and the sense key shall be set to COPY 
ABORTED (see 7.2.3.2).





  The block device number of blocks field specifies the number of blocks in 
the current segment to be copied.  A value of zero indicates that no blocks 
shall be transferred in this segment.

  The block device logical block address field specifies the starting logical 
block address on the logical unit for this segment.

7.2.3.4. COPY Function Code 02h
  The format for the segment descriptors for COPY transfers among block 
devices is specified in Table 7-9.  This format is required for COPY function 
code 02h.  The segment descriptor may be repeated up to 256 times within the 
parameter list length specified in the command descriptor block.

          Table 7-9: Segment Descriptor for COPY Function Code 02h

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   | Source Address           |   DC   |  Cat   | Source LUN               |
-----|-----------------------------------------------------------------------|
 1   | Destination Address      |   Reserved      | Destination LUN          |
-----|-----------------------------------------------------------------------|
 2   |                              Reserved                                 |
-----|-----------------------------------------------------------------------|
 3   |                              Reserved                                 |
-----|-----------------------------------------------------------------------|
 4   | (MSB)                                                                 |
- - -|- -                Number of Blocks                                 - -|
 7   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 8   | (MSB)                                                                 |
- - -|- -                Source Logical Block Address                     - -|
11   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
12   | (MSB)                                                                 |
- - -|- -                Destination Logical Block Address                - -|
15   |                                                                 (LSB) |
==============================================================================


  See 7.2.3.3 for definitions of the source address, the source LUN, the 
destination address, the destination LUN, and CAT fields.

  A destination count (DC) bit of zero indicates that the number of blocks 
field refers to the source logical unit.  A DC bit of one indicates that the 
number of blocks field refers to the destination logical unit. 

  The number of blocks field specifies the number of blocks to be transferred 
to or from (depending on the DC bit) the block device during this segment.  A 
value of zero indicates that no blocks shall be transferred.

  The source logical block address field specifies the starting logical block 
address on the source block device. 

  The destination logical block address field specifies the starting logical 
block address on the destination block device.

7.2.3.5. COPY Function Code 03h
  The format for the segment descriptors for COPY transfers among stream 
devices is specified by Table 7-10.  This format is required for COPY function 
code 03h.  The segment descriptor may be repeated up to 256 times within the 
parameter list length specified in the command descriptor block.

          Table 7-10: Segment Descriptor for COPY Function Code 03h

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   | Source Address           |   DC   |  Cat   | Source LUN               |
-----|-----------------------------------------------------------------------|
 1   | Destination Address      |   Reserved      | Destination LUN          |
-----|-----------------------------------------------------------------------|
 2   |                              Reserved                                 |
-----|-----------------------------------------------------------------------|
 3   |                              Reserved                                 |
-----|-----------------------------------------------------------------------|
 4   | (MSB)                                                                 |
-----|---                        Source Block Length                      ---|
 5   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 6   | (MSB)                                                                 |
-----|---                        Destination Block Length                 ---|
 7   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 8   | (MSB)                                                                 |
- - -|- -                        Number of Blocks                         - -|
11   |                                                                 (LSB) |
==============================================================================


  See 7.2.3.3 for definitions of the source address, the source LUN, the 
destination address, the destination LUN, and CAT fields.

  A destination count (DC) bit of zero indicates that the number of blocks 
field refers to the source logical unit.  A DC bit of one indicates that the 
number of blocks field refers to the destination logical unit. 

  The source block length field specifies the block-length of the source 
device for this segment of the COPY.  A zero in this field indicates variable 
block-length.  For non-zero values, this field shall match the logical unit's 
actual block-length. 

  If block-length mismatches are detected prior to the beginning of the read 
operation by the SCSI device managing the COPY, the command shall be 
terminated with CHECK CONDITION status.  The sense key shall be set to ILLEGAL 
REQUEST and the additional sense code shall be set to INVALID FIELD IN 
PARAMETER LIST (see 7.2.3.1). 

  If the mismatches are detected during the read operation by the COPY 
manager, the command shall be terminated with CHECK CONDITION status.  The 
sense key shall be set to COPY ABORTED (see 7.2.3.2).  and the additional 
sense code shall be set to INVALID FIELD IN PARAMETER LIST.

  The destination block-length field specifies the block length to be used on 
the destination logical unit during the COPY.  Destination block length 
mismatches are handled in an analogous manner as source block length 
mismatches.

  The number of blocks field specifies the number of blocks to be transferred 
to or from (depending on the DC bit) the device during this segment.  A value 
of zero indicates that no blocks shall be transferred.

7.2.3.6. COPY Function Code 04h
  The format for the segment descriptors for image COPY transfers between 
sequential-access devices is specified in Table 7-11.  This format is required 
for COPY function code 04h.  The segment descriptor may be repeated up to 256 
times within the parameter list length specified in the command descriptor 
block.

          Table 7-11: Segment Descriptor for COPY Function Code 04h

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   | Source Address           |   Reserved      | Source LUN               |
-----|-----------------------------------------------------------------------|
 1   | Destination Address      |   Reserved      | Destination LUN          |
-----|-----------------------------------------------------------------------|
 2   |                              Count                                    |
-----|-----------------------------------------------------------------------|
 3   |                                                                       |
- - -|- -                           Reserved                              - -|
 7   |                                                                       |
-----|-----------------------------------------------------------------------|
 8   |                                                                       |
- - -|- -                           Vendor Specific                       - -|
11   |                                                                       |
==============================================================================


  See 7.2.3.3 for definitions of the source address, the source LUN, the 
destination address, the destination LUN, and CAT fields.










  The image mode COPY command copies an exact image of the source device 
medium to the destination device medium, beginning at their current positions. 
The copy function terminates when the source device:
  (1) encounters an end-of-partition as defined by the source device
  (2) encounters an end-of-data as defined by the source device (i.e., BLANK 
CHECK sense key)
  (3) has copied the number of consecutive filemarks specified in the count 
field from the source device to the destination device
  (4) has copied the number of consecutive setmarks specified in the count 
field from the source device to the destination device, if the RSmk bit in the 
device configuration page (see 9.3.3.1) is one. 

  A count field of zero indicates that the COPY command shall not terminate 
due to any number of consecutive filemarks or setmarks.  Other error or 
exception conditions (e.g., early-warning end-of-partition on the destination 
device) may cause the COPY command to terminate prior to completion.  In such 
cases, it is not possible to calculate a residue, so the information field in 
the sense data shall be set to zero.

7.2.3.7. Copies With Unequal Block Lengths
  When copying data between two devices with unequal block lengths, it is 
possible for the last source block to not completely fill the last destination 
block for one or more segments in the COPY command.  Two optional bits are 
defined to assist in controlling the copy manager's actions in this 
circumstance.  The Pad bit (in the command descriptor block) and the Cat bit 
(in each applicable segment descriptor) are defined in Table 7-12.

                    Table 7-12: Pad and Cat Bit Definition

==============================================================================
 Pad Cat   COPY Manager's Action
---- ----  -------------------------------------------------------------------
  0   0    On inexact segments, it is device specific whether the COPY manager 
           rejects the COPY command with CHECK CONDITION status and ILLEGAL 
           REQUEST sense key, the COPY manager writes or accepts short blocks 
           (variable-block mode on sequential-access devices), or the COPY 
           manager adds pad characters (00h) to the destination block or 
           strips pad characters from the source block.

  1   0    On inexact segments, the COPY manager shall add pad characters 
           (00h) to the destination block to completely fill the block or it 
           shall strip pad characters from the source block, always stopping 
           at the end of a complete block.

  X   1    The COPY manager shall always write or read complete blocks.  On 
           inexact segments, the remainder of the block contains data from the 
           next segment.  This code is not valid in the last segment of the 
           COPY command.
==============================================================================


  IMPLEMENTORS NOTE:  Use of pad characters is intended to assist in managing 
  COPY commands between devices of different block lengths where partial-block 
  residues may occur.  The initiator which issued the COPY command is 
  responsible for management of these pad areas (i.e., remembering where they 
  are).  One possible method is to write the COPY parameter list information 
  to the destination medium prior to issuing the COPY command for backup and 
  to read this information prior to issuing the COPY command for restore.

7.2.4. COPY AND VERIFY Command


                     Table 7-13: COPY AND VERIFY Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (3Ah)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |        Reserved          | BytChk |  Pad   |
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   | (MSB)                                                                 |
- - -|- -                        Parameter List Length                    - -|
 5   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 6   |                                                                       |
- - -|- -                        Reserved                                 - -|
 8   |                                                                       |
-----|-----------------------------------------------------------------------|
 9   |                           Control                                     |
==============================================================================


  The COPY AND VERIFY command (Table 7-13) performs the same function as the 
COPY command, except that a verification of the data written to the 
destination logical unit is performed after the data is written.  The 
parameter list transferred to the target is the same as for the COPY command. 
This parameter list contains the information to identify the logical units 
involved in the copy and the length of the copy.  See 7.2.3 for additional 
information about the COPY command.

  A byte check (BytChk) bit of zero causes a medium verification to be 
performed with no data comparison.  A BytChk bit of one causes a byte-by-byte 
compare of data written on the destination medium and the data transferred 
from the source medium.  If the compare is unsuccessful for any reason, the 
copy manager shall return CHECK CONDITION status with the sense key set to 
MISCOMPARE.  The remaining fields in the sense data shall be set as documented 
in the COPY command.









7.2.5. INQUIRY Command


                         Table 7-14: INQUIRY Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (12h)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |                  Reserved         |  EVPD  |
-----|-----------------------------------------------------------------------|
 2   |                           Page Code                                   |
-----|-----------------------------------------------------------------------|
 3   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 4   |                           Allocation Length                           |
-----|-----------------------------------------------------------------------|
 5   |                           Control                                     |
==============================================================================


  The INQUIRY command (Table 7-14) requests that information regarding 
parameters of the target and its attached peripheral device(s) be sent to the 
initiator.  An option allows the initiator to request additional information 
about the target or logical unit (see 7.2.5.2).

  An enable vital product data (EVPD) bit of one specifies that the target 
shall return the optional vital product data specified by the page code field.  
If the target does not support vital product data and this bit is set to one, 
the target shall return CHECK CONDITION status with the sense key set to 
ILLEGAL REQUEST and an additional sense code of INVALID FIELD IN CDB.

  An EVPD bit of zero specifies that the target shall return the standard 
INQUIRY data.  If the page code field is not zero, the target shall return 
CHECK CONDITION status with the sense key set to ILLEGAL REQUEST and an 
additional sense code of INVALID FIELD IN CDB.

  The page code field specifies which page of vital product data information 
the target shall return (see 7.3.4).

  The INQUIRY command shall return CHECK CONDITION status only when the target 
cannot return the requested INQUIRY data. 

  IMPLEMENTORS NOTE:  It is recommended that the INQUIRY data be returned even 
  though the peripheral device may not be ready for other commands.

  If an INQUIRY command is received from an initiator with a pending unit 
attention condition (i.e., before the target reports CHECK CONDITION status), 
the target shall perform the INQUIRY command and shall not clear the unit 
attention condition (see 6.9).



  IMPLEMENTORS NOTES:
  (1) The INQUIRY command is typically used by the initiator after a reset or 
  power-up condition to determine the device types for system configuration.  
  To minimize delays after a reset or power-up condition the standard INQUIRY 
  data should be available without incurring any media access delays.  If the 
  target does store some of the INQUIRY data on the device it may return zeros 
  or ASCII spaces (20h) in those fields until the data is available from the 
  device.
  (2) The INQUIRY data may change as the target executes its initialization 
  sequence or in response to a CHANGE DEFINITION command.  For example, the 
  target may contain a minimum command set in its non-volatile memory and may 
  load its final firmware from the device when it becomes ready.  After it has 
  loaded the firmware it may support more options and therefore return 
  different supported options information in the INQUIRY data.

7.2.5.1. Standard INQUIRY Data
  The standard INQUIRY data (Table 7-15) contains 36 required bytes, followed 
by a variable number of vendor-specific parameters.  Bytes 56 through 95, if 
returned, are reserved for future standardization.  




































  The standard INQUIRY data format is shown in Table 7-15.

                   Table 7-15: Standard INQUIRY Data Format

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   | Peripheral Qualifier     |           Peripheral Device Type           |
-----|-----------------------------------------------------------------------|
 1   |  RMB   |                  Device-Type Modifier                        |
-----|-----------------------------------------------------------------------|
 2   |   ISO Version   |       ECMA Version       |  ANSI-Approved Version   |
-----|-----------------------------------------------------------------------|
 3   |  AENC  | TrmIOP |     Reserved    |         Response Data Format      |
-----|-----------------------------------------------------------------------|
 4   |                           Additional Length (n-4)                     |
-----|-----------------------------------------------------------------------|
 5   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 6   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 7   | RelAdr | WBus32 | WBus16 |  Sync  | Linked |Reserved| CmdQue | SftRe  |
-----|-+---------------------------------------------------------------------|
 8   | (MSB)                                                                 |
- - -|- -                        Vendor Identification                    - -|
 15  |                                                                 (LSB) |
-----|-+---------------------------------------------------------------------|
 16  | (MSB)                                                                 |
- - -|- -                        Product Identification                   - -|
 31  |                                                                 (LSB) |
-----|-+---------------------------------------------------------------------|
 32  | (MSB)                                                                 |
- - -|- -                        Product Revision Level                   - -|
 35  |                                                                 (LSB) |
-----|-+---------------------------------------------------------------------|
 36  |                                                                       |
- - -|- -                        Vendor Specific                          - -|
 55  |                                                                       |
-----|-+---------------------------------------------------------------------|
 56  |                                                                       |
- - -|- -                        Reserved                                 - -|
 95  |                                                                       |
============================================================================== 
     |                       Vendor-Specific Parameters                      |
==============================================================================
96 to|                           Vendor-Specific                             |
 n   |                           Parameter Bytes                             |
==============================================================================






  The peripheral qualifier and peripheral device-type fields identify the 
device currently connected to the logical unit.  If the target is not capable 
of supporting a device on this logical unit, this field shall be set to 7Fh 
(peripheral qualifier set to 011b and peripheral device type set to 1Fh).  The 
peripheral qualifier is defined in Table 7-16 and the peripheral device type 
is defined in Table 7-17.

                       Table 7-16: Peripheral Qualifier

==============================================================================
Qualifier     Description
---------     ----------------------------------------------------------------
  000b        The specified peripheral device type is currently connected to 
              this logical unit.  If the target cannot determine whether or 
              not a physical device is currently connected it shall also use 
              this peripheral qualifier when returning the INQUIRY data.  
              Note: This peripheral qualifier does not imply that the device 
              is ready for access by the initiator.

  001b        The target is capable of supporting the specified peripheral 
              device type on this logical unit, however the physical device is 
              not currently connected to this logical unit.

  010b        Reserved

  011b        The target is not capable of supporting a physical device on 
              this logical unit.  For this peripheral qualifier the peripheral 
              device type shall be set to 1Fh to provide compatibility with 
              previous versions of SCSI.  All other peripheral device type 
              values are reserved for this peripheral qualifier.

  1XXb        Vendor specific
==============================================================================


                      Table 7-17: Peripheral Device Type

==============================================================================
  Code         Description
-----------    ---------------------------------------------------------------
  00h          Direct-access device (e.g., magnetic disk)
  01h          Sequential-access device (e.g., magnetic tape)
  02h          Printer device
  03h          Processor device
  04h          Write-once device (e.g., some optical disks)
  05h          CD-ROM device
  06h          Scanner device
  07h          Optical memory device (e.g., some optical disks)
  08h          Medium Changer device (e.g., jukeboxes) 
  09h          Communications device
  0Ah - 0Bh    Defined by ASC IT8 (Graphic Arts Pre-Press Devices)
  0Ch - 1Eh    Reserved
  1Fh          Unknown or no device type
==============================================================================


  A removable medium (RMB) bit of zero indicates that the medium is not 
removable.  A RMB bit of one indicates that the medium is removable.

  The device-type modifier field was defined in SCSI-1 to permit vendor-
specific qualification codes of the device type.  This field is retained for 
compatibility with SCSI-1.  Targets that do not support this field should 
return a value of zero.

  The usage of non-zero code values in the ISO version and ECMA version fields 
are defined by the International Organization for Standardization and the 
European Computer Manufacturers Association, respectively.  A zero code value 
in these fields shall indicate that the target does not claim compliance to 
the ISO version of SCSI (ISO IS 9316) or the ECMA version of SCSI (ECMA-111). 
It is possible to claim compliance to more than one of these SCSI standards.

  The ANSI-approved version field indicates the implemented version of this 
standard and is defined in Table 7-18.

                      Table 7-18: ANSI-Approved Version

==============================================================================
  Code        Description
------------------------------------------------------------------------------
   0h      The device might or might not comply to an ANSI-approved standard.
   1h      The device complies to ANSI X3.131-1986 (SCSI-1).
   2h      The device complies to this version of SCSI.  This code is reserved 
           to designate this standard upon approval by ANSI.
   3h - 7h   Reserved
==============================================================================


  The asynchronous event notification capability (AENC) bit indicates that the 
device supports the asynchronous event notification capability as defined in 
6.5.5. 
  (1) Processor device-type definition:  An AENC bit of one indicates that the 
  processor device is capable of accepting asynchronous event notifications. 
  An AENC bit of zero indicates that the processor device does not support 
  asynchronous event notifications.
  (2) All other device-types:  This bit is reserved.

  A terminate I/O process (TrmIOP) bit of one indicates that the device 
supports the TERMINATE I/O PROCESS message as defined in 5.6.22.  A value of 
zero indicates that the device does not support the TERMINATE I/O PROCESS 
message.

  A response data format value of zero indicates the INQUIRY data format is as 
specified in SCSI-1.  A response data format value of one indicates 
compatibility with some products that were designed prior to the development 
of this standard (i.e., CCS).  A response data format value of two indicates 
that the data shall be in the format specified in this standard.  Response 
data format values greater than two are reserved.



  The additional length field shall specify the length in bytes of the 
parameters.  If the allocation length of the command descriptor block is too 
small to transfer all of the parameters, the additional length shall not be 
adjusted to reflect the truncation.

  A relative addressing (RelAdr) bit of one indicates that the device supports 
the relative addressing mode for this logical unit.  If this bit is set to one 
the linked command (Linked) bit shall also be set to one since relative 
addressing can only be used with linked commands.  A RelAdr bit of zero 
indicates the device does not support relative addressing for this logical 
unit.

  A wide bus 32 (WBus32) bit of one indicates that the device supports 32-bit 
wide data transfers.  A value of zero indicates that the device does not 
support 32-bit wide data transfers.

  A wide bus 16 (WBus16) bit of one indicates that the device supports 16-bit 
wide data transfers.  A value of zero indicates that the device does not 
support 16-bit wide data transfers.

  NOTE: If the values of both the WBus16 and WBus32 bits are zero the device 
  only supports 8-bit wide data transfers.

  A synchronous transfer (Sync) bit of one indicates that the device supports 
synchronous data transfer.  A value of zero indicates the device does not 
support synchronous data transfer.

  A linked command (Linked) bit of one indicates that the device supports 
linked commands for this logical unit.  A value of zero indicates the device 
does not support linked commands for this logical unit.

  A command queuing (CmdQue) bit of one indicates that the device supports 
tagged command queuing for this logical unit.  A value of zero indicates the 
device does not support tagged command queuing for this logical unit.

  A soft reset (SftRe) bit of zero indicates that the device responds to the 
RESET condition with the hard RESET alternative (see 5.2.2.1).  A SftRe bit of 
one indicates that the device responds to the RESET condition with the soft 
RESET alternative (see 5.2.2.2).

  ASCII data fields shall contain only graphic codes (i.e., code values 20h 
through 7Eh).  Left-aligned fields shall place any unused bytes at the end of 
the field (highest offset) and the unused bytes shall be filled with space 
characters (20h).  Right-aligned fields shall place any unused bytes at the 
start of the field (lowest offset) and the unused bytes shall be filled with 
space characters (20h).

  The vendor identification field contains eight bytes of ASCII data 
identifying the vendor of the product.  The data shall be left aligned within 
this field.  





  NOTE:  It is intended that this field provide a unique vendor identification 
  of the manufacturer of the SCSI device.  In the absence of a formal 
  registration procedure, X3T9.2 maintains a list of vendor identification 
  codes in use.  Vendors are requested to voluntarily submit their 
  identification codes to X3T9.2 to prevent duplication of codes (see Appendix 
  J).

  The product identification field contains sixteen bytes of ASCII data as 
defined by the vendor.  The data shall be left-aligned within this field.

  The product revision level field contains four bytes of ASCII data as 
defined by the vendor.  The data shall be left-aligned within this field.

7.2.5.2. Vital Product Data
  Implementation of vital product data is optional.  The information returned 
consists of configuration data (e.g., vendor identification, product 
identification, model, serial number), manufacturing data (e.g., plant and 
date of manufacture), field replaceable unit data and other vendor- or device-
specific data.  

  The initiator requests the vital product data information by setting the 
EVPD bit to one and specifying the page code of the desired vital product data 
(see Table 7-72).  If the target does not implement the requested page it 
shall return CHECK CONDITION status.  The a sense key shall be set to ILLEGAL 
REQUEST and the additional sense code shall be set to INVALID FIELD IN CDB.

  IMPLEMENTORS NOTES: 
  (1) It is recommended that the target have the ability to execute the 
  INQUIRY command even when a device error occurs which prohibits normal 
  command execution.  In such a case, CHECK CONDITION status would be returned 
  for commands other than INQUIRY or REQUEST SENSE.  The sense data returned 
  may contain the field replaceable unit code.  The vital product data would 
  be obtained for the failing device using the INQUIRY command.
  (2) This standard defines a format which allows device-independent initiator 
  software to display the vital product data returned by the INQUIRY command.  
  For example, the initiator may display the data associated for the field 
  replaceable unit returned in the sense data.  The contents of the data may 
  be vendor-specific; therefore it may not be usable without detailed 
  information about the device.
  (3) This standard does not define the location or method of storing the 
  vital product data.  The retrieval of the data may require completion of 
  initialization operations within the device which may induce delays before 
  the data is available to the initiator.  Time-critical requirements are an 
  implementation consideration and are not addressed in this standard.











7.2.6. LOG SELECT Command


                        Table 7-19: LOG SELECT Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (4Ch)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |              Reserved    |  PCR   |   SP   |
-----|-----------------------------------------------------------------------|
 2   |        PC       |         Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 4   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 5   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 6   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 7   | (MSB)                                                                 |
-----|---                        Parameter List Length                    ---|
 8   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 9   |                           Control                                     |
==============================================================================


  The LOG SELECT command (Table 7-19) provides a means for the initiator to 
manage statistical information maintained by the device about the device or 
its logical units.  Targets that implement the LOG SELECT command shall also 
implement the LOG SENSE command.  Structures in the form of log parameters 
within log pages are defined as a way to manage the log data. The LOG SELECT 
command provides for sending zero or more log pages during a DATA OUT phase.  
This standard defines the format of the log pages, but does not define the 
exact conditions and events which are logged.

  A parameter code reset (PCR) bit of one and a parameter list length of zero 
shall cause all implemented parameters to be set to the target-defined default 
values (e.g., zero).  If the PCR bit is one and a the parameter list length is 
greater than zero the command is terminated with CHECK CONDITION status.  The 
sense key shall be set to ILLEGAL REQUEST and the additional sense code shall 
be set to INVALID FIELD IN CDB.  A PCR bit of zero specifies that the log 
parameters shall not be reset.

  A save parameters (SP) bit of one indicates that after performing the 
specified LOG SELECT operation the target shall save to non-volatile memory 
all parameters identified as savable by the DS bit in the log page (see 
7.3.2).  A SP bit of zero specifies that parameters shall not be saved.



  Saving of log parameters is optional and indicated for each log parameter by 
the DS bit in the page.  Log parameters may be saved at vendor-specific times 
subject to the TSD bit (see 7.3.2) in the log parameter.  If the target does 
not implement saved parameters for any log parameter and the SP bit is set to 
one, the command shall be terminated with CHECK CONDITION status.  The sense 
key shall be set to ILLEGAL REQUEST, and the additional sense code set to 
INVALID FIELD IN CDB. 

  It is not an error to set the SP bit to one and to set the DS bit of a log 
parameter to one.  In this case, the parameter value for that log parameter is 
not saved.

  The page control (PC) field defines the type of parameter values to be 
selected.  The page control field is defined in Table 7-20.

                        Table 7-20: Page Control Field

         ============================================================
                             Type of Parameter Values 
         Value         LOG SENSE                   LOG SELECT
         -----  -------------------------  --------------------------
         00b    Current Threshold Values    Threshold Values     
         01b    Current Cumulative Values   Cumulative Values     
         10b    Default Threshold Values    Default Threshold Values
         11b    Default Cumulative Values   Default Cumulative Values
         ============================================================

  The current cumulative values may be updated by the target or by the 
initiator using the LOG SELECT command to reflect the cumulative number of 
events experienced by the target.  Fields in the parameter control byte 
(7.3.2) of each log parameter control the updating and saving of the current 
cumulative parameters.  

  The target shall set the current threshold parameters to the default 
threshold values in response to a LOG SELECT command with the PC field set to 
10b and the parameter list length field set to zero.

  The target shall set all cumulative parameters to their default values in 
response to a LOG SELECT command with the PC field set to 11b and the 
parameter list length field set to zero. 

  The current threshold value can only be modified by the initiator via the 
LOG SELECT command.  If the initiator attempts to change current threshold 
values that are not available or not implemented for that log parameter, then 
the target shall terminate the LOG SELECT command with CHECK CONDITION status, 
the sense key set to ILLEGAL REQUEST, and the additional sense code set to 
INVALID FIELD IN PARAMETER LIST.  The saving of current threshold parameters 
and the criteria for the current threshold being met are controlled by bits in 
the parameter control byte (7.3.2). 

  IMPLEMENTORS NOTE: Pages or log parameters that are not available may become 
  available at some later time (e.g., after the device has become ready).



  The parameter list length field specifies the length in bytes of the 
parameter list that shall be transferred from the initiator to the target 
during the DATA OUT phase.  A parameter list length of zero indicates that no 
pages shall be transferred.  This condition shall not be considered an error.  
If the initiator sends page codes or parameter codes within the parameter list 
that are reserved or not implemented by the target, the target shall terminate 
the LOG SELECT command with CHECK CONDITION status.  The sense key shall be 
set to ILLEGAL REQUEST and the additional sense code set to INVALID FIELD IN 
PARAMETER LIST.

  If a parameter list length results in the truncation of any log parameter, 
the target shall terminate the command with CHECK CONDITION status.  The sense 
key shall be set to ILLEGAL REQUEST and the additional sense code set to 
INVALID FIELD IN CDB. 

  The initiator should send pages in ascending order by page code value if 
multiple pages are sent during a DATA OUT phase.  If multiple log parameters 
within a page are sent during the DATA OUT phase then they should be sent in 
ascending order by parameter code value.  The target shall return CHECK 
CONDITION status if the initiator sends pages out of order or parameter codes 
out of order.  The sense key shall be set to ILLEGAL REQUEST and the 
additional sense code set to INVALID FIELD IN PARAMETER LIST.

  IMPLEMENTORS NOTE:  Initiators should issue LOG SENSE commands prior to 
  issuing LOG SELECT commands to determine supported pages and page lengths.

  The target may provide independent sets of log parameters for each logical 
unit or for each combination of logical units and initiators.  If the target 
does not support independent sets of log parameters and any log parameters are 
changed that affect other initiators, then the target shall generate an unit 
attention condition for all initiators except the one that issued the LOG 
SELECT command (see 6.9).  This unit attention condition is returned with an 
additional sense code of LOG PARAMETERS CHANGED.

  If the initiator sends a log parameter that is not supported by the target, 
the target shall terminate the command with CHECK CONDITION status, set the 
sense key to ILLEGAL REQUEST, and set the additional sense code to INVALID 
FIELD IN PARAMETER LIST.

















7.2.7. LOG SENSE Command


                        Table 7-21: LOG SENSE Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (4Dh)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |         Reserved         |  PPC   |    SP  |
-----|-----------------------------------------------------------------------|
 2   |        PC        |        Page Code                                   |
-----|-----------------------------------------------------------------------|
 3   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 4   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 5   | (MSB)                                                                 |
-----|---                        Parameter Pointer                        ---|
 6   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 7   | (MSB)                                                                 |
-----|---                        Allocation Length                        ---|
 8   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 9   |                           Control                                     |
==============================================================================


  The LOG SENSE command (Table 7-21) provides a means for the initiator to 
retrieve statistical information maintained by the device about the device or 
its logical units.  It is a complementary command to the LOG SELECT command.

  The parameter pointer control (PPC) bit controls the type of parameters 
requested from the target:
  (1) A PPC bit of one indicates that the target shall return a log page with 
parameter code values which have changed since the last LOG SELECT or LOG 
SENSE command.  The target shall return only those parameter codes following 
the parameter pointer field.
  (2) A PPC bit of zero indicates that the log parameter requested from the 
target shall begin with the parameter code specified in the parameter pointer 
field and return the number of bytes specified by the allocation length field 
in ascending order of parameter codes from the specified log page.  A PPC bit 
of zero and a parameter pointer field of zero shall cause all available log 
parameters for the specified log page to be returned to the initiator subject 
to the specified allocation length.

  Saving parameters is an optional function of the LOG SENSE command.  If the 
target does not implement saving log parameters and if the save parameters 
(SP) bit is one, then the target shall return CHECK CONDITION status, set the 
sense key to ILLEGAL REQUEST, and set the additional sense code to INVALID 
FIELD IN CDB. 

  A SP bit of zero indicates the target shall perform the specified LOG SENSE 
command and shall not save any log parameters.  If saving log parameters is 
implemented, a SP bit of one indicates that the target shall perform the 
specified LOG SENSE command and shall save all log parameters identified as 
savable by the DS bit (7.3.2) to a non-volatile vendor-specific location. 

  The page control (PC) field defines the type of parameter values to be 
selected (see 7.2.6 for the definition of the page control field).  The 
parameter values returned by a LOG SENSE command are determined as follows:
  (1) The specified parameter values at the last update (in response to a LOG 
SELECT or LOG SENSE command or done automatically by the target for cumulative 
values).
  (2) The saved values if an update has not occurred since the last power-on, 
hard RESET condition, or BUS DEVICE RESET message and saved parameters are 
implemented.
  (3) The default values if an update has not occurred since the last power-
on, hard RESET condition, or BUS DEVICE RESET message and saved values are not 
available or not implemented.

  The page code field identifies which page of data is being requested (see 
Table 7-53).  If the page code is reserved or not implemented, the target 
shall terminate the command with CHECK CONDITION status.  The sense key shall 
be set to ILLEGAL REQUEST with the additional sense code set to INVALID FIELD 
IN CDB. 

  The parameter pointer field allows the initiator to request parameter data 
beginning from a specific parameter code to the maximum allocation length or 
the maximum parameter code supported by the target, whichever is less.  If the 
value of the parameter pointer field is larger than the largest available 
parameter code that can be returned by the target on the specified page, the 
target shall terminate the command with CHECK CONDITION status.  The sense key 
shall be set to ILLEGAL REQUEST and the additional sense code shall be set to 
INVALID FIELD IN CDB. 

  Log parameters within the specified log page shall be transferred in 
ascending order according to parameter code.



















7.2.8. MODE SELECT(6) Command


                      Table 7-22: MODE SELECT(6) Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (15h)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |   PF   |         Reserved         |  SP    |
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 4   |                           Parameter List Length                       |
-----|-----------------------------------------------------------------------|
 5   |                           Control                                     |
==============================================================================


  The MODE SELECT(6) command (Table 7-22) 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.

  If a target supports saved pages, it may save only one copy of the page for 
each logical unit and have it apply to all initiators or it may save separate 
copies for each initiator for each logical unit.  If separate copies are 
saved, the target shall maintain separate current values for each I_T_L nexus. 
Pages which are common to all initiators are not required to have multiple 
copies. 

  If an initiator sends a MODE SELECT command that changes any parameters that 
apply to other initiators, the target shall generate a unit attention 
condition for all initiators except the one that issued the MODE SELECT 
command (see 6.9).  The target shall set the additional sense code to MODE 
PARAMETERS CHANGED. 

  The target may provide for independent sets of parameters for each attached 
logical unit or for each combination of logical unit and initiator.  If 
independent sets of parameters are implemented, and a third party reservation 
is requested the target transfers the set of parameters in effect for the 
initiator of the RESERVE command to the parameters used for commands from the 
third party device (see 8.2.12.3 and 9.2.10.1).

  A page format (PF) bit of zero indicates that the MODE SELECT parameters are 
as specified in SCSI-1, (i.e., all parameters after the block descriptors are 
vendor-specific.  A PF bit of one indicates that the MODE SELECT parameters 
following the header and block descriptor(s) are structured as pages of 
related parameters and are as specified in this standard.

  A save pages (SP) bit of zero indicates the target shall perform the 
specified MODE SELECT operation, and shall not save any pages.  A SP bit of 
one indicates that the target shall perform the specified MODE SELECT 
operation, and shall save to a non-volatile vendor-specific location all the 
savable pages including any sent during the DATA OUT phase.  The SP bit is 
optional, even when mode pages are supported by the target.  Pages which are 
saved are identified by the parameter savable bit that is returned in the page 
header by the MODE SENSE command (see 7.2.10.4).  If the target does not 
implement saved pages and the SP bit is set to one, the command shall be 
terminated with CHECK CONDITION status. The sense key shall be set to ILLEGAL 
REQUEST, and the additional sense code shall be set to INVALID FIELD IN CDB.

  The parameter list length field specifies the length in bytes of the MODE 
SELECT parameter list that shall be transferred from the initiator to the 
target during the DATA OUT phase.  A parameter list length of zero indicates 
that no data shall be transferred.  This condition shall not be considered as 
an error.  A parameter list length that results in the truncation of any 
descriptor, header or page of parameters shall cause the target to terminate 
the command with CHECK CONDITION status.  The sense key shall be set to 
ILLEGAL REQUEST, and the additional sense code shall be set to PARAMETER LIST 
LENGTH ERROR. 

  The parameter list for the MODE SELECT and MODE SENSE commands is defined in 
7.3.3.  Parts of each parameter list are uniquely defined for each device-
type.  

  IMPLEMENTORS NOTE:  In some situations where there is a conflict between the 
  information in the command descriptor block and the information in the 
  parameter list, one of several additional sense codes may apply.  As a 
  guide, INVALID FIELD IN CDB or PARAMETER LIST LENGTH ERROR should be used if 
  the error is detected prior to any operations that alter the logical unit's 
  mode parameters.  INVALID FIELD IN PARAMETER LIST should be used if the 
  logical unit's mode parameters have been altered.  

  The target shall terminate the MODE SELECT command with CHECK CONDITION 
status, set the sense key to ILLEGAL REQUEST and set the additional sense code 
to INVALID FIELD IN PARAMETER LIST for the following conditions:
  (1) If the initiator attempts to change any field that is not changeable as 
reported by the target.  In this case, no parameters shall be changed by this 
command.
  (2) If the initiator attempts to send an unsupported value or a non-zero 
value to a reserved field  in the MODE SELECT header, block descriptor, or any 
page header.
  (3) If an initiator attempts to send a page with a length not equal to the 
parameter length reported for that page by the MODE SENSE command.
  (4) If the initiator attempts to send a value for a parameter that is 
outside the range supported by the target and rounding is not implemented for 
that parameter.







  If the initiator sends a value for a parameter that is outside the range 
supported by the target and rounding is implemented for that parameter, the 
target may either:
  (1) round the parameter to an acceptable value and terminate the command as 
described in 6.5.4.
  (2) terminate the command with CHECK CONDITION status, the sense key set to 
ILLEGAL REQUEST, and the additional sense code set to INVALID FIELD IN 
PARAMETER LIST.

7.2.9. MODE SELECT(10) Command


                     Table 7-23: MODE SELECT(10) Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (55h)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |   PF   |         Reserved         |  SP    |
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 4   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 5   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 6   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 7   | (MSB)                                                                 |
-----|---                        Parameter List Length                    ---|
 8   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 9   |                           Control                                     |
==============================================================================


  The MODE SELECT(10) command (Table 7-23) provides a means for the initiator 
to specify medium, logical unit, or peripheral device parameters to the 
target.  See the MODE SELECT(6) command (7.2.8) for a description of the 
fields in this command.  Initiators should issue MODE SENSE prior to MODE 
SELECT to determine supported pages, page lengths, and other parameters.

  Targets that implement the MODE SELECT(10) command shall also implement the 
MODE SENSE(10) command.  







7.2.10. MODE SENSE(6) Command


                      Table 7-24: MODE SENSE(6) Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (1Ah)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |Reserved|   DBD  |         Reserved         |
-----|-----------------------------------------------------------------------|
 2   |       PC        |                   Page Code                         |
-----|-----------------------------------------------------------------------|
 3   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 4   |                           Allocation Length                           |
-----|-----------------------------------------------------------------------|
 5   |                           Control                                     |
==============================================================================


  The MODE SENSE(6) command (Table 7-24) provides a means for a target to 
report parameters to the initiator.  It is a complementary command to the MODE 
SELECT(6) command. 

  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 
7.3.3), at the target's discretion.  A DBD bit of one specifies that the 
target shall not return any block descriptors in the returned MODE SENSE data.

  The page control (PC) field defines the type of parameter values to be 
returned. The page control field is defined in Table 7-25.

                        Table 7-25: Page Control Field

               ================================================
               Bit 7  Bit 6  Type of Parameter Values  Section
               -----  -----  ------------------------  --------
                 0      0    Current Values            7.2.10.1
                 0      1    Changeable Values         7.2.10.2
                 1      0    Default Values            7.2.10.3
                 1      1    Saved Values              7.2.10.4
               ================================================










  The page code specifies which page or pages to return.  Page code usage is 
defined in Table 7-26.

                 Table 7-26: Page Code Usage for All Devices 

          ==========================================================
          Page Code   Description                                  
          ---------   ----------------------------------------------
             00h      Vendor Specific (does not require page format)
          01h - 1Fh   See specific device-types
          20h - 3Eh   Vendor Specific (page format required)
             3Fh      Return all pages 
          ==========================================================


  An initiator may request any one or all of the supported pages of a target. 
If an initiator attempts a MODE SENSE command with a page code value not 
implemented by the target, the target shall return CHECK CONDITION status and 
shall set the sense key to ILLEGAL REQUEST and the additional sense code to 
INVALID FIELD IN CDB. 

  A page code of 3Fh indicates that all pages implemented by the target shall 
be returned to the initiator.  Page 00h, if implemented, shall be returned 
after all other pages.  Targets that implement more than 256 bytes of mode 
page parameter data and block descriptors shall return CHECK CONDITION status 
to a MODE SENSE(6) request of 3Fh in the page code field.  The sense key shall 
be set to ILLEGAL REQUEST and the additional sense code shall be set to 
INVALID FIELD IN CDB. 

  IMPLEMENTORS NOTES:  
  (1) Targets that support more than 256 bytes of block descriptors and 
  parameter pages should consider implementing the MODE SELECT(10) and MODE 
  SENSE(10) commands.  Targets might not support an entire mode page as 
  defined in this standard.  Typically, the mode pages are returned in 
  ascending order (except for page 00h).
  (2) A target that receives a MODE SENSE command with a PC field and a page 
  code field of zero should return a mode parameter header and block 
  descriptor (if applicable).  This allows for compatibility with existing 
  SCSI-1 initiators.

  The parameter list for MODE SELECT and MODE SENSE is defined in 7.3.3.  
Parts of the parameter lists are specifically defined for each device type. 

7.2.10.1. Current Values
  A PC field value of 0h requests the target to return the current parameter 
values for the specified page code for the logical unit.  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 since 
the last power-on, hard RESET condition, or BUS DEVICE RESET message.
  (3) The default values if saved values are not available or not supported.




7.2.10.2. Changeable Values
  A PC field value of 1h requests the target to return the changeable 
parameter mask for the page code specified.  The page requested shall be 
returned containing information that indicates which parameters are 
changeable.  All bits of parameters that are changeable shall be set to one.  
All bits of parameters that are target defined (not changeable by the 
initiator) shall be set to zero.

  NOTE: An attempt to change a target-defined parameter (via MODE SELECT) 
  results in an error condition (see 7.2.8).

  IMPLEMENTORS NOTE:  The initiator should issue a MODE SENSE command with the 
  PC field set to 1h and the page code field set to 3Fh to determine which 
  pages are supported, which parameters within the pages are changeable, and 
  the supported length of each page prior to issuing any MODE SELECT commands.

7.2.10.3. Default Values
  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 each supported 
parameter set to its default value.  Parameters not supported by the target 
shall be set to zero. 

7.2.10.4. Saved Values
  A PC field value of 3h requests the target return the saved values for the 
page code specified.  Implementation of saved page parameters is optional.  
The page requested shall be returned with the parameters set to their saved 
values.  Parameters not supported by the target shall be set to zero.  If 
saved values are not implemented, the command shall be terminated with CHECK 
CONDITION status with the sense key set to ILLEGAL REQUEST and the additional 
sense code set to SAVING PARAMETERS NOT SUPPORTED.

  IMPLEMENTORS NOTE:  The method of saving parameters is vendor-specific.  The 
  parameters are preserved in such a manner that they are retained when the 
  target is powered down.  All savable pages can be considered saved when a 
  MODE SELECT command issued with the SP bit set to one has returned a GOOD 
  status or after the successful completion of a FORMAT UNIT command. 

7.2.10.5. Initial Responses
  After a power-up condition or hard reset condition, the target shall respond 
in the following manner:
  (1) If default values are requested, report the default values.
  (2) If saved values are requested, report valid restored parameters, or 
restore the parameters and report them.  If the saved parameters are not able 
to be accessed from the non-volatile vendor-specific location, terminate the 
command with CHECK CONDITION status and the sense key set to NOT READY.  If 
saved parameters are not implemented respond as defined in 7.2.10.4.
  (3) If current values are requested and current values have not been sent by 
the initiator (via a MODE SELECT command), the target may return either the 
default or saved parameters (if implemented), as defined above.  If current 
values have been sent, the current values shall be reported. 





7.2.11. MODE SENSE(10) Command


                      Table 7-27: MODE SENSE(10) Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (5Ah)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |Reserved|  DBD   |         Reserved         |
-----|-----------------------------------------------------------------------|
 2   |       PC        |                   Page Code                         |
-----|-----------------------------------------------------------------------|
 3   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 4   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 5   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 6   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 7   | (MSB)                                                                 |
-----|---                        Allocation Length                        ---|
 8   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 9   |                           Control                                     |
==============================================================================


  The MODE SENSE(10) command (Table 7-27) provides a means for a target to 
report parameters to the initiator.  It is a complementary command to the MODE 
SELECT(10) command.  If the MODE SELECT(10) command is implemented the MODE 
SENSE(10) command shall be implemented.  See the MODE SENSE(6) command for a 
description of the fields in this command.



















7.2.12. READ BUFFER


                       Table 7-28: READ BUFFER Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (3Ch)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |     Reserved    |           Mode           |
-----|-----------------------------------------------------------------------|
 2   |                           Buffer ID                                   |
-----|-----------------------------------------------------------------------|
 3   | (MSB)                                                                 |
- - -|- -                        Buffer Offset                            - -|
 5   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 6   | (MSB)                                                                 |
- - -|- -                        Allocation Length                        - -|
 8   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 9   |                           Control                                     |
==============================================================================


  The READ BUFFER command (Table 7-28) is used in conjunction with the WRITE 
BUFFER command as a diagnostic function for testing target memory and the SCSI 
bus integrity.  This command shall not alter the medium.

  The function of this command and the meaning of fields within the command 
descriptor block depend on the contents of the mode field.  The mode field is 
defined in Table 7-29.

                      Table 7-29: READ BUFFER Mode Field

               ===============================================
               Mode  Description               Type
               ----  ------------------------  ---------------
               000b  Combined header and data  Optional
               001b  Vendor-specific           Vendor specific
               010b  Data                      Optional
               011b  Descriptor                Optional
               100b  Reserved                  Reserved
               101b  Reserved                  Reserved
               110b  Reserved                  Reserved
               111b  Reserved                  Reserved
               ===============================================

  IMPLEMENTORS NOTE: Modes 000b and 001b are included for compatibility with 
  products that were designed prior to the generation of this standard.  Some 
  products that were designed prior to the generation of this standard 
  restrict the available length to to 65535 bytes.

7.2.12.1. Combined Header and Data Mode (000b)
  In this mode, a four-byte header followed by data bytes are returned to the 
initiator during the DATA IN phase.  The buffer ID and the buffer offset 
fields are reserved. 

  The four-byte READ BUFFER header (Table 7-30) is followed by data bytes from 
the target's data buffer.

                        Table 7-30: READ BUFFER Header

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 1   | (MSB)                                                                 |
- - -|- -                        Buffer Capacity                          - -|
 3   |                                                                 (LSB) |
==============================================================================


  The buffer capacity field specifies the total number of data bytes that are 
available in the target's data buffer.  This number is not reduced to reflect 
the allocation length nor is it reduced to reflect the actual number of bytes 
written using the WRITE BUFFER command.  Following the READ BUFFER header, the 
target shall transfer data from its data buffer.  The target terminates the 
DATA IN phase when allocation length bytes of header plus data have been 
transferred or when all available header and buffer data have been transferred 
to the initiator, whichever is less.

7.2.12.2. Vendor-Specific Mode (001b)
  In this mode, the meaning of the buffer ID, buffer offset, and allocation 
length fields are not specified by this standard.

7.2.12.3. Data Mode (010b)
  In this mode, the DATA IN phase contains buffer data.  The buffer ID field 
identifies a specific buffer within the target from which data shall be 
transferred.  The vendor assigns buffer ID codes to buffers within the target. 
Buffer ID zero shall be supported.  If more than one buffer is supported, 
additional buffer ID codes shall be assigned contiguously, beginning with one. 
Buffer ID code assignments for the READ BUFFER command shall be the same as 
for the WRITE BUFFER command.  If an unsupported buffer ID code is selected, 
the target shall return CHECK CONDITION status, shall set the sense key to 
ILLEGAL REQUEST and set the additional sense code to ILLEGAL FIELD IN CDB.  
The target terminates the DATA IN phase when allocation length bytes have been 
transferred or when all the available data from the buffer has been 
transferred to the initiator, whichever is less.

  The buffer offset field contains the byte offset within the specified buffer 
where data shall be transferred from.  The initiator should conform to the 
offset boundary requirements returned in the READ BUFFER descriptor (see 
7.2.12.4).  If the target is unable to accept the specified buffer offset, it 
shall return CHECK CONDITION status, shall set the sense key to ILLEGAL 
REQUEST and set the additional sense code to ILLEGAL FIELD IN CDB.

7.2.12.4. Descriptor Mode (011b)
  In this mode, a maximum of four bytes of READ BUFFER descriptor information 
are returned.  The target shall return the descriptor information for the 
buffer specified by the buffer ID (see the description of the buffer ID in 
7.2.12.3).  If there is no buffer associated with the specified buffer ID, the 
target shall return all zeros in the READ BUFFER descriptor.  The buffer 
offset field is reserved in this mode.  The allocation length should be set to 
four or greater.  The target shall transfer the lesser of the allocation 
length or four bytes of READ BUFFER descriptor.  The READ BUFFER descriptor is 
defined as shown in Table 7-31.

                      Table 7-31: READ BUFFER Descriptor

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Offset Boundary                             |
-----|-----------------------------------------------------------------------|
 1   | (MSB)                                                                 |
- - -|- -                        Buffer Capacity                          - -|
 3   |                                                                 (LSB) |
==============================================================================


  The offset boundary field returns the boundary alignment within the selected 
buffer for subsequent WRITE BUFFER and READ BUFFER commands.  The value 
contained in the offset boundary field shall be interpreted as a power of two.

  The value contained in the buffer offset field of subsequent WRITE BUFFER 
and READ BUFFER commands should be a multiple of 2offset boundary as shown in 
Table 7-32.

                      Table 7-32: Buffer Offset Boundary

==============================================================================
      Offset 
      Boundary  2Offset Boundary  Buffer Offsets
      --------  ----------------  --------------------------------------
         0           20 = 1       Byte boundaries
         1           21 = 2       Even-byte boundaries
         2           22 = 4       Four-byte boundaries
         3           23 = 8       Eight-byte boundaries
         4           24 = 16      16-byte boundaries
         .              .                .
         .              .                .
         .              .                .
        FFh     Not Applicable    0 is the only supported buffer offset.
==============================================================================


  The buffer capacity field shall return the size of the selected buffer in 
bytes.

  IMPLEMENTORS NOTE:  In a multi-tasking system, a buffer may be altered 
  between the WRITE BUFFER and READ BUFFER commands by another task.  Buffer 
  testing applications may wish to insure that only a single task is active. 
  Use of reservations (to all logical units on the device) or linked commands 
  may also be helpful in avoiding buffer alteration between these two 
  commands. 

7.2.13. RECEIVE DIAGNOSTIC RESULTS Command


                Table 7-33: RECEIVE DIAGNOSTIC RESULTS Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (1Ch)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |             Reserved                       |
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   | (MSB)                                                                 |
-----|---                        Allocation Length                        ---|
 4   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 5   |                           Control                                     |
==============================================================================


  The RECEIVE DIAGNOSTIC RESULTS command (Table 7-33) requests analysis data 
be sent to the initiator after completion of a SEND DIAGNOSTIC command (see 
7.2.15).  If the target supports the optional page format the page code field 
sent in the previous SEND DIAGNOSTIC command specifies the format of the 
returned data. 

  IMPLEMENTORS NOTES: 
  (1) To insure that the diagnostic command information is not destroyed by a 
  command sent from another initiator, the SEND DIAGNOSTIC command should 
  either be linked to the RECEIVE DIAGNOSTIC RESULTS command or the logical 
  unit should be reserved.
  (2) Although diagnostic software is generally device-specific, this command 
  and the SEND DIAGNOSTIC command provide a means to isolate the operating 
  system software from the device-specific diagnostic software. Hence the 
  operating system can remain device-independent.  This also allows diagnostic 
  software to be more easily transferred to other operating systems.

  See 7.3.1 for RECEIVE DIAGNOSTIC RESULTS page format definitions.







7.2.14. REQUEST SENSE Command


                      Table 7-34: REQUEST SENSE Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (03h)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |                  Reserved                  |
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 4   |                           Allocation Length                           |
-----|-----------------------------------------------------------------------|
 5   |                           Control                                     |
==============================================================================


  The REQUEST SENSE command (Table 7-34) requests that the target transfer 
sense data to the initiator.

  The sense data:
  (1) shall be available if the previous command to the specified I_T_x nexus 
terminated with CHECK CONDITION or COMMAND TERMINATED status
  (2) shall be available if other information (e.g., medium position) is 
available in any field
  (3) may be available if the previous command to the specified I_T_x nexus 
ended with an unexpected BUS FREE error (5.1.1).

  If the target has no sense data available to return, it shall return a sense 
key of NO SENSE and an additional sense code of NO ADDITIONAL SENSE 
INFORMATION.

  The sense data shall be preserved by the target for the initiator until 
retrieved by the REQUEST SENSE command or until the receipt of any other 
command for the same I_T_x nexus (see 6.6).  Sense data shall be cleared upon 
receipt of any subsequent command (including REQUEST SENSE) to the same I_T_x 
nexus.

  IMPLEMENTORS NOTE: Some target implementations do not update sense data 
  except on commands that return CHECK CONDITION or COMMAND TERMINATED status.  
  Thus when polling for a logical unit to become ready, the initiator should 
  issue TEST UNIT READY commands until GOOD status is returned.  If desired, 
  the initiator may issue REQUEST SENSE commands after the TEST UNIT READY 
  commands that return CHECK CONDITION or COMMAND TERMINATED status to obtain 
  the sense data.




  The target shall return CHECK CONDITION status for a REQUEST SENSE command 
only to report errors specific to the command itself.  For example:
  (1) A non-zero reserved bit is detected in the command descriptor block.
  (2) An unrecovered parity error is detected on the data bus. 
  (3) A target malfunction prevents return of the sense data.

  If a recovered error occurs during the execution of the REQUEST SENSE 
command, the target shall return the sense data with GOOD status.  If a target 
returns CHECK CONDITION status for a REQUEST SENSE command the sense data may 
be invalid. 

  IMPLEMENTORS NOTE:  The sense data appropriate to the selection of an 
  invalid logical unit is defined in 6.5.3.

  Targets shall be capable of returning eighteen bytes of data in response to 
a REQUEST SENSE command.  If the allocation length is eighteen or greater and 
a target returns less than eighteen bytes of data the initiator should assume 
that the bytes not transferred would have been zeros had the target returned 
those bytes.  Initiators can determine how much sense data has been returned 
by examining the allocation length parameter in the command descriptor block 
and the additional sense length in the sense data.  Targets shall not adjust 
the additional sense length to reflect truncation if the allocation length is 
less than the sense data available. 
































            Table 7-35: Error Codes 70h and 71h Sense Data Format

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   | Valid  |                  Error Code (70h or 71h)                     |
-----|-----------------------------------------------------------------------|
 1   |                           Segment Number                              |
-----|-----------------------------------------------------------------------|
 2   |Filemark|  EOM   |  ILI   |Reserved|         Sense Key                 |
-----|-----------------------------------------------------------------------|
 3   | (MSB)                                                                 |
- - -|- -                        Information                              - -|
 6   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 7   |                           Additional Sense Length (n-7)               |
-----|-----------------------------------------------------------------------|
 8   | (MSB)                                                                 |
- - -|- -                        Command-Specific Information             - -|
 11  |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 12  |                           Additional Sense Code                       |
-----|-----------------------------------------------------------------------|
 13  |                           Additional Sense Code Qualifier             |
-----|-----------------------------------------------------------------------|
 14  |                           Field Replaceable Unit Code                 |
-----|-----------------------------------------------------------------------|
15 to|  SKSV  |                                                              |
- - -|---------- -               Sense-Key Specific                       - -|
 17  |                                                                       |
-----|-----------------------------------------------------------------------|
18 to|                                                                       |
- - -|- -                        Additional Sense Bytes                   - -|
 n   |                                                                       |
==============================================================================


  A valid bit of zero indicates that the information field is not as defined 
in this standard.  A valid bit of one indicates the information field contains 
valid information as defined in this standard.  Targets shall implement the 
valid bit.

  The sense data format for error codes 70h (current errors) and 71h (deferred 
errors) are defined in Table 7-35.  Error code values of 72h to 7Eh are 
reserved.  Error code 7Fh is for a vendor-specific sense data format.  Targets 
shall implement error code 70h; implementation of error code 71h is optional. 
Error code values of 00h to 6Fh are not defined by this standard and their use 
is not recommended.  

  The segment number field contains the number of the current segment 
descriptor if the REQUEST SENSE command is in response to a COPY, COMPARE, or 
COPY AND VERIFY command.  Up to 256 segments are supported beginning with 
segment zero.  

  The filemark bit is mandatory for sequential-access devices and this bit is 
reserved for all other device types.  A filemark bit of one indicates that the 
current command has read a filemark or setmark.  The additional sense code 
field may be used to indicate whether a filemark or setmark was read.  
Reporting of setmarks is optional and indicated by the RSmk bit for 
sequential-access devices in the configuration parameters page (see 9.3.3).

  The end-of-medium (EOM) bit is mandatory for sequential-access and printer 
devices and this bit is reserved for all other device types.  An EOM bit of 
one indicates that an end-of-medium condition (end-of-partition, beginning-of-
partition, out-of-paper, etc.) exists.  For sequential-access devices, this 
bit indicates that the unit is at or past the early-warning if the direction 
was forward or that the command could not be completed because beginning-of-
partition was encountered if the direction was reverse.  

  An incorrect length indicator (ILI) bit of one usually indicates that the 
requested logical block length did not match the logical block length of the 
data on the medium.

  The sense key, additional sense code and additional sense code qualifier 
provide a hierarchy of information.  The intention of the hierarchy is to 
provide a top-down approach for an initiator to determine information relating 
to the error and exception conditions.  The sense key provides generic 
categories in which error and exception conditions can be reported.  
Initiators would typically use sense keys for high level error recovery 
procedures.  Additional sense codes provide further detail describing the 
sense key.  Additional sense code qualifiers add further detail to the 
additional sense code.  The additional sense code and additional sense code 
qualifier can be used by initiators where sophisticated error recovery 
procedures require detailed information describing the error and exception 
conditions.

  The sense key field is mandatory and indicates generic information 
describing an error or exception condition.  The sense keys are defined in 
Tables 7-39 and 7-40.

  The contents of the information field is device-type or command specific and 
is defined within the appropriate section for the device type or command of 
interest.  Targets shall implement the information field.  Unless specified 
otherwise, this field contains:
  (1) The unsigned logical block address associated with the sense key, for 
direct-access devices (Device Type 0), write-once devices (Device Type 4), CD-
ROM devices (Device Type 5), and optical memory devices (Device Type 7).
  (2) The difference (residue) of the requested length minus the actual length 
in either bytes or blocks, as determined by the command, for sequential-access 
devices (Device Type 1), printer devices (Device Type 2), processor devices 
(Device Type 3) and some direct access device commands, except as defined for 
(4) below. (Negative values are indicated by two's complement notation.)
  (3) The difference (residue) of the requested number of blocks minus the 
actual number of blocks copied or compared for the current segment descriptor 
of a COPY, COMPARE, or COPY AND VERIFY command.




  (4) For sequential-access devices operating in buffered modes 1h or 2h that 
detect an unrecoverable write error when unwritten data blocks, filemarks, or 
setmarks remain in the buffer, the value of the information field for all 
commands shall be:
     (a) the total number of data blocks, filemarks, and setmarks in the 
  buffer if the device is in fixed block mode (block length field of the MODE 
  SENSE block descriptor is non-zero and the fixed bit of the WRITE command is 
  one). 
     (b) the number of bytes in the buffer, including filemarks and setmarks, 
  if the device is in variable mode (the fixed bit of the WRITE command is 
  zero).   

  The additional sense length field indicates the number of additional sense 
bytes to follow.  If the allocation length of the command descriptor block is 
too small to transfer all of the additional sense bytes, the additional sense 
length is not adjusted to reflect the truncation.

  The command-specific information field contains information that depends on 
the command which was executed.  Further meaning for this field is defined 
within the command description.  The command-specific information field is 
mandatory if the target supports any of the following commands:  COPY, 
COMPARE, COPY AND VERIFY, SEARCH DATA, and REASSIGN BLOCKS.

  The additional sense code field indicates further information related to the 
error or exception condition reported in the sense key field.  Targets shall 
support the additional sense code field.  Support of the additional sense 
codes not explicitly required by this standard is optional.  A list of 
additional sense codes is in Table 7-41.  If the target does not have further 
information related to the error or exception condition, the additional sense 
code is set to NO ADDITIONAL SENSE INFORMATION.

  The additional sense code qualifier indicates detailed information related 
to the additional sense code.  The additional sense code qualifier is 
optional.  If the error or exception condition is reportable by the device the 
value returned shall be as specified in Table 7-41.  If the target does not 
have detailed information related to the error or exception condition, the 
additional sense code qualifier is set to zero.

  Non-zero values in the field replaceable unit code field are used to define 
a device-specific mechanism or unit that has failed.  A value of zero in this 
field shall indicate that no specific mechanism or unit has been identified to 
have failed or that the data is not available.  The field replaceable unit 
code field is optional. The format of this information is not specified by 
this standard.  Additional information about the field replaceable unit may be 
available in the ASCII information page (see 7.3.4.2), if supported by the 
target. 

  The sense-key specific bytes are described in 7.2.14.1, below.

  The additional sense bytes field may contain command specific data, 
peripheral device specific data, or vendor-specific data that further defines 
the nature of the CHECK CONDITION status.



7.2.14.1. Sense-Key Specific
  The sense-key specific field is defined by this standard when the value of 
the sense-key specific valid (SKSV) bit is one.  The sense-key specific valid 
bit and sense-key specific field are optional.  The definition of this field 
is determined by the value of the sense key field.  This field is reserved for 
sense keys not described below.  An SKSV value of zero indicates that this 
field is not defined by this standard. 

  If the sense key field is set to ILLEGAL REQUEST and the SKSV bit is set to 
one, the sense-key specific field shall be defined as shown in Table 7-36. 
These Field Pointer field indicates which illegal parameters in command 
descriptor blocks or data parameters are in error.

                       Table 7-36: Field Pointer Bytes

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 15  |  SKSV  |  C/D   |Reserved|Reserved|  BPV   |    Bit Pointer           |
-----|-----------------------------------------------------------------------|
 16  | (MSB)                                                                 |
-----|---                        Field Pointer                            ---|
 17  |                                                                 (LSB) |
==============================================================================


  A command data (C/D) bit of one indicates that the illegal parameter is in 
the command descriptor block.  A C/D bit of zero indicates that the illegal 
parameter is in the data parameters sent by the initiator during the DATA OUT 
phase.

  A bit pointer valid (BPV) bit of zero indicates that the value in the bit 
pointer field is not valid.  A BPV bit of one indicates that the bit pointer 
field specifies which bit of the byte designated by the field pointer field is 
in error.  When a multiple-bit field is in error, the bit pointer field shall 
point to the most-significant (left-most) bit of the field.

  The field pointer field indicates which byte of the command descriptor block 
or of the parameter data was in error.  Bytes are numbered starting from zero, 
as shown in the tables describing the commands and parameters.  When a 
multiple-byte field is in error, the pointer shall point to the most- 
significant (left-most) byte of the field.

  IMPLEMENTORS NOTE:  Bytes identified as being in error are not necessarily 
  the place that has to be changed to correct the problem.

  If the sense key is RECOVERED ERROR, HARDWARE ERROR or MEDIUM ERROR and if 
the SKSV bit is one, the sense-key specific field shall be defined as shown in 
Table 7-37. 





                     Table 7-37: Actual Retry Count Bytes

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 15  |  SKSV  |                  Reserved                                    |
-----|-----------------------------------------------------------------------|
 16  | (MSB)                                                                 |
-----|---                        Actual Retry Count                       ---|
 17  |                                                                 (LSB) |
==============================================================================


  The actual retry count field returns implementation-specific information on 
the actual number of retries of the recovery algorithm used in attempting to 
recover an error or exception condition. 

  IMPLEMENTORS NOTE: It is recommended that this field relate to the retry 
  count fields within the error recovery page of the MODE SELECT command.

  If the sense key is NOT READY and the SKSV bit is one, the sense-key 
specific field shall be defined as shown in Table 7-38.  These fields are only 
defined for the FORMAT UNIT command with the Immed bit set to one.

                 Table 7-38: Format Progress Indication Bytes

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 15  |  SKSV  |                  Reserved                                    |
-----|-----------------------------------------------------------------------|
 16  | (MSB)                                                                 |
-----|---                        Progress Indication                      ---|
 17  |                                                                 (LSB) |
==============================================================================


  The progress indication field is a percent complete indication in which the 
returned value is the numerator that has 65536 (10000h) as its denominator. 
The progress indication shall be an based upon the total format operation 
including any certification or initialization operations.

  IMPLEMENTORS NOTE: It is intended that the progress indication be time 
  related.  However, since format time varies with the number of defects 
  encountered, etc., it is reasonable for the target to assign values to 
  various steps within the process.  The granularity of these steps should be 
  small enough to provide reasonable assurances to the initiator that progress 
  is being made.





7.2.14.2. Deferred Errors
  Error code 70h indicates that the CHECK CONDITION or COMMAND TERMINATED 
status returned is the result of an error or exception condition on the 
command that returned the CHECK CONDITION or COMMAND TERMINATED status or an 
unexpected bus free condition.  This includes errors generated during 
execution of the command by the actual execution process.  It also includes 
errors not related to any command that are first observed during execution of 
a command.  Examples of this latter type of error include disk servo-mechanism 
off-track errors and power-up test errors. 

  Error Code 71h (deferred error) indicates that the CHECK CONDITION status 
returned is the result of an error or exception condition that occurred during 
execution of a previous command for which GOOD status has already been 
returned.  Such commands are associated with use of the immediate bit, with 
some forms of caching, and with multiple command buffering.  Targets that 
implement these features are required to implement deferred error reporting.

  The deferred error indication may be sent at a time selected by the target 
through the asynchronous event notification process (see 6.5.5) if AEN is 
supported by both the initiator and target.  

  If AEN is not supported, the deferred error may be indicated by returning 
CHECK CONDITION status to the the appropriate initiator as described below.  
The subsequent execution of a REQUEST SENSE command shall return the deferred 
error sense information.

  If CHECK CONDITION status for a deferred error is returned, the current 
command has not performed any storage operations or output operations to the 
media.  After the target detects a deferred error condition on a logical unit, 
it shall return a deferred error according to the rules described below: 
  (1) If a deferred error can be recovered with no external system 
intervention, a deferred error indication shall not be posted unless required 
by the error handling parameters of the MODE SELECT command.  The occurrence 
of the error may be logged if statistical or error logging is supported.
  (2) If a deferred error can be associated with a causing initiator and with 
a particular function or a particular subset of data, and the error is either 
unrecovered or required to be reported by the mode parameters, a deferred 
error indication shall be returned to the causing initiator.  If an initiator 
other than the causing initiator attempts access to the particular function or 
subset of data associated with the deferred error, a BUSY status shall be 
returned to that initiator in response to the command attempting the access.

  NOTE:  Not all devices may be sufficiently sophisticated to identify the 
  function or data that has failed.  Those that cannot should treat the error 
  in the following manner.

  (3) If a deferred error cannot be associated with a causing initiator or 
with a particular subset of data, a deferred error indication shall be 
returned on behalf of the failing logical unit to each initiator.  If multiple 
deferred errors have accumulated for some initiators, only the last error 
shall be returned.
  (4) If a deferred error cannot be associated with a particular logical unit, 
it shall be returned to the appropriate initiator for all logical units 
supported by the target.

  (5) If a current command has not yet started executing, and a deferred error 
occurs, the command shall be terminated with CHECK CONDITION status and 
deferred error information posted in the sense data.  By convention, the 
current command is considered to have started execution if the target has 
changed phase from the COMMAND phase to the next normal phase of the command 
sequence.  If a deferred error occurs while a current command is executing and 
the current command has been affected by the error, the command shall be 
terminated by CHECK CONDITION status and current error information shall be 
returned in the sense data.  In this case, if the current error information 
does not adequately define the deferred error condition, a deferred error may 
be returned after the current error information has been recovered.  If a 
deferred error occurs while a current command is executing and the current 
command completes successfully, the target may choose to return the deferred 
error information after the completion of the current command.

  IMPLEMENTORS NOTE:  Deferred errors may indicate that an operation was 
  unsuccessful long after the command performing the data transfer returned 
  GOOD status.  If data that cannot be replicated or recovered from other 
  sources is being stored using such buffered write operations, 
  synchronization commands should be performed before the critical data is 
  destroyed in the host initiator.  This is necessary to be sure that recovery 
  actions can be taken if deferred errors do occur in the storing of the data. 
  If AEN is not implemented, the synchronizing process should provide the 
  necessary commands to allow returning CHECK CONDITION status and subsequent 
  returning of deferred error sense information after all buffered operations 
  are guaranteed to be complete.





























                  Table 7-39: Sense Key (0h-7h) Descriptions

==============================================================================
Sense Key  Description
---------  -------------------------------------------------------------------
   0h      NO SENSE.  Indicates that there is no specific sense key 
           information to be reported for the designated logical unit.  This 
           would be the case for a successful command or a command that 
           received CHECK CONDITION or COMMAND TERMINATED status because one 
           of the filemark, EOM, or ILI bits is set to one.

   1h      RECOVERED ERROR.  Indicates that the last command completed 
           successfully with some recovery action performed by the target. 
           Details may be determinable by examining the additional sense bytes 
           and the information field.  When multiple recovered errors occur 
           during one command, the choice of which error to report (first, 
           last, most severe, etc.) is device specific.

   2h      NOT READY.  Indicates that the logical unit addressed cannot be 
           accessed.  Operator intervention may be required to correct this 
           condition.

   3h      MEDIUM ERROR.  Indicates that the command terminated with a non- 
           recovered error condition that was probably caused by a flaw in the 
           medium or an error in the recorded data.  This sense key may also 
           be returned if the target is unable to distinguish between a flaw 
           in the medium and a specific hardware failure (sense key 4h).

   4h      HARDWARE ERROR.  Indicates that the target detected a non- 
           recoverable hardware failure (for example, controller failure, 
           device failure, parity error, etc.) while performing the command or 
           during a self test.

   5h      ILLEGAL REQUEST.  Indicates that there was an illegal parameter in 
           the command descriptor block or in the additional parameters 
           supplied as data for some commands (FORMAT UNIT, SEARCH DATA, 
           etc.).  If the target detects an invalid parameter in the command 
           descriptor block, then it shall terminate the command without 
           altering the medium.  If the target detects an invalid parameter in 
           the additional parameters supplied as data, then the target may 
           have already altered the medium.  This sense key may also indicate 
           that an invalid IDENTIFY message was received (5.6.7).

   6h      UNIT ATTENTION.  Indicates that the removable medium may have been 
           changed or the target has been reset.  See 6.9 for more detailed 
           information about the unit attention condition. 

   7h      DATA PROTECT.  Indicates that a command that reads or writes the 
           medium was attempted on a block that is protected from this 
           operation.  The read or write operation is not performed.
==============================================================================




                  Table 7-40: Sense Key (8h-Fh) Descriptions

==============================================================================
Sense Key  Description
---------  -------------------------------------------------------------------
   8h      BLANK CHECK.  Indicates that a write-once device or a sequential-
           access device encountered blank medium or format-defined end-of-
           data indication while reading or a write-once device encountered a 
           non-blank medium while writing.

   9h      Vendor Specific.  This sense key is available for reporting vendor 
           specific conditions.

   Ah      COPY ABORTED.  Indicates a COPY, COMPARE, or COPY AND VERIFY 
           command was aborted due to an error condition on the source device, 
           the destination device, or both.  (See 7.2.3.2 for additional 
           information about this sense key.)

   Bh      ABORTED COMMAND.  Indicates that the target aborted the command. 
           The initiator may be able to recover by trying the command again.

   Ch      EQUAL.  Indicates a SEARCH DATA command has satisfied an equal 
           comparison.

   Dh      VOLUME OVERFLOW.  Indicates that a buffered peripheral device has 
           reached the end-of-partition and data may remain in the buffer that 
           has not been written to the medium.  A RECOVER BUFFERED DATA 
           command(s) may be issued to read the unwritten data from the 
           buffer.

   Eh      MISCOMPARE.  Indicates that the source data did not match the data 
           read from the medium.

   Fh      RESERVED. 

==============================================================================



















                     Table 7-41: ASC and ASCQ Assignments

==============================================================================
                 ASC AND ASCQ ASSIGNMENTS

      D          = DIRECT ACCESS DEVICE
       T         = SEQUENTIAL ACCESS DEVICE
        L        = PRINTER DEVICE
         P       = PROCESSOR DEVICE
          W      = WRITE ONCE READ MULTIPLE DEVICE
           R     = READ ONLY (CD-ROM) DEVICE
            S    = SCANNER DEVICE
             O   = OPTICAL MEMORY DEVICE
              M  = MEDIA CHANGER DEVICE
               C = COMMUNICATION DEVICE
BYTE
12 13 DTLPWRSOMC DESCRIPTION
-- --            ------------------------------------------------------------
13 00 D   W  O   ADDRESS MARK NOT FOUND FOR DATA FIELD
12 00 D   W  O   ADDRESS MARK NOT FOUND FOR ID FIELD
00 11      R     AUDIO PLAY OPERATION IN PROGRESS
00 12      R     AUDIO PLAY OPERATION PAUSED
00 14      R     AUDIO PLAY OPERATION STOPPED DUE TO ERROR
00 13      R     AUDIO PLAY OPERATION SUCCESSFULLY COMPLETED
00 04  T    S    BEGINNING-OF-PARTITION/MEDIUM DETECTED
14 04  T         BLOCK SEQUENCE ERROR
30 02 DT  WR O   CANNOT READ MEDIUM - INCOMPATIBLE FORMAT
30 01 DT  WR O   CANNOT READ MEDIUM - UNKNOWN FORMAT
52 00  T         CARTRIDGE FAULT
3F 02 DTLPWRSOMC CHANGED OPERATING DEFINITION
11 06     WR O   CIRC UNRECOVERED ERROR
30 03 DT         CLEANING CARTRIDGE INSTALLED
4A 00 DTLPWRSOMC COMMAND PHASE ERROR
2C 00 DTLPWRSOMC COMMAND SEQUENCE ERROR
2F 00 DTLPWRSOMC COMMANDS CLEARED BY ANOTHER INITIATOR
2B 00 DTLPWRSO C COPY CANNOT EXECUTE SINCE HOST CANNOT DISCONNECT
41 00 D          DATA PATH FAILURE (SHOULD USE 40 NN)
4B 00 DTLPWRSOMC DATA PHASE ERROR
11 07     W  O   DATA RESYCHRONIZATION ERROR
16 00 D   W  O   DATA SYNCHRONIZATION MARK ERROR
19 00 D      O   DEFECT LIST ERROR
19 03 D      O   DEFECT LIST ERROR IN GROWN LIST
19 02 D      O   DEFECT LIST ERROR IN PRIMARY LIST
19 01 D      O   DEFECT LIST NOT AVAILABLE
1C 00 D      O   DEFECT LIST NOT FOUND
32 01 D   W  O   DEFECT LIST UPDATE FAILURE
40 NN DTLPWRSOMC DIAGNOSTIC FAILURE ON COMPONENT NN (80H-FFH)
63 00      R     END OF USER AREA ENCOUNTERED ON THIS TRACK
00 05  T    S    END-OF-DATA DETECTED
14 03  T         END-OF-DATA NOT FOUND
00 02  T    S    END-OF-PARTITION/MEDIUM DETECTED
51 00  T     O   ERASE FAILURE
0A 00 DTLPWRSOMC ERROR LOG OVERFLOW
11 02 DT  W SO   ERROR TOO LONG TO CORRECT
==============================================================================
               Table 7-41: ASC and ASCQ Assignments (continued)

==============================================================================
BYTE
12 13 DTLPWRSOMC DESCRIPTION
-- --            ------------------------------------------------------------
03 02  T         EXCESSIVE WRITE ERRORS
3B 07   L        FAILED TO SENSE BOTTOM-OF-FORM
3B 06   L        FAILED TO SENSE TOP-OF-FORM
00 01  T         FILEMARK DETECTED
14 02  T         FILEMARK OR SETMARK NOT FOUND
09 02     WR O   FOCUS SERVO FAILURE
31 01 D L    O   FORMAT COMMAND FAILED
58 00        O   GENERATION DOES NOT EXIST
1C 02 D      O   GROWN DEFECT LIST NOT FOUND
00 06 DTLPWRSOMC I/O PROCESS TERMINATED
10 00 D   W  O   ID CRC OR ECC ERROR
22 00 D          ILLEGAL FUNCTION (SHOULD USE 20 00, 24 00, OR 26 00)
64 00      R     ILLEGAL MODE FOR THIS TRACK
28 01         M  IMPORT OR EXPORT ELEMENT ACCESSED
30 00 DT  WR OM  INCOMPATIBLE MEDIUM INSTALLED
11 08  T         INCOMPLETE BLOCK READ
48 00 DTLPWRSOMC INITIATOR DETECTED ERROR MESSAGE RECEIVED
3F 03 DTLPWRSOMC INQUIRY DATA HAS CHANGED
44 00 DTLPWRSOMC INTERNAL TARGET FAILURE
3D 00 DTLPWRSOMC INVALID BITS IN IDENTIFY MESSAGE
2C 02       S    INVALID COMBINATION OF WINDOWS SPECIFIED
20 00 DTLPWRSOMC INVALID COMMAND OPERATION CODE
21 01         M  INVALID ELEMENT ADDRESS
24 00 DTLPWRSOMC INVALID FIELD IN CDB
26 00 DTLPWRSOMC INVALID FIELD IN PARAMETER LIST
49 00 DTLPWRSOMC INVALID MESSAGE ERROR
11 05     WR O   L-EC UNCORRECTABLE ERROR
60 00       S    LAMP FAILURE
5B 02 DTLPWRSOM  LOG COUNTER AT MAXIMUM
5B 00 DTLPWRSOM  LOG EXCEPTION
5B 03 DTLPWRSOM  LOG LIST CODES EXHAUSTED
2A 02 DTL WRSOMC LOG PARAMETERS CHANGED
21 00 DT  WR OM  LOGICAL BLOCK ADDRESS OUT OF RANGE
08 00 DTL WRSOMC LOGICAL UNIT COMMUNICATION FAILURE
08 02 DTL WRSOMC LOGICAL UNIT COMMUNICATION PARITY ERROR
08 01 DTL WRSOMC LOGICAL UNIT COMMUNICATION TIME-OUT
05 00 DTL WRSOMC LOGICAL UNIT DOES NOT RESPOND TO SELECTION
4C 00 DTLPWRSOMC LOGICAL UNIT FAILED SELF-CONFIGURATION
3E 00 DTLPWRSOMC LOGICAL UNIT HAS NOT SELF-CONFIGURED YET
04 01 DTLPWRSOMC LOGICAL UNIT IS IN PROCESS OF BECOMING READY
04 00 DTLPWRSOMC LOGICAL UNIT NOT READY, CAUSE NOT REPORTABLE
04 04 DTL    O   LOGICAL UNIT NOT READY, FORMAT IN PROGRESS
04 02 DTLPWRSOMC LOGICAL UNIT NOT READY, INITIALIZING COMMAND REQUIRED
04 03 DTLPWRSOMC LOGICAL UNIT NOT READY, MANUAL INTERVENTION REQUIRED
25 00 DTLPWRSOMC LOGICAL UNIT NOT SUPPORTED
15 01 DTL WRSOM  MECHANICAL POSITIONING ERROR
53 00 DTL WRSOM  MEDIA LOAD OR EJECT FAILED
==============================================================================

               Table 7-41: ASC and ASCQ Assignments (continued)

==============================================================================
BYTE
12 13 DTLPWRSOMC DESCRIPTION
-- --            ------------------------------------------------------------
3B 0D         M  MEDIUM DESTINATION ELEMENT FULL
31 00 DT  W  O   MEDIUM FORMAT CORRUPTED
3A 00 DTL WRSOM  MEDIUM NOT PRESENT
53 02 DT  WR OM  MEDIUM REMOVAL PREVENTED
3B 0E         M  MEDIUM SOURCE ELEMENT EMPTY
43 00 DTLPWRSOMC MESSAGE ERROR
3F 01 DTLPWRSOMC MICROCODE HAS BEEN CHANGED
1D 00 D   W  O   MISCOMPARE DURING VERIFY OPERATION
11 0A DT     O   MISCORRECTED ERROR
2A 01 DTL WRSOMC MODE PARAMETERS CHANGED
07 00 DTL WRSOM  MULTIPLE PERIPHERAL DEVICES SELECTED
11 03 DT  W SO   MULTIPLE READ ERRORS
00 00 DTLPWRSOMC NO ADDITIONAL SENSE INFORMATION
00 15      R     NO CURRENT AUDIO STATUS TO RETURN
32 00 D   W  O   NO DEFECT SPARE LOCATION AVAILABLE
11 09  T         NO GAP FOUND
01 00 D   W  O   NO INDEX/SECTOR SIGNAL
06 00 D   WR OM  NO REFERENCE POSITION FOUND
02 00 D   WR OM  NO SEEK COMPLETE
03 01  T         NO WRITE CURRENT
28 00 DTLPWRSOMC NOT READY TO READY TRANSITION (MEDIUM MAY HAVE CHANGED)
5A 01 DT  WR OM  OPERATOR MEDIUM REMOVAL REQUEST
5A 00 DTLPWRSOM  OPERATOR REQUEST OR STATE CHANGE INPUT (UNSPECIFIED)
5A 03 DT  W  O   OPERATOR SELECTED WRITE PERMIT
5A 02 DT  W  O   OPERATOR SELECTED WRITE PROTECT
61 02       S    OUT OF FOCUS
4E 00 DTLPWRSOMC OVERLAPPED COMMANDS ATTEMPTED
2D 00  T         OVERWRITE ERROR ON UPDATE IN PLACE
3B 05   L        PAPER JAM
1A 00 DTLPWRSOMC PARAMETER LIST LENGTH ERROR
26 01 DTLPWRSOMC PARAMETER NOT SUPPORTED
26 02 DTLPWRSOMC PARAMETER VALUE INVALID
2A 00 DTL WRSOMC PARAMETERS CHANGED
03 00 DTL W SO   PERIPHERAL DEVICE WRITE FAULT
50 02  T         POSITION ERROR RELATED TO TIMING
3B 0C       S    POSITION PAST BEGINNING OF MEDIUM
3B 0B       S    POSITION PAST END OF MEDIUM
15 02 DT  WR O   POSITIONING ERROR DETECTED BY READ OF MEDIUM
29 00 DTLPWRSOMC POWER ON, RESET, OR BUS DEVICE RESET OCCURRED
42 00 D          POWER-ON OR SELF-TEST FAILURE (SHOULD USE 40 NN)
1C 01 D      O   PRIMARY DEFECT LIST NOT FOUND
40 00 D          RAM FAILURE (SHOULD USE 40 NN)
15 00 DTL WRSOM  RANDOM POSITIONING ERROR
3B 0A       S    READ PAST BEGINNING OF MEDIUM
3B 09       S    READ PAST END OF MEDIUM
11 01 DT  W SO   READ RETRIES EXHAUSTED
14 01 DT  WR O   RECORD NOT FOUND
14 00 DTL WRSO   RECORDED ENTITY NOT FOUND
==============================================================================
               Table 7-41: ASC and ASCQ Assignments (continued)

==============================================================================
BYTE
12 13 DTLPWRSOMC DESCRIPTION
-- --            ------------------------------------------------------------
18 02 D   WR O   RECOVERED DATA - DATA AUTO-REALLOCATED
18 05 D   WR O   RECOVERED DATA - RECOMMEND REASSIGNMENT
17 05 D   WR O   RECOVERED DATA USING PREVIOUS SECTOR ID
18 03      R     RECOVERED DATA WITH CIRC
18 01 D   WR O   RECOVERED DATA WITH ERROR CORRECTION AND RETRIES APPLIED
18 00 DT  WR O   RECOVERED DATA WITH ERROR CORRECTION APPLIED
18 04      R     RECOVERED DATA WITH LEC
17 03 DT  WR O   RECOVERED DATA WITH NEGATIVE HEAD OFFSET
17 00 DT  WRSO   RECOVERED DATA WITH NO ERROR CORRECTION APPLIED
17 02 DT  WR O   RECOVERED DATA WITH POSITIVE HEAD OFFSET
17 01 DT  WRSO   RECOVERED DATA WITH RETRIES
17 04     WR O   RECOVERED DATA WITH RETRIES AND/OR CIRC APPLIED
17 06 D   W  O   RECOVERED DATA WITHOUT ECC - DATA AUTO-REALLOCATED
17 07 D   W  O   RECOVERED DATA WITHOUT ECC - RECOMMEND REASSIGNMENT
1E 00 D   W  O   RECOVERED ID WITH ECC CORRECTION
3B 08  T         REPOSITION ERROR
36 00   L        RIBBON, INK, OR TONER FAILURE
37 00 DTL WRSOMC ROUNDED PARAMETER
5C 00 D      O   RPL STATUS CHANGE
39 00 DTL WRSOMC SAVING PARAMETERS NOT SUPPORTED
62 00       S    SCAN HEAD POSITIONING ERROR
47 00 DTLPWRSOMC SCSI PARITY ERROR
54 00    P       SCSI TO HOST SYSTEM INTERFACE FAILURE
45 00 DTLPWRSOMC SELECT OR RESELECT FAILURE
3B 00  TL        SEQUENTIAL POSITIONING ERROR
00 03  T         SETMARK DETECTED
3B 04   L        SLEW FAILURE
09 03     WR O   SPINDLE SERVO FAILURE
5C 02 D      O   SPINDLES NOT SYNCHRONIZED
5C 01 D      O   SPINDLES SYNCHRONIZED
1B 00 DTLPWRSOMC SYNCHRONOUS DATA TRANSFER ERROR
55 00    P       SYSTEM RESOURCE FAILURE
33 00  T         TAPE LENGTH ERROR
3B 03   L        TAPE OR ELECTRONIC VERTICAL FORMS UNIT NOT READY
3B 01  T         TAPE POSITION ERROR AT BEGINNING-OF-MEDIUM
3B 02  T         TAPE POSITION ERROR AT END-OF-MEDIUM
3F 00 DTLPWRSOMC TARGET OPERATING CONDITIONS HAVE CHANGED
5B 01 DTLPWRSOM  THRESHOLD CONDITION MET
26 03 DTLPWRSOMC THRESHOLD PARAMETERS NOT SUPPORTED
2C 01       S    TOO MANY WINDOWS SPECIFIED
09 00 DT  WR O   TRACK FOLLOWING ERROR
09 01     WR O   TRACKING SERVO FAILURE
61 01       S    UNABLE TO ACQUIRE VIDEO
57 00      R     UNABLE TO RECOVER TABLE-OF-CONTENTS
53 01  T         UNLOAD TAPE FAILURE
11 00 DT  WRSO   UNRECOVERED READ ERROR
11 04 D   W  O   UNRECOVERED READ ERROR - AUTO REALLOCATE FAILED
==============================================================================

               Table 7-41: ASC and ASCQ Assignments (continued)

==============================================================================
BYTE
12 13 DTLPWRSOMC DESCRIPTION
-- --            ------------------------------------------------------------
11 0B D   W  O   UNRECOVERED READ ERROR - RECOMMEND REASSIGNMENT
11 0C D   W  O   UNRECOVERED READ ERROR - RECOMMEND REWRITE THE DATA
46 00 DTLPWRSOMC UNSUCCESSFUL SOFT RESET
59 00        O   UPDATED BLOCK READ
61 00       S    VIDEO ACQUISITION ERROR
50 00  T         WRITE APPEND ERROR
50 01  T         WRITE APPEND POSITION ERROR
0C 00  T    S    WRITE ERROR
0C 02 D   W  O   WRITE ERROR - AUTO REALLOCATION FAILED
0C 01 D   W  O   WRITE ERROR RECOVERED WITH AUTO REALLOCATION
27 00 DT  W  O   WRITE PROTECTED
                 ------------------------------------------
80 XX     \
THROUGH    >     VENDOR SPECIFIC.
FF XX     /

XX 80     \
THROUGH    >     VENDOR SPECIFIC QUALIFICATION OF STANDARD ASC.
XX FF     /
                 ALL CODES NOT SHOWN ARE RESERVED.
==============================================================================

  NOTE:  Appendix I contains the ASC and ASCQ assignments in numeric order.


























7.2.15. SEND DIAGNOSTIC Command


                     Table 7-42: SEND DIAGNOSTIC Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (1Dh)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |   PF   |Reserved|SelfTest| DevOfL | UnitOfL|
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   | (MSB)                                                                 |
-----|---                        Parameter List Length                    ---|
 4   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 5   |                           Control                                     |
==============================================================================


  The SEND DIAGNOSTIC command (Table 7-42) requests the target to perform 
diagnostic operations on itself, on the logical unit, or on both.  The only 
mandatory implementation of this command is the self-test feature with the 
parameter list length of zero.  Except when the self-test bit is one, this 
command is usually followed by a RECEIVE DIAGNOSTIC RESULTS command.

  A page format (PF) bit of one specifies that the SEND DIAGNOSTIC parameters 
conform to the page structure as specified in this standard.  The 
implementation of the PF bit is optional.  See 7.3.1 for the definition of 
diagnostic pages.  A PF bit of zero indicates that the SEND DIAGNOSTIC 
parameters are as specified in SCSI-1 (i.e., all parameters are vendor 
specific).

  A self-test (SelfTest) bit of one directs the target to complete its default 
self-test.  If the self-test successfully passes, the command shall be 
terminated with GOOD status; otherwise, the command shall be terminated with 
CHECK CONDITION status and the sense key shall be set to HARDWARE ERROR.

  A self-test bit of zero requests that the target perform the diagnostic 
operation specified in the parameter list.  The diagnostic operation might or 
might not require a target to return data which contains diagnostic results.  
If the return of data is not required, the return of GOOD status indicates 
successful completion of the diagnostic operation.  If the return of data is 
required the target shall either:
  (1) perform the requested diagnostic operation, prepare the data to be 
returned and indicate completion by returning GOOD status.  The initiator 
issues a RECEIVE DIAGNOSTIC RESULTS command to recover the data.
  (2) accept the parameter list and if no errors are detected in the parameter 
list return GOOD status.  The requested diagnostic operation and the 
preparation of the data to be returned is performed upon receipt of a RECEIVE 
DIAGNOSTIC RESULTS command.

  IMPLEMENTORS NOTE:  To insure that the diagnostic command information is not 
  destroyed by a command sent from another initiator, the SEND DIAGNOSTIC 
  command should either be linked to the RECEIVE DIAGNOSTIC RESULTS command or 
  the logical unit should be reserved.

  The device off-line (DevOfL) and unit off-line (UnitOfL) bits are generally 
set by operating system software, while the parameter list is prepared by 
diagnostic application software.  These bits grant permission to perform 
vendor-specific diagnostic operations on the target which may be visible to 
attached initiators.  Thus, by preventing operations that are not enabled by 
these bits, the target assists the operating system in protecting its 
resources.

  A UnitOfL bit of one grants permission to the target to perform diagnostic 
operations that may affect the user accessible medium on the logical unit, 
e.g., write operations to the user accessible medium, or repositioning of the 
medium on sequential access devices.  The implementation of the UnitOfl bit is 
optional.  A UnitOfL bit of zero prohibits any diagnostic operations that may 
be detected by subsequent I/O processes.  

  A DevOfl bit of one grants permission to the target to perform diagnostic 
operations that may affect all the logical units on a target, e.g., alteration 
of reservations, log parameters, or sense data. The implementation of the 
DevOfl bit is optional.  A DevOfL bit of zero prohibits diagnostic operations 
that may be detected by subsequent I/O processes.

  The parameter list length field specifies the length in bytes of the 
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.  If the specified 
parameter list length results in the truncation of one or more pages (PF bit 
set to one) the target shall return CHECK CONDITION status with a sense key of 
ILLEGAL REQUEST and an additional sense code of INVALID FIELD IN CDB.  

  See the implementors note under the RECEIVE DIAGNOSTIC RESULTS command in 
7.2.13.



















7.2.16. TEST UNIT READY Command


                     Table 7-43: TEST UNIT READY Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (00h)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |                  Reserved                  |
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 4   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 5   |                           Control                                     |
==============================================================================


  The TEST UNIT READY command (Table 7-43) provides a means to check if the 
logical unit is ready.  This is not a request for a self-test.  If the logical 
unit would accept an appropriate medium-access command without returning CHECK 
CONDITION status, this command shall return a GOOD status.  If the logical 
unit cannot become operational or is in a state such that an initiator action 
(e.g., START UNIT command) is required to make the unit ready the target shall 
return CHECK CONDITION status with a sense key of NOT READY.

  Table 7-44 defines the preferred responses to the TEST UNIT READY command. 
Higher-priority responses (e.g., BUSY or RESERVATION CONFLICT) are also 
permitted. 

               Table 7-44: Preferred TEST UNIT READY Responses

==============================================================================
Status           Sense Key        Additional Sense Code and 
                                  Additional Sense Code Qualifier
---------------  ---------------  --------------------------------------------
GOOD             NO SENSE         NO ADDITIONAL SENSE INFORMATION or other 
                                  valid additional sense code.
CHECK CONDITION  ILLEGAL REQUEST  LOGICAL UNIT NOT SUPPORTED 
CHECK CONDITION  NOT READY        LOGICAL UNIT DOES NOT RESPOND TO SELECTION
CHECK CONDITION  NOT READY        MEDIUM NOT PRESENT
CHECK CONDITION  NOT READY        LOGICAL UNIT NOT READY, CAUSE NOT REPORTABLE
CHECK CONDITION  NOT READY        LOGICAL UNIT IS IN PROCESS OF BECOMING READY
CHECK CONDITION  NOT READY        LOGICAL UNIT NOT READY, INITIALIZING COMMAND
                                  REQUIRED
CHECK CONDITION  NOT READY        LOGICAL UNIT NOT READY, MANUAL INTERVENTION
                                  REQUIRED
CHECK CONDITION  NOT READY        LOGICAL UNIT NOT READY, FORMAT IN PROGRESS
==============================================================================


7.2.17. WRITE BUFFER Command


                       Table 7-45: WRITE BUFFER Command

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Operation Code (3Bh)                        |
-----|-----------------------------------------------------------------------|
 1   | Logical Unit Number      |     Reserved    |          Mode            |
-----|-----------------------------------------------------------------------|
 2   |                           Buffer ID                                   |
-----|-----------------------------------------------------------------------|
 3   | (MSB)                                                                 |
- - -|- -                        Buffer Offset                            - -|
 5   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 6   | (MSB)                                                                 |
- - -|- -                        Parameter List Length                    - -|
 8   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 9   |                           Control                                     |
==============================================================================


  The WRITE BUFFER command (Table 7-45) is used in conjunction with the READ 
BUFFER command as a diagnostic for testing target memory and the SCSI bus 
integrity.  Additional modes are provided for downloading microcode and for 
downloading and saving microcode.

  This command shall not alter any medium of the target when the data mode or 
the combined header and data mode is specified.  

  The function of this command and the meaning of fields within the command 
descriptor block depend on the contents of the mode field.  The mode field is 
defined in Table 7-46.

                     Table 7-46: WRITE BUFFER Mode Field

           =======================================================
                                                   Implementation
           Mode   Description                      Requirements
           ----   ------------------------------   ---------------
           000b   Write combined header and data   Optional
           001b   Vendor specific                  Vendor specific
           010b   Write data                       Optional
           011b   Reserved                         Reserved
           100b   Download Microcode               Optional
           101b   Download Microcode and Save      Optional
           110b   Reserved                         Reserved
           111b   Reserved                         Reserved
           =======================================================


  IMPLEMENTORS NOTE: Modes 000b and 001b are included for compatibility with 
  CCS products that were designed prior to the generation of this standard. 
  These products restrict the maximum transfer length to 65535 bytes.

7.2.17.1. Combined Header and Data Mode (000b)
  In this mode, data to be transferred is preceded by a four-byte header.  The 
four-byte header consists of all reserved bytes.  The buffer ID and the buffer 
offset fields shall be zero.  The parameter list length field specifies the 
maximum number of bytes that shall be transferred during the DATA OUT phase.  
This number includes four bytes of header, so the data length to be stored in 
the target's buffer is parameter list length minus four.  The initiator should 
attempt to ensure that the parameter list length is not greater than four plus 
the available length that is returned in the header of the READ BUFFER command 
(mode 00b).  If the parameter list length exceeds the available length plus 
four, the target shall return CHECK CONDITION status and shall set the sense 
key to ILLEGAL REQUEST.

7.2.17.2. Vendor-Specific Mode (001b)
  In this mode, the meaning of the buffer ID, buffer offset, and parameter 
list length fields are not specified by this standard.

7.2.17.3. Data Mode (010b)
  In this mode, the DATA OUT phase contains buffer data.  The buffer ID field 
identifies a specific buffer within the target.  The vendor assigns buffer ID 
codes to buffers within the target.  Buffer ID zero shall be supported.  If 
more than one buffer is supported, additional buffer ID codes shall be 
assigned contiguously, beginning with one.  If an unsupported buffer ID code 
is selected, the target shall return CHECK CONDITION status and shall set the 
sense key to ILLEGAL REQUEST with an additional sense code of INVALID FIELD IN 
CDB.

  Data is written to the target buffer starting at the location specified by 
the buffer offset.  The initiator should conform to the offset boundary 
requirements returned in the READ BUFFER descriptor.  If the target is unable 
to accept the specified buffer offset, it shall return CHECK CONDITION status 
and it shall set the sense key to ILLEGAL REQUEST with an additional sense 
code of INVALID FIELD IN CDB.

  The parameter list length specifies the maximum number of bytes that shall 
be transferred during the DATA OUT phase to be stored in the specified buffer 
beginning at the buffer offset.  The initiator should attempt to ensure that 
the parameter list length plus the buffer offset does not exceed the capacity 
of the specified buffer.  (The capacity of the buffer can be determined by the 
buffer capacity field in the READ BUFFER descriptor.)  If the buffer offset 
and parameter list length fields specify a transfer that would exceed the 
buffer capacity, the target shall return CHECK CONDITION status and shall set 
the sense key to ILLEGAL REQUEST with an additional sense code of INVALID 
FIELD IN CDB. 





7.2.17.4. Download Microcode Mode (100b)
  In this mode, vendor-specific microcode or control information shall be 
transferred to the control memory space of the target.  After a power-cycle or 
reset, the device operation shall revert to a vendor-specific condition.  The 
meanings of the buffer ID, buffer offset, and parameter list length fields are 
not specified by this standard and are not required to be zero-filled.  When 
the microcode download has completed successfully the target shall generate a 
unit attention condition for all initiators except the one that issued the 
WRITE BUFFER command (see 6.9).  The additional sense code shall be set to 
MICROCODE HAS BEEN CHANGED.

7.2.17.5. Download Microcode and Save Mode (101b)
  In this mode, vendor-specific microcode or control information shall be 
transferred to the target and, if the WRITE BUFFER command is completed 
successfully, also shall be saved in a non-volatile memory space 
(semiconductor, disk, or other).  The downloaded code shall then be effective 
after each power-cycle and reset until it is supplanted in another download 
microcode and save operation.  The meanings of the buffer ID, buffer offset, 
and parameter list length fields are not specified by this standard and are 
not required to be zero-filled.  When the download microcode and save command 
has completed successfully the target shall generate a unit attention 
condition for all initiators except the one that issued the WRITE BUFFER 
command.  When reporting the unit attention condition, the target shall set 
the additional sense code to MICROCODE HAS BEEN CHANGED.


7.3. Parameters for All Device Types 

7.3.1. Diagnostic Parameters 

  This section describes the diagnostic page structure and the diagnostic 
pages that are applicable to all SCSI devices.  Pages specific to each device 
type are described in the third subsection of each device-type section (i.e., 
8.3, 9.3, etc.).

  A SEND DIAGNOSTIC command with a PF bit of one specifies that the SEND 
DIAGNOSTIC parameter list consists of zero or more diagnostic pages and that 
the data returned by the subsequent RECEIVE DIAGNOSTIC RESULTS command shall 
use the diagnostic page format (Table 7-47) described in this standard.

  Each diagnostic page defines a function or operation that the target shall 
perform.  The page contains a page header followed by the analysis data which 
is formatted according to the page code specified in the previous SEND 
DIAGNOSTIC command.

  Targets that implement diagnostic pages are only required to accept a single 
diagnostic page per command.








                      Table 7-47: Diagnostic Page Format

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Page Code                                   |
-----|-----------------------------------------------------------------------|
 1   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 2   | (MSB)                                                                 |
-----|---                        Page Length (n-3)                        ---|
 3   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 4   |                                                                       |
- - -|- -                        Diagnostic Parameters                    - -|
 n   |                                                                       |
==============================================================================

  The page code field identifies which diagnostic page is being sent or 
returned.  The page codes are defined in Table 7-48.

  The page length field specifies the length in bytes of the diagnostic 
parameters which follow this field.  If the initiator sends a page length that 
results in the truncation of any parameter, the target shall terminate the 
command with CHECK CONDITION status.  The sense key shall be set to ILLEGAL 
REQUEST with the additional sense code set to INVALID FIELD IN PARAMETER LIST.

  The diagnostic parameters are defined for each page code.  The diagnostic 
parameters within a page may be defined differently in a SEND DIAGNOSTIC 
command than in a RECEIVE DIAGNOSTIC RESULTS command.

                      Table 7-48: Diagnostic Page Codes

==============================================================================
  Page Code    Description                                          Section
------------------------------------------------------------------------------
     00h       Supported Diagnostics Pages                          7.3.1.1
  01h - 3Fh    Reserved (for all device type pages) 
  40h - 7Fh    See specific device type for definition
  80h - FFh    Vendor specific pages
==============================================================================

7.3.1.1. Supported Diagnostic Pages
  The supported diagnostics page (Table 7-49) returns the list of diagnostic 
pages implemented by the target.  This page shall be implemented if the target 
implements the page format option of the SEND DIAGNOSTIC and RECEIVE 
DIAGNOSTIC RESULTS commands.







                    Table 7-49: Supported Diagnostic Pages

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Page Code (00h)                             |
-----|-----------------------------------------------------------------------|
 1   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 2   | (MSB)                                                                 |
-----|---                        Page Length (n-3)                        ---|
 3   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 4   |                                                                       |
- - -|- -                        Supported Page List                      - -|
 n   |                                                                       |
==============================================================================

  The definition of this page for the SEND DIAGNOSTIC command includes only 
the first four bytes.  If the page length field is not zero, the target shall 
terminate the SEND DIAGNOSTIC command with CHECK CONDITION status.  The sense 
key shall be set to ILLEGAL REQUEST with an additional sense code of INVALID 
FIELD IN PARAMETER LIST.  This page instructs the target to make available the 
list of all supported diagnostic pages to be returned by a subsequent RECEIVE 
DIAGNOSTIC RESULTS command. 

  The definition of this page for the RECEIVE DIAGNOSTIC RESULTS command 
includes the list of diagnostic pages supported by the target.

  The page length field specifies the length in bytes of the following 
supported page list.

  The supported page list field shall contain a list of all diagnostic page 
codes implemented by the target in ascending order beginning with page code 
00h.



















7.3.2. Log Parameters

  This section describes the log page structure and the log pages that are 
applicable to all SCSI devices.  Pages specific to each device type are 
described in the third subsection of each device-type section (i.e., 8.3.2, 
9.3.2, etc.).  The LOG SELECT command supports the ability to send zero or 
more log pages.  The LOG SENSE command returns a single log page specified in 
the page code field of the command descriptor block (see Table 7-21).

  Each log page begins with a four-byte page header followed by zero or more 
variable-length log parameters defined for that page.  The log page format is 
defined in Table 7-50.

                         Table 7-50: Log Page Format

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |    Reserved     |            Page Code                                |
-----|-----------------------------------------------------------------------|
 1   |                              Reserved                                 |
-----|-----------------------------------------------------------------------|
 2   | (MSB)                                                                 |
-----|---                           Page Length (n-3)                     ---|
 3   |                                                                 (LSB) |
==============================================================================
     |                         Log Parameters(s)                             |
==============================================================================
 4 - |                              Log Parameter (First)                    |
 x+3 |                              (Length x)                               |
-----|-----------------------------------------------------------------------|
     |                                 .                                     |
     |                                 .                                     |
     |                                 .                                     |
-----|-----------------------------------------------------------------------|
 n-y |                              Log Parameter (Last)                     |
 n   |                              (Length y)                               |
==============================================================================


  The page code field identifies which log page is being transferred.  

  The page length field specifies the length in bytes of the following log 
parameters.  If the initiator sends a page length that results in the 
truncation of any parameter, the target shall terminate the command with CHECK 
CONDITION status.  The sense key shall be set to ILLEGAL REQUEST with the 
additional sense code set to INVALID FIELD IN PARAMETER LIST.

  Most log pages contain one or more special data structures called log 
parameters (see Table 7-51).  Log parameters may be data counters which record 
a count of a particular event (or events) or log parameters may be list 
parameters (strings) which contain a description of a particular event.


                          Table 7-51: Log Parameter

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   | (MSB)                                                                 |
-----|---                        Parameter Code                           ---|
 1   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 2   |   DU   |   DS   |  TSD   |   ETC  |       TMC       |Reserved|  LP    |
-----|-----------------------------------------------------------------------|
 3   |                           Parameter Length (n-3)                      |
-----|-----------------------------------------------------------------------|
 4   |                                                                       |
- - -|- -                        Parameter Value                          - -|
 n   |                                                                       |
==============================================================================


  Each log parameter (Table 7-51) begins with a four-byte parameter header 
followed by one or more bytes of parameter value data.  

  The parameter code field identifies which log parameter is being transferred 
for that log page.  

  The DU, DS, TSD, ETC, TMC, and LP fields are collectively referred to as the 
parameter control byte.  These fields are described below.

  For cumulative log parameter values (indicated by the PC field of the LOG 
SELECT and LOG SENSE command descriptor block), the disable update (DU) bit is 
defined as follows:
  (1) A zero value indicates that the target shall update the log parameter 
value to reflect all events that should be noted by that parameter.  
  (2) A one value indicates that the target shall not update the log parameter 
value except in response to a LOG SELECT command that specifies a new value 
for the parameter.

  IMPLEMENTORS NOTE:  When updating cumulative log parameter values, a target 
  may use volatile memory to hold these values until a LOG SELECT or LOG SENSE 
  command is received with an SP bit of one (or a target-defined event 
  occurs).  Thus the updated cumulative log parameter values may be lost if a 
  power cycle occurs.

  The DU bit is not defined for threshold values (indicated by the PC field of 
the LOG SENSE command descriptor block) nor for list parameters (indicated by 
the LP bit).  The target shall ignore the value of any DU bits in a LOG SELECT 
command.







  A disable save (DS) bit of zero indicates that the target supports saving 
for that log parameter.  The target shall save the current cumulative or the 
current threshold parameter value (depending on the value in the PC field of 
the command descriptor block) in response to a LOG SELECT or LOG SENSE command 
with a SP bit of one.  A DS bit of one indicates that the target does not 
support saving that log parameter in response to a LOG SELECT or LOG SENSE 
command with a SP bit of one.

  A target save disable (TSD) bit of zero indicates that the target provides a 
target-defined method for saving log parameters.  This implicit saving 
operation shall be done frequently enough to insure that the cumulative 
parameter values retain statistical significance (i.e., across power cycles).  
A TSD bit of one indicates that either the target does not provide a target-
defined method for saving log parameters or the target-defined method has been 
disabled by the initiator.  If the initiator sets both the DS and the TSD bits 
set to one, the target shall terminate the command with CHECK CONDITION 
status.  The sense key shall be set to ILLEGAL REQUEST with the additional 
sense code set to INVALID FIELD IN PARAMETER LIST.

  An enable threshold comparison (ETC) bit of one indicates that a comparison 
to the threshold value is performed whenever the cumulative value is updated.  
An ETC bit of zero indicates that a comparison is not performed.  The value of 
the ETC bit is the same for cumulative and threshold parameters.

  The threshold met criteria (TMC) field (Table 7-52) defines the basis for 
comparison of the cumulative and threshold values.  The TMC field is valid 
only if the ETC bit is one.  The value of the TMC field is the same for 
cumulative and threshold parameters.

  If the ETC bit is one and the result of the comparison is true, a unit 
attention condition shall be generated for all initiators.  When reporting the 
unit attention condition, the target shall set The sense key shall be set to 
UNIT ATTENTION; the additional sense code shall be set to LOG EXCEPTION; and 
the additional sense code qualifier set to THRESHOLD CONDITION MET.  



                      Table 7-52: Threshold Met Criteria

             ===================================================
             Code  Basis For Comparison
             ---   ---------------------------------------------
             00b   Every update of the cumulative value
             01b   Cumulative value     equal    threshold value
             10b   Cumulative value   not equal  threshold value
             11b   Cumulative value greater than threshold value
             ===================================================


  The list parameter (LP) bit indicates the format of the log parameter.  If 
an initiator attempts to set the value of the LP bit to a value other than the 
one returned for the same parameter in the LOG SENSE command, the target shall 
terminate the command with CHECK CONDITION status.  The sense key shall be set 
to ILLEGAL REQUEST with the additional sense code set to INVALID FIELD IN 
PARAMETER LIST.

  An LP bit of zero indicates that the parameter is a data counter.  Data 
counters are associated with one of more events.  The data counter is updated 
whenever one of these events occurs by incrementing of the counter value 
provided the DU bit is zero.  Each data counter has associated with it a 
target-defined maximum value.  Upon reaching this maximum value, the data 
counter shall not be incremented (i.e., it does not wrap).  When a data 
counter reaches its maximum value, the target shall set the associated DU bit 
to one.  If the data counter is at or reaches its maximum value during the 
execution of a command, the target shall complete the command.  If the command 
completes correctly (except for the data counter being at its maximum value) 
and if the RLEC bit of the control mode page (7.3.3.1) is set to one, then the 
target shall terminate the command with CHECK CONDITION status and set the 
sense key to RECOVERED ERROR with the additional sense code set to LOG COUNTER 
AT MAXIMUM.  

  An LP bit of one indicates that the parameter is a list parameter.  List 
parameters are not counters and thus the ET and TMC fields shall be set to 
zero.  A list parameter is a string of ASCII graphic codes (i.e., code values 
20h through 7Eh).

  If more than one list parameter is defined in a single log page, the 
following rules apply to assigning parameter codes:
  (1) The parameter updated last shall have a higher parameter code than the 
previous parameter, except as defined in rule (2).
  (2) When the maximum parameter code value supported by the target is 
reached, the target shall assign the lowest parameter code value to the next 
log parameter (i.e., wrap-around parameter codes).  If the associated command 
completes correctly (except for the parameter code being at its maximum value) 
and if the RLEC bit of the control mode page (7.3.3.1) is set to one, then the 
target shall terminate the command with CHECK CONDITION status and set the 
sense key to RECOVERED ERROR with the additional sense code set to LOG LIST 
CODES EXHAUSTED.

  IMPLEMENTORS NOTE:  List parameters can be used to store the locations of 
  defective blocks in the following manner.  When a defective block is 
  identified, a list parameter is updated to reflect the location and cause of 
  the defect.  When the next defect is encountered, the list parameter with 
  the next higher parameter code is updated to record this defect.  The size 
  of the page can be made target specific to accommodate memory limitations.  
  It is recommended that one or more data counter parameters be defined for 
  the page to keep track of the number of valid list parameters and the 
  parameter code of the parameter with the oldest recorded defect.  This 
  technique can be adapted to record other types of information.  

  The parameter length field specifies the length in bytes of the following 
parameter value.  If the initiator sends a parameter length value that results 
in the truncation of the parameter value, the target shall terminate the 
command with CHECK CONDITION status.  The sense key shall be set to ILLEGAL 
REQUEST with the additional sense code set to INVALID FIELD IN PARAMETER LIST.





  If the initiator sends a log parameter value that is outside the range 
supported by the target and rounding is implemented for that parameter, the 
target may either:
  (1) round to an acceptable value and terminate the command as described in 
6.5.4.
  (2) terminate the command with CHECK CONDITION status, set the sense key to 
ILLEGAL REQUEST with the additional sense code set to INVALID FIELD IN 
PARAMETER LIST.

  When any counter in a log page reaches its maximum value, incrementing of 
all counters in that log page shall cease until re-initialized by the 
initiator via a LOG SELECT command.  If the RLEC bit of the control mode page 
is one, then the target shall report the exception condition as described in 
7.3.3.1.

  The page code assignments for the log pages are listed in Table 7-53.  

                          Table 7-53: Log Page Codes

==============================================================================
  Page Code    Description                                          Section
------------------------------------------------------------------------------
     01h       Buffer Over-Run/Under-Run Page                       7.3.2.1
     03h       Error Counter Page (Read) Page                       7.3.2.2
     04h       Error Counter Page (Read Reverse) Page               7.3.2.2
     05h       Error Counter Page (Verify) Page                     7.3.2.2
     02h       Error Counter Page (Write) Page                      7.3.2.2
     07h       Last n Error Events Page                             7.3.2.3
     06h       Non-Medium Error Page                                7.3.2.4
     00h       Supported Log Pages                                  7.3.2.5
  08h - 2Fh    Reserved                              
     3Fh       Reserved                              
  30h - 3Eh    Vendor Specific                       
==============================================================================


7.3.2.1. Buffer Over-Run/Under-Run Page
  The buffer over-run/under-run page (page code 01h) defines 24 data counters 
that may be used to record the number of buffer over-runs or under-runs for 
the logical unit.  A target that implements this page may implement one or 
more of the defined data counters.  

  A buffer over-run or under-run can occur when an initiator does not transmit 
data to or from the target's buffer fast enough to keep up with reading or 
writing the media.  This can be caused by a slow transfer rate across the SCSI 
bus or by a high SCSI bus utilization that prevents reconnection by the 
target.  A buffer over-run condition can occur during a read operation when a 
buffer full condition prevents continued transfer of data from the media to 
the buffer.  A buffer under-run condition can occur during a write operation 
when a buffer empty condition prevents continued transfer of data to the media 
from the buffer.  Most devices incur a delay at this point while the media is 
repositioned.



  Table 7-54 defines the parameter code field for the buffer over-run/under-
run counters.

   Table 7-54: Parameter Code Field for Buffer Over-Run/Under-Run Counters

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                          Reserved                                     |
-----|-----------------------------------------------------------------------|
 1   |      Count Basis         |               Cause               |  Type  |
==============================================================================


  The parameter code field for buffer over-run/under-run counters is a 16-bit 
value comprised of eight reserved bits, a three-bit count basis field (Table 
7-55), a four-bit cause field (Table 7-56), and a one-bit type field.  These 
are concatenated to determine the value of the parameter code for that log 
parameter.  For example, a parameter code value of 0023h specifies a count 
basis of 001b, a cause of 0001b, and a type of 1b which is a counter that is 
incremented once per command that experiences an over-run due to the SCSI bus 
being busy.

  The count basis field defines the criteria for incrementing the counter.  
The following criteria are defined: 

                      Table 7-55: Count Basis Definition

                    ================================================
                    Count Basis  Description
                    -----------  -----------------------------------
                       000b      Undefined
                       001b      Per Command
                       010b      Per Failed Reconnect
                       011b      Per Unit of Time
                    100b-111b    Reserved
                    ================================================

  IMPLEMENTORS NOTE:  The per unit of time count basis is device type 
  specific.  Direct-access devices typically use a latency period (i.e., one 
  revolution of the medium) as the unit of time.













  The cause field indicates the reason that the over-run or under-run 
occurred.  The following causes are defined: 

                      Table 7-56: Cause Field Definition

                    =================================
                     Cause     Description
                    -------    ----------------------
                       0h      Undefined
                       1h      SCSI Bus Busy
                       2h      Transfer Rate Too Slow
                     3h-Fh     Reserved
                    =================================


  The type field indicates whether the counter records under-runs or over-
runs.  A value of zero specifies a buffer under-run condition and a value of 
one specifies a buffer over-run condition.

  The counters contain the total number of times buffer over-run or under- run 
conditions have occurred since the last time the counter was cleared.  The 
counter shall be incremented for each occurrence of an under-run or over-run 
condition and can be incremented more than once for multiple occurrences 
during the execution of a single command.

7.3.2.2. Error Counter Pages
  This section defines the optional error counter pages for write errors (page 
code 02h), read errors (page code 03h), read reverse errors (page code 04h) 
and verify errors (page code 05h).  Table 7-50 defines the page format for 
these pages.  A page can return one or more log parameters which record events 
defined by the parameter codes (Table 7-57).

  Table 7-57 defines the parameter codes for the error counter pages.  Support 
of each log parameter is optional. 

             Table 7-57: Parameter Codes for Error Counter Pages

            ======================================================
            Parameter
              Code      Description
            ----------  ------------------------------------------
              0000h     Errors corrected without substantial delay
              0001h     Errors corrected with possible delays
              0002h     Total (e.g., re-writes or re-reads)
              0003h     Total errors corrected
              0004h     Total times correction algorithm processed
              0005h     Total bytes processed
              0006h     Total uncorrected errors
            0007-7FFFh  Reserved
            8000-FFFFh  Vendor specific
            ======================================================




  IMPLEMENTORS NOTE:  The exact definition of the error counters is not part 
  of this standard.  These counters should not be used to compare products 
  because the products may define errors differently.

7.3.2.3. Last n Error Events Page
  Log page (07h) provides for a number of error-event records using the list 
parameter format of the log page.  The number of these error-event records 
supported, n, is device-specific.  Each error-event record contains device-
specific diagnostic information for a single error encountered by the device.  
The parameter code associated with error-event record indicates the relative 
time at which the error occurred.  A higher parameter code indicates that the 
error event occurred later in time.

  The content of the parameter value field of each log parameter is an ASCII 
character string which may describe the error event.  The exact contents of 
the character string is not defined by this standard.

  When the last supported parameter code is used by an error-event record, the 
recording on this page of all subsequent error information shall cease until 
one or more of the list parameters with the highest parameter codes have been 
re-initialized.  If the RLEC bit of the common mode (7.3.3.1) is set to one, 
the target shall return CHECK CONDITION status with the sense key set to 
RECOVERED ERROR and the additional sense code set to LOG LIST CODES EXHAUSTED.  
Alternatively, the target may report this condition via asynchronous event 
notification (see 6.5.5).

7.3.2.4. Non-Medium Error Page 
  This page (page code 06h) provides for summing the occurrences of 
recoverable error events other than write, read, or verify failures.  No 
discrimination among the various types of events is provided by parameter code 
(Table 7-58).  Vendor-specific discrimination may be provided through the 
vendor-specific parameter codes.

              Table 7-58: Non-Medium Error Event Parameter Codes

                ==============================================
                Parameter Code  Description
                --------------  ------------------------------
                    0000h       Non-Medium Error Count
                0001h - 7FFFh   Reserved
                8000h - FFFFh   Vendor-Specific Error Counts
                ==============================================













7.3.2.5. Supported Log Pages
  The supported log page (Table 7-59) returns the list of log pages 
implemented by the target.  Targets that implement the LOG SENSE command shall 
implement this log page.  

                       Table 7-59: Supported Log Pages

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |    Reserved     |        Page Code (00h)                              |
-----|-----------------------------------------------------------------------|
 1   |                          Reserved                                     |
-----|-----------------------------------------------------------------------|
 2   | (MSB)                                                                 |
-----|---                       Page Length (n-3)                         ---|
 3   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 4   |                                                                       |
- - -|- -                       Supported Page List                       - -|
 n   |                                                                       |
==============================================================================


  This page is not defined for the LOG SELECT command.  This log page returns 
the list of supported log pages for the specified logical unit.

  The page length field specifies the length in bytes of the following 
supported page list.

  The supported page list field shall contain a list of all log page codes 
implemented by the target in ascending order beginning with page code 00h.

7.3.3. Mode Parameters 

  This section describes the block descriptors and the pages used with MODE 
SELECT and MODE SENSE commands that are applicable to all SCSI devices.  Pages 
specific to each device type are described in the third subsection of each 
device-type section (i.e., 8.3, 9.3, etc.).

  The mode parameter list shown in Table 7-60 contains a header, followed by 
zero or more block descriptors, followed by zero or more variable-length 
pages.  Parameter lists are defined for each device type.











                       Table 7-60: Mode Parameter List

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
0 - n|                        Mode Parameter Header                          |
==============================================================================
0 - n|                        Block Descriptor(s)                            |
==============================================================================
0 - n|                        Page(s)                                        |
==============================================================================


  The six-byte command descriptor block parameter header is defined in Table 
7-61.  The ten-byte command descriptor block parameter header is defined in 
Table 7-62.

                     Table 7-61: Mode Parameter Header(6)

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Mode Data Length                            |
-----|-----------------------------------------------------------------------|
 1   |                           Medium Type                                 |
-----|-----------------------------------------------------------------------|
 2   |                           Device-Specific Parameter                   |
-----|-----------------------------------------------------------------------|
 3   |                           Block Descriptor Length                     |
==============================================================================























                    Table 7-62: Mode Parameter Header(10)

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   | (MSB)                                                                 |
-----|---                        Mode Data Length                         ---|
 1   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 2   |                           Medium Type                                 |
-----|-----------------------------------------------------------------------|
 3   |                           Device-Specific Parameter                   |
-----|-----------------------------------------------------------------------|
 4   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 5   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 6   | (MSB)                                                                 |
-----|---                        Block Descriptor Length                  ---|
 7   |                                                                 (LSB) |
==============================================================================


  When using the MODE SENSE command, the mode data length field specifies the 
length in bytes of the following data that is available to be transferred.  
The mode data length does not include itself.  When using the MODE SELECT 
command, this field is reserved.

  IMPLEMENTORS NOTE:  Targets that support more than 256 bytes of block 
  descriptors and pages may need to implement ten-byte mode commands.  The 
  mode data length field in the six-byte command descriptor block header 
  limits the returned data to 256 bytes.

  Medium types are unique for each device type.  Refer to the mode parameters 
section of the specific device type for definition of these values.  Some 
device types reserve this field.

  The device specific parameter is unique for each device type.  Refer to the 
mode parameters section of the specific device type for definition of this 
field.  Some device types reserve all or part of this field.

  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 pages or vendor-specific parameters, if any, that may follow 
the last block descriptor.  A block descriptor length of zero indicates that 
no block descriptors are included in the mode parameter list.  This condition 
shall not be considered an error.

  The mode parameter block descriptor is shown in Table 7-63.





                 Table 7-63: Mode Parameter Block Descriptor

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |                           Density Code                                |
-----|-----------------------------------------------------------------------|
 1   | (MSB)                                                                 |
-----|---                                                                 ---|
 2   |                           Number of Blocks                            |
-----|---                                                                 ---|
 3   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 4   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 5   | (MSB)                                                                 |
-----|---                                                                 ---|
 6   |                           Block Length                                |
-----|---                                                                 ---|
 7   |                                                                 (LSB) |
==============================================================================


  Block descriptors specify some of the medium characteristics for all or part 
of a logical unit.  Support for block descriptors is optional.  Each block 
descriptor contains a density code field, a number of blocks field, and a 
block length field.  Block descriptor values are always current (i.e., saving 
is not supported).  A unit attention condition (see 6.9) shall be generated 
when any block descriptor values are changed.

  The density code field is unique for each device type. Refer to the mode 
parameters section of the specific device type for definition of this field.  
Some device types reserve all or part of this field.

  The number of blocks field specifies the number of logical blocks on the 
medium to which the density code and block length fields apply.  A value of 
zero indicates that all of the remaining logical blocks of the logical unit 
shall have the medium characteristics specified.

  IMPLEMENTORS NOTES:
  (1) There may be implicit association between parameters defined in the 
  pages and block descriptors.  For direct-access devices, the block length 
  affects the optimum values (the values that achieve best performance) for 
  the sectors per track, bytes per physical sector, track skew factor, and 
  cylinder skew factor fields in the format parameters page.  In this case, 
  the target may change parameters not explicitly sent with the MODE SELECT 
  command.  A subsequent MODE SENSE command would reflect these changes.
  (2) The number of remaining logical blocks may be unknown for some device 
  types.





  The block length specifies the length in bytes of each logical block 
described by the block descriptor.  For sequential-access devices, a block 
length of zero indicates that the logical block size written to the medium is 
specified by the transfer length field in the command descriptor block (see 
9.2.5 and 9.2.15)

  The mode page format is defined in Table 7-64.

                         Table 7-64: Mode Page Format

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |   PS   |Reserved|         Page Code                                   |
-----|-----------------------------------------------------------------------|
 1   |                           Page Length                                 |
-----|-----------------------------------------------------------------------|
2 - n|                           Mode Parameters                             |
==============================================================================


  Each mode page contains a page code, a page length, and a set of mode 
parameters.  The page codes are defined in Table 7-65 and in the mode 
parameter sub-sections of the specific device type.

  When using the MODE SENSE command, a parameters savable (PS) bit of one 
indicates that the mode page can be saved by the target in a non-volatile, 
vendor-specific location.  A PS bit of zero indicates that the supported 
parameters cannot be saved.  When using the MODE SELECT command, the PS bit is 
reserved.

  The page code field identifies the format and parameters defined for that 
mode page.  Some page codes are defined as applying to all device types (Table 
7-65) and other page codes are defined for the specific device type.  

  When using the MODE SENSE command, if page code 00h (vendor-specific page) 
is implemented, the target shall return that page last in response to a 
request to return all pages (page code 3Fh).  When using the MODE SELECT 
command, this page should be sent last.

  The page length field specifies the length in bytes of the mode parameters 
that follow.  If the initiator does not set this value to the value that is 
returned for the page by the MODE SENSE command, the target shall terminate 
the command with CHECK CONDITION status.  The sense key shall be set to to 
ILLEGAL REQUEST with the additional sense code set to INVALID FIELD IN 
PARAMETER LIST.  The target is permitted to implement a mode page that is less 
than the full page length defined by this standard, provided no field is 
truncated and the page length field correctly specifies the actual length 
implemented.

  The mode parameters for each page are defined in the following sub-sections 
or in the mode parameters sub-section for the specific device type.  Mode 
parameters not implemented by the target shall be set to zero.

  Table 7-65 defines the mode pages that are applicable to all device types 
that include the MODE SELECT and MODE SENSE commands.

                         Table 7-65: Mode Page Codes

==============================================================================
  Page Code   Description                                           Section
------------------------------------------------------------------------------
     0Ah      Control Mode Page                                     7.3.3.1
     02h      Disconnect-Reconnect Page                             7.3.3.2
     09h      Peripheral Device Page                                7.3.3.3
     01h      (See specific device type)
  03h - 08h   (See specific device type)
  0Bh - 1Fh   (See specific device type)
     00h      Vendor specific (does not require page format)
  20h - 3Eh   Vendor specific (page format required)
     3Fh      Return all pages (valid only for the MODE SENSE command)
==============================================================================


7.3.3.1. Control Mode Page

                        Table 7-66: Control Mode Page

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |   PS   |Reserved|         Page Code (0Ah)                             |
-----|-----------------------------------------------------------------------|
 1   |                           Page Length (06h)                           |
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                           |  RLEC  |
-----|-----------------------------------------------------------------------|
 3   |     Queue Algorithm Modifier      |    Reserved     |  QErr  |  DQue  |
-----|-----------------------------------------------------------------------|
 4   |  EECA  |              Reserved             | RAENP  | UAAENP | EAENP  |
-----|-----------------------------------------------------------------------|
 5   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 6   |                                                                       |
-----|---                        Ready AEN Holdoff Period                 ---|
 7   |                                                                       |
==============================================================================


  The control mode page (Table 7-66) provides controls over several SCSI-2 
features which are applicable to all device types such as tagged queuing, 
extended contingent allegiance, asynchronous event notification, and error 
logging.

  A report log exception condition (RLEC) bit of one specifies that the target 
shall report log exception conditions as described in 7.3.2.  A RLEC bit of 
zero specifies that the target shall not report log exception conditions.

  The queue algorithm modifier field (Table 7-67) specifies restrictions on 
the algorithm used for re-ordering commands that are tagged with the SIMPLE 
QUEUE TAG message.

                     Table 7-67: Queue Algorithm Modifier

               ===============================================
               Value          Definition
               -------        --------------------------------
                 0h           Restricted re-ordering
                 1h           Unrestricted re-ordering allowed
               2h - 7h        Reserved
               8h - Fh        Vendor specific
               ===============================================

  A value of zero in this field specifies that the target shall order the 
actual execution sequence of the queued commands from each initiator such that 
data integrity is maintained for that initiator.  This means that, if the 
transmission of new commands was halted at any time, the final value of all 
data observable on the medium shall have exactly the same value as it would 
have if the commands had been executed in the same received sequence without 
tagged queuing.  The restricted reordering value shall be the default value.

  A value of one in this field specifies that the target may re-order the 
actual execution sequence of the queued commands in any manner it selects.  
Any data integrity exposures related to command sequence order are explicitly 
handled by the initiator through the selection of appropriate commands and 
queue tag messages. 

  A queue error management (QErr) bit of zero specifies that those commands 
still queued after the target has entered the contingent allegiance or 
extended contingent allegiance conditions shall continue execution in a normal 
manner when that condition has terminated (see 6.8).  A QErr bit of one 
specifies that those commands still queued after the target has entered the 
contingent allegiance or extended contingent allegiance conditions shall be 
aborted when that condition has terminated.  A unit attention condition shall 
be generated for each initiator which had commands in the queue except the 
initiator that received the original INITIATE RECOVERY message.  When 
reporting the unit attention condition, the target shall set the additional 
sense code to TAGGED COMMANDS CLEARED BY ANOTHER INITIATOR.

  A disable queuing (DQue) bit of zero specifies that tagged queuing shall be 
enabled if the target supports tagged queuing.  A DQue bit of one specifies 
that tagged queuing shall be disabled.  Any queued commands for that I_T_x 
nexus shall be aborted.  Any subsequent queue tag message received shall be 
rejected with a MESSAGE REJECT message and the I/O process shall be executed 
as an untagged command (see 6.8.1).

  An enable extended contingent allegiance (EECA) bit of one specifies that 
extended contingent allegiance is enabled (see 6.7).  An EECA bit of zero 
specifies that extended contingent allegiance is disabled.

  The RAENP, UAAENP, and EAENP bits enable specific events to be reported via 
the asynchronous event notification protocol.  When all three bits are zero, 
the target shall not create asynchronous event notifications.

  A ready AEN permission (RAENP) bit of one specifies that the target may 
issue an asynchronous event notification upon completing its initialization 
sequence instead of generating a unit attention condition.  A RAENP bit of 
zero specifies that the target shall not issue an asynchronous event 
notification upon completing its initialization sequence.

  IMPLEMENTORS NOTE:  If the target's default value for the RAENP bit is one 
  and it does not implement saved parameters or include a hardware switch, 
  then it may not be possible to disable the initialization sequence 
  asynchronous event notification.

  A unit attention AEN permission (UAAENP) bit of one specifies that the 
target may issue an asynchronous event notification instead of creating a unit 
attention condition upon detecting an event which would cause a unit attention 
condition (other than upon completing an initialization sequence).  A UAAENP 
bit of zero specifies that the target shall not issue an asynchronous event 
notification instead of creating a unit attention condition.

  An error AEN permission (EAENP) bit of one specifies that the target may 
issue an asynchronous event notification upon detecting a deferred error 
condition instead of waiting to report the deferred error on the next command.  
An EAENP bit of zero specifies that the target shall not report deferred error 
conditions via an asynchronous event notification.

  The ready AEN holdoff period field specifies the minimum time in 
milliseconds after the target starts its initialization sequence that it shall 
delay before attempting to issue an asynchronous event notification.  This 
value may be rounded up as defined in 6.5.4.


























7.3.3.2. Disconnect-Reconnect Page

                    Table 7-68: Disconnect-Reconnect Page

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |   PS   |Reserved|         Page Code (02h)                             |
-----|-----------------------------------------------------------------------|
 1   |                           Page Length (0Eh)                           |
-----|-----------------------------------------------------------------------|
 2   |                           Buffer Full Ratio                           |
-----|-----------------------------------------------------------------------|
 3   |                           Buffer Empty Ratio                          |
-----|-+---------------------------------------------------------------------|
 4   | (MSB)                                                                 |
-----|---                        Bus Inactivity Limit                     ---|
 5   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 6   | (MSB)                                                                 |
-----|---                        Disconnect Time Limit                    ---|
 7   |                                                                 (LSB) |
-----|-+---------------------------------------------------------------------|
 8   | (MSB)                                                                 |
-----|---                        Connect Time Limit                       ---|
 9   |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 10  | (MSB)                                                                 |
-----|---                        Maximum Burst Size                       ---|
 11  |                                                                 (LSB) |
-----|-----------------------------------------------------------------------|
 12  |                           Reserved                  |      DTDC       |
-----|-----------------------------------------------------------------------|
 13  |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 14  |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 15  |                           Reserved                                    |
==============================================================================


  The disconnect-reconnect page (Table 7-68) provides the initiator the means 
to tune the performance of the SCSI bus.

  The buffer full ratio field indicates to the target, on read operations, how 
full the buffer should be prior to attempting a reselection.  Targets that do 
not implement the requested ratio should round down to the nearest implemented 
ratio as defined in 6.5.4.  

  The buffer empty ratio field indicates to the target, on write operations, 
how empty the buffer should be prior to attempting a reselection.  Targets 
that do not implement the requested ratio should round down to the nearest 
implemented ratio as defined in 6.5.4.  

  The buffer full and buffer empty ratios are numerators of a fractional 
multiplier that has 256 as its denominator.  A value of zero indicates that 
the target determines when to initiate reselection consistent with the 
disconnect time limit parameter.  These parameters are advisory to the target.

  IMPLEMENTORS NOTE:  As an example, consider a target with ten 512-byte 
  buffers and a specified buffer full ratio of 3Fh.  The formula is: 
  INTEGER((ratio/256)*number of buffers).  Thus INTEGER((3Fh/256)*10) = 2.  
  The target should attempt to reselect the initiator on read operations 
  whenever two or more buffers are full.  

  The bus inactivity limit field indicates the maximum time in 100 microsecond 
increments that the target is permitted to assert the BSY signal without a 
REQ/ACK handshake.  If the bus inactivity limit is exceeded the target shall 
attempt to disconnect if the initiator has granted the disconnect privilege 
(see 5.6.7) and it is not restricted by DTDC.  This value may be rounded as 
defined in 6.5.4.  A value of zero indicates that there is no bus inactivity 
limit.

  The disconnect time limit field indicates the minimum time in 100 
microsecond increments that the target shall wait after releasing the SCSI bus 
before attempting reselection.  This value may be rounded as defined in 6.5.4.  
A value of zero indicates that there is no disconnect time limit.

  The connect time limit field indicates the maximum time in 100 microsecond 
increments that the target is allowed to use the SCSI bus before disconnecting 
if the initiator has granted the disconnect privilege (see 5.6.7) and it is 
not restricted by DTDC.  This value may be rounded as defined in 6.5.4.  A 
value of zero indicates that there is no connect time limit.

  The maximum burst size field indicates the maximum amount of data that the 
target shall transfer during a data phase before disconnecting if the 
initiator has granted the disconnect privilege.  This value is expressed in 
increments of 512 bytes (e.g., a value of one means 512 bytes, two means 1024 
bytes, etc.).  A value of zero indicates there is no limit on the amount of 
data transferred per connection.  

  The data transfer disconnect control (DTDC) field (Table 7-69) defines 
further restrictions on when a disconnect is permitted.
















                 Table 7-69: Data Transfer Disconnect Control

==============================================================================
 DTDC   Description
------  ----------------------------------------------------------------------
  00b   Data transfer disconnect control is not used.  Disconnect is 
        controlled by the other fields in this page.
  01b   A target shall not attempt to disconnect once the data transfer of a 
        command has started until all data the command is to transfer has been 
        transferred.  The connect time limit and bus inactivity limit are 
        ignored during the data transfer.
  10b   Reserved
  11b   A target shall not attempt to disconnect once the data transfer of a 
        command has started until the command is complete.  The connect time 
        limit and bus inactivity limit are ignored once data transfer has 
        started.
==============================================================================

  If DTDC is nonzero and the maximum burst size is nonzero the target shall 
return CHECK CONDITION status.  The sense key shall be set to ILLEGAL REQUEST 
and the additional sense code set to ILLEGAL FIELD IN PARAMETER LIST. 

7.3.3.3. Peripheral Device Page

                      Table 7-70: Peripheral Device Page

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   |   PS   |Reserved|         Page Code (09h)                             |
-----|-----------------------------------------------------------------------|
 1   |                           Page Length (n-1)                           |
-----|-----------------------------------------------------------------------|
 2   | (MSB)                                                                 |
-----|---                        Interface Identifier                     ---|
 3   |                                                                 (LSB) |
-----|-+---------------------------------------------------------------------|
 4   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 5   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 6   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 7   |                           Reserved                                    |
-----|-+---------------------------------------------------------------------|
 8   |                                                                       |
-----|- -                        Vendor Specific                          - -|
 n   |                                                                       |
==============================================================================





  The peripheral device page (Table 7-70) is used to pass vendor-specific 
information between an initiator and a peripheral interface below the target 
(i.e., between the target and the peripheral device).  This standard does not 
define the format of this data, except to provide a standard header. 

  Interface identifier codes are defined in the Table 7-71.

                    Table 7-71: Interface Identifier Codes

==============================================================================
                                                Reference
Code Value   Interface                          Standard 
-----------  ---------------------------------  --------------------------
  0000h      Small Computer System Interface    X3.131
  0001h      Storage Module Interface           X3.91M-1987
  0002h      Enhanced Small Device Interface    X3.170
  0003h      IPI-2                              X3.130-1986; X3T9.3/87-002
  0004h      IPI-3                              X3.132-1987; X3.147-1988
0005h-7FFFh  Reserved
8000h-FFFFh  Vendor Specific
==============================================================================


7.3.4. Vital Product Data Parameters

  This section describes the optional vital product data page structure and 
the vital product data pages (Table 7-72) that are applicable to all SCSI 
devices.  These pages are optionally returned by the INQUIRY command (7.2.5) 
and contain vendor-specific product information about a target or logical 
unit.  The vital product data may include vendor identification, product 
identification, unit serial numbers, device operating definitions, 
manufacturing data, field replaceable unit information, and other vendor-
specific information.  This standard defines the structure of the vital 
product data, but not the contents.

                  Table 7-72: Vital Product Data Page Codes

==============================================================================
 Page Code     Description                                          Section
------------------------------------------------------------------------------
    82h        ASCII Implemented Operating Definition Page          7.3.4.1
 01h - 7Fh     ASCII Information Page                               7.3.4.2
    81h        Implemented Operating Definitions Page               7.3.4.3
    00h        Supported Vital Product Data Pages                   7.3.4.4
    80h        Unit Serial Number Page                              7.3.4.5
 83h - BFh     Reserved
 C0h - FFh     Vendor Specific
==============================================================================







7.3.4.1. ASCII Implemented Operating Definition Page

              Table 7-73: ASCII Implemented Operating Definition 

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   | Peripheral Qualifier     |           Peripheral Device Type           |
-----|-----------------------------------------------------------------------|
 1   |                           Page Code (82h)                             |
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   |                           Page Length (n-3)                           |
-----|-----------------------------------------------------------------------|
 4   |              ASCII Operating Definition Description Length (m-4)      |
-----|-----------------------------------------------------------------------|
 5   |                                                                       |
- - -|- -           ASCII Operating Definition Description Data           - -|
 m   |                                                                       |
-----|-----------------------------------------------------------------------|
 m+1 |                                                                       |
- - -|- -           Vendor-Specific Description Data                      - -|
 n   |                                                                       |
==============================================================================


  This page (Table 7-73) contains operating definition description data for 
all operating definitions implemented by the target.  The contents of this 
data is not defined by this standard.

  The peripheral qualifier field is defined in Table 7-16 and the peripheral 
device type field is defined in Table 7-17.

  The page length field specifies the length of the following page data.  If 
the allocation length is less than the length of the data to be returned the 
page length shall not be adjusted to reflect the truncation.

  The ASCII operating definition description length field specifies the length 
in bytes of the ASCII operating definition description data that follows.  If 
the allocation length is less than the length of data to be returned, the 
ASCII operating definition description length shall not be adjusted to reflect 
the truncation.  A value of zero in this field indicates that no ASCII 
operating definition description data is available.

  The ASCII operating definition description data field contains the ASCII 
operating definition description data for the target or logical unit.  The 
data in this field shall be formatted in lines (or character strings).  Each 
line shall contain only graphic codes (i.e., code values 20h through 7Eh) and 
shall be terminated with a NULL (00h) character. 




7.3.4.2. ASCII Information Page

                      Table 7-74: ASCII Information Page

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   | Peripheral Qualifier     |           Peripheral Device Type           |
-----|-----------------------------------------------------------------------|
 1   |                           Page Code (01h - 7Fh)                       |
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   |                           Page Length (n-3)                           |
-----|-----------------------------------------------------------------------|
 4   |                           ASCII Length (m-4)                          |
-----|-----------------------------------------------------------------------|
 5   |                                                                       |
- - -|- -                        ASCII Information                        - -|
 m   |                                                                       |
-----|-----------------------------------------------------------------------|
 m+1 |                                                                       |
- - -|- -                        Vendor-Specific Information              - -|
 n   |                                                                       |
==============================================================================


  The ASCII information page (Table 7-74) returns information for the field 
replaceable unit code returned in the REQUEST SENSE sense data (see 7.2.14).  

  The peripheral qualifier field is defined in Table 7-16 and the peripheral 
device type field is defined in Table 7-17.

  The page code field contains the same value as in the page code field of the 
INQUIRY command descriptor block (see 7.2.5) and is associated with the field 
replaceable unit code returned by the REQUEST SENSE command.

  IMPLEMENTORS NOTE:  The field replaceable unit field in the sense data 
  provides for 255 possible codes, while the page code field provides for only 
  127 possible codes.  Thus it is not possible to return ASCII information 
  pages for the upper code values.

  The page length field specifies the length of the following page data.  If 
the allocation length of the command descriptor block is too small to transfer 
all of the page, the page length shall not be adjusted to reflect the 
truncation.

  The ASCII length field specifies the length in bytes of the ASCII 
information that follows.  If the allocation length is less than the length of 
the data to be returned the ASCII length shall not be adjusted to reflect the 
truncation.  A value of zero in this field indicates that no ASCII information 
is available for the specified page code.


  The ASCII information field contains ASCII information concerning the field 
replaceable unit identified by the page code.  The data in this field shall be 
formatted in one or more lines (or character strings).  Each line shall 
contain only graphic codes (i.e., code values 20h through 7Eh) and shall be 
terminated with a NULL (00h) character. 

  The contents of the vendor-specific information field is not defined in this 
standard.

7.3.4.3. Implemented Operating Definition Page

              Table 7-75: Implemented Operating Definition Page

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   | Peripheral Qualifier     |           Peripheral Device Type           |
-----|-----------------------------------------------------------------------|
 1   |                           Page Code (81h)                             |
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   |                           Page Length (n-3)                           |
-----|-----------------------------------------------------------------------|
 4   |Reserved|         Current Operating Definition                         |
-----|-----------------------------------------------------------------------|
 5   | SavImp |         Default Operating Definition                         |
-----|-----------------------------------------------------------------------|
 6   | SavImp |                                                              |
-----|- -               Supported Operating Definition List               - -|
 n   | SavImp |                                                              |
==============================================================================


  The implemented operating definition page (Table 7-75) defines the current 
operating definition, the default operating definition, and which operating 
definitions are implemented by the target.  These operating definition values 
are specified in the CHANGE DEFINITION command (see 7.2.1).

  The peripheral qualifier field is defined in Table 7-16 and the peripheral 
device type field is defined in Table 7-17.

  The page length field specifies the length of the following operating 
definitions.  If the allocation length of the command descriptor block is too 
small to transfer all of the page, the page length shall not be adjusted to 
reflect the truncation.

  For each operating definition there is an associated save implemented 
(SavImp) bit.  A SavImp bit of zero indicates that the corresponding operating 
definition parameter cannot be saved.  A SavImp bit of one indicates that the 
corresponding operating definition parameter can be saved.



  All returned operating definitions use the codes defined in Table 7-3.  The 
current operating definition field returns the value of the present operating 
definition.  The default operating definition field returns the value of the 
operating definition the target uses when power is applied if no operating 
definition is saved.  The supported operating definition list returns one or 
more operating definitions implemented by the target.

7.3.4.4. Supported Vital Product Data Pages

                Table 7-76: Supported Vital Product Data Pages

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   | Peripheral Qualifier     |           Peripheral Device Type           |
-----|-----------------------------------------------------------------------|
 1   |                           Page Code (00h)                             |
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   |                           Page Length (n-3)                           |
-----|-----------------------------------------------------------------------|
 4   |                                                                       |
-----|- -                        Supported Page List                      - -|
 n   |                                                                       |
==============================================================================


  The supported vital product data pages are shown in Table 7-76.

  The peripheral qualifier field is defined in Table 7-16 and the peripheral 
device type field is defined in Table 7-17.

  The page code field shall be set to the value of the page code field in the 
INQUIRY command descriptor block (see 7.2.5).

  The page length field specifies the length of the supported page list.  If 
the allocation length is too small to transfer all of the page, the page 
length shall not be adjusted to reflect the truncation.

  The supported page list field shall contain a list of all vital product data 
page codes implemented for the target or logical unit in ascending order 
beginning with page code 00h.











7.3.4.5. Unit Serial Number Page

                     Table 7-77: Unit Serial Number Page

==============================================================================
  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
Byte |        |        |        |        |        |        |        |        |
==============================================================================
 0   | Peripheral Qualifier     |           Peripheral Device Type           |
-----|-----------------------------------------------------------------------|
 1   |                           Page Code (80h)                             |
-----|-----------------------------------------------------------------------|
 2   |                           Reserved                                    |
-----|-----------------------------------------------------------------------|
 3   |                           Page Length (n-3)                           |
-----|-----------------------------------------------------------------------|
 8   |                                                                       |
- - -|- -                        Product Serial Number                    - -|
 n   |                                                                       |
==============================================================================


  This page (Table 7-77) provides a product serial number for the target or 
logical unit.

  The peripheral qualifier field is defined in Table 7-16 and the peripheral 
device type field is defined in Table 7-17.

  The page length field specifies the length of the product serial number.  If 
the allocation length is too small to transfer all of the page, the page 
length shall not be adjusted to reflect the truncation.

  The product serial number field contains ASCII data that is vendor specific. 
The least significant ASCII character of the serial number shall appear as the 
last byte of a successful data transfer.  If the product serial number is not 
available, the target shall return ASCII spaces (20h) in this field. 








































                       (This page is intentionally blank.)



































These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.