From ba1cef1d233015021abd14e9b58ee514b032037a Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Sun, 17 Oct 2010 21:21:56 +0200 Subject: 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 --- src/target/firmware/calypso/dsp.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'src/target/firmware/calypso/dsp.c') 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 ------ -- cgit v1.2.3-55-g7522