aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/hard-interface.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-05-11 20:09:31 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-20 16:15:20 -0400
commit9563877ea52ea18bb4f1ed724c5e3a39bbbcf60b (patch)
tree56bd2312e4aa7d04b448edd1d8ed87309c941f80 /net/batman-adv/hard-interface.c
parent84d5e5e003752bc56b413f8d2c3fcfeeec066145 (diff)
batman-adv: Prefix hard-interface non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that case the linker will see all non-static symbols of batman-adv and all other non-static symbols of the kernel. This could lead to symbol collisions. A prefix for the batman-adv symbols that defines their private namespace avoids such a problem. Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/hard-interface.c')
-rw-r--r--net/batman-adv/hard-interface.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 1643e7fca6c6..4f44f049186f 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -32,7 +32,7 @@
32 32
33#include <linux/if_arp.h> 33#include <linux/if_arp.h>
34 34
35void hardif_free_rcu(struct rcu_head *rcu) 35void batadv_hardif_free_rcu(struct rcu_head *rcu)
36{ 36{
37 struct hard_iface *hard_iface; 37 struct hard_iface *hard_iface;
38 38
@@ -41,7 +41,7 @@ void hardif_free_rcu(struct rcu_head *rcu)
41 kfree(hard_iface); 41 kfree(hard_iface);
42} 42}
43 43
44struct hard_iface *hardif_get_by_netdev(const struct net_device *net_dev) 44struct hard_iface *batadv_hardif_get_by_netdev(const struct net_device *net_dev)
45{ 45{
46 struct hard_iface *hard_iface; 46 struct hard_iface *hard_iface;
47 47
@@ -180,7 +180,7 @@ static void check_known_mac_addr(const struct net_device *net_dev)
180 rcu_read_unlock(); 180 rcu_read_unlock();
181} 181}
182 182
183int hardif_min_mtu(struct net_device *soft_iface) 183int batadv_hardif_min_mtu(struct net_device *soft_iface)
184{ 184{
185 const struct bat_priv *bat_priv = netdev_priv(soft_iface); 185 const struct bat_priv *bat_priv = netdev_priv(soft_iface);
186 const struct hard_iface *hard_iface; 186 const struct hard_iface *hard_iface;
@@ -209,11 +209,11 @@ out:
209} 209}
210 210
211/* adjusts the MTU if a new interface with a smaller MTU appeared. */ 211/* adjusts the MTU if a new interface with a smaller MTU appeared. */
212void update_min_mtu(struct net_device *soft_iface) 212void batadv_update_min_mtu(struct net_device *soft_iface)
213{ 213{
214 int min_mtu; 214 int min_mtu;
215 215
216 min_mtu = hardif_min_mtu(soft_iface); 216 min_mtu = batadv_hardif_min_mtu(soft_iface);
217 if (soft_iface->mtu != min_mtu) 217 if (soft_iface->mtu != min_mtu)
218 soft_iface->mtu = min_mtu; 218 soft_iface->mtu = min_mtu;
219} 219}
@@ -242,7 +242,7 @@ static void hardif_activate_interface(struct hard_iface *hard_iface)
242 bat_info(hard_iface->soft_iface, "Interface activated: %s\n", 242 bat_info(hard_iface->soft_iface, "Interface activated: %s\n",
243 hard_iface->net_dev->name); 243 hard_iface->net_dev->name);
244 244
245 update_min_mtu(hard_iface->soft_iface); 245 batadv_update_min_mtu(hard_iface->soft_iface);
246 246
247out: 247out:
248 if (primary_if) 248 if (primary_if)
@@ -260,11 +260,11 @@ static void hardif_deactivate_interface(struct hard_iface *hard_iface)
260 bat_info(hard_iface->soft_iface, "Interface deactivated: %s\n", 260 bat_info(hard_iface->soft_iface, "Interface deactivated: %s\n",
261 hard_iface->net_dev->name); 261 hard_iface->net_dev->name);
262 262
263 update_min_mtu(hard_iface->soft_iface); 263 batadv_update_min_mtu(hard_iface->soft_iface);
264} 264}
265 265
266int hardif_enable_interface(struct hard_iface *hard_iface, 266int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
267 const char *iface_name) 267 const char *iface_name)
268{ 268{
269 struct bat_priv *bat_priv; 269 struct bat_priv *bat_priv;
270 struct net_device *soft_iface; 270 struct net_device *soft_iface;
@@ -357,7 +357,7 @@ err:
357 return ret; 357 return ret;
358} 358}
359 359
360void hardif_disable_interface(struct hard_iface *hard_iface) 360void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
361{ 361{
362 struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 362 struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
363 struct hard_iface *primary_if = NULL; 363 struct hard_iface *primary_if = NULL;
@@ -461,7 +461,7 @@ static void hardif_remove_interface(struct hard_iface *hard_iface)
461 461
462 /* first deactivate interface */ 462 /* first deactivate interface */
463 if (hard_iface->if_status != IF_NOT_IN_USE) 463 if (hard_iface->if_status != IF_NOT_IN_USE)
464 hardif_disable_interface(hard_iface); 464 batadv_hardif_disable_interface(hard_iface);
465 465
466 if (hard_iface->if_status != IF_NOT_IN_USE) 466 if (hard_iface->if_status != IF_NOT_IN_USE)
467 return; 467 return;
@@ -471,7 +471,7 @@ static void hardif_remove_interface(struct hard_iface *hard_iface)
471 hardif_free_ref(hard_iface); 471 hardif_free_ref(hard_iface);
472} 472}
473 473
474void hardif_remove_interfaces(void) 474void batadv_hardif_remove_interfaces(void)
475{ 475{
476 struct hard_iface *hard_iface, *hard_iface_tmp; 476 struct hard_iface *hard_iface, *hard_iface_tmp;
477 477
@@ -488,7 +488,7 @@ static int hard_if_event(struct notifier_block *this,
488 unsigned long event, void *ptr) 488 unsigned long event, void *ptr)
489{ 489{
490 struct net_device *net_dev = ptr; 490 struct net_device *net_dev = ptr;
491 struct hard_iface *hard_iface = hardif_get_by_netdev(net_dev); 491 struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev);
492 struct hard_iface *primary_if = NULL; 492 struct hard_iface *primary_if = NULL;
493 struct bat_priv *bat_priv; 493 struct bat_priv *bat_priv;
494 494
@@ -513,7 +513,7 @@ static int hard_if_event(struct notifier_block *this,
513 break; 513 break;
514 case NETDEV_CHANGEMTU: 514 case NETDEV_CHANGEMTU:
515 if (hard_iface->soft_iface) 515 if (hard_iface->soft_iface)
516 update_min_mtu(hard_iface->soft_iface); 516 batadv_update_min_mtu(hard_iface->soft_iface);
517 break; 517 break;
518 case NETDEV_CHANGEADDR: 518 case NETDEV_CHANGEADDR:
519 if (hard_iface->if_status == IF_NOT_IN_USE) 519 if (hard_iface->if_status == IF_NOT_IN_USE)
@@ -545,7 +545,7 @@ out:
545 545
546/* This function returns true if the interface represented by ifindex is a 546/* This function returns true if the interface represented by ifindex is a
547 * 802.11 wireless device */ 547 * 802.11 wireless device */
548bool is_wifi_iface(int ifindex) 548bool batadv_is_wifi_iface(int ifindex)
549{ 549{
550 struct net_device *net_device = NULL; 550 struct net_device *net_device = NULL;
551 bool ret = false; 551 bool ret = false;
@@ -573,6 +573,6 @@ out:
573 return ret; 573 return ret;
574} 574}
575 575
576struct notifier_block hard_if_notifier = { 576struct notifier_block batadv_hard_if_notifier = {
577 .notifier_call = hard_if_event, 577 .notifier_call = hard_if_event,
578}; 578};