set the TRX nominal power by default and/or VTY

This commit is contained in:
Harald Welte (local) 2009-12-27 20:56:38 +01:00 committed by Harald Welte
parent 19ef62a0a5
commit 7b37d9710d
3 changed files with 34 additions and 6 deletions

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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);