summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/calypso
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2010-10-17 21:21:56 +0200
committerSylvain Munaut <tnt@246tNt.com>2010-10-25 20:58:31 +0200
commitba1cef1d233015021abd14e9b58ee514b032037a (patch)
treeb2ff50fb91c6a2503f8e9b85b1f9e49bdc7a09a2 /src/target/firmware/calypso
parentaab5419af0f2b9ab3e06b31c976b760f327bef00 (diff)
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>
Diffstat (limited to 'src/target/firmware/calypso')
-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 425682ac..82dcb29e 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
------