aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Godin <yves.godin@nutaq.com>2016-09-09 15:37:03 -0400
committerYves Godin <yves.godin@nutaq.com>2016-09-09 15:37:03 -0400
commitc59bc6909daeb0a390cfc7c225bf346be8149108 (patch)
treedeecf708c7d33a061c4018f5a60a8b26f5df64c0
parent12e1e6c263687a6c87d080038b4bdbc3545b053b (diff)
parent58c8f227d830f7c1ee83c242982114e3ac722347 (diff)
Merge branch 'nrw/litecell15-manufacture-oml-1db-step' into 'nrw/litecell15-next'
LC15: Manufacture-defined O&M message to set RF Max Power Reduction in 1 dB step. This MR should have: * See merge request !50
-rw-r--r--src/common/oml.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/common/oml.c b/src/common/oml.c
index 06d0ba02..8fd6b926 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1451,6 +1451,44 @@ static int oml_ipa_mo_set_attr(struct gsm_bts *bts, struct gsm_abis_mo *mo,
return rc;
}
+#ifdef ENABLE_LC15BTS
+/* This function is a manufacture O&M message in order to set RF Max Power Reduction
+ * for the LC15 BTS in non-standard way, i.e. it is binary representation of 1 dB step
+ * rather than 2 dB step defined in TS 12.21.
+ * Radio Attribute message type, Radio Object Class, and RF Max Power Reduction attribute
+ * defined in TS 12.21 are re-used in this message*/
+static int oml_nrw_set_tx_max_pwr_red(struct gsm_bts_trx *trx, struct msgb *msg)
+{
+ struct abis_om_fom_hdr *foh = msgb_l3(msg);
+ struct tlv_parsed tp;
+ int rc;
+
+ abis_nm_debugp_foh(DOML, foh);
+ LOGP(DOML, LOGL_DEBUG, "RX Manufacture O&M message NM_MT_SET_RADIO_ATTR\n");
+
+ rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh));
+ if (rc < 0)
+ return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT);
+
+ if (!TLVP_PRESENT(&tp, NM_ATT_RF_MAXPOWR_R))
+ return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT);
+
+ trx->max_power_red = *TLVP_VAL(&tp, NM_ATT_RF_MAXPOWR_R);
+ if (trx->max_power_red > trx->nominal_power) {
+ LOGP(DOML, LOGL_ERROR, "RF Max Power Reduction = %d dB is out of range. It must be in between [0..%d] dB\n",
+ trx->max_power_red,
+ trx->nominal_power);
+ return oml_fom_ack_nack(msg, NM_NACK_PARAM_RANGE);
+ }
+
+ LOGP(DOML, LOGL_INFO, " Set RF Max Power Reduction = %d dB\n",
+ trx->max_power_red);
+
+ /* call into BTS driver to apply new Tx power reduction to hardware */
+ return bts_model_apply_oml(trx->bts, msg, NULL, NM_OC_RADIO_CARRIER, trx);
+}
+#endif
+
static int oml_ipa_set_attr(struct gsm_bts *bts, struct msgb *msg)
{
struct abis_om_fom_hdr *foh = msgb_l3(msg);
@@ -1556,6 +1594,12 @@ static int down_mom(struct gsm_bts *bts, struct msgb *msg)
case NM_MT_IPACC_SET_ATTR:
ret = oml_ipa_set_attr(bts, msg);
break;
+#ifdef ENABLE_LC15BTS
+ case NM_MT_SET_RADIO_ATTR:
+ trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
+ ret = oml_nrw_set_tx_max_pwr_red(trx, msg);
+ break;
+#endif
default:
LOGP(DOML, LOGL_INFO, "Manufacturer Formatted O&M msg_type 0x%02x\n",
foh->msg_type);