[PATCH 2/4] Add Accessor functions for MCS change in Retx

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


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

Add Accessor functions in existing classes to support MCS change
during the retransmission in EGPRS DL
---
 src/gprs_coding_scheme.h |   19 +++++++++++++++++++
 src/gprs_ms.cpp          |    5 +++++
 src/gprs_ms.h            |    1 +
 3 files changed, 25 insertions(+)

diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h
index 06e90fc..e0c5fd8 100644
--- a/src/gprs_coding_scheme.h
+++ b/src/gprs_coding_scheme.h
@@ -72,6 +72,8 @@ public:
 	GprsCodingScheme& operator =(Scheme s);
 	GprsCodingScheme& operator =(GprsCodingScheme o);
 
+	bool operator == (Scheme s);
+
 	bool isValid()   const {return UNKNOWN <= m_scheme && m_scheme <= MCS9;}
 	bool isGprs()   const {return CS1 <= m_scheme && m_scheme <= CS4;}
 	bool isEgprs()  const {return m_scheme >= MCS1;}
@@ -111,6 +113,9 @@ public:
 	static GprsCodingScheme getEgprsByNum(unsigned num);
 
 	static const char *modeName(Mode mode);
+	static Scheme get_retx_mcs(const GprsCodingScheme &mcs,
+				const GprsCodingScheme &demanded_mcs);
+
 	static Scheme egprs_mcs_retx_tbl[MAX_NUM_ARQ]
 			[MAX_NUM_MCS][MAX_NUM_MCS];
 private:
@@ -196,6 +201,13 @@ inline bool operator ==(GprsCodingScheme a, GprsCodingScheme b)
 	return GprsCodingScheme::Scheme(a) == GprsCodingScheme::Scheme(b);
 }
 
+inline bool GprsCodingScheme::operator == (Scheme scheme)
+{
+	if (this->m_scheme == scheme)
+		return true;
+	return false;
+}
+
 inline bool operator !=(GprsCodingScheme a, GprsCodingScheme b)
 {
 	return !(a == b);
@@ -222,3 +234,10 @@ inline bool operator >=(GprsCodingScheme a, GprsCodingScheme b)
 	return a == b || a > b;
 }
 
+inline GprsCodingScheme::Scheme GprsCodingScheme::get_retx_mcs(
+				const GprsCodingScheme &mcs,
+				const GprsCodingScheme &demanded_mcs)
+{
+	return egprs_mcs_retx_tbl[EGPRS_ARQ2][mcs.to_num() - 1]
+			[demanded_mcs.to_num() - 1];
+}
diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp
index 4296fd3..b9a04fb 100644
--- a/src/gprs_ms.cpp
+++ b/src/gprs_ms.cpp
@@ -574,6 +574,11 @@ GprsCodingScheme GprsMs::max_cs_ul() const
 	return GprsCodingScheme(GprsCodingScheme::MCS4);
 }
 
+void GprsMs::set_current_cs_dl(GprsCodingScheme::Scheme scheme)
+{
+	m_current_cs_dl = scheme;
+}
+
 GprsCodingScheme GprsMs::max_cs_dl() const
 {
 	struct gprs_rlcmac_bts *bts_data;
diff --git a/src/gprs_ms.h b/src/gprs_ms.h
index b07f175..bcc4fb3 100644
--- a/src/gprs_ms.h
+++ b/src/gprs_ms.h
@@ -86,6 +86,7 @@ public:
 	uint8_t egprs_ms_class() const;
 	void set_ms_class(uint8_t ms_class);
 	void set_egprs_ms_class(uint8_t ms_class);
+	void set_current_cs_dl(GprsCodingScheme::Scheme scheme);
 
 	GprsCodingScheme current_cs_ul() const;
 	GprsCodingScheme current_cs_dl() const;
-- 
1.7.9.5




More information about the osmocom-net-gprs mailing list