aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2012-10-13 07:27:47 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-02-18 15:34:30 +0100
commitc0e64110fae40c18852f69f56703cad9428ef74c (patch)
treea31027ed3e4529e2a3e6c7e7a49360f01446885d
parent762907bfe90c20e8615d101e4141cf7f65c90180 (diff)
Allow setting of Control Channel Description parameters via VTY
-rw-r--r--openbsc/src/libbsc/bsc_init.c8
-rw-r--r--openbsc/src/libbsc/bsc_vty.c59
-rw-r--r--openbsc/src/libcommon/gsm_data.c3
3 files changed, 66 insertions, 4 deletions
diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index 189b6e9cb..f70864903 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -391,10 +391,7 @@ static int bootstrap_bts(struct gsm_bts *bts)
"GSM networks and should only be used in a RF "
"shielded environment such as a faraday cage!\n\n");
- /* Control Channel Description */
- bts->si_common.chan_desc.att = 1;
- bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5;
- bts->si_common.chan_desc.bs_ag_blks_res = 1;
+ /* Control Channel Description is set from vty/config */
/* T3212 is set from vty/config */
@@ -405,6 +402,9 @@ static int bootstrap_bts(struct gsm_bts *bts)
switch (n) {
case 0:
bts->si_common.chan_desc.ccch_conf = RSL_BCCH_CCCH_CONF_1_C;
+ /* Limit reserved block to 2 on combined channel */
+ if (bts->si_common.chan_desc.bs_ag_blks_res > 2)
+ bts->si_common.chan_desc.bs_ag_blks_res = 2;
break;
case 1:
bts->si_common.chan_desc.ccch_conf = RSL_BCCH_CCCH_CONF_1_NC;
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 07987dac2..cda5930a5 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -266,6 +266,12 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
VTY_NEWLINE);
if (bts->si_common.rach_control.cell_bar)
vty_out(vty, " CELL IS BARRED%s", VTY_NEWLINE);
+ vty_out(vty, "Channel Description Attachment: %s%s",
+ (bts->si_common.chan_desc.att) ? "yes" : "no", VTY_NEWLINE);
+ vty_out(vty, "Channel Description BS-PA-MFRMS: %u%s",
+ bts->si_common.chan_desc.bs_pa_mfrms + 2, VTY_NEWLINE);
+ vty_out(vty, "Channel Description BS-AG_BLKS-RES: %u%s",
+ bts->si_common.chan_desc.bs_ag_blks_res, VTY_NEWLINE);
vty_out(vty, "System Information present: 0x%08x, static: 0x%08x%s",
bts->si_valid, bts->si_mode_static, VTY_NEWLINE);
if (is_ipaccess_bts(bts))
@@ -501,6 +507,13 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
rach_max_trans_raw2val(bts->si_common.rach_control.max_trans),
VTY_NEWLINE);
+ vty_out(vty, " channel-descrption attach %u%s",
+ bts->si_common.chan_desc.att, VTY_NEWLINE);
+ vty_out(vty, " channel-descrption bs-pa-mfrms %u%s",
+ bts->si_common.chan_desc.bs_pa_mfrms + 2, VTY_NEWLINE);
+ vty_out(vty, " channel-descrption bs-ag-blks-res %u%s",
+ bts->si_common.chan_desc.bs_ag_blks_res, VTY_NEWLINE);
+
if (bts->rach_b_thresh != -1)
vty_out(vty, " rach nm busy threshold %u%s",
bts->rach_b_thresh, VTY_NEWLINE);
@@ -1772,6 +1785,49 @@ DEFUN(cfg_bts_rach_max_trans,
return CMD_SUCCESS;
}
+#define CD_STR "Channel Description\n"
+
+DEFUN(cfg_bts_chan_desc_att,
+ cfg_bts_chan_desc_att_cmd,
+ "channel-descrption attach (0|1)",
+ CD_STR
+ "Set if attachment is required\n"
+ "Attachment is NOT required\n"
+ "Attachment is required (standard)\n")
+{
+ struct gsm_bts *bts = vty->index;
+ bts->si_common.chan_desc.att = atoi(argv[0]);
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_chan_desc_bs_pa_mfrms,
+ cfg_bts_chan_desc_bs_pa_mfrms_cmd,
+ "channel-descrption bs-pa-mfrms <2-9>",
+ CD_STR
+ "Set number of multiframe periods for paging groups\n"
+ "Number of multiframe periods for paging groups\n")
+{
+ struct gsm_bts *bts = vty->index;
+ int bs_pa_mfrms = atoi(argv[0]);
+
+ bts->si_common.chan_desc.bs_pa_mfrms = bs_pa_mfrms - 2;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_chan_desc_bs_ag_blks_res,
+ cfg_bts_chan_desc_bs_ag_blks_res_cmd,
+ "channel-descrption bs-ag-blks-res <0-7>",
+ CD_STR
+ "Set number of blocks reserved for access grant\n"
+ "Number of blocks reserved for access grant\n")
+{
+ struct gsm_bts *bts = vty->index;
+ int bs_ag_blks_res = atoi(argv[0]);
+
+ bts->si_common.chan_desc.bs_ag_blks_res = bs_ag_blks_res;
+ return CMD_SUCCESS;
+}
+
#define NM_STR "Network Management\n"
DEFUN(cfg_bts_rach_nm_b_thresh,
@@ -2835,6 +2891,9 @@ int bsc_vty_init(const struct log_info *cat)
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_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_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/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c
index e14d57443..011adb815 100644
--- a/openbsc/src/libcommon/gsm_data.c
+++ b/openbsc/src/libcommon/gsm_data.c
@@ -390,6 +390,9 @@ struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, enum gsm_bts_typ
bts->si_common.rach_control.tx_integer = 9; /* 12 slots spread - 217/115 slots delay */
bts->si_common.rach_control.max_trans = 3; /* 7 retransmissions */
bts->si_common.rach_control.t2 = 4; /* no emergency calls */
+ bts->si_common.chan_desc.att = 1; /* attachment required */
+ bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */
+ bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */
llist_add_tail(&bts->list, &net->bts_list);