Review at  https://gerrit.osmocom.org/6745

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
---
M src/host/trxcon/sched_clck.c
M src/host/trxcon/sched_trx.c
M src/host/trxcon/trxcon.c
M src/host/trxcon/trxcon.h
4 files changed, 4 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/45/6745/1

diff --git a/src/host/trxcon/sched_clck.c b/src/host/trxcon/sched_clck.c
index efb3f4c..9c1edc5 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 @@
                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 @@
 
 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 @@
                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 be7a480..cc9b1ce 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -152,6 +152,9 @@
        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 c0d5da3..f0fca16 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -99,8 +99,6 @@
                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 @@
                        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 17d3408..1ab3a14 100644
--- a/src/host/trxcon/trxcon.h
+++ b/src/host/trxcon/trxcon.h
@@ -19,8 +19,4 @@
        TRX_EVENT_RESET_IND,
        TRX_EVENT_RSP_ERROR,
        TRX_EVENT_OFFLINE,
-
-       /* Scheduler specific events */
-       SCH_EVENT_CLCK_IND,
-       SCH_EVENT_CLCK_LOSS,
 };

-- 
To view, visit https://gerrit.osmocom.org/6745
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8efac459a40f4287e3325890809991d5ef46e9b1
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>

Reply via email to