[PATCH] openbsc[master]: Implement VTY configuration to control Early Classmark Sending

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Jan 26 14:26:28 UTC 2017


Review at  https://gerrit.osmocom.org/1690

Implement VTY configuration to control Early Classmark Sending

The SI3 rest octests contain a flag that indicates if early classmark
sending is allowed in this cell or not.  So far we always set this to
one, now it is configurable using the 'early-classmark-sending' command
at the VTY node.

Change-Id: Ia0b1cc5ab45673f3da70c59ae8917eba343f9862
---
M openbsc/include/openbsc/gsm_data_shared.h
M openbsc/src/libbsc/bsc_vty.c
M openbsc/src/libbsc/system_information.c
3 files changed, 27 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/90/1690/1

diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h
index 9407b82..5b05016 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -803,6 +803,7 @@
 			uint16_t scramble_list[MAX_EARFCN_LIST];
 		} data;
 	} si_common;
+	bool early_classmark_allowed;
 
 	/* do we use static (user-defined) system information messages? (bitmask) */
 	uint32_t si_mode_static;
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 01ee4df..b28d4de 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -274,6 +274,9 @@
 		bts->si_common.chan_desc.bs_ag_blks_res, VTY_NEWLINE);
 	vty_out(vty, "System Information present: 0x%08x, static: 0x%08x%s",
 		bts->si_valid, bts->si_mode_static, VTY_NEWLINE);
+	vty_out(vty, "Early Classmark Sending: %s%s",
+		bts->early_classmark_allowed ? "allowed" : "forbidden",
+		VTY_NEWLINE);
 	if (is_ipaccess_bts(bts))
 		vty_out(vty, "  Unit ID: %u/%u/0, OML Stream ID 0x%02x%s",
 			bts->ip_access.site_id, bts->ip_access.bts_id,
@@ -641,6 +644,8 @@
 				VTY_NEWLINE);
 		}
 	}
+	vty_out(vty, "  early-classmark-sending %s%s",
+		bts->early_classmark_allowed ? "allowed" : "forbidden", VTY_NEWLINE);
 	switch (bts->type) {
 	case GSM_BTS_TYPE_NANOBTS:
 	case GSM_BTS_TYPE_OSMO_SYSMO:
@@ -2674,6 +2679,23 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(cfg_bts_early_cm, cfg_bts_early_cm_cmd,
+	"early-classmark-sending (allowed|forbidden)",
+	"Early Classmark Sending\n"
+	"Early Classmark Sending is allowed\n"
+	"Early Classmark Sending is forbidden\n")
+{
+	struct gsm_bts *bts = vty->index;
+	int rc, type;
+
+	if (!strcmp(argv[0], "allowed"))
+		bts->early_classmark_allowed = true;
+	else
+		bts->early_classmark_allowed = false;
+
+	return CMD_SUCCESS;
+}
+
 DEFUN(cfg_bts_neigh_mode, cfg_bts_neigh_mode_cmd,
 	"neighbor-list mode (automatic|manual|manual-si5)",
 	"Neighbor List\n" "Mode of Neighbor List generation\n"
@@ -3955,6 +3977,7 @@
 	install_element(BTS_NODE, &cfg_bts_pag_free_cmd);
 	install_element(BTS_NODE, &cfg_bts_si_mode_cmd);
 	install_element(BTS_NODE, &cfg_bts_si_static_cmd);
+	install_element(BTS_NODE, &cfg_bts_early_cm_cmd);
 	install_element(BTS_NODE, &cfg_bts_neigh_mode_cmd);
 	install_element(BTS_NODE, &cfg_bts_neigh_cmd);
 	install_element(BTS_NODE, &cfg_bts_si5_neigh_cmd);
@@ -4029,6 +4052,7 @@
 	abis_nm_vty_init();
 	abis_om2k_vty_init();
 	e1inp_vty_init();
+	osmo_fsm_vty_add_cmds();
 
 	bsc_vty_init_extra();
 
diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c
index e71490e..a2dd827 100644
--- a/openbsc/src/libbsc/system_information.c
+++ b/openbsc/src/libbsc/system_information.c
@@ -764,6 +764,8 @@
 	} else {
 		si_info.si2quater_indicator = 0;
 	}
+	si_info.early_cm_ctrl = bts->early_classmark_allowed;
+
 	/* SI3 Rest Octets (10.5.2.34), containing
 		CBQ, CELL_RESELECT_OFFSET, TEMPORARY_OFFSET, PENALTY_TIME
 		Power Offset, 2ter Indicator, Early Classmark Sending,

-- 
To view, visit https://gerrit.osmocom.org/1690
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia0b1cc5ab45673f3da70c59ae8917eba343f9862
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>


More information about the gerrit-log mailing list