aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf_dl.cpp
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-12-20 17:31:13 +0100
committerMax <msuraev@sysmocom.de>2017-12-20 17:49:25 +0100
commitee5be3a0095b4bae430032d35e3ad0716eff34ab (patch)
tree43d74ede1ad950f6d73cd251f8677b4c73d3f60d /src/tbf_dl.cpp
parentc21f007277713b15d9a48d0bcc6f28aa51b4f908 (diff)
TBF: implement independent T31xx timers
Previously TBF got single timer so the pending timer was automatically cancelled when new one was scheduled. Let's make it more robust by implementing independent T31 xx timers from 3GPP TS 44.060 ยง13.2 with corresponding start/stop functions and counters. The semantics of the timers is preserved as before: pending timers are restarted unconditionally. It might be neecessary to change this later on after spec review. N. B. T0: used for assign/reject timeouts, have to be properly attributed and documented first. Change-Id: I0305873ca47534f53441247217881da59625e1f7 Related: OS#2407
Diffstat (limited to 'src/tbf_dl.cpp')
-rw-r--r--src/tbf_dl.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 0bcb67b1..b0439892 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -216,9 +216,9 @@ int gprs_rlcmac_dl_tbf::handle(struct gprs_rlcmac_bts *bts,
}
/* Clean up the old MS object */
/* TODO: Put this into a separate function, use timer? */
- if (ms_old->ul_tbf() && ms_old->ul_tbf()->T == 0)
+ if (ms_old->ul_tbf() && !ms_old->ul_tbf()->timers_pending(T_MAX))
tbf_free(ms_old->ul_tbf());
- if (ms_old->dl_tbf() && ms_old->dl_tbf()->T == 0)
+ if (ms_old->dl_tbf() && !ms_old->dl_tbf()->timers_pending(T_MAX))
tbf_free(ms_old->dl_tbf());
ms->merge_old_ms(ms_old);
@@ -485,6 +485,7 @@ void gprs_rlcmac_dl_tbf::trigger_ass(struct gprs_rlcmac_tbf *old_tbf)
{
/* stop pending timer */
stop_timer("assignment (DL-TBF)");
+ stop_timers("assignment (DL-TBF)");
/* check for downlink tbf: */
if (old_tbf) {
@@ -651,7 +652,7 @@ bool gprs_rlcmac_dl_tbf::handle_ack_nack()
/* reset N3105 */
n3105 = 0;
- stop_t3191();
+ t_stop(T3191, "ACK/NACK received");
poll_state = GPRS_RLCMAC_POLL_NONE;
return ack_recovered;
@@ -854,7 +855,7 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
m_tx_counter = 0;
/* start timer whenever we send the final block */
if (is_final)
- tbf_timer_start(this, 3191, bts_data()->t3191, 0, "final block (DL-TBF)");
+ t_start(T3191, bts_data()->t3191, 0, "final block (DL-TBF)", true);
clear_poll_timeout_flag();
@@ -1116,9 +1117,8 @@ int gprs_rlcmac_dl_tbf::release()
set_state(GPRS_RLCMAC_WAIT_RELEASE);
/* start T3193 */
- tbf_timer_start(this, 3193,
- bts_data()->t3193_msec / 1000,
- (bts_data()->t3193_msec % 1000) * 1000, "release (DL-TBF)");
+ t_start(T3193, bts_data()->t3193_msec / 1000, (bts_data()->t3193_msec % 1000) * 1000,
+ "release (DL-TBF)", true);
/* reset rlc states */
m_tx_counter = 0;