diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-06-29 13:45:05 +0200 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-07-03 13:17:22 +0200 |
commit | ccc34e4d30b962a2963c004d003d3851801ffb3b (patch) | |
tree | 63ab4167148ae54cc8858e5cc6a5821e569e9a57 /src/gprs_rlcmac_ts_alloc.cpp | |
parent | c6d4ceeda6e6b96cc5bbc07fb9489587ed181f60 (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/gprs_rlcmac_ts_alloc.cpp')
-rw-r--r-- | src/gprs_rlcmac_ts_alloc.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index bae1ea5f..29749b8e 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -117,13 +117,23 @@ static int find_enabled_pdch(struct gprs_rlcmac_trx *trx, const uint8_t start_ts return 8; } +static void attach_tbf_to_pdch(struct gprs_rlcmac_pdch *pdch, + struct gprs_rlcmac_tbf *tbf) +{ + if (tbf->pdch[pdch->ts_no]) + tbf->pdch[pdch->ts_no]->detach_tbf(tbf); + + tbf->pdch[pdch->ts_no] = pdch; + pdch->attach_tbf(tbf); +} + static void assign_uplink_tbf_usf( struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_ul_tbf *tbf, int8_t usf) { tbf->trx->ul_tbf[tbf->tfi()] = tbf; - tbf->pdch[pdch->ts_no] = pdch; tbf->m_usf[pdch->ts_no] = usf; + attach_tbf_to_pdch(pdch, tbf); } static void assign_dlink_tbf( @@ -131,7 +141,7 @@ static void assign_dlink_tbf( struct gprs_rlcmac_dl_tbf *tbf) { tbf->trx->dl_tbf[tbf->tfi()] = tbf; - tbf->pdch[pdch->ts_no] = pdch; + attach_tbf_to_pdch(pdch, tbf); } |