Commit 18a1cb6e authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Antonio Quartulli

batman-adv: Prefix hard-interface local static functions with batadv_

All non-static symbols of batman-adv were prefixed with batadv_ to avoid
collisions with other symbols of the kernel. Other symbols of batman-adv
should use the same prefix to keep the naming scheme consistent.
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
parent 8e714a5d
...@@ -57,7 +57,7 @@ struct hard_iface *batadv_hardif_get_by_netdev(const struct net_device *net_dev) ...@@ -57,7 +57,7 @@ struct hard_iface *batadv_hardif_get_by_netdev(const struct net_device *net_dev)
return hard_iface; return hard_iface;
} }
static int is_valid_iface(const struct net_device *net_dev) static int batadv_is_valid_iface(const struct net_device *net_dev)
{ {
if (net_dev->flags & IFF_LOOPBACK) if (net_dev->flags & IFF_LOOPBACK)
return 0; return 0;
...@@ -75,7 +75,8 @@ static int is_valid_iface(const struct net_device *net_dev) ...@@ -75,7 +75,8 @@ static int is_valid_iface(const struct net_device *net_dev)
return 1; return 1;
} }
static struct hard_iface *hardif_get_active(const struct net_device *soft_iface) static struct hard_iface *
batadv_hardif_get_active(const struct net_device *soft_iface)
{ {
struct hard_iface *hard_iface; struct hard_iface *hard_iface;
...@@ -96,8 +97,8 @@ static struct hard_iface *hardif_get_active(const struct net_device *soft_iface) ...@@ -96,8 +97,8 @@ static struct hard_iface *hardif_get_active(const struct net_device *soft_iface)
return hard_iface; return hard_iface;
} }
static void primary_if_update_addr(struct bat_priv *bat_priv, static void batadv_primary_if_update_addr(struct bat_priv *bat_priv,
struct hard_iface *oldif) struct hard_iface *oldif)
{ {
struct vis_packet *vis_packet; struct vis_packet *vis_packet;
struct hard_iface *primary_if; struct hard_iface *primary_if;
...@@ -118,8 +119,8 @@ static void primary_if_update_addr(struct bat_priv *bat_priv, ...@@ -118,8 +119,8 @@ static void primary_if_update_addr(struct bat_priv *bat_priv,
batadv_hardif_free_ref(primary_if); batadv_hardif_free_ref(primary_if);
} }
static void primary_if_select(struct bat_priv *bat_priv, static void batadv_primary_if_select(struct bat_priv *bat_priv,
struct hard_iface *new_hard_iface) struct hard_iface *new_hard_iface)
{ {
struct hard_iface *curr_hard_iface; struct hard_iface *curr_hard_iface;
...@@ -135,14 +136,14 @@ static void primary_if_select(struct bat_priv *bat_priv, ...@@ -135,14 +136,14 @@ static void primary_if_select(struct bat_priv *bat_priv,
goto out; goto out;
bat_priv->bat_algo_ops->bat_primary_iface_set(new_hard_iface); bat_priv->bat_algo_ops->bat_primary_iface_set(new_hard_iface);
primary_if_update_addr(bat_priv, curr_hard_iface); batadv_primary_if_update_addr(bat_priv, curr_hard_iface);
out: out:
if (curr_hard_iface) if (curr_hard_iface)
batadv_hardif_free_ref(curr_hard_iface); batadv_hardif_free_ref(curr_hard_iface);
} }
static bool hardif_is_iface_up(const struct hard_iface *hard_iface) static bool batadv_hardif_is_iface_up(const struct hard_iface *hard_iface)
{ {
if (hard_iface->net_dev->flags & IFF_UP) if (hard_iface->net_dev->flags & IFF_UP)
return true; return true;
...@@ -150,7 +151,7 @@ static bool hardif_is_iface_up(const struct hard_iface *hard_iface) ...@@ -150,7 +151,7 @@ static bool hardif_is_iface_up(const struct hard_iface *hard_iface)
return false; return false;
} }
static void check_known_mac_addr(const struct net_device *net_dev) static void batadv_check_known_mac_addr(const struct net_device *net_dev)
{ {
const struct hard_iface *hard_iface; const struct hard_iface *hard_iface;
...@@ -213,7 +214,7 @@ void batadv_update_min_mtu(struct net_device *soft_iface) ...@@ -213,7 +214,7 @@ void batadv_update_min_mtu(struct net_device *soft_iface)
soft_iface->mtu = min_mtu; soft_iface->mtu = min_mtu;
} }
static void hardif_activate_interface(struct hard_iface *hard_iface) static void batadv_hardif_activate_interface(struct hard_iface *hard_iface)
{ {
struct bat_priv *bat_priv; struct bat_priv *bat_priv;
struct hard_iface *primary_if = NULL; struct hard_iface *primary_if = NULL;
...@@ -231,7 +232,7 @@ static void hardif_activate_interface(struct hard_iface *hard_iface) ...@@ -231,7 +232,7 @@ static void hardif_activate_interface(struct hard_iface *hard_iface)
*/ */
primary_if = batadv_primary_if_get_selected(bat_priv); primary_if = batadv_primary_if_get_selected(bat_priv);
if (!primary_if) if (!primary_if)
primary_if_select(bat_priv, hard_iface); batadv_primary_if_select(bat_priv, hard_iface);
bat_info(hard_iface->soft_iface, "Interface activated: %s\n", bat_info(hard_iface->soft_iface, "Interface activated: %s\n",
hard_iface->net_dev->name); hard_iface->net_dev->name);
...@@ -243,7 +244,7 @@ static void hardif_activate_interface(struct hard_iface *hard_iface) ...@@ -243,7 +244,7 @@ static void hardif_activate_interface(struct hard_iface *hard_iface)
batadv_hardif_free_ref(primary_if); batadv_hardif_free_ref(primary_if);
} }
static void hardif_deactivate_interface(struct hard_iface *hard_iface) static void batadv_hardif_deactivate_interface(struct hard_iface *hard_iface)
{ {
if ((hard_iface->if_status != IF_ACTIVE) && if ((hard_iface->if_status != IF_ACTIVE) &&
(hard_iface->if_status != IF_TO_BE_ACTIVATED)) (hard_iface->if_status != IF_TO_BE_ACTIVATED))
...@@ -331,8 +332,8 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface, ...@@ -331,8 +332,8 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
hard_iface->net_dev->name, hard_iface->net_dev->mtu, hard_iface->net_dev->name, hard_iface->net_dev->mtu,
ETH_DATA_LEN + BAT_HEADER_LEN); ETH_DATA_LEN + BAT_HEADER_LEN);
if (hardif_is_iface_up(hard_iface)) if (batadv_hardif_is_iface_up(hard_iface))
hardif_activate_interface(hard_iface); batadv_hardif_activate_interface(hard_iface);
else else
bat_err(hard_iface->soft_iface, bat_err(hard_iface->soft_iface,
"Not using interface %s (retrying later): interface not active\n", "Not using interface %s (retrying later): interface not active\n",
...@@ -357,7 +358,7 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface) ...@@ -357,7 +358,7 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
struct hard_iface *primary_if = NULL; struct hard_iface *primary_if = NULL;
if (hard_iface->if_status == IF_ACTIVE) if (hard_iface->if_status == IF_ACTIVE)
hardif_deactivate_interface(hard_iface); batadv_hardif_deactivate_interface(hard_iface);
if (hard_iface->if_status != IF_INACTIVE) if (hard_iface->if_status != IF_INACTIVE)
goto out; goto out;
...@@ -373,8 +374,8 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface) ...@@ -373,8 +374,8 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
if (hard_iface == primary_if) { if (hard_iface == primary_if) {
struct hard_iface *new_if; struct hard_iface *new_if;
new_if = hardif_get_active(hard_iface->soft_iface); new_if = batadv_hardif_get_active(hard_iface->soft_iface);
primary_if_select(bat_priv, new_if); batadv_primary_if_select(bat_priv, new_if);
if (new_if) if (new_if)
batadv_hardif_free_ref(new_if); batadv_hardif_free_ref(new_if);
...@@ -400,14 +401,15 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface) ...@@ -400,14 +401,15 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
batadv_hardif_free_ref(primary_if); batadv_hardif_free_ref(primary_if);
} }
static struct hard_iface *hardif_add_interface(struct net_device *net_dev) static struct hard_iface *
batadv_hardif_add_interface(struct net_device *net_dev)
{ {
struct hard_iface *hard_iface; struct hard_iface *hard_iface;
int ret; int ret;
ASSERT_RTNL(); ASSERT_RTNL();
ret = is_valid_iface(net_dev); ret = batadv_is_valid_iface(net_dev);
if (ret != 1) if (ret != 1)
goto out; goto out;
...@@ -429,7 +431,7 @@ static struct hard_iface *hardif_add_interface(struct net_device *net_dev) ...@@ -429,7 +431,7 @@ static struct hard_iface *hardif_add_interface(struct net_device *net_dev)
/* extra reference for return */ /* extra reference for return */
atomic_set(&hard_iface->refcount, 2); atomic_set(&hard_iface->refcount, 2);
check_known_mac_addr(hard_iface->net_dev); batadv_check_known_mac_addr(hard_iface->net_dev);
list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list); list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list);
/* This can't be called via a bat_priv callback because /* This can't be called via a bat_priv callback because
...@@ -448,7 +450,7 @@ static struct hard_iface *hardif_add_interface(struct net_device *net_dev) ...@@ -448,7 +450,7 @@ static struct hard_iface *hardif_add_interface(struct net_device *net_dev)
return NULL; return NULL;
} }
static void hardif_remove_interface(struct hard_iface *hard_iface) static void batadv_hardif_remove_interface(struct hard_iface *hard_iface)
{ {
ASSERT_RTNL(); ASSERT_RTNL();
...@@ -472,13 +474,13 @@ void batadv_hardif_remove_interfaces(void) ...@@ -472,13 +474,13 @@ void batadv_hardif_remove_interfaces(void)
list_for_each_entry_safe(hard_iface, hard_iface_tmp, list_for_each_entry_safe(hard_iface, hard_iface_tmp,
&batadv_hardif_list, list) { &batadv_hardif_list, list) {
list_del_rcu(&hard_iface->list); list_del_rcu(&hard_iface->list);
hardif_remove_interface(hard_iface); batadv_hardif_remove_interface(hard_iface);
} }
rtnl_unlock(); rtnl_unlock();
} }
static int hard_if_event(struct notifier_block *this, static int batadv_hard_if_event(struct notifier_block *this,
unsigned long event, void *ptr) unsigned long event, void *ptr)
{ {
struct net_device *net_dev = ptr; struct net_device *net_dev = ptr;
struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev); struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev);
...@@ -486,23 +488,23 @@ static int hard_if_event(struct notifier_block *this, ...@@ -486,23 +488,23 @@ static int hard_if_event(struct notifier_block *this,
struct bat_priv *bat_priv; struct bat_priv *bat_priv;
if (!hard_iface && event == NETDEV_REGISTER) if (!hard_iface && event == NETDEV_REGISTER)
hard_iface = hardif_add_interface(net_dev); hard_iface = batadv_hardif_add_interface(net_dev);
if (!hard_iface) if (!hard_iface)
goto out; goto out;
switch (event) { switch (event) {
case NETDEV_UP: case NETDEV_UP:
hardif_activate_interface(hard_iface); batadv_hardif_activate_interface(hard_iface);
break; break;
case NETDEV_GOING_DOWN: case NETDEV_GOING_DOWN:
case NETDEV_DOWN: case NETDEV_DOWN:
hardif_deactivate_interface(hard_iface); batadv_hardif_deactivate_interface(hard_iface);
break; break;
case NETDEV_UNREGISTER: case NETDEV_UNREGISTER:
list_del_rcu(&hard_iface->list); list_del_rcu(&hard_iface->list);
hardif_remove_interface(hard_iface); batadv_hardif_remove_interface(hard_iface);
break; break;
case NETDEV_CHANGEMTU: case NETDEV_CHANGEMTU:
if (hard_iface->soft_iface) if (hard_iface->soft_iface)
...@@ -512,7 +514,7 @@ static int hard_if_event(struct notifier_block *this, ...@@ -512,7 +514,7 @@ static int hard_if_event(struct notifier_block *this,
if (hard_iface->if_status == IF_NOT_IN_USE) if (hard_iface->if_status == IF_NOT_IN_USE)
goto hardif_put; goto hardif_put;
check_known_mac_addr(hard_iface->net_dev); batadv_check_known_mac_addr(hard_iface->net_dev);
bat_priv = netdev_priv(hard_iface->soft_iface); bat_priv = netdev_priv(hard_iface->soft_iface);
bat_priv->bat_algo_ops->bat_iface_update_mac(hard_iface); bat_priv->bat_algo_ops->bat_iface_update_mac(hard_iface);
...@@ -522,7 +524,7 @@ static int hard_if_event(struct notifier_block *this, ...@@ -522,7 +524,7 @@ static int hard_if_event(struct notifier_block *this,
goto hardif_put; goto hardif_put;
if (hard_iface == primary_if) if (hard_iface == primary_if)
primary_if_update_addr(bat_priv, NULL); batadv_primary_if_update_addr(bat_priv, NULL);
break; break;
default: default:
break; break;
...@@ -569,5 +571,5 @@ bool batadv_is_wifi_iface(int ifindex) ...@@ -569,5 +571,5 @@ bool batadv_is_wifi_iface(int ifindex)
} }
struct notifier_block batadv_hard_if_notifier = { struct notifier_block batadv_hard_if_notifier = {
.notifier_call = hard_if_event, .notifier_call = batadv_hard_if_event,
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment