aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-05-27 21:51:44 +0200
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-06-05 00:34:36 +0200
commit6d20a49806d50a2ef2fbf72b9c32cd3a216cd604 (patch)
treee94986731d7e0ee626df9e68e83ff911331924f8 /src/osmo-bts-trx
parent0686ae612834c329546c2f65d04283685ec790ad (diff)
[VAMOS] osmo-bts-trx: schedule bursts on 'shadow' timeslots
Diffstat (limited to 'src/osmo-bts-trx')
-rw-r--r--src/osmo-bts-trx/main.c1
-rw-r--r--src/osmo-bts-trx/scheduler_trx.c39
-rw-r--r--src/osmo-bts-trx/trx_if.c8
3 files changed, 45 insertions, 3 deletions
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index 6ec8dfc9..71349397 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -146,6 +146,7 @@ int bts_model_init(struct gsm_bts *bts)
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 4a23f117..1a4f03fa 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -149,6 +149,40 @@ static void bts_sched_flush_buffers(struct gsm_bts *bts)
}
}
+/* 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 @@ static void bts_sched_fn(struct gsm_bts *bts, const uint32_t fn)
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 afd630f0..968c335e 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_rx_hdr_len[] = {
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 @@ static int trx_data_handle_pdu_v2(struct phy_instance *phy_inst,
/* 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;