]> git.proxmox.com Git - mirror_edk2.git/blob - QuarkSocPkg/QuarkSouthCluster/Usb/Ohci/Dxe/OhciDebug.c
QuarkSocPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / QuarkSocPkg / QuarkSouthCluster / Usb / Ohci / Dxe / OhciDebug.c
1 /** @file
2 This file provides the information dump support for OHCI when in debug mode.
3
4 Copyright (c) 2013-2015 Intel Corporation.
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10
11 #include "Ohci.h"
12
13
14 /*++
15
16 Print the data of ED and the TDs attached to the ED
17
18 @param Uhc Pointer to OHCI private data
19 @param Ed Pointer to a ED to free
20 @param Td Pointer to the Td head
21
22 @retval EFI_SUCCESS ED
23
24 **/
25 EFI_STATUS
26 OhciDumpEdTdInfo (
27 IN USB_OHCI_HC_DEV *Uhc,
28 IN ED_DESCRIPTOR *Ed,
29 IN TD_DESCRIPTOR *Td,
30 BOOLEAN Stage
31 )
32 {
33 UINT32 Index;
34
35 if (Stage) {
36 DEBUG ((EFI_D_INFO, "\n Before executing command\n"));
37 }else{
38 DEBUG ((EFI_D_INFO, "\n after executing command\n"));
39 }
40 if (Ed != NULL) {
41 DEBUG ((EFI_D_INFO, "\nED Address:%p, ED buffer:\n", Ed));
42 DEBUG ((EFI_D_INFO, "DWord0 :TD Tail :TD Head :Next ED\n"));
43 for (Index = 0; Index < sizeof (ED_DESCRIPTOR)/4; Index ++) {
44 DEBUG ((EFI_D_INFO, "%8x ", *((UINT32*)(Ed) + Index) ));
45 }
46 DEBUG ((EFI_D_INFO, "\nNext TD buffer:%p\n", Td));
47 }
48 while (Td != NULL) {
49 if (Td->Word0.DirPID == TD_SETUP_PID) {
50 DEBUG ((EFI_D_INFO, "\nSetup PID "));
51 }else if (Td->Word0.DirPID == TD_OUT_PID) {
52 DEBUG ((EFI_D_INFO, "\nOut PID "));
53 }else if (Td->Word0.DirPID == TD_IN_PID) {
54 DEBUG ((EFI_D_INFO, "\nIn PID "));
55 }else if (Td->Word0.DirPID == TD_NODATA_PID) {
56 DEBUG ((EFI_D_INFO, "\nNo data PID "));
57 }
58 DEBUG ((EFI_D_INFO, "TD Address:%p, TD buffer:\n", Td));
59 DEBUG ((EFI_D_INFO, "DWord0 :CuBuffer:Next TD :Buff End:Next TD :DataBuff:ActLength\n"));
60 for (Index = 0; Index < sizeof (TD_DESCRIPTOR)/4; Index ++) {
61 DEBUG ((EFI_D_INFO, "%8x ", *((UINT32*)(Td) + Index) ));
62 }
63 DEBUG ((EFI_D_INFO, "\nCurrent TD Data buffer(size%d)\n", (UINT32)Td->ActualSendLength));
64 for (Index = 0; Index < Td->ActualSendLength; Index ++) {
65 DEBUG ((EFI_D_INFO, "%2x ", *(UINT8 *)(UINTN)(Td->DataBuffer + Index) ));
66 }
67 Td = (TD_DESCRIPTOR *)(UINTN)(Td->NextTDPointer);
68 }
69 DEBUG ((EFI_D_INFO, "\n TD buffer End\n"));
70
71 return EFI_SUCCESS;
72 }
73
74
75
76
77
78