diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-24 00:21:32 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-26 20:57:24 +0100 |
commit | c03e38291aa0fe9bf8168776c08f915bf9e66efe (patch) | |
tree | 54ce0338f4ea8036957af38b2e7ede8cac9049f1 /src | |
parent | 15777795268ac0d0b53453afe80ce6d8e68f9a55 (diff) |
tbf: Move the check if the window is stalled to a separate method
Diffstat (limited to 'src')
-rw-r--r-- | src/tbf.cpp | 9 | ||||
-rw-r--r-- | src/tbf.h | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp index 747678c6..a279fcc2 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -906,8 +906,7 @@ do_resend: /* if the window has stalled, or transfer is complete, * send an unacknowledged block */ - if (state_is(GPRS_RLCMAC_FINISHED) - || ((dir.dl.v_s - dir.dl.v_a) & mod_sns) == m_ws) { + if (state_is(GPRS_RLCMAC_FINISHED) || dl_window_stalled()) { int resend = 0; if (state_is(GPRS_RLCMAC_FINISHED)) { @@ -1859,3 +1858,9 @@ void gprs_rlcmac_tbf::reuse_tbf(const uint8_t *data, const uint16_t len) tbf_name(this)); bts->trigger_dl_ass(this, this, NULL); } + +bool gprs_rlcmac_tbf::dl_window_stalled() const +{ + const uint16_t mod_sns = m_sns - 1; + return ((dir.dl.v_s - dir.dl.v_a) & mod_sns) == m_ws; +} @@ -241,6 +241,7 @@ struct gprs_rlcmac_tbf { protected: void reuse_tbf(const uint8_t *data, const uint16_t len); gprs_rlcmac_bts *bts_data() const; + bool dl_window_stalled() const; int append_data(const uint8_t ms_class, const uint16_t pdu_delay_csec, |