LASER MAGNETIC STORAGE MEMO INTERNATIONAL _________________________________________________________________________ Optical Storage Division 10 October 1988 To: SCSI Standards Committee X3T9.2 From: Paul Boulay (719) 593-4323 Subject: Asynchronous Event Notification Revision This is a minor cleanup to revision 2. The first 8 paragraphs of the section 6.6 text have been reworked. The AEN data format table and supporting text is moved to the processor device type SEND command. The requirement for repeating the AEN capability survey as needed is added. Much of this proposal has already been added to the draft SCSI-2 rev. 5. The text in italics is not to be added to the SCSI-2 document. 6.6 Asynchronous Event Notification Asynchronous event notification (AEN) is an optional protocol used to inform processor devices that an asynchronous event has occurred. The notification comes in the form of a SEND command directed to the processor device with a data block that includes device REQUEST SENSE information. Devices that respond to INQUIRY commands as a processor device type with asynchronous event notification capability may be notified of asynchronous events using this protocol. A SCSI device has to be capable of acting as an initiator in order to perform asynchronous event notification. IMPLEMENTORS NOTE: Asynchronous event notification cannot be used with a device that acts as a temporary initiator (e.g., devices executing third party COPY commands) since they are not identified as a processor device. Use of AEN is governed by the permissions fields in the Asynchronous Event Notification Parameters MODE SELECT page. Four uses for AEN in a SCSI system are: (1) for a device to promptly inform a processor of an error condition encountered after command completion; (2) for a device newly initialized to inform all the processor devices on the bus of its availability; (3) for a device to inform processor(s) of other Unit Attention conditions; and (4) for a device to inform processors of other state changes that supply sense key 0h information. Other uses of AEN are not prohibited, however this protocol is not intended to be used while an I-T-L nexus exists between the processor (initiator of the nexus) and the device. An example of the first case above is a tape that implements write caching. Notification of an unable to write condition can be sent to the processor that initiated the write via the AEN protocol. An extended contingent allegiance condition may also be established during the same I-T-L nexus used for the AEN SEND command. (See 5.6.10.) An example of the third case above is a device that supports removable media. AEN may be used to report a not ready to ready transition (media changed) and also operator initiated state changes such as write protect switch and start / stop switch actuations. [to ljl: need ASC/ASCQ for operator media removal request - i.e. ready to not ready timer started.] An example of the fourth case above is a tape performing a REWIND command with the immediate bit set. Notification of beginning of media reached may be reported via the AEN protocol. Similarly, completion of a CD-ROM AUDIO PLAY operation started in the immediate mode may be reported via a AEN notification. [to ljl: need ASC/ASCQ for Audio Play operation complete. Maybe 00/??.] Notification of an asynchronous event is performed using the SEND command with the AEN bit set to one. The information identifying the condition being reported shall be returned during the DATA IN phase of the SEND command. (See 11.2.2.) The data sent beginning at byte 4 of the SEND command AEN data format shall be the same as that which would have been returned to report the event in response to a REQUEST SENSE command. An error or unit attention condition successfully reported using the AEN protocol shall not also cause a CHECK CONDITION termination of a subsequent command. Similarly, if a CHECK CONDITION termination of a command from some processor is caused by an event, an AEN protocol notification shall not be initiated to report the same event to that processor. An event may be reported with either the CHECK CONDITION / REQUEST SENSE protocol or with the AEN protocol but shall not be reported to the same processor with both. AEN protocol notification of command related exception conditions shall be sent only to the processor that initiated the operation. Systems in which devices can become available independent of the rest of the system may use the AEN protocol to inform processors when they become ready. In this case the SEND command shall transfer a REQUEST SENSE data block with the UNIT ATTENTION sense key. Successful delivery of a unit attention condition notification via the AEN protocol shall clear the unit attention condition with respect to the receiving processor device. A device that wishes to perform asynchronous event notification shall conducts a survey to determine which devices respond to the Processor Device type command set and have AEN capability. This survey is conducted by sending an INQUIRY command to logical unit 0 of each device that responds to selection. This survey shall be conducted prior to the first AEN and shall be repeated whenever the device becomes aware of a new device or the AEN capability state information may have become invalid. (See 5.6.22, SDTR message, for examples of these conditions.) After conducting the survey, the device verifies that each processor device with AEN capability is ready to receive asynchronous event notifications by issuing a TEST UNIT READY command. If a CHECK CONDITION status is returned a REQUEST SENSE command is issued. This procedure clears any pending UNIT ATTENTION conditions. A processor device which reports AEN capability responds to a TEST UNIT READY with GOOD status shall be ready to accept an AEN SEND command. IMPLEMENTERS NOTE: A SCSI device which can use AEN at initialization time should provide means to defeat these notifications. This can be done with a switch or jumper. Devices which implement saved parameters may alternatively save the AEN permissions either on a per SCSI ID basis or as a system wide option. In any case, a device must conduct a survey with INQUIRY commands to be sure that the devices on the SCSI bus are appropriate destinations for AEN SEND commands. (The devices on the bus or the SCSI ID assignments may have changed.) The Asynchronous Event Notification Parameters MODE SELECT / MODE SENSE page is the means for a processor device to give explicit permission to a SCSI bus device for AEN SEND commands. This page is applicable to all device types. Devices that do not save mode select parameters save AEN will probably reject non zero RAENP and Ready AEN Holdoff fields. The following table and accompanying definitions are to be added to the MODE SELECT section of 7.2.x. Table 7-xx: Asynchronous Event Notification Parameters ============================================================================== Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved | Page Code (TBD) | ------|----------------------------------------------------------------------| 1 | Parameter Length (06h) | ------|----------------------------------------------------------------------| 2 | Reserved | ------|----------------------------------------------------------------------| 3 | Reserved | RAENP | UAENP | EAENP | ------|----------------------------------------------------------------------| 4 | Reserved | ------|----------------------------------------------------------------------| 5 | Reserved | ------|----------------------------------------------------------------------| 6 | | ------|- - - - Ready AEN Holdoff Period (0 - 0FFFFh mS ) - - - -| 7 | | ============================================================================== The Asynchronous Event Notification Parameters Page (Table 7-xx) provides control over the use of the AEN protocol. A Ready AEN Permission (RAENP) bit of one indicates that a device may initiate a SEND command with the AEN bit set upon completing its power up or hard reset initialization sequence. Note that this requires implementation of saved parameters. A Unit Attention AEN Permission (UAENP) bit of one indicates that a device may initiate a SEND command with the AEN bit set upon sensing a Unit Attention Condition other than a reset. An Error AEN Permission (EAENP) bit of one indicates that a device may initiate a SEND command with the AEN bit set upon sensing an error condition encountered while performing an operation initiated by a completed command (AEN deferred error reporting.) The Ready AEN Holdoff Period field indicates the minimum number of milliseconds after starting its initialization sequence due to a reset condition or power-up before initiating a SEND command with the AEN bit. This parameter may be rounded up to the nearest capable value of the device. Note that this requires implementation of saved parameters. 6.1.3 Unit Attention Condition Add the following new paragraph to the end of section 6.1.3. If a target issues a SEND Command with the AEN bit set which reports the Unit Attention condition to an initiator and the command executes with GOOD Completion Status, then the target shall clear the Unit Attention condition with respect to that initiator. The AEN Data Format table is moved to 11.2.2, the Processor Device Type, SEND command section. If the AEN bit is set to one, this SEND command is an Asynchronous Event Notification. The data to be transferred during the DATA IN phase shall conform to the AEN data format of Table 11-xx. The data sent beginning at byte 4 shall be the same as that which would have been returned to report the event in response to a REQUEST SENSE command. Table 11-xx: SEND Command - AEN Data Format ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved | LUNTAR | Reserved |Logical Unit Number/LUNTPN| -----|-----------------------------------------------------------------------| 1 | Sub-logical Unit Number | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 to| Sense Data Byte (0) | - - -|- - - -| n+4 | Sense Data Byte (n) | ============================================================================== The identify, LUNTAR, logical unit number/LUNTPN, and sub-logical unit fields are defined in 5.6.8. The sense data bytes are defined in Table 7-58.