home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / syncdtct.h < prev    next >
C/C++ Source or Header  |  2000-02-01  |  7KB  |  108 lines

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