Change in osmo-bsc[master]: Add command to enable RX diversity to RBS2000 Allow selection of RX ...

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


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


Change subject: Add command to enable RX diversity to RBS2000 Allow  selection of RX diversity from VTY options are a,ab,b default is a so there is no change from previous behavior
......................................................................

Add command to enable RX diversity to RBS2000
Allow  selection of RX diversity from VTY
options are a,ab,b default is a so there is no change
from previous behavior

Change-Id: I430762b8cfa51060841d90ba4446de73bd557c6c
---
M include/osmocom/bsc/abis_om2000.h
M include/osmocom/bsc/bts_trx.h
M src/osmo-bsc/abis_om2000.c
M src/osmo-bsc/abis_om2000_vty.c
M src/osmo-bsc/bts_ericsson_rbs2000.c
5 files changed, 63 insertions(+), 2 deletions(-)



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

diff --git a/include/osmocom/bsc/abis_om2000.h b/include/osmocom/bsc/abis_om2000.h
index 51ec11b..ee03583 100644
--- a/include/osmocom/bsc/abis_om2000.h
+++ b/include/osmocom/bsc/abis_om2000.h
@@ -48,6 +48,12 @@
 	OM2K_SYNC_SRC_EXTERNAL	= 0x01,
 };
 
+enum om2k_rx_diversity {
+	OM2K_RX_DIVERSITY_A	= 0x02,
+	OM2K_RX_DIVERSITY_AB	= 0x03,
+	OM2K_RX_DIVERSITY_B	= 0x01,
+};
+
 /* on-wire format for IS conn group */
 struct om2k_is_conn_grp {
 	uint16_t icp1;
@@ -151,6 +157,7 @@
 
 struct vty;
 void abis_om2k_config_write_bts(struct vty *vty, struct gsm_bts *bts);
+void abis_om2k_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx);
 
 const char *abis_om2k_mo_name(const struct abis_om2k_mo *mo);
 
diff --git a/include/osmocom/bsc/bts_trx.h b/include/osmocom/bsc/bts_trx.h
index 85adc9b..998ed7a 100644
--- a/include/osmocom/bsc/bts_trx.h
+++ b/include/osmocom/bsc/bts_trx.h
@@ -76,6 +76,7 @@
 			struct {
 				struct om2k_mo om2k_mo;
 			} tx;
+			int rx_diversity;
 		} rbs2000;
 	};
 	struct gsm_bts_trx_ts ts[TRX_NR_TS];
diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c
index edcf8cf..61db437 100644
--- a/src/osmo-bsc/abis_om2000.c
+++ b/src/osmo-bsc/abis_om2000.c
@@ -1344,7 +1344,7 @@
 
 	/* OM2K_DEI_FREQ_SPEC_RX: Using trx_nr as "RX address" only works for single MCTR case */
 	msgb_tv16_put(msg, OM2K_DEI_FREQ_SPEC_RX, 0x8000 | ((uint16_t)trx->nr << 10));
-	msgb_tv_put(msg, OM2K_DEI_RX_DIVERSITY, 0x02); /* A */
+	msgb_tv_put(msg, OM2K_DEI_RX_DIVERSITY, trx->rbs2000.rx_diversity);
 
 	return abis_om2k_sendmsg(trx->bts, msg);
 }
@@ -1518,7 +1518,7 @@
 	msgb_tv_put(msg, OM2K_DEI_HSN, ts->hopping.hsn);
 	msgb_tv_put(msg, OM2K_DEI_MAIO, ts->hopping.maio);
 	msgb_tv_put(msg, OM2K_DEI_BSIC, ts->trx->bts->bsic);
-	msgb_tv_put(msg, OM2K_DEI_RX_DIVERSITY, 0x02); /* A */
+	msgb_tv_put(msg, OM2K_DEI_RX_DIVERSITY, ts->trx->rbs2000.rx_diversity);
 	msgb_tv16_put(msg, OM2K_DEI_FN_OFFSET, 0);
 	msgb_tv_put(msg, OM2K_DEI_EXT_RANGE, 0); /* Off */
 	/* Optional: Interference Rejection Combining */
@@ -3076,6 +3076,7 @@
 
 	trx_fi = om2k_trx_fsm_alloc(trx->bts->rbs2000.bts_fi, trx, OM2K_BTS_EVT_TRX_DONE);
 	trx->rbs2000.trx_fi = trx_fi;
