summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/virtio-net.h
diff options
context:
space:
mode:
authorLadi Prosek2016-04-11 11:26:57 +0200
committerMichael Brown2016-04-15 18:28:06 +0200
commit7b499f849edc79f30b27dfe8143c04e90e3154c9 (patch)
tree2cdcf8be0f2c03c502709f9b27d4347aafab4971 /src/drivers/net/virtio-net.h
parent[pci] Add pci_find_next_capability() (diff)
downloadipxe-7b499f849edc79f30b27dfe8143c04e90e3154c9.tar.gz
ipxe-7b499f849edc79f30b27dfe8143c04e90e3154c9.tar.xz
ipxe-7b499f849edc79f30b27dfe8143c04e90e3154c9.zip
[virtio] Add virtio 1.0 constants and data structures
Virtio 1.0 introduces new constants and data structures, common to all devices as well as specific to virtio-net. This commit adds a subset of these to be able to drive the virtio-net 1.0 network device. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/virtio-net.h')
-rw-r--r--src/drivers/net/virtio-net.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/drivers/net/virtio-net.h b/src/drivers/net/virtio-net.h
index 3abef28e..c2b4a17c 100644
--- a/src/drivers/net/virtio-net.h
+++ b/src/drivers/net/virtio-net.h
@@ -14,6 +14,12 @@
#define VIRTIO_NET_F_HOST_TSO6 12 /* Host can handle TSOv6 in. */
#define VIRTIO_NET_F_HOST_ECN 13 /* Host can handle TSO[6] w/ ECN in. */
#define VIRTIO_NET_F_HOST_UFO 14 /* Host can handle UFO in. */
+#define VIRTIO_NET_F_MRG_RXBUF 15 /* Driver can merge receive buffers. */
+#define VIRTIO_NET_F_STATUS 16 /* Configuration status field is available. */
+#define VIRTIO_NET_F_CTRL_VQ 17 /* Control channel is available. */
+#define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support. */
+#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering. */
+#define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Driver can send gratuitous packets. */
struct virtio_net_config
{
@@ -41,4 +47,14 @@ struct virtio_net_hdr
uint16_t csum_start;
uint16_t csum_offset;
};
+
+/* Virtio 1.0 version of the first element of the scatter-gather list. */
+struct virtio_net_hdr_modern
+{
+ struct virtio_net_hdr legacy;
+
+ /* Used only if VIRTIO_NET_F_MRG_RXBUF: */
+ uint16_t num_buffers;
+};
+
#endif /* _VIRTIO_NET_H_ */