fixeria has uploaded this change for review.

View Change

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
---
M src/target/firmware/Makefile
M src/target/firmware/layer1/prim_tch.c
2 files changed, 1 insertion(+), 55 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/84/30484/1
diff --git a/src/target/firmware/Makefile b/src/target/firmware/Makefile
index 104ddac..d1ab0c6 100644
--- a/src/target/firmware/Makefile
+++ b/src/target/firmware/Makefile
@@ -126,8 +126,7 @@
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 0542e82..56c32fb 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 @@
/* 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 @@
/* 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;

To view, visit change 30484. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I5afd4e4ddd9c06d32768d01bc1e3e18d476706fb
Gerrit-Change-Number: 30484
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-MessageType: newchange