From 15400251813f0750bef8a94daba9f672d52c8f91 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 24 May 2019 11:56:23 +0200 Subject: Allow VTY to set the CCCH Load Indication Threshold Add a new VTY command "ccch load-indication-threshold <0-100>" by which the user can configure the threshold after which the BTS shall send CCCH LOAD IND. It used to be hard-coded to a default value of 10. Change-Id: I059fe4627438e26a06e00d84e342b736ab7af440 --- include/osmocom/bsc/gsm_data.h | 3 +++ src/osmo-bsc/bsc_vty.c | 18 ++++++++++++++++++ src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c | 2 +- src/osmo-bsc/gsm_data.c | 1 + 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 82bd23846..a4640015e 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1115,6 +1115,9 @@ struct gsm_bts { bool ctrl_ack_type_use_block; } gprs; + /* threshold (in percent) when BTS shall send CCCH LOAD IND */ + int ccch_load_ind_thresh; + /* RACH NM values */ int rach_b_thresh; int rach_ldavg_slots; diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index af25cabc9..111c9107e 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -848,6 +848,9 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) vty_out(vty, " channel-descrption bs-ag-blks-res %u%s", bts->si_common.chan_desc.bs_ag_blks_res, VTY_NEWLINE); + if (bts->ccch_load_ind_thresh != 10) + vty_out(vty, " ccch load-indication-threshold %u%s", + bts->ccch_load_ind_thresh, VTY_NEWLINE); if (bts->rach_b_thresh != -1) vty_out(vty, " rach nm busy threshold %u%s", bts->rach_b_thresh, VTY_NEWLINE); @@ -2434,6 +2437,20 @@ DEFUN(cfg_bts_chan_desc_bs_ag_blks_res, return CMD_SUCCESS; } +#define CCCH_STR "Common Control Channel\n" + +DEFUN(cfg_bts_ccch_load_ind_thresh, + cfg_bts_ccch_load_ind_thresh_cmd, + "ccch load-indication-threshold <0-100>", + CCCH_STR + "Percentage of CCCH load at which BTS sends RSL CCCH LOAD IND\n" + "CCCH Load Threshold in percent (Default: 10)") +{ + struct gsm_bts *bts = vty->index; + bts->ccch_load_ind_thresh = atoi(argv[0]); + return CMD_SUCCESS; +} + #define NM_STR "Network Management\n" DEFUN(cfg_bts_rach_nm_b_thresh, @@ -5233,6 +5250,7 @@ int bsc_vty_init(struct gsm_network *network) install_element(BTS_NODE, &cfg_bts_chan_desc_att_cmd); install_element(BTS_NODE, &cfg_bts_chan_desc_bs_pa_mfrms_cmd); install_element(BTS_NODE, &cfg_bts_chan_desc_bs_ag_blks_res_cmd); + install_element(BTS_NODE, &cfg_bts_ccch_load_ind_thresh_cmd); install_element(BTS_NODE, &cfg_bts_rach_nm_b_thresh_cmd); install_element(BTS_NODE, &cfg_bts_rach_nm_ldavg_cmd); install_element(BTS_NODE, &cfg_bts_cell_barred_cmd); diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c index 8a370dafc..be823ae43 100644 --- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c +++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c @@ -60,7 +60,7 @@ struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts) msgb_tv_fixed_put(msgb, NM_ATT_OVERL_PERIOD, 3, buf); /* percent */ - msgb_tv_put(msgb, NM_ATT_CCCH_L_T, 10); + msgb_tv_put(msgb, NM_ATT_CCCH_L_T, bts->ccch_load_ind_thresh); /* seconds */ msgb_tv_put(msgb, NM_ATT_CCCH_L_I_P, 1); diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index 5942fba47..ea338173e 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -827,6 +827,7 @@ struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, uint8_t bts_num) } bts->c0->ts[0].pchan_from_config = GSM_PCHAN_CCCH_SDCCH4; /* TODO: really?? */ + bts->ccch_load_ind_thresh = 10; /* 10% of Load: Start sending CCCH LOAD IND */ bts->rach_b_thresh = -1; bts->rach_ldavg_slots = -1; -- cgit v1.2.3