diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-24 17:13:10 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-26 20:57:24 +0100 |
commit | e358ff8fa4865be81cd0fbf46ddd6baee3856e9b (patch) | |
tree | 2bbe02ec2668d41a850131bd9d818c74748fc9ae /src/tbf.cpp | |
parent | df6b4f52e05e699b9a96a920973bff6241b5a853 (diff) |
tbf/rlc: Move the moving of V(A) into the V_B code
Move the code that moves the V_B to the first not acked frame. Return
how many indexes the V_B was moved and update the V_A in the caller.
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r-- | src/tbf.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp index c83ca966..0d6d19b1 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1405,14 +1405,8 @@ int gprs_rlcmac_tbf::snd_dl_ack(uint8_t final, uint8_t ssn, uint8_t *rbb) gprs_rlcmac_received_lost(this, received, lost); /* raise V(A), if possible */ - for (i = 0, bsn = dir.dl.v_a; bsn != dir.dl.v_s; - i++, bsn = (bsn + 1) & mod_sns) { - if (dir.dl.v_b.is_acked(bsn & mod_sns_half)) { - dir.dl.v_b.mark_invalid(bsn & mod_sns_half); - dir.dl.v_a = (dir.dl.v_a + 1) & mod_sns; - } else - break; - } + dir.dl.v_a += dir.dl.v_b.move_window(dir.dl.v_a, dir.dl.v_s, + mod_sns, mod_sns_half) & mod_sns; /* show receive state array in debug (V(A)..V(S)-1) */ for (i = 0, bsn = dir.dl.v_a; bsn != dir.dl.v_s; |