]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/Usb2HostController.h
Code Scrub for Protocol and Ppi Definition
[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, 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
115 #define EFI_USB_HC_RESET_GLOBAL 0x0001
116 #define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002
117 #define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004
118 #define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008
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 **/
137 typedef
138 EFI_STATUS
139 (EFIAPI *EFI_USB2_HC_PROTOCOL_RESET)(
140 IN EFI_USB2_HC_PROTOCOL *This,
141 IN UINT16 Attributes
142 )
143 ;
144
145 /**
146
147 @param 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
158 @param 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
167 @param EfiUsbHcStateSuspend The host controller is in the
168 suspend state. No USB
169 transactions can occur while in
170 this state. The host controller
171 enters this state for the
172 following reasons: 1) Explicitly
173 set by software. 2) Triggered
174 when there is no bus traffic for
175 3 microseconds.
176
177 **/
178 typedef enum {
179 EfiUsbHcStateHalt,
180 EfiUsbHcStateOperational,
181 EfiUsbHcStateSuspend,
182 EfiUsbHcStateMaximum
183 } EFI_USB_HC_STATE;
184
185 /**
186 Retrieves current state of the USB host controller.
187
188 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
189 @param State A pointer to the EFI_USB_HC_STATE data structure that
190 indicates current state of the USB host controller.
191
192 @retval EFI_SUCCESS The state information of the host controller was returned in State.
193 @retval EFI_INVALID_PARAMETER State is NULL.
194 @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the
195 host controller's current state.
196
197 **/
198 typedef
199 EFI_STATUS
200 (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE)(
201 IN CONST EFI_USB2_HC_PROTOCOL *This,
202 OUT EFI_USB_HC_STATE *State
203 )
204 ;
205
206 /**
207 Sets the USB host controller to a specific state.
208
209 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
210 @param State Indicates the state of the host controller that will be set.
211
212 @retval EFI_SUCCESS The USB host controller was successfully placed in the state
213 specified by State.
214 @retval EFI_INVALID_PARAMETER State is not valid.
215 @retval EFI_DEVICE_ERROR Failed to set the state specified by State due to device error.
216
217 **/
218 typedef
219 EFI_STATUS
220 (EFIAPI *EFI_USB2_HC_PROTOCOL_SET_STATE)(
221 IN EFI_USB2_HC_PROTOCOL *This,
222 IN EFI_USB_HC_STATE State
223 )
224 ;
225
226 /**
227 Submits control transfer to a target USB device.
228
229 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
230 @param DeviceAddress Represents the address of the target device on the USB.
231 @param DeviceSpeed Indicates device speed.
232 @param MaximumPacketLength Indicates the maximum packet size that the default control transfer
233 endpoint is capable of sending or receiving.
234 @param Request A pointer to the USB device request that will be sent to the USB device.
235 @param TransferDirection Specifies the data direction for the transfer. There are three values
236 available, EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.
237 @param Data A pointer to the buffer of data that will be transmitted to USB device or
238 received from USB device.
239 @param DataLength On input, indicates the size, in bytes, of the data buffer specified by Data.
240 On output, indicates the amount of data actually transferred.
241 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
242 allowed to complete.
243 @param Translator A pointer to the transaction translator data.
244 @param TransferResult A pointer to the detailed result information generated by this control
245 transfer.
246
247 @retval EFI_SUCCESS The control transfer was completed successfully.
248 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
249 @retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources.
250 @retval EFI_TIMEOUT The control transfer failed due to timeout.
251 @retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.
252 Caller should check TransferResult for detailed error information.
253
254 **/
255 typedef
256 EFI_STATUS
257 (EFIAPI *EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER)(
258 IN EFI_USB2_HC_PROTOCOL *This,
259 IN UINT8 DeviceAddress,
260 IN UINT8 DeviceSpeed,
261 IN UINTN MaximumPacketLength,
262 IN EFI_USB_DEVICE_REQUEST *Request,
263 IN EFI_USB_DATA_DIRECTION TransferDirection,
264 IN OUT VOID *Data OPTIONAL,
265 IN OUT UINTN *DataLength OPTIONAL,
266 IN UINTN TimeOut,
267 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
268 OUT UINT32 *TransferResult
269 )
270 ;
271
272 #define EFI_USB_MAX_BULK_BUFFER_NUM 10
273
274 /**
275 Submits bulk transfer to a bulk endpoint of a USB device.
276
277 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
278 @param DeviceAddress Represents the address of the target device on the USB.
279 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
280 target USB device.
281 @param DeviceSpeed Indicates device speed.
282 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
283 sending or receiving.
284 @param DataBuffersNumber Number of data buffers prepared for the transfer.
285 @param Data Array of pointers to the buffers of data that will be transmitted to USB
286 device or received from USB device.
287 @param DataLength When input, indicates the size, in bytes, of the data buffers specified by
288 Data. When output, indicates the actually transferred data size.
289 @param DataToggle A pointer to the data toggle value.
290 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
291 allowed to complete.
292 @param Translator A pointer to the transaction translator data.
293 @param TransferResult A pointer to the detailed result information of the bulk transfer.
294
295 @retval EFI_SUCCESS The bulk transfer was completed successfully.
296 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
297 @retval EFI_OUT_OF_RESOURCES The bulk transfer could not be submitted due to a lack of resources.
298 @retval EFI_TIMEOUT The bulk transfer failed due to timeout.
299 @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.
300 Caller should check TransferResult for detailed error information.
301
302 **/
303 typedef
304 EFI_STATUS
305 (EFIAPI *EFI_USB2_HC_PROTOCOL_BULK_TRANSFER)(
306 IN EFI_USB2_HC_PROTOCOL *This,
307 IN UINT8 DeviceAddress,
308 IN UINT8 EndPointAddress,
309 IN UINT8 DeviceSpeed,
310 IN UINTN MaximumPacketLength,
311 IN UINT8 DataBuffersNumber,
312 IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM],
313 IN OUT UINTN *DataLength,
314 IN OUT UINT8 *DataToggle,
315 IN UINTN TimeOut,
316 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
317 OUT UINT32 *TransferResult
318 )
319 ;
320
321 /**
322 Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
323 Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.
324
325 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
326 @param DeviceAddress Represents the address of the target device on the USB.
327 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
328 target USB device.
329 @param DeviceSpeed Indicates device speed.
330 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
331 sending or receiving.
332 @param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between the host and the
333 target interrupt endpoint. If FALSE, the specified asynchronous interrupt
334 pipe is canceled. If TRUE, and an interrupt transfer exists for the target
335 end point, then EFI_INVALID_PARAMETER is returned.
336 @param DataToggle A pointer to the data toggle value.
337 @param PollingInterval Indicates the interval, in milliseconds, that the asynchronous interrupt
338 transfer is polled.
339 @param DataLength Indicates the length of data to be received at the rate specified by
340 PollingInterval from the target asynchronous interrupt endpoint.
341 @param Translator A pointr to the transaction translator data.
342 @param CallBackFunction The Callback function. This function is called at the rate specified by
343 PollingInterval.
344 @param Context The context that is passed to the CallBackFunction. This is an
345 optional parameter and may be NULL.
346
347 @retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully
348 submitted or canceled.
349 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
350 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
351
352 **/
353 typedef
354 EFI_STATUS
355 (EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER)(
356 IN EFI_USB2_HC_PROTOCOL *This,
357 IN UINT8 DeviceAddress,
358 IN UINT8 EndPointAddress,
359 IN UINT8 DeviceSpeed,
360 IN UINTN MaxiumPacketLength,
361 IN BOOLEAN IsNewTransfer,
362 IN OUT UINT8 *DataToggle,
363 IN UINTN PollingInterval OPTIONAL,
364 IN UINTN DataLength OPTIONAL,
365 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator OPTIONAL,
366 IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,
367 IN VOID *Context OPTIONAL
368 )
369 ;
370
371 /**
372 Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.
373 Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.
374
375 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
376 @param DeviceAddress Represents the address of the target device on the USB.
377 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
378 target USB device.
379 @param DeviceSpeed Indicates device speed.
380 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
381 sending or receiving.
382 @param Data A pointer to the buffer of data that will be transmitted to USB device or
383 received from USB device.
384 @param DataLength On input, the size, in bytes, of the data buffer specified by Data. On
385 output, the number of bytes transferred.
386 @param DataToggle A pointer to the data toggle value.
387 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
388 allowed to complete.
389 @param Translator A pointr to the transaction translator data.
390 @param TransferResult A pointer to the detailed result information from the synchronous
391 interrupt transfer.
392
393 @retval EFI_SUCCESS The synchronous interrupt transfer was completed successfully.
394 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
395 @retval EFI_OUT_OF_RESOURCES The synchronous interrupt transfer could not be submitted due to a lack of resources.
396 @retval EFI_TIMEOUT The synchronous interrupt transfer failed due to timeout.
397 @retval EFI_DEVICE_ERROR The synchronous interrupt transfer failed due to host controller or device error.
398 Caller should check TransferResult for detailed error information.
399
400 **/
401 typedef
402 EFI_STATUS
403 (EFIAPI *EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER)(
404 IN EFI_USB2_HC_PROTOCOL *This,
405 IN UINT8 DeviceAddress,
406 IN UINT8 EndPointAddress,
407 IN UINT8 DeviceSpeed,
408 IN UINTN MaximumPacketLength,
409 IN OUT VOID *Data,
410 IN OUT UINTN *DataLength,
411 IN OUT UINT8 *DataToggle,
412 IN UINTN TimeOut,
413 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
414 OUT UINT32 *TransferResult
415 )
416 ;
417
418 #define EFI_USB_MAX_ISO_BUFFER_NUM 7
419 #define EFI_USB_MAX_ISO_BUFFER_NUM1 2
420
421 /**
422 Submits isochronous transfer to an isochronous endpoint of a USB device.
423
424 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
425 @param DeviceAddress Represents the address of the target device on the USB.
426 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
427 target USB device.
428 @param DeviceSpeed Indicates device speed.
429 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
430 sending or receiving.
431 @param DataBuffersNumber Number of data buffers prepared for the transfer.
432 @param Data Array of pointers to the buffers of data that will be transmitted to USB
433 device or received from USB device.
434 @param DataLength Specifies the length, in bytes, of the data to be sent to or received from
435 the USB device.
436 @param Translator A pointer to the transaction translator data.
437 @param TransferResult A pointer to the detailed result information of the isochronous transfer.
438
439 @retval EFI_SUCCESS The isochronous transfer was completed successfully.
440 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
441 @retval EFI_OUT_OF_RESOURCES The isochronous transfer could not be submitted due to a lack of resources.
442 @retval EFI_TIMEOUT The isochronous transfer cannot be completed within the one USB frame time.
443 @retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.
444 Caller should check TransferResult for detailed error information.
445
446 **/
447 typedef
448 EFI_STATUS
449 (EFIAPI *EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER)(
450 IN EFI_USB2_HC_PROTOCOL *This,
451 IN UINT8 DeviceAddress,
452 IN UINT8 EndPointAddress,
453 IN UINT8 DeviceSpeed,
454 IN UINTN MaximumPacketLength,
455 IN UINT8 DataBuffersNumber,
456 IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
457 IN UINTN DataLength,
458 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
459 OUT UINT32 *TransferResult
460 )
461 ;
462
463 /**
464 Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.
465
466 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
467 @param DeviceAddress Represents the address of the target device on the USB.
468 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the
469 target USB device.
470 @param DeviceSpeed Indicates device speed.
471 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
472 sending or receiving.
473 @param DataBuffersNumber Number of data buffers prepared for the transfer.
474 @param Data Array of pointers to the buffers of data that will be transmitted to USB
475 device or received from USB device.
476 @param DataLength Specifies the length, in bytes, of the data to be sent to or received from
477 the USB device.
478 @param Translator A pointer to the transaction translator data.
479 @param IsochronousCallback The Callback function. This function is called if the requested
480 isochronous transfer is completed.
481 @param Context Data passed to the IsochronousCallback function. This is an
482 optional parameter and may be NULL.
483
484 @retval EFI_SUCCESS The asynchronous isochronous transfer request has been successfully
485 submitted or canceled.
486 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
487 @retval EFI_OUT_OF_RESOURCES The asynchronous isochronous transfer could not be submitted due to
488 a lack of resources.
489
490 **/
491 typedef
492 EFI_STATUS
493 (EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER)(
494 IN EFI_USB2_HC_PROTOCOL *This,
495 IN UINT8 DeviceAddress,
496 IN UINT8 EndPointAddress,
497 IN UINT8 DeviceSpeed,
498 IN UINTN MaximumPacketLength,
499 IN UINT8 DataBuffersNumber,
500 IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
501 IN UINTN DataLength,
502 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
503 IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
504 IN VOID *Context OPTIONAL
505 )
506 ;
507
508 /**
509 Retrieves the current status of a USB root hub port.
510
511 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
512 @param PortNumber Specifies the root hub port from which the status is to be retrieved.
513 This value is zero based.
514 @param PortStatus A pointer to the current port status bits and port status change bits.
515
516 @retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber
517 was returned in PortStatus.
518 @retval EFI_INVALID_PARAMETER PortNumber is invalid.
519
520 **/
521 typedef
522 EFI_STATUS
523 (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS)(
524 IN CONST EFI_USB2_HC_PROTOCOL *This,
525 IN CONST UINT8 PortNumber,
526 OUT EFI_USB_PORT_STATUS *PortStatus
527 )
528 ;
529
530 /**
531 Sets a feature for the specified root hub port.
532
533 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
534 @param PortNumber Specifies the root hub port whose feature is requested to be set. This
535 value is zero based.
536 @param PortFeature Indicates the feature selector associated with the feature set request.
537
538 @retval EFI_SUCCESS The feature specified by PortFeature was set for the USB
539 root hub port specified by PortNumber.
540 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
541
542 **/
543 typedef
544 EFI_STATUS
545 (EFIAPI *EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE)(
546 IN EFI_USB2_HC_PROTOCOL *This,
547 IN UINT8 PortNumber,
548 IN EFI_USB_PORT_FEATURE PortFeature
549 )
550 ;
551
552 /**
553 Clears a feature for the specified root hub port.
554
555 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
556 @param PortNumber Specifies the root hub port whose feature is requested to be cleared. This
557 value is zero based.
558 @param PortFeature Indicates the feature selector associated with the feature clear request.
559
560 @retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB
561 root hub port specified by PortNumber.
562 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
563
564 **/
565 typedef
566 EFI_STATUS
567 (EFIAPI *EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE)(
568 IN EFI_USB2_HC_PROTOCOL *This,
569 IN UINT8 PortNumber,
570 IN EFI_USB_PORT_FEATURE PortFeature
571 )
572 ;
573
574 /**
575 @par Protocol Description:
576 The EFI_USB2_HC_PROTOCOL provides USB host controller management, basic
577 data transactions over a USB bus, and USB root hub access. A device driver
578 that wishes to manage a USB bus in a system retrieves the EFI_USB2_HC_PROTOCOL
579 instance that is associated with the USB bus to be managed. A device handle
580 for a USB host controller will minimally contain an EFI_DEVICE_PATH_PROTOCOL
581 instance, and an EFI_USB2_HC_PROTOCOL instance.
582
583 @param GetCapability
584 Retrieves the capabilities of the USB host controller.
585
586 @param Reset
587 Software reset of USB.
588
589 @param GetState
590 Retrieves the current state of the USB host controller.
591
592 @param SetState
593 Sets the USB host controller to a specific state.
594
595 @param ControlTransfer
596 Submits a control transfer to a target USB device.
597
598 @param BulkTransfer
599 Submits a bulk transfer to a bulk endpoint of a USB device.
600
601 @param AsyncInterruptTransfer
602 Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
603
604 @param SyncInterruptTransfer
605 Submits a synchronous interrupt transfer to an interrupt endpoint of a USB device.
606
607 @param IsochronousTransfer
608 Submits isochronous transfer to an isochronous endpoint of a USB device.
609
610 @param AsyncIsochronousTransfer
611 Submits nonblocking USB isochronous transfer.
612
613 @param GetRootHubPortStatus
614 Retrieves the status of the specified root hub port.
615
616 @param SetRootHubPortFeature
617 Sets the feature for the specified root hub port.
618
619 @param ClearRootHubPortFeature
620 Clears the feature for the specified root hub port.
621
622 @param MajorRevision
623 The major revision number of the USB host controller. The revision information
624 indicates the release of the Universal Serial Bus Specification with which the
625 host controller is compliant.
626
627 @param MinorRevision
628 The minor revision number of the USB host controller. The revision information
629 indicates the release of the Universal Serial Bus Specification with which the
630 host controller is compliant.
631 **/
632 struct _EFI_USB2_HC_PROTOCOL {
633 EFI_USB2_HC_PROTOCOL_GET_CAPABILITY GetCapability;
634 EFI_USB2_HC_PROTOCOL_RESET Reset;
635 EFI_USB2_HC_PROTOCOL_GET_STATE GetState;
636 EFI_USB2_HC_PROTOCOL_SET_STATE SetState;
637 EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer;
638 EFI_USB2_HC_PROTOCOL_BULK_TRANSFER BulkTransfer;
639 EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer;
640 EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer;
641 EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer;
642 EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer;
643 EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;
644 EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;
645 EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature;
646 UINT16 MajorRevision;
647 UINT16 MinorRevision;
648 };
649
650 extern EFI_GUID gEfiUsb2HcProtocolGuid;
651
652 #endif