diff options
Diffstat (limited to 'src/common/msg_utils.c')
-rw-r--r-- | src/common/msg_utils.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 52b05668..04a0c344 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -10,7 +10,7 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. @@ -23,6 +23,7 @@ #include <osmo-bts/oml.h> #include <osmo-bts/amr.h> #include <osmo-bts/rsl.h> +#include <osmo-bts/bts.h> #include <osmocom/gsm/protocol/ipaccess.h> #include <osmocom/gsm/protocol/gsm_12_21.h> @@ -320,17 +321,17 @@ static inline bool dtx_amr_sid_optional(struct gsm_lchan *lchan, uint32_t fn) already: we rely here on the order of RTS arrival from L1 - we expect that PH-DATA.req ALWAYS comes before PH-TCH.req for the same FN */ - if(lchan->type == GSM_LCHAN_TCH_H) { + if (lchan->type == GSM_LCHAN_TCH_H) { if (lchan->tch.dtx.fn != LCHAN_FN_DUMMY && lchan->tch.dtx.fn != LCHAN_FN_WAIT) { /* FACCH interruption is over */ dtx_dispatch(lchan, E_COMPL); return false; - } else if(lchan->tch.dtx.fn == LCHAN_FN_DUMMY) { + } else if (lchan->tch.dtx.fn == LCHAN_FN_DUMMY) { lchan->tch.dtx.fn = LCHAN_FN_WAIT; } else lchan->tch.dtx.fn = fn; - } else if(lchan->type == GSM_LCHAN_TCH_F) { + } else if (lchan->type == GSM_LCHAN_TCH_F) { if (lchan->tch.dtx.fn != LCHAN_FN_DUMMY) { /* FACCH interruption is over */ dtx_dispatch(lchan, E_COMPL); @@ -379,15 +380,19 @@ static inline bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn) static const uint8_t f[] = { 52, 53, 54, 55, 56, 57, 58, 59 }, h0[] = { 0, 2, 4, 6, 52, 54, 56, 58 }, h1[] = { 14, 16, 18, 20, 66, 68, 70, 72 }; - if (lchan->tch_mode == GSM48_CMODE_SPEECH_V1) { + switch (lchan->tch_mode) { + case GSM48_CMODE_SPEECH_V1: if (lchan->type == GSM_LCHAN_TCH_F) return fn_chk(f, fn, ARRAY_SIZE(f)); else return fn_chk(lchan->nr ? h1 : h0, fn, lchan->nr ? ARRAY_SIZE(h1) : ARRAY_SIZE(h0)); + case GSM48_CMODE_SPEECH_EFR: + return fn_chk(f, fn, ARRAY_SIZE(f)); + default: + return false; } - return false; } /*! \brief Check if DTX DL AMR is enabled for a given lchan (it have proper type, @@ -465,10 +470,6 @@ void dtx_int_signal(struct gsm_lchan *lchan) */ uint8_t repeat_last_sid(struct gsm_lchan *lchan, uint8_t *dst, uint32_t fn) { - /* FIXME: add EFR support */ - if (lchan->tch_mode == GSM48_CMODE_SPEECH_EFR) - return 0; - if (lchan->tch_mode != GSM48_CMODE_SPEECH_AMR) { if (dtx_sched_optional(lchan, fn)) return 0; |