Change in osmo-pcu[master]: Move ws_* fields from BTS to PCU

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
Mon Jan 18 14:44:59 UTC 2021


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

Change subject: Move ws_* fields from BTS to PCU
......................................................................

Move ws_* fields from BTS to PCU

Change-Id: I997bc52f0d924c8f2a0b1d6cf23af98828ad4258
---
M src/bts.cpp
M src/bts.h
M src/gprs_pcu.c
M src/gprs_pcu.h
M src/pcu_vty.c
M src/tbf.cpp
M src/tbf_dl.cpp
M src/tbf_ul.cpp
M tests/tbf/TbfTest.cpp
9 files changed, 19 insertions(+), 23 deletions(-)

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



diff --git a/src/bts.cpp b/src/bts.cpp
index 9f987ff..450c04e 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -201,10 +201,6 @@
 	bts->n3105 = 8;
 	bts->si13_is_set = false;
 
-	/* TODO: increase them when CRBB decoding is implemented */
-	bts->ws_base = 64;
-	bts->ws_pdch = 0;
-
 	bts->llc_codel_interval_msec = LLC_CODEL_USE_DEFAULT;
 	bts->llc_idle_ack_csec = 10;
 
diff --git a/src/bts.h b/src/bts.h
index db5f3e8..635c3c7 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -102,8 +102,6 @@
 
 	uint8_t si13[GSM_MACBLOCK_LEN];
 	bool si13_is_set;
-	uint16_t ws_base;
-	uint16_t ws_pdch; /* increase WS by this value per PDCH */
 
 	/* State for dynamic algorithm selection */
 	int multislot_disabled;
diff --git a/src/gprs_pcu.c b/src/gprs_pcu.c
index 209fca6..18c5568 100644
--- a/src/gprs_pcu.c
+++ b/src/gprs_pcu.c
@@ -91,6 +91,9 @@
 	pcu->vty.mcs_lqual_ranges[8].low = 23;
 	pcu->vty.mcs_lqual_ranges[8].high = 256;
 	pcu->vty.ns_dialect = NS2_DIALECT_IPACCESS;
+	/* TODO: increase them when CRBB decoding is implemented */
+	pcu->vty.ws_base = 64;
+	pcu->vty.ws_pdch = 0;
 
 	pcu->T_defs = T_defs_pcu;
 	osmo_tdefs_reset(pcu->T_defs);
diff --git a/src/gprs_pcu.h b/src/gprs_pcu.h
index 87c8cdf..b4e7c13 100644
--- a/src/gprs_pcu.h
+++ b/src/gprs_pcu.h
@@ -95,6 +95,8 @@
 		struct {int16_t low; int16_t high; } cs_lqual_ranges[MAX_GPRS_CS];
 		struct {int16_t low; int16_t high; } mcs_lqual_ranges[MAX_EDGE_MCS];
 		enum gprs_ns2_dialect ns_dialect; /* Are we talking Gb with IP-SNS (true) or classic Gb? */
+		uint16_t ws_base;
+		uint16_t ws_pdch; /* increase WS by this value per PDCH */
 	} vty;
 
 	struct gsmtap_inst *gsmtap;
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index d107548..5e9da45 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -195,7 +195,7 @@
 				the_pcu->vty.max_mcs_ul, VTY_NEWLINE);
 	}
 
