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