summaryrefslogtreecommitdiff
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2015-12-03 14:12:15 +0300
committerDavid S. Miller <davem@davemloft.net>2015-12-03 19:49:26 +0300
commit04d482660a07039fc4e9a42bb3517db236d98f96 (patch)
tree416983aba87723dd09de034c5a13c74a092dd1a8 /include/linux/netdevice.h
parent41f0b0496466d6e0e8245f94a79889234cde5e3c (diff)
downloadlinux-04d482660a07039fc4e9a42bb3517db236d98f96.tar.xz
net: introduce change lower state notifier
When lower device like bonding slave, team/bridge port, etc changes its state, it is useful for others to notice this change. Currently this is implemented specificly for bonding as NETDEV_BONDING_INFO notifier. This patch aims to replace this specific usage and make this more generic to be used for all upper-lower devices. Introduce NETDEV_CHANGELOWERSTATE netdev notifier type and netdev_lower_state_changed() helper. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 3ab90ea0ed03..ad69f237aa78 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2158,6 +2158,7 @@ struct netdev_lag_upper_info {
#define NETDEV_CHANGEINFODATA 0x0018
#define NETDEV_BONDING_INFO 0x0019
#define NETDEV_PRECHANGEUPPER 0x001A
+#define NETDEV_CHANGELOWERSTATE 0x001B
int register_netdevice_notifier(struct notifier_block *nb);
int unregister_netdevice_notifier(struct notifier_block *nb);
@@ -2179,6 +2180,11 @@ struct netdev_notifier_changeupper_info {
void *upper_info; /* upper dev info */
};
+struct netdev_notifier_changelowerstate_info {
+ struct netdev_notifier_info info; /* must be first */
+ void *lower_state_info; /* is lower dev state */
+};
+
static inline void netdev_notifier_info_init(struct netdev_notifier_info *info,
struct net_device *dev)
{
@@ -3640,6 +3646,8 @@ void netdev_upper_dev_unlink(struct net_device *dev,
void netdev_adjacent_rename_links(struct net_device *dev, char *oldname);
void *netdev_lower_dev_get_private(struct net_device *dev,
struct net_device *lower_dev);
+void netdev_lower_state_changed(struct net_device *lower_dev,
+ void *lower_state_info);
/* RSS keys are 40 or 52 bytes long */
#define NETDEV_RSS_KEY_LEN 52