This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
fixeria gerrit-no-reply at lists.osmocom.orgfixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/25899 )
Change subject: [overpower] Turn it on and off depending on DL RxQual
......................................................................
[overpower] Turn it on and off depending on DL RxQual
Change-Id: Iaa812d4661ee17c4cd4a8c4ae4bd3e94c1a2e6cc
Depends: Ia28293a12de0af71f55e701fb65c46e905dae217
Related: SYS#5319
---
M include/osmo-bts/lchan.h
M src/common/measurement.c
M src/common/rsl.c
M src/common/scheduler.c
4 files changed, 75 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/99/25899/1
diff --git a/include/osmo-bts/lchan.h b/include/osmo-bts/lchan.h
index b463b24..b1e3a96 100644
--- a/include/osmo-bts/lchan.h
+++ b/include/osmo-bts/lchan.h
@@ -293,8 +293,9 @@
struct gsm_power_ctrl_params ms_dpc_params;
struct gsm_power_ctrl_params bs_dpc_params;
- /* Temporary ACCH overpower capabilities */
+ /* Temporary ACCH overpower capabilities and state */
struct abis_rsl_osmo_temp_ovp_acch_cap top_acch_cap;
+ bool top_acch_active;
struct msgb *pending_rel_ind_msg;
diff --git a/src/common/measurement.c b/src/common/measurement.c
index 52431c5..5036128 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -865,6 +865,56 @@
LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "DL-FACCH repetition: active => inactive\n");
}
+static void acch_overpower_active_decision(struct gsm_lchan *lchan,
+ const struct gsm48_hdr *gh)
+{
+ const bool old = lchan->top_acch_active;
+ const struct gsm48_meas_res *meas_res;
+ uint8_t upper, lower, rxqual;
+
+ /* ACCH overpower is not allowed => nothing to do */
+ if (lchan->top_acch_cap.overpower_db == 0)
+ return;
+ /* RxQual threshold is disabled => overpower is always on */
+ if (lchan->top_acch_cap.rxqual == 0)
+ return;
+
+ /* Parse MS measurement results */
+ if (gh == NULL)
+ return;
+ /* Check if this is a Measurement Report */
+ if (gh->proto_discr != GSM48_PDISC_RR)
+ return;
+ if (gh->msg_type != GSM48_MT_RR_MEAS_REP)
+ return;
+ meas_res = (const struct gsm48_meas_res *) gh->data;
+ if (meas_res->meas_valid != 0) /* 0 = valid */
+ goto out;
+
+ /* If DTx is active on Downlink, use the '-SUB' */
+ if (meas_res->dtx_used)
+ rxqual = meas_res->rxqual_sub;
+ else /* ... otherwise use the '-FULL' */
+ rxqual = meas_res->rxqual_full;
+
+ upper = lchan->top_acch_cap.rxqual;
+ if (upper > 2)
+ lower = upper - 2;
+ else
+ lower = 0;
+
+ if (rxqual >= upper)
+ lchan->top_acch_active = true;
+ else if (rxqual <= lower)
+ lchan->top_acch_active = false;
+
+ if (lchan->top_acch_active != old) {
+ LOGPLCHAN(lchan, DL1P, LOGL_DEBUG, "Temporary ACCH overpower: %s\n",
+ lchan->top_acch_active ? "inactive => active"
+ : "active => inactive");
+ }
+}
+
/* Called every time a Measurement Result (TS 08.58 8.4.8) is received from
* lower layers and has to be forwarded to BSC */
int handle_ms_meas_report(struct gsm_lchan *lchan,
@@ -929,7 +979,10 @@
if (gh)
lchan_bs_pwr_ctrl(lchan, gh);
+ /* Trigger ACCH repetition/overpower decision logic */
+ /* TODO: parse RxQual once, feed it to both functions */
repeated_dl_facch_active_decision(lchan, gh);
+ acch_overpower_active_decision(lchan, gh);
/* Reset state for next iteration */
lchan->tch.dtx.dl_active = false;
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 7fc4f3e..1555579 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1604,6 +1604,11 @@
TLVP_VAL(tp, RSL_IE_OSMO_TEMP_OVP_ACCH_CAP),
sizeof(lchan->top_acch_cap));
+ /* Simplify checking whether the overpower is enabled at all: allow
+ * testing just one parameter (overpower_db > 0) instead of all three. */
+ if (!lchan->top_acch_cap.sacch_enabled && !lchan->top_acch_cap.facch_enabled)
+ lchan->top_acch_cap.overpower_db = 0;
+
return 0;
}
@@ -1923,6 +1928,13 @@
if (rc < 0)
return rsl_tx_chan_act_acknack(lchan, -rc);
+ /* Take the first ACCH overpower decision (if allowed): it can be
+ * enabled immediately if the RxQual threshold is disabled (0). */
+ if (lchan->top_acch_cap.overpower_db > 0)
+ lchan->top_acch_active = !lchan->top_acch_cap.rxqual;
+ else
+ lchan->top_acch_active = false;
+
/* actually activate the channel in the BTS */
rc = l1sap_chan_act(lchan->ts->trx, dch->chan_nr, &tp);
if (rc < 0)
@@ -2193,6 +2205,13 @@
if (rc < 0)
return rsl_tx_mode_modif_nack(lchan, -rc);
+ /* Immediately disable ACCH overpower if the value is 0 dB,
+ * or enable if the RxQual threshold becomes disabled (0). */
+ if (lchan->top_acch_cap.overpower_db == 0)
+ lchan->top_acch_active = false;
+ else if (lchan->top_acch_cap.rxqual == 0)
+ lchan->top_acch_active = true;
+
l1sap_chan_modify(lchan->ts->trx, dch->chan_nr);
/* FIXME: delay this until L1 says OK? */
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 94900c6..4f97db5 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -1304,7 +1304,7 @@
br->att = lchan->bs_power_ctrl.current;
/* Temporary Overpower for SACCH/FACCH bursts */
- if (lchan->top_acch_cap.overpower_db == 0)
+ if (!lchan->top_acch_active)
return;
if ((lchan->top_acch_cap.sacch_enabled && desc->link_id == LID_SACCH)
|| (lchan->top_acch_cap.facch_enabled && br->flags & TRX_BR_F_FACCH)) {
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25899
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iaa812d4661ee17c4cd4a8c4ae4bd3e94c1a2e6cc
Gerrit-Change-Number: 25899
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211022/35332ae2/attachment.htm>