Change to new structure of multirate at gsm_data_shared.h
This commit is contained in:
parent
79bc80102c
commit
c64fa4f888
|
@ -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) {
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue