]>
Commit | Line | Data |
---|---|---|
842f5579 | 1 | /** @file\r |
50a64e5b | 2 | Provides most usb APIs to support the Hid requests defined in Usb Hid 1.1 spec\r |
3 | and the standard requests defined in Usb 1.1 spec.\r | |
fb3df220 | 4 | \r |
50a64e5b | 5 | Copyright (c) 2006 - 2008, Intel Corporation<BR>\r |
6 | All rights reserved. This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
842f5579 | 10 | \r |
50a64e5b | 11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
842f5579 A |
13 | \r |
14 | **/\r | |
fb3df220 | 15 | \r |
fb3df220 | 16 | \r |
842f5579 A |
17 | #ifndef __USB_DXE_LIB_H__\r |
18 | #define __USB_DXE_LIB_H__\r | |
fb3df220 | 19 | \r |
c7d265a9 | 20 | #include <Protocol/UsbIo.h>\r |
d5954c61 | 21 | #include <IndustryStandard/Usb.h>\r |
ed838d0c | 22 | \r |
fc30687f | 23 | ///\r |
24 | /// define the timeout time as 3ms\r | |
25 | ///\r | |
fb3df220 | 26 | #define TIMEOUT_VALUE 3 * 1000\r |
27 | \r | |
373b5cf9 | 28 | /**\r |
d5954c61 | 29 | Get the descriptor of the specified USB HID interface.\r |
373b5cf9 | 30 | \r |
d5954c61 | 31 | Submit a USB get HID descriptor request for the USB device specified by UsbIo\r |
32 | and Interface and return the HID descriptor in HidDescriptor.\r | |
33 | If UsbIo is NULL, then ASSERT().\r | |
34 | If HidDescriptor is NULL, then ASSERT().\r | |
373b5cf9 | 35 | \r |
d5954c61 | 36 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r |
37 | @param Interface The index of the HID interface on the USB target.\r | |
38 | @param HidDescriptor Pointer to the USB HID descriptor that was retrieved from\r | |
39 | the specified USB target and interface. Type EFI_USB_HID_DESCRIPTOR\r | |
40 | is defined in the MDE Package Industry Standard include file Usb.h.\r | |
41 | \r | |
42 | @retval EFI_SUCCESS The request executed successfully.\r | |
43 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
44 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
373b5cf9 | 45 | \r |
46 | **/\r | |
fb3df220 | 47 | EFI_STATUS\r |
f1787349 | 48 | EFIAPI\r |
fb3df220 | 49 | UsbGetHidDescriptor (\r |
50 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
d5954c61 | 51 | IN UINT8 Interface,\r |
fb3df220 | 52 | OUT EFI_USB_HID_DESCRIPTOR *HidDescriptor\r |
53 | );\r | |
54 | \r | |
373b5cf9 | 55 | \r |
56 | /**\r | |
d5954c61 | 57 | Get the report descriptor of the specified USB HID interface.\r |
58 | \r | |
59 | Submit a USB get HID report descriptor request for the USB device specified by\r | |
60 | UsbIo and Interface and return the report descriptor in DescriptorBuffer.\r | |
61 | If UsbIo is NULL, then ASSERT().\r | |
62 | If DescriptorBuffer is NULL, then ASSERT().\r | |
373b5cf9 | 63 | \r |
d5954c61 | 64 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r |
65 | @param Interface The index of the report interface on the USB target.\r | |
66 | @param DescriptorLength The size, in bytes, of DescriptorBuffer.\r | |
67 | @param DescriptorBuffer A pointer to the buffer to store the report class descriptor.\r | |
373b5cf9 | 68 | \r |
d5954c61 | 69 | @retval EFI_SUCCESS The request executed successfully.\r |
70 | @retval EFI_OUT_OF_RESOURCES The request could not be completed because the\r | |
9638ba6d | 71 | buffer specified by DescriptorLength and DescriptorBuffer\r |
d5954c61 | 72 | is not large enough to hold the result of the request.\r |
73 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
74 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
373b5cf9 | 75 | \r |
76 | **/\r | |
fb3df220 | 77 | EFI_STATUS\r |
f1787349 | 78 | EFIAPI\r |
fb3df220 | 79 | UsbGetReportDescriptor (\r |
80 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
d5954c61 | 81 | IN UINT8 Interface,\r |
82 | IN UINT16 DescriptorLength,\r | |
fb3df220 | 83 | OUT UINT8 *DescriptorBuffer\r |
84 | );\r | |
85 | \r | |
373b5cf9 | 86 | /**\r |
d5954c61 | 87 | Get the HID protocol of the specified USB HID interface.\r |
373b5cf9 | 88 | \r |
d5954c61 | 89 | Submit a USB get HID protocol request for the USB device specified by UsbIo\r |
90 | and Interface and return the protocol retrieved in Protocol.\r | |
91 | If UsbIo is NULL, then ASSERT().\r | |
92 | If Protocol is NULL, then ASSERT().\r | |
373b5cf9 | 93 | \r |
d5954c61 | 94 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r |
95 | @param Interface The index of the report interface on the USB target.\r | |
96 | @param Protocol A pointer to the protocol for the specified USB target.\r | |
97 | \r | |
98 | @retval EFI_SUCCESS The request executed successfully.\r | |
99 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
100 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
373b5cf9 | 101 | \r |
102 | **/\r | |
fb3df220 | 103 | EFI_STATUS\r |
f1787349 | 104 | EFIAPI\r |
fb3df220 | 105 | UsbGetProtocolRequest (\r |
106 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
107 | IN UINT8 Interface,\r | |
4cb616da | 108 | OUT UINT8 *Protocol\r |
fb3df220 | 109 | );\r |
110 | \r | |
373b5cf9 | 111 | /**\r |
d5954c61 | 112 | Set the HID protocol of the specified USB HID interface.\r |
113 | \r | |
114 | Submit a USB set HID protocol request for the USB device specified by UsbIo\r | |
115 | and Interface and set the protocol to the value specified by Protocol.\r | |
116 | If UsbIo is NULL, then ASSERT().\r | |
373b5cf9 | 117 | \r |
d5954c61 | 118 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r |
119 | @param Interface The index of the report interface on the USB target.\r | |
120 | @param Protocol The protocol value to set for the specified USB target.\r | |
373b5cf9 | 121 | \r |
d5954c61 | 122 | @retval EFI_SUCCESS The request executed successfully.\r |
123 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
124 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
373b5cf9 | 125 | \r |
126 | **/\r | |
fb3df220 | 127 | EFI_STATUS\r |
f1787349 | 128 | EFIAPI\r |
fb3df220 | 129 | UsbSetProtocolRequest (\r |
130 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
131 | IN UINT8 Interface,\r | |
132 | IN UINT8 Protocol\r | |
133 | );\r | |
134 | \r | |
373b5cf9 | 135 | /**\r |
d5954c61 | 136 | Set the idle rate of the specified USB HID report.\r |
137 | \r | |
138 | Submit a USB set HID report idle request for the USB device specified by UsbIo,\r | |
139 | Interface, and ReportId, and set the idle rate to the value specified by Duration.\r | |
140 | If UsbIo is NULL, then ASSERT().\r | |
373b5cf9 | 141 | \r |
d5954c61 | 142 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r |
143 | @param Interface The index of the report interface on the USB target.\r | |
144 | @param ReportId The identifier of the report to retrieve.\r | |
145 | @param Duration The idle rate to set for the specified USB target.\r | |
373b5cf9 | 146 | \r |
d5954c61 | 147 | @retval EFI_SUCCESS The request executed successfully.\r |
148 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
149 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
373b5cf9 | 150 | \r |
151 | **/\r | |
fb3df220 | 152 | EFI_STATUS\r |
f1787349 | 153 | EFIAPI\r |
fb3df220 | 154 | UsbSetIdleRequest (\r |
155 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
156 | IN UINT8 Interface,\r | |
157 | IN UINT8 ReportId,\r | |
158 | IN UINT8 Duration\r | |
159 | );\r | |
160 | \r | |
373b5cf9 | 161 | /**\r |
d5954c61 | 162 | Get the idle rate of the specified USB HID report.\r |
373b5cf9 | 163 | \r |
d5954c61 | 164 | Submit a USB get HID report idle request for the USB device specified by UsbIo,\r |
165 | Interface, and ReportId, and return the ide rate in Duration.\r | |
166 | If UsbIo is NULL, then ASSERT().\r | |
167 | If Duration is NULL, then ASSERT().\r | |
373b5cf9 | 168 | \r |
d5954c61 | 169 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r |
170 | @param Interface The index of the report interface on the USB target.\r | |
171 | @param ReportId The identifier of the report to retrieve.\r | |
172 | @param Duration A pointer to the idle rate retrieved from the specified USB target.\r | |
173 | \r | |
174 | @retval EFI_SUCCESS The request executed successfully.\r | |
175 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
176 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
373b5cf9 | 177 | \r |
178 | **/\r | |
fb3df220 | 179 | EFI_STATUS\r |
f1787349 | 180 | EFIAPI\r |
fb3df220 | 181 | UsbGetIdleRequest (\r |
182 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
183 | IN UINT8 Interface,\r | |
184 | IN UINT8 ReportId,\r | |
185 | OUT UINT8 *Duration\r | |
186 | );\r | |
187 | \r | |
373b5cf9 | 188 | /**\r |
d5954c61 | 189 | Set the report descriptor of the specified USB HID interface.\r |
373b5cf9 | 190 | \r |
98ea597b | 191 | Submit a USB set HID report request for the USB device specified by UsbIo,\r |
192 | Interface, ReportId, and ReportType, and set the report descriptor using the\r | |
193 | buffer specified by ReportLength and Report.\r | |
194 | If UsbIo is NULL, then ASSERT().\r | |
195 | If Report is NULL, then ASSERT().\r | |
196 | \r | |
d5954c61 | 197 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r |
198 | @param Interface The index of the report interface on the USB target.\r | |
199 | @param ReportId The identifier of the report to retrieve.\r | |
200 | @param ReportType The type of report to retrieve.\r | |
201 | @param ReportLength The size, in bytes, of Report.\r | |
202 | @param Report A pointer to the report descriptor buffer to set.\r | |
373b5cf9 | 203 | \r |
d5954c61 | 204 | @retval EFI_SUCCESS The request executed successfully.\r |
205 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
206 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
373b5cf9 | 207 | \r |
208 | **/\r | |
fb3df220 | 209 | EFI_STATUS\r |
f1787349 | 210 | EFIAPI\r |
fb3df220 | 211 | UsbSetReportRequest (\r |
212 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
213 | IN UINT8 Interface,\r | |
214 | IN UINT8 ReportId,\r | |
215 | IN UINT8 ReportType,\r | |
216 | IN UINT16 ReportLen,\r | |
217 | IN UINT8 *Report\r | |
218 | );\r | |
219 | \r | |
373b5cf9 | 220 | /**\r |
d5954c61 | 221 | Get the report descriptor of the specified USB HID interface.\r |
222 | \r | |
223 | Submit a USB get HID report request for the USB device specified by UsbIo,\r | |
224 | Interface, ReportId, and ReportType, and return the report in the buffer\r | |
225 | specified by Report.\r | |
226 | If UsbIo is NULL, then ASSERT().\r | |
227 | If Report is NULL, then ASSERT().\r | |
228 | \r | |
229 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r | |
230 | @param Interface The index of the report interface on the USB target.\r | |
231 | @param ReportId The identifier of the report to retrieve.\r | |
232 | @param ReportType The type of report to retrieve.\r | |
233 | @param ReportLength The size, in bytes, of Report.\r | |
234 | @param Report A pointer to the buffer to store the report descriptor.\r | |
235 | \r | |
236 | @retval EFI_SUCCESS The request executed successfully.\r | |
237 | @retval EFI_OUT_OF_RESOURCES The request could not be completed because the\r | |
238 | buffer specifed by ReportLength and Report is not\r | |
239 | large enough to hold the result of the request.\r | |
240 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
241 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
373b5cf9 | 242 | \r |
243 | **/\r | |
fb3df220 | 244 | EFI_STATUS\r |
f1787349 | 245 | EFIAPI\r |
fb3df220 | 246 | UsbGetReportRequest (\r |
4cb616da | 247 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
248 | IN UINT8 Interface,\r | |
249 | IN UINT8 ReportId,\r | |
250 | IN UINT8 ReportType,\r | |
251 | IN UINT16 ReportLen,\r | |
252 | OUT UINT8 *Report\r | |
fb3df220 | 253 | );\r |
254 | \r | |
373b5cf9 | 255 | /**\r |
d5954c61 | 256 | Get the descriptor of the specified USB device.\r |
257 | \r | |
258 | Submit a USB get descriptor request for the USB device specified by UsbIo, Value,\r | |
259 | and Index, and return the descriptor in the buffer specified by Descriptor.\r | |
260 | The status of the transfer is returned in Status.\r | |
261 | If UsbIo is NULL, then ASSERT().\r | |
262 | If Descriptor is NULL, then ASSERT().\r | |
263 | If Status is NULL, then ASSERT().\r | |
264 | \r | |
265 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r | |
266 | @param Value The device request value.\r | |
267 | @param Index The device request index.\r | |
268 | @param DescriptorLength The size, in bytes, of Descriptor.\r | |
269 | @param Descriptor A pointer to the descriptor buffer to get.\r | |
270 | @param Status A pointer to the status of the transfer.\r | |
271 | \r | |
272 | @retval EFI_SUCCESS The request executed successfully.\r | |
273 | @retval EFI_OUT_OF_RESOURCES The request could not be completed because the\r | |
274 | buffer specifed by DescriptorLength and Descriptor\r | |
275 | is not large enough to hold the result of the request.\r | |
276 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
277 | @retval EFI_DEVICE_ERROR The request failed due to a device error. The transfer\r | |
278 | status is returned in Status.\r | |
373b5cf9 | 279 | \r |
280 | **/\r | |
fb3df220 | 281 | EFI_STATUS\r |
9199040c | 282 | EFIAPI\r |
fb3df220 | 283 | UsbGetDescriptor (\r |
284 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
285 | IN UINT16 Value,\r | |
286 | IN UINT16 Index,\r | |
287 | IN UINT16 DescriptorLength,\r | |
288 | OUT VOID *Descriptor,\r | |
289 | OUT UINT32 *Status\r | |
290 | );\r | |
291 | \r | |
373b5cf9 | 292 | /**\r |
d5954c61 | 293 | Set the descriptor of the specified USB device.\r |
294 | \r | |
295 | Submit a USB set descriptor request for the USB device specified by UsbIo,\r | |
296 | Value, and Index, and set the descriptor using the buffer specified by DesriptorLength\r | |
297 | and Descriptor. The status of the transfer is returned in Status.\r | |
298 | If UsbIo is NULL, then ASSERT().\r | |
299 | If Descriptor is NULL, then ASSERT().\r | |
300 | If Status is NULL, then ASSERT().\r | |
301 | \r | |
302 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r | |
303 | @param Value The device request value.\r | |
304 | @param Index The device request index.\r | |
305 | @param DescriptorLength The size, in bytes, of Descriptor.\r | |
306 | @param Descriptor A pointer to the descriptor buffer to set.\r | |
307 | @param Status A pointer to the status of the transfer.\r | |
308 | \r | |
309 | @retval EFI_SUCCESS The request executed successfully.\r | |
310 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
311 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
312 | The transfer status is returned in Status.\r | |
373b5cf9 | 313 | \r |
314 | **/\r | |
fb3df220 | 315 | EFI_STATUS\r |
f1787349 | 316 | EFIAPI\r |
fb3df220 | 317 | UsbSetDescriptor (\r |
318 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
319 | IN UINT16 Value,\r | |
320 | IN UINT16 Index,\r | |
321 | IN UINT16 DescriptorLength,\r | |
322 | IN VOID *Descriptor,\r | |
323 | OUT UINT32 *Status\r | |
324 | );\r | |
325 | \r | |
373b5cf9 | 326 | /**\r |
d5954c61 | 327 | Get the interface setting of the specified USB device.\r |
373b5cf9 | 328 | \r |
d5954c61 | 329 | Submit a USB get interface request for the USB device specified by UsbIo,\r |
330 | and Interface, and place the result in the buffer specified by AlternateSetting.\r | |
331 | The status of the transfer is returned in Status.\r | |
332 | If UsbIo is NULL, then ASSERT().\r | |
333 | If AlternateSetting is NULL, then ASSERT().\r | |
334 | If Status is NULL, then ASSERT().\r | |
373b5cf9 | 335 | \r |
d5954c61 | 336 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r |
337 | @param Interface The interface index value.\r | |
338 | @param AlternateSetting A pointer to the alternate setting to be retrieved.\r | |
339 | @param Status A pointer to the status of the transfer.\r | |
340 | \r | |
341 | @retval EFI_SUCCESS The request executed successfully.\r | |
342 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
343 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
344 | The transfer status is returned in Status.\r | |
373b5cf9 | 345 | \r |
346 | **/\r | |
fb3df220 | 347 | EFI_STATUS\r |
f1787349 | 348 | EFIAPI\r |
ed838d0c | 349 | UsbGetInterface (\r |
fb3df220 | 350 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
d5954c61 | 351 | IN UINT16 Interface,\r |
2d8a3c13 | 352 | OUT UINT16 *AlternateSetting,\r |
fb3df220 | 353 | OUT UINT32 *Status\r |
354 | );\r | |
355 | \r | |
373b5cf9 | 356 | /**\r |
d5954c61 | 357 | Set the interface setting of the specified USB device.\r |
373b5cf9 | 358 | \r |
d5954c61 | 359 | Submit a USB set interface request for the USB device specified by UsbIo, and\r |
360 | Interface, and set the alternate setting to the value specified by AlternateSetting.\r | |
361 | The status of the transfer is returned in Status.\r | |
362 | If UsbIo is NULL, then ASSERT().\r | |
363 | If Status is NULL, then ASSERT().\r | |
373b5cf9 | 364 | \r |
d5954c61 | 365 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r |
366 | @param Interface The interface index value.\r | |
367 | @param AlternateSetting The alternate setting to be set.\r | |
368 | @param Status A pointer to the status of the transfer.\r | |
369 | \r | |
370 | @retval EFI_SUCCESS The request executed successfully.\r | |
371 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
372 | @retval EFI_SUCCESS The request failed due to a device error.\r | |
373 | The transfer status is returned in Status.\r | |
373b5cf9 | 374 | \r |
375 | **/\r | |
fb3df220 | 376 | EFI_STATUS\r |
f1787349 | 377 | EFIAPI\r |
ed838d0c | 378 | UsbSetInterface (\r |
fb3df220 | 379 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
d5954c61 | 380 | IN UINT16 Interface,\r |
381 | IN UINT16 AlternateSetting,\r | |
fb3df220 | 382 | OUT UINT32 *Status\r |
383 | );\r | |
384 | \r | |
373b5cf9 | 385 | /**\r |
d5954c61 | 386 | Get the device configuration.\r |
387 | \r | |
388 | Submit a USB get configuration request for the USB device specified by UsbIo\r | |
389 | and place the result in the buffer specified by ConfigurationValue. The status\r | |
390 | of the transfer is returned in Status.\r | |
391 | If UsbIo is NULL, then ASSERT().\r | |
392 | If ConfigurationValue is NULL, then ASSERT().\r | |
393 | If Status is NULL, then ASSERT().\r | |
373b5cf9 | 394 | \r |
d5954c61 | 395 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r |
396 | @param ConfigurationValue A pointer to the device configuration to be retrieved.\r | |
397 | @param Status A pointer to the status of the transfer.\r | |
373b5cf9 | 398 | \r |
d5954c61 | 399 | @retval EFI_SUCCESS The request executed successfully.\r |
400 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
401 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
402 | The transfer status is returned in Status.\r | |
373b5cf9 | 403 | \r |
404 | **/\r | |
fb3df220 | 405 | EFI_STATUS\r |
f1787349 | 406 | EFIAPI\r |
ed838d0c | 407 | UsbGetConfiguration (\r |
fb3df220 | 408 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
2d8a3c13 | 409 | OUT UINT16 *ConfigurationValue,\r |
fb3df220 | 410 | OUT UINT32 *Status\r |
411 | );\r | |
412 | \r | |
373b5cf9 | 413 | /**\r |
d5954c61 | 414 | Set the device configuration.\r |
373b5cf9 | 415 | \r |
d5954c61 | 416 | Submit a USB set configuration request for the USB device specified by UsbIo\r |
417 | and set the device configuration to the value specified by ConfigurationValue.\r | |
418 | The status of the transfer is returned in Status.\r | |
419 | If UsbIo is NULL, then ASSERT().\r | |
420 | If Status is NULL, then ASSERT().\r | |
373b5cf9 | 421 | \r |
d5954c61 | 422 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r |
423 | @param ConfigurationValue The device configuration value to be set.\r | |
424 | @param Status A pointer to the status of the transfer.\r | |
425 | \r | |
426 | @retval EFI_SUCCESS The request executed successfully.\r | |
427 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
428 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
429 | The transfer status is returned in Status.\r | |
373b5cf9 | 430 | \r |
431 | **/\r | |
fb3df220 | 432 | EFI_STATUS\r |
f1787349 | 433 | EFIAPI\r |
ed838d0c | 434 | UsbSetConfiguration (\r |
fb3df220 | 435 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
d5954c61 | 436 | IN UINT16 ConfigurationValue,\r |
fb3df220 | 437 | OUT UINT32 *Status\r |
438 | );\r | |
439 | \r | |
373b5cf9 | 440 | /**\r |
d5954c61 | 441 | Set the specified feature of the specified device.\r |
442 | \r | |
443 | Submit a USB set device feature request for the USB device specified by UsbIo,\r | |
444 | Recipient, and Target to the value specified by Value. The status of the\r | |
445 | transfer is returned in Status.\r | |
446 | If UsbIo is NULL, then ASSERT().\r | |
447 | If Status is NULL, then ASSERT().\r | |
448 | \r | |
449 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r | |
450 | @param Recipient The USB data recipient type (i.e. Device, Interface, Endpoint).\r | |
451 | Type USB_TYPES_DEFINITION is defined in the MDE Package Industry\r | |
452 | Standard include file Usb.h.\r | |
453 | @param Value The value of the feature to be set.\r | |
454 | @param Target The index of the device to be set.\r | |
455 | @param Status A pointer to the status of the transfer.\r | |
456 | \r | |
457 | @retval EFI_SUCCESS The request executed successfully.\r | |
458 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
459 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
460 | The transfer status is returned in Status.\r | |
373b5cf9 | 461 | \r |
462 | **/\r | |
fb3df220 | 463 | EFI_STATUS\r |
f1787349 | 464 | EFIAPI\r |
ed838d0c | 465 | UsbSetFeature (\r |
fb3df220 | 466 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
d5954c61 | 467 | IN USB_TYPES_DEFINITION Recipient,\r |
fb3df220 | 468 | IN UINT16 Value,\r |
469 | IN UINT16 Target,\r | |
470 | OUT UINT32 *Status\r | |
471 | );\r | |
472 | \r | |
373b5cf9 | 473 | /**\r |
d5954c61 | 474 | Clear the specified feature of the specified device.\r |
475 | \r | |
476 | Submit a USB clear device feature request for the USB device specified by UsbIo,\r | |
477 | Recipient, and Target to the value specified by Value. The status of the transfer\r | |
478 | is returned in Status.\r | |
479 | If UsbIo is NULL, then ASSERT().\r | |
480 | If Status is NULL, then ASSERT().\r | |
481 | \r | |
482 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r | |
483 | @param Recipient The USB data recipient type (i.e. Device, Interface, Endpoint).\r | |
484 | Type USB_TYPES_DEFINITION is defined in the MDE Package Industry Standard\r | |
485 | include file Usb.h.\r | |
486 | @param Value The value of the feature to be cleared.\r | |
487 | @param Target The index of the device to be cleared.\r | |
488 | @param Status A pointer to the status of the transfer.\r | |
489 | \r | |
490 | @retval EFI_SUCCESS The request executed successfully.\r | |
491 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
492 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
493 | The transfer status is returned in Status.\r | |
373b5cf9 | 494 | \r |
495 | **/\r | |
fb3df220 | 496 | EFI_STATUS\r |
f1787349 | 497 | EFIAPI\r |
ed838d0c | 498 | UsbClearFeature (\r |
fb3df220 | 499 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
d5954c61 | 500 | IN USB_TYPES_DEFINITION Recipient,\r |
fb3df220 | 501 | IN UINT16 Value,\r |
502 | IN UINT16 Target,\r | |
503 | OUT UINT32 *Status\r | |
504 | );\r | |
505 | \r | |
373b5cf9 | 506 | /**\r |
d5954c61 | 507 | Get the status of the specified device.\r |
508 | \r | |
509 | Submit a USB device get status request for the USB device specified by UsbIo,\r | |
510 | Recipient, and Target and place the result in the buffer specified by DeviceStatus.\r | |
511 | The status of the transfer is returned in Status.\r | |
512 | If UsbIo is NULL, then ASSERT().\r | |
513 | If DeviceStatus is NULL, then ASSERT().\r | |
514 | If Status is NULL, then ASSERT().\r | |
515 | \r | |
516 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r | |
517 | @param Recipient The USB data recipient type (i.e. Device, Interface, Endpoint).\r | |
518 | Type USB_TYPES_DEFINITION is defined in the MDE Package Industry Standard\r | |
519 | include file Usb.h.\r | |
520 | @param Target The index of the device to be get the status of.\r | |
521 | @param DeviceStatus A pointer to the device status to be retrieved.\r | |
522 | @param Status A pointer to the status of the transfer.\r | |
523 | \r | |
524 | @retval EFI_SUCCESS The request executed successfully.\r | |
525 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
526 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
527 | The transfer status is returned in Status.\r | |
373b5cf9 | 528 | \r |
529 | **/\r | |
fb3df220 | 530 | EFI_STATUS\r |
f1787349 | 531 | EFIAPI\r |
ed838d0c | 532 | UsbGetStatus (\r |
fb3df220 | 533 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r |
d5954c61 | 534 | IN USB_TYPES_DEFINITION Recipient,\r |
fb3df220 | 535 | IN UINT16 Target,\r |
adde977a | 536 | OUT UINT16 *DeviceStatus,\r |
fb3df220 | 537 | OUT UINT32 *Status\r |
538 | );\r | |
539 | \r | |
373b5cf9 | 540 | /**\r |
d5954c61 | 541 | Clear halt feature of the specified usb endpoint.\r |
542 | \r | |
543 | Retrieve the USB endpoint descriptor specified by UsbIo and EndPoint.\r | |
544 | If the USB endpoint descriptor can not be retrieved, then return EFI_NOT_FOUND.\r | |
9638ba6d | 545 | If the endpoint descriptor is found, then clear the halt feature of this USB endpoint.\r |
d5954c61 | 546 | The status of the transfer is returned in Status.\r |
547 | If UsbIo is NULL, then ASSERT().\r | |
548 | If Status is NULL, then ASSERT().\r | |
373b5cf9 | 549 | \r |
d5954c61 | 550 | @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r |
551 | @param Endpoint The endpoint address.\r | |
552 | @param Status A pointer to the status of the transfer.\r | |
373b5cf9 | 553 | \r |
d5954c61 | 554 | @retval EFI_SUCCESS The request executed successfully.\r |
555 | @retval EFI_TIMEOUT A timeout occurred executing the request.\r | |
556 | @retval EFI_DEVICE_ERROR The request failed due to a device error.\r | |
557 | The transfer status is returned in Status.\r | |
558 | @retval EFI_NOT_FOUND The specified USB endpoint descriptor can not be found\r | |
373b5cf9 | 559 | \r |
560 | **/\r | |
fb3df220 | 561 | EFI_STATUS\r |
f1787349 | 562 | EFIAPI\r |
fb3df220 | 563 | UsbClearEndpointHalt (\r |
564 | IN EFI_USB_IO_PROTOCOL *UsbIo,\r | |
d5954c61 | 565 | IN UINT8 Endpoint,\r |
fb3df220 | 566 | OUT UINT32 *Status\r |
567 | );\r | |
568 | \r | |
569 | #endif\r |