From 459383d531bd0c6edf6fcda806333cb0669a4fb0 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 21 Jul 2023 19:21:48 +0200 Subject: [PATCH] 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 --- src/rlcmac/tbf_ul.c | 14 ++++++++++++++ tests/rlcmac/rlcmac_prim_test.c | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) 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)