]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: pci -i -_e to print next capability
authorAbdul Lateef Attar <abdul-lateef.attar@hpe.com>
Sat, 10 Sep 2016 06:31:35 +0000 (23:31 -0700)
committerJaben Carsey <jaben.carsey@intel.com>
Thu, 8 Sep 2016 16:27:40 +0000 (09:27 -0700)
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 <capability-id>

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Abdul Lateef Attar <abdul-lateef.attar@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c

index 337495e16892d324c2b222d4b87bdfefa31e5243..664c22bd822c400a7ff3705823e9e80954053a0d 100644 (file)
@@ -2370,7 +2370,7 @@ PCI_CONFIG_SPACE  *mConfigSpace = NULL;
 STATIC CONST SHELL_PARAM_ITEM ParamList[] = {\r
   {L"-s", TypeValue},\r
   {L"-i", TypeFlag},\r
 STATIC CONST SHELL_PARAM_ITEM ParamList[] = {\r
   {L"-s", TypeValue},\r
   {L"-i", TypeFlag},\r
-  {L"-_e", TypeFlag},\r
+  {L"-_e", TypeValue},\r
   {NULL, TypeMax}\r
   };\r
 \r
   {NULL, TypeMax}\r
   };\r
 \r
@@ -5914,7 +5914,7 @@ PciExplainPciExpress (
       // Advance to the next item if it exists\r
       //\r
       if (ExtHdr->NextCapabilityOffset != 0) {\r
       // Advance to the next item if it exists\r
       //\r
       if (ExtHdr->NextCapabilityOffset != 0) {\r
-        ExtHdr = (PCI_EXP_EXT_HDR*)((UINT8*)ExRegBuffer + ExtHdr->NextCapabilityOffset);\r
+        ExtHdr = (PCI_EXP_EXT_HDR*)((UINT8*)ExRegBuffer + ExtHdr->NextCapabilityOffset - EFI_PCIE_CAPABILITY_BASE_OFFSET);\r
       } else {\r
         break;\r
       }\r
       } else {\r
         break;\r
       }\r