aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2016-01-14 13:40:01 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-08 00:45:35 +0100
commit419b03497555eec53bc5759f6838d6a464987b99 (patch)
treed0ac081971671149d81bd40029fa00986e27578d /src
parentb41262fa0bc7edb64e518839923933a3480d1d48 (diff)
tbf: Use bitvec based window methods for GPRS
Currently the old fixed 64 bit RBB based implementation is used for GPRS. Use the new bitvec based methods instead. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src')
-rw-r--r--src/bts.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index 1696145..d95dd86 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -892,6 +892,11 @@ void gprs_rlcmac_pdch::rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *ack_n
struct gprs_rlcmac_dl_tbf *tbf;
int rc;
struct pcu_l1_meas meas;
+ int num_blocks;
+ uint8_t bits_data[RLC_GPRS_WS/8];
+ bitvec bits;
+ int bsn_begin, bsn_end;
+ char show_bits[RLC_GPRS_WS + 1];
tfi = ack_nack->DOWNLINK_TFI;
tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no);
@@ -918,10 +923,24 @@ void gprs_rlcmac_pdch::rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *ack_n
LOGP(DRLCMAC, LOGL_DEBUG, "RX: [PCU <- BTS] %s Packet Downlink Ack/Nack\n", tbf_name(tbf));
tbf->poll_state = GPRS_RLCMAC_POLL_NONE;
+ bits.data = bits_data;
+ bits.data_len = sizeof(bits_data);
+ bits.cur_bit = 0;
+
+ num_blocks = Decoding::decode_gprs_acknack_bits(
+ &ack_nack->Ack_Nack_Description, &bits,
+ &bsn_begin, &bsn_end, &tbf->m_window);
+
+ LOGP(DRLCMAC, LOGL_DEBUG,
+ "Got GPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), "
+ "\"%s\"\n",
+ ack_nack->Ack_Nack_Description.STARTING_SEQUENCE_NUMBER,
+ bsn_begin, bsn_end, num_blocks,
+ (Decoding::extract_rbb(&bits, show_bits), show_bits));
+
rc = tbf->rcvd_dl_ack(
ack_nack->Ack_Nack_Description.FINAL_ACK_INDICATION,
- ack_nack->Ack_Nack_Description.STARTING_SEQUENCE_NUMBER,
- ack_nack->Ack_Nack_Description.RECEIVED_BLOCK_BITMAP);
+ bsn_begin, &bits);
if (rc == 1) {
tbf_free(tbf);
return;