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

pespin gerrit-no-reply at lists.osmocom.org
Mon Mar 15 10:04:30 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/23317 )

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

Add vty command for Ericsson RBS2000 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, 37 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



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..0c0e467 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -15,6 +15,7 @@
 #include "osmocom/bsc/gsm_data.h"
 #include "osmocom/bsc/bts_trx.h"
 #include "osmocom/bsc/bts_sm.h"
+#include "osmocom/bsc/abis_om2000.h"
 
 enum bts_counter_id {
 	BTS_CTR_CHREQ_TOTAL,
@@ -378,6 +379,7 @@
 				uint16_t limit;
 				uint16_t active;
 			} om2k_version[16];
+			enum om2k_sync_src 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..0c35b8f 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;
+	else 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,10 @@
 				(bts->rbs2000.om2k_version[i].limit >> 8),
 				(bts->rbs2000.om2k_version[i].limit & 0xff),
 				VTY_NEWLINE);
+	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 +781,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: 4
Gerrit-Owner: javi-tic <javi at tic-ac.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: keith <keith at rhizomatica.org>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: tnt <tnt at 246tNt.com>
Gerrit-CC: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210315/d3d68ada/attachment.htm>


More information about the gerrit-log mailing list