]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/Usb2HostController.h
Formalize comments for Protocols and PPIs.
[mirror_edk2.git] / MdePkg / Include / Protocol / Usb2HostController.h
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 - 2008, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 **/
17
18 #ifndef _USB2_HOSTCONTROLLER_H_
19 #define _USB2_HOSTCONTROLLER_H_
20
21 #include <IndustryStandard/Usb.h>
22 #include <Protocol/UsbIo.h>
23
24 #define EFI_USB2_HC_PROTOCOL_GUID \
25 { \
26 0x3e745226, 0x9818, 0x45b6, {0xa2, 0xac, 0xd7, 0xcd, 0xe, 0x8b, 0xa2, 0xbc } \
27 }
28
29 ///
30 /// Forward reference for pure ANSI compatability
31 ///
32 typedef struct _EFI_USB2_HC_PROTOCOL EFI_USB2_HC_PROTOCOL;
33
34
35 typedef struct {
36 UINT16 PortStatus;
37 UINT16 PortChangeStatus;
38 } EFI_USB_PORT_STATUS;
39
40 //
41 // Constant value for Port Status & Port Change Status
42 //
43 #define USB_PORT_STAT_CONNECTION 0x0001
44 #define USB_PORT_STAT_ENABLE 0x0002
45 #define USB_PORT_STAT_SUSPEND 0x0004
46 #define USB_PORT_STAT_OVERCURRENT 0x0008
47 #define USB_PORT_STAT_RESET 0x0010
48 #define USB_PORT_STAT_POWER 0x0100
49 #define USB_PORT_STAT_LOW_SPEED 0x0200
50 #define USB_PORT_STAT_HIGH_SPEED 0x0400
51 #define USB_PORT_STAT_OWNER 0x0800
52
53 #define USB_PORT_STAT_C_CONNECTION 0x0001
54 #define USB_PORT_STAT_C_ENABLE 0x0002
55 #define USB_PORT_STAT_C_SUSPEND 0x0004
56 #define USB_PORT_STAT_C_OVERCURRENT 0x0008
57 #define USB_PORT_STAT_C_RESET 0x0010
58
59
60 //
61 // Usb port features
62 //
63 typedef enum {
64 EfiUsbPortEnable = 1,
65 EfiUsbPortSuspend = 2,
66 EfiUsbPortReset = 4,
67 EfiUsbPortPower = 8,
68 EfiUsbPortOwner = 13,
69 EfiUsbPortConnectChange = 16,
70 EfiUsbPortEnableChange = 17,
71 EfiUsbPortSuspendChange = 18,
72 EfiUsbPortOverCurrentChange = 19,
73 EfiUsbPortResetChange = 20
74 } EFI_USB_PORT_FEATURE;
75
76
77 #define EFI_USB_SPEED_FULL 0x0000 // 12 Mb/s, USB 1.1 OHCI and UHCI HC.
78 #define EFI_USB_SPEED_LOW 0x0001 // 1 Mb/s, USB 1.1 OHCI and UHCI HC.
79 #define EFI_USB_SPEED_HIGH 0x0002 // 480 Mb/s, USB 2.0 EHCI HC.
80
81 typedef struct {
82 UINT8 TranslatorHubAddress;
83 UINT8 TranslatorPortNumber;
84 } EFI_USB2_HC_TRANSACTION_TRANSLATOR;
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 **/
105 typedef
106 EFI_STATUS
107 (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_CAPABILITY)(
108 IN EFI_USB2_HC_PROTOCOL *This,
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 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 **/
136 typedef
137 EFI_STATUS
138 (EFIAPI *EFI_USB2_HC_PROTOCOL_RESET)(
139 IN EFI_USB2_HC_PROTOCOL *This,
140 IN UINT16 Attributes
141 );
142
143 /**
144 Enumration value for status of USB HC.
145 **/
146 typedef 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.
176 } EFI_USB_HC_STATE;
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 **/
191 typedef
192 EFI_STATUS
193 (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE)(
194 IN CONST EFI_USB2_HC_PROTOCOL *This,
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 **/
210 typedef
211 EFI_STATUS
212 (EFIAPI *EFI_USB2_HC_PROTOCOL_SET_STATE)(
213 IN EFI_USB2_HC_PROTOCOL *This,
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 **/
246 typedef
247 EFI_STATUS
248 (EFIAPI *EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER)(
249 IN EFI_USB2_HC_PROTOCOL *This,
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,
256 IN OUT UINTN *DataLength OPTIONAL,
257 IN UINTN TimeOut,
258 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
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 **/
293 typedef
294 EFI_STATUS
295 (EFIAPI *EFI_USB2_HC_PROTOCOL_BULK_TRANSFER)(
296 IN EFI_USB2_HC_PROTOCOL *This,
297 IN UINT8 DeviceAddress,
298 IN UINT8 EndPointAddress,
299 IN UINT8 DeviceSpeed,
300 IN UINTN MaximumPacketLength,
301 IN UINT8 DataBuffersNumber,
302 IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM],
303 IN OUT UINTN *DataLength,
304 IN OUT UINT8 *DataToggle,
305 IN UINTN TimeOut,
306 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
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 **/
342 typedef
343 EFI_STATUS
344 (EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER)(
345 IN EFI_USB2_HC_PROTOCOL *This,
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,
353 IN UINTN DataLength OPTIONAL,
354 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator OPTIONAL,
355 IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction 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 **/
389 typedef
390 EFI_STATUS
391 (EFIAPI *EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER)(
392 IN EFI_USB2_HC_PROTOCOL *This,
393 IN UINT8 DeviceAddress,
394 IN UINT8 EndPointAddress,
395 IN UINT8 DeviceSpeed,
396 IN UINTN MaximumPacketLength,
397 IN OUT VOID *Data,
398 IN OUT UINTN *DataLength,
399 IN OUT UINT8 *DataToggle,
400 IN UINTN TimeOut,
401 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
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 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
412 @param DeviceAddress Represents the address of the target device on the USB.
413 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
414 target USB device.
415 @param DeviceSpeed Indicates device speed.
416 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
417 sending or receiving.
418 @param DataBuffersNumber Number of data buffers prepared for the transfer.
419 @param Data Array of pointers to the buffers of data that will be transmitted to USB
420 device or received from USB device.
421 @param DataLength Specifies the length, in bytes, of the data to be sent to or received from
422 the USB device.
423 @param Translator A pointer to the transaction translator data.
424 @param TransferResult A pointer to the detailed result information of the isochronous transfer.
425
426 @retval EFI_SUCCESS The isochronous transfer was completed successfully.
427 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
428 @retval EFI_OUT_OF_RESOURCES The isochronous transfer could not be submitted due to a lack of resources.
429 @retval EFI_TIMEOUT The isochronous transfer cannot be completed within the one USB frame time.
430 @retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.
431 Caller should check TransferResult for detailed error information.
432
433 **/
434 typedef
435 EFI_STATUS
436 (EFIAPI *EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER)(
437 IN EFI_USB2_HC_PROTOCOL *This,
438 IN UINT8 DeviceAddress,
439 IN UINT8 EndPointAddress,
440 IN UINT8 DeviceSpeed,
441 IN UINTN MaximumPacketLength,
442 IN UINT8 DataBuffersNumber,
443 IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
444 IN UINTN DataLength,
445 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
446 OUT UINT32 *TransferResult
447 );
448
449 /**
450 Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.
451
452 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
453 @param DeviceAddress Represents the address of the target device on the USB.
454 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
455 target USB device.
456 @param DeviceSpeed Indicates device speed.
457 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
458 sending or receiving.
459 @param DataBuffersNumber Number of data buffers prepared for the transfer.
460 @param Data Array of pointers to the buffers of data that will be transmitted to USB
461 device or received from USB device.
462 @param DataLength Specifies the length, in bytes, of the data to be sent to or received from
463 the USB device.
464 @param Translator A pointer to the transaction translator data.
465 @param IsochronousCallback The Callback function. This function is called if the requested
466 isochronous transfer is completed.
467 @param Context Data passed to the IsochronousCallback function. This is an
468 optional parameter and may be NULL.
469
470 @retval EFI_SUCCESS The asynchronous isochronous transfer request has been successfully
471 submitted or canceled.
472 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
473 @retval EFI_OUT_OF_RESOURCES The asynchronous isochronous transfer could not be submitted due to
474 a lack of resources.
475
476 **/
477 typedef
478 EFI_STATUS
479 (EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER)(
480 IN EFI_USB2_HC_PROTOCOL *This,
481 IN UINT8 DeviceAddress,
482 IN UINT8 EndPointAddress,
483 IN UINT8 DeviceSpeed,
484 IN UINTN MaximumPacketLength,
485 IN UINT8 DataBuffersNumber,
486 IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
487 IN UINTN DataLength,
488 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
489 IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
490 IN VOID *Context OPTIONAL
491 );
492
493 /**
494 Retrieves the current status of a USB root hub port.
495
496 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
497 @param PortNumber Specifies the root hub port from which the status is to be retrieved.
498 This value is zero based.
499 @param PortStatus A pointer to the current port status bits and port status change bits.
500
501 @retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber
502 was returned in PortStatus.
503 @retval EFI_INVALID_PARAMETER PortNumber is invalid.
504
505 **/
506 typedef
507 EFI_STATUS
508 (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS)(
509 IN CONST EFI_USB2_HC_PROTOCOL *This,
510 IN CONST UINT8 PortNumber,
511 OUT EFI_USB_PORT_STATUS *PortStatus
512 );
513
514 /**
515 Sets a feature for the specified root hub port.
516
517 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
518 @param PortNumber Specifies the root hub port whose feature is requested to be set. This
519 value is zero based.
520 @param PortFeature Indicates the feature selector associated with the feature set request.
521
522 @retval EFI_SUCCESS The feature specified by PortFeature was set for the USB
523 root hub port specified by PortNumber.
524 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
525
526 **/
527 typedef
528 EFI_STATUS
529 (EFIAPI *EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE)(
530 IN EFI_USB2_HC_PROTOCOL *This,
531 IN UINT8 PortNumber,
532 IN EFI_USB_PORT_FEATURE PortFeature
533 );
534
535 /**
536 Clears a feature for the specified root hub port.
537
538 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
539 @param PortNumber Specifies the root hub port whose feature is requested to be cleared. This
540 value is zero based.
541 @param PortFeature Indicates the feature selector associated with the feature clear request.
542
543 @retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB
544 root hub port specified by PortNumber.
545 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
546
547 **/
548 typedef
549 EFI_STATUS
550 (EFIAPI *EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE)(
551 IN EFI_USB2_HC_PROTOCOL *This,
552 IN UINT8 PortNumber,
553 IN EFI_USB_PORT_FEATURE PortFeature
554 );
555
556 ///
557 /// The EFI_USB2_HC_PROTOCOL provides USB host controller management, basic
558 /// data transactions over a USB bus, and USB root hub access. A device driver
559 /// that wishes to manage a USB bus in a system retrieves the EFI_USB2_HC_PROTOCOL
560 /// instance that is associated with the USB bus to be managed. A device handle
561 /// for a USB host controller will minimally contain an EFI_DEVICE_PATH_PROTOCOL
562 /// instance, and an EFI_USB2_HC_PROTOCOL instance.
563 ///
564 struct _EFI_USB2_HC_PROTOCOL {
565 EFI_USB2_HC_PROTOCOL_GET_CAPABILITY GetCapability;
566 EFI_USB2_HC_PROTOCOL_RESET Reset;
567 EFI_USB2_HC_PROTOCOL_GET_STATE GetState;
568 EFI_USB2_HC_PROTOCOL_SET_STATE SetState;
569 EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer;
570 EFI_USB2_HC_PROTOCOL_BULK_TRANSFER BulkTransfer;
571 EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer;
572 EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer;
573 EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer;
574 EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer;
575 EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;
576 EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;
577 EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature;
578
579 ///
580 /// The major revision number of the USB host controller. The revision information
581 /// indicates the release of the Universal Serial Bus Specification with which the
582 /// host controller is compliant.
583 ///
584 UINT16 MajorRevision;
585
586 ///
587 /// The minor revision number of the USB host controller. The revision information
588 /// indicates the release of the Universal Serial Bus Specification with which the
589 /// host controller is compliant.
590 ///
591 UINT16 MinorRevision;
592 };
593
594 extern EFI_GUID gEfiUsb2HcProtocolGuid;
595
596 #endif