From: Johannes Anderwald Date: Thu, 25 Oct 2012 15:36:09 +0000 (+0000) Subject: [USBHUB] X-Git-Tag: backups/ros-csrss@60644~172^2~8 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=b1002c5e57a5f0336d875af3789fd14f23f7b14e;ds=sidebyside [USBHUB] - Partly implement IOCTL_USB_GET_NODE_CONNECTION_NAME - Complete power irps svn path=/trunk/; revision=57616 --- diff --git a/reactos/drivers/usb/usbhub/fdo.c b/reactos/drivers/usb/usbhub/fdo.c index 05cb20ec072..ff56169ebdd 100644 --- a/reactos/drivers/usb/usbhub/fdo.c +++ b/reactos/drivers/usb/usbhub/fdo.c @@ -2062,6 +2062,7 @@ USBHUB_FdoHandleDeviceControl( 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 @@ USBHUB_FdoHandleDeviceControl( } break; } - // done Irp->IoStatus.Information = sizeof(USB_NODE_INFORMATION); Status = STATUS_SUCCESS; @@ -2188,7 +2188,7 @@ USBHUB_FdoHandleDeviceControl( 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 @@ USBHUB_FdoHandleDeviceControl( } } } + 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, diff --git a/reactos/drivers/usb/usbhub/usbhub.c b/reactos/drivers/usb/usbhub/usbhub.c index 5e14a97d984..f34c4e44157 100644 --- a/reactos/drivers/usb/usbhub/usbhub.c +++ b/reactos/drivers/usb/usbhub/usbhub.c @@ -184,8 +184,39 @@ USBHUB_DispatchPower( PDEVICE_OBJECT DeviceObject, PIRP Irp) { + 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_NOT_SUPPORTED; + return STATUS_SUCCESS; } VOID