source: GPL/branches/uniaud32-next/include/strategy.h@ 660

Last change on this file since 660 was 587, checked in by David Azarewicz, 9 years ago

Rearrange directory structure
rework makefiles
cleanup files

File size: 5.7 KB
Line 
1/****************************************************************************
2 * *
3 * Copyright (c) IBM Corporation 1994 - 1997. *
4 * *
5 * The following IBM OS/2 source code is provided to you solely for the *
6 * the purpose of assisting you in your development of OS/2 device drivers. *
7 * You may use this code in accordance with the IBM License Agreement *
8 * provided in the IBM Device Driver Source Kit for OS/2. *
9 * *
10 * Copyright (c) 2013 David Azarewicz david@88watts.net *
11 * Modified to fix problems and for OpenWatcom compatibility *
12 ****************************************************************************/
13#ifndef STRATEGY_INCLUDED
14#define STRATEGY_INCLUDED
15
16#pragma pack(1);
17
18typedef struct { /* template for request header */
19 BYTE bLength; /* 00 request packet length */
20 BYTE bUnit; /* 01 unit code for block DD only */
21 BYTE bCommand; /* 02 command code */
22 USHORT usStatus; /* 03 return status */
23 ULONG dwReserved; /* 05 reserved bytes */
24 ULONG ulQlink; /* 09 queue linkage */
25 union { /* command-specific data */
26 struct {
27 BYTE b; /* 0D */
28 PFN ulDevHlp; /* 0E dev help address */
29 ULONG szArgs; /* 12 argument pointer */
30 BYTE bDrive; /* 16 */
31 } init_in;
32 struct {
33 BYTE bUnits;
34 USHORT usCodeEnd; // final code offset
35 USHORT usDataEnd; // final data offset
36 ULONG ul;
37 } init_out;
38 struct {
39 BYTE bMedia;
40 ULONG ulAddress;
41 USHORT usCount;
42 ULONG ulStartSector;
43 USHORT usSysFileNum;
44 } io;
45 struct {
46 BYTE bData;
47 } peek;
48 struct {
49 BYTE bCategory; // category code
50 BYTE bFunction; // function code
51 ULONG pvParm; // address of parameter buffer
52 ULONG pvData; // address of data buffer
53 USHORT usSysFileNum; // system file number
54 USHORT usParmLen; // length of parameter buffer
55 USHORT usDataLen; // length of data buffer
56 } ioctl;
57 struct {
58 USHORT usSysFileNum; // system file number
59 } open_close;
60 struct {
61 BYTE Function; // Shutdown code: 0 = start, 1 = end
62 ULONG Reserved; // Reserved
63 } shutdown;
64 struct {
65 BYTE Function;
66 } save_restore;
67 };
68} REQPACKET;
69
70#pragma pack();
71
72/* Constants relating to the Strategy Routines */
73
74#define RPDONE 0x0100 // return successful, must be set
75#define RPBUSY 0x0200 // device is busy (or has no data to return)
76#define RPDEV 0x4000 // user-defined error
77#define RPERR 0x8000 // return error
78
79#define RPERR_PROTECT 0x8000
80#define RPERR_UNIT 0x8001
81#define RPERR_NOTREADY 0x8002
82#define RPERR_BADCOMMAND 0x8003
83#define RPERR_CRC 0x8004
84#define RPERR_LENGTH 0x8005
85#define RPERR_SEEK 0x8006
86#define RPERR_FORMAT 0x8007
87#define RPERR_SECTOR 0x8008
88#define RPERR_PAPER 0x8009
89#define RPERR_WRITE 0x800A
90#define RPERR_READ 0x800B
91#define RPERR_GENERAL 0x800C
92#define RPERR_DISK 0x800D
93#define RPERR_MEDIA 0x8010
94#define RPERR_INTERRUPTED 0x8011
95#define RPERR_MONITOR 0x8012
96#define RPERR_PARAMETER 0x8013
97#define RPERR_DEVINUSE 0x8014
98#define RPERR_INITFAIL 0x8015
99
100// list of Strategy commands from PDD reference
101#define STRATEGY_INIT 0x00
102#define STRATEGY_MEDIACHECK 0x01
103#define STRATEGY_BUILDBPB 0x02
104#define STRATEGY_IOCTLR 0x03
105#define STRATEGY_READ 0x04
106#define STRATEGY_NDR 0x05
107#define STRATEGY_INPUTSTATUS 0x06
108#define STRATEGY_FLUSHINPUT 0x07
109#define STRATEGY_WRITE 0x08
110#define STRATEGY_WRITEVERIFY 0x09
111#define STRATEGY_OUTPUTSTATUS 0x0A
112#define STRATEGY_FLUSHOUTPUT 0x0B
113#define STRATEGY_IOCTLW 0x0C
114#define STRATEGY_OPEN 0x0D
115#define STRATEGY_CLOSE 0x0E
116#define STRATEGY_REMOVEABLEMEDIA 0x0F
117#define STRATEGY_GENIOCTL 0x10
118#define STRATEGY_RESETMEDIA 0x11
119#define STRATEGY_GETLOGMAP 0x12
120#define STRATEGY_SETLOGMAP 0x13
121#define STRATEGY_DEINSTALL 0x14
122#define STRATEGY_PARTFIXEDDISKS 0x16
123#define STRATEGY_GETFDLOGUNITMAP 0x17
124#define STRATEGY_INPUTBYPASS 0x18
125#define STRATEGY_OUTPUTBYPASS 0x19
126#define STRATEGY_OUTPUTBYPASSV 0x1A
127#define STRATEGY_BASEDEVINIT 0x1B
128#define STRATEGY_SHUTDOWN 0x1C
129#define STRATEGY_GETDRIVERCAPS 0x1D
130#define STRATEGY_INITCOMPLETE 0x1F
131#define STRATEGY_SAVERESTORE 0x20
132
133#define IOCTL_ASYNC 0x0001
134#define IOCTL_SCR_AND_PTRDRAW 0x0003
135#define IOCTL_KEYBOARD 0x0004
136#define IOCTL_PRINTER 0x0005
137#define IOCTL_LIGHTPEN 0x0006
138#define IOCTL_POINTINGDEVICE 0x0007
139#define IOCTL_DISK 0x0008
140#define IOCTL_PHYSICALDISK 0x0009
141#define IOCTL_MONITOR 0x000A
142#define IOCTL_GENERAL 0x000B
143#define IOCTL_POWER 0x000C
144#define IOCTL_OEMHLP 0x0080
145#define IOCTL_TESTCFG_SYS 0x0080
146#define IOCTL_CDROMDISK 0x0080
147#define IOCTL_CDROMAUDIO 0x0081
148#define IOCTL_TOUCH_DEVDEP 0x0081
149#define IOCTL_TOUCH_DEVINDEP 0x0081
150
151#endif
Note: See TracBrowser for help on using the repository browser.