diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-06-19 10:59:58 +0200 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-06-29 11:43:17 +0200 |
commit | cb1b494c896243a92a1969bb4c0ee4baddad2423 (patch) | |
tree | b47823e288af93eb03e942a38aa65bcae1fe51bb /src/tbf.cpp | |
parent | 6d86628e5b6d81afae4ca1f24201ee90bfab1c2a (diff) |
tbf: Add BTS::ms_alloc method
Currently the code that creates the MS objects with tbf.cpp is
duplicated.
This commit moves the corresponding code into a new method. Since
there is no TLLI available there, the GprsMsStorage::create_ms method
has been refactored into two variants: one with TLLI/direction and
one without.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r-- | src/tbf.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp index faddb79b..9bdc1f78 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -499,11 +499,8 @@ struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, tbf->direction = GPRS_RLCMAC_UL_TBF; - if (!ms) { - ms = bts->bts->ms_store().create_ms(0, tbf->direction); - ms->set_timeout(bts->ms_idle_sec); - ms->set_ms_class(ms_class); - } + if (!ms) + ms = bts->bts->ms_alloc(ms_class); rc = setup_tbf(tbf, bts, ms, tfi, trx, ms_class, single_slot); /* if no resource */ @@ -539,11 +536,8 @@ struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, tbf->direction = GPRS_RLCMAC_DL_TBF; - if (!ms) { - ms = bts->bts->ms_store().create_ms(0, tbf->direction); - ms->set_timeout(bts->ms_idle_sec); - ms->set_ms_class(ms_class); - } + if (!ms) + ms = bts->bts->ms_alloc(ms_class); rc = setup_tbf(tbf, bts, ms, tfi, trx, ms_class, single_slot); /* if no resource */ |