2 Provides some data struct used by OHCI controller driver.
4 Copyright (c) 2013-2015 Intel Corporation.
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 #include "Descriptor.h"
32 @Param Ohc UHC private data
34 @retval TD structure pointer
39 IN USB_OHCI_HC_DEV
*Ohc
46 @Param Ohc UHC private data
47 @Param Td Pointer to a TD to free
49 @retval EFI_SUCCESS TD freed
54 IN USB_OHCI_HC_DEV
*Ohc
,
62 @Param Ohc Device private data
64 @retval ED descriptor pointer
77 @Param Ohc UHC private data
78 @Param Ed Pointer to a ED to free
80 @retval EFI_SUCCESS ED freed
86 IN USB_OHCI_HC_DEV
*Ohc
,
94 @Param Ohc Device private data
95 @Param Ed Pointer to a ED to free
97 @retval EFI_SUCCESS ED freed
101 OhciFreeAllTDFromED (
102 IN USB_OHCI_HC_DEV
*Ohc
,
108 Find a working ED match the requirement
110 @Param EdHead Head of the ED list
111 @Param DeviceAddress Device address to search
112 @Param EndPointNum End point num to search
113 @Param EdDir ED Direction to search
115 @retval ED descriptor searched
121 IN ED_DESCRIPTOR
*EdHead
,
122 IN UINT8 DeviceAddress
,
123 IN UINT8 EndPointNum
,
130 Initialize interrupt list.
132 @Param Ohc Device private data
134 @retval EFI_SUCCESS Initialization done
138 OhciInitializeInterruptList (
146 @Param Ed Ed to be attached
147 @Param NewEd Ed to attach
149 @retval EFI_SUCCESS NewEd attached to Ed
150 @retval EFI_INVALID_PARAMETER Ed is NULL
155 IN ED_DESCRIPTOR
*Ed
,
156 IN ED_DESCRIPTOR
*NewEd
161 Count ED number on a ED chain
163 @Param Ed Head of the ED chain
165 @retval ED number on the chain
176 Find the minimal burn ED list on a specific depth level
178 @Param Ohc Device private data
179 @Param Depth Depth level
181 @retval ED list found
186 OhciFindMinInterruptEDList (
187 IN USB_OHCI_HC_DEV
*Ohc
,
193 Attach an ED to an ED list
195 @Param OHC UHC private data
196 @Param ListType Type of the ED list
197 @Param Ed ED to attach
198 @Param EdList ED list to be attached
200 @retval EFI_SUCCESS ED attached to ED list
205 IN USB_OHCI_HC_DEV
*Ohc
,
206 IN DESCRIPTOR_LIST_TYPE ListType
,
207 IN ED_DESCRIPTOR
*Ed
,
208 IN ED_DESCRIPTOR
*EdList
213 Remove interrupt EDs that match requirement
215 @Param Ohc UHC private data
216 @Param IntEd The address of Interrupt endpoint
218 @retval EFI_SUCCESS EDs match requirement removed
223 OhciFreeInterruptEdByEd (
224 IN USB_OHCI_HC_DEV
*Ohc
,
225 IN ED_DESCRIPTOR
*IntEd
230 Remove interrupt EDs that match requirement
232 @Param Ohc UHC private data
233 @Param FunctionAddress Requirement on function address
234 @Param EndPointNum Requirement on end point number
236 @retval EFI_SUCCESS EDs match requirement removed
240 OhciFreeInterruptEdByAddr (
241 IN USB_OHCI_HC_DEV
*Ohc
,
242 IN UINT8 FunctionAddress
,
249 Link Td2 to the end of Td1
251 @Param Td1 TD to be linked
252 @Param Td2 TD to link
254 @retval EFI_SUCCESS TD successfully linked
255 @retval EFI_INVALID_PARAMETER Td1 is NULL
260 IN TD_DESCRIPTOR
*Td1
,
261 IN TD_DESCRIPTOR
*Td2
269 @Param Ed ED which TD list attach on
270 @Param HeadTd Head of the TD list to attach
272 @retval EFI_SUCCESS TD list attached on the ED
276 OhciAttachTDListToED (
277 IN ED_DESCRIPTOR
*Ed
,
278 IN TD_DESCRIPTOR
*HeadTd
284 Set value to ED specific field
286 @Param Ed ED to be set
287 @Param Field Field to be set
288 @Param Value Value to set
290 @retval EFI_SUCCESS Value set
295 IN ED_DESCRIPTOR
*Ed
,
303 Get value from an ED's specific field
306 @Param Field Field to get value from
308 @retval Value of the field
313 IN ED_DESCRIPTOR
*Ed
,
320 Set value to TD specific field
322 @Param Td TD to be set
323 @Param Field Field to be set
324 @Param Value Value to set
326 @retval EFI_SUCCESS Value set
331 IN TD_DESCRIPTOR
*Td
,
339 Get value from ED specific field
342 @Param Field Field to get value from
344 @retval Value of the field
350 IN TD_DESCRIPTOR
*Td
,
355 Free the Ed,Td,buffer that were created during transferring
357 @Param Ohc Device private data
361 OhciFreeDynamicIntMemory(
362 IN USB_OHCI_HC_DEV
*Ohc
367 Free the Ed that were initilized during driver was starting,
368 those memory were used as interrupt ED head
370 @Param Ohc Device private data
375 OhciFreeFixedIntMemory (
376 IN USB_OHCI_HC_DEV
*Ohc
380 Release all OHCI used memory when OHCI going to quit
382 @Param Ohc Device private data
384 @retval EFI_SUCCESS Memory released
389 OhciFreeIntTransferMemory (
390 IN USB_OHCI_HC_DEV
*Ohc