From 7c398f6eb7251c8bb88e50f06aced4b26bc9fdf4 Mon Sep 17 00:00:00 2001 From: Vadim Galyant Date: Mon, 27 Nov 2017 20:44:13 +0900 Subject: [PATCH] [USBPORT] Initialize FdoExtension->Bandwidth[] in USBPORT_StartDevice(). --- drivers/usb/usbport/pnp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/usb/usbport/pnp.c b/drivers/usb/usbport/pnp.c index e7ec3117fc6..7b0c5dd20e8 100644 --- a/drivers/usb/usbport/pnp.c +++ b/drivers/usb/usbport/pnp.c @@ -519,6 +519,7 @@ USBPORT_StartDevice(IN PDEVICE_OBJECT FdoDevice, BOOLEAN IsCompanion = FALSE; ULONG LegacyBIOS; ULONG MiniportFlags; + ULONG ix; DPRINT("USBPORT_StartDevice: FdoDevice - %p, UsbPortResources - %p\n", FdoDevice, @@ -610,6 +611,7 @@ USBPORT_StartDevice(IN PDEVICE_OBJECT FdoDevice, KeInitializeSpinLock(&FdoExtension->PowerWakeSpinLock); KeInitializeSpinLock(&FdoExtension->SetPowerD0SpinLock); KeInitializeSpinLock(&FdoExtension->RootHubCallbackSpinLock); + KeInitializeSpinLock(&FdoExtension->TtSpinLock); KeInitializeDpc(&FdoExtension->IsrDpc, USBPORT_IsrDpc, FdoDevice); @@ -754,6 +756,12 @@ USBPORT_StartDevice(IN PDEVICE_OBJECT FdoDevice, FdoExtension->TotalBusBandwidth = TotalBusBandwidth; } + for (ix = 0; ix < USB2_FRAMES; ix++) + { + FdoExtension->Bandwidth[ix] = FdoExtension->TotalBusBandwidth - + FdoExtension->TotalBusBandwidth / 10; + } + FdoExtension->ActiveIrpTable = ExAllocatePoolWithTag(NonPagedPool, sizeof(USBPORT_IRP_TABLE), USB_PORT_TAG);