aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/gsm_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-bsc/gsm_data.c')
-rw-r--r--src/osmo-bsc/gsm_data.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index ac965e222..12ab66e93 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -1329,13 +1329,10 @@ void gsm_bts_all_ts_dispatch(struct gsm_bts *bts, uint32_t ts_ev, void *data)
gsm_trx_all_ts_dispatch(trx, ts_ev, data);
}
-void gsm48_lchan2chan_desc(struct gsm48_chan_desc *cd,
- const struct gsm_lchan *lchan)
+static void _chan_desc_fill_tail(struct gsm48_chan_desc *cd, const struct gsm_lchan *lchan)
{
- uint16_t arfcn = lchan->ts->trx->arfcn & 0x3ff;
-
- cd->chan_nr = gsm_lchan2chan_nr(lchan);
if (!lchan->ts->hopping.enabled) {
+ uint16_t arfcn = lchan->ts->trx->arfcn & 0x3ff;
cd->h0.tsc = gsm_ts_tsc(lchan->ts);
cd->h0.h = 0;
cd->h0.arfcn_high = arfcn >> 8;
@@ -1349,6 +1346,23 @@ void gsm48_lchan2chan_desc(struct gsm48_chan_desc *cd,
}
}
+void gsm48_lchan2chan_desc(struct gsm48_chan_desc *cd,
+ const struct gsm_lchan *lchan)
+{
+ cd->chan_nr = gsm_lchan2chan_nr(lchan);
+ _chan_desc_fill_tail(cd, lchan);
+}
+
+/* like gsm48_lchan2chan_desc() above, but use ts->pchan_from_config to
+ * return a channel description based on what is configured, rather than
+ * what the current state of the pchan type is */
+void gsm48_lchan2chan_desc_as_configured(struct gsm48_chan_desc *cd,
+ const struct gsm_lchan *lchan)
+{
+ cd->chan_nr = gsm_pchan2chan_nr(lchan->ts->pchan_from_config, lchan->ts->nr, lchan->nr);
+ _chan_desc_fill_tail(cd, lchan);
+}
+
bool nm_is_running(const struct gsm_nm_state *s) {
return (s->operational == NM_OPSTATE_ENABLED) && (
(s->availability == NM_AVSTATE_OK) ||