]> mj.ucw.cz Git - pciutils.git/commitdiff
Advanced Error Reporting capability support
authorZhao, Yu <yu.zhao@intel.com>
Thu, 3 Jul 2008 09:39:23 +0000 (17:39 +0800)
committerMartin Mares <mj@ucw.cz>
Tue, 26 Aug 2008 11:37:35 +0000 (13:37 +0200)
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
lib/header.h |    5 ++++-
lspci.c      |   47 ++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 50 insertions(+), 2 deletions(-)

lib/header.h
lspci.c

index b92baadf479ad5bfb733f448207cfc21a5a57583..ef4b8fb3f42b37c34fc138c034b73d8ed152f4de 100644 (file)
 
 /* Advanced Error Reporting */
 #define PCI_ERR_UNCOR_STATUS   4       /* Uncorrectable Error Status */
-#define  PCI_ERR_UNC_TRAIN     0x00000001      /* Training */
+#define  PCI_ERR_UNC_TRAIN     0x00000001      /* Undefined in PCIe rev1.1 & 2.0 spec */
 #define  PCI_ERR_UNC_DLP       0x00000010      /* Data Link Protocol */
+#define  PCI_ERR_UNC_SDES      0x00000020      /* Surprise Down Error */
 #define  PCI_ERR_UNC_POISON_TLP        0x00001000      /* Poisoned TLP */
 #define  PCI_ERR_UNC_FCP       0x00002000      /* Flow Control Protocol */
 #define  PCI_ERR_UNC_COMP_TIME 0x00004000      /* Completion Timeout */
 #define  PCI_ERR_UNC_MALF_TLP  0x00040000      /* Malformed TLP */
 #define  PCI_ERR_UNC_ECRC      0x00080000      /* ECRC Error Status */
 #define  PCI_ERR_UNC_UNSUP     0x00100000      /* Unsupported Request */
+#define  PCI_ERR_UNC_ACS_VIOL  0x00200000      /* ACS Violation */
 #define PCI_ERR_UNCOR_MASK     8       /* Uncorrectable Error Mask */
        /* Same bits as above */
 #define PCI_ERR_UNCOR_SEVER    12      /* Uncorrectable Error Severity */
 #define  PCI_ERR_COR_BAD_DLLP  0x00000080      /* Bad DLLP Status */
 #define  PCI_ERR_COR_REP_ROLL  0x00000100      /* REPLAY_NUM Rollover */
 #define  PCI_ERR_COR_REP_TIMER 0x00001000      /* Replay Timer Timeout */
+#define  PCI_ERR_COR_REP_ANFE  0x00002000      /* Advisory Non-Fatal Error */
 #define PCI_ERR_COR_MASK       20      /* Correctable Error Mask */
        /* Same bits as above */
 #define PCI_ERR_CAP            24      /* Advanced Error Capabilities */
diff --git a/lspci.c b/lspci.c
index 1d3018a8445a4777edf54834843da4bd0ed1bf34..207ca60aae725c75449c583cc57dd9d7411272e8 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -1490,6 +1490,51 @@ cap_debug_port(int cap)
   printf("Debug port: BAR=%d offset=%04x\n", bar, pos);
 }
 
