mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
Add a model string to VLANClientState (Mark McLoughlin)
Don't lose track of what type/model a vlan client is so that we can e.g. assign a global per-model id to clients. The entire patch is basically a tedious excercise in making sure the type/model string gets propagated down to qemu_new_vlan_client(). Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6216 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
f7b4a940a4
commit
bf38c1a0e1
17 changed files with 74 additions and 62 deletions
|
@ -1071,8 +1071,8 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn)
|
|||
d->rxbuf_min_shift = 1;
|
||||
memset(&d->tx, 0, sizeof d->tx);
|
||||
|
||||
d->vc = qemu_new_vlan_client(nd->vlan, e1000_receive,
|
||||
e1000_can_receive, d);
|
||||
d->vc = qemu_new_vlan_client(nd->vlan, nd->model,
|
||||
e1000_receive, e1000_can_receive, d);
|
||||
|
||||
snprintf(d->vc->info_str, sizeof(d->vc->info_str),
|
||||
"%s macaddr=%02x:%02x:%02x:%02x:%02x:%02x", info_str,
|
||||
|
|
|
@ -1776,7 +1776,8 @@ static void nic_init(PCIBus * bus, NICInfo * nd,
|
|||
|
||||
nic_reset(s);
|
||||
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, nic_receive, nic_can_receive, s);
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, nd->model,
|
||||
nic_receive, nic_can_receive, s);
|
||||
|
||||
snprintf(s->vc->info_str, sizeof(s->vc->info_str),
|
||||
"eepro100 pci macaddr=%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
|
|
|
@ -572,7 +572,7 @@ void *etraxfs_eth_init(NICInfo *nd, CPUState *env,
|
|||
eth->ethregs = cpu_register_io_memory(0, eth_read, eth_write, eth);
|
||||
cpu_register_physical_memory (base, 0x5c, eth->ethregs);
|
||||
|
||||
eth->vc = qemu_new_vlan_client(nd->vlan,
|
||||
eth->vc = qemu_new_vlan_client(nd->vlan, nd->model,
|
||||
eth_receive, eth_can_receive, eth);
|
||||
|
||||
return dma;
|
||||
|
|
|
@ -452,7 +452,7 @@ void mcf_fec_init(NICInfo *nd, target_phys_addr_t base, qemu_irq *irq)
|
|||
mcf_fec_writefn, s);
|
||||
cpu_register_physical_memory(base, 0x400, iomemtype);
|
||||
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, mcf_fec_receive,
|
||||
mcf_fec_can_receive, s);
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, nd->model,
|
||||
mcf_fec_receive, mcf_fec_can_receive, s);
|
||||
memcpy(s->macaddr, nd->macaddr, 6);
|
||||
}
|
||||
|
|
|
@ -250,8 +250,8 @@ void mipsnet_init (int base, qemu_irq irq, NICInfo *nd)
|
|||
s->irq = irq;
|
||||
s->nd = nd;
|
||||
if (nd && nd->vlan) {
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, mipsnet_receive,
|
||||
mipsnet_can_receive, s);
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, nd->model,
|
||||
mipsnet_receive, mipsnet_can_receive, s);
|
||||
} else {
|
||||
s->vc = NULL;
|
||||
}
|
||||
|
|
|
@ -718,7 +718,8 @@ static void mv88w8618_eth_init(NICInfo *nd, uint32_t base, qemu_irq irq)
|
|||
if (!s)
|
||||
return;
|
||||
s->irq = irq;
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, eth_receive, eth_can_receive, s);
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, nd->model,
|
||||
eth_receive, eth_can_receive, s);
|
||||
iomemtype = cpu_register_io_memory(0, mv88w8618_eth_readfn,
|
||||
mv88w8618_eth_writefn, s);
|
||||
cpu_register_physical_memory(base, MP_ETH_SIZE, iomemtype);
|
||||
|
|
|
@ -741,8 +741,8 @@ void isa_ne2000_init(int base, qemu_irq irq, NICInfo *nd)
|
|||
|
||||
ne2000_reset(s);
|
||||
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, ne2000_receive,
|
||||
ne2000_can_receive, s);
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, nd->model,
|
||||
ne2000_receive, ne2000_can_receive, s);
|
||||
|
||||
snprintf(s->vc->info_str, sizeof(s->vc->info_str),
|
||||
"ne2000 macaddr=%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
|
@ -811,8 +811,8 @@ void pci_ne2000_init(PCIBus *bus, NICInfo *nd, int devfn)
|
|||
s->pci_dev = (PCIDevice *)d;
|
||||
memcpy(s->macaddr, nd->macaddr, 6);
|
||||
ne2000_reset(s);
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, ne2000_receive,
|
||||
ne2000_can_receive, s);
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, nd->model,
|
||||
ne2000_receive, ne2000_can_receive, s);
|
||||
|
||||
snprintf(s->vc->info_str, sizeof(s->vc->info_str),
|
||||
"ne2000 pci macaddr=%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
|
|
|
@ -1936,8 +1936,8 @@ static void pcnet_common_init(PCNetState *d, NICInfo *nd, const char *info_str)
|
|||
d->nd = nd;
|
||||
|
||||
if (nd && nd->vlan) {
|
||||
d->vc = qemu_new_vlan_client(nd->vlan, pcnet_receive,
|
||||
pcnet_can_receive, d);
|
||||
d->vc = qemu_new_vlan_client(nd->vlan, nd->model,
|
||||
pcnet_receive, pcnet_can_receive, d);
|
||||
|
||||
snprintf(d->vc->info_str, sizeof(d->vc->info_str),
|
||||
"pcnet macaddr=%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
|
|
|
@ -3438,8 +3438,8 @@ void pci_rtl8139_init(PCIBus *bus, NICInfo *nd, int devfn)
|
|||
s->pci_dev = (PCIDevice *)d;
|
||||
memcpy(s->macaddr, nd->macaddr, 6);
|
||||
rtl8139_reset(s);
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, rtl8139_receive,
|
||||
rtl8139_can_receive, s);
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, nd->model,
|
||||
rtl8139_receive, rtl8139_can_receive, s);
|
||||
|
||||
snprintf(s->vc->info_str, sizeof(s->vc->info_str),
|
||||
"rtl8139 pci macaddr=%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
|
|
|
@ -704,7 +704,7 @@ void smc91c111_init(NICInfo *nd, uint32_t base, qemu_irq irq)
|
|||
|
||||
smc91c111_reset(s);
|
||||
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, smc91c111_receive,
|
||||
smc91c111_can_receive, s);
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, nd->model,
|
||||
smc91c111_receive, smc91c111_can_receive, s);
|
||||
/* ??? Save/restore. */
|
||||
}
|
||||
|
|
|
@ -397,8 +397,8 @@ void stellaris_enet_init(NICInfo *nd, uint32_t base, qemu_irq irq)
|
|||
memcpy(s->macaddr, nd->macaddr, 6);
|
||||
|
||||
if (nd->vlan)
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, stellaris_enet_receive,
|
||||
stellaris_enet_can_receive, s);
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, nd->model,
|
||||
stellaris_enet_receive, stellaris_enet_can_receive, s);
|
||||
|
||||
stellaris_enet_reset(s);
|
||||
register_savevm("stellaris_enet", -1, 1,
|
||||
|
|
|
@ -1453,7 +1453,7 @@ USBDevice *usb_net_init(NICInfo *nd)
|
|||
|
||||
pstrcpy(s->dev.devname, sizeof(s->dev.devname),
|
||||
"QEMU USB Network Interface");
|
||||
s->vc = qemu_new_vlan_client(nd->vlan,
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, nd->model,
|
||||
usbnet_receive, usbnet_can_receive, s);
|
||||
|
||||
snprintf(s->usbstring_mac, sizeof(s->usbstring_mac),
|
||||
|
|
|
@ -315,8 +315,8 @@ PCIDevice *virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn)
|
|||
n->rx_vq = virtio_add_queue(&n->vdev, 256, virtio_net_handle_rx);
|
||||
n->tx_vq = virtio_add_queue(&n->vdev, 256, virtio_net_handle_tx);
|
||||
memcpy(n->mac, nd->macaddr, 6);
|
||||
n->vc = qemu_new_vlan_client(nd->vlan, virtio_net_receive,
|
||||
virtio_net_can_receive, n);
|
||||
n->vc = qemu_new_vlan_client(nd->vlan, nd->model,
|
||||
virtio_net_receive, virtio_net_can_receive, n);
|
||||
|
||||
n->tx_timer = qemu_new_timer(vm_clock, virtio_net_tx_timer, n);
|
||||
n->tx_timer_active = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue