From 9f4d26d0f3016cf8813977d624751b94465fa317 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Mon, 19 Jan 2009 17:09:49 -0800 Subject: virtio_net: add link status handling Allow the host to inform us that the link is down by adding a VIRTIO_NET_F_STATUS which indicates that device status is available in virtio_net config. This is currently useful for simulating link down conditions (e.g. using proposed qemu 'set_link' monitor command) but would also be needed if we were to support device assignment via virtio. Signed-off-by: Mark McLoughlin Signed-off-by: Rusty Russell (added future masking) Signed-off-by: David S. Miller --- include/linux/virtio_net.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/linux/virtio_net.h') diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 5cdd0aa..f76bd4a7 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h @@ -21,11 +21,16 @@ #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 /* Host can merge receive buffers. */ +#define VIRTIO_NET_F_STATUS 16 /* virtio_net_config.status available */ + +#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ struct virtio_net_config { /* The config defining mac address (if VIRTIO_NET_F_MAC) */ __u8 mac[6]; + /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ + __u16 status; } __attribute__((packed)); /* This is the first element of the scatter-gather list. If you don't -- cgit v1.1