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) \
27 // Common interface used by usb bus enumeration process.
28 // This interface is defined to mask the difference between
29 // the root hub and normal hub. So, bus enumeration code
30 // can be shared by both root hub and normal hub
35 IN USB_INTERFACE
*UsbIf
39 // Get the port status. This function is required to
40 // ACK the port change bits although it will return
41 // the port changes in PortState. Bus enumeration code
42 // doesn't need to ACK the port change bits.
46 (*USB_HUB_GET_PORT_STATUS
) (
47 IN USB_INTERFACE
*UsbIf
,
49 OUT EFI_USB_PORT_STATUS
*PortState
54 (*USB_HUB_CLEAR_PORT_CHANGE
) (
55 IN USB_INTERFACE
*HubIf
,
61 (*USB_HUB_SET_PORT_FEATURE
) (
62 IN USB_INTERFACE
*UsbIf
,
64 IN EFI_USB_PORT_FEATURE Feature
69 (*USB_HUB_CLEAR_PORT_FEATURE
) (
70 IN USB_INTERFACE
*UsbIf
,
72 IN EFI_USB_PORT_FEATURE Feature
77 (*USB_HUB_RESET_PORT
) (
78 IN USB_INTERFACE
*UsbIf
,
85 IN USB_INTERFACE
*UsbIf
89 Return the endpoint descriptor in this interface.
91 @param UsbIf The interface to search in.
92 @param EpAddr The address of the endpoint to return.
94 @return The endpoint descriptor or NULL.
99 IN USB_INTERFACE
*UsbIf
,
104 Select an alternate setting for the interface.
105 Each interface can have several mutually exclusive
106 settings. Only one setting is active. It will
107 also reset its endpoints' toggle to zero.
109 @param IfDesc The interface descriptor to set.
110 @param Alternate The alternate setting number to locate.
112 @retval EFI_NOT_FOUND There is no setting with this alternate index.
113 @retval EFI_SUCCESS The interface is set to Alternate setting.
118 IN USB_INTERFACE_DESC
*IfDesc
,
123 Select a new configuration for the device. Each
124 device may support several configurations.
126 @param Device The device to select configuration.
127 @param ConfigIndex The index of the configuration ( != 0).
129 @retval EFI_NOT_FOUND There is no configuration with the index.
130 @retval EFI_OUT_OF_RESOURCES Failed to allocate resource.
131 @retval EFI_SUCCESS The configuration is selected.
136 IN USB_DEVICE
*Device
,
141 Remove the current device configuration.
143 @param Device The USB device to remove configuration from.
150 IN USB_DEVICE
*Device
154 Remove the device and all its children from the bus.
156 @param Device The device to remove.
158 @retval EFI_SUCCESS The device is removed.
163 IN USB_DEVICE
*Device
167 Enumerate all the changed hub ports.
169 @param Event The event that is triggered.
170 @param Context The context to the event.
183 Enumerate all the changed hub ports.
185 @param Event The event that is triggered.
186 @param Context The context to the event.
193 UsbRootHubEnumeration (