aboutsummaryrefslogtreecommitdiff
path: root/pc-bios/s390-ccw/virtio.h
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2017-07-12 14:49:52 +0200
committerChristian Borntraeger <borntraeger@de.ibm.com>2017-07-14 12:29:48 +0200
commit00dde1e60dd334b6a27b208132c9a57c36852ea1 (patch)
tree6d7ae249cea1f9a3d9b7d7973066ffec2bda9265 /pc-bios/s390-ccw/virtio.h
parent3e4415a751d2474052ac5e62e8c793d978ed080e (diff)
downloadqemu-00dde1e60dd334b6a27b208132c9a57c36852ea1.zip
qemu-00dde1e60dd334b6a27b208132c9a57c36852ea1.tar.gz
qemu-00dde1e60dd334b6a27b208132c9a57c36852ea1.tar.bz2
pc-bios/s390-ccw: Add virtio-net driver code
The driver provides the recv() and send() functions which will be required by SLOF's libnet code for receiving and sending packets. Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1499863793-18627-11-git-send-email-thuth@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'pc-bios/s390-ccw/virtio.h')
-rw-r--r--pc-bios/s390-ccw/virtio.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h
index a00a320..19fceb6 100644
--- a/pc-bios/s390-ccw/virtio.h
+++ b/pc-bios/s390-ccw/virtio.h
@@ -11,8 +11,6 @@
#ifndef VIRTIO_H
#define VIRTIO_H
-#include "s390-ccw.h"
-
/* Status byte for guest to report progress, and synchronize features. */
/* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */
#define VIRTIO_CONFIG_S_ACKNOWLEDGE 1
@@ -227,6 +225,13 @@ struct ScsiDevice {
};
typedef struct ScsiDevice ScsiDevice;
+struct VirtioNetConfig {
+ uint8_t mac[6];
+ /* uint16_t status; */ /* Only with VIRTIO_NET_F_STATUS */
+ /* uint16_t max_virtqueue_pairs; */ /* Only with VIRTIO_NET_F_MQ */
+};
+typedef struct VirtioNetConfig VirtioNetConfig;
+
struct VDev {
int nr_vqs;
VRing *vrings;
@@ -239,6 +244,7 @@ struct VDev {
union {
VirtioBlkConfig blk;
VirtioScsiConfig scsi;
+ VirtioNetConfig net;
} config;
ScsiDevice *scsi_device;
bool is_cdrom;
@@ -273,4 +279,6 @@ int vring_wait_reply(void);
int virtio_run(VDev *vdev, int vqid, VirtioCmd *cmd);
void virtio_setup_ccw(VDev *vdev);
+int virtio_net_init(void *mac_addr);
+
#endif /* VIRTIO_H */