fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-bts/+/38314?usp=email )
Change subject: gsmtap_csd_rlp_process(): fix frame reassembly for TCH/F4.8
......................................................................
gsmtap_csd_rlp_process(): fix frame reassembly for TCH/F4.8
Unfortunately this approach cannot work because bit E7 simply does
not exist in NT mode: that bit position gets replaced by one of
D-prime bits belonging to the RLP frame. Let's use TDMA Fn of the
given TCH.ind to distinguish between the 1st and 2nd halves of an
RLP frame, like we do in csd_v110_rtp_encode().
Related: OS#6578
Change-Id: Ia6b3b03faa066ca7fd828d24ba2559ac69c0362a
---
M include/osmo-bts/csd_v110.h
M src/common/csd_v110.c
M src/common/l1sap.c
3 files changed, 6 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/14/38314/1
diff --git a/include/osmo-bts/csd_v110.h b/include/osmo-bts/csd_v110.h
index b461724..f1c1027 100644
--- a/include/osmo-bts/csd_v110.h
+++ b/include/osmo-bts/csd_v110.h
@@ -17,6 +17,8 @@
extern const struct csd_v110_lchan_desc csd_v110_lchan_desc[256];
+extern const uint8_t csd_v110_tchf48_nt_e2_map[26];
+
int csd_v110_rtp_encode(const struct gsm_lchan *lchan, uint8_t *rtp,
const uint8_t *data, size_t data_len, uint32_t fn);
int csd_v110_rtp_decode(const struct gsm_lchan *lchan, uint8_t *data,
diff --git a/src/common/csd_v110.c b/src/common/csd_v110.c
index d8a8596..d25eb7b 100644
--- a/src/common/csd_v110.c
+++ b/src/common/csd_v110.c
@@ -76,7 +76,7 @@
/* In the case of TCH/F4.8 NT, we have to set bit E2 based on the TDMA
* frame number at which we received the block in question. See
* GSM 05.03 section 3.4.1 and the mapping tables of GSM 05.02. */
-static const uint8_t tchf48_nt_e2_map[26] = {
+const uint8_t csd_v110_tchf48_nt_e2_map[26] = {
[4] = 1, /* B1 position */
[13] = 1, /* B3 position */
[21] = 1, /* B5 position */
@@ -124,7 +124,7 @@
if (desc->num_blocks == 4)
df.e_bits[1] = (i >> 1) & 0x01;
else
- df.e_bits[1] = tchf48_nt_e2_map[fn % 26];
+ df.e_bits[1] = csd_v110_tchf48_nt_e2_map[fn % 26];
/* E3: 0 for Q1/Q3, 1 for Q2/Q4 */
df.e_bits[2] = (i >> 0) & 0x01;
} else {
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 83dacbd..381dd2d 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -460,10 +460,9 @@
if (lchan->type == GSM_LCHAN_TCH_F && lchan->tch_mode ==
GSM48_CMODE_DATA_6k0) {
/* in this mode we have 120bit MAC blocks; two of them need to be concatenated
* to render a 240-bit RLP frame. The fist block is present in B0/B2/B4.
- * The E7 bit is used to indicate the Frame MF0a */
+ * The TDMA Fn is used to distinguish between the 1st and 2nd halves. */
OSMO_ASSERT(data_len == 120);
- ubit_t e7 = data[4*7+3];
- if (e7 == 0) {
+ if (csd_v110_tchf48_nt_e2_map[tch_ind->fn % 26] == 0) {
/* E2=0: this is B0/B2/B4 containing the 1st half */
osmo_ubit2pbit_ext(rlp_buf, 0, data, 0, data_len, 1);
return;
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bts/+/38314?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ia6b3b03faa066ca7fd828d24ba2559ac69c0362a
Gerrit-Change-Number: 38314
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>