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