Change in osmo-bsc[master]: gsm_data.c: Set reasonable AMR codec defaults in gsm_bts_alloc()

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Sep 24 11:14:31 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11058 )

Change subject: gsm_data.c: Set reasonable AMR codec defaults in gsm_bts_alloc()
......................................................................

gsm_data.c: Set reasonable AMR codec defaults in gsm_bts_alloc()

At the moment we do not initalize the struct members mr_full and mr_half
in struct gsm_bts. The user still has the option to configure reasonable
values via vty, but when not VTY configuration is made, the flags for
the AMR rates will be all zero. Lets initalize the struct members with
reasonable defaults.

- Make sure gsm_bts_alloc() populates fr_half and fr_full with
  reasonable defaults.

Change-Id: I68747ae6dd2582e2a7d60337d9f2c43bd06ac525
Related: OS#3548
---
M src/osmo-bsc/gsm_data.c
1 file changed, 28 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 0718e91..8d0b831 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -774,6 +774,7 @@
 struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, uint8_t bts_num)
 {
 	struct gsm_bts *bts = talloc_zero(net, struct gsm_bts);
+	struct gsm48_multi_rate_conf mr_cfg;
 	int i;
 
 	if (!bts)
@@ -885,6 +886,33 @@
 		.amr = 1,
 	};
 
+	/* Set reasonable defaults for AMR-FR and AMR-HR rate configuration.
+	 * It is possible to set up to 4 codecs per active set, while 5,15K must
+	 * be selected. */
+	mr_cfg = (struct gsm48_multi_rate_conf) {
+		.m4_75 = 0,
+		.m5_15 = 1,
+		.m5_90 = 1,
+		.m6_70 = 0,
+		.m7_40 = 0,
+		.m7_95 = 0,
+		.m10_2 = 1,
+		.m12_2 = 1
+	};
+	memcpy(bts->mr_full.gsm48_ie, &mr_cfg, sizeof(bts->mr_full.gsm48_ie));
+
+	mr_cfg = (struct gsm48_multi_rate_conf) {
+		.m4_75 = 0,
+		.m5_15 = 1,
+		.m5_90 = 1,
+		.m6_70 = 0,
+		.m7_40 = 1,
+		.m7_95 = 1,
+		.m10_2 = 0,
+		.m12_2 = 0
+	};
+	memcpy(bts->mr_half.gsm48_ie, &mr_cfg, sizeof(bts->mr_half.gsm48_ie));
+
 	return bts;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/11058
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I68747ae6dd2582e2a7d60337d9f2c43bd06ac525
Gerrit-Change-Number: 11058
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180924/96937033/attachment.htm>


More information about the gerrit-log mailing list