From ccc34e4d30b962a2963c004d003d3851801ffb3b Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Mon, 29 Jun 2015 13:45:05 +0200 Subject: 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 --- src/bts.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/bts.cpp') 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(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]); +} -- cgit v1.2.3