NPAOptionStruct

Contains the HAM's command line option data on a per option basis.

Used By:HAM (CDM usage is optional)

Syntax

    struct NPAOptionStruct 
    { 
       BYTE   name[32];
       LONG   parameter0;
       LONG   parameter1;
       LONG   parameter2;
       WORD   type;
       WORD   flags;
       BYTE   string[16];
    };
    

Fields

name
A 32-byte field to contain a length-preceded and null-terminated string. The HAM places the name of the desired option, as it will appear on the command line, in this field.
parameter0
A 4-byte field to contain the value associated with an option.

For the relationship between this parameter and the option type selected, see Option Types vs. Parameter Definitions.

NOTE:Return values to this parameter are valid only after NPA_Register_Options has been called.

parameter1
A 4-byte field to contain the length or range associated with this option.

Typically, this field is used in specifying memory decode ranges and port lengths. See Option Types vs. Parameter Definitions for the relationship between this parameter and the option type selected.

For the Product ID option, Option Types vs. Parameter Definitions shows the various formats for product ID values (as applicable).

NOTE:Return values to this parameter are valid only after NPA_Register_Options has been called.

parameter2
A 4-byte field that can be either an input or an output parameter.

See Option Types vs. Parameter Definitions for the relationship between this parameter and the option selected.

NOTE:Return values to this parameter are valid only after NPA_Register_Options has been called.

type
A 2-byte field to contain a code indicating the option type. See Option Types vs. Parameter Definitions for the list of possible values for this field.
flags
A 2-byte field to contain a bitmap indicating the status of the option.

The following is a list of the flags defined for this field:

Constant

Bit

Description

REQUIRED_OPTION

0x0001

If not specified on command line, then prompt the user.

USE_THIS_OPTION

0x0002

Use this option whether or not it is specified on the command line.

VALUE_REQUIRED_ OPTION

0x0004

Tells NWPA to look for a “name =” on the command line where name is the string contained in the name field and the user is expected to enter a value.

SPECIFIC_VALUE_ REQUIRED_OPTION

0x0008

Same as VALUE_REQUIRED_OPTION. However, instead of prompting the user for a value, a list of values is displayed from which to choose. To use this flag value, the developer must add a whole set of options of the same type with this flag set. From this group, NWPA will create its enumeration. Each value in the set is contained in parameter0 of one of the options added in the set.

DEFAULT_VALUE_IN_ PARAMETER0

0x0010

Contained in parameter0.

SHARABLE_OPTION

0x0020

Indicates that the driver is willing to share resource.

UNREGISTERED_ SLOT

0x0040

(Interrupt Option only) Indicates the driver functions as a HIN-aware driver, but the slot number associated with the IRQ in question must not be registered.

All other bits in this field are reserved by NetWare.

string
A 16-byte field that can be used for information to pass to and/or receive information from the command line. If flags is set to Specific Value Required, this field contains a length-preceded and NULL terminated string. The string parameter contains the ASCII code for the value (or values) specified in parameter0. In this case where a matching option was not specified on the command line, this value appears at the console as a choice for the user. After a user makes a selection, the selected value is placed back into this field.

If the flags parameter is set to Value Required, the developer can use this field to read the command line option “name=”. This field must contain n-2, where n is the maximum length of string plus the length count byte and the NULL terminator byte. In this case, when the information is returned back, the length byte will be updated to indicate the actual size of the string being returned. When flags is set to Value Required and the user was prompted to enter a value for this option, the entered ASCII string is placed in this field.

The figure below illustrates the string used for various bus types.

Figure 10-1 String fields for different bus types

LOHI byte order refers to a little-endian byte order.

  • EISA bus: Uses the 32-bit encoded EISA ID (LOHI)
  • PCMIA: Uses the 16-bit manufacturer ID (bytes 2 and 3, LOHI) and the 16-bit manufacturer information (bytes 0 and 1, LOHI)
  • PCI bus: Uses the 16-bit device ID (bytes 2 and 3, LOHI) and the 16-bit vendor ID (bytes 0 and 1, LOHI)
  • PnP ISA bus: Uses the 32-bit EISA ID (LOHI)

    The PnP ISA Specification specifies the use of the 32-bit encoded EISA product ID format for PnP ISA product IDs.

Option Types vs. Parameter Definitions

type

Option

parameter0

parameter1

parameter2

Remarks

0x0001

Interrupt Option

