lspci: Decode AER Root Error Command, Root Error Status, Error Source

Decode the AER Root Error Command, Root Error Status, and Error Source
Identification registers.

Per PCIe r3.1, sec 7.10, these registers are only available for Root Ports
and Root Complex Event Collectors, so we have to check the Device/Port Type
from the PCIe capability.

The difference in the "lspci -vv" output looks like this (for a Root Port):

+       RootCmd: CERptEn- NFERptEn- FERptEn-
+       RootSta: CERcvd- MultCERcvd- UERcvd- MultUERcvd-
+                FirstFatal- NonFatalMsg- FatalMsg- IntMsg 0
+       ErrorSrc: ERR_COR: 0000 ERR_FATAL/NONFATAL: 0000

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
5 files changed