Change in osmo-bts[master]: [VAMOS] osmo-bts-trx: schedule bursts on 'shadow' timeslots

fixeria gerrit-no-reply at lists.osmocom.org
Sun Jun 6 01:09:27 UTC 2021


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

Change subject: [VAMOS] osmo-bts-trx: schedule bursts on 'shadow' timeslots
......................................................................

[VAMOS] osmo-bts-trx: schedule bursts on 'shadow' timeslots

Change-Id: I3e0bdf8c03273f66991aa1764029ab1dd3528d7e
Related: SYS#4895, OS#4941
---
M include/osmo-bts/scheduler.h
M src/common/scheduler.c
M src/osmo-bts-trx/main.c
M src/osmo-bts-trx/scheduler_trx.c
M src/osmo-bts-trx/trx_if.c
5 files changed, 91 insertions(+), 20 deletions(-)

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



diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index 9093229..86bfdf9 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -71,6 +71,7 @@
 enum trx_mod_type {
 	TRX_MOD_T_GMSK,
 	TRX_MOD_T_8PSK,
+	TRX_MOD_T_AQPSK,
 };
 
 /* A set of measurements belonging to one Uplink burst */
@@ -231,6 +232,7 @@
 #define TRX_BI_F_CI_CB		(1 << 3)
 #define TRX_BI_F_TRX_NUM	(1 << 4)
 #define TRX_BI_F_BATCH_IND	(1 << 5)
+#define TRX_BI_F_SHADOW_IND	(1 << 6)
 
 /*! UL burst indication with the corresponding meta info */
 struct trx_ul_burst_ind {
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index eb0aecd..3ab94a2 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -606,32 +606,49 @@
  * init / exit
  */
 
+static void trx_sched_init_ts(struct gsm_bts_trx_ts *ts,
+			      const unsigned int rate_ctr_idx)
+{
+	struct l1sched_ts *l1ts;
+	unsigned int i;
+
+	l1ts = talloc_zero(ts->trx, struct l1sched_ts);
+	OSMO_ASSERT(l1ts != NULL);
+
+	/* Link both structures */
+	ts->priv = l1ts;
+	l1ts->ts = ts;
+
+	l1ts->ctrs = rate_ctr_group_alloc(ts->trx,
+					  &l1sched_ts_ctrg_desc,
+					  rate_ctr_idx);
+	INIT_LLIST_HEAD(&l1ts->dl_prims);
+
+	for (i = 0; i < ARRAY_SIZE(l1ts->chan_state); i++) {
+		struct l1sched_chan_state *chan_state;
+		chan_state = &l1ts->chan_state[i];
+		chan_state->active = false;
+	}
+}
+
 void trx_sched_init(struct gsm_bts_trx *trx)
 {
-	unsigned int tn, i;
+	unsigned int tn;
 
 	OSMO_ASSERT(trx != NULL);
 
 	LOGPTRX(trx, DL1C, LOGL_DEBUG, "Init scheduler structures\n");
 
+	/* Allocate shadow timeslots */
+	gsm_bts_trx_init_shadow_ts(trx);
+
 	for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) {
-		struct l1sched_ts *l1ts;
+		unsigned int rate_ctr_idx = trx->nr * 100 + tn;
+		struct gsm_bts_trx_ts *ts = &trx->ts[tn];
 
-		l1ts = talloc_zero(trx, struct l1sched_ts);
-		OSMO_ASSERT(l1ts != NULL);
-
-		trx->ts[tn].priv = l1ts;
-		l1ts->ts = &trx->ts[tn];
-
-		l1ts->mf_index = 0;
-		l1ts->ctrs = rate_ctr_group_alloc(trx, &l1sched_ts_ctrg_desc, (trx->nr + 1) * 10 + tn);
-		INIT_LLIST_HEAD(&l1ts->dl_prims);
-
-		for (i = 0; i < ARRAY_SIZE(l1ts->chan_state); i++) {
-			struct l1sched_chan_state *chan_state;
-			chan_state = &l1ts->chan_state[i];
-			chan_state->active = false;
-		}
+		/* Init primary and shadow timeslots */
+		trx_sched_init_ts(ts, rate_ctr_idx);
+		trx_sched_init_ts(ts->vamos.peer, rate_ctr_idx + 10);
 	}
 }
 
@@ -999,6 +1016,12 @@
 	l1ts->mf_index = i;
 	l1ts->mf_period = trx_sched_multiframes[i].period;
 	l1ts->mf_frames = trx_sched_multiframes[i].frames;
+	if (ts->vamos.peer != NULL) {
+		l1ts = ts->vamos.peer->priv;
+		l1ts->mf_index = i;
+		l1ts->mf_period = trx_sched_multiframes[i].period;
+		l1ts->mf_frames = trx_sched_multiframes[i].frames;
+	}
 	LOGP(DL1C, LOGL_NOTICE, "%s Configured multiframe with '%s'\n",
 	     gsm_ts_name(ts), trx_sched_multiframes[i].name);
 	return 0;
