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