Change in osmo-bsc[master]: WIP: avoid switching dyn ts to sdcch8 if it starves later TCH

pespin gerrit-no-reply at lists.osmocom.org
Wed Jul 7 17:15:27 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24876 )


Change subject: WIP: avoid switching dyn ts to sdcch8 if it starves later TCH
......................................................................

WIP: avoid switching dyn ts to sdcch8 if it starves later TCH

Add a 2nd step lchan target, which provides information on channel type
required after the 1st one is used. This is used to avoid selecting a
dynamic timeslot to be switched to SDCCH8 when doing so would end up
with the BTS having no free TCH channels to be used later on when the
call is negotiated in SDCCH8. In that case, we avoid the PDCH->SDCCH8
dyn TS switch and instead let upper layers look for a TCH as a next
step. This way we ensure that the call is possible.

Related: SYS#5309
Change-Id: I3b32968949a7bdcbebf5a823359295bac51d8e08
---
M include/osmocom/bsc/lchan_select.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/assignment_fsm.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/handover_decision_2.c
M src/osmo-bsc/handover_fsm.c
M src/osmo-bsc/lchan_select.c
M tests/handover/handover_test.c
8 files changed, 159 insertions(+), 57 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/76/24876/1

diff --git a/include/osmocom/bsc/lchan_select.h b/include/osmocom/bsc/lchan_select.h
index aa2f40e..11ee34b 100644
--- a/include/osmocom/bsc/lchan_select.h
+++ b/include/osmocom/bsc/lchan_select.h
@@ -1,8 +1,12 @@
 /* Select a suitable lchan from a given cell. */
 #pragma once
 
-struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, enum gsm_chan_t type);
+struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, enum gsm_chan_t type, enum gsm_chan_t step2_type);
 enum gsm_chan_t chan_mode_to_chan_type(enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate);
 struct gsm_lchan *lchan_select_by_chan_mode(struct gsm_bts *bts,
 					    enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate);
-struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type, bool log);
+struct gsm_lchan *lchan_select_by_chan_mode_list(struct gsm_bts *bts,
+						 const struct channel_mode_and_rate *chan_mode_rate_list,
+						 unsigned int chan_mode_rate_list_len,
+						 struct channel_mode_and_rate *selected_chan_mode_rate);
+struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type, enum gsm_chan_t step2_type, bool log);
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index f0adc56..71e6b7a 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1778,12 +1778,12 @@
 
 	/* First check the situation on the BTS, if we have TCH/H or TCH/F resources available for another (EMERGENCY)
 	 * call. If yes, then no (further) action has to be carried out. */
-	if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_F, true)) {
+	if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_F, GSM_LCHAN_NONE, true)) {
 		LOG_BTS(rqd->bts, DRSL, LOGL_NOTICE,
 			"CHAN RQD/EMERGENCY-PRIORITY: at least one TCH/F is (now) available!\n");
 		return false;
 	}
