From 2436f40b4cf5b875700ab0e62bff5f7eb6a7ddc0 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Thu, 4 May 2023 16:23:32 +0200 Subject: [PATCH] ASCI: Add selection reason for VGCS/VBS channels "enum lchan_select_reason" gets a new selection reason: "SELECT_FOR_VGCS" The selection "direction" can also be changed via VTY. Change-Id: I6b96d0a1df68efa5858b98297ebe0944b1473aaf Related: OS#4852 --- include/osmocom/bsc/bts.h | 1 + include/osmocom/bsc/lchan_select.h | 1 + src/osmo-bsc/bts_vty.c | 9 ++++++++- src/osmo-bsc/lchan_select.c | 4 ++++ tests/osmo-bsc.vty | 5 +++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h index a2b84c6b6..3f7958c57 100644 --- a/include/osmocom/bsc/bts.h +++ b/include/osmocom/bsc/bts.h @@ -523,6 +523,7 @@ struct gsm_bts { bool chan_alloc_chan_req_reverse; bool chan_alloc_assignment_reverse; bool chan_alloc_handover_reverse; + bool chan_alloc_vgcs_reverse; /* Whether to use dynamic allocation mode for assignment */ bool chan_alloc_assignment_dynamic; diff --git a/include/osmocom/bsc/lchan_select.h b/include/osmocom/bsc/lchan_select.h index 8f1dc628a..d6a1b2026 100644 --- a/include/osmocom/bsc/lchan_select.h +++ b/include/osmocom/bsc/lchan_select.h @@ -5,6 +5,7 @@ enum lchan_select_reason { SELECT_FOR_MS_CHAN_REQ, SELECT_FOR_ASSIGNMENT, SELECT_FOR_HANDOVER, + SELECT_FOR_VGCS, }; extern const struct value_string lchan_select_reason_names[]; diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index 511065914..9f5ca5bb4 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -549,6 +549,7 @@ DEFUN_ATTR(cfg_bts_challoc_mode_all, bts->chan_alloc_chan_req_reverse = reverse; bts->chan_alloc_assignment_reverse = reverse; bts->chan_alloc_handover_reverse = reverse; + bts->chan_alloc_vgcs_reverse = reverse; bts->chan_alloc_assignment_dynamic = false; return CMD_SUCCESS; @@ -557,7 +558,7 @@ DEFUN_ATTR(cfg_bts_challoc_mode_all, DEFUN_ATTR(cfg_bts_challoc_mode, cfg_bts_challoc_mode_cmd, CHAN_ALLOC_CMD - " mode (set-all|chan-req|assignment|handover) " + " mode (set-all|chan-req|assignment|handover|vgcs-vbs) " CHAN_ALLOC_ASC_DSC, CHAN_ALLOC_DESC "Channel allocation mode\n" @@ -565,6 +566,7 @@ DEFUN_ATTR(cfg_bts_challoc_mode, "Channel allocation for CHANNEL REQUEST (RACH)\n" "Channel allocation for assignment\n" "Channel allocation for handover\n" + "Channel allocation for VGCS/VBS\n" CHAN_ALLOC_ASC_DSC_DESC, CMD_ATTR_IMMEDIATE) { @@ -580,6 +582,8 @@ DEFUN_ATTR(cfg_bts_challoc_mode, } if (set_all || !strcmp(argv[0], "handover")) bts->chan_alloc_handover_reverse = reverse; + if (set_all || !strcmp(argv[0], "vgcs-vbs")) + bts->chan_alloc_vgcs_reverse = reverse; return CMD_SUCCESS; } @@ -4424,6 +4428,9 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) vty_out(vty, " channel allocator mode handover %s%s", bts->chan_alloc_handover_reverse ? "descending" : "ascending", VTY_NEWLINE); + vty_out(vty, " channel allocator mode vgcs-vbs %s%s", + bts->chan_alloc_vgcs_reverse ? "descending" : "ascending", + VTY_NEWLINE); if (bts->chan_alloc_avoid_interf) vty_out(vty, " channel allocator avoid-interference 1%s", VTY_NEWLINE); if (bts->chan_alloc_tch_signalling_policy == BTS_TCH_SIGNALLING_NEVER) diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c index ad5c98400..c830bd1ee 100644 --- a/src/osmo-bsc/lchan_select.c +++ b/src/osmo-bsc/lchan_select.c @@ -41,6 +41,7 @@ const struct value_string lchan_select_reason_names[] = { OSMO_VALUE_STRING(SELECT_FOR_MS_CHAN_REQ), OSMO_VALUE_STRING(SELECT_FOR_ASSIGNMENT), OSMO_VALUE_STRING(SELECT_FOR_HANDOVER), + OSMO_VALUE_STRING(SELECT_FOR_VGCS), {0, NULL} }; @@ -349,6 +350,9 @@ struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, case SELECT_FOR_HANDOVER: chan_alloc_reverse = bts->chan_alloc_handover_reverse; break; + case SELECT_FOR_VGCS: + chan_alloc_reverse = bts->chan_alloc_vgcs_reverse; + break; } /* Allocate an array with pointers to all timeslots of a BTS */ diff --git a/tests/osmo-bsc.vty b/tests/osmo-bsc.vty index 776b5ada6..690b9f36d 100644 --- a/tests/osmo-bsc.vty +++ b/tests/osmo-bsc.vty @@ -177,6 +177,7 @@ OsmoBSC(config-net-bts)# channel allocator mode ? chan-req Channel allocation for CHANNEL REQUEST (RACH) assignment Channel allocation for assignment handover Channel allocation for handover + vgcs-vbs Channel allocation for VGCS/VBS OsmoBSC(config-net-bts)# channel allocator mode set-all ? ascending Allocate Timeslots and Transceivers in ascending order @@ -191,6 +192,10 @@ OsmoBSC(config-net-bts)# channel allocator mode assignment ? descending Allocate Timeslots and Transceivers in descending order dynamic Dynamic lchan selection based on configured parameters +OsmoBSC(config-net-bts)# channel allocator mode vgcs-vbs ? + ascending Allocate Timeslots and Transceivers in ascending order + descending Allocate Timeslots and Transceivers in descending order + OsmoBSC(config-net-bts)# channel allocator dynamic-param ? sort-by-trx-power Whether to sort TRX instances by their respective power levels ul-rxlev Uplink RxLev