diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-24 00:18:47 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-26 20:57:19 +0100 |
commit | 15777795268ac0d0b53453afe80ce6d8e68f9a55 (patch) | |
tree | 84b531ae91e5aa45454a73478e19f36d21f8b7ae /src/rlc.cpp | |
parent | ef93bdb19b8ff93ef1ed6e858029df44da82982e (diff) |
rlc/tbf: Move the loop into the gprs_rlc_v_b class
Diffstat (limited to 'src/rlc.cpp')
-rw-r--r-- | src/rlc.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/rlc.cpp b/src/rlc.cpp index 1a2aa0fb..1a055468 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -37,3 +37,16 @@ void gprs_rlc_v_b::reset() for (size_t i = 0; i < ARRAY_SIZE(m_v_b); ++i) mark_invalid(i); } + +int gprs_rlc_v_b::resend_needed(const uint16_t v_a, const uint16_t v_s, + const uint16_t mod_sns, + const uint16_t mod_sns_half) +{ + for (uint8_t bsn = v_a; bsn != v_s; bsn = (bsn + 1) & mod_sns) { + uint16_t index = bsn & mod_sns_half; + if (is_nacked(index) || is_resend(index)) + return bsn; + } + + return -1; +} |