mirror of
https://github.com/reactos/reactos.git
synced 2025-05-23 11:04:52 +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->BusBandwidth = TOTAL_USB11_BUS_BANDWIDTH;
|
||||
|
||||
InitializeListHead(&TtExtension->TtList);
|
||||
InitializeListHead(&TtExtension->EndpointList);
|
||||
|
||||
/* 90% maximum allowed for periodic endpoints */
|
||||
for (ix = 0; ix < USB2_FRAMES; ix++)
|
||||
|
|
|
@ -471,6 +471,9 @@ USBPORT_ClosePipe(IN PUSBPORT_DEVICE_HANDLE DeviceHandle,
|
|||
PUSBPORT_DEVICE_EXTENSION FdoExtension;
|
||||
PUSBPORT_RHDEVICE_EXTENSION PdoExtension;
|
||||
PUSBPORT_ENDPOINT Endpoint;
|
||||
PUSBPORT_REGISTRATION_PACKET Packet;
|
||||
PUSB2_TT_EXTENSION TtExtension;
|
||||
ULONG ix;
|
||||
BOOLEAN IsReady;
|
||||
KIRQL OldIrql;
|
||||
|
||||
|
@ -492,7 +495,6 @@ USBPORT_ClosePipe(IN PUSBPORT_DEVICE_HANDLE DeviceHandle,
|
|||
}
|
||||
|
||||
Endpoint = PipeHandle->Endpoint;
|
||||
DPRINT("USBPORT_ClosePipe: Endpoint - %p\n", Endpoint);
|
||||
|
||||
KeAcquireSpinLock(&FdoExtension->EndpointListSpinLock, &OldIrql);
|
||||
|
||||
|
@ -543,16 +545,44 @@ USBPORT_ClosePipe(IN PUSBPORT_DEVICE_HANDLE DeviceHandle,
|
|||
}
|
||||
|
||||
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_FreeBandwidthUSB20();
|
||||
USBPORT_FreeBandwidthUSB2(FdoDevice, Endpoint);
|
||||
|
||||
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
|
||||
{
|
||||
DPRINT("USBPORT_ClosePipe: FIXME USBPORT_FreeBandwidthUSB11\n");
|
||||
//USBPORT_FreeBandwidthUSB11();
|
||||
USBPORT_FreeBandwidth(FdoDevice, Endpoint);
|
||||
}
|
||||
|
||||
KeAcquireSpinLock(&Endpoint->EndpointSpinLock, &Endpoint->EndpointOldIrql);
|
||||
|
@ -676,7 +706,7 @@ USBPORT_OpenPipe(IN PDEVICE_OBJECT FdoDevice,
|
|||
|
||||
if (DeviceHandle->TtExtension)
|
||||
{
|
||||
ExInterlockedInsertTailList(&DeviceHandle->TtExtension->TtList,
|
||||
ExInterlockedInsertTailList(&DeviceHandle->TtExtension->EndpointList,
|
||||
&Endpoint->TtLink,
|
||||
&FdoExtension->TtSpinLock);
|
||||
}
|
||||
|
|
|
@ -528,6 +528,8 @@ typedef struct _USB2_TT {
|
|||
ULONG TimeCS[USB2_FRAMES][USB2_MICROFRAMES];
|
||||
} USB2_TT, *PUSB2_TT;
|
||||
|
||||
#define USB2_TT_EXTENSION_FLAG_DELETED 1
|
||||
|
||||
typedef struct _USB2_TT_EXTENSION {
|
||||
PDEVICE_OBJECT RootHubPdo;
|
||||
ULONG Flags;
|
||||
|
@ -537,7 +539,7 @@ typedef struct _USB2_TT_EXTENSION {
|
|||
ULONG MinBandwidth;
|
||||
USHORT DeviceAddress;
|
||||
USHORT TtNumber;
|
||||
LIST_ENTRY TtList;
|
||||
LIST_ENTRY EndpointList;
|
||||
LIST_ENTRY Link;
|
||||
USB2_TT Tt;
|
||||
} USB2_TT_EXTENSION, *PUSB2_TT_EXTENSION;
|
||||
|
|
Loading…
Reference in a new issue