From 838a2043a0131f0964ce9bb05637ea1aa7037fec Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Mon, 8 Jul 2013 18:44:44 +0200 Subject: trx: Add option to set transmit power reduction via OML (BSC) --- src/osmo-bts-trx/l1_if.c | 7 +++++++ src/osmo-bts-trx/l1_if.h | 1 + src/osmo-bts-trx/trx_vty.c | 28 ++++++++++++++++++++++++++-- 3 files changed, 34 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 0575a429..a135d442 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -330,6 +330,13 @@ static uint8_t trx_set_trx(struct gsm_bts_trx *trx) l1if_provision_transceiver_trx(l1h); } + if (l1h->config.power_oml) { + l1h->config.power = trx->max_power_red; + l1h->config.power_valid = 1; + l1h->config.power_sent = 0; + l1if_provision_transceiver_trx(l1h); + } + return 0; } diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h index 5b4dce3c..5110cde1 100644 --- a/src/osmo-bts-trx/l1_if.h +++ b/src/osmo-bts-trx/l1_if.h @@ -127,6 +127,7 @@ struct trx_config { int power_valid; int power; + int power_oml; int power_sent; int maxdly_valid; diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 4e675921..ebc7cfdb 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -233,6 +233,24 @@ DEFUN(cfg_trx_power, cfg_trx_power_cmd, struct trx_l1h *l1h = trx_l1h_hdl(trx); l1h->config.power = atoi(argv[0]); + l1h->config.power_oml = 0; + l1h->config.power_valid = 1; + l1h->config.power_sent = 0; + l1if_provision_transceiver_trx(l1h); + + return CMD_SUCCESS; +} + +DEFUN(cfg_trx_poweroml_, cfg_trx_power_oml_cmd, + "power oml", + "Set the transmitter power dampening\n" + "Given by NM_ATT_RF_MAXPOWR_R (max power reduction) via OML\n") +{ + struct gsm_bts_trx *trx = vty->index; + struct trx_l1h *l1h = trx_l1h_hdl(trx); + + l1h->config.power = trx->max_power_red; + l1h->config.power_oml = 1; l1h->config.power_valid = 1; l1h->config.power_sent = 0; l1if_provision_transceiver_trx(l1h); @@ -338,8 +356,13 @@ void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) if (l1h->config.rxgain_valid) vty_out(vty, " rxgain %d%s", l1h->config.rxgain, VTY_NEWLINE); - if (l1h->config.power_valid) - vty_out(vty, " power %d%s", l1h->config.power, VTY_NEWLINE); + if (l1h->config.power_valid) { + if (l1h->config.power_oml) + vty_out(vty, " power oml%s", VTY_NEWLINE); + else + vty_out(vty, " power %d%s", l1h->config.power, + VTY_NEWLINE); + } if (l1h->config.maxdly_valid) vty_out(vty, " maxdly %d%s", l1h->config.maxdly, VTY_NEWLINE); if (l1h->config.slotmask != 0xff) @@ -373,6 +396,7 @@ int bts_model_vty_init(struct gsm_bts *bts) install_element(TRX_NODE, &cfg_trx_rxgain_cmd); install_element(TRX_NODE, &cfg_trx_power_cmd); + install_element(TRX_NODE, &cfg_trx_power_oml_cmd); install_element(TRX_NODE, &cfg_trx_maxdly_cmd); install_element(TRX_NODE, &cfg_trx_slotmask_cmd); install_element(TRX_NODE, &cfg_trx_no_rxgain_cmd); -- cgit v1.2.3