3 Copyright (c) 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 USB bus enumeration interface
25 #ifndef _USB_ENUMERATION_H_
26 #define _USB_ENUMERATION_H_
29 // Advance the byte and bit to the next bit, adjust byte accordingly.
31 #define USB_NEXT_BIT(Byte, Bit) \
42 // Common interface used by usb bus enumeration process.
43 // This interface is defined to mask the difference between
44 // the root hub and normal hub. So, bus enumeration code
45 // can be shared by both root hub and normal hub
50 IN USB_INTERFACE
*UsbIf
54 // Get the port status. This function is required to
55 // ACK the port change bits although it will return
56 // the port changes in PortState. Bus enumeration code
57 // doesn't need to ACK the port change bits.
61 (*USB_HUB_GET_PORT_STATUS
) (
62 IN USB_INTERFACE
*UsbIf
,
64 OUT EFI_USB_PORT_STATUS
*PortState
69 (*USB_HUB_CLEAR_PORT_CHANGE
) (
70 IN USB_INTERFACE
*HubIf
,
76 (*USB_HUB_SET_PORT_FEATURE
) (
77 IN USB_INTERFACE
*UsbIf
,
79 IN EFI_USB_PORT_FEATURE Feature
84 (*USB_HUB_CLEAR_PORT_FEATURE
) (
85 IN USB_INTERFACE
*UsbIf
,
87 IN EFI_USB_PORT_FEATURE Feature
92 (*USB_HUB_RESET_PORT
) (
93 IN USB_INTERFACE
*UsbIf
,
100 IN USB_INTERFACE
*UsbIf
103 typedef struct _USB_HUB_API
{
105 USB_HUB_GET_PORT_STATUS GetPortStatus
;
106 USB_HUB_CLEAR_PORT_CHANGE ClearPortChange
;
107 USB_HUB_SET_PORT_FEATURE SetPortFeature
;
108 USB_HUB_CLEAR_PORT_FEATURE ClearPortFeature
;
109 USB_HUB_RESET_PORT ResetPort
;
110 USB_HUB_RELEASE Release
;
115 IN USB_INTERFACE
*UsbIf
,
122 IN USB_INTERFACE_DESC
*IfDesc
,
128 IN USB_DEVICE
*Device
,
134 IN USB_DEVICE
*Device
139 IN USB_DEVICE
*Device
149 UsbRootHubEnumeration (