diff options
Diffstat (limited to 'CommonLibs/trx_vty.c')
-rw-r--r-- | CommonLibs/trx_vty.c | 375 |
1 files changed, 274 insertions, 101 deletions
diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c index 2c7ecc2..bd1b0ce 100644 --- a/CommonLibs/trx_vty.c +++ b/CommonLibs/trx_vty.c @@ -32,6 +32,7 @@ #include <osmocom/core/rate_ctr.h> #include <osmocom/vty/command.h> +#include <osmocom/vty/logging.h> #include <osmocom/vty/vty.h> #include <osmocom/vty/misc.h> @@ -41,22 +42,41 @@ static struct trx_ctx* g_trx_ctx; -static const struct value_string clock_ref_names[] = { +const struct value_string clock_ref_names[] = { { REF_INTERNAL, "internal" }, { REF_EXTERNAL, "external" }, { REF_GPS, "gpsdo" }, { 0, NULL } }; -static const struct value_string filler_names[] = { - { FILLER_DUMMY, "Dummy bursts" }, - { FILLER_ZERO, "Disabled" }, - { FILLER_NORM_RAND, "Normal bursts with random payload" }, - { FILLER_EDGE_RAND, "EDGE bursts with random payload" }, - { FILLER_ACCESS_RAND, "Access bursts with random payload" }, +const struct value_string filler_names[] = { + { FILLER_DUMMY, "Dummy bursts (C0 only)" }, + { FILLER_ZERO, "Empty bursts" }, + { FILLER_NORM_RAND, "GMSK Normal Bursts with random payload" }, + { FILLER_EDGE_RAND, "8-PSK Normal Bursts with random payload" }, + { FILLER_ACCESS_RAND, "Access Bursts with random payload" }, { 0, NULL } }; +static const struct value_string filler_types[] = { + { FILLER_DUMMY, "dummy" }, + { FILLER_ZERO, "zero" }, + { FILLER_NORM_RAND, "random-nb-gmsk" }, + { FILLER_EDGE_RAND, "random-nb-8psk" }, + { FILLER_ACCESS_RAND, "random-ab" }, + { 0, NULL } +}; + +static const struct value_string filler_docs[] = { + { FILLER_DUMMY, "Send a Dummy Burst on C0 (TRX0) and empty burst on other channels" }, + { FILLER_ZERO, "Send an empty burst (default)" }, + { FILLER_NORM_RAND, "Send a GMSK modulated Normal Burst with random bits (spectrum mask testing)" }, + { FILLER_EDGE_RAND, "Send an 8-PSK modulated Normal Burst with random bits (spectrum mask testing)" }, + { FILLER_ACCESS_RAND, "Send an Access Burst with random bits (Rx/Tx alignment testing)" }, + { 0, NULL } +}; + + struct trx_ctx *trx_from_vty(struct vty *v) { /* It can't hurt to force callers to continue to pass the vty instance @@ -101,7 +121,7 @@ DEFUN(cfg_trx, cfg_trx_cmd, } DEFUN(cfg_bind_ip, cfg_bind_ip_cmd, - "bind-ip A.B.C.D", + "bind-ip " VTY_IPV4_CMD, "Set the IP address for the local bind\n" "IPv4 Address\n") { @@ -113,7 +133,7 @@ DEFUN(cfg_bind_ip, cfg_bind_ip_cmd, } DEFUN(cfg_remote_ip, cfg_remote_ip_cmd, - "remote-ip A.B.C.D", + "remote-ip " VTY_IPV4_CMD, "Set the IP address for the remote BTS\n" "IPv4 Address\n") { @@ -151,7 +171,9 @@ DEFUN(cfg_dev_args, cfg_dev_args_cmd, DEFUN(cfg_tx_sps, cfg_tx_sps_cmd, "tx-sps (1|4)", "Set the Tx Samples-per-Symbol\n" - "Tx Samples-per-Symbol\n") + "Tx Samples-per-Symbol\n" + "1 Sample-per-Symbol\n" + "4 Samples-per-Symbol\n") { struct trx_ctx *trx = trx_from_vty(vty); @@ -163,7 +185,9 @@ DEFUN(cfg_tx_sps, cfg_tx_sps_cmd, DEFUN(cfg_rx_sps, cfg_rx_sps_cmd, "rx-sps (1|4)", "Set the Rx Samples-per-Symbol\n" - "Rx Samples-per-Symbol\n") + "Rx Samples-per-Symbol\n" + "1 Sample-per-Symbol\n" + "4 Samples-per-Symbol\n") { struct trx_ctx *trx = trx_from_vty(vty); @@ -172,53 +196,6 @@ DEFUN(cfg_rx_sps, cfg_rx_sps_cmd, return CMD_SUCCESS; } -DEFUN(cfg_test_rtsc, cfg_test_rtsc_cmd, - "test rtsc <0-7>", - "Set the Random Normal Burst test mode with TSC\n" - "TSC\n") -{ - struct trx_ctx *trx = trx_from_vty(vty); - - if (trx->cfg.rach_delay_set) { - vty_out(vty, "rach-delay and rtsc options are mutual-exclusive%s", - VTY_NEWLINE); - return CMD_WARNING; - } - - trx->cfg.rtsc_set = true; - trx->cfg.rtsc = atoi(argv[0]); - if (!trx->cfg.egprs) /* Don't override egprs which sets different filler */ - trx->cfg.filler = FILLER_NORM_RAND; - - return CMD_SUCCESS; -} - -DEFUN(cfg_test_rach_delay, cfg_test_rach_delay_cmd, - "test rach-delay <0-68>", - "Set the Random Access Burst test mode with delay\n" - "RACH delay\n") -{ - struct trx_ctx *trx = trx_from_vty(vty); - - if (trx->cfg.rtsc_set) { - vty_out(vty, "rach-delay and rtsc options are mutual-exclusive%s", - VTY_NEWLINE); - return CMD_WARNING; - } - - if (trx->cfg.egprs) { - vty_out(vty, "rach-delay and egprs options are mutual-exclusive%s", - VTY_NEWLINE); - return CMD_WARNING; - } - - trx->cfg.rach_delay_set = true; - trx->cfg.rach_delay = atoi(argv[0]); - trx->cfg.filler = FILLER_ACCESS_RAND; - - return CMD_SUCCESS; -} - DEFUN(cfg_clock_ref, cfg_clock_ref_cmd, "clock-ref (internal|external|gpsdo)", "Set the Reference Clock\n" @@ -235,7 +212,8 @@ DEFUN(cfg_clock_ref, cfg_clock_ref_cmd, DEFUN(cfg_multi_arfcn, cfg_multi_arfcn_cmd, "multi-arfcn (disable|enable)", - "Enable multi-ARFCN transceiver (default=disable)\n") + "Multi-ARFCN transceiver mode (default=disable)\n" + "Enable multi-ARFCN mode\n" "Disable multi-ARFCN mode\n") { struct trx_ctx *trx = trx_from_vty(vty); @@ -266,21 +244,125 @@ DEFUN(cfg_offset, cfg_offset_cmd, return CMD_SUCCESS; } +DEFUN_ATTR(cfg_freq_offset, cfg_freq_offset_cmd, + "freq-offset FLOAT", + "Apply an artificial offset to Rx/Tx carrier frequency\n" + "Frequency offset in kHz (e.g. -145300)\n", + CMD_ATTR_HIDDEN) +{ + struct trx_ctx *trx = trx_from_vty(vty); + + trx->cfg.freq_offset_khz = atof(argv[0]); + + return CMD_SUCCESS; +} + DEFUN(cfg_rssi_offset, cfg_rssi_offset_cmd, - "rssi-offset FLOAT", + "rssi-offset FLOAT [relative]", "Set the RSSI to dBm offset in dB (default=0)\n" - "RSSI to dBm offset in dB\n") + "RSSI to dBm offset in dB\n" + "Add to the default rssi-offset value instead of completely replacing it\n") { struct trx_ctx *trx = trx_from_vty(vty); trx->cfg.rssi_offset = atof(argv[0]); + trx->cfg.force_rssi_offset = (argc == 1); + + return CMD_SUCCESS; +} + + +DEFUN_ATTR(cfg_ul_fn_offset, cfg_ul_fn_offset_cmd, + "ul-fn-offset <-10-10>", + "Adjusts the uplink frame FN by the specified amount\n" + "Frame Number offset\n", + CMD_ATTR_HIDDEN) +{ + struct trx_ctx *trx = trx_from_vty(vty); + + trx->cfg.ul_fn_offset = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN_ATTR(cfg_ul_freq_override, cfg_ul_freq_override_cmd, + "ul-freq-override FLOAT", + "Overrides Rx carrier frequency\n" + "Frequency in Hz (e.g. 145300000)\n", + CMD_ATTR_HIDDEN) +{ + struct trx_ctx *trx = trx_from_vty(vty); + + trx->cfg.overrides.ul_freq_override = true; + trx->cfg.overrides.ul_freq = atof(argv[0]); + + return CMD_SUCCESS; +} +DEFUN_ATTR(cfg_dl_freq_override, cfg_dl_freq_override_cmd, + "dl-freq-override FLOAT", + "Overrides Tx carrier frequency\n" + "Frequency in Hz (e.g. 145300000)\n", + CMD_ATTR_HIDDEN) +{ + struct trx_ctx *trx = trx_from_vty(vty); + + trx->cfg.overrides.dl_freq_override = true; + trx->cfg.overrides.dl_freq = atof(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN_ATTR(cfg_ul_gain_override, cfg_ul_gain_override_cmd, + "ul-gain-override FLOAT", + "Overrides Rx gain\n" + "gain in dB\n", + CMD_ATTR_HIDDEN) +{ + struct trx_ctx *trx = trx_from_vty(vty); + + trx->cfg.overrides.ul_gain_override = true; + trx->cfg.overrides.ul_gain = atof(argv[0]); + + return CMD_SUCCESS; +} +DEFUN_ATTR(cfg_dl_gain_override, cfg_dl_gain_override_cmd, + "dl-gain-override FLOAT", + "Overrides Tx gain\n" + "gain in dB\n", + CMD_ATTR_HIDDEN) +{ + struct trx_ctx *trx = trx_from_vty(vty); + + trx->cfg.overrides.dl_gain_override = true; + trx->cfg.overrides.dl_gain = atof(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN_ATTR(cfg_use_viterbi, cfg_use_viterbi_cmd, + "viterbi-eq (disable|enable)", + "Use viterbi equalizer for gmsk (default=disable)\n" + "Disable VA\n" + "Enable VA\n", + CMD_ATTR_HIDDEN) +{ + struct trx_ctx *trx = trx_from_vty(vty); + + if (strcmp("disable", argv[0]) == 0) + trx->cfg.use_va = false; + else if (strcmp("enable", argv[0]) == 0) + trx->cfg.use_va = true; + else + return CMD_WARNING; return CMD_SUCCESS; } DEFUN(cfg_swap_channels, cfg_swap_channels_cmd, "swap-channels (disable|enable)", - "Swap channels (default=disable)\n") + "Swap primary and secondary channels of the PHY (if any)\n" + "Do not swap primary and secondary channels (default)\n" + "Swap primary and secondary channels\n") { struct trx_ctx *trx = trx_from_vty(vty); @@ -297,7 +379,9 @@ DEFUN(cfg_swap_channels, cfg_swap_channels_cmd, DEFUN(cfg_egprs, cfg_egprs_cmd, "egprs (disable|enable)", - "Enable EDGE receiver (default=disable)\n") + "EGPRS (8-PSK demodulation) support (default=disable)\n" + "Disable EGPRS (8-PSK demodulation) support\n" + "Enable EGPRS (8-PSK demodulation) support\n") { struct trx_ctx *trx = trx_from_vty(vty); @@ -314,7 +398,9 @@ DEFUN(cfg_egprs, cfg_egprs_cmd, DEFUN(cfg_ext_rach, cfg_ext_rach_cmd, "ext-rach (disable|enable)", - "Enable extended (11-bit) RACH (default=disable)\n") + "11-bit Access Burst correlation support (default=disable)\n" + "Disable 11-bit Access Burst (TS1 & TS2) correlation\n" + "Enable 11-bit Access Burst (TS1 & TS2) correlation\n") { struct trx_ctx *trx = trx_from_vty(vty); @@ -327,7 +413,7 @@ DEFUN(cfg_ext_rach, cfg_ext_rach_cmd, return CMD_SUCCESS; } -DEFUN(cfg_rt_prio, cfg_rt_prio_cmd, +DEFUN_DEPRECATED(cfg_rt_prio, cfg_rt_prio_cmd, "rt-prio <1-32>", "Set the SCHED_RR real-time priority\n" "Real time priority\n") @@ -335,6 +421,8 @@ DEFUN(cfg_rt_prio, cfg_rt_prio_cmd, struct trx_ctx *trx = trx_from_vty(vty); trx->cfg.sched_rr = atoi(argv[0]); + vty_out (vty, "%% 'rt-prio %u' is deprecated, use 'policy rr %u' under 'sched' node instead%s", + trx->cfg.sched_rr, trx->cfg.sched_rr, VTY_NEWLINE); return CMD_SUCCESS; } @@ -351,14 +439,48 @@ DEFUN(cfg_stack_size, cfg_stack_size_cmd, return CMD_SUCCESS; } -DEFUN(cfg_filler, cfg_filler_cmd, - "filler dummy", - "Enable C0 filler table\n" - "Dummy method\n") +#define CFG_FILLER_DOC_STR \ + "Filler burst settings\n" + +DEFUN(cfg_filler, cfg_filler_type_cmd, + "AUTO-GENERATED", "AUTO-GENERATED") { struct trx_ctx *trx = trx_from_vty(vty); + // trx->cfg.filler is unsigned, so we need an interim int var to detect errors + int type = get_string_value(filler_types, argv[0]); - trx->cfg.filler = FILLER_DUMMY; + if (type < 0) { + trx->cfg.filler = FILLER_ZERO; + return CMD_WARNING; + } + trx->cfg.filler = type; + + return CMD_SUCCESS; +} + +DEFUN(cfg_test_rtsc, cfg_filler_tsc_cmd, + "filler tsc <0-7>", + CFG_FILLER_DOC_STR + "Set the TSC for GMSK/8-PSK Normal Burst random fillers. Used only with 'random-nb-gmsk' and" + " 'random-nb-8psk' filler types. (default=0)\n" + "TSC\n") +{ + struct trx_ctx *trx = trx_from_vty(vty); + + trx->cfg.rtsc = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_test_rach_delay, cfg_filler_rach_delay_cmd, + "filler access-burst-delay <0-68>", + CFG_FILLER_DOC_STR + "Set the delay for Access Burst random fillers. Used only with 'random-ab' filler type. (default=0)\n" + "RACH delay in symbols\n") +{ + struct trx_ctx *trx = trx_from_vty(vty); + + trx->cfg.rach_delay = atoi(argv[0]); return CMD_SUCCESS; } @@ -383,7 +505,7 @@ static int vty_intv_name_2_id(const char* str) { return -1; } -#define THRESHOLD_ARGS "(rx_overruns|tx_underruns|rx_drop_events|rx_drop_samples|tx_drop_events|tx_drop_samples)" +#define THRESHOLD_ARGS "(rx_overruns|tx_underruns|rx_drop_events|rx_drop_samples|tx_drop_events|tx_drop_samples|tx_stale_bursts|tx_unavailable_bursts|tx_trxd_fn_repeated|tx_trxd_fn_outoforder|tx_trxd_fn_skipped)" #define THRESHOLD_STR_VAL(s) "Set threshold value for rate_ctr device:" OSMO_STRINGIFY_VAL(s) "\n" #define THRESHOLD_STRS \ THRESHOLD_STR_VAL(rx_overruns) \ @@ -391,7 +513,13 @@ static int vty_intv_name_2_id(const char* str) { THRESHOLD_STR_VAL(rx_drop_events) \ THRESHOLD_STR_VAL(rx_drop_samples) \ THRESHOLD_STR_VAL(tx_drop_events) \ - THRESHOLD_STR_VAL(tx_drop_samples) + THRESHOLD_STR_VAL(tx_drop_samples) \ + THRESHOLD_STR_VAL(tx_stale_bursts) \ + THRESHOLD_STR_VAL(tx_unavailable_bursts) \ + THRESHOLD_STR_VAL(tx_trxd_fn_repeated) \ + THRESHOLD_STR_VAL(tx_trxd_fn_outoforder) \ + THRESHOLD_STR_VAL(tx_trxd_fn_skipped) \ + "" #define INTV_ARGS "(per-second|per-minute|per-hour|per-day)" #define INTV_STR_VAL(s) "Threshold value sampled " OSMO_STRINGIFY_VAL(s) "\n" #define INTV_STRS \ @@ -400,17 +528,17 @@ static int vty_intv_name_2_id(const char* str) { INTV_STR_VAL(per-hour) \ INTV_STR_VAL(per-day) -DEFUN(cfg_ctr_error_threshold, cfg_ctr_error_threshold_cmd, - "ctr-error-threshold " THRESHOLD_ARGS " <0-65535> " INTV_ARGS, - "Threshold rate for error counter\n" - THRESHOLD_STRS - "Value to set for threshold\n" - INTV_STRS) +DEFUN_ATTR(cfg_ctr_error_threshold, cfg_ctr_error_threshold_cmd, + "ctr-error-threshold " THRESHOLD_ARGS " <0-65535> " INTV_ARGS, + "Threshold rate for error counter\n" + THRESHOLD_STRS + "Value to set for threshold\n" + INTV_STRS, + CMD_ATTR_IMMEDIATE) { int rc; struct ctr_threshold ctr; - struct trx_ctx *trx = trx_from_vty(vty); rc = vty_ctr_name_2_id(argv[0]); if (rc < 0) { vty_out(vty, "No valid ctr_name found for ctr-error-threshold %s%s", @@ -431,17 +559,17 @@ DEFUN(cfg_ctr_error_threshold, cfg_ctr_error_threshold_cmd, return CMD_SUCCESS; } -DEFUN(cfg_no_ctr_error_threshold, cfg_no_ctr_error_threshold_cmd, - "no ctr-error-threshold " THRESHOLD_ARGS " <0-65535> " INTV_ARGS, - NO_STR "Threshold rate for error counter\n" - THRESHOLD_STRS - "Value to set for threshold\n" - INTV_STRS) +DEFUN_ATTR(cfg_no_ctr_error_threshold, cfg_no_ctr_error_threshold_cmd, + "no ctr-error-threshold " THRESHOLD_ARGS " <0-65535> " INTV_ARGS, + NO_STR "Threshold rate for error counter\n" + THRESHOLD_STRS + "Value to set for threshold\n" + INTV_STRS, + CMD_ATTR_IMMEDIATE) { int rc; struct ctr_threshold ctr; - struct trx_ctx *trx = trx_from_vty(vty); rc = vty_ctr_name_2_id(argv[0]); if (rc < 0) { vty_out(vty, "No valid ctr_name found for ctr-error-threshold %s%s", @@ -505,6 +633,12 @@ DEFUN(cfg_chan_rx_path, cfg_chan_rx_path_cmd, { struct trx_chan *chan = vty->index; + if (chan->trx->cfg.multi_arfcn && chan->idx > 0) { + vty_out(vty, "%% Setting 'rx-path' for chan %u in multi-ARFCN mode " + "does not make sense, because only chan 0 is used%s", + chan->idx, VTY_NEWLINE); + } + osmo_talloc_replace_string(chan->trx, &chan->rx_path, argv[0]); return CMD_SUCCESS; @@ -517,6 +651,12 @@ DEFUN(cfg_chan_tx_path, cfg_chan_tx_path_cmd, { struct trx_chan *chan = vty->index; + if (chan->trx->cfg.multi_arfcn && chan->idx > 0) { + vty_out(vty, "%% Setting 'tx-path' for chan %u in multi-ARFCN mode " + "does not make sense, because only chan 0 is used%s", + chan->idx, VTY_NEWLINE); + } + osmo_talloc_replace_string(chan->trx, &chan->tx_path, argv[0]); return CMD_SUCCESS; @@ -540,30 +680,47 @@ static int config_write_trx(struct vty *vty) vty_out(vty, " remote-ip %s%s", trx->cfg.remote_addr, VTY_NEWLINE); if (trx->cfg.base_port != DEFAULT_TRX_PORT) vty_out(vty, " base-port %u%s", trx->cfg.base_port, VTY_NEWLINE); - if (trx->cfg.dev_args) + if (strlen(trx->cfg.dev_args)) vty_out(vty, " dev-args %s%s", trx->cfg.dev_args, VTY_NEWLINE); if (trx->cfg.tx_sps != DEFAULT_TX_SPS) vty_out(vty, " tx-sps %u%s", trx->cfg.tx_sps, VTY_NEWLINE); if (trx->cfg.rx_sps != DEFAULT_RX_SPS) vty_out(vty, " rx-sps %u%s", trx->cfg.rx_sps, VTY_NEWLINE); - if (trx->cfg.rtsc_set) - vty_out(vty, " test rtsc %u%s", trx->cfg.rtsc, VTY_NEWLINE); - if (trx->cfg.rach_delay_set) - vty_out(vty, " test rach-delay %u%s", trx->cfg.rach_delay, VTY_NEWLINE); if (trx->cfg.clock_ref != REF_INTERNAL) vty_out(vty, " clock-ref %s%s", get_value_string(clock_ref_names, trx->cfg.clock_ref), VTY_NEWLINE); vty_out(vty, " multi-arfcn %s%s", trx->cfg.multi_arfcn ? "enable" : "disable", VTY_NEWLINE); if (trx->cfg.offset != 0) vty_out(vty, " offset %f%s", trx->cfg.offset, VTY_NEWLINE); - if (trx->cfg.rssi_offset != 0) - vty_out(vty, " rssi-offset %f%s", trx->cfg.rssi_offset, VTY_NEWLINE); + if (trx->cfg.freq_offset_khz != 0) + vty_out(vty, " freq-offset %f%s", trx->cfg.freq_offset_khz, VTY_NEWLINE); + if (!(trx->cfg.rssi_offset == 0 && !trx->cfg.force_rssi_offset)) + vty_out(vty, " rssi-offset %f%s%s", trx->cfg.rssi_offset, + trx->cfg.force_rssi_offset ? " relative": "", VTY_NEWLINE); vty_out(vty, " swap-channels %s%s", trx->cfg.swap_channels ? "enable" : "disable", VTY_NEWLINE); vty_out(vty, " egprs %s%s", trx->cfg.egprs ? "enable" : "disable", VTY_NEWLINE); vty_out(vty, " ext-rach %s%s", trx->cfg.ext_rach ? "enable" : "disable", VTY_NEWLINE); if (trx->cfg.sched_rr != 0) vty_out(vty, " rt-prio %u%s", trx->cfg.sched_rr, VTY_NEWLINE); + if (trx->cfg.filler != FILLER_ZERO) + vty_out(vty, " filler type %s%s", get_value_string(filler_types, trx->cfg.filler), VTY_NEWLINE); + if (trx->cfg.rtsc > 0) + vty_out(vty, " filler tsc %u%s", trx->cfg.rtsc, VTY_NEWLINE); + if (trx->cfg.rach_delay > 0) + vty_out(vty, " filler access-burst-delay %u%s", trx->cfg.rach_delay, VTY_NEWLINE); if (trx->cfg.stack_size != 0) vty_out(vty, " stack-size %u%s", trx->cfg.stack_size, VTY_NEWLINE); + if (trx->cfg.ul_fn_offset != 0) + vty_out(vty, " ul-fn-offset %d%s", trx->cfg.ul_fn_offset, VTY_NEWLINE); + if (trx->cfg.overrides.dl_freq_override) + vty_out(vty, " dl-freq-override %f%s", trx->cfg.overrides.dl_freq, VTY_NEWLINE); + if (trx->cfg.overrides.ul_freq_override) + vty_out(vty, " ul-freq-override %f%s", trx->cfg.overrides.ul_freq, VTY_NEWLINE); + if (trx->cfg.overrides.dl_gain_override) + vty_out(vty, " dl-gain-override %f%s", trx->cfg.overrides.dl_gain, VTY_NEWLINE); + if (trx->cfg.overrides.ul_gain_override) + vty_out(vty, " ul-gain-override %f%s", trx->cfg.overrides.ul_gain, VTY_NEWLINE); + if (trx->cfg.use_va) + vty_out(vty, " viterbi-eq %s%s", trx->cfg.use_va ? "enable" : "disable", VTY_NEWLINE); trx_rate_ctr_threshold_write_config(vty, " "); for (i = 0; i < trx->cfg.num_chans; i++) { @@ -589,11 +746,9 @@ static void trx_dump_vty(struct vty *vty, struct trx_ctx *trx) vty_out(vty, " Device args: %s%s", trx->cfg.dev_args, VTY_NEWLINE); vty_out(vty, " Tx Samples-per-Symbol: %u%s", trx->cfg.tx_sps, VTY_NEWLINE); vty_out(vty, " Rx Samples-per-Symbol: %u%s", trx->cfg.rx_sps, VTY_NEWLINE); - vty_out(vty, " Test Mode: TSC: %u (%s)%s", trx->cfg.rtsc, - trx->cfg.rtsc_set ? "Enabled" : "Disabled", VTY_NEWLINE); - vty_out(vty, " Test Mode: RACH Delay: %u (%s)%s", trx->cfg.rach_delay, - trx->cfg.rach_delay_set ? "Enabled" : "Disabled", VTY_NEWLINE); - vty_out(vty, " C0 Filler Table: %s%s", get_value_string(filler_names, trx->cfg.filler), VTY_NEWLINE); + vty_out(vty, " Filler Burst Type: %s%s", get_value_string(filler_names, trx->cfg.filler), VTY_NEWLINE); + vty_out(vty, " Filler Burst TSC: %u%s", trx->cfg.rtsc, VTY_NEWLINE); + vty_out(vty, " Filler Burst RACH Delay: %u%s", trx->cfg.rach_delay, VTY_NEWLINE); vty_out(vty, " Clock Reference: %s%s", get_value_string(clock_ref_names, trx->cfg.clock_ref), VTY_NEWLINE); vty_out(vty, " Multi-Carrier: %s%s", trx->cfg.multi_arfcn ? "Enabled" : "Disabled", VTY_NEWLINE); vty_out(vty, " Tuning offset: %f%s", trx->cfg.offset, VTY_NEWLINE); @@ -662,6 +817,7 @@ static int trx_vty_go_parent(struct vty *vty) static const char trx_copyright[] = "Copyright (C) 2007-2014 Free Software Foundation, Inc.\r\n" "Copyright (C) 2013 Thomas Tsou <tom@tsou.cc>\r\n" + "Copyright (C) 2013-2019 Fairwaves, Inc.\r\n" "Copyright (C) 2015 Ettus Research LLC\r\n" "Copyright (C) 2017-2018 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>\r\n" "License AGPLv3+: GNU AGPL version 3 or later <http://gnu.org/licenses/agpl-3.0.html>\r\n" @@ -686,12 +842,20 @@ struct trx_ctx *vty_trx_ctx_alloc(void *talloc_ctx) trx->cfg.tx_sps = DEFAULT_TX_SPS; trx->cfg.rx_sps = DEFAULT_RX_SPS; trx->cfg.filler = FILLER_ZERO; + trx->cfg.rssi_offset = 0.0f; + trx->cfg.dev_args = talloc_strdup(trx, ""); return trx; } int trx_vty_init(struct trx_ctx* trx) { + cfg_filler_type_cmd.string = vty_cmd_string_from_valstr(trx, filler_types, + "filler type (", "|", ")", 0); + cfg_filler_type_cmd.doc = vty_cmd_string_from_valstr(trx, filler_docs, + CFG_FILLER_DOC_STR "What to do when there is nothing to send " + "(filler type, default=zero)\n", "\n", "", 0); + g_trx_ctx = trx; install_element_ve(&show_trx_cmd); @@ -704,25 +868,34 @@ int trx_vty_init(struct trx_ctx* trx) install_element(TRX_NODE, &cfg_dev_args_cmd); install_element(TRX_NODE, &cfg_tx_sps_cmd); install_element(TRX_NODE, &cfg_rx_sps_cmd); - install_element(TRX_NODE, &cfg_test_rtsc_cmd); - install_element(TRX_NODE, &cfg_test_rach_delay_cmd); install_element(TRX_NODE, &cfg_clock_ref_cmd); install_element(TRX_NODE, &cfg_multi_arfcn_cmd); install_element(TRX_NODE, &cfg_offset_cmd); + install_element(TRX_NODE, &cfg_freq_offset_cmd); install_element(TRX_NODE, &cfg_rssi_offset_cmd); install_element(TRX_NODE, &cfg_swap_channels_cmd); install_element(TRX_NODE, &cfg_egprs_cmd); install_element(TRX_NODE, &cfg_ext_rach_cmd); install_element(TRX_NODE, &cfg_rt_prio_cmd); - install_element(TRX_NODE, &cfg_filler_cmd); + install_element(TRX_NODE, &cfg_filler_type_cmd); + install_element(TRX_NODE, &cfg_filler_tsc_cmd); + install_element(TRX_NODE, &cfg_filler_rach_delay_cmd); install_element(TRX_NODE, &cfg_ctr_error_threshold_cmd); install_element(TRX_NODE, &cfg_no_ctr_error_threshold_cmd); install_element(TRX_NODE, &cfg_stack_size_cmd); install_element(TRX_NODE, &cfg_chan_cmd); + install_element(TRX_NODE, &cfg_ul_fn_offset_cmd); + install_element(TRX_NODE, &cfg_ul_freq_override_cmd); + install_element(TRX_NODE, &cfg_dl_freq_override_cmd); + install_element(TRX_NODE, &cfg_ul_gain_override_cmd); + install_element(TRX_NODE, &cfg_dl_gain_override_cmd); + install_element(TRX_NODE, &cfg_use_viterbi_cmd); install_node(&chan_node, dummy_config_write); install_element(CHAN_NODE, &cfg_chan_rx_path_cmd); install_element(CHAN_NODE, &cfg_chan_tx_path_cmd); + logging_vty_add_deprecated_subsys(g_trx_ctx, "lms"); + return 0; } |