Contains the IRQ handle.

See HAM_ISR.

0x01 -Put at the end of ISR chain (The default is the front of the ISR chain.)

0x02- Adjust RealModeInterrupt mask. This enables real mode (DOS) Interrupts.

0x04-edge (0) or level (1) triggered Interrupts (NetWare 4 only).

To NWPA: Contains the busTag that is returned by NPAB_Search_Adapter or by parsing the Product ID option (see below).

To HAM: Used by NetWare.

String contains the ASCII code for the hexadecimal value of the lower WORD specified in parameter0.

0x0002

Port Option

Value of the port address being added.

Range in bytes.

To NWPA: Contains the busTag that is returned by NPAB_Search_Adapter or by parsing the Product ID option (see below).

String contains the ASCII code for the hexadecimal value specified in parameter0.

0x0003

DMA Option

Value of the DMA channel being added.

Not used. Set to 0.

To NWPA: Contains the busTag that is returned by NPAB_Search_Adapter or by parsing the Product ID option (see below).

String contains the ASCII code for the hexadecimal value specified in parameter0.

0x0004

Memory decode option

Contains the shared memory physical address used by the adapter for onboard memory that is mapped into NetWare's logical address table.

Contains the number of 16-byte paragraphs of system memory.

To NWPA: Contains the busTag that is returned by NPAB_Search_Adapter or by parsing the Product ID option (see below).

To HAM: Contains the shared memory logical address of the mapped memory for NPA_Register_Options only.

 

0x0005

Slot option

Value of the slot being added.

Not used. Set to 0.

To NWPA: Contains the busTag that is returned by NPAB_Search_Adapter or by parsing the Product ID option (see below).

String contains the ASCII code for the decimal representation of the hexadecimal value specified in parameter0.

0x0006

Card option

Value of the card being added.

Not used. Set to 0.

Not used. Set to 0.

String contains the ASCII code for the hexadecimal value specified in parameter0.

0x0007

Reserved by NetWare

Reserved by NetWare.

Reserved by NetWare.

Reserved by NetWare.

 

0x0008

Product ID option

To NWPA: Contains the bus type returned from NPAB_Get_Bus_Type.

To HAM: Contains the busTag.

To NWPA: Contains a pointer to an array of bytes that contain a bus architecture-dependent parameter that uniquely identifies an adapter board/peripheral/system option. See Figure 10-1.

To HAM: Contains the slot number.

To NWPA: Contains the size of the array pointed to by parameter1.

To HAM: Contains the uniqueID.

 

0x0009

to

0x01FF

Reserved by NetWare

Reserved by NetWare.

Reserved by NetWare.

Reserved by NetWare.

 

0x0200

to

0xFFFF

For vendor use as needed

For vendor use as needed.

For vendor use as needed

For vendor use as needed.

Vendors must register with Developer Services to use these options in released driver code.

Remarks

Using this structure, the HAM can select the command line options that it wants NWPA to prompt the system operator for.

The HAM must fill out one of these structures and call NPA_Add_Option for each option it supports. With each successive call to NPA_Add_Option, NWPA adds the current option to a select-list. After the HAM has added all of its command line options, it calls NPA_Parse_Options, which parses the command line to determine which options in the select-list were actually chosen. Within the context of NPA_Parse_Options, NWPA iteratively calls the HAM's HAM_Check_Option routine for each option (provided that the options are of differing types) that was actually selected from the command line. HAM_Check_Option can direct NWPA to either accept the option by returning zero or reject the option by returning non-zero. If the option is accepted, NWPA places it in a use-list. The HAM then calls NPA_Register_Options to direct NWPA to physically register the options in its use-list for the HAM.

NWPA does not place multiple options of the same type, such as multiple interrupts, in its use-list for a single parse of the command line. Therefore, if the host adapter supports multiple options of the same type and the HAM wants to add/parse/register them, then the HAM must do the following:

  1. Call NPA_Add_Option to add the first option.
  2. Call NPA_Parse_Options and have HAM_Check_Option accept the option so that it is placed in the use-list.
  3. Call NPA_Add_Option to add the next option of the same type.
  4. Call NPA_Parse_Options and have HAM_Check_Option accept this option so that it is also placed in the use-list.
  5. Repeat Steps 3 and 4 until all of the options of the same type are in the use-list.
  6. Call NPA_Register_Options to have the Media Manager physically register the options.