Change in osmo-bts[master]: WIP: l1sap: add repeated uplink SACCH

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

dexter gerrit-no-reply at lists.osmocom.org
Mon Nov 16 21:39:29 UTC 2020


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/21185 )


Change subject: WIP: l1sap: add repeated uplink SACCH
......................................................................

WIP: l1sap: add repeated uplink SACCH

3GPP TS 44.006, section 11 describes a method how the uplink
SACCH transmission can be repeated to increase transmission
reliability.

Change-Id: I7e4cc33cc010866e41e3b594351a7f7bf93e08ac
Related: OS#4795, SYS#5114
---
M include/osmo-bts/gsm_data.h
M include/osmo-bts/scheduler.h
M src/common/l1sap.c
M src/osmo-bts-trx/sched_lchan_xcch.c
4 files changed, 55 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/85/21185/1

diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index ff6878d..4e925af 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -310,6 +310,7 @@
 	struct osmo_ecu_state *ecu_state;
 
 	struct abis_rsl_osmo_rep_acch_cap repeated_acch_capability;
+	bool repeated_ul_sacch_active;
 };
 
 static inline uint8_t lchan_get_ta(const struct gsm_lchan *lchan)
diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index 6bb0b9b..6f05756 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -87,6 +87,7 @@
 	ubit_t			*dl_bursts;	/* burst buffer for TX */
 	enum trx_burst_type	dl_burst_type;  /* GMSK or 8PSK burst type */
 	sbit_t			*ul_bursts;	/* burst buffer for RX */
+	sbit_t			*ul_bursts_prev;/* previous burst buffer for RX (repeated SACCH) */
 	uint32_t		ul_first_fn;	/* fn of first burst */
 	uint8_t			ul_mask;	/* mask of received bursts */
 
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 142a3c8..f63aff9 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1080,6 +1080,8 @@
 			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_acch_capability.ul_sacch && lchan->repeated_ul_sacch_active)
+				p[0] |= 0x40; /* See also: 3GPP TS 44.004, section 7.1 */
 			p[1] = lchan->rqd_ta;
 			le = &lchan->lapdm_ch.lapdm_acch;
 			if (lchan->repeated_acch_capability.dl_sacch)
diff --git a/src/osmo-bts-trx/sched_lchan_xcch.c b/src/osmo-bts-trx/sched_lchan_xcch.c
index b96bc0b..2e4993e 100644
--- a/src/osmo-bts-trx/sched_lchan_xcch.c
+++ b/src/osmo-bts-trx/sched_lchan_xcch.c
@@ -34,6 +34,24 @@
 
 #include <sched_utils.h>
 
+/* Add two arrays of sbits */
+static void add_sbits(sbit_t *current, const sbit_t *previous)
+{
+	unsigned int i;
+	int result;
+	for (i = 0; i < 464; i++) {
+		result = *current + *previous;
+		if (result > 127)
+			result = 127;
+		else if (result < -127)
+			result = -127;
+		*current = (sbit_t) result;
+
+		current++;
+		previous++;
+	}
+}
+
 /*! \brief a single (SDCCH/SACCH) burst was received by the PHY, process it */
 int rx_data_fn(struct l1sched_trx *l1t, enum trx_chan_type chan,
 	       uint8_t bid, const struct trx_ul_burst_ind *bi)
@@ -49,6 +67,11 @@
 	int n_bits_total = 0;
 	uint16_t ber10k;
 	int rc;
+	struct gsm_lchan *lchan = chan_state->lchan;
+	bool is_sacch = false;
+
+	if (chan == TRXC_SACCHTF || chan == TRXC_SACCHTH_0 || chan ==TRXC_SACCHTH_1)
+		is_sacch = true;
 
 	/* 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. */
@@ -65,6 +88,14 @@
 			return -ENOMEM;
 	}
 
+	/* UL-SACCH requires additional memory to keep a copy of each previous
+	 * burst set. */
+	if (is_sacch && !chan_state->ul_bursts_prev) {
+		chan_state->ul_bursts_prev = talloc_zero_size(tall_bts_ctx, 464);
+		if (!*chan_state->ul_bursts_prev)
+			return -ENOMEM;
+	}
+
 	/* clear burst & store frame number of first burst */
 	if (bid == 0) {
 		memset(*bursts_p, 0, 464);
@@ -115,9 +146,29 @@
 			"Received bad data (%u/%u)\n",
 			bi->fn % l1ts->mf_period, l1ts->mf_period);
 		l2_len = 0;
+
+		/* When SACCH Repetition is active, we may try to decode the
+		 * current SACCH block by including the information from the
+		 * information from the previous SACCH block. See also:
+		 * 3GPP TS 44.006, section 11.2 */
+		if (is_sacch && lchan->repeated_ul_sacch_active) {
+			add_sbits(*bursts_p, chan_state->ul_bursts_prev);
+			rc = gsm0503_xcch_decode(l2, *bursts_p, &n_errors, &n_bits_total);
+			if (rc) {
+				LOGL1S(DL1P, LOGL_NOTICE, l1t, bi->tn, chan, bi->fn,
+				       "Combining current SACCH block with previous SACCH block also yields bad data (%u/%u)\n",
+				       bi->fn % l1ts->mf_period, l1ts->mf_period);
+				l2_len = 0;
+			} else
+				l2_len = GSM_MACBLOCK_LEN;
+		}
 	} else
 		l2_len = GSM_MACBLOCK_LEN;
 
+	/* Keep a copy to ease decoding in the next repetition pass */
+	if (is_sacch && lchan->repeated_ul_sacch_active)
+		memcpy(chan_state->ul_bursts_prev, *bursts_p, 464);
+
 	ber10k = compute_ber10k(n_bits_total, n_errors);
 	return _sched_compose_ph_data_ind(l1t, bi->tn, *first_fn,
 					  chan, l2, l2_len,

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I7e4cc33cc010866e41e3b594351a7f7bf93e08ac
Gerrit-Change-Number: 21185
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201116/534f8427/attachment.htm>


More information about the gerrit-log mailing list