aboutsummaryrefslogtreecommitdiffstats
path: root/src/encoding.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-12-23 16:29:07 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-01 13:58:12 +0100
commit93c55d04e5917aa54ce37a9e997d0af87cc8be85 (patch)
tree25d4261bbed94b8fce8b5d826287955ef44011e9 /src/encoding.cpp
parent2b3121eebf1ec6cbcb25422d6a254d2b4fc15d18 (diff)
rlc: Add and use mod_sns(bsn) method
Currently there is only a mod_sns() method which is being used in expression like bsn_expr & win.mod_sns(). This only works, because it is known that mod_sns() is (sns() - 1) where sns() in turn is always 2^n. This is error prone, hard to read, and relies on window specifics that should be kept inside the respective module. This commit adds a mod_sns(uint bsn) method to gprs_rlc_ul_window and gprs_rlc_dl_window, that encapsulates and hides this optimized computation. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/encoding.cpp')
-rw-r--r--src/encoding.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/encoding.cpp b/src/encoding.cpp
index d05177fb..6d66a725 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -441,7 +441,7 @@ static void write_packet_uplink_ack_egprs(struct gprs_rlcmac_bts *bts,
int bow = 1;
int eow = 1;
- int ssn = (tbf->m_window.v_q() + 1) & tbf->m_window.mod_sns();
+ int ssn = tbf->m_window.mod_sns(tbf->m_window.v_q() + 1);
tbf->m_window.update_rbb(rbb);