home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / syncdtct.h < prev    next >
Text File  |  1998-04-25  |  7KB  |  106 lines

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