summaryrefslogtreecommitdiffstats
path: root/src/target/firmware
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-12-05 08:06:08 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-12-06 06:28:56 +0700
commit10eeb3cac98dea485cbb87abe313abe62d7c1b84 (patch)
treeba79fbe4f757f4d0f64a7012098eb734b71cfc82 /src/target/firmware
parent67d45c054a07378e89b818595f8483b2f157a70a (diff)
firmware: remove TCH/F specific bit re-ordering
This is a partial revert of d49a748cbbf7d7b5bb77f3d906179da9b462e6d1. The GAPK based audio I/O implementation of the mobile app is now capable of handling TI's specific TCH frame format, which can be configured via the VTY interface ('io-tch-format ti'). Thus there is no need to have the conversion logic in the firmware anymore. This patch also fixes the layer1 firmware, so it does not hang on receipt of Uplink TCH frames anymore when compiled with recent arm-none-eabi toolchain (v12.2.0 on my machine). Change-Id: I5afd4e4ddd9c06d32768d01bc1e3e18d476706fb Related: OS#3400
Diffstat (limited to 'src/target/firmware')
-rw-r--r--src/target/firmware/Makefile3
-rw-r--r--src/target/firmware/layer1/prim_tch.c53
2 files changed, 1 insertions, 55 deletions
diff --git a/src/target/firmware/Makefile b/src/target/firmware/Makefile
index 104ddac9..d1ab0c6e 100644
--- a/src/target/firmware/Makefile
+++ b/src/target/firmware/Makefile
@@ -126,8 +126,7 @@ ANY_APP_LIBS+= calypso/libcalypso.a \
comm/libcomm.a \
tiffs/libtiffs.a \
../../shared/libosmocore/build-target/src/.libs/libosmocore.a \
- ../../shared/libosmocore/build-target/src/gsm/.libs/libosmogsm.a \
- ../../shared/libosmocore/build-target/src/codec/.libs/libosmocodec.a
+ ../../shared/libosmocore/build-target/src/gsm/.libs/libosmogsm.a
#
diff --git a/src/target/firmware/layer1/prim_tch.c b/src/target/firmware/layer1/prim_tch.c
index 0542e827..56c32fba 100644
--- a/src/target/firmware/layer1/prim_tch.c
+++ b/src/target/firmware/layer1/prim_tch.c
@@ -28,7 +28,6 @@
#include <byteorder.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
-#include <osmocom/codec/codec.h>
#include <osmocom/core/msgb.h>
#include <calypso/dsp_api.h>
#include <calypso/irq.h>
@@ -52,45 +51,6 @@
#include <l1ctl_proto.h>
-static inline int msb_get_bit(uint8_t *buf, int bn)
-{
- int pos_byte = bn >> 3;
- int pos_bit = 7 - (bn & 7);
-
- return (buf[pos_byte] >> pos_bit) & 1;
-}
-
-static inline void msb_set_bit(uint8_t *buf, int bn, int bit)
-{
- int pos_byte = bn >> 3;
- int pos_bit = 7 - (bn & 7);
-
- buf[pos_byte] |= (bit << pos_bit);
-}
-
-static void tch_fr_bit_magic(uint8_t *frame, int dl)
-{
- uint8_t fr[33];
- int i, di, si;
-
- memset(fr, 0x00, 33);
-
- if (dl)
- fr[0] = 0xd0;
-
- for (i = 0; i < 260; i++) {
- di = gsm610_bitorder[i];
- si = (i > 181) ? i + 4 : i;
-
- if (dl)
- msb_set_bit(fr, 4 + di, msb_get_bit(frame, si));
- else
- msb_set_bit(fr, si, msb_get_bit(frame, 4 + di));
- }
-
- memcpy(frame, fr, 33);
-}
-
/* This computes various parameters both for the DSP and for
* our logic. Not all are used all the time, but it's easier
* to build all in one place */
@@ -351,12 +311,6 @@ static int l1s_tch_resp(__unused uint8_t p1, __unused uint8_t p2, uint16_t p3)
/* Copy actual data, skipping the information block [0,1,2] */
dsp_memcpy_from_api(payload, &traffic_buf[3], 33, 1);
- /**
- * Perform some bit conversations
- * FIXME: what about other (than FR) codecs?
- */
- tch_fr_bit_magic(payload, 1);
-
/* Give message to up layer */
l1_queue_for_l2(msg);
}
@@ -483,13 +437,6 @@ static int l1s_tch_cmd(__unused uint8_t p1, __unused uint8_t p2, uint16_t p3)
/* Pull Traffic data (if any) */
msg = msgb_dequeue(&l1s.tx_queue[L1S_CHAN_TRAFFIC]);
- /**
- * Perform some bit conversations
- * FIXME: what about other (than FR) codecs?
- */
- if (msg)
- tch_fr_bit_magic(msg->l2h, 0);
-
/* Copy actual data, skipping the information block [0,1,2] */
if (msg) {
data = msg->l2h;