From 98c8f0a2f3ce41283d404bb89c74f95d21ba5ce8 Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Tue, 6 Feb 2018 14:55:04 +0100 Subject: Move ACC data structures to their own header file. Change-Id: I6bdcac5d8c358320f953a0a3cd06876ae571be23 --- include/osmocom/bsc/acc_ramp.h | 76 +++++++++++++++++++++++++++++++++++ include/osmocom/bsc/gsm_data_shared.h | 53 +----------------------- 2 files changed, 78 insertions(+), 51 deletions(-) create mode 100644 include/osmocom/bsc/acc_ramp.h diff --git a/include/osmocom/bsc/acc_ramp.h b/include/osmocom/bsc/acc_ramp.h new file mode 100644 index 000000000..73bd2cc17 --- /dev/null +++ b/include/osmocom/bsc/acc_ramp.h @@ -0,0 +1,76 @@ +/* (C) 2018 Stefan Sperling + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#ifndef _ACC_RAMP_H_ +#define _ACC_RAMP_H_ + +#include + +#include + +/* + * Access control class (ACC) ramping is used to slowly make the cell available to + * an increasing number of MS. This avoids overload at startup time in cases where + * a lot of MS would discover the new cell and try to connect to it all at once. + */ + +enum acc_ramp_step_size { + ACC_RAMP_STEP_SIZE_MIN = 1, /* allow at most 1 new ACC per ramp step */ + ACC_RAMP_STEP_SIZE_DEFAULT = ACC_RAMP_STEP_SIZE_MIN, + ACC_RAMP_STEP_SIZE_MAX = 10, /* allow all ACC in one step (disables ramping) */ +}; + +enum acc_ramp_step_interval { + ACC_RAMP_STEP_INTERVAL_MIN = 1, /* 1 second */ + ACC_RAMP_STEP_INTERVAL_DEFAULT = 60, /* 1 minute */ + ACC_RAMP_STEP_INTERVAL_MAX = 600, /* 10 minutes */ +}; + +struct acc_ramp { + /* + * Bitmasks which keep track of access control classes that are currently + * denied access to this BTS. These masks modulate bits from octets 2 and 3 + * of the RACH Control Parameters (see 3GPP 44.018 10.5.2.29). + * While a bit in these masks is set, the corresponding ACC is barred. + * Note that t2 contains bits for classes 11-15 which should always be allowed, + * and a bit which denies emergency calls for all ACCs from 0-9 inclusive. + * Ramping is only concerned with those bits which control access for ACCs 0-9. + */ + uint8_t barred_t2; + uint8_t barred_t3; + + /* + * This controls the maximum number of ACCs to allow per ramping step (1 - 10). + * The compile-time default value is ACC_RAMP_STEP_SIZE_DEFAULT. + * This value can be changed by VTY configuration. + * A value of ACC_RAMP_STEP_SIZE_MAX effectively disables ramping. + */ + enum acc_ramp_step_size step_size; + + /* + * Ramping step interval in seconds. + * This value depends on the current BTS channel load average, unless + * it has been overriden by VTY configuration. + */ + unsigned int step_interval_sec; + bool step_interval_is_fixed; + struct osmo_timer_list step_timer; +}; + +#endif /* _ACC_RAMP_H_ */ diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index aa532cec3..cf93b620b 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -22,6 +22,7 @@ #include #include #include +#include /* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: 4-bit index is used (2#1111 = 10#15) */ @@ -578,56 +579,6 @@ struct load_counter { unsigned int used; }; - -/* - * Access control class (ACC) ramping is used to slowly make the cell available to - * an increasing number of MS. This avoids overload at startup time in cases where - * a lot of MS would discover the new cell and try to connect to it all at once. - */ - -enum bts_acc_ramp_step_size { - BTS_ACC_RAMP_STEP_SIZE_MIN = 1, /* allow at most 1 new ACC per ramp step */ - BTS_ACC_RAMP_STEP_SIZE_DEFAULT = BTS_ACC_RAMP_STEP_SIZE_MIN, - BTS_ACC_RAMP_STEP_SIZE_MAX = 10, /* allow all ACC in one step (disables ramping) */ -}; - -enum bts_acc_ramp_step_interval { - BTS_ACC_RAMP_STEP_INTERVAL_MIN = 1, /* 1 second */ - BTS_ACC_RAMP_STEP_INTERVAL_DEFAULT = 60, /* 1 minute */ - BTS_ACC_RAMP_STEP_INTERVAL_MAX = 300, /* 5 minutes */ -}; - -struct bts_acc_ramp { - /* - * Bitmasks which keep track of access control classes that are currently - * denied access to this BTS. These masks modulate bits from octets 2 and 3 - * of the RACH Control Parameters (see 3GPP 44.018 10.5.2.29). - * While a bit in these masks is set, the corresponding ACC is barred. - * Note that t2 contains bits for classes 11-15 which should always be allowed, - * and a bit which denies emergency calls for all ACCs from 0-9 inclusive. - * Ramping is only concerned with those bits which control access for ACCs 0-9. - */ - uint8_t barred_t2; - uint8_t barred_t3; - - /* - * This controls the maximum number of ACCs to allow per ramping step (1 - 10). - * The compile-time default value is BTS_ACC_RAMP_STEP_SIZE_DEFAULT. - * This value can be changed by VTY configuration. - * A value of BTS_ACC_RAMP_STEP_SIZE_MAX effectively disables ramping. - */ - enum bts_acc_ramp_step_size step_size; - - /* - * Ramping step interval in seconds. - * This value depends on the current BTS channel load average, unless - * it has been overriden by VTY configuration. - */ - unsigned int step_interval_sec; - bool step_interval_is_fixed; - struct osmo_timer_list step_timer; -}; - /* One BTS */ struct gsm_bts { /* list header in net->bts_list */ @@ -838,7 +789,7 @@ struct gsm_bts { uint32_t si_mode_static; /* access control class ramping */ - struct bts_acc_ramp acc_ramp; + struct acc_ramp acc_ramp; /* exclude the BTS from the global RF Lock handling */ int excl_from_rf_lock; -- cgit v1.2.3