dyn TS: fix: e1_config.c: switch(pchan) for dyn TS
Add ts_is_tch() in gsm_data_shared.h/.c and use it to replace a switch on the
pchan in e1_config.c.
This patch is not due to an actual observed failure. A general grep for switch
on pchan turned up this instance that doesn't handle dyn TS properly. Hence
this patch is not actually tested with real equipment.
Change-Id: Ide4f156034bab77140d2d9a8c462d68ae6f0d6a6
diff --git a/openbsc/src/libbsc/e1_config.c b/openbsc/src/libbsc/e1_config.c
index 803772b..f1962c7 100644
--- a/openbsc/src/libbsc/e1_config.c
+++ b/openbsc/src/libbsc/e1_config.c
@@ -63,15 +63,10 @@
return -ENOMEM;
}
- switch (ts->pchan) {
- case GSM_PCHAN_TCH_F:
- case GSM_PCHAN_TCH_H:
+ if (ts_is_tch(ts)) {
e1_ts = &line->ts[e1_link->e1_ts-1];
e1inp_ts_config_trau(e1_ts, line, subch_cb);
subch_demux_activate(&e1_ts->trau.demux, e1_link->e1_ts_ss);
- break;
- default:
- break;
}
return 0;