X3T9.2/91-19 Rev. 0 Date: Feb. 15, 1991 To: X3T9.2 Committee (SCSI) From: Paul Hanmann Emulex Corporation 3545 Harbor Blvd. Costa Mesa, Ca. 92626 Work phone: (714)668-5328 Internet: p_hanmann@emulex.com Subject: Using MODE SELECT to reset a drive to defaults. Before SCSI-2 became an accepted reference for designing SCSI products, people used the CCS standard and SCSI-1 as the definitive answer on how to design SCSI devices. One of the problems was the way in which a peripheral device, in my case a disk drive, could be reset to defaults. As a OEM host bus adaptor manufacturer, most of the time we have little or no control over the configuration of drives which are hooked to our HBA's originate. The accepted method of accomplishing this was through the following sequence: 1. Request Default MODE SENSE pages from the drive. 2. Request Changeable MODE SENSE pages from the drive. 3. Mask to save only the changeable values. 4. Make changes to changeable fields for Initiator required values. 5. Send back pages thru a MODE SELECT. This accomplished the function of setting the drive "back to a known state". This is supported by the CCS spec and can be found on page 20, second paragraph: "The Target shall create a CHECK CONDITION status when receiving a non- zero value in a MODE SELECT field or bit that the target declared non- changeable in MODE SENSE data." SCSI-2 appears to have not addressed the problem at all but if anything has reversed the direction taken in CCS by the following found on page 7-31 of 10c in the paragraph right after the Implementors Note: "The target shall terminate the MODE SELECT command with CHECK CONDITION status, set the sense key to ILLEGAL REQUEST and set the additional sense code to INVALID FIELD IN PARAMETER LIST for the following conditions: 1) If the Initiator attempts to change any field that is not changeable as reported by the target. In this case, no parameters shall be changed by this command." This appears to be the exact opposite of the CCS standard set and used by many for years. I have no problem with this method and would be glad to just implement software if this was the only problem. In testing we have found that a number of manufacturers currently allow non- changeable values to be sent back as zero, echoed default values, and even incorrect values(ignored?). This causes many problems in coding software to handle all circumstances and is more complicated the deeper you go. Some people return errors if you return a non-changeable value that is affected by a changeable value which the Initiator has modified. Not all the interactions of fields are apparent to the host, and no rules govern how each manufacturer handles these interactions. It would be much better if the normal action was to allow non-changeable fields to be ignored by the target. If this action appears unsuitable I would recommend the following change be done on page 7-31 of revision 10c. "The target shall terminate the MODE SELECT command with CHECK CONDITION status, set the sense key to RECOVERED ERROR and set the additional sense code to ROUNDED PARAMETER for the following condition: 1) If the Initiator attempts to change any field that is not changeable as reported by the target. In this case, no non-changeable parameters shall be changed by this command." "The target shall terminate the MODE SELECT command with CHECK CONDITION status, set the sense key to ILLEGAL REQUEST and set the additional sense code to INVALID FIELD IN PARAMETER LIST for the following conditions: 1) If the Initiator attempts to send an unsupported value...."