aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
diff options
context:
space:
mode:
authorStefan Sperling <ssperling@sysmocom.de>2018-04-16 13:33:16 +0200
committerStefan Sperling <ssperling@sysmocom.de>2018-04-16 13:35:12 +0200
commit4e526ba0f571e87fd26f243e95115bdd9c0ce230 (patch)
tree78d4577f8663bb566d41bd3b42e3b8326d2eb60e /openbsc/include
parent53f36ba1cc42ee99a77cf31777cc87e31b283718 (diff)
ensure that acc_ramp_init() is only called once
There are plans to register signal handlers in acc_ramp_init(). Once we do that, the acc_ramp_init() function should only be called once to avoid duplicate signal handlers on the handler list. However, the acc_ramp_init() function currently serves a dual-purpose: 1) Initialize the acc_ramp structure for a bts 2) Enable or disable ACC ramping Add new functions to support use case 2, and call acc_ramp_init() just once while reading the configuration file. The VTY commands which enable/disable ACC ramping use the new APIs instead. Also, rename acc_ramp_start() to acc_ramp_trigger() and tweak its semantics so that it can always be called regardless of what the current configuration settings are. This prepares us for triggering ACC ramping upon events other than "RSL link-up". This is a port of osmo-bsc commit ea33341cf7b52d432be98f2280b4a5f3129ef667. Also remove a call to acc_ramp_init() which should have been removed in openbsc commit ebc1e39d919f5f919cb176ee9c6cbbccc8d620b1 Change-Id: Iadd25016e6478a9dc5da1db42e6192ce0f5cc746 Related: OS2591
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/acc_ramp.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/openbsc/include/openbsc/acc_ramp.h b/openbsc/include/openbsc/acc_ramp.h
index cb063bf53..efb12b088 100644
--- a/openbsc/include/openbsc/acc_ramp.h
+++ b/openbsc/include/openbsc/acc_ramp.h
@@ -79,6 +79,18 @@ struct acc_ramp {
};
/*!
+ * Enable or disable ACC ramping.
+ * When enabled, ramping begins once acc_ramp_start() is called.
+ * When disabled, an ACC ramping process in progress will continue
+ * unless acc_ramp_abort() is called as well.
+ * \param[in] acc_ramp Pointer to acc_ramp structure.
+ */
+static inline void acc_ramp_set_enabled(struct acc_ramp *acc_ramp, bool enable)
+{
+ acc_ramp->acc_ramping_enabled = enable;
+}
+
+/*!
* Return true if ACC ramping is currently enabled, else false.
* \param[in] acc_ramp Pointer to acc_ramp structure.
*/
@@ -141,9 +153,9 @@ static inline void acc_ramp_apply(struct gsm48_rach_control *rach_control, struc
rach_control->t3 |= acc_ramp_get_barred_t3(acc_ramp);
}
-void acc_ramp_init(struct acc_ramp *acc_ramp, bool enable, struct gsm_bts *bts);
+void acc_ramp_init(struct acc_ramp *acc_ramp, struct gsm_bts *bts);
int acc_ramp_set_step_size(struct acc_ramp *acc_ramp, unsigned int step_size);
int acc_ramp_set_step_interval(struct acc_ramp *acc_ramp, unsigned int step_interval);
void acc_ramp_set_step_interval_dynamic(struct acc_ramp *acc_ramp);
-void acc_ramp_start(struct acc_ramp *acc_ramp);
+void acc_ramp_trigger(struct acc_ramp *acc_ramp);
void acc_ramp_abort(struct acc_ramp *acc_ramp);