]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/UefiUsbLib.h
refine the comments
[mirror_edk2.git] / MdePkg / Include / Library / UefiUsbLib.h
CommitLineData
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 5Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
6All rights reserved. This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
842f5579 10\r
50a64e5b 11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT 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 47EFI_STATUS\r
f1787349 48EFIAPI\r
fb3df220 49UsbGetHidDescriptor (\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
71 buffer specifed by DescriptorLength and DescriptorBuffer\r
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 77EFI_STATUS\r
f1787349 78EFIAPI\r
fb3df220 79UsbGetReportDescriptor (\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 103EFI_STATUS\r
f1787349 104EFIAPI\r
fb3df220 105UsbGetProtocolRequest (\r
106 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
107 IN UINT8 Interface,\r
108 IN UINT8 *Protocol\r
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 127EFI_STATUS\r
f1787349 128EFIAPI\r
fb3df220 129UsbSetProtocolRequest (\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 152EFI_STATUS\r
f1787349 153EFIAPI\r
fb3df220 154UsbSetIdleRequest (\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 179EFI_STATUS\r
f1787349 180EFIAPI\r
fb3df220 181UsbGetIdleRequest (\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
d5954c61 191 @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
192 @param Interface The index of the report interface on the USB target.\r
193 @param ReportId The identifier of the report to retrieve.\r
194 @param ReportType The type of report to retrieve.\r
195 @param ReportLength The size, in bytes, of Report.\r
196 @param Report A pointer to the report descriptor buffer to set.\r
373b5cf9 197\r
d5954c61 198 @retval EFI_SUCCESS The request executed successfully.\r
199 @retval EFI_TIMEOUT A timeout occurred executing the request.\r
200 @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
373b5cf9 201\r
202**/\r
fb3df220 203EFI_STATUS\r
f1787349 204EFIAPI\r
fb3df220 205UsbSetReportRequest (\r
206 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
207 IN UINT8 Interface,\r
208 IN UINT8 ReportId,\r
209 IN UINT8 ReportType,\r
210 IN UINT16 ReportLen,\r
211 IN UINT8 *Report\r
212 );\r
213\r
373b5cf9 214/**\r
d5954c61 215 Get the report descriptor of the specified USB HID interface.\r
216\r
217 Submit a USB get HID report request for the USB device specified by UsbIo,\r
218 Interface, ReportId, and ReportType, and return the report in the buffer\r
219 specified by Report.\r
220 If UsbIo is NULL, then ASSERT().\r
221 If Report is NULL, then ASSERT().\r
222\r
223 @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
224 @param Interface The index of the report interface on the USB target.\r
225 @param ReportId The identifier of the report to retrieve.\r
226 @param ReportType The type of report to retrieve.\r
227 @param ReportLength The size, in bytes, of Report.\r
228 @param Report A pointer to the buffer to store the report descriptor.\r
229\r
230 @retval EFI_SUCCESS The request executed successfully.\r
231 @retval EFI_OUT_OF_RESOURCES The request could not be completed because the\r
232 buffer specifed by ReportLength and Report is not\r
233 large enough to hold the result of the request.\r
234 @retval EFI_TIMEOUT A timeout occurred executing the request.\r
235 @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
373b5cf9 236\r
237**/\r
fb3df220 238EFI_STATUS\r
f1787349 239EFIAPI\r
fb3df220 240UsbGetReportRequest (\r
241 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
242 IN UINT8 Interface,\r
243 IN UINT8 ReportId,\r
244 IN UINT8 ReportType,\r
245 IN UINT16 ReportLen,\r
246 IN UINT8 *Report\r
247 );\r
248\r
373b5cf9 249/**\r
d5954c61 250 Get the descriptor of the specified USB device.\r
251\r
252 Submit a USB get descriptor request for the USB device specified by UsbIo, Value,\r
253 and Index, and return the descriptor in the buffer specified by Descriptor.\r
254 The status of the transfer is returned in Status.\r
255 If UsbIo is NULL, then ASSERT().\r
256 If Descriptor is NULL, then ASSERT().\r
257 If Status is NULL, then ASSERT().\r
258\r
259 @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
260 @param Value The device request value.\r
261 @param Index The device request index.\r
262 @param DescriptorLength The size, in bytes, of Descriptor.\r
263 @param Descriptor A pointer to the descriptor buffer to get.\r
264 @param Status A pointer to the status of the transfer.\r
265\r
266 @retval EFI_SUCCESS The request executed successfully.\r
267 @retval EFI_OUT_OF_RESOURCES The request could not be completed because the\r
268 buffer specifed by DescriptorLength and Descriptor\r
269 is not large enough to hold the result of the request.\r
270 @retval EFI_TIMEOUT A timeout occurred executing the request.\r
271 @retval EFI_DEVICE_ERROR The request failed due to a device error. The transfer\r
272 status is returned in Status.\r
373b5cf9 273\r
274**/\r
fb3df220 275EFI_STATUS\r
9199040c 276EFIAPI\r
fb3df220 277UsbGetDescriptor (\r
278 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
279 IN UINT16 Value,\r
280 IN UINT16 Index,\r
281 IN UINT16 DescriptorLength,\r
282 OUT VOID *Descriptor,\r
283 OUT UINT32 *Status\r
284 );\r
285\r
373b5cf9 286/**\r
d5954c61 287 Set the descriptor of the specified USB device.\r
288\r
289 Submit a USB set descriptor request for the USB device specified by UsbIo,\r
290 Value, and Index, and set the descriptor using the buffer specified by DesriptorLength\r
291 and Descriptor. The status of the transfer is returned in Status.\r
292 If UsbIo is NULL, then ASSERT().\r
293 If Descriptor is NULL, then ASSERT().\r
294 If Status is NULL, then ASSERT().\r
295\r
296 @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
297 @param Value The device request value.\r
298 @param Index The device request index.\r
299 @param DescriptorLength The size, in bytes, of Descriptor.\r
300 @param Descriptor A pointer to the descriptor buffer to set.\r
301 @param Status A pointer to the status of the transfer.\r
302\r
303 @retval EFI_SUCCESS The request executed successfully.\r
304 @retval EFI_TIMEOUT A timeout occurred executing the request.\r
305 @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
306 The transfer status is returned in Status.\r
373b5cf9 307\r
308**/\r
fb3df220 309EFI_STATUS\r
f1787349 310EFIAPI\r
fb3df220 311UsbSetDescriptor (\r
312 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
313 IN UINT16 Value,\r
314 IN UINT16 Index,\r
315 IN UINT16 DescriptorLength,\r
316 IN VOID *Descriptor,\r
317 OUT UINT32 *Status\r
318 );\r
319\r
373b5cf9 320/**\r
d5954c61 321 Get the interface setting of the specified USB device.\r
373b5cf9 322\r
d5954c61 323 Submit a USB get interface request for the USB device specified by UsbIo,\r
324 and Interface, and place the result in the buffer specified by AlternateSetting.\r
325 The status of the transfer is returned in Status.\r
326 If UsbIo is NULL, then ASSERT().\r
327 If AlternateSetting is NULL, then ASSERT().\r
328 If Status is NULL, then ASSERT().\r
373b5cf9 329\r
d5954c61 330 @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
331 @param Interface The interface index value.\r
332 @param AlternateSetting A pointer to the alternate setting to be retrieved.\r
333 @param Status A pointer to the status of the transfer.\r
334\r
335 @retval EFI_SUCCESS The request executed successfully.\r
336 @retval EFI_TIMEOUT A timeout occurred executing the request.\r
337 @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
338 The transfer status is returned in Status.\r
373b5cf9 339\r
340**/\r
fb3df220 341EFI_STATUS\r
f1787349 342EFIAPI\r
ed838d0c 343UsbGetInterface (\r
fb3df220 344 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
d5954c61 345 IN UINT16 Interface,\r
346 OUT UINT8 *AlternateSetting,\r
fb3df220 347 OUT UINT32 *Status\r
348 );\r
349\r
373b5cf9 350/**\r
d5954c61 351 Set the interface setting of the specified USB device.\r
373b5cf9 352\r
d5954c61 353 Submit a USB set interface request for the USB device specified by UsbIo, and\r
354 Interface, and set the alternate setting to the value specified by AlternateSetting.\r
355 The status of the transfer is returned in Status.\r
356 If UsbIo is NULL, then ASSERT().\r
357 If Status is NULL, then ASSERT().\r
373b5cf9 358\r
d5954c61 359 @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
360 @param Interface The interface index value.\r
361 @param AlternateSetting The alternate setting to be set.\r
362 @param Status A pointer to the status of the transfer.\r
363\r
364 @retval EFI_SUCCESS The request executed successfully.\r
365 @retval EFI_TIMEOUT A timeout occurred executing the request.\r
366 @retval EFI_SUCCESS The request failed due to a device error.\r
367 The transfer status is returned in Status.\r
373b5cf9 368\r
369**/\r
fb3df220 370EFI_STATUS\r
f1787349 371EFIAPI\r
ed838d0c 372UsbSetInterface (\r
fb3df220 373 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
d5954c61 374 IN UINT16 Interface,\r
375 IN UINT16 AlternateSetting,\r
fb3df220 376 OUT UINT32 *Status\r
377 );\r
378\r
373b5cf9 379/**\r
d5954c61 380 Get the device configuration.\r
381\r
382 Submit a USB get configuration request for the USB device specified by UsbIo\r
383 and place the result in the buffer specified by ConfigurationValue. The status\r
384 of the transfer is returned in Status.\r
385 If UsbIo is NULL, then ASSERT().\r
386 If ConfigurationValue is NULL, then ASSERT().\r
387 If Status is NULL, then ASSERT().\r
373b5cf9 388\r
d5954c61 389 @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
390 @param ConfigurationValue A pointer to the device configuration to be retrieved.\r
391 @param Status A pointer to the status of the transfer.\r
373b5cf9 392\r
d5954c61 393 @retval EFI_SUCCESS The request executed successfully.\r
394 @retval EFI_TIMEOUT A timeout occurred executing the request.\r
395 @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
396 The transfer status is returned in Status.\r
373b5cf9 397\r
398**/\r
fb3df220 399EFI_STATUS\r
f1787349 400EFIAPI\r
ed838d0c 401UsbGetConfiguration (\r
fb3df220 402 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
d5954c61 403 OUT UINT8 *ConfigurationValue,\r
fb3df220 404 OUT UINT32 *Status\r
405 );\r
406\r
373b5cf9 407/**\r
d5954c61 408 Set the device configuration.\r
373b5cf9 409\r
d5954c61 410 Submit a USB set configuration request for the USB device specified by UsbIo\r
411 and set the device configuration to the value specified by ConfigurationValue.\r
412 The status of the transfer is returned in Status.\r
413 If UsbIo is NULL, then ASSERT().\r
414 If Status is NULL, then ASSERT().\r
373b5cf9 415\r
d5954c61 416 @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
417 @param ConfigurationValue The device configuration value to be set.\r
418 @param Status A pointer to the status of the transfer.\r
419\r
420 @retval EFI_SUCCESS The request executed successfully.\r
421 @retval EFI_TIMEOUT A timeout occurred executing the request.\r
422 @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
423 The transfer status is returned in Status.\r
373b5cf9 424\r
425**/\r
fb3df220 426EFI_STATUS\r
f1787349 427EFIAPI\r
ed838d0c 428UsbSetConfiguration (\r
fb3df220 429 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
d5954c61 430 IN UINT16 ConfigurationValue,\r
fb3df220 431 OUT UINT32 *Status\r
432 );\r
433\r
373b5cf9 434/**\r
d5954c61 435 Set the specified feature of the specified device.\r
436\r
437 Submit a USB set device feature request for the USB device specified by UsbIo,\r
438 Recipient, and Target to the value specified by Value. The status of the\r
439 transfer is returned in Status.\r
440 If UsbIo is NULL, then ASSERT().\r
441 If Status is NULL, then ASSERT().\r
442\r
443 @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
444 @param Recipient The USB data recipient type (i.e. Device, Interface, Endpoint).\r
445 Type USB_TYPES_DEFINITION is defined in the MDE Package Industry\r
446 Standard include file Usb.h.\r
447 @param Value The value of the feature to be set.\r
448 @param Target The index of the device to be set.\r
449 @param Status A pointer to the status of the transfer.\r
450\r
451 @retval EFI_SUCCESS The request executed successfully.\r
452 @retval EFI_TIMEOUT A timeout occurred executing the request.\r
453 @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
454 The transfer status is returned in Status.\r
373b5cf9 455\r
456**/\r
fb3df220 457EFI_STATUS\r
f1787349 458EFIAPI\r
ed838d0c 459UsbSetFeature (\r
fb3df220 460 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
d5954c61 461 IN USB_TYPES_DEFINITION Recipient,\r
fb3df220 462 IN UINT16 Value,\r
463 IN UINT16 Target,\r
464 OUT UINT32 *Status\r
465 );\r
466\r
373b5cf9 467/**\r
d5954c61 468 Clear the specified feature of the specified device.\r
469\r
470 Submit a USB clear device feature request for the USB device specified by UsbIo,\r
471 Recipient, and Target to the value specified by Value. The status of the transfer\r
472 is returned in Status.\r
473 If UsbIo is NULL, then ASSERT().\r
474 If Status is NULL, then ASSERT().\r
475\r
476 @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
477 @param Recipient The USB data recipient type (i.e. Device, Interface, Endpoint).\r
478 Type USB_TYPES_DEFINITION is defined in the MDE Package Industry Standard\r
479 include file Usb.h.\r
480 @param Value The value of the feature to be cleared.\r
481 @param Target The index of the device to be cleared.\r
482 @param Status A pointer to the status of the transfer.\r
483\r
484 @retval EFI_SUCCESS The request executed successfully.\r
485 @retval EFI_TIMEOUT A timeout occurred executing the request.\r
486 @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
487 The transfer status is returned in Status.\r
373b5cf9 488\r
489**/\r
fb3df220 490EFI_STATUS\r
f1787349 491EFIAPI\r
ed838d0c 492UsbClearFeature (\r
fb3df220 493 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
d5954c61 494 IN USB_TYPES_DEFINITION Recipient,\r
fb3df220 495 IN UINT16 Value,\r
496 IN UINT16 Target,\r
497 OUT UINT32 *Status\r
498 );\r
499\r
373b5cf9 500/**\r
d5954c61 501 Get the status of the specified device.\r
502\r
503 Submit a USB device get status request for the USB device specified by UsbIo,\r
504 Recipient, and Target and place the result in the buffer specified by DeviceStatus.\r
505 The status of the transfer is returned in Status.\r
506 If UsbIo is NULL, then ASSERT().\r
507 If DeviceStatus is NULL, then ASSERT().\r
508 If Status is NULL, then ASSERT().\r
509\r
510 @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
511 @param Recipient The USB data recipient type (i.e. Device, Interface, Endpoint).\r
512 Type USB_TYPES_DEFINITION is defined in the MDE Package Industry Standard\r
513 include file Usb.h.\r
514 @param Target The index of the device to be get the status of.\r
515 @param DeviceStatus A pointer to the device status to be retrieved.\r
516 @param Status A pointer to the status of the transfer.\r
517\r
518 @retval EFI_SUCCESS The request executed successfully.\r
519 @retval EFI_TIMEOUT A timeout occurred executing the request.\r
520 @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
521 The transfer status is returned in Status.\r
373b5cf9 522\r
523**/\r
fb3df220 524EFI_STATUS\r
f1787349 525EFIAPI\r
ed838d0c 526UsbGetStatus (\r
fb3df220 527 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
d5954c61 528 IN USB_TYPES_DEFINITION Recipient,\r
fb3df220 529 IN UINT16 Target,\r
530 OUT UINT16 *DevStatus,\r
531 OUT UINT32 *Status\r
532 );\r
533\r
373b5cf9 534/**\r
d5954c61 535 Clear halt feature of the specified usb endpoint.\r
536\r
537 Retrieve the USB endpoint descriptor specified by UsbIo and EndPoint.\r
538 If the USB endpoint descriptor can not be retrieved, then return EFI_NOT_FOUND.\r
539 If the endpoint descriptor is found, then clear the halt fature of this USB endpoint.\r
540 The status of the transfer is returned in Status.\r
541 If UsbIo is NULL, then ASSERT().\r
542 If Status is NULL, then ASSERT().\r
373b5cf9 543\r
d5954c61 544 @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
545 @param Endpoint The endpoint address.\r
546 @param Status A pointer to the status of the transfer.\r
373b5cf9 547\r
d5954c61 548 @retval EFI_SUCCESS The request executed successfully.\r
549 @retval EFI_TIMEOUT A timeout occurred executing the request.\r
550 @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
551 The transfer status is returned in Status.\r
552 @retval EFI_NOT_FOUND The specified USB endpoint descriptor can not be found\r
373b5cf9 553\r
554**/\r
fb3df220 555EFI_STATUS\r
f1787349 556EFIAPI\r
fb3df220 557UsbClearEndpointHalt (\r
558 IN EFI_USB_IO_PROTOCOL *UsbIo,\r
d5954c61 559 IN UINT8 Endpoint,\r
fb3df220 560 OUT UINT32 *Status\r
561 );\r
562\r
563#endif\r