summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/layer1/l23_api.c
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2010-10-18 22:37:32 +0200
committerSylvain Munaut <tnt@246tNt.com>2010-10-25 20:58:32 +0200
commit69c84c45e57bbc0bdddd770259004754beac8794 (patch)
tree2993727bae85440fd38423e52fcf95377e86e58f /src/target/firmware/layer1/l23_api.c
parentf1d942b8f4a28e7c57674e5b9d16d6635b24e88c (diff)
target/fw/l23_api: Properly sync tch in DM EST REQ
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'src/target/firmware/layer1/l23_api.c')
-rw-r--r--src/target/firmware/layer1/l23_api.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/target/firmware/layer1/l23_api.c b/src/target/firmware/layer1/l23_api.c
index f6a2a9c9..4a06e04b 100644
--- a/src/target/firmware/layer1/l23_api.c
+++ b/src/target/firmware/layer1/l23_api.c
@@ -99,6 +99,12 @@ static int chan_nr2dchan_type(uint8_t chan_nr)
return GSM_DCHAN_UNKNOWN;
}
+static int chan_nr_is_tch(uint8_t chan_nr)
+{
+ return ((chan_nr >> 3) == 0x01 || /* TCH/F */
+ ((chan_nr >> 3) & 0x1e) == 0x02); /* TCH/H */
+}
+
struct msgb *l1ctl_msgb_alloc(uint8_t msg_type)
{
struct msgb *msg;
@@ -186,8 +192,14 @@ static void l1ctl_rx_dm_est_req(struct msgb *msg)
l1s.dedicated.h0.arfcn = ntohs(est_req->h0.band_arfcn);
}
- /* TCH mode */
- l1a_tch_mode_set(est_req->tch_mode);
+ /* TCH config */
+ if (chan_nr_is_tch(ul->chan_nr)) {
+ /* Mode */
+ l1a_tch_mode_set(est_req->tch_mode);
+
+ /* Sync */
+ l1s.tch_sync = 1; /* can be set without locking */
+ }
/* figure out which MF tasks to enable */
l1a_mftask_set(1 << chan_nr2mf_task(ul->chan_nr));