<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/26050">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">measurement: call lchan_bs_pwr_ctrl() iff *mr is valid<br><br>Change-Id: I125aab5224e25585cbfbe1550d2d52d62ba198bb<br>---<br>M src/common/measurement.c<br>M src/common/power_control.c<br>M tests/power/bs_power_loop_test.c<br>M tests/power/bs_power_loop_test.err<br>M tests/power/bs_power_loop_test.ok<br>5 files changed, 3 insertions(+), 61 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/50/26050/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/common/measurement.c b/src/common/measurement.c</span><br><span>index 52243fe..45b7fa9 100644</span><br><span>--- a/src/common/measurement.c</span><br><span>+++ b/src/common/measurement.c</span><br><span>@@ -957,7 +957,7 @@</span><br><span>        }</span><br><span>    lchan_ms_ta_ctrl(lchan, ms_ta, lchan->meas.ms_toa256);</span><br><span>    lchan_ms_pwr_ctrl(lchan, ms_pwr, ul_rssi, ul_ci_cb);</span><br><span style="color: hsl(0, 100%, 40%);">-    if (mr)</span><br><span style="color: hsl(120, 100%, 40%);">+       if (mr && !mr->meas_valid) /* 0 = valid */</span><br><span>                lchan_bs_pwr_ctrl(lchan, mr);</span><br><span> </span><br><span>    repeated_dl_facch_active_decision(lchan, mr);</span><br><span>diff --git a/src/common/power_control.c b/src/common/power_control.c</span><br><span>index 73a30da..2979eff 100644</span><br><span>--- a/src/common/power_control.c</span><br><span>+++ b/src/common/power_control.c</span><br><span>@@ -325,13 +325,6 @@</span><br><span>    if (params == NULL)</span><br><span>          return 0;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   /* Check if the measurement results are valid */</span><br><span style="color: hsl(0, 100%, 40%);">-        if (mr->meas_valid != 0) { /* 0 = valid */</span><br><span style="color: hsl(0, 100%, 40%);">-           LOGPLCHAN(lchan, DLOOP, LOGL_DEBUG,</span><br><span style="color: hsl(0, 100%, 40%);">-                       "The measurement results are not valid\n");</span><br><span style="color: hsl(0, 100%, 40%);">-         return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    LOGPLCHAN(lchan, DLOOP, LOGL_DEBUG, "Rx DL Measurement Report: "</span><br><span>             "RXLEV-FULL(%02u), RXQUAL-FULL(%u), "</span><br><span>              "RXLEV-SUB(%02u), RXQUAL-SUB(%u), "</span><br><span>diff --git a/tests/power/bs_power_loop_test.c b/tests/power/bs_power_loop_test.c</span><br><span>index b5e5264..06fe3ed 100644</span><br><span>--- a/tests/power/bs_power_loop_test.c</span><br><span>+++ b/tests/power/bs_power_loop_test.c</span><br><span>@@ -47,11 +47,6 @@</span><br><span>    { DL_MEAS_FULL(rxqual, rxlev), \</span><br><span>       DL_MEAS_SUB(rxqual, rxlev) }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#define DL_MEAS_FULL_SUB_INV(rxqual, rxlev) \</span><br><span style="color: hsl(0, 100%, 40%);">- { DL_MEAS_FULL(rxqual, rxlev), \</span><br><span style="color: hsl(0, 100%, 40%);">-          DL_MEAS_SUB(rxqual, rxlev), \</span><br><span style="color: hsl(0, 100%, 40%);">-   .invalid = true }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> enum power_test_step_type {</span><br><span>   PWR_TEST_ST_IND_MEAS = 0,</span><br><span>    PWR_TEST_ST_SET_STATE,</span><br><span>@@ -77,7 +72,6 @@</span><br><span>                   uint8_t rxqual_sub;</span><br><span>                  uint8_t rxlev_full;</span><br><span>                  uint8_t rxlev_sub;</span><br><span style="color: hsl(0, 100%, 40%);">-                      bool invalid;</span><br><span>                } meas;</span><br><span>              /* Increase / reduce step size */</span><br><span>            struct {</span><br><span>@@ -131,14 +125,12 @@</span><br><span>             .rxlev_sub = step->meas.rxlev_sub,</span><br><span>                .rxqual_full = step->meas.rxqual_full,</span><br><span>            .rxqual_sub = step->meas.rxqual_sub,</span><br><span style="color: hsl(0, 100%, 40%);">-         /* NOTE: inversed logic (1 means invalid) */</span><br><span style="color: hsl(0, 100%, 40%);">-            .meas_valid = step->meas.invalid,</span><br><span>         };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-  printf("#%02u %s() -> Measurement Results (%svalid): "</span><br><span style="color: hsl(120, 100%, 40%);">+   printf("#%02u %s() -> Measurement Results (valid): "</span><br><span>           "RXLEV-FULL(%02u), RXQUAL-FULL(%u), "</span><br><span>              "RXLEV-SUB(%02u), RXQUAL-SUB(%u)\n",</span><br><span style="color: hsl(0, 100%, 40%);">-          n, __func__, step->meas.invalid ? "in" : "",</span><br><span style="color: hsl(120, 100%, 40%);">+           n, __func__,</span><br><span>         mr->rxlev_full, mr->rxqual_full,</span><br><span>               mr->rxlev_sub, mr->rxqual_sub);</span><br><span> }</span><br><span>@@ -393,21 +385,6 @@</span><br><span>     { .meas = DL_MEAS_FULL_SUB(7, PWR_TEST_RXLEV_TARGET) }, /* max */</span><br><span> };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/* Verify that invalid measurement results are ignored. */</span><br><span style="color: hsl(0, 100%, 40%);">-static const struct power_test_step TC_inval_meas[] = {</span><br><span style="color: hsl(0, 100%, 40%);">-    /* Initial state: 16 dB, up to 20 dB */</span><br><span style="color: hsl(0, 100%, 40%);">- { .type = PWR_TEST_ST_SET_STATE,</span><br><span style="color: hsl(0, 100%, 40%);">-          .state = { .current = 16, .max = 2 * 10 } },</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-  /* MS sends invalid measurement results which must be ignored */</span><br><span style="color: hsl(0, 100%, 40%);">-        { .meas = DL_MEAS_FULL_SUB_INV(7, 63),                  .exp_txred = 16 },</span><br><span style="color: hsl(0, 100%, 40%);">-      { .meas = DL_MEAS_FULL_SUB_INV(0, 0),                   .exp_txred = 16 },</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      { .meas = DL_MEAS_FULL_SUB(0, PWR_TEST_RXLEV_TARGET),   .exp_txred = 16 },</span><br><span style="color: hsl(0, 100%, 40%);">-      { .meas = DL_MEAS_FULL_SUB(0, PWR_TEST_RXLEV_TARGET),   .exp_txred = 16 },</span><br><span style="color: hsl(0, 100%, 40%);">-      { .meas = DL_MEAS_FULL_SUB(0, PWR_TEST_RXLEV_TARGET),   .exp_txred = 16 },</span><br><span style="color: hsl(0, 100%, 40%);">-};</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> /* Verify handling of optional power control interval (P_Con_INTERVAL). */</span><br><span> static const struct power_test_step TC_ctrl_interval[] = {</span><br><span>     /* Initial state: 0 dB, up to 20 dB */</span><br><span>@@ -529,7 +506,6 @@</span><br><span> </span><br><span>     exec_test(TC_dtxd_mode);</span><br><span>     exec_test(TC_rxqual_ber);</span><br><span style="color: hsl(0, 100%, 40%);">-       exec_test(TC_inval_meas);</span><br><span>    exec_test(TC_ctrl_interval);</span><br><span> </span><br><span>     exec_test(TC_rxlev_hyst);</span><br><span>diff --git a/tests/power/bs_power_loop_test.err b/tests/power/bs_power_loop_test.err</span><br><span>index dc4f411..24107ba 100644</span><br><span>--- a/tests/power/bs_power_loop_test.err</span><br><span>+++ b/tests/power/bs_power_loop_test.err</span><br><span>@@ -130,14 +130,6 @@</span><br><span> (bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 7, avg 7, thresh 3..0]</span><br><span> (bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(7), RXLEV-SUB(30), RXQUAL-SUB(7), DTx is disabled => using FULL</span><br><span> (bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 7, avg 7, thresh 3..0]</span><br><span style="color: hsl(0, 100%, 40%);">-(bts=0,trx=0,ts=0,ss=0) The measurement results are not valid</span><br><span style="color: hsl(0, 100%, 40%);">-(bts=0,trx=0,ts=0,ss=0) The measurement results are not valid</span><br><span style="color: hsl(0, 100%, 40%);">-(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL</span><br><span style="color: hsl(0, 100%, 40%);">-(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 16 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]</span><br><span style="color: hsl(0, 100%, 40%);">-(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL</span><br><span style="color: hsl(0, 100%, 40%);">-(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 16 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]</span><br><span style="color: hsl(0, 100%, 40%);">-(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL</span><br><span style="color: hsl(0, 100%, 40%);">-(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 16 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]</span><br><span> (bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL</span><br><span> (bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 0 dB => 2 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]</span><br><span> (bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL</span><br><span>diff --git a/tests/power/bs_power_loop_test.ok b/tests/power/bs_power_loop_test.ok</span><br><span>index 1001ba1..18a94ba 100644</span><br><span>--- a/tests/power/bs_power_loop_test.ok</span><br><span>+++ b/tests/power/bs_power_loop_test.ok</span><br><span>@@ -243,25 +243,6 @@</span><br><span> #16 lchan_bs_pwr_ctrl() -> BS power reduction: 0 -> 0 (expected 0)</span><br><span> Test case verdict: SUCCESS</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-Starting test case 'TC_inval_meas'</span><br><span style="color: hsl(0, 100%, 40%);">-#00 exec_power_step() <- State (re)set (current 16 dB, max 20 dB)</span><br><span style="color: hsl(0, 100%, 40%);">-#01 enc_meas_rep() -> Measurement Results (invalid): RXLEV-FULL(63), RXQUAL-FULL(7), RXLEV-SUB(63), RXQUAL-SUB(7)</span><br><span style="color: hsl(0, 100%, 40%);">-#01 lchan_bs_pwr_ctrl() <- UL SACCH: 06 15 3f 7f 7e 00 00 00 00 00 00 00 00 00 00 00 00 00 </span><br><span style="color: hsl(0, 100%, 40%);">-#01 lchan_bs_pwr_ctrl() -> BS power reduction: 16 -> 16 (expected 16)</span><br><span style="color: hsl(0, 100%, 40%);">-#02 enc_meas_rep() -> Measurement Results (invalid): RXLEV-FULL(00), RXQUAL-FULL(0), RXLEV-SUB(00), RXQUAL-SUB(0)</span><br><span style="color: hsl(0, 100%, 40%);">-#02 lchan_bs_pwr_ctrl() <- UL SACCH: 06 15 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 </span><br><span style="color: hsl(0, 100%, 40%);">-#02 lchan_bs_pwr_ctrl() -> BS power reduction: 16 -> 16 (expected 16)</span><br><span style="color: hsl(0, 100%, 40%);">-#03 enc_meas_rep() -> Measurement Results (valid): RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0)</span><br><span style="color: hsl(0, 100%, 40%);">-#03 lchan_bs_pwr_ctrl() <- UL SACCH: 06 15 1e 1e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 </span><br><span style="color: hsl(0, 100%, 40%);">-#03 lchan_bs_pwr_ctrl() -> BS power reduction: 16 -> 16 (expected 16)</span><br><span style="color: hsl(0, 100%, 40%);">-#04 enc_meas_rep() -> Measurement Results (valid): RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0)</span><br><span style="color: hsl(0, 100%, 40%);">-#04 lchan_bs_pwr_ctrl() <- UL SACCH: 06 15 1e 1e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 </span><br><span style="color: hsl(0, 100%, 40%);">-#04 lchan_bs_pwr_ctrl() -> BS power reduction: 16 -> 16 (expected 16)</span><br><span style="color: hsl(0, 100%, 40%);">-#05 enc_meas_rep() -> Measurement Results (valid): RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0)</span><br><span style="color: hsl(0, 100%, 40%);">-#05 lchan_bs_pwr_ctrl() <- UL SACCH: 06 15 1e 1e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 </span><br><span style="color: hsl(0, 100%, 40%);">-#05 lchan_bs_pwr_ctrl() -> BS power reduction: 16 -> 16 (expected 16)</span><br><span style="color: hsl(0, 100%, 40%);">-Test case verdict: SUCCESS</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> Starting test case 'TC_ctrl_interval'</span><br><span> #00 exec_power_step() <- State (re)set (current 0 dB, max 20 dB)</span><br><span> #01 exec_power_step() <- (Re)set power control interval: 0 -> 0</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/26050">change 26050</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bts/+/26050"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I125aab5224e25585cbfbe1550d2d52d62ba198bb </div>
<div style="display:none"> Gerrit-Change-Number: 26050 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>