aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bitarray.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-06-03 16:19:17 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-28 02:45:05 -0400
commit42d0b044b7c9e5821f1bf3e2b4ea7861417c11c2 (patch)
tree3dedf87facfbc4dd0392256e93088c18509e1391 /net/batman-adv/bitarray.c
parentedbf7ff72312afcc502014ccf3c72c49fa55722a (diff)
batman-adv: Prefix main defines with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/bitarray.c')
-rw-r--r--net/batman-adv/bitarray.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/net/batman-adv/bitarray.c b/net/batman-adv/bitarray.c
index e195b9eed7ee..4a009b550895 100644
--- a/net/batman-adv/bitarray.c
+++ b/net/batman-adv/bitarray.c
@@ -25,10 +25,10 @@
25/* shift the packet array by n places. */ 25/* shift the packet array by n places. */
26static void batadv_bitmap_shift_left(unsigned long *seq_bits, int32_t n) 26static void batadv_bitmap_shift_left(unsigned long *seq_bits, int32_t n)
27{ 27{
28 if (n <= 0 || n >= TQ_LOCAL_WINDOW_SIZE) 28 if (n <= 0 || n >= BATADV_TQ_LOCAL_WINDOW_SIZE)
29 return; 29 return;
30 30
31 bitmap_shift_left(seq_bits, seq_bits, n, TQ_LOCAL_WINDOW_SIZE); 31 bitmap_shift_left(seq_bits, seq_bits, n, BATADV_TQ_LOCAL_WINDOW_SIZE);
32} 32}
33 33
34 34
@@ -46,7 +46,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
46 /* sequence number is slightly older. We already got a sequence number 46 /* sequence number is slightly older. We already got a sequence number
47 * higher than this one, so we just mark it. 47 * higher than this one, so we just mark it.
48 */ 48 */
49 if ((seq_num_diff <= 0) && (seq_num_diff > -TQ_LOCAL_WINDOW_SIZE)) { 49 if (seq_num_diff <= 0 && seq_num_diff > -BATADV_TQ_LOCAL_WINDOW_SIZE) {
50 if (set_mark) 50 if (set_mark)
51 batadv_set_bit(seq_bits, -seq_num_diff); 51 batadv_set_bit(seq_bits, -seq_num_diff);
52 return 0; 52 return 0;
@@ -55,7 +55,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
55 /* sequence number is slightly newer, so we shift the window and 55 /* sequence number is slightly newer, so we shift the window and
56 * set the mark if required 56 * set the mark if required
57 */ 57 */
58 if ((seq_num_diff > 0) && (seq_num_diff < TQ_LOCAL_WINDOW_SIZE)) { 58 if (seq_num_diff > 0 && seq_num_diff < BATADV_TQ_LOCAL_WINDOW_SIZE) {
59 batadv_bitmap_shift_left(seq_bits, seq_num_diff); 59 batadv_bitmap_shift_left(seq_bits, seq_num_diff);
60 60
61 if (set_mark) 61 if (set_mark)
@@ -64,12 +64,12 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
64 } 64 }
65 65
66 /* sequence number is much newer, probably missed a lot of packets */ 66 /* sequence number is much newer, probably missed a lot of packets */
67 if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE) && 67 if (seq_num_diff >= BATADV_TQ_LOCAL_WINDOW_SIZE &&
68 (seq_num_diff < EXPECTED_SEQNO_RANGE)) { 68 seq_num_diff < BATADV_EXPECTED_SEQNO_RANGE) {
69 batadv_dbg(DBG_BATMAN, bat_priv, 69 batadv_dbg(DBG_BATMAN, bat_priv,
70 "We missed a lot of packets (%i) !\n", 70 "We missed a lot of packets (%i) !\n",
71 seq_num_diff - 1); 71 seq_num_diff - 1);
72 bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE); 72 bitmap_zero(seq_bits, BATADV_TQ_LOCAL_WINDOW_SIZE);
73 if (set_mark) 73 if (set_mark)
74 batadv_set_bit(seq_bits, 0); 74 batadv_set_bit(seq_bits, 0);
75 return 1; 75 return 1;
@@ -80,13 +80,13 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
80 * packet should be dropped without calling this function if the 80 * packet should be dropped without calling this function if the
81 * seqno window is protected. 81 * seqno window is protected.
82 */ 82 */
83 if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) || 83 if (seq_num_diff <= -BATADV_TQ_LOCAL_WINDOW_SIZE ||
84 (seq_num_diff >= EXPECTED_SEQNO_RANGE)) { 84 seq_num_diff >= BATADV_EXPECTED_SEQNO_RANGE) {
85 85
86 batadv_dbg(DBG_BATMAN, bat_priv, 86 batadv_dbg(DBG_BATMAN, bat_priv,
87 "Other host probably restarted!\n"); 87 "Other host probably restarted!\n");
88 88
89 bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE); 89 bitmap_zero(seq_bits, BATADV_TQ_LOCAL_WINDOW_SIZE);
90 if (set_mark) 90 if (set_mark)
91 batadv_set_bit(seq_bits, 0); 91 batadv_set_bit(seq_bits, 0);
92 92