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