]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.h
1. Fixed tools_def.template to meet ICC build for IA32
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBusDxe / UsbEnumer.h
CommitLineData
e237e7ae 1/** @file\r
2\r
3Copyright (c) 2007, 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 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
47typedef\r
48EFI_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
59typedef\r
60EFI_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
67typedef\r
68VOID\r
69(*USB_HUB_CLEAR_PORT_CHANGE) (\r
70 IN USB_INTERFACE *HubIf,\r
71 IN UINT8 Port\r
72 );\r
73\r
74typedef\r
75EFI_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
82typedef\r
83EFI_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
90typedef\r
91EFI_STATUS\r
92(*USB_HUB_RESET_PORT) (\r
93 IN USB_INTERFACE *UsbIf,\r
94 IN UINT8 Port\r
95 );\r
96\r
97typedef\r
98EFI_STATUS\r
99(*USB_HUB_RELEASE) (\r
100 IN USB_INTERFACE *UsbIf\r
101 );\r
102\r
c52fa98c 103struct _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
113USB_ENDPOINT_DESC*\r
114UsbGetEndpointDesc (\r
115 IN USB_INTERFACE *UsbIf,\r
116 IN UINT8 EpAddr\r
117 );\r
118\r
119\r
120EFI_STATUS\r
121UsbSelectSetting (\r
122 IN USB_INTERFACE_DESC *IfDesc,\r
123 IN UINT8 Alternate\r
124 );\r
125\r
126EFI_STATUS\r
127UsbSelectConfig (\r
128 IN USB_DEVICE *Device,\r
129 IN UINT8 ConfigIndex\r
130 );\r
131\r
132VOID\r
133UsbRemoveConfig (\r
134 IN USB_DEVICE *Device\r
135 );\r
136\r
137EFI_STATUS\r
138UsbRemoveDevice (\r
139 IN USB_DEVICE *Device\r
140 );\r
141\r
142VOID\r
143UsbHubEnumeration (\r
144 IN EFI_EVENT Event,\r
145 IN VOID *Context\r
146 );\r
147\r
148VOID\r
149UsbRootHubEnumeration (\r
150 IN EFI_EVENT Event,\r
151 IN VOID *Context\r
152 );\r
153#endif\r