HAM_Instance_Unload
(Function 0x09)
Mandatory function. Directs the HAM to unload a specific
instance of the HAM, as identified by the HAM bus handle.
Parameters
- function
- 0x09
- parameter0
- 0
- parameter1
- 0
- parameter2
- 0
Remarks
This function is sent by NWPA to the HAM as a result of an
operator-entered command on the console screen or a request from
an application. Refer to Unloading a Specific
Instance of a HAM for details. This is always sent
in a Blocking context; however, interrupts might be disabled depending
on the Interrupt_Safe_Execute bit setting of the flags field
in the HAMInfoStruct structure.
Prior to passing this request on to the HAM, NWPA verifies
that either:
- All devices associated with this instance
are not currently in use by an application.
- The operator desires to continue with the unload
regardless of current usage of these devices.
When a HAM that supports HAM_Instance_Unload
receives this Type 0 function from NWPA, it must do the following
tasks:
- Call HAI_Complete_HACB. If the HAM does not support this function,
it must return a HACB completion error of Unsupported HACB Type
Zero function (See HACB Completion
Codes) to NWPA, and skip to Step 5.
If supported, complete the message as successful. This should be
done prior to the HAI_Deactivate_Bus call
to avoid aborting this message.
- Call HAI_Deactivate_Bus to
deactivate the bus associated with the HAM instance to be unloaded.
- Call NPA_Unregister_Options,
passing in the instance number of the HAM instance that is being
unloaded. Do not use -1 as the instance number in this case, because
it will deregister all option instances associated with this HAM.
- Release all other resources (memory, etc.) that
are associated with this instance. Allocated memory can be returned
by using NPA_Return_Memory, for
example.
- Return from the HAM_Execute_HACB call.