From: "Bryan O'Sullivan" <bos@serpentine.com>
To: netdev@oss.sgi.com
Subject: [TRIVIAL PATCH] export dev->state via sysfs
Date: 19 Aug 2003 22:04:56 -0700 [thread overview]
Message-ID: <1061355896.10843.22.camel@camp4.serpentine.com> (raw)
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,
next reply other threads:[~2003-08-20 5:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-20 5:04 Bryan O'Sullivan [this message]
2003-08-20 5:03 ` [TRIVIAL PATCH] export dev->state via sysfs David S. Miller
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=1061355896.10843.22.camel@camp4.serpentine.com \
--to=bos@serpentine.com \
--cc=netdev@oss.sgi.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).