path: root/openbsc/tests
diff options
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-09-25 15:33:02 +0200
committerHarald Welte <laforge@gnumonks.org>2016-09-28 00:28:01 +0000
commitc3f72f63afde926dfc46827d6880055597515fb6 (patch)
tree62221c2df03881999361982afb4d40a43c809d29 /openbsc/tests
parent2afffd5cf67ad84c4fd8e589798b8697b809ebc5 (diff)
dyn TS: fix: ts_subslots() for TCH/F_PDCH in PDCH mode
In gsm_data_shared.c, add ts_pchan() to determine actual pchan type for dynamic and non-dynamic TS. Use in ts_subslots() to fix the value returned for TCH/F_PDCH in PDCH mode. Adjust the assertion in channel_test.c accordingly. Drop GSM_PCHAN_TCH_F_PDCH, which is now handled in ts_pchan(). Explicitly add GSM_PCHAN_PDCH as zero in subslots_per_pchan[] (cosmetic). Adjust the comment in subslots_per_pchan[]. The fix for the number of subslots affects only one caller: bts_chan_load() in chan_alloc.c. Before this, it would always include a TCH/F_PDCH in the load_counter->total, now it is skipped when in PDCH mode. Whether this is the way bts_chan_load() should handle dynamic TS is a separate discussion, so far I'm only making sure that the two dyn TS kinds act in the same way: TCH/F_TCH/H_PDCH is only counted when in TCH mode, and TCH/F_PDCH should match. Change-Id: Icd6668667ad2be7ad20866ffd185bf3b8711ccd6
Diffstat (limited to 'openbsc/tests')
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c
index 668644dd9..b4a5fb17d 100644
--- a/openbsc/tests/channel/channel_test.c
+++ b/openbsc/tests/channel/channel_test.c
@@ -109,7 +109,7 @@ void test_dyn_ts_subslots(void)
ts.flags = 0; /* TCH_F mode */
OSMO_ASSERT(ts_subslots(&ts) == 1);
ts.flags = TS_F_PDCH_ACTIVE;
- OSMO_ASSERT(ts_subslots(&ts) == 1 /* SHOULD BE 0 */);
+ OSMO_ASSERT(ts_subslots(&ts) == 0);
ts.dyn.pchan_is = GSM_PCHAN_TCH_F;