Blame SOURCES/0005-Avoid-very-long-IDE-programming-interface-names-as-c.patch

510200
From 54d6169eeaf46b220ca9a30f82cce282a304a456 Mon Sep 17 00:00:00 2001
510200
From: Dan Callaghan <dcallagh@redhat.com>
510200
Date: Mon, 9 Jul 2018 17:46:39 +1000
510200
Subject: [PATCH 05/10] Avoid very long IDE programming interface names as
510200
 capabilities
510200
510200
Recent versions of the PCIID database added programming interface names
510200
for IDE controllers, like this:
510200
510200
	01  IDE interface
510200
		00  ISA Compatibility mode-only controller
510200
		05  PCI native mode-only controller
510200
		0a  ISA Compatibility mode controller, supports both channels switched to PCI native mode
510200
		0f  PCI native mode controller, supports both channels switched to ISA compatibility mode
510200
		80  ISA Compatibility mode-only controller, supports bus mastering
510200
		85  PCI native mode-only controller, supports bus mastering
510200
		8a  ISA Compatibility mode controller, supports both channels switched to PCI native mode, supports bus mastering
510200
		8f  PCI native mode controller, supports both channels switched to ISA compatibility mode, supports bus mastering
510200
510200
resulting in an awkwardly named capability for the IDE controller:
510200
510200
    <capabilities>
510200
     <capability id="ide" />
510200
     <capability id="pci_native_mode_controller__supports_both_channels_switched_to_isa_compatibility_mode__supports_bus_mastering" />
510200
     <capability id="bus_master" >bus mastering</capability>
510200
    </capabilities>
510200
510200
This patch adds a special case for IDE controllers to avoid using the
510200
programming interface name as a capability. Instead, separate
510200
capabilities are added for the possible combinations:
510200
510200
    <capabilities>
510200
     <capability id="ide" />
510200
     <capability id="isa_compat_mode" >ISA compatibility mode</capability>
510200
     <capability id="pci_native_mode" >PCI native mode</capability>
510200
     <capability id="bus_master" >bus mastering</capability>
510200
    </capabilities>
510200
510200
---
510200
 src/core/pci.cc | 16 +++++++++++++++-
510200
 1 file changed, 15 insertions(+), 1 deletion(-)
510200
510200
diff --git a/src/core/pci.cc b/src/core/pci.cc
510200
index 30359cc..8d60b2a 100644
510200
--- a/src/core/pci.cc
510200
+++ b/src/core/pci.cc
510200
@@ -965,7 +965,21 @@ static hwNode *scan_pci_dev(struct pci_dev &d, hwNode & n)
510200
           }
510200
           device->setDescription(get_class_description(dclass));
510200
 
510200
-          if (moredescription != ""
510200
+          if (dclass == PCI_CLASS_STORAGE_IDE)
510200
+          {
510200
+            // IDE programming interface names are really long and awkward,
510200
+            // so don't add them as capabilities
510200
+            if (progif == 0x00 || progif == 0x80)
510200
+              device->addCapability("isa_compat_mode", "ISA compatibility mode");
510200
+            else if (progif == 0x05 || progif == 0x85)
510200
+              device->addCapability("pci_native_mode", "PCI native mode");
510200
+            else if (progif == 0x0a || progif == 0x0f || progif == 0x8a || progif == 0x8f)
510200
+            {
510200
+              device->addCapability("isa_compat_mode", "ISA compatibility mode");
510200
+              device->addCapability("pci_native_mode", "PCI native mode");
510200
+            }
510200
+          }
510200
+          else if (moredescription != ""
510200
             && moredescription != device->getDescription())
510200
           {
510200
             device->addCapability(moredescription);
510200
-- 
510200
2.17.1
510200