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-11-26 21:43:58 +0100
commit73257c550c6ee4f6c8a435f42c33e5c1d8a19dfa (patch)
tree9bee603d74f0c440ba79bc26087396b082472be1 /src/encoding.cpp
parent0b0b95d6fe05b8f0cdc3079fa767b3e76f70574f (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..24b5730a 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')