aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-06-03 22:19:18 +0200
committerAntonio Quartulli <ordex@autistici.org>2012-07-01 22:47:18 +0200
commitcd646ab1e2edde9faeff52bbc1b40e58a5e381fc (patch)
tree7608bcfc6054333d482d83a5d77276b6ee2a182a /net
parenta59a4d1921664da63d801ba477950114c71c88c9 (diff)
batman-adv: Prefix gateway enum with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/bat_iv_ogm.c4
-rw-r--r--net/batman-adv/bat_sysfs.c14
-rw-r--r--net/batman-adv/gateway_client.c8
-rw-r--r--net/batman-adv/gateway_common.h8
-rw-r--r--net/batman-adv/soft-interface.c10
5 files changed, 22 insertions, 22 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index bbe0f123d2a..d3fc58172c8 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -611,7 +611,7 @@ static void batadv_iv_ogm_schedule(struct hard_iface *hard_iface)
batman_ogm_packet->flags &= ~VIS_SERVER;
if ((hard_iface == primary_if) &&
- (atomic_read(&bat_priv->gw_mode) == GW_MODE_SERVER))
+ (atomic_read(&bat_priv->gw_mode) == BATADV_GW_MODE_SERVER))
batman_ogm_packet->gw_flags =
(uint8_t)atomic_read(&bat_priv->gw_bandwidth);
else
@@ -760,7 +760,7 @@ update_tt:
/* restart gateway selection if fast or late switching was enabled */
if ((orig_node->gw_flags) &&
- (atomic_read(&bat_priv->gw_mode) == GW_MODE_CLIENT) &&
+ (atomic_read(&bat_priv->gw_mode) == BATADV_GW_MODE_CLIENT) &&
(atomic_read(&bat_priv->gw_sel_class) > 2))
batadv_gw_check_election(bat_priv, orig_node);
diff --git a/net/batman-adv/bat_sysfs.c b/net/batman-adv/bat_sysfs.c
index 95d80d1808f..561ec31fdfb 100644
--- a/net/batman-adv/bat_sysfs.c
+++ b/net/batman-adv/bat_sysfs.c
@@ -360,11 +360,11 @@ static ssize_t batadv_show_gw_mode(struct kobject *kobj, struct attribute *attr,
int bytes_written;
switch (atomic_read(&bat_priv->gw_mode)) {
- case GW_MODE_CLIENT:
+ case BATADV_GW_MODE_CLIENT:
bytes_written = sprintf(buff, "%s\n",
BATADV_GW_MODE_CLIENT_NAME);
break;
- case GW_MODE_SERVER:
+ case BATADV_GW_MODE_SERVER:
bytes_written = sprintf(buff, "%s\n",
BATADV_GW_MODE_SERVER_NAME);
break;
@@ -391,15 +391,15 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj,
if (strncmp(buff, BATADV_GW_MODE_OFF_NAME,
strlen(BATADV_GW_MODE_OFF_NAME)) == 0)
- gw_mode_tmp = GW_MODE_OFF;
+ gw_mode_tmp = BATADV_GW_MODE_OFF;
if (strncmp(buff, BATADV_GW_MODE_CLIENT_NAME,
strlen(BATADV_GW_MODE_CLIENT_NAME)) == 0)
- gw_mode_tmp = GW_MODE_CLIENT;
+ gw_mode_tmp = BATADV_GW_MODE_CLIENT;
if (strncmp(buff, BATADV_GW_MODE_SERVER_NAME,
strlen(BATADV_GW_MODE_SERVER_NAME)) == 0)
- gw_mode_tmp = GW_MODE_SERVER;
+ gw_mode_tmp = BATADV_GW_MODE_SERVER;
if (gw_mode_tmp < 0) {
batadv_info(net_dev,
@@ -412,10 +412,10 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj,
return count;
switch (atomic_read(&bat_priv->gw_mode)) {
- case GW_MODE_CLIENT:
+ case BATADV_GW_MODE_CLIENT:
curr_gw_mode_str = BATADV_GW_MODE_CLIENT_NAME;
break;
- case GW_MODE_SERVER:
+ case BATADV_GW_MODE_SERVER:
curr_gw_mode_str = BATADV_GW_MODE_SERVER_NAME;
break;
default:
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 5fc162c8425..2fcf26f5b9c 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -194,7 +194,7 @@ void batadv_gw_election(struct bat_priv *bat_priv)
* hear about. This check is based on the daemon's uptime which we
* don't have.
*/
- if (atomic_read(&bat_priv->gw_mode) != GW_MODE_CLIENT)
+ if (atomic_read(&bat_priv->gw_mode) != BATADV_GW_MODE_CLIENT)
goto out;
if (!batadv_atomic_dec_not_zero(&bat_priv->gw_reselect))
@@ -663,13 +663,13 @@ bool batadv_gw_out_of_range(struct bat_priv *bat_priv,
goto out;
switch (atomic_read(&bat_priv->gw_mode)) {
- case GW_MODE_SERVER:
+ case BATADV_GW_MODE_SERVER:
/* If we are a GW then we are our best GW. We can artificially
* set the tq towards ourself as the maximum value
*/
curr_tq_avg = BATADV_TQ_MAX_VALUE;
break;
- case GW_MODE_CLIENT:
+ case BATADV_GW_MODE_CLIENT:
curr_gw = batadv_gw_get_selected_gw_node(bat_priv);
if (!curr_gw)
goto out;
@@ -689,7 +689,7 @@ bool batadv_gw_out_of_range(struct bat_priv *bat_priv,
curr_tq_avg = neigh_curr->tq_avg;
break;
- case GW_MODE_OFF:
+ case BATADV_GW_MODE_OFF:
default:
goto out;
}
diff --git a/net/batman-adv/gateway_common.h b/net/batman-adv/gateway_common.h
index 31bbc3c070a..13697f6e711 100644
--- a/net/batman-adv/gateway_common.h
+++ b/net/batman-adv/gateway_common.h
@@ -20,10 +20,10 @@
#ifndef _NET_BATMAN_ADV_GATEWAY_COMMON_H_
#define _NET_BATMAN_ADV_GATEWAY_COMMON_H_
-enum gw_modes {
- GW_MODE_OFF,
- GW_MODE_CLIENT,
- GW_MODE_SERVER,
+enum batadv_gw_modes {
+ BATADV_GW_MODE_OFF,
+ BATADV_GW_MODE_CLIENT,
+ BATADV_GW_MODE_SERVER,
};
#define BATADV_GW_MODE_OFF_NAME "off"
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index c1b2ab2f37b..b77e598fb2b 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -177,7 +177,7 @@ static int batadv_interface_tx(struct sk_buff *skb,
do_bcast = true;
switch (atomic_read(&bat_priv->gw_mode)) {
- case GW_MODE_SERVER:
+ case BATADV_GW_MODE_SERVER:
/* gateway servers should not send dhcp
* requests into the mesh
*/
@@ -185,7 +185,7 @@ static int batadv_interface_tx(struct sk_buff *skb,
if (ret)
goto dropped;
break;
- case GW_MODE_CLIENT:
+ case BATADV_GW_MODE_CLIENT:
/* gateway clients should send dhcp requests
* via unicast to their gateway
*/
@@ -193,7 +193,7 @@ static int batadv_interface_tx(struct sk_buff *skb,
if (ret)
do_bcast = false;
break;
- case GW_MODE_OFF:
+ case BATADV_GW_MODE_OFF:
default:
break;
}
@@ -234,7 +234,7 @@ static int batadv_interface_tx(struct sk_buff *skb,
/* unicast packet */
} else {
- if (atomic_read(&bat_priv->gw_mode) != GW_MODE_OFF) {
+ if (atomic_read(&bat_priv->gw_mode) != BATADV_GW_MODE_OFF) {
ret = batadv_gw_out_of_range(bat_priv, skb, ethhdr);
if (ret)
goto dropped;
@@ -387,7 +387,7 @@ struct net_device *batadv_softif_create(const char *name)
atomic_set(&bat_priv->bridge_loop_avoidance, 0);
atomic_set(&bat_priv->ap_isolation, 0);
atomic_set(&bat_priv->vis_mode, VIS_TYPE_CLIENT_UPDATE);
- atomic_set(&bat_priv->gw_mode, GW_MODE_OFF);
+ atomic_set(&bat_priv->gw_mode, BATADV_GW_MODE_OFF);
atomic_set(&bat_priv->gw_sel_class, 20);
atomic_set(&bat_priv->gw_bandwidth, 41);
atomic_set(&bat_priv->orig_interval, 1000);