home *** CD-ROM | disk | FTP | other *** search
/ Multimedia Jumpstart / Multimedia Microsoft Jumpstart Version 1.1a (Microsoft).BIN / develpmt / drivers / mscdex / testdrv / rstruct.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-25  |  10.6 KB  |  284 lines

  1.  
  2. /*
  3. ** RSTRUCT.H
  4. ** 
  5. ** - Structure declarations for most driver calls
  6. ** 
  7. ** If a call structure is not declared here, its probably just a WORD or
  8. ** DWORD.
  9. **
  10. ** HISTORY:
  11. **      10/01/90 Final (v1.0) -by- JYG
  12. */
  13.  
  14. /*  *** Device Header ***  */
  15. /*  This is a node in the linked list of device headers for ALL CDROM
  16. **  drives that is returned with the MSCDEX Int2f AH=15h call.
  17. */
  18.  
  19. typedef struct Dev_Hdr {
  20.     struct Dev_Hdr _far *sdevnext;  // Pointer to next dev header
  21.     WORD        sdevatt;            // Attributes of the device
  22.     void        (*sdevstrat)();     // Strategy entry point
  23.     void        (*sdevint)();       // Interrupt entry point
  24.     BYTE        sdevname[8];        // Name of device
  25.     WORD        sdevrsvd;           // Reserved word
  26.     BYTE        sdevlet;            // Drive letter of first unit
  27.     BYTE        sdevunits;          // Number of units handled
  28.     BYTE        sigf[6];            // signature field
  29. } Dev_Hdr;
  30.  
  31. /*  *** Device list node identifier ***  */
  32.  
  33. typedef struct Dev_List {
  34.     BYTE       sub_unit;
  35.     Dev_Hdr _far *dev_addr;
  36. } Dev_List;
  37.  
  38. /*  *** Request header structure definition ***  */
  39. /*  A Properly formatted request header should always return with the
  40. **  the status word correctly set
  41. */
  42.  
  43. typedef struct Request_Hdr {
  44.     BYTE       len;
  45.     BYTE       unit;
  46.     BYTE       cmd;
  47.     WORD       status;
  48.     BYTE       rsvd[8];
  49. } Request_Hdr;
  50.  
  51. /*  *** INIT command request header ***  */
  52.  
  53. typedef struct Init_Hdr {
  54.     Request_Hdr rqh;
  55.     BYTE       units;
  56.     BYTE _far *endaddr;
  57.     BYTE _far *bpbarr;
  58.     BYTE       devno;
  59. } Init_Hdr;
  60.  
  61. /*  *** READ/Write LONG command request header ***  */
  62.  
  63. typedef struct ReadWriteL_Hdr {
  64.     Request_Hdr rqh;
  65.     BYTE        addrmd;             // Addressing Mode (REDBOOK|HSG)
  66.     BYTE _far   *xfer;              // Transfer Buffer Address
  67.     WORD        nsects;             // Number of sectors to read/write
  68.     DWORD       start;              // Starting address
  69.     BYTE        mode;               // Read/Write Mode (COOKED|RAW)
  70.     BYTE        ilsize;             // Interleave size
  71.     BYTE        ilskip;             // Interleave skip
  72. } ReadWriteL_Hdr;
  73.  
  74. /*  *** SEEK command request header structure *** */
  75.  
  76. typedef struct SeekReq_Hdr {
  77.     Request_Hdr rqh;
  78.     BYTE        addrmd;             // Addressing Mode (REDBOOK|HSG)
  79.     DWORD       zero;               // -
  80.     WORD        nsects;             // Number of sectors to read(?)
  81.     DWORD       start;              // Starting sector number
  82. } SeekReq_Hdr;
  83.  
  84.  
  85. /*  ***  PLAY command request header *** */
  86.  
  87. typedef struct PlayReq_Hdr {
  88.     Request_Hdr rqh;
  89.     BYTE        addrmd;             // Addressing Mode (REDBOOK|HSG)
  90.     DWORD       start;              // Starting sector number
  91.     DWORD       num;                // Number of sectors to play
  92. } PlayReq_Hdr;
  93.  
  94.  
  95. /*  *** IOCTL Command structures ***  */
  96.  
  97. /*  *** (I/O) IOCTL command request header structure definition ***  */
  98.  
  99. typedef struct Ioctl_Hdr {
  100.     Request_Hdr rqh;
  101.     BYTE        media;              // Media descriptor bytes from BPB (=0)
  102.     BYTE _far   *xfer;              // Transfer address 
  103.                                     //   (ptr to the SUBSTRUCTURE)
  104.     WORD        nbytes;             // Number of bytes to transfer 
  105.                                     //   this is: sizeof(SUBSTRUCTURE)
  106.     WORD        sector;             // Starting sector number (=0)
  107.     DWORD       valid;              // Pointer to requested vol ID if 
  108.                                     //   error 0fh (=0)
  109. } Ioctl_Hdr;
  110.  
  111. /*  *** The IOCTL Substructures - (subordinate structures) ***  */
  112. /*  *** ************************************************** ***  */
  113.  
  114. /*  *** (I) Raddr_Rec - Return address of device header ***  */
  115.  
  116. typedef struct Raddr_Rec {
  117.     BYTE        code;               // (=0)
  118.     DWORD       addr;               // Return field for device header addr
  119. } Raddr_Rec;
  120.  
  121. /*  *** (I) LocHead_Rec ***  */
  122. /*  Returns the address of the head location
  123. */
  124. typedef struct LocHead_Rec {
  125.     BYTE       code;                // (=1)
  126.     BYTE       addrmode;            // Addressing Mode (REDBOOK|HSG)
  127.     DWORD      drvhead;             // Return field for head location
  128. } LocHead_Rec;
  129.  
  130. /*  *** (I) ErrStat is unsupported ***  */
  131.  
  132. /*  *** (I/O) AudInfo_Rec ***  */
  133. /*  For Audio status and control
  134. */
  135. typedef struct AudInfo_Rec {
  136.     BYTE       code;                // ((I? =4) | (O? =3))
  137.     BYTE       in0;                 // Input Channel (0-3) for output 0
  138.     BYTE       vol0;                // Volume (0-0xff) for output 0
  139.     BYTE       in1;                 // Input Channel (0-3) for output 1
  140.     BYTE       vol1;                // Volume (0-0xff) for output 1
  141.     BYTE       in2;                 // Input Channel (0-3) for output 2
  142.     BYTE       vol2;                // Volume (0-0xff) for output 2
  143.     BYTE       in3;                 // Input Channel (0-3) for output 3
  144.     BYTE       vol3;                // Volume (0-0xff) for output 3
  145. } AudInfo_Rec;
  146.  
  147. /*  *** (I/O) DrvBytes_Rec ***  */
  148. /*  For Read Drive Bytes, hardware specific information
  149. **  The HITACHI's just return an ASCII version string.
  150. **  NOTE: This is actually NOT defined for the the IOCTLO fcn 4
  151. */
  152. typedef struct DrvBytes_Rec {
  153.     BYTE       code;                // ((I? =5) | (O? =4))
  154.     BYTE       nbytes;              // Number of bytes transfered
  155.     BYTE       buf[128];            // Buffer for received data
  156. } DrvBytes_Rec;
  157.  
  158. /*  *** (I) DevStat_Rec ***  */
  159. /*  VERY important.  For returning the current drive status and
  160. **  specific information about the drive hardware.  The returned
  161. **  DWORD should be always correct.
  162. */
  163. typedef struct DevStat_Rec {
  164.     BYTE       code;                // (=6)
  165.     DWORD      params;              // Returned device parameters
  166. } DevStat_Rec;
  167.  
  168. /*  *** (I) SectSize_Rec ***  */
  169. /*  The sector size (in bytes) for the read mode specified
  170. */
  171. typedef struct SectSize_Rec {
  172.     BYTE       code;                // (=7)
  173.     BYTE       rmode;               // Read mode (RAW|COOKED)
  174.     WORD       sectsize;            // Returned sector size value
  175. } SectSize_Rec;
  176.  
  177. /*  *** (I) VolSize_Rec ***  */
  178. /*  Return structure for the volume size (in sectors) of the current
  179. **  disc.  Equivalent to the address of the lead out track
  180. */
  181. typedef struct VolSize_Rec {
  182.     BYTE       code;                // (=8)
  183.     DWORD      volsize;             // Returned volume size
  184. } VolSize_Rec;
  185.  
  186. /*  *** (I) MedChng_Rec ***  */
  187. /*  The Media changed byte should return 1,0,or ffh.  This is a reduced
  188. **  functionality media check.
  189. */
  190. typedef struct MedChng_Rec {
  191.     BYTE       code;                // (=9)
  192.     BYTE       medbyte;             // Returned media byte
  193. } MedChng_Rec;
  194.  
  195. /*  *** (I) DiskInfo_Rec ***  */
  196. /*  Return structure for VTOC information, from the Qchannel info in the
  197. **  lead in track.
  198. **  Information is obtained from lead in track 
  199. */
  200. typedef struct DiskInfo_Rec {
  201.     BYTE       code;                // (=Ah)
  202.     BYTE       low_track;           // First track number
  203.     BYTE       hi_track;            // Last track number
  204.     DWORD      start;               // Redbook binary address of the lead out
  205.                                     //   track
  206. } DiskInfo_Rec;
  207.  
  208. /*  *** (I) TnoInfo_Rec ***  */
  209. /*  Given the track number, returns the READBOOK address for the starting
  210. **  point of the the track and control information
  211. */
  212. typedef struct TnoInfo_Rec {
  213.     BYTE       code;                // (=Bh)
  214.     BYTE       tno;                 // Track request byte
  215.     DWORD      start_tno;           // returned starting address (REDBOOK)
  216.     BYTE       tcntrl;              // returned control byte
  217. } TnoInfo_Rec;
  218.  
  219. /*  *** (I) QchanInfo_Rec ***  */
  220. /*  Returns the current Q-channel information
  221. */
  222. typedef struct QchanInfo_Rec {
  223.     BYTE       code;                // (=Ch)
  224.     BYTE       ctrl ;                // Control and ADR byte
  225.     BYTE       tno;                 // Current track number (BCD) 
  226.                                     //   (00==leadin,00-99 valid,AA==LeadOut)
  227.     BYTE       x;                   // Point (BCD) Index to TNO
  228.                                     // 00==Pause encoding
  229.                                     // 01-99 Subdivision numbers
  230.     BYTE       min;                 // (BCD) minutes running time within track
  231.     BYTE       sec;                 //       seconds
  232.     BYTE       frame;               //       frame
  233.     BYTE       zero;                // 00
  234.     BYTE       pmin;                // (BCD) minutes running time on disc
  235.     BYTE       psec;                //       seconds
  236.     BYTE       pframe;              //       frame
  237.                                     // the above running time is an entry
  238.                                     // in the TOC during the LeadIn track
  239.                                     // where the Point byte is the index
  240. } QchanInfo_Rec;
  241.  
  242. /*  *** (I) SubChanInfo_Rec ***  */
  243. /*  The R-W information during play can be transferred into a buffer
  244. **  for at least one sector.  (96bytes/sector)
  245. */
  246.  
  247. typedef struct SubChanInfo_Rec {
  248.     BYTE       code;                // (=Dh)
  249.     DWORD      start_tno;           // Starting Sector Address
  250.     BYTE _far  *xfer;               // Transfer Address
  251.     DWORD      nsect;               // Number of sectors to read
  252. } SubChanInfo_Rec;
  253.  
  254. /*  *** (I) UPCCode_Rec ***  */
  255. /*  The UPC code *if any* is returned in the seven byte upc array
  256. */
  257. typedef struct UPCCode_Rec {
  258.     BYTE       code;                // (=Eh)
  259.     BYTE       ctrl_adr;            // Control and ADR byte
  260.     BYTE       upc[7];              // UPC code  (BCD)
  261.     BYTE       zero;                // 0
  262.     BYTE       aframe;              // Continuation of FRAME in mode 1
  263. } UPCCode_Rec;
  264.  
  265. /*  *** (I) AudStat_Rec ***  */
  266. /*  The Audio Status request structure.  Holds information for paused
  267. **  status and starting/ending locations for PLAY and RESUME
  268. */
  269. typedef struct AudStat_Rec {
  270.     BYTE       code;                // (=Fh)
  271.     WORD       stat_bits;           // (bit 0 is PAUSED bit)
  272.     DWORD      start_tno;           // Starting REDBOOK addr of last play
  273.                                     //   or next resume
  274.     DWORD      end_tno;             // Ending location for the last play or
  275.                                     //   next resume
  276. } AudStat_Rec;
  277.  
  278. /*  *** Eject, CloseTray and ResetDrv only require single byte ***  */
  279.  
  280. typedef struct LockDoor_Rec { 
  281.     BYTE       code;                // (=1h)
  282.     BYTE       fcn;                 // (fcn = 0, unlocks; fcn = 1, locks))
  283. } LockDoor_Rec;
  284.