Change in osmo-pcu[master]: ms: Properly handle EGPRS_GMSK mode in ms_max_cs_dl/ul()

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/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Jan 26 12:19:35 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/22434 )

Change subject: ms: Properly handle EGPRS_GMSK mode in ms_max_cs_dl/ul()
......................................................................

ms: Properly handle EGPRS_GMSK mode in ms_max_cs_dl/ul()

Change-Id: Ied3e02a12145112fafa12282ed7aefa5b0fa6eb6
---
M src/gprs_ms.c
M tests/ms/MsTest.ok
2 files changed, 12 insertions(+), 20 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  osmith: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gprs_ms.c b/src/gprs_ms.c
index f157d13..0c4db89 100644
--- a/src/gprs_ms.c
+++ b/src/gprs_ms.c
@@ -632,6 +632,7 @@
 
 enum CodingScheme ms_max_cs_ul(const struct GprsMs *ms)
 {
+	enum CodingScheme cs;
 	OSMO_ASSERT(ms->bts != NULL);
 
 	if (mcs_is_gprs(ms->current_cs_ul)) {
@@ -642,15 +643,10 @@
 		return mcs_get_gprs_by_num(bts_max_cs_ul(ms->bts));
 	}
 
-	if (!mcs_is_edge(ms->current_cs_ul))
-		return UNKNOWN;
-
-	if (bts_max_mcs_ul(ms->bts))
-		return mcs_get_egprs_by_num(bts_max_mcs_ul(ms->bts));
-	else if (bts_max_cs_ul(ms->bts))
-		return mcs_get_gprs_by_num(bts_max_cs_ul(ms->bts));
-
-	return MCS4;
+	cs = mcs_get_egprs_by_num(bts_max_mcs_ul(ms->bts));
+	if (ms_mode(ms) == EGPRS_GMSK && cs > MCS4)
+		cs = MCS4;
+	return cs;
 }
 
 void ms_set_current_cs_dl(struct GprsMs *ms, enum CodingScheme scheme)
@@ -660,6 +656,7 @@
 
 enum CodingScheme ms_max_cs_dl(const struct GprsMs *ms)
 {
+	enum CodingScheme cs;
 	OSMO_ASSERT(ms->bts != NULL);
 
 	if (mcs_is_gprs(ms->current_cs_dl)) {
@@ -670,15 +667,10 @@
 		return mcs_get_gprs_by_num(bts_max_cs_dl(ms->bts));
 	}
 
-	if (!mcs_is_edge(ms->current_cs_dl))
-		return UNKNOWN;
-
-	if (bts_max_mcs_dl(ms->bts))
-		return mcs_get_egprs_by_num(bts_max_mcs_dl(ms->bts));
-	else if (bts_max_cs_dl(ms->bts))
-		return mcs_get_gprs_by_num(bts_max_cs_dl(ms->bts));
-
-	return MCS4;
+	cs = mcs_get_egprs_by_num(bts_max_mcs_dl(ms->bts));
+	if (ms_mode(ms) == EGPRS_GMSK && cs > MCS4)
+		cs = MCS4;
+	return cs;
 }
 
 void ms_update_cs_ul(struct GprsMs *ms, const struct pcu_l1_meas *meas)
diff --git a/tests/ms/MsTest.ok b/tests/ms/MsTest.ok
index 3e5cdab..98e345c 100644
--- a/tests/ms/MsTest.ok
+++ b/tests/ms/MsTest.ok
@@ -26,8 +26,8 @@
 2: after mode set    MS DL MCS-1/MCS-9, UL MCS-1/MCS-9, mode EGPRS, <ACTIVE>
 1: after MCS set     MS DL MCS-7/MCS-9, UL MCS-1/MCS-9, mode EGPRS, <IDLE>
 2: after MCS set     MS DL MCS-8/MCS-9, UL MCS-1/MCS-9, mode EGPRS, <ACTIVE>
-1: after mode set    MS DL MCS-1/MCS-9, UL MCS-1/MCS-9, mode EGPRS_GMSK-only, <IDLE>
-2: after mode set    MS DL MCS-1/MCS-9, UL MCS-1/MCS-9, mode EGPRS_GMSK-only, <ACTIVE>
+1: after mode set    MS DL MCS-1/MCS-4, UL MCS-1/MCS-4, mode EGPRS_GMSK-only, <IDLE>
+2: after mode set    MS DL MCS-1/MCS-4, UL MCS-1/MCS-4, mode EGPRS_GMSK-only, <ACTIVE>
 1: after mode set    MS DL CS-4/CS-4, UL CS-1/CS-4, mode GPRS, <IDLE>
 2: after mode set    MS DL CS-4/CS-4, UL CS-1/CS-4, mode GPRS, <ACTIVE>
 === end test_ms_mcs_mode ===

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/22434
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Ied3e02a12145112fafa12282ed7aefa5b0fa6eb6
Gerrit-Change-Number: 22434
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210126/f4826de2/attachment.htm>


More information about the gerrit-log mailing list