netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [TRIVIAL PATCH] export dev->state via sysfs
  2003-08-20  5:04 [TRIVIAL PATCH] export dev->state via sysfs Bryan O'Sullivan
@ 2003-08-20  5:03 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2003-08-20  5:03 UTC (permalink / raw)
  To: Bryan O'Sullivan; +Cc: netdev

On 19 Aug 2003 22:04:56 -0700
"Bryan O'Sullivan" <bos@serpentine.com> wrote:

> This trivial patch exports the netdev state field via sysfs.  The
> motivation is to make it possible to check link state from userspace
> without having to go through the netlink interface.

Please use ethtool.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [TRIVIAL PATCH] export dev->state via sysfs
@ 2003-08-20  5:04 Bryan O'Sullivan
  2003-08-20  5:03 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Bryan O'Sullivan @ 2003-08-20  5:04 UTC (permalink / raw)
  To: netdev

This trivial patch exports the netdev state field via sysfs.  The
motivation is to make it possible to check link state from userspace
without having to go through the netlink interface.

	<b

--- 2.6.0-test3/net/core/net-sysfs.c	Wed Jul 23 12:21:29 2003
+++ 2.6.0-test3-sysfs/net/core/net-sysfs.c	Tue Aug 19 22:04:13 2003
@@ -147,6 +147,10 @@
 
 static CLASS_DEVICE_ATTR(flags, S_IRUGO | S_IWUSR, show_flags, store_flags);
 
+NETDEVICE_SHOW(state, "%#x\n");
+
+static CLASS_DEVICE_ATTR(state, S_IRUGO, show_state, NULL);
+
 NETDEVICE_SHOW(tx_queue_len, "%lu\n");
 
 static int change_tx_queue_len(struct net_device *net, unsigned long new_len)
@@ -172,6 +176,7 @@
 	&class_device_attr_features,
 	&class_device_attr_mtu,
 	&class_device_attr_flags,
+	&class_device_attr_state,
 	&class_device_attr_type,
 	&class_device_attr_address,
 	&class_device_attr_broadcast,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-08-20  5:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-20  5:04 [TRIVIAL PATCH] export dev->state via sysfs Bryan O'Sullivan
2003-08-20  5:03 ` David S. Miller

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).