diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2016-07-17 00:32:07 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-07-25 15:22:06 +0000 |
commit | c9582ac2d7366233ab64f2868f17071c2ddadf32 (patch) | |
tree | 73ba2138ba780112e8dbf7525d9e013643142b8c /src | |
parent | c57304b65e0789167f992ffc9b4037c871569880 (diff) |
prepare dyn TS: split/replace conf_lchans_for_pchan()
Move the actual switch from static conf_lchans_for_pchan() into new 'public'
function conf_lchans_as_pchan(), adding an explicit pchan argument. This allows
passing a non-trivial pchan, for dynamic TS.
conf_lchans_as_pchan() now takes a pchan argument, so distinguish the naming
and drop the 'for_pchan' from conf_lchans_for_pchan(), which takes only a ts
argument.
Change-Id: I8e458501fff5503c243512aeb3469c12b1f2bbc4
Diffstat (limited to 'src')
-rw-r--r-- | src/common/oml.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/common/oml.c b/src/common/oml.c index 38df11ae..89708583 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -685,10 +685,8 @@ static int oml_rx_set_radio_attr(struct gsm_bts_trx *trx, struct msgb *msg) return bts_model_apply_oml(trx->bts, msg, tp_merged, NM_OC_RADIO_CARRIER, trx); } -static int conf_lchans_for_pchan(struct gsm_bts_trx_ts *ts) +static int conf_lchans(struct gsm_bts_trx_ts *ts) { - struct gsm_lchan *lchan; - unsigned int i; enum gsm_phys_chan_config pchan = ts->pchan; /* RSL_MT_IPAC_PDCH_ACT style dyn PDCH */ @@ -696,6 +694,15 @@ static int conf_lchans_for_pchan(struct gsm_bts_trx_ts *ts) pchan = ts->flags & TS_F_PDCH_ACTIVE? GSM_PCHAN_PDCH : GSM_PCHAN_TCH_F; + return conf_lchans_as_pchan(ts, pchan); +} + +int conf_lchans_as_pchan(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config pchan) +{ + struct gsm_lchan *lchan; + unsigned int i; + switch (pchan) { case GSM_PCHAN_CCCH_SDCCH4_CBCH: /* fallthrough */ @@ -797,7 +804,7 @@ static int oml_rx_set_chan_attr(struct gsm_bts_trx_ts *ts, struct msgb *msg) if (TLVP_PRESENT(&tp, NM_ATT_CHAN_COMB)) { uint8_t comb = *TLVP_VAL(&tp, NM_ATT_CHAN_COMB); ts->pchan = abis_nm_pchan4chcomb(comb); - rc = conf_lchans_for_pchan(ts); + rc = conf_lchans(ts); if (rc < 0) { talloc_free(tp_merged); /* Send NACK */ |