-	vty_out(vty, " window-size %d %d%s", bts->ws_base, bts->ws_pdch,
+	vty_out(vty, " window-size %d %d%s", the_pcu->vty.ws_base, the_pcu->vty.ws_pdch,
 		VTY_NEWLINE);
 
 	if (the_pcu->vty.dl_arq_type == EGPRS_ARQ2)
@@ -557,13 +557,12 @@
 	      "Base value (b)\n"
 	      "Factor for number of PDCH (f)")
 {
-	struct gprs_rlcmac_bts *bts = bts_main_data();
 	uint16_t b = atoi(argv[0]);
 
-	bts->ws_base = b;
+	the_pcu->vty.ws_base = b;
 	if (argc > 1) {
 		uint16_t f = atoi(argv[1]);
-		bts->ws_pdch = f;
+		the_pcu->vty.ws_pdch = f;
 	}
 
 	return CMD_SUCCESS;
diff --git a/src/tbf.cpp b/src/tbf.cpp
index eb043e5..43c8cbf 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -321,7 +321,7 @@
 	uint8_t num_pdch = pcu_bitcount(slots);
 
 	return OSMO_MIN((num_pdch != 1) ? (128 * num_pdch) : 192,
-			OSMO_MAX(64, (bts_data->ws_base + num_pdch * bts_data->ws_pdch) / 32 * 32));
+			OSMO_MAX(64, (the_pcu->vty.ws_base + num_pdch * the_pcu->vty.ws_pdch) / 32 * 32));
 }
 
 int gprs_rlcmac_tbf::update()
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 024a5f3..653db14 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -1494,7 +1494,7 @@
 	uint16_t ws = egprs_window_size(b, dl_slots());
 
 	LOGPTBFDL(this, LOGL_INFO, "setting EGPRS DL window size to %u, base(%u) slots(%u) ws_pdch(%u)\n",
-		  ws, b->ws_base, pcu_bitcount(dl_slots()), b->ws_pdch);
+		  ws, bts->pcu->vty.ws_base, pcu_bitcount(dl_slots()), bts->pcu->vty.ws_pdch);
 	m_window.set_ws(ws);
 }
 
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index f8c860c..1f3cb01 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -764,7 +764,7 @@
 	const struct gprs_rlcmac_bts *b = bts->bts_data();
 	uint16_t ws = egprs_window_size(b, ul_slots());
 	LOGPTBFUL(this, LOGL_INFO, "setting EGPRS UL window size to %u, base(%u) slots(%u) ws_pdch(%u)\n",
-		  ws, b->ws_base, pcu_bitcount(ul_slots()), b->ws_pdch);
+		  ws, bts->pcu->vty.ws_base, pcu_bitcount(ul_slots()), bts->pcu->vty.ws_pdch);
 	m_window.set_ws(ws);
 }
 
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 66e344e..1b85201 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -1749,7 +1749,6 @@
 	uint32_t tlli = 0xf1223344;
 	const char *imsi = "0011223344";
 	uint8_t ms_class = 1;
-	gprs_rlcmac_bts *bts;
 	uint8_t egprs_ms_class = 1;
 	gprs_rlcmac_ul_tbf *ul_tbf;
 	uint8_t test_data[256];
@@ -1760,9 +1759,8 @@
 
 	setup_bts(the_bts, ts_no, 4);
 	the_bts->bts_data()->initial_mcs_dl = 9;
-	bts = the_bts->bts_data();
-	bts->ws_base = 128;
-	bts->ws_pdch = 64;
+	the_pcu->vty.ws_base = 128;
+	the_pcu->vty.ws_pdch = 64;
 
 	ul_tbf = establish_ul_tbf(the_bts, ts_no, tlli, &fn, qta, ms_class, egprs_ms_class);
 	/* Function to generate URBB with no length */
@@ -1782,8 +1780,8 @@
 
 	static_cast<gprs_rlc_ul_window *>(ul_tbf->window())->reset_state();
 	/* Function to generate CRBB */
-	bts->ws_base = 128;
-	bts->ws_pdch = 64;
+	the_pcu->vty.ws_base = 128;
+	the_pcu->vty.ws_pdch = 64;
 	ul_tbf = establish_ul_tbf_two_phase_puan_CRBB(the_bts, ts_no, tlli, &fn,
 		qta, ms_class, egprs_ms_class);
 
@@ -2288,8 +2286,8 @@
 
 	setup_bts(the_bts, ts_no);
 
-	bts->ws_base = 128;
-	bts->ws_pdch = 64;
+	the_pcu->vty.ws_base = 128;
+	the_pcu->vty.ws_pdch = 64;
 	the_pcu->alloc_algorithm = alloc_algorithm_b;
 	bts->trx[0].pdch[2].enable();
 	bts->trx[0].pdch[3].enable();
@@ -2336,8 +2334,8 @@
 
 	setup_bts(the_bts, ts_no);
 
-	bts->ws_base = 128;
-	bts->ws_pdch = 64;
+	the_pcu->vty.ws_base = 128;
+	the_pcu->vty.ws_pdch = 64;
 	the_pcu->alloc_algorithm = alloc_algorithm_b;
 	bts->trx[0].pdch[2].enable();
 	bts->trx[0].pdch[3].enable();

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I997bc52f0d924c8f2a0b1d6cf23af98828ad4258
Gerrit-Change-Number: 22190
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
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/20210118/5de8a053/attachment.htm>


More information about the gerrit-log mailing list