X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=lspci.h;h=4d711a555d65f7a5233e120afc56de56fcc07383;hb=7d23054d18402b1891343f090d3cd37d7e83c82f;hp=c498b7c970e64e8eb409056112877f2b88445581;hpb=c7a349934e4b9160d5788c60f168bae1f0b6dd9d;p=pciutils.git diff --git a/lspci.h b/lspci.h index c498b7c..4d711a5 100644 --- a/lspci.h +++ b/lspci.h @@ -1,9 +1,11 @@ /* * The PCI Utilities -- List All PCI Devices * - * Copyright (c) 1997--2008 Martin Mares + * Copyright (c) 1997--2018 Martin Mares * - * Can be freely distributed and used under the terms of the GNU GPL. + * Can be freely distributed and used under the terms of the GNU GPL v2+ + * + * SPDX-License-Identifier: GPL-2.0-or-later */ #define PCIUTILS_LSPCI @@ -14,7 +16,7 @@ * This increases our memory footprint, but only slightly since we don't * use alloca() much. */ -#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__DragonFly__) +#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__DragonFly__) || defined (__DJGPP__) /* alloca() is defined in stdlib.h */ #elif defined(__GNUC__) && !defined(PCI_OS_WINDOWS) #include @@ -34,6 +36,12 @@ 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 */ + int no_config_access; unsigned int config_cached, config_bufsize; byte *config; /* Cached configuration space data */ byte *present; /* Maps which configuration bytes are present */ @@ -50,30 +58,51 @@ u32 get_conf_long(struct device *d, unsigned int pos); word get_conf_word(struct device *d, unsigned int pos); byte get_conf_byte(struct device *d, unsigned int pos); -void get_subid(struct device *d, word *subvp, word *subdp); - -#define FLAG(x,y) ((x & y) ? '+' : '-') - /* ls-vpd.c */ 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 */ -void show_ext_caps(struct device *d); +void show_ext_caps(struct device *d, int type); + +/* ls-caps-vendor.c */ + +void show_vendor_caps(struct device *d, int where, int cap); /* ls-kernel.c */ void show_kernel_machine(struct device *d UNUSED); void show_kernel(struct device *d UNUSED); +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, *prev, *child; /* Tree of bridges */ + struct bus *first_bus, *last_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 */