qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 08/10] hw/isa: Add the ISA_IRQ_NET_DEFAULT definition


From: Philippe Mathieu-Daudé
Subject: [PATCH 08/10] hw/isa: Add the ISA_IRQ_NET_DEFAULT definition
Date: Sun, 11 Oct 2020 21:32:27 +0200

The network devices use IRQ #9 by default. Add this
default definition to the IsaIrqNumber enum.

Avoid magic values in the code, replace them by the
newly introduced definition.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/isa.h | 1 +
 hw/net/ne2000-isa.c  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 9f78ff11246..11166592246 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -15,6 +15,7 @@ enum IsaIrqNumber {
     ISA_IRQ_FDC_DEFAULT =  6,
     ISA_IRQ_PAR_DEFAULT =  7,
     ISA_IRQ_RTC_DEFAULT =  8,
+    ISA_IRQ_NET_DEFAULT =  9,
     ISA_NUM_IRQS        = 16
 };
 
diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c
index dd6f6e34d3c..e31e86c14af 100644
--- a/hw/net/ne2000-isa.c
+++ b/hw/net/ne2000-isa.c
@@ -80,7 +80,7 @@ static void isa_ne2000_realizefn(DeviceState *dev, Error 
**errp)
 
 static Property ne2000_isa_properties[] = {
     DEFINE_PROP_UINT32("iobase", ISANE2000State, iobase, 0x300),
-    DEFINE_PROP_UINT32("irq",   ISANE2000State, isairq, 9),
+    DEFINE_PROP_UINT32("irq", ISANE2000State, isairq, ISA_IRQ_NET_DEFAULT),
     DEFINE_NIC_PROPERTIES(ISANE2000State, ne2000.c),
     DEFINE_PROP_END_OF_LIST(),
 };
-- 
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]