aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2020-09-29 21:51:25 +0200
committerlaforge <laforge@osmocom.org>2020-10-08 07:16:55 +0000
commit05549ae252d2a517e54c2519e8927de5cdde2b1d (patch)
tree88ca186d413a45040e4e1f0a675820852279c35b
parent909646150792083ac81114e6af8ee3c81fb0c7a1 (diff)
vty: add attributes to VTY commands indicating when they apply
-rw-r--r--include/osmo-bts/vty.h6
-rw-r--r--src/common/vty.c199
-rw-r--r--src/osmo-bts-trx/trx_vty.c158
3 files changed, 207 insertions, 156 deletions
diff --git a/include/osmo-bts/vty.h b/include/osmo-bts/vty.h
index 8eb76a8c..b6e3f0d3 100644
--- a/include/osmo-bts/vty.h
+++ b/include/osmo-bts/vty.h
@@ -28,4 +28,10 @@ struct gsm_network *gsmnet_from_vty(struct vty *v);
extern struct vty_app_info bts_vty_info;
+enum bts_vty_cmd_attr {
+ BTS_VTY_ATTR_NEW_LCHAN,
+ BTS_VTY_TRX_POWERCYCLE,
+ /* NOTE: up to 32 entries */
+};
+
#endif
diff --git a/src/common/vty.c b/src/common/vty.c
index 0d62a0e7..a21b1ec9 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -66,6 +66,8 @@
#define BTS_TRX_TS_STR BTS_TRX_STR TS_NR_STR
#define BTS_TRX_TS_LCHAN_STR BTS_TRX_TS_STR LCHAN_NR_STR
+#define X(x) (1 << x)
+
int g_vty_port_num = OSMO_VTY_PORT_BTS;
struct phy_instance *vty_get_phy_instance(struct vty *vty, int phy_nr, int inst_nr)
@@ -137,6 +139,16 @@ struct vty_app_info bts_vty_info = {
.copyright = osmobts_copyright,
.go_parent_cb = bts_vty_go_parent,
.is_config_node = bts_vty_is_config_node,
+ .usr_attr_desc = {
+ [BTS_VTY_ATTR_NEW_LCHAN] = \
+ "This command applies for newly created lchans",
+ [BTS_VTY_TRX_POWERCYCLE] = \
+ "This command applies when the TRX powercycles or restarts",
+ },
+ .usr_attr_letters = {
+ [BTS_VTY_ATTR_NEW_LCHAN] = 'l',
+ [BTS_VTY_TRX_POWERCYCLE] = 'p',
+ },
};
extern struct gsm_network bts_gsmnet;
@@ -178,10 +190,10 @@ gDEFUN(cfg_bts_no_auto_band, cfg_bts_no_auto_band_cmd,
return CMD_SUCCESS;
}
-
-DEFUN(cfg_bts_trx, cfg_bts_trx_cmd,
- "trx <0-254>",
- "Select a TRX to configure\n" "TRX number\n")
+DEFUN_ATTR(cfg_bts_trx, cfg_bts_trx_cmd,
+ "trx <0-254>",
+ "Select a TRX to configure\n" "TRX number\n",
+ CMD_ATTR_IMMEDIATE)
{
int trx_nr = atoi(argv[0]);
struct gsm_bts *bts = vty->index;
@@ -360,11 +372,12 @@ DEFUN(cfg_vty_telnet_port, cfg_vty_telnet_port_cmd,
}
/* per-BTS configuration */
-DEFUN(cfg_bts,
- cfg_bts_cmd,
- "bts BTS_NR",
- "Select a BTS to configure\n"
- "BTS Number\n")
+DEFUN_ATTR(cfg_bts,
+ cfg_bts_cmd,
+ "bts BTS_NR",
+ "Select a BTS to configure\n"
+ "BTS Number\n",
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_network *gsmnet = gsmnet_from_vty(vty);
int bts_nr = atoi(argv[0]);
@@ -457,10 +470,11 @@ DEFUN_DEPRECATED(cfg_bts_rtp_bind_ip,
return CMD_WARNING;
}
-DEFUN(cfg_bts_rtp_jitbuf,
- cfg_bts_rtp_jitbuf_cmd,
- "rtp jitter-buffer <0-10000> [adaptive]",
- RTP_STR "RTP jitter buffer\n" "jitter buffer in ms\n")
+DEFUN_USRATTR(cfg_bts_rtp_jitbuf,
+ cfg_bts_rtp_jitbuf_cmd,
+ X(BTS_VTY_ATTR_NEW_LCHAN),
+ "rtp jitter-buffer <0-10000> [adaptive]",
+ RTP_STR "RTP jitter buffer\n" "jitter buffer in ms\n")
{
struct gsm_bts *bts = vty->index;
@@ -508,10 +522,11 @@ DEFUN(cfg_bts_rtp_port_range,
return CMD_SUCCESS;
}
-DEFUN(cfg_bts_rtp_ip_dscp,
- cfg_bts_rtp_ip_dscp_cmd,
- "rtp ip-dscp <0-63>",
- RTP_STR "Specify DSCP for RTP/IP packets\n" "The DSCP value (upper 6 bits of TOS)\n")
+DEFUN_USRATTR(cfg_bts_rtp_ip_dscp,
+ cfg_bts_rtp_ip_dscp_cmd,
+ X(BTS_VTY_ATTR_NEW_LCHAN),
+ "rtp ip-dscp <0-63>",
+ RTP_STR "Specify DSCP for RTP/IP packets\n" "The DSCP value (upper 6 bits of TOS)\n")
{
struct gsm_bts *bts = vty->index;
int dscp = atoi(argv[0]);
@@ -523,11 +538,12 @@ DEFUN(cfg_bts_rtp_ip_dscp,
#define PAG_STR "Paging related parameters\n"
-DEFUN(cfg_bts_paging_queue_size,
- cfg_bts_paging_queue_size_cmd,
- "paging queue-size <1-1024>",
- PAG_STR "Maximum length of BTS-internal paging queue\n"
- "Maximum length of BTS-internal paging queue\n")
+DEFUN_ATTR(cfg_bts_paging_queue_size,
+ cfg_bts_paging_queue_size_cmd,
+ "paging queue-size <1-1024>",
+ PAG_STR "Maximum length of BTS-internal paging queue\n"
+ "Maximum length of BTS-internal paging queue\n",
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_bts *bts = vty->index;
@@ -536,11 +552,12 @@ DEFUN(cfg_bts_paging_queue_size,
return CMD_SUCCESS;
}
-DEFUN(cfg_bts_paging_lifetime,
- cfg_bts_paging_lifetime_cmd,
- "paging lifetime <0-60>",
- PAG_STR "Maximum lifetime of a paging record\n"
- "Maximum lifetime of a paging record (secods)\n")
+DEFUN_ATTR(cfg_bts_paging_lifetime,
+ cfg_bts_paging_lifetime_cmd,
+ "paging lifetime <0-60>",
+ PAG_STR "Maximum lifetime of a paging record\n"
+ "Maximum lifetime of a paging record (secods)\n",
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_bts *bts = vty->index;
@@ -551,13 +568,14 @@ DEFUN(cfg_bts_paging_lifetime,
#define AGCH_QUEUE_STR "AGCH queue mgmt\n"
-DEFUN(cfg_bts_agch_queue_mgmt_params,
- cfg_bts_agch_queue_mgmt_params_cmd,
- "agch-queue-mgmt threshold <0-100> low <0-100> high <0-100000>",
- AGCH_QUEUE_STR
- "Threshold to start cleanup\nin %% of the maximum queue length\n"
- "Low water mark for cleanup\nin %% of the maximum queue length\n"
- "High water mark for cleanup\nin %% of the maximum queue length\n")
+DEFUN_ATTR(cfg_bts_agch_queue_mgmt_params,
+ cfg_bts_agch_queue_mgmt_params_cmd,
+ "agch-queue-mgmt threshold <0-100> low <0-100> high <0-100000>",
+ AGCH_QUEUE_STR
+ "Threshold to start cleanup\nin %% of the maximum queue length\n"
+ "Low water mark for cleanup\nin %% of the maximum queue length\n"
+ "High water mark for cleanup\nin %% of the maximum queue length\n",
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_bts *bts = vty->index;
@@ -568,11 +586,12 @@ DEFUN(cfg_bts_agch_queue_mgmt_params,
return CMD_SUCCESS;
}
-DEFUN(cfg_bts_agch_queue_mgmt_default,
- cfg_bts_agch_queue_mgmt_default_cmd,
- "agch-queue-mgmt default",
- AGCH_QUEUE_STR
- "Reset clean parameters to default values\n")
+DEFUN_ATTR(cfg_bts_agch_queue_mgmt_default,
+ cfg_bts_agch_queue_mgmt_default_cmd,
+ "agch-queue-mgmt default",
+ AGCH_QUEUE_STR
+ "Reset clean parameters to default values\n",
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_bts *bts = vty->index;
@@ -583,10 +602,11 @@ DEFUN(cfg_bts_agch_queue_mgmt_default,
return CMD_SUCCESS;
}
-DEFUN(cfg_bts_ul_power_target, cfg_bts_ul_power_target_cmd,
- "uplink-power-target <-110-0>",
- "Set the nominal target Rx Level for uplink power control loop\n"
- "Target uplink Rx level in dBm\n")
+DEFUN_ATTR(cfg_bts_ul_power_target, cfg_bts_ul_power_target_cmd,
+ "uplink-power-target <-110-0>",
+ "Set the nominal target Rx Level for uplink power control loop\n"
+ "Target uplink Rx level in dBm\n",
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_bts *bts = vty->index;
@@ -595,10 +615,11 @@ DEFUN(cfg_bts_ul_power_target, cfg_bts_ul_power_target_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_bts_min_qual_rach, cfg_bts_min_qual_rach_cmd,
- "min-qual-rach <-100-100>",
- "Set the minimum link quality level of Access Bursts to be accepted\n"
- "C/I (Carrier-to-Interference) ratio in centiBels (10e-2 B or 10e-1 dB)\n")
+DEFUN_ATTR(cfg_bts_min_qual_rach, cfg_bts_min_qual_rach_cmd,
+ "min-qual-rach <-100-100>",
+ "Set the minimum link quality level of Access Bursts to be accepted\n"
+ "C/I (Carrier-to-Interference) ratio in centiBels (10e-2 B or 10e-1 dB)\n",
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_bts *bts = vty->index;
@@ -607,10 +628,11 @@ DEFUN(cfg_bts_min_qual_rach, cfg_bts_min_qual_rach_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_bts_min_qual_norm, cfg_bts_min_qual_norm_cmd,
- "min-qual-norm <-100-100>",
- "Set the minimum link quality level of Normal Bursts to be accepted\n"
- "C/I (Carrier-to-Interference) ratio in centiBels (10e-2 B or 10e-1 dB)\n")
+DEFUN_ATTR(cfg_bts_min_qual_norm, cfg_bts_min_qual_norm_cmd,
+ "min-qual-norm <-100-100>",
+ "Set the minimum link quality level of Normal Bursts to be accepted\n"
+ "C/I (Carrier-to-Interference) ratio in centiBels (10e-2 B or 10e-1 dB)\n",
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_bts *bts = vty->index;
@@ -619,10 +641,11 @@ DEFUN(cfg_bts_min_qual_norm, cfg_bts_min_qual_norm_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_bts_max_ber_rach, cfg_bts_max_ber_rach_cmd,
- "max-ber10k-rach <0-10000>",
- "Set the maximum BER for valid RACH requests\n"
- "BER in 1/10000 units (0=no BER; 100=1% BER)\n")
+DEFUN_ATTR(cfg_bts_max_ber_rach, cfg_bts_max_ber_rach_cmd,
+ "max-ber10k-rach <0-10000>",
+ "Set the maximum BER for valid RACH requests\n"
+ "BER in 1/10000 units (0=no BER; 100=1% BER)\n",
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_bts *bts = vty->index;
@@ -643,10 +666,11 @@ DEFUN(cfg_bts_pcu_sock, cfg_bts_pcu_sock_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_bts_supp_meas_toa256, cfg_bts_supp_meas_toa256_cmd,
- "supp-meas-info toa256",
- "Configure the RSL Supplementary Measurement Info\n"
- "Report the TOA in 1/256th symbol periods\n")
+DEFUN_ATTR(cfg_bts_supp_meas_toa256, cfg_bts_supp_meas_toa256_cmd,
+ "supp-meas-info toa256",
+ "Configure the RSL Supplementary Measurement Info\n"
+ "Report the TOA in 1/256th symbol periods\n",
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_bts *bts = vty->index;
@@ -654,10 +678,11 @@ DEFUN(cfg_bts_supp_meas_toa256, cfg_bts_supp_meas_toa256_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_bts_no_supp_meas_toa256, cfg_bts_no_supp_meas_toa256_cmd,
- "no supp-meas-info toa256",
- NO_STR "Configure the RSL Supplementary Measurement Info\n"
- "Report the TOA in 1/256th symbol periods\n")
+DEFUN_ATTR(cfg_bts_no_supp_meas_toa256, cfg_bts_no_supp_meas_toa256_cmd,
+ "no supp-meas-info toa256",
+ NO_STR "Configure the RSL Supplementary Measurement Info\n"
+ "Report the TOA in 1/256th symbol periods\n",
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_bts *bts = vty->index;
@@ -665,27 +690,30 @@ DEFUN(cfg_bts_no_supp_meas_toa256, cfg_bts_no_supp_meas_toa256_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_bts_smscb_max_qlen, cfg_bts_smscb_max_qlen_cmd,
- "smscb queue-max-length <1-60>",
- "Maximum queue length for SMSCB (CBCH) queue. In count of messages/pages (Default: 15)")
+DEFUN_ATTR(cfg_bts_smscb_max_qlen, cfg_bts_smscb_max_qlen_cmd,
+ "smscb queue-max-length <1-60>",
+ "Maximum queue length for SMSCB (CBCH) queue. In count of messages/pages (Default: 15)",
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_bts *bts = vty->index;
bts->smscb_queue_max_len = atoi(argv[0]);
return CMD_SUCCESS;
}
-DEFUN(cfg_bts_smscb_tgt_qlen, cfg_bts_smscb_tgt_qlen_cmd,
- "smscb queue-target-length <1-30>",
- "Target queue length for SMSCB (CBCH) queue. In count of messages/pages (Default: 2)")
+DEFUN_ATTR(cfg_bts_smscb_tgt_qlen, cfg_bts_smscb_tgt_qlen_cmd,
+ "smscb queue-target-length <1-30>",
+ "Target queue length for SMSCB (CBCH) queue. In count of messages/pages (Default: 2)",
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_bts *bts = vty->index;
bts->smscb_queue_tgt_len = atoi(argv[0]);
return CMD_SUCCESS;
}
-DEFUN(cfg_bts_smscb_qhyst, cfg_bts_smscb_qhyst_cmd,
- "smscb queue-hysteresis <0-30>",
- "Hysteresis for SMSCB (CBCH) queue. In count of messages/pages (Default: 2)")
+DEFUN_ATTR(cfg_bts_smscb_qhyst, cfg_bts_smscb_qhyst_cmd,
+ "smscb queue-hysteresis <0-30>",
+ "Hysteresis for SMSCB (CBCH) queue. In count of messages/pages (Default: 2)",
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_bts *bts = vty->index;
bts->smscb_queue_hyst = atoi(argv[0]);
@@ -707,11 +735,12 @@ static int parse_mdbm(const char *valstr, const char *unit)
return val;
}
-DEFUN(cfg_trx_user_gain,
- cfg_trx_user_gain_cmd,
- "user-gain <-100000-100000> (dB|mdB)",
- "Inform BTS about additional, user-provided gain or attenuation at TRX output\n"
- "Value of user-provided external gain(+)/attenuation(-)\n" DB_MDB_STR)
+DEFUN_ATTR(cfg_trx_user_gain,
+ cfg_trx_user_gain_cmd,
+ "user-gain <-100000-100000> (dB|mdB)",
+ "Inform BTS about additional, user-provided gain or attenuation at TRX output\n"
+ "Value of user-provided external gain(+)/attenuation(-)\n" DB_MDB_STR,
+ CMD_ATTR_IMMEDIATE)
{
struct gsm_bts_trx *trx = vty->index;
@@ -759,7 +788,7 @@ DEFUN(cfg_trx_pr_step_interval, cfg_trx_pr_step_interval_cmd,
DEFUN(cfg_trx_ms_power_control, cfg_trx_ms_power_control_cmd,
"ms-power-control (dsp|osmo)",
- "Mobile Station Power Level Control (change requires restart)\n"
+ "Mobile Station Power Level Control\n"
"Handled by DSP\n" "Handled by OsmoBTS\n")
{
struct gsm_bts_trx *trx = vty->index;
@@ -1516,9 +1545,10 @@ static struct cmd_node phy_inst_node = {
1,
};
-DEFUN(cfg_phy, cfg_phy_cmd,
- "phy <0-255>",
- "Select a PHY to configure\n" "PHY number\n")
+DEFUN_ATTR(cfg_phy, cfg_phy_cmd,
+ "phy <0-255>",
+ "Select a PHY to configure\n" "PHY number\n",
+ CMD_ATTR_IMMEDIATE)
{
int phy_nr = atoi(argv[0]);
struct phy_link *plink;
@@ -1536,9 +1566,10 @@ DEFUN(cfg_phy, cfg_phy_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_phy_inst, cfg_phy_inst_cmd,
- "instance <0-255>",
- "Select a PHY instance to configure\n" "PHY Instance number\n")
+DEFUN_ATTR(cfg_phy_inst, cfg_phy_inst_cmd,
+ "instance <0-255>",
+ "Select a PHY instance to configure\n" "PHY Instance number\n",
+ CMD_ATTR_IMMEDIATE)
{
int inst_nr = atoi(argv[0]);
struct phy_link *plink = vty->index;
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index e5199ec1..6dc28f62 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -48,6 +48,8 @@
#include "trx_if.h"
#include "loops.h"
+#define X(x) (1 << x)
+
#define OSMOTRX_STR "OsmoTRX Transceiver configuration\n"
static struct gsm_bts *vty_bts;
@@ -160,10 +162,11 @@ DEFUN(show_phy, show_phy_cmd, "show phy",
return CMD_SUCCESS;
}
-DEFUN(cfg_trx_nominal_power, cfg_trx_nominal_power_cmd,
- "nominal-tx-power <-10-100>",
- "Manually set (force) the nominal transmit output power in dBm\n"
- "Nominal transmit output power level in dBm\n")
+DEFUN_USRATTR(cfg_trx_nominal_power, cfg_trx_nominal_power_cmd,
+ X(BTS_VTY_TRX_POWERCYCLE),
+ "nominal-tx-power <-10-100>",
+ "Manually set (force) the nominal transmit output power in dBm\n"
+ "Nominal transmit output power level in dBm\n")
{
struct gsm_bts_trx *trx = vty->index;
struct phy_instance *pinst = trx_phy_instance(trx);
@@ -176,10 +179,11 @@ DEFUN(cfg_trx_nominal_power, cfg_trx_nominal_power_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_trx_no_nominal_power, cfg_trx_no_nominal_power_cmd,
- "no nominal-tx-power",
- NO_STR
- "Manually set (force) the nominal transmit output power; ask the TRX instead (default)\n")
+DEFUN_USRATTR(cfg_trx_no_nominal_power, cfg_trx_no_nominal_power_cmd,
+ X(BTS_VTY_TRX_POWERCYCLE),
+ "no nominal-tx-power",
+ NO_STR
+ "Manually set (force) the nominal transmit output power; ask the TRX instead (default)\n")
{
struct gsm_bts_trx *trx = vty->index;
struct phy_instance *pinst = trx_phy_instance(trx);
@@ -228,17 +232,18 @@ DEFUN_DEPRECATED(cfg_phy_no_timing_advance_loop, cfg_phy_no_timing_advance_loop_
return CMD_SUCCESS;
}
-DEFUN(cfg_phyinst_maxdly, cfg_phyinst_maxdly_cmd,
- "osmotrx maxdly <0-31>",
- OSMOTRX_STR
- "Set the maximum acceptable delay of an Access Burst (in GSM symbols)."
- " Access Burst is the first burst a mobile transmits in order to establish"
- " a connection and it is used to estimate Timing Advance (TA) which is"
- " then applied to Normal Bursts to compensate for signal delay due to"
- " distance. So changing this setting effectively changes maximum range of"
- " the cell, because if we receive an Access Burst with a delay higher than"
- " this value, it will be ignored and connection is dropped.\n"
- "GSM symbols (approx. 1.1km per symbol)\n")
+DEFUN_ATTR(cfg_phyinst_maxdly, cfg_phyinst_maxdly_cmd,
+ "osmotrx maxdly <0-31>",
+ OSMOTRX_STR
+ "Set the maximum acceptable delay of an Access Burst (in GSM symbols)."
+ " Access Burst is the first burst a mobile transmits in order to establish"
+ " a connection and it is used to estimate Timing Advance (TA) which is"
+ " then applied to Normal Bursts to compensate for signal delay due to"
+ " distance. So changing this setting effectively changes maximum range of"
+ " the cell, because if we receive an Access Burst with a delay higher than"
+ " this value, it will be ignored and connection is dropped.\n"
+ "GSM symbols (approx. 1.1km per symbol)\n",
+ CMD_ATTR_IMMEDIATE)
{
struct phy_instance *pinst = vty->index;
struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
@@ -251,20 +256,20 @@ DEFUN(cfg_phyinst_maxdly, cfg_phyinst_maxdly_cmd,
return CMD_SUCCESS;
}
-
-DEFUN(cfg_phyinst_maxdlynb, cfg_phyinst_maxdlynb_cmd,
- "osmotrx maxdlynb <0-31>",
- OSMOTRX_STR
- "Set the maximum acceptable delay of a Normal Burst (in GSM symbols)."
- " USE FOR TESTING ONLY, DON'T CHANGE IN PRODUCTION USE!"
- " During normal operation, Normal Bursts delay are controlled by a Timing"
- " Advance control loop and thus Normal Bursts arrive to a BTS with no more"
- " than a couple GSM symbols, which is already taken into account in osmo-trx."
- " So changing this setting will have no effect in production installations"
- " except increasing osmo-trx CPU load. This setting is only useful when"
- " testing with a transmitter which can't precisely synchronize to the BTS"
- " downlink signal, like e.g. R&S CMD57.\n"
- "GSM symbols (approx. 1.1km per symbol)\n")
+DEFUN_ATTR(cfg_phyinst_maxdlynb, cfg_phyinst_maxdlynb_cmd,
+ "osmotrx maxdlynb <0-31>",
+ OSMOTRX_STR
+ "Set the maximum acceptable delay of a Normal Burst (in GSM symbols)."
+ " USE FOR TESTING ONLY, DON'T CHANGE IN PRODUCTION USE!"
+ " During normal operation, Normal Bursts delay are controlled by a Timing"
+ " Advance control loop and thus Normal Bursts arrive to a BTS with no more"
+ " than a couple GSM symbols, which is already taken into account in osmo-trx."
+ " So changing this setting will have no effect in production installations"
+ " except increasing osmo-trx CPU load. This setting is only useful when"
+ " testing with a transmitter which can't precisely synchronize to the BTS"
+ " downlink signal, like e.g. R&S CMD57.\n"
+ "GSM symbols (approx. 1.1km per symbol)\n",
+ CMD_ATTR_IMMEDIATE)
{
struct phy_instance *pinst = vty->index;
struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
@@ -319,12 +324,13 @@ DEFUN_DEPRECATED(cfg_phyinst_power_on, cfg_phyinst_power_on_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_phy_fn_advance, cfg_phy_fn_advance_cmd,
- "osmotrx fn-advance <0-30>",
- OSMOTRX_STR
- "Set the number of frames to be transmitted to transceiver in advance "
- "of current FN\n"
- "Advance in frames\n")
+DEFUN_ATTR(cfg_phy_fn_advance, cfg_phy_fn_advance_cmd,
+ "osmotrx fn-advance <0-30>",
+ OSMOTRX_STR
+ "Set the number of frames to be transmitted to transceiver in advance "
+ "of current FN\n"
+ "Advance in frames\n",
+ CMD_ATTR_IMMEDIATE)
{
struct phy_link *plink = vty->index;
@@ -333,12 +339,13 @@ DEFUN(cfg_phy_fn_advance, cfg_phy_fn_advance_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_phy_rts_advance, cfg_phy_rts_advance_cmd,
- "osmotrx rts-advance <0-30>",
- OSMOTRX_STR
- "Set the number of frames to be requested (PCU) in advance of current "
- "FN. Do not change this, unless you have a good reason!\n"
- "Advance in frames\n")
+DEFUN_ATTR(cfg_phy_rts_advance, cfg_phy_rts_advance_cmd,
+ "osmotrx rts-advance <0-30>",
+ OSMOTRX_STR
+ "Set the number of frames to be requested (PCU) in advance of current "
+ "FN. Do not change this, unless you have a good reason!\n"
+ "Advance in frames\n",
+ CMD_ATTR_IMMEDIATE)
{
struct phy_link *plink = vty->index;
@@ -347,11 +354,12 @@ DEFUN(cfg_phy_rts_advance, cfg_phy_rts_advance_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_phyinst_rxgain, cfg_phyinst_rxgain_cmd,
- "osmotrx rx-gain <0-50>",
- OSMOTRX_STR
- "Set the receiver gain in dB\n"
- "Gain in dB\n")
+DEFUN_ATTR(cfg_phyinst_rxgain, cfg_phyinst_rxgain_cmd,
+ "osmotrx rx-gain <0-50>",
+ OSMOTRX_STR
+ "Set the receiver gain in dB\n"
+ "Gain in dB\n",
+ CMD_ATTR_IMMEDIATE)
{
struct phy_instance *pinst = vty->index;
struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
@@ -382,9 +390,10 @@ DEFUN(cfg_phyinst_tx_atten, cfg_phyinst_tx_atten_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_phyinst_no_rxgain, cfg_phyinst_no_rxgain_cmd,
- "no osmotrx rx-gain",
- NO_STR OSMOTRX_STR "Unset the receiver gain in dB\n")
+DEFUN_USRATTR(cfg_phyinst_no_rxgain, cfg_phyinst_no_rxgain_cmd,
+ X(BTS_VTY_TRX_POWERCYCLE),
+ "no osmotrx rx-gain",
+ NO_STR OSMOTRX_STR "Unset the receiver gain in dB\n")
{
struct phy_instance *pinst = vty->index;
struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
@@ -394,10 +403,11 @@ DEFUN(cfg_phyinst_no_rxgain, cfg_phyinst_no_rxgain_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_phyinst_no_maxdly, cfg_phyinst_no_maxdly_cmd,
- "no osmotrx maxdly",
- NO_STR OSMOTRX_STR
- "Unset the maximum delay of GSM symbols\n")
+DEFUN_USRATTR(cfg_phyinst_no_maxdly, cfg_phyinst_no_maxdly_cmd,
+ X(BTS_VTY_TRX_POWERCYCLE),
+ "no osmotrx maxdly",
+ NO_STR OSMOTRX_STR
+ "Unset the maximum delay of GSM symbols\n")
{
struct phy_instance *pinst = vty->index;
struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
@@ -407,10 +417,11 @@ DEFUN(cfg_phyinst_no_maxdly, cfg_phyinst_no_maxdly_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_phyinst_no_maxdlynb, cfg_phyinst_no_maxdlynb_cmd,
- "no osmotrx maxdlynb",
- NO_STR OSMOTRX_STR
- "Unset the maximum delay of GSM symbols\n")
+DEFUN_USRATTR(cfg_phyinst_no_maxdlynb, cfg_phyinst_no_maxdlynb_cmd,
+ X(BTS_VTY_TRX_POWERCYCLE),
+ "no osmotrx maxdlynb",
+ NO_STR OSMOTRX_STR
+ "Unset the maximum delay of GSM symbols\n")
{
struct phy_instance *pinst = vty->index;
struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
@@ -467,9 +478,10 @@ DEFUN(cfg_phy_base_port, cfg_phy_base_port_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_phy_setbsic, cfg_phy_setbsic_cmd,
- "osmotrx legacy-setbsic", OSMOTRX_STR
- "Use SETBSIC to configure transceiver (use ONLY with OpenBTS Transceiver!)\n")
+DEFUN_USRATTR(cfg_phy_setbsic, cfg_phy_setbsic_cmd,
+ X(BTS_VTY_TRX_POWERCYCLE),
+ "osmotrx legacy-setbsic", OSMOTRX_STR
+ "Use SETBSIC to configure transceiver (use ONLY with OpenBTS Transceiver!)\n")
{
struct phy_link *plink = vty->index;
plink->u.osmotrx.use_legacy_setbsic = true;
@@ -481,9 +493,10 @@ DEFUN(cfg_phy_setbsic, cfg_phy_setbsic_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_phy_no_setbsic, cfg_phy_no_setbsic_cmd,
- "no osmotrx legacy-setbsic",
- NO_STR OSMOTRX_STR "Disable Legacy SETBSIC to configure transceiver\n")
+DEFUN_USRATTR(cfg_phy_no_setbsic, cfg_phy_no_setbsic_cmd,
+ X(BTS_VTY_TRX_POWERCYCLE),
+ "no osmotrx legacy-setbsic",
+ NO_STR OSMOTRX_STR "Disable Legacy SETBSIC to configure transceiver\n")
{
struct phy_link *plink = vty->index;
plink->u.osmotrx.use_legacy_setbsic = false;
@@ -491,11 +504,12 @@ DEFUN(cfg_phy_no_setbsic, cfg_phy_no_setbsic_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_phy_trxd_max_version, cfg_phy_trxd_max_version_cmd,
- "osmotrx trxd-max-version (latest|<0-15>)", OSMOTRX_STR
- "Set maximum TRXD format version to negotiate with TRX\n"
- "Use latest supported TRXD format version (default)\n"
- "Maximum TRXD format version number\n")
+DEFUN_USRATTR(cfg_phy_trxd_max_version, cfg_phy_trxd_max_version_cmd,
+ X(BTS_VTY_TRX_POWERCYCLE),
+ "osmotrx trxd-max-version (latest|<0-15>)", OSMOTRX_STR
+ "Set maximum TRXD format version to negotiate with TRX\n"
+ "Use latest supported TRXD format version (default)\n"
+ "Maximum TRXD format version number\n")
{
struct phy_link *plink = vty->index;