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