Command Descriptions for Automatic Medium Changers Group 0 Commands for Automatic Medium Changers The Group 0 commands for automatic medium changers shall be as shown in Table 12-1. Group 0 Commands for Automatic Medium Changers ============================================================================== Operation Code Type Command Name Section Page ------------------------------------------------------------------------------ 00h O TEST UNIT READY 7.1.1 01h O REZERO UNIT 8.1.1 02h V 03h M REQUEST SENSE 7.1.2 04h R 05h V 06h V 07h V 08h V 09h V 0Ah V 0Bh V 0Ch V 0Dh V 0Eh V 0Fh V 10h R 11h R 12h M INQUIRY 7.1.3 13h R 14h R 15h O MODE SELECT _.1.1 16h O RESERVE _.1.2 17h O RELEASE _.1.3 18h R 19h R 1Ah O MODE SENSE _.1.4 1Bh R 1Ch O RECEIVE DIAGNOSTIC RESULTS 7.1.5 1Dh O SEND DIAGNOSTIC 7.1.6 1Eh O PREVENT/ALLOW MEDIUM REMOVAL 8.1.12 1Fh R ============================================================================== Key: M = Command implementation is mandatory. O = Command implementation is optional. R = Operation code is reserved for future standardization. V = Operation code is available for vendor unique commands. MODE SELECT Command Peripheral Device Type: Automatic Medium Changer Operation Code Type: Optional MODE SELECT Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (15h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | SP | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | Parameter List Length | -----|-----------------------------------------------------------------------| 5 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The MODE SELECT command (Table _-_) provides a means for the initiator to specify logical unit or peripheral device parameters to the target. Targets that implement the MODE SELECT command shall also implement the MODE SENSE command. A save parameters (SP) bit of zero indicates the target shall not save the saveable pages to nonvolatile memory. A SP bit of one indicates that the target shall save the saveable pages (if any) sent during the DATA OUT phase to nonvolatile memory. (Saveable pages are identified by the PS bit that is returned in the page header by the MODE SENSE command.) The parameter list length specifies the length in bytes of the MODE SELECT parameter list that shall be transferred from the initiator to the target. A parameter list length of zero indicates that no data shall be transferred. This condition shall not be considered as an error. The MODE SELECT parameter list (Table .-.) contains a four-byte header followed by the vendor unique parameters, if any. MODE SELECT Parameter List ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved | -----|-----------------------------------------------------------------------| 1 | Reserved | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | ============================================================================== | Page(s) | ============================================================================== 0 | Reserved | Page Code | -----|-----------------------------------------------------------------------| 1 | Page-Specific Parameter Length | -----|-----------------------------------------------------------------------| 2 | | - - -|- - Page-Specific Parameters - -| n | | ============================================================================== Each page descriptor specifies parameters for the target to use for subsequent operations on the specific logical unit. The format of each page descriptor depends on the peripheral device type but is always a multiple of four. The page codes for automatic medium changers are given in Table _-_. The parameter length field specifies the length in bytes of the parameters that follow for the specified page. The initiator should set this value to the value that is returned in the parameter length field for the same page by the MODE SENSE command. If this condition is not met, the target may return the CHECK CONDITION status and set the sense key to ILLEGAL REQUEST. (Note that the parameter length value returned by the MODE SENSE command may be less than the full page.) Page Codes for Automatic Medium Changers ============================================================================== Page Code Description Section ---------- -------------------------------------------- ------- 00h Vendor Unique (does not require page format) 01h - 1Dh Reserved 1Eh Device Geometry Parameters 1Fh Transport Geometry Parameters 20h - 3Eh Vendor Unique 3Fh (Defined for MODE SENSE only) ============================================================================== Device Geometry Parameters ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved | Page Code (1Eh) | -----|-----------------------------------------------------------------------| 1 | Parameter Length (12h) | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----+--- First Storage Element Address ---| 3 | (LSB) | -----|-----------------------------------------------------------------------| 4 | (MSB) | -----+--- Number of Storage Elements ---| 5 | (LSB) | -----+-----------------------------------------------------------------------+ 6 | (MSB) | -----+--- First Input/Output Element Address ---| 7 | (LSB) | -----|-----------------------------------------------------------------------| 8 | (MSB) | -----+--- Number of Input/Output Elements ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | (MSB) | -----+--- Medium Transport Element Address ---| 11 | (LSB) | -----|-+---------------------------------------------------------------------| 12 | (MSB) | -----+--- Number of Medium Transport Elements ---| 13 | (LSB) | -----|-+---------------------------------------------------------------------| 14 | (MSB) | -----|--- First Data Transfer Element Address ---| 15 | (LSB) | -----|-----------------------------------------------------------------------| 16 | (MSB) | -----+--- Number of Data Transfer Elements ---| 17 | (LSB) | -----|-----------------------------------------------------------------------| 18 | Reserved | -----|-----------------------------------------------------------------------| 19 | Reserved | ============================================================================== The First Storage Element Address specifies a sixteen bit number that identifies the first medium storage cell contained in the automatic medium changer. The Number of Storage Elements is a sixteen bit number that defines the total number of medium storage cells contained in the automatic medium changer. The target shall return a CHECK CONDITION status with the sense key set to ILLEGAL REQUEST if the Number of Medium Storage Elements field is greater than the default value returned in the MODE SENSE parameter data. The First Input/Output Element Address is a sixteen bit number that identifies the first medium portal that is accessible both by the medium transport devices and also by an operator from outside the automatic medium changer. The Number of Input/Output Elements is a sixteen bit number that defines the total number of Input/Output elements contained in the automatic medium changer and accessible to the medium transport devices. Note: this number may be zero. The target shall return a CHECK CONDITION status with the sense key set to ILLEGAL REQUEST if the Number of Input/Output elements field is greater than the default value returned in the MODE SENSE parameter data. The Medium Transport Element Address specifies a sixteen bit number that identifies the first medium transport element contained in the automatic medium changer. The Number of Medium Transport Elements is a sixteen bit number that defines the total number of medium transport elements contained in the automatic medium changer. The target shall return a CHECK CONDITION status with the sense key set to ILLEGAL REQUEST if the Number of Medium Transport Elements field is greater than the default value returned in the MODE SENSE parameter data. The First Data Transfer Element Address is a sixteen bit number that identifies the first data transfer device contained in the automatic medium changer. The data transfer elements may be either read/write or read only devices. The Number of Data Transfer Elements is a sixteen bit number that defines the total number of data transfer devices contained within the automatic medium changer and accessible to the medium transport device.The target shall return a CHECK CONDITION status with the sense key set to ILLEGAL REQUEST if the Number of Data Transfer Elements field is greater than the default value returned in the MODE SENSE parameter data. Each element in the automatic medium changer must have a unique address. The target shall return a CHECK CONDITION status with the sense key set to ILLEGAL REQUEST if the address ranges defined for any of the element types overlap. Transport Geometry Parameters ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved | Page Code (1Fh) | -----|-----------------------------------------------------------------------| 1 | Parameter Length | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | Reserved | -----|--- ---| 4 | | -----|--- ------------------------------| 5 | (LSB) | grip2 | grip1 | Invert | ============================================================================== The Parameter Length specifies the number of bytes of Mechanism Geometry parameters to follow. The geometry of each mechanism is described using a four byte field as defined below. The grip1 bit is set to one and the grip2 bit is set to zero if the medium transport is capable of handling only one unit of media at one time. If the medium transport is capable of handling two units of media at a time, both the grip1 bit and the grip2 bit are set to one. (Implementor's note: If the changer has two medium gripping devices and supports changeable parameter values, these bits can be used for enabling or disabling the use of either of the gripping devices.) If the medium transport element supports medium rotation for handling double sided media, the invert bit is set to one. If it does not provide for medium rotation for handling double sided media, the invert bit is set to zero. All other bits of this field are reserved. RESERVE Command Peripheral Device Type: Automatic Medium Changers Operation Code Type: Optional RESERVE Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (16h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | 3rdPty | Third Party Device ID | Element| -----|-----------------------------------------------------------------------| 2 | Reservation Identification | -----|-----------------------------------------------------------------------| 3 | (MSB) | -----|--- Element List Length ---| 4 | (LSB) | -----|-----------------------------------------------------------------------| 5 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The RESERVE command (Table 8-__) is used to reserve units or, if the element reservation option is implemented, elements within units for the use of the initiator. The third-party reservation allows units or elements to be reserved for another specified SCSI device. The RESERVE and RELEASE commands provide the basic mechanism for contention resolution in multiple-initiator systems. Logical Unit Reservation If the element bit is zero, this command shall request that the entire unit be reserved for the exclusive use of the initiator until the reservation is superseded by another valid RESERVE command from the initiator that made the reservation or until released by a RELEASE command from the same initiator that made the reservation, by a BUS DEVICE RESET message from any initiator, by a "hard" RESET condition, or by a power off/on cycle. A unit reservation shall not be granted if the unit or any element is reserved by another initiator. It shall be permissible for an initiator to reserve a unit that is currently reserved by that initiator. If the element bit is zero, the reservation identification and the element list length shall be ignored. If the unit, or any element within the unit is reserved for another initiator, the target shall respond by either: (1) returning a RESERVATION CONFLICT status (2) queuing the reservation request and then disconnecting until all previously queued reservations have been released and the unit is available, then reconnecting to perform the reservation If, after honoring the reservation, any other initiator then subsequently attempts to perform any command on the reserved unit other than an INQUIRY command, a REQUEST SENSE command, a RESERVE command, which may be queued, or a RELEASE command, which shall be ignored, then the command shall be rejected with RESERVATION CONFLICT status. Element Reservation (Optional) The reservation identification provides a means for an initiator to identify each element reservation. This allows an initiator in a multiple tasking environment, to have multiple reservations outstanding. The reservation identification is used in the RELEASE command to specify which reservation is to be released. It is also used in superseding RESERVE commands to specify which reservation is to be superseded. If the element reservation option is implemented, then the element release option (see 8.1.9.2) shall also be implemented. These options permit multiple elements within the unit to be reserved, each with a separate reservation type. If the element bit is one, and the element reservation option is implemented, then the target shall process the reservation request as follows: (1) The element list shall be checked for valid element addresses. If any element address is invalid for this unit, the command shall be terminated with a CHECK CONDITION status and the sense key shall be set to ILLEGAL REQUEST. The element list shall be checked for invalid element overlaps with other element descriptors in the element list and if invalid overlaps are found, the command shall be terminated with a CHECK CONDITION status and the sense key shall be set to ILLEGAL REQUEST. (2) If the requested reservation does not conflict with any active or previously requested reservation, the elements specified shall be reserved until superseded by another valid RESERVE command from the initiator that made the reservation or until released by a RELEASE command from the same initiator, by a BUS DEVICE RESET message from any initiator, or by a "hard" RESET condition. If either of the last two conditions occur, the next command from each initiator shall be terminated with a CHECK CONDITION status and the sense key shall be set to UNIT ATTENTION. (3) If the reservation request conflicts with a reservation already active or a reservation request that is already queued, then the target shall either: (a) return RESERVATION CONFLICT status (b) queue the reservation and disconnect until it is allowed to be active. Reservations are only made active when all elements are free from conflict with active or previously queued reservations. If the element bit is one, and the element reservation option is not implemented, then the RESERVE command shall be rejected with CHECK CONDITION status and the sense key shall be set to ILLEGAL REQUEST. Data Format of Element List Descriptors ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved -----|-----------------------------------------------------------------------| 1 | (MSB) | -----|--- Number of Elements ---| 2 | (LSB) | -----|-----------------------------------------------------------------------| 3 | (MSB) | -----|--- Element Address ---| 4 | (LSB) | ============================================================================== The size of the element list shall be defined by the element list length parameter. The element list shall consist of zero or more descriptors as shown in Table _-_. Each element list descriptor defines a series of elements beginning at the specified element address for the specified number of elements. If the number of elements is zero, the element list shall begin at the specified element address and continue through the last element address on the unit. If an initiator attempts a command to a block that has been reserved, the command shall not be performed and the command shall be terminated with a RESERVATION CONFLICT status. If a reservation conflict precludes any part of the command, none of the command shall be performed. Third Party Reservation The third-party reservation for the RESERVE command allows an initiator to reserve a unit or elements within a unit for another SCSI device. This is intended for use in multiple-initiator systems that use the COPY command. Third-party reservation is required. If the third-party (3rdPty) bit is zero, then the third-party reservation option is not requested. If the 3rdPty bit is one and the third-party reservation option is implemented, then the RESERVE command shall reserve the specified unit or elements for the SCSI device specified in the third-party device ID field. The target shall preserve the reservation until it is superseded by another valid RESERVE command from the initiator that made the reservation or until it is released by the same initiator, by a BUS DEVICE RESET message from any initiator, or a "hard" RESET condition. The target shall ignore any attempt to release the reservation made by any other initiator. If the 3rdPty bit is one and the third-party reservation option is not implemented, then the target shall reject the RESERVE command with a CHECK CONDITION status and the sense key shall be set to ILLEGAL REQUEST. Superseding Reservations An initiator that holds a current reservation may modify that reservation by issuing another RESERVE command to the same unit and, if the element bit is one, using the same reservation identification. The superseding RESERVE command shall release the previous reservation state when the new reservation request is granted. The current reservation shall not be modified if the new reservation request cannot be granted. If the superseding reservation cannot be granted because of conflicts with a previous active reservation (other than the reservation being superseded), then the target shall either: (1) return RESERVATION CONFLICT status (2) queue the reservation request and disconnect until it is allowed to be active. The reservation request shall be made active when it is free from conflict with all active reservations. A superseding reservation takes priority over any previously queued reservation request. IMPLEMENTORS NOTE: Superseding reservations are principally intended to allow the SCSI device ID to be changed on a reservation using the third- party reservation option. This capability is necessary for certain situations when using the COPY command. RELEASE Command Peripheral Device Type: Automatic Medium Changers Operation Code Type: Optional RELEASE Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (17h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | 3rdPty | Third Party Device ID | Element| -----|-----------------------------------------------------------------------| 2 | Reservation Identification | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | Reserved | -----|-----------------------------------------------------------------------| 5 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The RELEASE command (Table 8-17) is used to release previously reserved units, or, if the element release option is implemented, previously reserved elements within units. It is not an error for an initiator to attempt to release a reservation that is not currently active. In this case, the target returns GOOD status without altering any other reservation. Logical Unit Release. If the element bit is zero, this command shall cause the target to terminate all unit and element reservations that are active from the initiator to the specified unit. Element Release (Optional). If the element bit is one and the element release option is not implemented, then the RELEASE command shall be terminated with a CHECK CONDITION status and the sense key shall be set to ILLEGAL REQUEST. This option shall be implemented if the element reservation option (see 8.1.8.2) is implemented. If the element bit is one and the element release option is implemented, this command shall cause any reservation from the requesting initiator with a matching reservation identification to be terminated. Other reservations from the requesting initiator shall remain in effect. If the unit queues reservations, then when a RELEASE command is processed, the reservation queue shall be examined on a first-in first-out basis. If there are one or more reservations in the queue that can now be activated, the unit shall first disconnect from the initiator. It shall then successively reconnect with each initiator whose queued reservation may now be activated. A queued reservation request shall not be activated if it conflicts with any previously queued reservation. After first granting all possible queued reservations, the unit shall reconnect with the initiator of the RELEASE command to terminate the command. If a unit that queues reservations receives a RELEASE command from a second initiator while it is disconnected during processing of a previous RELEASE command, it shall then disconnect from the second initiator and suspend processing of the second RELEASE until after reconnection with the first initiator, or until it is determined that reconnection has failed. Third Party Release The third-party release for the RELEASE command allows an initiator to release a unit or elements within a unit that were previously reserved using third-party reservation (see 8.1.8.3). Third-party release shall be implemented, and is intended for use in multiple-initiator systems that use the COPY command. If the third-party (3rdPty) bit is zero, then the third-party release option is not requested. If the 3rdPty bit is one and the target implements the third-party release option, then the target shall release the specified unit or elements, but only if the reservation was made using the third-party reservation option by the initiator that is requesting the release for the same SCSI device as specified in the third-party device ID field. If the 3rdPty bit is one and the target does not implement the third-party release option, then the target shall terminate the command with a CHECK CONDITION status and the sense key shall be set to ILLEGAL REQUEST. MODE SENSE Command Peripheral Device Type: Automatic Medium Changer Operation Code Type: Optional MODE SENSE Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (1Ah) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | -----|-----------------------------------------------------------------------| 2 | PC | Page Code | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | Allocation Length | -----|-----------------------------------------------------------------------| 5 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The MODE SENSE command (Table _-_) provides a means for a target to report its logical unit or peripheral device parameters to the initiator. It is a complementary command to the MODE SELECT command for support of devices that may allow different operating modes. The page control (PC) field defines the type of parameter values to be returned as defined below. DB(7) DB(6) Type of Parameter Values Section ----- ----- ------------------------ ------- 0 0 Current Values 0 1 Changeable Values 1 0 Default Values 1 1 Saved Values The page code specifies which page or pages to return. The page codes are as defined in Table _-_. The allocation length specifies the number of bytes that the initiator has allocated for returned MODE SENSE Data. An allocation length of zero indicates that no MODE SENSE data shall be transferred. This condition shall not be considered as an error. Any other value indicates the maximum number of bytes that shall be transferred. The target shall terminate the DATA IN phase when allocation length bytes have been transferred or when all available MODE SENSE data have been transferred to the initiator, whichever is less. Current Values A PC field value of 0h requests the target return the current values for the page code specified. The current values returned are: 1) The parameters set in the last successful MODE SELECT command. 2) The saved values if a MODE SELECT command has not been executed. 3) The default values if saved values are not available or not supported. If the page code is 3Fh, all implemented pages are requested to be returned by the target. Implementors note: Page code 0h is vendor unique and may be returned as the last page if it is returned at all during a page code 3Fh request. Normally the pages are returned in ascending order. Parameters not supported by the target shall be set to zero. The parameter length of each page indicates the length of the parameters that are supported. Changeable Values A PC field value of 1h requests the target return the changeable values for the page code specified. The page requested shall be returned with the bits that are allowed to be changed set to one. Parameters that are not changeable shall be set to zero. If any part of a field is changable all bits in that field are set to one. If the page code is 3Fh, all implemented pages are requested to be returned by the target. 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 the default parameters set. Parameters not supported by the target shall be set to zero. (Implementors note: The value of the parameters returned is intended to avoid confusion over whether the value of zero is the default or the unsupported value.) If the page code is 3Fh, all implemented pages are requested to be returned by the target. Saved Values A PC field value of 3h requests the target return the saved values for the page code specified. The page requested shall be returned with the saved parameters set. Parameters not supported by the target shall be set to zero. (Implementors note: The value of the parameters returned is intended to avoid confusion over whether the value of zero is the default or the unsupported value.) If saved values are not available or not supported a CHECK CONDITION status shall be returned with the sense key set to ILLEGAL REQUEST and the Additional Sense Code set to Save Parameters Not Supported. If the page code is 3Fh, all implemented pages are requested to be returned by the target. Implementors note: The method of saving parameters is vendor unique. The parameters must be preserved in such a manner that they are retained when the target is powered down. Pages can be considered saved when the Mode Select command with the Save Parameters bit set has returned a status of GOOD. The MODE SENSE data (Table _-_) contains a four-byte header, followed by zero eight-byte block descriptors, followed by pages of parameter data or vendor unique parameters, if any. MODE SENSE Data ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Sense Data Length | -----|-----------------------------------------------------------------------| 1 | Reserved | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | ============================================================================== | Pages | ============================================================================== 0 | PS |Reserved| Page Code | -----|-----------------------------------------------------------------------| 1 | Page-Specific Parameter Length | -----|-----------------------------------------------------------------------| 2 | | - - -|- - Page-Specific Parameters - -| n | | ============================================================================== The sense data length specifies the length in bytes of the following MODE SENSE data that is available to be transferred during the DATA IN phase. The sense data length does not include itself. Blocks of parameters called pages may be sent to the target in the DATA phase of the MODE SELECT command, following the MODE SELECT header. Each defined Page is preceded by a Header of two bytes defining the Page Code and the length of the page. Following the Header the Pages are separated into sub-blocks containing a list of related flags and/or values. The Parameters Saveable (PS) bits of each Page Header are set to one by the target to indicate that the supported parameters can be saved by the target. PS bits set to zero indicates that the supported parameters cannot be saved by the target. The Page Code identifies the meaning of the following bytes in the Page. The parameters in the defined Pages are classified in priority to ease implementation by the target. The Page-Specific Parameter Length indicates the number of bytes that the target supports in each Page. The Page-Specific Parameter Length value of each defined page, shall not include the Page-Specific Parameter Length byte. The target may return in the pages of the MODE SENSE commands as many consecutive bytes as it supports, for each page that it supports, without splitting fields of multiple bytes. The page length shall be set in the pages of the MODE SELECT commands to the value returned by the target in the MODE SENSE page length bytes. Otherwise, the target shall create CHECK CONDITION status with the sense key of ILLEGAL REQUEST. Implementors Note: The initiator shall issue a MODE SENSE command requesting the target to return all Changeable values (PC field configuration 0 1 and Page Code 3Fh in byte 2 of the MODE SENSE CDB) prior to issuing any MODE SELECT commands, in order to find out which Pages are implemented by the target and the length of each Pages for that particular LUN. After a power up condition or hard SCSI reset condition, the following is required of the target in response to a MODE SENSE command. If Default Values are requested report the default values. If Saved Values are requested, report the valid restored parameters, or restore the parameters and report them. If the saved parameters are not able to be accessed in non-volatile memory terminate the command with a CHECK CONDITION status and the sense key set to NOT READY. If the current values are requested, report a valid set of saved parameters, or restore the parameters and report them. If the current parameters are not able to be accessed in non-volatile memory terminate the command with a CHECK CONDITION status and the sense key set to NOT READY. An attempt may be made to identify the parameters if the target is unable to save parameters. At the targets option it may report default values. Group 5 Commands for Automatic Medium Changers The Group 5 commands for automatic medium changer shall be as shown in Table 12-8. Group 5 Commands for Automatic Medium Changers ============================================================================== Operation Code Type Command Name Section Page ------------------------------------------------------------------------------ A0h V A1h V A2h V A3h V A4h O READ ELEMENT STATUS n.2.1 A5h M MOVE MEDIUM n.2.2 A6h O EXCHANGE MEDIUM n.2.3 A7h V A8h V A9h V AAh V ABh R ACh R ADh R AEh R AFh R B0h R B1h R B2h R B3h R B4h R B5h R B6h R B7h R B8h R B9h R BAh R BBh R BCh R BDh R BEh R BFh R ============================================================================== Key: M = Command implementation is mandatory. O = Command implementation is optional. R = Operation code is reserved for future standardization. V = Operation code is available for vendor unique commands. READ ELEMENT STATUS Command Peripheral Device Type: Automatic Medium Changer Operation Code Type: Optional READ ELEMENT STATUS Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (38h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- Starting Element Address ---| 3 | (LSB) | -----|-----------------------------------------------------------------------| 4 | (MSB) | -----|--- Number of Elements ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | Reserved | -----|-----------------------------------------------------------------------| 8 | Reserved | -----|-----------------------------------------------------------------------| 9 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The READ ELEMENT STATUS Command Table (_-_) provides a means for the target to report the status of its internal elements to the initiator. The starting element address specifies the first element whose status is to be reported. The number of elements specifies the number of elements whose status is to be reported. ELEMENT STATUS Data ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | (MSB) | -----|--- Starting Cell Address ---| 1 | (LSB) | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- Number of Cells ---| 3 | (LSB) | -----|-----------------------------------------------------------------------| 4 | Reserved | -----|-----------------------------------------------------------------------| 5 | Reserved | ============================================================================== | Status Report Data | ============================================================================== | Element Type Code | Data Length | -----|-----------------------------------------------------------------------| | Data Mask | ============================================================================== The starting element address specifies the first element whose status is to be reported. The number of elements specifies the number of elements whose status is to be reported. The Element Type Code defines the type of element whose status is being reported. This is used in selecting the proper mask for interpreting the status data being returned. Element Type Code ============================================================================== Code Description Data Length Section ----- ---------------------------- ----------- ------- 0h Unused address 1h 1h Storage element 1h 2h Input/Output element 1h 3h Medium transport element 4h 4h Data transfer element 1h 5h-Fh Reserved ============================================================================== The data mask varies depending on the element type as defined below. No Element Defined for Indicated Address Data Mask - Element Type Code 0h ============================================================================== Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -----|-----------------------------------------------------------------------| | Vendor Unique | Reserved | ============================================================================== Some of the addresses within the range specified by the initiator may not have been assigned to any element type. This shall not be considered to be an error. Instead, the target shall respond with the type code bits set to 0h. Storage Element Data Mask - Type Code 1h ============================================================================== Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -----|-----------------------------------------------------------------------| | Vendor Unique | Reserved | Access | Error | Resv'd | Full | ============================================================================== The full bit is set to one to indicate that the storage element contains a unit of media. The full bit is set to zero to indicate that the storage element does not contain a unit of media. The error bit is set to one to indicate that the storage element is in an abnormal state. This bit is set to zero if the storage element is in its normal state. The access bit is set to one if access to the storage element by the medium transport element is allowed. This bit is set to zero if access to the storage element by the medium transport element is denied. All other bits in this data mask are reserved. Input/Output Element Address Data Mask - Type Code 2h ============================================================================== Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -----|-----------------------------------------------------------------------| | Vendor Unique | Reserved | Access | Error | I/O | Full | ============================================================================== The full bit is set to one to indicate that the Input/Output element contains a unit of media. The full bit is set to zero to indicate that the Input/Output element does not contain a unit of media. The I/O bit is set to one if the unit of media in the Input/Output element was placed there by an operator. This bit is set to zero if the unit of media in the Input/Output element was placed there by the medium transport element. The error bit is set to one to indicate that the Input/Output element is in an abnormal state. This bit is set to zero if the Input/Output element is in its normal state. An example of an abnormal state would be if the operator placed the unit of media into the Input/Output element incorrectly. The access bit is set to one if access to the Input/Output element by the medium transport element is allowed. This bit is set to zero if access to the Input/Output element by the medium transport element is denied. (Implementor's note: An example of when access would be denied is when the operator has access to the Input/Output element.) All other bits in this data mask are reserved. Medium Transport Element Address Data Mask - Type Code 3h ============================================================================== Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -----|-----------------------------------------------------------------------| 0 | Vendor Unique | Reserved | Error | Full2 | Full1 | -----|-----------------------------------------------------------------------| 1 | | -----|--- ---| 2 | Reserved | -----|--- ---| 3 | | ============================================================================== If the medium transport element is only capable of holding one unit of media at a time, the full1 bit is set to one if it is holding a unit of media and the full1 bit is set to zero if it is not holding a unit of media. If the medium transport element is capable of handling two units of media at once, the full1 bit is set to one if the medium transport is holding a unit of media in the first of its medium gripping devices and the full1 bit is set to zero if the medium transport is not holding a unit of media in the first of its medium gripping devices. If the medium transport element is capable of handling two units of media at once, the full2 bit is set to one if the medium transport is holding a unit of media in the second of its medium gripping devices and the full2 bit is set to zero if the medium transport is not holding a unit of media in the second of its medium gripping devices. If the medium transport device is only capable of handling one unit of media at a time, the full2 bit is reserved. The error bit is set to one to indicate that the medium transport element is in an abnormal state. This bit is set to zero if the medium transport element is in its normal state. All other bits in this data mask are reserved. Data Transfer Element Address Data Mask - Type Code 4h ============================================================================== Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -----|-----------------------------------------------------------------------| | Vendor Unique | Reserved | Access | Error |Reserved| Full | ============================================================================== The full bit is set to one to indicate that the data transfer element contains a unit of media. The full bit is set to zero to indicate that the data transfer element does not contain a unit of media. The error bit is set to one to indicate that the data transfer element is in an abnormal state. This bit is set to zero if the data transfer element is in its normal state. The access bit is set to one if access to the data transfer element by the medium transport element is allowed. This bit is set to zero if access to the data transfer element by the medium transport element is denied. (Implementor's note: Access to the data transfer element by the medium transport element might be denied if a data transfer operation were underway.) All other bits in this data mask are reserved. MOVE MEDIUM Command Peripheral Device Type: Automatic Medium Changer Operation Code Type: Mandatory MOVE MEDIUM Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (A5h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- Transport Element Address ---| 3 | (LSB) | -----|-----------------------------------------------------------------------| 3 | (MSB) | -----|--- Source Address ---| 4 | (LSB) | -----|-----------------------------------------------------------------------| 5 | (MSB) | -----|--- Destination Address ---| 6 | (LSB) | -----|-----------------------------------------------------------------------| 7 | Reserved | -----|-----------------------------------------------------------------------| 8 | Reserved | -----|-----------------------------------------------------------------------| 10 | Reserved | Invert | -----|-----------------------------------------------------------------------| 11 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The MOVE MEDIUM Command (Table _-_) requests that the target move a unit of media between two elements of the automatic medium changer. The transport element address specifies the medium transport element that is to be used in executing this command. The source address specifies the location that the unit of media is taken from. This address may represent a storage element, an input/output element, a data transfer element or a medium transport element. The target shall return a CHECK CONDITION status with the sense key set to ILLEGAL REQUEST if the address specified has not been assigned to a specific element of the automatic medium changer or if it has been assigned to a medium transport element other than the one specified in the transport element address field. The destination address specifies the location that the unit of media is moved to. This address may represent a storage element, an input/output element, a data transfer element or a medium transport element. The target shall return a CHECK CONDITION status with the sense key set to ILLEGAL REQUEST if the address specified has not been assigned to a specific element of the automatic medium changer or if it has been assigned to a medium transport element other than the one specified in the transport element address field. The invert bit is used to specify that the orientation of the unit of media should be reversed prior to placing it at the destination. If the automatic medium changer does not support medium rotation for handling double sided media, this bit is reserved. EXCHANGE MEDIUM Command Peripheral Device Type: Automatic Medium Changer Operation Code Type: Optional EXCHANGE MEDIUM Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (A6h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- Transport Element Address ---| 3 | (LSB) | -----|-----------------------------------------------------------------------| 4 | (MSB) | -----|--- Source Address ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- First Destination Address ---| 7 | (LSB) | -----|-----------------------------------------------------------------------| 8 | (MSB) | -----|--- Second Destination Address ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | Inv1 | Inv2 | -----|-----------------------------------------------------------------------| 11 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The EXCHANGE MEDIUM Command (Table _-_) provides a means for commanding automatic medium changers that can emulate or have the capablibility of handling two units of media at the same time to exchange the unit of media in the transport element with one located at a full element. The unit of media in the full element is moved to an empty destination element. The target shall return a CHECK CONDITION status with the sense key set to ILLEGAL REQUEST if this command is received while the transport element is holding one unit of media, if the first destination element is empty or if the second destination element is full. The transport element address specifies the medium transport element that is to be used in executing this command. The source element address specifies the location that the unit of media is taken from. This address may represent a storage element, an input/output element, a data transfer element or a medium transport element. The target shall return a CHECK CONDITION status with the sense key set to ILLEGAL REQUEST if the address specified has not been assigned to a specific element of the automatic medium changer or if it has been assigned to a medium transport element other than the one specified in the transport element address field. The first destination address specifies the location that the source unit of media is moved to. This address may represent a storage element, an input/output element or a data transfer element. The target shall return a CHECK CONDITION status with the sense key set to ILLEGAL REQUEST if the address specified has not been assigned to a specific element of the automatic medium changer or if it has been assigned to a medium transport element other than the one specified in the transport element address field. The second destination address specifies the location that the first destination unit of media is moved to. This address may represent a storage element, an input/output element or a data transfer element. The target shall return a CHECK CONDITION status with the sense key set to ILLEGAL REQUEST if the address specified has not been assigned to a specific element of the automatic medium changer or if it has been assigned to a medium transport element other than the one specified in the transport element address field. The Inv1 bit is used to specify that the transport element is to be placed in its inverted orientation prior to depositing the unit of media into the first destination element. The Inv2 bit is used to specify that the transport element is to be placed in its inverted orientation prior to depositing the new unit of media into the second destination element. If the automatic medium changer does not support medium rotation for handling double sided media, the Inv1 and Inv2 bits are reserved.