Change in osmo-bts[master]: struct gsm_lchan: group ACCH repetition state fields

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Fri Oct 22 13:54:26 UTC 2021


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/25895 )

Change subject: struct gsm_lchan: group ACCH repetition state fields
......................................................................

struct gsm_lchan: group ACCH repetition state fields

Change-Id: I2680c88f2a51b64f085a92233bc125338622babf
Related: SYS#5114
---
M include/osmo-bts/lchan.h
M src/common/l1sap.c
M src/common/lchan.c
M src/common/measurement.c
M src/common/vty.c
M src/osmo-bts-trx/sched_lchan_xcch.c
6 files changed, 41 insertions(+), 38 deletions(-)

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



diff --git a/include/osmo-bts/lchan.h b/include/osmo-bts/lchan.h
index 03b3144..3eb4f93 100644
--- a/include/osmo-bts/lchan.h
+++ b/include/osmo-bts/lchan.h
@@ -304,13 +304,16 @@
 	/* ECU (Error Concealment Unit) state */
 	struct osmo_ecu_state *ecu_state;
 
+	/* Repeated ACCH capabilities and current state */
 	struct abis_rsl_osmo_rep_acch_cap rep_acch_cap;
-	bool repeated_dl_facch_active;
-	bool repeated_ul_sacch_active;
-	bool repeated_dl_sacch_active;
+	struct {
+		bool dl_facch_active;
+		bool ul_sacch_active;
+		bool dl_sacch_active;
 
-	/* Message buffer to store DL-SACCH repeation candidate */
-	struct msgb *rep_sacch;
+		/* Message buffer to store DL-SACCH repeation candidate */
+		struct msgb *dl_sacch_msg;
+	} rep_acch;
 
 	/* Cached early Immediate Assignment message: if the Immediate Assignment arrives before the channel is
 	 * confirmed active, then cache it here and send it once the channel is confirmed to be active. This is related
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index cbe43b4..d94e3bc 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1037,15 +1037,15 @@
 	 * possible candidates in order to have one ready in case the MS enables
 	 * SACCH repetition. */
 
-	if (lchan->rep_sacch) {
+	if (lchan->rep_acch.dl_sacch_msg) {
 		if (lchan->meas.l1_info.srr_sro == 0) {
 			/* Toss previous repetition candidate */
-			msgb_free(lchan->rep_sacch);
-			lchan->rep_sacch = NULL;
+			msgb_free(lchan->rep_acch.dl_sacch_msg);
+			lchan->rep_acch.dl_sacch_msg = NULL;
 		} else {
 			/* Use previous repetition candidate */
-			msg = lchan->rep_sacch;
-			lchan->rep_sacch = NULL;
+			msg = lchan->rep_acch.dl_sacch_msg;
+			lchan->rep_acch.dl_sacch_msg = NULL;
 			return msg;
 		}
 	}
@@ -1059,7 +1059,7 @@
 	/* Only LAPDm frames for SAPI 0 may become a repetition
 	 * candidate. */
 	if (sapi == 0)
-		lchan->rep_sacch = msgb_copy(msg, "rep_sacch");
+		lchan->rep_acch.dl_sacch_msg = msgb_copy(msg, "rep_sacch");
 
 	return msg;
 }
@@ -1143,20 +1143,20 @@
 			p = msgb_put(msg, GSM_MACBLOCK_LEN);
 			/* L1-header, if not set/modified by layer 1 */
 			p[0] = lchan->ms_power_ctrl.current;
-			if (lchan->repeated_ul_sacch_active)
+			if (lchan->rep_acch.ul_sacch_active)
 				p[0] |= 0x40; /* See also: 3GPP TS 44.004, section 7.1 */
 			p[1] = lchan->ta_ctrl.current;
 			le = &lchan->lapdm_ch.lapdm_acch;
 			if (lchan->rep_acch_cap.dl_sacch) {
 				/* Check if MS requests SACCH repetition and update state accordingly */
 				if (lchan->meas.l1_info.srr_sro) {
-					if (lchan->repeated_dl_sacch_active == false)
+					if (lchan->rep_acch.dl_sacch_active == false)
 						LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "DL-SACCH repetition: inactive => active\n");
-					lchan->repeated_dl_sacch_active = true;
+					lchan->rep_acch.dl_sacch_active = true;
 				} else {
-					if (lchan->repeated_dl_sacch_active == true)
+					if (lchan->rep_acch.dl_sacch_active == true)
 						LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "DL-SACCH repetition: active => inactive\n");
