aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/virtio_net.h
diff options
context:
space:
mode:
authorAmos Kong <akong@redhat.com>2013-01-20 20:17:23 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-21 14:07:44 -0500
commit7e58d5aea8abb993983a3f3088fd4a3f06180a1c (patch)
tree26b31fbcf0995c22b073394946717eba0151fbe5 /include/uapi/linux/virtio_net.h
parentfa0879e37b59e8e3f130a30a9e6fa515717c5bdd (diff)
virtio-net: introduce a new control to set macaddr
Currently we write MAC address to pci config space byte by byte, this means that we have an intermediate step where mac is wrong. This patch introduced a new control command to set MAC address, it's atomic. VIRTIO_NET_F_CTRL_MAC_ADDR is a new feature bit for compatibility. Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/virtio_net.h')
-rw-r--r--include/uapi/linux/virtio_net.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
index 848e3584d7c8..a5a8c88753b9 100644
--- a/include/uapi/linux/virtio_net.h
+++ b/include/uapi/linux/virtio_net.h
@@ -53,6 +53,7 @@
53 * network */ 53 * network */
54#define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow 54#define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow
55 * Steering */ 55 * Steering */
56#define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */
56 57
57#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ 58#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
58#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */ 59#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */
@@ -127,7 +128,7 @@ typedef __u8 virtio_net_ctrl_ack;
127 #define VIRTIO_NET_CTRL_RX_NOBCAST 5 128 #define VIRTIO_NET_CTRL_RX_NOBCAST 5
128 129
129/* 130/*
130 * Control the MAC filter table. 131 * Control the MAC
131 * 132 *
132 * The MAC filter table is managed by the hypervisor, the guest should 133 * The MAC filter table is managed by the hypervisor, the guest should
133 * assume the size is infinite. Filtering should be considered 134 * assume the size is infinite. Filtering should be considered
@@ -140,6 +141,10 @@ typedef __u8 virtio_net_ctrl_ack;
140 * first sg list contains unicast addresses, the second is for multicast. 141 * first sg list contains unicast addresses, the second is for multicast.
141 * This functionality is present if the VIRTIO_NET_F_CTRL_RX feature 142 * This functionality is present if the VIRTIO_NET_F_CTRL_RX feature
142 * is available. 143 * is available.
144 *
145 * The ADDR_SET command requests one out scatterlist, it contains a
146 * 6 bytes MAC address. This functionality is present if the
147 * VIRTIO_NET_F_CTRL_MAC_ADDR feature is available.
143 */ 148 */
144struct virtio_net_ctrl_mac { 149struct virtio_net_ctrl_mac {
145 __u32 entries; 150 __u32 entries;
@@ -148,6 +153,7 @@ struct virtio_net_ctrl_mac {
148 153
149#define VIRTIO_NET_CTRL_MAC 1 154#define VIRTIO_NET_CTRL_MAC 1
150 #define VIRTIO_NET_CTRL_MAC_TABLE_SET 0 155 #define VIRTIO_NET_CTRL_MAC_TABLE_SET 0
156 #define VIRTIO_NET_CTRL_MAC_ADDR_SET 1
151 157
152/* 158/*
153 * Control VLAN filtering 159 * Control VLAN filtering