diff options
-rw-r--r-- | include/linux/netdevice.h | 1 | ||||
-rw-r--r-- | net/core/dev.c | 2 | ||||
-rw-r--r-- | net/core/link_watch.c | 8 |
3 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9ad7fa8c10e0..ccac82e61604 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -2227,6 +2227,7 @@ static inline void dev_hold(struct net_device *dev) | |||
2227 | * kind of lower layer not just hardware media. | 2227 | * kind of lower layer not just hardware media. |
2228 | */ | 2228 | */ |
2229 | 2229 | ||
2230 | extern void linkwatch_init_dev(struct net_device *dev); | ||
2230 | extern void linkwatch_fire_event(struct net_device *dev); | 2231 | extern void linkwatch_fire_event(struct net_device *dev); |
2231 | extern void linkwatch_forget_dev(struct net_device *dev); | 2232 | extern void linkwatch_forget_dev(struct net_device *dev); |
2232 | 2233 | ||
diff --git a/net/core/dev.c b/net/core/dev.c index bc857fead8c8..2f25d0cac51c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -5648,6 +5648,8 @@ int register_netdevice(struct net_device *dev) | |||
5648 | 5648 | ||
5649 | set_bit(__LINK_STATE_PRESENT, &dev->state); | 5649 | set_bit(__LINK_STATE_PRESENT, &dev->state); |
5650 | 5650 | ||
5651 | linkwatch_init_dev(dev); | ||
5652 | |||
5651 | dev_init_scheduler(dev); | 5653 | dev_init_scheduler(dev); |
5652 | dev_hold(dev); | 5654 | dev_hold(dev); |
5653 | list_netdevice(dev); | 5655 | list_netdevice(dev); |
diff --git a/net/core/link_watch.c b/net/core/link_watch.c index c3519c6d1b16..a01922219a23 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c | |||
@@ -76,6 +76,14 @@ static void rfc2863_policy(struct net_device *dev) | |||
76 | } | 76 | } |
77 | 77 | ||
78 | 78 | ||
79 | void linkwatch_init_dev(struct net_device *dev) | ||
80 | { | ||
81 | /* Handle pre-registration link state changes */ | ||
82 | if (!netif_carrier_ok(dev) || netif_dormant(dev)) | ||
83 | rfc2863_policy(dev); | ||
84 | } | ||
85 | |||
86 | |||
79 | static bool linkwatch_urgent_event(struct net_device *dev) | 87 | static bool linkwatch_urgent_event(struct net_device *dev) |
80 | { | 88 | { |
81 | if (!netif_running(dev)) | 89 | if (!netif_running(dev)) |