home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / detk45he.zip / VDSKPDD.H < prev    next >
C/C++ Source or Header  |  1999-03-15  |  7KB  |  208 lines

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