Change in osmocom-bb[master]: mobile: Make time spent in c7 configurable

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Holger Freyther gerrit-no-reply at lists.osmocom.org
Tue Jun 5 20:20:50 UTC 2018


Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/9407 )

Change subject: mobile: Make time spent in c7 configurable
......................................................................

mobile: Make time spent in c7 configurable

When no cell was found during the PLMN search the camp on any cell
state will be entered. LUs are prevented in this state and it will be
left after the start_any_timer has timedout. Even if camping on the
home network the state will not be left before the expiry of the timer.

For systematic tests this is producing a too high upper bound. Make it
configurable so we can succeed with a UL more quickly.

Change-Id: I25bc985cd4360d5e37d05a7b16b39eefb75ce20f
---
M src/host/layer23/include/osmocom/bb/mobile/settings.h
M src/host/layer23/src/mobile/settings.c
M src/host/layer23/src/mobile/subscriber.c
M src/host/layer23/src/mobile/vty_interface.c
4 files changed, 26 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/host/layer23/include/osmocom/bb/mobile/settings.h b/src/host/layer23/include/osmocom/bb/mobile/settings.h
index cdf6323..a1bce06 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 @@
 	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 6d50c6b..f1c0cfc 100644
--- a/src/host/layer23/src/mobile/settings.c
+++ b/src/host/layer23/src/mobile/settings.c
@@ -90,6 +90,8 @@
 	/* 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 d332a07..6a30148 100644
--- a/src/host/layer23/src/mobile/subscriber.c
+++ b/src/host/layer23/src/mobile/subscriber.c
@@ -99,7 +99,7 @@
 	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 37093ce..f8ecb28 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -1528,6 +1528,10 @@
 		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 @@
 	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 @@
 	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);

-- 
To view, visit https://gerrit.osmocom.org/9407
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I25bc985cd4360d5e37d05a7b16b39eefb75ce20f
Gerrit-Change-Number: 9407
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180605/dc4b7b11/attachment.htm>


More information about the gerrit-log mailing list