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