Change in osmo-bts[master]: l1sap: add repeated downlink 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/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Dec 1 12:01:30 UTC 2020


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

Change subject: l1sap: add repeated downlink SACCH
......................................................................

l1sap: add repeated downlink SACCH

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

Change-Id: I00806f936b15fbaf6a4e7bbd61f3bec262cdbb28
Related: OS#4794, SYS#5114
---
M include/osmo-bts/gsm_data.h
M src/common/l1sap.c
M src/common/rsl.c
3 files changed, 49 insertions(+), 3 deletions(-)

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



diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 47a6db8..b5b616e 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -326,6 +326,9 @@
 
 	struct abis_rsl_osmo_rep_acch_cap repeated_acch_capability;
 	bool repeated_dl_facch_active;
+
+	/* Message buffer to store DL-SACCH repeation candidate */
+	struct msgb *rep_sacch;
 };
 
 static inline uint8_t lchan_get_ta(const struct gsm_lchan *lchan)
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 3c45b62..05adbb1 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1014,6 +1014,44 @@
 		lchan->repeated_dl_facch_active = false;
 }
 
+/* Special dequeueing function with SACCH repetition (3GPP TS 44.006, section 11) */
+static inline struct msgb *lapdm_phsap_dequeue_msg_sacch(struct gsm_lchan *lchan, struct lapdm_entity *le)
+{
+	struct osmo_phsap_prim pp;
+	struct msgb *msg;
+	uint8_t sapi;
+
+	/* Note: When the MS disables SACCH repetition, we still must collect
+	 * possible candidates in order to have one ready in case the MS enables
+	 * SACCH repetition. */
+
+	if (lchan->rep_sacch) {
+		if (((lchan->meas.l1_info[0] >> 1) & 1) == 0) {
+			/* Toss previous repetition candidate */
+			msgb_free(lchan->rep_sacch);
+			lchan->rep_sacch = NULL;
+		} else {
+			/* Use previous repetition candidate */
+			msg = lchan->rep_sacch;
+			lchan->rep_sacch = NULL;
+			return msg;
+		}
+	}
+
+	/* Fetch new repetition candidate from queue */
+	if (lapdm_phsap_dequeue_prim(le, &pp) < 0)
+		return NULL;
+	msg = pp.oph.msg;
+	sapi = (msg->data[0] >> 2) & 0x07;
+
+	/* Only LAPDm frames for SAPI may become a repetition
+	 * candidate. */
+	if (sapi == 0)
+		lchan->rep_sacch = msgb_copy(msg, "rep_sacch");
+
+	return msg;
+}
+
 /* PH-RTS-IND prim received from bts model */
 static int l1sap_ph_rts_ind(struct gsm_bts_trx *trx,
 	struct osmo_phsap_prim *l1sap, struct ph_data_param *rts_ind)
@@ -1095,7 +1133,10 @@
 			p[0] = lchan->ms_power_ctrl.current;
 			p[1] = lchan->rqd_ta;
 			le = &lchan->lapdm_ch.lapdm_acch;
-			pp_msg = lapdm_phsap_dequeue_msg(le);
+			if (lchan->repeated_acch_capability.dl_sacch)
+				pp_msg = lapdm_phsap_dequeue_msg_sacch(lchan, le);
+			else
+				pp_msg = lapdm_phsap_dequeue_msg(le);
 		} else {
 			if (lchan->ts->trx->bts->dtxd)
 				dtxd_facch = true;
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 14a0dcc..8760c24 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -823,12 +823,14 @@
 	 */
 	lapdm_channel_exit(&lchan->lapdm_ch);
 
-	/* Also ensure that there are no leftovers from repeated FACCH
-	 * that might cause memory leakage. */
+	/* Also ensure that there are no leftovers from repeated FACCH or
+	 * repeated SACCH that might cause memory leakage. */
 	msgb_free(lchan->tch.rep_facch[0].msg);
 	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;
 
 	return tx_rf_rel_ack(lchan, chan_nr);
 }

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I00806f936b15fbaf6a4e7bbd61f3bec262cdbb28
Gerrit-Change-Number: 21105
Gerrit-PatchSet: 7
Gerrit-Owner: dexter <pmaier 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/20201201/b464fd2c/attachment.htm>


More information about the gerrit-log mailing list