[PATCH 3/4] Modify DL tbf flow for MCS change in Retx

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/osmocom-net-gprs@lists.osmocom.org/.

Aravind Sirsikar Arvind.sirsikar at radisys.com
Mon Apr 11 10:45:22 UTC 2016


From: Aravind Sirsikar <arvind.sirsikar at radisys.com>

Modify the DL TBF flow to support MCS change during the
EGPRS retransmission
---
 src/tbf_dl.cpp |   36 +++++++++++++++++++++++++-----------
 1 file changed, 25 insertions(+), 11 deletions(-)

diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 9e4d078..28f9083 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -365,7 +365,7 @@ int gprs_rlcmac_dl_tbf::take_next_bsn(uint32_t fn,
 	bsn = m_window.resend_needed();
 
 	if (previous_bsn >= 0) {
-		force_cs = m_rlc.block(previous_bsn)->cs;
+		force_cs = m_rlc.block(previous_bsn)->cs2;
 		if (!force_cs.isEgprs())
 			return -1;
 		force_data_len = m_rlc.block(previous_bsn)->len;
@@ -379,7 +379,19 @@ int gprs_rlcmac_dl_tbf::take_next_bsn(uint32_t fn,
 			m_window.mod_sns(bsn - previous_bsn) > RLC_EGPRS_MAX_BSN_DELTA)
 			return -1;
 
-		cs2 = m_rlc.block(bsn)->cs;
+		if (is_egprs_enabled()) {
+			m_rlc.block(bsn)->cs2 =	GprsCodingScheme::get_retx_mcs
+				(m_rlc.block(bsn)->cs, ms()->current_cs_dl());
+
+			/* TODO: Need to remove this check when MCS-8 -> MCS-6
+			 * transistion is handled
+			 */
+			if ((m_rlc.block(bsn)->cs2 == GprsCodingScheme::MCS6) &&
+			(m_rlc.block(bsn)->cs == GprsCodingScheme::MCS8))
+				m_rlc.block(bsn)->cs2 = GprsCodingScheme::MCS8;
+		} else
+			m_rlc.block(bsn)->cs2 = m_rlc.block(bsn)->cs;
+
 		data_len2 = m_rlc.block(bsn)->len;
 		if (force_data_len > 0 && force_data_len != data_len2)
 			return -1;
@@ -433,7 +445,7 @@ int gprs_rlcmac_dl_tbf::take_next_bsn(uint32_t fn,
 		bts->rlc_resent();
 	}
 
-	*may_combine = cs2.numDataBlocks() > 1;
+	*may_combine = m_rlc.block(bsn)->cs2.numDataBlocks() > 1;
 
 	return bsn;
 }
@@ -505,6 +517,7 @@ int gprs_rlcmac_dl_tbf::create_new_bsn(const uint32_t fn, GprsCodingScheme cs)
 	rlc_data = m_rlc.block(bsn);
 	data = rlc_data->prepare(block_data_len);
 	rlc_data->cs = cs;
+	rlc_data->cs2 = cs;
 	rlc_data->len = block_data_len;
 
 	rdbi = &(rlc_data->block_info);
@@ -587,7 +600,6 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
 	bool is_final = false;
 	gprs_rlc_data_info rlc;
 	GprsCodingScheme cs;
-	GprsCodingScheme cs_current_trans;
 	int bsns[ARRAY_SIZE(rlc.block_info)];
 	unsigned num_bsns;
 	enum egprs_puncturing_values punct[ARRAY_SIZE(rlc.block_info)];
@@ -601,7 +613,7 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
 	 * be put into the data area, even if the resulting CS is higher than
 	 * the current limit.
 	 */
-	cs = m_rlc.block(index)->cs;
+	cs = m_rlc.block(index)->cs2;
 	bsns[0] = index;
 	num_bsns = 1;
 
@@ -613,6 +625,9 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
 	if (num_bsns == 1) {
 		/* TODO: remove the conditional when MCS-6 padding isn't
 		 * failing to be decoded by MEs anymore */
+		/* TODO: support of MCS-8 -> MCS-6 transition should be
+		 * handled
+		 */
 		if (cs != GprsCodingScheme(GprsCodingScheme::MCS8))
 			cs.decToSingleBlock(&need_padding);
 	}
@@ -647,18 +662,15 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
 		else
 			bsn = bsns[0];
 
-		cs_enc = m_rlc.block(bsn)->cs;
+		cs_enc = m_rlc.block(bsn)->cs2;
 
 		/* get data and header from current block */
 		block_data = m_rlc.block(bsn)->block;
 
-		/* TODO: Need to support MCS change during retx */
-		cs_current_trans = cs;
-
 		/* Get current puncturing scheme from block */
 		punct_scheme = gprs_get_punct_scheme(
 			m_rlc.block(bsn)->next_ps,
-			cs, cs_current_trans);
+			m_rlc.block(bsn)->cs, cs);
 
 		if (cs.isEgprs()) {
 			OSMO_ASSERT(punct_scheme >= EGPRS_PS_1);
@@ -682,7 +694,9 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
 		 * in header type 1
 		 */
 		gprs_update_punct_scheme(&m_rlc.block(bsn)->next_ps,
-					cs_current_trans);
+					cs);
+
+		m_rlc.block(bsn)->cs = m_rlc.block(bsn)->cs2;
 
 		rdbi->e   = block_info->e;
 		rdbi->cv  = block_info->cv;
-- 
1.7.9.5





More information about the osmocom-net-gprs mailing list