]>
Commit | Line | Data |
---|---|---|
842f5579 | 1 | /** @file\r |
ed838d0c | 2 | Common Dxe Libarary for USB\r |
fb3df220 | 3 | \r |
842f5579 A |
4 | Copyright (c) 2006, Intel Corporation<BR>\r |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
fb3df220 | 14 | \r |
fb3df220 | 15 | \r |
842f5579 A |
16 | #ifndef __USB_DXE_LIB_H__\r |
17 | #define __USB_DXE_LIB_H__\r | |
fb3df220 | 18 | \r |
c7d265a9 | 19 | #include <Protocol/UsbIo.h>\r |
ed838d0c | 20 | \r |
fb3df220 | 21 | //\r |
22 | // define the timeout time as 3ms\r | |
23 | //\r | |
24 | #define TIMEOUT_VALUE 3 * 1000\r | |
25 | \r | |
fb3df220 | 26 | EFI_STATUS\r |
27 | UsbGetHidDescriptor (\r | |
28 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
29 | IN UINT8 InterfaceNum,\r | |
30 | OUT EFI_USB_HID_DESCRIPTOR *HidDescriptor\r | |
31 | );\r | |
32 | \r | |
33 | EFI_STATUS\r | |
34 | UsbGetReportDescriptor (\r | |
35 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
36 | IN UINT8 InterfaceNum,\r | |
37 | IN UINT16 DescriptorSize,\r | |
38 | OUT UINT8 *DescriptorBuffer\r | |
39 | );\r | |
40 | \r | |
41 | EFI_STATUS\r | |
42 | UsbGetProtocolRequest (\r | |
43 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
44 | IN UINT8 Interface,\r | |
45 | IN UINT8 *Protocol\r | |
46 | );\r | |
47 | \r | |
48 | EFI_STATUS\r | |
49 | UsbSetProtocolRequest (\r | |
50 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
51 | IN UINT8 Interface,\r | |
52 | IN UINT8 Protocol\r | |
53 | );\r | |
54 | \r | |
55 | EFI_STATUS\r | |
56 | UsbSetIdleRequest (\r | |
57 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
58 | IN UINT8 Interface,\r | |
59 | IN UINT8 ReportId,\r | |
60 | IN UINT8 Duration\r | |
61 | );\r | |
62 | \r | |
63 | EFI_STATUS\r | |
64 | UsbGetIdleRequest (\r | |
65 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
66 | IN UINT8 Interface,\r | |
67 | IN UINT8 ReportId,\r | |
68 | OUT UINT8 *Duration\r | |
69 | );\r | |
70 | \r | |
71 | EFI_STATUS\r | |
72 | UsbSetReportRequest (\r | |
73 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
74 | IN UINT8 Interface,\r | |
75 | IN UINT8 ReportId,\r | |
76 | IN UINT8 ReportType,\r | |
77 | IN UINT16 ReportLen,\r | |
78 | IN UINT8 *Report\r | |
79 | );\r | |
80 | \r | |
81 | EFI_STATUS\r | |
82 | UsbGetReportRequest (\r | |
83 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
84 | IN UINT8 Interface,\r | |
85 | IN UINT8 ReportId,\r | |
86 | IN UINT8 ReportType,\r | |
87 | IN UINT16 ReportLen,\r | |
88 | IN UINT8 *Report\r | |
89 | );\r | |
90 | \r | |
ed838d0c | 91 | typedef enum {\r |
92 | EfiUsbEndpointHalt,\r | |
93 | EfiUsbDeviceRemoteWakeup\r | |
94 | } EFI_USB_STANDARD_FEATURE_SELECTOR;\r | |
95 | \r | |
fb3df220 | 96 | EFI_STATUS\r |
97 | UsbGetDescriptor (\r | |
98 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
99 | IN UINT16 Value,\r | |
100 | IN UINT16 Index,\r | |
101 | IN UINT16 DescriptorLength,\r | |
102 | OUT VOID *Descriptor,\r | |
103 | OUT UINT32 *Status\r | |
104 | );\r | |
105 | \r | |
fb3df220 | 106 | EFI_STATUS\r |
107 | UsbSetDescriptor (\r | |
108 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
109 | IN UINT16 Value,\r | |
110 | IN UINT16 Index,\r | |
111 | IN UINT16 DescriptorLength,\r | |
112 | IN VOID *Descriptor,\r | |
113 | OUT UINT32 *Status\r | |
114 | );\r | |
115 | \r | |
fb3df220 | 116 | EFI_STATUS\r |
ed838d0c | 117 | UsbGetInterface (\r |
fb3df220 | 118 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
119 | IN UINT16 Index,\r | |
120 | OUT UINT8 *AltSetting,\r | |
121 | OUT UINT32 *Status\r | |
122 | );\r | |
123 | \r | |
fb3df220 | 124 | EFI_STATUS\r |
ed838d0c | 125 | UsbSetInterface (\r |
fb3df220 | 126 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
127 | IN UINT16 InterfaceNo,\r | |
128 | IN UINT16 AltSetting,\r | |
129 | OUT UINT32 *Status\r | |
130 | );\r | |
131 | \r | |
fb3df220 | 132 | EFI_STATUS\r |
ed838d0c | 133 | UsbGetConfiguration (\r |
fb3df220 | 134 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
135 | OUT UINT8 *ConfigValue,\r | |
136 | OUT UINT32 *Status\r | |
137 | );\r | |
138 | \r | |
fb3df220 | 139 | EFI_STATUS\r |
ed838d0c | 140 | UsbSetConfiguration (\r |
fb3df220 | 141 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
142 | IN UINT16 Value,\r | |
143 | OUT UINT32 *Status\r | |
144 | );\r | |
145 | \r | |
fb3df220 | 146 | EFI_STATUS\r |
ed838d0c | 147 | UsbSetFeature (\r |
fb3df220 | 148 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
ed838d0c | 149 | IN UINTN Recipient,\r |
fb3df220 | 150 | IN UINT16 Value,\r |
151 | IN UINT16 Target,\r | |
152 | OUT UINT32 *Status\r | |
153 | );\r | |
154 | \r | |
fb3df220 | 155 | EFI_STATUS\r |
ed838d0c | 156 | UsbClearFeature (\r |
fb3df220 | 157 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
ed838d0c | 158 | IN UINTN Recipient,\r |
fb3df220 | 159 | IN UINT16 Value,\r |
160 | IN UINT16 Target,\r | |
161 | OUT UINT32 *Status\r | |
162 | );\r | |
163 | \r | |
fb3df220 | 164 | EFI_STATUS\r |
ed838d0c | 165 | UsbGetStatus (\r |
fb3df220 | 166 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
ed838d0c | 167 | IN UINTN Recipient,\r |
fb3df220 | 168 | IN UINT16 Target,\r |
169 | OUT UINT16 *DevStatus,\r | |
170 | OUT UINT32 *Status\r | |
171 | );\r | |
172 | \r | |
fb3df220 | 173 | EFI_STATUS\r |
ed838d0c | 174 | UsbGetHubDescriptor (\r |
fb3df220 | 175 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
ed838d0c | 176 | IN UINT16 Value,\r |
177 | IN UINT16 Index,\r | |
178 | IN UINT16 DescriptorLength,\r | |
179 | OUT VOID *Descriptor,\r | |
fb3df220 | 180 | OUT UINT32 *Status\r |
181 | );\r | |
182 | \r | |
183 | //\r | |
184 | // Clear endpoint stall\r | |
185 | //\r | |
186 | EFI_STATUS\r | |
187 | UsbClearEndpointHalt (\r | |
188 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
189 | IN UINT8 EndpointNo,\r | |
190 | OUT UINT32 *Status\r | |
191 | );\r | |
192 | \r | |
193 | #endif\r |