-	if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_H, true)) {
+	if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_H, GSM_LCHAN_NONE, true)) {
 		LOG_BTS(rqd->bts, DRSL, LOGL_NOTICE,
 			"CHAN RQD/EMERGENCY-PRIORITY: at least one TCH/H is (now) available!\n");
 		return false;
@@ -1881,18 +1881,25 @@
 
 	/* Emergency calls will be put on a free TCH/H or TCH/F directly in the code below, all other channel requests
 	 * will get an SDCCH first (if possible). */
-	if (rqd->reason != GSM_CHREQ_REASON_EMERG)
-		lchan = lchan_select_by_type(bts, GSM_LCHAN_SDCCH);
+	if (rqd->reason != GSM_CHREQ_REASON_EMERG) {
+		if (GSM_CHREQ_REASON_CALL) {
+			lchan = lchan_select_by_type(bts, GSM_LCHAN_SDCCH, GSM_LCHAN_TCH_H);
+			if (!lchan)
+				lchan = lchan_select_by_type(bts, GSM_LCHAN_SDCCH, GSM_LCHAN_TCH_F);
+		} else {
+			lchan = lchan_select_by_type(bts, GSM_LCHAN_SDCCH, GSM_LCHAN_NONE);
+		}
+	}
 
 	if (!lchan) {
 		LOG_BTS(bts, DRSL, LOGL_NOTICE, "CHAN RQD: no resources for %s 0x%x, retrying with %s\n",
 			gsm_lchant_name(GSM_LCHAN_SDCCH), rqd->ref.ra, gsm_lchant_name(GSM_LCHAN_TCH_H));
-		lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_H);
+		lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_H, GSM_LCHAN_NONE);
 	}
 	if (!lchan) {
 		LOG_BTS(bts, DRSL, LOGL_NOTICE, "CHAN RQD: no resources for %s 0x%x, retrying with %s\n",
 			gsm_lchant_name(GSM_LCHAN_SDCCH), rqd->ref.ra, gsm_lchant_name(GSM_LCHAN_TCH_F));
-		lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_F);
+		lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_F, GSM_LCHAN_NONE);
 	}
 	if (!lchan) {
 		LOG_BTS(bts, DRSL, LOGL_NOTICE, "CHAN RQD: no resources for %s 0x%x\n",
diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c
index 2c52d22..8efef52 100644
--- a/src/osmo-bsc/assignment_fsm.c
+++ b/src/osmo-bsc/assignment_fsm.c
@@ -585,19 +585,15 @@
 		}
 	} else {
 		/* Try to allocate a new lchan in order of preference */
-		for (i = 0; i < req->n_ch_mode_rate; i++) {
-			conn->assignment.new_lchan = lchan_select_by_chan_mode(bts,
-			    req->ch_mode_rate_list[i].chan_mode, req->ch_mode_rate_list[i].chan_rate);
-			if (!conn->assignment.new_lchan)
-				continue;
-			LOG_ASSIGNMENT(conn, LOGL_DEBUG, "selected new lchan %s for mode[%d] = %s channel_rate=%d\n",
+		conn->assignment.new_lchan = lchan_select_by_chan_mode_list(bts,
+									    req->ch_mode_rate_list,
+									    req->n_ch_mode_rate,
+									    &conn->assignment.selected_ch_mode_rate);
+		if (conn->assignment.new_lchan)
+			LOG_ASSIGNMENT(conn, LOGL_DEBUG, "selected new lchan %s for mode=%s channel_rate=%d\n",
 				       gsm_lchan_name(conn->assignment.new_lchan),
-				       i, gsm48_chan_mode_name(req->ch_mode_rate_list[i].chan_mode),
-				       req->ch_mode_rate_list[i].chan_rate);
-
-			conn->assignment.selected_ch_mode_rate = req->ch_mode_rate_list[i];
-			break;
-		}
+				       gsm48_chan_mode_name(conn->assignment.selected_ch_mode_rate.chan_mode),
+				       conn->assignment.selected_ch_mode_rate.chan_rate);
 	}
 
 	/* Check whether the lchan allocation was successful or not and tear
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 070b660..0d73fd2 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -1937,7 +1937,7 @@
 {
 	LOG_LCHAN(from_lchan, LOGL_NOTICE, "Manually triggering Assignment from VTY\n");
 	if (!to_lchan) {
-		to_lchan = lchan_select_by_type(from_lchan->ts->trx->bts, from_lchan->type);
+		to_lchan = lchan_select_by_type(from_lchan->ts->trx->bts, from_lchan->type, GSM_LCHAN_NONE);
 		vty_out(vty, "Error: cannot find free lchan of type %s%s",
 			gsm_lchant_name(from_lchan->type), VTY_NEWLINE);
 	}
@@ -2115,7 +2115,7 @@
 			continue;
 
 		llist_for_each_entry(trx, &bts->trx_list, list) {
-			struct gsm_lchan *lchan = lchan_select_by_type(bts, free_type);
+			struct gsm_lchan *lchan = lchan_select_by_type(bts, free_type, GSM_LCHAN_NONE);
 			if (!lchan)
 				continue;
 
diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c
index d778876..7699c81 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -1033,7 +1033,7 @@
 	c->target.min_free_tchh = ho_get_hodec2_tchh_min_slots(c->target.bts->ho);
 
 	/* Would the next TCH/F lchan occupy a dynamic timeslot that currently counts for free TCH/H timeslots? */
-	next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_F, false);
+	next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_F, GSM_LCHAN_NONE, false);
 	if (next_lchan && next_lchan->ts->pchan_on_init == GSM_PCHAN_OSMO_DYN)
 		c->target.next_tchf_reduces_tchh = 2;
 	else
@@ -1041,7 +1041,7 @@
 
 	/* Would the next TCH/H lchan occupy a dynamic timeslot that currently counts for free TCH/F timeslots?
 	 * Note that a dyn TS already in TCH/H mode (half occupied) would not reduce free TCH/F. */
-	next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_H, false);
+	next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_H, GSM_LCHAN_NONE, false);
 	if (next_lchan && next_lchan->ts->pchan_on_init == GSM_PCHAN_OSMO_DYN
 	    && next_lchan->ts->pchan_is != GSM_PCHAN_TCH_H)
 		c->target.next_tchh_reduces_tchf = 1;
diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c
index 5f4b892..1d38fff 100644
--- a/src/osmo-bsc/handover_fsm.c
+++ b/src/osmo-bsc/handover_fsm.c
@@ -375,7 +375,7 @@
 	ho->async = true;
 	gsm_bts_cell_id_list(&ho->target_cell_ids, ho->new_bts);
 
-	ho->new_lchan = lchan_select_by_type(ho->new_bts, ho->new_lchan_type);
+	ho->new_lchan = lchan_select_by_type(ho->new_bts, ho->new_lchan_type, GSM_LCHAN_NONE);
 
 	if (ho->scope & HO_INTRA_CELL) {
 		ho_count(bts, CTR_INTRA_CELL_HO_ATTEMPTED);
diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c
index efa2ff2..d6c5275 100644
--- a/src/osmo-bsc/lchan_select.c
+++ b/src/osmo-bsc/lchan_select.c
@@ -32,7 +32,7 @@
 
 static struct gsm_lchan *
 _lc_find_trx(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan,
-	     enum gsm_phys_chan_config as_pchan, bool allow_pchan_switch, bool log)
+	     enum gsm_phys_chan_config as_pchan, bool allow_pchan_switch, const struct gsm_bts_trx_ts *exclude_ts, bool log)
 {
 	struct gsm_lchan *lchan;
 	struct gsm_bts_trx_ts *ts;
@@ -69,6 +69,10 @@
 		ts = &trx->ts[j];
 		if (!ts_is_usable(ts))
 			continue;
+		if (ts == exclude_ts) {
+			LOGPLCHANALLOC("%s is excluded\n", gsm_ts_and_pchan_name(ts));
+			continue;
+		}
 		/* The caller first selects what kind of TS to search in, e.g. looking for exact
 		 * GSM_PCHAN_TCH_F, or maybe among dynamic GSM_PCHAN_OSMO_DYN... */
 		if (ts->pchan_on_init != pchan) {
@@ -105,8 +109,8 @@
 }
 
 static struct gsm_lchan *
-_lc_dyn_find_bts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan,
-		 enum gsm_phys_chan_config dyn_as_pchan, bool log)
+_lc_dyn_find_bts_excl(struct gsm_bts *bts, enum gsm_phys_chan_config pchan,
+		 enum gsm_phys_chan_config dyn_as_pchan, const struct gsm_bts_trx_ts *exclude_dyn_ts_switch, bool log, bool *ts_switch_required)
 {
 	struct gsm_bts_trx *trx;
 	struct gsm_lchan *lc;
@@ -120,15 +124,18 @@
 	 * true, because they never switch anyway. */
 	try_pchan_switch = (pchan != dyn_as_pchan);
 	for (allow_pchan_switch = 0; allow_pchan_switch <= (try_pchan_switch ? 1 : 0); allow_pchan_switch++) {
+		const struct gsm_bts_trx_ts *excl = allow_pchan_switch ? exclude_dyn_ts_switch : NULL;
+		if (ts_switch_required)
+			*ts_switch_required = allow_pchan_switch;
 		if (bts->chan_alloc_reverse) {
 			llist_for_each_entry_reverse(trx, &bts->trx_list, list) {
-				lc = _lc_find_trx(trx, pchan, dyn_as_pchan, (bool)allow_pchan_switch, log);
+				lc = _lc_find_trx(trx, pchan, dyn_as_pchan, (bool)allow_pchan_switch, excl, log);
 				if (lc)
 					return lc;
 			}
 		} else {
 			llist_for_each_entry(trx, &bts->trx_list, list) {
-				lc = _lc_find_trx(trx, pchan, dyn_as_pchan, (bool)allow_pchan_switch, log);
+				lc = _lc_find_trx(trx, pchan, dyn_as_pchan, (bool)allow_pchan_switch, excl, log);
 				if (lc)
 					return lc;
 			}
@@ -139,9 +146,16 @@
 }
 
 static struct gsm_lchan *
+_lc_dyn_find_bts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan,
+		 enum gsm_phys_chan_config dyn_as_pchan, bool log, bool *ts_switch_required)
+{
+	return _lc_dyn_find_bts_excl(bts, pchan, dyn_as_pchan, NULL, log, ts_switch_required);
+}
+
+static struct gsm_lchan *
 _lc_find_bts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan, bool log)
 {
-	return _lc_dyn_find_bts(bts, pchan, pchan, log);
+	return _lc_dyn_find_bts(bts, pchan, pchan, log, NULL);
 }
 
 enum gsm_chan_t chan_mode_to_chan_type(enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate)
