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