diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-05-13 13:33:12 +0200 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-05-20 11:36:12 +0200 |
commit | e43460b50fc152026ab96b5095b94fbac6939ab2 (patch) | |
tree | be82e5062fa68f19a4bd660394a77104728e5560 /src/tbf_dl.cpp | |
parent | 536708617505a017b6b263a32f592471913ec464 (diff) |
ms: Integrate the MS storage
Use the MS storage to find a MS object for a given TLLI instead of
searching the TBF lists. The TBFs are then taken from the MS object,
if one has been found. If all TBF might be temporarily detached from
the MS object, a GprsMs::Guard is added to prevent the deletion of
the object, in case another TBF gets attached later on in the scope.
Ticket: #1674
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf_dl.cpp')
-rw-r--r-- | src/tbf_dl.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index aec1535f..5cdac5f5 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -137,8 +137,11 @@ int gprs_rlcmac_dl_tbf::append_data(const uint8_t ms_class, static struct gprs_rlcmac_dl_tbf *tbf_lookup_dl(BTS *bts, const uint32_t tlli, const char *imsi) { - /* TODO: look up by IMSI first, then tlli, then old_tlli */ - return bts->dl_tbf_by_tlli(tlli); + GprsMs *ms = bts->ms_store().get_ms(tlli, 0, imsi); + if (!ms) + return NULL; + + return ms->dl_tbf(); } static int tbf_new_dl_assignment(struct gprs_rlcmac_bts *bts, @@ -148,15 +151,19 @@ static int tbf_new_dl_assignment(struct gprs_rlcmac_bts *bts, { uint8_t trx, ta, ss; int8_t use_trx; - struct gprs_rlcmac_ul_tbf *ul_tbf, *old_ul_tbf; + struct gprs_rlcmac_ul_tbf *ul_tbf = NULL, *old_ul_tbf; struct gprs_rlcmac_dl_tbf *dl_tbf = NULL; int8_t tfi; /* must be signed */ int rc; + GprsMs *ms; /* check for uplink data, so we copy our informations */ #warning "Do the same look up for IMSI, TLLI and OLD_TLLI" #warning "Refactor the below lines... into a new method" - ul_tbf = bts->bts->ul_tbf_by_tlli(tlli); + ms = bts->bts->ms_store().get_ms(tlli, 0, imsi); + if (ms) + ul_tbf = ms->ul_tbf(); + if (ul_tbf && ul_tbf->m_contention_resolution_done && !ul_tbf->m_final_ack_sent) { use_trx = ul_tbf->trx->trx_no; |