]>
Commit | Line | Data |
---|---|---|
e237e7ae | 1 | /** @file\r |
2 | \r | |
3 | Copyright (c) 2007, Intel Corporation\r | |
4 | All rights reserved. This program and the accompanying materials\r | |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | UsbEnumer.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | USB bus enumeration interface\r | |
19 | \r | |
20 | Revision History\r | |
21 | \r | |
22 | \r | |
23 | **/\r | |
24 | \r | |
25 | #ifndef _USB_ENUMERATION_H_\r | |
26 | #define _USB_ENUMERATION_H_\r | |
27 | \r | |
28 | //\r | |
29 | // Advance the byte and bit to the next bit, adjust byte accordingly.\r | |
30 | //\r | |
31 | #define USB_NEXT_BIT(Byte, Bit) \\r | |
32 | do { \\r | |
33 | (Bit)++; \\r | |
34 | if ((Bit) > 7) { \\r | |
35 | (Byte)++; \\r | |
36 | (Bit) = 0; \\r | |
37 | } \\r | |
38 | } while (0)\r | |
39 | \r | |
40 | \r | |
41 | //\r | |
42 | // Common interface used by usb bus enumeration process.\r | |
43 | // This interface is defined to mask the difference between\r | |
44 | // the root hub and normal hub. So, bus enumeration code\r | |
45 | // can be shared by both root hub and normal hub\r | |
46 | //\r | |
47 | typedef\r | |
48 | EFI_STATUS\r | |
49 | (*USB_HUB_INIT) (\r | |
50 | IN USB_INTERFACE *UsbIf\r | |
51 | );\r | |
52 | \r | |
53 | //\r | |
54 | // Get the port status. This function is required to\r | |
55 | // ACK the port change bits although it will return\r | |
56 | // the port changes in PortState. Bus enumeration code\r | |
57 | // doesn't need to ACK the port change bits.\r | |
58 | //\r | |
59 | typedef\r | |
60 | EFI_STATUS\r | |
61 | (*USB_HUB_GET_PORT_STATUS) (\r | |
62 | IN USB_INTERFACE *UsbIf,\r | |
63 | IN UINT8 Port,\r | |
64 | OUT EFI_USB_PORT_STATUS *PortState\r | |
65 | );\r | |
66 | \r | |
67 | typedef\r | |
68 | VOID\r | |
69 | (*USB_HUB_CLEAR_PORT_CHANGE) (\r | |
70 | IN USB_INTERFACE *HubIf,\r | |
71 | IN UINT8 Port\r | |
72 | );\r | |
73 | \r | |
74 | typedef\r | |
75 | EFI_STATUS\r | |
76 | (*USB_HUB_SET_PORT_FEATURE) (\r | |
77 | IN USB_INTERFACE *UsbIf,\r | |
78 | IN UINT8 Port,\r | |
79 | IN EFI_USB_PORT_FEATURE Feature\r | |
80 | );\r | |
81 | \r | |
82 | typedef\r | |
83 | EFI_STATUS\r | |
84 | (*USB_HUB_CLEAR_PORT_FEATURE) (\r | |
85 | IN USB_INTERFACE *UsbIf,\r | |
86 | IN UINT8 Port,\r | |
87 | IN EFI_USB_PORT_FEATURE Feature\r | |
88 | );\r | |
89 | \r | |
90 | typedef\r | |
91 | EFI_STATUS\r | |
92 | (*USB_HUB_RESET_PORT) (\r | |
93 | IN USB_INTERFACE *UsbIf,\r | |
94 | IN UINT8 Port\r | |
95 | );\r | |
96 | \r | |
97 | typedef\r | |
98 | EFI_STATUS\r | |
99 | (*USB_HUB_RELEASE) (\r | |
100 | IN USB_INTERFACE *UsbIf\r | |
101 | );\r | |
102 | \r | |
c52fa98c | 103 | struct _USB_HUB_API{\r |
e237e7ae | 104 | USB_HUB_INIT Init;\r |
105 | USB_HUB_GET_PORT_STATUS GetPortStatus;\r | |
106 | USB_HUB_CLEAR_PORT_CHANGE ClearPortChange;\r | |
107 | USB_HUB_SET_PORT_FEATURE SetPortFeature;\r | |
108 | USB_HUB_CLEAR_PORT_FEATURE ClearPortFeature;\r | |
109 | USB_HUB_RESET_PORT ResetPort;\r | |
110 | USB_HUB_RELEASE Release;\r | |
c52fa98c | 111 | };\r |
e237e7ae | 112 | \r |
113 | USB_ENDPOINT_DESC*\r | |
114 | UsbGetEndpointDesc (\r | |
115 | IN USB_INTERFACE *UsbIf,\r | |
116 | IN UINT8 EpAddr\r | |
117 | );\r | |
118 | \r | |
119 | \r | |
120 | EFI_STATUS\r | |
121 | UsbSelectSetting (\r | |
122 | IN USB_INTERFACE_DESC *IfDesc,\r | |
123 | IN UINT8 Alternate\r | |
124 | );\r | |
125 | \r | |
126 | EFI_STATUS\r | |
127 | UsbSelectConfig (\r | |
128 | IN USB_DEVICE *Device,\r | |
129 | IN UINT8 ConfigIndex\r | |
130 | );\r | |
131 | \r | |
132 | VOID\r | |
133 | UsbRemoveConfig (\r | |
134 | IN USB_DEVICE *Device\r | |
135 | );\r | |
136 | \r | |
137 | EFI_STATUS\r | |
138 | UsbRemoveDevice (\r | |
139 | IN USB_DEVICE *Device\r | |
140 | );\r | |
141 | \r | |
142 | VOID\r | |
143 | UsbHubEnumeration (\r | |
144 | IN EFI_EVENT Event,\r | |
145 | IN VOID *Context\r | |
146 | );\r | |
147 | \r | |
148 | VOID\r | |
eb1f5ab3 | 149 | EFIAPI\r |
e237e7ae | 150 | UsbRootHubEnumeration (\r |
151 | IN EFI_EVENT Event,\r | |
152 | IN VOID *Context\r | |
153 | );\r | |
154 | #endif\r |