Commit 97ea4ba1 authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Antonio Quartulli

batman-adv: Prefix gateway defines with BATADV_

Reported-by: default avatarMartin Hundebøll <martin@hundeboll.net>
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
parent 3964f728
...@@ -361,13 +361,16 @@ static ssize_t batadv_show_gw_mode(struct kobject *kobj, struct attribute *attr, ...@@ -361,13 +361,16 @@ static ssize_t batadv_show_gw_mode(struct kobject *kobj, struct attribute *attr,
switch (atomic_read(&bat_priv->gw_mode)) { switch (atomic_read(&bat_priv->gw_mode)) {
case GW_MODE_CLIENT: case GW_MODE_CLIENT:
bytes_written = sprintf(buff, "%s\n", GW_MODE_CLIENT_NAME); bytes_written = sprintf(buff, "%s\n",
BATADV_GW_MODE_CLIENT_NAME);
break; break;
case GW_MODE_SERVER: case GW_MODE_SERVER:
bytes_written = sprintf(buff, "%s\n", GW_MODE_SERVER_NAME); bytes_written = sprintf(buff, "%s\n",
BATADV_GW_MODE_SERVER_NAME);
break; break;
default: default:
bytes_written = sprintf(buff, "%s\n", GW_MODE_OFF_NAME); bytes_written = sprintf(buff, "%s\n",
BATADV_GW_MODE_OFF_NAME);
break; break;
} }
...@@ -386,15 +389,16 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj, ...@@ -386,15 +389,16 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj,
if (buff[count - 1] == '\n') if (buff[count - 1] == '\n')
buff[count - 1] = '\0'; buff[count - 1] = '\0';
if (strncmp(buff, GW_MODE_OFF_NAME, strlen(GW_MODE_OFF_NAME)) == 0) if (strncmp(buff, BATADV_GW_MODE_OFF_NAME,
strlen(BATADV_GW_MODE_OFF_NAME)) == 0)
gw_mode_tmp = GW_MODE_OFF; gw_mode_tmp = GW_MODE_OFF;
if (strncmp(buff, GW_MODE_CLIENT_NAME, if (strncmp(buff, BATADV_GW_MODE_CLIENT_NAME,
strlen(GW_MODE_CLIENT_NAME)) == 0) strlen(BATADV_GW_MODE_CLIENT_NAME)) == 0)
gw_mode_tmp = GW_MODE_CLIENT; gw_mode_tmp = GW_MODE_CLIENT;
if (strncmp(buff, GW_MODE_SERVER_NAME, if (strncmp(buff, BATADV_GW_MODE_SERVER_NAME,
strlen(GW_MODE_SERVER_NAME)) == 0) strlen(BATADV_GW_MODE_SERVER_NAME)) == 0)
gw_mode_tmp = GW_MODE_SERVER; gw_mode_tmp = GW_MODE_SERVER;
if (gw_mode_tmp < 0) { if (gw_mode_tmp < 0) {
...@@ -409,13 +413,13 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj, ...@@ -409,13 +413,13 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj,
switch (atomic_read(&bat_priv->gw_mode)) { switch (atomic_read(&bat_priv->gw_mode)) {
case GW_MODE_CLIENT: case GW_MODE_CLIENT:
curr_gw_mode_str = GW_MODE_CLIENT_NAME; curr_gw_mode_str = BATADV_GW_MODE_CLIENT_NAME;
break; break;
case GW_MODE_SERVER: case GW_MODE_SERVER:
curr_gw_mode_str = GW_MODE_SERVER_NAME; curr_gw_mode_str = BATADV_GW_MODE_SERVER_NAME;
break; break;
default: default:
curr_gw_mode_str = GW_MODE_OFF_NAME; curr_gw_mode_str = BATADV_GW_MODE_OFF_NAME;
break; break;
} }
......
...@@ -26,9 +26,9 @@ enum gw_modes { ...@@ -26,9 +26,9 @@ enum gw_modes {
GW_MODE_SERVER, GW_MODE_SERVER,
}; };
#define GW_MODE_OFF_NAME "off" #define BATADV_GW_MODE_OFF_NAME "off"
#define GW_MODE_CLIENT_NAME "client" #define BATADV_GW_MODE_CLIENT_NAME "client"
#define GW_MODE_SERVER_NAME "server" #define BATADV_GW_MODE_SERVER_NAME "server"
void batadv_gw_bandwidth_to_kbit(uint8_t gw_class, int *down, int *up); void batadv_gw_bandwidth_to_kbit(uint8_t gw_class, int *down, int *up);
ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff, ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff,
......
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