aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-02 16:00:41 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-08 09:39:25 +0200
commita700dd9e11d31805cfe8dd07fc27ac96425cbf0c (patch)
tree7a7d6922c8cb5f1dbd3bfe95dcdb72e766bacddf /src/tbf.cpp
parent17214bb06de4a1d8b626dab0f695017b0c74b358 (diff)
tbf: Move the current CS field to GprsMs
Currently the current CS value is stored in the cs field of gprs_rlcmac_tbf and initialised when it is used the first time. This commit adds separate fields for UL and DL CS values to the GprsMs class and provides corresponding getter methods for GprsMs and gprs_rlcmac_tbf. Ticket: #1739 Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r--src/tbf.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp
index e058348f..f3c5e69e 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -115,6 +115,17 @@ void gprs_rlcmac_tbf::set_ms_class(uint8_t ms_class_)
m_ms_class = ms_class_;
}
+uint8_t gprs_rlcmac_tbf::current_cs() const
+{
+ uint8_t cs;
+ if (direction == GPRS_RLCMAC_UL_TBF)
+ cs = m_ms ? m_ms->current_cs_ul() : bts->bts_data()->initial_cs_ul;
+ else
+ cs = m_ms ? m_ms->current_cs_dl() : bts->bts_data()->initial_cs_dl;
+
+ return cs < 1 ? 1 : cs;
+}
+
gprs_llc_queue *gprs_rlcmac_tbf::llc_queue()
{
return m_ms ? m_ms->llc_queue() : NULL;
@@ -945,5 +956,6 @@ void tbf_print_vty_info(struct vty *vty, struct llist_head *ltbf)
if (tbf->pdch[i])
vty_out(vty, "%d ", i);
}
- vty_out(vty, " CS=%d%s%s", tbf->cs, VTY_NEWLINE, VTY_NEWLINE);
+ vty_out(vty, " CS=%d%s%s", tbf->ms() ? tbf->ms()->current_cs_dl() : 1,
+ VTY_NEWLINE, VTY_NEWLINE);
}