aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-05-21 20:16:36 +0200
committerfixeria <vyanitskiy@sysmocom.de>2021-06-01 02:46:43 +0000
commitc70196240c8d158e25ba3315010167aa46ed5510 (patch)
treeb48556b471d3168ea81f8367c4cff57b82f48fd5 /tests
parente02612d86314e9dff2d167d4ab538f3356823bbd (diff)
[VAMOS] rsl: call bts_supports_cm() from rsl_handle_chan_mod_ie()
Ensure that we check the PHY capabilities in both cases: * RSL CHANnel ACTIVation, and * RSL CHANnel MODE MODIFY, by calling bts_supports_cm() from rsl_handle_chan_mod_ie(). Modify bts_supports_cm() to accept a 'struct rsl_ie_chan_mode', so we can handle VAMOS enabled channel modes and CSD later on. Change-Id: I31a444592436705ec9d6ddade3cbfa7f8cb4bb91 Related: SYS#5315, OS#4940
Diffstat (limited to 'tests')
-rw-r--r--tests/misc/misc_test.c44
1 files changed, 34 insertions, 10 deletions
diff --git a/tests/misc/misc_test.c b/tests/misc/misc_test.c
index 439d6b33..e65fcb4d 100644
--- a/tests/misc/misc_test.c
+++ b/tests/misc/misc_test.c
@@ -162,25 +162,49 @@ static void test_sacch_get(void)
static void test_bts_supports_cm(void)
{
+ struct rsl_ie_chan_mode cm;
struct gsm_bts *bts;
bts = gsm_bts_alloc(ctx, 0);
+ /* Signalling shall be supported regardless of the features */
+ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Bm,
+ .spd_ind = RSL_CMOD_SPD_SIGN };
+ OSMO_ASSERT(bts_supports_cm(bts, &cm) == 1); /* TCH/F */
+
+ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Lm,
+ .spd_ind = RSL_CMOD_SPD_SIGN };
+ OSMO_ASSERT(bts_supports_cm(bts, &cm) == 1); /* TCH/H */
+
osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_F_V1);
osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_H_V1);
osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_F_AMR);
osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_H_AMR);
- OSMO_ASSERT(bts_supports_cm
- (bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_V1) == 1);
- OSMO_ASSERT(bts_supports_cm
- (bts, GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_V1) == 1);
- OSMO_ASSERT(bts_supports_cm
- (bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_EFR) == 0);
- OSMO_ASSERT(bts_supports_cm
- (bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_AMR) == 1);
- OSMO_ASSERT(bts_supports_cm
- (bts, GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_AMR) == 1);
+ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Bm,
+ .spd_ind = RSL_CMOD_SPD_SPEECH,
+ .chan_rate = RSL_CMOD_SP_GSM1 };
+ OSMO_ASSERT(bts_supports_cm(bts, &cm) == 1); /* TCH/FS */
+
+ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Lm,
+ .spd_ind = RSL_CMOD_SPD_SPEECH,
+ .chan_rate = RSL_CMOD_SP_GSM1 };
+ OSMO_ASSERT(bts_supports_cm(bts, &cm) == 1); /* TCH/HS */
+
+ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Bm,
+ .spd_ind = RSL_CMOD_SPD_SPEECH,
+ .chan_rate = RSL_CMOD_SP_GSM2 };
+ OSMO_ASSERT(bts_supports_cm(bts, &cm) == 0); /* TCH/EFS */
+
+ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Bm,
+ .spd_ind = RSL_CMOD_SPD_SPEECH,
+ .chan_rate = RSL_CMOD_SP_GSM3 };
+ OSMO_ASSERT(bts_supports_cm(bts, &cm) == 1); /* TCH/AFS */
+
+ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Lm,
+ .spd_ind = RSL_CMOD_SPD_SPEECH,
+ .chan_rate = RSL_CMOD_SP_GSM3 };
+ OSMO_ASSERT(bts_supports_cm(bts, &cm) == 1); /* TCH/AHS */
talloc_free(bts);
}