From 8bde75c91d0c251468436a1f117f6b92deef82ce Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Wed, 16 Dec 2020 23:20:34 +0100 Subject: power_control: add new structures and default parameters Change-Id: I7fb8ccb997490b40a061d09c241359aaabc37c4a Related: SYS#4918 --- include/osmocom/bsc/bts.h | 4 +++ include/osmocom/bsc/gsm_data.h | 70 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) (limited to 'include') diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h index d2f130730..7c988a81a 100644 --- a/include/osmocom/bsc/bts.h +++ b/include/osmocom/bsc/bts.h @@ -470,6 +470,10 @@ struct gsm_bts { /* osmocom specific FACCH/SACCH repetition mode flags set by VTY to * enable/disable certain ACCH repeation features individually */ struct abis_rsl_osmo_rep_acch_cap repeated_acch_policy; + + /* MS/BS Power Control parameters */ + struct gsm_power_ctrl_params ms_power_ctrl; + struct gsm_power_ctrl_params bs_power_ctrl; }; #define GSM_BTS_SI2Q(bts, i) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater][i]) diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 3472f39b4..f9d5736db 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1269,4 +1269,74 @@ 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 { + /* 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, +}; + +/* 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; + + /* Power change step size (dynamic mode only) */ + uint8_t inc_step_size_db; /* increasing direction */ + uint8_t red_step_size_db; /* reducing direction */ + + /* Measurement averaging parameters for RxLev & RxQual */ + struct gsm_power_ctrl_meas_params rxqual_meas; + struct gsm_power_ctrl_meas_params rxlev_meas; +}; + +extern const struct gsm_power_ctrl_params power_ctrl_params_def; + #endif /* _GSM_DATA_H */ -- cgit v1.2.3