]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Bus/Usb/UsbBus/Dxe/hub.h
Initial import.
[mirror_edk2.git] / EdkModulePkg / Bus / Usb / UsbBus / Dxe / hub.h
1 /*++
2
3 Copyright (c) 2006, 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
8
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.
11
12 Module Name:
13
14 Hub.h
15
16 Abstract:
17
18 Constants definitions for Usb Hub
19
20 Revision History
21
22 --*/
23
24 #ifndef _HUB_H
25 #define _HUB_H
26
27 //
28 // Hub feature numbers
29 //
30 #define C_HUB_LOCAL_POWER 0
31 #define C_HUB_OVER_CURRENT 1
32
33 //
34 // Hub class code & sub class code
35 //
36 #define CLASS_CODE_HUB 0x09
37 #define SUB_CLASS_CODE_HUB 0
38
39 //
40 // Hub Status & Hub Change bit masks
41 //
42 #define HUB_STATUS_LOCAL_POWER 0x0001
43 #define HUB_STATUS_OVERCURRENT 0x0002
44
45 #define HUB_CHANGE_LOCAL_POWER 0x0001
46 #define HUB_CHANGE_OVERCURRENT 0x0002
47
48 //
49 // Hub Characteristics
50 //
51 #define HUB_CHAR_LPSM 0x0003
52 #define HUB_CHAR_COMPOUND 0x0004
53 #define HUB_CHAR_OCPM 0x0018
54
55 //
56 // Hub specific request
57 //
58 #define HUB_CLEAR_FEATURE 0x01
59 #define HUB_CLEAR_FEATURE_REQ_TYPE 0x20
60
61 #define HUB_CLEAR_FEATURE_PORT 0x01
62 #define HUB_CLEAR_FEATURE_PORT_REQ_TYPE 0x23
63
64 #define HUB_GET_BUS_STATE 0x02
65 #define HUB_GET_BUS_STATE_REQ_TYPE 0xA3
66
67 #define HUB_GET_DESCRIPTOR 0x06
68 #define HUB_GET_DESCRIPTOR_REQ_TYPE 0xA0
69
70 #define HUB_GET_HUB_STATUS 0x00
71 #define HUB_GET_HUB_STATUS_REQ_TYPE 0xA0
72
73 #define HUB_GET_PORT_STATUS 0x00
74 #define HUB_GET_PORT_STATUS_REQ_TYPE 0xA3
75
76 #define HUB_SET_DESCRIPTOR 0x07
77 #define HUB_SET_DESCRIPTOR_REQ_TYPE 0x20
78
79 #define HUB_SET_HUB_FEATURE 0x03
80 #define HUB_SET_HUB_FEATURE_REQ_TYPE 0x20
81
82 #define HUB_SET_PORT_FEATURE 0x03
83 #define HUB_SET_PORT_FEATURE_REQ_TYPE 0x23
84
85 #pragma pack(1)
86 typedef struct usb_hub_status {
87 UINT16 HubStatus;
88 UINT16 HubChange;
89 } EFI_USB_HUB_STATUS;
90 #pragma pack()
91
92 EFI_STATUS
93 HubGetPortStatus (
94 IN EFI_USB_IO_PROTOCOL *UsbIo,
95 IN UINT8 Port,
96 OUT UINT32 *PortStatus
97 );
98
99 EFI_STATUS
100 HubSetPortFeature (
101 IN EFI_USB_IO_PROTOCOL *UsbIo,
102 IN UINT8 Port,
103 IN UINT8 Value
104 );
105
106 EFI_STATUS
107 HubSetHubFeature (
108 IN EFI_USB_IO_PROTOCOL *UsbIo,
109 IN UINT8 Value
110 );
111
112 EFI_STATUS
113 HubGetHubStatus (
114 IN EFI_USB_IO_PROTOCOL *UsbIo,
115 OUT UINT32 *HubStatus
116 );
117
118 EFI_STATUS
119 HubClearPortFeature (
120 IN EFI_USB_IO_PROTOCOL *UsbIo,
121 IN UINT8 Port,
122 IN UINT8 Value
123 );
124
125 EFI_STATUS
126 HubClearHubFeature (
127 IN EFI_USB_IO_PROTOCOL *UsbIo,
128 IN UINT8 Value
129 );
130
131 EFI_STATUS
132 GetHubDescriptor (
133 IN EFI_USB_IO_PROTOCOL *UsbIo,
134 IN UINTN DescriptorSize,
135 OUT EFI_USB_HUB_DESCRIPTOR *HubDescriptor
136 );
137
138 #endif