]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.h
Fixed potential issues to release resources when error occurs.
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / EhciDxe / EhciDebug.h
1 /** @file
2
3 Copyright (c) 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 EhciDebug.h
15
16 Abstract:
17
18 This file contains the definination for host controller debug support routines
19
20 Revision History
21
22 **/
23
24 #ifndef _EFI_EHCI_DEBUG_H_
25 #define _EFI_EHCI_DEBUG_H_
26
27
28 enum {
29 USB_DEBUG_FORCE_OUTPUT = (UINTN)(1 << 0),
30
31 EHC_DEBUG_QH = (UINTN)(1 << 8),
32 EHC_DEBUG_QTD = (UINTN)(1 << 9),
33 EHC_DEBUG_BUF = (UINTN)(1 << 10)
34 };
35
36
37 /**
38 EHCI's debug output function. It determines whether
39 to output by the mask and level
40
41 @param Level The output level
42 @param Format The format parameters to the print
43 @param ... The variable length parameters after format
44
45 @return None
46
47 **/
48 VOID
49 EhciDebugPrint (
50 IN UINTN Level,
51 IN CHAR8 *Format,
52 ...
53 )
54 ;
55
56
57 /**
58 EHCI's debug output function. It determines whether
59 to output by the mask and level
60
61 @param Format The format parameters to the print
62 @param ... The variable length parameters after format
63
64 @return None
65
66 **/
67 VOID
68 EhcDebug (
69 IN CHAR8 *Format,
70 ...
71 )
72 ;
73
74
75
76 /**
77 EHCI's error output function. It determines whether
78 to output by the mask and level
79
80 @param Format The format parameters to the print
81 @param ... The variable length parameters after format
82
83 @return None
84
85 **/
86 VOID
87 EhcError (
88 IN CHAR8 *Format,
89 ...
90 )
91 ;
92
93
94
95 /**
96 Dump the fields of a QTD
97
98 @param Qtd The QTD to dump
99 @param Msg The message to print before the dump
100
101 @return None
102
103 **/
104 VOID
105 EhcDumpQtd (
106 IN EHC_QTD *Qtd,
107 IN UINT8 *Msg
108 )
109 ;
110
111
112
113 /**
114 Dump the queue head
115
116 @param Qh The queue head to dump
117 @param Msg The message to print before the dump
118 @param DumpBuf Whether to dump the memory buffer of the associated QTD
119
120 @return None
121
122 **/
123 VOID
124 EhcDumpQh (
125 IN EHC_QH *Qh,
126 IN UINT8 *Msg,
127 IN BOOLEAN DumpBuf
128 )
129 ;
130
131
132
133 /**
134 Dump the buffer in the form of hex
135
136 @param Buf The buffer to dump
137 @param Len The length of buffer
138
139 @return None
140
141 **/
142 VOID
143 EhcDumpBuf (
144 IN UINT8 *Buf,
145 IN UINTN Len
146 )
147 ;
148
149 #ifdef EFI_DEBUG
150 #define EHC_DEBUG(arg) EhcDebug arg
151 #define EHC_ERROR(arg) EhcError arg
152 #define EHC_DUMP_QH(arg) EhcDumpQh arg
153 #define EHC_DUMP_QTD(arg) EhcDumpQtd arg
154 #define EHC_DUMP_BUF(arg) EhcDumpBuf arg
155 #else
156 #define EHC_DEBUG(arg)
157 #define EHC_ERROR(arg)
158 #define EHC_DUMP_QH(arg)
159 #define EHC_DUMP_QTD(arg)
160 #define EHC_DUMP_BUF(arg)
161 #endif
162
163 #endif