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

Submitted by Aravind Sirsikar on April 25, 2016, 10:30 a.m.

Details

Message ID 1461580260-9199-3-git-send-email-arvind.sirsikar@radisys.com
State New
Series "Support for Incremental redundency in EGPRS DL"
Headers show

Commit Message

Aravind Sirsikar April 25, 2016, 10:30 a.m.
Add accessor function 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, 24 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h
index bb0bad4..fb3a191 100644
--- a/src/gprs_coding_scheme.h
+++ b/src/gprs_coding_scheme.h
@@ -70,6 +70,7 @@  public:
 	unsigned int to_num() const;
 
 	GprsCodingScheme& operator =(Scheme s);
+	bool operator == (Scheme s);
 	GprsCodingScheme& operator =(GprsCodingScheme o);
 
 	bool isValid()   const {return UNKNOWN <= m_scheme && m_scheme <= MCS9;}
@@ -111,6 +112,9 @@  public:
 	static GprsCodingScheme getEgprsByNum(unsigned num);
 
 	static const char *modeName(Mode mode);
+	static Scheme get_retx_mcs(const GprsCodingScheme &mcs,
+				const GprsCodingScheme &retx_mcs);
+
 	static enum Scheme egprs_mcs_retx_tbl[MAX_NUM_ARQ]
 			[MAX_NUM_MCS][MAX_NUM_MCS];
 private:
@@ -196,6 +200,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);
@@ -221,4 +232,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;