]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Bus/Pci/EhciPei/EhciSched.h
MdeModulePkg: Add PEI USB drivers and related PPIs
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / EhciPei / EhciSched.h
CommitLineData
4b1bf81c 1/** @file\r
2Private Header file for Usb Host Controller PEIM\r
3\r
4Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
5 \r
6This program and the accompanying materials\r
7are licensed and made available under the terms and conditions\r
8of the BSD License which accompanies this distribution. The\r
9full text of the license may be found at\r
10http://opensource.org/licenses/bsd-license.php\r
11\r
12THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
15**/\r
16\r
17#ifndef _EFI_EHCI_SCHED_H_\r
18#define _EFI_EHCI_SCHED_H_\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 PEI_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 PEI_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 PEI_USB2_HC_DEV *Ehc,\r
61 IN PEI_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 PEI_USB2_HC_DEV *Ehc,\r
76 IN PEI_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 PEI_USB2_HC_DEV *Ehc,\r
92 IN PEI_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 PEI_USB2_HC_DEV *Ehc,\r
107 IN PEI_EHC_QH *Qh\r
108 )\r
109;\r
110\r
111/**\r
112 Execute the transfer by polling the URB. This is a synchronous operation.\r
113 \r
114 @param Ehc The EHCI device.\r
115 @param Urb The URB to execute.\r
116 @param TimeOut The time to wait before abort, in millisecond.\r
117\r
118 @retval EFI_DEVICE_ERROR The transfer failed due to transfer error.\r
119 @retval EFI_TIMEOUT The transfer failed due to time out.\r
120 @retval EFI_SUCCESS The transfer finished OK.\r
121\r
122**/\r
123EFI_STATUS\r
124EhcExecTransfer (\r
125 IN PEI_USB2_HC_DEV *Ehc,\r
126 IN PEI_URB *Urb,\r
127 IN UINTN TimeOut\r
128 )\r
129;\r
130\r
131/**\r
132 Delete a single asynchronous interrupt transfer for\r
133 the device and endpoint.\r
134 \r
135 @param Ehc The EHCI device.\r
136 @param DevAddr The address of the target device.\r
137 @param EpNum The endpoint of the target.\r
138 @param DataToggle Return the next data toggle to use.\r
139\r
140 @retval EFI_NOT_FOUND No transfer for the device is found.\r
141 @retval EFI_SUCCESS An asynchronous transfer is removed.\r
142\r
143**/\r
144EFI_STATUS\r
145EhciDelAsyncIntTransfer (\r
146 IN PEI_USB2_HC_DEV *Ehc,\r
147 IN UINT8 DevAddr,\r
148 IN UINT8 EpNum, \r
149 OUT UINT8 *DataToggle\r
150 )\r
151;\r
152\r
153/**\r
154 Remove all the asynchronous interrutp transfers.\r
155 \r
156 @param Ehc The EHCI device.\r
157\r
158**/\r
159VOID\r
160EhciDelAllAsyncIntTransfers (\r
161 IN PEI_USB2_HC_DEV *Ehc\r
162 )\r
163;\r
164\r
165/**\r
166 Remove all the asynchronous interrutp transfers.\r
167 \r
168 @param Event Interrupt event.\r
169 @param Context Pointer to PEI_USB2_HC_DEV.\r
170\r
171**/\r
172VOID\r
173EFIAPI\r
174EhcMoniteAsyncRequests (\r
175 IN EFI_EVENT Event,\r
176 IN VOID *Context\r
177 )\r
178;\r
179\r
180#endif\r