Skip to content

Commit

Permalink
batman-adv: Prefix main enum with BATADV_
Browse files Browse the repository at this point in the history
Reported-by: Martin Hundebøll <[email protected]>
Signed-off-by: Sven Eckelmann <[email protected]>
  • Loading branch information
ecsv authored and Antonio Quartulli committed Jul 1, 2012
1 parent acd34af commit 39c75a5
Show file tree
Hide file tree
Showing 14 changed files with 140 additions and 135 deletions.
48 changes: 24 additions & 24 deletions net/batman-adv/bat_iv_ogm.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static void batadv_iv_ogm_send_to_if(struct forw_packet *forw_packet,
fwd_str = (packet_num > 0 ? "Forwarding" : (forw_packet->own ?
"Sending own" :
"Forwarding"));
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"%s %spacket (originator %pM, seqno %u, TQ %d, TTL %d, IDF %s, ttvn %d) on interface %s [%pM]\n",
fwd_str, (packet_num > 0 ? "aggregated " : ""),
batman_ogm_packet->orig,
Expand Down Expand Up @@ -252,7 +252,7 @@ static void batadv_iv_ogm_emit(struct forw_packet *forw_packet)
(forw_packet->own && (forw_packet->if_incoming != primary_if))) {

/* FIXME: what about aggregated packets ? */
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"%s packet (originator %pM, seqno %u, TTL %d) on interface %s [%pM]\n",
(forw_packet->own ? "Sending own" : "Forwarding"),
batman_ogm_packet->orig,
Expand Down Expand Up @@ -385,7 +385,7 @@ static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff,
/* own packet should always be scheduled */
if (!own_packet) {
if (!batadv_atomic_dec_not_zero(&bat_priv->batman_queue_left)) {
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"batman packet queue full\n");
goto out;
}
Expand Down Expand Up @@ -535,7 +535,7 @@ static void batadv_iv_ogm_forward(struct orig_node *orig_node,
uint8_t tt_num_changes;

if (batman_ogm_packet->header.ttl <= 1) {
batadv_dbg(DBG_BATMAN, bat_priv, "ttl exceeded\n");
batadv_dbg(BATADV_DBG_BATMAN, bat_priv, "ttl exceeded\n");
return;
}

Expand All @@ -561,7 +561,7 @@ static void batadv_iv_ogm_forward(struct orig_node *orig_node,
batman_ogm_packet->tq = batadv_hop_penalty(batman_ogm_packet->tq,
bat_priv);

batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Forwarding packet: tq: %i, ttl: %i\n",
batman_ogm_packet->tq, batman_ogm_packet->header.ttl);

Expand Down Expand Up @@ -642,7 +642,7 @@ batadv_iv_ogm_orig_update(struct bat_priv *bat_priv,
uint8_t bcast_own_sum_orig, bcast_own_sum_neigh;
uint8_t *neigh_addr;

batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"update_originator(): Searching and updating originator entry of received packet\n");

rcu_read_lock();
Expand Down Expand Up @@ -685,7 +685,7 @@ batadv_iv_ogm_orig_update(struct bat_priv *bat_priv,
if (!neigh_node)
goto unlock;
} else
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Updating existing last-hop neighbor of originator\n");

rcu_read_unlock();
Expand Down Expand Up @@ -866,7 +866,7 @@ static int batadv_iv_ogm_calc_tq(struct orig_node *orig_node,
combined_tq /= BATADV_TQ_MAX_VALUE * BATADV_TQ_MAX_VALUE;
batman_ogm_packet->tq = combined_tq;

batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"bidirectional: orig = %-15pM neigh = %-15pM => own_bcast = %2i, real recv = %2i, local tq: %3i, asym_penalty: %3i, total tq: %3i\n",
orig_node->orig, orig_neigh_node->orig, total_count,
neigh_rq_count, tq_own,
Expand Down Expand Up @@ -948,7 +948,7 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
rcu_read_unlock();

if (need_update) {
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"updating last_seqno: old %u, new %u\n",
orig_node->last_real_seqno, seqno);
orig_node->last_real_seqno = seqno;
Expand Down Expand Up @@ -1007,7 +1007,7 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
if (batadv_compare_eth(ethhdr->h_source, batman_ogm_packet->orig))
is_single_hop_neigh = true;

batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Received BATMAN packet via NB: %pM, IF: %s [%pM] (from OG: %pM, via prev OG: %pM, seqno %u, ttvn %u, crc %u, changes %u, td %d, TTL %d, V %d, IDF %d)\n",
ethhdr->h_source, if_incoming->net_dev->name,
if_incoming->net_dev->dev_addr, batman_ogm_packet->orig,
Expand Down Expand Up @@ -1044,21 +1044,21 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
rcu_read_unlock();

if (batman_ogm_packet->header.version != BATADV_COMPAT_VERSION) {
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Drop packet: incompatible batman version (%i)\n",
batman_ogm_packet->header.version);
return;
}

if (is_my_addr) {
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Drop packet: received my own broadcast (sender: %pM)\n",
ethhdr->h_source);
return;
}

if (is_broadcast) {
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Drop packet: ignoring all packets with broadcast source addr (sender: %pM)\n",
ethhdr->h_source);
return;
Expand Down Expand Up @@ -1097,21 +1097,21 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock);
}

batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Drop packet: originator packet from myself (via neighbor)\n");
batadv_orig_node_free_ref(orig_neigh_node);
return;
}

if (is_my_oldorig) {
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Drop packet: ignoring all rebroadcast echos (sender: %pM)\n",
ethhdr->h_source);
return;
}

