aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlc.cpp
diff options
context:
space:
mode:
authorsivasankari <Sivasankari.Theerthagiri@radisys.com>2017-01-16 15:41:21 +0530
committerHarald Welte <laforge@gnumonks.org>2017-01-23 12:26:09 +0000
commit8adfcd06a1db8033467d30b21ad7f6f35d6bf919 (patch)
tree8682b76a777bb0924f7f70606c3dfbca61460cf7 /src/rlc.cpp
parent127a1e07504e555a53072d34e65ca7838c905edb (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/rlc.cpp')
-rw-r--r--src/rlc.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/rlc.cpp b/src/rlc.cpp
index 2bffccb8..d13045e8 100644
--- a/src/rlc.cpp
+++ b/src/rlc.cpp
@@ -83,6 +83,32 @@ int gprs_rlc_dl_window::mark_for_resend()
return resend;
}
+/* Update the receive block bitmap */
+uint16_t gprs_rlc_ul_window::update_egprs_rbb(uint8_t *rbb)
+{
+ int i;
+ uint16_t bsn;
+ uint16_t bitmask = 0x80;
+ int8_t pos = 0;
+ int8_t bit_pos = 0;
+ for (i = 0, bsn = (v_q()+1); ((bsn < (v_r())) && (i < ws())); i++,
+ bsn = this->mod_sns(bsn + 1)) {
+ if (m_v_n.is_received(bsn)) {
+ rbb[pos] = rbb[pos] | bitmask;
+ } else {
+ rbb[pos] = rbb[pos] & (~bitmask);
+ }
+ bitmask = bitmask >> 1;
+ bit_pos++;
+ bit_pos = bit_pos % 8;
+ if (bit_pos == 0) {
+ pos++;
+ bitmask = 0x80;
+ }
+ }
+ return i;
+}
+
int gprs_rlc_dl_window::count_unacked()
{
uint16_t unacked = 0;
@@ -219,6 +245,8 @@ void gprs_rlc_window::set_sns(uint16_t sns)
void gprs_rlc_window::set_ws(uint16_t ws)
{
+ LOGP(DRLCMAC, LOGL_INFO, "ws(%d)\n",
+ ws);
OSMO_ASSERT(ws >= RLC_GPRS_SNS/2);
OSMO_ASSERT(ws <= RLC_MAX_SNS/2);
m_ws = ws;