diff options
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; +} |