To: John Lohmeyer X3T9.2/87-137 Chairman, X359.2 Revision 1 From: Robert Snively Date: August 12, 1987 Revised October 2, 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 logical units and a mix of old and new hosts running with old and new operating systems. The old hosts must see the new logical units according to the old operating definitions. The new hosts should see the new logical units according to either the old or the new operating definitions, depending on which provides the required set of function. On a single new target, both old and new definitions may need to be applied to the attached logical units from the same initiator. 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. The host may also run two operating systems over a virtual machine, requiring that some logical units support one image and that others on the same target support a second image. 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 logical unit must obey two operating rules. a) The logical unit must always respond to an INQUIRY command with the information representing its present operating definition. b) A logical unit that implements programmable definition must respond to a newly defined command, CHANGE DEFINITION, that specifies the operating definition of the logical unit. The change in definition occurrs immediately upon the successful completion of the CHANGE DEFINITION command. The definition is established for all interchanges between the logical unit and the initiator that requested the CHANGE DEFINITION. Each initiator must establish its own set of definitions for attached logical units. When a target is first attached to a system, the operating definition of the attached LU's is the default value. A new operating definition may be saved if saving is supported. The initialized operating definition is the saved operating definition if one has been saved or the default operating definition if no save has occurred or if saving is not supported. 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 logical unit operating definition unchanged. Using these operational rules, programmable operating definition can be managed in the following way. Those logical units 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 logical unit provides in the INQUIRY command. Since no CHANGE DEFINITION commands will be issued by such an initiator, the logical unit will always identify itself by the default operating definition. Those logical units 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 logical unit operating definition to meet their own particular requirements. Normally, a logical unit that supports multiple levels of operating definition will power up the first time with a default operating definition which is the lowest common denominator. If this definition is not known to the initiator, the initiator will treat the logical unit as it would any other logical unit of unknown characteristics. Initiators having operating systems that use an operating definition other than the default operating definition may inquire of each logical unit if it has the capability of changing its operating definition. 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 logical unit. Any new INQUIRY will recover the new operating definition and all commands will operate in a manner consistent with the new operating definition. The new operating definition may be saved so that subsequent resets and power on sequences will immediately have access to the saved 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 since each initiator can have its own image of the same logical unit. 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. 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 | SNS | SAVE | _____|_______________________________________________|_______|_______| 3 | Definition Parameter | _____|_______________________________________________________________| 4 | Reserved | _____|_______________________________________________________________| 5 | Reserved | _____|_______________________________________________________________| 6 | Reserved | _____|_______________________________________________________________| 7 | Reserved | _____|_______________________________________________________________| 8 | Parameter Sense List Length | _____|_______________________________________________________________| 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. Certain characteristics of the operating definition may also be sensed by the CHANGE DEFINITION command. Any modification changes only the image of a particular logical unit to a particular initiator. All other logical units and their images to all other initiators are unchanged. 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 the selected LUN. 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 vendor identifier, the device type, the device model, the SCSI implementation level, the command set, and any other operating characteristics. The logical unit responds to any command according to the requirements of its present operating definition. The initialized operating definition of the logical unit is the saved operating definition if any has been saved or the default operating definition if none has been saved. 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 Sense control bit (SNS) indicates whether the command is changing the operating definition or sensing operating definition information. If the SNS bit is zero, the CHANGE DEFINITION command is changing the operating definition. The new operating definition will be the one specified by the Definition Parameter. If the Save control bit (SAVE) is one, the new operating definition will be saved and used during subsequent initialization operations. If the SAVE bit is zero, the new operating definition will not be saved. Subsequent initialization operations will invoked the previously saved operating definition, if any, or the default operating definition. If the SNS bit is one, the SAVE bit is ignored. The SNS bit demands an inbound data transfer of a length not to exceed the Parameter Sense List Length. If the SNS bit is one, the Definition Parameter is used as an index to the Parameter Sense List, requesting more detailed information about a particular Definition Parameter. If the SNS bit is zero, the Definition Parameter contains a value which specifies the desired operating definition of the logical unit. 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 | Default 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. If the SNS bit is one, an inbound data transfer containing the parameters requested by the Definition Parameter value will be provided. The inbound data transfer will be truncated to the value specified by the Parameter Sense List Length. If the SNS bit is one and the Definition Parameter value is zero, the following inbound data format will be transmitted. The format is intended to provide a complete list of the Definition Parameters supported by a particular logical unit. Further information about each Definition Parameter is provided by subsequent commands with a non-zero Definition Parameter value. ====================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ====================================================================== 0 | Definition Parameter (00h) | _____|_______________________________________________________________| 1 | Number of parameters in list | _____|_______________________________________________________________| 2 | Default Definition Parameter (00 if Vendor Unique) | _____|_______________________________________________________________| 3 | First Definition Parameter supported | _____|_______________________________________________________________| 4 | Second Definition Parameter supported | _____|_______________________________________________________________| . . . . _____|_______________________________________________________________| n | Last Definition Parameter supported | ====================================================================== If the SNS bit is one and the Definition Parameter value is other than zero, the following format will be returned to the initiator. The format indicates in byte 2 whether or not the parameter is saveable. The Definition Parameter Description is a vendor defined descriptive text not exceeding 255 characters of ASCII information. ====================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ====================================================================== 0 | Definition Parameter | _____|_______________________________________________________________| 1 | Length of Definition Parameter Description | _____|_______________________________________________________________| 2 | Reserved | SAVE | _____|_______________________________________________________|_______| 3 | First byte of Definition Parameter Description | _____|_______________________________________________________________| 4 | Second byte of Definition Parameter Description | _____|_______________________________________________________________| | . | . . . . _____|_______________________________________________________________| 8 | Last byte of Definition Parameter Description | ====================================================================== 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 LU 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 logical unit include the vendor identification, 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 logical unit 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 logical unit 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 any new operating definition, if any, supported by the logical unit. The actual details of the operating definition of a logical unit 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. An initiator may interrogate the logical unit for a list of the operating definitions it supports. After obtaining the list, the initiator may obtain descriptive text for each operating definition. The descriptive text can be made available to the operating system to use as a source for context sensitive help text or for descriptive menus. Both interrogations are performed by the CHANGE DEFINITION command with the SNS bit set. Some simple implementations operating in well known environments may choose not to implement the SNS function. 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.