summary refs log tree commit diff stats
path: root/hw/pci/pci.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2024-08-01 03:44:50 -0400
committerMichael S. Tsirkin <mst@redhat.com>2024-08-01 04:32:00 -0400
commit93829009a685687e2fb48158cb5df18c4eb49d07 (patch)
treef698ceb909a25d89a59770dca6a429749504239d /hw/pci/pci.c
parentf1feffc4ef4b1c02daa5ce23fa8ad728c8ef7ce9 (diff)
downloadfocaccia-qemu-93829009a685687e2fb48158cb5df18c4eb49d07.tar.gz
focaccia-qemu-93829009a685687e2fb48158cb5df18c4eb49d07.zip
Revert "hw/pci: Rename has_power to enabled"
This reverts commit 6a31b219a5338564f3978251c79f96f689e037da.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci/pci.c')
-rw-r--r--hw/pci/pci.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index b532888e8f..fab86d0567 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1525,7 +1525,7 @@ static void pci_update_mappings(PCIDevice *d)
             continue;
 
         new_addr = pci_bar_address(d, i, r->type, r->size);
-        if (!d->enabled) {
+        if (!d->has_power) {
             new_addr = PCI_BAR_UNMAPPED;
         }
 
@@ -1613,7 +1613,7 @@ void pci_default_write_config(PCIDevice *d, uint32_t addr, uint32_t val_in, int
         pci_update_irq_disabled(d, was_irq_disabled);
         memory_region_set_enabled(&d->bus_master_enable_region,
                                   (pci_get_word(d->config + PCI_COMMAND)
-                                   & PCI_COMMAND_MASTER) && d->enabled);
+                                   & PCI_COMMAND_MASTER) && d->has_power);
     }
 
     msi_write_config(d, addr, val_in, l);
@@ -2884,18 +2884,18 @@ MSIMessage pci_get_msi_message(PCIDevice *dev, int vector)
     return msg;
 }
 
-void pci_set_enabled(PCIDevice *d, bool state)
+void pci_set_power(PCIDevice *d, bool state)
 {
-    if (d->enabled == state) {
+    if (d->has_power == state) {
         return;
     }
 
-    d->enabled = state;
+    d->has_power = state;
     pci_update_mappings(d);
     memory_region_set_enabled(&d->bus_master_enable_region,
                               (pci_get_word(d->config + PCI_COMMAND)
-                               & PCI_COMMAND_MASTER) && d->enabled);
-    if (!d->enabled) {
+                               & PCI_COMMAND_MASTER) && d->has_power);
+    if (!d->has_power) {
         pci_device_reset(d);
     }
 }