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