2 Defines the USB Host Controller PPI that provides I/O services for a USB Host
3 Controller that may be used to access recovery devices. These interfaces are
4 modeled on the UEFI 2.3 specification EFI_USB2_HOST_CONTROLLER_PROTOCOL.
5 Refer to section 16.1 of the UEFI 2.3 Specification for more information on
8 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
10 This program and the accompanying materials
11 are licensed and made available under the terms and conditions
12 of the BSD License which accompanies this distribution. The
13 full text of the license may be found at
14 http://opensource.org/licenses/bsd-license.php
16 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
17 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 #ifndef _PEI_USB_HOST_CONTROLLER_PPI_H_
22 #define _PEI_USB_HOST_CONTROLLER_PPI_H_
24 #include <Protocol/Usb2HostController.h>
27 /// Global ID for the PEI_USB_HOST_CONTROLLER_PPI.
29 #define PEI_USB_HOST_CONTROLLER_PPI_GUID \
31 0x652b38a9, 0x77f4, 0x453f, { 0x89, 0xd5, 0xe7, 0xbd, 0xc3, 0x52, 0xfc, 0x53} \
35 /// Forward declaration for the PEI_USB_HOST_CONTROLLER_PPI.
37 typedef struct _PEI_USB_HOST_CONTROLLER_PPI PEI_USB_HOST_CONTROLLER_PPI
;
40 Initiate a USB control transfer using a specific USB Host controller on the USB bus.
42 @param[in] PeiServices The pointer to the PEI Services Table.
43 @param[in] This The pointer to this instance of the
44 PEI_USB_HOST_CONTROLLER_PPI.
45 @param[in] DeviceAddress Represents the address of the target device
47 @param[in] DeviceSpeed Indicates device speed.
48 @param[in] MaximumPacketLength Indicates the maximum packet size that the
49 default control transfer
50 endpoint is capable of sending or receiving.
51 @param[in] Request A pointer to the USB device request that
52 will be sent to the USB device.
53 @param[in] TransferDirection Specifies the data direction for the transfer.
54 There are three values available:
55 EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.
56 @param[in,out] Data A pointer to the buffer of data that will
57 be transmitted to USB device or
58 received from USB device.
59 @param[in,out] DataLength On input, indicates the size, in bytes, of
60 the data buffer specified by Data.
61 On output, indicates the amount of data
63 @param[in] TimeOut Indicates the maximum time, in milliseconds,
64 that the transfer is allowed to complete.
65 @param[out] TransferResult A pointer to the detailed result information
66 generated by this control transfer.
68 @retval EFI_DEVICE_ERROR The control transfer failed due to host controller
70 @retval EFI_SUCCESS The control transfer was completed successfully.
75 (EFIAPI
*PEI_USB_HOST_CONTROLLER_CONTROL_TRANSFER
)(
76 IN EFI_PEI_SERVICES
**PeiServices
,
77 IN PEI_USB_HOST_CONTROLLER_PPI
*This
,
78 IN UINT8 DeviceAddress
,
80 IN UINT8 MaximumPacketLength
,
81 IN USB_DEVICE_REQUEST
*Request
,
82 IN EFI_USB_DATA_DIRECTION TransferDirection
,
83 IN OUT VOID
*Data OPTIONAL
,
84 IN OUT UINTN
*DataLength OPTIONAL
,
86 OUT UINT32
*TransferResult
90 Initiate a USB bulk transfer using a specific USB Host controller on the USB bus.
92 @param[in] PeiServices The pointer to the PEI Services Table.
93 @param[in] This The pointer to this instance of the
94 PEI_USB_HOST_CONTROLLER_PPI.
95 @param[in] DeviceAddress Represents the address of the target device
97 @param[in] EndPointAddress The combination of an endpoint number and
98 an endpoint direction of the target USB device.
99 @param[in] MaximumPacketLength Indicates the maximum packet size the target
100 endpoint is capable of sending or receiving.
101 @param[in,out] Data Array of pointers to the buffers of data
102 that will be transmitted to USB device or
103 received from USB device.
104 @param[in,out] DataLength When input, indicates the size, in bytes, of
105 the data buffers specified by Data. When output,
106 indicates the data size actually transferred.
107 @param[in,out] DataToggle A pointer to the data toggle value.
108 @param[in] TimeOut Indicates the maximum time, in milliseconds,
109 in which the transfer is allowed to complete.
110 @param[out] TransferResult A pointer to the detailed result information
111 of the bulk transfer.
113 @retval EFI_SUCCESS The bulk transfer was completed successfully.
114 @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.
115 Caller should check TransferResult for detailed error information.
120 (EFIAPI
*PEI_USB_HOST_CONTROLLER_BULK_TRANSFER
)(
121 IN EFI_PEI_SERVICES
**PeiServices
,
122 IN PEI_USB_HOST_CONTROLLER_PPI
*This
,
123 IN UINT8 DeviceAddress
,
124 IN UINT8 EndPointAddress
,
125 IN UINT8 MaximumPacketLength
,
127 IN OUT UINTN
*DataLength
,
128 IN OUT UINT8
*DataToggle
,
130 OUT UINT32
*TransferResult
134 Retrieves the number of root hub ports.
136 @param[in] PeiServices The pointer to the PEI Services Table.
137 @param[in] This The pointer to this instance of the
138 PEI_USB_HOST_CONTROLLER_PPI.
139 @param[out] PortNumber The pointer to the number of the root hub ports.
141 @retval EFI_SUCCESS The port number was retrieved successfully.
142 @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve
144 @retval EFI_INVALID_PARAMETER PortNumber is NULL.
149 (EFIAPI
*PEI_USB_HOST_CONTROLLER_GET_ROOTHUB_PORT_NUMBER
)(
150 IN EFI_PEI_SERVICES
**PeiServices
,
151 IN PEI_USB_HOST_CONTROLLER_PPI
*This
,
152 OUT UINT8
*PortNumber
156 Retrieves the current status of a USB root hub port.
158 @param[in] PeiServices The pointer to the PEI Services Table.
159 @param[in] This The pointer to this instance of the
160 PEI_USB_HOST_CONTROLLER_PPI.
161 @param[in] PortNumber Specifies the root hub port from which the status is
163 This value is zero based.
164 @param[out] PortStatus A pointer to the current port status bits and port
167 @retval EFI_SUCCESS The status of the USB root hub port specified by
168 PortNumber was returned in PortStatus.
169 @retval EFI_INVALID_PARAMETER PortNumber is invalid.
174 (EFIAPI
*PEI_USB_HOST_CONTROLLER_GET_ROOTHUB_PORT_STATUS
)(
175 IN EFI_PEI_SERVICES
**PeiServices
,
176 IN PEI_USB_HOST_CONTROLLER_PPI
*This
,
178 OUT EFI_USB_PORT_STATUS
*PortStatus
182 Sets a feature for the specified root hub port.
184 @param[in] PeiServices The pointer to the PEI Services Table.
185 @param[in] This The pointer to this instance of the
186 PEI_USB_HOST_CONTROLLER_PPI.
187 @param[in] PortNumber Specifies the root hub port whose feature is requested
188 to be set. This value is zero based.
189 @param[in] PortFeature Indicates the feature selector associated with the feature
192 @retval EFI_SUCCESS The feature specified by PortFeature was set for
193 the USB root hub port specified by PortNumber.
194 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid
200 (EFIAPI
*PEI_USB_HOST_CONTROLLER_SET_ROOTHUB_PORT_FEATURE
)(
201 IN EFI_PEI_SERVICES
**PeiServices
,
202 IN PEI_USB_HOST_CONTROLLER_PPI
*This
,
204 IN EFI_USB_PORT_FEATURE PortFeature
208 Clears a feature for the specified root hub port.
210 @param[in] PeiServices The pointer to the PEI Services Table.
211 @param[in] This The pointer to this instance of the
212 PEI_USB_HOST_CONTROLLER_PPI.
213 @param[in] PortNumber Specifies the root hub port whose feature is
214 requested to be cleared.
215 @param[in] PortFeature Indicates the feature selector associated with the
216 feature clear request.
218 @return EFI_SUCCESS The feature specified by PortFeature was cleared
219 for the USB root hub port specified by PortNumber.
220 @return EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid.
221 @return EFI_DEVICE_ERROR Can't read the register.
226 (EFIAPI
*PEI_USB_HOST_CONTROLLER_CLEAR_ROOTHUB_PORT_FEATURE
)(
227 IN EFI_PEI_SERVICES
**PeiServices
,
228 IN PEI_USB_HOST_CONTROLLER_PPI
*This
,
230 IN EFI_USB_PORT_FEATURE PortFeature
234 /// This PPI contains a set of services to interact with the USB host controller.
235 /// These interfaces are modeled on the UEFI 2.3 specification protocol
236 /// EFI_USB2_HOST_CONTROLLER_PROTOCOL. Refer to section 16.1 of the UEFI 2.3
237 /// Specification for more information on these interfaces.
239 struct _PEI_USB_HOST_CONTROLLER_PPI
{
240 PEI_USB_HOST_CONTROLLER_CONTROL_TRANSFER ControlTransfer
;
241 PEI_USB_HOST_CONTROLLER_BULK_TRANSFER BulkTransfer
;
242 PEI_USB_HOST_CONTROLLER_GET_ROOTHUB_PORT_NUMBER GetRootHubPortNumber
;
243 PEI_USB_HOST_CONTROLLER_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus
;
244 PEI_USB_HOST_CONTROLLER_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature
;
245 PEI_USB_HOST_CONTROLLER_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature
;
248 extern EFI_GUID gPeiUsbHostControllerPpiGuid
;