]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Bus/Pci/UhciDxe/UhciDebug.c
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
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.
18 This file provides the information dump support for Uhci when in debug mode.
19 You can dynamically adjust the debug level by changing variable gEHCDebugLevel
28 #include "UhciDebug.h"
32 UINTN mUhciDebugMask
= USB_DEBUG_FORCE_OUTPUT
;
36 Debug debug print interface for UHCI
38 @param Format String to use for the print, followed by print arguments
51 VA_START (Marker
, Format
);
52 DebugVPrint (DEBUG_INFO
, Format
, Marker
);
58 Debug error print interface for UHCI
60 @param Format String to use for the print, followed by print arguments
73 VA_START (Marker
, Format
);
74 DebugVPrint (DEBUG_ERROR
, Format
, Marker
);
81 Debug print interface for UHCI
83 @param Level Level to control debug print
84 @param Format String to use for the print, followed by print arguments
98 VA_START (Marker
, Format
);
100 if (Level
& mUhciDebugMask
) {
101 if (mUhciDebugMask
& USB_DEBUG_FORCE_OUTPUT
) {
102 DebugVPrint (DEBUG_ERROR
, Format
, Marker
);
104 DebugVPrint (DEBUG_INFO
, Format
, Marker
);
113 Dump the content of QH structure
115 @param QhSw Pointer to software QH structure
127 Level
= UHCI_DEBUG_QH
;
129 UhciDebugPrint (Level
, "&QhSw @ 0x%x\n", QhSw
);
130 UhciDebugPrint (Level
, "QhSw.NextQh - 0x%x\n", QhSw
->NextQh
);
131 UhciDebugPrint (Level
, "QhSw.TDs - 0x%x\n", QhSw
->TDs
);
132 UhciDebugPrint (Level
, "QhSw.QhHw:\n");
133 UhciDebugPrint (Level
, " Horizon Link - %x\n", QhSw
->QhHw
.HorizonLink
);
134 UhciDebugPrint (Level
, " Vertical Link - %x\n\n", QhSw
->QhHw
.VerticalLink
);
139 Dump the content of TD structure.
141 @param TdSw Pointer to software TD structure
142 @param IsCur Whether dump the whole list, or only dump the current TD
155 Level
= UHCI_DEBUG_TD
;
158 while (CurTdSw
!= NULL
) {
159 UhciDebugPrint (Level
, "TdSw @ 0x%x\n", CurTdSw
);
160 UhciDebugPrint (Level
, "TdSw.NextTd - 0x%x\n", CurTdSw
->NextTd
);
161 UhciDebugPrint (Level
, "TdSw.DataLen - %d\n", CurTdSw
->DataLen
);
162 UhciDebugPrint (Level
, "TdSw.Data - 0x%x\n", CurTdSw
->Data
);
163 UhciDebugPrint (Level
, "TdHw:\n");
164 UhciDebugPrint (Level
, " NextLink - 0x%x\n", CurTdSw
->TdHw
.NextLink
);
165 UhciDebugPrint (Level
, " ActualLen - %d\n", CurTdSw
->TdHw
.ActualLen
);
166 UhciDebugPrint (Level
, " Status - 0x%x\n", CurTdSw
->TdHw
.Status
);
167 UhciDebugPrint (Level
, " IOC - %d\n", CurTdSw
->TdHw
.IntOnCpl
);
168 UhciDebugPrint (Level
, " IsIsoCh - %d\n", CurTdSw
->TdHw
.IsIsoch
);
169 UhciDebugPrint (Level
, " LowSpeed - %d\n", CurTdSw
->TdHw
.LowSpeed
);
170 UhciDebugPrint (Level
, " ErrorCount - %d\n", CurTdSw
->TdHw
.ErrorCount
);
171 UhciDebugPrint (Level
, " ShortPacket - %d\n", CurTdSw
->TdHw
.ShortPacket
);
172 UhciDebugPrint (Level
, " PidCode - 0x%x\n", CurTdSw
->TdHw
.PidCode
);
173 UhciDebugPrint (Level
, " DevAddr - %d\n", CurTdSw
->TdHw
.DeviceAddr
);
174 UhciDebugPrint (Level
, " EndPoint - %d\n", CurTdSw
->TdHw
.EndPoint
);
175 UhciDebugPrint (Level
, " DataToggle - %d\n", CurTdSw
->TdHw
.DataToggle
);
176 UhciDebugPrint (Level
, " MaxPacketLen - %d\n", CurTdSw
->TdHw
.MaxPacketLen
);
177 UhciDebugPrint (Level
, " DataBuffer - 0x%x\n\n",CurTdSw
->TdHw
.DataBuffer
);
179 CurTdSw
= CurTdSw
->NextTd
;