summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-28 22:46:29 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-28 23:18:09 +0100
commitb1b11620191d14943303a5104d845295f74750e8 (patch)
treed82d0f061180e1193e7fb9be896211c7d6d06d89
parent6fa80f274ed932b8142a9f04a652820b135483e7 (diff)
trxcon: Define event names for osmo_fsm's
-rw-r--r--src/host/trxcon/l1ctl_link.c5
-rw-r--r--src/host/trxcon/trx_if.c5
-rw-r--r--src/host/trxcon/trxcon.c9
3 files changed, 19 insertions, 0 deletions
diff --git a/src/host/trxcon/l1ctl_link.c b/src/host/trxcon/l1ctl_link.c
index 39056547..596a9d1d 100644
--- a/src/host/trxcon/l1ctl_link.c
+++ b/src/host/trxcon/l1ctl_link.c
@@ -45,6 +45,10 @@
#include "l1ctl_link.h"
#include "l1ctl.h"
+static struct value_string l1ctl_evt_names[] = {
+ { 0, NULL } /* no events? */
+};
+
static struct osmo_fsm_state l1ctl_fsm_states[] = {
[L1CTL_STATE_IDLE] = {
.out_state_mask = GEN_MASK(L1CTL_STATE_CONNECTED),
@@ -61,6 +65,7 @@ static struct osmo_fsm l1ctl_fsm = {
.states = l1ctl_fsm_states,
.num_states = ARRAY_SIZE(l1ctl_fsm_states),
.log_subsys = DL1C,
+ .event_names = l1ctl_evt_names,
};
static int l1ctl_link_read_cb(struct osmo_fd *bfd)
diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index 6ee75d3e..98e3cdd4 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -45,6 +45,10 @@
#include "logging.h"
#include "scheduler.h"
+static struct value_string trx_evt_names[] = {
+ { 0, NULL } /* no events? */
+};
+
static struct osmo_fsm_state trx_fsm_states[] = {
[TRX_STATE_OFFLINE] = {
.out_state_mask = (
@@ -76,6 +80,7 @@ static struct osmo_fsm trx_fsm = {
.states = trx_fsm_states,
.num_states = ARRAY_SIZE(trx_fsm_states),
.log_subsys = DTRX,
+ .event_names = trx_evt_names,
};
static int trx_udp_open(void *priv, struct osmo_fd *ofd, const char *host,
diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index 0250b726..60db8878 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -125,11 +125,20 @@ static struct osmo_fsm_state trxcon_fsm_states[] = {
},
};
+static const struct value_string app_evt_names[] = {
+ OSMO_VALUE_STRING(L1CTL_EVENT_CONNECT),
+ OSMO_VALUE_STRING(L1CTL_EVENT_DISCONNECT),
+ OSMO_VALUE_STRING(TRX_EVENT_OFFLINE),
+ OSMO_VALUE_STRING(TRX_EVENT_RSP_ERROR),
+ { 0, NULL }
+};
+
static struct osmo_fsm trxcon_fsm_def = {
.name = "trxcon_app_fsm",
.states = trxcon_fsm_states,
.num_states = ARRAY_SIZE(trxcon_fsm_states),
.log_subsys = DAPP,
+ .event_names = app_evt_names,
};
static void print_usage(const char *app)