Commit 9b4a1159 authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Antonio Quartulli

batman-adv: Prefix bitarray static inline 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 9e466250
...@@ -901,7 +901,7 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, ...@@ -901,7 +901,7 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
hlist_for_each_entry_rcu(tmp_neigh_node, node, hlist_for_each_entry_rcu(tmp_neigh_node, node,
&orig_node->neigh_list, list) { &orig_node->neigh_list, list) {
is_duplicate |= bat_test_bit(tmp_neigh_node->real_bits, is_duplicate |= batadv_test_bit(tmp_neigh_node->real_bits,
orig_node->last_real_seqno, orig_node->last_real_seqno,
seqno); seqno);
...@@ -1037,6 +1037,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr, ...@@ -1037,6 +1037,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
if (is_my_orig) { if (is_my_orig) {
unsigned long *word; unsigned long *word;
int offset; int offset;
int32_t bit_pos;
orig_neigh_node = batadv_get_orig_node(bat_priv, orig_neigh_node = batadv_get_orig_node(bat_priv,
ethhdr->h_source); ethhdr->h_source);
...@@ -1054,9 +1055,9 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr, ...@@ -1054,9 +1055,9 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
spin_lock_bh(&orig_neigh_node->ogm_cnt_lock); spin_lock_bh(&orig_neigh_node->ogm_cnt_lock);
word = &(orig_neigh_node->bcast_own[offset]); word = &(orig_neigh_node->bcast_own[offset]);
bat_set_bit(word, bit_pos = if_incoming_seqno - 2;
if_incoming_seqno - bit_pos -= ntohl(batman_ogm_packet->seqno);
ntohl(batman_ogm_packet->seqno) - 2); batadv_set_bit(word, bit_pos);
orig_neigh_node->bcast_own_sum[if_incoming->if_num] = orig_neigh_node->bcast_own_sum[if_incoming->if_num] =
bitmap_weight(word, TQ_LOCAL_WINDOW_SIZE); bitmap_weight(word, TQ_LOCAL_WINDOW_SIZE);
spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock); spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock);
......
...@@ -48,7 +48,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, ...@@ -48,7 +48,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
*/ */
if ((seq_num_diff <= 0) && (seq_num_diff > -TQ_LOCAL_WINDOW_SIZE)) { if ((seq_num_diff <= 0) && (seq_num_diff > -TQ_LOCAL_WINDOW_SIZE)) {
if (set_mark) if (set_mark)
bat_set_bit(seq_bits, -seq_num_diff); batadv_set_bit(seq_bits, -seq_num_diff);
return 0; return 0;
} }
...@@ -59,7 +59,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, ...@@ -59,7 +59,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
batadv_bitmap_shift_left(seq_bits, seq_num_diff); batadv_bitmap_shift_left(seq_bits, seq_num_diff);
if (set_mark) if (set_mark)
bat_set_bit(seq_bits, 0); batadv_set_bit(seq_bits, 0);
return 1; return 1;
} }
...@@ -71,7 +71,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, ...@@ -71,7 +71,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
seq_num_diff - 1); seq_num_diff - 1);
bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE); bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE);
if (set_mark) if (set_mark)
bat_set_bit(seq_bits, 0); batadv_set_bit(seq_bits, 0);
return 1; return 1;
} }
...@@ -88,7 +88,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, ...@@ -88,7 +88,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE); bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE);
if (set_mark) if (set_mark)
bat_set_bit(seq_bits, 0); batadv_set_bit(seq_bits, 0);
return 1; return 1;
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/* returns true if the corresponding bit in the given seq_bits indicates true /* returns true if the corresponding bit in the given seq_bits indicates true
* and curr_seqno is within range of last_seqno * and curr_seqno is within range of last_seqno
*/ */
static inline int bat_test_bit(const unsigned long *seq_bits, static inline int batadv_test_bit(const unsigned long *seq_bits,
uint32_t last_seqno, uint32_t curr_seqno) uint32_t last_seqno, uint32_t curr_seqno)
{ {
int32_t diff; int32_t diff;
...@@ -36,7 +36,7 @@ static inline int bat_test_bit(const unsigned long *seq_bits, ...@@ -36,7 +36,7 @@ static inline int bat_test_bit(const unsigned long *seq_bits,
} }
/* turn corresponding bit on, so we can remember that we got the packet */ /* turn corresponding bit on, so we can remember that we got the packet */
static inline void bat_set_bit(unsigned long *seq_bits, int32_t n) static inline void batadv_set_bit(unsigned long *seq_bits, int32_t n)
{ {
/* if too old, just drop it */ /* if too old, just drop it */
if (n < 0 || n >= TQ_LOCAL_WINDOW_SIZE) if (n < 0 || n >= TQ_LOCAL_WINDOW_SIZE)
......
...@@ -1086,7 +1086,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if) ...@@ -1086,7 +1086,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
spin_lock_bh(&orig_node->bcast_seqno_lock); spin_lock_bh(&orig_node->bcast_seqno_lock);
/* check whether the packet is a duplicate */ /* check whether the packet is a duplicate */
if (bat_test_bit(orig_node->bcast_bits, orig_node->last_bcast_seqno, if (batadv_test_bit(orig_node->bcast_bits, orig_node->last_bcast_seqno,
ntohl(bcast_packet->seqno))) ntohl(bcast_packet->seqno)))
goto spin_unlock; goto spin_unlock;
......
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