+	trx->rbs2000.rx_diversity = OM2K_RX_DIVERSITY_A;
 
 	om2k_mo_init(&trx->rbs2000.trxc.om2k_mo, OM2K_MO_CLS_TRXC, bts->nr, 255, trx->nr);
 	om2k_mo_fsm_alloc(trx_fi, OM2K_TRX_EVT_TRXC_DONE, trx, &trx->rbs2000.trxc.om2k_mo);
diff --git a/src/osmo-bsc/abis_om2000_vty.c b/src/osmo-bsc/abis_om2000_vty.c
index 7909fc7..7050fc5 100644
--- a/src/osmo-bsc/abis_om2000_vty.c
+++ b/src/osmo-bsc/abis_om2000_vty.c
@@ -574,6 +574,32 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN_USRATTR(cfg_trx_om2k_rx_diversity,
+		  cfg_trx_om2k_rx_diversity_cmd,
+		  X(BSC_VTY_ATTR_RESTART_ABIS_RSL_LINK),
+		  "om2000 rx-diversity-mode (a|ab|b)",
+		  OM2K_VTY_HELP
+		  "RX Diversity\n"
+		  "Antenna TX/RX (A)\n"
+		  "Antenna RX (B)\n"
+		  "Both\n")
+{
+	struct gsm_bts_trx *trx = vty->index;
+
+	if (trx->bts->type != GSM_BTS_TYPE_RBS2000) {
+		vty_out(vty, "%% Command only works for RBS2000%s",
+			VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
+	if (!strcmp(argv[0], "a"))
+		trx->rbs2000.rx_diversity = OM2K_RX_DIVERSITY_A;
+	if (!strcmp(argv[0], "ab"))
+		trx->rbs2000.rx_diversity = OM2K_RX_DIVERSITY_AB;
+	if (!strcmp(argv[0], "b"))
+		trx->rbs2000.rx_diversity = OM2K_RX_DIVERSITY_B;
+	return CMD_SUCCESS;
+}
 
 DEFUN(om2k_conf_req, om2k_conf_req_cmd,
 	"configuration-request",
@@ -653,6 +679,24 @@
 	}
 }
 
+const struct value_string om2k_rx_diversity_names[4] = {
+	{ OM2K_RX_DIVERSITY_A,		"a" },
+	{ OM2K_RX_DIVERSITY_AB,		"ab" },
+	{ OM2K_RX_DIVERSITY_B,		"b" },
+	{ 0, NULL }
+};
+
+const char *rx_diversity2str(enum om2k_rx_diversity type)
+{
+	return get_value_string(om2k_rx_diversity_names, type);
+}
+
+void abis_om2k_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx)
+{
+	vty_out(vty, "   om2000 rx-diversity-mode %s%s",
+		rx_diversity2str(trx->rbs2000.rx_diversity), VTY_NEWLINE);
+}
+
 void abis_om2k_config_write_bts(struct vty *vty, struct gsm_bts *bts)
 {
 	struct is_conn_group *igrp;
@@ -789,5 +833,7 @@
 	install_element(BTS_NODE, &cfg_om2k_con_group_cmd);
 	install_element(BTS_NODE, &del_om2k_con_group_cmd);
 
+	install_element(TRX_NODE, &cfg_trx_om2k_rx_diversity_cmd);
+
 	return 0;
 }
diff --git a/src/osmo-bsc/bts_ericsson_rbs2000.c b/src/osmo-bsc/bts_ericsson_rbs2000.c
index fa0dab8..7d29657 100644
--- a/src/osmo-bsc/bts_ericsson_rbs2000.c
+++ b/src/osmo-bsc/bts_ericsson_rbs2000.c
@@ -174,6 +174,11 @@
 	abis_om2k_config_write_bts(vty, bts);
 }
 
+static void config_write_trx(struct vty *vty, struct gsm_bts_trx *trx)
+{
+	abis_om2k_config_write_trx(vty, trx);
+}
+
 static int bts_model_rbs2k_start(struct gsm_network *net);
 
 static void bts_model_rbs2k_e1line_bind_ops(struct e1inp_line *line)
@@ -201,6 +206,7 @@
 	.trx_init = bts_model_rbs2k_trx_init,
 	.oml_rcvmsg = &abis_om2k_rcvmsg,
 	.config_write_bts = &config_write_bts,
+	.config_write_trx = &config_write_trx,
 	.e1line_bind_ops = &bts_model_rbs2k_e1line_bind_ops,
 };
 

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I430762b8cfa51060841d90ba4446de73bd557c6c
Gerrit-Change-Number: 23318
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/15084a9c/attachment.htm>


More information about the gerrit-log mailing list