aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-04-14 23:47:41 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2021-04-15 00:46:45 +0200
commitd6fcd2aff21f7dc2e15e8e9ede5449ead42a18fb (patch)
tree43b9cc9a0f1a95a87b4ffed86d454c678bdc8b86
parent3e1b7fe72a08646303356cae4f16c13fbde4bd30 (diff)
move mr_*_lv arrays out of lchan stateneels/mode_modif
-rw-r--r--include/osmocom/bsc/gsm_data.h3
-rw-r--r--src/osmo-bsc/gsm_04_08_rr.c16
2 files changed, 14 insertions, 5 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 3505a1300..c1d8fd58b 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -645,9 +645,6 @@ struct gsm_lchan {
/* Encryption information */
struct gsm_encr encr;
- /* AMR bits */
- uint8_t mr_ms_lv[7];
- uint8_t mr_bts_lv[7];
/* AMR bits were based on these rate bits: */
uint16_t s15_s0;
diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c
index b69b13342..ffc039ae3 100644
--- a/src/osmo-bsc/gsm_04_08_rr.c
+++ b/src/osmo-bsc/gsm_04_08_rr.c
@@ -558,6 +558,18 @@ int gsm48_send_ho_cmd(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan,
return gsm48_sendmsg(msg);
}
+void put_multi_rate_cfg(struct msgb *msg, struct gsm_bts *bts, struct gsm48_multi_rate_conf *mr_conf,
+ bool full_rate)
+{
+ /* AMR bits */
+ uint8_t mr_ms_lv[7];
+ uint8_t mr_bts_lv[7];
+
+ mr_config_render_lv(mr_ms_lv
+ msgb_tlv_put(msg, GSM48_IE_MUL_RATE_CFG, new_lchan->mr_ms_lv[0],
+ new_lchan->mr_ms_lv + 1);
+}
+
/* Chapter 9.1.2: Assignment Command */
int gsm48_send_rr_ass_cmd(struct gsm_lchan *current_lchan, struct gsm_lchan *new_lchan, uint8_t power_command)
{
@@ -602,8 +614,8 @@ int gsm48_send_rr_ass_cmd(struct gsm_lchan *current_lchan, struct gsm_lchan *new
/* in case of multi rate we need to attach a config */
if (new_lchan->tch_mode == GSM48_CMODE_SPEECH_AMR)
- msgb_tlv_put(msg, GSM48_IE_MUL_RATE_CFG, new_lchan->mr_ms_lv[0],
- new_lchan->mr_ms_lv + 1);
+ put_multi_rate_cfg(msg, new_lchan->ts->trx->bts, new_lchan->activate.mr_config,
+ new_lchan->type == LCHAN_TCH_F);
return gsm48_sendmsg(msg);
}