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

dexter gerrit-no-reply at lists.osmocom.org
Fri Sep 21 14:47:40 UTC 2018


dexter has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/58/11058/1

diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 0718e91..6b4e5a7 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.
+	*  See also: 3GPP TS 28.062, Table 7.11.3.1.3-2: Preferred Configurations for
+	*  the Adaptive Multi-Rate Codec Types. */
+	mr_cfg = (struct gsm48_multi_rate_conf) {
+		.m4_75 = 1,
+		.m5_15 = 1,
+		.m5_90 = 1,
+		.m6_70 = 1,
+		.m7_40 = 1,
+		.m7_95 = 1,
+		.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 = 1,
+		.m5_15 = 1,
+		.m5_90 = 1,
+		.m6_70 = 1,
+		.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: newchange
Gerrit-Change-Id: I68747ae6dd2582e2a7d60337d9f2c43bd06ac525
Gerrit-Change-Number: 11058
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180921/3ccd7b10/attachment.htm>


More information about the gerrit-log mailing list