LASER MAGNETIC STORAGE MEMO INTERNATIONAL COMPANY ______________________________________________________________________________ Optical Storage Division 22 October 1987 To: SCSI Standards Committee X3T9.2 From: Paul Boulay (303) 593-4323 Subject: Mode Select Implementations to Support Copy Revision 1 note: The Wichita working group meeting considered this issue and selected the approach presented here. This is a rewrite of Rev. 1 which deletes the third party mode select approach in favor of encapsulating Mode Select parameters in the Copy parameter list. The action item directed that I clarify the permitted modes of storing Mode Select parameters. Revision 2 note: This is the same as Rev. 1 (distributed at the Saratoga Springs plenary), except for adding the EMS bit and moving the Mode Select Area Length field. These changes were suggested by Gary Stevens to allow for future enhancement of the Copy command. Some implementations of maintaining Mode Select parameters in SCSI target devices can prevent proper operation of device to device Copy commands. If a SCSI target maintains an independent set of mode selections for each possible initiator ID, the Copy Master device does not inherit parameters previously set by the Host. If the target device requires particular mode select parameters for proper operation in a system, means to set them up for Copy operations should be available. The Copy Master must be able to inherit such parameters, be informed of them by direct action of the host or the target device must always supply the correct parameters by default. Storing Mode Select Parameters The SCSI-1 standard provides facilities for the management of Mode Select parameters stored on a one set per device or LUN basis. This traditional method is certainly appropriate for format control parameters tied to the media. It also produces a side effect assumed in the architecture of the COPY command. That side effect is the inheritance of the Mode Selections of the host by a Copy Master. In multi-initiator systems where mode selections may be dynamic, storing parameters on a per SCSI ID basis is better. Embedded SCSI implementations can usually do this easily. Controllers without much RAM, with many LUNs, or with many dynamically alterable parameters may have difficulty. Disconnect/reconnect control, error handling selections and vendor unique operating modes are parameters which can reasonably be dynamic or initiator specific. One advantage of per SCSI ID parameter storage is that each host can separately customize its use of the target device and is not affected by the operations of other hosts via spurious Unit Attentions. (Now, any Unit Attention except media change only will cause a host to send a heavy overhead Mode Select command.) SCSI devices which store parameters by ID do not provide inheritance of mode selections from host to copy master. When devices which store mode selections by SCSI ID are Copy sources or destinations their parameters end up being power up defaults. Approaches to the problems of per SCSI ID parameter storage with device to device Copy are next. Impossible Solutions 1) Disallow saving mode select parameters on a SCSI ID basis. This is a simplistic solution that has two problems. It obsoletes some perfectly good SCSI-1 products and it restricts a mode of operation with general merit because of a special case problem. The CCS document explicitly permitted saving parameters in this manner. 2) Disallow device to device Copy. This makes this special case problem disappear and makes existence less challenging for SCSI controller implementers. However, this approach removes existing functionality from the standard and prohibits a class of solutions to SCSI bus bandwidth limitations. 3) Require that the Copy operation always take place with the power up defaults of devices which save parameters by ID. This is unreasonably restrictive and may make efficiently use of Copy impossible. Possible Solutions 4) Where a target used in a Copy command stores parameters by SCSI ID, the host sends the Copy target devices a new Mode Select option which sets parameters for all possible hosts. In this way the Copy Manager will have the appropriate parameters set up for him. The disadvantage is that it would interfere with other hosts who use the target device. They will get Unit Attention indications but should recover reasonably. This approach could apply only to SCSI-2 source and destination devices. 5) The host sends a 3rd party Mode Select with the parameters the target is to use in upcoming commands from the Copy Manager SCSI device. This has the advantage of letting the host do the Copy set up. In addition it is symmetrical with 3rd Party Reservations. However, this approach applies only to new implementations. 6) Require that the Copy Manager set the appropriate mode. This method allows use of SCSI-1 source and destination devices. The Copy Manager needs a way to determine the appropriate parameters. The host sends Copy Managers a new sort of Mode Select which passes the Mode Select data the copy manager is to send to the target devices. This requires a new Mode Select command option implemented in devices which support device to device Copy. The host would send separate Copy source and Copy destination Mode Select commands. This isn't convenient for copy managers because they would have to store the parameters for future use. (Would separate storage be needed for each host device ID? If not, would the device create a Unit Attention if these were overwritten?) 7) The Copy Manager could send Mode Selects from parameters in the Copy parameter block. This permits operation with existing devices and limits the changes to the copy command. It doesn't assume that the copy manager knows about the other devices, the host system passes all the mode information necessary. However, this approach makes the copy command more complicated. The Wichita working group meeting selected the last proposal. The implementation of this implies that all mode selections be done at the beginning of the Copy operation. This is a small restriction from the general case in which the Copy Master is directed to intersperse Mode Selects at arbitrary points. Described below are the proposed additions to the draft specification to carry out this last solution. Add the following to the second paragraph of the Mode Select command text. (Section 8.1.4, Page 8-18 of SCSI-2 Draft Rev.2.) "The target may provide for independent sets of parameters for each attached logical unit or for each combination of logical unit and initiator." The copy command modification uses the two reserved bytes in the copy parameter list header. These bytes become Mode Select Area Length. If this is zero, no Mode select data is present and the copy parameter list is the same as SCSI-1. (Gary Stevens suggested that the Mode Select Area belongs after the Segment Descriptors. He reasoned that this would result in more compatibility with existing implementations. SCSI-1 implementations of Copy will reject non-zero Mode Select Area Lengths because these were Reserved bytes; this covers the compatibility issue. I believe that the Mode Select Area belongs before the Segment Descriptors because any Mode Selections have to be done before the Segment Descriptors are needed. This way, the copy master pulls in control information from the host as needed. The placement of the Mode Select Area is moot in systems such as Gary's which validity check all parameter data before acting on any of it.) The modifications to the copy command are a revised layout of the Parameter List (Table 7-4) and a new section defining the Mode Select Area use and format. Replace the paragraph describing the COPY Parameter List (last paragraph on page 7-3 of SCSI-2 Draft Rev. 2), Table 7-4 The COPY parameter list (Table 7-4) begins with a four-byte header that contains the COPY function code and priority. Following the header are the Mode Select Area (optional) and one or more Segment Descriptors. Table 7-4: COPY Parameter List ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | COPY Function Code | Priority | -----|-----------------------------------------------------------------------| 1 | Vendor Unique | -----|-----------------------------------------------------------------------| 2 | Reserved | EMS | -----|-----------------------------------------------------------------------| 3 | Reserved | ============================================================================== | Mode Select Area (If present) | ============================================================================== 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 defines a specific format for the segment descriptors. The COPY function codes are defined in Table 7-5. 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 Encapsulated Mode Select (EMS) bit, if one, indicates that a Mode Select Area is present. (See 7.1.2.3.) If zero, Segment Descriptor 0 follows the 4 byte header. Add a new section after the error handling sections and prior to the Copy Function code 00h and 01h section. 7.1.2.3 Mode Select Area The Mode Select Area of the Copy Parameter List passes encapsulated Mode Select commands for the Copy Master to send before the copy data transfer. If a copy source or destination device stores Mode Select parameters on a per initiator basis, the Copy Master device must issue Mode Select commands so copy reads and writes use the operating parameters desired by the host. There can be as many Encapsulated Mode Select commands as different logical units involved in the Copy. The Mode Select Area consists of a Mode Select Area Length field followed by a series of Encapsulated Mode Select commands. Each consists of a 4 byte header, followed by a 6 or 10 byte command descriptor block, followed by the parameter block to send with the Mode Select. See Table 7-6. Table 7-6: Encapsulated Mode Select Area ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | | -----|- - - - Mode Select Area Length - - - -| 1 | | ============================================================================== First encapsulated Mode Select Command follows. ============================================================================== 2 | Target Address | Reserved | Target LUN | -----|-----------------------------------------------------------------------| 3 | Reserved | Length of CDB Area (lcdb) | -----|-----------------------------------------------------------------------| 4 | | -----|- - - - Length of Parameter Area (lparm) - - - -| 5 | | ============================================================================== 6 | | - | CDB Area | lcdb+5 | ============================================================================== lcdb+6 | - | Parameter Area | lcdb+lparm+5 | ============================================================================== | Additional encapsulated Mode Select commands as needed. | ============================================================================== The Mode Select Area Length gives the number of bytes in all encapsulated Mode Select commands that follow. The Target Address is the SCSI device address where the Copy Master sends the following Mode Select command. Similarly, the Target LUN is the logical unit addressed via the target device. The Length of CDB Area gives the number of command bytes which follow. The Length of Parameter Area is the number of bytes in the Parameter Area. Note that these lengths are the number of bytes passed from the host to copy master, not necessarily the number of bytes which will be requested by the target device when it executes the command. The Copy Master may assume that the length values represent maximum expected transfers. The Copy Master may assume that the CDB area contains a legal Mode Select command consistent with the target device requirements. Likewise, it may assume that the Parameter Area contains an appropriate Parameter List for the Mode Select command. The execution of the Copy command shall terminate if any of the Mode Select commands executed posts a Sense Key greater than 01h.