3 USB bus enumeration interface.
5 Copyright (c) 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
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.
16 #ifndef _USB_ENUMERATION_H_
17 #define _USB_ENUMERATION_H_
20 // Advance the byte and bit to the next bit, adjust byte accordingly.
22 #define USB_NEXT_BIT(Byte, Bit) \
33 // Common interface used by usb bus enumeration process.
34 // This interface is defined to mask the difference between
35 // the root hub and normal hub. So, bus enumeration code
36 // can be shared by both root hub and normal hub
41 IN USB_INTERFACE
*UsbIf
45 // Get the port status. This function is required to
46 // ACK the port change bits although it will return
47 // the port changes in PortState. Bus enumeration code
48 // doesn't need to ACK the port change bits.
52 (*USB_HUB_GET_PORT_STATUS
) (
53 IN USB_INTERFACE
*UsbIf
,
55 OUT EFI_USB_PORT_STATUS
*PortState
60 (*USB_HUB_CLEAR_PORT_CHANGE
) (
61 IN USB_INTERFACE
*HubIf
,
67 (*USB_HUB_SET_PORT_FEATURE
) (
68 IN USB_INTERFACE
*UsbIf
,
70 IN EFI_USB_PORT_FEATURE Feature
75 (*USB_HUB_CLEAR_PORT_FEATURE
) (
76 IN USB_INTERFACE
*UsbIf
,
78 IN EFI_USB_PORT_FEATURE Feature
83 (*USB_HUB_RESET_PORT
) (
84 IN USB_INTERFACE
*UsbIf
,
91 IN USB_INTERFACE
*UsbIf
95 Return the endpoint descriptor in this interface.
97 @param UsbIf The interface to search in.
98 @param EpAddr The address of the endpoint to return.
100 @return The endpoint descriptor or NULL.
105 IN USB_INTERFACE
*UsbIf
,
110 Select an alternate setting for the interface.
111 Each interface can have several mutually exclusive
112 settings. Only one setting is active. It will
113 also reset its endpoints' toggle to zero.
115 @param IfDesc The interface descriptor to set.
116 @param Alternate The alternate setting number to locate.
118 @retval EFI_NOT_FOUND There is no setting with this alternate index.
119 @retval EFI_SUCCESS The interface is set to Alternate setting.
124 IN USB_INTERFACE_DESC
*IfDesc
,
129 Select a new configuration for the device. Each
130 device may support several configurations.
132 @param Device The device to select configuration.
133 @param ConfigIndex The index of the configuration ( != 0).
135 @retval EFI_NOT_FOUND There is no configuration with the index.
136 @retval EFI_OUT_OF_RESOURCES Failed to allocate resource.
137 @retval EFI_SUCCESS The configuration is selected.
142 IN USB_DEVICE
*Device
,
147 Remove the current device configuration.
149 @param Device The USB device to remove configuration from.
156 IN USB_DEVICE
*Device
160 Remove the device and all its children from the bus.
162 @param Device The device to remove.
164 @retval EFI_SUCCESS The device is removed.
169 IN USB_DEVICE
*Device
173 Enumerate all the changed hub ports.
175 @param Event The event that is triggered.
176 @param Context The context to the event.
189 Enumerate all the changed hub ports.
191 @param Event The event that is triggered.
192 @param Context The context to the event.
199 UsbRootHubEnumeration (