From b30031356cc6d4950b56bfd77060b0b1c3465a55 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Thu, 27 Jul 2017 08:57:13 +0600 Subject: host/trxcon: get rid of useless trxcon fsm events Both SCH_EVENT_CLCK_IND and SCH_EVENT_CLCK_LOSS were not handled, moreover there is no purpose to keep them. Change-Id: I8efac459a40f4287e3325890809991d5ef46e9b1 --- src/host/trxcon/sched_clck.c | 7 ------- src/host/trxcon/sched_trx.c | 3 +++ src/host/trxcon/trxcon.c | 6 +----- src/host/trxcon/trxcon.h | 4 ---- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/host/trxcon/sched_clck.c b/src/host/trxcon/sched_clck.c index efb3f4c9..9c1edc5b 100644 --- a/src/host/trxcon/sched_clck.c +++ b/src/host/trxcon/sched_clck.c @@ -47,16 +47,12 @@ static void sched_clck_tick(void *data) { struct trx_sched *sched = (struct trx_sched *) data; - struct trx_instance *trx = (struct trx_instance *) sched->data; - struct timeval tv_now, *tv_clock; int32_t elapsed; /* Check if transceiver is still alive */ if (sched->fn_counter_lost++ == TRX_LOSS_FRAMES) { LOGP(DSCH, LOGL_NOTICE, "No more clock from transceiver\n"); - - osmo_fsm_inst_dispatch(trxcon_fsm, SCH_EVENT_CLCK_LOSS, trx); sched->state = SCH_CLCK_STATE_WAIT; return; @@ -74,7 +70,6 @@ static void sched_clck_tick(void *data) LOGP(DSCH, LOGL_NOTICE, "PC clock skew: " "elapsed uS %d\n", elapsed); - osmo_fsm_inst_dispatch(trxcon_fsm, SCH_EVENT_CLCK_LOSS, trx); sched->state = SCH_CLCK_STATE_WAIT; return; @@ -122,7 +117,6 @@ static void sched_clck_correct(struct trx_sched *sched, int sched_clck_handle(struct trx_sched *sched, uint32_t fn) { - struct trx_instance *trx = (struct trx_instance *) sched->data; struct timeval tv_now, *tv_clock; int32_t elapsed, elapsed_fn; @@ -138,7 +132,6 @@ int sched_clck_handle(struct trx_sched *sched, uint32_t fn) sched_clck_correct(sched, &tv_now, fn); LOGP(DSCH, LOGL_NOTICE, "Initial clock received: fn=%u\n", fn); - osmo_fsm_inst_dispatch(trxcon_fsm, SCH_EVENT_CLCK_IND, trx); sched->state = SCH_CLCK_STATE_OK; return 0; diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c index be7a480d..cc9b1ce6 100644 --- a/src/host/trxcon/sched_trx.c +++ b/src/host/trxcon/sched_trx.c @@ -152,6 +152,9 @@ int sched_trx_reset(struct trx_instance *trx) sched->fn_counter_proc = 0; sched->fn_counter_lost = 0; + /* Reset internal state */ + sched->state = SCH_CLCK_STATE_WAIT; + return 0; } diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c index c0d5da32..f0fca16b 100644 --- a/src/host/trxcon/trxcon.c +++ b/src/host/trxcon/trxcon.c @@ -99,8 +99,6 @@ static void trxcon_fsm_managed_action(struct osmo_fsm_inst *fi, break; case TRX_EVENT_RSP_ERROR: case TRX_EVENT_OFFLINE: - case SCH_EVENT_CLCK_IND: - case SCH_EVENT_CLCK_LOSS: case TRX_EVENT_RESET_IND: /* TODO: notify L2 & L3 about that */ break; @@ -121,9 +119,7 @@ static struct osmo_fsm_state trxcon_fsm_states[] = { GEN_MASK(L1CTL_EVENT_DISCONNECT) | GEN_MASK(TRX_EVENT_RESET_IND) | GEN_MASK(TRX_EVENT_RSP_ERROR) | - GEN_MASK(TRX_EVENT_OFFLINE) | - GEN_MASK(SCH_EVENT_CLCK_IND) | - GEN_MASK(SCH_EVENT_CLCK_LOSS)), + GEN_MASK(TRX_EVENT_OFFLINE)), .out_state_mask = GEN_MASK(TRXCON_STATE_IDLE), .name = "MANAGED", .action = trxcon_fsm_managed_action, diff --git a/src/host/trxcon/trxcon.h b/src/host/trxcon/trxcon.h index 17d34089..1ab3a14b 100644 --- a/src/host/trxcon/trxcon.h +++ b/src/host/trxcon/trxcon.h @@ -19,8 +19,4 @@ enum trxcon_fsm_events { TRX_EVENT_RESET_IND, TRX_EVENT_RSP_ERROR, TRX_EVENT_OFFLINE, - - /* Scheduler specific events */ - SCH_EVENT_CLCK_IND, - SCH_EVENT_CLCK_LOSS, }; -- cgit v1.2.3