From: Jiri Pirko jiri@mellanox.com
Eliminate netdev_master_upper_dev_link_private and pass priv directly as a parameter of netdev_master_upper_dev_link.
Signed-off-by: Jiri Pirko jiri@mellanox.com Signed-off-by: David S. Miller davem@davemloft.net --- compat-include/linux/netdevice.h | 7 +++++++ net/batman-adv/hard-interface.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/compat-include/linux/netdevice.h b/compat-include/linux/netdevice.h index f19f624..a8da7bf 100644 --- a/compat-include/linux/netdevice.h +++ b/compat-include/linux/netdevice.h @@ -117,4 +117,11 @@ static inline int batadv_netdev_set_master(struct net_device *slave,
#endif /* < KERNEL_VERSION(3, 19, 0) */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) + +#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv) \ + netdev_master_upper_dev_link(dev, upper_dev) + +#endif /* < KERNEL_VERSION(4, 5, 0) */ + #endif /* _NET_BATMAN_ADV_COMPAT_LINUX_NETDEVICE_H_ */ diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index bef9147..484c50e 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -466,7 +466,8 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, hard_iface->soft_iface = soft_iface; bat_priv = netdev_priv(hard_iface->soft_iface);
- ret = netdev_master_upper_dev_link(hard_iface->net_dev, soft_iface); + ret = netdev_master_upper_dev_link(hard_iface->net_dev, + soft_iface, NULL); if (ret) goto err_dev;
From: Jiri Pirko jiri@mellanox.com
Sometimes the drivers and other code would find it handy to know some internal information about upper device being changed. So allow upper-code to pass information down to notifier listeners during linking.
Signed-off-by: Jiri Pirko jiri@mellanox.com Signed-off-by: David S. Miller davem@davemloft.net --- compat-include/linux/netdevice.h | 2 +- net/batman-adv/hard-interface.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/compat-include/linux/netdevice.h b/compat-include/linux/netdevice.h index a8da7bf..34e5ac7 100644 --- a/compat-include/linux/netdevice.h +++ b/compat-include/linux/netdevice.h @@ -119,7 +119,7 @@ static inline int batadv_netdev_set_master(struct net_device *slave,
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
-#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv) \ +#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info) \ netdev_master_upper_dev_link(dev, upper_dev)
#endif /* < KERNEL_VERSION(4, 5, 0) */ diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index 484c50e..2d1470f 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -467,7 +467,7 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, bat_priv = netdev_priv(hard_iface->soft_iface);
ret = netdev_master_upper_dev_link(hard_iface->net_dev, - soft_iface, NULL); + soft_iface, NULL, NULL); if (ret) goto err_dev;
On Tuesday, December 08, 2015 21:35:14 Sven Eckelmann wrote:
From: Jiri Pirko jiri@mellanox.com
Sometimes the drivers and other code would find it handy to know some internal information about upper device being changed. So allow upper-code to pass information down to notifier listeners during linking.
Signed-off-by: Jiri Pirko jiri@mellanox.com Signed-off-by: David S. Miller davem@davemloft.net
compat-include/linux/netdevice.h | 2 +- net/batman-adv/hard-interface.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Applied in revision 4291a5b.
Thanks, Marek
From: Andrew Lunn andrew@lunn.ch
A network interface can change type. It may change from a type which batman does not support, e.g. hdlc, to one it does, e.g. hdlc-eth. When an interface changes type, it sends two notifications. Handle these notifications.
Signed-off-by: Andrew Lunn andrew@lunn.ch Signed-off-by: David S. Miller davem@davemloft.net --- compat-include/linux/netdevice.h | 3 +++ net/batman-adv/hard-interface.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/compat-include/linux/netdevice.h b/compat-include/linux/netdevice.h index 34e5ac7..10253e0 100644 --- a/compat-include/linux/netdevice.h +++ b/compat-include/linux/netdevice.h @@ -58,6 +58,9 @@ struct batadv_dev_addr_list { int da_gusers; };
+#define NETDEV_PRE_TYPE_CHANGE 0x000E +#define NETDEV_POST_TYPE_CHANGE 0x000F + #endif /* < KERNEL_VERSION(2, 6, 35) */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index 2d1470f..49e05d2 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -714,7 +714,8 @@ static int batadv_hard_if_event(struct notifier_block *this, }
hard_iface = batadv_hardif_get_by_netdev(net_dev); - if (!hard_iface && event == NETDEV_REGISTER) + if (!hard_iface && (event == NETDEV_REGISTER || + event == NETDEV_POST_TYPE_CHANGE)) hard_iface = batadv_hardif_add_interface(net_dev);
if (!hard_iface) @@ -729,6 +730,7 @@ static int batadv_hard_if_event(struct notifier_block *this, batadv_hardif_deactivate_interface(hard_iface); break; case NETDEV_UNREGISTER: + case NETDEV_PRE_TYPE_CHANGE: list_del_rcu(&hard_iface->list);
batadv_hardif_remove_interface(hard_iface);
On Tuesday, December 08, 2015 21:35:58 Sven Eckelmann wrote:
From: Andrew Lunn andrew@lunn.ch
A network interface can change type. It may change from a type which batman does not support, e.g. hdlc, to one it does, e.g. hdlc-eth. When an interface changes type, it sends two notifications. Handle these notifications.
Signed-off-by: Andrew Lunn andrew@lunn.ch Signed-off-by: David S. Miller davem@davemloft.net
compat-include/linux/netdevice.h | 3 +++ net/batman-adv/hard-interface.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-)
Applied in revision 399bf29.
Thanks, Marek
On Tuesday, December 08, 2015 21:35:13 Sven Eckelmann wrote:
From: Jiri Pirko jiri@mellanox.com
Eliminate netdev_master_upper_dev_link_private and pass priv directly as a parameter of netdev_master_upper_dev_link.
Signed-off-by: Jiri Pirko jiri@mellanox.com Signed-off-by: David S. Miller davem@davemloft.net
compat-include/linux/netdevice.h | 7 +++++++ net/batman-adv/hard-interface.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-)
Applied in revision d794c1c.
Thanks, Marek
b.a.t.m.a.n@lists.open-mesh.org