summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-07-08 18:16:42 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-10-23 22:05:49 +0330
commitd102624d2660777f6911fcc4712ba33900726cc2 (patch)
tree5709ccc91a1a69de28620dc39014d02f4d5f7173
parent52fd453181ce320cd426fe113b21e16e6b8b9cba (diff)
host/trxcon: bind L1CTL link with TRX and vice versa
-rw-r--r--src/host/trxcon/l1ctl_link.h6
-rw-r--r--src/host/trxcon/trx_if.h6
-rw-r--r--src/host/trxcon/trxcon.c4
3 files changed, 16 insertions, 0 deletions
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 l1ctl_link {
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 @@ struct trx_instance {
/* 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 @@ int main(int argc, char **argv)
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)