[TRIVIAL PATCH] export dev->state via sysfs

DORMANTno replies

2 messages, 2 authors, 2003-08-20 · open the first message on its own page

[TRIVIAL PATCH] export dev->state via sysfs

From: Bryan O'Sullivan <hidden>
Date: 2003-08-20 05:04:56

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,

Re: [TRIVIAL PATCH] export dev->state via sysfs

From: David S. Miller <hidden>
Date: 2003-08-20 05:03:22

On 19 Aug 2003 22:04:56 -0700
"Bryan O'Sullivan" [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help