aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-04-08 01:22:37 +0300
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-04-08 01:23:04 +0300
commit6a97cd39b6ba9372240e24e44cc3c6a0d89532e9 (patch)
tree7a473a84fb51c7d53c5fe6d2f2179a9341f16504 /include
parent6c33014bb9f6f93cc620532241529d4c93e7aa6d (diff)
Move power control related definitions to power_control.h
Now that we have separate header/code files for the power control, let's move the related definitions there. This change makes the code consistent with osmo-bts, where it's already done this way. Change-Id: I1cb3f6bfba0306e8f371dcd5162d1813beb3a088
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/bsc/bts.h1
-rw-r--r--include/osmocom/bsc/gsm_data.h92
-rw-r--r--include/osmocom/bsc/power_control.h92
3 files changed, 93 insertions, 92 deletions
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index c4ee39daf..cd0f8cbe0 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -12,6 +12,7 @@
#include <osmocom/abis/e1_input.h>
+#include "osmocom/bsc/power_control.h"
#include "osmocom/bsc/gsm_data.h"
#include "osmocom/bsc/bts_trx.h"
#include "osmocom/bsc/bts_sm.h"
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index fcd888367..4a58c2b68 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1356,98 +1356,6 @@ enum gsm48_rr_cause bsc_gsm48_rr_cause_from_rsl_cause(uint8_t c);
int bsc_sccp_inst_next_conn_id(struct osmo_sccp_instance *sccp);
-/* MS/BS Power related measurement averaging algo */
-enum gsm_power_ctrl_meas_avg_algo {
- GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE = 0x00,
- GSM_PWR_CTRL_MEAS_AVG_ALGO_UNWEIGHTED = 0x01,
- GSM_PWR_CTRL_MEAS_AVG_ALGO_WEIGHTED = 0x02,
- GSM_PWR_CTRL_MEAS_AVG_ALGO_MOD_MEDIAN = 0x03,
- /* EWMA is an Osmocom specific algo */
- GSM_PWR_CTRL_MEAS_AVG_ALGO_OSMO_EWMA = 0x04,
-};
-
-/* MS/BS Power related measurement parameters */
-struct gsm_power_ctrl_meas_params {
- /* Are these measurement paremeters to be taken into account by loop? */
- bool enabled;
-
- /* Thresholds (see 3GPP TS 45.008, section A.3.2.1) */
- uint8_t lower_thresh; /* lower (decreasing) direction */
- uint8_t upper_thresh; /* upper (increasing) direction */
-
- /* Threshold Comparators for lower (decreasing) direction */
- uint8_t lower_cmp_p; /* P1 for RxLev, P3 for RxQual */
- uint8_t lower_cmp_n; /* N1 for RxLev, N3 for RxQual */
- /* Threshold Comparators for upper (increasing) direction */
- uint8_t upper_cmp_p; /* P2 for RxLev, P4 for RxQual */
- uint8_t upper_cmp_n; /* N2 for RxLev, N4 for RxQual */
-
- /* Hreqave and Hreqt (see 3GPP TS 45.008, Annex A) */
- uint8_t h_reqave;
- uint8_t h_reqt;
-
- /* AVG algorithm and its specific parameters */
- enum gsm_power_ctrl_meas_avg_algo algo;
- union {
- /* Exponentially Weighted Moving Average */
- struct {
- /* Smoothing factor: higher the value - less smoothing */
- uint8_t alpha; /* 1 .. 99 (in %) */
- } ewma;
- };
-};
-
-enum gsm_power_ctrl_dir {
- GSM_PWR_CTRL_DIR_UL, /* MS Power Control */
- GSM_PWR_CTRL_DIR_DL, /* BS Power Control */
-};
-
-enum gsm_power_ctrl_mode {
- /* Do not send MS/BS Power Control IEs */
- GSM_PWR_CTRL_MODE_NONE = 0,
- /* Send MS/BS Power IE only (with target level) */
- GSM_PWR_CTRL_MODE_STATIC,
- /* Send MS/BS Power [Parameters] IEs (dynamic mode) */
- GSM_PWR_CTRL_MODE_DYN_BTS,
- /* Do not send MS/BS Power IEs and use BSC Power Loop */
- GSM_PWR_CTRL_MODE_DYN_BSC,
-
-};
-
-/* MS/BS Power Control Parameters */
-struct gsm_power_ctrl_params {
- /* Power Control direction: Uplink or Downlink */
- enum gsm_power_ctrl_dir dir;
- /* Power Control mode to be used by the BTS */
- enum gsm_power_ctrl_mode mode;
-
- /* BS Power reduction value / maximum (in dB) */
- uint8_t bs_power_val_db; /* for static mode */
- uint8_t bs_power_max_db; /* for dynamic mode */
-
- /* Power change step size (dynamic mode only) */
- uint8_t inc_step_size_db; /* increasing direction */
- uint8_t red_step_size_db; /* reducing direction */
-
- /* Minimum interval between power level changes */
- uint8_t ctrl_interval; /* 1 step is 2 SACCH periods */
-
- /* Measurement averaging parameters for RxLev & RxQual */
- struct gsm_power_ctrl_meas_params rxqual_meas;
- struct gsm_power_ctrl_meas_params rxlev_meas;
- /* Measurement averaging parameters for C/I: */
- struct gsm_power_ctrl_meas_params ci_fr_meas;
- struct gsm_power_ctrl_meas_params ci_hr_meas;
- struct gsm_power_ctrl_meas_params ci_amr_fr_meas;
- struct gsm_power_ctrl_meas_params ci_amr_hr_meas;
- struct gsm_power_ctrl_meas_params ci_sdcch_meas;
- struct gsm_power_ctrl_meas_params ci_gprs_meas;
-};
-
-extern const struct gsm_power_ctrl_params power_ctrl_params_def;
-void power_ctrl_params_def_reset(struct gsm_power_ctrl_params *params,
- enum gsm_power_ctrl_dir dir);
-
/* Interference Measurement Parameters */
struct gsm_interf_meas_params {
/* Intave: Interference Averaging period (see 3GPP TS 45.008, table A.1) */
diff --git a/include/osmocom/bsc/power_control.h b/include/osmocom/bsc/power_control.h
index 82cbcb096..2eb23e7e2 100644
--- a/include/osmocom/bsc/power_control.h
+++ b/include/osmocom/bsc/power_control.h
@@ -5,3 +5,95 @@
#include <osmocom/bsc/meas_rep.h>
int lchan_ms_pwr_ctrl(struct gsm_lchan *lchan, const struct gsm_meas_rep *mr);
+
+/* MS/BS Power related measurement averaging algo */
+enum gsm_power_ctrl_meas_avg_algo {
+ GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE = 0x00,
+ GSM_PWR_CTRL_MEAS_AVG_ALGO_UNWEIGHTED = 0x01,
+ GSM_PWR_CTRL_MEAS_AVG_ALGO_WEIGHTED = 0x02,
+ GSM_PWR_CTRL_MEAS_AVG_ALGO_MOD_MEDIAN = 0x03,
+ /* EWMA is an Osmocom specific algo */
+ GSM_PWR_CTRL_MEAS_AVG_ALGO_OSMO_EWMA = 0x04,
+};
+
+/* MS/BS Power related measurement parameters */
+struct gsm_power_ctrl_meas_params {
+ /* Are these measurement paremeters to be taken into account by loop? */
+ bool enabled;
+
+ /* Thresholds (see 3GPP TS 45.008, section A.3.2.1) */
+ uint8_t lower_thresh; /* lower (decreasing) direction */
+ uint8_t upper_thresh; /* upper (increasing) direction */
+
+ /* Threshold Comparators for lower (decreasing) direction */
+ uint8_t lower_cmp_p; /* P1 for RxLev, P3 for RxQual */
+ uint8_t lower_cmp_n; /* N1 for RxLev, N3 for RxQual */
+ /* Threshold Comparators for upper (increasing) direction */
+ uint8_t upper_cmp_p; /* P2 for RxLev, P4 for RxQual */
+ uint8_t upper_cmp_n; /* N2 for RxLev, N4 for RxQual */
+
+ /* Hreqave and Hreqt (see 3GPP TS 45.008, Annex A) */
+ uint8_t h_reqave;
+ uint8_t h_reqt;
+
+ /* AVG algorithm and its specific parameters */
+ enum gsm_power_ctrl_meas_avg_algo algo;
+ union {
+ /* Exponentially Weighted Moving Average */
+ struct {
+ /* Smoothing factor: higher the value - less smoothing */
+ uint8_t alpha; /* 1 .. 99 (in %) */
+ } ewma;
+ };
+};
+
+enum gsm_power_ctrl_dir {
+ GSM_PWR_CTRL_DIR_UL, /* MS Power Control */
+ GSM_PWR_CTRL_DIR_DL, /* BS Power Control */
+};
+
+enum gsm_power_ctrl_mode {
+ /* Do not send MS/BS Power Control IEs */
+ GSM_PWR_CTRL_MODE_NONE = 0,
+ /* Send MS/BS Power IE only (with target level) */
+ GSM_PWR_CTRL_MODE_STATIC,
+ /* Send MS/BS Power [Parameters] IEs (dynamic mode) */
+ GSM_PWR_CTRL_MODE_DYN_BTS,
+ /* Do not send MS/BS Power IEs and use BSC Power Loop */
+ GSM_PWR_CTRL_MODE_DYN_BSC,
+
+};
+
+/* MS/BS Power Control Parameters */
+struct gsm_power_ctrl_params {
+ /* Power Control direction: Uplink or Downlink */
+ enum gsm_power_ctrl_dir dir;
+ /* Power Control mode to be used by the BTS */
+ enum gsm_power_ctrl_mode mode;
+
+ /* BS Power reduction value / maximum (in dB) */
+ uint8_t bs_power_val_db; /* for static mode */
+ uint8_t bs_power_max_db; /* for dynamic mode */
+
+ /* Power change step size (dynamic mode only) */
+ uint8_t inc_step_size_db; /* increasing direction */
+ uint8_t red_step_size_db; /* reducing direction */
+
+ /* Minimum interval between power level changes */
+ uint8_t ctrl_interval; /* 1 step is 2 SACCH periods */
+
+ /* Measurement averaging parameters for RxLev & RxQual */
+ struct gsm_power_ctrl_meas_params rxqual_meas;
+ struct gsm_power_ctrl_meas_params rxlev_meas;
+ /* Measurement averaging parameters for C/I: */
+ struct gsm_power_ctrl_meas_params ci_fr_meas;
+ struct gsm_power_ctrl_meas_params ci_hr_meas;
+ struct gsm_power_ctrl_meas_params ci_amr_fr_meas;
+ struct gsm_power_ctrl_meas_params ci_amr_hr_meas;
+ struct gsm_power_ctrl_meas_params ci_sdcch_meas;
+ struct gsm_power_ctrl_meas_params ci_gprs_meas;
+};
+
+extern const struct gsm_power_ctrl_params power_ctrl_params_def;
+void power_ctrl_params_def_reset(struct gsm_power_ctrl_params *params,
+ enum gsm_power_ctrl_dir dir);