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/.
Stefan Sperling gerrit-no-reply at lists.osmocom.orgReview at https://gerrit.osmocom.org/7750 rename helper functions in the acc ramp code to avoid confusion The word 'enabled' was used in two contexts: Whether ACC ramp is enabled as a feature, and whether a particular access control class is permantly allowed/disallowed via VTY configuration. Rename some helper functions to avoid the use of the word 'enabled' in the latter context. Change-Id: Ia67e84270cd50f4c55b8cf616ca38b00482f765c Related: OS#2591 --- M src/libbsc/acc_ramp.c 1 file changed, 13 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/50/7750/1 diff --git a/src/libbsc/acc_ramp.c b/src/libbsc/acc_ramp.c index 7cace4b..aee47ca 100644 --- a/src/libbsc/acc_ramp.c +++ b/src/libbsc/acc_ramp.c @@ -31,12 +31,12 @@ * Check if an ACC has been permanently barred for a BTS, * e.g. with the 'rach access-control-class' VTY command. */ -static bool acc_is_enabled(struct gsm_bts *bts, unsigned int acc) +static bool acc_is_permanently_barred(struct gsm_bts *bts, unsigned int acc) { OSMO_ASSERT(acc >= 0 && acc <= 9); if (acc == 8 || acc == 9) - return (bts->si_common.rach_control.t2 & (1 << (acc - 8))) == 0; - return (bts->si_common.rach_control.t3 & (1 << (acc))) == 0; + return (bts->si_common.rach_control.t2 & (1 << (acc - 8))); + return (bts->si_common.rach_control.t3 & (1 << (acc))); } static void allow_one_acc(struct acc_ramp *acc_ramp, unsigned int acc) @@ -53,20 +53,20 @@ acc_ramp->barred_accs |= (1 << acc); } -static void barr_all_enabled_accs(struct acc_ramp *acc_ramp) +static void barr_all_accs(struct acc_ramp *acc_ramp) { unsigned int acc; for (acc = 0; acc < 10; acc++) { - if (acc_is_enabled(acc_ramp->bts, acc)) + if (!acc_is_permanently_barred(acc_ramp->bts, acc)) barr_one_acc(acc_ramp, acc); } } -static void allow_all_enabled_accs(struct acc_ramp *acc_ramp) +static void allow_all_accs(struct acc_ramp *acc_ramp) { unsigned int acc; for (acc = 0; acc < 10; acc++) { - if (acc_is_enabled(acc_ramp->bts, acc)) + if (!acc_is_permanently_barred(acc_ramp->bts, acc)) allow_one_acc(acc_ramp, acc); } } @@ -99,7 +99,7 @@ /* Shortcut in case we only do one ramping step. */ if (acc_ramp->step_size == ACC_RAMP_STEP_SIZE_MAX) { - allow_all_enabled_accs(acc_ramp); + allow_all_accs(acc_ramp); gsm_bts_set_system_infos(acc_ramp->bts); return; } @@ -110,14 +110,14 @@ if (idx > 0) { /* One of ACC0-ACC7 is still bared. */ unsigned int acc = idx - 1; - if (acc_is_enabled(acc_ramp->bts, acc)) + if (!acc_is_permanently_barred(acc_ramp->bts, acc)) allow_one_acc(acc_ramp, acc); } else { idx = ffs(acc_ramp_get_barred_t2(acc_ramp)); if (idx == 1 || idx == 2) { /* ACC8 or ACC9 is still barred. */ unsigned int acc = idx - 1 + 8; - if (acc_is_enabled(acc_ramp->bts, acc)) + if (!acc_is_permanently_barred(acc_ramp->bts, acc)) allow_one_acc(acc_ramp, acc); } else { /* All ACCs are now allowed. */ @@ -157,9 +157,9 @@ osmo_timer_setup(&acc_ramp->step_timer, do_acc_ramping_step, acc_ramp); if (acc_ramp->acc_ramping_enabled) - barr_all_enabled_accs(acc_ramp); + barr_all_accs(acc_ramp); else - allow_all_enabled_accs(acc_ramp); + allow_all_accs(acc_ramp); } /*! @@ -219,7 +219,7 @@ acc_ramp_abort(acc_ramp); /* Set all availble ACCs to barred and start ramping up. */ - barr_all_enabled_accs(acc_ramp); + barr_all_accs(acc_ramp); do_acc_ramping_step(acc_ramp); } -- To view, visit https://gerrit.osmocom.org/7750 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia67e84270cd50f4c55b8cf616ca38b00482f765c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling <ssperling at sysmocom.de>