home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / kernex32.zip / mwdd_src.zip / 32bits / ext2-os2 / include / os2 / reqpkt32.h < prev    next >
C/C++ Source or Header  |  1997-03-16  |  3KB  |  104 lines

  1. //
  2. // $Header: d:\\32bits\\ext2-os2\\include\\os2\\rcs\\reqpkt32.h,v 1.3 1997/03/15 18:10:17 Willm Exp $
  3. //
  4.  
  5. // 32 bits OS/2 device driver and IFS support. Provides 32 bits kernel 
  6. // services (DevHelp) and utility functions to 32 bits OS/2 ring 0 code 
  7. // (device drivers and installable file system drivers).
  8. // Copyright (C) 1995, 1996, 1997  Matthieu WILLM (willm@ibm.net)
  9. //
  10. // This program is free software; you can redistribute it and/or modify
  11. // it under the terms of the GNU General Public License as published by
  12. // the Free Software Foundation; either version 2 of the License, or
  13. // (at your option) any later version.
  14. //
  15. // This program is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. // GNU General Public License for more details.
  19. //
  20. // You should have received a copy of the GNU General Public License
  21. // along with this program; if not, write to the Free Software
  22. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  
  24. /* Status word in RPH */
  25.  
  26. #define STERR        0x8000           /* Bit 15 - Error                */
  27. #define STINTER      0x0400           /* Bit 10 - Interim character    */
  28. #define STBUI        0x0200           /* Bit  9 - Busy                 */
  29. #define STDON        0x0100           /* Bit  8 - Done                 */
  30. #define STECODE      0x00FF           /* Error code                    */
  31. #define WRECODE      0x0000
  32.  
  33. #define STATUS_DONE       0x0100
  34. #define STATUS_ERR_UNKCMD 0x8003
  35.  
  36. #pragma pack(1)
  37. struct reqhdr {
  38.     unsigned char  length;
  39.     unsigned char  unit;
  40.     unsigned char  command;
  41.     unsigned short status;
  42.     unsigned char  flags;
  43.     unsigned char  reserved[3];
  44.     unsigned long  link;
  45. };
  46.  
  47. struct reqpkt_ioctl {
  48.     struct reqhdr  header;
  49.     unsigned char  cat;
  50.     unsigned char  func;
  51.     PTR16          parm;
  52.     PTR16          data;
  53.     unsigned short sfn;
  54.     unsigned short parmlen;
  55.     unsigned short datalen;
  56. };
  57.  
  58. struct reqpkt_open {
  59.     struct reqhdr  header;
  60.     unsigned short sfn;
  61. };
  62.  
  63. struct reqpkt_close {
  64.     struct reqhdr  header;
  65.     unsigned short sfn;
  66. };
  67.  
  68. struct reqpkt_read {
  69.     struct reqhdr  header;
  70.     unsigned char  media_descriptor;
  71.     unsigned long  transfer_address;
  72.     unsigned short count;
  73.     unsigned long  first_sector;
  74.     unsigned short sfn;
  75. };
  76.  
  77. struct reqpkt_write {
  78.     struct reqhdr  header;
  79.     unsigned char  media_descriptor;
  80.     unsigned long  transfer_address;
  81.     unsigned short count;
  82.     unsigned long  first_sector;
  83.     unsigned short sfn;
  84. };
  85.  
  86. struct reqpkt_init {
  87.     struct reqhdr header;
  88.     unsigned char unit;
  89.     union {
  90.         struct {
  91.             PTR16         devhelp;
  92.             PTR16         initarg;
  93.             unsigned char drivenum;
  94.         } input;
  95.         struct {
  96.             unsigned short codeend;
  97.             unsigned short dataend;
  98.             PTR16          bpbarray;
  99.             unsigned short status;
  100.         } output;
  101.     } u;
  102. };
  103. #pragma pack()
  104.