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/tbf.cpp | |
parent | c03e38291aa0fe9bf8168776c08f915bf9e66efe (diff) |
tbf/rlc: Move the marking of frames for resend into the v_b
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r-- | src/tbf.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp index a279fcc2..3dc4146f 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -907,8 +907,6 @@ do_resend: /* if the window has stalled, or transfer is complete, * send an unacknowledged block */ if (state_is(GPRS_RLCMAC_FINISHED) || dl_window_stalled()) { - int resend = 0; - if (state_is(GPRS_RLCMAC_FINISHED)) { LOGP(DRLCMACDL, LOGL_DEBUG, "- Restarting at BSN %d, " "because all blocks have been transmitted.\n", @@ -936,16 +934,10 @@ do_resend: } /* cycle through all unacked blocks */ - for (bsn = dir.dl.v_a; bsn != dir.dl.v_s; - bsn = (bsn + 1) & mod_sns) { - index = (bsn & mod_sns_half); - if (dir.dl.v_b.is_unacked(index)) { - /* mark to be re-send */ - dir.dl.v_b.mark_resend(index); - resend++; - } - } - /* At this point there should be at leasst one unacked block + int resend = dir.dl.v_b.mark_for_resend(dir.dl.v_a, dir.dl.v_s, + mod_sns, mod_sns_half); + + /* At this point there should be at least one unacked block * to be resent. If not, this is an software error. */ if (resend == 0) { LOGP(DRLCMACDL, LOGL_ERROR, "Software error: " |