1 | /* $Id: strategy.h 142 2000-04-23 14:55:46Z ktk $ */
|
---|
2 |
|
---|
3 | /* SCCSID = %W% %E% */
|
---|
4 | /****************************************************************************
|
---|
5 | * *
|
---|
6 | * Copyright (c) IBM Corporation 1994 - 1997. *
|
---|
7 | * *
|
---|
8 | * The following IBM OS/2 source code is provided to you solely for the *
|
---|
9 | * the purpose of assisting you in your development of OS/2 device drivers. *
|
---|
10 | * You may use this code in accordance with the IBM License Agreement *
|
---|
11 | * provided in the IBM Device Driver Source Kit for OS/2. *
|
---|
12 | * *
|
---|
13 | ****************************************************************************/
|
---|
14 | /**@internal %W%
|
---|
15 | * Defines, and prototypes for the strategy entry point and it's functions.
|
---|
16 | * @version %I%
|
---|
17 | * @context Unless otherwise noted, all interfaces are Ring-0, 16-bit,
|
---|
18 | * <stack context>.
|
---|
19 | * @history
|
---|
20 | *
|
---|
21 | */
|
---|
22 | #ifndef STRATEGY_INCLUDED
|
---|
23 | #define STRATEGY_INCLUDED
|
---|
24 |
|
---|
25 | #ifndef OS2_INCLUDED
|
---|
26 | #define INCL_NOPMAPI
|
---|
27 | #include <os2.h>
|
---|
28 | #endif
|
---|
29 |
|
---|
30 | #pragma pack(1);
|
---|
31 |
|
---|
32 | typedef struct { /* template for request header */
|
---|
33 | BYTE bLength; /* request packet length */
|
---|
34 | BYTE bUnit; /* unit code for block DD only */
|
---|
35 | BYTE bCommand; /* command code */
|
---|
36 | USHORT usStatus; /* return status */
|
---|
37 | ULONG dwReserved; /* reserved bytes */
|
---|
38 | ULONG ulQlink; /* queue linkage */
|
---|
39 | union { /* command-specific data */
|
---|
40 | struct {
|
---|
41 | BYTE b;
|
---|
42 | PFN ulDevHlp; /* dev help address */
|
---|
43 | char __far *szArgs; /* argument pointer */
|
---|
44 | BYTE bDrive;
|
---|
45 | } init_in;
|
---|
46 | struct {
|
---|
47 | BYTE bUnits;
|
---|
48 | USHORT usCodeEnd; // final code offset
|
---|
49 | USHORT usDataEnd; // final data offset
|
---|
50 | ULONG ul;
|
---|
51 | } init_out;
|
---|
52 | struct {
|
---|
53 | BYTE bMedia;
|
---|
54 | ULONG ulAddress;
|
---|
55 | USHORT usCount;
|
---|
56 | ULONG ulStartSector;
|
---|
57 | USHORT usSysFileNum;
|
---|
58 | } io;
|
---|
59 | struct {
|
---|
60 | BYTE bData;
|
---|
61 | } peek;
|
---|
62 | struct {
|
---|
63 | BYTE bCategory; // category code
|
---|
64 | BYTE bCode; // function code
|
---|
65 | void __far *pvParm; // address of parameter buffer
|
---|
66 | void __far *pvData; // address of data buffer
|
---|
67 | USHORT usSysFileNum; // system file number
|
---|
68 | USHORT usPLength; // length of parameter buffer
|
---|
69 | USHORT usDLength; // length of data buffer
|
---|
70 | } ioctl;
|
---|
71 | struct {
|
---|
72 | USHORT usSysFileNum; // system file number
|
---|
73 | } open_close;
|
---|
74 | } s;
|
---|
75 | } REQPACKET, __far *PREQPACKET;
|
---|
76 |
|
---|
77 | #pragma pack();
|
---|
78 |
|
---|
79 | /* Constants relating to the Strategy Routines
|
---|
80 | */
|
---|
81 |
|
---|
82 | #define RPDONE 0x0100 // return successful, must be set
|
---|
83 | #define RPBUSY 0x0200 // device is busy (or has no data to return)
|
---|
84 | #define RPDEV 0x4000 // user-defined error
|
---|
85 | #define RPERR 0x8000 // return error
|
---|
86 |
|
---|
87 | // List of error codes, from chapter 8 of PDD reference
|
---|
88 | #define RPNOTREADY 0x0002
|
---|
89 | #define RPBADCMD 0x0003
|
---|
90 | #define RPGENFAIL 0x000c
|
---|
91 | #define RPDEVINUSE 0x0014
|
---|
92 | #define RPINITFAIL 0x0015
|
---|
93 |
|
---|
94 | // list of Strategy commands from PDD reference
|
---|
95 | // Note this is only the list of commands audio device drivers care about
|
---|
96 | #define STRATEGY_INIT 0x00
|
---|
97 | #define STRATEGY_OPEN 0x0D
|
---|
98 | #define STRATEGY_CLOSE 0x0E
|
---|
99 | #define STRATEGY_GENIOCTL 0x10
|
---|
100 | #define STRATEGY_DEINSTALL 0x14
|
---|
101 | #define STRATEGY_INITCOMPLETE 0x1F
|
---|
102 |
|
---|
103 | #endif
|
---|