NWPA provides a mechanism for CDMs to request that HAMs notify them of asynchronous events. These include hardware events such as a bus reset, device reset, or a device attention. The CDM requests for asynchronous event notification (AEN) by issuing a hacbType = 0 request to the HAM. hacbType = 0 means that the HACB's union command area is defined by the host adapter command structure.
A HACB request for asynchronous event notification is also referred to as an AEN HACB.
To register for asynchronous event notification, the CDM must issue an AEN HACB with the following information in the HACB's host adapter command block:
These requests must be issued on a per device basis, meaning that the CDM provides the correct device handle for the device it wants monitored. The device handle is placed in the AEN HACB's deviceHandle field.
The CDM builds the bitmap indicating the events it wants to be informed of, places the bitmap value in the parameter0 field of the AEN HACB, and executes the request by calling the NWPA routine CDI_Non_Blocking_Execute_HACB. This API requires the CDM to provide a pointer to a callback routine as an input parameter.
The HAM receives the AEN HACB through its HAM_Queue_AEN_HACB (Function 0x05) HAM function and maintains it in a local holding area associated with the target device until an event occurs. These AEN HACBs should not be placed in the device queue since they do not represent I/O requests that need device processing.
After an AEN event occurs, the HAM checks to see if the value in parameter0 represents an event that a CDM wants to be notified of. If so, the HAM freezes the device queue, sets a bitmap value in the HACB's controlInfo field to indicate which events occurred, places the AEN code (0x80080000) in the HACB's hacbCompletion field, and completes the AEN HACB by calling HAI_Complete_HACB. The bit definitions for the return bitmap value are the same as those defined for the parameter0 field.
If no CDM has registered for a specific AEN event that occurs, the queue state does not change.
The HAM must be ready to accept multiples of these requests per device. When an event occurs, the HAM should complete all AEN HACBs registered for that event for the target device.