iPXE
Usb2HostController.h
Go to the documentation of this file.
1/** @file
2 EFI_USB2_HC_PROTOCOL as defined in UEFI 2.0.
3 The USB Host Controller Protocol is used by code, typically USB bus drivers,
4 running in the EFI boot services environment, to perform data transactions over
5 a USB bus. In addition, it provides an abstraction for the root hub of the USB bus.
6
7 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10**/
11
12#pragma once
13
14FILE_LICENCE ( BSD2_PATENT );
15FILE_SECBOOT ( PERMITTED );
16
18
19#define EFI_USB2_HC_PROTOCOL_GUID \
20 { \
21 0x3e745226, 0x9818, 0x45b6, {0xa2, 0xac, 0xd7, 0xcd, 0xe, 0x8b, 0xa2, 0xbc } \
22 }
23
24///
25/// Forward reference for pure ANSI compatability
26///
28
29typedef struct {
30 UINT16 PortStatus; ///< Contains current port status bitmap.
31 UINT16 PortChangeStatus; ///< Contains current port status change bitmap.
33
34///
35/// EFI_USB_PORT_STATUS.PortStatus bit definition
36///
37#define USB_PORT_STAT_CONNECTION 0x0001
38#define USB_PORT_STAT_ENABLE 0x0002
39#define USB_PORT_STAT_SUSPEND 0x0004
40#define USB_PORT_STAT_OVERCURRENT 0x0008
41#define USB_PORT_STAT_RESET 0x0010
42#define USB_PORT_STAT_POWER 0x0100
43#define USB_PORT_STAT_LOW_SPEED 0x0200
44#define USB_PORT_STAT_HIGH_SPEED 0x0400
45#define USB_PORT_STAT_SUPER_SPEED 0x0800
46#define USB_PORT_STAT_OWNER 0x2000
47
48///
49/// EFI_USB_PORT_STATUS.PortChangeStatus bit definition
50///
51#define USB_PORT_STAT_C_CONNECTION 0x0001
52#define USB_PORT_STAT_C_ENABLE 0x0002
53#define USB_PORT_STAT_C_SUSPEND 0x0004
54#define USB_PORT_STAT_C_OVERCURRENT 0x0008
55#define USB_PORT_STAT_C_RESET 0x0010
56
57///
58/// Usb port features value
59/// Each value indicates its bit index in the port status and status change bitmaps,
60/// if combines these two bitmaps into a 32-bit bitmap.
61///
74
75#define EFI_USB_SPEED_FULL 0x0000 ///< 12 Mb/s, USB 1.1 OHCI and UHCI HC.
76#define EFI_USB_SPEED_LOW 0x0001 ///< 1 Mb/s, USB 1.1 OHCI and UHCI HC.
77#define EFI_USB_SPEED_HIGH 0x0002 ///< 480 Mb/s, USB 2.0 EHCI HC.
78#define EFI_USB_SPEED_SUPER 0x0003 ///< 4.8 Gb/s, USB 3.0 XHCI HC.
79
80typedef struct {
81 UINT8 TranslatorHubAddress; ///< device address
82 UINT8 TranslatorPortNumber; ///< the port number of the hub that device is connected to.
84
85//
86// Protocol definitions
87//
88
89/**
90 Retrieves the Host Controller capabilities.
91
92 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
93 @param MaxSpeed Host controller data transfer speed.
94 @param PortNumber Number of the root hub ports.
95 @param Is64BitCapable TRUE if controller supports 64-bit memory addressing,
96 FALSE otherwise.
97
98 @retval EFI_SUCCESS The host controller capabilities were retrieved successfully.
99 @retval EFI_INVALID_PARAMETER One of the input args was NULL.
100 @retval EFI_DEVICE_ERROR An error was encountered while attempting to
101 retrieve the capabilities.
102
103**/
104typedef
108 OUT UINT8 *MaxSpeed,
109 OUT UINT8 *PortNumber,
110 OUT UINT8 *Is64BitCapable
111 );
112
113#define EFI_USB_HC_RESET_GLOBAL 0x0001
114#define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002
115#define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004
116#define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008
117
118/**
119 Provides software reset for the USB host controller.
120
121 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
122 @param Attributes A bit mask of the reset operation to perform.
123
124 @retval EFI_SUCCESS The reset operation succeeded.
125 @retval EFI_INVALID_PARAMETER Attributes is not valid.
126 @retval EFI_UNSUPPORTED The type of reset specified by Attributes is not currently
127 supported by the host controller hardware.
128 @retval EFI_ACCESS_DENIED Reset operation is rejected due to the debug port being configured
129 and active; only EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG or
130 EFI_USB_HC_RESET_HOST_WITH_DEBUG reset Attributes can be used to
131 perform reset operation for this host controller.
132 @retval EFI_DEVICE_ERROR An error was encountered while attempting to
133 retrieve the capabilities.
134
135**/
136typedef
140 IN UINT16 Attributes
141 );
142
143/**
144 Enumration value for status of USB HC.
145**/
146typedef enum {
147 EfiUsbHcStateHalt, ///< The host controller is in halt
148 ///< state. No USB transactions can occur
149 ///< while in this state. The host
150 ///< controller can enter this state for
151 ///< three reasons: 1) After host
152 ///< controller hardware reset. 2)
153 ///< Explicitly set by software. 3)
154 ///< Triggered by a fatal error such as
155 ///< consistency check failure.
156
157 EfiUsbHcStateOperational, ///< The host controller is in an
158 ///< operational state. When in
159 ///< this state, the host
160 ///< controller can execute bus
161 ///< traffic. This state must be
162 ///< explicitly set to enable the
163 ///< USB bus traffic.
164
165 EfiUsbHcStateSuspend, ///< The host controller is in the
166 ///< suspend state. No USB
167 ///< transactions can occur while in
168 ///< this state. The host controller
169 ///< enters this state for the
170 ///< following reasons: 1) Explicitly
171 ///< set by software. 2) Triggered
172 ///< when there is no bus traffic for
173 ///< 3 microseconds.
174
175 EfiUsbHcStateMaximum ///< Maximum value for enumration value of HC status.
177
178/**
179 Retrieves current state of the USB host controller.
180
181 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
182 @param State A pointer to the EFI_USB_HC_STATE data structure that
183 indicates current state of the USB host controller.
184
185 @retval EFI_SUCCESS The state information of the host controller was returned in State.
186 @retval EFI_INVALID_PARAMETER State is NULL.
187 @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the
188 host controller's current state.
189
190**/
191typedef
195 OUT EFI_USB_HC_STATE *State
196 );
197
198/**
199 Sets the USB host controller to a specific state.
200
201 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
202 @param State Indicates the state of the host controller that will be set.
203
204 @retval EFI_SUCCESS The USB host controller was successfully placed in the state
205 specified by State.
206 @retval EFI_INVALID_PARAMETER State is not valid.
207 @retval EFI_DEVICE_ERROR Failed to set the state specified by State due to device error.
208
209**/
210typedef
214 IN EFI_USB_HC_STATE State
215 );
216
217/**
218 Submits control transfer to a target USB device.
219
220 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
221 @param DeviceAddress Represents the address of the target device on the USB.
222 @param DeviceSpeed Indicates device speed.
223 @param MaximumPacketLength Indicates the maximum packet size that the default control transfer
224 endpoint is capable of sending or receiving.
225 @param Request A pointer to the USB device request that will be sent to the USB device.
226 @param TransferDirection Specifies the data direction for the transfer. There are three values
227 available, EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.
228 @param Data A pointer to the buffer of data that will be transmitted to USB device or
229 received from USB device.
230 @param DataLength On input, indicates the size, in bytes, of the data buffer specified by Data.
231 On output, indicates the amount of data actually transferred.
232 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
233 allowed to complete.
234 @param Translator A pointer to the transaction translator data.
235 @param TransferResult A pointer to the detailed result information generated by this control
236 transfer.
237
238 @retval EFI_SUCCESS The control transfer was completed successfully.
239 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
240 @retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources.
241 @retval EFI_TIMEOUT The control transfer failed due to timeout.
242 @retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.
243 Caller should check TransferResult for detailed error information.
244
245**/
246typedef
250 IN UINT8 DeviceAddress,
251 IN UINT8 DeviceSpeed,
252 IN UINTN MaximumPacketLength,
253 IN EFI_USB_DEVICE_REQUEST *Request,
254 IN EFI_USB_DATA_DIRECTION TransferDirection,
255 IN OUT VOID *Data OPTIONAL,
257 IN UINTN TimeOut,
259 OUT UINT32 *TransferResult
260 );
261
262#define EFI_USB_MAX_BULK_BUFFER_NUM 10
263
264/**
265 Submits bulk transfer to a bulk endpoint of a USB device.
266
267 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
268 @param DeviceAddress Represents the address of the target device on the USB.
269 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
270 target USB device.
271 @param DeviceSpeed Indicates device speed.
272 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
273 sending or receiving.
274 @param DataBuffersNumber Number of data buffers prepared for the transfer.
275 @param Data Array of pointers to the buffers of data that will be transmitted to USB
276 device or received from USB device.
277 @param DataLength When input, indicates the size, in bytes, of the data buffers specified by
278 Data. When output, indicates the actually transferred data size.
279 @param DataToggle A pointer to the data toggle value.
280 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
281 allowed to complete.
282 @param Translator A pointer to the transaction translator data.
283 @param TransferResult A pointer to the detailed result information of the bulk transfer.
284
285 @retval EFI_SUCCESS The bulk transfer was completed successfully.
286 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
287 @retval EFI_OUT_OF_RESOURCES The bulk transfer could not be submitted due to a lack of resources.
288 @retval EFI_TIMEOUT The bulk transfer failed due to timeout.
289 @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.
290 Caller should check TransferResult for detailed error information.
291
292**/
293typedef
297 IN UINT8 DeviceAddress,
298 IN UINT8 EndPointAddress,
299 IN UINT8 DeviceSpeed,
300 IN UINTN MaximumPacketLength,
301 IN UINT8 DataBuffersNumber,
304 IN OUT UINT8 *DataToggle,
305 IN UINTN TimeOut,
307 OUT UINT32 *TransferResult
308 );
309
310/**
311 Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
312 Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.
313
314 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
315 @param DeviceAddress Represents the address of the target device on the USB.
316 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
317 target USB device.
318 @param DeviceSpeed Indicates device speed.
319 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
320 sending or receiving.
321 @param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between the host and the
322 target interrupt endpoint. If FALSE, the specified asynchronous interrupt
323 pipe is canceled. If TRUE, and an interrupt transfer exists for the target
324 end point, then EFI_INVALID_PARAMETER is returned.
325 @param DataToggle A pointer to the data toggle value.
326 @param PollingInterval Indicates the interval, in milliseconds, that the asynchronous interrupt
327 transfer is polled.
328 @param DataLength Indicates the length of data to be received at the rate specified by
329 PollingInterval from the target asynchronous interrupt endpoint.
330 @param Translator A pointr to the transaction translator data.
331 @param CallBackFunction The Callback function. This function is called at the rate specified by
332 PollingInterval.
333 @param Context The context that is passed to the CallBackFunction. This is an
334 optional parameter and may be NULL.
335
336 @retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully
337 submitted or canceled.
338 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
339 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
340
341**/
342typedef
346 IN UINT8 DeviceAddress,
347 IN UINT8 EndPointAddress,
348 IN UINT8 DeviceSpeed,
349 IN UINTN MaxiumPacketLength,
350 IN BOOLEAN IsNewTransfer,
351 IN OUT UINT8 *DataToggle,
352 IN UINTN PollingInterval OPTIONAL,
356 IN VOID *Context OPTIONAL
357 );
358
359/**
360 Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.
361 Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.
362
363 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
364 @param DeviceAddress Represents the address of the target device on the USB.
365 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
366 target USB device.
367 @param DeviceSpeed Indicates device speed.
368 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
369 sending or receiving.
370 @param Data A pointer to the buffer of data that will be transmitted to USB device or
371 received from USB device.
372 @param DataLength On input, the size, in bytes, of the data buffer specified by Data. On
373 output, the number of bytes transferred.
374 @param DataToggle A pointer to the data toggle value.
375 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
376 allowed to complete.
377 @param Translator A pointr to the transaction translator data.
378 @param TransferResult A pointer to the detailed result information from the synchronous
379 interrupt transfer.
380
381 @retval EFI_SUCCESS The synchronous interrupt transfer was completed successfully.
382 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
383 @retval EFI_OUT_OF_RESOURCES The synchronous interrupt transfer could not be submitted due to a lack of resources.
384 @retval EFI_TIMEOUT The synchronous interrupt transfer failed due to timeout.
385 @retval EFI_DEVICE_ERROR The synchronous interrupt transfer failed due to host controller or device error.
386 Caller should check TransferResult for detailed error information.
387
388**/
389typedef
393 IN UINT8 DeviceAddress,
394 IN UINT8 EndPointAddress,
395 IN UINT8 DeviceSpeed,
396 IN UINTN MaximumPacketLength,
397 IN OUT VOID *Data,
399 IN OUT UINT8 *DataToggle,
400 IN UINTN TimeOut,
402 OUT UINT32 *TransferResult
403 );
404
405#define EFI_USB_MAX_ISO_BUFFER_NUM 7
406#define EFI_USB_MAX_ISO_BUFFER_NUM1 2
407
408/**
409 Submits isochronous transfer to an isochronous endpoint of a USB device.
410
411 This function is used to submit isochronous transfer to a target endpoint of a USB device.
412 The target endpoint is specified by DeviceAddressand EndpointAddress. Isochronous transfers are
413 used when working with isochronous date. It provides periodic, continuous communication between
414 the host and a device. Isochronous transfers can beused only by full-speed, high-speed, and
415 super-speed devices.
416
417 High-speed isochronous transfers can be performed using multiple data buffers. The number of
418 buffers that are actually prepared for the transfer is specified by DataBuffersNumber. For
419 full-speed isochronous transfers this value is ignored.
420
421 Data represents a list of pointers to the data buffers. For full-speed isochronous transfers
422 only the data pointed by Data[0]shall be used. For high-speed isochronous transfers and for
423 the split transactions depending on DataLengththere several data buffers canbe used. For the
424 high-speed isochronous transfers the total number of buffers must not exceed EFI_USB_MAX_ISO_BUFFER_NUM.
425
426 For split transactions performed on full-speed device by high-speed host controller the total
427 number of buffers is limited to EFI_USB_MAX_ISO_BUFFER_NUM1.
428 If the isochronous transfer is successful, then EFI_SUCCESSis returned. The isochronous transfer
429 is designed to be completed within one USB frame time, if it cannot be completed, EFI_TIMEOUT
430 is returned. If an error other than timeout occurs during the USB transfer, then EFI_DEVICE_ERROR
431 is returned and the detailed status code will be returned in TransferResult.
432
433 EFI_INVALID_PARAMETERis returned if one of the following conditionsis satisfied:
434 - Data is NULL.
435 - DataLength is 0.
436 - DeviceSpeed is not one of the supported values listed above.
437 - MaximumPacketLength is invalid. MaximumPacketLength must be 1023 or less for full-speed devices,
438 and 1024 or less for high-speed and super-speed devices.
439 - TransferResult is NULL.
440
441 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
442 @param DeviceAddress Represents the address of the target device on the USB.
443 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
444 target USB device.
445 @param DeviceSpeed Indicates device speed. The supported values are EFI_USB_SPEED_FULL,
446 EFI_USB_SPEED_HIGH, or EFI_USB_SPEED_SUPER.
447 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
448 sending or receiving.
449 @param DataBuffersNumber Number of data buffers prepared for the transfer.
450 @param Data Array of pointers to the buffers of data that will be transmitted to USB
451 device or received from USB device.
452 @param DataLength Specifies the length, in bytes, of the data to be sent to or received from
453 the USB device.
454 @param Translator A pointer to the transaction translator data.
455 @param TransferResult A pointer to the detailed result information of the isochronous transfer.
456
457 @retval EFI_SUCCESS The isochronous transfer was completed successfully.
458 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
459 @retval EFI_OUT_OF_RESOURCES The isochronous transfer could not be submitted due to a lack of resources.
460 @retval EFI_TIMEOUT The isochronous transfer cannot be completed within the one USB frame time.
461 @retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.
462 Caller should check TransferResult for detailed error information.
463
464**/
465typedef
469 IN UINT8 DeviceAddress,
470 IN UINT8 EndPointAddress,
471 IN UINT8 DeviceSpeed,
472 IN UINTN MaximumPacketLength,
473 IN UINT8 DataBuffersNumber,
477 OUT UINT32 *TransferResult
478 );
479
480/**
481 Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.
482
483 This is an asynchronous type of USB isochronous transfer. If the caller submits a USB
484 isochronous transfer request through this function, this function will return immediately.
485
486 When the isochronous transfer completes, the IsochronousCallbackfunction will be triggered,
487 the caller can know the transfer results. If the transfer is successful, the caller can get
488 the data received or sent in this callback function.
489
490 The target endpoint is specified by DeviceAddressand EndpointAddress. Isochronous transfers
491 are used when working with isochronous date. It provides periodic, continuous communication
492 between the host and a device. Isochronous transfers can be used only by full-speed, high-speed,
493 and super-speed devices.
494
495 High-speed isochronous transfers can be performed using multiple data buffers. The number of
496 buffers that are actually prepared for the transfer is specified by DataBuffersNumber. For
497 full-speed isochronous transfers this value is ignored.
498
499 Data represents a list of pointers to the data buffers. For full-speed isochronous transfers
500 only the data pointed by Data[0] shall be used. For high-speed isochronous transfers and for
501 the split transactions depending on DataLength there several data buffers can be used. For
502 the high-speed isochronous transfers the total number of buffers must not exceed EFI_USB_MAX_ISO_BUFFER_NUM.
503
504 For split transactions performed on full-speed device by high-speed host controller the total
505 number of buffers is limited to EFI_USB_MAX_ISO_BUFFER_NUM1.
506
507 EFI_INVALID_PARAMETER is returned if one of the following conditionsis satisfied:
508 - Data is NULL.
509 - DataLength is 0.
510 - DeviceSpeed is not one of the supported values listed above.
511 - MaximumPacketLength is invalid. MaximumPacketLength must be 1023 or less for full-speed
512 devices and 1024 or less for high-speed and super-speed devices.
513
514 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
515 @param DeviceAddress Represents the address of the target device on the USB.
516 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
517 target USB device.
518 @param DeviceSpeed Indicates device speed. The supported values are EFI_USB_SPEED_FULL,
519 EFI_USB_SPEED_HIGH, or EFI_USB_SPEED_SUPER.
520 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
521 sending or receiving.
522 @param DataBuffersNumber Number of data buffers prepared for the transfer.
523 @param Data Array of pointers to the buffers of data that will be transmitted to USB
524 device or received from USB device.
525 @param DataLength Specifies the length, in bytes, of the data to be sent to or received from
526 the USB device.
527 @param Translator A pointer to the transaction translator data.
528 @param IsochronousCallback The Callback function. This function is called if the requested
529 isochronous transfer is completed.
530 @param Context Data passed to the IsochronousCallback function. This is an
531 optional parameter and may be NULL.
532
533 @retval EFI_SUCCESS The asynchronous isochronous transfer request has been successfully
534 submitted or canceled.
535 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
536 @retval EFI_OUT_OF_RESOURCES The asynchronous isochronous transfer could not be submitted due to
537 a lack of resources.
538
539**/
540typedef
544 IN UINT8 DeviceAddress,
545 IN UINT8 EndPointAddress,
546 IN UINT8 DeviceSpeed,
547 IN UINTN MaximumPacketLength,
548 IN UINT8 DataBuffersNumber,
552 IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
553 IN VOID *Context OPTIONAL
554 );
555
556/**
557 Retrieves the current status of a USB root hub port.
558
559 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
560 @param PortNumber Specifies the root hub port from which the status is to be retrieved.
561 This value is zero based.
562 @param PortStatus A pointer to the current port status bits and port status change bits.
563
564 @retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber
565 was returned in PortStatus.
566 @retval EFI_INVALID_PARAMETER PortNumber is invalid.
567
568**/
569typedef
573 IN UINT8 PortNumber,
574 OUT EFI_USB_PORT_STATUS *PortStatus
575 );
576
577/**
578 Sets a feature for the specified root hub port.
579
580 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
581 @param PortNumber Specifies the root hub port whose feature is requested to be set. This
582 value is zero based.
583 @param PortFeature Indicates the feature selector associated with the feature set request.
584
585 @retval EFI_SUCCESS The feature specified by PortFeature was set for the USB
586 root hub port specified by PortNumber.
587 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
588
589**/
590typedef
594 IN UINT8 PortNumber,
595 IN EFI_USB_PORT_FEATURE PortFeature
596 );
597
598/**
599 Clears a feature for the specified root hub port.
600
601 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
602 @param PortNumber Specifies the root hub port whose feature is requested to be cleared. This
603 value is zero based.
604 @param PortFeature Indicates the feature selector associated with the feature clear request.
605
606 @retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB
607 root hub port specified by PortNumber.
608 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
609
610**/
611typedef
615 IN UINT8 PortNumber,
616 IN EFI_USB_PORT_FEATURE PortFeature
617 );
618
619///
620/// The EFI_USB2_HC_PROTOCOL provides USB host controller management, basic
621/// data transactions over a USB bus, and USB root hub access. A device driver
622/// that wishes to manage a USB bus in a system retrieves the EFI_USB2_HC_PROTOCOL
623/// instance that is associated with the USB bus to be managed. A device handle
624/// for a USB host controller will minimally contain an EFI_DEVICE_PATH_PROTOCOL
625/// instance, and an EFI_USB2_HC_PROTOCOL instance.
626///
656
volatile unsigned int DataLength
Definition 3c90x.h:3
unsigned short UINT16
2-byte unsigned value.
unsigned char BOOLEAN
Logical Boolean.
UINT64 UINTN
Unsigned value of native width.
#define EFIAPI
unsigned char UINT8
1-byte unsigned value.
unsigned int UINT32
4-byte unsigned value.
#define VOID
Undeclared type.
Definition Base.h:271
#define OPTIONAL
Passing the datum to the function is optional, and a NULL is passed if the value is not supplied.
Definition Base.h:292
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaxiumPacketLength, IN BOOLEAN IsNewTransfer, IN OUT UINT8 *DataToggle, IN UINTN PollingInterval OPTIONAL, IN UINTN DataLength OPTIONAL, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator OPTIONAL, IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL, IN VOID *Context OPTIONAL)
Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN OUT UINT8 *DataToggle, IN UINTN TimeOut, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_GET_CAPABILITY)(IN EFI_USB2_HC_PROTOCOL *This, OUT UINT8 *MaxSpeed, OUT UINT8 *PortNumber, OUT UINT8 *Is64BitCapable)
Retrieves the Host Controller capabilities.
EFI_GUID gEfiUsb2HcProtocolGuid
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN UINT8 DataBuffersNumber, IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM], IN UINTN DataLength, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack, IN VOID *Context OPTIONAL)
Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.
EFI_USB_PORT_FEATURE
Usb port features value Each value indicates its bit index in the port status and status change bitma...
@ EfiUsbPortPower
@ EfiUsbPortOverCurrentChange
@ EfiUsbPortSuspendChange
@ EfiUsbPortSuspend
@ EfiUsbPortReset
@ EfiUsbPortResetChange
@ EfiUsbPortEnableChange
@ EfiUsbPortEnable
@ EfiUsbPortConnectChange
@ EfiUsbPortOwner
struct _EFI_USB2_HC_PROTOCOL EFI_USB2_HC_PROTOCOL
Forward reference for pure ANSI compatability.
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, OUT EFI_USB_PORT_STATUS *PortStatus)
Retrieves the current status of a USB root hub port.
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_RESET)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT16 Attributes)
Provides software reset for the USB host controller.
#define EFI_USB_MAX_ISO_BUFFER_NUM
#define EFI_USB_MAX_BULK_BUFFER_NUM
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, IN EFI_USB_PORT_FEATURE PortFeature)
Clears a feature for the specified root hub port.
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_SET_STATE)(IN EFI_USB2_HC_PROTOCOL *This, IN EFI_USB_HC_STATE State)
Sets the USB host controller to a specific state.
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_BULK_TRANSFER)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN UINT8 DataBuffersNumber, IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM], IN OUT UINTN *DataLength, IN OUT UINT8 *DataToggle, IN UINTN TimeOut, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
Submits bulk transfer to a bulk endpoint of a USB device.
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN EFI_USB_DEVICE_REQUEST *Request, IN EFI_USB_DATA_DIRECTION TransferDirection, IN OUT VOID *Data OPTIONAL, IN OUT UINTN *DataLength OPTIONAL, IN UINTN TimeOut, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
Submits control transfer to a target USB device.
EFI_USB_HC_STATE
Enumration value for status of USB HC.
@ EfiUsbHcStateHalt
The host controller is in halt state.
@ EfiUsbHcStateOperational
The host controller is in an operational state.
@ EfiUsbHcStateSuspend
The host controller is in the suspend state.
@ EfiUsbHcStateMaximum
Maximum value for enumration value of HC status.
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN UINT8 DataBuffersNumber, IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM], IN UINTN DataLength, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
Submits isochronous transfer to an isochronous endpoint of a USB device.
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_GET_STATE)(IN EFI_USB2_HC_PROTOCOL *This, OUT EFI_USB_HC_STATE *State)
Retrieves current state of the USB host controller.
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, IN EFI_USB_PORT_FEATURE PortFeature)
Sets a feature for the specified root hub port.
EFI Usb I/O Protocol as defined in UEFI specification.
EFI_USB_DATA_DIRECTION
USB data transfer direction.
Definition UsbIo.h:46
USB_DEVICE_REQUEST EFI_USB_DEVICE_REQUEST
Definition UsbIo.h:37
EFI_STATUS(EFIAPI * EFI_ASYNC_USB_TRANSFER_CALLBACK)(IN VOID *Data, IN UINTN DataLength, IN VOID *Context, IN UINT32 Status)
Async USB transfer callback routine.
Definition UsbIo.h:82
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:921
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:951
#define IN
Definition mlx_utils.h:28
#define OUT
Definition mlx_utils.h:29
UINT8 TranslatorPortNumber
the port number of the hub that device is connected to.
UINT16 PortChangeStatus
Contains current port status change bitmap.
UINT16 PortStatus
Contains current port status bitmap.
The EFI_USB2_HC_PROTOCOL provides USB host controller management, basic data transactions over a USB ...
EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus
EFI_USB2_HC_PROTOCOL_SET_STATE SetState
EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature
EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer
EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer
EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer
UINT16 MinorRevision
The minor revision number of the USB host controller.
EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer
EFI_USB2_HC_PROTOCOL_GET_STATE GetState
EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature
UINT16 MajorRevision
The major revision number of the USB host controller.
EFI_USB2_HC_PROTOCOL_GET_CAPABILITY GetCapability
EFI_USB2_HC_PROTOCOL_RESET Reset
EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer
EFI_USB2_HC_PROTOCOL_BULK_TRANSFER BulkTransfer