From 9d7357e4fe67ad4a2f00d173ab769f56afb23980 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 14 Dec 2017 15:02:33 +0100 Subject: TBF: unify EGPRS window calculation Move actual calculation into shared function and use it to set window size for TBF. TBT test output requires cosmetic adjuestements due to extended debug output. Change-Id: Ib9f4a277082da3c71007f5f3b4f2acac8b994540 Related: OS#1759 --- src/tbf_ul.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/tbf_ul.cpp') diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 6442b8f9..83ac08f4 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -606,21 +606,10 @@ void gprs_rlcmac_ul_tbf::update_coding_scheme_counter_ul(const GprsCodingScheme } } -void gprs_rlcmac_ul_tbf::egprs_calc_ulwindow_size() +void gprs_rlcmac_ul_tbf::set_window_size() { - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); - unsigned int num_pdch = pcu_bitcount(ul_slots()); - unsigned int ws = bts_data->ws_base + num_pdch * bts_data->ws_pdch; - ws = (ws / 32) * 32; - ws = OSMO_MAX(64, ws); - - if (num_pdch == 1) - ws = OSMO_MIN(192, ws); - else - ws = OSMO_MIN(128 * num_pdch, ws); - - LOGP(DRLCMAC, LOGL_INFO, "%s: Setting EGPRS window size to %d, base(%d) slots(%d) ws_pdch(%d)\n", - name(), ws, bts_data->ws_base, num_pdch, bts_data->ws_pdch); - + uint16_t ws = egprs_window_size(bts->bts_data(), ul_slots()); + LOGP(DRLCMAC, LOGL_INFO, "%s: setting EGPRS UL window size to %u, base(%u) slots(%u) ws_pdch(%u)\n", + name(), ws, bts->bts_data()->ws_base, pcu_bitcount(ul_slots()), bts->bts_data()->ws_pdch); m_window.set_ws(ws); } -- cgit v1.2.3