aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-08-25 19:01:24 +0200
committerHarald Welte <laforge@gnumonks.org>2014-08-25 19:01:24 +0200
commit11b14fd6624a012cb6bdc49f2dea970f02fda653 (patch)
tree0793a3a3eba54b8b229597e550836eb8f0a9a941
parent9e873335ec6c77df8a3ffa9fe041d8dfa4ac4ece (diff)
tx_power: Check actual TRX output power against intended value
We use the completion call-back from L1 to compare the instructed TRX board output power with the actual value as reported back from L1. Right now we only print an error message in case the values disagree. In the future we might want to either use that value as part of our calculation or send an OML alarm report to the BSC.
-rw-r--r--include/osmo-bts/tx_power.h2
-rw-r--r--src/common/tx_power.c18
-rw-r--r--src/osmo-bts-sysmo/oml.c3
3 files changed, 23 insertions, 0 deletions
diff --git a/include/osmo-bts/tx_power.h b/include/osmo-bts/tx_power.h
index c5d6f2b..1d76864 100644
--- a/include/osmo-bts/tx_power.h
+++ b/include/osmo-bts/tx_power.h
@@ -72,3 +72,5 @@ int get_p_trxout_actual_mdBm(struct gsm_bts_trx *trx, uint8_t bs_power_ie);
int get_p_trxout_actual_mdBm_lchan(struct gsm_lchan *lchan);
int power_ramp_start(struct gsm_bts_trx *trx, int p_total_tgt_mdBm, int bypass);
+
+void power_trx_change_compl(struct gsm_bts_trx *trx, int p_trxout_cur_mdBm);
diff --git a/src/common/tx_power.c b/src/common/tx_power.c
index 27b2425..d8c90b2 100644
--- a/src/common/tx_power.c
+++ b/src/common/tx_power.c
@@ -182,6 +182,24 @@ static void power_ramp_timer_cb(void *_trx)
/* Instruct L1 to apply new effective TRX output power required */
bts_model_change_power(trx, p_trxout_eff_mdBm);
+}
+
+/* BTS model call-back once one a call to bts_model_change_power()
+ * completes, indicating actual L1 transmit power */
+void power_trx_change_compl(struct gsm_bts_trx *trx, int p_trxout_cur_mdBm)
+{
+ struct trx_power_params *tpp = &trx->power_params;
+ int p_trxout_should_mdBm;
+
+ p_trxout_should_mdBm = get_p_trxout_eff_mdBm(trx, tpp->p_total_tgt_mdBm);
+
+ /* for now we simply write an error message, but in the future
+ * we might use the value (again) as part of our math? */
+ if (p_trxout_cur_mdBm != p_trxout_should_mdBm) {
+ LOGP(DL1C, LOGL_ERROR, "bts_model notifies us of %u mdBm TRX "
+ "output power. However, it should be %u mdBm!\n",
+ p_trxout_cur_mdBm, p_trxout_should_mdBm);
+ }
/* and do another step... */
power_ramp_do_step(trx, 0);
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index 2aed31f..b590eff 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -1078,6 +1078,9 @@ static int chmod_txpower_compl_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg,
LOGPC(DL1C, LOGL_INFO, "setTxPower %f dBm\n",
cc->cfgParams.setTxPowerLevel.fTxPowerLevel);
+ power_trx_change_compl(trx,
+ (int) (cc->cfgParams.setTxPowerLevel.fTxPowerLevel * 1000));
+
msgb_free(l1_msg);
return 0;