fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/43631?usp=email )
Change subject: proxy: make max TRXD PDU version VTY-configurable ......................................................................
proxy: make max TRXD PDU version VTY-configurable
Change-Id: Ibd384ee57a728b709b1e43726b46c8c3840b5535 Related: OS#6672 --- M proxy/include/osmocom/proxy/trx.h M proxy/src/ctrl_cmd.c M proxy/src/trx.c M proxy/src/vty.c 4 files changed, 21 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/31/43631/1
diff --git a/proxy/include/osmocom/proxy/trx.h b/proxy/include/osmocom/proxy/trx.h index de46e9a..13ca697 100644 --- a/proxy/include/osmocom/proxy/trx.h +++ b/proxy/include/osmocom/proxy/trx.h @@ -70,6 +70,7 @@ struct osmo_trx_ep *ep; bool powered; /*!< POWERON/POWEROFF applies to all channels at once */ int tx_power; /*!< dBm, nominal Tx power (path_sim_state::tx_power) */ + uint8_t trxd_max_ver; /*!< highest TRXD PDU version SETFORMAT may negotiate */ unsigned int num_chans; /*!< mirrors osmo_trx_ep_get_num_chans(ep) */ struct proxy_trx_chan *chans; /*!< array of num_chans entries, allocated on open */ }; diff --git a/proxy/src/ctrl_cmd.c b/proxy/src/ctrl_cmd.c index fb163e7..8f123f1 100644 --- a/proxy/src/ctrl_cmd.c +++ b/proxy/src/ctrl_cmd.c @@ -281,8 +281,8 @@ return; }
- if (ver_req > OSMO_TRXD_PDU_VER_MAX) - ver_req = OSMO_TRXD_PDU_VER_MAX; + if (ver_req > trx->trxd_max_ver) + ver_req = trx->trxd_max_ver;
osmo_trx_ep_set_pdu_ver(trx->ep, chan, ver_req); rsp->status = ver_req; diff --git a/proxy/src/trx.c b/proxy/src/trx.c index 96e9fea..ffcd2c2 100644 --- a/proxy/src/trx.c +++ b/proxy/src/trx.c @@ -53,6 +53,7 @@
trx->name = talloc_strdup(trx, name); trx->tx_power = PROXY_TRX_DEFAULT_TX_POWER; + trx->trxd_max_ver = OSMO_TRXD_PDU_VER_MAX; trx->ep = osmo_trx_ep_alloc(trx, num_chans); if (trx->ep == NULL) { talloc_free(trx); diff --git a/proxy/src/vty.c b/proxy/src/vty.c index ab53147..c5fe6b7 100644 --- a/proxy/src/vty.c +++ b/proxy/src/vty.c @@ -292,6 +292,20 @@ return CMD_SUCCESS; }
+DEFUN(cfg_ep_trxd_max_version, + cfg_ep_trxd_max_version_cmd, + "trxd-max-version <0-" OSMO_STRINGIFY_VAL(OSMO_TRXD_PDU_VER_MAX) ">", + "Set the highest TRXD PDU version SETFORMAT may negotiate " + "(default: " OSMO_STRINGIFY_VAL(OSMO_TRXD_PDU_VER_MAX) ")\n" + "TRXD PDU version\n") +{ + struct proxy_trx *trx = vty->index; + + trx->trxd_max_ver = atoi(argv[0]); + + return CMD_SUCCESS; +} + DEFUN(cfg_ep_clock_socket, cfg_ep_clock_socket_cmd, "clock-socket", @@ -345,6 +359,8 @@ vty_out(vty, " base-port %u%s", osmo_trx_ep_get_base_port(trx->ep), VTY_NEWLINE); vty_out(vty, " num-chans %u%s", trx->num_chans, VTY_NEWLINE); vty_out(vty, " tx-power %d%s", trx->tx_power, VTY_NEWLINE); + if (trx->trxd_max_ver < OSMO_TRXD_PDU_VER_MAX) + vty_out(vty, " trxd-max-version %u%s", trx->trxd_max_ver, VTY_NEWLINE);
if (!osmo_trx_ep_get_clock_socket(trx->ep)) vty_out(vty, " no clock-socket%s", VTY_NEWLINE); @@ -450,6 +466,7 @@ install_element(EP_NODE, &cfg_ep_base_port_cmd); install_element(EP_NODE, &cfg_ep_num_chans_cmd); install_element(EP_NODE, &cfg_ep_tx_power_cmd); + install_element(EP_NODE, &cfg_ep_trxd_max_version_cmd); install_element(EP_NODE, &cfg_ep_clock_socket_cmd); install_element(EP_NODE, &cfg_ep_no_clock_socket_cmd);