]> mj.ucw.cz Git - pciutils.git/blobdiff - lspci.h
lspci: Decode PCIe Link Capabilities 2, expand Link Status 2
[pciutils.git] / lspci.h
diff --git a/lspci.h b/lspci.h
index bcd007e34bd44f4f81f1606a7b2a1cb0da7bf549..fefee5256423a4790487e06cd31419eb8d5d978a 100644 (file)
--- a/lspci.h
+++ b/lspci.h
@@ -1,7 +1,7 @@
 /*
  *     The PCI Utilities -- List All PCI Devices
  *
- *     Copyright (c) 1997--2010 Martin Mares <mj@ucw.cz>
+ *     Copyright (c) 1997--2018 Martin Mares <mj@ucw.cz>
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -34,6 +34,11 @@ extern char *opt_pcimap;
 struct device {
   struct device *next;
   struct pci_dev *dev;
+  /* Bus topology calculated by grow_tree() */
+  struct device *bus_next;
+  struct bus *parent_bus;
+  struct bridge *bridge;
+  /* Cache */
   unsigned int config_cached, config_bufsize;
   byte *config;                                /* Cached configuration space data */
   byte *present;                       /* Maps which configuration bytes are present */
@@ -82,7 +87,27 @@ void show_kernel_cleanup(void);
 
 /* ls-tree.c */
 
-void show_forest(void);
+struct bridge {
+  struct bridge *chain;                        /* Single-linked list of bridges */
+  struct bridge *next, *child;         /* Tree of bridges */
+  struct bus *first_bus;               /* List of buses connected to this bridge */
+  unsigned int domain;
+  unsigned int primary, secondary, subordinate;        /* Bus numbers */
+  struct device *br_dev;
+};
+
+struct bus {
+  unsigned int domain;
+  unsigned int number;
+  struct bus *sibling;
+  struct bridge *parent_bridge;
+  struct device *first_dev, **last_dev;
+};
+
+extern struct bridge host_bridge;
+
+void grow_tree(void);
+void show_forest(struct pci_filter *filter);
 
 /* ls-map.c */