Implement IRP_MJ_CLEANUP for UHCI controller

svn path=/trunk/; revision=16124
This commit is contained in:
Hervé Poussineau 2005-06-19 22:19:11 +00:00
parent 8098dc0a97
commit 697e997b8f
4 changed files with 43 additions and 2 deletions

View file

@ -0,0 +1,24 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS UHCI controller driver (Cromwell type)
* FILE: drivers/usb/cromwell/uhci/cleanup.c
* PURPOSE: IRP_MJ_CLEANUP operations
*
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.com)
*/
#define NDEBUG
#include "uhci.h"
NTSTATUS STDCALL
UhciCleanup(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
DPRINT("UHCI: IRP_MJ_CLEANUP\n");
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
}

View file

@ -244,6 +244,15 @@ DispatchClose(PDEVICE_OBJECT DeviceObject, PIRP Irp)
return IrpStub(DeviceObject, Irp); return IrpStub(DeviceObject, Irp);
} }
static NTSTATUS STDCALL
DispatchCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
if (((POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
return UhciCleanup(DeviceObject, Irp);
else
return IrpStub(DeviceObject, Irp);
}
static NTSTATUS STDCALL static NTSTATUS STDCALL
DispatchDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) DispatchDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{ {
@ -289,6 +298,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegPath)
DriverObject->MajorFunction[IRP_MJ_CREATE] = DispatchCreate; DriverObject->MajorFunction[IRP_MJ_CREATE] = DispatchCreate;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = DispatchClose; DriverObject->MajorFunction[IRP_MJ_CLOSE] = DispatchClose;
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = DispatchCleanup;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = DispatchDeviceControl; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = DispatchDeviceControl;
DriverObject->MajorFunction[IRP_MJ_PNP] = DispatchPnp; DriverObject->MajorFunction[IRP_MJ_PNP] = DispatchPnp;
DriverObject->MajorFunction[IRP_MJ_POWER] = DispatchPower; DriverObject->MajorFunction[IRP_MJ_POWER] = DispatchPower;

View file

@ -12,9 +12,9 @@
#define USB_UHCI_TAG TAG('u','s','b','u') #define USB_UHCI_TAG TAG('u','s','b','u')
/* create.c */ /* cleanup.c */
NTSTATUS STDCALL NTSTATUS STDCALL
UhciCreate( UhciCleanup(
IN PDEVICE_OBJECT DeviceObject, IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp); IN PIRP Irp);
@ -24,6 +24,12 @@ UhciClose(
IN PDEVICE_OBJECT DeviceObject, IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp); IN PIRP Irp);
/* create.c */
NTSTATUS STDCALL
UhciCreate(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
/* fdo.c */ /* fdo.c */
NTSTATUS STDCALL NTSTATUS STDCALL
UhciPnpFdo( UhciPnpFdo(

View file

@ -7,6 +7,7 @@
<library>ntoskrnl</library> <library>ntoskrnl</library>
<library>hal</library> <library>hal</library>
<library>usbcore</library> <library>usbcore</library>
<file>cleanup.c</file>
<file>close.c</file> <file>close.c</file>
<file>create.c</file> <file>create.c</file>
<file>fdo.c</file> <file>fdo.c</file>