aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/main.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-01-09 13:13:37 +0100
committerHarald Welte <laforge@gnumonks.org>2016-02-15 14:18:59 +0100
commitd784e50747b8cf0ce505489e1451f75be5ccbd4b (patch)
treeb143bbf2162bea0959ba9b80cc5d1573de7d62ee /src/common/main.c
parentf58542899a91d1db0bbe9966ae98ccdf449f45d0 (diff)
Introduce new phy_link and phy_instance abstraction
This way we can model a flexible mapping between any number of PHYs, each having multiple instances, and then map BTSs with TRXx on top of those PHYs.
Diffstat (limited to 'src/common/main.c')
-rw-r--r--src/common/main.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/common/main.c b/src/common/main.c
index fabe4827..e454a28b 100644
--- a/src/common/main.c
+++ b/src/common/main.c
@@ -42,6 +42,7 @@
#include <osmocom/core/gsmtap.h>
#include <osmo-bts/gsm_data.h>
+#include <osmo-bts/phy_link.h>
#include <osmo-bts/logging.h>
#include <osmo-bts/abis.h>
#include <osmo-bts/bts.h>
@@ -284,6 +285,19 @@ int bts_main(int argc, char **argv)
exit(1);
}
+ if (!phy_link_by_num(0)) {
+ fprintf(stderr, "You need to configure at last phy0\n");
+ exit(1);
+ }
+
+ llist_for_each_entry(trx, &bts->trx_list, list) {
+ if (!trx->role_bts.l1h) {
+ fprintf(stderr, "TRX %u has no associated PHY instance\n",
+ trx->nr);
+ exit(1);
+ }
+ }
+
write_pid_file("osmo-bts");
bts_controlif_setup(bts);
@@ -317,6 +331,12 @@ int bts_main(int argc, char **argv)
exit(2);
}
+ rc = phy_links_open();
+ if (rc < 0) {
+ fprintf(stderr, "unable ot open PHY link(s)\n");
+ exit(2);
+ }
+
if (daemonize) {
rc = osmo_daemonize();
if (rc < 0) {