aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authordavid decotigny <decot@googlers.com>2014-03-29 12:48:35 -0400
committerDavid S. Miller <davem@davemloft.net>2014-03-31 16:24:52 -0400
commit2d3b479df41a10e2f41f9259fcba775bd34de6e4 (patch)
tree517291066c35188a41b005e81904e69865643e76 /include/linux/netdevice.h
parent9c76a114bbef10b4d44bd258006721dd896695dd (diff)
net-sysfs: expose number of carrier on/off changes
This allows to monitor carrier on/off transitions and detect link flapping issues: - new /sys/class/net/X/carrier_changes - new rtnetlink IFLA_CARRIER_CHANGES (getlink) Tested: - grep . /sys/class/net/*/carrier_changes + ip link set dev X down/up + plug/unplug cable - updated iproute2: prints IFLA_CARRIER_CHANGES - iproute2 20121211-2 (debian): unchanged behavior Signed-off-by: David Decotigny <decot@googlers.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 34cae3ee74f1..45537ed7a5b3 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1308,6 +1308,9 @@ struct net_device {
1308 atomic_long_t rx_dropped; 1308 atomic_long_t rx_dropped;
1309 atomic_long_t tx_dropped; 1309 atomic_long_t tx_dropped;
1310 1310
1311 /* Stats to monitor carrier on<->off transitions */
1312 atomic_t carrier_changes;
1313
1311#ifdef CONFIG_WIRELESS_EXT 1314#ifdef CONFIG_WIRELESS_EXT
1312 /* List of functions to handle Wireless Extensions (instead of ioctl). 1315 /* List of functions to handle Wireless Extensions (instead of ioctl).
1313 * See <net/iw_handler.h> for details. Jean II */ 1316 * See <net/iw_handler.h> for details. Jean II */