X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EdkModulePkg%2FBus%2FPci%2FEhci%2FDxe%2FEhci.h;h=603bb2665a8b2c6717a1e9105181dfc0366af979;hp=747e1ee1240417e2c2442a14cb36a112173a6665;hb=4d1fe68e1ca84cf0d3eec69d20625fa57769de12;hpb=01bf334d2c017095a1776c2c42fe5dd0337cff0a diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.h b/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.h index 747e1ee124..603bb2665a 100644 --- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.h +++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.h @@ -1,20 +1,20 @@ /*++ -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: Ehci.h - -Abstract: - + +Abstract: + Revision History --*/ @@ -36,6 +36,9 @@ extern UINTN gEHCErrorLevel; #define STALL_1_MILLI_SECOND 1000 * STALL_1_MACRO_SECOND #define STALL_1_SECOND 1000 * STALL_1_MILLI_SECOND +#define MEM_UNIT_SIZE 128 + + #define SETUP_PACKET_PID_CODE 0x02 #define INPUT_PACKET_PID_CODE 0x01 #define OUTPUT_PACKET_PID_CODE 0x0 @@ -54,7 +57,7 @@ extern UINTN gEHCErrorLevel; #define USB_BAR_INDEX 0 /* how many bytes away from USB_BASE to 0x10 */ -#define NORMAL_MEMORY_BLOCK_UNIT_IN_PAGES 1 +#define NORMAL_MEMORY_BLOCK_UNIT_IN_PAGES 16 #define EHCI_MIN_PACKET_SIZE 8 #define EHCI_MAX_PACKET_SIZE 1024 @@ -64,7 +67,7 @@ extern UINTN gEHCErrorLevel; #define EHCI_MAX_QTD_CAPACITY (EFI_PAGE_SIZE * 5) #define NAK_COUNT_RELOAD 3 -#define QTD_ERROR_COUNTER 1 +#define QTD_ERROR_COUNTER 3 #define HIGH_BANDWIDTH_PIPE_MULTIPLIER 1 #define QTD_STATUS_ACTIVE 0x80 @@ -210,6 +213,9 @@ typedef struct { UINT8 BaseCode; } USB_CLASSC; +// +//32 Bytes Aligned +// typedef struct { UINT32 NextQtdTerminate : 1; UINT32 Rsvd1 : 4; @@ -242,13 +248,12 @@ typedef struct { UINT32 Rsvd6 : 12; UINT32 BufferPointer4 : 20; - UINT32 ExtBufferPointer0; - UINT32 ExtBufferPointer1; - UINT32 ExtBufferPointer2; - UINT32 ExtBufferPointer3; - UINT32 ExtBufferPointer4; + UINT32 PAD[5]; } EHCI_QTD_HW; +// +//32 Bytes Aligned +// typedef struct { UINT32 QhTerminate : 1; UINT32 SelectType : 2; @@ -307,11 +312,7 @@ typedef struct { UINT32 Rsvd6 : 12; UINT32 BufferPointer4 : 20; - UINT32 ExtBufferPointer0; - UINT32 ExtBufferPointer1; - UINT32 ExtBufferPointer2; - UINT32 ExtBufferPointer3; - UINT32 ExtBufferPointer4; + UINT32 Pad[5]; } EHCI_QH_HW; typedef struct { @@ -326,7 +327,9 @@ typedef struct { typedef struct _EHCI_QTD_ENTITY EHCI_QTD_ENTITY; typedef struct _EHCI_QH_ENTITY EHCI_QH_ENTITY; typedef struct _EHCI_ASYNC_REQUEST EHCI_ASYNC_REQUEST; - +// +//Aligan On 32 Bytes +// struct _EHCI_QTD_ENTITY { EHCI_QTD_HW Qtd; UINT32 TotalBytes; @@ -337,7 +340,9 @@ struct _EHCI_QTD_ENTITY { EHCI_QTD_ENTITY *AltNext; EHCI_QH_ENTITY *SelfQh; }; - +// +//Aligan On 32 Bytes +// struct _EHCI_QH_ENTITY { EHCI_QH_HW Qh; EHCI_QH_ENTITY *Next; @@ -390,8 +395,9 @@ typedef struct _USB2_HC_DEV { EFI_EVENT AsyncRequestEvent; EFI_UNICODE_STRING_TABLE *ControllerNameTable; MEMORY_MANAGE_HEADER *MemoryHeader; - UINT8 Is64BitCapable; + UINT8 Is64BitCapable; UINT32 High32BitAddr; + EHCI_QH_ENTITY *NULLQH; UINT32 UsbCapabilityLen; UINT16 DeviceSpeed[16]; } USB2_HC_DEV; @@ -422,13 +428,13 @@ Arguments: HcDev - USB2_HC_DEV MemoryHeader - MEMORY_MANAGE_HEADER to output MemoryBlockSizeInPages - MemoryBlockSizeInPages - + Returns: EFI_SUCCESS Success EFI_OUT_OF_RESOURCES Fail for no resources EFI_UNSUPPORTED Unsupported currently - + --*/ ; @@ -500,7 +506,7 @@ Arguments: Returns: EFI_SUCCESS Success - EFI_NOT_FOUND Can't find the free memory + EFI_NOT_FOUND Can't find the free memory --*/ ; @@ -522,7 +528,7 @@ Arguments: Returns: TRUE Empty - FALSE Not Empty + FALSE Not Empty --*/ ; @@ -590,7 +596,7 @@ Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -616,7 +622,7 @@ Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -659,18 +665,18 @@ ReadEhcCapabiltiyReg ( Routine Description: Read Ehc Capabitlity register - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV CapabiltiyRegAddr - Ehc Capability register address Data - A pointer to data read from register - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -685,18 +691,18 @@ ReadEhcOperationalReg ( Routine Description: Read Ehc Operation register - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV OperationalRegAddr - Ehc Operation register address Data - A pointer to data read from register - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -711,18 +717,18 @@ WriteEhcOperationalReg ( Routine Description: Write Ehc Operation register - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV OperationalRegAddr - Ehc Operation register address Data - 32bit write to register - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -735,16 +741,16 @@ SetEhcDoorbell ( Routine Description: Set Ehc door bell bit - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -758,18 +764,18 @@ SetFrameListLen ( Routine Description: Set the length of Frame List - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV Length - the required length of frame list - + Returns: EFI_SUCCESS Success EFI_INVALID_PARAMETER Invalid parameter EFI_DEVICE_ERROR Fail - + --*/ ; @@ -782,16 +788,16 @@ IsFrameListProgrammable ( Routine Description: Whether frame list is programmable - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: TRUE Programmable FALSE Unprogrammable - + --*/ ; @@ -804,16 +810,16 @@ IsPeriodicScheduleEnabled ( Routine Description: Whether periodic schedule is enabled - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: TRUE Enabled FALSE Disabled - + --*/ ; @@ -826,16 +832,16 @@ IsAsyncScheduleEnabled ( Routine Description: Whether asynchronous schedule is enabled - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: TRUE Enabled FALSE Disabled - + --*/ ; @@ -849,16 +855,16 @@ IsEhcPortEnabled ( Routine Description: Whether port is enabled - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: TRUE Enabled FALSE Disabled - + --*/ ; @@ -871,16 +877,16 @@ IsEhcReseted ( Routine Description: Whether Ehc is halted - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: TRUE Reseted FALSE Unreseted - + --*/ ; @@ -893,16 +899,16 @@ IsEhcHalted ( Routine Description: Whether Ehc is halted - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: TRUE Halted FALSE Not halted - + --*/ ; @@ -915,39 +921,39 @@ IsEhcSysError ( Routine Description: Whether Ehc is system error - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: TRUE System error FALSE No system error - + --*/ ; BOOLEAN IsHighSpeedDevice ( IN EFI_USB2_HC_PROTOCOL *This, - IN UINT8 PortNum + IN UINT8 PortNum ) /*++ Routine Description: Whether high speed device attached - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: TRUE High speed FALSE Full speed - + --*/ ; @@ -961,17 +967,17 @@ WaitForEhcReset ( Routine Description: wait for Ehc reset or timeout - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV Timeout - timeout threshold - + Returns: EFI_SUCCESS Success EFI_TIMEOUT Timeout - + --*/ ; @@ -985,17 +991,17 @@ WaitForEhcHalt ( Routine Description: wait for Ehc halt or timeout - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV Timeout - timeout threshold - + Returns: EFI_SUCCESS Success EFI_TIMEOUT Timeout - + --*/ ; @@ -1009,17 +1015,17 @@ WaitForEhcNotHalt ( Routine Description: wait for Ehc not halt or timeout - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV Timeout - timeout threshold - + Returns: EFI_SUCCESS Success EFI_TIMEOUT Timeout - + --*/ ; @@ -1036,14 +1042,14 @@ Routine Description: Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV Timeout - timeout threshold Returns: EFI_SUCCESS Success EFI_TIMEOUT Timeout - + --*/ ; @@ -1057,17 +1063,17 @@ WaitForAsyncScheduleEnable ( Routine Description: Wait for Ehc asynchronous schedule enable or timeout - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV Timeout - timeout threshold - + Returns: EFI_SUCCESS Success EFI_TIMEOUT Timeout - + --*/ ; @@ -1081,17 +1087,17 @@ WaitForAsyncScheduleDisable ( Routine Description: Wait for Ehc asynchronous schedule disable or timeout - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV Timeout - timeout threshold - + Returns: EFI_SUCCESS Success EFI_TIMEOUT Timeout - + --*/ ; @@ -1105,17 +1111,17 @@ WaitForPeriodicScheduleEnable ( Routine Description: Wait for Ehc periodic schedule enable or timeout - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV Timeout - timeout threshold - + Returns: EFI_SUCCESS Success EFI_TIMEOUT Timeout - + --*/ ; @@ -1129,17 +1135,17 @@ WaitForPeriodicScheduleDisable ( Routine Description: Wait for periodic schedule disable or timeout - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV Timeout - timeout threshold - + Returns: EFI_SUCCESS Success EFI_TIMEOUT Timeout - + --*/ ; @@ -1152,16 +1158,16 @@ GetCapabilityLen ( Routine Description: Get the length of capability register - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1175,17 +1181,17 @@ SetFrameListBaseAddr ( Routine Description: Set base address of frame list first entry - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV FrameBuffer - base address of first entry of frame list - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1199,17 +1205,17 @@ SetAsyncListAddr ( Routine Description: Set address of first Async schedule Qh - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV QhPtr - A pointer to first Qh in the Async schedule - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1222,17 +1228,17 @@ SetCtrlDataStructSeg ( Routine Description: Set address of first Async schedule Qh - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV QhPtr - A pointer to first Qh in the Async schedule - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1245,16 +1251,16 @@ SetPortRoutingEhc ( Routine Description: Set Ehc port routing bit - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1267,16 +1273,16 @@ EnablePeriodicSchedule ( Routine Description: Enable periodic schedule - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1289,16 +1295,16 @@ DisablePeriodicSchedule ( Routine Description: Disable periodic schedule - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1311,16 +1317,16 @@ EnableAsynchronousSchedule ( Routine Description: Enable asynchrounous schedule - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1333,16 +1339,16 @@ DisableAsynchronousSchedule ( Routine Description: Disable asynchrounous schedule - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1355,16 +1361,16 @@ StartScheduleExecution ( Routine Description: Start Ehc schedule execution - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1377,16 +1383,16 @@ ResetEhc ( Routine Description: Reset Ehc - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1399,16 +1405,16 @@ ClearEhcAllStatus ( Routine Description: Clear Ehc all status bits - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1430,12 +1436,12 @@ Arguments: HcDev - USB2_HC_DEV Length - Frame List Length - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1456,7 +1462,7 @@ Arguments: Returns: VOID - + --*/ ; @@ -1475,12 +1481,12 @@ Arguments: HcDev - USB2_HC_DEV NotifyFunction - Timer Notify Function - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1497,12 +1503,12 @@ Routine Description: Arguments: HcDev - USB2_HC_DEV - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1519,12 +1525,12 @@ Routine Description: Arguments: HcDev - USB2_HC_DEV - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1541,12 +1547,12 @@ Routine Description: Arguments: HcDev - USB2_HC_DEV - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1567,18 +1573,18 @@ Routine Description: Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV DeviceAddr - Address of Device Endpoint - Endpoint Number DeviceSpeed - Device Speed MaxPacketLen - Max Length of one Packet QhPtrPtr - A pointer of pointer to Qh for return - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1599,18 +1605,18 @@ Routine Description: Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV DeviceAddr - Address of Device DeviceSpeed - Device Speed MaxPacketLen - Max Length of one Packet Translator - Translator Transaction for SplitX QhPtrPtr - A pointer of pointer to Qh for return - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1633,19 +1639,19 @@ Routine Description: Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV DeviceAddr - Address of Device EndPointAddr - Address of Endpoint DeviceSpeed - Device Speed MaxPacketLen - Max Length of one Packet Translator - Translator Transaction for SplitX QhPtrPtr - A pointer of pointer to Qh for return - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1669,7 +1675,7 @@ Routine Description: Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV DeviceAddr - Address of Device EndPointAddr - Address of Endpoint DeviceSpeed - Device Speed @@ -1677,12 +1683,12 @@ Arguments: Interval - value of interval Translator - Translator Transaction for SplitX QhPtrPtr - A pointer of pointer to Qh for return - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1695,17 +1701,17 @@ DestoryQh ( Routine Description: - Destory Qh Structure - + Destory Qh Structure + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV QhPtr - A pointer to Qh - + Returns: VOID - + --*/ ; @@ -1727,19 +1733,19 @@ Routine Description: Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV DataPtr - A pointer to user data buffer to transfer DataLen - Length of user data to transfer PktId - Packet Identification of this Qtd Toggle - Data Toggle of this Qtd QtdStatus - Default value of status of this Qtd QtdPtrPtr - A pointer of pointer to Qtd for return - + Returns: EFI_SUCCESS Success EFI_OUT_OF_RESOURCES Cannot allocate resources - + --*/ ; @@ -1753,19 +1759,19 @@ CreateSetupQtd ( Routine Description: - Create Qtd Structure for Setup + Create Qtd Structure for Setup Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV DevReqPtr - A pointer to Device Request Data QtdPtrPtr - A pointer of pointer to Qtd for return - + Returns: EFI_SUCCESS Success EFI_OUT_OF_RESOURCES Cannot allocate resources - + --*/ ; @@ -1782,22 +1788,22 @@ CreateDataQtd ( Routine Description: - Create Qtd Structure for data + Create Qtd Structure for data Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV DataPtr - A pointer to user data buffer to transfer DataLen - Length of user data to transfer PktId - Packet Identification of this Qtd Toggle - Data Toggle of this Qtd QtdPtrPtr - A pointer of pointer to Qtd for return - + Returns: EFI_SUCCESS Success EFI_OUT_OF_RESOURCES Cannot allocate resources - + --*/ ; @@ -1811,19 +1817,19 @@ CreateStatusQtd ( Routine Description: - Create Qtd Structure for status + Create Qtd Structure for status Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV PktId - Packet Identification of this Qtd QtdPtrPtr - A pointer of pointer to Qtd for return - + Returns: EFI_SUCCESS Success EFI_OUT_OF_RESOURCES Cannot allocate resources - + --*/ ; @@ -1837,19 +1843,19 @@ CreateAltQtd ( Routine Description: - Create Qtd Structure for Alternative + Create Qtd Structure for Alternative Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV PktId - Packet Identification of this Qtd QtdPtrPtr - A pointer of pointer to Qtd for return - + Returns: EFI_SUCCESS Success EFI_OUT_OF_RESOURCES Cannot allocate resources - + --*/ ; @@ -1867,22 +1873,22 @@ CreateControlQtds ( Routine Description: - Create Qtds list for Control Transfer + Create Qtds list for Control Transfer Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV DataPktId - Packet Identification of Data Qtds RequestCursor - A pointer to request structure buffer to transfer DataCursor - A pointer to user data buffer to transfer DataLen - Length of user data to transfer ControlQtdsHead - A pointer of pointer to first Qtd for control tranfer for return - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1899,23 +1905,23 @@ CreateBulkOrInterruptQtds ( Routine Description: - Create Qtds list for Bulk or Interrupt Transfer + Create Qtds list for Bulk or Interrupt Transfer Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV PktId - Packet Identification of Qtds DataCursor - A pointer to user data buffer to transfer DataLen - Length of user data to transfer DataToggle - Data Toggle to start Translator - Translator Transaction for SplitX QtdsHead - A pointer of pointer to first Qtd for control tranfer for return - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -1932,9 +1938,9 @@ Routine Description: Arguments: - HcDev - USB2_HC_DEV - FirstQtdPtr - A pointer to first Qtd in the list - + HcDev - USB2_HC_DEV + FirstQtdPtr - A pointer to first Qtd in the list + Returns: VOID @@ -1952,12 +1958,12 @@ LinkQtdToQtd ( Routine Description: Link Qtds together - + Arguments: PreQtdPtr - A pointer to pre Qtd QtdPtr - A pointer to next Qtd - + Returns: VOID @@ -1975,12 +1981,12 @@ LinkQtdsToAltQtd ( Routine Description: Link AlterQtds together - + Arguments: FirstQtdPtr - A pointer to first Qtd in the list AltQtdPtr - A pointer to alternative Qtd - + Returns: VOID @@ -1997,12 +2003,12 @@ LinkQtdToQh ( Routine Description: Link Qtds list to Qh - + Arguments: QhPtr - A pointer to Qh QtdPtr - A pointer to first Qtd in the list - + Returns: VOID @@ -2020,17 +2026,17 @@ LinkQhToAsyncList ( Routine Description: Link Qh to Async Schedule List - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV QhPtr - A pointer to Qh - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -2044,17 +2050,17 @@ UnlinkQhFromAsyncList ( Routine Description: Unlink Qh from Async Schedule List - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV QhPtr - A pointer to Qh - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -2068,12 +2074,12 @@ LinkQhToPeriodicList ( Routine Description: Link Qh to Periodic Schedule List - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV QhPtr - A pointer to Qh - + Returns: VOID @@ -2092,17 +2098,17 @@ UnlinkQhFromPeriodicList ( Routine Description: Unlink Qh from Periodic Schedule List - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV QhPtr - A pointer to Qh Interval - Interval of this periodic transfer - + Returns: VOID - + --*/ ; @@ -2116,16 +2122,16 @@ LinkToAsyncReqeust ( Routine Description: Llink AsyncRequest Entry to Async Request List - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV AsyncRequestPtr - A pointer to Async Request Entry - + Returns: VOID - + --*/ ; @@ -2139,16 +2145,16 @@ UnlinkFromAsyncReqeust ( Routine Description: Unlink AsyncRequest Entry from Async Request List - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV AsyncRequestPtr - A pointer to Async Request Entry - + Returns: VOID - + --*/ ; @@ -2161,11 +2167,11 @@ GetNumberOfQtd ( Routine Description: Number of Qtds in the list - + Arguments: FirstQtdPtr - A pointer to first Qtd in the list - + Returns: Number of Qtds in the list @@ -2173,28 +2179,7 @@ Returns: --*/ ; -UINTN -GetNumberOfTransaction ( - IN UINTN SizeOfData, - IN UINTN SizeOfTransaction - ) -/*++ - -Routine Description: - Number of Transactions in one Qtd - -Arguments: - - SizeOfData - Size of one Qtd - SizeOfTransaction - Size of one Transaction - -Returns: - - Number of Transactions in this Qtd - ---*/ -; UINTN GetCapacityOfQtd ( @@ -2205,11 +2190,11 @@ GetCapacityOfQtd ( Routine Description: Get Capacity of Qtd - + Arguments: BufferCursor - BufferCursor of the Qtd - + Returns: Capacity of Qtd @@ -2226,15 +2211,15 @@ GetApproxiOfInterval ( Routine Description: Get the approximate value in the 2 index sequence - + Arguments: Interval - the value of interval - + Returns: approximate value of interval in the 2 index sequence - + --*/ ; @@ -2247,15 +2232,15 @@ GetQtdNextPointer ( Routine Description: Get Qtd next pointer field - + Arguments: HwQtdPtr - A pointer to hardware Qtd structure - + Returns: A pointer to next hardware Qtd structure - + --*/ ; @@ -2268,16 +2253,16 @@ IsQtdStatusActive ( Routine Description: Whether Qtd status is active or not - + Arguments: HwQtdPtr - A pointer to hardware Qtd structure - + Returns: TRUE Active FALSE Inactive - + --*/ ; @@ -2290,16 +2275,16 @@ IsQtdStatusHalted ( Routine Description: Whether Qtd status is halted or not - + Arguments: HwQtdPtr - A pointer to hardware Qtd structure - + Returns: TRUE Halted FALSE Not halted - + --*/ ; @@ -2312,16 +2297,16 @@ IsQtdStatusBufferError ( Routine Description: Whether Qtd status is buffer error or not - + Arguments: HwQtdPtr - A pointer to hardware Qtd structure - + Returns: TRUE Buffer error FALSE No buffer error - + --*/ ; @@ -2334,16 +2319,16 @@ IsQtdStatusBabbleError ( Routine Description: Whether Qtd status is babble error or not - + Arguments: HwQtdPtr - A pointer to hardware Qtd structure - + Returns: TRUE Babble error FALSE No babble error - + --*/ ; @@ -2356,16 +2341,16 @@ IsQtdStatusTransactionError ( Routine Description: Whether Qtd status is transaction error or not - + Arguments: HwQtdPtr - A pointer to hardware Qtd structure - + Returns: TRUE Transaction error FALSE No transaction error - + --*/ ; @@ -2378,16 +2363,16 @@ IsDataInTransfer ( Routine Description: Whether is a DataIn direction transfer - + Arguments: - EndPointAddress - address of the endpoint - + EndPointAddress - address of the endpoint + Returns: TRUE DataIn FALSE DataOut - + --*/ ; @@ -2406,22 +2391,22 @@ MapDataBuffer ( Routine Description: Map address of user data buffer - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV TransferDirection - direction of transfer - Data - A pointer to user data buffer + Data - A pointer to user data buffer DataLength - length of user data PktId - Packte Identificaion DataCursor - mapped address to return DataMap - identificaion of this mapping to return - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -2437,19 +2422,19 @@ MapRequestBuffer ( Routine Description: Map address of request structure buffer - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV Request - A pointer to request structure RequestCursor - Mapped address of request structure to return RequestMap - Identificaion of this mapping to return - + Returns: EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + --*/ ; @@ -2467,10 +2452,10 @@ Routine Description: Arguments: - QtdHwPtr - A pointer to Qtd hardware structure + QtdHwPtr - A pointer to Qtd hardware structure DataPtr - A pointer to user data buffer DataLen - Length of the user data buffer - + Returns: VOID @@ -2487,15 +2472,15 @@ GetQtdAlternateNextPointer ( Routine Description: Get Qtd alternate next pointer field - + Arguments: HwQtdPtr - A pointer to hardware Qtd structure - + Returns: A pointer to hardware alternate Qtd - + --*/ ; @@ -2508,15 +2493,15 @@ ZeroOutQhOverlay ( Routine Description: Zero out the fields in Qh structure - + Arguments: QhPtr - A pointer to Qh structure - + Returns: VOID - + --*/ ; @@ -2531,17 +2516,17 @@ UpdateAsyncRequestTransfer ( Routine Description: Update asynchronous request transfer - + Arguments: - AsyncRequestPtr - A pointer to async request - TransferResult - transfer result + AsyncRequestPtr - A pointer to async request + TransferResult - transfer result ErrQtdPos - postion of error Qtd - + Returns: VOID - + --*/ ; @@ -2558,14 +2543,14 @@ DeleteAsyncRequestTransfer ( Routine Description: Delete all asynchronous request transfer - + Arguments: - HcDev - USB2_HC_DEV + HcDev - USB2_HC_DEV DeviceAddress - address of usb device EndPointAddress - address of endpoint DataToggle - stored data toggle - + Returns: EFI_SUCCESS Success @@ -2583,14 +2568,14 @@ CleanUpAllAsyncRequestTransfer ( Routine Description: Clean up all asynchronous request transfer - + Arguments: - HcDev - USB2_HC_DEV - + HcDev - USB2_HC_DEV + Returns: VOID - + --*/ ; @@ -2615,16 +2600,16 @@ Arguments: HcDev - USB2_HC_DEV IsControl - Is control transfer or not QhPtr - A pointer to Qh - ActualLen - Actual transfered Len + ActualLen - Actual transfered Len DataToggle - Data Toggle TimeOut - TimeOut threshold TransferResult - Transfer result - + Returns: EFI_SUCCESS Sucess EFI_DEVICE_ERROR Error - + --*/ ; @@ -2654,7 +2639,7 @@ Returns: TRUE Qtds finished FALSE Not finish - + --*/ ; @@ -2666,22 +2651,48 @@ AsyncRequestMoniter ( /*++ Routine Description: - + Interrupt transfer periodic check handler - + Arguments: Event - Interrupt event Context - Pointer to USB2_HC_DEV - + Returns: - + EFI_SUCCESS Success EFI_DEVICE_ERROR Fail - + +--*/ +; + + +EFI_STATUS +CreateNULLQH ( + IN USB2_HC_DEV *HcDev + ) +/*++ + +Routine Description: + + Create the NULL QH to make it as the Async QH header + +Arguments: + + HcDev - USB2_HC_DEV + +Returns: + + EFI_SUCCESS Success --*/ ; +VOID +DestroyNULLQH ( + IN USB2_HC_DEV *HcDev + ); + VOID ClearLegacySupport ( IN USB2_HC_DEV *HcDev @@ -2692,8 +2703,11 @@ HostReset ( IN USB2_HC_DEV *HcDev ); -VOID + +VOID DumpEHCIPortsStatus ( IN USB2_HC_DEV *HcDev ); + + #endif