DriverFamilyMatching.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:8k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       DriverFamilyMatching.h
  3.  
  4.      Contains:   Interfaces for create native drivers NDRV
  5.  
  6.      Version:    Technology: 
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1995-2001 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __DRIVERFAMILYMATCHING__
  18. #define __DRIVERFAMILYMATCHING__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __NAMEREGISTRY__
  23. #include "NameRegistry.h"
  24. #endif
  25. #ifndef __CODEFRAGMENTS__
  26. #include "CodeFragments.h"
  27. #endif
  28. #if PRAGMA_ONCE
  29. #pragma once
  30. #endif
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. #if PRAGMA_IMPORT
  35. #pragma import on
  36. #endif
  37. #if PRAGMA_STRUCT_ALIGN
  38.     #pragma options align=mac68k
  39. #elif PRAGMA_STRUCT_PACKPUSH
  40.     #pragma pack(push, 2)
  41. #elif PRAGMA_STRUCT_PACK
  42.     #pragma pack(2)
  43. #endif
  44. /*
  45.   ##############################################
  46.    Well known properties in the Name Registry
  47.   ##############################################
  48. */
  49. #define kPropertyName                  "name"
  50. #define kPropertyCompatible              "compatible"
  51. #define    kPropertyDriverPtr              "driver-ptr"
  52. #define kPropertyDriverDesc                "driver-description"
  53. #define kPropertyReg                   "reg"
  54. #define kPropertyAAPLAddress          "AAPL,address"
  55. #define kPropertyMatching                "matching"
  56. #define kPropertyAAPLDriverName          "AAPL,driver-name"
  57. /* CPassThru */
  58. /*
  59.   #########################################################
  60.    Descriptor for Drivers and NDRVs
  61.   #########################################################
  62. */
  63. /* 
  64.     QuickTime 3.0: "DriverType" has a name collision with cross-platform code.
  65.     Use Mac prefix to avoid collision 
  66. */
  67. /* Driver Typing Information Used to Match Drivers With Devices */
  68. struct MacDriverType {
  69.     Str31                           nameInfoStr;                /* Driver Name/Info String*/
  70.     NumVersion                      version;                    /* Driver Version Number*/
  71. };
  72. typedef struct MacDriverType            MacDriverType;
  73. #if TARGET_OS_MAC
  74. typedef MacDriverType                   DriverType;
  75. #endif  /* TARGET_OS_MAC */
  76. typedef MacDriverType *                 DriverTypePtr;
  77. /* OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment */
  78. typedef OptionBits                      RuntimeOptions;
  79. enum {
  80.     kDriverIsLoadedUponDiscovery = 0x00000001,                  /* auto-load driver when discovered*/
  81.     kDriverIsOpenedUponLoad     = 0x00000002,                   /* auto-open driver when loaded*/
  82.     kDriverIsUnderExpertControl = 0x00000004,                   /* I/O expert handles loads/opens*/
  83.     kDriverIsConcurrent         = 0x00000008,                   /* supports concurrent requests*/
  84.     kDriverQueuesIOPB           = 0x00000010,                   /* device manager doesn't queue IOPB*/
  85.     kDriverIsLoadedAtBoot       = 0x00000020,                   /* Driver is loaded at the boot time */
  86.     kDriverIsForVirtualDevice   = 0x00000040,                   /* Driver is for a virtual Device */
  87.     kDriverSupportDMSuspendAndResume = 0x00000080               /* Driver supports Device Manager Suspend and Resume command */
  88. };
  89. struct DriverOSRuntime {
  90.     RuntimeOptions                  driverRuntime;              /* Options for OS Runtime*/
  91.     Str31                           driverName;                 /* Driver's name to the OS*/
  92.     UInt32                          driverDescReserved[8];      /* Reserved area*/
  93. };
  94. typedef struct DriverOSRuntime          DriverOSRuntime;
  95. typedef DriverOSRuntime *               DriverOSRuntimePtr;
  96. /* OS Service Information Used To Declare What APIs a Driver Supports */
  97. typedef UInt32                          ServiceCount;
  98. struct DriverServiceInfo {
  99.     OSType                          serviceCategory;            /* Service Category Name*/
  100.     OSType                          serviceType;                /* Type within Category*/
  101.     NumVersion                      serviceVersion;             /* Version of service*/
  102. };
  103. typedef struct DriverServiceInfo        DriverServiceInfo;
  104. typedef DriverServiceInfo *             DriverServiceInfoPtr;
  105. struct DriverOSService {
  106.     ServiceCount                    nServices;                  /* Number of Services Supported*/
  107.     DriverServiceInfo               service[1];                 /* The List of Services (at least one)*/
  108. };
  109. typedef struct DriverOSService          DriverOSService;
  110. typedef DriverOSService *               DriverOSServicePtr;
  111. /* Categories */
  112. enum {
  113.     kServiceCategoryDisplay     = FOUR_CHAR_CODE('disp'),       /* Display Manager*/
  114.     kServiceCategoryOpenTransport = FOUR_CHAR_CODE('otan'),     /* Open Transport*/
  115.     kServiceCategoryBlockStorage = FOUR_CHAR_CODE('blok'),      /* Block Storage*/
  116.     kServiceCategoryNdrvDriver  = FOUR_CHAR_CODE('ndrv'),       /* Generic Native Driver*/
  117.     kServiceCategoryScsiSIM     = FOUR_CHAR_CODE('scsi'),       /* SCSI */
  118.     kServiceCategoryFileManager = FOUR_CHAR_CODE('file'),       /* File Manager */
  119.     kServiceCategoryIDE         = FOUR_CHAR_CODE('ide-'),       /* ide */
  120.     kServiceCategoryADB         = FOUR_CHAR_CODE('adb-'),       /* adb */
  121.     kServiceCategoryPCI         = FOUR_CHAR_CODE('pci-'),       /* pci bus */
  122.                                                                 /* Nu Bus */
  123.     kServiceCategoryDFM         = FOUR_CHAR_CODE('dfm-'),       /* DFM */
  124.     kServiceCategoryMotherBoard = FOUR_CHAR_CODE('mrbd'),       /* mother Board */
  125.     kServiceCategoryKeyboard    = FOUR_CHAR_CODE('kybd'),       /* Keyboard */
  126.     kServiceCategoryPointing    = FOUR_CHAR_CODE('poit'),       /* Pointing */
  127.     kServiceCategoryRTC         = FOUR_CHAR_CODE('rtc-'),       /* RTC */
  128.     kServiceCategoryNVRAM       = FOUR_CHAR_CODE('nram'),       /* NVRAM */
  129.     kServiceCategorySound       = FOUR_CHAR_CODE('sond'),       /* Sound (1/3/96 MCS) */
  130.     kServiceCategoryPowerMgt    = FOUR_CHAR_CODE('pgmt'),       /* Power Management */
  131.     kServiceCategoryGeneric     = FOUR_CHAR_CODE('genr')        /* Generic Service Category to receive general Events */
  132. };
  133. /* Ndrv ServiceCategory Types */
  134. enum {
  135.     kNdrvTypeIsGeneric          = FOUR_CHAR_CODE('genr'),       /* generic*/
  136.     kNdrvTypeIsVideo            = FOUR_CHAR_CODE('vido'),       /* video*/
  137.     kNdrvTypeIsBlockStorage     = FOUR_CHAR_CODE('blok'),       /* block storage*/
  138.     kNdrvTypeIsNetworking       = FOUR_CHAR_CODE('netw'),       /* networking*/
  139.     kNdrvTypeIsSerial           = FOUR_CHAR_CODE('serl'),       /* serial*/
  140.     kNdrvTypeIsParallel         = FOUR_CHAR_CODE('parl'),       /* parallel */
  141.     kNdrvTypeIsSound            = FOUR_CHAR_CODE('sond'),       /* sound*/
  142.     kNdrvTypeIsBusBridge        = FOUR_CHAR_CODE('brdg'),
  143.     kNdrvTypeIsFWConference     = FOUR_CHAR_CODE('crsh'),       /* FireWire conference camera */
  144.     kNdrvTypeIsAVC              = FOUR_CHAR_CODE('avc ')        /* FireWire AVC devices (DV cameras) */
  145. };
  146. typedef UInt32                          DriverDescVersion;
  147. /*  The Driver Description */
  148. enum {
  149.     kTheDescriptionSignature    = FOUR_CHAR_CODE('mtej'),
  150.     kDriverDescriptionSignature = FOUR_CHAR_CODE('pdes')
  151. };
  152. enum {
  153.     kInitialDriverDescriptor    = 0,
  154.     kVersionOneDriverDescriptor = 1
  155. };
  156. struct DriverDescription {
  157.     OSType                          driverDescSignature;        /* Signature field of this structure*/
  158.     DriverDescVersion               driverDescVersion;          /* Version of this data structure*/
  159.     MacDriverType                   driverType;                 /* Type of Driver*/
  160.     DriverOSRuntime                 driverOSRuntimeInfo;        /* OS Runtime Requirements of Driver*/
  161.     DriverOSService                 driverServices;             /* Apple Service API Membership*/
  162. };
  163. typedef struct DriverDescription        DriverDescription;
  164. typedef DriverDescription *             DriverDescriptionPtr;
  165. #if PRAGMA_STRUCT_ALIGN
  166.     #pragma options align=reset
  167. #elif PRAGMA_STRUCT_PACKPUSH
  168.     #pragma pack(pop)
  169. #elif PRAGMA_STRUCT_PACK
  170.     #pragma pack()
  171. #endif
  172. #ifdef PRAGMA_IMPORT_OFF
  173. #pragma import off
  174. #elif PRAGMA_IMPORT
  175. #pragma import reset
  176. #endif
  177. #ifdef __cplusplus
  178. }
  179. #endif
  180. #endif /* __DRIVERFAMILYMATCHING__ */