* [PATCH] ShellPkg: pci -i -_e to print next capability
@ 2016-09-06 6:34 Abdul Lateef Attar
2016-09-07 17:38 ` Carsey, Jaben
0 siblings, 1 reply; 2+ messages in thread
From: Abdul Lateef Attar @ 2016-09-06 6:34 UTC (permalink / raw)
To: edk2-devel
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 <abdul-lateef.attar@hpe.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ShellPkg: pci -i -_e to print next capability
2016-09-06 6:34 [PATCH] ShellPkg: pci -i -_e to print next capability Abdul Lateef Attar
@ 2016-09-07 17:38 ` Carsey, Jaben
0 siblings, 0 replies; 2+ messages in thread
From: Carsey, Jaben @ 2016-09-07 17:38 UTC (permalink / raw)
To: Abdul Lateef Attar, edk2-devel@lists.01.org; +Cc: Carsey, Jaben
Change Looks good. Can you please clarify the commit message on why to change -_e type?
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Abdul Lateef Attar
> Sent: Monday, September 05, 2016 11:34 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH] ShellPkg: pci -i -_e to print next capability
> Importance: High
>
> 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 <abdul-lateef.attar@hpe.com>
> ---
> 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
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-07 17:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-06 6:34 [PATCH] ShellPkg: pci -i -_e to print next capability Abdul Lateef Attar
2016-09-07 17:38 ` Carsey, Jaben
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox