1 /** @file
2 Private Header file for Usb Host Controller PEIM
3 
4 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
5 
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions
8 of the BSD License which accompanies this distribution.  The
9 full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11 
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 
15 **/
16 
17 #ifndef _EFI_EHCI_SCHED_H_
18 #define _EFI_EHCI_SCHED_H_
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 PEI_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 **/
41 VOID
42 EhcFreeSched (
43   IN PEI_USB2_HC_DEV          *Ehc
44   )
45 ;
46 
47 /**
48   Link the queue head to the asynchronous schedule list.
49   UEFI only supports one CTRL/BULK transfer at a time
50   due to its interfaces. This simplifies the AsynList
51   management: A reclamation header is always linked to
52   the AsyncListAddr, the only active QH is appended to it.
53 
54   @param  Ehc   The EHCI device.
55   @param  Qh    The queue head to link.
56 
57 **/
58 VOID
59 EhcLinkQhToAsync (
60   IN PEI_USB2_HC_DEV      *Ehc,
61   IN PEI_EHC_QH           *Qh
62   )
63 ;
64 
65 /**
66   Unlink a queue head from the asynchronous schedule list.
67   Need to synchronize with hardware.
68 
69   @param  Ehc   The EHCI device.
70   @param  Qh    The queue head to unlink.
71 
72 **/
73 VOID
74 EhcUnlinkQhFromAsync (
75   IN PEI_USB2_HC_DEV      *Ehc,
76   IN PEI_EHC_QH           *Qh
77   )
78 ;
79 
80 /**
81   Execute the transfer by polling the URB. This is a synchronous operation.
82 
83   @param  Ehc               The EHCI device.
84   @param  Urb               The URB to execute.
85   @param  TimeOut           The time to wait before abort, in millisecond.
86 
87   @retval EFI_DEVICE_ERROR  The transfer failed due to transfer error.
88   @retval EFI_TIMEOUT       The transfer failed due to time out.
89   @retval EFI_SUCCESS       The transfer finished OK.
90 
91 **/
92 EFI_STATUS
93 EhcExecTransfer (
94   IN  PEI_USB2_HC_DEV     *Ehc,
95   IN  PEI_URB             *Urb,
96   IN  UINTN               TimeOut
97   )
98 ;
99 
100 #endif
101