Change in osmocom-bb[master]: trxcon/l1ctl_link.c: use TRXCON_EV_L1CTL_REQ event

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Thu Jan 17 12:40:12 UTC 2019


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/12611


Change subject: trxcon/l1ctl_link.c: use TRXCON_EV_L1CTL_REQ event
......................................................................

trxcon/l1ctl_link.c: use TRXCON_EV_L1CTL_REQ event

Change-Id: I9ad19c158397f73ab1b6639a34ce20fc7a7431b3
---
M src/host/trxcon/l1ctl_link.c
M src/host/trxcon/trxcon_fsm.c
2 files changed, 14 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/11/12611/1

diff --git a/src/host/trxcon/l1ctl_link.c b/src/host/trxcon/l1ctl_link.c
index 5a22c7e..aea23bd 100644
--- a/src/host/trxcon/l1ctl_link.c
+++ b/src/host/trxcon/l1ctl_link.c
@@ -113,8 +113,13 @@
 	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 69a2da1..f90f88b 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_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 @@
 		/* 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));

-- 
To view, visit https://gerrit.osmocom.org/12611
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ad19c158397f73ab1b6639a34ce20fc7a7431b3
Gerrit-Change-Number: 12611
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190117/f987f4b7/attachment.htm>


More information about the gerrit-log mailing list