diff options
author | Max <msuraev@sysmocom.de> | 2016-10-03 17:37:45 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-10-13 06:58:06 +0000 |
commit | babd05661d13b12234e848acf9c4bff909ef05f4 (patch) | |
tree | 656168076a94b5a430d2b0c1d856011e3b4c6a4d /include | |
parent | c09e5a44c3c1c2882339fe8822f373b1e12839ae (diff) |
DTX DL: use FSM for AMR
Use dedicated FSM to handle all DTX DL related events:
- add explicit checks if DTX DL is enabled (fixes regression for non-DTX
setup introduced in 654175f33bd412671e3ef8cdd65c0689d10f278c)
- fix handling of AMR CMI for SPEECH frames
- add FSM for DTX DL
- sync with corresponding changes in OpenBSC's
- handle FACCH-related DTX ONSET events
This affects both lc15 and sysmobts and requires corresponding change in
OpenBSC (Change-Id: Idac8609faf9b5ced818fde899ccfc6ed0c42e8fd).
Change-Id: I74a0b42cb34d525b8a70d264135e82994ca70d31
Diffstat (limited to 'include')
-rw-r--r-- | include/osmo-bts/Makefile.am | 3 | ||||
-rw-r--r-- | include/osmo-bts/dtx_dl_amr_fsm.h | 35 | ||||
-rw-r--r-- | include/osmo-bts/msg_utils.h | 9 |
3 files changed, 41 insertions, 6 deletions
diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am index d0b55ff9..ef4165f3 100644 --- a/include/osmo-bts/Makefile.am +++ b/include/osmo-bts/Makefile.am @@ -1,4 +1,5 @@ noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h logging.h measurement.h \ oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \ handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \ - power_control.h scheduler.h scheduler_backend.h phy_link.h + power_control.h scheduler.h scheduler_backend.h phy_link.h \ + dtx_dl_amr_fsm.h diff --git a/include/osmo-bts/dtx_dl_amr_fsm.h b/include/osmo-bts/dtx_dl_amr_fsm.h new file mode 100644 index 00000000..8b195953 --- /dev/null +++ b/include/osmo-bts/dtx_dl_amr_fsm.h @@ -0,0 +1,35 @@ +#pragma once + +#include <osmocom/core/fsm.h> +#include <osmocom/core/utils.h> +#include <osmocom/core/logging.h> + +/* DTX DL AMR FSM */ + +#define X(s) (1 << (s)) + +enum dtx_dl_amr_fsm_states { + ST_VOICE, + ST_SID_F1, + ST_SID_F2, + ST_F1_INH, + ST_U_INH, + ST_SID_U, + ST_ONSET_V, + ST_ONSET_F, + ST_FACCH_V, + ST_FACCH, +}; + +enum dtx_dl_amr_fsm_events { + E_VOICE, + E_ONSET, + E_FACCH, + E_COMPL, + E_INHIB, + E_SID_F, + E_SID_U, +}; + +extern const struct value_string dtx_dl_amr_fsm_event_names[]; +extern struct osmo_fsm dtx_dl_amr_fsm; diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index f99f3c40..31bd1725 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -26,12 +26,11 @@ enum { }; void lchan_set_marker(bool t, struct gsm_lchan *lchan); -void save_last_sid(struct gsm_lchan *lchan, const uint8_t *l1_payload, - size_t length, uint32_t fn, int update, uint8_t cmr, - int8_t cmi); -int dtx_amr_check_onset(struct gsm_lchan *lchan, const uint8_t *rtp_pl, +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, size_t rtp_pl_len, uint32_t fn, uint8_t *l1_payload, - uint8_t *ft_out); + bool marker, uint8_t *len, uint8_t *ft_out); uint8_t repeat_last_sid(struct gsm_lchan *lchan, uint8_t *dst, uint32_t fn); int msg_verify_ipa_structure(struct msgb *msg); int msg_verify_oml_structure(struct msgb *msg); |