CDMMessageStruct
A data packet containing a control or I/O request from the Media Manager (CDM message).
struct CDMMessageStruct { LONG msgPutHandle; LONG function; LONG parameter0; LONG parameter1; LONG parameter2; LONG bufferLength; void *buffer; LONG cdmSpace[2]; };
For processor independence reasons, the CDM can use the GET_MSW and GET_LSW macros to extract information from this field. These macros are defined as follows:
#define GET_MSW (function) ((function >> 16) & 0xFFFF)
#define GET_LSW (function) (function & 0xFFFF)
Media Manager control and I/O requests are equated to unique hexadecimal function codes (0x0000 - 0x0047). A Media Manager application makes an I/O request by calling a Media Manager API. The application selects a desired I/O action by passing one of the Media Manager function codes as an input parameter. In turn, the Media Manager packages the request into a CDM message [see CDMMessageStruct] by placing the function code in the lower WORD of this field, and then issues the CDM message to the target CDM.
The CDM maps this code into a call to one of its locally-implemented control or I/O routines designed to build the corresponding SuperHACB request.
A list of CDM message types, their corresponding Media Manager function codes, and their corresponding request descriptions can be found in CDM Message Control Functions and CDM Message I/O Functions.
As previously mentioned, in building the CDM message, the Media Manager places control attributes associated with the request in the upper WORD of this field. Most of these attributes have meaning only to the Media Manager and OS. The attributes that do have meaning to a CDM are defined as follows:
#define SCATTER_GATHER_ON_BIT 0x0080
Indicates that the request is in NWPA's scatter/gather format. To inform the HAM, the CDM must set the Scatter_Gather_Bit in the corresponding HACB.
#define HARDWARE_VERIFY_BIT 0x0100
Tells CDMs that they must set the verify bit for all write commands.
#define CACHE_OKAY_BIT 0x8000
Indicates that controller and/or device level caching is okay. If this bit is not set, all write commands must write-through any controller/device caches.
For information about the format of a scatter/gather list, refer to Scatter/Gather List .
CDMMessageStruct is identical to the Media Manager internal message structure. The fields in CDMMessageStruct contain the pertinent information required to build a control or I/O request. A pointer to this structure is then passed to the CDM which processes the CDMMessageStruct and converts it into a HACB request that is compatible with the adapter supporting the desired device.