Change in osmo-pcu[master]: Get rid of bts->egprs_enabled

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
Fri Oct 30 19:43:12 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/20994 )


Change subject: Get rid of bts->egprs_enabled
......................................................................

Get rid of bts->egprs_enabled

BTS simply notifies the PCU about the supported MCS, and PCU is
responsible for providing correct data formatting supported for the BTS
and the target MS.

Change-Id: Ifcf23771bd23afc64ca6fea38948f98f2d134ecb
---
M src/bts.h
M src/gprs_bssgp_pcu.cpp
M src/pcu_l1_if.cpp
M tests/edge/EdgeTest.cpp
M tests/tbf/TbfTest.cpp
M tests/types/TypesTest.cpp
6 files changed, 15 insertions(+), 24 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/94/20994/1

diff --git a/src/bts.h b/src/bts.h
index edb5d6e..cc6c22b 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -135,7 +135,6 @@
 
 	uint8_t force_two_phase;
 	uint8_t alpha, gamma;
-	bool egprs_enabled;
 	bool dl_tbf_preemptive_retransmission;
 	uint8_t si13[GSM_MACBLOCK_LEN];
 	bool si13_is_set;
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index a788ac0..2f79fa4 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -737,18 +737,23 @@
 {
 	int num;
 	int i;
+	bool mcs_any = false;
 
-	if (bts->egprs_enabled) {
+	/* First check if we support any MCS: */
+	for (i = sizeof(bts->mcs_supported) - 1; i >= 0; i--) {
+		if (bts->mcs_supported[i]) {
+			num = i + 1;
+			mcs_any = true;
+			break;
+		}
+	}
+
+	if (mcs_any) {
 		if (!bts->cs_adj_enabled) {
 			if (bts->initial_mcs_dl) {
 				num = bts->initial_mcs_dl;
 			} else {
-				for (i = sizeof(bts->mcs_supported) - 1; i >= 0; i--) {
-					if (bts->mcs_supported[i]) {
-						num = i + 1;
-						break;
-					}
-				}
+				/* We found "num" for free in the loop above */
 			}
 		} else if (bts->bts->max_mcs_dl()) {
 			num = bts->bts->max_mcs_dl();
@@ -803,6 +808,9 @@
 	ms_bucket_size = bts->fc_ms_bucket_size;
 	ms_leak_rate = bts->fc_ms_leak_rate;
 
+	/* FIXME: This calculation is mostly wrong. It should be done based on
+	   currently established TBF (and whether the related (egprs)_ms_class
+	   as per which CS/MCS they support). */
 	if (leak_rate == 0) {
 		int meas_rate;
 		int usage; /* in 0..1000 */
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 45527f5..4e2f339 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -625,11 +625,9 @@
 	if (!any_cs_supported) /* We need at least 1 CS, let's enable CS1 */
 		bts->cs_supported[0] = true;
 
-	bts->egprs_enabled = false;
 	for (i = 0; i < sizeof(bts->mcs_supported); i++) {
 		bts->mcs_supported[i] = (info_ind->flags & (PCU_IF_FLAG_MCS1 << i));
 		if (bts->mcs_supported[i]) {
-			bts->egprs_enabled = true;
 			LOGP(DL1IF, LOGL_DEBUG, " Use MCS%d\n", i+1);
 		}
 	}
diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp
index 5845f4d..67ed2a7 100644
--- a/tests/edge/EdgeTest.cpp
+++ b/tests/edge/EdgeTest.cpp
@@ -1157,7 +1157,6 @@
 	gprs_rlcmac_trx *trx;
 
 	bts = the_bts->bts_data();
-	bts->egprs_enabled = true;
 	bts->alloc_algorithm = alloc_algorithm_a;
 	bts->initial_cs_dl = cs;
 	bts->initial_cs_ul = cs;
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 7811883..99ec54a 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -1737,7 +1737,6 @@
 
 	setup_bts(&the_bts, ts_no, 4);
 	the_bts.bts_data()->initial_mcs_dl = 9;
-	the_bts.bts_data()->egprs_enabled = true;
 	bts = the_bts.bts_data();
 	bts->ws_base = 128;
 	bts->ws_pdch = 64;
@@ -2177,7 +2176,6 @@
 	setup_bts(&the_bts, ts_no);
 
 	/* EGPRS-only */
-	bts->egprs_enabled = true;
 
 	gprs_bssgp_init(bts, 3234, 3234, 1, 1, false, 0, 0, 0);
 
@@ -2257,7 +2255,6 @@
 	ws_check(dl_tbf, __func__, 4, 64, true, false);
 
 	/* EGPRS-only */
-	bts->egprs_enabled = true;
 
 	/* Does support EGPRS */
 	ms = the_bts.ms_alloc(ms_class, ms_class);
@@ -2297,7 +2294,6 @@
 	gprs_bssgp_init(bts, 5234, 5234, 1, 1, false, 0, 0, 0);
 
 	/* EGPRS-only */
-	bts->egprs_enabled = true;
 
 	/* Does support EGPRS */
 	ms = the_bts.ms_alloc(ms_class, ms_class);
@@ -2330,7 +2326,6 @@
 
 	setup_bts(&the_bts, ts_no, 4);
 	the_bts.bts_data()->initial_mcs_dl = 9;
-	the_bts.bts_data()->egprs_enabled = true;
 
 	ul_tbf = puan_urbb_len_issue(&the_bts, ts_no, tlli, &fn, qta,
 		ms_class, egprs_ms_class);
@@ -2471,7 +2466,6 @@
 
 	setup_bts(&the_bts, ts_no, 4);
 	the_bts.bts_data()->initial_mcs_dl = 9;
-	the_bts.bts_data()->egprs_enabled = true;
 
 	ul_tbf = tbf_li_decoding(&the_bts, ts_no, tlli, &fn, qta,
 		ms_class, egprs_ms_class);
@@ -2515,7 +2509,6 @@
 
 	setup_bts(&the_bts, ts_no);
 	OSMO_ASSERT(osmo_tdef_set(bts->T_defs_pcu, -2031, 200, OSMO_TDEF_MS) == 0);
-	bts->egprs_enabled = true;
 	/* ARQ II */
 	bts->dl_arq_type = EGPRS_ARQ2;
 
@@ -2599,7 +2592,6 @@
 
 	setup_bts(&the_bts, ts_no, 4);
 	the_bts.bts_data()->initial_mcs_dl = 9;
-	the_bts.bts_data()->egprs_enabled = true;
 
 	ul_tbf = establish_ul_tbf_two_phase_spb(&the_bts, ts_no, tlli, &fn, qta,
 		ms_class, egprs_ms_class);
@@ -2629,7 +2621,6 @@
 
 	setup_bts(&the_bts, ts_no, 4);
 	the_bts.bts_data()->initial_mcs_dl = 9;
-	the_bts.bts_data()->egprs_enabled = true;
 
 	ul_tbf = establish_ul_tbf_two_phase(&the_bts, ts_no, tlli, &fn, qta,
 		ms_class, egprs_ms_class);
@@ -3054,7 +3045,6 @@
 	bts->cs_downgrade_threshold = 0;
 	setup_bts(&the_bts, ts_no);
 	OSMO_ASSERT(osmo_tdef_set(bts->T_defs_pcu, -2031, 200, OSMO_TDEF_MS) == 0);
-	bts->egprs_enabled = true;
 	/* ARQ II */
 	bts->dl_arq_type = EGPRS_ARQ2;
 
@@ -3083,7 +3073,6 @@
 	bts->cs_downgrade_threshold = 0;
 	setup_bts(&the_bts, ts_no);
 	OSMO_ASSERT(osmo_tdef_set(bts->T_defs_pcu, -2031, 200, OSMO_TDEF_MS) == 0);
-	bts->egprs_enabled = true;
 
 	/* ARQ I resegmentation support */
 	bts->dl_arq_type = EGPRS_ARQ1;
@@ -3115,7 +3104,6 @@
 
 	setup_bts(&the_bts, ts_no);
 	OSMO_ASSERT(osmo_tdef_set(bts->T_defs_pcu, -2031, 200, OSMO_TDEF_MS) == 0);
-	bts->egprs_enabled = true;
 	/* ARQ II */
 	bts->dl_arq_type = EGPRS_ARQ2;
 
diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index eeebc70..feccf42 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -670,7 +670,6 @@
 	fprintf(stderr, "############## test_egprs_ul_ack_nack\n");
 
 	BTS the_bts;
-	the_bts.bts_data()->egprs_enabled = true;
 	the_bts.bts_data()->alloc_algorithm = alloc_algorithm_a;
 	the_bts.bts_data()->trx[0].pdch[4].enable();
 

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Ifcf23771bd23afc64ca6fea38948f98f2d134ecb
Gerrit-Change-Number: 20994
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201030/bff23945/attachment.htm>


More information about the gerrit-log mailing list