home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1998 February / PCOnline_02_1998.iso / filesbbs / os2 / dsksl096.arj / DSKSL096.ZIP / dskslpub.h < prev    next >
C/C++ Source or Header  |  1997-11-23  |  5KB  |  152 lines

  1. /*
  2.  * $Source: E:/source/driver/sleep/RCS/dskslpub.h,v $
  3.  * $Revision: 1.6 $
  4.  * $Date: 1997/08/24 01:53:44 $
  5.  * $Author: vitus $
  6.  *
  7.  * Describes IOCtl interface to dsksleep.flt
  8.  *
  9.  * $Log: dskslpub.h,v $
  10.  * Revision 1.6  1997/08/24 01:53:44  vitus
  11.  * Added DSKSL_GET_LASTSTATUS
  12.  *
  13.  * Revision 1.5  1997/06/03 23:07:52  vitus
  14.  * Removed syntax error
  15.  *
  16.  * Revision 1.4  1997/04/05 01:56:25  vitus
  17.  * Expanded QUERY_VERSION to return additional bitfield
  18.  *
  19.  * Revision 1.3  1997/03/03 01:21:15  vitus
  20.  * Added DSKSL_MSGS_* IOCtls and structure
  21.  *
  22.  * Revision 1.2  1997/02/26 01:49:54  vitus
  23.  * Added SET/QUERY_DEVSTATE, Changed timeout units to seconds
  24.  *
  25.  * Revision 1.1  1997/02/06 01:07:05  vitus
  26.  * Initial revision
  27.  * -------------------------------------------
  28.  * This code is Copyright Vitus Jensen 1996-97
  29.  */
  30.  
  31. #if !defined(_DSKSLPUB_H)
  32. #define _DSKSLPUB_H
  33. #pragma pack(1)                    /* all structures packed */
  34.  
  35.  
  36. /*
  37.  * IOCtl category and function codes
  38.  */
  39. #define IOCTL_DSKSLEEP_CATEGORY    0xC0        /* a user-defined category */
  40. #define DSKSL_QUERY_VERSION    0x60        /* returns version and more */
  41. #define DSKSL_QUERY_TIMEOUT    0x61        /* return device list */
  42. #define DSKSL_SET_TIMEOUT    0x41        /* changes single entry */
  43. #define DSKSL_QUERY_DEVSTATE    0x62        /* stopped? */
  44. #define DSKSL_SET_DEVSTATE    0x42        /* stop now! */
  45. #define DSKSL_READ_MSGS        0x63        /* read startup messages */
  46. #define DSKSL_CLEAR_MSGS    0x43        /* forget all messages */
  47. #define DSKSL_GET_LASTSTATUS    0x64        /* reads statusblock + sense */
  48.  
  49.  
  50. /* Describes installed DSKSleep.flt */
  51. typedef struct _DSKSL_VER_DATA {
  52.     USHORT    version;            /* as in PC-DOS */
  53.     USHORT    flags;                /* BIT0: registered */
  54. } DSKSL_VER_DATA;
  55.  
  56.  
  57.  
  58. /* Defines device settings */
  59. typedef struct _DEVICE_TIMEOUT {
  60.     UCHAR    adapter;            /* adapter index */
  61.     UCHAR    unit;                /* unit index */
  62.     UCHAR    reserved[2];            /* (padding) */
  63.     ULONG    seconds;            /* 0 -> no sleep */
  64. } DEVICE_TIMEOUT;
  65.  
  66.  
  67.  
  68. /* Returned by DSKSL_QUERY_TIMEOUT */
  69. typedef struct _DSKSL_QL_DATA {
  70.     USHORT        cb;            /* byte count driver wants
  71.                            to return (may be larger
  72.                            than application buffer) */
  73.     UCHAR        reserved[2];        /* (padding) */
  74.     DEVICE_TIMEOUT    list[1];        /* some compiler don't
  75.                            support '[]' ... */
  76. } DSKSL_QL_DATA, * PDSKSL_QL_DATA;
  77.  
  78.  
  79.  
  80. /* Passed to DSKSL_SET_TIMEOUT */
  81. typedef struct _DSKSL_SETTO_PARM {
  82.     USHORT        cb;            /* size of complete structure */
  83.     UCHAR        reserved[2];        /* (padding) */
  84.     DEVICE_TIMEOUT    list[1];        /* see above */
  85. } DSKSL_SETTO_PARM, * PDSKSL_SETTO_PARM;
  86.  
  87.  
  88.  
  89. /* Passed to DSKSL_QUERY_DEVSTATE, DSKSL_SET_DEVSTATE and DSKSL_GET_LASTSTATUS */
  90. typedef struct _DSKSL_DEVSTATE_PARM {
  91.     UCHAR    adapter;            /* adapter index */
  92.     UCHAR    unit;                /* unit index */
  93. } DSKSL_DEVSTATE_PARM, * PDSKSL_DEVSTATE_PARM;
  94.  
  95.  
  96.  
  97. /* Returned from DSKSL_QUERY_DEVSTATE
  98.  * -- x seconds until device is stopped
  99.  * Passed to DSKSL_SET_DEVSTATE
  100.  * -- change current timeout to x seconds
  101.  *    setting this value to 0 will immediately stop the
  102.  *    device.
  103.  *    OBS: any disk I/O will reset the device timeout to it's maximum. */
  104. typedef struct _DSKSL_DEVSTATE_DATA {
  105.     ULONG    seconds;            /* seconds still to go
  106.                            until device is stopped */
  107. } DSKSL_DEVSTATE_DATA, * PDSKSL_DEVSTATE_DATA;
  108.  
  109.  
  110.  
  111. /* Returned by DSKSL_READ_MSGS
  112.  * 'msg' will contain a buffer filled with ASCIIZ strings.  Strings
  113.  * usually don't contain newlines.
  114.  * Some time in the future this buffer might even contain messages
  115.  * added after system startup.
  116.  * To clear the buffer just issue DSKSL_CLEAR_MSGS w/o parameter or
  117.  * data buffer. */
  118. typedef struct _DSKSL_MSGS_DATA {
  119.     USHORT    cb;                /* byte count driver wants
  120.                            to return */
  121.     char    msg[1];                /* some compiler don't
  122.                            support '[]' */
  123. } DSKSL_MSGS_DATA;
  124.  
  125.  
  126.  
  127. /* Reads statusblock and sense data from last I/O issued.  See DDK
  128.  * information for format of status block and a SCSI II+ spec for
  129.  * sense data.
  130.  * Warning: this data may not be consistent, i.e. status and statusblock
  131.  * may come from different I/Os if you happen to call this IOCtl during
  132.  * device start or stop. */
  133. typedef struct _DSKSL_STATUS_DATA {
  134.     UCHAR    iotype;                /* DSKIO_* */
  135.     UCHAR    reserved;            /* 0 */
  136.     USHORT    status;                /* see DDK */
  137.     USHORT    error;                /* see DDK */
  138.     UCHAR    statusblock[23];        /* see DDK */
  139.     UCHAR    sensedata[18];            /* see SCSI spec */
  140. } DSKSL_STATUS_DATA, * PDSKSL_STATUS_DATA;
  141.  
  142. #define DSKIO_ALLOC    1
  143. #define DSKIO_DEALLOC    2
  144. #define DSKIO_CHANGEUI    3
  145. #define DSKIO_START    4
  146. #define DSKIO_STOP    5
  147. #define DSKIO_VERIFY    6
  148. #define DSKIO_TESTREADY    7
  149.  
  150. #pragma pack()
  151. #endif /* _DSKSLPUB_H */
  152.