4.8 Asynchronous Hardware Event Notification

CDMs can request that HAMs notify them of any hardware events, such as a bus reset, device reset, or a device attention, that may occur. To do this, the CDM must issue a hacbType = 0 HACB request placing the following information in the HACB's union to Host command block:

function
5
parameter0
Bitmap indicating the type of events for which the CDM wants to be notified. Currently, NWPA recognizes the following:

Number

Event

0x00000001

Bus reset

0x00000002

Device reset

0x00000004

Device attention

In order for a HAM to detect a device attention, the CDM must first issue commands that will program the device to issue the alert.

0x00000008

Adapter reset

0x00000010

Device disappeared

0x00000020

Device appeared

0x00000040

Adapter attention

0x00000080-0x40000000

Reserved

0x80000000

Vendor Unique AEN

parameter1
0
parameter2
0

These requests must be issued on a per device basis, meaning that the CDM must provide the correct device handle for the device it wants monitored. The device handle is placed in the 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 HACB, and executes the request by calling CDI_Non_Blocking_Execute_HACB.

The HAM receives the HACB and maintains it in a local holding area associated with the target device until an event occurs. These 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, 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 CDM receives notification of the event when it gets the HACB through CDM_Callback.CDM_Callback is required to check the hacbCompletion field on every HACB it receives. At callback time when the CDM receives a HACB having an AEN completion code, it decodes the bitmap value in the controlInfo field to determine which event occurred, and takes appropriate action. If desired, the CDM can reissue the AEN HACB. To minimize a possible notification-not-available window, the CDM should reissue the AEN HACB.