aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2023-03-03 16:21:52 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2023-03-03 16:21:53 +0100
commitee105c57b1bcb060c56ac771a6f06d3f74a1bedd (patch)
tree6082dfc5b4fbbd1d0e860d6d6e688037541a35ae
parent5ea91cdae4fa7dcc861193c7e90aa39f2910f1e2 (diff)
cosmetic: timeslot_fsm.c: move some code to separate functionneels/for_dexter
-rw-r--r--src/osmo-bsc/timeslot_fsm.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c
index c7f61304b..511489c30 100644
--- a/src/osmo-bsc/timeslot_fsm.c
+++ b/src/osmo-bsc/timeslot_fsm.c
@@ -323,11 +323,32 @@ static void ts_fsm_not_initialized_onenter(struct osmo_fsm_inst *fi, uint32_t pr
chan_counts_ts_clear(ts);
}
-static void ts_fsm_unused_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+static void ts_fsm_unused_pdch_act(struct osmo_fsm_inst *fi)
{
struct gsm_bts_trx_ts *ts = ts_fi_ts(fi);
struct gsm_bts *bts = ts->trx->bts;
+ if (bts->gprs.mode == BTS_GPRS_NONE) {
+ LOG_TS(ts, LOGL_DEBUG, "GPRS mode is 'none': not activating PDCH.\n");
+ return;
+ }
+
+ if (!ts->pdch_act_allowed) {
+ LOG_TS(ts, LOGL_DEBUG, "PDCH is disabled for this timeslot,"
+ " either due to a PDCH ACT NACK, or from manual VTY command:"
+ " not activating PDCH. (last error: %s)\n",
+ ts->last_errmsg ? : "-");
+ return;
+ }
+
+ osmo_fsm_inst_state_chg(fi, TS_ST_WAIT_PDCH_ACT, CHAN_ACT_DEACT_TIMEOUT,
+ T_CHAN_ACT_DEACT);
+}
+
+static void ts_fsm_unused_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+{
+ struct gsm_bts_trx_ts *ts = ts_fi_ts(fi);
+
chan_counts_ts_update(ts);
/* We are entering the unused state. There must by definition not be any lchans waiting to be
@@ -342,19 +363,7 @@ static void ts_fsm_unused_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
switch (ts->pchan_on_init) {
case GSM_PCHAN_OSMO_DYN:
case GSM_PCHAN_TCH_F_PDCH:
- if (bts->gprs.mode == BTS_GPRS_NONE) {
- LOG_TS(ts, LOGL_DEBUG, "GPRS mode is 'none': not activating PDCH.\n");
- return;
- }
- if (!ts->pdch_act_allowed) {
- LOG_TS(ts, LOGL_DEBUG, "PDCH is disabled for this timeslot,"
- " either due to a PDCH ACT NACK, or from manual VTY command:"
- " not activating PDCH. (last error: %s)\n",
- ts->last_errmsg ? : "-");
- return;
- }
- osmo_fsm_inst_state_chg(fi, TS_ST_WAIT_PDCH_ACT, CHAN_ACT_DEACT_TIMEOUT,
- T_CHAN_ACT_DEACT);
+ ts_fsm_unused_pdch_act(fi);
break;
case GSM_PCHAN_CCCH_SDCCH4_CBCH: