diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-25 23:26:06 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-26 21:00:51 +0100 |
commit | cbb00ebd04c11aade8503e407ab97ee8b632e99f (patch) | |
tree | 0ed727d825e1ac410910575746fe8f787fcc928c /src/rlc.cpp | |
parent | 423dd2286befbaa29f63c65e739bbe894daa65e1 (diff) |
rlc/tbf: Move the code to raise V(R) into the ul_window handling
Diffstat (limited to 'src/rlc.cpp')
-rw-r--r-- | src/rlc.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/rlc.cpp b/src/rlc.cpp index 838554ae..ecc7b9a5 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -149,3 +149,19 @@ void gprs_rlc_v_n::reset() { memset(m_v_n, 0x0, sizeof(m_v_n)); } + +/* Raise V(R) to highest received sequence number not received. */ +void gprs_rlc_ul_window::raise(const uint16_t bsn, gprs_rlc_v_n *v_n) +{ + uint16_t offset_v_r; + offset_v_r = (bsn + 1 - v_r()) & mod_sns(); + /* Positive offset, so raise. */ + if (offset_v_r < (sns() >> 1)) { + while (offset_v_r--) { + if (offset_v_r) /* all except the received block */ + v_n->mark_missing(v_r() & mod_sns_half()); + raise(1); + } + LOGP(DRLCMACUL, LOGL_DEBUG, "- Raising V(R) to %d\n", v_r()); + } +} |