3 USB bus enumeration interface.
5 Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef _USB_ENUMERATION_H_
11 #define _USB_ENUMERATION_H_
14 // Advance the byte and bit to the next bit, adjust byte accordingly.
16 #define USB_NEXT_BIT(Byte, Bit) \
26 // Common interface used by usb bus enumeration process.
27 // This interface is defined to mask the difference between
28 // the root hub and normal hub. So, bus enumeration code
29 // can be shared by both root hub and normal hub
34 IN USB_INTERFACE
*UsbIf
38 // Get the port status. This function is required to
39 // ACK the port change bits although it will return
40 // the port changes in PortState. Bus enumeration code
41 // doesn't need to ACK the port change bits.
45 (*USB_HUB_GET_PORT_STATUS
) (
46 IN USB_INTERFACE
*UsbIf
,
48 OUT EFI_USB_PORT_STATUS
*PortState
53 (*USB_HUB_CLEAR_PORT_CHANGE
) (
54 IN USB_INTERFACE
*HubIf
,
60 (*USB_HUB_SET_PORT_FEATURE
) (
61 IN USB_INTERFACE
*UsbIf
,
63 IN EFI_USB_PORT_FEATURE Feature
68 (*USB_HUB_CLEAR_PORT_FEATURE
) (
69 IN USB_INTERFACE
*UsbIf
,
71 IN EFI_USB_PORT_FEATURE Feature
76 (*USB_HUB_RESET_PORT
) (
77 IN USB_INTERFACE
*UsbIf
,
84 IN USB_INTERFACE
*UsbIf
88 Return the endpoint descriptor in this interface.
90 @param UsbIf The interface to search in.
91 @param EpAddr The address of the endpoint to return.
93 @return The endpoint descriptor or NULL.
98 IN USB_INTERFACE
*UsbIf
,
103 Select an alternate setting for the interface.
104 Each interface can have several mutually exclusive
105 settings. Only one setting is active. It will
106 also reset its endpoints' toggle to zero.
108 @param IfDesc The interface descriptor to set.
109 @param Alternate The alternate setting number to locate.
111 @retval EFI_NOT_FOUND There is no setting with this alternate index.
112 @retval EFI_SUCCESS The interface is set to Alternate setting.
117 IN USB_INTERFACE_DESC
*IfDesc
,
122 Select a new configuration for the device. Each
123 device may support several configurations.
125 @param Device The device to select configuration.
126 @param ConfigIndex The index of the configuration ( != 0).
128 @retval EFI_NOT_FOUND There is no configuration with the index.
129 @retval EFI_OUT_OF_RESOURCES Failed to allocate resource.
130 @retval EFI_SUCCESS The configuration is selected.
135 IN USB_DEVICE
*Device
,
140 Remove the current device configuration.
142 @param Device The USB device to remove configuration from.
149 IN USB_DEVICE
*Device
153 Remove the device and all its children from the bus.
155 @param Device The device to remove.
157 @retval EFI_SUCCESS The device is removed.
162 IN USB_DEVICE
*Device
166 Enumerate all the changed hub ports.
168 @param Event The event that is triggered.
169 @param Context The context to the event.
182 Enumerate all the changed hub ports.
184 @param Event The event that is triggered.
185 @param Context The context to the event.
192 UsbRootHubEnumeration (