@@ -184,16 +198,92 @@
 	enum gsm_chan_t type = chan_mode_to_chan_type(chan_mode, chan_rate);
 	if (type == GSM_LCHAN_NONE)
 		return NULL;
-	return lchan_select_by_type(bts, type);
+	return lchan_select_by_type(bts, type, GSM_LCHAN_NONE);
 }
 
-struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type, bool log)
+static enum gsm_chan_t _step2_type_get(enum gsm_chan_t type,
+					const struct channel_mode_and_rate *chan_mode_rate_list,
+					unsigned int chan_mode_rate_list_len)
+{
+	int i;
+	enum gsm_chan_t step2_type;
+
+	if (type == GSM_LCHAN_SDCCH) {
+			for (i = 0; i < chan_mode_rate_list_len; i++)
+			step2_type = chan_mode_to_chan_type(chan_mode_rate_list[i].chan_mode,
+								      chan_mode_rate_list[i].chan_rate);
+			if (step2_type == GSM_LCHAN_TCH_H || step2_type == GSM_LCHAN_TCH_F)
+				return step2_type;
+	}
+	return GSM_LCHAN_NONE;
+}
+
+/* Try to allocate a new lchan in order of preference */
+struct gsm_lchan *lchan_select_by_chan_mode_list(struct gsm_bts *bts,
+						 const struct channel_mode_and_rate *chan_mode_rate_list,
+						 unsigned int chan_mode_rate_list_len,
+						 struct channel_mode_and_rate *selected_chan_mode_rate)
+{
+	unsigned int i;
+	struct gsm_lchan *new_lchan;
+	/* Try to allocate a new lchan in order of preference */
+	for (i = 0; i < chan_mode_rate_list_len; i++) {
+		enum gsm_chan_t type = chan_mode_to_chan_type(chan_mode_rate_list[i].chan_mode,
+							      chan_mode_rate_list[i].chan_rate);
+		enum gsm_chan_t step2_type;
+
+		if (type == GSM_LCHAN_NONE)
+			continue;
+		step2_type = _step2_type_get(type, (&chan_mode_rate_list[i]) + 1, chan_mode_rate_list_len - i - 1);
+		new_lchan = lchan_select_by_type(bts, type, step2_type);
+		if (!new_lchan)
+			continue;
+
+		*selected_chan_mode_rate = chan_mode_rate_list[i];
+		break;
+	}
+	return NULL;
+}
+
+static struct gsm_lchan *_lchan_avail_tch_f(struct gsm_bts *bts, const struct gsm_bts_trx_ts *exclude_dyn_ts_switch, bool log)
 {
 	struct gsm_lchan *lchan = NULL;
+	lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F, log);
+	/* If we don't have TCH/F available, try dynamic TCH/F_PDCH */
+	if (!lchan)
+		lchan = _lc_dyn_find_bts_excl(bts, GSM_PCHAN_TCH_F_PDCH,
+					 GSM_PCHAN_TCH_F, exclude_dyn_ts_switch, log, NULL);
+
+	/* Try fully dynamic TCH/F_TCH/H_PDCH as TCH/F... */
+	if (!lchan && bts->network->dyn_ts_allow_tch_f)
+		lchan = _lc_dyn_find_bts_excl(bts,
+					 GSM_PCHAN_OSMO_DYN,
+					 GSM_PCHAN_TCH_F, exclude_dyn_ts_switch, log, NULL);
+	return lchan;
+}
+
+static struct gsm_lchan *_lchan_avail_tch_h(struct gsm_bts *bts, const struct gsm_bts_trx_ts *exclude_dyn_ts_switch, bool log)
+{
+	struct gsm_lchan *lchan = NULL;
+	lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_H, log);
+	/* No dedicated TCH/x available -- try fully dynamic
+	 * TCH/F_TCH/H_PDCH */
+	if (!lchan)
+		lchan = _lc_dyn_find_bts_excl(bts,
+					 GSM_PCHAN_OSMO_DYN,
+					 GSM_PCHAN_TCH_H, exclude_dyn_ts_switch, log, NULL);
+	return lchan;
+}
+
+struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type, enum gsm_chan_t step2_type, bool log)
+{
+	struct gsm_lchan *lchan = NULL;
+	bool ts_switch_required;
 	enum gsm_phys_chan_config first, first_cbch, second, second_cbch;
 
 	if (log)
-		LOG_BTS(bts, DRLL, LOGL_DEBUG, "lchan_avail_by_type(%s)\n", gsm_lchant_name(type));
+		LOG_BTS(bts, DRLL, LOGL_DEBUG, "lchan_avail_by_type(%s, step2=%s)\n",
+			gsm_lchant_name(type), gsm_lchant_name(step2_type));
 
 	switch (type) {
 	case GSM_LCHAN_SDCCH:
@@ -218,32 +308,37 @@
 			lchan = _lc_find_bts(bts, second_cbch, log);
 		/* No dedicated SDCCH available -- try fully dynamic
 		 * TCH/F_TCH/H_SDCCH8_PDCH if BTS supports it: */
-		if (lchan == NULL && osmo_bts_has_feature(&bts->features, BTS_FEAT_DYN_TS_SDCCH8))
+		if (lchan == NULL && osmo_bts_has_feature(&bts->features, BTS_FEAT_DYN_TS_SDCCH8)) {
 			lchan = _lc_dyn_find_bts(bts,
 						 GSM_PCHAN_OSMO_DYN,
-						 GSM_PCHAN_SDCCH8_SACCH8C, log);
+						 GSM_PCHAN_SDCCH8_SACCH8C, log, &ts_switch_required);
+			/* If a DYN TS is switched to SDCCH8 as a first step towards
+			   handling a TCH, let's make sure there's still a TCH available
+			   too. Otherwise, let's rather return NOT FOUND now and let
+			   caller subsequently request a TCH, which will take the DYN TS
+			   and be able to success through the entire call channel
+			   establishment */
+			if (ts_switch_required) {
+				switch (step2_type) {
+				case GSM_LCHAN_TCH_F:
+					if (!_lchan_avail_tch_f(bts, lchan->ts, log))
+						lchan = NULL;
+					break;
+				case GSM_LCHAN_TCH_H:
+					if (!_lchan_avail_tch_h(bts, lchan->ts, log))
+						lchan = NULL;
+					break;
+				default:
+					/* we are fine, go forward */
+				}
+			}
+		}
 		break;
 	case GSM_LCHAN_TCH_F:
-		lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F, log);
-		/* If we don't have TCH/F available, try dynamic TCH/F_PDCH */
-		if (!lchan)
-			lchan = _lc_dyn_find_bts(bts, GSM_PCHAN_TCH_F_PDCH,
-						 GSM_PCHAN_TCH_F, log);
-
-		/* Try fully dynamic TCH/F_TCH/H_PDCH as TCH/F... */
-		if (!lchan && bts->network->dyn_ts_allow_tch_f)
-			lchan = _lc_dyn_find_bts(bts,
-						 GSM_PCHAN_OSMO_DYN,
-						 GSM_PCHAN_TCH_F, log);
+		lchan = _lchan_avail_tch_f(bts, NULL, log);
 		break;
 	case GSM_LCHAN_TCH_H:
