]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.h
MdeModulePkg UhciPei: Remove redundant functions
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / EhciDxe / EhciSched.h
... / ...
CommitLineData
1/** @file\r
2\r
3 This file contains the definination for host controller schedule routines.\r
4\r
5Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>\r
6This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef _EFI_EHCI_SCHED_H_\r
17#define _EFI_EHCI_SCHED_H_\r
18\r
19\r
20/**\r
21 Initialize the schedule data structure such as frame list.\r
22\r
23 @param Ehc The EHCI device to init schedule data for.\r
24\r
25 @retval EFI_OUT_OF_RESOURCES Failed to allocate resource to init schedule data.\r
26 @retval EFI_SUCCESS The schedule data is initialized.\r
27\r
28**/\r
29EFI_STATUS\r
30EhcInitSched (\r
31 IN USB2_HC_DEV *Ehc\r
32 );\r
33\r
34\r
35/**\r
36 Free the schedule data. It may be partially initialized.\r
37\r
38 @param Ehc The EHCI device.\r
39\r
40**/\r
41VOID\r
42EhcFreeSched (\r
43 IN USB2_HC_DEV *Ehc\r
44 );\r
45\r
46\r
47/**\r
48 Link the queue head to the asynchronous schedule list.\r
49 UEFI only supports one CTRL/BULK transfer at a time\r
50 due to its interfaces. This simplifies the AsynList\r
51 management: A reclamation header is always linked to\r
52 the AsyncListAddr, the only active QH is appended to it.\r
53\r
54 @param Ehc The EHCI device.\r
55 @param Qh The queue head to link.\r
56\r
57**/\r
58VOID\r
59EhcLinkQhToAsync (\r
60 IN USB2_HC_DEV *Ehc,\r
61 IN EHC_QH *Qh\r
62 );\r
63\r
64\r
65/**\r
66 Unlink a queue head from the asynchronous schedule list.\r
67 Need to synchronize with hardware.\r
68\r
69 @param Ehc The EHCI device.\r
70 @param Qh The queue head to unlink.\r
71\r
72**/\r
73VOID\r
74EhcUnlinkQhFromAsync (\r
75 IN USB2_HC_DEV *Ehc,\r
76 IN EHC_QH *Qh\r
77 );\r
78\r
79\r
80/**\r
81 Link a queue head for interrupt transfer to the periodic\r
82 schedule frame list. This code is very much the same as\r
83 that in UHCI.\r
84\r
85 @param Ehc The EHCI device.\r
86 @param Qh The queue head to link.\r
87\r
88**/\r
89VOID\r
90EhcLinkQhToPeriod (\r
91 IN USB2_HC_DEV *Ehc,\r
92 IN EHC_QH *Qh\r
93 );\r
94\r
95\r
96/**\r
97 Unlink an interrupt queue head from the periodic\r
98 schedule frame list.\r
99\r
100 @param Ehc The EHCI device.\r
101 @param Qh The queue head to unlink.\r
102\r
103**/\r
104VOID\r
105EhcUnlinkQhFromPeriod (\r
106 IN USB2_HC_DEV *Ehc,\r
107 IN EHC_QH *Qh\r
108 );\r
109\r
110\r
111\r
112/**\r
113 Execute the transfer by polling the URB. This is a synchronous operation.\r
114\r
115 @param Ehc The EHCI device.\r
116 @param Urb The URB to execute.\r
117 @param TimeOut The time to wait before abort, in millisecond.\r
118\r
119 @retval EFI_DEVICE_ERROR The transfer failed due to transfer error.\r
120 @retval EFI_TIMEOUT The transfer failed due to time out.\r
121 @retval EFI_SUCCESS The transfer finished OK.\r
122\r
123**/\r
124EFI_STATUS\r
125EhcExecTransfer (\r
126 IN USB2_HC_DEV *Ehc,\r
127 IN URB *Urb,\r
128 IN UINTN TimeOut\r
129 );\r
130\r
131\r
132/**\r
133 Delete a single asynchronous interrupt transfer for\r
134 the device and endpoint.\r
135\r
136 @param Ehc The EHCI device.\r
137 @param DevAddr The address of the target device.\r
138 @param EpNum The endpoint of the target.\r
139 @param DataToggle Return the next data toggle to use.\r
140\r
141 @retval EFI_SUCCESS An asynchronous transfer is removed.\r
142 @retval EFI_NOT_FOUND No transfer for the device is found.\r
143\r
144**/\r
145EFI_STATUS\r
146EhciDelAsyncIntTransfer (\r
147 IN USB2_HC_DEV *Ehc,\r
148 IN UINT8 DevAddr,\r
149 IN UINT8 EpNum,\r
150 OUT UINT8 *DataToggle\r
151 );\r
152\r
153\r
154/**\r
155 Remove all the asynchronous interrutp transfers.\r
156\r
157 @param Ehc The EHCI device.\r
158\r
159**/\r
160VOID\r
161EhciDelAllAsyncIntTransfers (\r
162 IN USB2_HC_DEV *Ehc\r
163 );\r
164\r
165\r
166/**\r
167 Interrupt transfer periodic check handler.\r
168\r
169 @param Event Interrupt event.\r
170 @param Context Pointer to USB2_HC_DEV.\r
171\r
172**/\r
173VOID\r
174EFIAPI\r
175EhcMonitorAsyncRequests (\r
176 IN EFI_EVENT Event,\r
177 IN VOID *Context\r
178 );\r
179\r
180#endif\r