aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-12-04 09:30:31 +0100
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-12-06 18:59:05 +0100
commit237ec6194b46f096d419efd8a663d1e7e279e2ae (patch)
tree784c84aed4869998a7682ae9f090d1e8cced31d4 /tests
parent63c1838c7ae4f51a6f50856c1aae072811d0a850 (diff)
power_control: clarify units in 'struct bts_power_ctrl_params'
Diffstat (limited to 'tests')
-rw-r--r--tests/power/bs_power_loop_test.c10
-rw-r--r--tests/power/ms_power_loop_test.c30
2 files changed, 20 insertions, 20 deletions
diff --git a/tests/power/bs_power_loop_test.c b/tests/power/bs_power_loop_test.c
index bc6b8154..2f60cc0a 100644
--- a/tests/power/bs_power_loop_test.c
+++ b/tests/power/bs_power_loop_test.c
@@ -95,7 +95,7 @@ static void init_test(const char *name)
g_trx = gsm_bts_trx_alloc(g_bts);
OSMO_ASSERT(g_trx != NULL);
- g_bts->dl_power_ctrl.target = rxlev2dbm(PWR_TEST_RXLEV_TARGET);
+ g_bts->dl_power_ctrl.target_dbm = rxlev2dbm(PWR_TEST_RXLEV_TARGET);
g_bts->band = GSM_BAND_900;
g_bts->c0 = g_trx;
@@ -147,7 +147,7 @@ static int exec_power_step(struct gsm_lchan *lchan,
case PWR_TEST_ST_SET_PARAMS:
printf("#%02u %s() <- Param (re)set (target %d dBm, hysteresis %u dB, "
"filtering is %sabled)\n",
- n, __func__, step->params.target, step->params.hysteresis,
+ n, __func__, step->params.target_dbm, step->params.hysteresis_db,
step->params.pf_algo != BTS_PF_ALGO_NONE ? "en" : "dis");
g_bts->dl_power_ctrl = step->params;
return 0; /* we're done */
@@ -326,8 +326,8 @@ static const struct power_test_step TC_rxlev_hyst[] = {
/* Enable hysteresis */
{ .type = PWR_TEST_ST_SET_PARAMS,
.params = {
- .target = -110 + PWR_TEST_RXLEV_TARGET,
- .hysteresis = 3,
+ .target_dbm = -110 + PWR_TEST_RXLEV_TARGET,
+ .hysteresis_db = 3,
}
},
@@ -347,7 +347,7 @@ static const struct power_test_step TC_rxlev_pf_ewma[] = {
/* Enable EWMA based power filtering */
{ .type = PWR_TEST_ST_SET_PARAMS,
.params = {
- .target = -110 + PWR_TEST_RXLEV_TARGET, /* RxLev 30 */
+ .target_dbm = -110 + PWR_TEST_RXLEV_TARGET, /* RxLev 30 */
.pf_algo = BTS_PF_ALGO_EWMA,
.pf.ewma.alpha = 50,
}
diff --git a/tests/power/ms_power_loop_test.c b/tests/power/ms_power_loop_test.c
index 147c725e..4f4f746b 100644
--- a/tests/power/ms_power_loop_test.c
+++ b/tests/power/ms_power_loop_test.c
@@ -47,8 +47,8 @@ static void init_test(const char *name)
g_trx->ms_pwr_ctl_soft = true;
- g_bts->ul_power_ctrl.target = -75;
- g_bts->dl_power_ctrl.target = -75;
+ g_bts->ul_power_ctrl.target_dbm = -75;
+ g_bts->dl_power_ctrl.target_dbm = -75;
g_bts->band = GSM_BAND_1800;
g_bts->c0 = g_trx;
@@ -99,7 +99,7 @@ static void test_power_loop(void)
apply_power_test(lchan, -90, 1, 5);
/* Check good RSSI value keeps it at same power level: */
- apply_power_test(lchan, g_bts->ul_power_ctrl.target, 0, 5);
+ apply_power_test(lchan, g_bts->ul_power_ctrl.target_dbm, 0, 5);
apply_power_test(lchan, -90, 1, 3);
apply_power_test(lchan, -90, 1, 2); /* .max is pwr lvl 2 */
@@ -117,7 +117,7 @@ static void test_power_loop(void)
apply_power_test(lchan, -90, 0, 29);
/* Check good RSSI value keeps it at same power level: */
- apply_power_test(lchan, g_bts->ul_power_ctrl.target, 0, 29);
+ apply_power_test(lchan, g_bts->ul_power_ctrl.target_dbm, 0, 29);
/* Now go down, steps are double size in this direction: */
apply_power_test(lchan, -45, 1, 1);
@@ -125,13 +125,13 @@ static void test_power_loop(void)
apply_power_test(lchan, -45, 1, 9);
/* Go down only one level down and up: */
- apply_power_test(lchan, g_bts->ul_power_ctrl.target + 2, 1, 10);
- apply_power_test(lchan, g_bts->ul_power_ctrl.target - 2, 1, 9);
+ apply_power_test(lchan, g_bts->ul_power_ctrl.target_dbm + 2, 1, 10);
+ apply_power_test(lchan, g_bts->ul_power_ctrl.target_dbm - 2, 1, 9);
/* Check if BSC requesting a low max power is applied after loop calculation: */
lchan->ms_power_ctrl.max = ms_pwr_ctl_lvl(GSM_BAND_1800, 2);
OSMO_ASSERT(lchan->ms_power_ctrl.max == 14);
- apply_power_test(lchan, g_bts->ul_power_ctrl.target + 2, 1, 14);
+ apply_power_test(lchan, g_bts->ul_power_ctrl.target_dbm + 2, 1, 14);
/* Set back a more normal max: */
lchan->ms_power_ctrl.max = ms_pwr_ctl_lvl(GSM_BAND_1800, 30);
OSMO_ASSERT(lchan->ms_power_ctrl.max == 0);
@@ -215,22 +215,22 @@ static void test_power_hysteresis(void)
lchan = &g_trx->ts[0].lchan[0];
/* Tolerate power deviations in range -80 .. -70 */
- g_bts->ul_power_ctrl.hysteresis = 5;
+ g_bts->ul_power_ctrl.hysteresis_db = 5;
lchan->ms_power_ctrl.current = ms_pwr_ctl_lvl(GSM_BAND_1800, 0);
OSMO_ASSERT(lchan->ms_power_ctrl.current == 15);
lchan->ms_power_ctrl.max = ms_pwr_ctl_lvl(GSM_BAND_1800, 26);
OSMO_ASSERT(lchan->ms_power_ctrl.max == 2);
- apply_power_test(lchan, g_bts->ul_power_ctrl.target, 0, 15);
- apply_power_test(lchan, g_bts->ul_power_ctrl.target + 3, 0, 15);
- apply_power_test(lchan, g_bts->ul_power_ctrl.target - 3, 0, 15);
+ apply_power_test(lchan, g_bts->ul_power_ctrl.target_dbm, 0, 15);
+ apply_power_test(lchan, g_bts->ul_power_ctrl.target_dbm + 3, 0, 15);
+ apply_power_test(lchan, g_bts->ul_power_ctrl.target_dbm - 3, 0, 15);
- apply_power_test(lchan, g_bts->ul_power_ctrl.target, 0, 15);
- apply_power_test(lchan, g_bts->ul_power_ctrl.target + 5, 0, 15);
- apply_power_test(lchan, g_bts->ul_power_ctrl.target - 5, 0, 15);
+ apply_power_test(lchan, g_bts->ul_power_ctrl.target_dbm, 0, 15);
+ apply_power_test(lchan, g_bts->ul_power_ctrl.target_dbm + 5, 0, 15);
+ apply_power_test(lchan, g_bts->ul_power_ctrl.target_dbm - 5, 0, 15);
- apply_power_test(lchan, g_bts->ul_power_ctrl.target - 10, 1, 13);
+ apply_power_test(lchan, g_bts->ul_power_ctrl.target_dbm - 10, 1, 13);
}
int main(int argc, char **argv)