From 368a8a1ec758569536b56e060df15fdc11159e95 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Wed, 16 Jun 2021 21:13:32 +0300 Subject: [PATCH] kinfocenter: obtain PCI info via pciutils if possible on FreeBSD Signed-off-by: Ivailo Monev --- kinfocenter/Modules/base/info_fbsd.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/kinfocenter/Modules/base/info_fbsd.cpp b/kinfocenter/Modules/base/info_fbsd.cpp index 396d17b5..9a8b1e33 100644 --- a/kinfocenter/Modules/base/info_fbsd.cpp +++ b/kinfocenter/Modules/base/info_fbsd.cpp @@ -18,12 +18,6 @@ #include #include -#ifdef HAVE_DEVINFO_H -extern "C" { -#include -} -#endif - #include #include @@ -34,6 +28,10 @@ extern "C" { void ProcessChildren(QString name); #ifdef HAVE_DEVINFO_H +extern "C" { +#include +} + extern "C" { int print_irq(struct devinfo_rman *rman, void *arg); int print_dma(struct devinfo_rman *rman, void *arg); @@ -42,6 +40,10 @@ extern "C" { } #endif +#ifdef HAVE_PCIUTILS +#include "kpci.h" +#endif //HAVE_PCIUTILS + bool GetInfo_IRQ(QTreeWidget* tree) { #ifdef HAVE_DEVINFO_H /* systat lists the interrupts assigned to devices as well as how many were @@ -125,6 +127,12 @@ bool GetInfo_SCSI(QTreeWidget* tree) { } bool GetInfo_PCI(QTreeWidget* tree) { +#ifdef HAVE_PCIUTILS + if (GetInfo_PCIUtils(tree)) { + return true; + } +#endif //HAVE_PCIUTILS + FILE *pipe; QString s; QByteArray cmd;