diff --git a/include/osmocom/bsc/lchan_fsm.h b/include/osmocom/bsc/lchan_fsm.h index 35b88471e..9fbf9b3dc 100644 --- a/include/osmocom/bsc/lchan_fsm.h +++ b/include/osmocom/bsc/lchan_fsm.h @@ -14,6 +14,7 @@ enum lchan_fsm_state { LCHAN_ST_UNUSED, + LCHAN_ST_CBCH, /*< Blocked by CBCH channel combination, not usable as SDCCH. */ LCHAN_ST_WAIT_TS_READY, LCHAN_ST_WAIT_ACTIV_ACK, /*< After RSL Chan Act Ack, lchan is active but RTP not configured. */ LCHAN_ST_WAIT_RLL_RTP_ESTABLISH, diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 1ef7869d3..c80d8a16e 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -1035,6 +1035,13 @@ static const struct osmo_fsm_state lchan_fsm_states[] = { , .out_state_mask = 0 | S(LCHAN_ST_WAIT_TS_READY) + | S(LCHAN_ST_CBCH) + , + }, + [LCHAN_ST_CBCH] = { + .name = "CBCH", + .out_state_mask = 0 + | S(LCHAN_ST_UNUSED) , }, [LCHAN_ST_WAIT_TS_READY] = { diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c index 56b335773..fc2546003 100644 --- a/src/osmo-bsc/timeslot_fsm.c +++ b/src/osmo-bsc/timeslot_fsm.c @@ -295,6 +295,15 @@ static void ts_fsm_unused_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) T_CHAN_ACT_DEACT); break; + case GSM_PCHAN_CCCH_SDCCH4_CBCH: + case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: + /* For any pchans containing a CBCH, lchan[2] is reserved for CBCH and cannot be + * allocated for SDCCH. */ + OSMO_ASSERT(ts->lchan[2].fi); + ts->lchan[2].type = GSM_LCHAN_CBCH; + osmo_fsm_inst_state_chg(ts->lchan[2].fi, LCHAN_ST_CBCH, 0, 0); + break; + default: /* nothing to do */ break;