[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/3] msi: Cleanup uninit
From: |
Alex Williamson |
Subject: |
[Qemu-devel] [PATCH 2/3] msi: Cleanup uninit |
Date: |
Mon, 01 Nov 2010 23:37:45 -0600 |
User-agent: |
StGIT/0.14.3 |
This makes msi_uninit more similar to msix_uninit, doing nothing if not
enable, clearing msi_cap and capability flag.
Signed-off-by: Alex Williamson <address@hidden>
---
hw/msi.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/hw/msi.c b/hw/msi.c
index 0ad4e38..110859b 100644
--- a/hw/msi.c
+++ b/hw/msi.c
@@ -170,9 +170,15 @@ int msi_init(struct PCIDevice *dev, uint8_t offset,
void msi_uninit(struct PCIDevice *dev)
{
- uint16_t flags = pci_get_word(dev->config + msi_flags_off(dev));
- uint8_t cap_size = msi_cap_sizeof(flags);
+ uint8_t cap_size;
+
+ if (!(dev->cap_present & QEMU_PCI_CAP_MSI))
+ return;
+
+ cap_size = msi_cap_sizeof(pci_get_word(dev->config + msi_flags_off(dev)));
pci_del_capability(dev, PCI_CAP_ID_MSIX, cap_size);
+ dev->msi_cap = 0;
+ dev->cap_present &= ~QEMU_PCI_CAP_MSI;
MSI_DEV_PRINTF(dev, "uninit\n");
}
- [Qemu-devel] [PATCH 0/3] msi: Small fixes and enhancements, Alex Williamson, 2010/11/02
- [Qemu-devel] [PATCH 1/3] msi: Allow pre-existing MSI capabilities, Alex Williamson, 2010/11/02
- [Qemu-devel] [PATCH 2/3] msi: Cleanup uninit,
Alex Williamson <=
- [Qemu-devel] [PATCH 3/3] msi: Store the capability size in PCIDevice, Alex Williamson, 2010/11/02
- [Qemu-devel] Re: [PATCH 3/3] msi: Store the capability size in PCIDevice, Michael S. Tsirkin, 2010/11/02
- [Qemu-devel] Re: [PATCH 3/3] msi: Store the capability size in PCIDevice, Alex Williamson, 2010/11/02
- [Qemu-devel] Re: [PATCH 3/3] msi: Store the capability size in PCIDevice, Michael S. Tsirkin, 2010/11/02
- [Qemu-devel] Re: [PATCH 3/3] msi: Store the capability size in PCIDevice, Alex Williamson, 2010/11/02
- [Qemu-devel] Re: [PATCH 3/3] msi: Store the capability size in PCIDevice, Michael S. Tsirkin, 2010/11/02
- [Qemu-devel] Re: [PATCH 3/3] msi: Store the capability size in PCIDevice, Alex Williamson, 2010/11/02
- [Qemu-devel] Re: [PATCH 3/3] msi: Store the capability size in PCIDevice, Michael S. Tsirkin, 2010/11/02