if (batman_ogm_packet->flags & BATADV_NOT_BEST_NEXT_HOP) {
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Drop packet: ignoring all packets not forwarded from the best next hop (sender: %pM)\n",
ethhdr->h_source);
return;
Expand All @@ -1125,14 +1125,14 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
if_incoming);

if (is_duplicate == -1) {
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Drop packet: packet within seqno protection time (sender: %pM)\n",
ethhdr->h_source);
goto out;
}

if (batman_ogm_packet->tq == 0) {
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Drop packet: originator packet with tq equal 0\n");
goto out;
}
Expand All @@ -1151,7 +1151,7 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
(batadv_compare_eth(router->addr, prev_sender)) &&
!(batadv_compare_eth(batman_ogm_packet->orig, prev_sender)) &&
(batadv_compare_eth(router->addr, router_router->addr))) {
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Drop packet: ignoring all rebroadcast packets that may make me loop (sender: %pM)\n",
ethhdr->h_source);
goto out;
Expand All @@ -1172,7 +1172,7 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
* don't route towards it
*/
if (!is_single_hop_neigh && (!orig_neigh_router)) {
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Drop packet: OGM via unknown neighbor!\n");
goto out_neigh;
}
Expand Down Expand Up @@ -1201,25 +1201,25 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
is_single_hop_neigh,
is_from_best_next_hop, if_incoming);

batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Forwarding packet: rebroadcast neighbor packet with direct link flag\n");
goto out_neigh;
}

/* multihop originator */
if (!is_bidirect) {
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Drop packet: not received via bidirectional link\n");
goto out_neigh;
}

if (is_duplicate) {
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Drop packet: duplicate packet received\n");
goto out_neigh;
}

batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Forwarding packet: rebroadcast originator packet\n");
batadv_iv_ogm_forward(orig_node, ethhdr, batman_ogm_packet,
is_single_hop_neigh, is_from_best_next_hop,
Expand Down
12 changes: 6 additions & 6 deletions net/batman-adv/bat_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ BATADV_ATTR_SIF_UINT(gw_sel_class, S_IRUGO | S_IWUSR, 1, BATADV_TQ_MAX_VALUE,
static BATADV_ATTR(gw_bandwidth, S_IRUGO | S_IWUSR, batadv_show_gw_bwidth,
batadv_store_gw_bwidth);
#ifdef CONFIG_BATMAN_ADV_DEBUG
BATADV_ATTR_SIF_UINT(log_level, S_IRUGO | S_IWUSR, 0, DBG_ALL, NULL);
BATADV_ATTR_SIF_UINT(log_level, S_IRUGO | S_IWUSR, 0, BATADV_DBG_ALL, NULL);
#endif

static struct bat_attribute *batadv_mesh_attrs[] = {
Expand Down Expand Up @@ -723,8 +723,8 @@ void batadv_sysfs_del_hardif(struct kobject **hardif_obj)
*hardif_obj = NULL;
}

int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type,
enum uev_action action, const char *data)
int batadv_throw_uevent(struct bat_priv *bat_priv, enum batadv_uev_type type,
enum batadv_uev_action action, const char *data)
{
int ret = -ENOMEM;
struct hard_iface *primary_if = NULL;
Expand Down Expand Up @@ -756,7 +756,7 @@ int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type,
batadv_uev_action_str[action]);

/* If the event is DEL, ignore the data field */
if (action != UEV_DEL) {
if (action != BATADV_UEV_DEL) {
uevent_env[2] = kmalloc(strlen(BATADV_UEV_DATA_VAR) +
strlen(data) + 1, GFP_ATOMIC);
if (!uevent_env[2])
Expand All @@ -775,10 +775,10 @@ int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type,
batadv_hardif_free_ref(primary_if);

if (ret)
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Impossible to send uevent for (%s,%s,%s) event (err: %d)\n",
batadv_uev_type_str[type],
batadv_uev_action_str[action],
(action == UEV_DEL ? "NULL" : data), ret);
(action == BATADV_UEV_DEL ? "NULL" : data), ret);
return ret;
}
4 changes: 2 additions & 2 deletions net/batman-adv/bat_sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void batadv_sysfs_del_meshif(struct net_device *dev);
int batadv_sysfs_add_hardif(struct kobject **hardif_obj,
struct net_device *dev);
void batadv_sysfs_del_hardif(struct kobject **hardif_obj);
int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type,
enum uev_action action, const char *data);
int batadv_throw_uevent(struct bat_priv *bat_priv, enum batadv_uev_type type,
enum batadv_uev_action action, const char *data);

#endif /* _NET_BATMAN_ADV_SYSFS_H_ */
4 changes: 2 additions & 2 deletions net/batman-adv/bitarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
/* sequence number is much newer, probably missed a lot of packets */
if (seq_num_diff >= BATADV_TQ_LOCAL_WINDOW_SIZE &&
seq_num_diff < BATADV_EXPECTED_SEQNO_RANGE) {
batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"We missed a lot of packets (%i) !\n",
seq_num_diff - 1);
bitmap_zero(seq_bits, BATADV_TQ_LOCAL_WINDOW_SIZE);
Expand All @@ -83,7 +83,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
if (seq_num_diff <= -BATADV_TQ_LOCAL_WINDOW_SIZE ||
seq_num_diff >= BATADV_EXPECTED_SEQNO_RANGE) {

batadv_dbg(DBG_BATMAN, bat_priv,
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Other host probably restarted!\n");

bitmap_zero(seq_bits, BATADV_TQ_LOCAL_WINDOW_SIZE);
Expand Down
Loading

0 comments on commit 39c75a5

Please sign in to comment.