aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-11-11 17:44:57 +0100
committerHarald Welte <laforge@gnumonks.org>2016-12-01 15:20:42 +0000
commit36153239bfd0b633c4d259a9de0a759f41197a2b (patch)
treebcd43bc4395df9b7d9d3da98235f23d43c3ab79b /src/osmo-bts-trx
parentaabeb2eae40bd8d5fc713fcf39e96ff14ad991b2 (diff)
Remove duplicated code
Remove lchan deactivation related code duplication to facilitate future use for dynamic CCCH re-activation. Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9
Diffstat (limited to 'src/osmo-bts-trx')
-rw-r--r--src/osmo-bts-trx/l1_if.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 202a05e1..3d5f52e9 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -144,6 +144,23 @@ int check_transceiver_availability(struct gsm_bts *bts, int avail)
return 0;
}
+int bts_model_lchan_deactivate(struct gsm_lchan *lchan)
+{
+ struct phy_instance *pinst = trx_phy_instance(lchan->ts->trx);
+ struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
+
+ /* set lchan inactive */
+ lchan_set_state(lchan, LCHAN_S_NONE);
+
+ return trx_sched_set_lchan(&l1h->l1s, lchan->nr, LID_DEDIC, 0);
+}
+
+int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan)
+{
+ struct phy_instance *pinst = trx_phy_instance(lchan->ts->trx);
+ struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
+ return trx_sched_set_lchan(&l1h->l1s, lchan->nr, LID_SACCH, 0);
+}
/*
* transceiver provisioning
@@ -646,16 +663,13 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap)
break;
}
/* deactivate associated channel */
- trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_SACCH, 0);
+ bts_model_lchan_deactivate_sacch(lchan);
if (!l1sap->u.info.u.act_req.sacch_only) {
- /* set lchan inactive */
- lchan_set_state(lchan, LCHAN_S_NONE);
/* deactivate dedicated channel */
- trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_DEDIC, 0);
+ lchan_deactivate(lchan);
/* confirm only on dedicated channel */
mph_info_chan_confirm(l1h, chan_nr,
PRIM_INFO_DEACTIVATE, 0);
- lchan->ciph_state = 0; /* FIXME: do this in common/\*.c */
}
break;
default: