summaryrefslogtreecommitdiffstats
path: root/src/host/trxcon/trxcon.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2016-07-22 22:57:50 +0600
committerVadim Yanitskiy <axilirator@gmail.com>2017-11-19 17:35:07 +0700
commit9f5fefe792628d995945158e653b388c01969d86 (patch)
tree62914327bd9488840ee8beab248821f590338d87 /src/host/trxcon/trxcon.c
parent8975b437ed476a1655e19b68d113bc93c468b087 (diff)
host/trxcon: initial release of L1CTL interface
There are two sides of the 'OsmocomBB <-> SDR' bridge. One of them is the L1CTL interface, which is used by existing layer23 applications to drive GSM L1. Exactly this interface is provided by the osmocon application, but instead of forwarding messages between both host software and firmware we need to handle incoming messages from layer23 applications, perform some GSM L1 specific conversations (coding, mapping, interleaving, etc.), then finally forward them to transceiver through the scheduler. And vice versa. This code is just a basic implementation of UNIX socket handlers, so currently we can only accept and drop connections from layer23 applications. Change-Id: I58d069bcc7742b42c0bf95e52063933bf2c352ff
Diffstat (limited to 'src/host/trxcon/trxcon.c')
-rw-r--r--src/host/trxcon/trxcon.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index 03664ca6..4ad8a0cc 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -36,6 +36,7 @@
#include <osmocom/core/application.h>
#include "logging.h"
+#include "l1ctl_link.h"
#define COPYRIGHT \
"Copyright (C) 2016-2017 by Vadim Yanitskiy <axilirator@gmail.com>\n" \
@@ -49,9 +50,12 @@ static struct {
int daemonize;
int quit;
+ /* L1CTL specific */
+ struct l1ctl_link *l1l;
+ const char *bind_socket;
+
const char *trx_ip;
uint16_t trx_base_port;
- const char *bind_socket;
} app_data;
void *tall_trx_ctx = NULL;
@@ -168,10 +172,12 @@ int main(int argc, char **argv)
/* Init logging system */
trx_log_init(app_data.debug_mask);
- /* Currently nothing to do */
- print_usage(argv[0]);
- print_help();
- goto exit;
+ /* Init L1CTL server */
+ rc = l1ctl_link_init(&app_data.l1l, app_data.bind_socket);
+ if (rc)
+ goto exit;
+
+ LOGP(DAPP, LOGL_NOTICE, "Init complete\n");
if (app_data.daemonize) {
rc = osmo_daemonize();
@@ -185,6 +191,9 @@ int main(int argc, char **argv)
osmo_select_main(0);
exit:
+ /* Close active connections */
+ l1ctl_link_shutdown(app_data.l1l);
+
/* Make Valgrind happy */
log_fini();
talloc_free(tall_trx_ctx);