]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/UsbIo.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Include / Protocol / UsbIo.h
CommitLineData
d1f95000 1/** @file\r
0f82bd55 2 EFI Usb I/O Protocol as defined in UEFI specification.\r
9095d37b
LG
3 This protocol is used by code, typically drivers, running in the EFI\r
4 boot services environment to access USB devices like USB keyboards,\r
5 mice and mass storage devices. In particular, functions for managing devices\r
0f82bd55 6 on USB buses are defined here.\r
9095d37b
LG
7\r
8 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 9 SPDX-License-Identifier: BSD-2-Clause-Patent\r
d1f95000 10\r
d1f95000 11**/\r
12\r
13#ifndef __USB_IO_H__\r
14#define __USB_IO_H__\r
15\r
16#include <IndustryStandard/Usb.h>\r
17\r
18//\r
19// Global ID for the USB I/O Protocol\r
20//\r
21#define EFI_USB_IO_PROTOCOL_GUID \\r
22 { \\r
23 0x2B2F68D6, 0x0CD2, 0x44cf, {0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 } \\r
24 }\r
25\r
2f88bd3a 26typedef struct _EFI_USB_IO_PROTOCOL EFI_USB_IO_PROTOCOL;\r
d1f95000 27\r
e3c6b3d9 28//\r
29// Related Definition for EFI USB I/O protocol\r
30//\r
31\r
32//\r
33// USB standard descriptors and reqeust\r
34//\r
2f88bd3a
MK
35typedef USB_DEVICE_REQUEST EFI_USB_DEVICE_REQUEST;\r
36typedef USB_DEVICE_DESCRIPTOR EFI_USB_DEVICE_DESCRIPTOR;\r
37typedef USB_CONFIG_DESCRIPTOR EFI_USB_CONFIG_DESCRIPTOR;\r
38typedef USB_INTERFACE_DESCRIPTOR EFI_USB_INTERFACE_DESCRIPTOR;\r
39typedef USB_ENDPOINT_DESCRIPTOR EFI_USB_ENDPOINT_DESCRIPTOR;\r
e3c6b3d9 40\r
992f22b9
LG
41///\r
42/// USB data transfer direction\r
43///\r
e3c6b3d9 44typedef enum {\r
45 EfiUsbDataIn,\r
46 EfiUsbDataOut,\r
47 EfiUsbNoData\r
48} EFI_USB_DATA_DIRECTION;\r
49\r
50//\r
51// USB Transfer Results\r
52//\r
2f88bd3a
MK
53#define EFI_USB_NOERROR 0x00\r
54#define EFI_USB_ERR_NOTEXECUTE 0x01\r
55#define EFI_USB_ERR_STALL 0x02\r
56#define EFI_USB_ERR_BUFFER 0x04\r
57#define EFI_USB_ERR_BABBLE 0x08\r
58#define EFI_USB_ERR_NAK 0x10\r
59#define EFI_USB_ERR_CRC 0x20\r
60#define EFI_USB_ERR_TIMEOUT 0x40\r
61#define EFI_USB_ERR_BITSTUFF 0x80\r
62#define EFI_USB_ERR_SYSTEM 0x100\r
e3c6b3d9 63\r
64/**\r
d1f95000 65 Async USB transfer callback routine.\r
e3c6b3d9 66\r
d1f95000 67 @param Data Data received or sent via the USB Asynchronous Transfer, if the\r
e3c6b3d9 68 transfer completed successfully.\r
d1f95000 69 @param DataLength The length of Data received or sent via the Asynchronous\r
e3c6b3d9 70 Transfer, if transfer successfully completes.\r
d1f95000 71 @param Context Data passed from UsbAsyncInterruptTransfer() request.\r
72 @param Status Indicates the result of the asynchronous transfer.\r
e3c6b3d9 73\r
74 @retval EFI_SUCCESS The asynchronous USB transfer request has been successfully executed.\r
d1f95000 75 @retval EFI_DEVICE_ERROR The asynchronous USB transfer request failed.\r
e3c6b3d9 76\r
d1f95000 77**/\r
78typedef\r
79EFI_STATUS\r
8b13229b 80(EFIAPI *EFI_ASYNC_USB_TRANSFER_CALLBACK)(\r
d1f95000 81 IN VOID *Data,\r
82 IN UINTN DataLength,\r
83 IN VOID *Context,\r
84 IN UINT32 Status\r
85 );\r
86\r
87//\r
88// Prototype for EFI USB I/O protocol\r
89//\r
90\r
e3c6b3d9 91/**\r
d1f95000 92 This function is used to manage a USB device with a control transfer pipe. A control transfer is\r
e3c6b3d9 93 typically used to perform device initialization and configuration.\r
94\r
95 @param This A pointer to the EFI_USB_IO_PROTOCOL instance.\r
d1f95000 96 @param Request A pointer to the USB device request that will be sent to the USB\r
e3c6b3d9 97 device.\r
d1f95000 98 @param Direction Indicates the data direction.\r
d1f95000 99 @param Timeout Indicating the transfer should be completed within this time frame.\r
e3c6b3d9 100 The units are in milliseconds.\r
8069d49e
LG
101 @param Data A pointer to the buffer of data that will be transmitted to USB\r
102 device or received from USB device.\r
d1f95000 103 @param DataLength The size, in bytes, of the data buffer specified by Data.\r
104 @param Status A pointer to the result of the USB transfer.\r
e3c6b3d9 105\r
d1f95000 106 @retval EFI_SUCCESS The control transfer has been successfully executed.\r
107 @retval EFI_DEVICE_ERROR The transfer failed. The transfer status is returned in Status.\r
4bdc41cf 108 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
d1f95000 109 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
110 @retval EFI_TIMEOUT The control transfer fails due to timeout.\r
e3c6b3d9 111\r
d1f95000 112**/\r
113typedef\r
114EFI_STATUS\r
8b13229b 115(EFIAPI *EFI_USB_IO_CONTROL_TRANSFER)(\r
d1f95000 116 IN EFI_USB_IO_PROTOCOL *This,\r
117 IN EFI_USB_DEVICE_REQUEST *Request,\r
118 IN EFI_USB_DATA_DIRECTION Direction,\r
119 IN UINT32 Timeout,\r
120 IN OUT VOID *Data OPTIONAL,\r
121 IN UINTN DataLength OPTIONAL,\r
122 OUT UINT32 *Status\r
123 );\r
124\r
e3c6b3d9 125/**\r
d1f95000 126 This function is used to manage a USB device with the bulk transfer pipe. Bulk Transfers are\r
127 typically used to transfer large amounts of data to/from USB devices.\r
e3c6b3d9 128\r
129 @param This A pointer to the EFI_USB_IO_PROTOCOL instance.\r
9095d37b
LG
130 @param DeviceEndpoint The destination USB device endpoint to which the\r
131 device request is being sent. DeviceEndpoint must\r
132 be between 0x01 and 0x0F or between 0x81 and 0x8F,\r
133 otherwise EFI_INVALID_PARAMETER is returned. If\r
134 the endpoint is not a BULK endpoint, EFI_INVALID_PARAMETER\r
135 is returned. The MSB of this parameter indicates\r
136 the endpoint direction. The number "1" stands for\r
3bb398eb 137 an IN endpoint, and "0" stands for an OUT endpoint.\r
d1f95000 138 @param Data A pointer to the buffer of data that will be transmitted to USB\r
e3c6b3d9 139 device or received from USB device.\r
d1f95000 140 @param DataLength The size, in bytes, of the data buffer specified by Data.\r
8377875b 141 On input, the size, in bytes, of the data buffer specified by Data.\r
142 On output, the number of bytes that were actually transferred.\r
d1f95000 143 @param Timeout Indicating the transfer should be completed within this time frame.\r
9095d37b
LG
144 The units are in milliseconds. If Timeout is 0, then the\r
145 caller must wait for the function to be completed until\r
8377875b 146 EFI_SUCCESS or EFI_DEVICE_ERROR is returned.\r
d1f95000 147 @param Status This parameter indicates the USB transfer status.\r
e3c6b3d9 148\r
d1f95000 149 @retval EFI_SUCCESS The bulk transfer has been successfully executed.\r
150 @retval EFI_DEVICE_ERROR The transfer failed. The transfer status is returned in Status.\r
4bdc41cf 151 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
d1f95000 152 @retval EFI_OUT_OF_RESOURCES The request could not be submitted due to a lack of resources.\r
153 @retval EFI_TIMEOUT The control transfer fails due to timeout.\r
e3c6b3d9 154\r
d1f95000 155**/\r
156typedef\r
157EFI_STATUS\r
8b13229b 158(EFIAPI *EFI_USB_IO_BULK_TRANSFER)(\r
d1f95000 159 IN EFI_USB_IO_PROTOCOL *This,\r
160 IN UINT8 DeviceEndpoint,\r
161 IN OUT VOID *Data,\r
162 IN OUT UINTN *DataLength,\r
163 IN UINTN Timeout,\r
164 OUT UINT32 *Status\r
165 );\r
166\r
e3c6b3d9 167/**\r
168 This function is used to manage a USB device with an interrupt transfer pipe. An Asynchronous\r
169 Interrupt Transfer is typically used to query a device's status at a fixed rate. For example,\r
d1f95000 170 keyboard, mouse, and hub devices use this type of transfer to query their interrupt endpoints at\r
e3c6b3d9 171 a fixed rate.\r
172\r
173 @param This A pointer to the EFI_USB_IO_PROTOCOL instance.\r
9095d37b
LG
174 @param DeviceEndpoint The destination USB device endpoint to which the\r
175 device request is being sent. DeviceEndpoint must\r
176 be between 0x01 and 0x0F or between 0x81 and 0x8F,\r
177 otherwise EFI_INVALID_PARAMETER is returned. If\r
178 the endpoint is not a BULK endpoint, EFI_INVALID_PARAMETER\r
179 is returned. The MSB of this parameter indicates\r
180 the endpoint direction. The number "1" stands for\r
3bb398eb 181 an IN endpoint, and "0" stands for an OUT endpoint.\r
e3c6b3d9 182 @param IsNewTransfer If TRUE, a new transfer will be submitted to USB controller. If\r
d1f95000 183 FALSE, the interrupt transfer is deleted from the device's interrupt\r
e3c6b3d9 184 transfer queue.\r
185 @param PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be\r
9095d37b
LG
186 executed.This parameter is required when IsNewTransfer is TRUE. The\r
187 value must be between 1 to 255, otherwise EFI_INVALID_PARAMETER is returned.\r
8377875b 188 The units are in milliseconds.\r
d1f95000 189 @param DataLength Specifies the length, in bytes, of the data to be received from the\r
8377875b 190 USB device. This parameter is only required when IsNewTransfer is TRUE.\r
d1f95000 191 @param InterruptCallback The Callback function. This function is called if the asynchronous\r
9095d37b 192 interrupt transfer is completed. This parameter is required\r
8377875b 193 when IsNewTransfer is TRUE.\r
9095d37b 194 @param Context Data passed to the InterruptCallback function. This is an optional\r
8377875b 195 parameter and may be NULL.\r
e3c6b3d9 196\r
d1f95000 197 @retval EFI_SUCCESS The asynchronous USB transfer request transfer has been successfully executed.\r
e3c6b3d9 198 @retval EFI_DEVICE_ERROR The asynchronous USB transfer request failed.\r
199\r
d1f95000 200**/\r
201typedef\r
202EFI_STATUS\r
8b13229b 203(EFIAPI *EFI_USB_IO_ASYNC_INTERRUPT_TRANSFER)(\r
d1f95000 204 IN EFI_USB_IO_PROTOCOL *This,\r
205 IN UINT8 DeviceEndpoint,\r
206 IN BOOLEAN IsNewTransfer,\r
207 IN UINTN PollingInterval OPTIONAL,\r
208 IN UINTN DataLength OPTIONAL,\r
209 IN EFI_ASYNC_USB_TRANSFER_CALLBACK InterruptCallBack OPTIONAL,\r
210 IN VOID *Context OPTIONAL\r
211 );\r
212\r
e3c6b3d9 213/**\r
d1f95000 214 This function is used to manage a USB device with an interrupt transfer pipe.\r
e3c6b3d9 215\r
216 @param This A pointer to the EFI_USB_IO_PROTOCOL instance.\r
9095d37b
LG
217 @param DeviceEndpoint The destination USB device endpoint to which the\r
218 device request is being sent. DeviceEndpoint must\r
219 be between 0x01 and 0x0F or between 0x81 and 0x8F,\r
220 otherwise EFI_INVALID_PARAMETER is returned. If\r
221 the endpoint is not a BULK endpoint, EFI_INVALID_PARAMETER\r
222 is returned. The MSB of this parameter indicates\r
223 the endpoint direction. The number "1" stands for\r
3bb398eb 224 an IN endpoint, and "0" stands for an OUT endpoint.\r
d1f95000 225 @param Data A pointer to the buffer of data that will be transmitted to USB\r
e3c6b3d9 226 device or received from USB device.\r
d1f95000 227 @param DataLength On input, then size, in bytes, of the buffer Data. On output, the\r
e3c6b3d9 228 amount of data actually transferred.\r
9095d37b
LG
229 @param Timeout The time out, in seconds, for this transfer. If Timeout is 0,\r
230 then the caller must wait for the function to be completed\r
231 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned. If the\r
8377875b 232 transfer is not completed in this time frame, then EFI_TIMEOUT is returned.\r
e3c6b3d9 233 @param Status This parameter indicates the USB transfer status.\r
234\r
d1f95000 235 @retval EFI_SUCCESS The sync interrupt transfer has been successfully executed.\r
236 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
e3c6b3d9 237 @retval EFI_DEVICE_ERROR The sync interrupt transfer request failed.\r
d1f95000 238 @retval EFI_OUT_OF_RESOURCES The request could not be submitted due to a lack of resources.\r
e3c6b3d9 239 @retval EFI_TIMEOUT The transfer fails due to timeout.\r
d1f95000 240**/\r
241typedef\r
242EFI_STATUS\r
8b13229b 243(EFIAPI *EFI_USB_IO_SYNC_INTERRUPT_TRANSFER)(\r
d1f95000 244 IN EFI_USB_IO_PROTOCOL *This,\r
245 IN UINT8 DeviceEndpoint,\r
246 IN OUT VOID *Data,\r
247 IN OUT UINTN *DataLength,\r
248 IN UINTN Timeout,\r
249 OUT UINT32 *Status\r
250 );\r
251\r
e3c6b3d9 252/**\r
d1f95000 253 This function is used to manage a USB device with an isochronous transfer pipe. An Isochronous\r
254 transfer is typically used to transfer streaming data.\r
e3c6b3d9 255\r
256 @param This A pointer to the EFI_USB_IO_PROTOCOL instance.\r
9095d37b
LG
257 @param DeviceEndpoint The destination USB device endpoint to which the\r
258 device request is being sent. DeviceEndpoint must\r
259 be between 0x01 and 0x0F or between 0x81 and 0x8F,\r
260 otherwise EFI_INVALID_PARAMETER is returned. If\r
261 the endpoint is not a BULK endpoint, EFI_INVALID_PARAMETER\r
262 is returned. The MSB of this parameter indicates\r
263 the endpoint direction. The number "1" stands for\r
3bb398eb 264 an IN endpoint, and "0" stands for an OUT endpoint.\r
d1f95000 265 @param Data A pointer to the buffer of data that will be transmitted to USB\r
e3c6b3d9 266 device or received from USB device.\r
267 @param DataLength The size, in bytes, of the data buffer specified by Data.\r
268 @param Status This parameter indicates the USB transfer status.\r
269\r
d1f95000 270 @retval EFI_SUCCESS The isochronous transfer has been successfully executed.\r
271 @retval EFI_INVALID_PARAMETER The parameter DeviceEndpoint is not valid.\r
272 @retval EFI_DEVICE_ERROR The transfer failed due to the reason other than timeout, The error status\r
e3c6b3d9 273 is returned in Status.\r
d1f95000 274 @retval EFI_OUT_OF_RESOURCES The request could not be submitted due to a lack of resources.\r
e3c6b3d9 275 @retval EFI_TIMEOUT The transfer fails due to timeout.\r
d1f95000 276**/\r
277typedef\r
278EFI_STATUS\r
8b13229b 279(EFIAPI *EFI_USB_IO_ISOCHRONOUS_TRANSFER)(\r
d1f95000 280 IN EFI_USB_IO_PROTOCOL *This,\r
281 IN UINT8 DeviceEndpoint,\r
282 IN OUT VOID *Data,\r
283 IN UINTN DataLength,\r
284 OUT UINT32 *Status\r
285 );\r
286\r
e3c6b3d9 287/**\r
d1f95000 288 This function is used to manage a USB device with an isochronous transfer pipe. An Isochronous\r
e3c6b3d9 289 transfer is typically used to transfer streaming data.\r
290\r
291 @param This A pointer to the EFI_USB_IO_PROTOCOL instance.\r
9095d37b
LG
292 @param DeviceEndpoint The destination USB device endpoint to which the\r
293 device request is being sent. DeviceEndpoint must\r
294 be between 0x01 and 0x0F or between 0x81 and 0x8F,\r
295 otherwise EFI_INVALID_PARAMETER is returned. If\r
296 the endpoint is not a BULK endpoint, EFI_INVALID_PARAMETER\r
297 is returned. The MSB of this parameter indicates\r
298 the endpoint direction. The number "1" stands for\r
3bb398eb 299 an IN endpoint, and "0" stands for an OUT endpoint.\r
d1f95000 300 @param Data A pointer to the buffer of data that will be transmitted to USB\r
e3c6b3d9 301 device or received from USB device.\r
302 @param DataLength The size, in bytes, of the data buffer specified by Data.\r
8377875b 303 This is an optional parameter and may be NULL.\r
9095d37b 304 @param IsochronousCallback The IsochronousCallback() function.This function is\r
8377875b 305 called if the requested isochronous transfer is completed.\r
0f82bd55 306 @param Context Data passed to the IsochronousCallback() function.\r
e3c6b3d9 307\r
d1f95000 308 @retval EFI_SUCCESS The asynchronous isochronous transfer has been successfully submitted\r
309 to the system.\r
310 @retval EFI_INVALID_PARAMETER The parameter DeviceEndpoint is not valid.\r
311 @retval EFI_OUT_OF_RESOURCES The request could not be submitted due to a lack of resources.\r
e3c6b3d9 312\r
d1f95000 313**/\r
314typedef\r
315EFI_STATUS\r
8b13229b 316(EFIAPI *EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER)(\r
d1f95000 317 IN EFI_USB_IO_PROTOCOL *This,\r
318 IN UINT8 DeviceEndpoint,\r
319 IN OUT VOID *Data,\r
320 IN UINTN DataLength,\r
321 IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,\r
322 IN VOID *Context OPTIONAL\r
323 );\r
324\r
e3c6b3d9 325/**\r
d1f95000 326 Resets and reconfigures the USB controller. This function will work for all USB devices except\r
e3c6b3d9 327 USB Hub Controllers.\r
328\r
329 @param This A pointer to the EFI_USB_IO_PROTOCOL instance.\r
330\r
331 @retval EFI_SUCCESS The USB controller was reset.\r
d1f95000 332 @retval EFI_INVALID_PARAMETER If the controller specified by This is a USB hub.\r
333 @retval EFI_DEVICE_ERROR An error occurred during the reconfiguration process.\r
e3c6b3d9 334\r
d1f95000 335**/\r
336typedef\r
337EFI_STATUS\r
8b13229b 338(EFIAPI *EFI_USB_IO_PORT_RESET)(\r
d1f95000 339 IN EFI_USB_IO_PROTOCOL *This\r
340 );\r
341\r
e3c6b3d9 342/**\r
d1f95000 343 Retrieves the USB Device Descriptor.\r
e3c6b3d9 344\r
345 @param This A pointer to the EFI_USB_IO_PROTOCOL instance.\r
d1f95000 346 @param DeviceDescriptor A pointer to the caller allocated USB Device Descriptor.\r
e3c6b3d9 347\r
d1f95000 348 @retval EFI_SUCCESS The device descriptor was retrieved successfully.\r
349 @retval EFI_INVALID_PARAMETER DeviceDescriptor is NULL.\r
350 @retval EFI_NOT_FOUND The device descriptor was not found. The device may not be configured.\r
e3c6b3d9 351\r
d1f95000 352**/\r
353typedef\r
354EFI_STATUS\r
8b13229b 355(EFIAPI *EFI_USB_IO_GET_DEVICE_DESCRIPTOR)(\r
d1f95000 356 IN EFI_USB_IO_PROTOCOL *This,\r
357 OUT EFI_USB_DEVICE_DESCRIPTOR *DeviceDescriptor\r
358 );\r
359\r
e3c6b3d9 360/**\r
d1f95000 361 Retrieves the USB Device Descriptor.\r
e3c6b3d9 362\r
363 @param This A pointer to the EFI_USB_IO_PROTOCOL instance.\r
d1f95000 364 @param ConfigurationDescriptor A pointer to the caller allocated USB Active Configuration\r
e3c6b3d9 365 Descriptor.\r
d1f95000 366 @retval EFI_SUCCESS The active configuration descriptor was retrieved successfully.\r
367 @retval EFI_INVALID_PARAMETER ConfigurationDescriptor is NULL.\r
368 @retval EFI_NOT_FOUND An active configuration descriptor cannot be found. The device may not\r
e3c6b3d9 369 be configured.\r
370\r
d1f95000 371**/\r
372typedef\r
373EFI_STATUS\r
8b13229b 374(EFIAPI *EFI_USB_IO_GET_CONFIG_DESCRIPTOR)(\r
d1f95000 375 IN EFI_USB_IO_PROTOCOL *This,\r
376 OUT EFI_USB_CONFIG_DESCRIPTOR *ConfigurationDescriptor\r
377 );\r
378\r
e3c6b3d9 379/**\r
d1f95000 380 Retrieves the Interface Descriptor for a USB Device Controller. As stated earlier, an interface\r
e3c6b3d9 381 within a USB device is equivalently to a USB Controller within the current configuration.\r
382\r
383 @param This A pointer to the EFI_USB_IO_PROTOCOL instance.\r
d1f95000 384 @param InterfaceDescriptor A pointer to the caller allocated USB Interface Descriptor within\r
e3c6b3d9 385 the configuration setting.\r
d1f95000 386 @retval EFI_SUCCESS The interface descriptor retrieved successfully.\r
387 @retval EFI_INVALID_PARAMETER InterfaceDescriptor is NULL.\r
388 @retval EFI_NOT_FOUND The interface descriptor cannot be found. The device may not be\r
e3c6b3d9 389 correctly configured.\r
390\r
d1f95000 391**/\r
392typedef\r
393EFI_STATUS\r
8b13229b 394(EFIAPI *EFI_USB_IO_GET_INTERFACE_DESCRIPTOR)(\r
d1f95000 395 IN EFI_USB_IO_PROTOCOL *This,\r
396 OUT EFI_USB_INTERFACE_DESCRIPTOR *InterfaceDescriptor\r
397 );\r
398\r
e3c6b3d9 399/**\r
d1f95000 400 Retrieves an Endpoint Descriptor within a USB Controller.\r
e3c6b3d9 401\r
402 @param This A pointer to the EFI_USB_IO_PROTOCOL instance.\r
d1f95000 403 @param EndpointIndex Indicates which endpoint descriptor to retrieve.\r
404 @param EndpointDescriptor A pointer to the caller allocated USB Endpoint Descriptor of\r
e3c6b3d9 405 a USB controller.\r
406\r
d1f95000 407 @retval EFI_SUCCESS The endpoint descriptor was retrieved successfully.\r
408 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
409 @retval EFI_NOT_FOUND The endpoint descriptor cannot be found. The device may not be\r
e3c6b3d9 410 correctly configured.\r
411\r
d1f95000 412**/\r
413typedef\r
414EFI_STATUS\r
8b13229b 415(EFIAPI *EFI_USB_IO_GET_ENDPOINT_DESCRIPTOR)(\r
d1f95000 416 IN EFI_USB_IO_PROTOCOL *This,\r
417 IN UINT8 EndpointIndex,\r
418 OUT EFI_USB_ENDPOINT_DESCRIPTOR *EndpointDescriptor\r
419 );\r
420\r
e3c6b3d9 421/**\r
fbf926ad 422 Retrieves a string stored in a USB Device.\r
e3c6b3d9 423\r
424 @param This A pointer to the EFI_USB_IO_PROTOCOL instance.\r
d1f95000 425 @param LangID The Language ID for the string being retrieved.\r
e3c6b3d9 426 @param StringID The ID of the string being retrieved.\r
427 @param String A pointer to a buffer allocated by this function with\r
9095d37b
LG
428 AllocatePool() to store the string.If this function\r
429 returns EFI_SUCCESS, it stores the string the caller\r
430 wants to get. The caller should release the string\r
8377875b 431 buffer with FreePool() after the string is not used any more.\r
e3c6b3d9 432\r
433 @retval EFI_SUCCESS The string was retrieved successfully.\r
434 @retval EFI_NOT_FOUND The string specified by LangID and StringID was not found.\r
d1f95000 435 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate the return buffer String.\r
e3c6b3d9 436\r
d1f95000 437**/\r
438typedef\r
439EFI_STATUS\r
8b13229b 440(EFIAPI *EFI_USB_IO_GET_STRING_DESCRIPTOR)(\r
d1f95000 441 IN EFI_USB_IO_PROTOCOL *This,\r
442 IN UINT16 LangID,\r
443 IN UINT8 StringID,\r
444 OUT CHAR16 **String\r
445 );\r
446\r
e3c6b3d9 447/**\r
d1f95000 448 Retrieves all the language ID codes that the USB device supports.\r
e3c6b3d9 449\r
450 @param This A pointer to the EFI_USB_IO_PROTOCOL instance.\r
d1f95000 451 @param LangIDTable Language ID for the string the caller wants to get.\r
9095d37b
LG
452 This is a 16-bit ID defined by Microsoft. This\r
453 buffer pointer is allocated and maintained by\r
454 the USB Bus Driver, the caller should not modify\r
8377875b 455 its contents.\r
d1f95000 456 @param TableSize The size, in bytes, of the table LangIDTable.\r
e3c6b3d9 457\r
458 @retval EFI_SUCCESS The support languages were retrieved successfully.\r
459\r
d1f95000 460**/\r
461typedef\r
462EFI_STATUS\r
8b13229b 463(EFIAPI *EFI_USB_IO_GET_SUPPORTED_LANGUAGE)(\r
d1f95000 464 IN EFI_USB_IO_PROTOCOL *This,\r
465 OUT UINT16 **LangIDTable,\r
466 OUT UINT16 *TableSize\r
467 );\r
468\r
44717a39 469///\r
9095d37b
LG
470/// The EFI_USB_IO_PROTOCOL provides four basic transfers types described\r
471/// in the USB 1.1 Specification. These include control transfer, interrupt\r
472/// transfer, bulk transfer and isochronous transfer. The EFI_USB_IO_PROTOCOL\r
473/// also provides some basic USB device/controller management and configuration\r
474/// interfaces. A USB device driver uses the services of this protocol to manage USB devices.\r
44717a39 475///\r
d1f95000 476struct _EFI_USB_IO_PROTOCOL {\r
477 //\r
478 // IO transfer\r
479 //\r
2f88bd3a
MK
480 EFI_USB_IO_CONTROL_TRANSFER UsbControlTransfer;\r
481 EFI_USB_IO_BULK_TRANSFER UsbBulkTransfer;\r
482 EFI_USB_IO_ASYNC_INTERRUPT_TRANSFER UsbAsyncInterruptTransfer;\r
483 EFI_USB_IO_SYNC_INTERRUPT_TRANSFER UsbSyncInterruptTransfer;\r
484 EFI_USB_IO_ISOCHRONOUS_TRANSFER UsbIsochronousTransfer;\r
485 EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER UsbAsyncIsochronousTransfer;\r
d1f95000 486\r
487 //\r
488 // Common device request\r
489 //\r
2f88bd3a
MK
490 EFI_USB_IO_GET_DEVICE_DESCRIPTOR UsbGetDeviceDescriptor;\r
491 EFI_USB_IO_GET_CONFIG_DESCRIPTOR UsbGetConfigDescriptor;\r
492 EFI_USB_IO_GET_INTERFACE_DESCRIPTOR UsbGetInterfaceDescriptor;\r
493 EFI_USB_IO_GET_ENDPOINT_DESCRIPTOR UsbGetEndpointDescriptor;\r
494 EFI_USB_IO_GET_STRING_DESCRIPTOR UsbGetStringDescriptor;\r
495 EFI_USB_IO_GET_SUPPORTED_LANGUAGE UsbGetSupportedLanguages;\r
d1f95000 496\r
497 //\r
498 // Reset controller's parent port\r
499 //\r
2f88bd3a 500 EFI_USB_IO_PORT_RESET UsbPortReset;\r
d1f95000 501};\r
502\r
2f88bd3a 503extern EFI_GUID gEfiUsbIoProtocolGuid;\r
d1f95000 504\r
505#endif\r