diff options
author | KONRAD Frederic <fred.konrad@greensocs.com> | 2013-04-11 16:29:57 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-17 10:28:21 -0500 |
commit | 17ec5a8686143da66208273d355f2eeb09807614 (patch) | |
tree | a665f4a4d1d16abe0ffbb2db0877312eb1005d99 /include/hw | |
parent | 6a87acf7df4b31ca0896b95b86dac9698420a9ed (diff) | |
download | hqemu-17ec5a8686143da66208273d355f2eeb09807614.zip hqemu-17ec5a8686143da66208273d355f2eeb09807614.tar.gz |
virtio-net: add the virtio-net device.
Create virtio-net-device which extends virtio-device, so it can be connected on
virtio-bus.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Message-id: 1365690602-22729-3-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/virtio/virtio-net.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index d2cc996..9fbb506 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -17,6 +17,10 @@ #include "hw/virtio/virtio.h" #include "hw/pci/pci.h" +#define TYPE_VIRTIO_NET "virtio-net-device" +#define VIRTIO_NET(obj) \ + OBJECT_CHECK(VirtIONet, (obj), TYPE_VIRTIO_NET) + #define ETH_ALEN 6 /* from Linux's virtio_net.h */ @@ -177,6 +181,8 @@ typedef struct VirtIONet { uint8_t *macs; } mac_table; uint32_t *vlans; + virtio_net_conf net_conf; + NICConf nic_conf; DeviceState *qdev; int multiqueue; uint16_t max_queues; @@ -243,4 +249,11 @@ struct virtio_net_ctrl_mq { DEFINE_PROP_BIT("ctrl_mac_addr", _state, _field, VIRTIO_NET_F_CTRL_MAC_ADDR, true), \ DEFINE_PROP_BIT("mq", _state, _field, VIRTIO_NET_F_MQ, false) +#define DEFINE_VIRTIO_NET_PROPERTIES(_state, _field) \ + DEFINE_PROP_UINT32("x-txtimer", _state, _field.txtimer, TX_TIMER_INTERVAL),\ + DEFINE_PROP_INT32("x-txburst", _state, _field.txburst, TX_BURST), \ + DEFINE_PROP_STRING("tx", _state, _field.tx) + +void virtio_net_set_config_size(VirtIONet *n, uint32_t host_features); + #endif |