2 Private Header file for Usb Host Controller PEIM
4 Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef _EFI_PEI_XHCI_SCHED_H_
11 #define _EFI_PEI_XHCI_SCHED_H_
14 // Transfer types, used in URB to identify the transfer type
16 #define XHC_CTRL_TRANSFER 0x01
17 #define XHC_BULK_TRANSFER 0x02
22 #define TRB_TYPE_NORMAL 1
23 #define TRB_TYPE_SETUP_STAGE 2
24 #define TRB_TYPE_DATA_STAGE 3
25 #define TRB_TYPE_STATUS_STAGE 4
26 #define TRB_TYPE_ISOCH 5
27 #define TRB_TYPE_LINK 6
28 #define TRB_TYPE_EVENT_DATA 7
29 #define TRB_TYPE_NO_OP 8
30 #define TRB_TYPE_EN_SLOT 9
31 #define TRB_TYPE_DIS_SLOT 10
32 #define TRB_TYPE_ADDRESS_DEV 11
33 #define TRB_TYPE_CON_ENDPOINT 12
34 #define TRB_TYPE_EVALU_CONTXT 13
35 #define TRB_TYPE_RESET_ENDPOINT 14
36 #define TRB_TYPE_STOP_ENDPOINT 15
37 #define TRB_TYPE_SET_TR_DEQUE 16
38 #define TRB_TYPE_RESET_DEV 17
39 #define TRB_TYPE_GET_PORT_BANW 21
40 #define TRB_TYPE_FORCE_HEADER 22
41 #define TRB_TYPE_NO_OP_COMMAND 23
42 #define TRB_TYPE_TRANS_EVENT 32
43 #define TRB_TYPE_COMMAND_COMPLT_EVENT 33
44 #define TRB_TYPE_PORT_STATUS_CHANGE_EVENT 34
45 #define TRB_TYPE_HOST_CONTROLLER_EVENT 37
46 #define TRB_TYPE_DEVICE_NOTIFI_EVENT 38
47 #define TRB_TYPE_MFINDEX_WRAP_EVENT 39
50 // Endpoint Type (EP Type).
52 #define ED_NOT_VALID 0
53 #define ED_ISOCH_OUT 1
55 #define ED_INTERRUPT_OUT 3
56 #define ED_CONTROL_BIDIR 4
59 #define ED_INTERRUPT_IN 7
62 // 6.4.5 TRB Completion Codes
64 #define TRB_COMPLETION_INVALID 0
65 #define TRB_COMPLETION_SUCCESS 1
66 #define TRB_COMPLETION_DATA_BUFFER_ERROR 2
67 #define TRB_COMPLETION_BABBLE_ERROR 3
68 #define TRB_COMPLETION_USB_TRANSACTION_ERROR 4
69 #define TRB_COMPLETION_TRB_ERROR 5
70 #define TRB_COMPLETION_STALL_ERROR 6
71 #define TRB_COMPLETION_SHORT_PACKET 13
74 // The topology string used to present usb device location
76 typedef struct _USB_DEV_TOPOLOGY
{
78 // The tier concatenation of down stream port.
80 UINT32 RouteString
:20;
82 // The root port number of the chain.
86 // The Tier the device reside.
92 // USB Device's RouteChart
94 typedef union _USB_DEV_ROUTE
{
96 USB_DEV_TOPOLOGY Route
;
100 // Endpoint address and its capabilities
102 typedef struct _USB_ENDPOINT
{
104 // Store logical device address assigned by UsbBus
105 // It's because some XHCI host controllers may assign the same physcial device
106 // address for those devices inserted at different root port.
111 EFI_USB_DATA_DIRECTION Direction
;
120 typedef struct _TRB_TEMPLATE
{
133 typedef struct _TRANSFER_RING
{
136 TRB_TEMPLATE
*RingEnqueue
;
137 TRB_TEMPLATE
*RingDequeue
;
141 typedef struct _EVENT_RING
{
145 TRB_TEMPLATE
*EventRingEnqueue
;
146 TRB_TEMPLATE
*EventRingDequeue
;
150 #define XHC_URB_SIG SIGNATURE_32 ('U', 'S', 'B', 'R')
153 // URB (Usb Request Block) contains information for all kinds of
156 typedef struct _URB
{
159 // Usb Device URB related information
162 EFI_USB_DEVICE_REQUEST
*Request
;
167 EFI_ASYNC_USB_TRANSFER_CALLBACK Callback
;
174 // completed data length
178 // Command/Tranfer Ring info
181 TRB_TEMPLATE
*TrbStart
;
182 TRB_TEMPLATE
*TrbEnd
;
188 TRB_TEMPLATE
*EvtTrb
;
192 // 6.5 Event Ring Segment Table
193 // The Event Ring Segment Table is used to define multi-segment Event Rings and to enable runtime
194 // expansion and shrinking of the Event Ring. The location of the Event Ring Segment Table is defined by the
195 // Event Ring Segment Table Base Address Register (5.5.2.3.2). The size of the Event Ring Segment Table
196 // is defined by the Event Ring Segment Table Base Size Register (5.5.2.3.1).
198 typedef struct _EVENT_RING_SEG_TABLE_ENTRY
{
201 UINT32 RingTrbSize
:16;
204 } EVENT_RING_SEG_TABLE_ENTRY
;
207 // 6.4.1.1 Normal TRB
208 // A Normal TRB is used in several ways; exclusively on Bulk and Interrupt Transfer Rings for normal and
209 // Scatter/Gather operations, to define additional data buffers for Scatter/Gather operations on Isoch Transfer
210 // Rings, and to define the Data stage information for Control Transfer Rings.
212 typedef struct _TRANSFER_TRB_NORMAL
{
232 } TRANSFER_TRB_NORMAL
;
235 // 6.4.1.2.1 Setup Stage TRB
236 // A Setup Stage TRB is created by system software to initiate a USB Setup packet on a control endpoint.
238 typedef struct _TRANSFER_TRB_CONTROL_SETUP
{
239 UINT32 bmRequestType
:8;
258 } TRANSFER_TRB_CONTROL_SETUP
;
261 // 6.4.1.2.2 Data Stage TRB
262 // A Data Stage TRB is used generate the Data stage transaction of a USB Control transfer.
264 typedef struct _TRANSFER_TRB_CONTROL_DATA
{
284 } TRANSFER_TRB_CONTROL_DATA
;
287 // 6.4.1.2.2 Data Stage TRB
288 // A Data Stage TRB is used generate the Data stage transaction of a USB Control transfer.
290 typedef struct _TRANSFER_TRB_CONTROL_STATUS
{
306 } TRANSFER_TRB_CONTROL_STATUS
;
309 // 6.4.2.1 Transfer Event TRB
310 // A Transfer Event provides the completion status associated with a Transfer TRB. Refer to section 4.11.3.1
311 // for more information on the use and operation of Transfer Events.
313 typedef struct _EVT_TRB_TRANSFER
{
319 UINT32 Completecode
:8;
332 // 6.4.2.2 Command Completion Event TRB
333 // A Command Completion Event TRB shall be generated by the xHC when a command completes on the
334 // Command Ring. Refer to section 4.11.4 for more information on the use of Command Completion Events.
336 typedef struct _EVT_TRB_COMMAND_COMPLETION
{
342 UINT32 Completecode
:8;
349 } EVT_TRB_COMMAND_COMPLETION
;
352 TRB_TEMPLATE TrbTemplate
;
353 TRANSFER_TRB_NORMAL TrbNormal
;
354 TRANSFER_TRB_CONTROL_SETUP TrbCtrSetup
;
355 TRANSFER_TRB_CONTROL_DATA TrbCtrData
;
356 TRANSFER_TRB_CONTROL_STATUS TrbCtrStatus
;
360 // 6.4.3.1 No Op Command TRB
361 // The No Op Command TRB provides a simple means for verifying the operation of the Command Ring
362 // mechanisms offered by the xHCI.
364 typedef struct _CMD_TRB_NO_OP
{
376 // 6.4.3.2 Enable Slot Command TRB
377 // The Enable Slot Command TRB causes the xHC to select an available Device Slot and return the ID of the
378 // selected slot to the host in a Command Completion Event.
380 typedef struct _CMD_TRB_ENABLE_SLOT
{
389 } CMD_TRB_ENABLE_SLOT
;
392 // 6.4.3.3 Disable Slot Command TRB
393 // The Disable Slot Command TRB releases any bandwidth assigned to the disabled slot and frees any
394 // internal xHC resources assigned to the slot.
396 typedef struct _CMD_TRB_DISABLE_SLOT
{
406 } CMD_TRB_DISABLE_SLOT
;
409 // 6.4.3.4 Address Device Command TRB
410 // The Address Device Command TRB transitions the selected Device Context from the Default to the
411 // Addressed state and causes the xHC to select an address for the USB device in the Default State and
412 // issue a SET_ADDRESS request to the USB device.
414 typedef struct _CMD_TRB_ADDRESS_DEVICE
{
427 } CMD_TRB_ADDRESS_DEVICE
;
430 // 6.4.3.5 Configure Endpoint Command TRB
431 // The Configure Endpoint Command TRB evaluates the bandwidth and resource requirements of the
432 // endpoints selected by the command.
434 typedef struct _CMD_TRB_CONFIG_ENDPOINT
{
447 } CMD_TRB_CONFIG_ENDPOINT
;
450 // 6.4.3.6 Evaluate Context Command TRB
451 // The Evaluate Context Command TRB is used by system software to inform the xHC that the selected
452 // Context data structures in the Device Context have been modified by system software and that the xHC
453 // shall evaluate any changes
455 typedef struct _CMD_TRB_EVALUATE_CONTEXT
{
467 } CMD_TRB_EVALUATE_CONTEXT
;
470 // 6.4.3.7 Reset Endpoint Command TRB
471 // The Reset Endpoint Command TRB is used by system software to reset a specified Transfer Ring
473 typedef struct _CMD_TRB_RESET_ENDPOINT
{
485 } CMD_TRB_RESET_ENDPOINT
;
488 // 6.4.3.8 Stop Endpoint Command TRB
489 // The Stop Endpoint Command TRB command allows software to stop the xHC execution of the TDs on a
490 // Transfer Ring and temporarily take ownership of TDs that had previously been passed to the xHC.
492 typedef struct _CMD_TRB_STOP_ENDPOINT
{
504 } CMD_TRB_STOP_ENDPOINT
;
507 // 6.4.3.9 Set TR Dequeue Pointer Command TRB
508 // The Set TR Dequeue Pointer Command TRB is used by system software to modify the TR Dequeue
509 // Pointer and DCS fields of an Endpoint or Stream Context.
511 typedef struct _CMD_SET_TR_DEQ_POINTER
{
525 } CMD_SET_TR_DEQ_POINTER
;
529 // A Link TRB provides support for non-contiguous TRB Rings.
531 typedef struct _LINK_TRB
{
537 UINT32 InterTarget
:10;
550 // 6.2.2 Slot Context
552 typedef struct _SLOT_CONTEXT
{
553 UINT32 RouteString
:20;
558 UINT32 ContextEntries
:5;
560 UINT32 MaxExitLatency
:16;
561 UINT32 RootHubPortNum
:8;
564 UINT32 TTHubSlotId
:8;
568 UINT32 InterTarget
:10;
570 UINT32 DeviceAddress
:8;
580 typedef struct _SLOT_CONTEXT_64
{
581 UINT32 RouteString
:20;
586 UINT32 ContextEntries
:5;
588 UINT32 MaxExitLatency
:16;
589 UINT32 RootHubPortNum
:8;
592 UINT32 TTHubSlotId
:8;
596 UINT32 InterTarget
:10;
598 UINT32 DeviceAddress
:8;
621 // 6.2.3 Endpoint Context
623 typedef struct _ENDPOINT_CONTEXT
{
627 UINT32 MaxPStreams
:5;
637 UINT32 MaxBurstSize
:8;
638 UINT32 MaxPacketSize
:16;
644 UINT32 AverageTRBLength
:16;
645 UINT32 MaxESITPayload
:16;
652 typedef struct _ENDPOINT_CONTEXT_64
{
656 UINT32 MaxPStreams
:5;
666 UINT32 MaxBurstSize
:8;
667 UINT32 MaxPacketSize
:16;
673 UINT32 AverageTRBLength
:16;
674 UINT32 MaxESITPayload
:16;
690 } ENDPOINT_CONTEXT_64
;
694 // 6.2.5.1 Input Control Context
696 typedef struct _INPUT_CONTRL_CONTEXT
{
705 } INPUT_CONTRL_CONTEXT
;
707 typedef struct _INPUT_CONTRL_CONTEXT_64
{
724 } INPUT_CONTRL_CONTEXT_64
;
727 // 6.2.1 Device Context
729 typedef struct _DEVICE_CONTEXT
{
731 ENDPOINT_CONTEXT EP
[31];
734 typedef struct _DEVICE_CONTEXT_64
{
735 SLOT_CONTEXT_64 Slot
;
736 ENDPOINT_CONTEXT_64 EP
[31];
740 // 6.2.5 Input Context
742 typedef struct _INPUT_CONTEXT
{
743 INPUT_CONTRL_CONTEXT InputControlContext
;
745 ENDPOINT_CONTEXT EP
[31];
748 typedef struct _INPUT_CONTEXT_64
{
749 INPUT_CONTRL_CONTEXT_64 InputControlContext
;
750 SLOT_CONTEXT_64 Slot
;
751 ENDPOINT_CONTEXT_64 EP
[31];
755 Execute the transfer by polling the URB. This is a synchronous operation.
757 @param Xhc The XHCI device.
758 @param CmdTransfer The executed URB is for cmd transfer or not.
759 @param Urb The URB to execute.
760 @param Timeout The time to wait before abort, in millisecond.
762 @return EFI_DEVICE_ERROR The transfer failed due to transfer error.
763 @return EFI_TIMEOUT The transfer failed due to time out.
764 @return EFI_SUCCESS The transfer finished OK.
770 IN BOOLEAN CmdTransfer
,
776 Find out the actual device address according to the requested device address from UsbBus.
778 @param Xhc The XHCI device.
779 @param BusDevAddr The requested device address by UsbBus upper driver.
781 @return The actual device address assigned to the device.
785 XhcPeiBusDevAddrToSlotId (
791 Find out the slot id according to the device's route string.
793 @param Xhc The XHCI device.
794 @param RouteString The route string described the device location.
796 @return The slot id used by the device.
800 XhcPeiRouteStringToSlotId (
802 IN USB_DEV_ROUTE RouteString
806 Calculate the device context index by endpoint address and direction.
808 @param EpAddr The target endpoint number.
809 @param Direction The direction of the target endpoint.
811 @return The device context index of endpoint.
815 XhcPeiEndpointToDci (
817 IN EFI_USB_DATA_DIRECTION Direction
821 Ring the door bell to notify XHCI there is a transaction to be executed.
823 @param Xhc The XHCI device.
824 @param SlotId The slot id of the target device.
825 @param Dci The device context index of the target slot or endpoint.
836 Monitor the port status change. Enable/Disable device slot if there is a device attached/detached.
838 @param Xhc The XHCI device.
839 @param ParentRouteChart The route string pointed to the parent device if it exists.
840 @param Port The port to be polled.
841 @param PortState The port state.
843 @retval EFI_SUCCESS Successfully enable/disable device slot according to port state.
844 @retval Others Should not appear.
848 XhcPeiPollPortStatusChange (
850 IN USB_DEV_ROUTE ParentRouteChart
,
852 IN EFI_USB_PORT_STATUS
*PortState
856 Evaluate the slot context for hub device through XHCI's Configure_Endpoint cmd.
858 @param Xhc The XHCI device.
859 @param SlotId The slot id to be configured.
860 @param PortNum The total number of downstream port supported by the hub.
861 @param TTT The TT think time of the hub device.
862 @param MTT The multi-TT of the hub device.
864 @retval EFI_SUCCESS Successfully configure the hub device's slot context.
868 XhcPeiConfigHubContext (
877 Evaluate the slot context for hub device through XHCI's Configure_Endpoint cmd.
879 @param Xhc The XHCI device.
880 @param SlotId The slot id to be configured.
881 @param PortNum The total number of downstream port supported by the hub.
882 @param TTT The TT think time of the hub device.
883 @param MTT The multi-TT of the hub device.
885 @retval EFI_SUCCESS Successfully configure the hub device's slot context.
889 XhcPeiConfigHubContext64 (
898 Configure all the device endpoints through XHCI's Configure_Endpoint cmd.
900 @param Xhc The XHCI device.
901 @param SlotId The slot id to be configured.
902 @param DeviceSpeed The device's speed.
903 @param ConfigDesc The pointer to the usb device configuration descriptor.
905 @retval EFI_SUCCESS Successfully configure all the device endpoints.
912 IN UINT8 DeviceSpeed
,
913 IN USB_CONFIG_DESCRIPTOR
*ConfigDesc
917 Configure all the device endpoints through XHCI's Configure_Endpoint cmd.
919 @param Xhc The XHCI device.
920 @param SlotId The slot id to be configured.
921 @param DeviceSpeed The device's speed.
922 @param ConfigDesc The pointer to the usb device configuration descriptor.
924 @retval EFI_SUCCESS Successfully configure all the device endpoints.
928 XhcPeiSetConfigCmd64 (
931 IN UINT8 DeviceSpeed
,
932 IN USB_CONFIG_DESCRIPTOR
*ConfigDesc
936 Stop endpoint through XHCI's Stop_Endpoint cmd.
938 @param Xhc The XHCI device.
939 @param SlotId The slot id of the target device.
940 @param Dci The device context index of the target slot or endpoint.
942 @retval EFI_SUCCESS Stop endpoint successfully.
943 @retval Others Failed to stop endpoint.
955 Reset endpoint through XHCI's Reset_Endpoint cmd.
957 @param Xhc The XHCI device.
958 @param SlotId The slot id of the target device.
959 @param Dci The device context index of the target slot or endpoint.
961 @retval EFI_SUCCESS Reset endpoint successfully.
962 @retval Others Failed to reset endpoint.
967 XhcPeiResetEndpoint (
974 Set transfer ring dequeue pointer through XHCI's Set_Tr_Dequeue_Pointer cmd.
976 @param Xhc The XHCI device.
977 @param SlotId The slot id of the target device.
978 @param Dci The device context index of the target slot or endpoint.
979 @param Urb The dequeue pointer of the transfer ring specified
980 by the urb to be updated.
982 @retval EFI_SUCCESS Set transfer ring dequeue pointer succeeds.
983 @retval Others Failed to set transfer ring dequeue pointer.
988 XhcPeiSetTrDequeuePointer (
996 Assign and initialize the device slot for a new device.
998 @param Xhc The XHCI device.
999 @param ParentRouteChart The route string pointed to the parent device.
1000 @param ParentPort The port at which the device is located.
1001 @param RouteChart The route string pointed to the device.
1002 @param DeviceSpeed The device speed.
1004 @retval EFI_SUCCESS Successfully assign a slot to the device and assign an address to it.
1005 @retval Others Fail to initialize device slot.
1009 XhcPeiInitializeDeviceSlot (
1010 IN PEI_XHC_DEV
*Xhc
,
1011 IN USB_DEV_ROUTE ParentRouteChart
,
1012 IN UINT16 ParentPort
,
1013 IN USB_DEV_ROUTE RouteChart
,
1014 IN UINT8 DeviceSpeed
1018 Assign and initialize the device slot for a new device.
1020 @param Xhc The XHCI device.
1021 @param ParentRouteChart The route string pointed to the parent device.
1022 @param ParentPort The port at which the device is located.
1023 @param RouteChart The route string pointed to the device.
1024 @param DeviceSpeed The device speed.
1026 @retval EFI_SUCCESS Successfully assign a slot to the device and assign an address to it.
1027 @retval Others Fail to initialize device slot.
1031 XhcPeiInitializeDeviceSlot64 (
1032 IN PEI_XHC_DEV
*Xhc
,
1033 IN USB_DEV_ROUTE ParentRouteChart
,
1034 IN UINT16 ParentPort
,
1035 IN USB_DEV_ROUTE RouteChart
,
1036 IN UINT8 DeviceSpeed
1040 Evaluate the endpoint 0 context through XHCI's Evaluate_Context cmd.
1042 @param Xhc The XHCI device.
1043 @param SlotId The slot id to be evaluated.
1044 @param MaxPacketSize The max packet size supported by the device control transfer.
1046 @retval EFI_SUCCESS Successfully evaluate the device endpoint 0.
1050 XhcPeiEvaluateContext (
1051 IN PEI_XHC_DEV
*Xhc
,
1053 IN UINT32 MaxPacketSize
1057 Evaluate the endpoint 0 context through XHCI's Evaluate_Context cmd.
1059 @param Xhc The XHCI device.
1060 @param SlotId The slot id to be evaluated.
1061 @param MaxPacketSize The max packet size supported by the device control transfer.
1063 @retval EFI_SUCCESS Successfully evaluate the device endpoint 0.
1067 XhcPeiEvaluateContext64 (
1068 IN PEI_XHC_DEV
*Xhc
,
1070 IN UINT32 MaxPacketSize
1074 Disable the specified device slot.
1076 @param Xhc The XHCI device.
1077 @param SlotId The slot id to be disabled.
1079 @retval EFI_SUCCESS Successfully disable the device slot.
1083 XhcPeiDisableSlotCmd (
1084 IN PEI_XHC_DEV
*Xhc
,
1089 Disable the specified device slot.
1091 @param Xhc The XHCI device.
1092 @param SlotId The slot id to be disabled.
1094 @retval EFI_SUCCESS Successfully disable the device slot.
1098 XhcPeiDisableSlotCmd64 (
1099 IN PEI_XHC_DEV
*Xhc
,
1104 System software shall use a Reset Endpoint Command (section 4.11.4.7) to remove the Halted
1105 condition in the xHC. After the successful completion of the Reset Endpoint Command, the Endpoint
1106 Context is transitioned from the Halted to the Stopped state and the Transfer Ring of the endpoint is
1107 reenabled. The next write to the Doorbell of the Endpoint will transition the Endpoint Context from the
1108 Stopped to the Running state.
1110 @param Xhc The XHCI device.
1111 @param Urb The urb which makes the endpoint halted.
1113 @retval EFI_SUCCESS The recovery is successful.
1114 @retval Others Failed to recovery halted endpoint.
1118 XhcPeiRecoverHaltedEndpoint (
1119 IN PEI_XHC_DEV
*Xhc
,
1124 System software shall use a Stop Endpoint Command (section 4.6.9) and the Set TR Dequeue Pointer
1125 Command (section 4.6.10) to remove the timed-out TDs from the xHC transfer ring. The next write to
1126 the Doorbell of the Endpoint will transition the Endpoint Context from the Stopped to the Running
1129 @param Xhc The XHCI device.
1130 @param Urb The urb which doesn't get completed in a specified timeout range.
1132 @retval EFI_SUCCESS The dequeuing of the TDs is successful.
1133 @retval Others Failed to stop the endpoint and dequeue the TDs.
1137 XhcPeiDequeueTrbFromEndpoint (
1138 IN PEI_XHC_DEV
*Xhc
,
1143 Create a new URB for a new transaction.
1145 @param Xhc The XHCI device
1146 @param DevAddr The device address
1147 @param EpAddr Endpoint addrress
1148 @param DevSpeed The device speed
1149 @param MaxPacket The max packet length of the endpoint
1150 @param Type The transaction type
1151 @param Request The standard USB request for control transfer
1152 @param Data The user data to transfer
1153 @param DataLen The length of data buffer
1154 @param Callback The function to call when data is transferred
1155 @param Context The context to the callback
1157 @return Created URB or NULL
1162 IN PEI_XHC_DEV
*Xhc
,
1168 IN EFI_USB_DEVICE_REQUEST
*Request
,
1171 IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback
,
1176 Free an allocated URB.
1178 @param Xhc The XHCI device.
1179 @param Urb The URB to free.
1184 IN PEI_XHC_DEV
*Xhc
,
1189 Create a transfer TRB.
1191 @param Xhc The XHCI device
1192 @param Urb The urb used to construct the transfer TRB.
1194 @return Created TRB or NULL
1198 XhcPeiCreateTransferTrb (
1199 IN PEI_XHC_DEV
*Xhc
,
1204 Synchronize the specified transfer ring to update the enqueue and dequeue pointer.
1206 @param Xhc The XHCI device.
1207 @param TrsRing The transfer ring to sync.
1209 @retval EFI_SUCCESS The transfer ring is synchronized successfully.
1214 IN PEI_XHC_DEV
*Xhc
,
1215 IN TRANSFER_RING
*TrsRing
1219 Create XHCI transfer ring.
1221 @param Xhc The XHCI Device.
1222 @param TrbNum The number of TRB in the ring.
1223 @param TransferRing The created transfer ring.
1227 XhcPeiCreateTransferRing (
1228 IN PEI_XHC_DEV
*Xhc
,
1230 OUT TRANSFER_RING
*TransferRing
1234 Check if there is a new generated event.
1236 @param Xhc The XHCI device.
1237 @param EvtRing The event ring to check.
1238 @param NewEvtTrb The new event TRB found.
1240 @retval EFI_SUCCESS Found a new event TRB at the event ring.
1241 @retval EFI_NOT_READY The event ring has no new event.
1245 XhcPeiCheckNewEvent (
1246 IN PEI_XHC_DEV
*Xhc
,
1247 IN EVENT_RING
*EvtRing
,
1248 OUT TRB_TEMPLATE
**NewEvtTrb
1252 Synchronize the specified event ring to update the enqueue and dequeue pointer.
1254 @param Xhc The XHCI device.
1255 @param EvtRing The event ring to sync.
1257 @retval EFI_SUCCESS The event ring is synchronized successfully.
1261 XhcPeiSyncEventRing (
1262 IN PEI_XHC_DEV
*Xhc
,
1263 IN EVENT_RING
*EvtRing
1267 Create XHCI event ring.
1269 @param Xhc The XHCI device.
1270 @param EventRing The created event ring.
1274 XhcPeiCreateEventRing (
1275 IN PEI_XHC_DEV
*Xhc
,
1276 OUT EVENT_RING
*EventRing
1280 Initialize the XHCI host controller for schedule.
1282 @param Xhc The XHCI device to be initialized.
1291 Free the resouce allocated at initializing schedule.
1293 @param Xhc The XHCI device.