]> xenbits.xensource.com Git - seabios.git/commitdiff
pci: Consistently set pci->have_drivers for devices with internal drivers
authorKevin O'Connor <kevin@koconnor.net>
Wed, 3 Feb 2016 03:50:33 +0000 (22:50 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 3 Feb 2016 04:37:05 +0000 (23:37 -0500)
Set the pci->have_drivers flag for any device that calls
pci_enable_x() to ensure that the flag is consistently set on any
device with an internal driver.  Setting this flag prevents an option
rom on the device from being executed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/hw/ata.c
src/hw/pci.c

index 7aaf2f1d5d3f3e14cdec68a1356acfbdf7af018d..12dab961cac91ab764cccff978ae806c43abd74f 100644 (file)
@@ -945,7 +945,6 @@ init_controller(struct pci_device *pci, int chanid, int irq
 static void
 init_pciata(struct pci_device *pci, u8 prog_if)
 {
-    pci->have_driver = 1;
     u8 pciirq = pci_config_readb(pci->bdf, PCI_INTERRUPT_LINE);
     int master = 0;
     if (CONFIG_ATA_DMA && prog_if & 0x80) {
index 86b7d546bad839b5663ed73b0a509d53821e7473..76c293c88d1660fdc7df07ca5d3d38e37bc7138f 100644 (file)
@@ -279,6 +279,7 @@ pci_enable_busmaster(struct pci_device *pci)
     ASSERT32FLAT();
     wait_preempt();
     pci_config_maskw(pci->bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER);
+    pci->have_driver = 1;
 }
 
 // Verify an IO bar and return it to the caller
@@ -298,6 +299,7 @@ pci_enable_iobar(struct pci_device *pci, u32 addr)
         return 0;
     }
     pci_config_maskw(pci->bdf, PCI_COMMAND, 0, PCI_COMMAND_IO);
+    pci->have_driver = 1;
     return bar;
 }
 
@@ -326,6 +328,7 @@ pci_enable_membar(struct pci_device *pci, u32 addr)
         return NULL;
     }
     pci_config_maskw(pci->bdf, PCI_COMMAND, 0, PCI_COMMAND_MEMORY);
+    pci->have_driver = 1;
     return (void*)bar;
 }