aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2019-03-13 18:40:19 +0100
committerMax <msuraev@sysmocom.de>2019-03-27 12:32:04 +0000
commitfb59a93425034cc560bc1cbcd938abd96bbb0848 (patch)
treeb1cb5573b61322f4b1d50be45bad493a64fd4834
parente742cc0997d303180240febea5c44a7013063eb6 (diff)
TBF: update MCS counters
* use enum CodingScheme directly instead of converting it to class and back * drop useless mode check * log errorneous update attempt Change-Id: I763136c2f356d63aa3d28d09c57fd5faf5336258
-rw-r--r--src/tbf.h4
-rw-r--r--src/tbf_dl.cpp119
-rw-r--r--src/tbf_ul.cpp119
3 files changed, 116 insertions, 126 deletions
diff --git a/src/tbf.h b/src/tbf.h
index dc0b050..0a58862 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -648,7 +648,7 @@ struct gprs_rlcmac_dl_tbf : public gprs_rlcmac_tbf {
int abort();
uint16_t window_size() const;
void set_window_size();
- void update_coding_scheme_counter_dl(const GprsCodingScheme cs);
+ void update_coding_scheme_counter_dl(enum CodingScheme cs);
/* TODO: add the gettimeofday as parameter */
struct msgb *llc_dequeue(bssgp_bvc_ctx *bctx);
@@ -751,7 +751,7 @@ struct gprs_rlcmac_ul_tbf : public gprs_rlcmac_tbf {
uint16_t window_size() const;
void set_window_size();
- void update_coding_scheme_counter_ul(const GprsCodingScheme cs);
+ void update_coding_scheme_counter_ul(enum CodingScheme cs);
/* Please note that all variables here will be reset when changing
* from WAIT RELEASE back to FLOW state (re-use of TBF).
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 13ef143..04c6499 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -1364,68 +1364,63 @@ void gprs_rlcmac_dl_tbf::set_window_size()
m_window.set_ws(ws);
}
-void gprs_rlcmac_dl_tbf::update_coding_scheme_counter_dl(const GprsCodingScheme cs)
+void gprs_rlcmac_dl_tbf::update_coding_scheme_counter_dl(enum CodingScheme cs)
{
- uint8_t coding_scheme = 0;
-
- coding_scheme = CodingScheme(cs);
- if (mcs_is_gprs(cs)) {
- switch (coding_scheme) {
- case CS1 :
- bts->gprs_dl_cs1();
- rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS1]);
- break;
- case CS2 :
- bts->gprs_dl_cs2();
- rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS2]);
- break;
- case CS3 :
- bts->gprs_dl_cs3();
- rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS3]);
- break;
- case CS4 :
- bts->gprs_dl_cs4();
- rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS4]);
- break;
- }
- } else {
- switch (coding_scheme) {
- case MCS1 :
- bts->egprs_dl_mcs1();
- rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS1]);
- break;
- case MCS2 :
- bts->egprs_dl_mcs2();
- rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS2]);
- break;
- case MCS3 :
- bts->egprs_dl_mcs3();
- rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS3]);
- break;
- case MCS4 :
- bts->egprs_dl_mcs4();
- rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS4]);
- break;
- case MCS5 :
- bts->egprs_dl_mcs5();
- rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS5]);
- break;
- case MCS6 :
- bts->egprs_dl_mcs6();
- rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS6]);
- break;
- case MCS7 :
- bts->egprs_dl_mcs7();
- rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS7]);
- break;
- case MCS8 :
- bts->egprs_dl_mcs8();
- rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS8]);
- break;
- case MCS9 :
- bts->egprs_dl_mcs9();
- rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS9]);
- break;
- }
+ switch (cs) {
+ case CS1:
+ bts->gprs_dl_cs1();
+ rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS1]);
+ break;
+ case CS2:
+ bts->gprs_dl_cs2();
+ rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS2]);
+ break;
+ case CS3:
+ bts->gprs_dl_cs3();
+ rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS3]);
+ break;
+ case CS4:
+ bts->gprs_dl_cs4();
+ rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS4]);
+ break;
+ case MCS1:
+ bts->egprs_dl_mcs1();
+ rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS1]);
+ break;
+ case MCS2:
+ bts->egprs_dl_mcs2();
+ rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS2]);
+ break;
+ case MCS3:
+ bts->egprs_dl_mcs3();
+ rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS3]);
+ break;
+ case MCS4:
+ bts->egprs_dl_mcs4();
+ rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS4]);
+ break;
+ case MCS5:
+ bts->egprs_dl_mcs5();
+ rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS5]);
+ break;
+ case MCS6:
+ bts->egprs_dl_mcs6();
+ rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS6]);
+ break;
+ case MCS7:
+ bts->egprs_dl_mcs7();
+ rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS7]);
+ break;
+ case MCS8:
+ bts->egprs_dl_mcs8();
+ rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS8]);
+ break;
+ case MCS9:
+ bts->egprs_dl_mcs9();
+ rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS9]);
+ break;
+ default:
+ LOGPTBFDL(this, LOGL_ERROR, "attempting to update rate counters for unsupported (M)CS %s\n",
+ mcs_name(cs));
}
}
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index f40ec3d..fd7d73b 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -525,69 +525,64 @@ egprs_rlc_ul_reseg_bsn_state gprs_rlcmac_ul_tbf::handle_egprs_ul_spb(
return assemble_status;
}
-void gprs_rlcmac_ul_tbf::update_coding_scheme_counter_ul(const GprsCodingScheme cs)
+void gprs_rlcmac_ul_tbf::update_coding_scheme_counter_ul(enum CodingScheme cs)
{
- uint8_t coding_scheme = 0;
-
- coding_scheme = CodingScheme(cs);
- if (mcs_is_gprs(cs)) {
- switch (coding_scheme) {
- case CS1 :
- bts->gprs_ul_cs1();
- rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS1]);
- break;
- case CS2 :
- bts->gprs_ul_cs2();
- rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS2]);
- break;
- case CS3 :
- bts->gprs_ul_cs3();
- rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS3]);
- break;
- case CS4 :
- bts->gprs_ul_cs4();
- rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS4]);
- break;
- }
- } else {
- switch (coding_scheme) {
- case MCS1 :
- bts->egprs_ul_mcs1();
- rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS1]);
- break;
- case MCS2 :
- bts->egprs_ul_mcs2();
- rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS2]);
- break;
- case MCS3 :
- bts->egprs_ul_mcs3();
- rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS3]);
- break;
- case MCS4 :
- bts->egprs_ul_mcs4();
- rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS4]);
- break;
- case MCS5 :
- bts->egprs_ul_mcs5();
- rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS5]);
- break;
- case MCS6 :
- bts->egprs_ul_mcs6();
- rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS6]);
- break;
- case MCS7 :
- bts->egprs_ul_mcs7();
- rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS7]);
- break;
- case MCS8 :
- bts->egprs_ul_mcs8();
- rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS8]);
- break;
- case MCS9 :
- bts->egprs_ul_mcs9();
- rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS9]);
- break;
- }
+ switch (cs) {
+ case CS1:
+ bts->gprs_ul_cs1();
+ rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS1]);
+ break;
+ case CS2:
+ bts->gprs_ul_cs2();
+ rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS2]);
+ break;
+ case CS3:
+ bts->gprs_ul_cs3();
+ rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS3]);
+ break;
+ case CS4:
+ bts->gprs_ul_cs4();
+ rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS4]);
+ break;
+ case MCS1:
+ bts->egprs_ul_mcs1();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS1]);
+ break;
+ case MCS2:
+ bts->egprs_ul_mcs2();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS2]);
+ break;
+ case MCS3:
+ bts->egprs_ul_mcs3();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS3]);
+ break;
+ case MCS4:
+ bts->egprs_ul_mcs4();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS4]);
+ break;
+ case MCS5:
+ bts->egprs_ul_mcs5();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS5]);
+ break;
+ case MCS6:
+ bts->egprs_ul_mcs6();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS6]);
+ break;
+ case MCS7:
+ bts->egprs_ul_mcs7();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS7]);
+ break;
+ case MCS8:
+ bts->egprs_ul_mcs8();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS8]);
+ break;
+ case MCS9:
+ bts->egprs_ul_mcs9();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS9]);
+ break;
+ default:
+ LOGPTBFUL(this, LOGL_ERROR, "attempting to update rate counters for unsupported (M)CS %s\n",
+ mcs_name(cs));
}
}