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
96 USB_HUB_GET_PORT_STATUS GetPortStatus
;
97 USB_HUB_CLEAR_PORT_CHANGE ClearPortChange
;
98 USB_HUB_SET_PORT_FEATURE SetPortFeature
;
99 USB_HUB_CLEAR_PORT_FEATURE ClearPortFeature
;
100 USB_HUB_RESET_PORT ResetPort
;
101 USB_HUB_RELEASE Release
;
105 Return the endpoint descriptor in this interface.
107 @param UsbIf The interface to search in.
108 @param EpAddr The address of the endpoint to return.
110 @return The endpoint descriptor or NULL.
115 IN USB_INTERFACE
*UsbIf
,
120 Select an alternate setting for the interface.
121 Each interface can have several mutually exclusive
122 settings. Only one setting is active. It will
123 also reset its endpoints' toggle to zero.
125 @param IfDesc The interface descriptor to set.
126 @param Alternate The alternate setting number to locate.
128 @retval EFI_NOT_FOUND There is no setting with this alternate index.
129 @retval EFI_SUCCESS The interface is set to Alternate setting.
134 IN USB_INTERFACE_DESC
*IfDesc
,
139 Select a new configuration for the device. Each
140 device may support several configurations.
142 @param Device The device to select configuration.
143 @param ConfigIndex The index of the configuration ( != 0).
145 @retval EFI_NOT_FOUND There is no configuration with the index.
146 @retval EFI_OUT_OF_RESOURCES Failed to allocate resource.
147 @retval EFI_SUCCESS The configuration is selected.
152 IN USB_DEVICE
*Device
,
157 Remove the current device configuration.
159 @param Device The USB device to remove configuration from.
166 IN USB_DEVICE
*Device
170 Remove the device and all its children from the bus.
172 @param Device The device to remove.
174 @retval EFI_SUCCESS The device is removed.
179 IN USB_DEVICE
*Device
183 Enumerate all the changed hub ports.
185 @param Event The event that is triggered.
186 @param Context The context to the event.
199 Enumerate all the changed hub ports.
201 @param Event The event that is triggered.
202 @param Context The context to the event.
209 UsbRootHubEnumeration (