home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v5.zip / DDKX86 / SRC / DEV / DASD / OS2DASD / DMFAULT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-14  |  7.2 KB  |  199 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 = "src/dev/dasd/os2dasd/dmfault.h, dsdm, ddk_subset, b_bdd.032 93/03/19";*/
  13. /**************************************************************************
  14.  *
  15.  * SOURCE FILE NAME = DMFAULT.H
  16.  *
  17.  * DESCRIPTIVE NAME = OS2DASD.DMD - OS/2 DASD Device Manager
  18.  *
  19.  *
  20.  *
  21.  *
  22.  * VERSION = V2.0
  23.  *
  24.  * DATE
  25.  *
  26.  * DESCRIPTION : Typedefs/Defines for drive mirroring support for
  27.  *               use with Fault Tolerant LAN Subsystem.
  28.  *
  29.  *
  30. */
  31.  
  32. /*-------------------------------------------------------*/
  33. /*   Header file for fault tolerance support.            */
  34. /*-------------------------------------------------------*/
  35.  
  36. #define FT_IOCTL_Cat         0x88    /* FT IOCTL Category     */
  37. #define FT_IOCTL_Func        0x51    /* FT IOCTL Function     */
  38. #define FT_ActivePartition   0x87    /* Active FT partition   */
  39. #define FT_InactivePartition 0xC7    /* Inactive FT partition */
  40.  
  41. #define I24_MIN_RECOV_ERROR  0x1A    /* Error Codes > this are recoverable */
  42.  
  43. /*-------------------------------------------------------*/
  44. /*   Partition descriptor table header                   */
  45. /*-------------------------------------------------------*/
  46. typedef struct _PDTH {
  47.    UCHAR        NumControllers;         /* Number of controllers    */
  48.    UCHAR        NumPhysDisks;           /* Number of physical disks */
  49.    UCHAR        NumPartitions;          /* Number of partitions     */
  50.    UCHAR        NumLogUnits;            /* Number of logical units  */
  51.    UCHAR        PartNumOffset;          /* Parition Number offset   */
  52.    UCHAR        Reserved_1;             /* Reserved, MBZ            */
  53.    USHORT       Reserved_2;             /* Reserved, MBZ            */
  54.    ULONG        Reserved_3;             /* Reserved, MBZ            */
  55.    ULONG        Reserved_4;             /* Reserved, MBZ            */
  56.  
  57. } PDTH, FAR *PPDTH;
  58.  
  59.  
  60. /*-------------------------------------------------------*/
  61. /*   Partition descriptor table entries                  */
  62. /*-------------------------------------------------------*/
  63. typedef struct _PDT {
  64.  
  65.    UCHAR        Controller;             /* Number of the Controller         */
  66.    UCHAR        PhysDisk;               /* Physical disk number (0x80...)   */
  67.    UCHAR        PartitionType;          /* partition type                   */
  68.    UCHAR        LogUnit;                /* Logical unit number of partition */
  69.    ULONG        StartSec;               /* Starting Sector Number           */
  70.    ULONG        EndSec;                 /* Ending sector number             */
  71.    ULONG        Reserved;               /* Reserved                         */
  72.  
  73. } PDT, FAR *PPDT;
  74.  
  75. /*-------------------------------------------------------*/
  76. /*   FT_IOCTL parameter packet filled in by DISKFT.SYS   */
  77. /*-------------------------------------------------------*/
  78. typedef struct _FT_IOCTL_param {
  79.  
  80.   USHORT        FT_Version;
  81.   USHORT        FT_SigFT;
  82.   UCHAR         Command;
  83.   UCHAR         PartNumOffset;
  84.   USHORT        FT_ProtDS;
  85.   PVOID         (FAR *FT_Request) ( );
  86.   PVOID         (FAR *FT_Done) ( );
  87.   PPDT          pPDT;
  88.  
  89. } FT_IOCTL_param, FAR *PFT_IOCTL_param;
  90.  
  91. #define FT_VERSION      0x0002          /* FT Version Number     */
  92. #define FT_SIG          0xf589          /* FT Signature Number   */
  93.  
  94. /* Command codes */
  95. #define FT_IDENTIFY     0x00            /* validate enable struc */
  96. #define FT_ENABLE       0x01            /* enable FT processing  */
  97. #define FT_DISABLE      0x02            /* disable FT processing */
  98.  
  99. /*-------------------------------------------------------*/
  100. /*   FT_IOCTL Data packet filled in by DASD Manager      */
  101. /*-------------------------------------------------------*/
  102. typedef struct _FT_IOCTL_data {
  103.  
  104.    USHORT       SupportCode;            /* Support level    */
  105.    USHORT       FT_SigDD;               /* return signature */
  106.  
  107. } FT_IOCTL_data, FAR *PFT_IOCTL_data;
  108.  
  109. #define FT_SUPPORTED            0x0000    /* FT interface fully supported */
  110. #define FT_VERSION_INCOMPAT     0x0001    /* FT version incompatibility   */
  111. #define FT_NOT_SUPPORTED        0x0002    /* FT not supported             */
  112. #define FT_INVALID_SIGNATURE    0x0003    /* invalid signature            */
  113. #define FT_NO_FT_PARTITIONS     0x8000    /* no FT partitions detected    */
  114.  
  115. #define FT_SIG_DD               0xf58a    /* return signature value       */
  116.  
  117.  
  118.  
  119. /*-------------------------------------------------------*/
  120. /*   FT_REQUEST return data                              */
  121. /*-------------------------------------------------------*/
  122. typedef struct _FT_RESULTS {
  123.  
  124.    USHORT       Reserved;
  125.    USHORT       RequestHandle;
  126.    PBYTE        pShadowReq;
  127.    UCHAR        SecPartNum;
  128.  
  129. } FT_RESULTS;
  130.  
  131. #define ACT_PRIMARY          0x00    /* Access primary drive only     */
  132. #define ACT_PRIMARY_FIRST    0x01    /* Access primary drive first    */
  133. #define ACT_SECONDARY        0x02    /* Access secondary drive only   */
  134. #define ACT_SECONDARY_FIRST  0x03    /* Access secondary drive first  */
  135. #define ACT_BOTH             0x05    /* Acess both drives             */
  136. #define ACT_EITHER           0x06    /* Use either drive for access   */
  137.  
  138.  
  139. /*-------------------------------------------------------*/
  140. /*   FT_DONE return codes                                */
  141. /*-------------------------------------------------------*/
  142. #define FT_DONE             0x00    /* Done */
  143. #define FT_NOTDONE          0x01    /* Try again later, not finished */
  144. #define I24_MIN_RECOV_ERROR 0x1A    /* Minimum recoverable error     */
  145.  
  146.  
  147. /* Data areas used in Request Packet and Request List Entries for  */
  148. /* tracking fault tolerant requests                                */
  149.  
  150. typedef struct _FTORIG {
  151.  
  152.    USHORT       RequestHandle;
  153.    USHORT       Reserved;
  154. } FTORIG;
  155.  
  156.  
  157. typedef struct _FTDB {
  158.  
  159.    UCHAR        FT_Flags;
  160.    UCHAR        AltLogDriveNum;
  161.    union
  162.    {
  163.       FTORIG   OrigRequest;
  164.       PBYTE    pOrigRequest;
  165.    };
  166.  
  167. } FTDB, FAR *PFTDB;
  168.  
  169. /* FT_Flags defines */
  170.  
  171. #define FTF_FT_REQUEST       0x01
  172. #define FTF_ACT_BOTH         0x02
  173. #define FTF_SHADOW_REQUEST   0x04
  174.  
  175.  
  176. #define MAXRPSIZE 32
  177.  
  178. typedef struct _RPFT {
  179.  
  180.    UCHAR        Dummy[MAXRPSIZE-6];
  181.    FTDB         ftdb;
  182.  
  183. } RPFT, FAR *PRPFT;
  184.  
  185.  
  186. typedef struct _RHFT {
  187.  
  188.    UCHAR        Dummy[sizeof(Req_Header)-8];
  189.    FTDB         ftdb;
  190.    UCHAR        Block_Dev_Unit;
  191.    UCHAR        Reserved;
  192.  
  193. } RHFT, FAR *PRHFT;
  194.  
  195.  
  196.  
  197.  
  198.  
  199.