]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/Usb2HostController.h
6687e323aaae0f515a8e153b863d1a6a583e4476
[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; /// Contains current port status bitmap.
37 UINT16 PortChangeStatus; /// Contains current port status change bitmap.
38 } EFI_USB_PORT_STATUS;
39
40 ///
41 /// EFI_USB_PORT_STATUS.PortStatus bit definition
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 ///
54 /// EFI_USB_PORT_STATUS.PortChangeStatus bit definition
55 ///
56 #define USB_PORT_STAT_C_CONNECTION 0x0001
57 #define USB_PORT_STAT_C_ENABLE 0x0002
58 #define USB_PORT_STAT_C_SUSPEND 0x0004
59 #define USB_PORT_STAT_C_OVERCURRENT 0x0008
60 #define USB_PORT_STAT_C_RESET 0x0010
61
62
63 ///
64 /// Usb port features value
65 /// Each value indicates its bit index in the port status and status change bitmaps,
66 /// if combines these two bitmaps into a 32-bit bitmap.
67 ///
68 typedef enum {
69 EfiUsbPortEnable = 1,
70 EfiUsbPortSuspend = 2,
71 EfiUsbPortReset = 4,
72 EfiUsbPortPower = 8,
73 EfiUsbPortOwner = 13,
74 EfiUsbPortConnectChange = 16,
75 EfiUsbPortEnableChange = 17,
76 EfiUsbPortSuspendChange = 18,
77 EfiUsbPortOverCurrentChange = 19,
78 EfiUsbPortResetChange = 20
79 } EFI_USB_PORT_FEATURE;
80
81 #define EFI_USB_SPEED_FULL 0x0000 /// 12 Mb/s, USB 1.1 OHCI and UHCI HC.
82 #define EFI_USB_SPEED_LOW 0x0001 /// 1 Mb/s, USB 1.1 OHCI and UHCI HC.
83 #define EFI_USB_SPEED_HIGH 0x0002 /// 480 Mb/s, USB 2.0 EHCI HC.
84
85 typedef struct {
86 UINT8 TranslatorHubAddress; /// device address
87 UINT8 TranslatorPortNumber; /// the port number of the hub that device is connected to.
88 } EFI_USB2_HC_TRANSACTION_TRANSLATOR;
89
90 //
91 // Protocol definitions
92 //
93
94 /**
95 Retrieves the Host Controller capabilities.
96
97 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
98 @param MaxSpeed Host controller data transfer speed.
99 @param PortNumber Number of the root hub ports.
100 @param Is64BitCapable TRUE if controller supports 64-bit memory addressing,
101 FALSE otherwise.
102
103 @retval EFI_SUCCESS The host controller capabilities were retrieved successfully.
104 @retval EFI_INVALID_PARAMETER One of the input args was NULL.
105 @retval EFI_DEVICE_ERROR An error was encountered while attempting to
106 retrieve the capabilities.
107
108 **/
109 typedef
110 EFI_STATUS
111 (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_CAPABILITY)(
112 IN EFI_USB2_HC_PROTOCOL *This,
113 OUT UINT8 *MaxSpeed,
114 OUT UINT8 *PortNumber,
115 OUT UINT8 *Is64BitCapable
116 );
117
118 #define EFI_USB_HC_RESET_GLOBAL 0x0001
119 #define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002
120 #define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004
121 #define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008
122 /**
123 Provides software reset for the USB host controller.
124
125 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
126 @param Attributes A bit mask of the reset operation to perform.
127
128 @retval EFI_SUCCESS The reset operation succeeded.
129 @retval EFI_INVALID_PARAMETER Attributes is not valid.
130 @retval EFI_UNSUPPORTED The type of reset specified by Attributes is not currently
131 supported by the host controller hardware.
132 @retval EFI_ACCESS_DENIED Reset operation is rejected due to the debug port being configured
133 and active; only EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG or
134 EFI_USB_HC_RESET_HOST_WITH_DEBUG reset Attributes can be used to
135 perform reset operation for this host controller.
136 @retval EFI_DEVICE_ERROR An error was encountered while attempting to
137 retrieve the capabilities.
138
139 **/
140 typedef
141 EFI_STATUS
142 (EFIAPI *EFI_USB2_HC_PROTOCOL_RESET)(
143 IN EFI_USB2_HC_PROTOCOL *This,
144 IN UINT16 Attributes
145 );
146
147 /**
148 Enumration value for status of USB HC.
149 **/
150 typedef enum {
151 EfiUsbHcStateHalt, ///< The host controller is in halt
152 ///< state. No USB transactions can occur
153 ///< while in this state. The host
154 ///< controller can enter this state for
155 ///< three reasons: 1) After host
156 ///< controller hardware reset. 2)
157 ///< Explicitly set by software. 3)
158 ///< Triggered by a fatal error such as
159 ///< consistency check failure.
160
161 EfiUsbHcStateOperational, ///< The host controller is in an
162 ///< operational state. When in
163 ///< this state, the host
164 ///< controller can execute bus
165 ///< traffic. This state must be
166 ///< explicitly set to enable the
167 ///< USB bus traffic.
168
169 EfiUsbHcStateSuspend, ///< The host controller is in the
170 ///< suspend state. No USB
171 ///< transactions can occur while in
172 ///< this state. The host controller
173 ///< enters this state for the
174 ///< following reasons: 1) Explicitly
175 ///< set by software. 2) Triggered
176 ///< when there is no bus traffic for
177 ///< 3 microseconds.
178
179 EfiUsbHcStateMaximum ///< Maximum value for enumration value of HC status.
180 } EFI_USB_HC_STATE;
181
182 /**
183 Retrieves current state of the USB host controller.
184
185 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
186 @param State A pointer to the EFI_USB_HC_STATE data structure that
187 indicates current state of the USB host controller.
188
189 @retval EFI_SUCCESS The state information of the host controller was returned in State.
190 @retval EFI_INVALID_PARAMETER State is NULL.
191 @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the
192 host controller's current state.
193
194 **/
195 typedef
196 EFI_STATUS
197 (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE)(
198 IN CONST EFI_USB2_HC_PROTOCOL *This,
199 OUT EFI_USB_HC_STATE *State
200 );
201
202 /**
203 Sets the USB host controller to a specific state.
204
205 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
206 @param State Indicates the state of the host controller that will be set.
207
208 @retval EFI_SUCCESS The USB host controller was successfully placed in the state
209 specified by State.
210 @retval EFI_INVALID_PARAMETER State is not valid.
211 @retval EFI_DEVICE_ERROR Failed to set the state specified by State due to device error.
212
213 **/
214 typedef
215 EFI_STATUS
216 (EFIAPI *EFI_USB2_HC_PROTOCOL_SET_STATE)(
217 IN EFI_USB2_HC_PROTOCOL *This,
218 IN EFI_USB_HC_STATE State
219 );
220
221 /**
222 Submits control transfer to a target USB device.
223
224 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
225 @param DeviceAddress Represents the address of the target device on the USB.
226 @param DeviceSpeed Indicates device speed.
227 @param MaximumPacketLength Indicates the maximum packet size that the default control transfer
228 endpoint is capable of sending or receiving.
229 @param Request A pointer to the USB device request that will be sent to the USB device.
230 @param TransferDirection Specifies the data direction for the transfer. There are three values
231 available, EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.
232 @param Data A pointer to the buffer of data that will be transmitted to USB device or
233 received from USB device.
234 @param DataLength On input, indicates the size, in bytes, of the data buffer specified by Data.
235 On output, indicates the amount of data actually transferred.
236 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
237 allowed to complete.
238 @param Translator A pointer to the transaction translator data.
239 @param TransferResult A pointer to the detailed result information generated by this control
240 transfer.
241
242 @retval EFI_SUCCESS The control transfer was completed successfully.
243 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
244 @retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources.
245 @retval EFI_TIMEOUT The control transfer failed due to timeout.
246 @retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.
247 Caller should check TransferResult for detailed error information.
248
249 **/
250 typedef
251 EFI_STATUS
252 (EFIAPI *EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER)(
253 IN EFI_USB2_HC_PROTOCOL *This,
254 IN UINT8 DeviceAddress,
255 IN UINT8 DeviceSpeed,
256 IN UINTN MaximumPacketLength,
257 IN EFI_USB_DEVICE_REQUEST *Request,
258 IN EFI_USB_DATA_DIRECTION TransferDirection,
259 IN OUT VOID *Data OPTIONAL,
260 IN OUT UINTN *DataLength OPTIONAL,
261 IN UINTN TimeOut,
262 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
263 OUT UINT32 *TransferResult
264 );
265
266 #define EFI_USB_MAX_BULK_BUFFER_NUM 10
267
268 /**
269 Submits bulk transfer to a bulk endpoint of a USB device.
270
271 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
272 @param DeviceAddress Represents the address of the target device on the USB.
273 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
274 target USB device.
275 @param DeviceSpeed Indicates device speed.
276 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
277 sending or receiving.
278 @param DataBuffersNumber Number of data buffers prepared for the transfer.
279 @param Data Array of pointers to the buffers of data that will be transmitted to USB
280 device or received from USB device.
281 @param DataLength When input, indicates the size, in bytes, of the data buffers specified by
282 Data. When output, indicates the actually transferred data size.
283 @param DataToggle A pointer to the data toggle value.
284 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
285 allowed to complete.
286 @param Translator A pointer to the transaction translator data.
287 @param TransferResult A pointer to the detailed result information of the bulk transfer.
288
289 @retval EFI_SUCCESS The bulk transfer was completed successfully.
290 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
291 @retval EFI_OUT_OF_RESOURCES The bulk transfer could not be submitted due to a lack of resources.
292 @retval EFI_TIMEOUT The bulk transfer failed due to timeout.
293 @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.
294 Caller should check TransferResult for detailed error information.
295
296 **/
297 typedef
298 EFI_STATUS
299 (EFIAPI *EFI_USB2_HC_PROTOCOL_BULK_TRANSFER)(
300 IN EFI_USB2_HC_PROTOCOL *This,
301 IN UINT8 DeviceAddress,
302 IN UINT8 EndPointAddress,
303 IN UINT8 DeviceSpeed,
304 IN UINTN MaximumPacketLength,
305 IN UINT8 DataBuffersNumber,
306 IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM],
307 IN OUT UINTN *DataLength,
308 IN OUT UINT8 *DataToggle,
309 IN UINTN TimeOut,
310 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
311 OUT UINT32 *TransferResult
312 );
313
314 /**
315 Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
316 Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.
317
318 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
319 @param DeviceAddress Represents the address of the target device on the USB.
320 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
321 target USB device.
322 @param DeviceSpeed Indicates device speed.
323 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
324 sending or receiving.
325 @param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between the host and the
326 target interrupt endpoint. If FALSE, the specified asynchronous interrupt
327 pipe is canceled. If TRUE, and an interrupt transfer exists for the target
328 end point, then EFI_INVALID_PARAMETER is returned.
329 @param DataToggle A pointer to the data toggle value.
330 @param PollingInterval Indicates the interval, in milliseconds, that the asynchronous interrupt
331 transfer is polled.
332 @param DataLength Indicates the length of data to be received at the rate specified by
333 PollingInterval from the target asynchronous interrupt endpoint.
334 @param Translator A pointr to the transaction translator data.
335 @param CallBackFunction The Callback function. This function is called at the rate specified by
336 PollingInterval.
337 @param Context The context that is passed to the CallBackFunction. This is an
338 optional parameter and may be NULL.
339
340 @retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully
341 submitted or canceled.
342 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
343 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
344
345 **/
346 typedef
347 EFI_STATUS
348 (EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER)(
349 IN EFI_USB2_HC_PROTOCOL *This,
350 IN UINT8 DeviceAddress,
351 IN UINT8 EndPointAddress,
352 IN UINT8 DeviceSpeed,
353 IN UINTN MaxiumPacketLength,
354 IN BOOLEAN IsNewTransfer,
355 IN OUT UINT8 *DataToggle,
356 IN UINTN PollingInterval OPTIONAL,
357 IN UINTN DataLength OPTIONAL,
358 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator OPTIONAL,
359 IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,
360 IN VOID *Context OPTIONAL
361 );
362
363 /**
364 Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.
365 Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.
366
367 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
368 @param DeviceAddress Represents the address of the target device on the USB.
369 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
370 target USB device.
371 @param DeviceSpeed Indicates device speed.
372 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
373 sending or receiving.
374 @param Data A pointer to the buffer of data that will be transmitted to USB device or
375 received from USB device.
376 @param DataLength On input, the size, in bytes, of the data buffer specified by Data. On
377 output, the number of bytes transferred.
378 @param DataToggle A pointer to the data toggle value.
379 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
380 allowed to complete.
381 @param Translator A pointr to the transaction translator data.
382 @param TransferResult A pointer to the detailed result information from the synchronous
383 interrupt transfer.
384
385 @retval EFI_SUCCESS The synchronous interrupt transfer was completed successfully.
386 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
387 @retval EFI_OUT_OF_RESOURCES The synchronous interrupt transfer could not be submitted due to a lack of resources.
388 @retval EFI_TIMEOUT The synchronous interrupt transfer failed due to timeout.
389 @retval EFI_DEVICE_ERROR The synchronous interrupt transfer failed due to host controller or device error.
390 Caller should check TransferResult for detailed error information.
391
392 **/
393 typedef
394 EFI_STATUS
395 (EFIAPI *EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER)(
396 IN EFI_USB2_HC_PROTOCOL *This,
397 IN UINT8 DeviceAddress,
398 IN UINT8 EndPointAddress,
399 IN UINT8 DeviceSpeed,
400 IN UINTN MaximumPacketLength,
401 IN OUT VOID *Data,
402 IN OUT UINTN *DataLength,
403 IN OUT UINT8 *DataToggle,
404 IN UINTN TimeOut,
405 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
406 OUT UINT32 *TransferResult
407 );
408
409 #define EFI_USB_MAX_ISO_BUFFER_NUM 7
410 #define EFI_USB_MAX_ISO_BUFFER_NUM1 2
411
412 /**
413 Submits isochronous transfer to an isochronous endpoint of a USB device.
414
415 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
416 @param DeviceAddress Represents the address of the target device on the USB.
417 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
418 target USB device.
419 @param DeviceSpeed Indicates device speed.
420 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
421 sending or receiving.
422 @param DataBuffersNumber Number of data buffers prepared for the transfer.
423 @param Data Array of pointers to the buffers of data that will be transmitted to USB
424 device or received from USB device.
425 @param DataLength Specifies the length, in bytes, of the data to be sent to or received from
426 the USB device.
427 @param Translator A pointer to the transaction translator data.
428 @param TransferResult A pointer to the detailed result information of the isochronous transfer.
429
430 @retval EFI_SUCCESS The isochronous transfer was completed successfully.
431 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
432 @retval EFI_OUT_OF_RESOURCES The isochronous transfer could not be submitted due to a lack of resources.
433 @retval EFI_TIMEOUT The isochronous transfer cannot be completed within the one USB frame time.
434 @retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.
435 Caller should check TransferResult for detailed error information.
436
437 **/
438 typedef
439 EFI_STATUS
440 (EFIAPI *EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER)(
441 IN EFI_USB2_HC_PROTOCOL *This,
442 IN UINT8 DeviceAddress,
443 IN UINT8 EndPointAddress,
444 IN UINT8 DeviceSpeed,
445 IN UINTN MaximumPacketLength,
446 IN UINT8 DataBuffersNumber,
447 IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
448 IN UINTN DataLength,
449 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
450 OUT UINT32 *TransferResult
451 );
452
453 /**
454 Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.
455
456 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
457 @param DeviceAddress Represents the address of the target device on the USB.
458 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
459 target USB device.
460 @param DeviceSpeed Indicates device speed.
461 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
462 sending or receiving.
463 @param DataBuffersNumber Number of data buffers prepared for the transfer.
464 @param Data Array of pointers to the buffers of data that will be transmitted to USB
465 device or received from USB device.
466 @param DataLength Specifies the length, in bytes, of the data to be sent to or received from
467 the USB device.
468 @param Translator A pointer to the transaction translator data.
469 @param IsochronousCallback The Callback function. This function is called if the requested
470 isochronous transfer is completed.
471 @param Context Data passed to the IsochronousCallback function. This is an
472 optional parameter and may be NULL.
473
474 @retval EFI_SUCCESS The asynchronous isochronous transfer request has been successfully
475 submitted or canceled.
476 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
477 @retval EFI_OUT_OF_RESOURCES The asynchronous isochronous transfer could not be submitted due to
478 a lack of resources.
479
480 **/
481 typedef
482 EFI_STATUS
483 (EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER)(
484 IN EFI_USB2_HC_PROTOCOL *This,
485 IN UINT8 DeviceAddress,
486 IN UINT8 EndPointAddress,
487 IN UINT8 DeviceSpeed,
488 IN UINTN MaximumPacketLength,
489 IN UINT8 DataBuffersNumber,
490 IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
491 IN UINTN DataLength,
492 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
493 IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
494 IN VOID *Context OPTIONAL
495 );
496
497 /**
498 Retrieves the current status of a USB root hub port.
499
500 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
501 @param PortNumber Specifies the root hub port from which the status is to be retrieved.
502 This value is zero based.
503 @param PortStatus A pointer to the current port status bits and port status change bits.
504
505 @retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber
506 was returned in PortStatus.
507 @retval EFI_INVALID_PARAMETER PortNumber is invalid.
508
509 **/
510 typedef
511 EFI_STATUS
512 (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS)(
513 IN CONST EFI_USB2_HC_PROTOCOL *This,
514 IN CONST UINT8 PortNumber,
515 OUT EFI_USB_PORT_STATUS *PortStatus
516 );
517
518 /**
519 Sets a feature for the specified root hub port.
520
521 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
522 @param PortNumber Specifies the root hub port whose feature is requested to be set. This
523 value is zero based.
524 @param PortFeature Indicates the feature selector associated with the feature set request.
525
526 @retval EFI_SUCCESS The feature specified by PortFeature was set for the USB
527 root hub port specified by PortNumber.
528 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
529
530 **/
531 typedef
532 EFI_STATUS
533 (EFIAPI *EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE)(
534 IN EFI_USB2_HC_PROTOCOL *This,
535 IN UINT8 PortNumber,
536 IN EFI_USB_PORT_FEATURE PortFeature
537 );
538
539 /**
540 Clears a feature for the specified root hub port.
541
542 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
543 @param PortNumber Specifies the root hub port whose feature is requested to be cleared. This
544 value is zero based.
545 @param PortFeature Indicates the feature selector associated with the feature clear request.
546
547 @retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB
548 root hub port specified by PortNumber.
549 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
550
551 **/
552 typedef
553 EFI_STATUS
554 (EFIAPI *EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE)(
555 IN EFI_USB2_HC_PROTOCOL *This,
556 IN UINT8 PortNumber,
557 IN EFI_USB_PORT_FEATURE PortFeature
558 );
559
560 ///
561 /// The EFI_USB2_HC_PROTOCOL provides USB host controller management, basic
562 /// data transactions over a USB bus, and USB root hub access. A device driver
563 /// that wishes to manage a USB bus in a system retrieves the EFI_USB2_HC_PROTOCOL
564 /// instance that is associated with the USB bus to be managed. A device handle
565 /// for a USB host controller will minimally contain an EFI_DEVICE_PATH_PROTOCOL
566 /// instance, and an EFI_USB2_HC_PROTOCOL instance.
567 ///
568 struct _EFI_USB2_HC_PROTOCOL {
569 EFI_USB2_HC_PROTOCOL_GET_CAPABILITY GetCapability;
570 EFI_USB2_HC_PROTOCOL_RESET Reset;
571 EFI_USB2_HC_PROTOCOL_GET_STATE GetState;
572 EFI_USB2_HC_PROTOCOL_SET_STATE SetState;
573 EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer;
574 EFI_USB2_HC_PROTOCOL_BULK_TRANSFER BulkTransfer;
575 EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer;
576 EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer;
577 EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer;
578 EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer;
579 EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;
580 EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;
581 EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature;
582
583 ///
584 /// The major revision number of the USB host controller. The revision information
585 /// indicates the release of the Universal Serial Bus Specification with which the
586 /// host controller is compliant.
587 ///
588 UINT16 MajorRevision;
589
590 ///
591 /// The minor revision number of the USB host controller. The revision information
592 /// indicates the release of the Universal Serial Bus Specification with which the
593 /// host controller is compliant.
594 ///
595 UINT16 MinorRevision;
596 };
597
598 extern EFI_GUID gEfiUsb2HcProtocolGuid;
599
600 #endif