+static void
+cap_aer(struct device *d, int where)
+{
+  u32 l;
+
+  printf("Advanced Error Reporting\n");
+  if (!config_fetch(d, where + PCI_ERR_UNCOR_STATUS, 24))
+    return;
+
+  l = get_conf_long(d, where + PCI_ERR_UNCOR_STATUS);
+  printf("\t\tUESta:\tDLP%c SDES%c TLP%c FCP%c CmpltTO%c CmpltAbrt%c UnxCmplt%c RxOF%c "
+       "MalfTLP%c ECRC%c UnsupReq%c ACSVoil%c\n",
+       FLAG(l, PCI_ERR_UNC_DLP), FLAG(l, PCI_ERR_UNC_SDES), FLAG(l, PCI_ERR_UNC_POISON_TLP),
+       FLAG(l, PCI_ERR_UNC_FCP), FLAG(l, PCI_ERR_UNC_COMP_TIME), FLAG(l, PCI_ERR_UNC_COMP_ABORT),
+       FLAG(l, PCI_ERR_UNC_UNX_COMP), FLAG(l, PCI_ERR_UNC_RX_OVER), FLAG(l, PCI_ERR_UNC_MALF_TLP),
+       FLAG(l, PCI_ERR_UNC_ECRC), FLAG(l, PCI_ERR_UNC_UNSUP), FLAG(l, PCI_ERR_UNC_ACS_VIOL));
+  l = get_conf_long(d, where + PCI_ERR_UNCOR_MASK);
+  printf("\t\tUEMsk:\tDLP%c SDES%c TLP%c FCP%c CmpltTO%c CmpltAbrt%c UnxCmplt%c RxOF%c "
+       "MalfTLP%c ECRC%c UnsupReq%c ACSVoil%c\n",
+       FLAG(l, PCI_ERR_UNC_DLP), FLAG(l, PCI_ERR_UNC_SDES), FLAG(l, PCI_ERR_UNC_POISON_TLP),
+       FLAG(l, PCI_ERR_UNC_FCP), FLAG(l, PCI_ERR_UNC_COMP_TIME), FLAG(l, PCI_ERR_UNC_COMP_ABORT),
+       FLAG(l, PCI_ERR_UNC_UNX_COMP), FLAG(l, PCI_ERR_UNC_RX_OVER), FLAG(l, PCI_ERR_UNC_MALF_TLP),
+       FLAG(l, PCI_ERR_UNC_ECRC), FLAG(l, PCI_ERR_UNC_UNSUP), FLAG(l, PCI_ERR_UNC_ACS_VIOL));
+  l = get_conf_long(d, where + PCI_ERR_UNCOR_SEVER);
+  printf("\t\tUESvrt:\tDLP%c SDES%c TLP%c FCP%c CmpltTO%c CmpltAbrt%c UnxCmplt%c RxOF%c "
+       "MalfTLP%c ECRC%c UnsupReq%c ACSVoil%c\n",
+       FLAG(l, PCI_ERR_UNC_DLP), FLAG(l, PCI_ERR_UNC_SDES), FLAG(l, PCI_ERR_UNC_POISON_TLP),
+       FLAG(l, PCI_ERR_UNC_FCP), FLAG(l, PCI_ERR_UNC_COMP_TIME), FLAG(l, PCI_ERR_UNC_COMP_ABORT),
+       FLAG(l, PCI_ERR_UNC_UNX_COMP), FLAG(l, PCI_ERR_UNC_RX_OVER), FLAG(l, PCI_ERR_UNC_MALF_TLP),
+       FLAG(l, PCI_ERR_UNC_ECRC), FLAG(l, PCI_ERR_UNC_UNSUP), FLAG(l, PCI_ERR_UNC_ACS_VIOL));
+  l = get_conf_long(d, where + PCI_ERR_COR_STATUS);
+  printf("\t\tCESta:\tRxErr%c BadTLP%c BadDLLP%c Rollover%c Timeout%c NonFatalErr%c\n",
+       FLAG(l, PCI_ERR_COR_RCVR), FLAG(l, PCI_ERR_COR_BAD_TLP), FLAG(l, PCI_ERR_COR_BAD_DLLP),
+       FLAG(l, PCI_ERR_COR_REP_ROLL), FLAG(l, PCI_ERR_COR_REP_TIMER), FLAG(l, PCI_ERR_COR_REP_ANFE));
+  l = get_conf_long(d, where + PCI_ERR_COR_MASK);
+  printf("\t\tCESta:\tRxErr%c BadTLP%c BadDLLP%c Rollover%c Timeout%c NonFatalErr%c\n",
+       FLAG(l, PCI_ERR_COR_RCVR), FLAG(l, PCI_ERR_COR_BAD_TLP), FLAG(l, PCI_ERR_COR_BAD_DLLP),
+       FLAG(l, PCI_ERR_COR_REP_ROLL), FLAG(l, PCI_ERR_COR_REP_TIMER), FLAG(l, PCI_ERR_COR_REP_ANFE));
+  l = get_conf_long(d, where + PCI_ERR_CAP);
+  printf("\t\tAERCap:\tFirst Error Pointer: %02x, GenCap%c CGenEn%c ChkCap%c ChkEn%c\n",
+       PCI_ERR_CAP_FEP(l), FLAG(l, PCI_ERR_CAP_ECRC_GENC), FLAG(l, PCI_ERR_CAP_ECRC_GENE),
+       FLAG(l, PCI_ERR_CAP_ECRC_CHKC), FLAG(l, PCI_ERR_CAP_ECRC_CHKE));
+
+}
+
 static void
 show_ext_caps(struct device *d)
 {
@@ -1516,7 +1561,7 @@ show_ext_caps(struct device *d)
       switch (id)
        {
          case PCI_EXT_CAP_ID_AER:
-           printf("Advanced Error Reporting <?>\n");
+           cap_aer(d, where);
            break;
          case PCI_EXT_CAP_ID_VC:
            printf("Virtual Channel <?>\n");