aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2016-01-22 18:12:10 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-02 17:06:38 +0100
commit2525b5ff7252d211df64c41c76395de7713ec09e (patch)
treeb6ccd7a49bff535c82e3ee25b6fd015d0c8cc332
parentf2594e07ebba2c5c4f67bfbee27885c06532e06c (diff)
tbf: Add gprs_rlcmac_tbf::first_control_ts method
Currently the tbf->first_ts field is accessed directly to get the first allocated TS when an immediate assigment is generated. While this is in principle correct (since in that state no other TBF exists), a more generic function that always returns the current (first) PACCH TS would hide the details. Add a function to return the current first PACCH timeslot. Note that concurrent TBF are not supported yet, which will not lead to errors yet, since it is only being used after RACH. Sponsored-by: On-Waves ehf
-rw-r--r--src/bts.cpp4
-rw-r--r--src/tbf.cpp5
-rw-r--r--src/tbf.h1
3 files changed, 8 insertions, 2 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index 2e6a4137..27dff294 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -527,7 +527,7 @@ int BTS::rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta)
LOGP(DRLCMAC, LOGL_INFO, "%s TX: START Immediate "
"Assignment Uplink (AGCH)\n", tbf_name(tbf));
trx_no = tbf->trx->trx_no;
- ts_no = tbf->control_ts;
+ ts_no = tbf->first_control_ts();
tfi = tbf->tfi();
usf = tbf->m_usf[ts_no];
tsc = tbf->tsc();
@@ -587,7 +587,7 @@ void BTS::trigger_dl_ass(
void BTS::snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi)
{
int plen;
- unsigned int ts = tbf->control_ts;
+ unsigned int ts = tbf->first_control_ts();
LOGP(DRLCMAC, LOGL_INFO, "TX: START %s Immediate Assignment Downlink (PCH)\n", tbf_name(tbf));
bitvec *immediate_assignment = bitvec_alloc(22); /* without plen */
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 2e8389cb..acccdb89 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -1178,3 +1178,8 @@ bool gprs_rlcmac_tbf::is_control_ts(uint8_t ts) const
{
return ts == control_ts;
}
+
+uint8_t gprs_rlcmac_tbf::first_control_ts() const
+{
+ return first_ts;
+}
diff --git a/src/tbf.h b/src/tbf.h
index d23cf933..8fce0cb9 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -145,6 +145,7 @@ struct gprs_rlcmac_tbf {
uint8_t ul_slots() const;
bool is_control_ts(uint8_t ts) const;
+ uint8_t first_control_ts() const;
/* EGPRS */
bool is_egprs_enabled() const;