-					lchan->repeated_dl_sacch_active = false;
+					lchan->rep_acch.dl_sacch_active = false;
 				}
 				pp_msg = lapdm_phsap_dequeue_msg_sacch(lchan, le);
 			} else {
@@ -1166,7 +1166,7 @@
 			if (lchan->ts->trx->bts->dtxd)
 				dtxd_facch = true;
 			le = &lchan->lapdm_ch.lapdm_dcch;
-			if (lchan->repeated_dl_facch_active && lchan->rsl_cmode != RSL_CMOD_SPD_SIGN)
+			if (lchan->rep_acch.dl_facch_active && lchan->rsl_cmode != RSL_CMOD_SPD_SIGN)
 				pp_msg = lapdm_phsap_dequeue_msg_facch(lchan, le, fn);
 			else
 				pp_msg = lapdm_phsap_dequeue_msg(le);
@@ -1427,20 +1427,20 @@
 {
 	uint16_t upper = 0;
 	uint16_t lower = 0;
-	bool prev_repeated_ul_sacch_active = lchan->repeated_ul_sacch_active;
+	bool prev_repeated_ul_sacch_active = lchan->rep_acch.ul_sacch_active;
 
 	/* This is an optimization so that we exit as quickly as possible if
 	 * there are no uplink SACCH repetition capabilities present.
 	 * However If the repeated UL-SACCH capabilities vanish for whatever
 	 * reason, we must be sure that UL-SACCH repetition is disabled. */
 	if (!lchan->rep_acch_cap.ul_sacch) {
-		lchan->repeated_ul_sacch_active = false;
+		lchan->rep_acch.ul_sacch_active = false;
 		goto out;
 	}
 
 	/* Threshold disabled (repetition is always on) */
 	if (lchan->rep_acch_cap.rxqual == 0) {
-		lchan->repeated_ul_sacch_active = true;
+		lchan->rep_acch.ul_sacch_active = true;
 		goto out;
 	}
 
@@ -1459,14 +1459,14 @@
 
 	/* If upper/rxqual == 0, then repeated UL-SACCH is always on */
 	if (ber10k >= upper)
-		lchan->repeated_ul_sacch_active = true;
+		lchan->rep_acch.ul_sacch_active = true;
 	else if (ber10k <= lower)
-		lchan->repeated_ul_sacch_active = false;
+		lchan->rep_acch.ul_sacch_active = false;
 
 out:
-	if (lchan->repeated_ul_sacch_active == prev_repeated_ul_sacch_active)
+	if (lchan->rep_acch.ul_sacch_active == prev_repeated_ul_sacch_active)
 		return;
-	if (lchan->repeated_ul_sacch_active)
+	if (lchan->rep_acch.ul_sacch_active)
 		LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "UL-SACCH repetition: inactive => active\n");
 	else
 		LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "UL-SACCH repetition: active => inactive\n");
diff --git a/src/common/lchan.c b/src/common/lchan.c
index 9661010..423ecc1 100644
--- a/src/common/lchan.c
+++ b/src/common/lchan.c
@@ -296,8 +296,8 @@
 		msgb_free(lchan->tch.rep_facch[1].msg);
 		lchan->tch.rep_facch[0].msg = NULL;
 		lchan->tch.rep_facch[1].msg = NULL;
