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