2 EFI_USB_HC_PROTOCOL as defined in EFI 1.10.
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 Module Name: UsbHostController.h
17 #ifndef _USB_HOSTCONTROLLER_H_
18 #define _USB_HOSTCONTROLLER_H_
20 #include <Protocol/Usb2HostController.h>
22 #define EFI_USB_HC_PROTOCOL_GUID \
24 0xf5089266, 0x1aa0, 0x4953, {0x97, 0xd8, 0x56, 0x2f, 0x8a, 0x73, 0xb5, 0x19 } \
28 // Forward reference for pure ANSI compatability
30 typedef struct _EFI_USB_HC_PROTOCOL EFI_USB_HC_PROTOCOL
;
33 // Protocol definitions
37 Provides software reset for the USB host controller.
39 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
40 @param Attributes A bit mask of the reset operation to perform.
42 @retval EFI_SUCCESS The reset operation succeeded.
43 @retval EFI_UNSUPPORTED The type of reset specified by Attributes is not currently supported
44 by the host controller hardware.
45 @retval EFI_INVALID_PARAMETER Attributes is not valid.
46 @retval EFI_DEVICE_ERROR An error was encountered while attempting to perform the reset operation.
51 (EFIAPI
*EFI_USB_HC_PROTOCOL_RESET
) (
52 IN EFI_USB_HC_PROTOCOL
*This
,
57 Retrieves current state of the USB host controller.
59 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
60 @param State A pointer to the EFI_USB_HC_STATE data structure that
61 indicates current state of the USB host controller.
63 @retval EFI_SUCCESS The state information of the host controller was returned in State.
64 @retval EFI_INVALID_PARAMETER State is NULL.
65 @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the host controller's
71 (EFIAPI
*EFI_USB_HC_PROTOCOL_GET_STATE
) (
72 IN EFI_USB_HC_PROTOCOL
*This
,
73 OUT EFI_USB_HC_STATE
*State
77 Sets the USB host controller to a specific state.
79 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
80 @param State Indicates the state of the host controller that will be set.
82 @retval EFI_SUCCESS The USB host controller was successfully placed in the state specified by
84 @retval EFI_INVALID_PARAMETER State is NULL.
85 @retval EFI_DEVICE_ERROR Failed to set the state specified by State due to device error.
90 (EFIAPI
*EFI_USB_HC_PROTOCOL_SET_STATE
) (
91 IN EFI_USB_HC_PROTOCOL
*This
,
92 IN EFI_USB_HC_STATE State
96 Submits control transfer to a target USB device.
98 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
99 @param DeviceAddress Represents the address of the target device on the USB, which is
100 assigned during USB enumeration.
101 @param IsSlowDevice Indicates whether the target device is slow device or full-speed
103 @param MaximumPacketLength Indicates the maximum packet size that the default control
104 transfer endpoint is capable of sending or receiving.
105 @param Request A pointer to the USB device request that will be sent to the USB
107 @param TransferDirection Specifies the data direction for the transfer.
108 @param Data A pointer to the buffer of data that will be transmitted to USB
109 device or received from USB device.
110 @param DataLength On input, indicates the size, in bytes, of the data buffer specified
111 by Data. On output, indicates the amount of data actually
113 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer
114 is allowed to complete.
115 @param TransferResult A pointer to the detailed result information generated by this
118 @retval EFI_SUCCESS The control transfer was completed successfully.
119 @retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources.
120 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
121 @retval EFI_TIMEOUT The control transfer failed due to timeout.
122 @retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.
127 (EFIAPI
*EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER
) (
128 IN EFI_USB_HC_PROTOCOL
*This
,
129 IN UINT8 DeviceAddress
,
130 IN BOOLEAN IsSlowDevice
,
131 IN UINT8 MaximumPacketLength
,
132 IN EFI_USB_DEVICE_REQUEST
*Request
,
133 IN EFI_USB_DATA_DIRECTION TransferDirection
,
134 IN OUT VOID
*Data OPTIONAL
,
135 IN OUT UINTN
*DataLength OPTIONAL
,
137 OUT UINT32
*TransferResult
141 Submits bulk transfer to a bulk endpoint of a USB device.
143 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
144 @param DeviceAddress Represents the address of the target device on the USB, which is
145 assigned during USB enumeration.
146 @param EndPointAddress The combination of an endpoint number and an endpoint
147 direction of the target USB device.
148 @param MaximumPacketLength Indicates the maximum packet size that the default control
149 transfer endpoint is capable of sending or receiving.
150 @param Data A pointer to the buffer of data that will be transmitted to USB
151 device or received from USB device.
152 @param DataLength On input, indicates the size, in bytes, of the data buffer specified
153 by Data. On output, indicates the amount of data actually
155 @param DataToggle A pointer to the data toggle value.
156 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer
157 is allowed to complete.
158 @param TransferResult A pointer to the detailed result information of the bulk transfer.
160 @retval EFI_SUCCESS The bulk transfer was completed successfully.
161 @retval EFI_OUT_OF_RESOURCES The bulk transfer could not be completed due to a lack of resources.
162 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
163 @retval EFI_TIMEOUT The bulk transfer failed due to timeout.
164 @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.
169 (EFIAPI
*EFI_USB_HC_PROTOCOL_BULK_TRANSFER
) (
170 IN EFI_USB_HC_PROTOCOL
*This
,
171 IN UINT8 DeviceAddress
,
172 IN UINT8 EndPointAddress
,
173 IN UINT8 MaximumPacketLength
,
175 IN OUT UINTN
*DataLength
,
176 IN OUT UINT8
*DataToggle
,
178 OUT UINT32
*TransferResult
182 Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
184 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
185 @param DeviceAddress Represents the address of the target device on the USB, which is
186 assigned during USB enumeration.
187 @param EndPointAddress The combination of an endpoint number and an endpoint
188 direction of the target USB device.
189 @param IsSlowDevice Indicates whether the target device is slow device or full-speed
191 @param MaximumPacketLength Indicates the maximum packet size that the default control
192 transfer endpoint is capable of sending or receiving.
193 @param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between the host
194 and the target interrupt endpoint. If FALSE, the specified
195 @param DataToggle A pointer to the data toggle value.
196 @param PollingInterval Indicates the interval, in milliseconds, that the asynchronous
197 interrupt transfer is polled. asynchronous interrupt pipe is canceled.
198 @param DataLength Indicates the length of data to be received at the rate specified by
199 PollingInterval from the target asynchronous interrupt
201 @param CallBackFunction The Callback function.
202 @param Context The context that is passed to the CallBackFunction.
204 @retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully
205 submitted or canceled.
206 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
207 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
208 @retval EFI_TIMEOUT The bulk transfer failed due to timeout.
209 @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.
214 (EFIAPI
*EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER
) (
215 IN EFI_USB_HC_PROTOCOL
*This
,
216 IN UINT8 DeviceAddress
,
217 IN UINT8 EndPointAddress
,
218 IN BOOLEAN IsSlowDevice
,
219 IN UINT8 MaxiumPacketLength
,
220 IN BOOLEAN IsNewTransfer
,
221 IN OUT UINT8
*DataToggle
,
222 IN UINTN PollingInterval OPTIONAL
,
223 IN UINTN DataLength OPTIONAL
,
224 IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL
,
225 IN VOID
*Context OPTIONAL
229 Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.
231 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
232 @param DeviceAddress Represents the address of the target device on the USB, which is
233 assigned during USB enumeration.
234 @param EndPointAddress The combination of an endpoint number and an endpoint
235 direction of the target USB device.
236 @param IsSlowDevice Indicates whether the target device is slow device or full-speed
238 @param MaximumPacketLength Indicates the maximum packet size that the default control
239 transfer endpoint is capable of sending or receiving.
240 @param Data A pointer to the buffer of data that will be transmitted to USB
241 device or received from USB device. asynchronous interrupt pipe is canceled.
242 @param DataLength On input, the size, in bytes, of the data buffer specified by Data.
243 On output, the number of bytes transferred.
244 @param DataToggle A pointer to the data toggle value.
245 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer
246 is allowed to complete.
247 @param TransferResult A pointer to the detailed result information from the synchronous
250 @retval EFI_SUCCESS The synchronous interrupt transfer was completed successfully.
251 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
252 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
253 @retval EFI_TIMEOUT The synchronous interrupt transfer failed due to timeout.
254 @retval EFI_DEVICE_ERROR The synchronous interrupt transfer failed due to host controller or device error.
259 (EFIAPI
*EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER
) (
260 IN EFI_USB_HC_PROTOCOL
*This
,
261 IN UINT8 DeviceAddress
,
262 IN UINT8 EndPointAddress
,
263 IN BOOLEAN IsSlowDevice
,
264 IN UINT8 MaximumPacketLength
,
266 IN OUT UINTN
*DataLength
,
267 IN OUT UINT8
*DataToggle
,
269 OUT UINT32
*TransferResult
273 Submits isochronous transfer to an isochronous endpoint of a USB device.
275 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
276 @param DeviceAddress Represents the address of the target device on the USB, which is
277 assigned during USB enumeration.
278 @param EndPointAddress The combination of an endpoint number and an endpoint
279 direction of the target USB device.
280 @param MaximumPacketLength Indicates the maximum packet size that the default control
281 transfer endpoint is capable of sending or receiving.
282 @param Data A pointer to the buffer of data that will be transmitted to USB
283 device or received from USB device. asynchronous interrupt pipe is canceled.
284 @param DataLength Specifies the length, in bytes, of the data to be sent to or received
286 @param TransferResult A pointer to the detailed result information from the isochronous
289 @retval EFI_SUCCESS The isochronous transfer was completed successfully.
290 @retval EFI_OUT_OF_RESOURCES The isochronous could not be completed due to a lack of resources.
291 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
292 @retval EFI_TIMEOUT The isochronous transfer failed due to timeout.
293 @retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.
298 (EFIAPI
*EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER
) (
299 IN EFI_USB_HC_PROTOCOL
*This
,
300 IN UINT8 DeviceAddress
,
301 IN UINT8 EndPointAddress
,
302 IN UINT8 MaximumPacketLength
,
305 OUT UINT32
*TransferResult
309 Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.
311 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
312 @param DeviceAddress Represents the address of the target device on the USB, which is
313 assigned during USB enumeration.
314 @param EndPointAddress The combination of an endpoint number and an endpoint
315 direction of the target USB device.
316 @param MaximumPacketLength Indicates the maximum packet size that the default control
317 transfer endpoint is capable of sending or receiving.
318 @param Data A pointer to the buffer of data that will be transmitted to USB
319 device or received from USB device. asynchronous interrupt pipe is canceled.
320 @param DataLength Specifies the length, in bytes, of the data to be sent to or received
322 @param IsochronousCallback The Callback function.
323 @param Context Data passed to the IsochronousCallback function. This is
324 an optional parameter and may be NULL.
326 @retval EFI_SUCCESS The asynchronous isochronous transfer was completed successfully.
327 @retval EFI_OUT_OF_RESOURCES The asynchronous isochronous could not be completed due to a lack of resources.
328 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
333 (EFIAPI
*EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER
) (
334 IN EFI_USB_HC_PROTOCOL
*This
,
335 IN UINT8 DeviceAddress
,
336 IN UINT8 EndPointAddress
,
337 IN UINT8 MaximumPacketLength
,
340 IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack
,
341 IN VOID
*Context OPTIONAL
345 Retrieves the number of root hub ports.
347 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
348 @param PortNumber A pointer to the number of the root hub ports.
350 @retval EFI_SUCCESS The port number was retrieved successfully.
351 @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the port number.
352 @retval EFI_INVALID_PARAMETER PortNumber is NULL.
357 (EFIAPI
*EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER
) (
358 IN EFI_USB_HC_PROTOCOL
*This
,
359 OUT UINT8
*PortNumber
363 Retrieves the current status of a USB root hub port.
365 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
366 @param PortNumber Specifies the root hub port from which the status is to be retrieved.
367 This value is zero based.
368 @param PortStatus A pointer to the current port status bits and port status change bits.
370 @retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber
371 was returned in PortStatus.
372 @retval EFI_INVALID_PARAMETER PortNumber is invalid.
377 (EFIAPI
*EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS
) (
378 IN EFI_USB_HC_PROTOCOL
*This
,
380 OUT EFI_USB_PORT_STATUS
*PortStatus
384 Sets a feature for the specified root hub port.
386 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
387 @param PortNumber Specifies the root hub port from which the status is to be retrieved.
388 This value is zero based.
389 @param PortFeature Indicates the feature selector associated with the feature set
392 @retval EFI_SUCCESS The feature specified by PortFeature was set for the USB
393 root hub port specified by PortNumber.
394 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
399 (EFIAPI
*EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE
) (
400 IN EFI_USB_HC_PROTOCOL
*This
,
402 IN EFI_USB_PORT_FEATURE PortFeature
406 Clears a feature for the specified root hub port.
408 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
409 @param PortNumber Specifies the root hub port from which the status is to be cleared.
410 This value is zero based.
411 @param PortFeature Indicates the feature selector associated with the feature clear
414 @retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB
415 root hub port specified by PortNumber.
416 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
421 (EFIAPI
*EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE
) (
422 IN EFI_USB_HC_PROTOCOL
*This
,
424 IN EFI_USB_PORT_FEATURE PortFeature
427 struct _EFI_USB_HC_PROTOCOL
{
428 EFI_USB_HC_PROTOCOL_RESET Reset
;
429 EFI_USB_HC_PROTOCOL_GET_STATE GetState
;
430 EFI_USB_HC_PROTOCOL_SET_STATE SetState
;
431 EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer
;
432 EFI_USB_HC_PROTOCOL_BULK_TRANSFER BulkTransfer
;
433 EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer
;
434 EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer
;
435 EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer
;
436 EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer
;
437 EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER GetRootHubPortNumber
;
438 EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus
;
439 EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature
;
440 EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature
;
441 UINT16 MajorRevision
;
442 UINT16 MinorRevision
;
445 extern EFI_GUID gEfiUsbHcProtocolGuid
;