aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.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/tbf.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/tbf.cpp')
-rw-r--r--src/tbf.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 9bdc1f78..ddc3b91f 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -209,14 +209,17 @@ static void tbf_unlink_pdch(struct gprs_rlcmac_tbf *tbf)
{
int ts;
- if (tbf->direction == GPRS_RLCMAC_UL_TBF) {
+ if (tbf->direction == GPRS_RLCMAC_UL_TBF)
tbf->trx->ul_tbf[tbf->tfi()] = NULL;
- for (ts = 0; ts < 8; ts++)
- tbf->pdch[ts] = NULL;
- } else {
+ else
tbf->trx->dl_tbf[tbf->tfi()] = NULL;
- for (ts = 0; ts < 8; ts++)
- tbf->pdch[ts] = NULL;
+
+ for (ts = 0; ts < 8; ts++) {
+ if (!tbf->pdch[ts])
+ continue;
+
+ tbf->pdch[ts]->detach_tbf(tbf);
+ tbf->pdch[ts] = NULL;
}
}