[PATCH 2/2] layer1: add l1s_run_handler and call it from prim_pm.c

Jan Luebbe jluebbe at debian.org
Sun May 16 15:31:22 UTC 2010


In f7af19661a43457fc6489391ecc70aab238abcb4 we stopped running
the callback, which broke the l1test app. Now it works again.
---
 src/target/firmware/include/layer1/sync.h |    1 +
 src/target/firmware/layer1/prim_pm.c      |    2 ++
 src/target/firmware/layer1/sync.c         |    6 ++++++
 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/target/firmware/include/layer1/sync.h b/src/target/firmware/include/layer1/sync.h
index d053c93..c5ff4c1 100644
--- a/src/target/firmware/include/layer1/sync.h
+++ b/src/target/firmware/include/layer1/sync.h
@@ -115,6 +115,7 @@ struct l1_signal {
 typedef void (*l1s_cb_t)(struct l1_signal *sig);
 
 void l1s_set_handler(l1s_cb_t handler);
+void l1s_run_handler(struct l1_signal *sig);
 
 int16_t l1s_snr_int(uint16_t snr);
 uint16_t l1s_snr_fract(uint16_t snr);
diff --git a/src/target/firmware/layer1/prim_pm.c b/src/target/firmware/layer1/prim_pm.c
index 85fc8d1..4a5c75c 100644
--- a/src/target/firmware/layer1/prim_pm.c
+++ b/src/target/firmware/layer1/prim_pm.c
@@ -96,6 +96,8 @@ static int l1s_pm_resp(__unused uint8_t p1, __unused uint8_t p2,
 	sig.pm.dbm8[0] = agc_inp_dbm8_by_pm(pm_level[0]);
 	sig.pm.dbm8[1] = agc_inp_dbm8_by_pm(pm_level[1]);
 
+	l1s_run_handler(&sig);
+
 	if (!l1s.pm.msg)
 		l1s.pm.msg = l1ctl_msgb_alloc(L1CTL_PM_RESP);
 
diff --git a/src/target/firmware/layer1/sync.c b/src/target/firmware/layer1/sync.c
index f5629cf..a4b3a65 100644
--- a/src/target/firmware/layer1/sync.c
+++ b/src/target/firmware/layer1/sync.c
@@ -65,6 +65,12 @@ void l1s_set_handler(l1s_cb_t cb)
 	l1s_cb = cb;
 }
 
+void l1s_run_handler(struct l1_signal *sig)
+{
+	if (l1s_cb)
+		l1s_cb(sig);
+}
+
 void l1s_time_inc(struct gsm_time *time, uint32_t delta_fn)
 {
 	ADD_MODULO(time->fn, delta_fn, GSM_MAX_FN);
-- 
1.7.1





More information about the baseband-devel mailing list