[usb/usbhub]

- Start rewrite of usbhub driver using the old and dead usbhub driver in trunk.
- Implement QueryRootHub for sending USB request to miniport driver.
- Implement new IRP_MN_START_DEVICE.  
Get the roothubs PDO and FDO and forward the start device down to start the PDO.
Get USBDI and HUB interfaces. Set all ports as returned by DCI GetExtendedHubInformation to powered and reset.
- Temporary add some usb specific defines until header is fixed.
- Fix Formatting.



svn path=/trunk/; revision=48705
This commit is contained in:
Michael Martin 2010-09-05 19:00:37 +00:00
parent 639f26f1b5
commit 74d5088c7d
6 changed files with 851 additions and 796 deletions

View file

@ -4,21 +4,105 @@
* FILE: drivers/usb/cromwell/hub/fdo.c
* PURPOSE: IRP_MJ_PNP operations for FDOs
*
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.com)
* PROGRAMMERS: Herv<EFBFBD> Poussineau (hpoussin@reactos.com)
* Michael Martin (michael.martin@reactos.org)
*/
#define INITGUID
#include <stdio.h>
#define NDEBUG
#include "usbhub.h"
#include "usbdlib.h"
#define IO_METHOD_FROM_CTL_CODE(ctlCode) (ctlCode&0x00000003)
NTSTATUS
QueryRootHub(IN PDEVICE_OBJECT Pdo, IN ULONG IoControlCode, OUT PVOID OutParameter1, OUT PVOID OutParameter2)
{
KEVENT Event;
PIRP Irp;
IO_STATUS_BLOCK IoStatus;
NTSTATUS Status;
PIO_STACK_LOCATION Stack = NULL;
KeInitializeEvent(&Event, NotificationEvent, FALSE);
Irp = IoBuildDeviceIoControlRequest(IoControlCode,
Pdo,
NULL, 0,
NULL, 0,
TRUE,
&Event,
&IoStatus);
if (Irp == NULL)
{
DPRINT("Usbhub: IoBuildDeviceIoControlRequest() failed\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
/* Initialize the status block before sending the IRP */
IoStatus.Status = STATUS_NOT_SUPPORTED;
IoStatus.Information = 0;
Stack = IoGetNextIrpStackLocation(Irp);
Stack->Parameters.Others.Argument1 = OutParameter1;
Stack->Parameters.Others.Argument2 = OutParameter2;
Status = IoCallDriver(Pdo, Irp);
if (Status == STATUS_PENDING)
{
DPRINT("Usbhub: Operation pending\n");
KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
Status = IoStatus.Status;
}
return Status;
}
NTSTATUS QueryInterface(IN PDEVICE_OBJECT Pdo, IN CONST GUID InterfaceType, IN LONG Size, IN LONG Version, OUT PVOID Interface)
{
KEVENT Event;
PIRP Irp;
IO_STATUS_BLOCK IoStatus;
NTSTATUS Status;
PIO_STACK_LOCATION Stack = NULL;
KeInitializeEvent(&Event, NotificationEvent, FALSE);
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP,
Pdo,
NULL,
0,
NULL,
&Event,
&IoStatus);
Stack = IoGetNextIrpStackLocation(Irp);
Stack->MinorFunction = IRP_MN_QUERY_INTERFACE;
Stack->Parameters.QueryInterface.InterfaceType= &InterfaceType;//USB_BUS_INTERFACE_HUB_GUID;
Stack->Parameters.QueryInterface.Size = Size;
Stack->Parameters.QueryInterface.Version = Version;
Stack->Parameters.QueryInterface.Interface = Interface;
Stack->Parameters.QueryInterface.InterfaceSpecificData = NULL;
Status = IoCallDriver(Pdo, Irp);
if (Status == STATUS_PENDING)
{
DPRINT("Usbhub: Operation pending\n");
KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
Status = IoStatus.Status;
}
return Status;
}
static VOID
UsbhubGetUserBuffers(
IN PIRP Irp,
IN ULONG IoControlCode,
OUT PVOID* BufferIn,
OUT PVOID* BufferOut)
UsbhubGetUserBuffers(IN PIRP Irp, IN ULONG IoControlCode, OUT PVOID* BufferIn, OUT PVOID* BufferOut)
{
ASSERT(Irp);
ASSERT(BufferIn);
@ -46,147 +130,36 @@ UsbhubGetUserBuffers(
}
}
static NTSTATUS
UsbhubFdoQueryBusRelations(
IN PDEVICE_OBJECT DeviceObject,
OUT PDEVICE_RELATIONS* pDeviceRelations)
NTSTATUS
UsbhubFdoQueryBusRelations(IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_RELATIONS* pDeviceRelations)
{
PHUB_DEVICE_EXTENSION DeviceExtension;
PDEVICE_RELATIONS DeviceRelations;
PDEVICE_OBJECT Pdo;
PHUB_DEVICE_EXTENSION PdoExtension;
struct usb_device* dev;
ULONG i;
ULONG Children = 0;
ULONG NeededSize;
NTSTATUS Status;
CHAR Buffer[3][40];
DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
dev = DeviceExtension->dev;
DPRINT1("USBHUB: Query Bus Relations\n");
/* Create PDOs that are missing */
for (i = 0; i < dev->maxchild; i++)
for (i = 0; i < USB_MAXCHILDREN; i++)
{
if (dev->children[i] == NULL)
if (DeviceExtension->Children[i] == NULL)
{
/* No child device at this place */
continue;
}
Children++;
if (DeviceExtension->Children[i] != NULL)
{
/* PDO already exists */
continue;
}
/* Need to create the PDO */
Status = IoCreateDevice(
DeviceObject->DriverObject,
sizeof(HUB_DEVICE_EXTENSION),
NULL, /* Device name */
FILE_DEVICE_CONTROLLER,
FILE_AUTOGENERATED_DEVICE_NAME,
FALSE,
&DeviceExtension->Children[i]);
if (!NT_SUCCESS(Status))
{
DPRINT("Usbhub: IoCreateDevice() failed with status 0x%08lx\n", Status);
return Status;
}
Pdo = DeviceExtension->Children[i];
Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE;
PdoExtension = Pdo->DeviceExtension;
RtlZeroMemory(PdoExtension, sizeof(HUB_DEVICE_EXTENSION));
PdoExtension->IsFDO = FALSE;
PdoExtension->dev = dev->children[i];
sprintf(Buffer[0], "%lu", i);
Status = UsbhubInitMultiSzString(
&PdoExtension->InstanceId,
Buffer[0], NULL);
if (!NT_SUCCESS(Status))
goto ByeBye;
DPRINT1("child #%lu: USB\\Vid_%04x&Pid_%04x&Rev_%04x\n",
i,
PdoExtension->dev->descriptor.idVendor,
PdoExtension->dev->descriptor.idProduct,
PdoExtension->dev->descriptor.bcdDevice);
sprintf(Buffer[0], "USB\\Vid_%04x&Pid_%04x&Rev_%04x",
PdoExtension->dev->descriptor.idVendor,
PdoExtension->dev->descriptor.idProduct,
PdoExtension->dev->descriptor.bcdDevice);
sprintf(Buffer[1], "USB\\Vid_%04x&Pid_%04x",
PdoExtension->dev->descriptor.idVendor,
PdoExtension->dev->descriptor.idProduct);
Status = UsbhubInitMultiSzString(
&PdoExtension->HardwareIds,
Buffer[0], Buffer[1], NULL);
if (!NT_SUCCESS(Status))
goto ByeBye;
Status = UsbhubInitMultiSzString(
&PdoExtension->DeviceId,
Buffer[1], NULL);
if (!NT_SUCCESS(Status))
goto ByeBye;
if (PdoExtension->dev->actconfig->desc.bNumInterfaces == 1)
{
/* Single-interface USB device */
if (PdoExtension->dev->descriptor.bDeviceClass != 0)
{
/* Use these values for device class/sub class/protocol */
sprintf(Buffer[0], "USB\\Class_%02x&SubClass_%02x&Prot_%02x",
PdoExtension->dev->descriptor.bDeviceClass,
PdoExtension->dev->descriptor.bDeviceSubClass,
PdoExtension->dev->descriptor.bDeviceProtocol);
sprintf(Buffer[1], "USB\\Class_%02x&SubClass_%02x",
PdoExtension->dev->descriptor.bDeviceClass,
PdoExtension->dev->descriptor.bDeviceSubClass);
sprintf(Buffer[2], "USB\\Class_%02x",
PdoExtension->dev->descriptor.bDeviceClass);
}
else
{
/* Use values specified in the interface descriptor */
struct usb_host_interface *itf = PdoExtension->dev->actconfig->interface->altsetting;
sprintf(Buffer[0], "USB\\Class_%02x&SubClass_%02x&Prot_%02x",
itf->desc.bInterfaceClass,
itf->desc.bInterfaceSubClass,
itf->desc.bInterfaceProtocol);
sprintf(Buffer[1], "USB\\Class_%02x&SubClass_%02x",
itf->desc.bInterfaceClass,
itf->desc.bInterfaceSubClass);
sprintf(Buffer[2], "USB\\Class_%02x",
itf->desc.bInterfaceClass);
}
Status = UsbhubInitMultiSzString(
&PdoExtension->CompatibleIds,
Buffer[0], Buffer[1], Buffer[2], NULL);
}
else
{
/* Multiple-interface USB device */
sprintf(Buffer[0], "USB\\DevClass_%02x&SubClass_%02x&Prot_%02x",
PdoExtension->dev->descriptor.bDeviceClass,
PdoExtension->dev->descriptor.bDeviceSubClass,
PdoExtension->dev->descriptor.bDeviceProtocol);
sprintf(Buffer[1], "USB\\DevClass_%02x&SubClass_%02x",
PdoExtension->dev->descriptor.bDeviceClass,
PdoExtension->dev->descriptor.bDeviceSubClass);
sprintf(Buffer[2], "USB\\DevClass_%02x",
PdoExtension->dev->descriptor.bDeviceClass);
Status = UsbhubInitMultiSzString(
&PdoExtension->CompatibleIds,
Buffer[0], Buffer[1], Buffer[2], "USB\\COMPOSITE", NULL);
}
if (!NT_SUCCESS(Status))
goto ByeBye;
Pdo->Flags &= ~DO_DEVICE_INITIALIZING;
}
@ -195,13 +168,15 @@ UsbhubFdoQueryBusRelations(
NeededSize = sizeof(DEVICE_RELATIONS);
if (Children > 1)
NeededSize += (Children - 1) * sizeof(PDEVICE_OBJECT);
DeviceRelations = (PDEVICE_RELATIONS)ExAllocatePool(
PagedPool,
DeviceRelations = (PDEVICE_RELATIONS)ExAllocatePool(PagedPool,
NeededSize);
if (!DeviceRelations)
return STATUS_INSUFFICIENT_RESOURCES;
DeviceRelations->Count = Children;
Children = 0;
for (i = 0; i < USB_MAXCHILDREN; i++)
{
if (DeviceExtension->Children[i])
@ -214,35 +189,160 @@ UsbhubFdoQueryBusRelations(
*pDeviceRelations = DeviceRelations;
return STATUS_SUCCESS;
ByeBye:
RtlFreeUnicodeString(&PdoExtension->DeviceId);
RtlFreeUnicodeString(&PdoExtension->InstanceId);
RtlFreeUnicodeString(&PdoExtension->HardwareIds);
RtlFreeUnicodeString(&PdoExtension->CompatibleIds);
IoDeleteDevice(Pdo);
return Status;
}
NTSTATUS NTAPI
UsbhubPnpFdo(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
UsbhubPnpFdo(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
{
PIO_STACK_LOCATION IrpSp;
NTSTATUS Status;
ULONG MinorFunction;
ULONG_PTR Information = 0;
PHUB_DEVICE_EXTENSION DeviceExtension;
IrpSp = IoGetCurrentIrpStackLocation(Irp);
MinorFunction = IrpSp->MinorFunction;
DeviceExtension = (PHUB_DEVICE_EXTENSION) DeviceObject->DeviceExtension;
switch (MinorFunction)
{
case IRP_MN_START_DEVICE: /* 0x0 */
{
URB Urb;
ULONG Result = 0;
USB_DEVICE_INFORMATION_0 DeviceInformation;
/* We differ from windows on hubpdo because we dont have usbport.sys which manages all usb device objects */
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
Status = ForwardIrpAndWait(DeviceObject, Irp);
/* Get the hubs PDO */
QueryRootHub(DeviceObject, IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO, &DeviceExtension->RootHubPdo, &DeviceExtension->RootHubFdo);
ASSERT(DeviceExtension->RootHubPdo);
ASSERT(DeviceExtension->RootHubFdo);
/* Send the START_DEVICE irp down to the PDO of RootHub */
Status = ForwardIrpAndWait(DeviceExtension->RootHubPdo, Irp);
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to start the RootHub PDO\n");
ASSERT(FALSE);
}
/* Get the current number of hubs */
QueryRootHub(DeviceObject,IOCTL_INTERNAL_USB_GET_HUB_COUNT, &DeviceExtension->HubCount, NULL);
/* Get the Direct Call Interfaces */
Status = QueryInterface(DeviceObject, USB_BUS_INTERFACE_HUB_GUID, sizeof(USB_BUS_INTERFACE_HUB_V5), 5, (PVOID)&DeviceExtension->HubInterface);
if (!NT_SUCCESS(Status))
{
DPRINT1("UsbhubM Failed to get HUB_GUID interface with status 0x%08lx\n", Status);
return STATUS_UNSUCCESSFUL;
}
Status = QueryInterface(DeviceObject, USB_BUS_INTERFACE_USBDI_GUID, sizeof(USB_BUS_INTERFACE_USBDI_V2), 2, (PVOID)&DeviceExtension->UsbDInterface);
if (!NT_SUCCESS(Status))
{
DPRINT1("UsbhubM Failed to get USBDI_GUID interface with status 0x%08lx\n", Status);
return STATUS_UNSUCCESSFUL;
}
/* Get roothub device handle */
Status = QueryRootHub(DeviceObject, IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE, &DeviceExtension->RootHubUsbDevice, NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("Usbhub: GetRootHubDeviceHandle failed with status 0x%08lx\n", Status);
return Status;
}
RtlZeroMemory(&DeviceInformation, sizeof(USB_DEVICE_INFORMATION_0));
Status = DeviceExtension->HubInterface.QueryDeviceInformation(DeviceExtension->RootHubPdo,
DeviceExtension->RootHubUsbDevice,
&DeviceInformation,
sizeof(USB_DEVICE_INFORMATION_0),
&Result);
DPRINT1("Status %x, Result %x\n", Status, Result);
DPRINT1("InformationLevel %x\n", DeviceInformation.InformationLevel);
DPRINT1("ActualLength %x\n", DeviceInformation.ActualLength);
DPRINT1("PortNumber %x\n", DeviceInformation.PortNumber);
DPRINT1("DeviceDescriptor %x\n", DeviceInformation.DeviceDescriptor);
DPRINT1("HubAddress %x\n", DeviceInformation.HubAddress);
DPRINT1("NumberofPipes %x\n", DeviceInformation.NumberOfOpenPipes);
UsbBuildGetDescriptorRequest(&Urb,
sizeof(Urb.UrbControlDescriptorRequest),
USB_DEVICE_DESCRIPTOR_TYPE,
0,
0,
&DeviceExtension->HubDeviceDescriptor,
NULL,
sizeof(USB_DEVICE_DESCRIPTOR),
NULL);
Urb.UrbHeader.UsbdDeviceHandle = DeviceExtension->RootHubUsbDevice;
Status = QueryRootHub(DeviceObject, IOCTL_INTERNAL_USB_SUBMIT_URB, &Urb, NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("Usbhub: Failed to get HubDeviceDescriptor!\n");
}
UsbBuildGetDescriptorRequest(&Urb,
sizeof(Urb.UrbControlDescriptorRequest),
USB_CONFIGURATION_DESCRIPTOR_TYPE,
0,
0,
&DeviceExtension->HubConfig,
NULL,
sizeof(USB_CONFIGURATION_DESCRIPTOR),
NULL);
Urb.UrbHeader.UsbdDeviceHandle = DeviceExtension->RootHubUsbDevice;
Status = QueryRootHub(DeviceObject, IOCTL_INTERNAL_USB_SUBMIT_URB, &Urb, NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("Usbhub: Failed to get HubConfig!\n");
}
Status = DeviceExtension->HubInterface.GetExtendedHubInformation(DeviceExtension->RootHubPdo,
DeviceExtension->RootHubPdo,
&DeviceExtension->UsbExtHubInfo,
sizeof(USB_EXTHUB_INFORMATION_0),
&Result);
if (!NT_SUCCESS(Status))
{
DPRINT1("Usbhub: Failed to extended hub information. Unable to determine the number of ports!\n");
ASSERT(FALSE);
}
DPRINT1("DeviceExtension->UsbExtHubInfo.NumberOfPorts %x\n", DeviceExtension->UsbExtHubInfo.NumberOfPorts);
/* FIXME: HubDescriptor is empty and shouldnt be but Status is success */
UsbBuildVendorRequest(&Urb,
URB_FUNCTION_CLASS_DEVICE,
sizeof(Urb.UrbControlVendorClassRequest),
USBD_TRANSFER_DIRECTION_IN,
0,
USB_DEVICE_CLASS_RESERVED,
0,
0,
&DeviceExtension->HubDescriptor,
NULL,
sizeof(USB_HUB_DESCRIPTOR),
NULL);
Urb.UrbHeader.UsbdDeviceHandle = DeviceExtension->RootHubUsbDevice;
Status = QueryRootHub(DeviceObject, IOCTL_INTERNAL_USB_SUBMIT_URB, &Urb, NULL);
DPRINT1("bDescriptorType %x\n", DeviceExtension->HubDescriptor.bDescriptorType);
Status = DeviceExtension->HubInterface.Initialize20Hub(DeviceExtension->RootHubPdo, DeviceExtension->RootHubUsbDevice, 1);
break;
}
@ -253,8 +353,10 @@ UsbhubPnpFdo(
case BusRelations:
{
PDEVICE_RELATIONS DeviceRelations = NULL;
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
Status = UsbhubFdoQueryBusRelations(DeviceObject, &DeviceRelations);
Information = (ULONG_PTR)DeviceRelations;
break;
}
@ -270,6 +372,26 @@ UsbhubPnpFdo(
}
break;
}
case IRP_MN_QUERY_BUS_INFORMATION:
{
DPRINT1("IRP_MN_QUERY_BUS_INFORMATION\n");
break;
}
case IRP_MN_QUERY_ID:
{
DPRINT1("IRP_MN_QUERY_ID\n");
break;
}
case IRP_MN_QUERY_CAPABILITIES:
{
DPRINT1("IRP_MN_QUERY_CAPABILITIES\n");
break;
}
default:
{
@ -284,9 +406,7 @@ UsbhubPnpFdo(
}
NTSTATUS
UsbhubDeviceControlFdo(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
UsbhubDeviceControlFdo(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
{
PIO_STACK_LOCATION Stack;
ULONG IoControlCode;
@ -294,7 +414,7 @@ UsbhubDeviceControlFdo(
ULONG LengthIn, LengthOut;
ULONG_PTR Information = 0;
PVOID BufferIn, BufferOut;
NTSTATUS Status;
NTSTATUS Status = STATUS_UNSUCCESSFUL;
Stack = IoGetCurrentIrpStackLocation(Irp);
LengthIn = Stack->Parameters.DeviceIoControl.InputBufferLength;
@ -307,16 +427,16 @@ UsbhubDeviceControlFdo(
{
case IOCTL_USB_GET_NODE_INFORMATION:
{
PUSB_NODE_INFORMATION NodeInformation;
struct usb_device* dev;
DPRINT("Usbhub: IOCTL_USB_GET_NODE_INFORMATION\n");
//PUSB_NODE_INFORMATION NodeInformation;
DPRINT1("Usbhub: IOCTL_USB_GET_NODE_INFORMATION\n");
if (LengthOut < sizeof(USB_NODE_INFORMATION))
Status = STATUS_BUFFER_TOO_SMALL;
else if (BufferOut == NULL)
Status = STATUS_INVALID_PARAMETER;
else
{
NodeInformation = (PUSB_NODE_INFORMATION)BufferOut;
/*NodeInformation = (PUSB_NODE_INFORMATION)BufferOut;
dev = ((PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->dev;
NodeInformation->NodeType = UsbHub;
RtlCopyMemory(
@ -324,7 +444,7 @@ UsbhubDeviceControlFdo(
((struct usb_hub *)usb_get_intfdata(to_usb_interface(&dev->actconfig->interface[0].dev)))->descriptor,
sizeof(USB_HUB_DESCRIPTOR));
NodeInformation->u.HubInformation.HubIsBusPowered = dev->actconfig->desc.bmAttributes & 0x80;
Information = sizeof(USB_NODE_INFORMATION);
Information = sizeof(USB_NODE_INFORMATION);*/
Status = STATUS_SUCCESS;
}
break;
@ -336,7 +456,7 @@ UsbhubDeviceControlFdo(
DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
ConnectionName = (PUSB_NODE_CONNECTION_NAME)BufferOut;
DPRINT("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_NAME\n");
DPRINT1("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_NAME\n");
if (LengthOut < sizeof(USB_NODE_CONNECTION_NAME))
Status = STATUS_BUFFER_TOO_SMALL;
else if (BufferOut == NULL)
@ -366,7 +486,7 @@ UsbhubDeviceControlFdo(
DeviceExtension->SymbolicLinkName.Buffer,
DeviceExtension->SymbolicLinkName.Length);
ConnectionName->NodeName[DeviceExtension->SymbolicLinkName.Length / sizeof(WCHAR)] = UNICODE_NULL;
DPRINT("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_NAME returns '%S'\n", ConnectionName->NodeName);
DPRINT1("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_NAME returns '%S'\n", ConnectionName->NodeName);
ConnectionName->ActualLength = NeededStructureSize / sizeof(WCHAR);
Information = NeededStructureSize;
Status = STATUS_SUCCESS;
@ -378,13 +498,15 @@ UsbhubDeviceControlFdo(
case IOCTL_USB_GET_NODE_CONNECTION_INFORMATION:
{
PUSB_NODE_CONNECTION_INFORMATION ConnectionInformation;
/*
ULONG i, j, k;
struct usb_device* dev;
ULONG NumberOfOpenPipes = 0;
ULONG SizeOfOpenPipesArray;
*/
ConnectionInformation = (PUSB_NODE_CONNECTION_INFORMATION)BufferOut;
DPRINT("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_INFORMATION\n");
DPRINT1("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_INFORMATION\n");
if (LengthOut < sizeof(USB_NODE_CONNECTION_INFORMATION))
Status = STATUS_BUFFER_TOO_SMALL;
else if (BufferOut == NULL)
@ -394,61 +516,14 @@ UsbhubDeviceControlFdo(
Status = STATUS_INVALID_PARAMETER;
else
{
dev = ((PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->dev;
dev = dev->children[ConnectionInformation->ConnectionIndex - 1];
if (dev == NULL)
{
/* No device connected to this port */
RtlZeroMemory(
&ConnectionInformation->DeviceDescriptor,
sizeof(USB_NODE_CONNECTION_INFORMATION) - FIELD_OFFSET(USB_NODE_CONNECTION_INFORMATION, DeviceDescriptor));
ConnectionInformation->ConnectionStatus = NoDeviceConnected;
Information = sizeof(USB_NODE_CONNECTION_INFORMATION);
Status = STATUS_SUCCESS;
break;
}
SizeOfOpenPipesArray = (LengthOut - FIELD_OFFSET(USB_NODE_CONNECTION_INFORMATION, PipeList)) / sizeof(USB_PIPE_INFO);
RtlCopyMemory(
&ConnectionInformation->DeviceDescriptor,
&dev->descriptor,
sizeof(USB_DEVICE_DESCRIPTOR));
ConnectionInformation->CurrentConfigurationValue = dev->actconfig->desc.bConfigurationValue;
ConnectionInformation->LowSpeed = dev->speed == USB_SPEED_LOW || dev->speed == USB_SPEED_FULL;
ConnectionInformation->DeviceIsHub = dev->descriptor.bDeviceClass == USB_CLASS_HUB;
ConnectionInformation->DeviceAddress = dev->devnum;
ConnectionInformation->ConnectionStatus = DeviceConnected;
for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++)
for (j = 0; j < dev->actconfig->interface[i].num_altsetting; j++)
for (k = 0; k < dev->actconfig->interface[i].altsetting[j].desc.bNumEndpoints; k++)
{
if (NumberOfOpenPipes < SizeOfOpenPipesArray)
{
PUSB_PIPE_INFO Pipe = &ConnectionInformation->PipeList[NumberOfOpenPipes];
struct usb_host_endpoint* endpoint = &dev->actconfig->interface[i].altsetting[j].endpoint[k];
RtlCopyMemory(
&Pipe->EndpointDescriptor,
&endpoint->desc,
endpoint->desc.bLength);
Pipe->ScheduleOffset = 0; /* FIXME */
}
NumberOfOpenPipes++;
}
ConnectionInformation->NumberOfOpenPipes = NumberOfOpenPipes;
Information = sizeof(USB_NODE_CONNECTION_INFORMATION);
if (NumberOfOpenPipes <= SizeOfOpenPipesArray)
Status = STATUS_SUCCESS;
else
Status = STATUS_BUFFER_OVERFLOW;
DPRINT1("Usbhub: We should succeed\n");
}
break;
}
case IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION:
{
//PUSB_DESCRIPTOR_REQUEST Descriptor;
DPRINT("Usbhub: IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION\n");
DPRINT1("Usbhub: IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION unimplemented\n");
DPRINT1("Usbhub: IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION\n");
Information = 0;
Status = STATUS_NOT_IMPLEMENTED;
break;
@ -457,7 +532,7 @@ UsbhubDeviceControlFdo(
{
PHUB_DEVICE_EXTENSION DeviceExtension;
PUSB_NODE_CONNECTION_DRIVERKEY_NAME StringDescriptor;
DPRINT("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME\n");
DPRINT1("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME\n");
DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
StringDescriptor = (PUSB_NODE_CONNECTION_DRIVERKEY_NAME)BufferOut;
if (LengthOut < sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME))

View file

@ -4,7 +4,7 @@
* FILE: drivers/usb/cromwell/hub/misc.c
* PURPOSE: Misceallenous operations
*
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.com),
* PROGRAMMERS: Herv<EFBFBD> Poussineau (hpoussin@reactos.com),
*/
#define NDEBUG
@ -27,19 +27,15 @@ ForwardIrpAndWait(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PDEVICE_OBJECT LowerDevice = ((PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
KEVENT Event;
NTSTATUS Status;
ASSERT(LowerDevice);
KeInitializeEvent(&Event, NotificationEvent, FALSE);
IoCopyCurrentIrpStackLocationToNext(Irp);
DPRINT("UHCI: Calling lower device %p [%wZ]\n", LowerDevice, &LowerDevice->DriverObject->DriverName);
IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
Status = IoCallDriver(LowerDevice, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
Status = KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);

View file

@ -5,6 +5,7 @@
* PURPOSE: IRP_MJ_PNP operations for PDOs
*
* PROGRAMMERS: Copyright 2005-2006 Hervé Poussineau (hpoussin@reactos.org)
* 2010 Michael Martin (michael.martin@reactos.org)
*/
#define NDEBUG
@ -22,7 +23,7 @@ UsbhubInternalDeviceControlPdo(
ULONG_PTR Information = 0;
NTSTATUS Status;
DPRINT("Usbhub: UsbhubInternalDeviceControlPdo() called\n");
DPRINT1("Usbhub: UsbhubInternalDeviceControlPdo() called\n");
Stack = IoGetCurrentIrpStackLocation(Irp);
Status = Irp->IoStatus.Status;
@ -33,7 +34,7 @@ UsbhubInternalDeviceControlPdo(
{
PHUB_DEVICE_EXTENSION DeviceExtension;
DPRINT("Usbhub: IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO\n");
DPRINT1("Usbhub: IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO\n");
if (Irp->AssociatedIrp.SystemBuffer == NULL
|| Stack->Parameters.DeviceIoControl.OutputBufferLength != sizeof(PVOID))
{
@ -71,28 +72,30 @@ UsbhubPdoStartDevice(
IN PIRP Irp)
{
PHUB_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;
NTSTATUS Status = STATUS_UNSUCCESSFUL;
DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
/* Register and activate device interface */
/*
Status = IoRegisterDeviceInterface(
DeviceObject,
DeviceExtension->dev->descriptor.bDeviceClass == USB_CLASS_HUB ?
&GUID_DEVINTERFACE_USB_HUB :
&GUID_DEVINTERFACE_USB_DEVICE,
NULL, /* Reference string */
NULL,
&DeviceExtension->SymbolicLinkName);
*/
if (!NT_SUCCESS(Status))
{
DPRINT("Usbhub: IoRegisterDeviceInterface() failed with status 0x%08lx\n", Status);
DPRINT1("Usbhub: IoRegisterDeviceInterface() failed with status 0x%08lx\n", Status);
return Status;
}
Status = IoSetDeviceInterfaceState(&DeviceExtension->SymbolicLinkName, TRUE);
//Status = IoSetDeviceInterfaceState(&DeviceExtension->SymbolicLinkName, TRUE);
if (!NT_SUCCESS(Status))
{
DPRINT("Usbhub: IoSetDeviceInterfaceState() failed with status 0x%08lx\n", Status);
DPRINT1("Usbhub: IoSetDeviceInterfaceState() failed with status 0x%08lx\n", Status);
return Status;
}
@ -119,25 +122,25 @@ UsbhubPdoQueryId(
{
case BusQueryDeviceID:
{
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryDeviceID\n");
DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryDeviceID\n");
SourceString = &DeviceExtension->DeviceId;
break;
}
case BusQueryHardwareIDs:
{
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n");
DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n");
SourceString = &DeviceExtension->HardwareIds;
break;
}
case BusQueryCompatibleIDs:
{
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs\n");
DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs\n");
SourceString = &DeviceExtension->CompatibleIds;
break;
}
case BusQueryInstanceID:
{
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n");
DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n");
SourceString = &DeviceExtension->InstanceId;
break;
}
@ -167,57 +170,20 @@ UsbhubPdoQueryDeviceText(
DeviceTextType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryDeviceText.DeviceTextType;
LocaleId = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryDeviceText.LocaleId;
DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
DPRINT1("Usbhub: UsbhubPdoQueryDeviceText\n");
switch (DeviceTextType)
{
case DeviceTextDescription:
case DeviceTextLocationInformation:
{
unsigned short size;
int ret;
PWCHAR buf;
PWCHAR bufret;
if (DeviceTextType == DeviceTextDescription)
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextDescription\n");
DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextDescription\n");
else
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextLocationInformation\n");
DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextLocationInformation\n");
if (!DeviceExtension->dev->descriptor.iProduct)
return STATUS_NOT_SUPPORTED;
/* if (!DeviceExtension->dev->descriptor.iProduct)
return STATUS_NOT_SUPPORTED;*/
ret = usb_get_string(DeviceExtension->dev, LocaleId, DeviceExtension->dev->descriptor.iProduct, &size, sizeof(size));
if (ret < 2)
{
DPRINT("Usbhub: usb_get_string() failed with error %d\n", ret);
return STATUS_IO_DEVICE_ERROR;
}
size &= 0xff;
buf = ExAllocatePool(PagedPool, size);
if (buf == NULL)
{
DPRINT("Usbhub: ExAllocatePool() failed\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
ret = usb_get_string(DeviceExtension->dev, LocaleId, DeviceExtension->dev->descriptor.iProduct, buf, size);
if (ret < 0)
{
DPRINT("Usbhub: usb_get_string() failed with error %d\n", ret);
ExFreePool(buf);
return STATUS_IO_DEVICE_ERROR;
}
bufret = ExAllocatePool(PagedPool, size - 2 /* size of length identifier */ + 2 /* final NULL */);
if (bufret == NULL)
{
DPRINT("Usbhub: ExAllocatePool() failed\n");
ExFreePool(buf);
return STATUS_INSUFFICIENT_RESOURCES;
}
RtlCopyMemory(bufret, &buf[1], size - 2);
bufret[(size - 1) / sizeof(WCHAR)] = 0;
*Information = (ULONG_PTR)bufret;
ExFreePool(buf);
return STATUS_SUCCESS;
}
default:
@ -243,7 +209,7 @@ UsbhubPnpPdo(
{
case IRP_MN_START_DEVICE: /* 0x0 */
{
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
Status = UsbhubPdoStartDevice(DeviceObject, Irp);
break;
}
@ -251,7 +217,7 @@ UsbhubPnpPdo(
{
PDEVICE_CAPABILITIES DeviceCapabilities;
ULONG i;
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n");
DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n");
DeviceCapabilities = (PDEVICE_CAPABILITIES)Stack->Parameters.DeviceCapabilities.Capabilities;
/* FIXME: capabilities can change with connected device */
@ -279,11 +245,11 @@ UsbhubPnpPdo(
{
PCM_RESOURCE_LIST ResourceList;
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES\n");
DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES\n");
ResourceList = ExAllocatePool(PagedPool, sizeof(CM_RESOURCE_LIST));
if (!ResourceList)
{
DPRINT("Usbhub: ExAllocatePool() failed\n");
DPRINT1("Usbhub: ExAllocatePool() failed\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
}
else
@ -298,11 +264,11 @@ UsbhubPnpPdo(
{
PIO_RESOURCE_REQUIREMENTS_LIST ResourceList;
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n");
DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n");
ResourceList = ExAllocatePool(PagedPool, sizeof(IO_RESOURCE_REQUIREMENTS_LIST));
if (!ResourceList)
{
DPRINT("Usbhub: ExAllocatePool() failed\n");
DPRINT1("Usbhub: ExAllocatePool() failed\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
}
else

View file

@ -2,7 +2,8 @@
* ReactOS USB hub driver
* Copyright (C) 2004 Aleksey Bragin
* (C) 2005 Mark Tempel
* (C) 2005 Hervé Poussineau
* (C) 2005 Herv<EFBFBD> Poussineau
* (C) 2010 Michael Martin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -26,48 +27,6 @@
/* PUBLIC AND PRIVATE FUNCTIONS ***********************************************/
static NTSTATUS
GetRootHubPointer(
IN PDEVICE_OBJECT Pdo,
OUT PVOID* RootHubPointer)
{
KEVENT Event;
PIRP Irp;
IO_STATUS_BLOCK IoStatus;
NTSTATUS Status;
KeInitializeEvent (&Event, NotificationEvent, FALSE);
Irp = IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO,
Pdo,
NULL, sizeof(NULL),
RootHubPointer, sizeof(*RootHubPointer),
FALSE,
&Event,
&IoStatus);
if (Irp == NULL)
{
DPRINT("Usbhub: IoBuildDeviceIoControlRequest() failed\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
/* Initialize the status block before sending the IRP */
IoGetNextIrpStackLocation(Irp)->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;
IoStatus.Status = STATUS_NOT_SUPPORTED;
IoStatus.Information = 0;
Status = IoCallDriver(Pdo, Irp);
if (Status == STATUS_PENDING)
{
DPRINT("Usbhub: Operation pending\n");
KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
Status = IoStatus.Status;
}
return Status;
}
NTSTATUS NTAPI
UsbhubAddDevice(
IN PDRIVER_OBJECT DriverObject,
@ -81,9 +40,10 @@ UsbhubAddDevice(
sizeof(HUB_DEVICE_EXTENSION),
NULL, /* DeviceName */
FILE_DEVICE_BUS_EXTENDER,
0,
FILE_AUTOGENERATED_DEVICE_NAME,
FALSE,
&Fdo);
if (!NT_SUCCESS(Status))
{
DPRINT1("Usbhub: IoCreateDevice() failed with status 0x%08lx\n", Status);
@ -94,18 +54,6 @@ UsbhubAddDevice(
DeviceExtension = (PHUB_DEVICE_EXTENSION)Fdo->DeviceExtension;
RtlZeroMemory(DeviceExtension, sizeof(HUB_DEVICE_EXTENSION));
/* Get a pointer to the linux structure created by the USB controller,
* by sending IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO to lower device.
*/
Status = GetRootHubPointer(Pdo, (PVOID*)&DeviceExtension->dev);
if (!NT_SUCCESS(Status))
{
DPRINT("Usbhub: GetRootHubPointer() failed with status 0x%08lx\n", Status);
IoDeleteDevice(Fdo);
return Status;
}
DeviceExtension->dev->dev.dev_ext = Pdo;
DeviceExtension->IsFDO = TRUE;
Fdo->Flags |= DO_POWER_PAGABLE;
Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice);
@ -116,6 +64,7 @@ UsbhubAddDevice(
return Status;
}
Fdo->Flags |= DO_BUFFERED_IO;
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
return STATUS_SUCCESS;
@ -132,9 +81,6 @@ IrpStub(
{
DPRINT1("Usbhub: FDO stub for major function 0x%lx\n",
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
#ifndef NDEBUG
DbgBreakPoint();
#endif
return ForwardIrpAndForget(DeviceObject, Irp);
}
else
@ -157,6 +103,7 @@ IrpStub(
static NTSTATUS NTAPI
DispatchDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
DPRINT1("Usbhub: DispatchDeviceControl\n");
if (((PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
return UsbhubDeviceControlFdo(DeviceObject, Irp);
else
@ -166,6 +113,7 @@ DispatchDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
static NTSTATUS NTAPI
DispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
DPRINT1("Usbhub: DispatchInternalDeviceControl\n");
if (((PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
return IrpStub(DeviceObject, Irp);
else
@ -175,6 +123,7 @@ DispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
static NTSTATUS NTAPI
DispatchPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
DPRINT1("Usbhub: DispatchPnp\n");
if (((PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
return UsbhubPnpFdo(DeviceObject, Irp);
else
@ -192,6 +141,7 @@ DriverEntry(
ULONG i;
DriverObject->DriverExtension->AddDevice = UsbhubAddDevice;
DPRINT1("Usbhub: DriverEntry\n");
for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++)
DriverObject->MajorFunction[i] = IrpStub;

View file

@ -1,21 +1,92 @@
#include <debug.h>
#include <ntddk.h>
#include <hubbusif.h>
#include <usbbusif.h>
#include <usbioctl.h>
#include "../miniport/usb_wrapper.h"
#include "../usbport/hub.h"
#include <usb.h>
#include <debug.h>
//BROKEN: #include <usbprotocoldefs.h>
#define USB_HUB_TAG 'hbsu'
#define USB_MAXCHILDREN 127
/* Lifted from broken header above */
#define C_HUB_LOCAL_POWER 0
#define C_HUB_OVER_CURRENT 1
#define PORT_CONNECTION 0
#define PORT_ENABLE 1
#define PORT_SUSPEND 2
#define PORT_OVER_CURRENT 3
#define PORT_RESET 4
#define PORT_POWER 8
#define PORT_LOW_SPEED 9
#define C_PORT_CONNECTION 16
#define C_PORT_ENABLE 17
#define C_PORT_SUSPEND 18
#define C_PORT_OVER_CURRENT 19
#define C_PORT_RESET 20
#define PORT_TEST 21
#define PORT_INDICATOR 22
typedef struct _USB_ENDPOINT
{
ULONG Flags;
LIST_ENTRY UrbList;
struct _USB_INTERFACE *Interface;
USB_ENDPOINT_DESCRIPTOR EndPointDescriptor;
} USB_ENDPOINT, *PUSB_ENDPOINT;
typedef struct _USB_INTERFACE
{
struct _USB_CONFIGURATION *Config;
USB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
USB_ENDPOINT *EndPoints[];
} USB_INTERFACE, *PUSB_INTERFACE;
typedef struct _USB_CONFIGURATION
{
struct _USB_DEVICE *Device;
USB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor;
USB_INTERFACE *Interfaces[];
} USB_CONFIGURATION, *PUSB_CONFIGURATION;
typedef struct _USB_DEVICE
{
UCHAR Address;
ULONG Port;
PVOID ParentDevice;
BOOLEAN IsHub;
USB_DEVICE_SPEED DeviceSpeed;
USB_DEVICE_TYPE DeviceType;
USB_DEVICE_DESCRIPTOR DeviceDescriptor;
USB_CONFIGURATION *ActiveConfig;
USB_INTERFACE *ActiveInterface;
USB_CONFIGURATION **Configs;
} USB_DEVICE, *PUSB_DEVICE;
typedef struct _HUB_DEVICE_EXTENSION
{
BOOLEAN IsFDO;
struct usb_device* dev;
USB_DEVICE* dev;
PDEVICE_OBJECT LowerDevice;
ULONG ChildCount;
PDEVICE_OBJECT Children[USB_MAXCHILDREN];
PUSB_DEVICE RootHubUsbDevice;
PDEVICE_OBJECT RootHubPdo;
PDEVICE_OBJECT RootHubFdo;
ULONG HubCount;
USB_BUS_INTERFACE_HUB_V5 HubInterface;
USB_BUS_INTERFACE_USBDI_V2 UsbDInterface;
USB_HUB_DESCRIPTOR HubDescriptor;
USB_DEVICE_DESCRIPTOR HubDeviceDescriptor;
USB_CONFIGURATION_DESCRIPTOR HubConfig;
USB_EXTHUB_INFORMATION_0 UsbExtHubInfo;
/* Fields valid only when IsFDO == FALSE */
UNICODE_STRING DeviceId; // REG_SZ
UNICODE_STRING InstanceId; // REG_SZ

View file

@ -1,11 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="usbhub" type="kernelmodedriver" installbase="system32/drivers" installname="usbhub.sys">
<include>../miniport/linux</include>
<library>sys_base</library>
<library>ntoskrnl</library>
<library>hal</library>
<library>usbport</library>
<file>createclose.c</file>
<file>fdo.c</file>
<file>misc.c</file>