aboutsummaryrefslogtreecommitdiffstats
path: root/src/bts.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-29 13:45:05 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-07-03 13:17:22 +0200
commitccc34e4d30b962a2963c004d003d3851801ffb3b (patch)
tree63ab4167148ae54cc8858e5cc6a5821e569e9a57 /src/bts.cpp
parentc6d4ceeda6e6b96cc5bbc07fb9489587ed181f60 (diff)
tbf: Maintain the number of TBF per PDCH
Currently the PDCH object do not know anything about the TBFs using them. To make the slot allocation load dependant, at least some numbers are required. This commit adds TBF counters (one per direction) and the related methods attach_tbf, detach_tbf, and num_tbfs to gprs_rlcmac_pdch. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/bts.cpp')
-rw-r--r--src/bts.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index bc5ac945..6da8cdd8 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -1131,3 +1131,19 @@ gprs_rlcmac_dl_tbf *gprs_rlcmac_pdch::dl_tbf_by_tfi(uint8_t tfi)
{
return static_cast<gprs_rlcmac_dl_tbf *>(tbf_from_list_by_tfi(&bts_data()->dl_tbfs, tfi, GPRS_RLCMAC_DL_TBF));
}
+
+void gprs_rlcmac_pdch::attach_tbf(gprs_rlcmac_tbf *tbf)
+{
+ m_num_tbfs[tbf->direction] += 1;
+ LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Attaching %s, %d TBFs.\n",
+ ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction]);
+}
+
+void gprs_rlcmac_pdch::detach_tbf(gprs_rlcmac_tbf *tbf)
+{
+ OSMO_ASSERT(m_num_tbfs[tbf->direction] > 0);
+
+ m_num_tbfs[tbf->direction] -= 1;
+ LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Detaching %s, %d TBFs.\n",
+ ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction]);
+}