diff options
author | Andreas Eversberg <andreas@eversberg.eu> | 2023-10-24 17:49:01 +0200 |
---|---|---|
committer | jolly <andreas@eversberg.eu> | 2023-10-27 10:35:21 +0000 |
commit | d88cc624ed56deab0fe4c0fe837ae4f2f0a90382 (patch) | |
tree | 326d24b18486aac21dbe41d921ff4481d5ae9ae0 | |
parent | bd777b027657a386fc72eb4a9d1a08a73a20603c (diff) |
ASCI: Add control of uplink access to osmo-bts-trx
An MPH-INFO message is used to turn detection of uplink access bursts on
or off. This is required for voice group/broadcast channels.
Related: OS#4851
Depends: libosmocore.git Ibd6a1d468a70126a8f67e944fcb916969cc3c36b
Change-Id: I9045437d52984b7abe00fbc815d7f83c62c0fb5a
-rw-r--r-- | include/osmo-bts/scheduler.h | 3 | ||||
-rw-r--r-- | src/common/scheduler.c | 27 | ||||
-rw-r--r-- | src/osmo-bts-trx/l1_if.c | 21 |
3 files changed, 47 insertions, 4 deletions
diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h index 94333ea4..b9c73508 100644 --- a/include/osmo-bts/scheduler.h +++ b/include/osmo-bts/scheduler.h @@ -186,6 +186,9 @@ int trx_sched_set_pchan(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config pch /*! \brief set all matching logical channels active/inactive */ int trx_sched_set_lchan(struct gsm_lchan *lchan, uint8_t chan_nr, uint8_t link_id, bool active); +/*! \brief set uplink access on given logical channels active/inactive */ +int trx_sched_set_ul_access(struct gsm_lchan *lchan, uint8_t chan_nr, bool active); + /*! \brief set all logical channels of BCCH/CCCH active/inactive */ int trx_sched_set_bcch_ccch(struct gsm_lchan *lchan, bool active); diff --git a/src/common/scheduler.c b/src/common/scheduler.c index e68d01f0..0e62b652 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -1144,6 +1144,33 @@ int trx_sched_set_lchan(struct gsm_lchan *lchan, uint8_t chan_nr, uint8_t link_i return found ? 0 : -EINVAL; } +int trx_sched_set_ul_access(struct gsm_lchan *lchan, uint8_t chan_nr, bool active) +{ + struct l1sched_ts *l1ts = lchan->ts->priv; + uint8_t tn = L1SAP_CHAN2TS(chan_nr); + uint8_t ss = l1sap_chan2ss(chan_nr); + int i; + + if (!l1ts) { + LOGPLCHAN(lchan, DL1C, LOGL_ERROR, "%s UL access on lchan with uninitialized scheduler structure.\n", + (active) ? "Activating" : "Deactivating"); + return -EINVAL; + } + + /* look for all matching chan_nr */ + for (i = 0; i < _TRX_CHAN_MAX; i++) { + if (trx_chan_desc[i].chan_nr == (chan_nr & RSL_CHAN_NR_MASK)) { + struct l1sched_chan_state *l1cs = &l1ts->chan_state[i]; + + l1cs->ho_rach_detect = active; + } + } + + _sched_act_rach_det(lchan->ts->trx, tn, ss, active); + + return 0; +} + int trx_sched_set_bcch_ccch(struct gsm_lchan *lchan, bool active) { struct l1sched_ts *l1ts = lchan->ts->priv; diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index ab660948..54f5bd24 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -417,10 +417,18 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) /* put data into scheduler's queue */ return trx_sched_tch_req(trx, l1sap); case OSMO_PRIM(PRIM_MPH_INFO, PRIM_OP_REQUEST): - if (l1sap->u.info.type == PRIM_INFO_ACT_CIPH) + switch (l1sap->u.info.type) { + case PRIM_INFO_ACT_CIPH: chan_nr = l1sap->u.info.u.ciph_req.chan_nr; - else /* u.act_req used by PRIM_INFO_{ACTIVATE,DEACTIVATE,MODIFY} */ + break; + case PRIM_INFO_ACT_UL_ACC: + case PRIM_INFO_DEACT_UL_ACC: + chan_nr = l1sap->u.info.u.ulacc_req.chan_nr; + break; + default: + /* u.act_req used by PRIM_INFO_{ACTIVATE,DEACTIVATE,MODIFY} */ chan_nr = l1sap->u.info.u.act_req.chan_nr; + } lchan = get_lchan_by_chan_nr(trx, chan_nr); if (OSMO_UNLIKELY(lchan == NULL)) { LOGP(DL1C, LOGL_ERROR, @@ -437,6 +445,12 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) if (l1sap->u.info.u.ciph_req.downlink) l1if_set_ciphering(lchan, chan_nr, 1); break; + case PRIM_INFO_ACT_UL_ACC: + trx_sched_set_ul_access(lchan, chan_nr, true); + break; + case PRIM_INFO_DEACT_UL_ACC: + trx_sched_set_ul_access(lchan, chan_nr, false); + break; case PRIM_INFO_ACTIVATE: if ((chan_nr & 0xE0) == 0x80) { LOGPLCHAN(lchan, DL1C, LOGL_ERROR, "Cannot activate" @@ -458,8 +472,7 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) lchan->tch.amr_mr.mode[2].mode, lchan->tch.amr_mr.mode[3].mode, amr_get_initial_mode(lchan), - (lchan->ho.active == HANDOVER_ENABLED) || - rsl_chan_rt_is_asci(lchan->rsl_chan_rt)); + (lchan->ho.active == HANDOVER_ENABLED)); /* set lchan active */ lchan_set_state(lchan, LCHAN_S_ACTIVE); /* set initial ciphering */ |