summaryrefslogtreecommitdiffstats
path: root/src/host
diff options
context:
space:
mode:
Diffstat (limited to 'src/host')
-rw-r--r--src/host/layer23/include/osmocom/bb/common/Makefile.am1
-rw-r--r--src/host/layer23/include/osmocom/bb/common/ms.h102
-rw-r--r--src/host/layer23/include/osmocom/bb/common/osmocom_data.h104
-rw-r--r--src/host/layer23/src/common/Makefile.am1
-rw-r--r--src/host/layer23/src/common/l1ctl.c1
-rw-r--r--src/host/layer23/src/common/l1l2_interface.c1
-rw-r--r--src/host/layer23/src/common/main.c18
-rw-r--r--src/host/layer23/src/common/ms.c40
-rw-r--r--src/host/layer23/src/common/sap_fsm.c1
-rw-r--r--src/host/layer23/src/common/sap_interface.c2
-rw-r--r--src/host/layer23/src/common/sim.c1
-rw-r--r--src/host/layer23/src/misc/app_cbch_sniff.c1
-rw-r--r--src/host/layer23/src/misc/app_ccch_scan.c1
-rw-r--r--src/host/layer23/src/misc/cell_log.c1
-rw-r--r--src/host/layer23/src/misc/rslms.c1
-rw-r--r--src/host/layer23/src/mobile/app_mobile.c1
-rw-r--r--src/host/layer23/src/mobile/gapk_io.c1
-rw-r--r--src/host/layer23/src/mobile/gsm322.c1
-rw-r--r--src/host/layer23/src/mobile/gsm411_sms.c1
-rw-r--r--src/host/layer23/src/mobile/gsm414.c1
-rw-r--r--src/host/layer23/src/mobile/gsm480_ss.c1
-rw-r--r--src/host/layer23/src/mobile/gsm48_cc.c1
-rw-r--r--src/host/layer23/src/mobile/gsm48_mm.c1
-rw-r--r--src/host/layer23/src/mobile/gsm48_rr.c1
-rw-r--r--src/host/layer23/src/mobile/mnccms.c1
-rw-r--r--src/host/layer23/src/mobile/script_lua.c1
-rw-r--r--src/host/layer23/src/mobile/settings.c1
-rw-r--r--src/host/layer23/src/mobile/subscriber.c1
-rw-r--r--src/host/layer23/src/mobile/support.c1
-rw-r--r--src/host/layer23/src/mobile/transaction.c1
-rw-r--r--src/host/layer23/src/mobile/voice.c1
-rw-r--r--src/host/layer23/src/mobile/vty_interface.c1
-rw-r--r--src/host/layer23/src/modem/app_modem.c1
33 files changed, 176 insertions, 118 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/Makefile.am b/src/host/layer23/include/osmocom/bb/common/Makefile.am
index 31bb6b64..8663d9cd 100644
--- a/src/host/layer23/include/osmocom/bb/common/Makefile.am
+++ b/src/host/layer23/include/osmocom/bb/common/Makefile.am
@@ -3,6 +3,7 @@ noinst_HEADERS = \
l1l2_interface.h \
l23_app.h \
logging.h \
+ ms.h \
networks.h \
gps.h \
sysinfo.h \
diff --git a/src/host/layer23/include/osmocom/bb/common/ms.h b/src/host/layer23/include/osmocom/bb/common/ms.h
new file mode 100644
index 00000000..b9c9276a
--- /dev/null
+++ b/src/host/layer23/include/osmocom/bb/common/ms.h
@@ -0,0 +1,102 @@
+/* Mobile Station */
+#pragma once
+
+#include <osmocom/core/select.h>
+#include <osmocom/gsm/gsm_utils.h>
+#include <osmocom/core/write_queue.h>
+
+/* FIXME no 'mobile' specific stuff should be here */
+#include <osmocom/bb/mobile/support.h>
+#include <osmocom/bb/mobile/settings.h>
+#include <osmocom/bb/mobile/subscriber.h>
+#include <osmocom/gsm/lapdm.h>
+#include <osmocom/bb/common/sap_interface.h>
+#include <osmocom/bb/common/sap_proto.h>
+#include <osmocom/bb/mobile/gsm48_rr.h>
+#include <osmocom/bb/common/sysinfo.h>
+#include <osmocom/bb/mobile/gsm322.h>
+#include <osmocom/bb/mobile/gsm48_mm.h>
+#include <osmocom/bb/mobile/gsm48_cc.h>
+#include <osmocom/bb/mobile/mncc_sock.h>
+#include <osmocom/bb/common/sim.h>
+#include <osmocom/bb/common/l1ctl.h>
+
+
+struct osmosap_entity {
+ struct osmo_fsm_inst *fi;
+ uint16_t max_msg_size;
+
+ /* Current state of remote SIM card */
+ enum sap_card_status_type card_status;
+
+ /* Optional SAP message call-back */
+ sap_msg_cb_t sap_msg_cb;
+ /* Optional response call-back */
+ sap_rsp_cb_t sap_rsp_cb;
+};
+
+struct osmol1_entity {
+ int (*l1_traffic_ind)(struct osmocom_ms *ms, struct msgb *msg);
+};
+
+struct osmomncc_entity {
+ int (*mncc_recv)(struct osmocom_ms *ms, int msg_type, void *arg);
+ struct mncc_sock_state *sock_state;
+ uint32_t ref;
+};
+
+/* RX measurement statistics */
+struct rx_meas_stat {
+ uint32_t last_fn;
+
+ /* cumulated values of current cell from SACCH dl */
+ uint32_t frames;
+ uint32_t snr;
+ uint32_t berr;
+ uint32_t rxlev;
+
+ /* counters loss criterion */
+ int16_t dsc, ds_fail;
+ int16_t s, rl_fail;
+};
+
+enum {
+ MS_SHUTDOWN_NONE = 0,
+ MS_SHUTDOWN_IMSI_DETACH = 1,
+ MS_SHUTDOWN_WAIT_RESET = 2,
+ MS_SHUTDOWN_COMPL = 3,
+};
+
+struct osmocom_ms {
+ struct llist_head entity;
+ char *name;
+ struct osmo_wqueue l2_wq, sap_wq;
+ uint16_t test_arfcn;
+ struct osmol1_entity l1_entity;
+
+ bool started, deleting;
+ uint8_t shutdown;
+ struct gsm_support support;
+ struct gsm_settings settings;
+ struct gsm_subscriber subscr;
+ struct gsm_sim sim;
+ struct lapdm_channel lapdm_channel;
+ struct osmosap_entity sap_entity;
+ struct rx_meas_stat meas;
+ struct gsm48_rrlayer rrlayer;
+ struct gsm322_plmn plmn;
+ struct gsm322_cellsel cellsel;
+ struct gsm48_mmlayer mmlayer;
+ struct gsm48_cclayer cclayer;
+ struct osmomncc_entity mncc_entity;
+ struct llist_head trans_list;
+
+ /* Audio I/O */
+ struct gapk_io_state *gapk_io;
+
+ void *lua_state;
+ int lua_cb_ref;
+ char *lua_script;
+};
+
+struct osmocom_ms *osmocom_ms_alloc(void *ctx);
diff --git a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
index a8af1e85..d78edc3e 100644
--- a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
+++ b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
@@ -1,108 +1,10 @@
-#ifndef osmocom_data_h
-#define osmocom_data_h
+#pragma once
-#include <osmocom/core/select.h>
-#include <osmocom/gsm/gsm_utils.h>
-#include <osmocom/core/write_queue.h>
+#include <stdint.h>
struct osmocom_ms;
struct gapk_io_state;
- /* FIXME no 'mobile' specific stuff should be here */
-#include <osmocom/bb/mobile/support.h>
-#include <osmocom/bb/mobile/settings.h>
-#include <osmocom/bb/mobile/subscriber.h>
-#include <osmocom/gsm/lapdm.h>
-#include <osmocom/bb/common/sap_interface.h>
-#include <osmocom/bb/common/sap_proto.h>
-#include <osmocom/bb/mobile/gsm48_rr.h>
-#include <osmocom/bb/common/sysinfo.h>
-#include <osmocom/bb/mobile/gsm322.h>
-#include <osmocom/bb/mobile/gsm48_mm.h>
-#include <osmocom/bb/mobile/gsm48_cc.h>
-#include <osmocom/bb/mobile/mncc_sock.h>
-#include <osmocom/bb/common/sim.h>
-#include <osmocom/bb/common/l1ctl.h>
-
-struct osmosap_entity {
- struct osmo_fsm_inst *fi;
- uint16_t max_msg_size;
-
- /* Current state of remote SIM card */
- enum sap_card_status_type card_status;
-
- /* Optional SAP message call-back */
- sap_msg_cb_t sap_msg_cb;
- /* Optional response call-back */
- sap_rsp_cb_t sap_rsp_cb;
-};
-
-struct osmol1_entity {
- int (*l1_traffic_ind)(struct osmocom_ms *ms, struct msgb *msg);
-};
-
-struct osmomncc_entity {
- int (*mncc_recv)(struct osmocom_ms *ms, int msg_type, void *arg);
- struct mncc_sock_state *sock_state;
- uint32_t ref;
-};
-
-
-/* RX measurement statistics */
-struct rx_meas_stat {
- uint32_t last_fn;
-
- /* cumulated values of current cell from SACCH dl */
- uint32_t frames;
- uint32_t snr;
- uint32_t berr;
- uint32_t rxlev;
-
- /* counters loss criterion */
- int16_t dsc, ds_fail;
- int16_t s, rl_fail;
-};
-
-enum {
- MS_SHUTDOWN_NONE = 0,
- MS_SHUTDOWN_IMSI_DETACH = 1,
- MS_SHUTDOWN_WAIT_RESET = 2,
- MS_SHUTDOWN_COMPL = 3,
-};
-
-/* One Mobilestation for osmocom */
-struct osmocom_ms {
- struct llist_head entity;
- char *name;
- struct osmo_wqueue l2_wq, sap_wq;
- uint16_t test_arfcn;
- struct osmol1_entity l1_entity;
-
- bool started, deleting;
- uint8_t shutdown;
- struct gsm_support support;
- struct gsm_settings settings;
- struct gsm_subscriber subscr;
- struct gsm_sim sim;
- struct lapdm_channel lapdm_channel;
- struct osmosap_entity sap_entity;
- struct rx_meas_stat meas;
- struct gsm48_rrlayer rrlayer;
- struct gsm322_plmn plmn;
- struct gsm322_cellsel cellsel;
- struct gsm48_mmlayer mmlayer;
- struct gsm48_cclayer cclayer;
- struct osmomncc_entity mncc_entity;
- struct llist_head trans_list;
-
- /* Audio I/O */
- struct gapk_io_state *gapk_io;
-
- void *lua_state;
- int lua_cb_ref;
- char *lua_script;
-};
-
enum osmobb_sig_subsys {
SS_L1CTL,
SS_GLOBAL,
@@ -153,5 +55,3 @@ struct osmobb_neigh_pm_ind {
uint16_t band_arfcn;
uint8_t rx_lev;
};
-
-#endif
diff --git a/src/host/layer23/src/common/Makefile.am b/src/host/layer23/src/common/Makefile.am
index 185bf044..f6578ece 100644
--- a/src/host/layer23/src/common/Makefile.am
+++ b/src/host/layer23/src/common/Makefile.am
@@ -18,6 +18,7 @@ liblayer23_a_SOURCES = \
l1l2_interface.c \
l1ctl_lapdm_glue.c \
logging.c \
+ ms.c \
networks.c \
sap_fsm.c \
sap_proto.c \
diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c
index 94079c74..2695e534 100644
--- a/src/host/layer23/src/common/l1ctl.c
+++ b/src/host/layer23/src/common/l1ctl.c
@@ -40,6 +40,7 @@
#include <osmocom/bb/common/l1ctl.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/l1l2_interface.h>
#include <osmocom/gsm/lapdm.h>
#include <osmocom/bb/common/logging.h>
diff --git a/src/host/layer23/src/common/l1l2_interface.c b/src/host/layer23/src/common/l1l2_interface.c
index 9db285f7..94303c29 100644
--- a/src/host/layer23/src/common/l1l2_interface.c
+++ b/src/host/layer23/src/common/l1l2_interface.c
@@ -18,6 +18,7 @@
*/
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/l1ctl.h>
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/l1l2_interface.h>
diff --git a/src/host/layer23/src/common/main.c b/src/host/layer23/src/common/main.c
index ae4932a5..61a8604a 100644
--- a/src/host/layer23/src/common/main.c
+++ b/src/host/layer23/src/common/main.c
@@ -18,6 +18,7 @@
*/
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/l1ctl.h>
#include <osmocom/bb/common/l1l2_interface.h>
#include <osmocom/bb/common/sap_interface.h>
@@ -265,25 +266,12 @@ int main(int argc, char **argv)
log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_BASENAME);
log_set_print_filename_pos(osmo_stderr_target, LOG_FILENAME_POS_HEADER_END);
- ms = talloc_zero(l23_ctx, struct osmocom_ms);
- if (!ms) {
- fprintf(stderr, "Failed to allocate MS\n");
- exit(1);
- }
-
print_copyright();
+ ms = osmocom_ms_alloc(l23_ctx);
+ OSMO_ASSERT(ms);
llist_add_tail(&ms->entity, &ms_list);
- ms->name = talloc_strdup(ms, "1");
- ms->test_arfcn = 871;
- ms->lapdm_channel.lapdm_dcch.l1_ctx = ms;
- ms->lapdm_channel.lapdm_dcch.l3_ctx = ms;
- ms->lapdm_channel.lapdm_acch.l1_ctx = ms;
- ms->lapdm_channel.lapdm_acch.l3_ctx = ms;
- lapdm_channel_init(&ms->lapdm_channel, LAPDM_MODE_MS);
- lapdm_channel_set_l1(&ms->lapdm_channel, l1ctl_ph_prim_cb, ms);
-
rc = l23_app_init(ms);
if (rc < 0) {
fprintf(stderr, "Failed during l23_app_init()\n");
diff --git a/src/host/layer23/src/common/ms.c b/src/host/layer23/src/common/ms.c
new file mode 100644
index 00000000..0b1ccb85
--- /dev/null
+++ b/src/host/layer23/src/common/ms.c
@@ -0,0 +1,40 @@
+/* Mobile Station */
+/* (C) 2010 by Holger Hans Peter Freyther
+ * (C) 2010 by Harald Welte <laforge@gnumonks.org>
+ * (C) 2023 by sysmocom - s.m.f.c. GmbH <info@sysmocom.de>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <osmocom/bb/common/ms.h>
+
+struct osmocom_ms *osmocom_ms_alloc(void *ctx)
+{
+ struct osmocom_ms *ms;
+
+ ms = talloc_zero(ctx, struct osmocom_ms);
+ if (!ms)
+ return NULL;
+
+ ms->name = talloc_strdup(ms, "1");
+ ms->test_arfcn = 871;
+ ms->lapdm_channel.lapdm_dcch.l1_ctx = ms;
+ ms->lapdm_channel.lapdm_dcch.l3_ctx = ms;
+ ms->lapdm_channel.lapdm_acch.l1_ctx = ms;
+ ms->lapdm_channel.lapdm_acch.l3_ctx = ms;
+ lapdm_channel_init(&ms->lapdm_channel, LAPDM_MODE_MS);
+ lapdm_channel_set_l1(&ms->lapdm_channel, l1ctl_ph_prim_cb, ms);
+
+ return ms;
+}
diff --git a/src/host/layer23/src/common/sap_fsm.c b/src/host/layer23/src/common/sap_fsm.c
index ce0a22d3..f189bc8a 100644
--- a/src/host/layer23/src/common/sap_fsm.c
+++ b/src/host/layer23/src/common/sap_fsm.c
@@ -30,6 +30,7 @@
#include <osmocom/core/write_queue.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/sap_interface.h>
diff --git a/src/host/layer23/src/common/sap_interface.c b/src/host/layer23/src/common/sap_interface.c
index c4f14535..86c70a96 100644
--- a/src/host/layer23/src/common/sap_interface.c
+++ b/src/host/layer23/src/common/sap_interface.c
@@ -34,7 +34,7 @@
#include <osmocom/bb/common/osmocom_data.h>
#include <osmocom/bb/common/logging.h>
-
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/sap_interface.h>
#include <osmocom/bb/common/sap_proto.h>
#include <osmocom/bb/common/sap_fsm.h>
diff --git a/src/host/layer23/src/common/sim.c b/src/host/layer23/src/common/sim.c
index 8e0d7993..bd50f627 100644
--- a/src/host/layer23/src/common/sim.c
+++ b/src/host/layer23/src/common/sim.c
@@ -25,6 +25,7 @@
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/l1ctl.h>
extern struct gsmtap_inst *gsmtap_inst;
diff --git a/src/host/layer23/src/misc/app_cbch_sniff.c b/src/host/layer23/src/misc/app_cbch_sniff.c
index 24caae91..d04faa93 100644
--- a/src/host/layer23/src/misc/app_cbch_sniff.c
+++ b/src/host/layer23/src/misc/app_cbch_sniff.c
@@ -19,6 +19,7 @@
*/
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/l1ctl.h>
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/l23_app.h>
diff --git a/src/host/layer23/src/misc/app_ccch_scan.c b/src/host/layer23/src/misc/app_ccch_scan.c
index cfb43922..da8223cf 100644
--- a/src/host/layer23/src/misc/app_ccch_scan.c
+++ b/src/host/layer23/src/misc/app_ccch_scan.c
@@ -32,6 +32,7 @@
#include <osmocom/bb/misc/rslms.h>
#include <osmocom/bb/misc/layer3.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/l1ctl.h>
#include <osmocom/bb/common/l23_app.h>
diff --git a/src/host/layer23/src/misc/cell_log.c b/src/host/layer23/src/misc/cell_log.c
index ab8678da..7635f1f2 100644
--- a/src/host/layer23/src/misc/cell_log.c
+++ b/src/host/layer23/src/misc/cell_log.c
@@ -37,6 +37,7 @@
#include <osmocom/bb/common/l1ctl.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/networks.h>
#include <osmocom/bb/common/gps.h>
diff --git a/src/host/layer23/src/misc/rslms.c b/src/host/layer23/src/misc/rslms.c
index afb27270..c071113b 100644
--- a/src/host/layer23/src/misc/rslms.c
+++ b/src/host/layer23/src/misc/rslms.c
@@ -30,6 +30,7 @@
#include <osmocom/bb/misc/rslms.h>
#include <osmocom/bb/misc/layer3.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/l1ctl.h>
/* Send a 'simple' RLL request to L2 */
diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c
index 5ea31c08..5bf765a7 100644
--- a/src/host/layer23/src/mobile/app_mobile.c
+++ b/src/host/layer23/src/mobile/app_mobile.c
@@ -22,6 +22,7 @@
#include <signal.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/l1l2_interface.h>
#include <osmocom/bb/common/l1ctl.h>
#include <osmocom/bb/common/logging.h>
diff --git a/src/host/layer23/src/mobile/gapk_io.c b/src/host/layer23/src/mobile/gapk_io.c
index 0a807ff3..a2a4e849 100644
--- a/src/host/layer23/src/mobile/gapk_io.c
+++ b/src/host/layer23/src/mobile/gapk_io.c
@@ -33,6 +33,7 @@
#include <osmocom/gapk/common.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/mobile/voice.h>
diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c
index b94fbafd..4b735947 100644
--- a/src/host/layer23/src/mobile/gsm322.c
+++ b/src/host/layer23/src/mobile/gsm322.c
@@ -32,6 +32,7 @@
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/l1ctl.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/networks.h>
#include <osmocom/bb/common/utils.h>
#include <osmocom/bb/mobile/vty.h>
diff --git a/src/host/layer23/src/mobile/gsm411_sms.c b/src/host/layer23/src/mobile/gsm411_sms.c
index 76355c0d..d00e94d2 100644
--- a/src/host/layer23/src/mobile/gsm411_sms.c
+++ b/src/host/layer23/src/mobile/gsm411_sms.c
@@ -30,6 +30,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/mobile/mncc.h>
#include <osmocom/bb/mobile/transaction.h>
#include <osmocom/bb/mobile/gsm411_sms.h>
diff --git a/src/host/layer23/src/mobile/gsm414.c b/src/host/layer23/src/mobile/gsm414.c
index e4a4edd5..ced15ed5 100644
--- a/src/host/layer23/src/mobile/gsm414.c
+++ b/src/host/layer23/src/mobile/gsm414.c
@@ -33,6 +33,7 @@
#include <osmocom/gsm/protocol/gsm_08_58.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/mobile/gsm48_rr.h>
diff --git a/src/host/layer23/src/mobile/gsm480_ss.c b/src/host/layer23/src/mobile/gsm480_ss.c
index b0a3dc97..139b45b7 100644
--- a/src/host/layer23/src/mobile/gsm480_ss.c
+++ b/src/host/layer23/src/mobile/gsm480_ss.c
@@ -24,6 +24,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/mobile/mncc.h>
#include <osmocom/bb/mobile/transaction.h>
#include <osmocom/bb/mobile/gsm480_ss.h>
diff --git a/src/host/layer23/src/mobile/gsm48_cc.c b/src/host/layer23/src/mobile/gsm48_cc.c
index 1be53ba4..4db19255 100644
--- a/src/host/layer23/src/mobile/gsm48_cc.c
+++ b/src/host/layer23/src/mobile/gsm48_cc.c
@@ -28,6 +28,7 @@
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/mobile/mncc.h>
#include <osmocom/bb/mobile/transaction.h>
#include <osmocom/bb/mobile/gsm48_cc.h>
diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c
index 8e3c9765..500eff6d 100644
--- a/src/host/layer23/src/mobile/gsm48_mm.c
+++ b/src/host/layer23/src/mobile/gsm48_mm.c
@@ -30,6 +30,7 @@
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/networks.h>
#include <osmocom/bb/common/l1ctl.h>
#include <osmocom/bb/common/utils.h>
diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c
index 44d74404..87a0dcd6 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -69,6 +69,7 @@
#include <osmocom/core/bitvec.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/l1l2_interface.h>
#include <osmocom/bb/common/l23_app.h>
#include <osmocom/bb/common/logging.h>
diff --git a/src/host/layer23/src/mobile/mnccms.c b/src/host/layer23/src/mobile/mnccms.c
index 5d4502ab..16cabc14 100644
--- a/src/host/layer23/src/mobile/mnccms.c
+++ b/src/host/layer23/src/mobile/mnccms.c
@@ -25,6 +25,7 @@
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/mobile/mncc.h>
#include <osmocom/bb/mobile/mncc_ms.h>
#include <osmocom/bb/mobile/vty.h>
diff --git a/src/host/layer23/src/mobile/script_lua.c b/src/host/layer23/src/mobile/script_lua.c
index f8f2bf39..eb3f0085 100644
--- a/src/host/layer23/src/mobile/script_lua.c
+++ b/src/host/layer23/src/mobile/script_lua.c
@@ -19,6 +19,7 @@
#include <lauxlib.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/mobile/app_mobile.h>
#include <osmocom/bb/common/logging.h>
diff --git a/src/host/layer23/src/mobile/settings.c b/src/host/layer23/src/mobile/settings.c
index 846cda20..b6e251bb 100644
--- a/src/host/layer23/src/mobile/settings.c
+++ b/src/host/layer23/src/mobile/settings.c
@@ -25,6 +25,7 @@
#include <osmocom/bb/common/utils.h>
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/networks.h>
static char *layer2_socket_path = "/tmp/osmocom_l2";
diff --git a/src/host/layer23/src/mobile/subscriber.c b/src/host/layer23/src/mobile/subscriber.c
index a2268893..164622a2 100644
--- a/src/host/layer23/src/mobile/subscriber.c
+++ b/src/host/layer23/src/mobile/subscriber.c
@@ -24,6 +24,7 @@
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/sap_interface.h>
#include <osmocom/bb/common/sap_proto.h>
#include <osmocom/bb/common/networks.h>
diff --git a/src/host/layer23/src/mobile/support.c b/src/host/layer23/src/mobile/support.c
index fd1ed743..e82d49f5 100644
--- a/src/host/layer23/src/mobile/support.c
+++ b/src/host/layer23/src/mobile/support.c
@@ -20,6 +20,7 @@
#include <string.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
void gsm_support_init(struct osmocom_ms *ms)
{
diff --git a/src/host/layer23/src/mobile/transaction.c b/src/host/layer23/src/mobile/transaction.c
index fd5a12d0..2fb910af 100644
--- a/src/host/layer23/src/mobile/transaction.c
+++ b/src/host/layer23/src/mobile/transaction.c
@@ -22,6 +22,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/mobile/mncc.h>
#include <osmocom/bb/mobile/transaction.h>
diff --git a/src/host/layer23/src/mobile/voice.c b/src/host/layer23/src/mobile/voice.c
index 0840ea50..7d6c2e02 100644
--- a/src/host/layer23/src/mobile/voice.c
+++ b/src/host/layer23/src/mobile/voice.c
@@ -27,6 +27,7 @@
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/mobile/gapk_io.h>
#include <osmocom/bb/mobile/mncc.h>
#include <osmocom/bb/mobile/mncc_sock.h>
diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c
index 16eedf24..ff881048 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -28,6 +28,7 @@
#include <osmocom/crypt/auth.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/networks.h>
#include <osmocom/bb/common/gps.h>
#include <osmocom/bb/mobile/mncc.h>
diff --git a/src/host/layer23/src/modem/app_modem.c b/src/host/layer23/src/modem/app_modem.c
index 1852a0db..61266f51 100644
--- a/src/host/layer23/src/modem/app_modem.c
+++ b/src/host/layer23/src/modem/app_modem.c
@@ -36,6 +36,7 @@
#include <osmocom/gprs/rlcmac/gprs_rlcmac.h>
#include <osmocom/bb/common/osmocom_data.h>
+#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/l1ctl.h>
#include <osmocom/bb/common/l23_app.h>