]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | EFI_USB2_HC_PROTOCOL as defined in UEFI 2.0.\r | |
3 | The USB Host Controller Protocol is used by code, typically USB bus drivers, \r | |
4 | running in the EFI boot services environment, to perform data transactions over \r | |
5 | a USB bus. In addition, it provides an abstraction for the root hub of the USB bus.\r | |
6 | \r | |
7 | Copyright (c) 2006 - 2008, Intel Corporation\r | |
8 | All rights reserved. This program and the accompanying materials\r | |
9 | are licensed and made available under the terms and conditions of the BSD License\r | |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef _USB2_HOSTCONTROLLER_H_\r | |
19 | #define _USB2_HOSTCONTROLLER_H_\r | |
20 | \r | |
21 | #include <IndustryStandard/Usb.h>\r | |
22 | #include <Protocol/UsbIo.h>\r | |
23 | \r | |
24 | #define EFI_USB2_HC_PROTOCOL_GUID \\r | |
25 | { \\r | |
26 | 0x3e745226, 0x9818, 0x45b6, {0xa2, 0xac, 0xd7, 0xcd, 0xe, 0x8b, 0xa2, 0xbc } \\r | |
27 | }\r | |
28 | \r | |
29 | ///\r | |
30 | /// Forward reference for pure ANSI compatability\r | |
31 | ///\r | |
32 | typedef struct _EFI_USB2_HC_PROTOCOL EFI_USB2_HC_PROTOCOL;\r | |
33 | \r | |
34 | \r | |
35 | typedef struct {\r | |
36 | UINT16 PortStatus;\r | |
37 | UINT16 PortChangeStatus;\r | |
38 | } EFI_USB_PORT_STATUS;\r | |
39 | \r | |
40 | //\r | |
41 | // Constant value for Port Status & Port Change Status\r | |
42 | //\r | |
43 | #define USB_PORT_STAT_CONNECTION 0x0001\r | |
44 | #define USB_PORT_STAT_ENABLE 0x0002\r | |
45 | #define USB_PORT_STAT_SUSPEND 0x0004\r | |
46 | #define USB_PORT_STAT_OVERCURRENT 0x0008\r | |
47 | #define USB_PORT_STAT_RESET 0x0010\r | |
48 | #define USB_PORT_STAT_POWER 0x0100\r | |
49 | #define USB_PORT_STAT_LOW_SPEED 0x0200\r | |
50 | #define USB_PORT_STAT_HIGH_SPEED 0x0400\r | |
51 | #define USB_PORT_STAT_OWNER 0x0800\r | |
52 | \r | |
53 | #define USB_PORT_STAT_C_CONNECTION 0x0001\r | |
54 | #define USB_PORT_STAT_C_ENABLE 0x0002\r | |
55 | #define USB_PORT_STAT_C_SUSPEND 0x0004\r | |
56 | #define USB_PORT_STAT_C_OVERCURRENT 0x0008\r | |
57 | #define USB_PORT_STAT_C_RESET 0x0010\r | |
58 | \r | |
59 | \r | |
60 | //\r | |
61 | // Usb port features\r | |
62 | //\r | |
63 | typedef enum {\r | |
64 | EfiUsbPortEnable = 1,\r | |
65 | EfiUsbPortSuspend = 2,\r | |
66 | EfiUsbPortReset = 4,\r | |
67 | EfiUsbPortPower = 8,\r | |
68 | EfiUsbPortOwner = 13,\r | |
69 | EfiUsbPortConnectChange = 16,\r | |
70 | EfiUsbPortEnableChange = 17,\r | |
71 | EfiUsbPortSuspendChange = 18,\r | |
72 | EfiUsbPortOverCurrentChange = 19,\r | |
73 | EfiUsbPortResetChange = 20\r | |
74 | } EFI_USB_PORT_FEATURE;\r | |
75 | \r | |
76 | \r | |
77 | #define EFI_USB_SPEED_FULL 0x0000 // 12 Mb/s, USB 1.1 OHCI and UHCI HC.\r | |
78 | #define EFI_USB_SPEED_LOW 0x0001 // 1 Mb/s, USB 1.1 OHCI and UHCI HC.\r | |
79 | #define EFI_USB_SPEED_HIGH 0x0002 // 480 Mb/s, USB 2.0 EHCI HC.\r | |
80 | \r | |
81 | typedef struct {\r | |
82 | UINT8 TranslatorHubAddress;\r | |
83 | UINT8 TranslatorPortNumber;\r | |
84 | } EFI_USB2_HC_TRANSACTION_TRANSLATOR;\r | |
85 | \r | |
86 | //\r | |
87 | // Protocol definitions\r | |
88 | //\r | |
89 | \r | |
90 | /**\r | |
91 | Retrieves the Host Controller capabilities.\r | |
92 | \r | |
93 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
94 | @param MaxSpeed Host controller data transfer speed.\r | |
95 | @param PortNumber Number of the root hub ports.\r | |
96 | @param Is64BitCapable TRUE if controller supports 64-bit memory addressing,\r | |
97 | FALSE otherwise.\r | |
98 | \r | |
99 | @retval EFI_SUCCESS The host controller capabilities were retrieved successfully.\r | |
100 | @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r | |
101 | @retval EFI_DEVICE_ERROR An error was encountered while attempting to\r | |
102 | retrieve the capabilities.\r | |
103 | \r | |
104 | **/\r | |
105 | typedef\r | |
106 | EFI_STATUS\r | |
107 | (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_CAPABILITY)(\r | |
108 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
109 | OUT UINT8 *MaxSpeed,\r | |
110 | OUT UINT8 *PortNumber,\r | |
111 | OUT UINT8 *Is64BitCapable\r | |
112 | );\r | |
113 | \r | |
114 | #define EFI_USB_HC_RESET_GLOBAL 0x0001\r | |
115 | #define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002\r | |
116 | #define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004\r | |
117 | #define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008\r | |
118 | /**\r | |
119 | Provides software reset for the USB host controller.\r | |
120 | \r | |
121 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
122 | @param Attributes A bit mask of the reset operation to perform.\r | |
123 | \r | |
124 | @retval EFI_SUCCESS The reset operation succeeded.\r | |
125 | @retval EFI_INVALID_PARAMETER Attributes is not valid.\r | |
126 | @retval EFI_UNSUPPORTED The type of reset specified by Attributes is not currently\r | |
127 | supported by the host controller hardware.\r | |
128 | @retval EFI_ACCESS_DENIED Reset operation is rejected due to the debug port being configured\r | |
129 | and active; only EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG or\r | |
130 | EFI_USB_HC_RESET_HOST_WITH_DEBUG reset Attributes can be used to\r | |
131 | perform reset operation for this host controller.\r | |
132 | @retval EFI_DEVICE_ERROR An error was encountered while attempting to\r | |
133 | retrieve the capabilities.\r | |
134 | \r | |
135 | **/\r | |
136 | typedef\r | |
137 | EFI_STATUS\r | |
138 | (EFIAPI *EFI_USB2_HC_PROTOCOL_RESET)(\r | |
139 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
140 | IN UINT16 Attributes\r | |
141 | );\r | |
142 | \r | |
143 | /**\r | |
144 | Enumration value for status of USB HC.\r | |
145 | **/\r | |
146 | typedef enum {\r | |
147 | EfiUsbHcStateHalt, ///< The host controller is in halt\r | |
148 | ///< state. No USB transactions can occur\r | |
149 | ///< while in this state. The host\r | |
150 | ///< controller can enter this state for\r | |
151 | ///< three reasons: 1) After host\r | |
152 | ///< controller hardware reset. 2)\r | |
153 | ///< Explicitly set by software. 3)\r | |
154 | ///< Triggered by a fatal error such as\r | |
155 | ///< consistency check failure.\r | |
156 | \r | |
157 | EfiUsbHcStateOperational, ///< The host controller is in an\r | |
158 | ///< operational state. When in\r | |
159 | ///< this state, the host\r | |
160 | ///< controller can execute bus\r | |
161 | ///< traffic. This state must be\r | |
162 | ///< explicitly set to enable the\r | |
163 | ///< USB bus traffic.\r | |
164 | \r | |
165 | EfiUsbHcStateSuspend, ///< The host controller is in the\r | |
166 | ///< suspend state. No USB\r | |
167 | ///< transactions can occur while in\r | |
168 | ///< this state. The host controller\r | |
169 | ///< enters this state for the\r | |
170 | ///< following reasons: 1) Explicitly\r | |
171 | ///< set by software. 2) Triggered\r | |
172 | ///< when there is no bus traffic for\r | |
173 | ///< 3 microseconds.\r | |
174 | \r | |
175 | EfiUsbHcStateMaximum ///< Maximum value for enumration value of HC status.\r | |
176 | } EFI_USB_HC_STATE;\r | |
177 | \r | |
178 | /**\r | |
179 | Retrieves current state of the USB host controller.\r | |
180 | \r | |
181 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
182 | @param State A pointer to the EFI_USB_HC_STATE data structure that\r | |
183 | indicates current state of the USB host controller.\r | |
184 | \r | |
185 | @retval EFI_SUCCESS The state information of the host controller was returned in State.\r | |
186 | @retval EFI_INVALID_PARAMETER State is NULL.\r | |
187 | @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the\r | |
188 | host controller's current state.\r | |
189 | \r | |
190 | **/\r | |
191 | typedef\r | |
192 | EFI_STATUS\r | |
193 | (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE)(\r | |
194 | IN CONST EFI_USB2_HC_PROTOCOL *This,\r | |
195 | OUT EFI_USB_HC_STATE *State\r | |
196 | );\r | |
197 | \r | |
198 | /**\r | |
199 | Sets the USB host controller to a specific state.\r | |
200 | \r | |
201 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
202 | @param State Indicates the state of the host controller that will be set.\r | |
203 | \r | |
204 | @retval EFI_SUCCESS The USB host controller was successfully placed in the state\r | |
205 | specified by State.\r | |
206 | @retval EFI_INVALID_PARAMETER State is not valid.\r | |
207 | @retval EFI_DEVICE_ERROR Failed to set the state specified by State due to device error.\r | |
208 | \r | |
209 | **/\r | |
210 | typedef\r | |
211 | EFI_STATUS\r | |
212 | (EFIAPI *EFI_USB2_HC_PROTOCOL_SET_STATE)(\r | |
213 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
214 | IN EFI_USB_HC_STATE State\r | |
215 | );\r | |
216 | \r | |
217 | /**\r | |
218 | Submits control transfer to a target USB device.\r | |
219 | \r | |
220 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
221 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
222 | @param DeviceSpeed Indicates device speed.\r | |
223 | @param MaximumPacketLength Indicates the maximum packet size that the default control transfer\r | |
224 | endpoint is capable of sending or receiving.\r | |
225 | @param Request A pointer to the USB device request that will be sent to the USB device.\r | |
226 | @param TransferDirection Specifies the data direction for the transfer. There are three values\r | |
227 | available, EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.\r | |
228 | @param Data A pointer to the buffer of data that will be transmitted to USB device or\r | |
229 | received from USB device.\r | |
230 | @param DataLength On input, indicates the size, in bytes, of the data buffer specified by Data.\r | |
231 | On output, indicates the amount of data actually transferred.\r | |
232 | @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is\r | |
233 | allowed to complete.\r | |
234 | @param Translator A pointer to the transaction translator data.\r | |
235 | @param TransferResult A pointer to the detailed result information generated by this control\r | |
236 | transfer.\r | |
237 | \r | |
238 | @retval EFI_SUCCESS The control transfer was completed successfully.\r | |
239 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
240 | @retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources.\r | |
241 | @retval EFI_TIMEOUT The control transfer failed due to timeout.\r | |
242 | @retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.\r | |
243 | Caller should check TransferResult for detailed error information.\r | |
244 | \r | |
245 | **/\r | |
246 | typedef\r | |
247 | EFI_STATUS\r | |
248 | (EFIAPI *EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER)(\r | |
249 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
250 | IN UINT8 DeviceAddress,\r | |
251 | IN UINT8 DeviceSpeed,\r | |
252 | IN UINTN MaximumPacketLength,\r | |
253 | IN EFI_USB_DEVICE_REQUEST *Request,\r | |
254 | IN EFI_USB_DATA_DIRECTION TransferDirection,\r | |
255 | IN OUT VOID *Data OPTIONAL,\r | |
256 | IN OUT UINTN *DataLength OPTIONAL,\r | |
257 | IN UINTN TimeOut,\r | |
258 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
259 | OUT UINT32 *TransferResult\r | |
260 | );\r | |
261 | \r | |
262 | #define EFI_USB_MAX_BULK_BUFFER_NUM 10\r | |
263 | \r | |
264 | /**\r | |
265 | Submits bulk transfer to a bulk endpoint of a USB device.\r | |
266 | \r | |
267 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
268 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
269 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
270 | target USB device.\r | |
271 | @param DeviceSpeed Indicates device speed.\r | |
272 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
273 | sending or receiving.\r | |
274 | @param DataBuffersNumber Number of data buffers prepared for the transfer.\r | |
275 | @param Data Array of pointers to the buffers of data that will be transmitted to USB\r | |
276 | device or received from USB device.\r | |
277 | @param DataLength When input, indicates the size, in bytes, of the data buffers specified by\r | |
278 | Data. When output, indicates the actually transferred data size.\r | |
279 | @param DataToggle A pointer to the data toggle value.\r | |
280 | @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is\r | |
281 | allowed to complete.\r | |
282 | @param Translator A pointer to the transaction translator data.\r | |
283 | @param TransferResult A pointer to the detailed result information of the bulk transfer.\r | |
284 | \r | |
285 | @retval EFI_SUCCESS The bulk transfer was completed successfully.\r | |
286 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
287 | @retval EFI_OUT_OF_RESOURCES The bulk transfer could not be submitted due to a lack of resources.\r | |
288 | @retval EFI_TIMEOUT The bulk transfer failed due to timeout.\r | |
289 | @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.\r | |
290 | Caller should check TransferResult for detailed error information.\r | |
291 | \r | |
292 | **/\r | |
293 | typedef\r | |
294 | EFI_STATUS\r | |
295 | (EFIAPI *EFI_USB2_HC_PROTOCOL_BULK_TRANSFER)(\r | |
296 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
297 | IN UINT8 DeviceAddress,\r | |
298 | IN UINT8 EndPointAddress,\r | |
299 | IN UINT8 DeviceSpeed,\r | |
300 | IN UINTN MaximumPacketLength,\r | |
301 | IN UINT8 DataBuffersNumber,\r | |
302 | IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM],\r | |
303 | IN OUT UINTN *DataLength,\r | |
304 | IN OUT UINT8 *DataToggle,\r | |
305 | IN UINTN TimeOut,\r | |
306 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
307 | OUT UINT32 *TransferResult\r | |
308 | );\r | |
309 | \r | |
310 | /**\r | |
311 | Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.\r | |
312 | Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.\r | |
313 | \r | |
314 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
315 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
316 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
317 | target USB device.\r | |
318 | @param DeviceSpeed Indicates device speed.\r | |
319 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
320 | sending or receiving.\r | |
321 | @param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between the host and the\r | |
322 | target interrupt endpoint. If FALSE, the specified asynchronous interrupt\r | |
323 | pipe is canceled. If TRUE, and an interrupt transfer exists for the target\r | |
324 | end point, then EFI_INVALID_PARAMETER is returned.\r | |
325 | @param DataToggle A pointer to the data toggle value.\r | |
326 | @param PollingInterval Indicates the interval, in milliseconds, that the asynchronous interrupt\r | |
327 | transfer is polled.\r | |
328 | @param DataLength Indicates the length of data to be received at the rate specified by\r | |
329 | PollingInterval from the target asynchronous interrupt endpoint.\r | |
330 | @param Translator A pointr to the transaction translator data.\r | |
331 | @param CallBackFunction The Callback function. This function is called at the rate specified by\r | |
332 | PollingInterval.\r | |
333 | @param Context The context that is passed to the CallBackFunction. This is an\r | |
334 | optional parameter and may be NULL.\r | |
335 | \r | |
336 | @retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully\r | |
337 | submitted or canceled.\r | |
338 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
339 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
340 | \r | |
341 | **/\r | |
342 | typedef\r | |
343 | EFI_STATUS\r | |
344 | (EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER)(\r | |
345 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
346 | IN UINT8 DeviceAddress,\r | |
347 | IN UINT8 EndPointAddress,\r | |
348 | IN UINT8 DeviceSpeed,\r | |
349 | IN UINTN MaxiumPacketLength,\r | |
350 | IN BOOLEAN IsNewTransfer,\r | |
351 | IN OUT UINT8 *DataToggle,\r | |
352 | IN UINTN PollingInterval OPTIONAL,\r | |
353 | IN UINTN DataLength OPTIONAL,\r | |
354 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator OPTIONAL,\r | |
355 | IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,\r | |
356 | IN VOID *Context OPTIONAL\r | |
357 | );\r | |
358 | \r | |
359 | /**\r | |
360 | Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.\r | |
361 | Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.\r | |
362 | \r | |
363 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
364 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
365 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
366 | target USB device.\r | |
367 | @param DeviceSpeed Indicates device speed.\r | |
368 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
369 | sending or receiving.\r | |
370 | @param Data A pointer to the buffer of data that will be transmitted to USB device or\r | |
371 | received from USB device.\r | |
372 | @param DataLength On input, the size, in bytes, of the data buffer specified by Data. On\r | |
373 | output, the number of bytes transferred.\r | |
374 | @param DataToggle A pointer to the data toggle value.\r | |
375 | @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is\r | |
376 | allowed to complete.\r | |
377 | @param Translator A pointr to the transaction translator data.\r | |
378 | @param TransferResult A pointer to the detailed result information from the synchronous\r | |
379 | interrupt transfer.\r | |
380 | \r | |
381 | @retval EFI_SUCCESS The synchronous interrupt transfer was completed successfully.\r | |
382 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
383 | @retval EFI_OUT_OF_RESOURCES The synchronous interrupt transfer could not be submitted due to a lack of resources.\r | |
384 | @retval EFI_TIMEOUT The synchronous interrupt transfer failed due to timeout.\r | |
385 | @retval EFI_DEVICE_ERROR The synchronous interrupt transfer failed due to host controller or device error.\r | |
386 | Caller should check TransferResult for detailed error information.\r | |
387 | \r | |
388 | **/\r | |
389 | typedef\r | |
390 | EFI_STATUS\r | |
391 | (EFIAPI *EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER)(\r | |
392 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
393 | IN UINT8 DeviceAddress,\r | |
394 | IN UINT8 EndPointAddress,\r | |
395 | IN UINT8 DeviceSpeed,\r | |
396 | IN UINTN MaximumPacketLength,\r | |
397 | IN OUT VOID *Data,\r | |
398 | IN OUT UINTN *DataLength,\r | |
399 | IN OUT UINT8 *DataToggle,\r | |
400 | IN UINTN TimeOut,\r | |
401 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
402 | OUT UINT32 *TransferResult\r | |
403 | );\r | |
404 | \r | |
405 | #define EFI_USB_MAX_ISO_BUFFER_NUM 7\r | |
406 | #define EFI_USB_MAX_ISO_BUFFER_NUM1 2\r | |
407 | \r | |
408 | /**\r | |
409 | Submits isochronous transfer to an isochronous endpoint of a USB device.\r | |
410 | \r | |
411 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
412 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
413 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
414 | target USB device.\r | |
415 | @param DeviceSpeed Indicates device speed.\r | |
416 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
417 | sending or receiving.\r | |
418 | @param DataBuffersNumber Number of data buffers prepared for the transfer.\r | |
419 | @param Data Array of pointers to the buffers of data that will be transmitted to USB\r | |
420 | device or received from USB device.\r | |
421 | @param DataLength Specifies the length, in bytes, of the data to be sent to or received from\r | |
422 | the USB device.\r | |
423 | @param Translator A pointer to the transaction translator data.\r | |
424 | @param TransferResult A pointer to the detailed result information of the isochronous transfer.\r | |
425 | \r | |
426 | @retval EFI_SUCCESS The isochronous transfer was completed successfully.\r | |
427 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
428 | @retval EFI_OUT_OF_RESOURCES The isochronous transfer could not be submitted due to a lack of resources.\r | |
429 | @retval EFI_TIMEOUT The isochronous transfer cannot be completed within the one USB frame time.\r | |
430 | @retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.\r | |
431 | Caller should check TransferResult for detailed error information.\r | |
432 | \r | |
433 | **/\r | |
434 | typedef\r | |
435 | EFI_STATUS\r | |
436 | (EFIAPI *EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER)(\r | |
437 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
438 | IN UINT8 DeviceAddress,\r | |
439 | IN UINT8 EndPointAddress,\r | |
440 | IN UINT8 DeviceSpeed,\r | |
441 | IN UINTN MaximumPacketLength,\r | |
442 | IN UINT8 DataBuffersNumber,\r | |
443 | IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r | |
444 | IN UINTN DataLength,\r | |
445 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
446 | OUT UINT32 *TransferResult\r | |
447 | );\r | |
448 | \r | |
449 | /**\r | |
450 | Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.\r | |
451 | \r | |
452 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
453 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
454 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
455 | target USB device.\r | |
456 | @param DeviceSpeed Indicates device speed.\r | |
457 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
458 | sending or receiving.\r | |
459 | @param DataBuffersNumber Number of data buffers prepared for the transfer.\r | |
460 | @param Data Array of pointers to the buffers of data that will be transmitted to USB\r | |
461 | device or received from USB device.\r | |
462 | @param DataLength Specifies the length, in bytes, of the data to be sent to or received from\r | |
463 | the USB device.\r | |
464 | @param Translator A pointer to the transaction translator data.\r | |
465 | @param IsochronousCallback The Callback function. This function is called if the requested\r | |
466 | isochronous transfer is completed.\r | |
467 | @param Context Data passed to the IsochronousCallback function. This is an\r | |
468 | optional parameter and may be NULL.\r | |
469 | \r | |
470 | @retval EFI_SUCCESS The asynchronous isochronous transfer request has been successfully\r | |
471 | submitted or canceled.\r | |
472 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
473 | @retval EFI_OUT_OF_RESOURCES The asynchronous isochronous transfer could not be submitted due to\r | |
474 | a lack of resources.\r | |
475 | \r | |
476 | **/\r | |
477 | typedef\r | |
478 | EFI_STATUS\r | |
479 | (EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER)(\r | |
480 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
481 | IN UINT8 DeviceAddress,\r | |
482 | IN UINT8 EndPointAddress,\r | |
483 | IN UINT8 DeviceSpeed,\r | |
484 | IN UINTN MaximumPacketLength,\r | |
485 | IN UINT8 DataBuffersNumber,\r | |
486 | IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r | |
487 | IN UINTN DataLength,\r | |
488 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
489 | IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,\r | |
490 | IN VOID *Context OPTIONAL\r | |
491 | );\r | |
492 | \r | |
493 | /**\r | |
494 | Retrieves the current status of a USB root hub port.\r | |
495 | \r | |
496 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
497 | @param PortNumber Specifies the root hub port from which the status is to be retrieved.\r | |
498 | This value is zero based.\r | |
499 | @param PortStatus A pointer to the current port status bits and port status change bits.\r | |
500 | \r | |
501 | @retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber\r | |
502 | was returned in PortStatus.\r | |
503 | @retval EFI_INVALID_PARAMETER PortNumber is invalid.\r | |
504 | \r | |
505 | **/\r | |
506 | typedef\r | |
507 | EFI_STATUS\r | |
508 | (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS)(\r | |
509 | IN CONST EFI_USB2_HC_PROTOCOL *This,\r | |
510 | IN CONST UINT8 PortNumber,\r | |
511 | OUT EFI_USB_PORT_STATUS *PortStatus\r | |
512 | );\r | |
513 | \r | |
514 | /**\r | |
515 | Sets a feature for the specified root hub port.\r | |
516 | \r | |
517 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
518 | @param PortNumber Specifies the root hub port whose feature is requested to be set. This\r | |
519 | value is zero based.\r | |
520 | @param PortFeature Indicates the feature selector associated with the feature set request.\r | |
521 | \r | |
522 | @retval EFI_SUCCESS The feature specified by PortFeature was set for the USB\r | |
523 | root hub port specified by PortNumber.\r | |
524 | @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.\r | |
525 | \r | |
526 | **/\r | |
527 | typedef\r | |
528 | EFI_STATUS\r | |
529 | (EFIAPI *EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE)(\r | |
530 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
531 | IN UINT8 PortNumber,\r | |
532 | IN EFI_USB_PORT_FEATURE PortFeature\r | |
533 | );\r | |
534 | \r | |
535 | /**\r | |
536 | Clears a feature for the specified root hub port.\r | |
537 | \r | |
538 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
539 | @param PortNumber Specifies the root hub port whose feature is requested to be cleared. This\r | |
540 | value is zero based.\r | |
541 | @param PortFeature Indicates the feature selector associated with the feature clear request.\r | |
542 | \r | |
543 | @retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB\r | |
544 | root hub port specified by PortNumber.\r | |
545 | @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.\r | |
546 | \r | |
547 | **/\r | |
548 | typedef\r | |
549 | EFI_STATUS\r | |
550 | (EFIAPI *EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE)(\r | |
551 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
552 | IN UINT8 PortNumber,\r | |
553 | IN EFI_USB_PORT_FEATURE PortFeature\r | |
554 | );\r | |
555 | \r | |
556 | ///\r | |
557 | /// The EFI_USB2_HC_PROTOCOL provides USB host controller management, basic \r | |
558 | /// data transactions over a USB bus, and USB root hub access. A device driver \r | |
559 | /// that wishes to manage a USB bus in a system retrieves the EFI_USB2_HC_PROTOCOL \r | |
560 | /// instance that is associated with the USB bus to be managed. A device handle \r | |
561 | /// for a USB host controller will minimally contain an EFI_DEVICE_PATH_PROTOCOL \r | |
562 | /// instance, and an EFI_USB2_HC_PROTOCOL instance.\r | |
563 | ///\r | |
564 | struct _EFI_USB2_HC_PROTOCOL {\r | |
565 | EFI_USB2_HC_PROTOCOL_GET_CAPABILITY GetCapability;\r | |
566 | EFI_USB2_HC_PROTOCOL_RESET Reset;\r | |
567 | EFI_USB2_HC_PROTOCOL_GET_STATE GetState;\r | |
568 | EFI_USB2_HC_PROTOCOL_SET_STATE SetState;\r | |
569 | EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer;\r | |
570 | EFI_USB2_HC_PROTOCOL_BULK_TRANSFER BulkTransfer;\r | |
571 | EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer;\r | |
572 | EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer;\r | |
573 | EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer;\r | |
574 | EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer;\r | |
575 | EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;\r | |
576 | EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;\r | |
577 | EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature;\r | |
578 | \r | |
579 | ///\r | |
580 | /// The major revision number of the USB host controller. The revision information \r | |
581 | /// indicates the release of the Universal Serial Bus Specification with which the \r | |
582 | /// host controller is compliant.\r | |
583 | ///\r | |
584 | UINT16 MajorRevision;\r | |
585 | \r | |
586 | ///\r | |
587 | /// The minor revision number of the USB host controller. The revision information \r | |
588 | /// indicates the release of the Universal Serial Bus Specification with which the \r | |
589 | /// host controller is compliant. \r | |
590 | ///\r | |
591 | UINT16 MinorRevision;\r | |
592 | };\r | |
593 | \r | |
594 | extern EFI_GUID gEfiUsb2HcProtocolGuid;\r | |
595 | \r | |
596 | #endif\r |