mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
Allow more than one USB controller (was a XBOX hack no more needed)
Implement IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_TEXT for Root USB hub/USB devices Add missing initialization which lead to BSOD when connecting a device to a UHCI controller svn path=/trunk/; revision=19003
This commit is contained in:
@@ -199,16 +199,6 @@ AddDevice(
|
||||
PUSBMP_DEVICE_EXTENSION DeviceExtension;
|
||||
ULONG DeviceNumber;
|
||||
|
||||
/* FIXME: actually, we prevent multiple USB controllers on a computer */
|
||||
static BOOLEAN xbox_workaround = FALSE;
|
||||
|
||||
DPRINT("USBMP: AddDevice called\n");
|
||||
|
||||
if (xbox_workaround)
|
||||
// Fail for any other host controller than the first
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
xbox_workaround = TRUE;
|
||||
|
||||
// Allocate driver extension now
|
||||
DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
|
||||
if (DriverExtension == NULL)
|
||||
|
||||
@@ -286,37 +286,20 @@ UsbMpPnpPdo(
|
||||
Status = Irp->IoStatus.Status;
|
||||
break;
|
||||
}
|
||||
#if 0 /* FIXME */
|
||||
case IRP_MN_QUERY_DEVICE_TEXT: /* 0x0c */
|
||||
{
|
||||
switch (Stack->Parameters.QueryDeviceText.DeviceTextType)
|
||||
{
|
||||
case DeviceTextDescription:
|
||||
{
|
||||
ULONG DescriptionSize;
|
||||
PWSTR Description;
|
||||
UNICODE_STRING SourceString = RTL_CONSTANT_STRING(L"Root USB hub");
|
||||
UNICODE_STRING Description;
|
||||
|
||||
DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextDescription\n");
|
||||
|
||||
Status = IoGetDeviceProperty(
|
||||
DeviceObject,
|
||||
DevicePropertyDeviceDescription,
|
||||
0, NULL,
|
||||
&DescriptionSize);
|
||||
if (Status == STATUS_BUFFER_TOO_SMALL)
|
||||
{
|
||||
Description = ExAllocatePool(PagedPool, DescriptionSize);
|
||||
if (!Description)
|
||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
else
|
||||
{
|
||||
Status = IoGetDeviceProperty(
|
||||
DeviceObject,
|
||||
DevicePropertyDeviceDescription,
|
||||
DescriptionSize, Description,
|
||||
&DescriptionSize);
|
||||
Information = DescriptionSize;
|
||||
}
|
||||
}
|
||||
Status = RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, &SourceString, &Description);
|
||||
if (NT_SUCCESS(Status))
|
||||
Information = (ULONG_PTR)Description.Buffer;
|
||||
break;
|
||||
}
|
||||
case DeviceTextLocationInformation:
|
||||
@@ -337,7 +320,6 @@ UsbMpPnpPdo(
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case IRP_MN_QUERY_ID: /* 0x13 */
|
||||
{
|
||||
Status = UsbMpPdoQueryId(DeviceObject, Irp, &Information);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
Lots of definitions should go to corresponding files
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ddk/ntifs.h>
|
||||
#include <ddk/kbdmou.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
|
||||
/* Initialize generic linux structure */
|
||||
dev->irq = DeviceExtension->InterruptVector;
|
||||
dev->dev_ext = (PVOID)DeviceExtension;
|
||||
dev->dev.dev_ext = (PVOID)DeviceExtension;
|
||||
dev->slot_name = ExAllocatePoolWithTag(NonPagedPool, 128, USB_UHCI_TAG); // 128 max len for slot name
|
||||
init_wrapper(dev);
|
||||
|
||||
@@ -48,10 +49,6 @@ InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
|
||||
/* Probe device with real id now */
|
||||
uhci_pci_driver.probe(dev, uhci_pci_ids);
|
||||
|
||||
// DPRINT1("UHCI :SysIoBusNumA %d\n",DeviceExtension->SystemIoBusNumber);
|
||||
// DeviceExtension->SystemIoBusNumber = dev->bus->number;
|
||||
// DPRINT1("UHCI: SysIoBusNumB %d\n",DeviceExtension->SystemIoBusNumber);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
@@ -149,11 +149,7 @@ UsbhubPdoQueryDeviceText(
|
||||
|
||||
switch (DeviceTextType)
|
||||
{
|
||||
/*case DeviceTextDescription:
|
||||
{
|
||||
DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextDescription\n");
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}*/
|
||||
case DeviceTextDescription:
|
||||
case DeviceTextLocationInformation:
|
||||
{
|
||||
unsigned short size;
|
||||
@@ -161,7 +157,11 @@ UsbhubPdoQueryDeviceText(
|
||||
PWCHAR buf;
|
||||
PWCHAR bufret;
|
||||
|
||||
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextLocationInformation\n");
|
||||
if (DeviceTextType == DeviceTextDescription)
|
||||
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextDescription\n");
|
||||
else
|
||||
DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextLocationInformation\n");
|
||||
|
||||
if (!DeviceExtension->dev->descriptor.iProduct)
|
||||
return STATUS_NOT_SUPPORTED;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user