Author: janderwald
Date: Thu Oct 25 15:36:09 2012
New Revision: 57616
URL:
http://svn.reactos.org/svn/reactos?rev=57616&view=rev
Log:
[USBHUB]
- Partly implement IOCTL_USB_GET_NODE_CONNECTION_NAME
- Complete power irps
Modified:
trunk/reactos/drivers/usb/usbhub/fdo.c
trunk/reactos/drivers/usb/usbhub/usbhub.c
Modified: trunk/reactos/drivers/usb/usbhub/fdo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub/fdo.c?r…
==============================================================================
--- trunk/reactos/drivers/usb/usbhub/fdo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbhub/fdo.c [iso-8859-1] Thu Oct 25 15:36:09 2012
@@ -2062,6 +2062,7 @@
PUSB_NODE_CONNECTION_INFORMATION NodeConnectionInfo;
PHUB_CHILDDEVICE_EXTENSION ChildDeviceExtension;
PUSB_NODE_CONNECTION_DRIVERKEY_NAME NodeKey;
+ PUSB_NODE_CONNECTION_NAME ConnectionName;
ULONG Index, Length;
// get stack location
@@ -2141,7 +2142,6 @@
}
break;
}
-
// done
Irp->IoStatus.Information = sizeof(USB_NODE_INFORMATION);
Status = STATUS_SUCCESS;
@@ -2188,7 +2188,7 @@
if (Length + sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME) >
IoStack->Parameters.DeviceIoControl.OutputBufferLength)
{
// terminate node key name
- NodeKey->DriverKeyName[0] = 0;
+ NodeKey->DriverKeyName[0] = UNICODE_NULL;
Irp->IoStatus.Information =
sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME);
}
else
@@ -2203,6 +2203,25 @@
}
}
}
+ else if (IoStack->Parameters.DeviceIoControl.IoControlCode ==
IOCTL_USB_GET_NODE_CONNECTION_NAME)
+ {
+ if (IoStack->Parameters.DeviceIoControl.OutputBufferLength <
sizeof(USB_NODE_CONNECTION_NAME))
+ {
+ // buffer too small
+ Status = STATUS_BUFFER_TOO_SMALL;
+ }
+ else
+ {
+ // FIXME support hubs
+ ConnectionName =
(PUSB_NODE_CONNECTION_NAME)Irp->AssociatedIrp.SystemBuffer;
+ ConnectionName->ActualLength = 0;
+ ConnectionName->NodeName[0] = UNICODE_NULL;
+
+ // done
+ Irp->IoStatus.Information = sizeof(USB_NODE_CONNECTION_NAME);
+ Status = STATUS_SUCCESS;
+ }
+ }
else
{
DPRINT1("UNIMPLEMENTED FdoHandleDeviceControl IoCtl %x InputBufferLength %x
OutputBufferLength %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode,
Modified: trunk/reactos/drivers/usb/usbhub/usbhub.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub/usbhub.…
==============================================================================
--- trunk/reactos/drivers/usb/usbhub/usbhub.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbhub/usbhub.c [iso-8859-1] Thu Oct 25 15:36:09 2012
@@ -184,8 +184,39 @@
PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return STATUS_NOT_SUPPORTED;
+ PIO_STACK_LOCATION IoStack;
+
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
+ DPRINT1("Power Function %x\n", IoStack->MinorFunction);
+
+ if (IoStack->MinorFunction == IRP_MN_SET_POWER)
+ {
+ PoStartNextPowerIrp(Irp);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
+
+ }
+ else if (IoStack->MinorFunction == IRP_MN_QUERY_POWER)
+ {
+ PoStartNextPowerIrp(Irp);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
+
+ }
+ else if (IoStack->MinorFunction == IRP_MN_WAIT_WAKE)
+ {
+ PoStartNextPowerIrp(Irp);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
+ }
+
+ PoStartNextPowerIrp(Irp);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
}
VOID