]> git.proxmox.com Git - mirror_edk2.git/blob - QuarkSocPkg/QuarkSouthCluster/Usb/Ohci/Pei/OhciSched.h
QuarkSocPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / QuarkSocPkg / QuarkSouthCluster / Usb / Ohci / Pei / OhciSched.h
1 /** @file
2 This file contains the definination for host controller schedule routines.
3
4 Copyright (c) 2013-2015 Intel Corporation.
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10
11
12 #ifndef _OHCI_SCHED_H
13 #define _OHCI_SCHED_H
14
15 #include "Descriptor.h"
16
17 #define HCCA_MEM_SIZE 256
18 #define GRID_SIZE 16
19 #define GRID_SHIFT 4
20
21 /**
22
23 Convert Error code from OHCI format to EFI format
24
25 @Param ErrorCode ErrorCode in OHCI format
26
27 @retval ErrorCode in EFI format
28
29 **/
30 UINT32
31 ConvertErrorCode (
32 IN UINT32 ErrorCode
33 );
34 /**
35
36 Check TDs Results
37
38 @Param Ohc UHC private data
39 @Param Td TD_DESCRIPTOR
40 @Param Result Result to return
41
42 @retval TRUE means OK
43 @retval FLASE means Error or Short packet
44
45 **/
46 BOOLEAN
47 OhciCheckTDsResults (
48 IN USB_OHCI_HC_DEV *Ohc,
49 IN TD_DESCRIPTOR *Td,
50 OUT UINT32 *Result
51 );
52 /**
53
54 Check the task status on an ED
55
56 @Param Ed Pointer to the ED task that TD hooked on
57 @Param HeadTd TD header for current transaction
58
59 @retval Task Status Code
60
61 **/
62
63 UINT32
64 CheckEDStatus (
65 IN ED_DESCRIPTOR *Ed,
66 IN TD_DESCRIPTOR *HeadTd
67 );
68 /**
69
70 Check the task status
71
72 @Param Ohc UHC private data
73 @Param ListType Pipe type
74 @Param Ed Pointer to the ED task hooked on
75 @Param HeadTd Head of TD corresponding to the task
76 @Param ErrorCode return the ErrorCode
77
78 @retval EFI_SUCCESS Task done
79 @retval EFI_NOT_READY Task on processing
80 @retval EFI_DEVICE_ERROR Some error occured
81
82 **/
83 EFI_STATUS
84 CheckIfDone (
85 IN USB_OHCI_HC_DEV *Ohc,
86 IN DESCRIPTOR_LIST_TYPE ListType,
87 IN ED_DESCRIPTOR *Ed,
88 IN TD_DESCRIPTOR *HeadTd,
89 OUT UINT32 *ErrorCode
90 );
91 /**
92
93 Convert TD condition code to Efi Status
94
95 @Param ConditionCode Condition code to convert
96
97 @retval EFI_SUCCESS No error occured
98 @retval EFI_NOT_READY TD still on processing
99 @retval EFI_DEVICE_ERROR Error occured in processing TD
100
101 **/
102
103 EFI_STATUS
104 OhciTDConditionCodeToStatus (
105 IN UINT32 ConditionCode
106 );
107
108 #endif