[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v9 12/13] e1000e: remove unnecessary internal msi st
From: |
Cao jin |
Subject: |
[Qemu-devel] [PATCH v9 12/13] e1000e: remove unnecessary internal msi state flag |
Date: |
Mon, 20 Jun 2016 14:13:43 +0800 |
Internal big flag E1000E_USE_MSI is unnecessary, also is the helper
function: e1000e_init_msi(), e1000e_cleanup_msi(), so, remove them all.
cc: Dmitry Fleytman <address@hidden>
cc: Jason Wang <address@hidden>
cc: Markus Armbruster <address@hidden>
cc: Marcel Apfelbaum <address@hidden>
cc: Michael S. Tsirkin <address@hidden>
Signed-off-by: Cao jin <address@hidden>
---
hw/net/e1000e.c | 33 +++++++--------------------------
1 file changed, 7 insertions(+), 26 deletions(-)
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
index a06d184..c7d33ee 100644
--- a/hw/net/e1000e.c
+++ b/hw/net/e1000e.c
@@ -89,8 +89,7 @@ typedef struct E1000EState {
#define E1000E_MSIX_TABLE (0x0000)
#define E1000E_MSIX_PBA (0x2000)
-#define E1000E_USE_MSI BIT(0)
-#define E1000E_USE_MSIX BIT(1)
+#define E1000E_USE_MSIX BIT(0)
static uint64_t
e1000e_mmio_read(void *opaque, hwaddr addr, unsigned size)
@@ -264,28 +263,6 @@ static void e1000e_core_realize(E1000EState *s)
}
static void
-e1000e_init_msi(E1000EState *s)
-{
- int res;
-
- res = msi_init(PCI_DEVICE(s), 0xD0, 1, true, false, NULL);
-
- if (!res) {
- s->intr_state |= E1000E_USE_MSI;
- } else {
- trace_e1000e_msi_init_fail(res);
- }
-}
-
-static void
-e1000e_cleanup_msi(E1000EState *s)
-{
- if (s->intr_state & E1000E_USE_MSI) {
- msi_uninit(PCI_DEVICE(s));
- }
-}
-
-static void
e1000e_unuse_msix_vectors(E1000EState *s, int num_vectors)
{
int i;
@@ -440,6 +417,7 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error
**errp)
static const uint16_t e1000e_dsn_offset = 0x140;
E1000EState *s = E1000E(pci_dev);
uint8_t *macaddr;
+ int ret;
trace_e1000e_cb_pci_realize();
@@ -489,7 +467,10 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error
**errp)
hw_error("Failed to initialize PCIe capability");
}
- e1000e_init_msi(s);
+ ret = msi_init(PCI_DEVICE(s), 0xD0, 1, true, false, NULL);
+ if (ret) {
+ trace_e1000e_msi_init_fail(ret);
+ }
if (e1000e_add_pm_capability(pci_dev, e1000e_pmrb_offset,
PCI_PM_CAP_DSI) < 0) {
@@ -528,7 +509,7 @@ static void e1000e_pci_uninit(PCIDevice *pci_dev)
qemu_del_nic(s->nic);
e1000e_cleanup_msix(s);
- e1000e_cleanup_msi(s);
+ msi_uninit(pci_dev);
}
static void e1000e_qdev_reset(DeviceState *dev)
--
2.1.0
- [Qemu-devel] [PATCH v9 07/13] pci bridge dev: change msi property type, (continued)
- [Qemu-devel] [PATCH v9 07/13] pci bridge dev: change msi property type, Cao jin, 2016/06/20
- [Qemu-devel] [PATCH v9 04/13] intel-hda: change msi property type, Cao jin, 2016/06/20
- [Qemu-devel] [PATCH v9 01/13] change pvscsi_init_msi() type to void, Cao jin, 2016/06/20
- [Qemu-devel] [PATCH v9 02/13] mptsas: change .realize function name, Cao jin, 2016/06/20
- [Qemu-devel] [PATCH v9 06/13] megasas: change msi/msix property type, Cao jin, 2016/06/20
- [Qemu-devel] [PATCH v9 10/13] mptsas: remove unnecessary internal msi state flag, Cao jin, 2016/06/20
- [Qemu-devel] [PATCH v9 03/13] usb xhci: change msi/msix property type, Cao jin, 2016/06/20
- [Qemu-devel] [PATCH v9 13/13] vmw_pvscsi: remove unnecessary internal msi state flag, Cao jin, 2016/06/20
- [Qemu-devel] [PATCH v9 12/13] e1000e: remove unnecessary internal msi state flag,
Cao jin <=
- [Qemu-devel] [PATCH v9 11/13] vmxnet3: remove unnecessary internal msi state flag, Cao jin, 2016/06/20
- [Qemu-devel] [PATCH v9 09/13] megasas: remove unnecessary megasas_use_msi(), Cao jin, 2016/06/20
- [Qemu-devel] [PATCH v9 08/13] pci: Convert msi_init() to Error and fix callers to check it, Cao jin, 2016/06/20
- Re: [Qemu-devel] [PATCH v9 00/13] Add param Error ** for msi_init()--part2, Cao jin, 2016/06/28