Change in osmo-bsc[master]: ensure chan_mode comparisons in non-VAMOS mode

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Sat May 29 22:37:14 UTC 2021


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24459 )


Change subject: ensure chan_mode comparisons in non-VAMOS mode
......................................................................

ensure chan_mode comparisons in non-VAMOS mode

When checking a chan_mode for AMR, both lchans in VAMOS and non-VAMOS
mode should match. So make sure that all chan_modes are converted to
non-vamos before comparing.

Change-Id: I791e7966b1f8eaa3299a8a46abeb313cf5136e0b
---
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/gsm_04_08_rr.c
M src/osmo-bsc/lchan_fsm.c
3 files changed, 8 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/59/24459/1

diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 02f1109..aec6bf5 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -70,7 +70,7 @@
 	OSMO_ASSERT(bts);
 
 	if (lchan->type == GSM_LCHAN_TCH_H) {
-		switch (lchan->current_ch_mode_rate.chan_mode) {
+		switch (gsm48_chan_mode_to_non_vamos(lchan->current_ch_mode_rate.chan_mode)) {
 		case GSM48_CMODE_SPEECH_AMR:
 			rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CODEC_AMR_H]);
 			break;
@@ -81,7 +81,7 @@
 			break;
 		}
 	} else if (lchan->type == GSM_LCHAN_TCH_F) {
-		switch (lchan->current_ch_mode_rate.chan_mode) {
+		switch (gsm48_chan_mode_to_non_vamos(lchan->current_ch_mode_rate.chan_mode)) {
 		case GSM48_CMODE_SPEECH_AMR:
 			rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CODEC_AMR_F]);
 			break;
@@ -390,20 +390,17 @@
 		return -EINVAL;
 	}
 
-	switch (ch_mode_rate->chan_mode) {
+	switch (gsm48_chan_mode_to_non_vamos(ch_mode_rate->chan_mode)) {
 	case GSM48_CMODE_SIGN:
 		cm->chan_rate = 0;
 		break;
 	case GSM48_CMODE_SPEECH_V1:
-	case GSM48_CMODE_SPEECH_V1_VAMOS:
 		cm->chan_rate = RSL_CMOD_SP_GSM1;
 		break;
 	case GSM48_CMODE_SPEECH_EFR:
-	case GSM48_CMODE_SPEECH_V2_VAMOS:
 		cm->chan_rate = RSL_CMOD_SP_GSM2;
 		break;
 	case GSM48_CMODE_SPEECH_AMR:
-	case GSM48_CMODE_SPEECH_V3_VAMOS:
 		cm->chan_rate = RSL_CMOD_SP_GSM3;
 		break;
 	case GSM48_CMODE_DATA_14k5:
@@ -602,7 +599,7 @@
 	add_power_control_params(msg, RSL_IE_BS_POWER_PARAM, lchan);
 	add_power_control_params(msg, RSL_IE_MS_POWER_PARAM, lchan);
 
-	if (lchan->activate.ch_mode_rate.chan_mode == GSM48_CMODE_SPEECH_AMR) {
+	if (gsm48_chan_mode_to_non_vamos(lchan->activate.ch_mode_rate.chan_mode) == GSM48_CMODE_SPEECH_AMR) {
 		rc = put_mr_config_for_bts(msg, &lchan->activate.mr_conf_filtered,
 					   (lchan->type == GSM_LCHAN_TCH_F) ? &bts->mr_full : &bts->mr_half);
 		if (rc) {
@@ -2114,7 +2111,7 @@
 /* Return an ip.access BTS speech mode value (uint8_t) or negative on error. */
 int ipacc_speech_mode(enum gsm48_chan_mode tch_mode, enum gsm_chan_t type)
 {
-	switch (tch_mode) {
+	switch (gsm48_chan_mode_to_non_vamos(tch_mode)) {
 	case GSM48_CMODE_SPEECH_V1:
 		switch (type) {
 		case GSM_LCHAN_TCH_F:
@@ -2162,7 +2159,7 @@
 /* Return an ip.access BTS payload type value (uint8_t) or negative on error. */
 int ipacc_payload_type(enum gsm48_chan_mode tch_mode, enum gsm_chan_t type)
 {
-	switch (tch_mode) {
+	switch (gsm48_chan_mode_to_non_vamos(tch_mode)) {
 	case GSM48_CMODE_SPEECH_V1:
 		switch (type) {
 		case GSM_LCHAN_TCH_F:
diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c
index 6e55947..bfc5bd0 100644
--- a/src/osmo-bsc/gsm_04_08_rr.c
+++ b/src/osmo-bsc/gsm_04_08_rr.c
@@ -638,7 +638,7 @@
 	}
 
 	/* in case of multi rate we need to attach a config */
-	if (new_lchan->current_ch_mode_rate.chan_mode == GSM48_CMODE_SPEECH_AMR) {
+	if (gsm48_chan_mode_to_non_vamos(new_lchan->current_ch_mode_rate.chan_mode) == GSM48_CMODE_SPEECH_AMR) {
 		int rc = put_mr_config_for_ms(msg, &new_lchan->current_mr_conf,
 					      (new_lchan->type == GSM_LCHAN_TCH_F) ? &bts->mr_full : &bts->mr_half);
 		if (rc) {
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 4b0b31f..0708292 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -642,7 +642,7 @@
 	lchan->activate.ch_mode_rate = lchan->activate.info.ch_mode_rate;
 	/* future: automatically adjust chan_mode in lchan->activate.ch_mode_rate */
 
-	if (lchan->activate.ch_mode_rate.chan_mode == GSM48_CMODE_SPEECH_AMR) {
+	if (gsm48_chan_mode_to_non_vamos(lchan->activate.ch_mode_rate.chan_mode) == GSM48_CMODE_SPEECH_AMR) {
 		if (lchan_mr_config(&lchan->activate.mr_conf_filtered, lchan, lchan->activate.ch_mode_rate.s15_s0) < 0) {
 			lchan_fail("Can not generate multirate configuration IE\n");
 			return;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24459
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I791e7966b1f8eaa3299a8a46abeb313cf5136e0b
Gerrit-Change-Number: 24459
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210529/04c750ec/attachment.htm>


More information about the gerrit-log mailing list