3 This file contains the definition for XHCI host controller schedule routines.
5 Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef _EFI_XHCI_SCHED_H_
17 #define _EFI_XHCI_SCHED_H_
19 #define XHC_URB_SIG SIGNATURE_32 ('U', 'S', 'B', 'R')
22 // Transfer types, used in URB to identify the transfer type
24 #define XHC_CTRL_TRANSFER 0x01
25 #define XHC_BULK_TRANSFER 0x02
26 #define XHC_INT_TRANSFER_SYNC 0x04
27 #define XHC_INT_TRANSFER_ASYNC 0x08
28 #define XHC_INT_ONLY_TRANSFER_ASYNC 0x10
33 #define TRB_TYPE_NORMAL 1
34 #define TRB_TYPE_SETUP_STAGE 2
35 #define TRB_TYPE_DATA_STAGE 3
36 #define TRB_TYPE_STATUS_STAGE 4
37 #define TRB_TYPE_ISOCH 5
38 #define TRB_TYPE_LINK 6
39 #define TRB_TYPE_EVENT_DATA 7
40 #define TRB_TYPE_NO_OP 8
41 #define TRB_TYPE_EN_SLOT 9
42 #define TRB_TYPE_DIS_SLOT 10
43 #define TRB_TYPE_ADDRESS_DEV 11
44 #define TRB_TYPE_CON_ENDPOINT 12
45 #define TRB_TYPE_EVALU_CONTXT 13
46 #define TRB_TYPE_RESET_ENDPOINT 14
47 #define TRB_TYPE_STOP_ENDPOINT 15
48 #define TRB_TYPE_SET_TR_DEQUE 16
49 #define TRB_TYPE_RESET_DEV 17
50 #define TRB_TYPE_GET_PORT_BANW 21
51 #define TRB_TYPE_FORCE_HEADER 22
52 #define TRB_TYPE_NO_OP_COMMAND 23
53 #define TRB_TYPE_TRANS_EVENT 32
54 #define TRB_TYPE_COMMAND_COMPLT_EVENT 33
55 #define TRB_TYPE_PORT_STATUS_CHANGE_EVENT 34
56 #define TRB_TYPE_HOST_CONTROLLER_EVENT 37
57 #define TRB_TYPE_DEVICE_NOTIFI_EVENT 38
58 #define TRB_TYPE_MFINDEX_WRAP_EVENT 39
61 // Endpoint Type (EP Type).
63 #define ED_NOT_VALID 0
64 #define ED_ISOCH_OUT 1
66 #define ED_INTERRUPT_OUT 3
67 #define ED_CONTROL_BIDIR 4
70 #define ED_INTERRUPT_IN 7
73 // 6.4.5 TRB Completion Codes
75 #define TRB_COMPLETION_INVALID 0
76 #define TRB_COMPLETION_SUCCESS 1
77 #define TRB_COMPLETION_DATA_BUFFER_ERROR 2
78 #define TRB_COMPLETION_BABBLE_ERROR 3
79 #define TRB_COMPLETION_USB_TRANSACTION_ERROR 4
80 #define TRB_COMPLETION_TRB_ERROR 5
81 #define TRB_COMPLETION_STALL_ERROR 6
82 #define TRB_COMPLETION_SHORT_PACKET 13
85 // The topology string used to present usb device location
87 typedef struct _USB_DEV_TOPOLOGY
{
89 // The tier concatenation of down stream port.
91 UINT32 RouteString
:20;
93 // The root port number of the chain.
97 // The Tier the device reside.
103 // USB Device's RouteChart
105 typedef union _USB_DEV_ROUTE
{
107 USB_DEV_TOPOLOGY Route
;
111 // Endpoint address and its capabilities
113 typedef struct _USB_ENDPOINT
{
115 // Store logical device address assigned by UsbBus
116 // It's because some XHCI host controllers may assign the same physcial device
117 // address for those devices inserted at different root port.
122 EFI_USB_DATA_DIRECTION Direction
;
131 typedef struct _TRB_TEMPLATE
{
144 typedef struct _TRANSFER_RING
{
147 TRB_TEMPLATE
*RingEnqueue
;
148 TRB_TEMPLATE
*RingDequeue
;
152 typedef struct _EVENT_RING
{
156 TRB_TEMPLATE
*EventRingEnqueue
;
157 TRB_TEMPLATE
*EventRingDequeue
;
162 // URB (Usb Request Block) contains information for all kinds of
165 typedef struct _URB
{
169 // Usb Device URB related information
172 EFI_USB_DEVICE_REQUEST
*Request
;
175 EFI_ASYNC_USB_TRANSFER_CALLBACK Callback
;
182 // completed data length
186 // Command/Tranfer Ring info
189 TRB_TEMPLATE
*TrbStart
;
190 TRB_TEMPLATE
*TrbEnd
;
196 TRB_TEMPLATE
*EvtTrb
;
200 // 6.5 Event Ring Segment Table
201 // The Event Ring Segment Table is used to define multi-segment Event Rings and to enable runtime
202 // expansion and shrinking of the Event Ring. The location of the Event Ring Segment Table is defined by the
203 // Event Ring Segment Table Base Address Register (5.5.2.3.2). The size of the Event Ring Segment Table
204 // is defined by the Event Ring Segment Table Base Size Register (5.5.2.3.1).
206 typedef struct _EVENT_RING_SEG_TABLE_ENTRY
{
209 UINT32 RingTrbSize
:16;
212 } EVENT_RING_SEG_TABLE_ENTRY
;
215 // 6.4.1.1 Normal TRB
216 // A Normal TRB is used in several ways; exclusively on Bulk and Interrupt Transfer Rings for normal and
217 // Scatter/Gather operations, to define additional data buffers for Scatter/Gather operations on Isoch Transfer
218 // Rings, and to define the Data stage information for Control Transfer Rings.
220 typedef struct _TRANSFER_TRB_NORMAL
{
240 } TRANSFER_TRB_NORMAL
;
243 // 6.4.1.2.1 Setup Stage TRB
244 // A Setup Stage TRB is created by system software to initiate a USB Setup packet on a control endpoint.
246 typedef struct _TRANSFER_TRB_CONTROL_SETUP
{
247 UINT32 bmRequestType
:8;
266 } TRANSFER_TRB_CONTROL_SETUP
;
269 // 6.4.1.2.2 Data Stage TRB
270 // A Data Stage TRB is used generate the Data stage transaction of a USB Control transfer.
272 typedef struct _TRANSFER_TRB_CONTROL_DATA
{
292 } TRANSFER_TRB_CONTROL_DATA
;
295 // 6.4.1.2.2 Data Stage TRB
296 // A Data Stage TRB is used generate the Data stage transaction of a USB Control transfer.
298 typedef struct _TRANSFER_TRB_CONTROL_STATUS
{
314 } TRANSFER_TRB_CONTROL_STATUS
;
317 // 6.4.2.1 Transfer Event TRB
318 // A Transfer Event provides the completion status associated with a Transfer TRB. Refer to section 4.11.3.1
319 // for more information on the use and operation of Transfer Events.
321 typedef struct _EVT_TRB_TRANSFER
{
327 UINT32 Completecode
:8;
340 // 6.4.2.2 Command Completion Event TRB
341 // A Command Completion Event TRB shall be generated by the xHC when a command completes on the
342 // Command Ring. Refer to section 4.11.4 for more information on the use of Command Completion Events.
344 typedef struct _EVT_TRB_COMMAND_COMPLETION
{
350 UINT32 Completecode
:8;
357 } EVT_TRB_COMMAND_COMPLETION
;
360 TRB_TEMPLATE TrbTemplate
;
361 TRANSFER_TRB_NORMAL TrbNormal
;
362 TRANSFER_TRB_CONTROL_SETUP TrbCtrSetup
;
363 TRANSFER_TRB_CONTROL_DATA TrbCtrData
;
364 TRANSFER_TRB_CONTROL_STATUS TrbCtrStatus
;
368 // 6.4.3.1 No Op Command TRB
369 // The No Op Command TRB provides a simple means for verifying the operation of the Command Ring
370 // mechanisms offered by the xHCI.
372 typedef struct _CMD_TRB_NO_OP
{
384 // 6.4.3.2 Enable Slot Command TRB
385 // The Enable Slot Command TRB causes the xHC to select an available Device Slot and return the ID of the
386 // selected slot to the host in a Command Completion Event.
388 typedef struct _CMD_TRB_ENABLE_SLOT
{
397 } CMD_TRB_ENABLE_SLOT
;
400 // 6.4.3.3 Disable Slot Command TRB
401 // The Disable Slot Command TRB releases any bandwidth assigned to the disabled slot and frees any
402 // internal xHC resources assigned to the slot.
404 typedef struct _CMD_TRB_DISABLE_SLOT
{
414 } CMD_TRB_DISABLE_SLOT
;
417 // 6.4.3.4 Address Device Command TRB
418 // The Address Device Command TRB transitions the selected Device Context from the Default to the
419 // Addressed state and causes the xHC to select an address for the USB device in the Default State and
420 // issue a SET_ADDRESS request to the USB device.
422 typedef struct _CMD_TRB_ADDRESS_DEVICE
{
435 } CMD_TRB_ADDRESS_DEVICE
;
438 // 6.4.3.5 Configure Endpoint Command TRB
439 // The Configure Endpoint Command TRB evaluates the bandwidth and resource requirements of the
440 // endpoints selected by the command.
442 typedef struct _CMD_TRB_CONFIG_ENDPOINT
{
455 } CMD_TRB_CONFIG_ENDPOINT
;
458 // 6.4.3.6 Evaluate Context Command TRB
459 // The Evaluate Context Command TRB is used by system software to inform the xHC that the selected
460 // Context data structures in the Device Context have been modified by system software and that the xHC
461 // shall evaluate any changes
463 typedef struct _CMD_TRB_EVALUATE_CONTEXT
{
475 } CMD_TRB_EVALUATE_CONTEXT
;
478 // 6.4.3.7 Reset Endpoint Command TRB
479 // The Reset Endpoint Command TRB is used by system software to reset a specified Transfer Ring
481 typedef struct _CMD_TRB_RESET_ENDPOINT
{
493 } CMD_TRB_RESET_ENDPOINT
;
496 // 6.4.3.8 Stop Endpoint Command TRB
497 // The Stop Endpoint Command TRB command allows software to stop the xHC execution of the TDs on a
498 // Transfer Ring and temporarily take ownership of TDs that had previously been passed to the xHC.
500 typedef struct _CMD_TRB_STOP_ENDPOINT
{
512 } CMD_TRB_STOP_ENDPOINT
;
515 // 6.4.3.9 Set TR Dequeue Pointer Command TRB
516 // The Set TR Dequeue Pointer Command TRB is used by system software to modify the TR Dequeue
517 // Pointer and DCS fields of an Endpoint or Stream Context.
519 typedef struct _CMD_SET_TR_DEQ_POINTER
{
533 } CMD_SET_TR_DEQ_POINTER
;
537 // A Link TRB provides support for non-contiguous TRB Rings.
539 typedef struct _LINK_TRB
{
545 UINT32 InterTarget
:10;
558 // 6.2.2 Slot Context
560 typedef struct _SLOT_CONTEXT
{
561 UINT32 RouteString
:20;
566 UINT32 ContextEntries
:5;
568 UINT32 MaxExitLatency
:16;
569 UINT32 RootHubPortNum
:8;
572 UINT32 TTHubSlotId
:8;
576 UINT32 InterTarget
:10;
578 UINT32 DeviceAddress
:8;
588 typedef struct _SLOT_CONTEXT_64
{
589 UINT32 RouteString
:20;
594 UINT32 ContextEntries
:5;
596 UINT32 MaxExitLatency
:16;
597 UINT32 RootHubPortNum
:8;
600 UINT32 TTHubSlotId
:8;
604 UINT32 InterTarget
:10;
606 UINT32 DeviceAddress
:8;
629 // 6.2.3 Endpoint Context
631 typedef struct _ENDPOINT_CONTEXT
{
635 UINT32 MaxPStreams
:5;
645 UINT32 MaxBurstSize
:8;
646 UINT32 MaxPacketSize
:16;
652 UINT32 AverageTRBLength
:16;
653 UINT32 MaxESITPayload
:16;
660 typedef struct _ENDPOINT_CONTEXT_64
{
664 UINT32 MaxPStreams
:5;
674 UINT32 MaxBurstSize
:8;
675 UINT32 MaxPacketSize
:16;
681 UINT32 AverageTRBLength
:16;
682 UINT32 MaxESITPayload
:16;
698 } ENDPOINT_CONTEXT_64
;
702 // 6.2.5.1 Input Control Context
704 typedef struct _INPUT_CONTRL_CONTEXT
{
713 } INPUT_CONTRL_CONTEXT
;
715 typedef struct _INPUT_CONTRL_CONTEXT_64
{
732 } INPUT_CONTRL_CONTEXT_64
;
735 // 6.2.1 Device Context
737 typedef struct _DEVICE_CONTEXT
{
739 ENDPOINT_CONTEXT EP
[31];
742 typedef struct _DEVICE_CONTEXT_64
{
743 SLOT_CONTEXT_64 Slot
;
744 ENDPOINT_CONTEXT_64 EP
[31];
748 // 6.2.5 Input Context
750 typedef struct _INPUT_CONTEXT
{
751 INPUT_CONTRL_CONTEXT InputControlContext
;
753 ENDPOINT_CONTEXT EP
[31];
756 typedef struct _INPUT_CONTEXT_64
{
757 INPUT_CONTRL_CONTEXT_64 InputControlContext
;
758 SLOT_CONTEXT_64 Slot
;
759 ENDPOINT_CONTEXT_64 EP
[31];
764 Initialize the XHCI host controller for schedule.
766 @param Xhc The XHCI Instance to be initialized.
771 IN USB_XHCI_INSTANCE
*Xhc
775 Free the resouce allocated at initializing schedule.
777 @param Xhc The XHCI Instance.
782 IN USB_XHCI_INSTANCE
*Xhc
786 Ring the door bell to notify XHCI there is a transaction to be executed through URB.
788 @param Xhc The XHCI Instance.
789 @param Urb The URB to be rung.
791 @retval EFI_SUCCESS Successfully ring the door bell.
795 RingIntTransferDoorBell (
796 IN USB_XHCI_INSTANCE
*Xhc
,
801 Execute the transfer by polling the URB. This is a synchronous operation.
803 @param Xhc The XHCI Instance.
804 @param CmdTransfer The executed URB is for cmd transfer or not.
805 @param Urb The URB to execute.
806 @param Timeout The time to wait before abort, in millisecond.
808 @return EFI_DEVICE_ERROR The transfer failed due to transfer error.
809 @return EFI_TIMEOUT The transfer failed due to time out.
810 @return EFI_SUCCESS The transfer finished OK.
815 IN USB_XHCI_INSTANCE
*Xhc
,
816 IN BOOLEAN CmdTransfer
,
822 Delete a single asynchronous interrupt transfer for
823 the device and endpoint.
825 @param Xhc The XHCI Instance.
826 @param BusAddr The logical device address assigned by UsbBus driver.
827 @param EpNum The endpoint of the target.
829 @retval EFI_SUCCESS An asynchronous transfer is removed.
830 @retval EFI_NOT_FOUND No transfer for the device is found.
834 XhciDelAsyncIntTransfer (
835 IN USB_XHCI_INSTANCE
*Xhc
,
841 Remove all the asynchronous interrupt transfers.
843 @param Xhc The XHCI Instance.
847 XhciDelAllAsyncIntTransfers (
848 IN USB_XHCI_INSTANCE
*Xhc
854 @param Xhc The XHCI Instance.
858 XhcSetBiosOwnership (
859 IN USB_XHCI_INSTANCE
*Xhc
865 @param Xhc The XHCI Instance.
869 XhcClearBiosOwnership (
870 IN USB_XHCI_INSTANCE
*Xhc
874 Find out the slot id according to the device's route string.
876 @param Xhc The XHCI Instance.
877 @param RouteString The route string described the device location.
879 @return The slot id used by the device.
884 XhcRouteStringToSlotId (
885 IN USB_XHCI_INSTANCE
*Xhc
,
886 IN USB_DEV_ROUTE RouteString
890 Calculate the device context index by endpoint address and direction.
892 @param EpAddr The target endpoint number.
893 @param Direction The direction of the target endpoint.
895 @return The device context index of endpoint.
905 Ring the door bell to notify XHCI there is a transaction to be executed.
907 @param Xhc The XHCI Instance.
908 @param SlotId The slot id of the target device.
909 @param Dci The device context index of the target slot or endpoint.
911 @retval EFI_SUCCESS Successfully ring the door bell.
917 IN USB_XHCI_INSTANCE
*Xhc
,
923 Interrupt transfer periodic check handler.
925 @param Event Interrupt event.
926 @param Context Pointer to USB_XHCI_INSTANCE.
931 XhcMonitorAsyncRequests (
937 Monitor the port status change. Enable/Disable device slot if there is a device attached/detached.
939 @param Xhc The XHCI Instance.
940 @param ParentRouteChart The route string pointed to the parent device if it exists.
941 @param Port The port to be polled.
942 @param PortState The port state.
944 @retval EFI_SUCCESS Successfully enable/disable device slot according to port state.
945 @retval Others Should not appear.
950 XhcPollPortStatusChange (
951 IN USB_XHCI_INSTANCE
*Xhc
,
952 IN USB_DEV_ROUTE ParentRouteChart
,
954 IN EFI_USB_PORT_STATUS
*PortState
958 Evaluate the slot context for hub device through XHCI's Configure_Endpoint cmd.
960 @param Xhc The XHCI Instance.
961 @param SlotId The slot id to be configured.
962 @param PortNum The total number of downstream port supported by the hub.
963 @param TTT The TT think time of the hub device.
964 @param MTT The multi-TT of the hub device.
966 @retval EFI_SUCCESS Successfully configure the hub device's slot context.
970 XhcConfigHubContext (
971 IN USB_XHCI_INSTANCE
*Xhc
,
980 Evaluate the slot context for hub device through XHCI's Configure_Endpoint cmd.
982 @param Xhc The XHCI Instance.
983 @param SlotId The slot id to be configured.
984 @param PortNum The total number of downstream port supported by the hub.
985 @param TTT The TT think time of the hub device.
986 @param MTT The multi-TT of the hub device.
988 @retval EFI_SUCCESS Successfully configure the hub device's slot context.
992 XhcConfigHubContext64 (
993 IN USB_XHCI_INSTANCE
*Xhc
,
1002 Configure all the device endpoints through XHCI's Configure_Endpoint cmd.
1004 @param Xhc The XHCI Instance.
1005 @param SlotId The slot id to be configured.
1006 @param DeviceSpeed The device's speed.
1007 @param ConfigDesc The pointer to the usb device configuration descriptor.
1009 @retval EFI_SUCCESS Successfully configure all the device endpoints.
1015 IN USB_XHCI_INSTANCE
*Xhc
,
1017 IN UINT8 DeviceSpeed
,
1018 IN USB_CONFIG_DESCRIPTOR
*ConfigDesc
1023 Configure all the device endpoints through XHCI's Configure_Endpoint cmd.
1025 @param Xhc The XHCI Instance.
1026 @param SlotId The slot id to be configured.
1027 @param DeviceSpeed The device's speed.
1028 @param ConfigDesc The pointer to the usb device configuration descriptor.
1030 @retval EFI_SUCCESS Successfully configure all the device endpoints.
1036 IN USB_XHCI_INSTANCE
*Xhc
,
1038 IN UINT8 DeviceSpeed
,
1039 IN USB_CONFIG_DESCRIPTOR
*ConfigDesc
1044 Find out the actual device address according to the requested device address from UsbBus.
1046 @param Xhc The XHCI Instance.
1047 @param BusDevAddr The requested device address by UsbBus upper driver.
1049 @return The actual device address assigned to the device.
1054 XhcBusDevAddrToSlotId (
1055 IN USB_XHCI_INSTANCE
*Xhc
,
1060 Assign and initialize the device slot for a new device.
1062 @param Xhc The XHCI Instance.
1063 @param ParentRouteChart The route string pointed to the parent device.
1064 @param ParentPort The port at which the device is located.
1065 @param RouteChart The route string pointed to the device.
1066 @param DeviceSpeed The device speed.
1068 @retval EFI_SUCCESS Successfully assign a slot to the device and assign an address to it.
1073 XhcInitializeDeviceSlot (
1074 IN USB_XHCI_INSTANCE
*Xhc
,
1075 IN USB_DEV_ROUTE ParentRouteChart
,
1076 IN UINT16 ParentPort
,
1077 IN USB_DEV_ROUTE RouteChart
,
1078 IN UINT8 DeviceSpeed
1082 Assign and initialize the device slot for a new device.
1084 @param Xhc The XHCI Instance.
1085 @param ParentRouteChart The route string pointed to the parent device.
1086 @param ParentPort The port at which the device is located.
1087 @param RouteChart The route string pointed to the device.
1088 @param DeviceSpeed The device speed.
1090 @retval EFI_SUCCESS Successfully assign a slot to the device and assign an address to it.
1095 XhcInitializeDeviceSlot64 (
1096 IN USB_XHCI_INSTANCE
*Xhc
,
1097 IN USB_DEV_ROUTE ParentRouteChart
,
1098 IN UINT16 ParentPort
,
1099 IN USB_DEV_ROUTE RouteChart
,
1100 IN UINT8 DeviceSpeed
1104 Evaluate the endpoint 0 context through XHCI's Evaluate_Context cmd.
1106 @param Xhc The XHCI Instance.
1107 @param SlotId The slot id to be evaluated.
1108 @param MaxPacketSize The max packet size supported by the device control transfer.
1110 @retval EFI_SUCCESS Successfully evaluate the device endpoint 0.
1115 XhcEvaluateContext (
1116 IN USB_XHCI_INSTANCE
*Xhc
,
1118 IN UINT32 MaxPacketSize
1123 Evaluate the endpoint 0 context through XHCI's Evaluate_Context cmd.
1125 @param Xhc The XHCI Instance.
1126 @param SlotId The slot id to be evaluated.
1127 @param MaxPacketSize The max packet size supported by the device control transfer.
1129 @retval EFI_SUCCESS Successfully evaluate the device endpoint 0.
1134 XhcEvaluateContext64 (
1135 IN USB_XHCI_INSTANCE
*Xhc
,
1137 IN UINT32 MaxPacketSize
1142 Disable the specified device slot.
1144 @param Xhc The XHCI Instance.
1145 @param SlotId The slot id to be disabled.
1147 @retval EFI_SUCCESS Successfully disable the device slot.
1153 IN USB_XHCI_INSTANCE
*Xhc
,
1159 Disable the specified device slot.
1161 @param Xhc The XHCI Instance.
1162 @param SlotId The slot id to be disabled.
1164 @retval EFI_SUCCESS Successfully disable the device slot.
1169 XhcDisableSlotCmd64 (
1170 IN USB_XHCI_INSTANCE
*Xhc
,
1176 Synchronize the specified transfer ring to update the enqueue and dequeue pointer.
1178 @param Xhc The XHCI Instance.
1179 @param TrsRing The transfer ring to sync.
1181 @retval EFI_SUCCESS The transfer ring is synchronized successfully.
1187 IN USB_XHCI_INSTANCE
*Xhc
,
1188 TRANSFER_RING
*TrsRing
1192 Synchronize the specified event ring to update the enqueue and dequeue pointer.
1194 @param Xhc The XHCI Instance.
1195 @param EvtRing The event ring to sync.
1197 @retval EFI_SUCCESS The event ring is synchronized successfully.
1203 IN USB_XHCI_INSTANCE
*Xhc
,
1208 Check if there is a new generated event.
1210 @param Xhc The XHCI Instance.
1211 @param EvtRing The event ring to check.
1212 @param NewEvtTrb The new event TRB found.
1214 @retval EFI_SUCCESS Found a new event TRB at the event ring.
1215 @retval EFI_NOT_READY The event ring has no new event.
1221 IN USB_XHCI_INSTANCE
*Xhc
,
1222 IN EVENT_RING
*EvtRing
,
1223 OUT TRB_TEMPLATE
**NewEvtTrb
1227 Create XHCI transfer ring.
1229 @param Xhc The XHCI Instance.
1230 @param TrbNum The number of TRB in the ring.
1231 @param TransferRing The created transfer ring.
1235 CreateTransferRing (
1236 IN USB_XHCI_INSTANCE
*Xhc
,
1238 OUT TRANSFER_RING
*TransferRing
1242 Create XHCI event ring.
1244 @param Xhc The XHCI Instance.
1245 @param EventRing The created event ring.
1250 IN USB_XHCI_INSTANCE
*Xhc
,
1251 OUT EVENT_RING
*EventRing
1255 System software shall use a Reset Endpoint Command (section 4.11.4.7) to remove the Halted
1256 condition in the xHC. After the successful completion of the Reset Endpoint Command, the Endpoint
1257 Context is transitioned from the Halted to the Stopped state and the Transfer Ring of the endpoint is
1258 reenabled. The next write to the Doorbell of the Endpoint will transition the Endpoint Context from the
1259 Stopped to the Running state.
1261 @param Xhc The XHCI Instance.
1262 @param Urb The urb which makes the endpoint halted.
1264 @retval EFI_SUCCESS The recovery is successful.
1265 @retval Others Failed to recovery halted endpoint.
1270 XhcRecoverHaltedEndpoint (
1271 IN USB_XHCI_INSTANCE
*Xhc
,
1276 Create a new URB for a new transaction.
1278 @param Xhc The XHCI Instance
1279 @param DevAddr The device address
1280 @param EpAddr Endpoint addrress
1281 @param DevSpeed The device speed
1282 @param MaxPacket The max packet length of the endpoint
1283 @param Type The transaction type
1284 @param Request The standard USB request for control transfer
1285 @param Data The user data to transfer
1286 @param DataLen The length of data buffer
1287 @param Callback The function to call when data is transferred
1288 @param Context The context to the callback
1290 @return Created URB or NULL
1295 IN USB_XHCI_INSTANCE
*Xhc
,
1301 IN EFI_USB_DEVICE_REQUEST
*Request
,
1304 IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback
,
1309 Create a transfer TRB.
1311 @param Xhc The XHCI Instance
1312 @param Urb The urb used to construct the transfer TRB.
1314 @return Created TRB or NULL
1318 XhcCreateTransferTrb (
1319 IN USB_XHCI_INSTANCE
*Xhc
,