Minimize differences between UHCI and OHCI

No need to return an empty string in IRP_MN_QUERY_ID / BusQueryInstanceID ; a null string is enough

svn path=/trunk/; revision=20130
This commit is contained in:
Hervé Poussineau 2005-12-12 22:52:16 +00:00
parent 4ae7fa84ae
commit ad18ef445e
3 changed files with 12 additions and 11 deletions

View file

@ -170,8 +170,8 @@ UsbMpPdoQueryId(
case BusQueryInstanceID: case BusQueryInstanceID:
{ {
DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n"); DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n");
RtlInitUnicodeString(&SourceString, L""); *Information = 0;
break; return Status;
} }
default: default:
DPRINT1("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType); DPRINT1("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType);

View file

@ -21,16 +21,16 @@ InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
/* Initialize generic linux structure */ /* Initialize generic linux structure */
dev->irq = DeviceExtension->InterruptVector; dev->irq = DeviceExtension->InterruptVector;
dev->dev_ext = (PVOID)DeviceExtension; dev->dev_ext = (PVOID)DeviceExtension;
dev->dev.dev_ext = (PVOID)DeviceObject; dev->dev.dev_ext = DeviceObject;
dev->slot_name = ExAllocatePoolWithTag(NonPagedPool, 128, USB_OHCI_TAG); // 128 max len for slot name dev->slot_name = ExAllocatePoolWithTag(NonPagedPool, 128, USB_OHCI_TAG); // 128 max len for slot name
// Init wrapper /* Init wrapper */
init_wrapper(dev); init_wrapper(dev);
strcpy(dev->dev.name, "OpenHCI PCI-USB Controller"); strcpy(dev->dev.name, "OpenHCI PCI-USB Controller");
strcpy(dev->slot_name, "OHCD PCI Slot"); strcpy(dev->slot_name, "OHCD PCI Slot");
// Init the OHCI HCD. Probe will be called automatically, but will fail because id=NULL /* Init the OHCI HCD. Probe will be called automatically, but will fail because id=NULL */
Status = ohci_hcd_pci_init(); Status = ohci_hcd_pci_init();
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
@ -40,10 +40,10 @@ InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
return Status; return Status;
} }
// Init core usb /* Init core usb */
usb_init(); usb_init();
// Probe device with real id now /* Probe device with real id now */
ohci_pci_driver.probe(dev, ohci_pci_ids); ohci_pci_driver.probe(dev, ohci_pci_ids);
return STATUS_SUCCESS; return STATUS_SUCCESS;

View file

@ -14,8 +14,7 @@ struct pci_device_id* pci_ids = &uhci_pci_ids[0];
NTSTATUS NTSTATUS
InitLinuxWrapper(PDEVICE_OBJECT DeviceObject) InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
{ {
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status;
PUSBMP_DEVICE_EXTENSION DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension; PUSBMP_DEVICE_EXTENSION DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
/* Create generic linux structure */ /* Create generic linux structure */
@ -26,8 +25,10 @@ InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
/* Initialize generic linux structure */ /* Initialize generic linux structure */
dev->irq = DeviceExtension->InterruptVector; dev->irq = DeviceExtension->InterruptVector;
dev->dev_ext = (PVOID)DeviceExtension; dev->dev_ext = (PVOID)DeviceExtension;
dev->dev.dev_ext = (PVOID)DeviceObject; dev->dev.dev_ext = DeviceObject;
dev->slot_name = ExAllocatePoolWithTag(NonPagedPool, 128, USB_UHCI_TAG); // 128 max len for slot name dev->slot_name = ExAllocatePoolWithTag(NonPagedPool, 128, USB_UHCI_TAG); // 128 max len for slot name
/* Init wrapper */
init_wrapper(dev); init_wrapper(dev);
strcpy(dev->dev.name, "UnivHCI PCI-USB Controller"); strcpy(dev->dev.name, "UnivHCI PCI-USB Controller");
@ -49,7 +50,7 @@ InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
/* Probe device with real id now */ /* Probe device with real id now */
uhci_pci_driver.probe(dev, uhci_pci_ids); uhci_pci_driver.probe(dev, uhci_pci_ids);
return Status; return STATUS_SUCCESS;
} }
VOID STDCALL VOID STDCALL