summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-12-27 20:56:38 +0100
committerHarald Welte <laforge@gnumonks.org>2009-12-28 13:42:47 +0100
commit7b37d9710d119675f374f10a780a8d93440c29d8 (patch)
tree9e57da6f990d9f2f28168c42e2f6263ea65d229c
parent19ef62a0a56a9c61d65283d005019ef9563cd8ae (diff)
set the TRX nominal power by default and/or VTY
-rw-r--r--openbsc/include/openbsc/gsm_data.h1
-rw-r--r--openbsc/src/gsm_data.c18
-rw-r--r--openbsc/src/vty_interface.c21
3 files changed, 34 insertions, 6 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 31d34608a..aee359219 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -615,6 +615,7 @@ struct gsm_network *gsm_network_init(u_int16_t country_code, u_int16_t network_c
struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type,
u_int8_t tsc, u_int8_t bsic);
struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
+void gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type);
struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num);
diff --git a/openbsc/src/gsm_data.c b/openbsc/src/gsm_data.c
index ae6d49e73..7e62aa846 100644
--- a/openbsc/src/gsm_data.c
+++ b/openbsc/src/gsm_data.c
@@ -133,6 +133,9 @@ struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts)
}
}
+ if (trx->nr != 0)
+ trx->nominal_power = bts->c0->nominal_power;
+
llist_add_tail(&trx->list, &bts->trx_list);
return trx;
@@ -464,3 +467,18 @@ struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan)
return meas_rep;
}
+
+void gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type)
+{
+ bts->type = type;
+
+ switch (bts->type) {
+ case GSM_BTS_TYPE_NANOBTS:
+ /* Set the default OML Stream ID to 0xff */
+ bts->oml_tei = 0xff;
+ bts->c0->nominal_power = 23;
+ break;
+ case GSM_BTS_TYPE_BS11:
+ break;
+ }
+}
diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c
index 0d66cb3a6..51c802842 100644
--- a/openbsc/src/vty_interface.c
+++ b/openbsc/src/vty_interface.c
@@ -266,6 +266,7 @@ static void config_write_trx_single(struct vty *vty, struct gsm_bts_trx *trx)
vty_out(vty, " trx %u%s", trx->nr, VTY_NEWLINE);
vty_out(vty, " arfcn %u%s", trx->arfcn, VTY_NEWLINE);
+ vty_out(vty, " nominal power %u%s", trx->nominal_power, VTY_NEWLINE);
vty_out(vty, " max_power_red %u%s", trx->max_power_red, VTY_NEWLINE);
config_write_e1_link(vty, &trx->rsl_e1_link, " rsl ");
vty_out(vty, " rsl e1 tei %u%s", trx->rsl_tei, VTY_NEWLINE);
@@ -1323,12 +1324,7 @@ DEFUN(cfg_bts_type,
{
struct gsm_bts *bts = vty->index;
- bts->type = parse_btstype(argv[0]);
-
- if (is_ipaccess_bts(bts)) {
- /* Set the default OML Stream ID to 0xff */
- bts->oml_tei = 0xff;
- }
+ gsm_set_bts_type(bts, parse_btstype(argv[0]));
return CMD_SUCCESS;
}
@@ -1635,6 +1631,18 @@ DEFUN(cfg_trx_arfcn,
return CMD_SUCCESS;
}
+DEFUN(cfg_trx_nominal_power,
+ cfg_trx_nominal_power_cmd,
+ "nominal power <0-100>",
+ "Nominal TRX RF Power in dB\n")
+{
+ struct gsm_bts_trx *trx = vty->index;
+
+ trx->nominal_power = atoi(argv[0]);
+
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_trx_max_power_red,
cfg_trx_max_power_red_cmd,
"max_power_red <0-100>",
@@ -1840,6 +1848,7 @@ int bsc_vty_init(struct gsm_network *net)
install_node(&trx_node, dummy_config_write);
install_default(TRX_NODE);
install_element(TRX_NODE, &cfg_trx_arfcn_cmd);
+ install_element(TRX_NODE, &cfg_trx_nominal_power_cmd);
install_element(TRX_NODE, &cfg_trx_max_power_red_cmd);
install_element(TRX_NODE, &cfg_trx_rsl_e1_cmd);
install_element(TRX_NODE, &cfg_trx_rsl_e1_tei_cmd);