Revert "bts: extend bts_chan_load to allow counting tch only"
This reverts commit 308cb0719dca3ba8eed1eff2a2124d44f34d9a28.
Problems in this commit:
openbsc/src/libbsc/chan_alloc.c:523: case GSM_PCHAN_TCH_F_PDCH:
This is actually wrong, GSM_PCHAN_TCH_F_PDCH use ts->flags, not ts->dyn below
(due to historical reasons and could be unified).
560: if (only_count_tch && !chan_is_tch(ts))
This has exactly one effect: it excludes GSM_PCHAN_TCH_F_PDCH when in PDCH
mode, because for all other PDCH (plain PDCH and TCH/F_TCH/H_PDCH in PDCH mode)
below ts_subslots() returns 0 and skips the for() loop. I consider this a bug
in TCH/F_PDCH, to be fixed in an upcoming commit.
I don't see why we need the only_count_tch argument, because this should
normally only count TCH, weren't it for the TCH/F_PDCH bug.
If dyn TS should be counted differently, we should do this in a different way.
Change-Id: I34dbbaf53a800115e3d03bd44028cad675f3b525
diff --git a/openbsc/src/libbsc/bsc_ctrl_commands.c b/openbsc/src/libbsc/bsc_ctrl_commands.c
index 3f4fee2..7e84797 100644
--- a/openbsc/src/libbsc/bsc_ctrl_commands.c
+++ b/openbsc/src/libbsc/bsc_ctrl_commands.c
@@ -239,7 +239,7 @@
bts = cmd->node;
memset(&pl, 0, sizeof(pl));
- bts_chan_load(&pl, bts, 0);
+ bts_chan_load(&pl, bts);
cmd->reply = talloc_strdup(cmd, "");
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index cdcc011..cb0b1d8 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -329,7 +329,7 @@
/* FIXME: chan_desc */
memset(&pl, 0, sizeof(pl));
- bts_chan_load(&pl, bts, 0);
+ bts_chan_load(&pl, bts);
vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE);
dump_pchan_load_vty(vty, " ", &pl);
}
diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c
index 03d44e0..7b0c3e6 100644
--- a/openbsc/src/libbsc/chan_alloc.c
+++ b/openbsc/src/libbsc/chan_alloc.c
@@ -514,28 +514,7 @@
return NULL;
}
-static int chan_is_tch(struct gsm_bts_trx_ts *ts)
-{
- switch (ts->pchan) {
- case GSM_PCHAN_TCH_F:
- case GSM_PCHAN_TCH_H:
- return 1;
- case GSM_PCHAN_TCH_F_PDCH:
- case GSM_PCHAN_TCH_F_TCH_H_PDCH:
- if (ts->dyn.pchan_is == GSM_PCHAN_TCH_F ||
- ts->dyn.pchan_is == GSM_PCHAN_TCH_H)
- return 1;
- else
- return 0;
- default:
- return 0;
- }
-}
-
-
-
-void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts,
- int only_count_tch)
+void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts)
{
struct gsm_bts_trx *trx;
@@ -557,9 +536,6 @@
if (!nm_is_running(&ts->mo.nm_state))
continue;
- if (only_count_tch && !chan_is_tch(ts))
- continue;
-
subslots = ts_subslots(ts);
for (j = 0; j < subslots; j++) {
struct gsm_lchan *lchan = &ts->lchan[j];
@@ -585,5 +561,6 @@
memset(pl, 0, sizeof(*pl));
llist_for_each_entry(bts, &net->bts_list, list)
- bts_chan_load(pl, bts, 0);
+ bts_chan_load(pl, bts);
}
+
diff --git a/openbsc/src/libbsc/paging.c b/openbsc/src/libbsc/paging.c
index e3795b3..fcb4deb 100644
--- a/openbsc/src/libbsc/paging.c
+++ b/openbsc/src/libbsc/paging.c
@@ -119,7 +119,7 @@
int count;
memset(&pl, 0, sizeof(pl));
- bts_chan_load(&pl, bts, 0);
+ bts_chan_load(&pl, bts);
switch (rsl_type) {
case RSL_CHANNEED_TCH_F: