diff options
author | Harald Welte <laforge@gnumonks.org> | 2016-01-09 17:53:30 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-01-16 17:48:26 +0100 |
commit | 6323d2e61707ac96d1f4c5c0218c0efe6c203697 (patch) | |
tree | 4efed29e8e3563bb12c08d362bba2911a0c698a0 /src | |
parent | 601781f463d0f5798ac27fd90be63d9f15261683 (diff) |
use existing #define for FR/EFR frame length (33/31)
Diffstat (limited to 'src')
-rw-r--r-- | src/osmo-bts-trx/gsm0503_coding.c | 9 | ||||
-rw-r--r-- | src/osmo-bts-trx/scheduler.c | 24 |
2 files changed, 18 insertions, 15 deletions
diff --git a/src/osmo-bts-trx/gsm0503_coding.c b/src/osmo-bts-trx/gsm0503_coding.c index fea25f9c..c56be5a2 100644 --- a/src/osmo-bts-trx/gsm0503_coding.c +++ b/src/osmo-bts-trx/gsm0503_coding.c @@ -30,6 +30,7 @@ #include <osmocom/codec/codec.h> #include <osmo-bts/logging.h> +#include <osmo-bts/gsm_data.h> #include "gsm0503_conv.h" #include "gsm0503_parity.h" @@ -722,13 +723,13 @@ int tch_fr_decode(uint8_t *tch_data, sbit_t *bursts, int net_order, int efr, tch_efr_reassemble(tch_data, s); - len = 31; + len = GSM_EFR_BYTES; } else { tch_fr_d_to_b(w, d); tch_fr_reassemble(tch_data, w, net_order); - len = 33; + len = GSM_FR_BYTES; } return len; @@ -741,7 +742,7 @@ int tch_fr_encode(ubit_t *bursts, uint8_t *tch_data, int len, int net_order) int i; switch (len) { - case 31: /* TCH EFR */ + case GSM_EFR_BYTES: /* TCH EFR */ tch_efr_disassemble(s, tch_data); @@ -754,7 +755,7 @@ int tch_fr_encode(ubit_t *bursts, uint8_t *tch_data, int len, int net_order) tch_efr_w_to_d(d, w); goto coding_efr_fr; - case 33: /* TCH FR */ + case GSM_FR_BYTES: /* TCH FR */ tch_fr_disassemble(w, tch_data, net_order); tch_fr_b_to_d(d, w); diff --git a/src/osmo-bts-trx/scheduler.c b/src/osmo-bts-trx/scheduler.c index 2edcae2e..5be5f387 100644 --- a/src/osmo-bts-trx/scheduler.c +++ b/src/osmo-bts-trx/scheduler.c @@ -30,6 +30,8 @@ #include <osmocom/core/bits.h> #include <osmocom/gsm/a5.h> +#include <osmocom/netif/rtp.h> + #include <osmo-bts/gsm_data.h> #include <osmo-bts/logging.h> #include <osmo-bts/rsl.h> @@ -801,7 +803,7 @@ static void tx_tch_common(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, /* handle loss detection of received TCH frames */ if (rsl_cmode == RSL_CMOD_SPD_SPEECH && ++(l1h->chan_states[tn][chan].lost) > 5) { - uint8_t tch_data[33]; + uint8_t tch_data[GSM_FR_BYTES]; int len; LOGP(DL1C, LOGL_NOTICE, "Missing TCH bursts detected, sending " @@ -816,14 +818,14 @@ static void tx_tch_common(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, len = 15; break; } - memset(tch_data, 0, 33); - len = 33; + memset(tch_data, 0, GSM_FR_BYTES); + len = GSM_FR_BYTES; break; case GSM48_CMODE_SPEECH_EFR: /* EFR */ if (chan != TRXC_TCHF) goto inval_mode1; - memset(tch_data, 0, 31); - len = 31; + memset(tch_data, 0, GSM_EFR_BYTES); + len = GSM_EFR_BYTES; break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ len = amr_compose_payload(tch_data, @@ -919,7 +921,7 @@ inval_mode1: } break; } - len = 33; + len = GSM_FR_BYTES; if (msgb_l2len(msg_tch) >= 1 && (msg_tch->l2h[0] >> 4) != 0xd) { LOGP(DL1C, LOGL_NOTICE, "%s Transmitting 'bad " @@ -932,7 +934,7 @@ inval_mode1: case GSM48_CMODE_SPEECH_EFR: /* EFR */ if (chan != TRXC_TCHF) goto inval_mode2; - len = 31; + len = GSM_EFR_BYTES; if (msgb_l2len(msg_tch) >= 1 && (msg_tch->l2h[0] >> 4) != 0xc) { LOGP(DL1C, LOGL_NOTICE, "%s Transmitting 'bad " @@ -1524,12 +1526,12 @@ bfi: /* indicate bad frame */ switch (tch_mode) { case GSM48_CMODE_SPEECH_V1: /* FR */ - memset(tch_data, 0, 33); - rc = 33; + memset(tch_data, 0, GSM_FR_BYTES); + rc = GSM_FR_BYTES; break; case GSM48_CMODE_SPEECH_EFR: /* EFR */ - memset(tch_data, 0, 31); - rc = 31; + memset(tch_data, 0, GSM_EFR_BYTES); + rc = GSM_EFR_BYTES; break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ rc = amr_compose_payload(tch_data, |