[PATCH] osmo-bts[master]: prepare dyn TS: split/replace conf_lchans_for_pchan()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Jul 25 12:16:55 UTC 2016


Review at  https://gerrit.osmocom.org/576

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
---
M include/osmo-bts/gsm_data.h
M src/common/oml.c
2 files changed, 13 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/76/576/1

diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 7a48667..c75f828 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -127,6 +127,8 @@
 #include "openbsc/gsm_data_shared.h"
 
 void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state);
+int conf_lchans_as_pchan(struct gsm_bts_trx_ts *ts,
+			 enum gsm_phys_chan_config pchan);
 
 /* cipher code */
 #define CIPHER_A5(x) (1 << (x-1))
diff --git a/src/common/oml.c b/src/common/oml.c
index 38df11a..8970858 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -685,16 +685,23 @@
 	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 */
 	if (pchan == GSM_PCHAN_TCH_F_PDCH)
 		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:
@@ -797,7 +804,7 @@
 	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 */

-- 
To view, visit https://gerrit.osmocom.org/576
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e458501fff5503c243512aeb3469c12b1f2bbc4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list