To: John Lohmeyer X3T9.2/87-137 Chairman, X3T9.2 From: Robert Snively Date: August 12, 1987 Subject: Programmable Control of SCSI Operating Mode The majority of SCSI target devices today operate according to only one of the SCSI operating definition levels: X3.131, CCS, or proposed SCSI-2. The operating definition level is reported in the response to an INQUIRY command. Those that support more than one level are typically set for the correct mode of operation at installation time by the correct placement of jumpers or the correct selection of PROM firmware. However, to provide flexible support of multiple levels of operating systems, programmable selection of the operating definition may be required by some systems. Programmable selection of the operating definition is required by systems that have new target devices and a mix of old and new hosts running with old and new operating systems. The old hosts must see the new target devices according to the old operating definitions. The new hosts should see the new target devices according to either the old or the new operating definitions, depending on which provides the required set of function. Programmable selection may also be required in single host systems if the host supports more than one level of operating system. At certain times, the host is running the old operating system and requires the old target device definition. At other times, the host is running the new operating system and may require either the old or a new target device definition. Programmable selection may also be useful in modifying the image of a sophisticated device, changing it from one model to another or even changing the device type. This document describes a mechanism for performing programmable definition selection and proposes the textual changes to the SCSI-2 document required to implement the function. To implement programmable definition selection, a target device must obey two operating rules. a) The target device must always respond to an INQUIRY command with the information representing its present operating definition. b) A target that implements programmable definition must respond to a newly defined command, CHANGE DEFINITION, that specifies the operating definition of the target. The change in definition occurrs immediately upon the successful completion of the CHANGE DEFINITION command. The definition is established for all interchanges between the target and the initiator that requested the CHANGE DEFINITION. Each initiator must establish its own set of definitions for attached targets. The initialized operating definition is established by the design specification of the target. The initialized operating definition is entered as the result of a power on sequence, as the result of a hard SCSI reset, or as the result of a Bus Device Reset message. All other SCSI operations leave the target operating definition unchanged. Using these operational rules, programmable operating definition can be managed in the following way. Those targets that do not support programmable operating definition will always respond to INQUIRY with their correct operating definition. They will reject a CHANGE DEFINITION command, since it is in the command space that has been reserved by all specifications prior to the SCSI-2 document. Those initiators that do not support programmable operating definition will treat the target according to the definition that the target provides in the INQUIRY command. Since no CHANGE DEFINITION commands will be issued by such an initiator, the target will always identify itself by the initialized operating definition. Those targets that do support programmable operating definition will respond according to the rules specified above. Those initators that do support programmable operating definition will manipulate the target operating definition to meet their own particular requirements. Normally, a target that supports multiple levels of operating definition will power up with an operating definition which is the lowest common denominator. If this definition is not known to the initiator, the initiator will treat the target as it would any other target of unknown characteristics. Initiators having operating systems that use an operating definition other than the initialized operating definition must have knowledge of which targets may have the capability of changing their operating definition. Since the initialized operating definition of a target that has multiple operating definitions should be a perfect image of the initialized machine, the initiator must have knowledge of which alias operating definitions may hide a multiple operating definition capability. The initiator then executes the appropriate CHANGE DEFINITION command. If the CHANGE DEFINITION command is successful, the new operating definition is immediately effective between that initiator and the target. Any new INQUIRY will recover the new operating definition and all commands will operate in a manner consistent with the new operating definition. If the CHANGE DEFINITION command is invalid , not supported, or not executed successfully, the old operating definition remains effective. If the CHANGE DEFINITION COMMAND did not complete successfully, all operations, including REQUEST SENSE, INQUIRY, and all other commands will operate according to the operating definition in force before the CHANGE DEFINITION was attempted. The execution of a CHANGE DEFINITION command does not require the presentation of UNIT ATTENTION to other initiators unless the image change will prevent proper operation of those initiators. The execution of a CHANGE DEFINITION command may cause disconnection if clean up operations involving the flushing of caches and the completion of queued operations are required. The CHANGE DEFINITION command is not considered complete until GOOD status and the COMMAND COMPLETE message have been presented. The CHANGE DEFINITION command can be implemented to execute rapidly enough that multiple operating systems using different operating definitions can co-execute on a single initiator with little effect on performance. The following textual changes are required in the SCSI-2 document to allow programmable operating definition. The proper operation code must be selected from the reserved space to support the CHANGE DEFINITION command. For this proposal, the operation code is assumed to come from one of the 10 byte command sets. The following text is inserted in the appropriate section of chapter 7, depending on the choice of command code. 7.X.X CHANGE DEFINITION Command Peripheral Device Type: All Operation Code Type: Optional Table 7-xx: CHANGE DEFINITION command ====================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ====================================================================== 0 | Operation Code (xxh) | _____|_______________________________________________________________| 1 | Logical Unit Number | Reserved | _____|_______________________|_______________________________________| 2 | Reserved | _____|_______________________________________________________________| 3 | Reserved | _____|_______________________________________________________________| 4 | Reserved | _____|_______________________________________________________________| 5 | Reserved | _____|_______________________________________________________________| 6 | Reserved | _____|_______________________________________________________________| 7 | Definition Parameter | _____|_______________________________________________________________| 8 | Reserved | _____|_______________________________________________________________| 9 | Vendor Unique | Reserved | Flag | Link | ====================================================================== The CHANGE DEFINITION command modifies the operating definition of the selected target with respect to commands from the selecting initiator. The modification changes only the image of a particular target to a particular initiator. All other targets and the target's image to all other initiators are unchanged. The changed operating definition applies to all LUN's supported by the target. The operating definition is modified after successful completion of the command, including the presentation of GOOD status and a COMMAND COMPLETE message. If the CHANGE DEFINITION command is not executed successfully for any reason, including non- support of the command, invalid parameters, or an execution failure, the operating definition remains the same as it was before the CHANGE DEFINITION command was attempted. The CHANGE DEFINITION command may disconnect if clean up activities are required for any of the affected LUN's. Such clean up activities may include the completion of queued operations or the flushing of cached data. The present operating definition of the target may always be interrogated through the INQUIRY command. A change in the operating definition may change the device type, the device model, the SCSI implementation level, the command set, and any other operating characteristics. The target responds to any command according to the requirements of its present operating definition. The initialized operating definition of the target is vendor unique. The initialized operating definition is always established by a target power on sequence, by a "hard" RESET condition, or by execution of a BUS DEVICE RESET message. The Definition Parameter contains a value which specifies the desired operating definition of the target. The meanings of the Definition Parameter values are defined in the following table. Table 7-xx: Definition Parameter Values Value | Meaning of Definition Parameter Value =========|================================================== 00 h | Initialized Operating Definition _________|__________________________________________________ 01 h | SCSI X3.131 Operating Definition _________|__________________________________________________ 02 h | CCS Operating Definition _________|__________________________________________________ 03 h | SCSI-2 Operating Definition _________|__________________________________________________ 04-7F h | Reserved _________|__________________________________________________ 80-FF h | Vendor Unique _________|__________________________________________________ The Definition Parameter values 01h, 02h, and 03h establish modes of operating compatible with the appropriate SCSI level specification for devices that are otherwise functionally identical. The Vendor Unique values are available for those applications where more complex operation definition changes are required. The following text is inserted in section 6 to describe and clarify the operational characteristics of programmable operating definition. 6.x Programmable Operating Definition Special applications require that the operating definition of a target be modified to meet the special requirements of a particular initiator. The program controlled modification of the operating definition is typically provided to allow back compatible operating systems to operate with more recently developed targets meeting a different level of SCSI specification. The parameters that can be changed by modifying the operating definition of a target include the device type, the device model, the SCSI compliance level, the SCSI specification level, the command set, and other parameters. The low level hardware parameters, including REQ/ACK to DATA BUS timing, arbitration timing, and parity definitions cannot be changed by modifying the operating definition. The present operating definition of a target with respect to an initiator can be determined at any time by execution of an INQUIRY command. In some vendor unique cases, it may also be necessary to perform other investigative actions including MODE SENSE and READ CAPACITY. Each target comes on line with an initialized operating definition. The initialized operating definition may or may not allow the execution of a CHANGE DEFINITION command. If the command can be executed, the present operating definition can be changed to a new operating definition, if any, supported by the target. The actual details of the operating definition of a target are vendor unique. If an error occurs during execution of a CHANGE DEFINITION command, the original operating definition remains in force after the command is executed. A new operating definition becomes active only after successful execution of a CHANGE DEFINITION command. Since new operating definitions may preclude the execution of operations that are already in progress, a CHANGE DEFINITION command will disconnect if necessary to allow the completion of operations that are in progress. Operations that may require such a disconnection include certain forms of caching and queueing. The new operating definition is not effective until both GOOD status and a COMMAND COMPLETE message are received for the command. Operating definition changes that may cause conflicts with the normal operation from other initiators should be implemented very carefully. An example of such a change is a device that operates as a sequential device from one initiator but as a direct access device from a second initiator. The text for the INQUIRY command, presently in section 7.1.3 should be as recommended by G. Floryance and should omit the Desired Data Format bits.