HAM_Queue_AEN_HACB (Function 0x05)
Mandatory function. Directs the HAM to monitor asynchronous hardware events such as a bus or device reset.
This function is identified by the following information in the HACB's command area.
AEN HACBs are used to respond to events detected outside of a pending request. When events are detected because of a request, the appropriate completion status is returned in the request.
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 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 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 because 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, set a bitmap value in the HACB's controlInfo field to indicate which events occurred, place the AEN code (0x80080000) in the HACB's hacbCompletion field, and complete 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 will 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.