From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g2t4622.austin.hp.com (g2t4622.austin.hp.com [15.73.212.79]) (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 CBEC41A1DEF for ; Wed, 7 Sep 2016 23:32:53 -0700 (PDT) Received: from g2t4689.austin.hpicorp.net (g2t4689.austin.hpicorp.net [15.94.10.175]) by g2t4622.austin.hp.com (Postfix) with ESMTP id E951A315; Thu, 8 Sep 2016 06:32:52 +0000 (UTC) Received: from darknight.asiapacific.hpqcorp.net (darknight.asiapacific.hpqcorp.net [16.154.170.151]) by g2t4689.austin.hpicorp.net (Postfix) with ESMTP id C4FBE3F; Thu, 8 Sep 2016 06:32:51 +0000 (UTC) From: Abdul Lateef Attar To: edk2-devel@lists.01.org Date: Sat, 10 Sep 2016 12:01:35 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 Subject: [PATCH v2] 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: Thu, 08 Sep 2016 06:32:54 -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. "-_e" option is changed from TypeFlag to TypeValue, so that user can specify individual AER capability to print. e.g. pci 00 00 01 -i -_e Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Abdul Lateef Attar Reviewed-by: Jaben Carsey --- 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