PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

Driver Description Structure

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

driverDescSignature
Signature of this DriverDescription structure; currently 'mtej' is used for all. Replace with the constant kTheDescriptionSignature
driverDescVersion
Version of this driver description structure, used to distinguish different versions of DriverDescription that have the same driverDescSignature value.
driverType
Structure that contains driver name and version.
driverOSRuntimeInfo
Structure that contains driver run-time information, which determines how a driver is handled when Mac OS finds it. This structure also provides the driver's name to Mac OS and specifies the driver's ability to support concurrent requests.
driverServices
Structure used to declare the driver's supported programming interfaces.

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
        }
    }
};

© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)