]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.h
modify coding style to pass ecc tool and provide comments that complied with Doxgen.
[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 /**
37 Free the schedule data. It may be partially initialized.
38
39 @param Ehc The EHCI device.
40
41 @return None
42
43 **/
44 VOID
45 EhcFreeSched (
46 IN USB2_HC_DEV *Ehc
47 )
48 ;
49
50
51 /**
52 Link the queue head to the asynchronous schedule list.
53 UEFI only supports one CTRL/BULK transfer at a time
54 due to its interfaces. This simplifies the AsynList
55 management: A reclamation header is always linked to
56 the AsyncListAddr, the only active QH is appended to it.
57
58 @param Ehc The EHCI device.
59 @param Qh The queue head to link.
60
61 @return None.
62
63 **/
64 VOID
65 EhcLinkQhToAsync (
66 IN USB2_HC_DEV *Ehc,
67 IN EHC_QH *Qh
68 )
69 ;
70
71
72 /**
73 Unlink a queue head from the asynchronous schedule list.
74 Need to synchronize with hardware.
75
76 @param Ehc The EHCI device.
77 @param Qh The queue head to unlink.
78
79 @return None.
80
81 **/
82 VOID
83 EhcUnlinkQhFromAsync (
84 IN USB2_HC_DEV *Ehc,
85 IN EHC_QH *Qh
86 )
87 ;
88
89
90 /**
91 Link a queue head for interrupt transfer to the periodic
92 schedule frame list. This code is very much the same as
93 that in UHCI.
94
95 @param Ehc The EHCI device.
96 @param Qh The queue head to link.
97
98 @return None.
99
100 **/
101 VOID
102 EhcLinkQhToPeriod (
103 IN USB2_HC_DEV *Ehc,
104 IN EHC_QH *Qh
105 )
106 ;
107
108
109 /**
110 Unlink an interrupt queue head from the periodic
111 schedule frame list.
112
113 @param Ehc The EHCI device.
114 @param Qh The queue head to unlink.
115
116 @return None.
117
118 **/
119 VOID
120 EhcUnlinkQhFromPeriod (
121 IN USB2_HC_DEV *Ehc,
122 IN EHC_QH *Qh
123 )
124 ;
125
126
127
128 /**
129 Execute the transfer by polling the URB. This is a synchronous operation.
130
131 @param Ehc The EHCI device.
132 @param Urb The URB to execute.
133 @param TimeOut The time to wait before abort, in millisecond.
134
135 @retval EFI_DEVICE_ERROR The transfer failed due to transfer error.
136 @retval EFI_TIMEOUT The transfer failed due to time out.
137 @retval EFI_SUCCESS The transfer finished OK.
138
139 **/
140 EFI_STATUS
141 EhcExecTransfer (
142 IN USB2_HC_DEV *Ehc,
143 IN URB *Urb,
144 IN UINTN TimeOut
145 )
146 ;
147
148
149 /**
150 Delete a single asynchronous interrupt transfer for
151 the device and endpoint.
152
153 @param Ehc The EHCI device.
154 @param DevAddr The address of the target device.
155 @param EpNum The endpoint of the target.
156 @param DataToggle Return the next data toggle to use.
157
158 @retval EFI_SUCCESS An asynchronous transfer is removed.
159 @retval EFI_NOT_FOUND No transfer for the device is found.
160
161 **/
162 EFI_STATUS
163 EhciDelAsyncIntTransfer (
164 IN USB2_HC_DEV *Ehc,
165 IN UINT8 DevAddr,
166 IN UINT8 EpNum,
167 OUT UINT8 *DataToggle
168 )
169 ;
170
171
172 /**
173 Remove all the asynchronous interrutp transfers.
174
175 @param Ehc The EHCI device.
176
177 @return None.
178
179 **/
180 VOID
181 EhciDelAllAsyncIntTransfers (
182 IN USB2_HC_DEV *Ehc
183 )
184 ;
185
186
187 /**
188 Interrupt transfer periodic check handler.
189
190 @param Event Interrupt event.
191 @param Context Pointer to USB2_HC_DEV.
192
193 @return None.
194
195 **/
196 VOID
197 EhcMoniteAsyncRequests (
198 IN EFI_EVENT Event,
199 IN VOID *Context
200 )
201 ;
202
203 #endif