Change in osmo-bsc[master]: Add vty command for Ericsson sync

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/.

javi-tic gerrit-no-reply at lists.osmocom.org
Wed Mar 10 23:42:02 UTC 2021


javi-tic has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/23317 )


Change subject: Add vty command for Ericsson sync
......................................................................

Add vty command for Ericsson sync

This commit adds support for Selection of syncronization source
Options are internal for E1 and external for GPS

Change-Id: Ia3d1acd6b3442238b35fc911092e12a6ac989adb
---
M include/osmocom/bsc/abis_om2000.h
M include/osmocom/bsc/bts.h
M src/osmo-bsc/abis_om2000.c
M src/osmo-bsc/abis_om2000_vty.c
4 files changed, 39 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/17/23317/1

diff --git a/include/osmocom/bsc/abis_om2000.h b/include/osmocom/bsc/abis_om2000.h
index 62aef9d..51ec11b 100644
--- a/include/osmocom/bsc/abis_om2000.h
+++ b/include/osmocom/bsc/abis_om2000.h
@@ -43,6 +43,11 @@
 	OM2K_MO_S_DISABLED,
 };
 
+enum om2k_sync_src {
+	OM2K_SYNC_SRC_INTERNAL	= 0x00,
+	OM2K_SYNC_SRC_EXTERNAL	= 0x01,
+};
+
 /* on-wire format for IS conn group */
 struct om2k_is_conn_grp {
 	uint16_t icp1;
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index 6b58c7e..70d72a5 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -378,6 +378,7 @@
 				uint16_t limit;
 				uint16_t active;
 			} om2k_version[16];
+			int sync_src;
 		} rbs2000;
 		struct {
 			uint8_t bts_type;
diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c
index 90d558a..edcf8cf 100644
--- a/src/osmo-bsc/abis_om2000.c
+++ b/src/osmo-bsc/abis_om2000.c
@@ -1389,7 +1389,7 @@
 	fill_om2k_hdr(o2k, &bts->rbs2000.tf.om2k_mo.addr, OM2K_MSGT_TF_CONF_REQ);
 
 	msgb_tv_put(msg, OM2K_DEI_TF_MODE, OM2K_TF_MODE_STANDALONE);
-	msgb_tv_put(msg, OM2K_DEI_TF_SYNC_SRC, 0x00);
+	msgb_tv_put(msg, OM2K_DEI_TF_SYNC_SRC, bts->rbs2000.sync_src);
 	msgb_tv_fixed_put(msg, OM2K_DEI_FS_OFFSET, sizeof(fs_offset_undef), fs_offset_undef);
 
 	DEBUGP(DNM, "Tx MO=%s %s\n", abis_om2k_mo_name(&bts->rbs2000.tf.om2k_mo.addr),
@@ -3103,6 +3103,7 @@
 
 	bts_fi = om2k_bts_fsm_alloc(bts);
 	bts->rbs2000.bts_fi = bts_fi;
+	bts->rbs2000.sync_src = OM2K_SYNC_SRC_INTERNAL;
 
 	om2k_mo_init(&bts->rbs2000.cf.om2k_mo, OM2K_MO_CLS_CF, bts->nr, 0xFF, 0);
 	om2k_mo_fsm_alloc(bts_fi, OM2K_BTS_EVT_CF_DONE, bts->c0, &bts->rbs2000.cf.om2k_mo);
diff --git a/src/osmo-bsc/abis_om2000_vty.c b/src/osmo-bsc/abis_om2000_vty.c
index ef063a1..7909fc7 100644
--- a/src/osmo-bsc/abis_om2000_vty.c
+++ b/src/osmo-bsc/abis_om2000_vty.c
@@ -81,6 +81,7 @@
 				"Central Function\n"	\
 				"Transmitter\n"		\
 				"Receiver\n"
+#define OM2K_VTY_HELP "Configure OM2K specific parameters\n"
 
 DEFUN(om2k_class_inst, om2k_class_inst_cmd,
 	"bts <0-255> om2000 class " OM2K_OBJCLASS_VTY
@@ -475,10 +476,31 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN_USRATTR(cfg_bts_om2k_sync, cfg_bts_om2k_sync_cmd,
+	      X(BSC_VTY_ATTR_RESTART_ABIS_OML_LINK),
+	      "om2000 sync-source (internal|external)",
+	      OM2K_VTY_HELP
+	      "TF Synchronization Source\n"
+	      "Use Internal (E1)\n"
+	      "USe External (GPS)\n")
+{
+	struct gsm_bts *bts = vty->index;
+	if (bts->type != GSM_BTS_TYPE_RBS2000) {
+		vty_out(vty, "%% Command only works for RBS2000%s",
+			VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+	if (!strcmp(argv[0], "internal"))
+		bts->rbs2000.sync_src = OM2K_SYNC_SRC_INTERNAL;
+	if (!strcmp(argv[0], "external"))
+		bts->rbs2000.sync_src = OM2K_SYNC_SRC_EXTERNAL;
+	return CMD_SUCCESS;
+}
+
 DEFUN_USRATTR(cfg_bts_om2k_version_limit, cfg_bts_om2k_version_limit_cmd,
 	      X(BSC_VTY_ATTR_RESTART_ABIS_OML_LINK),
 	      "om2000 version-limit (oml|rsl) gen <0-99> rev <0-99>",
-	      "Configure OM2K specific parameters\n"
+	      OM2K_VTY_HELP
 	      "Configure optional maximum protocol version to negotiate\n"
 	      "Limit OML IWD version\n" "Limit RSL IWD version\n"
 	      "Generation limit\n"
@@ -656,6 +678,13 @@
 				(bts->rbs2000.om2k_version[i].limit >> 8),
 				(bts->rbs2000.om2k_version[i].limit & 0xff),
 				VTY_NEWLINE);
+	if (bts->rbs2000.sync_src >= 0) {
+		vty_out(vty, "  om2000 sync-source %s%s",
+			bts->rbs2000.sync_src != OM2K_SYNC_SRC_EXTERNAL
+			? "internal" : "external",
+			VTY_NEWLINE);
+	}
+
 }
 
 static void vty_dump_om2k_mo(struct vty *vty, const struct om2k_mo *mo, const char *pfx)
@@ -755,6 +784,7 @@
 
 	install_element(BTS_NODE, &cfg_bts_is_conn_list_cmd);
 	install_element(BTS_NODE, &cfg_bts_alt_mode_cmd);
+	install_element(BTS_NODE, &cfg_bts_om2k_sync_cmd);
 	install_element(BTS_NODE, &cfg_bts_om2k_version_limit_cmd);
 	install_element(BTS_NODE, &cfg_om2k_con_group_cmd);
 	install_element(BTS_NODE, &del_om2k_con_group_cmd);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/23317
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ia3d1acd6b3442238b35fc911092e12a6ac989adb
Gerrit-Change-Number: 23317
Gerrit-PatchSet: 1
Gerrit-Owner: javi-tic <javi at tic-ac.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210310/30d54997/attachment.htm>


More information about the gerrit-log mailing list