From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com,
bhutchings@solarflare.com, mirqus@gmail.com,
shemminger@vyatta.com, greearb@candelatech.com, fbl@redhat.com,
john.r.fastabend@intel.com
Subject: [patch net-next 4/4] dummy: implement carrier change
Date: Fri, 28 Dec 2012 10:49:40 +0100 [thread overview]
Message-ID: <1356688180-3549-5-git-send-email-jiri@resnulli.us> (raw)
In-Reply-To: <1356688180-3549-1-git-send-email-jiri@resnulli.us>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
drivers/net/dummy.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index c260af5..42aa54a 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -100,6 +100,15 @@ static void dummy_dev_uninit(struct net_device *dev)
free_percpu(dev->dstats);
}
+static int dummy_change_carrier(struct net_device *dev, bool new_carrier)
+{
+ if (new_carrier)
+ netif_carrier_on(dev);
+ else
+ netif_carrier_off(dev);
+ return 0;
+}
+
static const struct net_device_ops dummy_netdev_ops = {
.ndo_init = dummy_dev_init,
.ndo_uninit = dummy_dev_uninit,
@@ -108,6 +117,7 @@ static const struct net_device_ops dummy_netdev_ops = {
.ndo_set_rx_mode = set_multicast_list,
.ndo_set_mac_address = eth_mac_addr,
.ndo_get_stats64 = dummy_get_stats64,
+ .ndo_change_carrier = dummy_change_carrier,
};
static void dummy_setup(struct net_device *dev)
--
1.8.0
next prev parent reply other threads:[~2012-12-28 9:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-28 9:49 [patch net-next V3,repost 0/4] net: allow to change carrier from userspace Jiri Pirko
2012-12-28 9:49 ` [patch net-next 1/4] net: add change_carrier netdev op Jiri Pirko
2012-12-28 9:49 ` [patch net-next 2/4] net: allow to change carrier via sysfs Jiri Pirko
2012-12-28 9:49 ` [patch net-next 3/4] rtnl: expose carrier value with possibility to set it Jiri Pirko
2012-12-28 9:49 ` Jiri Pirko [this message]
2012-12-28 13:18 ` [patch net-next V3,repost 0/4] net: allow to change carrier from userspace Flavio Leitner
2012-12-28 23:21 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2012-12-19 9:35 [patch net-next V3 " Jiri Pirko
2012-12-19 9:35 ` [patch net-next 4/4] dummy: implement carrier change Jiri Pirko
2012-12-18 22:14 [patch net-next V2 0/4] net: allow to change carrier from userspace Jiri Pirko
2012-12-18 22:14 ` [patch net-next 4/4] dummy: implement carrier change Jiri Pirko
2012-12-12 10:58 [patch net-next 0/4] net: allow to change carrier from userspace Jiri Pirko
2012-12-12 10:58 ` [patch net-next 4/4] dummy: implement carrier change Jiri Pirko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1356688180-3549-5-git-send-email-jiri@resnulli.us \
--to=jiri@resnulli.us \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fbl@redhat.com \
--cc=greearb@candelatech.com \
--cc=john.r.fastabend@intel.com \
--cc=mirqus@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).