summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2009-10-08 19:58:30 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-15 09:32:02 -0500
commit283c7c63f5c56c4d0340fb39093fb47e75cb122e (patch)
treec07299f36322356dac05fb41d3059e614e0073a2 /hw
parent5869c4d515128cd3a938a7346a8037abcc232220 (diff)
downloadhqemu-283c7c63f5c56c4d0340fb39093fb47e75cb122e.zip
hqemu-283c7c63f5c56c4d0340fb39093fb47e75cb122e.tar.gz
net: allow NICs to be connected to netdevs
Introduce a 'peer' member to VLANClientState as an alternative to a vlan. The idea being that packets are transfered directly from peer clients rather than going through a vlan. Patchworks-ID: 35516 Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/dp8393x.c3
-rw-r--r--hw/etraxfs_eth.c3
-rw-r--r--hw/mcf_fec.c3
-rw-r--r--hw/mipsnet.c5
-rw-r--r--hw/qdev.c6
-rw-r--r--hw/usb-net.c3
-rw-r--r--hw/xen_nic.c2
7 files changed, 16 insertions, 9 deletions
diff --git a/hw/dp8393x.c b/hw/dp8393x.c
index 067831d..e4caab0 100644
--- a/hw/dp8393x.c
+++ b/hw/dp8393x.c
@@ -889,7 +889,8 @@ void dp83932_init(NICInfo *nd, target_phys_addr_t base, int it_shift,
s->watchdog = qemu_new_timer(vm_clock, dp8393x_watchdog, s);
s->regs[SONIC_SR] = 0x0004; /* only revision recognized by Linux */
- s->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
+ s->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->netdev,
+ nd->model, nd->name,
nic_can_receive, nic_receive, NULL,
nic_cleanup, s);
diff --git a/hw/etraxfs_eth.c b/hw/etraxfs_eth.c
index 54786c5..a411dab 100644
--- a/hw/etraxfs_eth.c
+++ b/hw/etraxfs_eth.c
@@ -590,7 +590,8 @@ void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr)
eth->ethregs = cpu_register_io_memory(eth_read, eth_write, eth);
cpu_register_physical_memory (base, 0x5c, eth->ethregs);
- eth->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
+ eth->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->netdev,
+ nd->model, nd->name,
eth_can_receive, eth_receive,
NULL, eth_cleanup, eth);
eth->vc->opaque = eth;
diff --git a/hw/mcf_fec.c b/hw/mcf_fec.c
index f6d2bab..f9f437a 100644
--- a/hw/mcf_fec.c
+++ b/hw/mcf_fec.c
@@ -462,7 +462,8 @@ void mcf_fec_init(NICInfo *nd, target_phys_addr_t base, qemu_irq *irq)
mcf_fec_writefn, s);
cpu_register_physical_memory(base, 0x400, s->mmio_index);
- s->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
+ s->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->netdev,
+ nd->model, nd->name,
mcf_fec_can_receive, mcf_fec_receive,
NULL, mcf_fec_cleanup, s);
memcpy(s->macaddr, nd->macaddr, 6);
diff --git a/hw/mipsnet.c b/hw/mipsnet.c
index e98c576..ea8b570 100644
--- a/hw/mipsnet.c
+++ b/hw/mipsnet.c
@@ -262,8 +262,9 @@ void mipsnet_init (int base, qemu_irq irq, NICInfo *nd)
s->io_base = base;
s->irq = irq;
- if (nd && nd->vlan) {
- s->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
+ if (nd) {
+ s->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->netdev,
+ nd->model, nd->name,
mipsnet_can_receive, mipsnet_receive,
NULL, mipsnet_cleanup, s);
} else {
diff --git a/hw/qdev.c b/hw/qdev.c
index 906e897..20f931c 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -370,8 +370,10 @@ VLANClientState *qdev_get_vlan_client(DeviceState *dev,
{
NICInfo *nd = dev->nd;
assert(nd);
- nd->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, can_receive,
- receive, receive_iov, cleanup, opaque);
+ nd->vc = qemu_new_vlan_client(nd->vlan, nd->netdev,
+ nd->model, nd->name,
+ can_receive, receive, receive_iov,
+ cleanup, opaque);
return nd->vc;
}
diff --git a/hw/usb-net.c b/hw/usb-net.c
index b33e329..5c753e0 100644
--- a/hw/usb-net.c
+++ b/hw/usb-net.c
@@ -1460,7 +1460,8 @@ USBDevice *usb_net_init(NICInfo *nd)
memcpy(s->mac, nd->macaddr, 6);
- s->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
+ s->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->netdev,
+ nd->model, nd->name,
usbnet_can_receive,
usbnet_receive,
NULL,
diff --git a/hw/xen_nic.c b/hw/xen_nic.c
index c9e9199..b09b48a 100644
--- a/hw/xen_nic.c
+++ b/hw/xen_nic.c
@@ -301,7 +301,7 @@ static int net_init(struct XenDevice *xendev)
return -1;
vlan = qemu_find_vlan(netdev->xendev.dev, 1);
- netdev->vs = qemu_new_vlan_client(vlan, "xen", NULL,
+ netdev->vs = qemu_new_vlan_client(vlan, NULL, "xen", NULL,
net_rx_ok, net_rx_packet, NULL,
NULL, netdev);
snprintf(netdev->vs->info_str, sizeof(netdev->vs->info_str),
OpenPOWER on IntegriCloud