aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-09-01 11:20:29 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-09-01 11:49:04 +0200
commit91ff7d1864f0248ab5f45047069c09d7843212ca (patch)
tree48ace6cb13ba8df31b63a0c50f134bb985fc7a5c /src/tbf.cpp
parent9659d593073dfb6711f2ed9ad7bee4ca454db784 (diff)
tbf: Refactor reuse_tbf into releasing and DL TBF establishment
Currently reuse_tbf (partly) resets the old DL TBF and uses its PACCH to establish a new DL TBF. The method can not be used with UL TBFs. This commit replaces the reuse_tbf method into a gprs_rlcmac_dl_tbf:release method which triggers the TBF's timer based deletion (so that the TFI is still reserved for some time) and a gprs_rlcmac_tbf::establish_dl_tbf_on_pacch which can establish DL TBFs on existing PACCHs of either DL or UL TBFs. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r--src/tbf.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 42d522bd..b604c683 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -960,6 +960,27 @@ void gprs_rlcmac_tbf::free_all(struct gprs_rlcmac_pdch *pdch)
}
}
+int gprs_rlcmac_tbf::establish_dl_tbf_on_pacch()
+{
+ struct gprs_rlcmac_dl_tbf *new_tbf = NULL;
+
+ bts->tbf_reused();
+
+ new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(),
+ this->trx->trx_no, ms_class(), 0);
+
+ if (!new_tbf) {
+ LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n");
+ return -1;
+ }
+
+ LOGP(DRLCMAC, LOGL_DEBUG, "%s Trigger downlink assignment on PACCH\n",
+ tbf_name(this));
+ bts->trigger_dl_ass(new_tbf, this);
+
+ return 0;
+}
+
int gprs_rlcmac_tbf::extract_tlli(const uint8_t *data, const size_t len)
{
struct gprs_rlcmac_tbf *dl_tbf = NULL;