]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
lspci: Display CardBus bridge capabilities
authorMatthew Wilcox <matthew@wil.cx>
Sat, 20 Apr 2013 13:45:32 +0000 (07:45 -0600)
committerMartin Mares <mj@ucw.cz>
Sat, 20 Apr 2013 20:31:26 +0000 (22:31 +0200)
CardBus bridges can have capabilities, but the CAP_PTR register is at a
different location.  This one has Power Management:

CardBus bridge: O2 Micro, Inc. OZ711SP1 Memory CardBus Controller (rev 01)
+       Capabilities: [a0] Power Management version 2

lib/header.h
ls-caps.c
lspci.c
lspci.h

index b418982bd2d566be0c7a5484a19da731a4401a7f..69518fd838b6326f2ba3d137d040cf5123de659a 100644 (file)
 #define  PCI_BRIDGE_CTL_DISCARD_TIMER_SERR_EN 0x800    /* PCI-X? */
 
 /* Header type 2 (CardBus bridges) */
-/* 0x14-0x15 reserved */
+#define PCI_CB_CAPABILITY_LIST 0x14
+/* 0x15 reserved */
 #define PCI_CB_SEC_STATUS      0x16    /* Secondary status */
 #define PCI_CB_PRIMARY_BUS     0x18    /* PCI bus number */
 #define PCI_CB_CARD_BUS                0x19    /* CardBus bus number */
index 0f6fab37bc6d55c82bbbcf81fbcae00594d1265a..bddb45562adcb8b3dbfe548bad908fc789e976a1 100644 (file)
--- a/ls-caps.c
+++ b/ls-caps.c
@@ -1242,13 +1242,13 @@ cap_sata_hba(struct device *d, int where, int cap)
 }
 
 void
-show_caps(struct device *d)
+show_caps(struct device *d, int where)
 {
   int can_have_ext_caps = 0;
 
   if (get_conf_word(d, PCI_STATUS) & PCI_STATUS_CAP_LIST)
     {
-      int where = get_conf_byte(d, PCI_CAPABILITY_LIST) & ~3;
+      where = get_conf_byte(d, where) & ~3;
       byte been_there[256];
       memset(been_there, 0, 256);
       while (where)
diff --git a/lspci.c b/lspci.c
index bd810149bce96b695888cb62cec7a5d28a5b5fc0..dbba6782401eb8598b023088e54c3a2c529b42e6 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -461,7 +461,7 @@ show_htype0(struct device *d)
 {
   show_bases(d, 6);
   show_rom(d, PCI_ROM_ADDRESS);
-  show_caps(d);
+  show_caps(d, PCI_CAPABILITY_LIST);
 }
 
 static void
@@ -567,7 +567,7 @@ show_htype1(struct device *d)
        FLAG(brc, PCI_BRIDGE_CTL_DISCARD_TIMER_SERR_EN));
     }
 
-  show_caps(d);
+  show_caps(d, PCI_CAPABILITY_LIST);
 }
 
 static void
@@ -635,6 +635,7 @@ show_htype2(struct device *d)
   exca = get_conf_word(d, PCI_CB_LEGACY_MODE_BASE);
   if (exca)
     printf("\t16-bit legacy interface ports at %04x\n", exca);
+  show_caps(d, PCI_CB_CAPABILITY_LIST);
 }
 
 static void
diff --git a/lspci.h b/lspci.h
index 81aca269ae99a8a356c668ce25c9815541e31369..86429b2c73b43c8291729376ae693e9c8862d295 100644 (file)
--- a/lspci.h
+++ b/lspci.h
@@ -64,7 +64,7 @@ void cap_vpd(struct device *d);
 
 /* ls-caps.c */
 
-void show_caps(struct device *d);
+void show_caps(struct device *d, int where);
 
 /* ls-ecaps.c */