From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g1t6220.austin.hp.com (g1t6220.austin.hp.com [15.73.96.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4536E1A1E2E for ; Mon, 5 Sep 2016 23:34:03 -0700 (PDT) Received: from g1t6217.austin.hpicorp.net (g1t6217.austin.hpicorp.net [15.67.1.144]) by g1t6220.austin.hp.com (Postfix) with ESMTP id 6CEFD457; Tue, 6 Sep 2016 06:34:02 +0000 (UTC) Received: from darknight.asiapacific.hpqcorp.net (darknight.asiapacific.hpqcorp.net [16.154.170.151]) by g1t6217.austin.hpicorp.net (Postfix) with ESMTP id 40CAD5F; Tue, 6 Sep 2016 06:34:00 +0000 (UTC) From: Abdul Lateef Attar To: edk2-devel@lists.01.org Date: Tue, 6 Sep 2016 12:04:12 +0530 Message-Id: <3ac3b70ae8a01c19a82b09787879b351b71d4763.1472819042.git.abdul-lateef.attar@hpe.com> X-Mailer: git-send-email 2.7.4 Subject: [PATCH] ShellPkg: pci -i -_e to print next capability X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2016 06:34:03 -0000 According to PCI spec the next AER capability is relative to the beginning of PCI configuration space. Hence substract the base offset to get the next capability. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Abdul Lateef Attar --- ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c index 337495e..664c22b 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c @@ -2370,7 +2370,7 @@ PCI_CONFIG_SPACE *mConfigSpace = NULL; STATIC CONST SHELL_PARAM_ITEM ParamList[] = { {L"-s", TypeValue}, {L"-i", TypeFlag}, - {L"-_e", TypeFlag}, + {L"-_e", TypeValue}, {NULL, TypeMax} }; @@ -5914,7 +5914,7 @@ PciExplainPciExpress ( // Advance to the next item if it exists // if (ExtHdr->NextCapabilityOffset != 0) { - ExtHdr = (PCI_EXP_EXT_HDR*)((UINT8*)ExRegBuffer + ExtHdr->NextCapabilityOffset); + ExtHdr = (PCI_EXP_EXT_HDR*)((UINT8*)ExRegBuffer + ExtHdr->NextCapabilityOffset - EFI_PCIE_CAPABILITY_BASE_OFFSET); } else { break; } -- 2.7.4