[PATCH] osmo-bts[sysmocom/0.3.5-stable]: tx_power: Change PA calibration tables to use delta vales

daniel gerrit-no-reply at lists.osmocom.org
Tue Feb 14 16:47:58 UTC 2017


Review at  https://gerrit.osmocom.org/1822

tx_power: Change PA calibration tables to use delta vales

It seems more user friendly to look at a calibration table in terms of
the delta (positive or negative) compared to the nominal gain value,
rather than a collection of absolute gain values.  It has the added
benefit that the (API/data model) user doesn't have to specify a gain
value for each ARFCN, but rather can rely on the default nominal gain in
absence of a calibration table for this specific unit.

Change-Id: I7311815902a88d2fc9d211cf4c62fa6fdc5e86ad
---
M include/osmo-bts/tx_power.h
M src/common/tx_power.c
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/22/1822/1

diff --git a/include/osmo-bts/tx_power.h b/include/osmo-bts/tx_power.h
index 1d76864..8d099bc 100644
--- a/include/osmo-bts/tx_power.h
+++ b/include/osmo-bts/tx_power.h
@@ -8,7 +8,7 @@
 
 /* PA calibration table */
 struct pa_calibration {
-	int gain_mdB[1024];		/* gain provided at given ARFCN */
+	int delta_mdB[1024];		/* gain delta at given ARFCN */
 	/* FIXME: thermal calibration */
 };
 
diff --git a/src/common/tx_power.c b/src/common/tx_power.c
index d8c90b2..f3b9e31 100644
--- a/src/common/tx_power.c
+++ b/src/common/tx_power.c
@@ -33,12 +33,12 @@
 static int get_pa_drive_level_mdBm(const struct power_amp *pa,
 		       int desired_p_out_mdBm, unsigned int arfcn)
 {
-	if (arfcn >= ARRAY_SIZE(pa->calib.gain_mdB))
+	if (arfcn >= ARRAY_SIZE(pa->calib.delta_mdB))
 		return INT_MIN;
 
 	/* FIXME: temperature compensation */
 
-	return desired_p_out_mdBm - pa->calib.gain_mdB[arfcn];
+	return desired_p_out_mdBm - pa->nominal_gain_mdB - pa->calib.delta_mdB[arfcn];
 }
 
 /* maximum output power of the system */

-- 
To view, visit https://gerrit.osmocom.org/1822
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7311815902a88d2fc9d211cf4c62fa6fdc5e86ad
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: sysmocom/0.3.5-stable
Gerrit-Owner: daniel <dwillmann at sysmocom.de>


More information about the gerrit-log mailing list