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