aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-07-21 19:21:48 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2023-07-24 13:52:51 +0200
commit459383d531bd0c6edf6fcda806333cb0669a4fb0 (patch)
tree946603717f28daee1af76c08c1b03107ba498c55
parent3ae18f65a80bd4e1238538386399e47a2da0d5d3 (diff)
rlcmac: Apply tx_cs requested by the network through PKT UL ACK/NACK
Recalculating CV when in Countdown Procedure will be implemented in a follow-up commit. Related: OS#6108 Change-Id: I1e7b28c2e5f1d77a962ec3070f3a027b8f66a69e
-rw-r--r--src/rlcmac/tbf_ul.c14
-rw-r--r--tests/rlcmac/rlcmac_prim_test.c2
2 files changed, 15 insertions, 1 deletions
diff --git a/src/rlcmac/tbf_ul.c b/src/rlcmac/tbf_ul.c
index 6957658..0fa98ae 100644
--- a/src/rlcmac/tbf_ul.c
+++ b/src/rlcmac/tbf_ul.c
@@ -234,6 +234,18 @@ static int gprs_rlcmac_ul_tbf_update_window(struct gprs_rlcmac_ul_tbf *ul_tbf,
return 0;
}
+static void gprs_rlcmac_ul_tbf_update_tx_cs(struct gprs_rlcmac_ul_tbf *ul_tbf, enum gprs_rlcmac_coding_scheme tx_cs)
+{
+ if (ul_tbf->tx_cs == tx_cs)
+ return;
+
+ LOGPTBFUL(ul_tbf, LOGL_INFO, "Tx CS update: %s -> %s\n",
+ gprs_rlcmac_mcs_name(ul_tbf->tx_cs), gprs_rlcmac_mcs_name(tx_cs));
+ ul_tbf->tx_cs = tx_cs;
+
+ /* TODO: recalculate countdown_state, have to look a TS 44.060 specs on what to do exactly. */
+}
+
int gprs_rlcmac_ul_tbf_handle_pkt_ul_ack_nack(struct gprs_rlcmac_ul_tbf *ul_tbf,
const RlcMacDownlink_t *dl_block)
{
@@ -276,6 +288,8 @@ int gprs_rlcmac_ul_tbf_handle_pkt_ul_ack_nack(struct gprs_rlcmac_ul_tbf *ul_tbf,
"Received acknowledge of all blocks, but without final ack indication (don't worry)\n");
}
+ gprs_rlcmac_ul_tbf_update_tx_cs(ul_tbf, gprs->CHANNEL_CODING_COMMAND + GPRS_RLCMAC_CS_1);
+
return rc;
}
diff --git a/tests/rlcmac/rlcmac_prim_test.c b/tests/rlcmac/rlcmac_prim_test.c
index 0c40737..10f148a 100644
--- a/tests/rlcmac/rlcmac_prim_test.c
+++ b/tests/rlcmac/rlcmac_prim_test.c
@@ -321,7 +321,7 @@ static void ul_ack_nack_init(RlcMacDownlink_t *dl_block, uint8_t ul_tfi, enum gp
ack->UPLINK_TFI = ul_tfi;
ack->UnionType = 0; /* GPRS */
- gprs->CHANNEL_CODING_COMMAND = cs;
+ gprs->CHANNEL_CODING_COMMAND = gprs_rlcmac_mcs_chan_code(cs);
}
static void ul_ack_nack_mark(Ack_Nack_Description_t *ack_desc, unsigned int idx, bool received)