Change in osmo-bsc[master]: eliminate lchan->rsl_cmode

neels gerrit-no-reply at lists.osmocom.org
Tue Jun 1 17:29:36 UTC 2021


neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24354 )

Change subject: eliminate lchan->rsl_cmode
......................................................................

eliminate lchan->rsl_cmode

Related: SYS#5315 OS#4940
Change-Id: I1c167b22bb6638a929488d093bde0f1a5fb227ad
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/gsm_04_08_rr.c
M src/osmo-bsc/gsm_data.c
M src/osmo-bsc/lchan_fsm.c
5 files changed, 26 insertions(+), 43 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, but someone else must approve



diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 68c3074..ce47792 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -668,7 +668,6 @@
 	/* The logical channel type */
 	enum gsm_chan_t type;
 	/* RSL channel mode */
-	enum rsl_cmod_spd rsl_cmode;
 	enum lchan_csd_mode csd_mode;
 	/* Power levels for MS and BTS */
 	uint8_t bs_power;
@@ -1390,4 +1389,6 @@
 
 extern const struct gsm_power_ctrl_params power_ctrl_params_def;
 
+enum rsl_cmod_spd chan_mode_to_rsl_cmod_spd(enum gsm48_chan_mode chan_mode);
+
 #endif /* _GSM_DATA_H */
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 1aaebe3..9aced8b 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -364,12 +364,11 @@
 		cm->dtx_dtu |= RSL_CMOD_DTXd;
 
 	/* set TCH Speech/Data */
-	cm->spd_ind = lchan->rsl_cmode;
-
-	if (lchan->rsl_cmode == RSL_CMOD_SPD_SIGN &&
-	    ch_mode_rate->chan_mode != GSM48_CMODE_SIGN)
-		LOGP(DRSL, LOGL_ERROR, "unsupported: rsl_mode == signalling, "
-			"but tch_mode != signalling\n");
+	cm->spd_ind = chan_mode_to_rsl_cmod_spd(ch_mode_rate->chan_mode);
+	if (cm->spd_ind < 0) {
+		LOGP(DRSL, LOGL_ERROR, "unsupported: chan_mode = 0x%02x\n", ch_mode_rate->chan_mode);
+		return cm->spd_ind;
+	}
 
 	switch (lchan->type) {
 	case GSM_LCHAN_SDCCH:
diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c
index 8a375cb..bcc61a5 100644
--- a/src/osmo-bsc/gsm_04_08_rr.c
+++ b/src/osmo-bsc/gsm_04_08_rr.c
@@ -678,24 +678,6 @@
 		return -1;
 	}
 
-	/* update the channel type */
-	switch (mod->mode) {
-	case GSM48_CMODE_SIGN:
-		msg->lchan->rsl_cmode = RSL_CMOD_SPD_SIGN;
-		break;
-	case GSM48_CMODE_SPEECH_V1:
-	case GSM48_CMODE_SPEECH_EFR:
-	case GSM48_CMODE_SPEECH_AMR:
-		msg->lchan->rsl_cmode = RSL_CMOD_SPD_SPEECH;
-		break;
-	case GSM48_CMODE_DATA_14k5:
-	case GSM48_CMODE_DATA_12k0:
-	case GSM48_CMODE_DATA_6k0:
-	case GSM48_CMODE_DATA_3k6:
-		msg->lchan->rsl_cmode = RSL_CMOD_SPD_DATA;
-		break;
-	}
-
 	return 0;
 }
 
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index a371064..09fb64f 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -1059,3 +1059,22 @@
 		.h_reqt = 6, /* TODO: investigate a reasonable default value */
 	},
 };
+
+enum rsl_cmod_spd chan_mode_to_rsl_cmod_spd(enum gsm48_chan_mode chan_mode)
+{
+	switch (chan_mode) {
+	case GSM48_CMODE_SIGN:
+		return RSL_CMOD_SPD_SIGN;
+	case GSM48_CMODE_SPEECH_V1:
+	case GSM48_CMODE_SPEECH_EFR:
+	case GSM48_CMODE_SPEECH_AMR:
+		return RSL_CMOD_SPD_SPEECH;
+	case GSM48_CMODE_DATA_14k5:
+	case GSM48_CMODE_DATA_12k0:
+	case GSM48_CMODE_DATA_6k0:
+	case GSM48_CMODE_DATA_3k6:
+		return RSL_CMOD_SPD_DATA;
+	default:
+		return -EINVAL;
+	}
+}
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 6144ccf..d648202 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -653,24 +653,6 @@
 		}
 	}
 
-	switch (info->ch_mode_rate.chan_mode) {
-
-	case GSM48_CMODE_SIGN:
-		lchan->rsl_cmode = RSL_CMOD_SPD_SIGN;
-		break;
-
-	case GSM48_CMODE_SPEECH_V1:
-	case GSM48_CMODE_SPEECH_EFR:
-	case GSM48_CMODE_SPEECH_AMR:
-		lchan->rsl_cmode = RSL_CMOD_SPD_SPEECH;
-		break;
-
-	default:
-		lchan_fail("Not implemented: cannot activate for chan mode %s",
-			   gsm48_chan_mode_name(info->ch_mode_rate.chan_mode));
-		return;
-	}
-
 	use_mgwep_ci = lchan_use_mgw_endpoint_ci_bts(lchan);
 
 	LOG_LCHAN(lchan, LOGL_INFO,

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I1c167b22bb6638a929488d093bde0f1a5fb227ad
Gerrit-Change-Number: 24354
Gerrit-PatchSet: 5
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210601/ab4e2850/attachment.htm>


More information about the gerrit-log mailing list