[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1311955389.3220.15.camel@deadeye>
Date: Fri, 29 Jul 2011 18:03:09 +0200
From: Ben Hutchings <bhutchings@...arflare.com>
To: Jiri Pirko <jpirko@...hat.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, eric.dumazet@...il.com
Subject: Re: [patch net-next-2.6] dummy: allow report link status and
change it via sysfs
On Fri, 2011-07-29 at 17:27 +0200, Jiri Pirko wrote:
> Signed-off-by: Jiri Pirko <jpirko@...hat.com>
> ---
> drivers/net/dummy.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 54 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
> index 39cf9b9..fc39c24 100644
> --- a/drivers/net/dummy.c
> +++ b/drivers/net/dummy.c
> @@ -37,9 +37,57 @@
> #include <linux/rtnetlink.h>
> #include <net/rtnetlink.h>
> #include <linux/u64_stats_sync.h>
> +#include <linux/ethtool.h>
>
> static int numdummies = 1;
>
> +static ssize_t dummy_show_link(struct device *d,
> + struct device_attribute *attr,
> + char *buf)
> +{
> + struct net_device *dev = to_net_dev(d);
> +
> + return sprintf(buf, "%d\n", netif_carrier_ok(dev) ? 1 : 0);
> +}
[...]
Net devices already have the 'carrier' attribute. You should make that
attribute writable for dummy devices, rather than adding another one.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists