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.

Thread Context:Non-Blocking

Syntax

     LONG CDM_Check_Option (
       struct NPAOptionStruct  *option,
       LONG                     instance,
       LONG                     flag
       );
    
    

Parameters

option
NWPA passes the value of this parameter, which is a pointer to the NPAOptionStruct associated with this instance of the CDM module.
instance
(IN) NWPA passes the value of this parameter, which is a CDM-generated number identifying a device instance. NWPA uses this number to associate different groups of options with a particular device being managed by the CDM.
flag
(IN) NWPA passes the value of this parameter, which indicates the process that called CDM_Check_Option. This parameter is defined as follows:

Value

Description

0x00000000

Called by NPA_Parse_Options.

0x00000001

Called by NPA_Register_Options.

Return Values

The following table lists return values and descriptions.

zero

Successful

nonzero

Unsuccessful

Remarks

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.