home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v5.zip / DDKX86 / SRC / DEV / DASD / IBM / IBM2FLPY / FL2DATA.C next >
Encoding:
C/C++ Source or Header  |  1995-04-14  |  4.4 KB  |  109 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. /*static char *SCCSID = "%w% %e%";*/
  13. /**************************************************************************
  14.  *
  15.  * SOURCE FILE NAME = FL2DATA.C
  16.  *
  17.  * DESCRIPTIVE NAME = IBM2FLPY.ADD - Adapter Driver for ABIOS Diskette
  18.  *                    Static/Initialization Data Declarations
  19.  *
  20.  *
  21.  * VERSION = V2.0
  22.  *
  23.  * DATE
  24.  *
  25.  * DESCRIPTION A device driver data segment needs to be organized
  26.  *             so that the device header is the first thing in the
  27.  *             segment and data, used only at initialization time,
  28.  *             is at the very end of the segment.  To ensure that
  29.  *             initialization data is placed at the very end, all
  30.  *             global variables are defined in a single file
  31.  *             (this one) and all the global variables are initialized.
  32.  *             Initalizing the global variables forces C to allocate
  33.  *             them in the same order that they are defined.
  34.  *
  35.  *
  36. */
  37.  
  38. #define INCL_NOBASEAPI
  39. #define INCL_NOPMAPI
  40. #include <os2.h>
  41. #include <strat2.h>     /* needed to keep reqpkt.h happy */
  42. #include <reqpkt.h>
  43. #include <scb.h>        /* needed to keey abios.h happy */
  44. #include <abios.h>
  45. #include <iorb.h>
  46. #include <addcalls.h>
  47. #include "fl2def.h"
  48. #include "fl2proto.h"
  49. #include "fl2data.h"
  50.  
  51.  
  52. PFN    Device_Help = NULL;
  53.  
  54.  
  55. /* ABIOS request blocks */
  56.  
  57. BYTE   RequestBlock[GENERIC_ABRB_SIZE]   = {0};
  58. BYTE   MotorOffReqBlk[GENERIC_ABRB_SIZE] = {0};
  59. BYTE   DefaultIntHandlerRB[GENERIC_ABRB_SIZE] = {0};
  60.  
  61. PDEV_BLK pDeviceBlock = NULL;
  62.  
  63.  
  64. /* Controller specific information */
  65.  
  66. USHORT LID       = 0;    /* ABIOS Logical ID for this controller */
  67. USHORT IntLevel  = 0;    /* Interrupt Level for this controller  */
  68. USHORT UnitCnt   = 0;    /* Number of units on this controller   */
  69. UCHAR  Retry     = 0;    /* Current retry attempt                */
  70. USHORT SectorCnt = 0;    /* Current number of sectors being rwv  */
  71. USHORT Stage     = 0;    /* Specifies which ABIOS entry point    */
  72. GLBLFLGS GFlags  = {0};  /* Global Flags                         */
  73. USHORT ADDHandle = 0;    /* ADD Handle returned by RegisterADD   */
  74. ULONG  HookHandle = 0L;  /* Context hook handle                  */
  75. ULONG  LockHandle = 0L;  /* Lock handle for SwapCode segment     */
  76. PULONG pCurIntLvl = 0L;  /* Ptr to kernel interrupt level DosVar */  /*@Vxxxxx*/
  77.  
  78. PCOMPFN CompletionRoutine = NULL;
  79.  
  80. UCHAR AdapterName[] = "IBM2FLPY";
  81.  
  82. PIORBH pHeadIORB    = NULL;     /* Start of IORB linked list      */
  83. PIORB_DEVICE_CONTROL pSuspendIORB = NULL; /* Pointer to pending Suspend IORB */
  84. PIORBH pResumeIORB  = NULL;     /* Pointer to a Resume IORB being executed */
  85.  
  86. PBYTE   pDMABuffer       = NULL;  /* GDT address of DMA buffer            */
  87. ULONG   ppDMABuffer      = NULL;  /* Physical address of DMA buffer       */
  88. PBYTE   pReadBackBuffer  = NULL;  /* GDT address of read back buffer      */
  89. ULONG   ppReadBackBuffer = NULL;  /* Physical address of read back buffer */
  90. ULONG   MaxBuffSize      = 0L;    /* Maximum size needed for DMA buffer   */
  91. ULONG   BuffSize         = 0L;    /* Actual size of the DMA buffer        */
  92.  
  93. ADD_XFER_DATA XferData = {0};   /* Used by ADD_XferBuffData       */
  94.  
  95. /* Timer Variables */
  96.  
  97. USHORT MSPerTick       = 0;     /* Milliseconds per timer tick */
  98. TIMER  Timer[TIMERCNT] = {0};   /* Timer table                 */
  99.  
  100.  
  101. DRIVE  Drive[MAXUNITS] = {0};   /* Drive specific information */
  102.  
  103.  
  104. /* The following data is used only at initialzation time */
  105.  
  106. USHORT InitData   = 0;    /* Marks the start of initialization data */
  107.  
  108.  
  109.