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