]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Bus/Pci/EhciPei/EhciSched.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / EhciPei / EhciSched.h
1 /** @file
2 Private Header file for Usb Host Controller PEIM
3
4 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef _EFI_EHCI_SCHED_H_
11 #define _EFI_EHCI_SCHED_H_
12
13 /**
14 Initialize the schedule data structure such as frame list.
15
16 @param Ehc The EHCI device to init schedule data for.
17
18 @retval EFI_OUT_OF_RESOURCES Failed to allocate resource to init schedule data.
19 @retval EFI_SUCCESS The schedule data is initialized.
20
21 **/
22 EFI_STATUS
23 EhcInitSched (
24 IN PEI_USB2_HC_DEV *Ehc
25 )
26 ;
27
28 /**
29 Free the schedule data. It may be partially initialized.
30
31 @param Ehc The EHCI device.
32
33 **/
34 VOID
35 EhcFreeSched (
36 IN PEI_USB2_HC_DEV *Ehc
37 )
38 ;
39
40 /**
41 Link the queue head to the asynchronous schedule list.
42 UEFI only supports one CTRL/BULK transfer at a time
43 due to its interfaces. This simplifies the AsynList
44 management: A reclamation header is always linked to
45 the AsyncListAddr, the only active QH is appended to it.
46
47 @param Ehc The EHCI device.
48 @param Qh The queue head to link.
49
50 **/
51 VOID
52 EhcLinkQhToAsync (
53 IN PEI_USB2_HC_DEV *Ehc,
54 IN PEI_EHC_QH *Qh
55 )
56 ;
57
58 /**
59 Unlink a queue head from the asynchronous schedule list.
60 Need to synchronize with hardware.
61
62 @param Ehc The EHCI device.
63 @param Qh The queue head to unlink.
64
65 **/
66 VOID
67 EhcUnlinkQhFromAsync (
68 IN PEI_USB2_HC_DEV *Ehc,
69 IN PEI_EHC_QH *Qh
70 )
71 ;
72
73 /**
74 Execute the transfer by polling the URB. This is a synchronous operation.
75
76 @param Ehc The EHCI device.
77 @param Urb The URB to execute.
78 @param TimeOut The time to wait before abort, in millisecond.
79
80 @retval EFI_DEVICE_ERROR The transfer failed due to transfer error.
81 @retval EFI_TIMEOUT The transfer failed due to time out.
82 @retval EFI_SUCCESS The transfer finished OK.
83
84 **/
85 EFI_STATUS
86 EhcExecTransfer (
87 IN PEI_USB2_HC_DEV *Ehc,
88 IN PEI_URB *Urb,
89 IN UINTN TimeOut
90 )
91 ;
92
93 #endif