From c64fa4f88818a63bada0e34d179fd04319de47e1 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Tue, 26 Mar 2013 07:52:41 +0100 Subject: Change to new structure of multirate at gsm_data_shared.h --- src/common/amr.c | 23 +++++++++++++---------- src/common/rsl.c | 12 ++++++------ src/osmo-bts-sysmo/oml.c | 19 +++++++++++-------- 3 files changed, 30 insertions(+), 24 deletions(-) (limited to 'src') 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 0908f1cc..a225155a 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -837,12 +837,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), @@ -1094,12 +1094,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 4c9ac497..adc0241c 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -818,6 +818,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", @@ -857,41 +860,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: -- cgit v1.2.3