home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v5.zip / DDKX86 / SRC / DEV / TESTCFG / TCFGX.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  6KB  |  136 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  4. /*                                                                           */
  5. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  6. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  7. /*    drivers. You may use this code in accordance with the IBM License      */
  8. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  9. /*    Copyright statement may not be removed.                                */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12.  
  13. /*static char *SCCSID = "@(#)tcfgx.h  6.2 92/02/13";*/
  14.  
  15. /*** TCFGX.H - TCFGX Device Driver Include File
  16.  *
  17.  *
  18.  *
  19.  *
  20.  *   DESCRIPTION
  21.  *
  22.  *     TESTCFG external definitions and pragmas
  23.  *
  24.  *   MODIFICATION HISTORY
  25.  *
  26.  * 6.3  08/12/94   91719   E.Bentley IDE CDROM only accept Inquiries of
  27.                                      12 bytes.
  28.  */
  29.  
  30. /* TESTCFG function protocols */
  31.  
  32. USHORT main(PREQPACKET rp);        /* main entry point for TESTCFG       */
  33. USHORT far CFG_IOCtl(PREQPACKET rp);   /* IOCTL routines for TESTCFG     */
  34. USHORT CFG_Read_POSID(PREQPACKET rp);  /* Read POS IDs                   */
  35. USHORT CFG_Read_EISAID(PREQPACKET rp); /* Read EISA IDs                  */
  36. USHORT CFG_Read_ADPMEM(PREQPACKET rp); /* Copy Adapter ROM/RAM           */
  37. USHORT CFG_In_IO(PREQPACKET rp);       /* Input Port                     */
  38. USHORT CFG_Out_IO(PREQPACKET rp);      /* Output Port                    */
  39. USHORT CFG_Misc_Query(PREQPACKET rp);  /* Miscellaneous Query            */
  40.  
  41. USHORT far CFG_SCSI_Inquiry(PREQPACKET rp);/* SCSI Inquiry command           */
  42. unsigned near Build_UnitCBs(PINQUIRYDATAPACKET  pBuffer, UCHAR DevType);
  43. USHORT near Do_Inquiry(PUNITINFO pUnitInfo, PINQUIRYDATAPACKET  pBuffer, USHORT DevBus);
  44. USHORT near Do_AllocDeallocUnit(USHORT command_modifier,PUNITINFO  pUnitInfo);
  45. void   near BuildIORB_UnitControl (USHORT command_modifier,USHORT unit_handle);
  46.  
  47. void   CFG_INITCODE(void);             /* Dummy marker for beginning of Init  */
  48. USHORT far CFG_Init(PREQPACKET rp);    /* TESTCFG Init Routine                */
  49. void   CFG_Init_EISA(USHORT hOEM);     /* Initialize EISA ID Values           */
  50. void   CFG_Init_POS(void);             /* Initialize POS  ID Values           */
  51.  
  52. /* Assembly worker routines */
  53. void STRATEGYCFG(void);             /* name of strategy routine in TESTCFGA */
  54. UCHAR  NC InB   (USHORT Port);
  55. USHORT NC InW   (USHORT Port);
  56. ULONG  NC InDW  (USHORT Port);
  57. void   NC OutB  (USHORT Port,UCHAR Data);
  58. void   NC OutW  (USHORT Port, USHORT Data);
  59. void   NC OutDW (USHORT Port,ULONG Data);
  60. USHORT NC strlen(POINTER);
  61. USHORT NC GetDCTable(POINTER);
  62. USHORT NC ZeroCB(PBYTE ControlBlock, USHORT Length);
  63. void   NC BlockCopy(PBYTE Dest, PBYTE Orig, USHORT Length);
  64.  
  65. /*************************************************************************
  66.  *                 F U N C T I O N   P R O T O T Y P E S                 *
  67.  *************************************************************************/
  68.  
  69. /*  Special Routines
  70.  */
  71. int  NC SegLimit        (SEL, OFF far *);
  72.  
  73. /* Memory Management
  74.  */
  75. int  NC VerifyAccess    (FARPOINTER pMem, USHORT Length, FLAG AccessType);
  76.  
  77. /*  Physical/Virtual Conversion
  78.  */
  79. int  NC PhysToVirt      (PHYSADDR, USHORT, PFLAG);
  80. int  NC UnPhysToVirt    (void);
  81. int  NC VirtToPhys      (ULONG, PULONG);
  82. int  FC IsAPMPresent    (void);
  83.  
  84. /* ABIOS services
  85.  */
  86. int  NC GetLIDEntry(USHORT DevID,USHORT RelID,USHORT DevState,PUSHORT LID);
  87. int  NC FreeLIDEntry(USHORT LID);
  88. int  NC ABIOSCall(USHORT LID,POINTER RBOffset,USHORT Entry);
  89. void NC ProcBlock(ULONG EventId, ULONG WaitTime, USHORT IntWaitFlag );
  90. void NC ProcRun(ULONG EventId, PUSHORT AwakeCount);
  91.  
  92. /* Pragmas to put code in correct segments */
  93. #pragma alloc_text(STATICCODE, main)
  94. #pragma alloc_text(STATICCODE, ProcRun)
  95.  
  96. #pragma alloc_text(SWAPCODE,CFG_IOCtl)
  97. #pragma alloc_text(SWAPCODE,CFG_Read_POSID)
  98. #pragma alloc_text(SWAPCODE,CFG_Read_EISAID)
  99. #pragma alloc_text(SWAPCODE,CFG_Read_ADPMEM)
  100. #pragma alloc_text(SWAPCODE,CFG_In_IO)
  101. #pragma alloc_text(SWAPCODE,CFG_Out_IO)
  102. #pragma alloc_text(SWAPCODE,CFG_Misc_Query)
  103.  
  104. #pragma alloc_text(SWAPCODE,CFG_SCSI_Inquiry)
  105. #pragma alloc_text(SWAPCODE,Build_UnitCBs)
  106. #pragma alloc_text(SWAPCODE,Do_Inquiry)
  107. #pragma alloc_text(SWAPCODE,Do_AllocDeallocUnit)
  108. #pragma alloc_text(SWAPCODE,BuildIORB_UnitControl)
  109.  
  110. #pragma alloc_text(SWAPCODE,InB)
  111. #pragma alloc_text(SWAPCODE,InW)
  112. #pragma alloc_text(SWAPCODE,InDW)
  113. #pragma alloc_text(SWAPCODE,OutB)
  114. #pragma alloc_text(SWAPCODE,OutW)
  115. #pragma alloc_text(SWAPCODE,OutDW)
  116. #pragma alloc_text(SWAPCODE,GetDCTable)
  117. #pragma alloc_text(SWAPCODE,ZeroCB)
  118. #pragma alloc_text(SWAPCODE,BlockCopy)
  119.  
  120. #pragma alloc_text(SWAPCODE,VerifyAccess)
  121. #pragma alloc_text(SWAPCODE,IsAPMPresent)
  122. #pragma alloc_text(SWAPCODE,PhysToVirt)
  123. #pragma alloc_text(SWAPCODE,UnPhysToVirt)
  124. #pragma alloc_text(SWAPCODE,ProcBlock)
  125.  
  126. #pragma alloc_text(INITCODE, CFG_INITCODE)
  127. #pragma alloc_text(INITCODE, CFG_Init)
  128. #pragma alloc_text(INITCODE, CFG_Init_EISA)
  129. #pragma alloc_text(INITCODE, CFG_Init_POS)
  130. #pragma alloc_text(INITCODE,SegLimit)
  131. #pragma alloc_text(INITCODE,VirtToPhys)
  132. #pragma alloc_text(INITCODE,GetLIDEntry)
  133. #pragma alloc_text(INITCODE,ABIOSCall)
  134. #pragma alloc_text(INITCODE,FreeLIDEntry)
  135.  
  136.