[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 25 10:30:59 UTC 2016


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

diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 9e4d078..17e3603 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)->cs_current_trans;
 		if (!force_cs.isEgprs())
 			return -1;
 		force_data_len = m_rlc.block(previous_bsn)->len;
@@ -379,7 +379,21 @@ 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)->cs_current_trans =
+			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)->cs == GprsCodingScheme::MCS8)
+				m_rlc.block(bsn)->cs_current_trans =
+					GprsCodingScheme::MCS8;
+		} else
+			m_rlc.block(bsn)->cs_current_trans =
+					m_rlc.block(bsn)->cs;
+
 		data_len2 = m_rlc.block(bsn)->len;
 		if (force_data_len > 0 && force_data_len != data_len2)
 			return -1;
@@ -422,7 +436,7 @@ int gprs_rlcmac_dl_tbf::take_next_bsn(uint32_t fn,
 			"- Sending new dummy block at BSN %d, CS=%s\n",
 			m_window.v_s(), current_cs().name());
 		bsn = create_new_bsn(fn, current_cs());
-		/* Don't send a second block, so don't set cs2 */
+		/* Don't send a second block, so don't set cs_current_trans*/
 	}
 
 	if (bsn < 0) {
@@ -433,7 +447,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)->cs_current_trans.numDataBlocks() > 1;
 
 	return bsn;
 }
@@ -505,6 +519,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->cs_current_trans = cs;
 	rlc_data->len = block_data_len;
 
 	rdbi = &(rlc_data->block_info);
@@ -587,7 +602,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 +615,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)->cs_current_trans;
 	bsns[0] = index;
 	num_bsns = 1;
 
@@ -613,6 +627,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 +664,16 @@ 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)->cs_current_trans;
+
 
 		/* 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 +697,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)->cs_current_trans;
 
 		rdbi->e   = block_info->e;
 		rdbi->cv  = block_info->cv;
-- 
1.7.9.5





More information about the osmocom-net-gprs mailing list