aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf_dl.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-22 17:48:04 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-28 13:58:23 +0200
commit9200ce60196a289968144582f1acfac25e17eed5 (patch)
tree34b047174ff64bf5365fcb96ac531d39adccfc17 /src/tbf_dl.cpp
parentddfc0d57632c5f57aeb123f6506d3923fcec69dc (diff)
tbf: Store the timing advance (TA) value in the GprsMs object
The TA value rather relates to an MS and not to a single TBF. So all TBFs share the same TA value. Currently the TA value is stored per TBF and eventually copied from an old TBF to a new one. It is in general only passed with an RACH request when the TLLI and thus the MS is not yet known. This commit adds a TA member to the GprsMs class and uses that one when the TBF is associated to an MS object. Since the TBF is not always associated with an MS object (after RACH or when it has been replaced by another TBF), the TA value is still stored in each TBF and that value is used as long as no MS object is being associated. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf_dl.cpp')
-rw-r--r--src/tbf_dl.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index edaf2987..2289e3f0 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -151,42 +151,30 @@ static int tbf_new_dl_assignment(struct gprs_rlcmac_bts *bts,
const uint8_t ms_class,
const uint8_t *data, const uint16_t len)
{
- uint8_t trx, ta, ss;
+ uint8_t trx, ss;
int8_t use_trx;
+ uint16_t ta = 0;
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"
ms = bts->bts->ms_store().get_ms(tlli, tlli_old, imsi);
- if (ms)
+ if (ms) {
ul_tbf = ms->ul_tbf();
+ ta = ms->ta();
+ }
if (ul_tbf && ul_tbf->m_contention_resolution_done
&& !ul_tbf->m_final_ack_sent) {
use_trx = ul_tbf->trx->trx_no;
- ta = ul_tbf->ta;
ss = 0;
old_ul_tbf = ul_tbf;
} else {
use_trx = -1;
- /* we already have an uplink TBF, so we use that TA */
- if (ul_tbf)
- ta = ul_tbf->ta;
- else {
- /* recall TA */
- rc = bts->bts->timing_advance()->recall(tlli);
- if (rc < 0) {
- LOGP(DRLCMAC, LOGL_NOTICE, "TA unknown"
- ", assuming 0\n");
- ta = 0;
- } else
- ta = rc;
- }
ss = 1; /* PCH assignment only allows one timeslot */
old_ul_tbf = NULL;
}
@@ -205,8 +193,8 @@ static int tbf_new_dl_assignment(struct gprs_rlcmac_bts *bts,
bts->bts->llc_dropped_frame();
return -EBUSY;
}
- dl_tbf->ta = ta;
dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF);
+ dl_tbf->ms()->set_ta(ta);
LOGP(DRLCMAC, LOGL_DEBUG, "%s [DOWNLINK] START\n", tbf_name(dl_tbf));
@@ -801,7 +789,6 @@ void gprs_rlcmac_dl_tbf::reuse_tbf(const uint8_t *data, const uint16_t len)
}
new_tbf->set_ms(ms());
- new_tbf->ta = ta;
/* Copy over all data to the new TBF */
new_tbf->m_llc.put_frame(data, len);