net: propagate upper priv via netdev_master_upper_dev_link
Sven Eckelmann
maintainerPATCH 1/3 net: propagate upper priv via netdev_master_upper_dev_link
From: Jiri Pirko <[email protected]>
Eliminate netdev_master_upper_dev_link_private and pass priv directly as a parameter of netdev_master_upper_dev_link.
--- compat-include/linux/netdevice.h | 7 +++++++ net/batman-adv/hard-interface.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-)
compat-include/linux/netdevice.h +7 -0
@@ -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_ */
net/batman-adv/hard-interface.c +2 -1
@@ -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;
Signature · 1 line
2.6.2
Sven Eckelmann
maintainerPATCH 2/3 net: add possibility to pass information about upper device via notifier
From: Jiri Pirko <[email protected]>
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.
--- compat-include/linux/netdevice.h | 2 +- net/batman-adv/hard-interface.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
compat-include/linux/netdevice.h +1 -1
@@ -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) */
net/batman-adv/hard-interface.c +1 -1
@@ -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;
Signature · 1 line
2.6.2
Sven Eckelmann
maintainerPATCH 3/3 batman-adv: Act on NETDEV_*_TYPE_CHANGE events
In reply to Sven EckelmannFrom: Andrew Lunn <[email protected]>
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.
--- compat-include/linux/netdevice.h | 3 +++ net/batman-adv/hard-interface.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-)
compat-include/linux/netdevice.h +3 -0
@@ -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 )
net/batman-adv/hard-interface.c +3 -1
@@ -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);
Signature · 1 line
2.6.2
Marek Lindner
AppliedQuoted 11 lines · On Tuesday, December 08, 2015 21:35:13 Sven Eckelmann wrote:
From: Jiri Pirko <[email protected]>
Eliminate
netdev_master_upper_dev_link_privateand pass priv directly as a parameter ofnetdev_master_upper_dev_link.Signed-off-by Jiri Pirko <[email protected]>Signed-off-by David S. Miller <[email protected]>--- 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
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH-next 2/3] net: add possibility to pass information about upper device via notifier
In reply to Sven EckelmannQuoted 6 lines · On Tuesday, December 08, 2015 21:35:14 Sven Eckelmann wrote:
From: Jiri Pirko <[email protected]>
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.
Quoted 6 lines
Signed-off-by Jiri Pirko <[email protected]>Signed-off-by David S. Miller <[email protected]>--- 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
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH-next 3/3] batman-adv: Act on NETDEV_*_TYPE_CHANGE events
In reply to Sven EckelmannQuoted 7 lines · On Tuesday, December 08, 2015 21:35:58 Sven Eckelmann wrote:
From: Andrew Lunn <[email protected]>
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.
Quoted 6 lines
Signed-off-by Andrew Lunn <[email protected]>Signed-off-by David S. Miller <[email protected]>--- 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