From 034cc1216a2938ac52c82ff1dafaa78d527e3b48 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Mon, 30 Aug 2021 10:53:58 +0200 Subject: bty_vty: add VTY settungs for temporary overpower To configure temporary overpower, new VTY commands are added. This patch also addes the logic needed to attach the temporary overpower IE to the RSL CHANNEL ACTIVATE message. Change-Id: I488a91bb4ed86f630db56564a0cd293f39f0f690 Related: SYS#5319 --- include/osmocom/bsc/bts.h | 5 +++++ src/osmo-bsc/abis_rsl.c | 31 +++++++++++++++++++++++++++++++ src/osmo-bsc/bts_vty.c | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h index 291ec1082..5ff798bc8 100644 --- a/include/osmocom/bsc/bts.h +++ b/include/osmocom/bsc/bts.h @@ -549,6 +549,11 @@ struct gsm_bts { * enable/disable certain ACCH repeation features individually */ struct abis_rsl_osmo_rep_acch_cap repeated_acch_policy; + /* osmocom specific FACCH/SACCH temporary overpower value. This value + * is set to a constant value by the VTY. Temporary overpower is only + * applied when FACCH/SACCH repetition is not applicable or disabled */ + struct abis_rsl_osmo_temp_ovp_acch_cap temporary_overpower; + /* MS/BS Power Control parameters */ struct gsm_power_ctrl_params ms_power_ctrl; struct gsm_power_ctrl_params bs_power_ctrl; diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 26231ac9d..c7399ebef 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -548,6 +548,35 @@ static void rep_acch_cap_for_bts(struct gsm_lchan *lchan, } } +/* indicate Temporary overpower of SACCH and FACCH channels */ +static void top_acch_cap_for_bts(struct gsm_lchan *lchan, struct msgb *msg) +{ + struct abis_rsl_osmo_temp_ovp_acch_cap cap; + struct gsm_bts *bts = lchan->ts->trx->bts; + bool acch_rep_enabled; + bool acch_rep_supp_by_ms; + + /* The BTS_FEAT_ACCH_TEMP_OVP IE is a proprietary IE, that can only be used with osmo-bts type BTSs */ + if (!(bts->model->type == GSM_BTS_TYPE_OSMOBTS && osmo_bts_has_feature(&bts->features, BTS_FEAT_ACCH_TEMP_OVP))) + return; + + memcpy(&cap, &bts->temporary_overpower, sizeof(cap)); + + /* The user has enabled one of the two downlink related ACCH repetition features. */ + acch_rep_enabled = bts->repeated_acch_policy.dl_sacch || bts->repeated_acch_policy.dl_facch_all + || bts->repeated_acch_policy.dl_facch_cmd; + + /* The MS indicates support for ACCH repetition */ + acch_rep_supp_by_ms = lchan->conn && lchan->conn->cm3_valid && lchan->conn->cm3.repeated_acch_capability; + + /* If the MS fully supports repeated ACCH capabilites as specified in 3GPP TS 44.006, section 10 and 11. and if + * ACCH repetition is enabled for this BTS, then we will not apply temporary overpower. */ + if (acch_rep_enabled && acch_rep_supp_by_ms) + cap.overpower_db = 0; + + msgb_tlv_put(msg, RSL_IE_OSMO_TEMP_OVP_ACCH_CAP, sizeof(cap), (uint8_t*) &cap); +} + /* Write RSL_IE_OSMO_TRAINING_SEQUENCE to msgb. The tsc_set argument's range is 1-4, tsc argument range is 0-7. */ static void put_osmo_training_sequence_ie(struct msgb *msg, uint8_t tsc_set, uint8_t tsc) { @@ -675,6 +704,7 @@ int rsl_tx_chan_activ(struct gsm_lchan *lchan, uint8_t act_type, uint8_t ho_ref) } rep_acch_cap_for_bts(lchan, msg); + top_acch_cap_for_bts(lchan, msg); /* Selecting a specific TSC Set is only applicable to VAMOS mode */ if (lchan->activate.info.vamos && lchan->activate.tsc_set >= 1) @@ -746,6 +776,7 @@ int rsl_chan_mode_modify_req(struct gsm_lchan *lchan) } rep_acch_cap_for_bts(lchan, msg); + top_acch_cap_for_bts(lchan, msg); /* Selecting a specific TSC Set is only applicable to VAMOS mode. Send this Osmocom specific IE only to OsmoBTS * types. */ diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index 445eea402..bd0646320 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -747,6 +747,41 @@ DEFUN_USRATTR(cfg_bts_rep_rxqual, return CMD_SUCCESS; } +#define TOP_ACCH_STR "Temporary ACCH overpower\n" + +DEFUN_USRATTR(cfg_bts_top_dl_acch, + cfg_bts_top_dl_acch_cmd, + X(BSC_VTY_ATTR_NEW_LCHAN), + "overpower dl-acch <1-4>", + TOP_ACCH_STR + "Enable ACCH overpower for this BTS\n" + "overpower value in dB\n") +{ + struct gsm_bts *bts = vty->index; + + if (bts->model->type != GSM_BTS_TYPE_OSMOBTS) { + vty_out(vty, "%% repeated ACCH not supported by BTS %u%s", + bts->nr, VTY_NEWLINE); + return CMD_WARNING; + } + + bts->temporary_overpower.overpower_db = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN_USRATTR(cfg_bts_top_no_dl_acch, + cfg_bts_top_no_dl_acch_cmd, + X(BSC_VTY_ATTR_NEW_LCHAN), + "no overpower dl-acch", + NO_STR TOP_ACCH_STR + "Disable ACCH overpower for this BTS\n") +{ + struct gsm_bts *bts = vty->index; + + bts->temporary_overpower.overpower_db = 0; + + return CMD_SUCCESS; +} #define CD_STR "Channel Description\n" @@ -3967,6 +4002,9 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) ho_vty_write_bts(vty, bts); + if (bts->temporary_overpower.overpower_db > 0) + vty_out(vty, " overpower dl-acch %u%s", bts->temporary_overpower.overpower_db, VTY_NEWLINE); + if (bts->repeated_acch_policy.dl_facch_all) vty_out(vty, " repeat dl-facch all%s", VTY_NEWLINE); else if (bts->repeated_acch_policy.dl_facch_cmd) @@ -4182,6 +4220,8 @@ int bts_vty_init(void) install_element(BTS_NODE, &cfg_bts_rep_ul_dl_sacch_cmd); install_element(BTS_NODE, &cfg_bts_rep_no_ul_dl_sacch_cmd); install_element(BTS_NODE, &cfg_bts_rep_rxqual_cmd); + install_element(BTS_NODE, &cfg_bts_top_dl_acch_cmd); + install_element(BTS_NODE, &cfg_bts_top_no_dl_acch_cmd); install_element(BTS_NODE, &cfg_bts_interf_meas_avg_period_cmd); install_element(BTS_NODE, &cfg_bts_interf_meas_level_bounds_cmd); install_element(BTS_NODE, &cfg_bts_srvcc_fast_return_cmd); -- cgit v1.2.3