diff options
author | Jiri Pirko <jiri@resnulli.us> | 2012-12-27 18:49:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-12-28 18:24:19 -0500 |
commit | 210ab6656fa8c49d7238c13f85ed551ebab94fb0 (patch) | |
tree | 110b119c648062f4b38439a3ac3273ac6a9d6033 /drivers/net/dummy.c | |
parent | 9a57247f31e361f80508c40363366222dbbb6aa5 (diff) |
dummy: implement carrier change
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dummy.c')
-rw-r--r-- | drivers/net/dummy.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index c260af5411d0..42aa54af6842 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c | |||
@@ -100,6 +100,15 @@ static void dummy_dev_uninit(struct net_device *dev) | |||
100 | free_percpu(dev->dstats); | 100 | free_percpu(dev->dstats); |
101 | } | 101 | } |
102 | 102 | ||
103 | static int dummy_change_carrier(struct net_device *dev, bool new_carrier) | ||
104 | { | ||
105 | if (new_carrier) | ||
106 | netif_carrier_on(dev); | ||
107 | else | ||
108 | netif_carrier_off(dev); | ||
109 | return 0; | ||
110 | } | ||
111 | |||
103 | static const struct net_device_ops dummy_netdev_ops = { | 112 | static const struct net_device_ops dummy_netdev_ops = { |
104 | .ndo_init = dummy_dev_init, | 113 | .ndo_init = dummy_dev_init, |
105 | .ndo_uninit = dummy_dev_uninit, | 114 | .ndo_uninit = dummy_dev_uninit, |
@@ -108,6 +117,7 @@ static const struct net_device_ops dummy_netdev_ops = { | |||
108 | .ndo_set_rx_mode = set_multicast_list, | 117 | .ndo_set_rx_mode = set_multicast_list, |
109 | .ndo_set_mac_address = eth_mac_addr, | 118 | .ndo_set_mac_address = eth_mac_addr, |
110 | .ndo_get_stats64 = dummy_get_stats64, | 119 | .ndo_get_stats64 = dummy_get_stats64, |
120 | .ndo_change_carrier = dummy_change_carrier, | ||
111 | }; | 121 | }; |
112 | 122 | ||
113 | static void dummy_setup(struct net_device *dev) | 123 | static void dummy_setup(struct net_device *dev) |