]> git.proxmox.com Git - mirror_edk2.git/blame - EdkModulePkg/Bus/Usb/UsbBus/Dxe/hub.h
changed EdkModulePkg GUID from the original B6EC423C-21D2-490D-85C6-DD5864EAA674...
[mirror_edk2.git] / EdkModulePkg / Bus / Usb / UsbBus / Dxe / hub.h
CommitLineData
878ddf1f 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12 Module Name:\r
13\r
14 Hub.h\r
15 \r
16 Abstract:\r
17\r
18 Constants definitions for Usb Hub\r
19\r
20 Revision History\r
21\r
22--*/\r
23\r
24#ifndef _HUB_H\r
25#define _HUB_H\r
26\r
27//\r
28// Hub feature numbers\r
29//\r
30#define C_HUB_LOCAL_POWER 0\r
31#define C_HUB_OVER_CURRENT 1\r
32\r
33//\r
34// Hub class code & sub class code\r
35//\r
36#define CLASS_CODE_HUB 0x09\r
37#define SUB_CLASS_CODE_HUB 0\r
38\r
39//\r
40// Hub Status & Hub Change bit masks\r
41//\r
42#define HUB_STATUS_LOCAL_POWER 0x0001\r
43#define HUB_STATUS_OVERCURRENT 0x0002\r
44\r
45#define HUB_CHANGE_LOCAL_POWER 0x0001\r
46#define HUB_CHANGE_OVERCURRENT 0x0002\r
47\r
48//\r
49// Hub Characteristics\r
50//\r
51#define HUB_CHAR_LPSM 0x0003\r
52#define HUB_CHAR_COMPOUND 0x0004\r
53#define HUB_CHAR_OCPM 0x0018\r
54\r
55//\r
56// Hub specific request\r
57//\r
58#define HUB_CLEAR_FEATURE 0x01\r
59#define HUB_CLEAR_FEATURE_REQ_TYPE 0x20\r
60\r
61#define HUB_CLEAR_FEATURE_PORT 0x01\r
62#define HUB_CLEAR_FEATURE_PORT_REQ_TYPE 0x23\r
63\r
64#define HUB_GET_BUS_STATE 0x02\r
65#define HUB_GET_BUS_STATE_REQ_TYPE 0xA3\r
66\r
67#define HUB_GET_DESCRIPTOR 0x06\r
68#define HUB_GET_DESCRIPTOR_REQ_TYPE 0xA0\r
69\r
70#define HUB_GET_HUB_STATUS 0x00\r
71#define HUB_GET_HUB_STATUS_REQ_TYPE 0xA0\r
72\r
73#define HUB_GET_PORT_STATUS 0x00\r
74#define HUB_GET_PORT_STATUS_REQ_TYPE 0xA3\r
75\r
76#define HUB_SET_DESCRIPTOR 0x07\r
77#define HUB_SET_DESCRIPTOR_REQ_TYPE 0x20\r
78\r
79#define HUB_SET_HUB_FEATURE 0x03\r
80#define HUB_SET_HUB_FEATURE_REQ_TYPE 0x20\r
81\r
82#define HUB_SET_PORT_FEATURE 0x03\r
83#define HUB_SET_PORT_FEATURE_REQ_TYPE 0x23\r
84\r
85#pragma pack(1)\r
86typedef struct usb_hub_status {\r
87 UINT16 HubStatus;\r
88 UINT16 HubChange;\r
89} EFI_USB_HUB_STATUS;\r
90#pragma pack()\r
91\r
92EFI_STATUS\r
93HubGetPortStatus (\r
94 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
95 IN UINT8 Port,\r
96 OUT UINT32 *PortStatus\r
97 );\r
98\r
99EFI_STATUS\r
100HubSetPortFeature (\r
101 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
102 IN UINT8 Port,\r
103 IN UINT8 Value\r
104 );\r
105\r
106EFI_STATUS\r
107HubSetHubFeature (\r
108 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
109 IN UINT8 Value\r
110 );\r
111\r
112EFI_STATUS\r
113HubGetHubStatus (\r
114 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
115 OUT UINT32 *HubStatus\r
116 );\r
117\r
118EFI_STATUS\r
119HubClearPortFeature (\r
120 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
121 IN UINT8 Port,\r
122 IN UINT8 Value\r
123 );\r
124\r
125EFI_STATUS\r
126HubClearHubFeature (\r
127 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
128 IN UINT8 Value\r
129 );\r
130\r
131EFI_STATUS\r
132GetHubDescriptor (\r
133 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
134 IN UINTN DescriptorSize,\r
135 OUT EFI_USB_HUB_DESCRIPTOR *HubDescriptor\r
136 );\r
137\r
138#endif\r