source: Daodan/MinGW/include/ddk/minitape.h@ 1047

Last change on this file since 1047 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

File size: 5.9 KB
RevLine 
[1046]1/*
2 * minitape.h
3 *
4 * Minitape driver interface
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22#ifndef __MINITAPE_H
23#define __MINITAPE_H
24
25#if __GNUC__ >=3
26#pragma GCC system_header
27#endif
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#pragma pack(push,4)
34
35#include "ntddk.h"
36
37#define MEDIA_ERASEABLE 0x00000001
38#define MEDIA_WRITE_ONCE 0x00000002
39#define MEDIA_READ_ONLY 0x00000004
40#define MEDIA_READ_WRITE 0x00000008
41#define MEDIA_WRITE_PROTECTED 0x00000100
42#define MEDIA_CURRENTLY_MOUNTED 0x80000000
43
44typedef enum _TAPE_STATUS {
45 TAPE_STATUS_SEND_SRB_AND_CALLBACK,
46 TAPE_STATUS_CALLBACK,
47 TAPE_STATUS_CHECK_TEST_UNIT_READY,
48 TAPE_STATUS_SUCCESS,
49 TAPE_STATUS_INSUFFICIENT_RESOURCES,
50 TAPE_STATUS_NOT_IMPLEMENTED,
51 TAPE_STATUS_INVALID_DEVICE_REQUEST,
52 TAPE_STATUS_INVALID_PARAMETER,
53 TAPE_STATUS_MEDIA_CHANGED,
54 TAPE_STATUS_BUS_RESET,
55 TAPE_STATUS_SETMARK_DETECTED,
56 TAPE_STATUS_FILEMARK_DETECTED,
57 TAPE_STATUS_BEGINNING_OF_MEDIA,
58 TAPE_STATUS_END_OF_MEDIA,
59 TAPE_STATUS_BUFFER_OVERFLOW,
60 TAPE_STATUS_NO_DATA_DETECTED,
61 TAPE_STATUS_EOM_OVERFLOW,
62 TAPE_STATUS_NO_MEDIA,
63 TAPE_STATUS_IO_DEVICE_ERROR,
64 TAPE_STATUS_UNRECOGNIZED_MEDIA,
65 TAPE_STATUS_DEVICE_NOT_READY,
66 TAPE_STATUS_MEDIA_WRITE_PROTECTED,
67 TAPE_STATUS_DEVICE_DATA_ERROR,
68 TAPE_STATUS_NO_SUCH_DEVICE,
69 TAPE_STATUS_INVALID_BLOCK_LENGTH,
70 TAPE_STATUS_IO_TIMEOUT,
71 TAPE_STATUS_DEVICE_NOT_CONNECTED,
72 TAPE_STATUS_DATA_OVERRUN,
73 TAPE_STATUS_DEVICE_BUSY,
74 TAPE_STATUS_REQUIRES_CLEANING,
75 TAPE_STATUS_CLEANER_CARTRIDGE_INSTALLED
76} TAPE_STATUS, *PTAPE_STATUS;
77
78#define INQUIRYDATABUFFERSIZE 36
79#ifndef _INQUIRYDATA_DEFINED /* also in scsi.h */
80#define _INQUIRYDATA_DEFINED
81typedef struct _INQUIRYDATA {
82 UCHAR DeviceType : 5;
83 UCHAR DeviceTypeQualifier : 3;
84 UCHAR DeviceTypeModifier : 7;
85 UCHAR RemovableMedia : 1;
86 union {
87 UCHAR Versions;
88 struct {
89 UCHAR ANSIVersion : 3;
90 UCHAR ECMAVersion : 3;
91 UCHAR ISOVersion : 2;
92 };
93 };
94 UCHAR ResponseDataFormat : 4;
95 UCHAR HiSupport : 1;
96 UCHAR NormACA : 1;
97 UCHAR TerminateTask : 1;
98 UCHAR AERC : 1;
99 UCHAR AdditionalLength;
100 UCHAR Reserved;
101 UCHAR Addr16 : 1;
102 UCHAR Addr32 : 1;
103 UCHAR AckReqQ: 1;
104 UCHAR MediumChanger : 1;
105 UCHAR MultiPort : 1;
106 UCHAR ReservedBit2 : 1;
107 UCHAR EnclosureServices : 1;
108 UCHAR ReservedBit3 : 1;
109 UCHAR SoftReset : 1;
110 UCHAR CommandQueue : 1;
111 UCHAR TransferDisable : 1;
112 UCHAR LinkedCommands : 1;
113 UCHAR Synchronous : 1;
114 UCHAR Wide16Bit : 1;
115 UCHAR Wide32Bit : 1;
116 UCHAR RelativeAddressing : 1;
117 UCHAR VendorId[8];
118 UCHAR ProductId[16];
119 UCHAR ProductRevisionLevel[4];
120 UCHAR VendorSpecific[20];
121 UCHAR Reserved3[40];
122} INQUIRYDATA, *PINQUIRYDATA;
123#endif
124
125typedef struct _MODE_CAPABILITIES_PAGE {
126 UCHAR PageCode : 6;
127 UCHAR Reserved1 : 2;
128 UCHAR PageLength;
129 UCHAR Reserved2[2];
130 UCHAR RO : 1;
131 UCHAR Reserved3 : 4;
132 UCHAR SPREV : 1;
133 UCHAR Reserved4 : 2;
134 UCHAR Reserved5 : 3;
135 UCHAR EFMT : 1;
136 UCHAR Reserved6 : 1;
137 UCHAR QFA : 1;
138 UCHAR Reserved7 : 2;
139 UCHAR LOCK : 1;
140 UCHAR LOCKED : 1;
141 UCHAR PREVENT : 1;
142 UCHAR UNLOAD : 1;
143 UCHAR Reserved8 : 2;
144 UCHAR ECC : 1;
145 UCHAR CMPRS : 1;
146 UCHAR Reserved9 : 1;
147 UCHAR BLK512 : 1;
148 UCHAR BLK1024 : 1;
149 UCHAR Reserved10 : 4;
150 UCHAR SLOWB : 1;
151 UCHAR MaximumSpeedSupported[2];
152 UCHAR MaximumStoredDefectedListEntries[2];
153 UCHAR ContinuousTransferLimit[2];
154 UCHAR CurrentSpeedSelected[2];
155 UCHAR BufferSize[2];
156 UCHAR Reserved11[2];
157} MODE_CAPABILITIES_PAGE, *PMODE_CAPABILITIES_PAGE;
158
159typedef BOOLEAN DDKAPI
160(*TAPE_VERIFY_INQUIRY_ROUTINE)(
161 /*IN*/ PINQUIRYDATA InquiryData,
162 /*IN*/ PMODE_CAPABILITIES_PAGE ModeCapabilitiesPage);
163
164typedef VOID DDKAPI
165(*TAPE_EXTENSION_INIT_ROUTINE)(
166 /*IN*/ PVOID MinitapeExtension,
167 /*IN*/ PINQUIRYDATA InquiryData,
168 /*IN*/ PMODE_CAPABILITIES_PAGE ModeCapabilitiesPage);
169
170typedef VOID DDKAPI
171(*TAPE_ERROR_ROUTINE)(
172 /*IN*/ PVOID MinitapeExtension,
173 /*IN*/ PSCSI_REQUEST_BLOCK Srb,
174 /*IN OUT*/ PTAPE_STATUS TapeStatus);
175
176typedef TAPE_STATUS DDKAPI
177(*TAPE_PROCESS_COMMAND_ROUTINE)(
178 /*IN OUT*/ PVOID MinitapeExtension,
179 /*IN OUT*/ PVOID CommandExtension,
180 /*IN OUT*/ PVOID CommandParameters,
181 /*IN OUT*/ PSCSI_REQUEST_BLOCK Srb,
182 /*IN*/ ULONG CallNumber,
183 /*IN*/ TAPE_STATUS StatusOfLastCommand,
184 /*IN OUT*/ PULONG RetryFlags);
185
186#define TAPE_RETRY_MASK 0x0000FFFF
187#define IGNORE_ERRORS 0x00010000
188#define RETURN_ERRORS 0x00020000
189
190typedef struct _TAPE_INIT_DATA {
191 TAPE_VERIFY_INQUIRY_ROUTINE VerifyInquiry;
192 BOOLEAN QueryModeCapabilitiesPage;
193 ULONG MinitapeExtensionSize;
194 TAPE_EXTENSION_INIT_ROUTINE ExtensionInit;
195 ULONG DefaultTimeOutValue;
196 TAPE_ERROR_ROUTINE TapeError;
197 ULONG CommandExtensionSize;
198 TAPE_PROCESS_COMMAND_ROUTINE CreatePartition;
199 TAPE_PROCESS_COMMAND_ROUTINE Erase;
200 TAPE_PROCESS_COMMAND_ROUTINE GetDriveParameters;
201 TAPE_PROCESS_COMMAND_ROUTINE GetMediaParameters;
202 TAPE_PROCESS_COMMAND_ROUTINE GetPosition;
203 TAPE_PROCESS_COMMAND_ROUTINE GetStatus;
204 TAPE_PROCESS_COMMAND_ROUTINE Prepare;
205 TAPE_PROCESS_COMMAND_ROUTINE SetDriveParameters;
206 TAPE_PROCESS_COMMAND_ROUTINE SetMediaParameters;
207 TAPE_PROCESS_COMMAND_ROUTINE SetPosition;
208 TAPE_PROCESS_COMMAND_ROUTINE WriteMarks;
209 TAPE_PROCESS_COMMAND_ROUTINE PreProcessReadWrite /* OPTIONAL */;
210} TAPE_INIT_DATA, *PTAPE_INIT_DATA;
211
212typedef struct _TAPE_PHYS_POSITION {
213 ULONG SeekBlockAddress;
214 ULONG SpaceBlockCount;
215} TAPE_PHYS_POSITION, PTAPE_PHYS_POSITION;
216
217#pragma pack(pop)
218
219#ifdef __cplusplus
220}
221#endif
222
223#endif /* __MINITAPE_H */
Note: See TracBrowser for help on using the repository browser.