diff options
author | Harald Welte <laforge@gnumonks.org> | 2015-09-06 12:33:16 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2015-09-22 16:39:05 +0200 |
commit | 819b50e1a7b506a0a394cc71a795f0a9ce4083c1 (patch) | |
tree | 290806d3a1bc7f64a0e7a8e1cc5b48bfd6578164 /tests/sysmobts | |
parent | f449842053d333f6f9f41d3123262e8e05375acb (diff) |
move MS power control handling from sysmobts to common part
MS uplink power control is required in pretty much any BTS, and we
cannot assume that they PHY / L1 will always take care of it by
itself. So the correspondign code is moved to common/power_control.c
and called from the generic part of L1SAP.
The corresponding VTY paramter has been moved from the sysmobts-specific
trx VTY node to the common BTS VTY node.
Diffstat (limited to 'tests/sysmobts')
-rw-r--r-- | tests/sysmobts/sysmobts_test.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/sysmobts/sysmobts_test.c b/tests/sysmobts/sysmobts_test.c index 47c351c0..99fd4c7d 100644 --- a/tests/sysmobts/sysmobts_test.c +++ b/tests/sysmobts/sysmobts_test.c @@ -19,6 +19,7 @@ #include <osmo-bts/bts.h> #include <osmo-bts/l1sap.h> +#include <osmo-bts/power_control.h> #include "femtobts.h" #include "l1_if.h" @@ -186,12 +187,14 @@ static void test_sysmobts_cipher(void) static void test_sysmobts_loop(void) { struct gsm_bts bts; + struct gsm_bts_role_bts btsb; struct gsm_bts_trx trx; struct gsm_bts_trx_ts ts; struct gsm_lchan *lchan; int ret; memset(&bts, 0, sizeof(bts)); + memset(&btsb, 0, sizeof(btsb)); memset(&trx, 0, sizeof(trx)); memset(&ts, 0, sizeof(ts)); @@ -199,8 +202,10 @@ static void test_sysmobts_loop(void) lchan->ts = &ts; ts.trx = &trx; trx.bts = &bts; + bts.role = &btsb; bts.band = GSM_BAND_1800; trx.ms_power_control = 1; + btsb.ul_power_target = -75; printf("Testing sysmobts power control\n"); @@ -208,7 +213,7 @@ static void test_sysmobts_loop(void) lchan->state = LCHAN_S_NONE; lchan->ms_power_ctrl.current = ms_pwr_ctl_lvl(GSM_BAND_1800, 0); OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); - ret = l1if_ms_pwr_ctrl(lchan, -75, lchan->ms_power_ctrl.current, -60); + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); OSMO_ASSERT(ret == 0); OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); @@ -217,24 +222,24 @@ static void test_sysmobts_loop(void) * Now 15 dB too little and we should power it up. Could be a * power level of 7 or 8 for 15 dBm */ - ret = l1if_ms_pwr_ctrl(lchan, -75, lchan->ms_power_ctrl.current, -90); + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -90); OSMO_ASSERT(ret == 1); OSMO_ASSERT(lchan->ms_power_ctrl.current == 7); /* It should be clamped to level 0 and 30 dBm */ - ret = l1if_ms_pwr_ctrl(lchan, -75, lchan->ms_power_ctrl.current, -100); + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -100); OSMO_ASSERT(ret == 1); OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); /* Fix it and jump down */ lchan->ms_power_ctrl.fixed = 1; - ret = l1if_ms_pwr_ctrl(lchan, -75, lchan->ms_power_ctrl.current, -60); + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -60); OSMO_ASSERT(ret == 0); OSMO_ASSERT(lchan->ms_power_ctrl.current == 0); /* And leave it again */ lchan->ms_power_ctrl.fixed = 0; - ret = l1if_ms_pwr_ctrl(lchan, -75, lchan->ms_power_ctrl.current, -40); + ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, -40); OSMO_ASSERT(ret == 1); OSMO_ASSERT(lchan->ms_power_ctrl.current == 15); } |