aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/gsm_data.c
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-09-20 14:12:27 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2018-09-24 11:35:52 +0200
commit5a43b55a8e749ef020a35679ecc3d75e1d23a8fa (patch)
tree6978711e3968f1b82a6bc5ad82099ff6f6f70b51 /src/osmo-bsc/gsm_data.c
parent878954a1b302b0b8dee3cdb3ed863aecc0b07073 (diff)
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
Diffstat (limited to 'src/osmo-bsc/gsm_data.c')
-rw-r--r--src/osmo-bsc/gsm_data.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 0718e91ca..8d0b83173 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -774,6 +774,7 @@ static const struct gprs_rlc_cfg rlc_cfg_default = {
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 @@ struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, uint8_t bts_num)
.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;
}