diff options
author | Max <msuraev@sysmocom.de> | 2017-12-14 15:02:33 +0100 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2018-01-12 15:29:42 +0100 |
commit | 9d7357e4fe67ad4a2f00d173ab769f56afb23980 (patch) | |
tree | 4a7687e22b5c2060dda0fb8f5cfaf464f5c50c5c /src/tbf_dl.cpp | |
parent | d0532b53ebcafc1e71ac6478b03ee9ebe4ac386d (diff) |
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
Diffstat (limited to 'src/tbf_dl.cpp')
-rw-r--r-- | src/tbf_dl.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 45c9a8f4..6b8eda79 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -1366,23 +1366,11 @@ enum egprs_rlcmac_dl_spb gprs_rlcmac_dl_tbf::get_egprs_dl_spb(const int bsn) return EGPRS_RLCMAC_DL_NO_RETX; } -void gprs_rlcmac_dl_tbf::egprs_calc_window_size() +void gprs_rlcmac_dl_tbf::set_window_size() { - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); - unsigned int num_pdch = pcu_bitcount(dl_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\n", - name(), ws); - + uint16_t ws = egprs_window_size(bts->bts_data(), dl_slots()); + LOGP(DRLCMAC, LOGL_INFO, "%s: setting EGPRS DL window size to %u, base(%u) slots(%u) ws_pdch(%u)\n", + name(), ws, bts->bts_data()->ws_base, pcu_bitcount(dl_slots()), bts->bts_data()->ws_pdch); m_window.set_ws(ws); } |