aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/batman-adv/bat_iv_ogm.c14
-rw-r--r--net/batman-adv/ring_buffer.c5
-rw-r--r--net/batman-adv/ring_buffer.h5
3 files changed, 13 insertions, 11 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 9c8c9d017d00..cd57cf2022c5 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -642,10 +642,10 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
642 continue; 642 continue;
643 643
644 spin_lock_bh(&tmp_neigh_node->lq_update_lock); 644 spin_lock_bh(&tmp_neigh_node->lq_update_lock);
645 ring_buffer_set(tmp_neigh_node->tq_recv, 645 batadv_ring_buffer_set(tmp_neigh_node->tq_recv,
646 &tmp_neigh_node->tq_index, 0); 646 &tmp_neigh_node->tq_index, 0);
647 tmp_neigh_node->tq_avg = 647 tmp_neigh_node->tq_avg =
648 ring_buffer_avg(tmp_neigh_node->tq_recv); 648 batadv_ring_buffer_avg(tmp_neigh_node->tq_recv);
649 spin_unlock_bh(&tmp_neigh_node->lq_update_lock); 649 spin_unlock_bh(&tmp_neigh_node->lq_update_lock);
650 } 650 }
651 651
@@ -673,10 +673,10 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
673 neigh_node->last_seen = jiffies; 673 neigh_node->last_seen = jiffies;
674 674
675 spin_lock_bh(&neigh_node->lq_update_lock); 675 spin_lock_bh(&neigh_node->lq_update_lock);
676 ring_buffer_set(neigh_node->tq_recv, 676 batadv_ring_buffer_set(neigh_node->tq_recv,
677 &neigh_node->tq_index, 677 &neigh_node->tq_index,
678 batman_ogm_packet->tq); 678 batman_ogm_packet->tq);
679 neigh_node->tq_avg = ring_buffer_avg(neigh_node->tq_recv); 679 neigh_node->tq_avg = batadv_ring_buffer_avg(neigh_node->tq_recv);
680 spin_unlock_bh(&neigh_node->lq_update_lock); 680 spin_unlock_bh(&neigh_node->lq_update_lock);
681 681
682 if (!is_duplicate) { 682 if (!is_duplicate) {
diff --git a/net/batman-adv/ring_buffer.c b/net/batman-adv/ring_buffer.c
index fd63951d118d..db8f5ef83d3e 100644
--- a/net/batman-adv/ring_buffer.c
+++ b/net/batman-adv/ring_buffer.c
@@ -22,13 +22,14 @@
22#include "main.h" 22#include "main.h"
23#include "ring_buffer.h" 23#include "ring_buffer.h"
24 24
25void ring_buffer_set(uint8_t lq_recv[], uint8_t *lq_index, uint8_t value) 25void batadv_ring_buffer_set(uint8_t lq_recv[], uint8_t *lq_index,
26 uint8_t value)
26{ 27{
27 lq_recv[*lq_index] = value; 28 lq_recv[*lq_index] = value;
28 *lq_index = (*lq_index + 1) % TQ_GLOBAL_WINDOW_SIZE; 29 *lq_index = (*lq_index + 1) % TQ_GLOBAL_WINDOW_SIZE;
29} 30}
30 31
31uint8_t ring_buffer_avg(const uint8_t lq_recv[]) 32uint8_t batadv_ring_buffer_avg(const uint8_t lq_recv[])
32{ 33{
33 const uint8_t *ptr; 34 const uint8_t *ptr;
34 uint16_t count = 0, i = 0, sum = 0; 35 uint16_t count = 0, i = 0, sum = 0;
diff --git a/net/batman-adv/ring_buffer.h b/net/batman-adv/ring_buffer.h
index 8b58bd82767d..fbaf9d29d1d7 100644
--- a/net/batman-adv/ring_buffer.h
+++ b/net/batman-adv/ring_buffer.h
@@ -22,7 +22,8 @@
22#ifndef _NET_BATMAN_ADV_RING_BUFFER_H_ 22#ifndef _NET_BATMAN_ADV_RING_BUFFER_H_
23#define _NET_BATMAN_ADV_RING_BUFFER_H_ 23#define _NET_BATMAN_ADV_RING_BUFFER_H_
24 24
25void ring_buffer_set(uint8_t lq_recv[], uint8_t *lq_index, uint8_t value); 25void batadv_ring_buffer_set(uint8_t lq_recv[], uint8_t *lq_index,
26uint8_t ring_buffer_avg(const uint8_t lq_recv[]); 26 uint8_t value);
27uint8_t batadv_ring_buffer_avg(const uint8_t lq_recv[]);
27 28
28#endif /* _NET_BATMAN_ADV_RING_BUFFER_H_ */ 29#endif /* _NET_BATMAN_ADV_RING_BUFFER_H_ */