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