This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
pespin gerrit-no-reply at lists.osmocom.orgpespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/25357 ) Change subject: Power Control Loop: Move skip loop logic to function helper ...................................................................... Power Control Loop: Move skip loop logic to function helper Let's move duplicate logic to function helper. Related: SYS#5371 Change-Id: Ic26c17564ec61cdadaab0184c4246b9bf863c69a --- M src/common/power_control.c 1 file changed, 21 insertions(+), 18 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved diff --git a/src/common/power_control.c b/src/common/power_control.c index 0362675..d57c28d 100644 --- a/src/common/power_control.c +++ b/src/common/power_control.c @@ -139,6 +139,23 @@ return delta; } +/* Shall we skip current block based on configured interval? */ +static bool ctrl_interval_skip_block(const struct gsm_power_ctrl_params *params, + struct lchan_power_ctrl_state *state) +{ + /* Power control interval: how many blocks do we skip? */ + if (state->skip_block_num-- > 0) + return true; + + /* Reset the number of SACCH blocks to be skipped: + * ctrl_interval=0 => 0 blocks to skip, + * ctrl_interval=1 => 1 blocks to skip, + * ctrl_interval=2 => 3 blocks to skip, + * so basically ctrl_interval * 2 - 1. */ + state->skip_block_num = params->ctrl_interval * 2 - 1; + return false; +} + static const struct gsm_power_ctrl_meas_params *lchan_get_ci_thresholds(const struct gsm_lchan *lchan) { const struct gsm_power_ctrl_params *params = lchan->ms_power_ctrl.dpc_params; @@ -190,17 +207,10 @@ if (params == NULL) return 0; - /* Power control interval: how many blocks do we skip? */ - if (state->skip_block_num-- > 0) + /* Shall we skip current block based on configured interval? */ + if (ctrl_interval_skip_block(params, state)) return 0; - /* Reset the number of SACCH blocks to be skipped: - * ctrl_interval=0 => 0 blocks to skip, - * ctrl_interval=1 => 1 blocks to skip, - * ctrl_interval=2 => 3 blocks to skip, - * so basically ctrl_interval * 2 - 1. */ - state->skip_block_num = params->ctrl_interval * 2 - 1; - ms_dbm = ms_pwr_dbm(band, ms_power_lvl); if (ms_dbm < 0) { LOGPLCHAN(lchan, DLOOP, LOGL_NOTICE, @@ -318,17 +328,10 @@ lchan->tch.dtx.dl_active ? "enabled" : "disabled", lchan->tch.dtx.dl_active ? "SUB" : "FULL"); - /* Power control interval: how many blocks do we skip? */ - if (state->skip_block_num-- > 0) + /* Shall we skip current block based on configured interval? */ + if (ctrl_interval_skip_block(params, state)) return 0; - /* Reset the number of SACCH blocks to be skipped: - * ctrl_interval=0 => 0 blocks to skip, - * ctrl_interval=1 => 1 blocks to skip, - * ctrl_interval=2 => 3 blocks to skip, - * so basically ctrl_interval * 2 - 1. */ - state->skip_block_num = params->ctrl_interval * 2 - 1; - /* If DTx is active on Downlink, use the '-SUB' */ if (lchan->tch.dtx.dl_active) { rxqual = rxqual_sub; -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25357 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Ic26c17564ec61cdadaab0184c4246b9bf863c69a Gerrit-Change-Number: 25357 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin at sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de> Gerrit-Reviewer: pespin <pespin at sysmocom.de> Gerrit-MessageType: merged -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210907/a778abec/attachment.htm>