mirror of
https://github.com/reactos/reactos.git
synced 2025-06-15 20:08:37 +00:00
[USBPORT] Add support for transaction translators in USBPORT_RemoveDevice().
This commit is contained in:
parent
cbba6e80fc
commit
5e15ba48b9
1 changed files with 34 additions and 0 deletions
|
@ -1564,6 +1564,9 @@ USBPORT_RemoveDevice(IN PDEVICE_OBJECT FdoDevice,
|
||||||
IN ULONG Flags)
|
IN ULONG Flags)
|
||||||
{
|
{
|
||||||
PUSBPORT_DEVICE_EXTENSION FdoExtension;
|
PUSBPORT_DEVICE_EXTENSION FdoExtension;
|
||||||
|
PUSB2_TT_EXTENSION TtExtension;
|
||||||
|
ULONG ix;
|
||||||
|
KIRQL OldIrql;
|
||||||
|
|
||||||
DPRINT("USBPORT_RemoveDevice: DeviceHandle - %p, Flags - %x\n",
|
DPRINT("USBPORT_RemoveDevice: DeviceHandle - %p, Flags - %x\n",
|
||||||
DeviceHandle,
|
DeviceHandle,
|
||||||
|
@ -1623,6 +1626,37 @@ USBPORT_RemoveDevice(IN PDEVICE_OBJECT FdoDevice,
|
||||||
USBPORT_FreeUsbAddress(FdoDevice, DeviceHandle->DeviceAddress);
|
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,
|
KeReleaseSemaphore(&FdoExtension->DeviceSemaphore,
|
||||||
LOW_REALTIME_PRIORITY,
|
LOW_REALTIME_PRIORITY,
|
||||||
1,
|
1,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue