fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21441 )


Change subject: power_control: generalize power control state structure
......................................................................

power_control: generalize power control state structure

Change-Id: I8c6ad8d14349e8a05084c2912644c5202f951f52
Related: SYS#4918
---
M include/osmo-bts/gsm_data.h
M src/common/power_control.c
M tests/power/power_test.c
3 files changed, 13 insertions(+), 10 deletions(-)



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

diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 64102f5..04c6629 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -161,6 +161,15 @@
        uint32_t fn;
 };

+struct lchan_power_ctrl_state {
+       uint8_t current;
+       uint8_t max;
+       bool fixed;
+
+       /* Scaled up (100 times) average UL/DL RxLev (in dBm) */
+       int avg100_rxlev_dbm;
+};
+
 struct gsm_lchan {
        /* The TS that we're part of */
        struct gsm_bts_trx_ts *ts;
@@ -306,15 +315,9 @@
        enum lchan_rel_act_kind rel_act_kind;
        /* RTP header Marker bit to indicate beginning of speech after pause  */
        bool rtp_tx_marker;
-       /* power handling */
-       struct {
-               uint8_t current;
-               uint8_t max;
-               bool fixed;

-               /* Scaled up (100 times) average UL RSSI */
-               int avg100_ul_rssi;
-       } ms_power_ctrl;
+       /* MS power control */
+       struct lchan_power_ctrl_state ms_power_ctrl;

        /* BTS power reduction (in dB) */
        uint8_t bs_power_red;
diff --git a/src/common/power_control.c b/src/common/power_control.c
index e022e59..3328167 100644
--- a/src/common/power_control.c
+++ b/src/common/power_control.c
@@ -79,7 +79,7 @@
                               const int8_t Pwr)
 {
        const uint8_t A = bts->ul_power_ctrl.pf.ewma.alpha;
-       int *Avg100 = &lchan->ms_power_ctrl.avg100_ul_rssi;
+       int *Avg100 = &lchan->ms_power_ctrl.avg100_rxlev_dbm;

        /* We don't have 'Avg[n - 1]' if this is the first run */
        if (lchan->meas.res_nr == 0) {
diff --git a/tests/power/power_test.c b/tests/power/power_test.c
index f1b910b..1abe532 100644
--- a/tests/power/power_test.c
+++ b/tests/power/power_test.c
@@ -152,7 +152,7 @@

        init_test(__func__);
        lchan = &g_trx->ts[0].lchan[0];
-       avg100 = &lchan->ms_power_ctrl.avg100_ul_rssi;
+       avg100 = &lchan->ms_power_ctrl.avg100_rxlev_dbm;

        g_bts->ul_power_ctrl.pf_algo = BTS_PF_ALGO_EWMA;
        g_bts->ul_power_ctrl.pf.ewma.alpha = 20; /* 80% smoothing */

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21441
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I8c6ad8d14349e8a05084c2912644c5202f951f52
Gerrit-Change-Number: 21441
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanits...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to