CDM_Check_Option
The CDM's entry point for accepting and verifying the command line options parsed by NPA_Parse_Options are valid for the CDM.
LONG CDM_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.
CDM_Check_Option is registered with NWPA during NPA_Register_CDM_Module, and it is called by NWPA during two different phases of CDM initialization. CDM_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.
When called under the context of NPA_Parse_Options, the CDM should only determine if the current option is acceptable. Under this context, NWPA has not physically associated the options with a device instance in its database.
When called under the context of NPA_Register_Options, NWPA has already placed the options in its database, and the CDM can set its operational states accordingly.
Since CDMs do not directly interface with the hardware, they should not attempt to register for hardware options such as interrupts, DMA channels, and ports. CDM command line options should set only software, operational modes for the CDM.
If the CDM 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.