From c3ad4b3179a97bf22261d95fb4db67de77e1f173 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 27 Apr 2022 16:15:32 +0200 Subject: [statistics] Honor pci device revision for passthrough display --- modules-available/statistics/pages/machine.inc.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'modules-available/statistics/pages') diff --git a/modules-available/statistics/pages/machine.inc.php b/modules-available/statistics/pages/machine.inc.php index 0d91b017..798a5a83 100644 --- a/modules-available/statistics/pages/machine.inc.php +++ b/modules-available/statistics/pages/machine.inc.php @@ -103,13 +103,14 @@ class SubPage 'locationid', $locations); $hw->addGlobalColumn('vendor'); $hw->addGlobalColumn('device'); + $hw->addGlobalColumn('rev'); $res = $hw->query(); foreach ($res as $row) { - $devId = $row['vendor'] . ':' . $row['device']; + $devId = $row['vendor'] . ':' . $row['device'] . ':' . $row['rev']; if (!isset($passthroughTypes[$devId])) { $passthroughTypes[$devId] = []; } - $passthroughTypes[$devId][] = $row['@PASSTHROUGH']; + $passthroughTypes[$devId][$row['@PASSTHROUGH']] = $row['@PASSTHROUGH']; } } // 2) Sort and mangle list @@ -125,8 +126,8 @@ class SubPage $pciLookup[$devId] = true; } // Passthrough enabled? - if (isset($passthroughTypes[$devId])) { - $item['pt'] = implode(', ', $passthroughTypes[$devId]); + if (isset($passthroughTypes[$devId . ':' . $item['rev']])) { + $item['pt'] = implode(', ', $passthroughTypes[$devId . ':' . $item['rev']]); } $class = $item['class']; if ($class === '0300' || $class === '0200' || $class === '0403' || !empty($item['pt'])) { -- cgit v1.2.3-55-g7522