aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-03-26 07:52:41 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2014-04-06 08:57:30 +0200
commitaad7482d8147398ce7949b3d1b1162f2297aaa0e (patch)
tree8262ad231f849cd52aeb987f064d96a12924b7ed
parentaaed532f264fa54f12b80de47e70859d575b32a8 (diff)
Change to new structure of multirate at gsm_data_shared.h
-rw-r--r--src/common/amr.c23
-rw-r--r--src/common/rsl.c12
-rw-r--r--src/osmo-bts-sysmo/oml.c19
3 files changed, 30 insertions, 24 deletions
diff --git a/src/common/amr.c b/src/common/amr.c
index 4a79b69f..b0ff1b9c 100644
--- a/src/common/amr.c
+++ b/src/common/amr.c
@@ -16,8 +16,9 @@ void amr_log_mr_conf(int ss, int logl, const char *pfx,
for (i = 0; i < amr_mrc->num_modes; i++)
LOGPC(ss, logl, ", mode[%u] = %u/%u/%u",
- i, amr_mrc->mode[i].mode, amr_mrc->mode[i].threshold,
- amr_mrc->mode[i].hysteresis);
+ i, amr_mrc->mode[i].mode,
+ amr_mrc->mode[i].threshold_bts,
+ amr_mrc->mode[i].hysteresis_bts);
LOGPC(ss, logl, "\n");
}
@@ -68,18 +69,18 @@ int amr_parse_mr_conf(struct amr_multirate_conf *amr_mrc,
}
if (num_codecs >= 2) {
- amr_mrc->mode[0].threshold = mr_conf[1] & 0x3F;
- amr_mrc->mode[0].hysteresis = mr_conf[2] >> 4;
+ amr_mrc->mode[0].threshold_bts = mr_conf[1] & 0x3F;
+ amr_mrc->mode[0].hysteresis_bts = mr_conf[2] >> 4;
}
if (num_codecs >= 3) {
- amr_mrc->mode[1].threshold =
+ amr_mrc->mode[1].threshold_bts =
((mr_conf[2] & 0xF) << 2) | (mr_conf[3] >> 6);
- amr_mrc->mode[1].hysteresis = (mr_conf[3] >> 2) & 0x7;
+ amr_mrc->mode[1].hysteresis_bts = (mr_conf[3] >> 2) & 0xF;
}
if (num_codecs >= 4) {
- amr_mrc->mode[3].threshold =
+ amr_mrc->mode[2].threshold_bts =
((mr_conf[3] & 0x3) << 4) | (mr_conf[4] >> 4);
- amr_mrc->mode[3].hysteresis = mr_conf[4] & 0xF;
+ amr_mrc->mode[2].hysteresis_bts = mr_conf[4] & 0xF;
}
return num_codecs;
@@ -94,10 +95,12 @@ ret_einval:
unsigned int amr_get_initial_mode(struct gsm_lchan *lchan)
{
struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr;
+ struct gsm48_multi_rate_conf *mr_conf =
+ (struct gsm48_multi_rate_conf *) amr_mrc->gsm48_ie;
- if (lchan->mr_conf.icmi) {
+ if (mr_conf->icmi) {
/* initial mode given, coding in TS 05.09 3.4.1 */
- return lchan->mr_conf.smod;
+ return mr_conf->smod;
} else {
/* implicit rule according to TS 05.09 Chapter 3.4.3 */
switch (amr_mrc->num_modes) {
diff --git a/src/common/rsl.c b/src/common/rsl.c
index b2afe72c..26a809d5 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -806,12 +806,12 @@ static int rsl_rx_chan_activ(struct msgb *msg)
}
/* 9.3.52 MultiRate Configuration */
if (TLVP_PRESENT(&tp, RSL_IE_MR_CONFIG)) {
- if (TLVP_LEN(&tp, RSL_IE_MR_CONFIG) > sizeof(lchan->mr_conf)) {
+ if (TLVP_LEN(&tp, RSL_IE_MR_CONFIG) > sizeof(lchan->mr_bts_lv) - 1) {
LOGP(DRSL, LOGL_ERROR, "Error parsing MultiRate conf IE\n");
return rsl_tx_error_report(msg->trx, RSL_ERR_IE_CONTENT);
}
- memcpy(&lchan->mr_conf, TLVP_VAL(&tp, RSL_IE_MR_CONFIG),
- TLVP_LEN(&tp, RSL_IE_MR_CONFIG));
+ memcpy(lchan->mr_bts_lv, TLVP_VAL(&tp, RSL_IE_MR_CONFIG) - 1,
+ TLVP_LEN(&tp, RSL_IE_MR_CONFIG) + 1);
amr_parse_mr_conf(&lchan->tch.amr_mr, TLVP_VAL(&tp, RSL_IE_MR_CONFIG),
TLVP_LEN(&tp, RSL_IE_MR_CONFIG));
amr_log_mr_conf(DRTP, LOGL_DEBUG, gsm_lchan_name(lchan),
@@ -1062,12 +1062,12 @@ static int rsl_rx_mode_modif(struct msgb *msg)
/* 9.3.52 MultiRate Configuration */
if (TLVP_PRESENT(&tp, RSL_IE_MR_CONFIG)) {
- if (TLVP_LEN(&tp, RSL_IE_MR_CONFIG) > sizeof(lchan->mr_conf)) {
+ if (TLVP_LEN(&tp, RSL_IE_MR_CONFIG) > sizeof(lchan->mr_bts_lv) - 1) {
LOGP(DRSL, LOGL_ERROR, "Error parsing MultiRate conf IE\n");
return rsl_tx_error_report(msg->trx, RSL_ERR_IE_CONTENT);
}
- memcpy(&lchan->mr_conf, TLVP_VAL(&tp, RSL_IE_MR_CONFIG),
- TLVP_LEN(&tp, RSL_IE_MR_CONFIG));
+ memcpy(lchan->mr_bts_lv, TLVP_VAL(&tp, RSL_IE_MR_CONFIG) - 1,
+ TLVP_LEN(&tp, RSL_IE_MR_CONFIG) + 1);
amr_parse_mr_conf(&lchan->tch.amr_mr, TLVP_VAL(&tp, RSL_IE_MR_CONFIG),
TLVP_LEN(&tp, RSL_IE_MR_CONFIG));
amr_log_mr_conf(DRTP, LOGL_DEBUG, gsm_lchan_name(lchan),
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index c39a4aac..e4e1dc00 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -788,6 +788,9 @@ static void set_payload_format(GsmL1_LogChParam_t *lch_par)
static void lchan2lch_par(GsmL1_LogChParam_t *lch_par, struct gsm_lchan *lchan)
{
+ struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr;
+ struct gsm48_multi_rate_conf *mr_conf =
+ (struct gsm48_multi_rate_conf *) amr_mrc->gsm48_ie;
int j;
LOGP(DL1C, LOGL_INFO, "%s: %s tch_mode=0x%02x\n",
@@ -827,41 +830,41 @@ static void lchan2lch_par(GsmL1_LogChParam_t *lch_par, struct gsm_lchan *lchan)
lch_par->tch.amrActiveCodecSet[j] = GsmL1_AmrCodec_Unset;
j = 0;
- if (lchan->mr_conf.m4_75)
+ if (mr_conf->m4_75)
lch_par->tch.amrActiveCodecSet[j++] = GsmL1_AmrCodec_4_75;
if (j >= ARRAY_SIZE(lch_par->tch.amrActiveCodecSet))
break;
- if (lchan->mr_conf.m5_15)
+ if (mr_conf->m5_15)
lch_par->tch.amrActiveCodecSet[j++] = GsmL1_AmrCodec_5_15;
if (j >= ARRAY_SIZE(lch_par->tch.amrActiveCodecSet))
break;
- if (lchan->mr_conf.m5_90)
+ if (mr_conf->m5_90)
lch_par->tch.amrActiveCodecSet[j++] = GsmL1_AmrCodec_5_9;
if (j >= ARRAY_SIZE(lch_par->tch.amrActiveCodecSet))
break;
- if (lchan->mr_conf.m6_70)
+ if (mr_conf->m6_70)
lch_par->tch.amrActiveCodecSet[j++] = GsmL1_AmrCodec_6_7;
if (j >= ARRAY_SIZE(lch_par->tch.amrActiveCodecSet))
break;
- if (lchan->mr_conf.m7_40)
+ if (mr_conf->m7_40)
lch_par->tch.amrActiveCodecSet[j++] = GsmL1_AmrCodec_7_4;
if (j >= ARRAY_SIZE(lch_par->tch.amrActiveCodecSet))
break;
- if (lchan->mr_conf.m7_95)
+ if (mr_conf->m7_95)
lch_par->tch.amrActiveCodecSet[j++] = GsmL1_AmrCodec_7_95;
if (j >= ARRAY_SIZE(lch_par->tch.amrActiveCodecSet))
break;
- if (lchan->mr_conf.m10_2)
+ if (mr_conf->m10_2)
lch_par->tch.amrActiveCodecSet[j++] = GsmL1_AmrCodec_10_2;
if (j >= ARRAY_SIZE(lch_par->tch.amrActiveCodecSet))
break;
- if (lchan->mr_conf.m12_2)
+ if (mr_conf->m12_2)
lch_par->tch.amrActiveCodecSet[j++] = GsmL1_AmrCodec_12_2;
break;
case GSM48_CMODE_DATA_14k5: