aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-05-27 01:26:31 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-06-07 19:09:06 +0200
commit958f259f9592e3729a2ebf4084d8f37bdba6bf3c (patch)
tree3ca9a7de640b28ef6f40578df4c036440f8a4cb1 /include
parent8f2aaf47c910a984de370774e6910ea5d453983e (diff)
dissolve libbsc: move all to src/osmo-bsc, link .o files
Move all of libbsc/ into osmo-bsc/, and separate/move some implementations to allow linking from utils/* and ipaccess/* without pulling in unccessary dependencies. Some utilities use gsm_network and gsm_bts structs, which already include data structures for fairly advanced uses. Move initialization that only osmo-bsc needs into new bsc_network_init() and bsc_bts_alloc_register() functions, so that the leaner tools can use the old gsm_* versions without the need to link everything (e.g. handover and lchan alloc code). In some instances, there need to be stubs if to cut off linking "just before the RSL level" and prevent dependencies from creeping in. - abis_rsl_rcvmsg(): the only program currently interpreting RSL messages is osmo-bsc, the utils are merely concerned with OML, if at all. - paging_flush_bts(): ip.access nanobts models call this when the RSL link is dropped. Only osmo-bsc actually needs to do anything there. - on_gsm_ts_init(): the mechanism to trigger timeslot initialization is related to OML, while this action to take on init would pull in RSL dependencies. utils/ and ipaccess/ each have a stubs.c file to implement these stubs. Tests implement stubs inline where required. From src/utils/, src/ipaccess/ and tests/*/, link in .o files from osmo-bsc/. In order for this to work, the osmo-bsc subdir must be built before the other source trees. (An alternative would be to include the .c files as sources, but that would re-compile them in every source tree. Not a large burden really, but unless linking .o files gives problems, let's have the quicker build.) Minor obvious cleanups creep in with this patch, I will not bother to name them individually now unless code review asks me to. Rationale: 1) libbsc has been separate to use it for osmo-nitb and osmo-bsc in the old openbsc.git. This is no longer required, and spreading over libbsc and osmo-bsc is distracting. 2) Recently, ridiculous linking requirements have made adding new functions cumbersome, because libbsc has started depending on osmo-bsc/*.c implementations: on gscon FSM and bssap functions. For example, neither bs11_config nor ipaccess-config nor bts_test need handover_cfg or BSSMAP message composition. It makes no sense to link the entire osmo-bsc to it, nor do we want to keep adding stubs to each linking realm. Change-Id: I36a586726f5818121abe54d25654819fc451d3bf
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/bsc/Makefile.am1
-rw-r--r--include/osmocom/bsc/bss.h1
-rw-r--r--include/osmocom/bsc/chan_alloc.h1
-rw-r--r--include/osmocom/bsc/common_bsc.h5
-rw-r--r--include/osmocom/bsc/gsm_data.h11
5 files changed, 8 insertions, 11 deletions
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 0987be9dd..5fa39ebc5 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -12,7 +12,6 @@ noinst_HEADERS = \
bss.h \
bts_ipaccess_nanobts_omlattr.h \
chan_alloc.h \
- common_bsc.h \
ctrl.h \
debug.h \
e1_config.h \
diff --git a/include/osmocom/bsc/bss.h b/include/osmocom/bsc/bss.h
index 9891f5f1d..ecb68d627 100644
--- a/include/osmocom/bsc/bss.h
+++ b/include/osmocom/bsc/bss.h
@@ -7,7 +7,6 @@ struct msgb;
/* start and stop network */
extern int bsc_network_alloc(void);
-extern int bsc_network_configure(const char *cfg_file);
extern int bsc_shutdown_net(struct gsm_network *net);
/* register all supported BTS */
diff --git a/include/osmocom/bsc/chan_alloc.h b/include/osmocom/bsc/chan_alloc.h
index 98568a50f..f3aec9dd5 100644
--- a/include/osmocom/bsc/chan_alloc.h
+++ b/include/osmocom/bsc/chan_alloc.h
@@ -45,7 +45,6 @@ void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts);
void network_chan_load(struct pchan_load *pl, struct gsm_network *net);
void bts_update_t3122_chan_load(struct gsm_bts *bts);
-bool trx_is_usable(const struct gsm_bts_trx *trx);
bool ts_is_usable(const struct gsm_bts_trx_ts *ts);
#endif /* _CHAN_ALLOC_H */
diff --git a/include/osmocom/bsc/common_bsc.h b/include/osmocom/bsc/common_bsc.h
deleted file mode 100644
index c23d20cb5..000000000
--- a/include/osmocom/bsc/common_bsc.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#pragma once
-
-#include <stdint.h>
-
-struct gsm_network *bsc_network_init(void *ctx);
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index b1fceb3ea..a8d1f92b9 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -997,6 +997,8 @@ struct gsm_bts {
};
+struct gsm_network *gsm_network_init(void *ctx);
+
struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, uint8_t bts_num);
struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num);
@@ -1378,9 +1380,8 @@ struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_network *ne
struct gsm_subscriber_connection *msc_subscr_con_allocate(struct gsm_network *network);
void msc_subscr_con_free(struct gsm_subscriber_connection *conn);
-struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net,
- enum gsm_bts_type type,
- uint8_t bsic);
+struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, enum gsm_bts_type type, uint8_t bsic);
+struct gsm_bts *bsc_bts_alloc_register(struct gsm_network *net, enum gsm_bts_type type, uint8_t bsic);
void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr,
uint8_t e1_ts, uint8_t e1_ts_ss);
@@ -1418,4 +1419,8 @@ void gsm_ts_check_init(struct gsm_bts_trx_ts *ts);
void gsm_trx_mark_all_ts_uninitialized(struct gsm_bts_trx *trx);
void gsm_bts_mark_all_ts_uninitialized(struct gsm_bts *bts);
+bool trx_is_usable(const struct gsm_bts_trx *trx);
+
+bool on_gsm_ts_init(struct gsm_bts_trx_ts *ts);
+
#endif /* _GSM_DATA_H */