summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/calypso/dsp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/target/firmware/calypso/dsp.c')
-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
------