Change in osmo-pcu[master]: Move alpha,gamma 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:52 UTC 2021


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

Change subject: Move alpha,gamma fields from BTS to PCU
......................................................................

Move alpha,gamma fields from BTS to PCU

Change-Id: I2fdd9c8a7393157183fff64084bb10e2a3b1dc63
---
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 tests/emu/pcu_emu.cpp
7 files changed, 12 insertions(+), 18 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/src/bts.cpp b/src/bts.cpp
index f965714..3200b40 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -200,7 +200,6 @@
 	bts->n3101 = 10;
 	bts->n3103 = 4;
 	bts->n3105 = 8;
-	bts->alpha = 0; /* a = 0.0 */
 	bts->si13_is_set = false;
 	bts->cs_adj_enabled = 1;
 	bts->cs_adj_upper_limit = 33; /* Decrease CS if the error rate is above */
@@ -966,7 +965,7 @@
 		plen = Encoding::write_immediate_assignment(
 			&m_bts.trx[trx_no].pdch[ts_no], tbf, bv,
 			false, rip->ra, Fn, ta, usf, false, sb_fn,
-			m_bts.alpha, m_bts.gamma, -1,
+			pcu->vty.alpha, pcu->vty.gamma, -1,
 			rip->burst_type);
 		do_rate_ctr_inc(CTR_IMMEDIATE_ASSIGN_UL_TBF);
 	}
@@ -1048,7 +1047,7 @@
 						    tbf, immediate_assignment, true, 125,
 						    (tbf->pdch[ts_no]->last_rts_fn + 21216) % GSM_MAX_FN,
 						    tbf->ta(), 7, poll, tbf->poll_fn,
-						    m_bts.alpha, m_bts.gamma, -1,
+						    pcu->vty.alpha, pcu->vty.gamma, -1,
 						    GSM_L1_BURST_TYPE_ACCESS_0);
 	if (plen >= 0) {
 		do_rate_ctr_inc(CTR_IMMEDIATE_ASSIGN_DL_TBF);
diff --git a/src/bts.h b/src/bts.h
index 2097cca..81f7327 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -106,7 +106,6 @@
 	uint8_t n3105;
 	struct gprs_rlcmac_trx trx[8];
 
-	uint8_t alpha, gamma;
 	bool dl_tbf_preemptive_retransmission;
 	uint8_t si13[GSM_MACBLOCK_LEN];
 	bool si13_is_set;
diff --git a/src/gprs_pcu.c b/src/gprs_pcu.c
index e08094b..f791e43 100644
--- a/src/gprs_pcu.c
+++ b/src/gprs_pcu.c
@@ -50,6 +50,7 @@
 	pcu->vty.max_cs_dl = MAX_GPRS_CS;
 	pcu->vty.max_mcs_ul = MAX_EDGE_MCS;
 	pcu->vty.max_mcs_dl = MAX_EDGE_MCS;
+	pcu->vty.alpha = 0; /* a = 0.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 4920966..d6d2dca 100644
--- a/src/gprs_pcu.h
+++ b/src/gprs_pcu.h
@@ -75,6 +75,7 @@
 		uint8_t max_cs_dl, max_cs_ul;
 		uint8_t max_mcs_dl, max_mcs_ul;
 		uint8_t force_two_phase;
+		uint8_t alpha, gamma;
 	} vty;
 
 	struct gsmtap_inst *gsmtap;
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 83fb166..06e1674 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -229,8 +229,8 @@
 		vty_out(vty, " alloc-algorithm dynamic%s", VTY_NEWLINE);
 	if (the_pcu->vty.force_two_phase)
 		vty_out(vty, " two-phase-access%s", VTY_NEWLINE);
-	vty_out(vty, " alpha %d%s", bts->alpha, VTY_NEWLINE);
-	vty_out(vty, " gamma %d%s", bts->gamma * 2, VTY_NEWLINE);
+	vty_out(vty, " alpha %d%s", the_pcu->vty.alpha, VTY_NEWLINE);
+	vty_out(vty, " gamma %d%s", the_pcu->vty.gamma * 2, VTY_NEWLINE);
 	if (!bts->dl_tbf_preemptive_retransmission)
 		vty_out(vty, " no dl-tbf-preemptive-retransmission%s", VTY_NEWLINE);
 	if (strcmp(the_pcu->pcu_sock_path, PCU_SOCK_DEFAULT))
@@ -804,10 +804,7 @@
 	   "Alpha in units of 0.1\n",
 	   CMD_ATTR_IMMEDIATE)
 {
-	struct gprs_rlcmac_bts *bts = bts_main_data();
-
-	bts->alpha = atoi(argv[0]);
-
+	the_pcu->vty.alpha = atoi(argv[0]);
 	return CMD_SUCCESS;
 }
 
@@ -818,10 +815,7 @@
 	   "Gamma in even unit of dBs\n",
 	   CMD_ATTR_IMMEDIATE)
 {
-	struct gprs_rlcmac_bts *bts = bts_main_data();
-
-	bts->gamma = atoi(argv[0]) / 2;
-
+	the_pcu->vty.gamma = atoi(argv[0]) / 2;
 	return CMD_SUCCESS;
 }
 
diff --git a/src/tbf.cpp b/src/tbf.cpp
index c42081b..eb043e5 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -926,7 +926,7 @@
 	Encoding::write_packet_downlink_assignment(mac_control_block,
 		old_tfi_is_valid, m_tfi, (direction == GPRS_RLCMAC_DL_TBF),
 		new_dl_tbf, poll_ass_dl, rrbp,
-		bts_data()->alpha, bts_data()->gamma, -1, 0,
+		the_pcu->vty.alpha, the_pcu->vty.gamma, -1, 0,
 		is_egprs_enabled());
 	LOGP(DTBF, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++\n");
 	rc = encode_gsm_rlcmac_downlink(&bv, mac_control_block);
@@ -1029,8 +1029,8 @@
 	mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t);
 	Encoding::write_packet_uplink_assignment(mac_control_block, m_tfi,
 		(direction == GPRS_RLCMAC_DL_TBF), tlli(),
-		is_tlli_valid(), new_tbf, 1, rrbp, bts_data()->alpha,
-		bts_data()->gamma, -1, is_egprs_enabled());
+		is_tlli_valid(), new_tbf, 1, rrbp, the_pcu->vty.alpha,
+		the_pcu->vty.gamma, -1, is_egprs_enabled());
 
 	LOGP(DTBF, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++\n");
 	rc = encode_gsm_rlcmac_downlink(&bv, mac_control_block);
diff --git a/tests/emu/pcu_emu.cpp b/tests/emu/pcu_emu.cpp
index 7534b84..96aacda 100644
--- a/tests/emu/pcu_emu.cpp
+++ b/tests/emu/pcu_emu.cpp
@@ -72,13 +72,13 @@
 	bts->n3101 = 10;
 	bts->n3103 = 4;
 	bts->n3105 = 8;
-	bts->alpha = 0; /* a = 0.0 */
 }
 
 static void init_pcu(struct gprs_pcu *pcu)
 {
 	if (!pcu->alloc_algorithm)
 		pcu->alloc_algorithm = alloc_algorithm_b;
+	pcu->vty.alpha = 0; /* a = 0.0 */
 }
 
 static void bvci_unblocked(struct gprs_bssgp_pcu *pcu)

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I2fdd9c8a7393157183fff64084bb10e2a3b1dc63
Gerrit-Change-Number: 22181
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-CC: laforge <laforge at osmocom.org>
Gerrit-CC: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210118/fdb73f69/attachment.htm>


More information about the gerrit-log mailing list