Change in osmo-bts[master]: l1sap: add logging and VTY introspection for ACCH repetition

laforge gerrit-no-reply at lists.osmocom.org
Mon Mar 1 19:47:56 UTC 2021


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

Change subject: l1sap: add logging and VTY introspection for ACCH repetition
......................................................................

l1sap: add logging and VTY introspection for ACCH repetition

At the moment osmo-bts is not looging much ACCH repetition related
information. This makes testing ACCH repetition difficult. Lets add some
debug output that informs the user when ACCH repetition is turned on or
off. Lets also add an ACCH repetition status display to the show lchan
VTY command.

Change-Id: I59d11fd03be3d29fb8a4279d9945b03006764c0e
Related: SYS#5114
---
M src/common/l1sap.c
M src/common/vty.c
2 files changed, 90 insertions(+), 10 deletions(-)

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



diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 1d80a84..0600658 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -960,6 +960,7 @@
 	uint8_t upper;
 	uint8_t lower;
 	uint8_t rxqual;
+	bool prev_repeated_dl_facch_active = lchan->repeated_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
@@ -968,13 +969,13 @@
 	if (!lchan->repeated_acch_capability.dl_facch_cmd
 	    && !lchan->repeated_acch_capability.dl_facch_all) {
 		lchan->repeated_dl_facch_active = false;
-		return;
+		goto out;
 	}
 
 	/* Threshold disabled (always on) */
 	if (lchan->repeated_acch_capability.rxqual == 0) {
 		lchan->repeated_dl_facch_active = true;
-		return;
+		goto out;
 	}
 
 	/* When the MS sets the SRR bit in the UL-SACCH L1 header
@@ -982,16 +983,16 @@
 	 * FACCH repetition too. */
 	if (lchan->meas.l1_info.srr_sro) {
 		lchan->repeated_dl_facch_active = true;
-		return;
+		goto out;
 	}
 
 	/* Parse MS measurement results */
 	if (l3_len <= sizeof(struct gsm48_meas_res *) + 2)
-		return;
+		goto out;
 	if (l3[0] != GSM48_PDISC_RR)
-		return;
+		goto out;
 	if (l3[1] != GSM48_MT_RR_MEAS_REP)
-		return;
+		goto out;
 	l3 += 2;
 	meas_res = (struct gsm48_meas_res *)l3;
 
@@ -1015,6 +1016,13 @@
 	else if (rxqual <= lower)
 		lchan->repeated_dl_facch_active = false;
 
+out:
+	if (lchan->repeated_dl_facch_active == prev_repeated_dl_facch_active)
+		return;
+	if (lchan->repeated_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");
 }
 
 /* Special dequeueing function with SACCH repetition (3GPP TS 44.006, section 11) */
@@ -1140,10 +1148,15 @@
 			le = &lchan->lapdm_ch.lapdm_acch;
 			if (lchan->repeated_acch_capability.dl_sacch) {
 				/* Check if MS requests SACCH repetition and update state accordingly */
-				if (lchan->meas.l1_info.srr_sro)
+				if (lchan->meas.l1_info.srr_sro) {
+					if (lchan->repeated_dl_sacch_active == false)
+						LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "DL-SACCH repetition: inactive => active\n");
 					lchan->repeated_dl_sacch_active = true;
-				else
+				} else {
+					if (lchan->repeated_dl_sacch_active == true)
+						LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "DL-SACCH repetition: active => inactive\n");
 					lchan->repeated_dl_sacch_active = false;
