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