summaryrefslogtreecommitdiffstats
path: root/qemu/include/hw/pci
diff options
context:
space:
mode:
Diffstat (limited to 'qemu/include/hw/pci')
-rw-r--r--qemu/include/hw/pci/msi.h2
-rw-r--r--qemu/include/hw/pci/msix.h16
-rw-r--r--qemu/include/hw/pci/pci-assign.h27
-rw-r--r--qemu/include/hw/pci/pci.h19
-rw-r--r--qemu/include/hw/pci/pci_bridge.h2
-rw-r--r--qemu/include/hw/pci/pci_ids.h1
-rw-r--r--qemu/include/hw/pci/pcie_aer.h3
-rw-r--r--qemu/include/hw/pci/shpc.h1
8 files changed, 58 insertions, 13 deletions
diff --git a/qemu/include/hw/pci/msi.h b/qemu/include/hw/pci/msi.h
index 50e452bd0..8124908ab 100644
--- a/qemu/include/hw/pci/msi.h
+++ b/qemu/include/hw/pci/msi.h
@@ -29,7 +29,7 @@ struct MSIMessage {
uint32_t data;
};
-extern bool msi_supported;
+extern bool msi_nonbroken;
void msi_set_message(PCIDevice *dev, MSIMessage msg);
MSIMessage msi_get_message(PCIDevice *dev, unsigned int vector);
diff --git a/qemu/include/hw/pci/msix.h b/qemu/include/hw/pci/msix.h
index 954d82b35..72e5f931c 100644
--- a/qemu/include/hw/pci/msix.h
+++ b/qemu/include/hw/pci/msix.h
@@ -46,12 +46,16 @@ void msix_unset_vector_notifiers(PCIDevice *dev);
extern const VMStateDescription vmstate_msix;
-#define VMSTATE_MSIX(_field, _state) { \
- .name = (stringify(_field)), \
- .size = sizeof(PCIDevice), \
- .vmsd = &vmstate_msix, \
- .flags = VMS_STRUCT, \
- .offset = vmstate_offset_value(_state, _field, PCIDevice), \
+#define VMSTATE_MSIX_TEST(_field, _state, _test) { \
+ .name = (stringify(_field)), \
+ .size = sizeof(PCIDevice), \
+ .vmsd = &vmstate_msix, \
+ .flags = VMS_STRUCT, \
+ .offset = vmstate_offset_value(_state, _field, PCIDevice), \
+ .field_exists = (_test) \
}
+#define VMSTATE_MSIX(_f, _s) \
+ VMSTATE_MSIX_TEST(_f, _s, NULL)
+
#endif
diff --git a/qemu/include/hw/pci/pci-assign.h b/qemu/include/hw/pci/pci-assign.h
new file mode 100644
index 000000000..55f42c56f
--- /dev/null
+++ b/qemu/include/hw/pci/pci-assign.h
@@ -0,0 +1,27 @@
+/*
+ * This work is licensed under the terms of the GNU GPL, version 2. See
+ * the COPYING file in the top-level directory.
+ *
+ * Just split from hw/i386/kvm/pci-assign.c.
+ */
+#ifndef PCI_ASSIGN_H
+#define PCI_ASSIGN_H
+
+#include "hw/pci/pci.h"
+
+//#define DEVICE_ASSIGNMENT_DEBUG
+
+#ifdef DEVICE_ASSIGNMENT_DEBUG
+#define DEBUG(fmt, ...) \
+ do { \
+ fprintf(stderr, "%s: " fmt, __func__ , __VA_ARGS__); \
+ } while (0)
+#else
+#define DEBUG(fmt, ...)
+#endif
+
+void *pci_assign_dev_load_option_rom(PCIDevice *dev, struct Object *owner,
+ int *size, unsigned int domain,
+ unsigned int bus, unsigned int slot,
+ unsigned int function);
+#endif /* PCI_ASSIGN_H */
diff --git a/qemu/include/hw/pci/pci.h b/qemu/include/hw/pci/pci.h
index 551cb3d60..ef6ba51f6 100644
--- a/qemu/include/hw/pci/pci.h
+++ b/qemu/include/hw/pci/pci.h
@@ -1,12 +1,9 @@
#ifndef QEMU_PCI_H
#define QEMU_PCI_H
-#include "qemu-common.h"
-
#include "hw/qdev.h"
#include "exec/memory.h"
#include "sysemu/dma.h"
-#include "qapi/error.h"
/* PCI includes legacy ISA access. */
#include "hw/isa/isa.h"
@@ -93,10 +90,20 @@
#define PCI_DEVICE_ID_REDHAT_PCIE_HOST 0x0008
#define PCI_DEVICE_ID_REDHAT_PXB 0x0009
#define PCI_DEVICE_ID_REDHAT_BRIDGE_SEAT 0x000a
+#define PCI_DEVICE_ID_REDHAT_PXB_PCIE 0x000b
#define PCI_DEVICE_ID_REDHAT_QXL 0x0100
#define FMT_PCIBUS PRIx64
+typedef uint64_t pcibus_t;
+
+struct PCIHostDeviceAddress {
+ unsigned int domain;
+ unsigned int bus;
+ unsigned int slot;
+ unsigned int function;
+};
+
typedef void PCIConfigWriteFunc(PCIDevice *pci_dev,
uint32_t address, uint32_t data, int len);
typedef uint32_t PCIConfigReadFunc(PCIDevice *pci_dev,
@@ -397,6 +404,7 @@ void pci_for_each_bus_depth_first(PCIBus *bus,
void *(*begin)(PCIBus *bus, void *parent_state),
void (*end)(PCIBus *bus, void *state),
void *parent_state);
+PCIDevice *pci_get_function_0(PCIDevice *pci_dev);
/* Use this wrapper when specific scan order is not required. */
static inline
@@ -677,6 +685,11 @@ static inline uint32_t pci_config_size(const PCIDevice *d)
return pci_is_express(d) ? PCIE_CONFIG_SPACE_SIZE : PCI_CONFIG_SPACE_SIZE;
}
+static inline uint16_t pci_requester_id(PCIDevice *dev)
+{
+ return (pci_bus_num(dev->bus) << 8) | dev->devfn;
+}
+
/* DMA access functions */
static inline AddressSpace *pci_get_address_space(PCIDevice *dev)
{
diff --git a/qemu/include/hw/pci/pci_bridge.h b/qemu/include/hw/pci/pci_bridge.h
index 93b621cef..ed4aff6cd 100644
--- a/qemu/include/hw/pci/pci_bridge.h
+++ b/qemu/include/hw/pci/pci_bridge.h
@@ -48,7 +48,7 @@ void pci_bridge_disable_base_limit(PCIDevice *dev);
void pci_bridge_reset_reg(PCIDevice *dev);
void pci_bridge_reset(DeviceState *qdev);
-int pci_bridge_initfn(PCIDevice *pci_dev, const char *typename);
+void pci_bridge_initfn(PCIDevice *pci_dev, const char *typename);
void pci_bridge_exitfn(PCIDevice *pci_dev);
diff --git a/qemu/include/hw/pci/pci_ids.h b/qemu/include/hw/pci/pci_ids.h
index d98e6c915..db85afa03 100644
--- a/qemu/include/hw/pci/pci_ids.h
+++ b/qemu/include/hw/pci/pci_ids.h
@@ -64,6 +64,7 @@
#define PCI_VENDOR_ID_LSI_LOGIC 0x1000
#define PCI_DEVICE_ID_LSI_53C810 0x0001
#define PCI_DEVICE_ID_LSI_53C895A 0x0012
+#define PCI_DEVICE_ID_LSI_SAS1068 0x0054
#define PCI_DEVICE_ID_LSI_SAS1078 0x0060
#define PCI_DEVICE_ID_LSI_SAS0079 0x0079
diff --git a/qemu/include/hw/pci/pcie_aer.h b/qemu/include/hw/pci/pcie_aer.h
index 2fb83882b..c2ee4e2bd 100644
--- a/qemu/include/hw/pci/pcie_aer.h
+++ b/qemu/include/hw/pci/pcie_aer.h
@@ -87,7 +87,7 @@ struct PCIEAERErr {
extern const VMStateDescription vmstate_pcie_aer_log;
-int pcie_aer_init(PCIDevice *dev, uint16_t offset);
+int pcie_aer_init(PCIDevice *dev, uint16_t offset, uint16_t size);
void pcie_aer_exit(PCIDevice *dev);
void pcie_aer_write_config(PCIDevice *dev,
uint32_t addr, uint32_t val, int len);
@@ -102,5 +102,6 @@ void pcie_aer_root_write_config(PCIDevice *dev,
/* error injection */
int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err);
+void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg);
#endif /* QEMU_PCIE_AER_H */
diff --git a/qemu/include/hw/pci/shpc.h b/qemu/include/hw/pci/shpc.h
index 2c871b947..b2085543d 100644
--- a/qemu/include/hw/pci/shpc.h
+++ b/qemu/include/hw/pci/shpc.h
@@ -4,7 +4,6 @@
#include "qemu-common.h"
#include "exec/memory.h"
#include "migration/vmstate.h"
-#include "qapi/error.h"
#include "hw/hotplug.h"
#include "hw/pci/pci.h"