[PATCH] osmocom-bb[master]: host/trxcon: bind L1CTL link with TRX and vice versa

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Feb 22 15:32:38 UTC 2018


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

host/trxcon: bind L1CTL link with TRX and vice versa

Change-Id: I575f8699bf06fd5e86f7935c6ab3216db5a26ec5
---
M src/host/trxcon/l1ctl_link.h
M src/host/trxcon/trx_if.h
M src/host/trxcon/trxcon.c
3 files changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/98/6698/1

diff --git a/src/host/trxcon/l1ctl_link.h b/src/host/trxcon/l1ctl_link.h
index 620dde5..43d187a 100644
--- a/src/host/trxcon/l1ctl_link.h
+++ b/src/host/trxcon/l1ctl_link.h
@@ -8,6 +8,9 @@
 #define L1CTL_LENGTH 256
 #define L1CTL_HEADROOM 32
 
+/* Forward declaration to avoid mutual include */
+struct trx_instance;
+
 enum l1ctl_fsm_states {
 	L1CTL_STATE_IDLE = 0,
 	L1CTL_STATE_CONNECTED,
@@ -17,6 +20,9 @@
 	struct osmo_fsm_inst *fsm;
 	struct osmo_fd listen_bfd;
 	struct osmo_wqueue wq;
+
+	/* Bind TRX instance */
+	struct trx_instance *trx;
 };
 
 int l1ctl_link_init(struct l1ctl_link **l1l, const char *sock_path);
diff --git a/src/host/trxcon/trx_if.h b/src/host/trxcon/trx_if.h
index 4d9e470..5e9aeba 100644
--- a/src/host/trxcon/trx_if.h
+++ b/src/host/trxcon/trx_if.h
@@ -8,6 +8,9 @@
 #include "scheduler.h"
 #include "sched_trx.h"
 
+/* Forward declaration to avoid mutual include */
+struct l1ctl_link;
+
 enum trx_fsm_states {
 	TRX_STATE_OFFLINE = 0,
 	TRX_STATE_IDLE,
@@ -29,6 +32,9 @@
 	/* Scheduler stuff */
 	struct trx_sched sched;
 	struct llist_head ts_list;
+
+	/* Bind L1CTL link */
+	struct l1ctl_link *l1l;
 };
 
 struct trx_ctrl_msg {
diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index 32de253..de69db1 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -301,6 +301,10 @@
 	if (rc)
 		goto exit;
 
+	/* Bind L1CTL with TRX and vice versa */
+	app_data.l1l->trx = app_data.trx;
+	app_data.trx->l1l = app_data.l1l;
+
 	/* Init scheduler */
 	rc = sched_trx_init(app_data.trx);
 	if (rc)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I575f8699bf06fd5e86f7935c6ab3216db5a26ec5
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list