Add .keep guard files in order to restore lost but empty directories we had with...
[reactos.git] / drivers / usb / usbehci / usbehci.c
1 /*
2 * PROJECT: ReactOS Universal Serial Bus Bulk Enhanced Host Controller Interface
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: drivers/usb/usbehci/usbehci.c
5 * PURPOSE: USB EHCI device driver.
6 * PROGRAMMERS:
7 * Michael Martin (michael.martin@reactos.org)
8 */
9
10 /* DEFINES *******************************************************************/
11 #include "usbehci.h"
12
13 NTSTATUS NTAPI
14 DispatchDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
15 {
16 DPRINT("DispatchDeviceControl\n");
17 Irp->IoStatus.Information = 0;
18 Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
19
20 IoCompleteRequest(Irp, IO_NO_INCREMENT);
21 return STATUS_UNSUCCESSFUL;
22 }
23
24 NTSTATUS NTAPI
25 DispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
26 {
27 DPRINT("DispatchInternalDeviceControl\n");
28 if (((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFdo)
29 {
30 return FdoDispatchInternalDeviceControl(DeviceObject, Irp);
31 }
32 else
33 return PdoDispatchInternalDeviceControl(DeviceObject, Irp);
34 }
35
36 NTSTATUS NTAPI
37 UsbEhciCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp)
38 {
39 DPRINT1("UsbEhciCleanup\n");
40 Irp->IoStatus.Information = 0;
41 Irp->IoStatus.Status = STATUS_SUCCESS;
42
43 IoCompleteRequest(Irp, IO_NO_INCREMENT);
44 return STATUS_SUCCESS;
45 }
46
47 NTSTATUS NTAPI
48 UsbEhciCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp)
49 {
50 DPRINT1("UsbEhciCreate\n");
51 Irp->IoStatus.Information = 0;
52 Irp->IoStatus.Status = STATUS_SUCCESS;
53
54 IoCompleteRequest(Irp, IO_NO_INCREMENT);
55 return STATUS_SUCCESS;
56 }
57
58 NTSTATUS NTAPI
59 UsbEhciClose(PDEVICE_OBJECT DeviceObject, PIRP Irp)
60 {
61 DPRINT1("Close\n");
62 Irp->IoStatus.Information = 0;
63 Irp->IoStatus.Status = STATUS_SUCCESS;
64
65 IoCompleteRequest(Irp, IO_NO_INCREMENT);
66 return STATUS_SUCCESS;
67 }
68
69 VOID NTAPI
70 DriverUnload(PDRIVER_OBJECT DriverObject)
71 {
72 DPRINT("Unloading Driver\n");
73 /* FIXME: Clean up */
74 }
75
76 NTSTATUS NTAPI
77 DispatchPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp)
78 {
79 if (((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFdo)
80 return FdoDispatchPnp(DeviceObject, Irp);
81 else
82 return PdoDispatchPnp(DeviceObject, Irp);
83 }
84
85 NTSTATUS NTAPI
86 DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
87 {
88 DPRINT1("Driver Entry %wZ!\n", RegistryPath);
89
90 DriverObject->DriverExtension->AddDevice = AddDevice;
91 DriverObject->MajorFunction[IRP_MJ_CREATE] = UsbEhciCreate;
92 DriverObject->MajorFunction[IRP_MJ_CLOSE] = UsbEhciClose;
93 DriverObject->MajorFunction[IRP_MJ_CLEANUP] = UsbEhciCleanup;
94 DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = DispatchDeviceControl;
95 DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = DispatchInternalDeviceControl;
96 DriverObject->MajorFunction[IRP_MJ_PNP] = DispatchPnp;
97
98 DriverObject->DriverUnload = DriverUnload;
99 DPRINT1("Driver entry done\n");
100
101 return STATUS_SUCCESS;
102 }
103