[USBPORT] Initialize FdoExtension->Bandwidth[] in USBPORT_StartDevice().

This commit is contained in:
Vadim Galyant 2017-11-27 20:44:13 +09:00 committed by Amine Khaldi
parent 0f8425ed44
commit 7c398f6eb7

View file

@ -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);