This section provides prototypes for the entry points and routines required in a CDM by NetWare Peripheral Architecture (NWPA). A developer can use these prototypes to plumb the shell of a CDM. Detailed descriptions of the data structures and entry points can be found in Structures, and Functions.
To fit properly in the architecture, a CDM is required to provide the following:
Device control and I/O routines are mentioned here because they are crucial to the CDM architecture. However, this developer's guide does not attempt any specifications on these routines, because they are manufacturer specific. Prototypes and definitions of these routines are the responsibility of CDM developers.
Complete functional specifications of the entry points can be found in Functions, and descriptions of the CDM messages can be found in CDM Message Control Functions and CDM Message I/O Functions.
Naming each entry point is left to the CDM developer; however, each entry point must provide the functionality described in this guide.
For consistency in referring to these entry points and routines within the text and in code examples, this guide gives each a generic name with a CDM_ prefix. Whenever an entry point or function with this prefix is encountered, it indicates that the routine is CDM specific. The italic typeface indicates that the name is arbitrary.
A CDM must provide three standard NLM entry points for the OS. These entry points are made visible to the OS through a definition (.def) file that is processed by a NetWare compatible linker utility. The prototypes of these entry points, along with their generic names, are as follows:
CDM_Load is responsible for allocating any resources needed to make the CDM operational, for configuring the CDM based on the load options specified on the LOAD command line, and for registering the CDM and its I/O entry points with NWPA.
LONG CDM_Load (
LONG loadHandle,
LONG screenID,
BYTE *commandLine
);
LONG CDM_Unload_Check (LONG screenID);
void CDM_Unload (void);
A CDM must provide additional entry points for NWPA. The prototypes of these entry points, along with their generic names, are as follows:
LONG CDM_Abort_CDMMessage (LONG parameter);
As in the case of CDM_Callback, the CDM can define multiple abort routines. The term CDM_Abort_CDMMessage is used to generically refer to one or multiple CDM abort routines.
LONG CDM_Callback (
struct SuperHACBStruct *superHACB,
LONG npaCompletionCode);
This entry point is optional. The only reason a CDM would need to provide this routine is if it supports load options and intends to parse the LOAD command line for these options.
LONG CDM_Check_Option (
struct NPAOptionStruct *Option,
LONG instance
LONG flag);
LONG CDM_Execute_CDMMessage (
LONG cdmBindHandle,
struct CDMMessageStruct *Msg);
LONG CDM_Get_Attribute (
LONG cdmBindHandle,
void *infoBuffer,
LONG infoBufferLength,
LONG attributeID);
The CDM registers a get-attribute routine by calling CDI_Register_Object_Attribute. Therefore, the CDM can implement either one routine to handle all get-attribute calls, or distribute the calls through multiple routines. This developer's guide calls CDM_Get_Attribute generically to refer to either case.
During the context of this entry point the CDM must not issue any commands that change the state or mode of the device. Passive requests are those such as the SCSI MODE SENSE command.
LONG CDM_Inquiry (
LONG npaDeviceID,
LONG npaBusID,
struct DeviceInfoStruct *DeviceInfo,
LONG flags,
LONG cdmHandle);
The CDM registers a set-attribute routine with each call to CDI_Register_Object_Attribute. Therefore, the CDM can implement either one routine to handle all set-attribute calls, or distribute the calls through multiple routines. This developer's guide uses CDM_Set_Attribute generically to refer to either case.
LONG CDM_Set_Attribute (
LONG cdmBindHandle,
void *infoBuffer,
LONG infoBufferLength,
LONG attributeID);
A CDM must provide routines that translate CDM messages containing NWPA functions into HACB requests. Some of these NWPA functions deal with device control, and some deal with I/O. Control functions typically modify the state of devices or media objects such as activating a device or formatting media. I/O functions typically handle the movement of data to and from media such as reads and writes. The appropriate CDM routine to field an incoming CDM message gets called through the routing mechanism the CDM implements in CDM_Execute_CDMMessage.