home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / VDSKPDD.H < prev    next >
Text File  |  1995-04-14  |  8KB  |  198 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT (C) Microsoft Corporation, 1989                                 */
  4. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  5. /*                                                                           */
  6. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  7. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  8. /*    drivers. You may use this code in accordance with the IBM License      */
  9. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  10. /*    Copyright statement may not be removed.                                */
  11. /*                                                                           */
  12. /*****************************************************************************/
  13. /*static char *SCCSID = "@(#)vdskpdd.h    6.3 91/03/18";*/
  14. /***    vdskpdd.h
  15.  *
  16.  *      SCCSID = @(#)vdskpdd.h    6.3 91/03/18
  17.  *
  18.  *      Disk PDD/VDD shared structures/constants
  19.  *
  20.  *      MODIFICATION HISTORY
  21.  *          05/05/88 MTS        Created.
  22.  *  @715516 02/25/91 GAG        Reintegrate PTR 789010 under PTR 715516 fix
  23.  *                              Queryhddriveparms and Queryhddasdtype.
  24.  */
  25.  
  26. // Disk PDD component definitions
  27.  
  28. #define DSK_NAME                "DSK$"
  29.  
  30.  
  31. /***    PDD function commands
  32.  *
  33.  *  Format:
  34.  *      (*fpfnPDSKVDDProc)(PDSKCMD_*, ul1, ul2);
  35.  *
  36.  *  PDSKCMD_REGISTER:
  37.  *      ENTRY
  38.  *          ul1 == segment of 16:32 VDD entry point
  39.  *          ul2 ==  offset of 16:32 VDD entry point
  40.  *      EXIT
  41.  *          returns TRUE
  42.  *
  43.  *  PDSKCMD_DEREGISTER:
  44.  *      ENTRY
  45.  *          ul1 == 0                    //not used
  46.  *          ul2 == 0                    //not used
  47.  *
  48.  *  PDSKCMD_QUERYDRVTYPE: (for removable media drive only)
  49.  *      ENTRY
  50.  *          ul1 == nDrive               //drive number (USHORT)
  51.  *          ul2 -> bDriveType           //16:16 pointer to BYTE
  52.  *      EXIT-SUCCESS
  53.  *          returns TRUE
  54.  *          usDriveType is set to the appropriate drive type
  55.  *              see DRVTYPE_* equates
  56.  *      EXIT-FAILURE
  57.  *          returns FALSE
  58.  *          usDriveType is set to DRVTYPE_NONE
  59.  *
  60.  *  PDSKCMD_QUERYCHANGE: (for removable media drive only)
  61.  *      ENTRY
  62.  *          ul1 == nDrive               //drive number (USHORT)
  63.  *          ul2 == 0                    //not used
  64.  *      EXIT-SUCCESS
  65.  *          returns TRUE (disk has changed)
  66.  *      EXIT_FAILURE
  67.  *          returns FALSE (disk has not changed)
  68.  *
  69.  *  PDSKCMD_QUERYMEDIA: (for removable media drive only)
  70.  *      ENTRY
  71.  *          ul1 == nDrive               //drive number (USHORT)
  72.  *          ul2 -> bMediaType           //16:16 pointer to BYTE
  73.  *      EXIT-SUCCESS
  74.  *          returns TRUE
  75.  *          usMediaType is set to appropriate media type
  76.  *              see MEDIATYPE_* equates
  77.  *      EXIT-FAILURE
  78.  *          returns FALSE (no media in drive etc.)
  79.  *          usMediaType is set to MEDIATYPE_NONE
  80.  *
  81.  *  PDSKCMD_DISKREQUEST:
  82.  *      ENTRY
  83.  *          ul1 -> DISKREQ packet       //16:16 pointer to disk request pkt.
  84.  *          ul2 -> REQSTATUS packet     //16:16 pointer to req. status pkt.
  85.  *      EXIT-SUCCESS
  86.  *          returns TRUE (the request is accepted)
  87.  *      EXIT-FAILURE
  88.  *          returns FALSE (the request is rejected)
  89.  *          REQSTATUS packet has the operation status
  90.  *      NOTE
  91.  *          The current supported disk requests for this function are:
  92.  *              DISKREQ_READSECTORS
  93.  *              DISKREQ_WRITESECTORS (for floppy only)
  94.  *              DISKREQ_VERIFYSECTORS
  95.  *              DISKREQ_FORMATTRACK  (for floppy only)
  96.  *          The function will return immediately whether the request is
  97.  *          accepted or not.  If the request is accepted, the status of
  98.  *          the operation will not be available until the request is
  99.  *          actually completed at which time VDSK will receive an asyn-
  100.  *          chronous notification.  If the request is rejected, the request
  101.  *          status packet will have the error status and no asynchronous
  102.  *          notification will be made.
  103.  */
  104.  
  105. #define PDSKCMD_REGISTER        PDDCMD_REGISTER      //register VDD
  106. #define PDSKCMD_DEREGISTER      (PDSKCMD_REGISTER+1) //de-register of VDD
  107. #define PDSKCMD_QUERYDRVTYPE    (PDSKCMD_REGISTER+2) //query drive type
  108. #define PDSKCMD_QUERYDRVPARMS   (PDSKCMD_REGISTER+3) //query drive parms ; pb 789010
  109. #define PDSKCMD_QUERYCHANGE     (PDSKCMD_REGISTER+4) //query disk changed
  110. #define PDSKCMD_QUERYMEDIA      (PDSKCMD_REGISTER+5) //query media type
  111. #define PDSKCMD_DISKREQUEST     (PDSKCMD_REGISTER+6) //disk request
  112.  
  113.  
  114. /***    VDD function commands
  115.  *
  116.  *  Format:
  117.  *      (*fpfnVDSKPDDProc)(VDSKCMD_*, ul1, ul2);
  118.  *
  119.  *  VDSKCMD_REQDONE:
  120.  *      ul1 == 0        //not used
  121.  *      ul2 == 0        //not used
  122.  */
  123.  
  124. #define VDSKCMD_REQDONE         0x01    //notify VDSK of disk request completion
  125.  
  126.  
  127. /***    VDSK-PDSK Communication Structures
  128.  *
  129.  *      Note that the structures are allocated as VDM fixed instance
  130.  *      data so that the packet may be accessed at interrupt time.
  131.  *      However, the user buffer (specified as a 16:16 pointer) is
  132.  *      always swappable.  In addition, the user buffer pointer is
  133.  *      specified in virtual address space.  Therefore, it is the
  134.  *      physical device driver's responsibility to translate the
  135.  *      address into physical address for DMA purpose and make sure
  136.  *      the user buffer is locked down before any DMA operation can
  137.  *      proceed.
  138.  *
  139.  *      Also note that the request status codes returned are made
  140.  *      the same as Int 13h status codes for VDSK implementation
  141.  *      efficiency, but additional status codes can also be added
  142.  *      if necessary (see INT13STATUS_* equates in vdmbios.h).
  143.  */
  144.  
  145. typedef struct diskreq_s {
  146.     BYTE        dr_bReqFunc;            //request function
  147.     BYTE        dr_bDrive;              //drive number
  148.     BYTE        dr_bHead;               //head number
  149.     WORD        dr_wCylinder;           //cylinder number
  150.     BYTE        dr_bSector;             //sector number
  151.     BYTE        dr_nSectors;            //number of sectors to process
  152.     USHORT      dr_usFormatTracks;      //number of tracks to format
  153.     USHORT      dr_usFormatSectors;     //number of sectors per track to format
  154.     F16PVOID    dr_f16pBuffer;          //16:16 pointer to buffer
  155.     F16PVOID    dr_f16pDiskParm;        //16:16 pointer to disk parameter table
  156. } DISKREQ;
  157.  
  158.  
  159. typedef struct reqstatus_s {
  160.     BYTE    rs_bReqStatus;              //disk request status of operation
  161.     BYTE    rs_nSectorsDone;            //number of sectors processed
  162. } REQSTATUS;
  163.  
  164.  
  165. /***    Drive Type Equates
  166.  *
  167.  *      Note that these equates are derived from the
  168.  *      Diskette Drive Type Byte in the CMOS RAM.
  169.  */
  170.  
  171. #define DRVTYPE_NONE    0               //no drive
  172. #define DRVTYPE_360K    1               //360K drive
  173. #define DRVTYPE_1200K   2               //1.2M high capacity drive
  174. #define DRVTYPE_720K    3               //3.5" drive (720K)
  175. #define DRVTYPE_1440K   4               //3.5" high capacity drive (1.44M)
  176.  
  177.  
  178. /***    Media Type Equates
  179.  *
  180.  *      Note that the equates must be tied with DRVTYPE_* equates
  181.  *      because VDSK component implementation assumes it so.
  182.  */
  183.  
  184. #define MEDIATYPE_NONE  DRVTYPE_NONE    //no media in drive
  185. #define MEDIATYPE_360K  DRVTYPE_360K    //360K double side double density disk
  186. #define MEDIATYPE_1200K DRVTYPE_1200K   //1.2M high capacity disk
  187. #define MEDIATYPE_720K  DRVTYPE_720K    //3.5" 720K disk
  188. #define MEDIATYPE_1440K DRVTYPE_1440K   //3.5" 1.4M disk
  189.  
  190.  
  191. /***    Disk Request Function Equates
  192.  */
  193.  
  194. #define DISKREQ_READSECTORS     0
  195. #define DISKREQ_WRITESECTORS    1
  196. #define DISKREQ_VERIFYSECTORS   2
  197. #define DISKREQ_FORMATTRACK     3
  198.