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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       PCCardAdapterPlugin.h
  3.  
  4.      Contains:   PC Card Socket Service Plug-In Programming Interface
  5.  
  6.      Version:    Technology: System 7.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1996-2001 by Apple Computer, Inc. and SystemSoft Corporation. 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 __PCCARDADAPTERPLUGIN__
  18. #define __PCCARDADAPTERPLUGIN__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __NAMEREGISTRY__
  23. #include "NameRegistry.h"
  24. #endif
  25. #ifndef __INTERRUPTS__
  26. #include "Interrupts.h"
  27. #endif
  28. #ifndef __PCCARD__
  29. #include "PCCard.h"
  30. #endif
  31. #if PRAGMA_ONCE
  32. #pragma once
  33. #endif
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. #if PRAGMA_IMPORT
  38. #pragma import on
  39. #endif
  40. #if PRAGMA_STRUCT_ALIGN
  41.     #pragma options align=power
  42. #elif PRAGMA_STRUCT_PACKPUSH
  43.     #pragma pack(push, 2)
  44. #elif PRAGMA_STRUCT_PACK
  45.     #pragma pack(2)
  46. #endif
  47. /*------------------------------------------------------------------------------------
  48.   Types
  49. ------------------------------------------------------------------------------------*/
  50. /*  Interrupt Status Change bits*/
  51. enum {
  52.     kSCBatteryDead              = 0x01,                         /* Battery Dead Status Change*/
  53.     kSCBatteryLow               = 0x02,                         /* Battery Warning Status Change*/
  54.     kSCReady                    = 0x04,                         /* Ready Status Change*/
  55.     kSCCardDetect               = 0x08,                         /* Card Detect Status Change*/
  56.     kSCCardEjected              = 0x10,                         /* Card Ejected*/
  57.     kSCStatusChange             = 0x20,                         /* PC Card Status Change Signal Asserted*/
  58.     kSCRingIndicate             = 0x40                          /* PC Card Ring Indicate Signal Asserted*/
  59. };
  60. /*  IRQ bits */
  61. enum {
  62.     kIRQLevelMask               = 0x1F,
  63.     kIRQInvalid                 = 0x20,
  64.     kIRQHigh                    = 0x40,
  65.     kIRQEnable                  = 0x80
  66. };
  67. /*  bits for adapter characteristics flags*/
  68. enum {
  69.     SS_ADPT_FLG_IND             = 0x01,                         /* indicators for write-protect, card lock,*/
  70.                                                                 /* battery status, busy status, and XIP*/
  71.                                                                 /* are shared for all sockets*/
  72.     SS_ADPT_FLG_PWR             = 0x02,                         /* if set indicates that the sockets*/
  73.                                                                 /* share the same power control*/
  74.     SS_ADPT_FLG_DBW             = 0x04,                         /* all windows on the adapter must use*/
  75.                                                                 /* the same Data Bus Width*/
  76.     SS_ADPT_FLG_CARDBUS         = 0x08,                         /* all sockets are CardBus PC Card capable*/
  77.     SS_ADPT_FLG_DMA             = 0x10,                         /* the adapter has DMA capability*/
  78.                                                                 /*    bits for adapter power characteristics*/
  79.     SS_ADPT_FLG_V33             = 0x20,                         /* adapter supports 3.3 volt power to socket*/
  80.     SS_ADPT_FLG_V50             = 0x40,                         /* adapter supports 5.0 volt power to socket*/
  81.     SS_ADPT_FLG_V12             = 0x80                          /* adapter supports 12.0 volt power to socket*/
  82. };
  83. /*------------------------------------------------------------------------------------
  84.   Calls exported by the Family
  85. ------------------------------------------------------------------------------------*/
  86. #if CALL_NOT_IN_CARBON
  87. EXTERN_API_C( OSStatus )
  88. CSReportStatusChange            (const RegEntryID *     adapterRef,
  89.                                  PCCardSocket           whichSocket,
  90.                                  PCCardSCEvents         statusChange,
  91.                                  PCCardSocketStatus     socketStatus);
  92. /*------------------------------------------------------------------------------------
  93.   Plugin Dispatch Table
  94. ------------------------------------------------------------------------------------*/
  95. #endif  /* CALL_NOT_IN_CARBON */
  96. typedef CALLBACK_API_C( OSStatus , SSValidateHardwareProc )(const RegEntryID *deviceID);
  97. typedef CALLBACK_API_C( OSStatus , SSInitializeProc )(const RegEntryID *deviceID, Boolean replacingOldDriver);
  98. typedef CALLBACK_API_C( OSStatus , SSSuspendProc )(const RegEntryID *deviceID);
  99. typedef CALLBACK_API_C( OSStatus , SSResumeProc )(const RegEntryID *deviceID);
  100. typedef CALLBACK_API_C( OSStatus , SSFinalizeProc )(const RegEntryID *deviceID, Boolean beingReplaced);
  101. typedef CALLBACK_API_C( OSStatus , SSInquireAdapterProc )(ItemCount *numberOfSockets, ItemCount *numberOfWindows, ItemCount *numberOfBridgeWindow, PCCardAdapterCapabilities *capabilities);
  102. typedef CALLBACK_API_C( OSStatus , SSInquireSocketProc )(PCCardSocket socket, ItemCount *numberOfWindows, PCCardSocketStatus *supportedSocketStatus, PCCardSCEvents *supportedStatusChange);
  103. typedef CALLBACK_API_C( OSStatus , SSGetSocketProc )(PCCardSocket socket, PCCardVoltage *Vcc, PCCardVoltage *Vpp, PCCardVoltage *Vs, PCCardInterfaceType *socketIF, PCCardCustomInterfaceID *customIFID, PCCardSocketStatus *socketStatus, PCCardSCEvents *SCEventsMask, PCCardIRQ *IRQ, PCCardDMA *DMA);
  104. typedef CALLBACK_API_C( OSStatus , SSSetSocketProc )(PCCardSocket socket, PCCardVoltage Vcc, PCCardVoltage Vpp, PCCardInterfaceType socketIF, PCCardCustomInterfaceID customIFID, PCCardSocketStatus statusReset, PCCardSCEvents SCEventsMask, PCCardIRQ IRQ, PCCardDMA DMA);
  105. typedef CALLBACK_API_C( OSStatus , SSResetSocketProc )(PCCardSocket socket);
  106. typedef CALLBACK_API_C( OSStatus , SSGetStatusProc )(PCCardSocket socket, PCCardSocketStatus *currentStatus, PCCardSocketStatus *changedStatus);
  107. typedef CALLBACK_API_C( OSStatus , SSInquireWindowProc )(PCCardSocket *socket, PCCardWindow window, PCCardWindowState *windowState, PCCardWindowSize *windowSize, PCCardWindowAlign *windowAlign);
  108. typedef CALLBACK_API_C( OSStatus , SSGetWindowProc )(PCCardSocket *socket, PCCardWindow window, PCCardWindowState *windowState, PhysicalAddress *startAddress, PCCardWindowSize *windowSize, PCCardWindowOffset *windowOffset, PCCardAccessSpeed *memSpeed);
  109. typedef CALLBACK_API_C( OSStatus , SSSetWindowProc )(PCCardSocket socket, PCCardWindow window, PCCardWindowState windowState, PhysicalAddress startAddress, PCCardWindowSize windowSize, PCCardWindowOffset windowOffset, PCCardAccessSpeed memSpeed);
  110. typedef CALLBACK_API_C( OSStatus , SSGetWindowOffsetProc )(PCCardSocket *socket, PCCardWindow window, PCCardWindowState *windowState, PCCardWindowOffset *windowOffset);
  111. typedef CALLBACK_API_C( OSStatus , SSSetWindowOffsetProc )(PCCardSocket socket, PCCardWindow window, PCCardWindowState windowState, PCCardWindowOffset windowOffset);
  112. typedef CALLBACK_API_C( OSStatus , SSInquireBridgeWindowProc )(PCCardSocket *socket, PCCardWindow window, PCCardWindowState *windowState, PCCardWindowSize *windowSize, PCCardWindowAlign *windowAlign);
  113. typedef CALLBACK_API_C( OSStatus , SSGetBridgeWindowProc )(PCCardSocket *socket, PCCardWindow window, PCCardWindowState *windowState, PhysicalAddress *startAddress, PCCardWindowSize *windowSize);
  114. typedef CALLBACK_API_C( OSStatus , SSSetBridgeWindowProc )(PCCardSocket socket, PCCardWindow window, PCCardWindowState windowState, PhysicalAddress startAddress, PCCardWindowSize windowSize);
  115. typedef CALLBACK_API_C( OSStatus , SSGetInterruptSetMemberProc )(PCCardSocket socket, InterruptSetMember *interruptSetMember);
  116. typedef CALLBACK_API_C( OSStatus , SSEjectCardProc )(PCCardSocket socket);
  117. enum {
  118.     kServiceTypePCCardAdapter   = FOUR_CHAR_CODE('sock'),
  119.     kPCCardAdapterPluginVersion = 0x00000001,
  120.     kPCCardAdapterPluginCurrentVersion = kPCCardAdapterPluginVersion
  121. };
  122. struct PCCardAdapterPluginHeader {
  123.     UInt32                          version;
  124.     UInt32                          reserved1;
  125.     UInt32                          reserved2;
  126.     UInt32                          reserved3;
  127. };
  128. typedef struct PCCardAdapterPluginHeader PCCardAdapterPluginHeader;
  129. struct PCCardAdapterPluginDispatchTable {
  130.     PCCardAdapterPluginHeader       header;
  131.     SSValidateHardwareProc          validateHardware;
  132.     SSInitializeProc                initialize;
  133.     SSSuspendProc                   suspend;
  134.     SSResumeProc                    resume;
  135.     SSFinalizeProc                  finalize;
  136.     SSInquireAdapterProc            inquireAdapter;
  137.     SSInquireSocketProc             inquireSocket;
  138.     SSGetSocketProc                 getSocket;
  139.     SSSetSocketProc                 setSocket;
  140.     SSResetSocketProc               resetSocket;
  141.     SSGetStatusProc                 getStatus;
  142.     SSInquireWindowProc             inquireWindow;
  143.     SSGetWindowProc                 getWindow;
  144.     SSSetWindowProc                 setWindow;
  145.     SSGetWindowOffsetProc           getWindowOffset;
  146.     SSSetWindowOffsetProc           setWindowOffset;
  147.     SSInquireBridgeWindowProc       inquireBridgeWindow;
  148.     SSGetBridgeWindowProc           getBridgeWindow;
  149.     SSSetBridgeWindowProc           setBridgeWindow;
  150.     SSGetInterruptSetMemberProc     getInterruptSetMember;
  151.     SSEjectCardProc                 ejectCard;
  152. };
  153. typedef struct PCCardAdapterPluginDispatchTable PCCardAdapterPluginDispatchTable;
  154. typedef PCCardAdapterPluginDispatchTable * PCCardAdapterPluginDispatchTablePtr;
  155. #if PRAGMA_STRUCT_ALIGN
  156.     #pragma options align=reset
  157. #elif PRAGMA_STRUCT_PACKPUSH
  158.     #pragma pack(pop)
  159. #elif PRAGMA_STRUCT_PACK
  160.     #pragma pack()
  161. #endif
  162. #ifdef PRAGMA_IMPORT_OFF
  163. #pragma import off
  164. #elif PRAGMA_IMPORT
  165. #pragma import reset
  166. #endif
  167. #ifdef __cplusplus
  168. }
  169. #endif
  170. #endif /* __PCCARDADAPTERPLUGIN__ */