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 #define EFI_USB_HC_PROTOCOL_GUID \
22 0xf5089266, 0x1aa0, 0x4953, {0x97, 0xd8, 0x56, 0x2f, 0x8a, 0x73, 0xb5, 0x19 } \
26 // Forward reference for pure ANSI compatability
28 typedef struct _EFI_USB_HC_PROTOCOL EFI_USB_HC_PROTOCOL
;
31 // Protocol definitions
35 Provides software reset for the USB host controller.
37 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
38 @param Attributes A bit mask of the reset operation to perform.
40 @retval EFI_SUCCESS The reset operation succeeded.
41 @retval EFI_UNSUPPORTED The type of reset specified by Attributes is not currently supported
42 by the host controller hardware.
43 @retval EFI_INVALID_PARAMETER Attributes is not valid.
44 @retval EFI_DEVICE_ERROR An error was encountered while attempting to perform the reset operation.
49 (EFIAPI
*EFI_USB_HC_PROTOCOL_RESET
) (
50 IN EFI_USB_HC_PROTOCOL
*This
,
55 Retrieves current state of the USB host controller.
57 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
58 @param State A pointer to the EFI_USB_HC_STATE data structure that
59 indicates current state of the USB host controller.
61 @retval EFI_SUCCESS The state information of the host controller was returned in State.
62 @retval EFI_INVALID_PARAMETER State is NULL.
63 @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the host controller¡¯s
69 (EFIAPI
*EFI_USB_HC_PROTOCOL_GET_STATE
) (
70 IN EFI_USB_HC_PROTOCOL
*This
,
71 OUT EFI_USB_HC_STATE
*State
75 Sets the USB host controller to a specific state.
77 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
78 @param State Indicates the state of the host controller that will be set.
80 @retval EFI_SUCCESS The USB host controller was successfully placed in the state specified by
82 @retval EFI_INVALID_PARAMETER State is NULL.
83 @retval EFI_DEVICE_ERROR Failed to set the state specified by State due to device error.
88 (EFIAPI
*EFI_USB_HC_PROTOCOL_SET_STATE
) (
89 IN EFI_USB_HC_PROTOCOL
*This
,
90 IN EFI_USB_HC_STATE State
94 Submits control transfer to a target USB device.
96 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
97 @param DeviceAddress Represents the address of the target device on the USB, which is
98 assigned during USB enumeration.
99 @param IsSlowDevice Indicates whether the target device is slow device or full-speed
101 @param MaximumPacketLength Indicates the maximum packet size that the default control
102 transfer endpoint is capable of sending or receiving.
103 @param Request A pointer to the USB device request that will be sent to the USB
105 @param TransferDirection Specifies the data direction for the transfer.
106 @param Data A pointer to the buffer of data that will be transmitted to USB
107 device or received from USB device.
108 @param DataLength On input, indicates the size, in bytes, of the data buffer specified
109 by Data. On output, indicates the amount of data actually
111 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer
112 is allowed to complete.
113 @param TransferResult A pointer to the detailed result information generated by this
116 @retval EFI_SUCCESS The control transfer was completed successfully.
117 @retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources.
118 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
119 @retval EFI_TIMEOUT The control transfer failed due to timeout.
120 @retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.
125 (EFIAPI
*EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER
) (
126 IN EFI_USB_HC_PROTOCOL
*This
,
127 IN UINT8 DeviceAddress
,
128 IN BOOLEAN IsSlowDevice
,
129 IN UINT8 MaximumPacketLength
,
130 IN EFI_USB_DEVICE_REQUEST
*Request
,
131 IN EFI_USB_DATA_DIRECTION TransferDirection
,
132 IN OUT VOID
*Data OPTIONAL
,
133 IN OUT UINTN
*DataLength OPTIONAL
,
135 OUT UINT32
*TransferResult
139 Submits bulk transfer to a bulk endpoint of a USB device.
141 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
142 @param DeviceAddress Represents the address of the target device on the USB, which is
143 assigned during USB enumeration.
144 @param EndPointAddress The combination of an endpoint number and an endpoint
145 direction of the target USB device.
146 @param MaximumPacketLength Indicates the maximum packet size that the default control
147 transfer endpoint is capable of sending or receiving.
148 @param Data A pointer to the buffer of data that will be transmitted to USB
149 device or received from USB device.
150 @param DataLength On input, indicates the size, in bytes, of the data buffer specified
151 by Data. On output, indicates the amount of data actually
153 @param DataToggle A pointer to the data toggle value.
154 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer
155 is allowed to complete.
156 @param TransferResult A pointer to the detailed result information of the bulk transfer.
158 @retval EFI_SUCCESS The bulk transfer was completed successfully.
159 @retval EFI_OUT_OF_RESOURCES The bulk transfer could not be completed due to a lack of resources.
160 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
161 @retval EFI_TIMEOUT The bulk transfer failed due to timeout.
162 @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.
167 (EFIAPI
*EFI_USB_HC_PROTOCOL_BULK_TRANSFER
) (
168 IN EFI_USB_HC_PROTOCOL
*This
,
169 IN UINT8 DeviceAddress
,
170 IN UINT8 EndPointAddress
,
171 IN UINT8 MaximumPacketLength
,
173 IN OUT UINTN
*DataLength
,
174 IN OUT UINT8
*DataToggle
,
176 OUT UINT32
*TransferResult
180 Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
182 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
183 @param DeviceAddress Represents the address of the target device on the USB, which is
184 assigned during USB enumeration.
185 @param EndPointAddress The combination of an endpoint number and an endpoint
186 direction of the target USB device.
187 @param IsSlowDevice Indicates whether the target device is slow device or full-speed
189 @param MaximumPacketLength Indicates the maximum packet size that the default control
190 transfer endpoint is capable of sending or receiving.
191 @param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between the host
192 and the target interrupt endpoint. If FALSE, the specified
194 @param DataToggle A pointer to the data toggle value.
195 @param PollingInterval Indicates the interval, in milliseconds, that the asynchronous
196 interrupt transfer is polled. asynchronous interrupt pipe is canceled.
197 @param DataLength Indicates the length of data to be received at the rate specified by
198 PollingInterval from the target asynchronous interrupt
200 @param CallBackFunction The Callback function.
201 @param Context The context that is passed to the CallBackFunction.
203 @retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully
204 submitted or canceled.
205 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
206 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
207 @retval EFI_TIMEOUT The bulk transfer failed due to timeout.
208 @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.
213 (EFIAPI
*EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER
) (
214 IN EFI_USB_HC_PROTOCOL
*This
,
215 IN UINT8 DeviceAddress
,
216 IN UINT8 EndPointAddress
,
217 IN BOOLEAN IsSlowDevice
,
218 IN UINT8 MaxiumPacketLength
,
219 IN BOOLEAN IsNewTransfer
,
220 IN OUT UINT8
*DataToggle
,
221 IN UINTN PollingInterval OPTIONAL
,
222 IN UINTN DataLength OPTIONAL
,
223 IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL
,
224 IN VOID
*Context OPTIONAL
228 Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.
230 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
231 @param DeviceAddress Represents the address of the target device on the USB, which is
232 assigned during USB enumeration.
233 @param EndPointAddress The combination of an endpoint number and an endpoint
234 direction of the target USB device.
235 @param IsSlowDevice Indicates whether the target device is slow device or full-speed
237 @param MaximumPacketLength Indicates the maximum packet size that the default control
238 transfer endpoint is capable of sending or receiving.
239 @param Data A pointer to the buffer of data that will be transmitted to USB
240 device or received from USB device. asynchronous interrupt pipe is canceled.
241 @param DataLength On input, the size, in bytes, of the data buffer specified by Data.
242 On output, the number of bytes transferred.
243 @param DataToggle A pointer to the data toggle value.
244 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer
245 is allowed to complete.
246 @param TransferResult A pointer to the detailed result information from the synchronous
249 @retval EFI_SUCCESS The synchronous interrupt transfer was completed successfully.
250 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
251 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
252 @retval EFI_TIMEOUT The synchronous interrupt transfer failed due to timeout.
253 @retval EFI_DEVICE_ERROR The synchronous interrupt transfer failed due to host controller or device error.
258 (EFIAPI
*EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER
) (
259 IN EFI_USB_HC_PROTOCOL
*This
,
260 IN UINT8 DeviceAddress
,
261 IN UINT8 EndPointAddress
,
262 IN BOOLEAN IsSlowDevice
,
263 IN UINT8 MaximumPacketLength
,
265 IN OUT UINTN
*DataLength
,
266 IN OUT UINT8
*DataToggle
,
268 OUT UINT32
*TransferResult
272 Submits isochronous transfer to an isochronous endpoint of a USB device.
274 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
275 @param DeviceAddress Represents the address of the target device on the USB, which is
276 assigned during USB enumeration.
277 @param EndPointAddress The combination of an endpoint number and an endpoint
278 direction of the target USB device.
279 @param MaximumPacketLength Indicates the maximum packet size that the default control
280 transfer endpoint is capable of sending or receiving.
281 @param Data A pointer to the buffer of data that will be transmitted to USB
282 device or received from USB device. asynchronous interrupt pipe is canceled.
283 @param DataLength Specifies the length, in bytes, of the data to be sent to or received
285 @param TransferResult A pointer to the detailed result information from the isochronous
288 @retval EFI_SUCCESS The isochronous transfer was completed successfully.
289 @retval EFI_OUT_OF_RESOURCES The isochronous could not be completed due to a lack of resources.
290 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
291 @retval EFI_TIMEOUT The isochronous transfer failed due to timeout.
292 @retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.
297 (EFIAPI
*EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER
) (
298 IN EFI_USB_HC_PROTOCOL
*This
,
299 IN UINT8 DeviceAddress
,
300 IN UINT8 EndPointAddress
,
301 IN UINT8 MaximumPacketLength
,
304 OUT UINT32
*TransferResult
308 Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.
310 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
311 @param DeviceAddress Represents the address of the target device on the USB, which is
312 assigned during USB enumeration.
313 @param EndPointAddress The combination of an endpoint number and an endpoint
314 direction of the target USB device.
315 @param MaximumPacketLength Indicates the maximum packet size that the default control
316 transfer endpoint is capable of sending or receiving.
317 @param Data A pointer to the buffer of data that will be transmitted to USB
318 device or received from USB device. asynchronous interrupt pipe is canceled.
319 @param DataLength Specifies the length, in bytes, of the data to be sent to or received
321 @param IsochronousCallback The Callback function.
322 @param Context Data passed to the IsochronousCallback function. This is
323 an optional parameter and may be NULL.
325 @retval EFI_SUCCESS The asynchronous isochronous transfer was completed successfully.
326 @retval EFI_OUT_OF_RESOURCES The asynchronous isochronous could not be completed due to a lack of resources.
327 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
332 (EFIAPI
*EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER
) (
333 IN EFI_USB_HC_PROTOCOL
*This
,
334 IN UINT8 DeviceAddress
,
335 IN UINT8 EndPointAddress
,
336 IN UINT8 MaximumPacketLength
,
339 IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack
,
340 IN VOID
*Context OPTIONAL
344 Retrieves the number of root hub ports.
346 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
347 @param PortNumber A pointer to the number of the root hub ports.
349 @retval EFI_SUCCESS The port number was retrieved successfully.
350 @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the port number.
351 @retval EFI_INVALID_PARAMETER PortNumber is NULL.
356 (EFIAPI
*EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER
) (
357 IN EFI_USB_HC_PROTOCOL
*This
,
358 OUT UINT8
*PortNumber
362 Retrieves the current status of a USB root hub port.
364 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
365 @param PortNumber Specifies the root hub port from which the status is to be retrieved.
366 This value is zero based.
367 @param PortStatus A pointer to the current port status bits and port status change bits.
369 @retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber
370 was returned in PortStatus.
371 @retval EFI_INVALID_PARAMETER PortNumber is invalid.
376 (EFIAPI
*EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS
) (
377 IN EFI_USB_HC_PROTOCOL
*This
,
379 OUT EFI_USB_PORT_STATUS
*PortStatus
383 Sets a feature for the specified root hub port.
385 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
386 @param PortNumber Specifies the root hub port from which the status is to be retrieved.
387 This value is zero based.
388 @param PortFeature Indicates the feature selector associated with the feature set
391 @retval EFI_SUCCESS The feature specified by PortFeature was set for the USB
392 root hub port specified by PortNumber.
393 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
398 (EFIAPI
*EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE
) (
399 IN EFI_USB_HC_PROTOCOL
*This
,
401 IN EFI_USB_PORT_FEATURE PortFeature
405 Clears a feature for the specified root hub port.
407 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.
408 @param PortNumber Specifies the root hub port from which the status is to be cleared.
409 This value is zero based.
410 @param PortFeature Indicates the feature selector associated with the feature clear
413 @retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB
414 root hub port specified by PortNumber.
415 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
420 (EFIAPI
*EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE
) (
421 IN EFI_USB_HC_PROTOCOL
*This
,
423 IN EFI_USB_PORT_FEATURE PortFeature
426 struct _EFI_USB_HC_PROTOCOL
{
427 EFI_USB_HC_PROTOCOL_RESET Reset
;
428 EFI_USB_HC_PROTOCOL_GET_STATE GetState
;
429 EFI_USB_HC_PROTOCOL_SET_STATE SetState
;
430 EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer
;
431 EFI_USB_HC_PROTOCOL_BULK_TRANSFER BulkTransfer
;
432 EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer
;
433 EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer
;
434 EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer
;
435 EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer
;
436 EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER GetRootHubPortNumber
;
437 EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus
;
438 EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature
;
439 EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature
;
440 UINT16 MajorRevision
;
441 UINT16 MinorRevision
;
444 extern EFI_GUID gEfiUsbHcProtocolGuid
;