-		msgb_free(lchan->rep_sacch);
-		lchan->rep_sacch = NULL;
+		msgb_free(lchan->rep_acch.dl_sacch_msg);
+		lchan->rep_acch.dl_sacch_msg = NULL;
 		/* fall through */
 	default:
 		if (lchan->early_rr_ia) {
diff --git a/src/common/measurement.c b/src/common/measurement.c
index ec06131..52431c5 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -798,7 +798,7 @@
 	uint8_t upper;
 	uint8_t lower;
 	uint8_t rxqual;
-	bool prev_repeated_dl_facch_active = lchan->repeated_dl_facch_active;
+	bool prev_repeated_dl_facch_active = lchan->rep_acch.dl_facch_active;
 
 	/* This is an optimization so that we exit as quickly as possible if
 	 * there are no FACCH repetition capabilities present. However If the
@@ -806,13 +806,13 @@
 	 * sure that FACCH repetition is disabled. */
 	if (!lchan->rep_acch_cap.dl_facch_cmd
 	    && !lchan->rep_acch_cap.dl_facch_all) {
-		lchan->repeated_dl_facch_active = false;
+		lchan->rep_acch.dl_facch_active = false;
 		goto out;
 	}
 
 	/* Threshold disabled (always on) */
 	if (lchan->rep_acch_cap.rxqual == 0) {
-		lchan->repeated_dl_facch_active = true;
+		lchan->rep_acch.dl_facch_active = true;
 		goto out;
 	}
 
@@ -820,7 +820,7 @@
 	 * (repeated SACCH requested) then it makes sense to enable
 	 * FACCH repetition too. */
 	if (lchan->meas.l1_info.srr_sro) {
-		lchan->repeated_dl_facch_active = true;
+		lchan->rep_acch.dl_facch_active = true;
 		goto out;
 	}
 
@@ -852,14 +852,14 @@
 		rxqual = meas_res->rxqual_full;
 
 	if (rxqual >= upper)
-		lchan->repeated_dl_facch_active = true;
+		lchan->rep_acch.dl_facch_active = true;
 	else if (rxqual <= lower)
-		lchan->repeated_dl_facch_active = false;
+		lchan->rep_acch.dl_facch_active = false;
 
 out:
-	if (lchan->repeated_dl_facch_active == prev_repeated_dl_facch_active)
+	if (lchan->rep_acch.dl_facch_active == prev_repeated_dl_facch_active)
 		return;
-	if (lchan->repeated_dl_facch_active)
+	if (lchan->rep_acch.dl_facch_active)
 		LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "DL-FACCH repetition: inactive => active\n");
 	else
 		LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "DL-FACCH repetition: active => inactive\n");
diff --git a/src/common/vty.c b/src/common/vty.c
index b894ba8..124f7ef 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -1723,7 +1723,7 @@
 			VTY_NEWLINE);
 	else
 		cfg_out(vty, "no retransmission (disabled)%s", VTY_NEWLINE);
-	if (lchan->repeated_dl_facch_active)
+	if (lchan->rep_acch.dl_facch_active)
 		cfg_out(vty, "retransmission currently active%s", VTY_NEWLINE);
 	else
 		cfg_out(vty, "retransmission currently inactive%s",
@@ -1737,7 +1737,7 @@
 			VTY_NEWLINE);
 	else
 		cfg_out(vty, "no retransmission (disabled)%s", VTY_NEWLINE);
-	if (lchan->repeated_dl_sacch_active)
+	if (lchan->rep_acch.dl_sacch_active)
 		cfg_out(vty, "retransmission currently active%s", VTY_NEWLINE);
 	else
 		cfg_out(vty, "retransmission currently inactive%s",
@@ -1751,7 +1751,7 @@
 			VTY_NEWLINE);
 	else
 		cfg_out(vty, "no retransmission (disabled)%s", VTY_NEWLINE);
-	if (lchan->repeated_ul_sacch_active)
+	if (lchan->rep_acch.ul_sacch_active)
 		cfg_out(vty, "retransmission currently active%s", VTY_NEWLINE);
 	else
 		cfg_out(vty, "retransmission currently inactive%s",
diff --git a/src/osmo-bts-trx/sched_lchan_xcch.c b/src/osmo-bts-trx/sched_lchan_xcch.c
index e2baefd..e8f46c1 100644
--- a/src/osmo-bts-trx/sched_lchan_xcch.c
+++ b/src/osmo-bts-trx/sched_lchan_xcch.c
@@ -60,7 +60,7 @@
 	uint16_t ber10k;
 	int rc;
 	struct gsm_lchan *lchan = chan_state->lchan;
-	bool rep_sacch = L1SAP_IS_LINK_SACCH(trx_chan_desc[bi->chan].link_id) && lchan->repeated_ul_sacch_active;
+	bool rep_sacch = L1SAP_IS_LINK_SACCH(trx_chan_desc[bi->chan].link_id) && lchan->rep_acch.ul_sacch_active;
 
 	/* If handover RACH detection is turned on, treat this burst as an Access Burst.
 	 * Handle NOPE.ind as usually to ensure proper Uplink measurement reporting. */

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I2680c88f2a51b64f085a92233bc125338622babf
Gerrit-Change-Number: 25895
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
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/20211022/0f557708/attachment.htm>


More information about the gerrit-log mailing list