2 Provides some data struct used by OHCI controller driver.
4 Copyright (c) 2013-2015 Intel Corporation.
6 SPDX-License-Identifier: BSD-2-Clause-Patent
14 #include "Descriptor.h"
26 @Param Ohc UHC private data
28 @retval TD structure pointer
33 IN USB_OHCI_HC_DEV
*Ohc
40 @Param Ohc UHC private data
41 @Param Td Pointer to a TD to free
43 @retval EFI_SUCCESS TD freed
48 IN USB_OHCI_HC_DEV
*Ohc
,
56 @Param Ohc Device private data
58 @retval ED descriptor pointer
71 @Param Ohc UHC private data
72 @Param Ed Pointer to a ED to free
74 @retval EFI_SUCCESS ED freed
80 IN USB_OHCI_HC_DEV
*Ohc
,
88 @Param Ohc Device private data
89 @Param Ed Pointer to a ED to free
91 @retval EFI_SUCCESS ED freed
96 IN USB_OHCI_HC_DEV
*Ohc
,
102 Find a working ED match the requirement
104 @Param EdHead Head of the ED list
105 @Param DeviceAddress Device address to search
106 @Param EndPointNum End point num to search
107 @Param EdDir ED Direction to search
109 @retval ED descriptor searched
115 IN ED_DESCRIPTOR
*EdHead
,
116 IN UINT8 DeviceAddress
,
117 IN UINT8 EndPointNum
,
124 Initialize interrupt list.
126 @Param Ohc Device private data
128 @retval EFI_SUCCESS Initialization done
132 OhciInitializeInterruptList (
140 @Param Ed Ed to be attached
141 @Param NewEd Ed to attach
143 @retval EFI_SUCCESS NewEd attached to Ed
144 @retval EFI_INVALID_PARAMETER Ed is NULL
149 IN ED_DESCRIPTOR
*Ed
,
150 IN ED_DESCRIPTOR
*NewEd
155 Count ED number on a ED chain
157 @Param Ed Head of the ED chain
159 @retval ED number on the chain
170 Find the minimal burn ED list on a specific depth level
172 @Param Ohc Device private data
173 @Param Depth Depth level
175 @retval ED list found
180 OhciFindMinInterruptEDList (
181 IN USB_OHCI_HC_DEV
*Ohc
,
187 Attach an ED to an ED list
189 @Param OHC UHC private data
190 @Param ListType Type of the ED list
191 @Param Ed ED to attach
192 @Param EdList ED list to be attached
194 @retval EFI_SUCCESS ED attached to ED list
199 IN USB_OHCI_HC_DEV
*Ohc
,
200 IN DESCRIPTOR_LIST_TYPE ListType
,
201 IN ED_DESCRIPTOR
*Ed
,
202 IN ED_DESCRIPTOR
*EdList
207 Remove interrupt EDs that match requirement
209 @Param Ohc UHC private data
210 @Param IntEd The address of Interrupt endpoint
212 @retval EFI_SUCCESS EDs match requirement removed
217 OhciFreeInterruptEdByEd (
218 IN USB_OHCI_HC_DEV
*Ohc
,
219 IN ED_DESCRIPTOR
*IntEd
224 Remove interrupt EDs that match requirement
226 @Param Ohc UHC private data
227 @Param FunctionAddress Requirement on function address
228 @Param EndPointNum Requirement on end point number
230 @retval EFI_SUCCESS EDs match requirement removed
234 OhciFreeInterruptEdByAddr (
235 IN USB_OHCI_HC_DEV
*Ohc
,
236 IN UINT8 FunctionAddress
,
243 Link Td2 to the end of Td1
245 @Param Td1 TD to be linked
246 @Param Td2 TD to link
248 @retval EFI_SUCCESS TD successfully linked
249 @retval EFI_INVALID_PARAMETER Td1 is NULL
254 IN TD_DESCRIPTOR
*Td1
,
255 IN TD_DESCRIPTOR
*Td2
263 @Param Ed ED which TD list attach on
264 @Param HeadTd Head of the TD list to attach
266 @retval EFI_SUCCESS TD list attached on the ED
270 OhciAttachTDListToED (
271 IN ED_DESCRIPTOR
*Ed
,
272 IN TD_DESCRIPTOR
*HeadTd
278 Set value to ED specific field
280 @Param Ed ED to be set
281 @Param Field Field to be set
282 @Param Value Value to set
284 @retval EFI_SUCCESS Value set
289 IN ED_DESCRIPTOR
*Ed
,
297 Get value from an ED's specific field
300 @Param Field Field to get value from
302 @retval Value of the field
307 IN ED_DESCRIPTOR
*Ed
,
314 Set value to TD specific field
316 @Param Td TD to be set
317 @Param Field Field to be set
318 @Param Value Value to set
320 @retval EFI_SUCCESS Value set
325 IN TD_DESCRIPTOR
*Td
,
333 Get value from ED specific field
336 @Param Field Field to get value from
338 @retval Value of the field
344 IN TD_DESCRIPTOR
*Td
,
349 Free the Ed,Td,buffer that were created during transferring
351 @Param Ohc Device private data
355 OhciFreeDynamicIntMemory(
356 IN USB_OHCI_HC_DEV
*Ohc
361 Free the Ed that were initilized during driver was starting,
362 those memory were used as interrupt ED head
364 @Param Ohc Device private data
369 OhciFreeFixedIntMemory (
370 IN USB_OHCI_HC_DEV
*Ohc
374 Release all OHCI used memory when OHCI going to quit
376 @Param Ohc Device private data
378 @retval EFI_SUCCESS Memory released
383 OhciFreeIntTransferMemory (
384 IN USB_OHCI_HC_DEV
*Ohc