diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-24 00:38:54 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-26 20:57:24 +0100 |
commit | 8b16ae30fe0d6353ac7d39a2884f6716ff3efc5f (patch) | |
tree | 9c1b93a595f19b28e1a7111d7a4e9b82239ee56d /src/rlc.cpp | |
parent | c03e38291aa0fe9bf8168776c08f915bf9e66efe (diff) |
tbf/rlc: Move the marking of frames for resend into the v_b
Diffstat (limited to 'src/rlc.cpp')
-rw-r--r-- | src/rlc.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/rlc.cpp b/src/rlc.cpp index 1a055468..f6b13623 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -50,3 +50,21 @@ int gprs_rlc_v_b::resend_needed(const uint16_t v_a, const uint16_t v_s, return -1; } + +int gprs_rlc_v_b::mark_for_resend(const uint16_t v_a, const uint16_t v_s, + const uint16_t mod_sns, + const uint16_t mod_sns_half) +{ + int resend = 0; + + for (uint8_t bsn = v_a; bsn != v_s; bsn = (bsn + 1) & mod_sns) { + uint16_t index = (bsn & mod_sns_half); + if (is_unacked(index)) { + /* mark to be re-send */ + mark_resend(index); + resend += 1; + } + } + + return resend; +} |