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
Modified: trunk/reactos/drivers/usb/miniport/common/main.c
Modified: trunk/reactos/drivers/usb/miniport/common/pdo.c
Modified: trunk/reactos/drivers/usb/miniport/usb_wrapper.h
Modified: trunk/reactos/drivers/usb/miniport/usbuhci/uhci.c
Modified: trunk/reactos/drivers/usb/usbhub/pdo.c
_____
Modified: trunk/reactos/drivers/usb/miniport/common/main.c
--- trunk/reactos/drivers/usb/miniport/common/main.c 2005-11-04
19:31:47 UTC (rev 19002)
+++ trunk/reactos/drivers/usb/miniport/common/main.c 2005-11-04
20:24:44 UTC (rev 19003)
@@ -199,16 +199,6 @@
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)
_____
Modified: trunk/reactos/drivers/usb/miniport/common/pdo.c
--- trunk/reactos/drivers/usb/miniport/common/pdo.c 2005-11-04
19:31:47 UTC (rev 19002)
+++ trunk/reactos/drivers/usb/miniport/common/pdo.c 2005-11-04
20:24:44 UTC (rev 19003)
@@ -286,37 +286,20 @@
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 @@
}
break;
}
-#endif
case IRP_MN_QUERY_ID: /* 0x13 */
{
Status = UsbMpPdoQueryId(DeviceObject, Irp,
&Information);
_____
Modified: trunk/reactos/drivers/usb/miniport/usb_wrapper.h
--- trunk/reactos/drivers/usb/miniport/usb_wrapper.h 2005-11-04
19:31:47 UTC (rev 19002)
+++ trunk/reactos/drivers/usb/miniport/usb_wrapper.h 2005-11-04
20:24:44 UTC (rev 19003)
@@ -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>
_____
Modified: trunk/reactos/drivers/usb/miniport/usbuhci/uhci.c
--- trunk/reactos/drivers/usb/miniport/usbuhci/uhci.c 2005-11-04
19:31:47 UTC (rev 19002)
+++ trunk/reactos/drivers/usb/miniport/usbuhci/uhci.c 2005-11-04
20:24:44 UTC (rev 19003)
@@ -26,6 +26,7 @@
/* 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 @@
/* 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;
}
_____
Modified: trunk/reactos/drivers/usb/usbhub/pdo.c
--- trunk/reactos/drivers/usb/usbhub/pdo.c 2005-11-04 19:31:47 UTC
(rev 19002)
+++ trunk/reactos/drivers/usb/usbhub/pdo.c 2005-11-04 20:24:44 UTC
(rev 19003)
@@ -149,11 +149,7 @@
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 @@
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;