aboutsummaryrefslogtreecommitdiffstats
path: root/src/encoding.cpp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-26 21:43:58 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-04 21:01:02 +0100
commit3cbf9e040c8a84886468fe70e99d8d578d379b0d (patch)
tree58a390504665960e42c401a42e8706ef1320314e /src/encoding.cpp
parent3c95776805e522007c9e06ac95cdf0557d9cce94 (diff)
rlc: Make the RLC types only operate on the BSN
The code has an internal optimization to only use window_size space. This means that the caller needed to know that only half of the size was used. Change the API to work on the BSN and do the mapping internally. The compiler should have plenty of opportunity to propagate the constant(s) but this has not been verified.
Diffstat (limited to 'src/encoding.cpp')
-rw-r--r--src/encoding.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/encoding.cpp b/src/encoding.cpp
index 13390b90..085e7c34 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -363,7 +363,7 @@ void Encoding::write_packet_uplink_ack(struct gprs_rlcmac_bts *bts,
uint8_t rbb = 0;
uint16_t i, bbn;
- uint16_t mod_sns_half = (tbf->sns() >> 1) - 1;
+ uint16_t mod_sns = (tbf->sns() - 1);
char bit;
LOGP(DRLCMACUL, LOGL_DEBUG, "Encoding Ack/Nack for %s "
@@ -383,8 +383,8 @@ void Encoding::write_packet_uplink_ack(struct gprs_rlcmac_bts *bts,
block->u.Packet_Uplink_Ack_Nack.u.PU_AckNack_GPRS_Struct.Ack_Nack_Description.FINAL_ACK_INDICATION = final; // FINAL ACK INDICATION
block->u.Packet_Uplink_Ack_Nack.u.PU_AckNack_GPRS_Struct.Ack_Nack_Description.STARTING_SEQUENCE_NUMBER = tbf->dir.ul.window.v_r(); // STARTING_SEQUENCE_NUMBER
// RECEIVE_BLOCK_BITMAP
- for (i = 0, bbn = (tbf->dir.ul.window.v_r() - 64) & mod_sns_half; i < 64;
- i++, bbn = (bbn + 1) & mod_sns_half) {
+ for (i = 0, bbn = (tbf->dir.ul.window.v_r() - 64) & mod_sns; i < 64;
+ i++, bbn = (bbn + 1) & mod_sns) {
bit = tbf->dir.ul.v_n.state(bbn);
show_v_n[i] = bit;
if (bit == 'R')