aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2016-01-29 18:51:04 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-02 17:06:38 +0100
commita0dbfd89fa97739da795b4425c13d90432f408c9 (patch)
treee313c34cf4b11ee3c79e3cfa01ff3083b429dbff
parentb7232c9bf0ecee03e4843ecba78e24faa1e74e09 (diff)
tbf: Don't change type from CCCH to PACCH without ack
Currently the CCCH flag is cleared and the PACCH flag is set when a multislot upgrade is scheduled for a downlink TBF, even if the MS has never confirmed in any way that the PACCH really exists. This can happen if the MS did not receive the DL IMM.ASS. Since the CCCH flags gets cleared in that case, the IMM.ASSS is never retried and all subsequent PACKET DOWNLINK ASSIGNMENTS will fail. This commit delays the update of these flags until the MS has responded with a corresponding CONTROL ACK. Sponsored-by: On-Waves ehf
-rw-r--r--src/bts.cpp12
-rw-r--r--src/tbf.cpp1
2 files changed, 11 insertions, 2 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index 27dff294..c8dec025 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -569,7 +569,8 @@ void BTS::trigger_dl_ass(
/* change state */
dl_tbf->set_state(GPRS_RLCMAC_ASSIGN);
- dl_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH);
+ if (!(dl_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH)))
+ dl_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH);
/* start timer */
tbf_timer_start(dl_tbf, 0, Tassign_pacch);
} else {
@@ -799,6 +800,15 @@ void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet,
if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE))
tbf_free(tbf);
+ if ((new_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) {
+ /* We now know that the PACCH really existed */
+ LOGP(DRLCMAC, LOGL_INFO,
+ "The TBF has been confirmed on the PACCH, "
+ "changed type from CCCH to PACCH for %s\n",
+ tbf_name(new_tbf));
+ new_tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH);
+ new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH);
+ }
new_tbf->set_state(GPRS_RLCMAC_FLOW);
/* stop pending assignment timer */
new_tbf->stop_timer();
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 954a24b6..ff0af252 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -851,7 +851,6 @@ void gprs_rlcmac_tbf::handle_timeout()
/* keep to flags */
dl_tbf->state_flags &= GPRS_RLCMAC_FLAG_TO_MASK;
- dl_tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH);
dl_tbf->update();