fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/32558 )
Change subject: bts: st_op_enabled_on_enter(): resume C0 power reduction
......................................................................
bts: st_op_enabled_on_enter(): resume C0 power reduction
If power saving is enabled for a BTS, it should remain enabled even
if the BTS is restarted for whatever reason. This persistence can be
achieved by re-sending the configured power reduction value whenever
the BTS NM FSM enters the ENABLED state again (i.e. reconnects).
Separate gsm_bts_send_c0_power_red() from gsm_bts_set_c0_power_red()
and call the former from st_op_enabled_on_enter(). All we need to do
is to send the value that was configured before, per-timeslot power
reduction limits remain and need not to be updated.
Take a chance to move logging from BTS specific to the generic code.
Change-Id: Ic3f8a2ab0ffd049a8ed84361a3a588c1e1b23ac6
Related: SYS#6435
(cherry picked from commit 16922c5017faf8efa9bbb840aa564a979019a172)
---
M include/osmocom/bsc/bts.h
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_osmobts.c
M src/osmo-bsc/nm_bts_fsm.c
4 files changed, 46 insertions(+), 10 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index 12becf4..b1aaa6f 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -814,6 +814,7 @@
int gsm_bts_set_system_infos(struct gsm_bts *bts);
+int gsm_bts_send_c0_power_red(const struct gsm_bts *bts, const uint8_t red);
int gsm_bts_set_c0_power_red(struct gsm_bts *bts, const uint8_t red);
void gsm_bts_stats_reset(struct gsm_bts *bts);
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index 58a4a0b..585eb99 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -975,21 +975,30 @@
return 0;
}
+/* Send the given C0 power reduction value to the BTS */
+int gsm_bts_send_c0_power_red(const struct gsm_bts *bts, const uint8_t red)
+{
+ if (!osmo_bts_has_feature(&bts->features, BTS_FEAT_BCCH_POWER_RED))
+ return -ENOTSUP;
+ if (bts->model->power_ctrl_send_c0_power_red == NULL)
+ return -ENOTSUP;
+ return bts->model->power_ctrl_send_c0_power_red(bts, red);
+}
+
+/* Send the given C0 power reduction value to the BTS and update the internal state */
int gsm_bts_set_c0_power_red(struct gsm_bts *bts, const uint8_t red)
{
struct gsm_bts_trx *c0 = bts->c0;
unsigned int tn;
int rc;
- if (!osmo_bts_has_feature(&bts->features, BTS_FEAT_BCCH_POWER_RED))
- return -ENOTSUP;
- if (bts->model->power_ctrl_send_c0_power_red == NULL)
- return -ENOTSUP;
-
- rc = bts->model->power_ctrl_send_c0_power_red(bts, red);
+ rc = gsm_bts_send_c0_power_red(bts, red);
if (rc != 0)
return rc;
+ LOG_BTS(bts, DRSL, LOGL_NOTICE, "%sabling BCCH carrier power reduction "
+ "operation mode (maximum %u dB)\n", red ? "En" : "Dis", red);
+
/* Timeslot 0 is always transmitting BCCH/CCCH */
c0->ts[0].c0_max_power_red_db = 0;
diff --git a/src/osmo-bsc/bts_osmobts.c b/src/osmo-bsc/bts_osmobts.c
index 5f6f86f..ea0405b 100644
--- a/src/osmo-bsc/bts_osmobts.c
+++ b/src/osmo-bsc/bts_osmobts.c
@@ -168,10 +168,6 @@
if (msg == NULL)
return -ENOMEM;
- LOGP(DRSL, LOGL_NOTICE, "%sabling BCCH carrier power reduction "
- "operation mode for BTS%u (maximum %u dB)\n",
- red ? "En" : "Dis", bts->nr, red);
-
/* Abuse the standard BS POWER CONTROL message by specifying 'Common Channel'
* in the Protocol Discriminator field and 'BCCH' in the Channel Number IE. */
dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh));
diff --git a/src/osmo-bsc/nm_bts_fsm.c b/src/osmo-bsc/nm_bts_fsm.c
index 92728dc..ea9fa5c 100644
--- a/src/osmo-bsc/nm_bts_fsm.c
+++ b/src/osmo-bsc/nm_bts_fsm.c
@@ -286,6 +286,13 @@
bts->mo.get_attr_rep_received = false;
bts->mo.set_attr_sent = false;
bts->mo.set_attr_ack_received = false;
+
+ /* Resume power saving on the BCCH carrier, if was enabled */
+ if (bts->c0_max_power_red_db > 0) {
+ LOG_BTS(bts, DRSL, LOGL_NOTICE, "Resuming BCCH carrier power reduction "
+ "operation mode (maximum %u dB)\n", bts->c0_max_power_red_db);
+ gsm_bts_send_c0_power_red(bts, bts->c0_max_power_red_db);
+ }
}
static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/32558
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: 2023q1
Gerrit-Change-Id: Ic3f8a2ab0ffd049a8ed84361a3a588c1e1b23ac6
Gerrit-Change-Number: 32558
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/32556 )
Change subject: bts_is_online(): make the BTS pointer const, return bool
......................................................................
Set Ready For Review
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/32556
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: 2023q1
Gerrit-Change-Id: Idb4f9f8862041c5902df0e6e8d1ac2a60ada95df
Gerrit-Change-Number: 32556
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 04 May 2023 05:04:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32594 )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: codec: add define constants for RFC5993 and TS101318
......................................................................
codec: add define constants for RFC5993 and TS101318
The difference between the RFC5993 and the TS101318 format is only that
RFC5993 has one additional ToC (Table of contents) byte at the
beginning. However it can be difficult to remember which of the two
formats has the ToC byte at at the beginning and which hasn't.
Let's add a constant that defines the length for both formats so that we
can make it more clear in the code which format we are refering to.
Related: OS#5688
Change-Id: I125ef9cdab98c073971841c175b1a7dcd927f9c2
---
M include/osmocom/codec/codec.h
1 file changed, 22 insertions(+), 0 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/include/osmocom/codec/codec.h b/include/osmocom/codec/codec.h
index 364385b..a656bcf 100644
--- a/include/osmocom/codec/codec.h
+++ b/include/osmocom/codec/codec.h
@@ -15,6 +15,10 @@
/* TS 101318 Chapter 5.3: 244 bits + 4bit sig */
#define GSM_EFR_BYTES 31
+/* Number of bytes of an GSM_HR RTP payload */
+#define GSM_HR_BYTES_RTP_RFC5993 (GSM_HR_BYTES + 1)
+#define GSM_HR_BYTES_RTP_TS101318 (GSM_HR_BYTES)
+
extern const uint16_t gsm610_bitorder[]; /* FR */
extern const uint16_t gsm620_unvoiced_bitorder[]; /* HR unvoiced */
extern const uint16_t gsm620_voiced_bitorder[]; /* HR voiced */
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32594
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I125ef9cdab98c073971841c175b1a7dcd927f9c2
Gerrit-Change-Number: 32594
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: pespin.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/32597 )
Change subject: layer23: Store and use SAPI & NSAPI in apn->pdp
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/32597
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: If82c94ca9c84a94e63a9a5d642a27a7b4e3ff089
Gerrit-Change-Number: 32597
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 04 May 2023 03:04:48 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment