xHCI:
authorHervé Poussineau <hpoussin@reactos.org>
Sat, 10 Sep 2005 23:50:28 +0000 (23:50 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Sat, 10 Sep 2005 23:50:28 +0000 (23:50 +0000)
* Fix value returned by IRP_MN_QUERY_CAPABILITIES and IOCTL_INTERNAL_USB_GET_ROOT_USB_DEVICE
* Remove debug output
USBHUB:
* Don't enumerate too much children. Display informations about them

svn path=/trunk/; revision=17791

reactos/drivers/usb/miniport/common/misc.c
reactos/drivers/usb/miniport/common/pdo.c
reactos/drivers/usb/usbhub/fdo.c

index cfe8456..93d2600 100644 (file)
@@ -87,13 +87,9 @@ UsbMpInitMultiSzString(
        Source = va_arg(args, PCSZ);
        while (Source != NULL)
        {
-               DPRINT1("Source = %s\n", Source);
                RtlInitAnsiString(&AnsiString, Source);
-               DPRINT1("AnsiString = %Z\n", &AnsiString);
-               DPRINT1("NLS_MB_CODE_PAGE_TAG = %lu\n", (ULONG)NLS_MB_CODE_PAGE_TAG);
                DestinationSize += RtlAnsiStringToUnicodeSize(&AnsiString)
                        + sizeof(WCHAR) /* final NULL */;
-               DPRINT1("DestinationSize = %lu\n", DestinationSize);
                Source = va_arg(args, PCSZ);
        }
        va_end(args);
index 4d7259d..ca52d50 100644 (file)
@@ -50,7 +50,7 @@ UsbMpDeviceControlPdo(
                                DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceExtension->FunctionalDeviceObject->DeviceExtension;
                                
                                pRootHubPointer = (PVOID*)Irp->AssociatedIrp.SystemBuffer;
-                               *pRootHubPointer = (PVOID)DeviceExtension->pdev->bus; /* struct usb_device* */
+                               *pRootHubPointer = ((struct usb_hcd*)DeviceExtension->pdev->data)->self.root_hub;
                                Information = sizeof(PVOID);
                                Status = STATUS_SUCCESS;
                        }
@@ -80,7 +80,7 @@ UsbMpPdoQueryId(
        ULONG IdType;
        UNICODE_STRING SourceString;
        UNICODE_STRING String;
-       NTSTATUS Status;
+       NTSTATUS Status = STATUS_SUCCESS;
 
        IdType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryId.IdType;
        DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
@@ -96,13 +96,20 @@ UsbMpPdoQueryId(
                }
                case BusQueryHardwareIDs:
                {
+                       //CHAR Buffer[2][40];
                        DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n");
-                       /* FIXME: Should return
-                               USB\ROOT_HUB&VID????&PID????&REV????
-                               USB\ROOT_HUB&VID????&PID????
-                               USB\ROOT_HUB
-                       */
-                       UsbMpInitMultiSzString(&SourceString, "USB\\ROOT_HUB", NULL);
+
+                       /*FIXME: sprintf(Buffer[0], "USB\\VID%04X&PID%04X&REV%04X",
+                               VENDOR,
+                               PRODUCT,
+                               REV);
+                       sprintf(Buffer[1], "USB\\VID%04X&PID%04X",
+                               VENDOR,
+                               PRODUCT);
+                       Status = UsbMpInitMultiSzString(
+                               &SourceString,
+                               Buffer[0], Buffer[1], "USB\\ROOT_HUB", NULL);*/
+                       Status = UsbMpInitMultiSzString(&SourceString, "USB\\ROOT_HUB", NULL);
                        break;
                }
                case BusQueryCompatibleIDs:
@@ -121,11 +128,14 @@ UsbMpPdoQueryId(
                        return STATUS_NOT_SUPPORTED;
        }
 
-       Status = UsbMpDuplicateUnicodeString(
-               &String,
-               &SourceString,
-               PagedPool);
-       *Information = (ULONG_PTR)String.Buffer;
+       if (NT_SUCCESS(Status))
+       {
+               Status = UsbMpDuplicateUnicodeString(
+                       &String,
+                       &SourceString,
+                       PagedPool);
+               *Information = (ULONG_PTR)String.Buffer;
+       }
        return Status;
 }
 
@@ -184,12 +194,12 @@ UsbMpPnpPdo(
                        /* FIXME: capabilities can change with connected device */
                        DeviceCapabilities->LockSupported = FALSE;
                        DeviceCapabilities->EjectSupported = FALSE;
-                       DeviceCapabilities->Removable = TRUE;
+                       DeviceCapabilities->Removable = FALSE;
                        DeviceCapabilities->DockDevice = FALSE;
                        DeviceCapabilities->UniqueID = FALSE;
-                       DeviceCapabilities->SilentInstall = FALSE;
-                       DeviceCapabilities->RawDeviceOK = TRUE;
-                       DeviceCapabilities->SurpriseRemovalOK = TRUE;
+                       DeviceCapabilities->SilentInstall = TRUE;
+                       DeviceCapabilities->RawDeviceOK = FALSE;
+                       DeviceCapabilities->SurpriseRemovalOK = FALSE;
                        DeviceCapabilities->HardwareDisabled = FALSE; /* FIXME */
                        //DeviceCapabilities->NoDisplayInUI = FALSE; /* FIXME */
                        DeviceCapabilities->DeviceState[0] = PowerDeviceD0; /* FIXME */
index 7aa0176..ded34f2 100644 (file)
@@ -66,7 +66,7 @@ UsbhubFdoQueryBusRelations(
        dev = DeviceExtension->dev;
        
        /* Create PDOs that are missing */
-       for (i = 0; i < USB_MAXCHILDREN; i++)
+       for (i = 0; i < dev->maxchild; i++)
        {
                if (dev->children[i] == NULL)
                {
@@ -110,7 +110,13 @@ UsbhubFdoQueryBusRelations(
                if (!NT_SUCCESS(Status))
                        goto ByeBye;
                
-
+               DPRINT1("child #%lu: USB\\Vid_%04x&Pid_%04x&Rev_%04x (class %x:%x)\n",
+                       i,
+                       PdoExtension->dev->descriptor.idVendor,
+                       PdoExtension->dev->descriptor.idProduct,
+                       PdoExtension->dev->descriptor.bcdDevice,
+                       PdoExtension->dev->descriptor.bDeviceClass,
+                       PdoExtension->dev->descriptor.bDeviceSubClass);
                sprintf(Buffer[0], "USB\\Vid_%04x&Pid_%04x&Rev_%04x",
                        PdoExtension->dev->descriptor.idVendor,
                        PdoExtension->dev->descriptor.idProduct,