mirror of
https://github.com/reactos/reactos.git
synced 2025-06-05 01:10:26 +00:00
[USBPORT] Implement USBPORT_InitializeTT().
This commit is contained in:
parent
da1e283837
commit
18702047a1
2 changed files with 59 additions and 3 deletions
|
@ -1770,7 +1770,55 @@ USBPORT_InitializeTT(IN PDEVICE_OBJECT FdoDevice,
|
||||||
IN PUSBPORT_DEVICE_HANDLE HubDeviceHandle,
|
IN PUSBPORT_DEVICE_HANDLE HubDeviceHandle,
|
||||||
IN ULONG TtNumber)
|
IN ULONG TtNumber)
|
||||||
{
|
{
|
||||||
DPRINT1("USBPORT_InitializeTT: UNIMPLEMENTED. FIXME. \n");
|
PUSBPORT_DEVICE_EXTENSION FdoExtension;
|
||||||
|
PUSB2_TT_EXTENSION TtExtension;
|
||||||
|
ULONG ix;
|
||||||
|
|
||||||
|
DPRINT("USBPORT_InitializeTT: HubDeviceHandle - %p, TtNumber - %X\n",
|
||||||
|
HubDeviceHandle,
|
||||||
|
TtNumber);
|
||||||
|
|
||||||
|
FdoExtension = FdoDevice->DeviceExtension;
|
||||||
|
|
||||||
|
TtExtension = ExAllocatePoolWithTag(NonPagedPool,
|
||||||
|
sizeof(USB2_TT_EXTENSION),
|
||||||
|
USB_PORT_TAG);
|
||||||
|
|
||||||
|
if (!TtExtension)
|
||||||
|
{
|
||||||
|
DPRINT1("USBPORT_InitializeTT: ExAllocatePoolWithTag return NULL\n");
|
||||||
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
}
|
||||||
|
|
||||||
|
DPRINT("USBPORT_InitializeTT: TtExtension - %p\n", TtExtension);
|
||||||
|
|
||||||
|
RtlZeroMemory(TtExtension, sizeof(USB2_TT_EXTENSION));
|
||||||
|
|
||||||
|
TtExtension->DeviceAddress = HubDeviceHandle->DeviceAddress;
|
||||||
|
TtExtension->TtNumber = TtNumber;
|
||||||
|
TtExtension->RootHubPdo = FdoExtension->RootHubPdo;
|
||||||
|
TtExtension->BusBandwidth = TOTAL_USB11_BUS_BANDWIDTH;
|
||||||
|
|
||||||
|
InitializeListHead(&TtExtension->TtList);
|
||||||
|
|
||||||
|
/* 90% maximum allowed for periodic endpoints */
|
||||||
|
for (ix = 0; ix < USB2_FRAMES; ix++)
|
||||||
|
{
|
||||||
|
TtExtension->Bandwidth[ix] = TtExtension->BusBandwidth -
|
||||||
|
TtExtension->BusBandwidth / 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
USBPORT_UpdateAllocatedBwTt(TtExtension);
|
||||||
|
|
||||||
|
for (ix = 0; ix < USB2_FRAMES; ix++)
|
||||||
|
{
|
||||||
|
FdoExtension->Bandwidth[ix] -= TtExtension->MaxBandwidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
USB2_InitTT(FdoExtension->Usb2Extension, &TtExtension->Tt);
|
||||||
|
|
||||||
|
InsertTailList(&HubDeviceHandle->TtList, &TtExtension->Link);
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1783,7 +1831,7 @@ USBPORT_Initialize20Hub(IN PDEVICE_OBJECT FdoDevice,
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG ix;
|
ULONG ix;
|
||||||
|
|
||||||
DPRINT("USBPORT_Initialize20Hub \n");
|
DPRINT("USBPORT_Initialize20Hub: TtCount - %X\n", TtCount);
|
||||||
|
|
||||||
if (!HubDeviceHandle)
|
if (!HubDeviceHandle)
|
||||||
{
|
{
|
||||||
|
|
|
@ -194,6 +194,7 @@ typedef struct _USBPORT_DEVICE_HANDLE {
|
||||||
LIST_ENTRY DeviceHandleLink;
|
LIST_ENTRY DeviceHandleLink;
|
||||||
LONG DeviceHandleLock;
|
LONG DeviceHandleLock;
|
||||||
ULONG TtCount;
|
ULONG TtCount;
|
||||||
|
LIST_ENTRY TtList;
|
||||||
} USBPORT_DEVICE_HANDLE, *PUSBPORT_DEVICE_HANDLE;
|
} USBPORT_DEVICE_HANDLE, *PUSBPORT_DEVICE_HANDLE;
|
||||||
|
|
||||||
typedef struct _USBPORT_ENDPOINT {
|
typedef struct _USBPORT_ENDPOINT {
|
||||||
|
@ -379,10 +380,11 @@ typedef struct _USBPORT_DEVICE_EXTENSION {
|
||||||
KDPC HcWakeDpc;
|
KDPC HcWakeDpc;
|
||||||
/* Usb 2.0 HC Extension */
|
/* Usb 2.0 HC Extension */
|
||||||
PUSB2_HC_EXTENSION Usb2Extension;
|
PUSB2_HC_EXTENSION Usb2Extension;
|
||||||
|
ULONG Bandwidth[32];
|
||||||
|
|
||||||
/* Miniport extension should be aligned on 0x100 */
|
/* Miniport extension should be aligned on 0x100 */
|
||||||
#if !defined(_M_X64)
|
#if !defined(_M_X64)
|
||||||
ULONG Padded[33];
|
ULONG Padded[1];
|
||||||
#else
|
#else
|
||||||
ULONG Padded[0];
|
ULONG Padded[0];
|
||||||
#endif
|
#endif
|
||||||
|
@ -1294,6 +1296,12 @@ USBPORT_FreeBandwidthUSB2(
|
||||||
IN PDEVICE_OBJECT FdoDevice,
|
IN PDEVICE_OBJECT FdoDevice,
|
||||||
IN PUSBPORT_ENDPOINT Endpoint);
|
IN PUSBPORT_ENDPOINT Endpoint);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
USB2_InitTT(
|
||||||
|
IN PUSB2_HC_EXTENSION HcExtension,
|
||||||
|
IN PUSB2_TT Tt);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
USB2_InitController(
|
USB2_InitController(
|
||||||
|
|
Loading…
Reference in a new issue