-		lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_H, log);
-		/* No dedicated TCH/x available -- try fully dynamic
-		 * TCH/F_TCH/H_PDCH */
-		if (!lchan)
-			lchan = _lc_dyn_find_bts(bts,
-						 GSM_PCHAN_OSMO_DYN,
-						 GSM_PCHAN_TCH_H, log);
+		lchan = _lchan_avail_tch_h(bts, NULL, log);
 		break;
 	default:
 		LOG_BTS(bts, DRLL, LOGL_ERROR, "Unknown gsm_chan_t %u\n", type);
@@ -255,11 +350,11 @@
 /* Return a matching lchan from a specific BTS that is currently available. The next logical step is
  * lchan_activate() on it, which would possibly cause dynamic timeslot pchan switching, taken care of by
  * the lchan and timeslot FSMs. */
-struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, enum gsm_chan_t type)
+struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, enum gsm_chan_t type, enum gsm_chan_t step2_type)
 {
 	struct gsm_lchan *lchan = NULL;
 
-	lchan = lchan_avail_by_type(bts, type, true);
+	lchan = lchan_avail_by_type(bts, type, step2_type, true);
 
 	LOG_BTS(bts, DRLL, LOGL_DEBUG, "lchan_select_by_type(%s)\n", gsm_lchant_name(type));
 
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 2ff9f31..15245eb 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -434,7 +434,7 @@
 {
 	struct gsm_lchan *lchan;
 
-	lchan = lchan_select_by_type(bts, (full_rate) ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H);
+	lchan = lchan_select_by_type(bts, (full_rate) ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H, GSM_LCHAN_NONE);
 	if (!lchan) {
 		fprintf(stderr, "No resource for lchan\n");
 		exit(EXIT_FAILURE);

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3b32968949a7bdcbebf5a823359295bac51d8e08
Gerrit-Change-Number: 24876
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210707/3d1f8462/attachment.htm>


More information about the gerrit-log mailing list