]> mj.ucw.cz Git - pciutils.git/commitdiff
Decode all bits in type 1 headers
authorMartin Mares <mj@ucw.cz>
Fri, 28 May 2004 10:45:38 +0000 (10:45 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 5 May 2006 12:18:18 +0000 (14:18 +0200)
lspci.c: Decode all bits of the secondary status word in type 1 headers.
Thanks to Maciej W. Rozycki <macro@ds2.pg.gda.pl> for the patch.
git-archimport-id: mj@ucw.cz--public/pciutils--main--2.2--patch-38

ChangeLog
Makefile
TODO
lib/header.h
lspci.c

index e22207b364cec0f3fb137478562434a67d3978cc..8afa15153d4f89f9916b38a267d9b0a5f3258219 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-05-28  Martin Mares  <mj@ucw.cz>
+
+       * lspci.c: Decode all bits of the secondary status word in type 1 headers.
+       Thanks to Maciej W. Rozycki <macro@ds2.pg.gda.pl> for the patch.
+
 2003-12-27  Martin Mares  <mj@ucw.cz>
 
        * Released as 2.1.99-test3.
index cb824e9caac9b629496e999285c66277fdbefcbd..7ff7207b64279847eb817d4cbdcec7e16410f08e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,11 @@
 # Makefile for The PCI Utilities
-# (c) 1998--2003 Martin Mares <mj@ucw.cz>
+# (c) 1998--2004 Martin Mares <mj@ucw.cz>
 
 OPT=-O2 -fomit-frame-pointer
 CFLAGS=$(OPT) -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -Winline
 
-VERSION=2.1.99-test3
-DATE=2003-12-27
+VERSION=2.1.99-test4
+DATE=2004-05-28
 
 PREFIX=/usr/local
 SBINDIR=$(PREFIX)/sbin
diff --git a/TODO b/TODO
index 84150242c3c2daa3a5cc53eeaafda774c16f7208..302330696e7100ee4427bf871e8e157c2152a023 100644 (file)
--- a/TODO
+++ b/TODO
@@ -6,3 +6,5 @@
 - names.c: rewrite
 
 - spelling: buses x busses
+
+- update the web page
index 5fb4101e87aa04623688d068d27e4b0bc10d1246..5ffd06afa000df35f76819745b4f85ce4c2eea86 100644 (file)
 #define  PCI_IO_RANGE_TYPE_16  0x00
 #define  PCI_IO_RANGE_TYPE_32  0x01
 #define  PCI_IO_RANGE_MASK     ~0x0f
-#define PCI_SEC_STATUS         0x1e    /* Secondary status register, only bit 14 used */
+#define PCI_SEC_STATUS         0x1e    /* Secondary status register */
 #define PCI_MEMORY_BASE                0x20    /* Memory range behind */
 #define PCI_MEMORY_LIMIT       0x22
 #define  PCI_MEMORY_RANGE_TYPE_MASK 0x0f
diff --git a/lspci.c b/lspci.c
index 3fde622dbbe7884d85c54dc089b55f28f94e7d33..5d1a0fc1176c7c31d8580ae3ab696065b237bde3 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -1,7 +1,7 @@
 /*
  *     The PCI Utilities -- List All PCI Devices
  *
- *     Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz>
+ *     Copyright (c) 1997--2004 Martin Mares <mj@ucw.cz>
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -688,6 +688,7 @@ show_htype1(struct device *d)
   u32 pref_base = get_conf_word(d, PCI_PREF_MEMORY_BASE);
   u32 pref_limit = get_conf_word(d, PCI_PREF_MEMORY_LIMIT);
   u32 pref_type = pref_base & PCI_PREF_RANGE_TYPE_MASK;
+  word sec_stat = get_conf_word(d, PCI_SEC_STATUS);
   word brc = get_conf_word(d, PCI_BRIDGE_CONTROL);
   int verb = verbose > 2;
 
@@ -745,8 +746,19 @@ show_htype1(struct device *d)
        }
     }
 
-  if (get_conf_word(d, PCI_SEC_STATUS) & PCI_STATUS_SIG_SYSTEM_ERROR)
-    printf("\tSecondary status: SERR\n");
+  if (verbose > 1)
+    printf("\tSecondary status: 66Mhz%c FastB2B%c ParErr%c DEVSEL=%s >TAbort%c <TAbort%c <MAbort%c >SERR%c <PERR%c\n",
+            FLAG(sec_stat, PCI_STATUS_66MHZ),
+            FLAG(sec_stat, PCI_STATUS_FAST_BACK),
+            FLAG(sec_stat, PCI_STATUS_PARITY),
+            ((sec_stat & PCI_STATUS_DEVSEL_MASK) == PCI_STATUS_DEVSEL_SLOW) ? "slow" :
+            ((sec_stat & PCI_STATUS_DEVSEL_MASK) == PCI_STATUS_DEVSEL_MEDIUM) ? "medium" :
+            ((sec_stat & PCI_STATUS_DEVSEL_MASK) == PCI_STATUS_DEVSEL_FAST) ? "fast" : "??",
+            FLAG(sec_stat, PCI_STATUS_SIG_TARGET_ABORT),
+            FLAG(sec_stat, PCI_STATUS_REC_TARGET_ABORT),
+            FLAG(sec_stat, PCI_STATUS_REC_MASTER_ABORT),
+            FLAG(sec_stat, PCI_STATUS_SIG_SYSTEM_ERROR),
+            FLAG(sec_stat, PCI_STATUS_DETECTED_PARITY));
 
   show_rom(d);