Change in osmo-bts[master]: vty: add attributes to VTY commands indicating when they apply

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Tue Sep 29 19:52:13 UTC 2020


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/20318 )


Change subject: vty: add attributes to VTY commands indicating when they apply
......................................................................

vty: add attributes to VTY commands indicating when they apply

Change-Id: Ifcdfcd157e5067fa2e4296d7c7e93a74087f49ff
Related: SYS#4937, OS#1601
---
M include/osmo-bts/vty.h
M src/common/vty.c
M src/osmo-bts-trx/trx_vty.c
3 files changed, 201 insertions(+), 151 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/20318/1

diff --git a/include/osmo-bts/vty.h b/include/osmo-bts/vty.h
index 8eb76a8..b6e3f0d 100644
--- a/include/osmo-bts/vty.h
+++ b/include/osmo-bts/vty.h
@@ -28,4 +28,10 @@
 
 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 d5993d6..c5d37f1 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 @@
 	.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] = 'N',
+		[BTS_VTY_TRX_POWERCYCLE] = 'T',
+	},
 };
 
 extern struct gsm_network bts_gsmnet;
@@ -178,10 +190,10 @@
 	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 @@
 }
 
 /* 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 @@
 	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 @@
 	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 @@
 
 #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 @@
 	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 @@
 
 #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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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;
 
@@ -647,10 +670,11 @@
 	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;
 
@@ -658,10 +682,11 @@
 	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;
 
@@ -669,27 +694,30 @@
 	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]);
@@ -763,7 +791,7 @@
 
 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;
@@ -1474,9 +1502,10 @@
 	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;
@@ -1494,9 +1523,10 @@
 	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 6b8ca77..cb719ee 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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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;
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/20318
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ifcdfcd157e5067fa2e4296d7c7e93a74087f49ff
Gerrit-Change-Number: 20318
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200929/0eefbc9a/attachment.htm>


More information about the gerrit-log mailing list