aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dummy.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2012-06-29 01:10:08 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-30 04:08:00 -0400
commit0d1632b46ad76cde92085aa1ed422e9329443082 (patch)
tree5f950b956efc6fd99107ec5b01515be3be49ecfb /drivers/net/dummy.c
parent5a1d1c8c78e55df2e876249f8e3a4a573efdbaa6 (diff)
dummy: use IFF_LIVE_ADDR_CHANGE priv_flag
Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dummy.c')
-rw-r--r--drivers/net/dummy.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index bab0158f1cc3..9d6a0677466b 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -40,18 +40,6 @@
40 40
41static int numdummies = 1; 41static int numdummies = 1;
42 42
43static int dummy_set_address(struct net_device *dev, void *p)
44{
45 struct sockaddr *sa = p;
46
47 if (!is_valid_ether_addr(sa->sa_data))
48 return -EADDRNOTAVAIL;
49
50 dev->addr_assign_type &= ~NET_ADDR_RANDOM;
51 memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN);
52 return 0;
53}
54
55/* fake multicast ability */ 43/* fake multicast ability */
56static void set_multicast_list(struct net_device *dev) 44static void set_multicast_list(struct net_device *dev)
57{ 45{
@@ -118,7 +106,7 @@ static const struct net_device_ops dummy_netdev_ops = {
118 .ndo_start_xmit = dummy_xmit, 106 .ndo_start_xmit = dummy_xmit,
119 .ndo_validate_addr = eth_validate_addr, 107 .ndo_validate_addr = eth_validate_addr,
120 .ndo_set_rx_mode = set_multicast_list, 108 .ndo_set_rx_mode = set_multicast_list,
121 .ndo_set_mac_address = dummy_set_address, 109 .ndo_set_mac_address = eth_mac_addr,
122 .ndo_get_stats64 = dummy_get_stats64, 110 .ndo_get_stats64 = dummy_get_stats64,
123}; 111};
124 112
@@ -134,6 +122,7 @@ static void dummy_setup(struct net_device *dev)
134 dev->tx_queue_len = 0; 122 dev->tx_queue_len = 0;
135 dev->flags |= IFF_NOARP; 123 dev->flags |= IFF_NOARP;
136 dev->flags &= ~IFF_MULTICAST; 124 dev->flags &= ~IFF_MULTICAST;
125 dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
137 dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO; 126 dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO;
138 dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX; 127 dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX;
139 eth_hw_addr_random(dev); 128 eth_hw_addr_random(dev);