aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_ctrl_commands.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-04-01 15:34:35 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-04-01 15:34:35 +0200
commit878da382e08444c36299f1c4236c233c6acc11b3 (patch)
treea41681dbaa4f11816c8d2392bc057a44886bca4a /openbsc/src/libbsc/bsc_ctrl_commands.c
parent5047390eefae72d50cfc4cf821a70eba9d55d255 (diff)
WIP bts: Enable GPRS using OML if it wasn't enabledzecke/hacks/gprs-state
Diffstat (limited to 'openbsc/src/libbsc/bsc_ctrl_commands.c')
-rw-r--r--openbsc/src/libbsc/bsc_ctrl_commands.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/bsc_ctrl_commands.c b/openbsc/src/libbsc/bsc_ctrl_commands.c
index 368d0e7c6..e487fe8bf 100644
--- a/openbsc/src/libbsc/bsc_ctrl_commands.c
+++ b/openbsc/src/libbsc/bsc_ctrl_commands.c
@@ -327,11 +327,29 @@ static int get_bts_gprs_mode(struct ctrl_cmd *cmd, void *data)
return CTRL_CMD_REPLY;
}
+static void oml_activate(struct gsm_bts *bts)
+{
+ if (!is_ipaccess_bts(bts)) {
+ LOGP(DCTRL, LOGL_ERROR, "GPRS activation only possible with IP.\n");
+ return;
+ }
+
+ if (bts->gprs.nse.mo.nm_state.operational != NM_OPSTATE_ENABLED) {
+ bts_model_nanobts_start_nse(bts);
+ bts_model_nanobts_start_cell(bts);
+ bts_model_nanobts_start_nsvc(bts);
+ }
+}
+
static int set_bts_gprs_mode(struct ctrl_cmd *cmd, void *data)
{
struct gsm_bts *bts = cmd->node;
+ enum bts_gprs_mode old_mode = bts->gprs.mode;
bts->gprs.mode = bts_gprs_mode_parse(cmd->value, NULL);
+ if (old_mode == BTS_GPRS_NONE && bts->gprs.mode != old_mode)
+ oml_activate(bts);
+
return get_bts_gprs_mode(cmd, data);
}