From 5ee3dba39f241c5551196e8f167b907b9920355e Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 4 Nov 2016 16:52:35 +0100 Subject: DTX: wrap FSM signal dispatching Make wrapper function which checks that DTX is enabled for lchan before dispatching any events. Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66 --- src/common/msg_utils.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/common/msg_utils.c') diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index edf71239..b8764433 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -151,8 +151,7 @@ int dtx_dl_amr_fsm_step(struct gsm_lchan *lchan, const uint8_t *rtp_pl, if (rtp_pl == NULL) { /* SID-FIRST P1 -> P2 */ *len = 3; memcpy(l1_payload, lchan->tch.dtx.cache, 2); - osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_COMPL, - (void *)lchan); + dtx_dispatch(lchan, E_COMPL); return 0; } @@ -307,6 +306,13 @@ bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan) return false; } +void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e) +{ + if (dtx_dl_amr_enabled(lchan)) + osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, e, + (void *)lchan); +} + /* repeat last SID if possible, returns SID length + 1 or 0 */ /*! \brief Repeat last SID if possible in case of DTX * \param[in] lchan Logical channel on which we check scheduling -- cgit v1.2.3