https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7c398f6eb7251c8bb88e5…
commit 7c398f6eb7251c8bb88e50f06aced4b26bc9fdf4
Author: Vadim Galyant <vgal(a)rambler.ru>
AuthorDate: Mon Nov 27 20:44:13 2017 +0900
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sun Jan 21 19:35:39 2018 +0100
[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 e7ec3117fc..7b0c5dd20e 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);