3 * Copyright (C) 2001, 2002, 2003, 2004, 2005 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * Universal Serial Bus Bulk Storage Driver
23 * Written by James Tabor
27 /* INCLUDES ******************************************************************/
33 /* PUBLIC AND PRIVATE FUNCTIONS **********************************************/
36 IrpStub(IN PDEVICE_OBJECT DeviceObject
,
39 NTSTATUS Status
= STATUS_NOT_SUPPORTED
;
40 Irp
->IoStatus
.Status
= Status
;
41 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
46 AddDevice(IN PDRIVER_OBJECT DriverObject
,
47 IN PDEVICE_OBJECT pdo
)
49 return STATUS_SUCCESS
;
53 DriverUnload(PDRIVER_OBJECT DriverObject
)
58 StartIo(PUSBSTOR_DEVICE_EXTENSION DeviceExtension
,
63 static NTSTATUS STDCALL
64 DispatchClose(PDEVICE_OBJECT DeviceObject
, PIRP Irp
)
66 Irp
->IoStatus
.Information
= 0;
67 Irp
->IoStatus
.Status
= STATUS_SUCCESS
;
68 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
69 return STATUS_SUCCESS
;
72 static NTSTATUS STDCALL
73 DispatchCleanup(PDEVICE_OBJECT DeviceObject
, PIRP Irp
)
75 return STATUS_SUCCESS
;
78 static NTSTATUS STDCALL
79 DispatchDeviceControl(PDEVICE_OBJECT DeviceObject
, PIRP Irp
)
81 return STATUS_SUCCESS
;
85 static NTSTATUS STDCALL
86 DispatchScsi(PDEVICE_OBJECT DeviceObject
, PIRP Irp
)
88 return STATUS_SUCCESS
;
91 static NTSTATUS STDCALL
92 DispatchReadWrite(PDEVICE_OBJECT DeviceObject
, PIRP Irp
)
94 return STATUS_SUCCESS
;
97 static NTSTATUS STDCALL
98 DispatchSystemControl(PDEVICE_OBJECT DeviceObject
, PIRP Irp
)
100 return STATUS_SUCCESS
;
103 static NTSTATUS STDCALL
104 DispatchPnp(PDEVICE_OBJECT DeviceObject
, PIRP Irp
)
106 return STATUS_SUCCESS
;
109 static NTSTATUS STDCALL
110 DispatchPower(PDEVICE_OBJECT fido
, PIRP Irp
)
112 DPRINT1("USBSTOR: IRP_MJ_POWER unimplemented\n");
113 Irp
->IoStatus
.Information
= 0;
114 Irp
->IoStatus
.Status
= STATUS_SUCCESS
;
115 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
116 return STATUS_SUCCESS
;
122 * Standard DriverEntry method.
125 DriverEntry(IN PDRIVER_OBJECT DriverObject
, IN PUNICODE_STRING RegPath
)
128 DPRINT("********* USB Storage *********\n");
130 DriverObject
->DriverUnload
= DriverUnload
;
131 DriverObject
->DriverExtension
->AddDevice
= AddDevice
;
133 for (i
= 0; i
< IRP_MJ_MAXIMUM_FUNCTION
; i
++)
134 DriverObject
->MajorFunction
[i
] = IrpStub
;
136 DriverObject
->DriverStartIo
= (PVOID
)StartIo
;
138 DriverObject
->MajorFunction
[IRP_MJ_CREATE
] = DispatchClose
;
139 DriverObject
->MajorFunction
[IRP_MJ_CLOSE
] = DispatchClose
;
140 DriverObject
->MajorFunction
[IRP_MJ_CLEANUP
] = DispatchCleanup
;
141 DriverObject
->MajorFunction
[IRP_MJ_DEVICE_CONTROL
] = DispatchDeviceControl
;
142 DriverObject
->MajorFunction
[IRP_MJ_READ
] = DispatchReadWrite
;
143 DriverObject
->MajorFunction
[IRP_MJ_WRITE
] = DispatchReadWrite
;
145 /* Scsi Miniport support */
146 DriverObject
->MajorFunction
[IRP_MJ_SCSI
] = DispatchScsi
;
147 DriverObject
->MajorFunction
[IRP_MJ_SYSTEM_CONTROL
] = DispatchSystemControl
;
149 DriverObject
->MajorFunction
[IRP_MJ_PNP
] = DispatchPnp
;
150 DriverObject
->MajorFunction
[IRP_MJ_POWER
] = DispatchPower
;
152 return STATUS_SUCCESS
;