From 0c8f9ca30bafdc571f1f93361c6193c45d727aed Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sat, 16 Mar 2013 16:31:26 +0100 Subject: Add VTY option to set GPRS network-control-order to enable MS measurements In order to enable GPRS downlink measurements at mobile, the network-control-order must be set to nc1. --- openbsc/include/openbsc/gsm_data_shared.h | 1 + openbsc/src/libbsc/bsc_vty.c | 23 +++++++++++++++++++++++ openbsc/src/libbsc/system_information.c | 1 + 3 files changed, 25 insertions(+) (limited to 'openbsc') diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 83758b127..f5ab47327 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -658,6 +658,7 @@ struct gsm_bts { } cell; struct gsm_bts_gprs_nsvc nsvc[2]; uint8_t rac; + uint8_t net_ctrl_ord; } gprs; /* RACH NM values */ diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 8027a630a..0875e1a8a 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -418,6 +418,8 @@ static void config_write_bts_gprs(struct vty *vty, struct gsm_bts *bts) vty_out(vty, " gprs routing area %u%s", bts->gprs.rac, VTY_NEWLINE); + vty_out(vty, " gprs network-control-order nc%u%s", + bts->gprs.net_ctrl_ord, VTY_NEWLINE); vty_out(vty, " gprs cell bvci %u%s", bts->gprs.cell.bvci, VTY_NEWLINE); for (i = 0; i < ARRAY_SIZE(bts->gprs.cell.timer); i++) @@ -2288,6 +2290,26 @@ DEFUN(cfg_bts_gprs_rac, cfg_bts_gprs_rac_cmd, return CMD_SUCCESS; } +DEFUN(cfg_bts_gprs_net_ctrl_ord, cfg_bts_gprs_net_ctrl_ord_cmd, + "gprs network-control-order (nc0|nc1|nc2)", + GPRS_TEXT + "GPRS Network Control Order\n" + "MS controlled cell re-selection, no measurement reporting\n" + "MS controlled cell re-selection, MS sends measurement reports\n" + "Network controlled cell re-selection, MS sends measurement reports\n") +{ + struct gsm_bts *bts = vty->index; + + if (bts->gprs.mode == BTS_GPRS_NONE) { + vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); + return CMD_WARNING; + } + + bts->gprs.net_ctrl_ord = atoi(argv[0] + 2); + + return CMD_SUCCESS; +} + DEFUN(cfg_bts_gprs_mode, cfg_bts_gprs_mode_cmd, "gprs mode (none|gprs|egprs)", GPRS_TEXT @@ -3082,6 +3104,7 @@ int bsc_vty_init(const struct log_info *cat) install_element(BTS_NODE, &cfg_bts_gprs_mode_cmd); install_element(BTS_NODE, &cfg_bts_gprs_ns_timer_cmd); install_element(BTS_NODE, &cfg_bts_gprs_rac_cmd); + install_element(BTS_NODE, &cfg_bts_gprs_net_ctrl_ord_cmd); install_element(BTS_NODE, &cfg_bts_gprs_bvci_cmd); install_element(BTS_NODE, &cfg_bts_gprs_cell_timer_cmd); install_element(BTS_NODE, &cfg_bts_gprs_nsei_cmd); diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index acf713414..88b81dcb1 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -791,6 +791,7 @@ static int generate_si13(uint8_t *output, struct gsm_bts *bts) si13->header.system_information = GSM48_MT_RR_SYSINFO_13; si13_default.no_pbcch.rac = bts->gprs.rac; + si13_default.no_pbcch.net_ctrl_ord = bts->gprs.net_ctrl_ord; ret = rest_octets_si13(si13->rest_octets, &si13_default); if (ret < 0) -- cgit v1.2.3