aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.cpp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-24 17:34:17 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-26 20:57:24 +0100
commit9c5539d46da3e43eeb875e1849553214263ee618 (patch)
tree1fd59d3c6c7bdc6527e17f42992f127f42b44907 /src/tbf.cpp
parent86dc355a3328ad2305d8bd0b1fb6684509352289 (diff)
tbf/rlc: Move the counting of unacked frames into the RLC V_B class
Whenwe receive a final ack we assume that all the unacked frames have been acked now. Move the counting to V_B and now the caller can remove the BSN and the "lost" variable which has always been zero.
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r--src/tbf.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 4fefab63..c975cee2 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -1422,20 +1422,16 @@ int gprs_rlcmac_tbf::maybe_start_new_window()
{
const uint16_t mod_sns = m_sns - 1;
const uint16_t mod_sns_half = (m_sns >> 1) - 1;
- uint16_t bsn;
struct msgb *msg;
- uint16_t lost = 0, received = 0;
+ uint16_t received;
LOGP(DRLCMACDL, LOGL_DEBUG, "- Final ACK received.\n");
/* range V(A)..V(S)-1 */
- for (bsn = dir.dl.v_a; bsn != dir.dl.v_s;
- bsn = (bsn + 1) & mod_sns) {
- if (!dir.dl.v_b.is_acked(bsn & mod_sns_half))
- received++;
- }
+ received = dir.dl.v_b.count_unacked(dir.dl.v_a, dir.dl.v_s,
+ mod_sns, mod_sns_half);
/* report all outstanding packets as received */
- gprs_rlcmac_received_lost(this, received, lost);
+ gprs_rlcmac_received_lost(this, received, 0);
/* check for LLC PDU in the LLC Queue */
msg = llc_dequeue(gprs_bssgp_pcu_current_bctx());