mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
net: core: Expose number of link up/down transitions
Expose the number of times the link has been going UP or DOWN, and update the "carrier_changes" counter to be the sum of these two events. While at it, also update the sysfs-class-net documentation to cover: carrier_changes (3.15), carrier_up_count (4.16) and carrier_down_count (4.16) Signed-off-by: David Decotigny <[email protected]> [Florian: * rebase * add documentation * merge carrier_changes with up/down counters] Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
e8660ded7f
commit
b2d3bcfa26
6 changed files with 67 additions and 7 deletions
|
|
@ -510,7 +510,7 @@ void netif_carrier_on(struct net_device *dev)
|
|||
if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) {
|
||||
if (dev->reg_state == NETREG_UNINITIALIZED)
|
||||
return;
|
||||
atomic_inc(&dev->carrier_changes);
|
||||
atomic_inc(&dev->carrier_up_count);
|
||||
linkwatch_fire_event(dev);
|
||||
if (netif_running(dev))
|
||||
__netdev_watchdog_up(dev);
|
||||
|
|
@ -529,7 +529,7 @@ void netif_carrier_off(struct net_device *dev)
|
|||
if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) {
|
||||
if (dev->reg_state == NETREG_UNINITIALIZED)
|
||||
return;
|
||||
atomic_inc(&dev->carrier_changes);
|
||||
atomic_inc(&dev->carrier_down_count);
|
||||
linkwatch_fire_event(dev);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue