]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c
25a4dbff9bd8f55b2caffd9024bbd1ceb01934c8
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.
17 This file provides the information dump support for EHCI when in debug mode.
27 Dump the status byte in QTD/QH to a more friendly
30 @param State The state in the QTD/QH
41 if (EHC_BIT_IS_SET (State
, QTD_STAT_DO_PING
)) {
42 DEBUG ((EFI_D_INFO
, " Do_Ping"));
44 DEBUG ((EFI_D_INFO
, " Do_Out"));
47 if (EHC_BIT_IS_SET (State
, QTD_STAT_DO_CS
)) {
48 DEBUG ((EFI_D_INFO
, " Do_CS"));
50 DEBUG ((EFI_D_INFO
, " Do_SS"));
53 if (EHC_BIT_IS_SET (State
, QTD_STAT_TRANS_ERR
)) {
54 DEBUG ((EFI_D_INFO
, " Transfer_Error"));
57 if (EHC_BIT_IS_SET (State
, QTD_STAT_BABBLE_ERR
)) {
58 DEBUG ((EFI_D_INFO
, " Babble_Error"));
61 if (EHC_BIT_IS_SET (State
, QTD_STAT_BUFF_ERR
)) {
62 DEBUG ((EFI_D_INFO
, " Buffer_Error"));
65 if (EHC_BIT_IS_SET (State
, QTD_STAT_HALTED
)) {
66 DEBUG ((EFI_D_INFO
, " Halted"));
69 if (EHC_BIT_IS_SET (State
, QTD_STAT_ACTIVE
)) {
70 DEBUG ((EFI_D_INFO
, " Active"));
73 DEBUG ((EFI_D_INFO
, "\n"));
78 Dump the fields of a QTD
80 @param Qtd The QTD to dump
81 @param Msg The message to print before the dump
96 DEBUG ((EFI_D_INFO
, Msg
));
99 DEBUG ((EFI_D_INFO
, "Queue TD @ 0x%x, data length %d\n", Qtd
, Qtd
->DataLen
));
103 DEBUG ((EFI_D_INFO
, "Next QTD : %x\n", QtdHw
->NextQtd
));
104 DEBUG ((EFI_D_INFO
, "AltNext QTD : %x\n", QtdHw
->AltNext
));
105 DEBUG ((EFI_D_INFO
, "Status : %x\n", QtdHw
->Status
));
106 EhcDumpStatus (QtdHw
->Status
);
108 if (QtdHw
->Pid
== QTD_PID_SETUP
) {
109 DEBUG ((EFI_D_INFO
, "PID : Setup\n"));
111 } else if (QtdHw
->Pid
== QTD_PID_INPUT
) {
112 DEBUG ((EFI_D_INFO
, "PID : IN\n"));
114 } else if (QtdHw
->Pid
== QTD_PID_OUTPUT
) {
115 DEBUG ((EFI_D_INFO
, "PID : OUT\n"));
119 DEBUG ((EFI_D_INFO
, "Error Count : %d\n", QtdHw
->ErrCnt
));
120 DEBUG ((EFI_D_INFO
, "Current Page : %d\n", QtdHw
->CurPage
));
121 DEBUG ((EFI_D_INFO
, "IOC : %d\n", QtdHw
->IOC
));
122 DEBUG ((EFI_D_INFO
, "Total Bytes : %d\n", QtdHw
->TotalBytes
));
123 DEBUG ((EFI_D_INFO
, "Data Toggle : %d\n", QtdHw
->DataToggle
));
125 for (Index
= 0; Index
< 5; Index
++) {
126 DEBUG ((EFI_D_INFO
, "Page[%d] : 0x%x\n", Index
, QtdHw
->Page
[Index
]));
134 @param Qh The queue head to dump
135 @param Msg The message to print before the dump
136 @param DumpBuf Whether to dump the memory buffer of the associated QTD
154 DEBUG ((EFI_D_INFO
, Msg
));
157 DEBUG ((EFI_D_INFO
, "Queue head @ 0x%x, interval %d, next qh %x\n",
158 Qh
, Qh
->Interval
, Qh
->NextQh
));
162 DEBUG ((EFI_D_INFO
, "Hoziontal link: %x\n", QhHw
->HorizonLink
));
163 DEBUG ((EFI_D_INFO
, "Device address: %d\n", QhHw
->DeviceAddr
));
164 DEBUG ((EFI_D_INFO
, "Inactive : %d\n", QhHw
->Inactive
));
165 DEBUG ((EFI_D_INFO
, "EP number : %d\n", QhHw
->EpNum
));
166 DEBUG ((EFI_D_INFO
, "EP speed : %d\n", QhHw
->EpSpeed
));
167 DEBUG ((EFI_D_INFO
, "DT control : %d\n", QhHw
->DtCtrl
));
168 DEBUG ((EFI_D_INFO
, "Reclaim head : %d\n", QhHw
->ReclaimHead
));
169 DEBUG ((EFI_D_INFO
, "Max packet len: %d\n", QhHw
->MaxPacketLen
));
170 DEBUG ((EFI_D_INFO
, "Ctrl EP : %d\n", QhHw
->CtrlEp
));
171 DEBUG ((EFI_D_INFO
, "Nak reload : %d\n", QhHw
->NakReload
));
173 DEBUG ((EFI_D_INFO
, "SMask : %x\n", QhHw
->SMask
));
174 DEBUG ((EFI_D_INFO
, "CMask : %x\n", QhHw
->CMask
));
175 DEBUG ((EFI_D_INFO
, "Hub address : %d\n", QhHw
->HubAddr
));
176 DEBUG ((EFI_D_INFO
, "Hub port : %d\n", QhHw
->PortNum
));
177 DEBUG ((EFI_D_INFO
, "Multiplier : %d\n", QhHw
->Multiplier
));
179 DEBUG ((EFI_D_INFO
, "Cur QTD : %x\n", QhHw
->CurQtd
));
181 DEBUG ((EFI_D_INFO
, "Next QTD : %x\n", QhHw
->NextQtd
));
182 DEBUG ((EFI_D_INFO
, "AltNext QTD : %x\n", QhHw
->AltQtd
));
183 DEBUG ((EFI_D_INFO
, "Status : %x\n", QhHw
->Status
));
185 EhcDumpStatus (QhHw
->Status
);
187 if (QhHw
->Pid
== QTD_PID_SETUP
) {
188 DEBUG ((EFI_D_INFO
, "PID : Setup\n"));
190 } else if (QhHw
->Pid
== QTD_PID_INPUT
) {
191 DEBUG ((EFI_D_INFO
, "PID : IN\n"));
193 } else if (QhHw
->Pid
== QTD_PID_OUTPUT
) {
194 DEBUG ((EFI_D_INFO
, "PID : OUT\n"));
197 DEBUG ((EFI_D_INFO
, "Error Count : %d\n", QhHw
->ErrCnt
));
198 DEBUG ((EFI_D_INFO
, "Current Page : %d\n", QhHw
->CurPage
));
199 DEBUG ((EFI_D_INFO
, "IOC : %d\n", QhHw
->IOC
));
200 DEBUG ((EFI_D_INFO
, "Total Bytes : %d\n", QhHw
->TotalBytes
));
201 DEBUG ((EFI_D_INFO
, "Data Toggle : %d\n", QhHw
->DataToggle
));
203 for (Index
= 0; Index
< 5; Index
++) {
204 DEBUG ((EFI_D_INFO
, "Page[%d] : 0x%x\n", Index
, QhHw
->Page
[Index
]));
207 DEBUG ((EFI_D_INFO
, "\n"));
209 EFI_LIST_FOR_EACH (Entry
, &Qh
->Qtds
) {
210 Qtd
= EFI_LIST_CONTAINER (Entry
, EHC_QTD
, QtdList
);
211 EhcDumpQtd (Qtd
, NULL
);
213 if (DumpBuf
&& (Qtd
->DataLen
!= 0)) {
214 EhcDumpBuf (Qtd
->Data
, Qtd
->DataLen
);
221 Dump the buffer in the form of hex
223 @param Buf The buffer to dump
224 @param Len The length of buffer
237 for (Index
= 0; Index
< Len
; Index
++) {
238 if (Index
% 16 == 0) {
239 DEBUG ((EFI_D_INFO
,"\n"));
242 DEBUG ((EFI_D_INFO
, "%02x ", Buf
[Index
]));
245 DEBUG ((EFI_D_INFO
, "\n"));