]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.h
MdeModulePkg: Change OPTIONAL keyword usage style
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBusDxe / UsbBus.h
1 /** @file
2
3 Usb Bus Driver Binding and Bus IO Protocol.
4
5 Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef _EFI_USB_BUS_H_
11 #define _EFI_USB_BUS_H_
12
13
14 #include <Uefi.h>
15
16 #include <Protocol/Usb2HostController.h>
17 #include <Protocol/UsbHostController.h>
18 #include <Protocol/UsbIo.h>
19 #include <Protocol/DevicePath.h>
20
21 #include <Library/BaseLib.h>
22 #include <Library/DebugLib.h>
23 #include <Library/BaseMemoryLib.h>
24 #include <Library/UefiDriverEntryPoint.h>
25 #include <Library/UefiBootServicesTableLib.h>
26 #include <Library/UefiLib.h>
27 #include <Library/DevicePathLib.h>
28 #include <Library/MemoryAllocationLib.h>
29 #include <Library/ReportStatusCodeLib.h>
30
31
32 #include <IndustryStandard/Usb.h>
33
34 typedef struct _USB_DEVICE USB_DEVICE;
35 typedef struct _USB_INTERFACE USB_INTERFACE;
36 typedef struct _USB_BUS USB_BUS;
37 typedef struct _USB_HUB_API USB_HUB_API;
38
39
40 #include "UsbUtility.h"
41 #include "UsbDesc.h"
42 #include "UsbHub.h"
43 #include "UsbEnumer.h"
44
45 //
46 // USB bus timeout experience values
47 //
48
49 #define USB_MAX_LANG_ID 16
50 #define USB_MAX_INTERFACE 16
51 #define USB_MAX_DEVICES 128
52
53 #define USB_BUS_1_MILLISECOND 1000
54
55 //
56 // Roothub and hub's polling interval, set by experience,
57 // The unit of roothub is 100us, means 100ms as interval, and
58 // the unit of hub is 1ms, means 64ms as interval.
59 //
60 #define USB_ROOTHUB_POLL_INTERVAL (100 * 10000U)
61 #define USB_HUB_POLL_INTERVAL 64
62
63 //
64 // Wait for port stable to work, refers to specification
65 // [USB20-9.1.2]
66 //
67 #define USB_WAIT_PORT_STABLE_STALL (100 * USB_BUS_1_MILLISECOND)
68
69 //
70 // Wait for port statue reg change, set by experience
71 //
72 #define USB_WAIT_PORT_STS_CHANGE_STALL (100)
73
74 //
75 // Wait for set device address, refers to specification
76 // [USB20-9.2.6.3, it says 2ms]
77 //
78 #define USB_SET_DEVICE_ADDRESS_STALL (2 * USB_BUS_1_MILLISECOND)
79
80 //
81 // Wait for retry max packet size, set by experience
82 //
83 #define USB_RETRY_MAX_PACK_SIZE_STALL (100 * USB_BUS_1_MILLISECOND)
84
85 //
86 // Wait for hub port power-on, refers to specification
87 // [USB20-11.23.2]
88 //
89 #define USB_SET_PORT_POWER_STALL (2 * USB_BUS_1_MILLISECOND)
90
91 //
92 // Wait for port reset, refers to specification
93 // [USB20-7.1.7.5, it says 10ms for hub and 50ms for
94 // root hub]
95 //
96 // According to USB2.0, Chapter 11.5.1.5 Resetting,
97 // the worst case for TDRST is 20ms
98 //
99 #define USB_SET_PORT_RESET_STALL (20 * USB_BUS_1_MILLISECOND)
100 #define USB_SET_ROOT_PORT_RESET_STALL (50 * USB_BUS_1_MILLISECOND)
101
102 //
103 // Wait for port recovery to accept SetAddress, refers to specification
104 // [USB20-7.1.7.5, it says 10 ms for TRSTRCY]
105 //
106 #define USB_SET_PORT_RECOVERY_STALL (10 * USB_BUS_1_MILLISECOND)
107
108 //
109 // Wait for clear roothub port reset, set by experience
110 //
111 #define USB_CLR_ROOT_PORT_RESET_STALL (20 * USB_BUS_1_MILLISECOND)
112
113 //
114 // Wait for set roothub port enable, set by experience
115 //
116 #define USB_SET_ROOT_PORT_ENABLE_STALL (20 * USB_BUS_1_MILLISECOND)
117
118 //
119 // Send general device request timeout.
120 //
121 // The USB Specification 2.0, section 11.24.1 recommends a value of
122 // 50 milliseconds. We use a value of 500 milliseconds to work
123 // around slower hubs and devices.
124 //
125 #define USB_GENERAL_DEVICE_REQUEST_TIMEOUT 500
126
127 //
128 // Send clear feature request timeout, set by experience
129 //
130 #define USB_CLEAR_FEATURE_REQUEST_TIMEOUT 10
131
132 //
133 // Bus raises TPL to TPL_NOTIFY to serialize all its operations
134 // to protect shared data structures.
135 //
136 #define USB_BUS_TPL TPL_NOTIFY
137
138 #define USB_INTERFACE_SIGNATURE SIGNATURE_32 ('U', 'S', 'B', 'I')
139 #define USB_BUS_SIGNATURE SIGNATURE_32 ('U', 'S', 'B', 'B')
140
141 #define USB_BIT(a) ((UINTN)(1 << (a)))
142 #define USB_BIT_IS_SET(Data, Bit) ((BOOLEAN)(((Data) & (Bit)) == (Bit)))
143
144 #define USB_INTERFACE_FROM_USBIO(a) \
145 CR(a, USB_INTERFACE, UsbIo, USB_INTERFACE_SIGNATURE)
146
147 #define USB_BUS_FROM_THIS(a) \
148 CR(a, USB_BUS, BusId, USB_BUS_SIGNATURE)
149
150 //
151 // Used to locate USB_BUS
152 // UsbBusProtocol is the private protocol.
153 // gEfiCallerIdGuid will be used as its protocol guid.
154 //
155 typedef struct _EFI_USB_BUS_PROTOCOL {
156 UINT64 Reserved;
157 } EFI_USB_BUS_PROTOCOL;
158
159
160 //
161 // Stands for the real USB device. Each device may
162 // has several separately working interfaces.
163 //
164 struct _USB_DEVICE {
165 USB_BUS *Bus;
166
167 //
168 // Configuration information
169 //
170 UINT8 Speed;
171 UINT8 Address;
172 UINT32 MaxPacket0;
173
174 //
175 // The device's descriptors and its configuration
176 //
177 USB_DEVICE_DESC *DevDesc;
178 USB_CONFIG_DESC *ActiveConfig;
179
180 UINT16 LangId [USB_MAX_LANG_ID];
181 UINT16 TotalLangId;
182
183 UINT8 NumOfInterface;
184 USB_INTERFACE *Interfaces [USB_MAX_INTERFACE];
185
186 //
187 // Parent child relationship
188 //
189 EFI_USB2_HC_TRANSACTION_TRANSLATOR Translator;
190
191 UINT8 ParentAddr;
192 USB_INTERFACE *ParentIf;
193 UINT8 ParentPort; // Start at 0
194 UINT8 Tier;
195 BOOLEAN DisconnectFail;
196 };
197
198 //
199 // Stands for different functions of USB device
200 //
201 struct _USB_INTERFACE {
202 UINTN Signature;
203 USB_DEVICE *Device;
204 USB_INTERFACE_DESC *IfDesc;
205 USB_INTERFACE_SETTING *IfSetting;
206
207 //
208 // Handles and protocols
209 //
210 EFI_HANDLE Handle;
211 EFI_USB_IO_PROTOCOL UsbIo;
212 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
213 BOOLEAN IsManaged;
214
215 //
216 // Hub device special data
217 //
218 BOOLEAN IsHub;
219 USB_HUB_API *HubApi;
220 UINT8 NumOfPort;
221 EFI_EVENT HubNotify;
222
223 //
224 // Data used only by normal hub devices
225 //
226 USB_ENDPOINT_DESC *HubEp;
227 UINT8 *ChangeMap;
228
229 //
230 // Data used only by root hub to hand over device to
231 // companion UHCI driver if low/full speed devices are
232 // connected to EHCI.
233 //
234 UINT8 MaxSpeed;
235 };
236
237 //
238 // Stands for the current USB Bus
239 //
240 struct _USB_BUS {
241 UINTN Signature;
242 EFI_USB_BUS_PROTOCOL BusId;
243
244 //
245 // Managed USB host controller
246 //
247 EFI_HANDLE HostHandle;
248 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
249 EFI_USB2_HC_PROTOCOL *Usb2Hc;
250 EFI_USB_HC_PROTOCOL *UsbHc;
251
252 //
253 // Recorded the max supported usb devices.
254 // XHCI can support up to 255 devices.
255 // EHCI/UHCI/OHCI supports up to 127 devices.
256 //
257 UINT32 MaxDevices;
258 //
259 // An array of device that is on the bus. Devices[0] is
260 // for root hub. Device with address i is at Devices[i].
261 //
262 USB_DEVICE *Devices[256];
263
264 //
265 // USB Bus driver need to control the recursive connect policy of the bus, only those wanted
266 // usb child device will be recursively connected.
267 //
268 // WantedUsbIoDPList tracks the Usb child devices which user want to recursively fully connecte,
269 // every wanted child device is stored in a item of the WantedUsbIoDPList, whose structure is
270 // DEVICE_PATH_LIST_ITEM
271 //
272 LIST_ENTRY WantedUsbIoDPList;
273
274 };
275
276 //
277 // USB Hub Api
278 //
279 struct _USB_HUB_API{
280 USB_HUB_INIT Init;
281 USB_HUB_GET_PORT_STATUS GetPortStatus;
282 USB_HUB_CLEAR_PORT_CHANGE ClearPortChange;
283 USB_HUB_SET_PORT_FEATURE SetPortFeature;
284 USB_HUB_CLEAR_PORT_FEATURE ClearPortFeature;
285 USB_HUB_RESET_PORT ResetPort;
286 USB_HUB_RELEASE Release;
287 };
288
289 #define USB_US_LAND_ID 0x0409
290
291 #define DEVICE_PATH_LIST_ITEM_SIGNATURE SIGNATURE_32('d','p','l','i')
292 typedef struct _DEVICE_PATH_LIST_ITEM{
293 UINTN Signature;
294 LIST_ENTRY Link;
295 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
296 } DEVICE_PATH_LIST_ITEM;
297
298 typedef struct {
299 USB_CLASS_DEVICE_PATH UsbClass;
300 EFI_DEVICE_PATH_PROTOCOL End;
301 } USB_CLASS_FORMAT_DEVICE_PATH;
302
303 /**
304 Free a DEVICE_PATH_LIST_ITEM list.
305
306 @param UsbIoDPList a DEVICE_PATH_LIST_ITEM list pointer.
307
308 @retval EFI_INVALID_PARAMETER If parameters are invalid, return this value.
309 @retval EFI_SUCCESS If free operation is successful, return this value.
310
311 **/
312 EFI_STATUS
313 EFIAPI
314 UsbBusFreeUsbDPList (
315 IN LIST_ENTRY *UsbIoDPList
316 );
317
318 /**
319 Store a wanted usb child device info (its Usb part of device path) which is indicated by
320 RemainingDevicePath in a Usb bus which is indicated by UsbBusId.
321
322 @param UsbBusId Point to EFI_USB_BUS_PROTOCOL interface.
323 @param RemainingDevicePath The remaining device patch.
324
325 @retval EFI_SUCCESS Add operation is successful.
326 @retval EFI_INVALID_PARAMETER The parameters are invalid.
327
328 **/
329 EFI_STATUS
330 EFIAPI
331 UsbBusAddWantedUsbIoDP (
332 IN EFI_USB_BUS_PROTOCOL *UsbBusId,
333 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
334 );
335
336 /**
337 Check whether a usb child device is the wanted device in a bus.
338
339 @param Bus The Usb bus's private data pointer.
340 @param UsbIf The usb child device interface.
341
342 @retval True If a usb child device is the wanted device in a bus.
343 @retval False If a usb child device is *NOT* the wanted device in a bus.
344
345 **/
346 BOOLEAN
347 EFIAPI
348 UsbBusIsWantedUsbIO (
349 IN USB_BUS *Bus,
350 IN USB_INTERFACE *UsbIf
351 );
352
353 /**
354 Recursively connect every wanted usb child device to ensure they all fully connected.
355 Check all the child Usb IO handles in this bus, recursively connecte if it is wanted usb child device.
356
357 @param UsbBusId Point to EFI_USB_BUS_PROTOCOL interface.
358
359 @retval EFI_SUCCESS Connect is done successfully.
360 @retval EFI_INVALID_PARAMETER The parameter is invalid.
361
362 **/
363 EFI_STATUS
364 EFIAPI
365 UsbBusRecursivelyConnectWantedUsbIo (
366 IN EFI_USB_BUS_PROTOCOL *UsbBusId
367 );
368
369 /**
370 USB_IO function to execute a control transfer. This
371 function will execute the USB transfer. If transfer
372 successes, it will sync the internal state of USB bus
373 with device state.
374
375 @param This The USB_IO instance
376 @param Request The control transfer request
377 @param Direction Direction for data stage
378 @param Timeout The time to wait before timeout
379 @param Data The buffer holding the data
380 @param DataLength Then length of the data
381 @param UsbStatus USB result
382
383 @retval EFI_INVALID_PARAMETER The parameters are invalid
384 @retval EFI_SUCCESS The control transfer succeded.
385 @retval Others Failed to execute the transfer
386
387 **/
388 EFI_STATUS
389 EFIAPI
390 UsbIoControlTransfer (
391 IN EFI_USB_IO_PROTOCOL *This,
392 IN EFI_USB_DEVICE_REQUEST *Request,
393 IN EFI_USB_DATA_DIRECTION Direction,
394 IN UINT32 Timeout,
395 IN OUT VOID *Data OPTIONAL,
396 IN UINTN DataLength OPTIONAL,
397 OUT UINT32 *UsbStatus
398 );
399
400 /**
401 Execute a bulk transfer to the device endpoint.
402
403 @param This The USB IO instance.
404 @param Endpoint The device endpoint.
405 @param Data The data to transfer.
406 @param DataLength The length of the data to transfer.
407 @param Timeout Time to wait before timeout.
408 @param UsbStatus The result of USB transfer.
409
410 @retval EFI_SUCCESS The bulk transfer is OK.
411 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
412 @retval Others Failed to execute transfer, reason returned in
413 UsbStatus.
414
415 **/
416 EFI_STATUS
417 EFIAPI
418 UsbIoBulkTransfer (
419 IN EFI_USB_IO_PROTOCOL *This,
420 IN UINT8 Endpoint,
421 IN OUT VOID *Data,
422 IN OUT UINTN *DataLength,
423 IN UINTN Timeout,
424 OUT UINT32 *UsbStatus
425 );
426
427 /**
428 Execute a synchronous interrupt transfer.
429
430 @param This The USB IO instance.
431 @param Endpoint The device endpoint.
432 @param Data The data to transfer.
433 @param DataLength The length of the data to transfer.
434 @param Timeout Time to wait before timeout.
435 @param UsbStatus The result of USB transfer.
436
437 @retval EFI_SUCCESS The synchronous interrupt transfer is OK.
438 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
439 @retval Others Failed to execute transfer, reason returned in
440 UsbStatus.
441
442 **/
443 EFI_STATUS
444 EFIAPI
445 UsbIoSyncInterruptTransfer (
446 IN EFI_USB_IO_PROTOCOL *This,
447 IN UINT8 Endpoint,
448 IN OUT VOID *Data,
449 IN OUT UINTN *DataLength,
450 IN UINTN Timeout,
451 OUT UINT32 *UsbStatus
452 );
453
454 /**
455 Queue a new asynchronous interrupt transfer, or remove the old
456 request if (IsNewTransfer == FALSE).
457
458 @param This The USB_IO instance.
459 @param Endpoint The device endpoint.
460 @param IsNewTransfer Whether this is a new request, if it's old, remove
461 the request.
462 @param PollInterval The interval to poll the transfer result, (in ms).
463 @param DataLength The length of perodic data transfer.
464 @param Callback The function to call periodically when transfer is
465 ready.
466 @param Context The context to the callback.
467
468 @retval EFI_SUCCESS New transfer is queued or old request is removed.
469 @retval EFI_INVALID_PARAMETER Some parameters are invalid.
470 @retval Others Failed to queue the new request or remove the old
471 request.
472
473 **/
474 EFI_STATUS
475 EFIAPI
476 UsbIoAsyncInterruptTransfer (
477 IN EFI_USB_IO_PROTOCOL *This,
478 IN UINT8 Endpoint,
479 IN BOOLEAN IsNewTransfer,
480 IN UINTN PollInterval OPTIONAL,
481 IN UINTN DataLength OPTIONAL,
482 IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback OPTIONAL,
483 IN VOID *Context OPTIONAL
484 );
485
486 /**
487 Execute a synchronous isochronous transfer.
488
489 @param This The USB IO instance.
490 @param DeviceEndpoint The device endpoint.
491 @param Data The data to transfer.
492 @param DataLength The length of the data to transfer.
493 @param UsbStatus The result of USB transfer.
494
495 @retval EFI_UNSUPPORTED Currently isochronous transfer isn't supported.
496
497 **/
498 EFI_STATUS
499 EFIAPI
500 UsbIoIsochronousTransfer (
501 IN EFI_USB_IO_PROTOCOL *This,
502 IN UINT8 DeviceEndpoint,
503 IN OUT VOID *Data,
504 IN UINTN DataLength,
505 OUT UINT32 *Status
506 );
507
508 /**
509 Queue an asynchronous isochronous transfer.
510
511 @param This The USB_IO instance.
512 @param DeviceEndpoint The device endpoint.
513 @param Data The data to transfer.
514 @param DataLength The length of perodic data transfer.
515 @param IsochronousCallBack The function to call periodically when transfer is
516 ready.
517 @param Context The context to the callback.
518
519 @retval EFI_UNSUPPORTED Currently isochronous transfer isn't supported.
520
521 **/
522 EFI_STATUS
523 EFIAPI
524 UsbIoAsyncIsochronousTransfer (
525 IN EFI_USB_IO_PROTOCOL *This,
526 IN UINT8 DeviceEndpoint,
527 IN OUT VOID *Data,
528 IN UINTN DataLength,
529 IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
530 IN VOID *Context OPTIONAL
531 );
532
533 /**
534 Retrieve the device descriptor of the device.
535
536 @param This The USB IO instance.
537 @param Descriptor The variable to receive the device descriptor.
538
539 @retval EFI_SUCCESS The device descriptor is returned.
540 @retval EFI_INVALID_PARAMETER The parameter is invalid.
541
542 **/
543 EFI_STATUS
544 EFIAPI
545 UsbIoGetDeviceDescriptor (
546 IN EFI_USB_IO_PROTOCOL *This,
547 OUT EFI_USB_DEVICE_DESCRIPTOR *Descriptor
548 );
549
550 /**
551 Return the configuration descriptor of the current active configuration.
552
553 @param This The USB IO instance.
554 @param Descriptor The USB configuration descriptor.
555
556 @retval EFI_SUCCESS The active configuration descriptor is returned.
557 @retval EFI_INVALID_PARAMETER Some parameter is invalid.
558 @retval EFI_NOT_FOUND Currently no active configuration is selected.
559
560 **/
561 EFI_STATUS
562 EFIAPI
563 UsbIoGetActiveConfigDescriptor (
564 IN EFI_USB_IO_PROTOCOL *This,
565 OUT EFI_USB_CONFIG_DESCRIPTOR *Descriptor
566 );
567
568 /**
569 Retrieve the active interface setting descriptor for this USB IO instance.
570
571 @param This The USB IO instance.
572 @param Descriptor The variable to receive active interface setting.
573
574 @retval EFI_SUCCESS The active interface setting is returned.
575 @retval EFI_INVALID_PARAMETER Some parameter is invalid.
576
577 **/
578 EFI_STATUS
579 EFIAPI
580 UsbIoGetInterfaceDescriptor (
581 IN EFI_USB_IO_PROTOCOL *This,
582 OUT EFI_USB_INTERFACE_DESCRIPTOR *Descriptor
583 );
584
585 /**
586 Retrieve the endpoint descriptor from this interface setting.
587
588 @param This The USB IO instance.
589 @param Index The index (start from zero) of the endpoint to
590 retrieve.
591 @param Descriptor The variable to receive the descriptor.
592
593 @retval EFI_SUCCESS The endpoint descriptor is returned.
594 @retval EFI_INVALID_PARAMETER Some parameter is invalid.
595
596 **/
597 EFI_STATUS
598 EFIAPI
599 UsbIoGetEndpointDescriptor (
600 IN EFI_USB_IO_PROTOCOL *This,
601 IN UINT8 Index,
602 OUT EFI_USB_ENDPOINT_DESCRIPTOR *Descriptor
603 );
604
605 /**
606 Retrieve the supported language ID table from the device.
607
608 @param This The USB IO instance.
609 @param LangIDTable The table to return the language IDs.
610 @param TableSize The size, in bytes, of the table LangIDTable.
611
612 @retval EFI_SUCCESS The language ID is return.
613
614 **/
615 EFI_STATUS
616 EFIAPI
617 UsbIoGetSupportedLanguages (
618 IN EFI_USB_IO_PROTOCOL *This,
619 OUT UINT16 **LangIDTable,
620 OUT UINT16 *TableSize
621 );
622
623 /**
624 Retrieve an indexed string in the language of LangID.
625
626 @param This The USB IO instance.
627 @param LangID The language ID of the string to retrieve.
628 @param StringIndex The index of the string.
629 @param String The variable to receive the string.
630
631 @retval EFI_SUCCESS The string is returned.
632 @retval EFI_NOT_FOUND No such string existed.
633
634 **/
635 EFI_STATUS
636 EFIAPI
637 UsbIoGetStringDescriptor (
638 IN EFI_USB_IO_PROTOCOL *This,
639 IN UINT16 LangID,
640 IN UINT8 StringIndex,
641 OUT CHAR16 **String
642 );
643
644 /**
645 Reset the device, then if that succeeds, reconfigure the
646 device with its address and current active configuration.
647
648 @param This The USB IO instance.
649
650 @retval EFI_SUCCESS The device is reset and configured.
651 @retval Others Failed to reset the device.
652
653 **/
654 EFI_STATUS
655 EFIAPI
656 UsbIoPortReset (
657 IN EFI_USB_IO_PROTOCOL *This
658 );
659
660 /**
661 Install Usb Bus Protocol on host controller, and start the Usb bus.
662
663 @param This The USB bus driver binding instance.
664 @param Controller The controller to check.
665 @param RemainingDevicePath The remaining device patch.
666
667 @retval EFI_SUCCESS The controller is controlled by the usb bus.
668 @retval EFI_ALREADY_STARTED The controller is already controlled by the usb bus.
669 @retval EFI_OUT_OF_RESOURCES Failed to allocate resources.
670
671 **/
672 EFI_STATUS
673 EFIAPI
674 UsbBusBuildProtocol (
675 IN EFI_DRIVER_BINDING_PROTOCOL *This,
676 IN EFI_HANDLE Controller,
677 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
678 );
679
680 /**
681 The USB bus driver entry pointer.
682
683 @param ImageHandle The driver image handle.
684 @param SystemTable The system table.
685
686 @return EFI_SUCCESS The component name protocol is installed.
687 @return Others Failed to init the usb driver.
688
689 **/
690 EFI_STATUS
691 EFIAPI
692 UsbBusDriverEntryPoint (
693 IN EFI_HANDLE ImageHandle,
694 IN EFI_SYSTEM_TABLE *SystemTable
695 );
696
697 /**
698 Check whether USB bus driver support this device.
699
700 @param This The USB bus driver binding protocol.
701 @param Controller The controller handle to check.
702 @param RemainingDevicePath The remaining device path.
703
704 @retval EFI_SUCCESS The bus supports this controller.
705 @retval EFI_UNSUPPORTED This device isn't supported.
706
707 **/
708 EFI_STATUS
709 EFIAPI
710 UsbBusControllerDriverSupported (
711 IN EFI_DRIVER_BINDING_PROTOCOL *This,
712 IN EFI_HANDLE Controller,
713 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
714 );
715
716 /**
717 Start to process the controller.
718
719 @param This The USB bus driver binding instance.
720 @param Controller The controller to check.
721 @param RemainingDevicePath The remaining device patch.
722
723 @retval EFI_SUCCESS The controller is controlled by the usb bus.
724 @retval EFI_ALREADY_STARTED The controller is already controlled by the usb
725 bus.
726 @retval EFI_OUT_OF_RESOURCES Failed to allocate resources.
727
728 **/
729 EFI_STATUS
730 EFIAPI
731 UsbBusControllerDriverStart (
732 IN EFI_DRIVER_BINDING_PROTOCOL *This,
733 IN EFI_HANDLE Controller,
734 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
735 );
736
737 /**
738 Stop handle the controller by this USB bus driver.
739
740 @param This The USB bus driver binding protocol.
741 @param Controller The controller to release.
742 @param NumberOfChildren The child of USB bus that opened controller
743 BY_CHILD.
744 @param ChildHandleBuffer The array of child handle.
745
746 @retval EFI_SUCCESS The controller or children are stopped.
747 @retval EFI_DEVICE_ERROR Failed to stop the driver.
748
749 **/
750 EFI_STATUS
751 EFIAPI
752 UsbBusControllerDriverStop (
753 IN EFI_DRIVER_BINDING_PROTOCOL *This,
754 IN EFI_HANDLE Controller,
755 IN UINTN NumberOfChildren,
756 IN EFI_HANDLE *ChildHandleBuffer
757 );
758
759 extern EFI_USB_IO_PROTOCOL mUsbIoProtocol;
760 extern EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding;
761 extern EFI_COMPONENT_NAME_PROTOCOL mUsbBusComponentName;
762 extern EFI_COMPONENT_NAME2_PROTOCOL mUsbBusComponentName2;
763
764 #endif