From 1dc324d20f7404fd6a416f16c2cb9a4ec50a4dd7 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Sun, 12 Feb 2012 14:12:21 +0200 Subject: shpc: standard hot plug controller This adds support for SHPC interface, as defined by PCI Standard Hot-Plug Controller and Subsystem Specification, Rev 1.0 http://www.pcisig.com/specifications/conventional/pci_hot_plug/SHPC_10 Only SHPC intergrated with a PCI-to-PCI bridge is supported, SHPC integrated with a host bridge would need more work. All main SHPC features are supported: - MRL sensor - Attention button - Attention indicator - Power indicator Wake on hotplug and serr generation are stubbed out but unused as we don't have interfaces to generate these events ATM. One issue that isn't completely resolved is that qemu currently expects an "eject" interface, which SHPC does not provide: it merely removes the power to device and it's up to the user to remove the device from slot. This patch works around that by ejecting the device when power is removed and power LED goes off. Signed-off-by: Michael S. Tsirkin --- hw/pci.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hw/pci.h') diff --git a/hw/pci.h b/hw/pci.h index 704d3f3b44..dc4d9d10a7 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -126,6 +126,9 @@ enum { /* command register SERR bit enabled */ #define QEMU_PCI_CAP_SERR_BITNR 4 QEMU_PCI_CAP_SERR = (1 << QEMU_PCI_CAP_SERR_BITNR), + /* Standard hot plug controller. */ +#define QEMU_PCI_SHPC_BITNR 5 + QEMU_PCI_CAP_SHPC = (1 << QEMU_PCI_SHPC_BITNR), }; #define TYPE_PCI_DEVICE "pci-device" @@ -230,6 +233,9 @@ struct PCIDevice { /* PCI Express */ PCIExpressDevice exp; + /* SHPC */ + SHPCDevice *shpc; + /* Location of option rom */ char *romfile; bool has_rom; -- cgit v1.2.3