aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libbsc/bsc_vty.c')
-rw-r--r--openbsc/src/libbsc/bsc_vty.c329
1 files changed, 7 insertions, 322 deletions
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index d9b8cebef..bc0f67953 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -50,6 +50,7 @@
#include <openbsc/abis_rsl.h>
#include <openbsc/osmo_msc_data.h>
#include <openbsc/osmo_bsc_rf.h>
+#include <openbsc/handover_decision.h>
#include "../../bscconfig.h"
@@ -299,10 +300,8 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE);
e1isl_dump_vty(vty, bts->oml_link);
}
- vty_out(vty, " Handover: %s%s", bts->handover.ho_active ? "On" : "Off",
- VTY_NEWLINE);
- vty_out(vty, " Assignment: %s%s", bts->handover.as_active ? "On" : "Off",
- VTY_NEWLINE);
+
+ bts_dump_vty_handover(vty, bts);
/* FIXME: chan_desc */
memset(&pl, 0, sizeof(pl));
@@ -713,44 +712,7 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
vty_out(vty, "auto%s", VTY_NEWLINE);
}
- vty_out(vty, " handover enable handover %u%s",
- bts->handover.ho_active, VTY_NEWLINE);
- vty_out(vty, " handover enable assignment %u%s",
- bts->handover.as_active, VTY_NEWLINE);
- vty_out(vty, " handover set %s%s",
- (bts->handover.full) ? "full" : "sub", VTY_NEWLINE);
- vty_out(vty, " handover min rxlev %d%s",
- bts->handover.min_rxlev, VTY_NEWLINE);
- vty_out(vty, " handover window rxlev averaging %u%s",
- bts->handover.win_rxlev_avg, VTY_NEWLINE);
- vty_out(vty, " handover window rxlev neighbor averaging %u%s",
- bts->handover.win_rxlev_avg_neigh, VTY_NEWLINE);
- vty_out(vty, " handover power budget hysteresis %u%s",
- bts->handover.pwr_hysteresis, VTY_NEWLINE);
- vty_out(vty, " handover power budget interval %u%s",
- bts->handover.pwr_interval, VTY_NEWLINE);
- vty_out(vty, " handover afs rxlev improvement %u%s",
- bts->handover.afs_rxlev_improve, VTY_NEWLINE);
- vty_out(vty, " handover min rxqual %u%s",
- bts->handover.min_rxqual, VTY_NEWLINE);
- vty_out(vty, " handover window rxqual averaging %u%s",
- bts->handover.win_rxqual_avg, VTY_NEWLINE);
- vty_out(vty, " handover afs rxqual improvement %u%s",
- bts->handover.afs_rxqual_improve, VTY_NEWLINE);
- vty_out(vty, " handover maximum distance %u%s",
- bts->handover.max_distance, VTY_NEWLINE);
- vty_out(vty, " handover min free tch-f %u%s",
- bts->handover.min_free_tchf, VTY_NEWLINE);
- vty_out(vty, " handover min free tch-h %u%s",
- bts->handover.min_free_tchh, VTY_NEWLINE);
- vty_out(vty, " handover max unsync handovers %u%s",
- bts->handover.max_unsync_ho, VTY_NEWLINE);
- vty_out(vty, " handover penalty max distance %u%s",
- bts->handover.penalty_max_dist, VTY_NEWLINE);
- vty_out(vty, " handover penalty handover failure %u%s",
- bts->handover.penalty_ho_fail, VTY_NEWLINE);
- vty_out(vty, " handover penalty assignment failure %u%s",
- bts->handover.penalty_as_fail, VTY_NEWLINE);
+ config_write_bts_handover(vty, bts);
config_write_bts_gprs(vty, bts);
@@ -808,8 +770,7 @@ static int config_write_net(struct vty *vty)
vty_out(vty, " dtx-used %u%s", gsmnet->dtx_enabled, VTY_NEWLINE);
vty_out(vty, " subscriber-keep-in-ram %d%s",
gsmnet->keep_subscr, VTY_NEWLINE);
- vty_out(vty, " handover congestion-check-timer %u%s",
- gsmnet->ho_congest_timeout, VTY_NEWLINE);
+ config_write_net_handover(vty);
return CMD_SUCCESS;
}
@@ -1491,18 +1452,6 @@ DEFUN(cfg_net_subscr_keep,
return CMD_SUCCESS;
}
-DEFUN(cfg_net_ho_congest_timer,
- cfg_net_ho_congest_timer_cmd,
- "handover congestion-check-timer <0-60>",
- "Global handover settings.\n"
- "Handover congestion check timer\n"
- "Time in seconds for congestion check interval (0 to disable)\n")
-{
- struct gsm_network *gsmnet = gsmnet_from_vty(vty);
- gsmnet->ho_congest_timeout = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
/* per-BTS configuration */
DEFUN(cfg_bts,
cfg_bts_cmd,
@@ -3221,252 +3170,6 @@ DEFUN(cfg_bts_amr_hr_hyst3, cfg_bts_amr_hr_hyst3_cmd,
return CMD_SUCCESS;
}
-#define HANDOVER_STR "Handover Options\n"
-#define HO_ENABLE_STR HANDOVER_STR "Enable or disable handover/assignment\n"
-
-DEFUN(cfg_bts_ho_handover, cfg_bts_ho_handover_cmd,
- "handover enable handover (0|1)",
- HO_ENABLE_STR
- "Enable or disable handover\n"
- "Don't perform in-call handover\n"
- "Perform in-call handover\n")
-{
- int enable = atoi(argv[0]);
- struct gsm_bts *bts = vty->index;
-
- if (enable && ipacc_rtp_direct) {
- vty_out(vty, "%% Cannot enable handover unless RTP Proxy mode "
- "is enabled by using the -P command line option%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- bts->handover.ho_active = enable;
-
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_assignment, cfg_bts_ho_assignment_cmd,
- "handover enable assignment (0|1)",
- HO_ENABLE_STR
- "Enable or disable assignment\n"
- "Don't perform in-call assignment\n"
- "Perform in-call assignment\n")
-{
- int enable = atoi(argv[0]);
- struct gsm_bts *bts = vty->index;
-
- if (enable && ipacc_rtp_direct) {
- vty_out(vty, "%% Cannot enable assignment unless RTP Proxy mode "
- "is enabled by using the -P command line option%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- bts->handover.as_active = enable;
-
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_set, cfg_bts_ho_set_cmd,
- "handover set (full|sub)",
- HANDOVER_STR
- "Define measuement set of TDMA frames\n"
- "Full set of 102/104 TDMA frames\n"
- "Sub set of 4 TDMA frames (SACCH)")
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.full = (argv[0][0]=='f');
- return CMD_SUCCESS;
-}
-
-#define HO_MIN_STR HANDOVER_STR "Minimum Values\n"
-#define HO_MAX_STR HANDOVER_STR "Maximum Values\n"
-#define HO_MIN_FREE_STR HO_MIN_STR "Minimum free Slots\n"
-#define HO_WIN_STR HANDOVER_STR "Measurement Window\n"
-#define HO_WIN_RXLEV_STR HO_WIN_STR "Received Level Averaging\n"
-#define HO_WIN_RXQUAL_STR HO_WIN_STR "Received Quality Averaging\n"
-#define HO_PBUDGET_STR HANDOVER_STR "Power Budget\n"
-#define HO_AFS_STR HANDOVER_STR "AMR on TCH/F\n"
-#define HO_PENALTY_STR HANDOVER_STR "Penalty Time\n"
-#define HO_AVG_COUNT_STR "Amount to use for Averaging\n"
-
-DEFUN(cfg_bts_ho_min_rxlev, cfg_bts_ho_min_rxlev_cmd,
- "handover min rxlev <-110-50>",
- HO_MIN_STR
- "The minimum RxLev allowed in this cell\n"
- "Minimum RxLev in dBm")
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.min_rxlev = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_win_rxlev_avg, cfg_bts_ho_win_rxlev_avg_cmd,
- "handover window rxlev averaging <1-10>",
- HO_WIN_RXLEV_STR
- "How many RxLev measurements are used for averaging\n"
- HO_AVG_COUNT_STR)
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.win_rxlev_avg = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_win_rxlev_neigh_avg, cfg_bts_ho_win_rxlev_avg_neigh_cmd,
- "handover window rxlev neighbor averaging <1-10>",
- HO_WIN_RXLEV_STR "Neighbor\n"
- "How many RxQual measurements are used for averaging\n"
- HO_AVG_COUNT_STR)
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.win_rxlev_avg_neigh = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_pwr_hysteresis, cfg_bts_ho_pwr_hysteresis_cmd,
- "handover power budget hysteresis <0-999>",
- HO_PBUDGET_STR
- "How many dB does a neighbor to be stronger to become a HO candidate\n"
- "Hysteresis\n" "Number\n")
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.pwr_hysteresis = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_pwr_interval, cfg_bts_ho_pwr_interval_cmd,
- "handover power budget interval <1-99>",
- HO_PBUDGET_STR
- "How often to check if we have a better cell (SACCH frames)\n"
- "Interval\n" "Number\n")
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.pwr_interval = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_afs_rxlev_improve, cfg_bts_ho_afs_rxlev_improve_cmd,
- "handover afs rxlev improvement <0-20>",
- HO_AFS_STR
- "RxLev\n"
- "Improvement of RxLev over other codecs\n"
- "RxLev in dB")
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.afs_rxlev_improve = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_min_rxqual, cfg_bts_ho_min_rxqual_cmd,
- "handover min rxqual <0-7>",
- HO_MIN_STR
- "The minimum RxQual allowed in this cell\n"
- "Minimum RxQual in dBm")
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.min_rxqual = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_win_rxqual_avg, cfg_bts_ho_win_rxqual_avg_cmd,
- "handover window rxqual averaging <1-10>",
- HO_WIN_RXQUAL_STR
- "How many RxQual measurements are used for averaging\n"
- HO_AVG_COUNT_STR)
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.win_rxqual_avg = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_afs_rxqual_improve, cfg_bts_ho_afs_rxqual_improve_cmd,
- "handover afs rxqual improvement <0-7>",
- HO_AFS_STR
- "RxQual\n"
- "Improvement of RxQual over other codecs\n"
- "RxQual in dB")
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.afs_rxqual_improve = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_max_distance, cfg_bts_ho_max_distance_cmd,
- "handover maximum distance <0-9999>",
- HANDOVER_STR
- "How big is the maximum timing advance before HO is forced\n"
- "Distance\n" "Number\n")
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.max_distance = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_min_free_tchf, cfg_bts_ho_min_free_tchf_cmd,
- "handover min free tch-f <0-9999>",
- HO_MIN_FREE_STR
- "Minimum free TCH/F timeslots before cell is congeted\n"
- "Slots\n")
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.min_free_tchf = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_min_free_tchh, cfg_bts_ho_min_free_tchh_cmd,
- "handover min free tch-h <0-9999>",
- HO_MIN_FREE_STR
- "Minimum free TCH/H timeslots before cell is congeted\n"
- "Slots\n")
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.min_free_tchh = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_max_unsync_ho, cfg_bts_ho_max_unsync_ho_cmd,
- "handover max unsync handovers <0-9999>",
- HO_MAX_STR
- "Maximum unsynchronous handovers\n"
- "Handovers\nNumber\n")
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.max_unsync_ho = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_penalty_max_dist, cfg_bts_ho_penalty_max_dist_cmd,
- "handover penalty max distance <0-99999>",
- HO_PENALTY_STR
- "After leaving this cell due to exceeding the maximum allowed distance\n"
- "Distance\nTime in Seconds\n")
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.penalty_max_dist = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_penalty_ho_fail, cfg_bts_ho_penalty_ho_fail_cmd,
- "handover penalty handover failure <0-99999>",
- HO_PENALTY_STR
- "After handover failure to this cell\n"
- "Failure\nTime in Seconds\n")
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.penalty_ho_fail = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_bts_ho_penalty_as_fail, cfg_bts_ho_penalty_as_fail_cmd,
- "handover penalty assignment failure <0-99999>",
- HO_PENALTY_STR
- "After assignment failure in this cell\n"
- "Failure\nTime in Seconds\n")
-{
- struct gsm_bts *bts = vty->index;
- bts->handover.penalty_as_fail = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
#define TRX_TEXT "Radio Transceiver\n"
/* per TRX configuration */
@@ -3994,7 +3697,6 @@ int bsc_vty_init(const struct log_info *cat)
install_element(GSMNET_NODE, &cfg_net_T3141_cmd);
install_element(GSMNET_NODE, &cfg_net_dtx_cmd);
install_element(GSMNET_NODE, &cfg_net_subscr_keep_cmd);
- install_element(GSMNET_NODE, &cfg_net_ho_congest_timer_cmd);
install_element(GSMNET_NODE, &cfg_net_pag_any_tch_cmd);
install_element(GSMNET_NODE, &cfg_bts_cmd);
@@ -4086,25 +3788,6 @@ int bsc_vty_init(const struct log_info *cat)
install_element(BTS_NODE, &cfg_bts_amr_hr_hyst2_cmd);
install_element(BTS_NODE, &cfg_bts_amr_hr_hyst3_cmd);
install_element(BTS_NODE, &cfg_bts_amr_hr_start_mode_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_handover_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_assignment_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_set_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_min_rxlev_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_win_rxlev_avg_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_win_rxlev_avg_neigh_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_pwr_hysteresis_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_pwr_interval_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_afs_rxlev_improve_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_min_rxqual_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_win_rxqual_avg_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_afs_rxqual_improve_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_max_distance_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_min_free_tchf_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_min_free_tchh_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_max_unsync_ho_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_penalty_max_dist_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_penalty_ho_fail_cmd);
- install_element(BTS_NODE, &cfg_bts_ho_penalty_as_fail_cmd);
install_element(BTS_NODE, &cfg_trx_cmd);
install_node(&trx_node, dummy_config_write);
@@ -4144,5 +3827,7 @@ int bsc_vty_init(const struct log_info *cat)
bsc_vty_init_extra();
+ bsc_vty_init_handover();
+
return 0;
}