kinfocenter: obtain PCI info via pciutils if possible on FreeBSD

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-06-16 21:13:32 +03:00
parent 3b64183837
commit 368a8a1ec7

View file

@ -18,12 +18,6 @@
#include <sys/types.h>
#include <sys/sysctl.h>
#ifdef HAVE_DEVINFO_H
extern "C" {
#include <devinfo.h>
}
#endif
#include <string.h>
#include <QMap>
@ -34,6 +28,10 @@ extern "C" {
void ProcessChildren(QString name);
#ifdef HAVE_DEVINFO_H
extern "C" {
#include <devinfo.h>
}
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;