@@ -1423,6 +1446,10 @@
 	uint8_t offset, period;
 	trx_sched_ul_func *func;
 
+	/* VAMOS: redirect to the shadow timeslot */
+	if (bi->flags & TRX_BI_F_SHADOW_IND)
+		l1ts = l1ts->ts->vamos.peer->priv;
+
 	if (!l1ts->mf_index)
 		return -EINVAL;
 
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index 6ec8dfc..7134939 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -146,6 +146,7 @@
 	osmo_bts_set_feature(bts->features, BTS_FEAT_HOPPING);
 	osmo_bts_set_feature(bts->features, BTS_FEAT_ACCH_REP);
 	osmo_bts_set_feature(bts->features, BTS_FEAT_MULTI_TSC);
+	osmo_bts_set_feature(bts->features, BTS_FEAT_VAMOS);
 
 	bts_internal_flag_set(bts, BTS_INTERNAL_FLAG_MEAS_PAYLOAD_COMB);
 
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 4a23f11..1a4f03f 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -149,6 +149,40 @@
 	}
 }
 
+/* schedule one frame for a shadow timeslot, merge bursts */
+static void _sched_dl_shadow_burst(const struct gsm_bts_trx_ts *ts,
+				   struct trx_dl_burst_req *br)
+{
+	struct l1sched_ts *l1ts = ts->priv;
+
+	/* For the shadow timeslots, physical channel type can be either
+	 * GSM_PCHAN_TCH_{F,H} or GSM_PCHAN_NONE.  Even if the primary
+	 * timeslot is a dynamic timeslot, it's always a concrete value. */
+	if (ts->pchan == GSM_PCHAN_NONE)
+		return;
+
+	struct trx_dl_burst_req sbr = {
+		.trx_num = br->trx_num,
+		.fn = br->fn,
+		.tn = br->tn,
+	};
+
+	_sched_dl_burst(l1ts, &sbr);
+
+	if (br->burst_len != 0 && sbr.burst_len != 0) { /* Both present */
+		memcpy(br->burst + GSM_BURST_LEN, sbr.burst, GSM_BURST_LEN);
+		br->burst_len = 2 * GSM_BURST_LEN;
+		br->mod = TRX_MOD_T_AQPSK;
+		/* FIXME: SCPIR is hard-coded to 0 */
+	} else if (br->burst_len == 0) {
+		/* No primary burst, send shadow burst alone */
+		memcpy(br, &sbr, sizeof(sbr));
+	} else if (sbr.burst_len == 0) {
+		/* No shadow burst, send primary burst alone */
+		return;
+	}
+}
+
 /* schedule all frames of all TRX for given FN */
 static void bts_sched_fn(struct gsm_bts *bts, const uint32_t fn)
 {
@@ -193,8 +227,11 @@
 				br = &pinst->u.osmotrx.br[tn];
 			}
 
-			/* get burst for FN */
+			/* get burst for the primary timeslot */
 			_sched_dl_burst(l1ts, br);
+
+			/* get burst for the shadow timeslot */
+			_sched_dl_shadow_burst(ts->vamos.peer, br);
 		}
 	}
 
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index afd630f..968c335 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -755,6 +755,7 @@
 static const uint8_t trx_data_mod_val[] = {
 	[TRX_MOD_T_GMSK]	= 0x00, /* .00xx... */
 	[TRX_MOD_T_8PSK]	= 0x20, /* .010x... */
+	[TRX_MOD_T_AQPSK]	= 0x60, /* .11xx... */
 };
 
 /* Header dissector for TRXDv0 (and part of TRXDv1) */
@@ -863,9 +864,12 @@
 	/* TDMA timeslot number (other bits are RFU) */
 	bi->tn = buf[0] & 0x07;
 
-	/* TRX (RF channel) number and BATCH.ind */
-	if (buf[1] & (1 << 7))
+	if (buf[1] & (1 << 7)) /* BATCH.ind */
 		bi->flags |= TRX_BI_F_BATCH_IND;
+	if (buf[1] & (1 << 6)) /* VAMOS.ind */
+		bi->flags |= TRX_BI_F_SHADOW_IND;
+
+	/* TRX (RF channel) number */
 	bi->trx_num = buf[1] & 0x3f;
 	bi->flags |= TRX_BI_F_TRX_NUM;
 

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I3e0bdf8c03273f66991aa1764029ab1dd3528d7e
Gerrit-Change-Number: 24440
Gerrit-PatchSet: 5
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/20210606/7cf72e8d/attachment.htm>


More information about the gerrit-log mailing list