diff options
author | sivasankari <Sivasankari.Theerthagiri@radisys.com> | 2017-01-16 15:41:21 +0530 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-01-23 12:26:09 +0000 |
commit | 8adfcd06a1db8033467d30b21ad7f6f35d6bf919 (patch) | |
tree | 8682b76a777bb0924f7f70606c3dfbca61460cf7 /src/tbf_ul.cpp | |
parent | 127a1e07504e555a53072d34e65ca7838c905edb (diff) |
Add compression support in EGPRS PUAN
This adds compression of bitmap in PUAN. The compressed bitmap
is used only if the number of bits in the bitmap does not fit in
the message and there is a gain after compression.
The algorithm is part of libosmocore and so there is dependency
on the libosmocore for compilation.
The algorithm is tested on integration setup by forcing compression.
Change-Id: Id2eec4b5eb6da0ebd24054b541b09b700b9b40ba
Diffstat (limited to 'src/tbf_ul.cpp')
-rw-r--r-- | src/tbf_ul.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 0de0127b..25981741 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -29,6 +29,8 @@ #include <decoding.h> #include <pcu_l1_if.h> +#include "pcu_utils.h" + extern "C" { #include <osmocom/core/msgb.h> #include <osmocom/core/talloc.h> @@ -587,3 +589,22 @@ void gprs_rlcmac_ul_tbf::update_coding_scheme_counter_ul(const GprsCodingScheme } } } + +void gprs_rlcmac_ul_tbf::egprs_calc_ulwindow_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); + + m_window.set_ws(ws); +} |