mirror of
https://github.com/reactos/reactos.git
synced 2024-09-29 14:09:10 +00:00
[USBPORT] Add support for transaction translators in USBPORT_RemoveDevice().
This commit is contained in:
parent
cbba6e80fc
commit
5e15ba48b9
|
@ -1564,6 +1564,9 @@ USBPORT_RemoveDevice(IN PDEVICE_OBJECT FdoDevice,
|
|||
IN ULONG Flags)
|
||||
{
|
||||
PUSBPORT_DEVICE_EXTENSION FdoExtension;
|
||||
PUSB2_TT_EXTENSION TtExtension;
|
||||
ULONG ix;
|
||||
KIRQL OldIrql;
|
||||
|
||||
DPRINT("USBPORT_RemoveDevice: DeviceHandle - %p, Flags - %x\n",
|
||||
DeviceHandle,
|
||||
|
@ -1623,6 +1626,37 @@ USBPORT_RemoveDevice(IN PDEVICE_OBJECT FdoDevice,
|
|||
USBPORT_FreeUsbAddress(FdoDevice, DeviceHandle->DeviceAddress);
|
||||
}
|
||||
|
||||
DPRINT("USBPORT_RemoveDevice: DeviceHandle->TtList.Flink - %p\n", DeviceHandle->TtList.Flink);
|
||||
|
||||
while (!IsListEmpty(&DeviceHandle->TtList))
|
||||
{
|
||||
TtExtension = CONTAINING_RECORD(DeviceHandle->TtList.Flink,
|
||||
USB2_TT_EXTENSION,
|
||||
Link);
|
||||
|
||||
RemoveHeadList(&DeviceHandle->TtList);
|
||||
|
||||
DPRINT("USBPORT_RemoveDevice: TtExtension - %p\n", TtExtension);
|
||||
|
||||
KeAcquireSpinLock(&FdoExtension->TtSpinLock, &OldIrql);
|
||||
|
||||
TtExtension->Flags |= USB2_TT_EXTENSION_FLAG_DELETED;
|
||||
|
||||
if (IsListEmpty(&TtExtension->EndpointList))
|
||||
{
|
||||
USBPORT_UpdateAllocatedBwTt(TtExtension);
|
||||
|
||||
for (ix = 0; ix < USB2_FRAMES; ix++)
|
||||
{
|
||||
FdoExtension->Bandwidth[ix] += TtExtension->MaxBandwidth;
|
||||
}
|
||||
|
||||
ExFreePool(TtExtension);
|
||||
}
|
||||
|
||||
KeReleaseSpinLock(&FdoExtension->TtSpinLock, OldIrql);
|
||||
}
|
||||
|
||||
KeReleaseSemaphore(&FdoExtension->DeviceSemaphore,
|
||||
LOW_REALTIME_PRIORITY,
|
||||
1,
|
||||
|
|
Loading…
Reference in a new issue