HAM_ISR

The HAM's interrupt-time entry point. This entry point determines the request causing an interrupt, completes I/O transfers, posts HACB completion status, and completes HACB requests.

Thread Context:Interrupt Level, Non-Blocking
Requirements:This function cannot make calls to blocking functions.

Syntax

    LONG HAM_ISR (LONG irqHandle);
    
    

Parameters

irqHandle
(IN) The OS passes the value of this parameter, which is a value indicating the interrupt handle on which to take action. The HAM specified the interrupt handle in the Interrupt Option's parameter0 field of the NPAOptionStruct registered for the HAM during NPA_Register_Options.

The High WORD contains the Unique Handle, and the Low WORD contains the IRQ.

Figure 6-2 irqHandle

The Unique Handle must be different for each interrupt that the HAM registers for.

Return Values

The following table lists return values and descriptions.

zero

The interrupt was serviced successfully.

nonzero

The interrupt was not serviced.

Remarks

HAM_ISR is registered with NWPA during NPA_Register_HAM_Module, and it is the HAM's entry point for being notified of hardware interrupts. The term “notified” is used here because actual hardware interrupts are vectored to a system ISR within the OS. NWPA automatically channels the interrupt from the OS to the HAM through this entry point, and the state upon entering HAM_ISR is with interrupts disabled.

HAM_ISR must determine the adapter that caused the interrupt, determine if an error occurred for the request, complete the HACB, and send a new HACB to the device from the device's process queue.

If no error occurred, then HAM_ISR transfers I/O data to and from the buffer indicated in the HACB (in the case of programmed I/O), places the appropriate completion code in the hacbCompletion field, calls HAI_Complete_HACB, and sends a new HACB request in the process queue to the device.

If an error occurred, then HAM_ISR freezes that device's process queue, places the appropriate error completion code in the hacbCompletion field, and calls HAI_Complete_HACB on the HACB.

NOTE:For more information about how this entry point controls queue state, refer to Queue State. For more information about indicating queue state to the CDM, refer to the description of the HACB's hacbCompletion field in Host Adapter Control Block and HACB Completion Codes.

IMPORTANT:HAM_ISR must service only the interrupt called, it must not service more than one interrupt per ISR.