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 The definition for USB hub
28 #define USB_ENDPOINT_ADDR(EpAddr) ((EpAddr) & 0x7F)
29 #define USB_ENDPOINT_TYPE(Desc) ((Desc)->Attributes & USB_ENDPOINT_TYPE_MASK)
32 USB_DESC_TYPE_HUB
= 0x29,
35 // Hub class control transfer target
37 USB_HUB_TARGET_HUB
= 0,
38 USB_HUB_TARGET_PORT
= 3,
41 // HUB class specific contrl transfer request type
43 USB_HUB_REQ_GET_STATUS
= 0,
44 USB_HUB_REQ_CLEAR_FEATURE
= 1,
45 USB_HUB_REQ_SET_FEATURE
= 3,
46 USB_HUB_REQ_GET_DESC
= 6,
47 USB_HUB_REQ_SET_DESC
= 7,
48 USB_HUB_REQ_CLEAR_TT
= 8,
49 USB_HUB_REQ_RESET_TT
= 9,
50 USB_HUB_REQ_GET_TT_STATE
= 10,
51 USB_HUB_REQ_STOP_TT
= 11,
55 // USB hub class feature selector
57 USB_HUB_C_HUB_LOCAL_POWER
= 0,
58 USB_HUB_C_HUB_OVER_CURRENT
= 1,
59 USB_HUB_PORT_CONNECTION
= 0,
60 USB_HUB_PORT_ENABLE
= 1,
61 USB_HUB_PORT_SUSPEND
= 2,
62 USB_HUB_PORT_OVER_CURRENT
= 3,
63 USB_HUB_PORT_RESET
= 4,
64 USB_HUB_PORT_POWER
= 8,
65 USB_HUB_PORT_LOW_SPEED
= 9,
66 USB_HUB_C_PORT_CONNECT
= 16,
67 USB_HUB_C_PORT_ENABLE
= 17,
68 USB_HUB_C_PORT_SUSPEND
= 18,
69 USB_HUB_C_PORT_OVER_CURRENT
= 19,
70 USB_HUB_C_PORT_RESET
= 20,
71 USB_HUB_PORT_TEST
= 21,
72 USB_HUB_PORT_INDICATOR
= 22,
75 // USB hub power control method. In gang power control
77 USB_HUB_GANG_POWER_CTRL
= 0,
78 USB_HUB_PORT_POWER_CTRL
= 0x01,
81 // USB hub status bits
83 USB_HUB_STAT_LOCAL_POWER
= 0x01,
84 USB_HUB_STAT_OVER_CURRENT
= 0x02,
85 USB_HUB_STAT_C_LOCAL_POWER
= 0x01,
86 USB_HUB_STAT_C_OVER_CURRENT
= 0x02,
88 USB_HUB_CLASS_CODE
= 0x09,
89 USB_HUB_SUBCLASS_CODE
= 0x00,
97 // Hub descriptor, the last two fields are of variable lenght.
105 UINT8 HubContrCurrent
;
107 } EFI_USB_HUB_DESCRIPTOR
;
113 EFI_USB_PORT_FEATURE Feature
;
114 } USB_CHANGE_FEATURE_MAP
;
118 UsbHubCtrlClearTTBuffer (
119 IN USB_DEVICE
*UsbDev
,
129 IN USB_INTERFACE
*UsbIf
134 IN USB_DEVICE
*UsbDev
137 extern USB_HUB_API mUsbHubApi
;
138 extern USB_HUB_API mUsbRootHubApi
;