diff options
author | Keith <keith@rhizomatica.org> | 2021-09-23 06:43:03 +0200 |
---|---|---|
committer | keith <keith@rhizomatica.org> | 2021-10-05 04:32:33 +0000 |
commit | 22622452095bff83b254b5c5123438564f3b2219 (patch) | |
tree | 1101658f83a450b59a10caa81765c190a6f33c2d /include/osmocom | |
parent | b263d860e6ae98673b1c3973351af2e98c092dea (diff) |
Implement MS Uplink Power Control Loop
* Adds vty option dyn-bsc for ms-power-control -> mode
* Imports power_control.c from osmo-bts project
[at commit 2f3cd4b697972d8484f9a9d3b7ef634086f65fa5]
* Removes unused C/I code from osmo-bts's power_control.c
This patch then calls the power loop on receipt of measurement
reports and updates the MS Power Level accordingly.
Change-Id: Ibc307e758697eb5ca3fb86622f35709d6077db9e
Diffstat (limited to 'include/osmocom')
-rw-r--r-- | include/osmocom/bsc/Makefile.am | 1 | ||||
-rw-r--r-- | include/osmocom/bsc/debug.h | 1 | ||||
-rw-r--r-- | include/osmocom/bsc/gsm_data.h | 26 | ||||
-rw-r--r-- | include/osmocom/bsc/power_control.h | 7 |
4 files changed, 35 insertions, 0 deletions
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 3accc740a..3bccf44fd 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -62,4 +62,5 @@ noinst_HEADERS = \ penalty_timers.h \ osmo_bsc_lcls.h \ smscb.h \ + power_control.h \ $(NULL) diff --git a/include/osmocom/bsc/debug.h b/include/osmocom/bsc/debug.h index 4ad61b42e..a3cad68b7 100644 --- a/include/osmocom/bsc/debug.h +++ b/include/osmocom/bsc/debug.h @@ -29,6 +29,7 @@ enum { DCBS, DLCS, DRESET, + DLOOP, Debug_LastEntry, }; diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 21828d4f4..36d364c97 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -673,6 +673,27 @@ struct lchan_modify_info { #define INTERF_DBM_UNKNOWN 0 #define INTERF_BAND_UNKNOWN 0xff +/* Measurement pre-processing state */ +struct gsm_power_ctrl_meas_proc_state { + /* Number of measurements processed */ + unsigned int meas_num; + /* Algorithm specific data */ + union { + struct { + /* Scaled up 100 times average value */ + int Avg100; + } ewma; + }; +}; + +struct lchan_power_ctrl_state { + /* Measurement pre-processing state (for dynamic mode) */ + struct gsm_power_ctrl_meas_proc_state rxlev_meas_proc; + struct gsm_power_ctrl_meas_proc_state rxqual_meas_proc; + /* Number of SACCH blocks to skip (for dynamic mode) */ + int skip_block_num; +}; + struct gsm_lchan { /* The TS that we're part of */ struct gsm_bts_trx_ts *ts; @@ -820,6 +841,8 @@ struct gsm_lchan { /* Actual reported interference band index, or INTERF_BAND_UNKNOWN if this lchan was not included in the most * recent Resource Indication. */ uint8_t interf_band; + /* MS power control state */ + struct lchan_power_ctrl_state ms_power_ctrl; }; /* One Timeslot in a TRX */ @@ -1342,6 +1365,9 @@ enum gsm_power_ctrl_mode { 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 */ diff --git a/include/osmocom/bsc/power_control.h b/include/osmocom/bsc/power_control.h new file mode 100644 index 000000000..82cbcb096 --- /dev/null +++ b/include/osmocom/bsc/power_control.h @@ -0,0 +1,7 @@ +#pragma once + +#include <stdint.h> +#include <osmocom/bsc/gsm_data.h> +#include <osmocom/bsc/meas_rep.h> + +int lchan_ms_pwr_ctrl(struct gsm_lchan *lchan, const struct gsm_meas_rep *mr); |