mirror of
https://github.com/reactos/reactos.git
synced 2025-05-23 19:14:48 +00:00
[USBPORT] Add support for transaction translators in USBPORT_OpenPipe() and USBPORT_ClosePipe().
This commit is contained in:
parent
7c398f6eb7
commit
c6ca2a8f02
3 changed files with 41 additions and 9 deletions
|
@ -1914,7 +1914,7 @@ USBPORT_InitializeTT(IN PDEVICE_OBJECT FdoDevice,
|
||||||
TtExtension->RootHubPdo = FdoExtension->RootHubPdo;
|
TtExtension->RootHubPdo = FdoExtension->RootHubPdo;
|
||||||
TtExtension->BusBandwidth = TOTAL_USB11_BUS_BANDWIDTH;
|
TtExtension->BusBandwidth = TOTAL_USB11_BUS_BANDWIDTH;
|
||||||
|
|
||||||
InitializeListHead(&TtExtension->TtList);
|
InitializeListHead(&TtExtension->EndpointList);
|
||||||
|
|
||||||
/* 90% maximum allowed for periodic endpoints */
|
/* 90% maximum allowed for periodic endpoints */
|
||||||
for (ix = 0; ix < USB2_FRAMES; ix++)
|
for (ix = 0; ix < USB2_FRAMES; ix++)
|
||||||
|
|
|
@ -471,6 +471,9 @@ USBPORT_ClosePipe(IN PUSBPORT_DEVICE_HANDLE DeviceHandle,
|
||||||
PUSBPORT_DEVICE_EXTENSION FdoExtension;
|
PUSBPORT_DEVICE_EXTENSION FdoExtension;
|
||||||
PUSBPORT_RHDEVICE_EXTENSION PdoExtension;
|
PUSBPORT_RHDEVICE_EXTENSION PdoExtension;
|
||||||
PUSBPORT_ENDPOINT Endpoint;
|
PUSBPORT_ENDPOINT Endpoint;
|
||||||
|
PUSBPORT_REGISTRATION_PACKET Packet;
|
||||||
|
PUSB2_TT_EXTENSION TtExtension;
|
||||||
|
ULONG ix;
|
||||||
BOOLEAN IsReady;
|
BOOLEAN IsReady;
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
|
|
||||||
|
@ -492,7 +495,6 @@ USBPORT_ClosePipe(IN PUSBPORT_DEVICE_HANDLE DeviceHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
Endpoint = PipeHandle->Endpoint;
|
Endpoint = PipeHandle->Endpoint;
|
||||||
DPRINT("USBPORT_ClosePipe: Endpoint - %p\n", Endpoint);
|
|
||||||
|
|
||||||
KeAcquireSpinLock(&FdoExtension->EndpointListSpinLock, &OldIrql);
|
KeAcquireSpinLock(&FdoExtension->EndpointListSpinLock, &OldIrql);
|
||||||
|
|
||||||
|
@ -543,16 +545,44 @@ USBPORT_ClosePipe(IN PUSBPORT_DEVICE_HANDLE DeviceHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
Endpoint->DeviceHandle = NULL;
|
Endpoint->DeviceHandle = NULL;
|
||||||
|
Packet = &FdoExtension->MiniPortInterface->Packet;
|
||||||
|
|
||||||
if (FdoExtension->MiniPortInterface->Packet.MiniPortFlags & USB_MINIPORT_FLAGS_USB2)
|
if (Packet->MiniPortFlags & USB_MINIPORT_FLAGS_USB2)
|
||||||
{
|
{
|
||||||
DPRINT("USBPORT_ClosePipe: FIXME USBPORT_FreeBandwidthUSB20\n");
|
USBPORT_FreeBandwidthUSB2(FdoDevice, Endpoint);
|
||||||
//USBPORT_FreeBandwidthUSB20();
|
|
||||||
|
KeAcquireSpinLock(&FdoExtension->TtSpinLock, &OldIrql);
|
||||||
|
|
||||||
|
TtExtension = Endpoint->TtExtension;
|
||||||
|
|
||||||
|
if (TtExtension)
|
||||||
|
{
|
||||||
|
RemoveEntryList(&Endpoint->TtLink);
|
||||||
|
|
||||||
|
Endpoint->TtLink.Flink = NULL;
|
||||||
|
Endpoint->TtLink.Blink = NULL;
|
||||||
|
|
||||||
|
if (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);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINT("USBPORT_ClosePipe: FIXME USBPORT_FreeBandwidthUSB11\n");
|
USBPORT_FreeBandwidth(FdoDevice, Endpoint);
|
||||||
//USBPORT_FreeBandwidthUSB11();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
KeAcquireSpinLock(&Endpoint->EndpointSpinLock, &Endpoint->EndpointOldIrql);
|
KeAcquireSpinLock(&Endpoint->EndpointSpinLock, &Endpoint->EndpointOldIrql);
|
||||||
|
@ -676,7 +706,7 @@ USBPORT_OpenPipe(IN PDEVICE_OBJECT FdoDevice,
|
||||||
|
|
||||||
if (DeviceHandle->TtExtension)
|
if (DeviceHandle->TtExtension)
|
||||||
{
|
{
|
||||||
ExInterlockedInsertTailList(&DeviceHandle->TtExtension->TtList,
|
ExInterlockedInsertTailList(&DeviceHandle->TtExtension->EndpointList,
|
||||||
&Endpoint->TtLink,
|
&Endpoint->TtLink,
|
||||||
&FdoExtension->TtSpinLock);
|
&FdoExtension->TtSpinLock);
|
||||||
}
|
}
|
||||||
|
|
|
@ -528,6 +528,8 @@ typedef struct _USB2_TT {
|
||||||
ULONG TimeCS[USB2_FRAMES][USB2_MICROFRAMES];
|
ULONG TimeCS[USB2_FRAMES][USB2_MICROFRAMES];
|
||||||
} USB2_TT, *PUSB2_TT;
|
} USB2_TT, *PUSB2_TT;
|
||||||
|
|
||||||
|
#define USB2_TT_EXTENSION_FLAG_DELETED 1
|
||||||
|
|
||||||
typedef struct _USB2_TT_EXTENSION {
|
typedef struct _USB2_TT_EXTENSION {
|
||||||
PDEVICE_OBJECT RootHubPdo;
|
PDEVICE_OBJECT RootHubPdo;
|
||||||
ULONG Flags;
|
ULONG Flags;
|
||||||
|
@ -537,7 +539,7 @@ typedef struct _USB2_TT_EXTENSION {
|
||||||
ULONG MinBandwidth;
|
ULONG MinBandwidth;
|
||||||
USHORT DeviceAddress;
|
USHORT DeviceAddress;
|
||||||
USHORT TtNumber;
|
USHORT TtNumber;
|
||||||
LIST_ENTRY TtList;
|
LIST_ENTRY EndpointList;
|
||||||
LIST_ENTRY Link;
|
LIST_ENTRY Link;
|
||||||
USB2_TT Tt;
|
USB2_TT Tt;
|
||||||
} USB2_TT_EXTENSION, *PUSB2_TT_EXTENSION;
|
} USB2_TT_EXTENSION, *PUSB2_TT_EXTENSION;
|
||||||
|
|
Loading…
Reference in a new issue