batman-adv: Prefix types enum with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index a59e317..6099719 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -209,8 +209,8 @@
/* create clone because function is called more than once */
skb = skb_clone(forw_packet->skb, GFP_ATOMIC);
if (skb) {
- batadv_inc_counter(bat_priv, BAT_CNT_MGMT_TX);
- batadv_add_counter(bat_priv, BAT_CNT_MGMT_TX_BYTES,
+ batadv_inc_counter(bat_priv, BATADV_CNT_MGMT_TX);
+ batadv_add_counter(bat_priv, BATADV_CNT_MGMT_TX_BYTES,
skb->len + ETH_HLEN);
batadv_send_skb_packet(skb, hard_iface, batadv_broadcast_addr);
}
@@ -1256,8 +1256,8 @@
if (bat_priv->bat_algo_ops->bat_ogm_emit != batadv_iv_ogm_emit)
return NET_RX_DROP;
- batadv_inc_counter(bat_priv, BAT_CNT_MGMT_RX);
- batadv_add_counter(bat_priv, BAT_CNT_MGMT_RX_BYTES,
+ batadv_inc_counter(bat_priv, BATADV_CNT_MGMT_RX);
+ batadv_add_counter(bat_priv, BATADV_CNT_MGMT_RX_BYTES,
skb->len + ETH_HLEN);
packet_len = skb_headlen(skb);
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 4d63221..aa8325e 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -607,7 +607,7 @@
switch (tt_query->flags & BATADV_TT_QUERY_TYPE_MASK) {
case TT_REQUEST:
- batadv_inc_counter(bat_priv, BAT_CNT_TT_REQUEST_RX);
+ batadv_inc_counter(bat_priv, BATADV_CNT_TT_REQUEST_RX);
/* If we cannot provide an answer the tt_request is
* forwarded
@@ -622,7 +622,7 @@
}
break;
case TT_RESPONSE:
- batadv_inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_RX);
+ batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_RX);
if (batadv_is_my_mac(tt_query->dst)) {
/* packet needs to be linearized to access the TT
@@ -678,7 +678,7 @@
if (is_broadcast_ether_addr(ethhdr->h_source))
goto out;
- batadv_inc_counter(bat_priv, BAT_CNT_TT_ROAM_ADV_RX);
+ batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_RX);
roam_adv_packet = (struct roam_adv_packet *)skb->data;
@@ -900,8 +900,8 @@
unicast_packet->header.ttl--;
/* Update stats counter */
- batadv_inc_counter(bat_priv, BAT_CNT_FORWARD);
- batadv_add_counter(bat_priv, BAT_CNT_FORWARD_BYTES,
+ batadv_inc_counter(bat_priv, BATADV_CNT_FORWARD);
+ batadv_add_counter(bat_priv, BATADV_CNT_FORWARD_BYTES,
skb->len + ETH_HLEN);
/* route it */
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index b77e598..19a80d2 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -366,6 +366,7 @@
struct net_device *soft_iface;
struct bat_priv *bat_priv;
int ret;
+ size_t cnt_len = sizeof(uint64_t) * BATADV_CNT_NUM;
soft_iface = alloc_netdev(sizeof(*bat_priv), name,
batadv_interface_setup);
@@ -411,8 +412,7 @@
bat_priv->primary_if = NULL;
bat_priv->num_ifaces = 0;
- bat_priv->bat_counters = __alloc_percpu(sizeof(uint64_t) * BAT_CNT_NUM,
- __alignof__(uint64_t));
+ bat_priv->bat_counters = __alloc_percpu(cnt_len, __alignof__(uint64_t));
if (!bat_priv->bat_counters)
goto unreg_soft_iface;
@@ -542,14 +542,14 @@
struct bat_priv *bat_priv = netdev_priv(dev);
int i;
- for (i = 0; i < BAT_CNT_NUM; i++)
+ for (i = 0; i < BATADV_CNT_NUM; i++)
data[i] = batadv_sum_counter(bat_priv, i);
}
static int batadv_get_sset_count(struct net_device *dev, int stringset)
{
if (stringset == ETH_SS_STATS)
- return BAT_CNT_NUM;
+ return BATADV_CNT_NUM;
return -EOPNOTSUPP;
}
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 156c309..f36d1d5 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -1471,7 +1471,7 @@
dst_orig_node->orig, neigh_node->addr,
(full_table ? 'F' : '.'));
- batadv_inc_counter(bat_priv, BAT_CNT_TT_REQUEST_TX);
+ batadv_inc_counter(bat_priv, BATADV_CNT_TT_REQUEST_TX);
batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = 0;
@@ -1599,7 +1599,7 @@
res_dst_orig_node->orig, neigh_node->addr,
req_dst_orig_node->orig, req_ttvn);
- batadv_inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_TX);
+ batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_TX);
batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = true;
@@ -1720,7 +1720,7 @@
orig_node->orig, neigh_node->addr,
(tt_response->flags & TT_FULL_TABLE ? 'F' : '.'));
- batadv_inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_TX);
+ batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_TX);
batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = true;
@@ -2038,7 +2038,7 @@
"Sending ROAMING_ADV to %pM (client %pM) via %pM\n",
orig_node->orig, client, neigh_node->addr);
- batadv_inc_counter(bat_priv, BAT_CNT_TT_ROAM_ADV_TX);
+ batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_TX);
batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = 0;
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index fd538ea..fcbac82 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -143,20 +143,20 @@
};
#endif
-enum bat_counters {
- BAT_CNT_FORWARD,
- BAT_CNT_FORWARD_BYTES,
- BAT_CNT_MGMT_TX,
- BAT_CNT_MGMT_TX_BYTES,
- BAT_CNT_MGMT_RX,
- BAT_CNT_MGMT_RX_BYTES,
- BAT_CNT_TT_REQUEST_TX,
- BAT_CNT_TT_REQUEST_RX,
- BAT_CNT_TT_RESPONSE_TX,
- BAT_CNT_TT_RESPONSE_RX,
- BAT_CNT_TT_ROAM_ADV_TX,
- BAT_CNT_TT_ROAM_ADV_RX,
- BAT_CNT_NUM,
+enum batadv_counters {
+ BATADV_CNT_FORWARD,
+ BATADV_CNT_FORWARD_BYTES,
+ BATADV_CNT_MGMT_TX,
+ BATADV_CNT_MGMT_TX_BYTES,
+ BATADV_CNT_MGMT_RX,
+ BATADV_CNT_MGMT_RX_BYTES,
+ BATADV_CNT_TT_REQUEST_TX,
+ BATADV_CNT_TT_REQUEST_RX,
+ BATADV_CNT_TT_RESPONSE_TX,
+ BATADV_CNT_TT_RESPONSE_RX,
+ BATADV_CNT_TT_ROAM_ADV_TX,
+ BATADV_CNT_TT_ROAM_ADV_RX,
+ BATADV_CNT_NUM,
};
struct bat_priv {