Repository : ssh://git@open-mesh.org/batman-adv
On branch : next
>---------------------------------------------------------------
commit 92bc8cd2f254d1064f46151f77169c9aeda2791f
Author: Jiri Pirko <jiri(a)resnulli.us>
Date: Mon Jun 3 11:48:50 2013 +0200
net: pass info struct via netdevice notifier
So far, only net_device * could be passed along with netdevice notifier
event. This patch provides a possibility to pass custom structure
able to provide info that event listener needs to know.
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
v2->v3: fix typo on simeth
shortened dev_getter
shortened notifier_info struct name
v1->v2: fix notifier_call parameter in call_netdevice_notifier()
Signed-off-by: David S. Miller <davem(a)davemloft.net>
[ordex(a)autistici.org: added compat code]
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
92bc8cd2f254d1064f46151f77169c9aeda2791f
compat.h | 6 ++++++
hard-interface.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/compat.h b/compat.h
index 08b7500..17ef089 100644
--- a/compat.h
+++ b/compat.h
@@ -302,4 +302,10 @@ static int __batadv_interface_set_mac_addr(x, y)
#endif /* < KERNEL_VERSION(3, 10, 0) */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)
+
+#define netdev_notifier_info_to_dev(ptr) ptr
+
+#endif /* < KERNEL_VERSION(3, 11, 0) */
+
#endif /* _NET_BATMAN_ADV_COMPAT_H_ */
diff --git a/hard-interface.c b/hard-interface.c
index dc4ac29..c478e6b 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -645,7 +645,7 @@ void batadv_hardif_remove_interfaces(void)
static int batadv_hard_if_event(struct notifier_block *this,
unsigned long event, void *ptr)
{
- struct net_device *net_dev = ptr;
+ struct net_device *net_dev = netdev_notifier_info_to_dev(ptr);
struct batadv_hard_iface *hard_iface;
struct batadv_hard_iface *primary_if = NULL;
struct batadv_priv *bat_priv;