HAM_Check_Option
The HAM's entry point for accepting and verifying the command line options parsed by NPA_Parse_Options and registered by NPA_Register_Options are valid for the HAM. These command line options indicate hardware resources such as interrupts, ports, DMA channels, shared memory decoding, etc.
LONG HAM_Check_Option ( struct NPAOptionStruct *option, LONG instance, LONG flag );
Value |
Description |
---|---|
0x00000000 |
Called by NPA_Parse_Options. |
0x00000001 |
Called by NPA_Register_Options. |
The following table lists return values and descriptions.
HAM_Check_Option is registered with NWPA during NPA_Register_HAM_Module, and it is called by NWPA during two different phases of HAM initialization.
HAM_Check_Option is called by NPA_Parse_Options during the command line parsing phase and again by NPA_Register_Options during the options registration phase. NPA_Parse_Options iteratively calls HAM_Check_Option for each option found in the HAM's select-list.
HAM_Check_Option is responsible for accepting or rejecting the selected option. This function can logically check the compatibility of the option combination for each iteration. If the option is accepted, NWPA places the option into a use-list. The HAM should not try to communicate with any resources under this context because it does not physically own them at this time.
NPA_Register_Options iteratively calls HAM_Check_Option for each option found in the HAM's use list. HAM_Check_Option again is responsible for accepting or rejecting the selected option. This time, however, the HAM can attempt to communicate with resources to validate them because NWPA physically registers them for the HAM. If the HAM determines that an error occurred in registering its options, it needs to deregister these options using NPA_Unregister_Options, passing instance as an input parameter. Also, if a HAM is to support hot replacement, this function should be designed to accept configuration data from the module being replaced. NWPA stops requests on the elevator of the active HAM while the two modules swap data. To properly support data swapping, the HAMs should pass data indexes rather than data pointers.