qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/arm/virt: Initialize NICs configured in PCI bus
@ 2016-01-06 14:47 Ashok Kumar
  2016-01-06 18:10 ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Ashok Kumar @ 2016-01-06 14:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Ashok Kumar

virtio model is used for default case.

Signed-off-by: Ashok Kumar <ashoks@broadcom.com>
---
 hw/arm/virt.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index acc1fcb..fd52b76 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -808,6 +808,7 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic,
     DeviceState *dev;
     char *nodename;
     int i;
+    PCIHostState *pci;
 
     dev = qdev_create(NULL, TYPE_GPEX_HOST);
     qdev_init_nofail(dev);
@@ -847,6 +848,19 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic,
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, pic[irq + i]);
     }
 
+    pci = PCI_HOST_BRIDGE(dev);
+    if (pci->bus) {
+        for (i = 0; i < nb_nics; i++) {
+            NICInfo *nd = &nd_table[i];
+
+            if (!nd->model) {
+                nd->model = g_strdup("virtio");
+            }
+
+            pci_nic_init_nofail(nd, pci->bus, nd->model, NULL);
+        }
+    }
+
     nodename = g_strdup_printf("/pcie@%" PRIx64, base);
     qemu_fdt_add_subnode(vbi->fdt, nodename);
     qemu_fdt_setprop_string(vbi->fdt, nodename,
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-11 13:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-06 14:47 [Qemu-devel] [PATCH] hw/arm/virt: Initialize NICs configured in PCI bus Ashok Kumar
2016-01-06 18:10 ` Peter Maydell
2016-01-07  5:53   ` Ashok Kumar
     [not found]   ` <568dfd6e.2966420a.4f765.fffff89dSMTPIN_ADDED_BROKEN@mx.google.com>
2016-01-07 14:47     ` Peter Maydell
2016-01-07 15:21       ` Paolo Bonzini
2016-01-11  2:54         ` Jason Wang
2016-01-11 13:24           ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).