aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-octphy
diff options
context:
space:
mode:
authorPhilipp <pmaier@sysmocom.de>2016-09-22 15:40:35 +0200
committerHarald Welte <laforge@gnumonks.org>2017-01-23 12:23:17 +0000
commit2b763cc30c6cc36185f44322bc3af35a5bcbb479 (patch)
tree70b3e6f83ab4937a0726cbfbba6d33c72ac8a848 /src/osmo-bts-octphy
parent70b71507c27f8967b0aa31cad0b3070c6780f3b4 (diff)
octphy: set tx attenuation via VTY
add code to configure the transmision power via VTY Change-Id: I76bb8660eb1d8baeb6b8f69da4a6ba9ab7319981
Diffstat (limited to 'src/osmo-bts-octphy')
-rw-r--r--src/osmo-bts-octphy/l1_oml.c8
-rw-r--r--src/osmo-bts-octphy/octphy_vty.c28
2 files changed, 29 insertions, 7 deletions
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 58656256..da8ff03a 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -1373,7 +1373,13 @@ int l1if_trx_open(struct gsm_bts_trx *trx)
oc->Config.usTsc = trx->bts->bsic & 0x7;
oc->RfConfig.ulRxGainDb = plink->u.octphy.rx_gain_db;
/* FIXME: compute this based on nominal transmit power, etc. */
- oc->RfConfig.ulTxAttndB = plink->u.octphy.tx_atten_db;
+ if (plink->u.octphy.tx_atten_flag) {
+ oc->RfConfig.ulTxAttndB = plink->u.octphy.tx_atten_db;
+ } else {
+ /* Take the Tx Attn received in set radio attribures
+ * x4 is for the value in db */
+ oc->RfConfig.ulTxAttndB = (trx->max_power_red) << 2;
+ }
#if OCTPHY_MULTI_TRX == 1
LOGP(DL1C, LOGL_INFO, "Tx TRX-OPEN.req(trx=%u, rf_port=%u, arfcn=%u, "
diff --git a/src/osmo-bts-octphy/octphy_vty.c b/src/osmo-bts-octphy/octphy_vty.c
index 3ea576cb..e134fc59 100644
--- a/src/osmo-bts-octphy/octphy_vty.c
+++ b/src/osmo-bts-octphy/octphy_vty.c
@@ -136,10 +136,16 @@ DEFUN(cfg_phy_rx_gain_db, cfg_phy_rx_gain_db_cmd,
}
DEFUN(cfg_phy_tx_atten_db, cfg_phy_tx_atten_db_cmd,
- "octphy tx-attenuation <0-359>",
- OCT_STR "Configure the Tx Attenuation in quarter-dB\n"
- "Tx attenuation in quarter-dB\n")
+ "octphy tx-attenuation (oml|<0-359>)",
+ OCT_STR "Set attenuation on transmitted RF\n"
+ "Use tx-attenuation according to OML instructions from BSC\n"
+ "Fixed tx-attenuation in quarter-dB\n")
{
+
+
+
+
+
struct phy_link *plink = vty->index;
if (plink->state != PHY_LINK_SHUTDOWN) {
@@ -148,7 +154,12 @@ DEFUN(cfg_phy_tx_atten_db, cfg_phy_tx_atten_db_cmd,
return CMD_WARNING;
}
- plink->u.octphy.tx_atten_db = atoi(argv[0]);
+ if (strcmp(argv[0], "oml") == 0) {
+ plink->u.octphy.tx_atten_flag = false;
+ } else {
+ plink->u.octphy.tx_atten_db = atoi(argv[0]);
+ plink->u.octphy.tx_atten_flag = true;
+ }
return CMD_SUCCESS;
}
@@ -202,8 +213,13 @@ void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink)
VTY_NEWLINE);
vty_out(vty, " rx-gain %u%s", plink->u.octphy.rx_gain_db,
VTY_NEWLINE);
- vty_out(vty, " tx-attenuation %u%s", plink->u.octphy.tx_atten_db,
- VTY_NEWLINE);
+
+ if (plink->u.octphy.tx_atten_flag) {
+ vty_out(vty, " tx-attenuation %u%s",
+ plink->u.octphy.tx_atten_db, VTY_NEWLINE);
+ } else
+ vty_out(vty, " tx-attenuation oml%s", VTY_NEWLINE);
+
vty_out(vty, " rf-port-index %u%s", plink->u.octphy.rf_port_index,
VTY_NEWLINE);
}