SyncDtct.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:6k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /*****************************************************************************/
  2. /*                                                                           */
  3. /* SYNCDTCT.H - External include file for SYNCDTCT.DLL which is used by      */
  4. /*              setup to detect sync. comms. cards.                          */
  5. /*                                                                           */
  6. /*  SEE SYNCDTCT.C FOR DETAILED SYNTAX OF THE CALLS                          */
  7. /*                                                                           */
  8. /*****************************************************************************/
  9. /*****************************************************************************/
  10. /* Returned structure containing config data on the card                     */
  11. /*                                                                           */
  12. /* NEVER CHANGE THESE STRUCTURES WITHOUT ALSO CHANGING IBMSYNC.SYS           */
  13. /*                                                                           */
  14. /* The individual SYNC_CFG structures are stored as raw data in a single     */
  15. /* registry value under SERVICESIBMSYNCPARAMETERSCardCfg.                */
  16. /*                                                                           */
  17. /* When IBMSYNC starts, it reads the raw data into memory and then uses the  */
  18. /* result as it's config array. This means the data must be in the form the  */
  19. /* driver expects.                                                           */
  20. /*                                                                           */
  21. /* Note: For MCA buses, the DMA & port info is read in a new every time the  */
  22. /*       driver runs. It is the McaSlot & McaId field which define the cards.*/
  23. /*                                                                           */
  24. /*       For ISA/EISA buses, the base port addresses define the cards, and   */
  25. /*       this infois only updated when setup is run.                         */
  26. /*                                                                           */
  27. /*****************************************************************************/
  28. typedef struct _SYNC_CARD
  29. {
  30.   ULONG        IdandUseCount;        /* LOWORD is the adapter ID             */
  31.                                      /* HIWORD is the use count              */
  32.                                      /* Done this way to preserve back       */
  33.                                      /* compatibility.                       */
  34.   UCHAR        DisplayName[50];
  35. } SYNC_CARD,* PSYNC_CARD;
  36. typedef struct _PORT_DEF
  37. {
  38.   ULONG Addr;
  39.   ULONG Len;
  40. } PORT_DEF;
  41. typedef struct _SYNC_CFG
  42. {
  43.   SYNC_CARD    Card;
  44.   UCHAR        DeviceName[25];
  45.   PORT_DEF     AdapterBase;          /* Zero for MPA/A card if sync disabled */
  46.   UCHAR        Irq;
  47. #define NO_IRQ_GENERATED 0xFF        /* Adapter failed to generate interrupt */
  48.   UCHAR        DmaChannel;
  49. #define DMA_CANT_BE_DETECTED 0xFF    /* Need to get user to select 0, 1 or 3 */
  50. #define NO_DMA               0x10    /* IBMSYNC checks for this define       */
  51.   USHORT       McaId;
  52.   UCHAR        McaSlot;
  53.   PORT_DEF     MpcaModePort;
  54.   UCHAR        MpcaModeValue;
  55. } SYNC_CFG,* PSYNC_CFG;
  56. /*****************************************************************************/
  57. /*                                                                           */
  58. /* Calls to query sync cards                                                 */
  59. /* -------------------------                                                 */
  60. /*                                                                           */
  61. /* DetectPresentCards() is used during an initial install of sync devices to */
  62. /*                      get a list of present cards.This corresponds to      */
  63. /*                      primary netcard detection.                           */
  64. /*                                                                           */
  65. /* QueryPossibleCards() are used when a users wants to add a new card. The   */
  66. /* & QueryCardConfig()  fisrt call is made to get a list of all sync cards   */
  67. /*                      and then once one has been selected, the second call */
  68. /*                      checks for the cards existence and returns the config*/
  69. /*                      to be written to the registry. These calls correspond*/
  70. /*                      to secondary net card detection.                     */
  71. /*                                                                           */
  72. /* Both sets of cards can return NO_IRQ_GENERATED in the Irq field to        */
  73. /* indicate a possible interrupt clash and DMA_CANT_BE_DETECTED in the case  */
  74. /* of MicroGate cards when the DMA channel can't be selected.  In the second */
  75. /* case setup has to prompt the user for either 0,1 or 3 before putting info */
  76. /* in the registry.                                                          */
  77. /*****************************************************************************/
  78. DWORD DetectPresentCards(SYNC_CFG  CfgArray[], int MaxNum, int * pAvailNum);
  79. DWORD QueryPossibleCards(SYNC_CARD CardArray[], int MaxNum, int * pAvailNum);
  80. DWORD QueryCardConfig(ULONG CardId, PSYNC_CFG pCfg);
  81. /*****************************************************************************/
  82. /*                                                                           */
  83. /* Calls used to store cfg                                                   */
  84. /* -----------------------                                                   */
  85. /*                                                                           */
  86. /* These calls store the card configuration information under the IBMSYNC    */
  87. /* key in a format which the device driver can understand.                   */
  88. /*                                                                           */
  89. /* WriteSyncCfg()  Saves an array of card config entries where they can be   */
  90. /*                 accessed by the card.                                     */
  91. /*                                                                           */
  92. /* ReadSyncCfg()   Returns an array containing config on all the cards       */
  93. /*                 currently configured.                                     */
  94. /*                                                                           */
  95. /*****************************************************************************/
  96. DWORD WriteSyncCfg(SYNC_CFG  CfgArray[], int NumEntries);
  97. DWORD ReadSyncCfg  (SYNC_CFG  CfgArray[], int MaxNum, int * pAvailNum);