aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-25 23:08:39 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-25 23:08:39 +0800
commit95c229006ef9e0a55139a3e80f6212189e4f4408 (patch)
tree56600871c8e2717e4c8c5dd241448bdb918eb793
parentd941edaca2f16791e8b830ad62f6d2372254d205 (diff)
[vty] Allow to set the RACH NM attributes on a per BTS basis
Be able to tune the RACH settings of the BTS via the vty interface, by default they are initialized to -1 which means we will use the content of the static array (BTS default) and can be changed via the VTY interface. I have verified the setting on the nanoBTS with wireshark and I have tested writing the config file.
-rw-r--r--openbsc/include/openbsc/gsm_data.h4
-rw-r--r--openbsc/src/bsc_init.c16
-rw-r--r--openbsc/src/gsm_data.c2
-rw-r--r--openbsc/src/vty_interface.c29
4 files changed, 51 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 52b82c062..34d1118ac 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -494,6 +494,10 @@ struct gsm_bts {
struct gsm_bts_gprs_nsvc nsvc[2];
u_int8_t rac;
} gprs;
+
+ /* RACH NM values */
+ int rach_b_thresh;
+ int rach_ldavg_slots;
/* transceivers */
int num_trx;
diff --git a/openbsc/src/bsc_init.c b/openbsc/src/bsc_init.c
index a39bc198a..bdbff7b85 100644
--- a/openbsc/src/bsc_init.c
+++ b/openbsc/src/bsc_init.c
@@ -853,6 +853,22 @@ static void patch_nm_tables(struct gsm_bts *bts)
bs11_attr_radio[2] |= arfcn_high;
bs11_attr_radio[3] = arfcn_low;
+ /* patch the RACH attributes */
+ if (bts->rach_b_thresh != -1) {
+ nanobts_attr_bts[33] = bts->rach_b_thresh & 0xff;
+ bs11_attr_bts[33] = bts->rach_b_thresh & 0xff;
+ }
+
+ if (bts->rach_ldavg_slots != -1) {
+ u_int8_t avg_high = bts->rach_ldavg_slots & 0xff;
+ u_int8_t avg_low = (bts->rach_ldavg_slots >> 8) & 0x0f;
+
+ nanobts_attr_bts[35] = avg_high;
+ nanobts_attr_bts[36] = avg_low;
+ bs11_attr_bts[35] = avg_high;
+ bs11_attr_bts[36] = avg_low;
+ }
+
/* patch BSIC */
bs11_attr_bts[1] = bts->bsic;
nanobts_attr_bts[sizeof(nanobts_attr_bts)-11] = bts->bsic;
diff --git a/openbsc/src/gsm_data.c b/openbsc/src/gsm_data.c
index 4d8fa1747..9cb5647cb 100644
--- a/openbsc/src/gsm_data.c
+++ b/openbsc/src/gsm_data.c
@@ -221,6 +221,8 @@ struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type,
}
bts->c0->ts[0].pchan = GSM_PCHAN_CCCH_SDCCH4;
+ bts->rach_b_thresh = -1;
+ bts->rach_ldavg_slots = -1;
llist_add_tail(&bts->list, &net->bts_list);
return bts;
diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c
index dd35372ca..851a6039d 100644
--- a/openbsc/src/vty_interface.c
+++ b/openbsc/src/vty_interface.c
@@ -308,6 +308,13 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
vty_out(vty, " rach max transmission %u%s",
rach_max_trans_raw2val(bts->si_common.rach_control.max_trans),
VTY_NEWLINE);
+
+ if (bts->rach_b_thresh != -1)
+ vty_out(vty, " rach nm busy threshold %u%s",
+ bts->rach_b_thresh, VTY_NEWLINE);
+ if (bts->rach_ldavg_slots != -1)
+ vty_out(vty, " rach nm load average %u%s",
+ bts->rach_ldavg_slots, VTY_NEWLINE);
if (bts->si_common.rach_control.cell_bar)
vty_out(vty, " cell barred 1%s", VTY_NEWLINE);
if (is_ipaccess_bts(bts)) {
@@ -1337,6 +1344,26 @@ DEFUN(cfg_bts_rach_max_trans,
return CMD_SUCCESS;
}
+DEFUN(cfg_bts_rach_nm_b_thresh,
+ cfg_bts_rach_nm_b_thresh_cmd,
+ "rach nm busy threshold <0-255>",
+ "Set the NM Busy Threshold in DB")
+{
+ struct gsm_bts *bts = vty->index;
+ bts->rach_b_thresh = atoi(argv[0]);
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_rach_nm_ldavg,
+ cfg_bts_rach_nm_ldavg_cmd,
+ "rach nm load average <0-65535>",
+ "Set the NM Loadaver Slots value")
+{
+ struct gsm_bts *bts = vty->index;
+ bts->rach_ldavg_slots = atoi(argv[0]);
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_bts_cell_barred, cfg_bts_cell_barred_cmd,
"cell barred (0|1)",
"Should this cell be barred from access?")
@@ -1771,6 +1798,8 @@ int bsc_vty_init(struct gsm_network *net)
install_element(BTS_NODE, &cfg_bts_challoc_cmd);
install_element(BTS_NODE, &cfg_bts_rach_tx_integer_cmd);
install_element(BTS_NODE, &cfg_bts_rach_max_trans_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);
install_element(BTS_NODE, &cfg_bts_ms_max_power_cmd);
install_element(BTS_NODE, &cfg_bts_per_loc_upd_cmd);