This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Max gerrit-no-reply at lists.osmocom.orgReview at https://gerrit.osmocom.org/1202 DTX: wrap FSM signal dispatching Make wrapper function which checks that DTX is enabled for lchan before dispatching any events. Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66 --- M include/osmo-bts/msg_utils.h M src/common/l1sap.c M src/common/msg_utils.c 3 files changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/02/1202/1 diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 452761d..ab22eda 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -27,6 +27,7 @@ void lchan_set_marker(bool t, struct gsm_lchan *lchan); bool dtx_enabled(const struct gsm_lchan *lchan); +void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e); void dtx_cache_payload(struct gsm_lchan *lchan, const uint8_t *l1_payload, size_t length, uint32_t fn, int update); int dtx_dl_amr_fsm_step(struct gsm_lchan *lchan, const uint8_t *rtp_pl, diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 805a980..71c4b0b 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -610,10 +610,8 @@ memcpy(p, pp.oph.msg->data, GSM_MACBLOCK_LEN); /* check if it is a RR CIPH MODE CMD. if yes, enable RX ciphering */ check_for_ciph_cmd(pp.oph.msg, lchan, chan_nr); - if (dtxd_facch && dtx_enabled(lchan)) - osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, - E_FACCH, - (void *)lchan); + if (dtxd_facch) + dtx_dispatch(lchan, E_FACCH); } msgb_free(pp.oph.msg); } diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 9f985c3..018ed04 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -151,8 +151,7 @@ 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; } @@ -305,6 +304,13 @@ return false; } +void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e) +{ + if (dtx_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 -- To view, visit https://gerrit.osmocom.org/1202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max <msuraev at sysmocom.de>