Author: janderwald
Date: Sat Dec 31 04:13:37 2011
New Revision: 54792
URL:
http://svn.reactos.org/svn/reactos?rev=54792&view=rev
Log:
[USB-BRINGUP]
- Partly implement IRP_MN_START_DEVICE for PDO
- PDO now completely initializes
- Remaining IOCTL to implement IRP_MJ_CREATE, IRP_MJ_CLOSE, IRP_MJ_FLUSH, IRP_MJ_READ for
partial mouse support in hidclass
Modified:
branches/usb-bringup/drivers/hid/hidclass/hidclass.c
branches/usb-bringup/drivers/hid/hidclass/pdo.c
branches/usb-bringup/drivers/hid/hidclass/precomp.h
Modified: branches/usb-bringup/drivers/hid/hidclass/hidclass.c
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/hid/hidclas…
==============================================================================
--- branches/usb-bringup/drivers/hid/hidclass/hidclass.c [iso-8859-1] (original)
+++ branches/usb-bringup/drivers/hid/hidclass/hidclass.c [iso-8859-1] Sat Dec 31 04:13:37
2011
@@ -128,6 +128,8 @@
{
UNIMPLEMENTED
ASSERT(FALSE);
+ Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_NOT_IMPLEMENTED;
}
@@ -139,6 +141,8 @@
{
UNIMPLEMENTED
ASSERT(FALSE);
+ Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_NOT_IMPLEMENTED;
}
@@ -150,6 +154,8 @@
{
UNIMPLEMENTED
ASSERT(FALSE);
+ Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_NOT_IMPLEMENTED;
}
@@ -161,6 +167,8 @@
{
UNIMPLEMENTED
ASSERT(FALSE);
+ Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_NOT_IMPLEMENTED;
}
Modified: branches/usb-bringup/drivers/hid/hidclass/pdo.c
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/hid/hidclas…
==============================================================================
--- branches/usb-bringup/drivers/hid/hidclass/pdo.c [iso-8859-1] (original)
+++ branches/usb-bringup/drivers/hid/hidclass/pdo.c [iso-8859-1] Sat Dec 31 04:13:37 2011
@@ -422,13 +422,27 @@
}
case IRP_MN_START_DEVICE:
{
- DPRINT1("[HIDCLASS] PDO PnP not implemented %x\n",
IoStack->MinorFunction);
- ASSERT(FALSE);
-
- //
- // do nothing
- //
- Status = Irp->IoStatus.Status;
+ //
+ // FIXME: support polled devices
+ //
+ ASSERT(PDODeviceExtension->Common.DriverExtension->DevicesArePolled ==
FALSE);
+
+ //
+ // now register the device interface
+ //
+ Status =
IoRegisterDeviceInterface(PDODeviceExtension->Common.HidDeviceExtension.PhysicalDeviceObject,
&GUID_DEVINTERFACE_HID, NULL, &PDODeviceExtension->DeviceInterface);
+ if (NT_SUCCESS(Status))
+ {
+ //
+ // enable device interface
+ //
+ Status =
IoSetDeviceInterfaceState(&PDODeviceExtension->DeviceInterface, TRUE);
+ }
+ ASSERT(Status == STATUS_SUCCESS);
+
+ //
+ // break
+ //
break;
}
case IRP_MN_REMOVE_DEVICE:
@@ -528,7 +542,7 @@
//
PDODeviceExtension->Common.HidDeviceExtension.MiniDeviceExtension =
FDODeviceExtension->Common.HidDeviceExtension.MiniDeviceExtension;
PDODeviceExtension->Common.HidDeviceExtension.NextDeviceObject =
FDODeviceExtension->Common.HidDeviceExtension.NextDeviceObject;
- PDODeviceExtension->Common.HidDeviceExtension.PhysicalDeviceObject = NULL;
+ PDODeviceExtension->Common.HidDeviceExtension.PhysicalDeviceObject =
FDODeviceExtension->Common.HidDeviceExtension.PhysicalDeviceObject;
PDODeviceExtension->Common.IsFDO = FALSE;
PDODeviceExtension->Common.DriverExtension =
FDODeviceExtension->Common.DriverExtension;
RtlCopyMemory(&PDODeviceExtension->Attributes,
&FDODeviceExtension->Attributes, sizeof(HID_DEVICE_ATTRIBUTES));
Modified: branches/usb-bringup/drivers/hid/hidclass/precomp.h
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/hid/hidclas…
==============================================================================
--- branches/usb-bringup/drivers/hid/hidclass/precomp.h [iso-8859-1] (original)
+++ branches/usb-bringup/drivers/hid/hidclass/precomp.h [iso-8859-1] Sat Dec 31 04:13:37
2011
@@ -2,10 +2,10 @@
#define _HIDPI_NO_FUNCTION_MACROS_
#include <ntddk.h>
+#include <initguid.h>
#include <hidport.h>
#include <hidpddi.h>
#include <stdio.h>
-#include <initguid.h>
#include <wdmguid.h>
#include <debug.h>
@@ -108,6 +108,10 @@
//
ULONG CollectionIndex;
+ //
+ // device interface
+ //
+ UNICODE_STRING DeviceInterface;
}HIDCLASS_PDO_DEVICE_EXTENSION, *PHIDCLASS_PDO_DEVICE_EXTENSION;