aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/l1_if.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-05-28 16:00:36 +0200
committerDaniel Willmann <daniel@totalueberwachung.de>2017-06-01 00:50:51 +0200
commita4bd813081e788012c72f34d31150cdf02db307f (patch)
treead0d82f5b1667d2473bad230d7e8a5fb9722d36a /src/osmo-bts-sysmo/l1_if.h
parent1a2ff06d206fc4ff3cb8170ebe2b5570addc5be3 (diff)
sysmobts: Re-order the bit-endianness of every HR codec parametersysmocom/0.3.5-stable
The so-called "RTP mode" of the DSP contains a bug on all firmware versions < 5.3.3 which causes the bit-order within each of the non-aligned codec parameters to be wrong. Introduce a function originally written by Sylvain Munaut during 32C3 in http://git.osmocom.org/openbsc/commit/?h=sylvain/32c3_codec&id=5b4a16bbe93a7b1ace65cc23d6cce56ecf4f1275 to bring the bits into [the correct] order. This has never been seen in a "pure sysmoBTS" setup, as all BTSs would use the same (wrong) bit-ordering and thus interoperate. This patch now checks for an affected DSP firmware version and then jumbles (old DSP firmware version) or does nothing (new DSP firmware version). Change-Id: Ia0eee4f514fb8fd81c052bb44a4facba898d6afb Closes: SYS#2452
Diffstat (limited to 'src/osmo-bts-sysmo/l1_if.h')
-rw-r--r--src/osmo-bts-sysmo/l1_if.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h
index 5f05f1df..968cd170 100644
--- a/src/osmo-bts-sysmo/l1_if.h
+++ b/src/osmo-bts-sysmo/l1_if.h
@@ -78,12 +78,27 @@ struct femtol1_hdl {
} hw_info;
int fixup_needed;
+ bool rtp_hr_jumble_needed;
struct calib_send_state st;
uint8_t last_rf_mute[8];
};
+#define L1_VER_SHIFT(x,y,z) ((x << 16) | (y << 8) | (z))
+
+static inline uint32_t l1if_dsp_ver(struct femtol1_hdl *fl1h)
+{
+ const uint8_t *v = fl1h->hw_info.dsp_version;
+ return L1_VER_SHIFT(v[0], v[1], v[2]);
+}
+
+static inline uint32_t l1if_fpga_ver(struct femtol1_hdl *fl1h)
+{
+ const uint8_t *v = fl1h->hw_info.fpga_version;
+ return L1_VER_SHIFT(v[0], v[1], v[2]);
+}
+
#define msgb_l1prim(msg) ((GsmL1_Prim_t *)(msg)->l1h)
#define msgb_sysprim(msg) ((SuperFemto_Prim_t *)(msg)->l1h)