]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
2 | EFI_USB2_HC_PROTOCOL as defined in UEFI 2.0.\r | |
4ca9b6c4 LG |
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 | |
d1f95000 | 6 | \r |
1a09f6f6 | 7 | Copyright (c) 2006 - 2008, Intel Corporation\r |
20b1aab6 | 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 | |
d1f95000 | 12 | \r |
20b1aab6 | 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 | |
d1f95000 | 15 | \r |
d1f95000 | 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 | |
e3c6b3d9 | 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 | |
d1f95000 | 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 | |
8b13229b | 107 | (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_CAPABILITY)(\r |
d1f95000 | 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 | \r | |
20b1aab6 | 115 | #define EFI_USB_HC_RESET_GLOBAL 0x0001\r |
116 | #define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002\r | |
117 | #define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004\r | |
118 | #define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008\r | |
d1f95000 | 119 | /**\r |
120 | Provides software reset for the USB host controller.\r | |
121 | \r | |
122 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
123 | @param Attributes A bit mask of the reset operation to perform.\r | |
124 | \r | |
125 | @retval EFI_SUCCESS The reset operation succeeded.\r | |
126 | @retval EFI_INVALID_PARAMETER Attributes is not valid.\r | |
127 | @retval EFI_UNSUPPORTED The type of reset specified by Attributes is not currently\r | |
128 | supported by the host controller hardware.\r | |
129 | @retval EFI_ACCESS_DENIED Reset operation is rejected due to the debug port being configured\r | |
130 | and active; only EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG or\r | |
131 | EFI_USB_HC_RESET_HOST_WITH_DEBUG reset Attributes can be used to\r | |
132 | perform reset operation for this host controller.\r | |
133 | @retval EFI_DEVICE_ERROR An error was encountered while attempting to\r | |
134 | retrieve the capabilities.\r | |
135 | \r | |
136 | **/\r | |
137 | typedef\r | |
138 | EFI_STATUS\r | |
8b13229b | 139 | (EFIAPI *EFI_USB2_HC_PROTOCOL_RESET)(\r |
d1f95000 | 140 | IN EFI_USB2_HC_PROTOCOL *This,\r |
141 | IN UINT16 Attributes\r | |
142 | )\r | |
143 | ;\r | |
144 | \r | |
145 | /**\r | |
20b1aab6 | 146 | \r |
4ca9b6c4 LG |
147 | @param 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 | |
20b1aab6 | 156 | \r |
157 | \r | |
d1f95000 | 158 | @param EfiUsbHcStateOperational The host controller is in an\r |
159 | operational state. When in\r | |
160 | this state, the host\r | |
161 | controller can execute bus\r | |
162 | traffic. This state must be\r | |
163 | explicitly set to enable the\r | |
164 | USB bus traffic.\r | |
20b1aab6 | 165 | \r |
166 | \r | |
4ca9b6c4 LG |
167 | @param EfiUsbHcStateSuspend The host controller is in the\r |
168 | suspend state. No USB\r | |
169 | transactions can occur while in\r | |
170 | this state. The host controller\r | |
171 | enters this state for the\r | |
172 | following reasons: 1) Explicitly\r | |
173 | set by software. 2) Triggered\r | |
174 | when there is no bus traffic for\r | |
175 | 3 microseconds.\r | |
20b1aab6 | 176 | \r |
d1f95000 | 177 | **/\r |
178 | typedef enum {\r | |
179 | EfiUsbHcStateHalt,\r | |
180 | EfiUsbHcStateOperational,\r | |
181 | EfiUsbHcStateSuspend,\r | |
182 | EfiUsbHcStateMaximum\r | |
183 | } EFI_USB_HC_STATE;\r | |
184 | \r | |
185 | /**\r | |
186 | Retrieves current state of the USB host controller.\r | |
187 | \r | |
188 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
189 | @param State A pointer to the EFI_USB_HC_STATE data structure that\r | |
190 | indicates current state of the USB host controller.\r | |
191 | \r | |
192 | @retval EFI_SUCCESS The state information of the host controller was returned in State.\r | |
193 | @retval EFI_INVALID_PARAMETER State is NULL.\r | |
194 | @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the\r | |
195 | host controller's current state.\r | |
196 | \r | |
197 | **/\r | |
198 | typedef\r | |
199 | EFI_STATUS\r | |
8b13229b | 200 | (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE)(\r |
d1f95000 | 201 | IN CONST EFI_USB2_HC_PROTOCOL *This,\r |
202 | OUT EFI_USB_HC_STATE *State\r | |
203 | )\r | |
20b1aab6 | 204 | ;\r |
d1f95000 | 205 | \r |
206 | /**\r | |
207 | Sets the USB host controller to a specific state.\r | |
208 | \r | |
209 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
210 | @param State Indicates the state of the host controller that will be set.\r | |
211 | \r | |
212 | @retval EFI_SUCCESS The USB host controller was successfully placed in the state\r | |
213 | specified by State.\r | |
214 | @retval EFI_INVALID_PARAMETER State is not valid.\r | |
215 | @retval EFI_DEVICE_ERROR Failed to set the state specified by State due to device error.\r | |
216 | \r | |
217 | **/\r | |
218 | typedef\r | |
219 | EFI_STATUS\r | |
8b13229b | 220 | (EFIAPI *EFI_USB2_HC_PROTOCOL_SET_STATE)(\r |
d1f95000 | 221 | IN EFI_USB2_HC_PROTOCOL *This,\r |
222 | IN EFI_USB_HC_STATE State\r | |
223 | )\r | |
224 | ;\r | |
225 | \r | |
226 | /**\r | |
227 | Submits control transfer to a target USB device.\r | |
228 | \r | |
229 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
230 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
231 | @param DeviceSpeed Indicates device speed.\r | |
232 | @param MaximumPacketLength Indicates the maximum packet size that the default control transfer\r | |
233 | endpoint is capable of sending or receiving.\r | |
234 | @param Request A pointer to the USB device request that will be sent to the USB device.\r | |
235 | @param TransferDirection Specifies the data direction for the transfer. There are three values\r | |
236 | available, EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.\r | |
237 | @param Data A pointer to the buffer of data that will be transmitted to USB device or\r | |
238 | received from USB device.\r | |
239 | @param DataLength On input, indicates the size, in bytes, of the data buffer specified by Data.\r | |
240 | On output, indicates the amount of data actually transferred.\r | |
d1f95000 | 241 | @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is\r |
242 | allowed to complete.\r | |
4ca9b6c4 | 243 | @param Translator A pointer to the transaction translator data.\r |
d1f95000 | 244 | @param TransferResult A pointer to the detailed result information generated by this control\r |
245 | transfer.\r | |
246 | \r | |
247 | @retval EFI_SUCCESS The control transfer was completed successfully.\r | |
248 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
249 | @retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources.\r | |
250 | @retval EFI_TIMEOUT The control transfer failed due to timeout.\r | |
251 | @retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.\r | |
252 | Caller should check TransferResult for detailed error information.\r | |
253 | \r | |
254 | **/\r | |
255 | typedef\r | |
256 | EFI_STATUS\r | |
8b13229b | 257 | (EFIAPI *EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER)(\r |
d1f95000 | 258 | IN EFI_USB2_HC_PROTOCOL *This,\r |
259 | IN UINT8 DeviceAddress,\r | |
260 | IN UINT8 DeviceSpeed,\r | |
261 | IN UINTN MaximumPacketLength,\r | |
262 | IN EFI_USB_DEVICE_REQUEST *Request,\r | |
263 | IN EFI_USB_DATA_DIRECTION TransferDirection,\r | |
264 | IN OUT VOID *Data OPTIONAL,\r | |
265 | IN OUT UINTN *DataLength OPTIONAL,\r | |
266 | IN UINTN TimeOut,\r | |
267 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
268 | OUT UINT32 *TransferResult\r | |
269 | )\r | |
20b1aab6 | 270 | ;\r |
d1f95000 | 271 | \r |
272 | #define EFI_USB_MAX_BULK_BUFFER_NUM 10\r | |
273 | \r | |
274 | /**\r | |
275 | Submits bulk transfer to a bulk endpoint of a USB device.\r | |
276 | \r | |
277 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
278 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
279 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
280 | target USB device.\r | |
281 | @param DeviceSpeed Indicates device speed.\r | |
282 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
283 | sending or receiving.\r | |
284 | @param DataBuffersNumber Number of data buffers prepared for the transfer.\r | |
285 | @param Data Array of pointers to the buffers of data that will be transmitted to USB\r | |
286 | device or received from USB device.\r | |
287 | @param DataLength When input, indicates the size, in bytes, of the data buffers specified by\r | |
288 | Data. When output, indicates the actually transferred data size.\r | |
289 | @param DataToggle A pointer to the data toggle value.\r | |
d1f95000 | 290 | @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is\r |
291 | allowed to complete.\r | |
4ca9b6c4 | 292 | @param Translator A pointer to the transaction translator data.\r |
d1f95000 | 293 | @param TransferResult A pointer to the detailed result information of the bulk transfer.\r |
294 | \r | |
295 | @retval EFI_SUCCESS The bulk transfer was completed successfully.\r | |
296 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
297 | @retval EFI_OUT_OF_RESOURCES The bulk transfer could not be submitted due to a lack of resources.\r | |
298 | @retval EFI_TIMEOUT The bulk transfer failed due to timeout.\r | |
299 | @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.\r | |
300 | Caller should check TransferResult for detailed error information.\r | |
301 | \r | |
302 | **/\r | |
303 | typedef\r | |
304 | EFI_STATUS\r | |
8b13229b | 305 | (EFIAPI *EFI_USB2_HC_PROTOCOL_BULK_TRANSFER)(\r |
d1f95000 | 306 | IN EFI_USB2_HC_PROTOCOL *This,\r |
307 | IN UINT8 DeviceAddress,\r | |
308 | IN UINT8 EndPointAddress,\r | |
309 | IN UINT8 DeviceSpeed,\r | |
310 | IN UINTN MaximumPacketLength,\r | |
311 | IN UINT8 DataBuffersNumber,\r | |
312 | IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM],\r | |
313 | IN OUT UINTN *DataLength,\r | |
314 | IN OUT UINT8 *DataToggle,\r | |
315 | IN UINTN TimeOut,\r | |
316 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
317 | OUT UINT32 *TransferResult\r | |
318 | )\r | |
319 | ;\r | |
320 | \r | |
321 | /**\r | |
322 | Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.\r | |
323 | Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.\r | |
20b1aab6 | 324 | \r |
d1f95000 | 325 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r |
326 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
327 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
328 | target USB device.\r | |
329 | @param DeviceSpeed Indicates device speed.\r | |
330 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
331 | sending or receiving.\r | |
332 | @param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between the host and the\r | |
333 | target interrupt endpoint. If FALSE, the specified asynchronous interrupt\r | |
334 | pipe is canceled. If TRUE, and an interrupt transfer exists for the target\r | |
335 | end point, then EFI_INVALID_PARAMETER is returned.\r | |
336 | @param DataToggle A pointer to the data toggle value.\r | |
337 | @param PollingInterval Indicates the interval, in milliseconds, that the asynchronous interrupt\r | |
338 | transfer is polled.\r | |
339 | @param DataLength Indicates the length of data to be received at the rate specified by\r | |
340 | PollingInterval from the target asynchronous interrupt endpoint.\r | |
341 | @param Translator A pointr to the transaction translator data.\r | |
342 | @param CallBackFunction The Callback function. This function is called at the rate specified by\r | |
343 | PollingInterval.\r | |
344 | @param Context The context that is passed to the CallBackFunction. This is an\r | |
345 | optional parameter and may be NULL.\r | |
346 | \r | |
347 | @retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully\r | |
348 | submitted or canceled.\r | |
349 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
350 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
351 | \r | |
352 | **/\r | |
353 | typedef\r | |
354 | EFI_STATUS\r | |
8b13229b | 355 | (EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER)(\r |
d1f95000 | 356 | IN EFI_USB2_HC_PROTOCOL *This,\r |
357 | IN UINT8 DeviceAddress,\r | |
358 | IN UINT8 EndPointAddress,\r | |
359 | IN UINT8 DeviceSpeed,\r | |
360 | IN UINTN MaxiumPacketLength,\r | |
361 | IN BOOLEAN IsNewTransfer,\r | |
362 | IN OUT UINT8 *DataToggle,\r | |
363 | IN UINTN PollingInterval OPTIONAL,\r | |
364 | IN UINTN DataLength OPTIONAL,\r | |
365 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator OPTIONAL,\r | |
366 | IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,\r | |
367 | IN VOID *Context OPTIONAL\r | |
368 | )\r | |
369 | ;\r | |
370 | \r | |
371 | /**\r | |
372 | Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.\r | |
373 | Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.\r | |
374 | \r | |
375 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
376 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
377 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
378 | target USB device.\r | |
379 | @param DeviceSpeed Indicates device speed.\r | |
380 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
381 | sending or receiving.\r | |
382 | @param Data A pointer to the buffer of data that will be transmitted to USB device or\r | |
383 | received from USB device.\r | |
384 | @param DataLength On input, the size, in bytes, of the data buffer specified by Data. On\r | |
385 | output, the number of bytes transferred.\r | |
386 | @param DataToggle A pointer to the data toggle value.\r | |
387 | @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is\r | |
388 | allowed to complete.\r | |
389 | @param Translator A pointr to the transaction translator data.\r | |
390 | @param TransferResult A pointer to the detailed result information from the synchronous\r | |
391 | interrupt transfer.\r | |
392 | \r | |
393 | @retval EFI_SUCCESS The synchronous interrupt transfer was completed successfully.\r | |
394 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
395 | @retval EFI_OUT_OF_RESOURCES The synchronous interrupt transfer could not be submitted due to a lack of resources.\r | |
396 | @retval EFI_TIMEOUT The synchronous interrupt transfer failed due to timeout.\r | |
397 | @retval EFI_DEVICE_ERROR The synchronous interrupt transfer failed due to host controller or device error.\r | |
398 | Caller should check TransferResult for detailed error information.\r | |
399 | \r | |
400 | **/\r | |
401 | typedef\r | |
402 | EFI_STATUS\r | |
8b13229b | 403 | (EFIAPI *EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER)(\r |
d1f95000 | 404 | IN EFI_USB2_HC_PROTOCOL *This,\r |
405 | IN UINT8 DeviceAddress,\r | |
406 | IN UINT8 EndPointAddress,\r | |
407 | IN UINT8 DeviceSpeed,\r | |
408 | IN UINTN MaximumPacketLength,\r | |
409 | IN OUT VOID *Data,\r | |
410 | IN OUT UINTN *DataLength,\r | |
411 | IN OUT UINT8 *DataToggle,\r | |
412 | IN UINTN TimeOut,\r | |
413 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
414 | OUT UINT32 *TransferResult\r | |
415 | )\r | |
416 | ;\r | |
417 | \r | |
418 | #define EFI_USB_MAX_ISO_BUFFER_NUM 7\r | |
419 | #define EFI_USB_MAX_ISO_BUFFER_NUM1 2\r | |
420 | \r | |
421 | /**\r | |
422 | Submits isochronous transfer to an isochronous endpoint of a USB device.\r | |
423 | \r | |
424 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
425 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
426 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
427 | target USB device.\r | |
428 | @param DeviceSpeed Indicates device speed.\r | |
429 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
430 | sending or receiving.\r | |
431 | @param DataBuffersNumber Number of data buffers prepared for the transfer.\r | |
432 | @param Data Array of pointers to the buffers of data that will be transmitted to USB\r | |
433 | device or received from USB device.\r | |
434 | @param DataLength Specifies the length, in bytes, of the data to be sent to or received from\r | |
435 | the USB device.\r | |
436 | @param Translator A pointer to the transaction translator data.\r | |
437 | @param TransferResult A pointer to the detailed result information of the isochronous transfer.\r | |
438 | \r | |
439 | @retval EFI_SUCCESS The isochronous transfer was completed successfully.\r | |
440 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
441 | @retval EFI_OUT_OF_RESOURCES The isochronous transfer could not be submitted due to a lack of resources.\r | |
442 | @retval EFI_TIMEOUT The isochronous transfer cannot be completed within the one USB frame time.\r | |
443 | @retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.\r | |
444 | Caller should check TransferResult for detailed error information.\r | |
445 | \r | |
446 | **/\r | |
447 | typedef\r | |
448 | EFI_STATUS\r | |
8b13229b | 449 | (EFIAPI *EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER)(\r |
d1f95000 | 450 | IN EFI_USB2_HC_PROTOCOL *This,\r |
451 | IN UINT8 DeviceAddress,\r | |
452 | IN UINT8 EndPointAddress,\r | |
453 | IN UINT8 DeviceSpeed,\r | |
454 | IN UINTN MaximumPacketLength,\r | |
455 | IN UINT8 DataBuffersNumber,\r | |
456 | IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r | |
457 | IN UINTN DataLength,\r | |
458 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
459 | OUT UINT32 *TransferResult\r | |
460 | )\r | |
461 | ;\r | |
462 | \r | |
463 | /**\r | |
464 | Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.\r | |
465 | \r | |
466 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
467 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
468 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
469 | target USB device.\r | |
470 | @param DeviceSpeed Indicates device speed.\r | |
471 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
472 | sending or receiving.\r | |
473 | @param DataBuffersNumber Number of data buffers prepared for the transfer.\r | |
474 | @param Data Array of pointers to the buffers of data that will be transmitted to USB\r | |
475 | device or received from USB device.\r | |
476 | @param DataLength Specifies the length, in bytes, of the data to be sent to or received from\r | |
477 | the USB device.\r | |
478 | @param Translator A pointer to the transaction translator data.\r | |
479 | @param IsochronousCallback The Callback function. This function is called if the requested\r | |
480 | isochronous transfer is completed.\r | |
481 | @param Context Data passed to the IsochronousCallback function. This is an\r | |
482 | optional parameter and may be NULL.\r | |
483 | \r | |
484 | @retval EFI_SUCCESS The asynchronous isochronous transfer request has been successfully\r | |
485 | submitted or canceled.\r | |
486 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
487 | @retval EFI_OUT_OF_RESOURCES The asynchronous isochronous transfer could not be submitted due to\r | |
488 | a lack of resources.\r | |
489 | \r | |
490 | **/\r | |
491 | typedef\r | |
492 | EFI_STATUS\r | |
8b13229b | 493 | (EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER)(\r |
d1f95000 | 494 | IN EFI_USB2_HC_PROTOCOL *This,\r |
495 | IN UINT8 DeviceAddress,\r | |
496 | IN UINT8 EndPointAddress,\r | |
497 | IN UINT8 DeviceSpeed,\r | |
498 | IN UINTN MaximumPacketLength,\r | |
499 | IN UINT8 DataBuffersNumber,\r | |
500 | IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r | |
501 | IN UINTN DataLength,\r | |
502 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
503 | IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,\r | |
504 | IN VOID *Context OPTIONAL\r | |
505 | )\r | |
506 | ;\r | |
507 | \r | |
508 | /**\r | |
509 | Retrieves the current status of a USB root hub port.\r | |
510 | \r | |
511 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
512 | @param PortNumber Specifies the root hub port from which the status is to be retrieved.\r | |
513 | This value is zero based.\r | |
514 | @param PortStatus A pointer to the current port status bits and port status change bits.\r | |
515 | \r | |
516 | @retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber\r | |
517 | was returned in PortStatus.\r | |
518 | @retval EFI_INVALID_PARAMETER PortNumber is invalid.\r | |
519 | \r | |
520 | **/\r | |
521 | typedef\r | |
522 | EFI_STATUS\r | |
8b13229b | 523 | (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS)(\r |
d1f95000 | 524 | IN CONST EFI_USB2_HC_PROTOCOL *This,\r |
525 | IN CONST UINT8 PortNumber,\r | |
526 | OUT EFI_USB_PORT_STATUS *PortStatus\r | |
527 | )\r | |
20b1aab6 | 528 | ;\r |
d1f95000 | 529 | \r |
530 | /**\r | |
531 | Sets a feature for the specified root hub port.\r | |
532 | \r | |
533 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
534 | @param PortNumber Specifies the root hub port whose feature is requested to be set. This\r | |
535 | value is zero based.\r | |
536 | @param PortFeature Indicates the feature selector associated with the feature set request.\r | |
537 | \r | |
538 | @retval EFI_SUCCESS The feature specified by PortFeature was set for the USB\r | |
539 | root hub port specified by PortNumber.\r | |
540 | @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.\r | |
541 | \r | |
542 | **/\r | |
543 | typedef\r | |
544 | EFI_STATUS\r | |
8b13229b | 545 | (EFIAPI *EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE)(\r |
d1f95000 | 546 | IN EFI_USB2_HC_PROTOCOL *This,\r |
547 | IN UINT8 PortNumber,\r | |
548 | IN EFI_USB_PORT_FEATURE PortFeature\r | |
549 | )\r | |
20b1aab6 | 550 | ;\r |
d1f95000 | 551 | \r |
552 | /**\r | |
553 | Clears a feature for the specified root hub port.\r | |
554 | \r | |
555 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
556 | @param PortNumber Specifies the root hub port whose feature is requested to be cleared. This\r | |
557 | value is zero based.\r | |
558 | @param PortFeature Indicates the feature selector associated with the feature clear request.\r | |
559 | \r | |
560 | @retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB\r | |
561 | root hub port specified by PortNumber.\r | |
562 | @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.\r | |
563 | \r | |
564 | **/\r | |
565 | typedef\r | |
566 | EFI_STATUS\r | |
8b13229b | 567 | (EFIAPI *EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE)(\r |
d1f95000 | 568 | IN EFI_USB2_HC_PROTOCOL *This,\r |
569 | IN UINT8 PortNumber,\r | |
570 | IN EFI_USB_PORT_FEATURE PortFeature\r | |
571 | )\r | |
20b1aab6 | 572 | ;\r |
d1f95000 | 573 | \r |
4ca9b6c4 LG |
574 | /** \r |
575 | @par Protocol Description:\r | |
576 | The EFI_USB2_HC_PROTOCOL provides USB host controller management, basic \r | |
577 | data transactions over a USB bus, and USB root hub access. A device driver \r | |
578 | that wishes to manage a USB bus in a system retrieves the EFI_USB2_HC_PROTOCOL \r | |
579 | instance that is associated with the USB bus to be managed. A device handle \r | |
580 | for a USB host controller will minimally contain an EFI_DEVICE_PATH_PROTOCOL \r | |
581 | instance, and an EFI_USB2_HC_PROTOCOL instance.\r | |
582 | \r | |
583 | @param GetCapability\r | |
584 | Retrieves the capabilities of the USB host controller. \r | |
585 | \r | |
586 | @param Reset\r | |
587 | Software reset of USB. \r | |
588 | \r | |
589 | @param GetState\r | |
590 | Retrieves the current state of the USB host controller. \r | |
591 | \r | |
592 | @param SetState\r | |
593 | Sets the USB host controller to a specific state. \r | |
594 | \r | |
595 | @param ControlTransfer\r | |
596 | Submits a control transfer to a target USB device. \r | |
597 | \r | |
598 | @param BulkTransfer\r | |
599 | Submits a bulk transfer to a bulk endpoint of a USB device. \r | |
600 | \r | |
601 | @param AsyncInterruptTransfer\r | |
602 | Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device. \r | |
603 | \r | |
604 | @param SyncInterruptTransfer\r | |
605 | Submits a synchronous interrupt transfer to an interrupt endpoint of a USB device. \r | |
606 | \r | |
607 | @param IsochronousTransfer\r | |
608 | Submits isochronous transfer to an isochronous endpoint of a USB device. \r | |
609 | \r | |
610 | @param AsyncIsochronousTransfer\r | |
611 | Submits nonblocking USB isochronous transfer. \r | |
612 | \r | |
613 | @param GetRootHubPortStatus\r | |
614 | Retrieves the status of the specified root hub port. \r | |
615 | \r | |
616 | @param SetRootHubPortFeature\r | |
617 | Sets the feature for the specified root hub port. \r | |
618 | \r | |
619 | @param ClearRootHubPortFeature\r | |
620 | Clears the feature for the specified root hub port. \r | |
621 | \r | |
622 | @param MajorRevision\r | |
623 | The major revision number of the USB host controller. The revision information \r | |
624 | indicates the release of the Universal Serial Bus Specification with which the \r | |
625 | host controller is compliant.\r | |
626 | \r | |
627 | @param MinorRevision\r | |
628 | The minor revision number of the USB host controller. The revision information \r | |
629 | indicates the release of the Universal Serial Bus Specification with which the \r | |
630 | host controller is compliant.\r | |
631 | **/\r | |
d1f95000 | 632 | struct _EFI_USB2_HC_PROTOCOL {\r |
633 | EFI_USB2_HC_PROTOCOL_GET_CAPABILITY GetCapability;\r | |
634 | EFI_USB2_HC_PROTOCOL_RESET Reset;\r | |
635 | EFI_USB2_HC_PROTOCOL_GET_STATE GetState;\r | |
636 | EFI_USB2_HC_PROTOCOL_SET_STATE SetState;\r | |
637 | EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer;\r | |
638 | EFI_USB2_HC_PROTOCOL_BULK_TRANSFER BulkTransfer;\r | |
639 | EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer;\r | |
640 | EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer;\r | |
641 | EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer;\r | |
642 | EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer;\r | |
643 | EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;\r | |
644 | EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;\r | |
645 | EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature;\r | |
646 | UINT16 MajorRevision;\r | |
647 | UINT16 MinorRevision;\r | |
648 | };\r | |
649 | \r | |
650 | extern EFI_GUID gEfiUsb2HcProtocolGuid;\r | |
651 | \r | |
652 | #endif\r |