aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-10-09 00:59:16 +0700
committerlaforge <laforge@osmocom.org>2020-10-08 20:32:40 +0000
commit912b4df76ca7352c0da3a92770a6d7f335f4b4e8 (patch)
tree3b68fa5149b1b7df649497a8efb6fc25ff49eb36
parentc0b544f103e96e08416848ea9c243c64490a6784 (diff)
pcu_sock: fix pcu_sock_close(): deactivate dynamic timeslots too
-rw-r--r--src/common/pcu_sock.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index d54e385a..6040de5a 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -882,7 +882,6 @@ static void pcu_sock_close(struct pcu_sock_state *state)
struct osmo_fd *bfd = &state->conn_bfd;
struct gsm_bts *bts;
struct gsm_bts_trx *trx;
- struct gsm_bts_trx_ts *ts;
unsigned int tn;
/* FIXME: allow multiple BTS */
@@ -913,13 +912,15 @@ static void pcu_sock_close(struct pcu_sock_state *state)
/* Deactivate all active PDCH timeslots */
llist_for_each_entry(trx, &bts->trx_list, list) {
for (tn = 0; tn < 8; tn++) {
- ts = &trx->ts[tn];
- if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED
- && ts->pchan == GSM_PCHAN_PDCH) {
- ts->lchan[0].rel_act_kind = LCHAN_REL_ACT_PCU;
- l1sap_chan_rel(trx,
- gsm_lchan2chan_nr(&ts->lchan[0]));
- }
+ struct gsm_bts_trx_ts *ts = &trx->ts[tn];
+
+ if (ts->mo.nm_state.operational != NM_OPSTATE_ENABLED)
+ continue;
+ if (!ts_should_be_pdch(ts))
+ continue;
+
+ ts->lchan[0].rel_act_kind = LCHAN_REL_ACT_PCU;
+ l1sap_chan_rel(trx, gsm_lchan2chan_nr(&ts->lchan[0]));
}
}