The structure DriverDescription is used to match drivers with devices, set up and maintain a driver's run-time environment, and declare a driver's supported services.
struct DriverDescription {
OSType driverDescSignature;
DriverDescVersion driverDescVersion;
DriverType driverType;
DriverOSRuntime driverOSRuntimeInfo;
DriverOSService driverServices;
};
typedef struct DriverDescription DriverDescription;
typedef struct DriverDescription *DriverDescriptionPtr;
enum {
kTheDescriptionSignature = 'mtej' /* first long word of */
/* DriverDescription */
};
typedef UInt32 DriverDescVersion;
enum {
kInitialDriverDescriptor = 0 /* first version of */
/* DriverDescription */
};
Field descriptions
The driverType, driverOSRuntimeInfo, and driverServices structures are described in the next sections. A typical driver description is shown in Listing 8-1.
Listing 8-1 Typical driver description
DriverDescription TheDriverDescription =
{
// signature info
kTheDescriptionSignature, // signature always first
kInitialDriverDescriptor, // version second
// type info
{
"\pAAPL,Viper", // device's name (must match
// name in Name Registry)
0x1,0x0,0x40,0x2, // Rev 1.0.0a2
},
// OS run-time requirements
{
kDriverIsUnderExpertControl // run-time options
| kDriverIsOpenedUponLoad,
"\p.Display_Video_Apple_Viper",
},
// OS run-time info
{
1, // number of service categories
{
kServiceCategoryNdrvDriver, // supports 'ndrv' category
kNdrvTypeIsVideo, // video type
// Version of service
1, 0, 0, 0 // major, minor, stage, rev
}
}
};