[PATCH] pciutils: Extend pci_generic_scan() to scan all 256 buses.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently, pci_generic_scan() scans only bus 0 and its subordinate buses.
Due to this, 'lspci -H1' does not list the devices that are not under
root bus not 0 as shown below:
[root@caliobm11 pciutils]# lspci -n -s 84:00.0
84:00.0 0200: 177d:9702 (rev 02)
[root@caliobm11 pciutils]# lspci -H1 -n -s 84:00.0
[root@caliobm11 pciutils]#

Signed-off-by: Veerasenareddy Burru <vburru@xxxxxxxxxxxxxxxxxx>
---
 lib/generic.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/generic.c b/lib/generic.c
index c219592..9c5e267 100644
--- a/lib/generic.c
+++ b/lib/generic.c
@@ -69,9 +69,14 @@ void
 pci_generic_scan(struct pci_access *a)
 {
   byte busmap[256];
+  int bus;
 
   memset(busmap, 0, sizeof(busmap));
-  pci_generic_scan_bus(a, busmap, 0);
+  for (bus=0; bus<256; bus++)
+    {
+      if (!busmap[bus])
+        pci_generic_scan_bus(a, busmap, bus);
+    }
 }
 
 int
-- 
1.8.3.1




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux