summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-01-17 14:50:16 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-02-21 17:25:00 +0700
commitea041c008a0fbca06918103d838d4efcef94ac71 (patch)
treece8e11556691348541eb69da7b876c6a9177f304 /src
parentac486d581750f735283c7d194f6757935158b739 (diff)
trxcon/l1ctl_link.c: use TRXCON_EV_L1CTL_REQ event
Diffstat (limited to 'src')
-rw-r--r--src/host/trxcon/l1ctl_link.c9
-rw-r--r--src/host/trxcon/trxcon_fsm.c7
2 files changed, 14 insertions, 2 deletions
diff --git a/src/host/trxcon/l1ctl_link.c b/src/host/trxcon/l1ctl_link.c
index 5a22c7ee..aea23bd2 100644
--- a/src/host/trxcon/l1ctl_link.c
+++ b/src/host/trxcon/l1ctl_link.c
@@ -113,8 +113,13 @@ static int l1ctl_link_read_cb(struct osmo_fd *bfd)
LOGP(DL1D, LOGL_DEBUG, "RX: '%s'\n",
osmo_hexdump(msg->data, msg->len));
- /* Call L1CTL handler */
- l1ctl_rx_cb(l1l, msg);
+ /* Pass a message to the parent FSM */
+ rc = osmo_fsm_inst_dispatch(l1l->fsm->proc.parent,
+ TRXCON_EV_L1CTL_REQ, msg);
+ if (rc) {
+ msgb_free(msg);
+ return rc;
+ }
return 0;
}
diff --git a/src/host/trxcon/trxcon_fsm.c b/src/host/trxcon/trxcon_fsm.c
index 69a2da1b..f90f88ba 100644
--- a/src/host/trxcon/trxcon_fsm.c
+++ b/src/host/trxcon/trxcon_fsm.c
@@ -27,6 +27,7 @@
#include <logging.h>
#include <trxcon.h>
+#include <l1ctl.h>
static void trxcon_fsm_idle_action(struct osmo_fsm_inst *fi,
uint32_t event, void *data)
@@ -44,6 +45,8 @@ static void trxcon_fsm_idle_action(struct osmo_fsm_inst *fi,
static void trxcon_fsm_managed_action(struct osmo_fsm_inst *fi,
uint32_t event, void *data)
{
+ struct trxcon_inst *trxcon = (struct trxcon_inst *) fi->priv;
+
switch ((enum trxcon_event_type) event) {
case TRXCON_EV_L1CTL_DISCONNECT:
/* TODO: reset TRX interface */
@@ -53,6 +56,10 @@ static void trxcon_fsm_managed_action(struct osmo_fsm_inst *fi,
/* TODO: notify L1CTL interface */
osmo_fsm_inst_state_chg(fi, TRXCON_ST_IDLE, 0, 0);
break;
+ case TRXCON_EV_L1CTL_REQ:
+ OSMO_ASSERT(data != NULL);
+ l1ctl_rx_cb(trxcon->l1l, (struct msgb *) data);
+ break;
default:
LOGPFSML(fi, LOGL_ERROR, "Unhandled event '%s'\n",
osmo_fsm_event_name(&trxcon_fsm_def, event));