summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut2010-10-17 21:21:56 +0200
committerSylvain Munaut2010-10-25 20:58:31 +0200
commitba1cef1d233015021abd14e9b58ee514b032037a (patch)
treeb2ff50fb91c6a2503f8e9b85b1f9e49bdc7a09a2
parenttarget/fw/layer1: Store the GSM48 constants in l1s.tch_mode instead of DSP cste (diff)
downloadosmocom-ba1cef1d233015021abd14e9b58ee514b032037a.tar.gz
osmocom-ba1cef1d233015021abd14e9b58ee514b032037a.tar.xz
osmocom-ba1cef1d233015021abd14e9b58ee514b032037a.zip
target/fw/calypso: Fix dsp_load_tch_param to set fn_report for TCH/H
The previous code was only valid for TCH/F ... Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r--src/target/firmware/calypso/dsp.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/target/firmware/calypso/dsp.c b/src/target/firmware/calypso/dsp.c
index 425682a..82dcb29 100644
--- a/src/target/firmware/calypso/dsp.c
+++ b/src/target/firmware/calypso/dsp.c
@@ -482,11 +482,30 @@ void dsp_load_tch_param(struct gsm_time *next_time,
/* d_fn
----
+
+ for TCH_F:
bit [0..7] -> b_fn_report = (fn - (tn * 13) + 104) % 104)
- bit [8..15] -> b_fn_sid = (fn % 104) */
+ bit [8..15] -> b_fn_sid = (fn % 104)
+
+ for TCH_H:
+ tn_report = (tn & ~1) | subchannel
+ bit [0..7] -> b_fn_report = (fn - tn_report * 13) + 104) % 104)
+ bit [8..15] -> b_fn_sid = (fn % 104)
+
+ for other: irrelevant
+ */
- fn = ((next_time->fn - (tn * 13) + 104) % 104) |
- ((next_time->fn % 104) << 8);
+ if (chan_type == TCH_F) {
+ fn = ((next_time->fn - (tn * 13) + 104) % 104) |
+ ((next_time->fn % 104) << 8);
+ } else if (chan_type == TCH_H) {
+ uint8_t tn_report = (tn & ~1) | chan_sub;
+ fn = ((next_time->fn - (tn_report * 13) + 104) % 104) |
+ ((next_time->fn % 104) << 8);
+ } else {
+ /* irrelevant */
+ fn = 0;
+ }
/* a_a5fn
------