ReactOS  0.4.15-dev-439-g292f67a
tape.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) 1992 Microsoft Corporation
4 
5 Module Name:
6 
7  tape.h
8 
9 Abstract:
10 
11  These are the structures and defines that are used in the
12  SCSI tape class drivers. The tape class driver is separated
13  into two modules. Tape.c contains code common to all tape
14  class drivers including the driver's major entry points.
15  The major entry point names each begin with the prefix
16  'ScsiTape.' The second module is the device specific code.
17  It provides support for a set of functions. Each device
18  specific function name is prefixed by 'Tape.'
19 
20 Author:
21 
22  Mike Glass
23 
24 Revision History:
25 
26 --*/
27 
28 #include "scsi.h"
29 #include "class.h"
30 
31 //
32 // Define the maximum inquiry data length.
33 //
34 
35 #define MAXIMUM_TAPE_INQUIRY_DATA 252
36 
37 //
38 // Tape device data
39 //
40 
41 typedef struct _TAPE_DATA {
47 
48 #define DEVICE_EXTENSION_SIZE sizeof(DEVICE_EXTENSION) + sizeof(TAPE_DATA)
49 
50 
51 //
52 // Define Device Configuration Page
53 //
54 
56 
59  UCHAR PS : 1;
69  UCHAR REW : 1;
70  UCHAR RBO : 1;
71  UCHAR SOCF : 2;
72  UCHAR AVC : 1;
73  UCHAR RSmk : 1;
74  UCHAR BIS : 1;
75  UCHAR DBR : 1;
78  UCHAR SEW : 1;
79  UCHAR EEG : 1;
84 
86 
87 //
88 // Define Medium Partition Page
89 //
90 
92 
95  UCHAR PSBit : 1;
108 
110 
111 //
112 // Define Data Compression Page
113 //
114 
116 
121  UCHAR DCC : 1;
122  UCHAR DCE : 1;
124  UCHAR RED : 2;
125  UCHAR DDE : 1;
129 
131 
132 //
133 // Mode parameter list header and medium partition page -
134 // used in creating partitions
135 //
136 
137 typedef struct _MODE_MEDIUM_PART_PAGE {
138 
141 
143 
144 
145 //
146 // Mode parameters for retrieving tape or media information
147 //
148 
150 
154 
156 
157 //
158 // Mode parameter list header and device configuration page -
159 // used in retrieving device configuration information
160 //
161 
162 typedef struct _MODE_DEVICE_CONFIG_PAGE {
163 
166 
168 
169 
170 //
171 // Mode parameter list header and data compression page -
172 // used in retrieving data compression information
173 //
174 
175 typedef struct _MODE_DATA_COMPRESS_PAGE {
176 
179 
181 
182 
183 
184 //
185 // The following routines are the exported entry points for
186 // all tape class drivers. Note all these routines name start
187 // with 'ScsiTape.'
188 //
189 
190 NTSTATUS
194  );
195 
196 NTSTATUS
199  );
200 
201 NTSTATUS
204  IN PIRP Irp
205  );
206 
207 NTSTATUS
210  IN PIRP Irp
211  );
212 
213 NTSTATUS
216  IN PIRP Irp
217  );
218 
219 
220 
221 //
222 // The following routines are provided by the tape
223 // device-specific module. Each routine name is
224 // prefixed with 'Tape.'
225 
226 NTSTATUS
229  IN PIRP Irp
230  );
231 
232 NTSTATUS
233 TapeErase(
235  IN PIRP Irp
236  );
237 
238 VOID
239 TapeError(
242  NTSTATUS *Status,
243  BOOLEAN *Retry
244  );
245 
246 NTSTATUS
249  IN PIRP Irp
250  );
251 
252 NTSTATUS
255  IN PIRP Irp
256  );
257 
258 NTSTATUS
261  IN PIRP Irp
262  );
263 
264 NTSTATUS
267  IN PIRP Irp
268  );
269 
270 NTSTATUS
273  IN PIRP Irp
274  );
275 
276 NTSTATUS
279  IN PIRP Irp
280  );
281 
282 NTSTATUS
285  IN PIRP Irp
286  );
287 
288 NTSTATUS
291  IN PIRP Irp
292  );
293 
294 NTSTATUS
297  IN PIRP Irp
298  );
299 
300 BOOLEAN
302  IN PSCSI_INQUIRY_DATA LunInfo
303  );
304 
305 NTSTATUS
308  IN PIRP Irp
309  );
310 
311 
312 
#define IN
Definition: typedefs.h:39
NTSTATUS ScsiTapeInitialize(IN PDRIVER_OBJECT DriverObject)
ULONG Flags
Definition: tape.h:42
struct _MODE_DATA_COMPRESS_PAGE * PMODE_DATA_COMPRESS_PAGE
NTSTATUS ScsiTapeReadWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS TapeErase(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS TapeCreatePartition(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
_In_ PIRP Irp
Definition: csq.h:116
NTSTATUS TapeGetMediaParameters(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
struct _MODE_DEVICE_CONFIGURATION_PAGE MODE_DEVICE_CONFIGURATION_PAGE
NTSTATUS ScsiTapeCreate(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
LONG NTSTATUS
Definition: precomp.h:26
struct _MODE_MEDIUM_PARTITION_PAGE MODE_MEDIUM_PARTITION_PAGE
PSCSI_INQUIRY_DATA InquiryData
Definition: tape.h:45
MODE_PARAMETER_HEADER ParameterListHeader
Definition: tape.h:164
NTSTATUS TapeSetPosition(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
MODE_DATA_COMPRESSION_PAGE DataCompressPage
Definition: tape.h:178
MODE_PARAMETER_BLOCK ParameterListBlock
Definition: tape.h:152
struct _MODE_DEVICE_CONFIG_PAGE MODE_DEVICE_CONFIG_PAGE
MODE_MEDIUM_PARTITION_PAGE MediumPartPage
Definition: tape.h:140
struct _MODE_MEDIUM_PARTITION_PAGE * PMODE_MEDIUM_PARTITION_PAGE
NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: beep.c:367
MODE_PARAMETER_HEADER ParameterListHeader
Definition: tape.h:151
NTSTATUS TapeGetPosition(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
unsigned char BOOLEAN
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
ULONG CurrentPartition
Definition: tape.h:43
IN PSCSI_REQUEST_BLOCK IN OUT NTSTATUS IN OUT BOOLEAN * Retry
Definition: class2.h:49
MODE_PARAMETER_HEADER ParameterListHeader
Definition: tape.h:139
NTSTATUS TapeWriteMarks(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
struct _TAPE_DATA TAPE_DATA
NTSTATUS TapePrepare(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
struct _MODE_TAPE_MEDIA_INFORMATION MODE_TAPE_MEDIA_INFORMATION
BOOLEAN TapeVerifyInquiry(IN PSCSI_INQUIRY_DATA LunInfo)
struct _MODE_DATA_COMPRESSION_PAGE * PMODE_DATA_COMPRESSION_PAGE
struct _MODE_DATA_COMPRESSION_PAGE MODE_DATA_COMPRESSION_PAGE
struct _MODE_MEDIUM_PART_PAGE * PMODE_MEDIUM_PART_PAGE
UCHAR MaximumAdditionalPartitions
Definition: tape.h:97
unsigned char UCHAR
Definition: xmlstorage.h:181
NTSTATUS TapeReadWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
struct _MODE_DEVICE_CONFIGURATION_PAGE * PMODE_DEVICE_CONFIGURATION_PAGE
NTSTATUS TapeSetMediaParameters(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
UCHAR DecompressionAlgorithm[4]
Definition: tape.h:127
struct _MODE_DATA_COMPRESS_PAGE MODE_DATA_COMPRESS_PAGE
MODE_PARAMETER_HEADER ParameterListHeader
Definition: tape.h:177
struct _MODE_TAPE_MEDIA_INFORMATION * PMODE_TAPE_MEDIA_INFORMATION
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
NTSTATUS TapeGetStatus(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS ScsiTapeDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS TapeSetDriveParameters(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
struct _MODE_MEDIUM_PART_PAGE MODE_MEDIUM_PART_PAGE
UCHAR CompressionAlgorithm[4]
Definition: tape.h:126
struct _MODE_DEVICE_CONFIG_PAGE * PMODE_DEVICE_CONFIG_PAGE
unsigned int ULONG
Definition: retypes.h:1
MODE_MEDIUM_PARTITION_PAGE MediumPartPage
Definition: tape.h:153
VOID TapeError(PDEVICE_OBJECT DeviceObject, PSCSI_REQUEST_BLOCK Srb, NTSTATUS *Status, BOOLEAN *Retry)
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:28
UCHAR AdditionalPartitionDefined
Definition: tape.h:98
IN PSCSI_REQUEST_BLOCK Srb
Definition: class2.h:49
NTSTATUS TapeGetDriveParameters(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
MODE_DEVICE_CONFIGURATION_PAGE DeviceConfigPage
Definition: tape.h:165
struct _TAPE_DATA * PTAPE_DATA
PVOID DeviceSpecificExtension
Definition: tape.h:44