3.7 Auto Error Sense

Auto error sense is a generic phrase describing the way in which error sense information is automatically returned with an I/O request for a given bus protocol. As an example, for SCSI this phrase refers to auto REQUEST SENSE. Some adapter boards support this feature and others do not. The HAM, during its load-time initialization, is responsible for determining whether or not the feature is to be used.

There are three fields in the HACBStruct and one in the DeviceInfoStruct that provide NWPA support for auto error sense. The following is a list of these fields:

Fields in the HACBStruct:

    LONG   errorSenseBufferLen; 
    void  *vErrorSenseBufferPtr; 
    void  *pErrorSenseBufferPtr; 
    
    

Field in the DeviceInfoStruct:

    LONG attributeFlags;
    

If auto error sense is used, the HAM needs to indicate this by setting the Auto_Error_Sense_Flag (0x00000040) in the attributeFlags field of the DeviceInfoStruct associated with each device attached to the adapter. The HAM reports the DeviceInfoStruct information to NWPA during HAM_Return_Device_Info (Function 0x02). For a device error under the auto error sense case, the HAM must ensure that the sense information gets placed properly into the HACB's error sense buffer. The error sense buffer is defined by NWPA's ErrorSenseInfoStruct , and its length is a run-time variable according to the CDM that allocated it. The following is the structure's ANSI C definition:

    struct ErrorSenseInfoStruct  
    {
       LONG   numberBytesRequested; 
       LONG   numberBytesReturned; 
       LONG   reserved[2]; 
       BYTE   errorSenseData[1];
     } ;
    

For a description of its fields and its run-time length variability, refer to the structure's reference information in ErrorSenseInfoStruct . Also, NWPA provides the HAM with both virtual and physical (absolute) addresses of the auto error sense buffer, and the buffer is guaranteed to be physically contiguous in memory. These factors should accommodate any transport protocol. The HAM needs to make some special considerations in addition to the method of error handling this specification already prescribes. (These methods refer to queue state behavior, posting of the appropriate HACB completion code, etc.).

These considerations must be dealt with prior to completing the HACB that caused a device error. They are as follows:

    numberBytesReturned = min(numberBytesRequested, BytesReturnedByDevice); 
    
    

The following assumptions apply to the above formula: