diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-04-06 10:00:16 +0800 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-04-06 10:00:16 +0800 |
commit | 4e47a7a6ceadb92299b39c48ff83acfbcc2d463c (patch) | |
tree | e02592925bd9d5701b319d6cee84e6450c679797 /src/target/firmware | |
parent | 9a05cc42b5a4606138f9c3d9648f07b58a12ed33 (diff) |
layer1: properly reset fb_once and sb_once when syncing to new cell
Diffstat (limited to 'src/target/firmware')
-rw-r--r-- | src/target/firmware/include/layer1/sync.h | 3 | ||||
-rw-r--r-- | src/target/firmware/layer1/l23_api.c | 4 | ||||
-rw-r--r-- | src/target/firmware/layer1/sync.c | 12 |
3 files changed, 16 insertions, 3 deletions
diff --git a/src/target/firmware/include/layer1/sync.h b/src/target/firmware/include/layer1/sync.h index f13d5a97..4bf7f2b4 100644 --- a/src/target/firmware/include/layer1/sync.h +++ b/src/target/firmware/include/layer1/sync.h @@ -101,6 +101,9 @@ void l1s_nb_test(uint8_t base_fn); void l1s_init(void); +/* reset the layer1 as part of synchronizing to a new cell */ +void l1s_reset(void); + /* init.c */ void layer1_init(void); diff --git a/src/target/firmware/layer1/l23_api.c b/src/target/firmware/layer1/l23_api.c index c7903671..1d2c5e42 100644 --- a/src/target/firmware/layer1/l23_api.c +++ b/src/target/firmware/layer1/l23_api.c @@ -175,9 +175,7 @@ static void l1a_l23_rx_cb(uint8_t dlci, struct msgb *msg) printd("L1CTL_DM_EST_REQ (arfcn=%u)\n", sync_req->band_arfcn); /* reset scheduler and hardware */ - l1s.mf_tasks = 0; - tdma_sched_reset(); - l1s_dsp_abort(); + l1s_reset(); /* tune to specified frequency */ trf6151_rx_window(0, sync_req->band_arfcn, 40, 0); diff --git a/src/target/firmware/layer1/sync.c b/src/target/firmware/layer1/sync.c index dfdf64e2..d4b8d12d 100644 --- a/src/target/firmware/layer1/sync.c +++ b/src/target/firmware/layer1/sync.c @@ -1154,6 +1154,18 @@ static void frame_irq(__unused enum irq_nr nr) l1_sync(); } +/* reset the layer1 as part of synchronizing to a new cell */ +void l1s_reset(void) +{ + fb_once = 0; + sb_once = 0; + + /* reset scheduler and hardware */ + l1s.mf_tasks = 0; + tdma_sched_reset(); + l1s_dsp_abort(); +} + void l1s_init(void) { unsigned int i; |