summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/settings.h5
-rw-r--r--src/host/layer23/src/mobile/settings.c2
-rw-r--r--src/host/layer23/src/mobile/subscriber.c2
-rw-r--r--src/host/layer23/src/mobile/vty_interface.c18
4 files changed, 26 insertions, 1 deletions
diff --git a/src/host/layer23/include/osmocom/bb/mobile/settings.h b/src/host/layer23/include/osmocom/bb/mobile/settings.h
index cdf63237..a1bce06b 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/settings.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/settings.h
@@ -1,6 +1,8 @@
#ifndef _settings_h
#define _settings_h
+#define MOB_C7_DEFLT_ANY_TIMEOUT 30
+
struct gsm_settings {
char layer2_socket_path[128];
char sap_socket_path[128];
@@ -100,6 +102,9 @@ struct gsm_settings {
uint8_t class_dtm;
uint8_t dtm_mac;
uint8_t dtm_egprs;
+
+ /* Timeout for GSM 03.22 C7 state */
+ uint8_t any_timeout;
};
struct gsm_settings_abbrev {
diff --git a/src/host/layer23/src/mobile/settings.c b/src/host/layer23/src/mobile/settings.c
index 6d50c6b3..f1c0cfcd 100644
--- a/src/host/layer23/src/mobile/settings.c
+++ b/src/host/layer23/src/mobile/settings.c
@@ -90,6 +90,8 @@ int gsm_settings_init(struct osmocom_ms *ms)
/* software features */
set->cc_dtmf = 1;
+ set->any_timeout = MOB_C7_DEFLT_ANY_TIMEOUT;
+
INIT_LLIST_HEAD(&set->abbrev);
return 0;
diff --git a/src/host/layer23/src/mobile/subscriber.c b/src/host/layer23/src/mobile/subscriber.c
index d332a077..6a30148b 100644
--- a/src/host/layer23/src/mobile/subscriber.c
+++ b/src/host/layer23/src/mobile/subscriber.c
@@ -99,7 +99,7 @@ int gsm_subscr_init(struct osmocom_ms *ms)
subscr->key_seq = 7;
/* any cell selection timer timeout */
- subscr->any_timeout = 30;
+ subscr->any_timeout = ms->settings.any_timeout;
/* init lists */
INIT_LLIST_HEAD(&subscr->plmn_list);
diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c
index 37093ce9..f8ecb28c 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -1528,6 +1528,10 @@ static void config_write_ms(struct vty *vty, struct osmocom_ms *ms)
vty_out(vty, " hplmn-search %s%s",
(set->test_always) ? "everywhere" : "foreign-country",
VTY_NEWLINE);
+ if (!hide_default || set->any_timeout != MOB_C7_DEFLT_ANY_TIMEOUT)
+ vty_out(vty, " c7-any-timeout %d%s",
+ set->any_timeout, VTY_NEWLINE);
+
/* no shutdown must be written to config, because shutdown is default */
vty_out(vty, " %sshutdown%s", (ms->shutdown != MS_SHUTDOWN_NONE) ? "" : "no ",
VTY_NEWLINE);
@@ -2170,6 +2174,19 @@ DEFUN(cfg_ms_no_neighbour, cfg_ms_no_neighbour_cmd, "no neighbour-measurement",
return CMD_SUCCESS;
}
+DEFUN(cfg_ms_any_timeout, cfg_ms_any_timeout_cmd, "c7-any-timeout <0-255>",
+ "Seconds to wait in C7 before doing a PLMN search")
+{
+ struct osmocom_ms *ms = vty->index;
+ struct gsm_settings *set = &ms->settings;
+
+ set->any_timeout = atoi(argv[0]);
+
+ vty_restart_if_started(vty, ms);
+
+ return CMD_SUCCESS;
+}
+
static int config_write_dummy(struct vty *vty)
{
return CMD_SUCCESS;
@@ -2891,6 +2908,7 @@ int ms_vty_init(void)
install_element(MS_NODE, &cfg_ms_testsim_cmd);
install_element(MS_NODE, &cfg_ms_neighbour_cmd);
install_element(MS_NODE, &cfg_ms_no_neighbour_cmd);
+ install_element(MS_NODE, &cfg_ms_any_timeout_cmd);
install_element(MS_NODE, &cfg_ms_support_cmd);
install_node(&support_node, config_write_dummy);
install_element(SUPPORT_NODE, &cfg_ms_sup_dtmf_cmd);