aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-06-06 01:43:28 +0600
committerfixeria <vyanitskiy@sysmocom.de>2022-06-30 16:36:41 +0000
commitc2928ac269a55d2ea1a6ae7984ba9065f8c41db0 (patch)
tree6b51e4a323ab6083589934f399063dd4e22c088f /include
parentff9d3a64dc8fec465140c244a816db22eea97b6b (diff)
lchan_select: allow different alloc order for assignment and handover
A follow-up patch implements a special channel allocation mode, which is only working for assignment (basically TCH selection for a voice call). This mode cannot be employed for initial CHANNEL REQUEST or handover due to the absence of an already established lchan. Adding this mode to the existing VTY command syntax would be confusing: channel allocator (ascending|desscending|dynamic) ^^^^^^^ so this patch extends the VTY syntax in a way that it becomes possible to configure different channel allocator modes for different cases: OsmoBSC(config-net-bts)# channel allocator mode ? set-all Set a single mode for all variants chan-req Channel allocation for CHANNEL REQUEST (RACH) assignment Channel allocation for assignment handover Channel allocation for handover The old command syntax, which is basically 'set-all', is kept for backwards compatibility, but marked as deprecated. Change-Id: I3ae73b36ee9433cc768376b56f0765e5f416162f Related: SYS#5460
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/bsc/bts.h4
-rw-r--r--include/osmocom/bsc/lchan_select.h21
2 files changed, 21 insertions, 4 deletions
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index 8abcf1323..76945a136 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -517,7 +517,9 @@ struct gsm_bts {
/* should the channel allocator allocate channels from high TRX to TRX0,
* rather than starting from TRX0 and go upwards? */
- int chan_alloc_reverse;
+ bool chan_alloc_chan_req_reverse;
+ bool chan_alloc_assignment_reverse;
+ bool chan_alloc_handover_reverse;
/* When true, interference measurements from the BTS are used in the channel allocator to favor lchans with less
* interference reported in RSL Resource Indication. */
diff --git a/include/osmocom/bsc/lchan_select.h b/include/osmocom/bsc/lchan_select.h
index 3bb0d1ce6..b5eb078db 100644
--- a/include/osmocom/bsc/lchan_select.h
+++ b/include/osmocom/bsc/lchan_select.h
@@ -1,9 +1,24 @@
/* 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);
+enum lchan_select_reason {
+ SELECT_FOR_MS_CHAN_REQ,
+ SELECT_FOR_ASSIGNMENT,
+ SELECT_FOR_HANDOVER,
+};
+
+extern const struct value_string lchan_select_reason_names[];
+static inline const char *lchan_select_reason_name(enum lchan_select_reason reason)
+{ return get_value_string(lchan_select_reason_names, reason); }
+
+struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts,
+ enum gsm_chan_t type,
+ enum lchan_select_reason reason);
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);
+ enum gsm48_chan_mode chan_mode,
+ enum channel_rate chan_rate,
+ enum lchan_select_reason reason);
+struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type,
+ enum lchan_select_reason reason, bool log);
void lchan_select_set_type(struct gsm_lchan *lchan, enum gsm_chan_t type);