aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.cpp
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2014-05-30 20:21:30 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-06-04 17:17:45 +0200
commit17a1d5e1623ca7c09bc312fd402cdf0075b523be (patch)
tree20da98fbbb5ca7c9b2ed90cc3d12317077ccfe80 /src/tbf.cpp
parent1e0c61032fbccc6bd4b1fbd89765f125643e79c3 (diff)
gprs_rlcmac_pdch: Get rid of ul/dl_tbf
The current code keeps a reference to all tbfs in the bts and another reference in the pdch. This allows for the possibility of both lists to go out of sync. This patch removes the pdch-specific list of ul and dl tbfs and uses the lists in the bts to lookup tbfs everywhere. Performance for going through the global list is not an issue yet. We can optimize this later and in a better way. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r--src/tbf.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 3a2ad735..5943674e 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -250,25 +250,16 @@ struct gprs_rlcmac_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts,
static void tbf_unlink_pdch(struct gprs_rlcmac_tbf *tbf)
{
- struct gprs_rlcmac_pdch *pdch;
int ts;
if (tbf->direction == GPRS_RLCMAC_UL_TBF) {
tbf->trx->ul_tbf[tbf->tfi()] = NULL;
- for (ts = 0; ts < 8; ts++) {
- pdch = tbf->pdch[ts];
- if (pdch)
- pdch->ul_tbf[tbf->tfi()] = NULL;
+ for (ts = 0; ts < 8; ts++)
tbf->pdch[ts] = NULL;
- }
} else {
tbf->trx->dl_tbf[tbf->tfi()] = NULL;
- for (ts = 0; ts < 8; ts++) {
- pdch = tbf->pdch[ts];
- if (pdch)
- pdch->dl_tbf[tbf->tfi()] = NULL;
+ for (ts = 0; ts < 8; ts++)
tbf->pdch[ts] = NULL;
- }
}
}
@@ -1472,10 +1463,10 @@ void gprs_rlcmac_tbf::free_all(struct gprs_rlcmac_pdch *pdch)
for (uint8_t tfi = 0; tfi < 32; tfi++) {
struct gprs_rlcmac_tbf *tbf;
- tbf = pdch->ul_tbf[tfi];
+ tbf = pdch->ul_tbf_by_tfi(tfi);
if (tbf)
tbf_free(tbf);
- tbf = pdch->dl_tbf[tfi];
+ tbf = pdch->dl_tbf_by_tfi(tfi);
if (tbf)
tbf_free(tbf);
}