+				}
 				pp_msg = lapdm_phsap_dequeue_msg_sacch(lchan, le);
 			} else {
 				pp_msg = lapdm_phsap_dequeue_msg(le);
@@ -1413,6 +1426,7 @@
 {
 	uint16_t upper = 0;
 	uint16_t lower = 0;
+	bool prev_repeated_ul_sacch_active = lchan->repeated_ul_sacch_active;
 
 	/* This is an optimization so that we exit as quickly as possible if
 	 * there are no uplink SACCH repetition capabilities present.
@@ -1420,13 +1434,13 @@
 	 * reason, we must be sure that UL-SACCH repetition is disabled. */
 	if (!lchan->repeated_acch_capability.ul_sacch) {
 		lchan->repeated_ul_sacch_active = false;
-		return;
+		goto out;
 	}
 
 	/* Threshold disabled (repetition is always on) */
 	if (lchan->repeated_acch_capability.rxqual == 0) {
 		lchan->repeated_ul_sacch_active = true;
-		return;
+		goto out;
 	}
 
 	/* convert from RXQUAL value to ber10k value.
@@ -1447,6 +1461,14 @@
 		lchan->repeated_ul_sacch_active = true;
 	else if (ber10k <= lower)
 		lchan->repeated_ul_sacch_active = false;
+
+out:
+	if (lchan->repeated_ul_sacch_active == prev_repeated_ul_sacch_active)
+		return;
+	if (lchan->repeated_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");
 }
 
 /* DATA received from bts model */
diff --git a/src/common/vty.c b/src/common/vty.c
index bbd33f8..45ee32c 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -1564,6 +1564,63 @@
 	dump_dpc_params(vty, indent + 2, st->dpc_params);
 }
 
+static void lchan_acch_rep_state_dump(struct vty *vty, unsigned int indent,
+				      const struct gsm_lchan *lchan)
+{
+	cfg_out(vty, "ACCH repetition:%s", VTY_NEWLINE);
+	indent += 2;
+	if (lchan->repeated_acch_capability.rxqual)
+		cfg_out(vty, "Enable RXQUAL threshold: %u%s",
+			lchan->repeated_acch_capability.rxqual, VTY_NEWLINE);
+	else
+		cfg_out(vty, "Enable RXQUAL threshold: (none, alway on)%s",
+			VTY_NEWLINE);
+
+	cfg_out(vty, "DL-FACCH:%s", VTY_NEWLINE);
+	indent += 2;
+	if (lchan->repeated_acch_capability.dl_facch_all)
+		cfg_out(vty, "retramsit all LAPDM block types%s", VTY_NEWLINE);
+	else if (lchan->repeated_acch_capability.dl_facch_cmd)
+		cfg_out(vty, "retramsit only LAPDM command blocks%s",
+			VTY_NEWLINE);
+	else
+		cfg_out(vty, "no retransmission (disabled)%s", VTY_NEWLINE);
+	if (lchan->repeated_dl_facch_active)
+		cfg_out(vty, "retransmission currently active%s", VTY_NEWLINE);
+	else
+		cfg_out(vty, "retransmission currently inactive%s",
+			VTY_NEWLINE);
+	indent -= 2;
+
+	cfg_out(vty, "DL-SACCH:%s", VTY_NEWLINE);
+	indent += 2;
+	if (lchan->repeated_acch_capability.ul_sacch)
+		cfg_out(vty, "retramsit all SACCH blocks for SAPI=0%s",
+			VTY_NEWLINE);
+	else
+		cfg_out(vty, "no retransmission (disabled)%s", VTY_NEWLINE);
+	if (lchan->repeated_dl_sacch_active)
+		cfg_out(vty, "retransmission currently active%s", VTY_NEWLINE);
+	else
+		cfg_out(vty, "retransmission currently inactive%s",
+			VTY_NEWLINE);
+	indent -= 2;
+
+	cfg_out(vty, "UL-SACCH:%s", VTY_NEWLINE);
+	indent += 2;
+	if (lchan->repeated_acch_capability.dl_sacch)
+		cfg_out(vty, "retramsit all SACCH blocks for SAPI=0%s",
+			VTY_NEWLINE);
+	else
+		cfg_out(vty, "no retransmission (disabled)%s", VTY_NEWLINE);
+	if (lchan->repeated_ul_sacch_active)
+		cfg_out(vty, "retransmission currently active%s", VTY_NEWLINE);
+	else
+		cfg_out(vty, "retransmission currently inactive%s",
+			VTY_NEWLINE);
+	indent -= 2;
+}
+
 static void lchan_dump_full_vty(struct vty *vty, const struct gsm_lchan *lchan)
 {
 	struct in_addr ia;
@@ -1637,6 +1694,7 @@
 	/* BS/MS Power Control state and parameters */
 	lchan_bs_power_ctrl_state_dump(vty, 2, lchan);
 	lchan_ms_power_ctrl_state_dump(vty, 2, lchan);
+	lchan_acch_rep_state_dump(vty, 2, lchan);
 }
 
 static void lchan_dump_short_vty(struct vty *vty, const struct gsm_lchan *lchan)

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I59d11fd03be3d29fb8a4279d9945b03006764c0e
Gerrit-Change-Number: 22888
Gerrit-PatchSet: 7
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210301/d3c88d9e/attachment.htm>


More information about the gerrit-log mailing list