diff options
Diffstat (limited to 'src/osmo-bsc')
-rw-r--r-- | src/osmo-bsc/abis_rsl.c | 20 | ||||
-rw-r--r-- | src/osmo-bsc/bts_vty.c | 33 |
2 files changed, 50 insertions, 3 deletions
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index f93dee250..52008a5ba 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -554,7 +554,9 @@ static void put_rep_acch_cap_ie(const struct gsm_lchan *lchan, } /* indicate Temporary overpower of SACCH and FACCH channels */ -static void put_top_acch_cap_ie(const struct gsm_lchan *lchan, struct msgb *msg) +static void put_top_acch_cap_ie(const struct gsm_lchan *lchan, + const struct rsl_ie_chan_mode *cm, + struct msgb *msg) { const struct gsm_bts *bts = lchan->ts->trx->bts; @@ -562,6 +564,18 @@ static void put_top_acch_cap_ie(const struct gsm_lchan *lchan, struct msgb *msg) if (!(bts->model->type == GSM_BTS_TYPE_OSMOBTS && osmo_bts_has_feature(&bts->features, BTS_FEAT_ACCH_TEMP_OVP))) return; + /* Check if TOP is permitted for the given Channel Mode */ + switch (bts->top_acch_chan_mode) { + case TOP_ACCH_CHAN_MODE_SPEECH_V3: + if (cm->spd_ind != RSL_CMOD_SPD_SPEECH) + return; + if (cm->chan_rate != RSL_CMOD_SP_GSM3) + return; + break; + case TOP_ACCH_CHAN_MODE_ANY: + break; + } + msgb_tlv_put(msg, RSL_IE_OSMO_TEMP_OVP_ACCH_CAP, sizeof(bts->top_acch_cap), (void *)&bts->top_acch_cap); @@ -700,7 +714,7 @@ int rsl_tx_chan_activ(struct gsm_lchan *lchan, uint8_t act_type, uint8_t ho_ref) } put_rep_acch_cap_ie(lchan, msg); - put_top_acch_cap_ie(lchan, msg); + put_top_acch_cap_ie(lchan, &cm, msg); /* Selecting a specific TSC Set is only applicable to VAMOS mode */ if (lchan->activate.info.vamos && lchan->activate.tsc_set >= 1) @@ -772,7 +786,7 @@ int rsl_chan_mode_modify_req(struct gsm_lchan *lchan) } put_rep_acch_cap_ie(lchan, msg); - put_top_acch_cap_ie(lchan, msg); + put_top_acch_cap_ie(lchan, &cm, msg); /* Selecting a specific TSC Set is only applicable to VAMOS mode. Send this Osmocom specific IE only to OsmoBTS * types. */ diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index 683f2c31e..2da789a39 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -818,6 +818,34 @@ DEFUN_USRATTR(cfg_bts_top_dl_acch_rxqual, return CMD_SUCCESS; } +static const struct value_string top_acch_chan_mode_name[] = { + { TOP_ACCH_CHAN_MODE_ANY, "any" }, + { TOP_ACCH_CHAN_MODE_SPEECH_V3, "speech-amr" }, + { 0, NULL } +}; + +DEFUN_USRATTR(cfg_bts_top_dl_acch_chan_mode, + cfg_bts_top_dl_acch_chan_mode_cmd, + X(BSC_VTY_ATTR_NEW_LCHAN), + "overpower chan-mode (speech-amr|any)", + TOP_ACCH_STR + "Allow temporary overpower for specific Channel mode(s)\n" + "Speech channels using AMR codec\n" + "Any kind of channel mode (default)\n") +{ + struct gsm_bts *bts = vty->index; + + if (bts->model->type != GSM_BTS_TYPE_OSMOBTS) { + vty_out(vty, "%% ACCH overpower is not supported by BTS %u%s", + bts->nr, VTY_NEWLINE); + return CMD_WARNING; + } + + bts->top_acch_chan_mode = get_string_value(top_acch_chan_mode_name, argv[0]); + + return CMD_SUCCESS; +} + #define CD_STR "Channel Description\n" DEFUN_USRATTR(cfg_bts_chan_desc_att, @@ -4311,6 +4339,10 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) mode, top->overpower_db, VTY_NEWLINE); vty_out(vty, " overpower rxqual %u%s", top->rxqual, VTY_NEWLINE); + vty_out(vty, " overpower chan-mode %s%s", + get_value_string(top_acch_chan_mode_name, + bts->top_acch_chan_mode), + VTY_NEWLINE); } if (bts->rep_acch_cap.dl_facch_all) @@ -4531,6 +4563,7 @@ int bts_vty_init(void) install_element(BTS_NODE, &cfg_bts_top_dl_acch_cmd); install_element(BTS_NODE, &cfg_bts_top_no_dl_acch_cmd); install_element(BTS_NODE, &cfg_bts_top_dl_acch_rxqual_cmd); + install_element(BTS_NODE, &cfg_bts_top_dl_acch_chan_mode_cmd); install_element(BTS_NODE, &cfg_bts_interf_meas_avg_period_cmd); install_element(BTS_NODE, &cfg_bts_interf_meas_level_bounds_cmd); install_element(BTS_NODE, &cfg_bts_srvcc_fast_return_cmd); |