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