aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r--src/tbf.cpp9
1 files changed, 7 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;
+}