[M] Change in osmo-bts[master]: osmo-bts-trx: add test VTY command to send arbitrary TRXC messages

2024-01-24 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/35654?usp=email )

Change subject: osmo-bts-trx: add test VTY command to send arbitrary TRXC 
messages
..

osmo-bts-trx: add test VTY command to send arbitrary TRXC messages

Change-Id: Iabc9b702e5f1513187e24f45d9ffe06ea940c3ec
---
M src/osmo-bts-trx/trx_if.c
M src/osmo-bts-trx/trx_if.h
M src/osmo-bts-trx/trx_vty.c
3 files changed, 50 insertions(+), 3 deletions(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index 89078a3..b6b20e9 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -227,8 +227,8 @@
  *  The new command will be added to the end of the control command
  *  queue.
  */
-static int trx_ctrl_cmd_cb(struct trx_l1h *l1h, int critical, void *cb, const 
char *cmd,
-   const char *fmt, ...)
+int trx_ctrl_cmd_cb(struct trx_l1h *l1h, int critical, void *cb,
+   const char *cmd, const char *fmt, ...)
 {
struct trx_ctrl_msg *tcm;
struct trx_ctrl_msg *prev = NULL;
@@ -277,7 +277,6 @@

return 0;
 }
-#define trx_ctrl_cmd(l1h, critical, cmd, fmt, ...) trx_ctrl_cmd_cb(l1h, 
critical, NULL, cmd, fmt, ##__VA_ARGS__)

 /*! Send "POWEROFF" command to TRX */
 int trx_if_cmd_poweroff(struct trx_l1h *l1h, trx_if_cmd_poweronoff_cb *cb)
diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h
index b838b76..3a22a1b 100644
--- a/src/osmo-bts-trx/trx_if.h
+++ b/src/osmo-bts-trx/trx_if.h
@@ -48,3 +48,7 @@

 /* Format negotiation command */
 int trx_if_cmd_setformat(struct trx_l1h *l1h, uint8_t ver, 
trx_if_cmd_generic_cb *cb);
+
+int trx_ctrl_cmd_cb(struct trx_l1h *l1h, int critical, void *cb,
+   const char *cmd, const char *fmt, ...);
+#define trx_ctrl_cmd(l1h, critical, cmd, fmt, ...) trx_ctrl_cmd_cb(l1h, 
critical, NULL, cmd, fmt, ##__VA_ARGS__)
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index 998e9cb..9056f02 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -194,6 +194,39 @@
return CMD_SUCCESS;
 }

+DEFUN_HIDDEN(test_send_trxc,
+test_send_trxc_cmd,
+"test send-trxc-cmd <0-255> CMD [.ARGS]",
+"Various testing commands\n"
+"Send an arbitrary TRX command\n"
+"Transceiver number\n"
+"TRXC command\n" "TRXC command arguments\n")
+{
+   const struct gsm_bts_trx *trx;
+   const struct phy_instance *pinst;
+   struct trx_l1h *l1h;
+   int rc;
+
+   trx = gsm_bts_trx_num(g_bts, atoi(argv[0]));
+   if (trx == NULL) {
+   vty_out(vty, "%% Could not find TRX%s", VTY_NEWLINE);
+   return CMD_WARNING;
+   }
+
+   pinst = trx_phy_instance(trx);
+   l1h = pinst->u.osmotrx.hdl;
+
+   if (argc > 2) {
+   char *cmd_args = argv_concat(argv, argc, 2);
+   rc = trx_ctrl_cmd(l1h, 0, argv[1], "%s", cmd_args);
+   talloc_free(cmd_args);
+   } else {
+   rc = trx_ctrl_cmd(l1h, 0, argv[1], "");
+   }
+
+   return (rc == 0) ? CMD_SUCCESS : CMD_WARNING;
+}
+
 DEFUN_USRATTR(cfg_trx_nominal_power, cfg_trx_nominal_power_cmd,
  X(BTS_VTY_TRX_POWERCYCLE),
  "nominal-tx-power <-10-100>",
@@ -630,6 +663,8 @@
install_element_ve(_transceiver_cmd);
install_element_ve(_phy_cmd);

+   install_element(ENABLE_NODE, _send_trxc_cmd);
+
install_element(TRX_NODE, _trx_nominal_power_cmd);
install_element(TRX_NODE, _trx_no_nominal_power_cmd);


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iabc9b702e5f1513187e24f45d9ffe06ea940c3ec
Gerrit-Change-Number: 35654
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[M] Change in osmo-bts[master]: osmo-bts-trx: add test VTY command to send arbitrary TRXC messages

2024-01-24 Thread laforge
Attention is currently required from: fixeria.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/35654?usp=email )

Change subject: osmo-bts-trx: add test VTY command to send arbitrary TRXC 
messages
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iabc9b702e5f1513187e24f45d9ffe06ea940c3ec
Gerrit-Change-Number: 35654
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Wed, 24 Jan 2024 08:47:53 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: osmo-bts-trx: add test VTY command to send arbitrary TRXC messages

2024-01-23 Thread pespin
Attention is currently required from: fixeria.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/35654?usp=email )

Change subject: osmo-bts-trx: add test VTY command to send arbitrary TRXC 
messages
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iabc9b702e5f1513187e24f45d9ffe06ea940c3ec
Gerrit-Change-Number: 35654
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Tue, 23 Jan 2024 10:09:44 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: osmo-bts-trx: add test VTY command to send arbitrary TRXC messages

2024-01-22 Thread fixeria
fixeria has uploaded a new patch set (#2). ( 
https://gerrit.osmocom.org/c/osmo-bts/+/35654?usp=email )


Change subject: osmo-bts-trx: add test VTY command to send arbitrary TRXC 
messages
..

osmo-bts-trx: add test VTY command to send arbitrary TRXC messages

Change-Id: Iabc9b702e5f1513187e24f45d9ffe06ea940c3ec
---
M src/osmo-bts-trx/trx_if.c
M src/osmo-bts-trx/trx_if.h
M src/osmo-bts-trx/trx_vty.c
3 files changed, 50 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/54/35654/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/35654?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iabc9b702e5f1513187e24f45d9ffe06ea940c3ec
Gerrit-Change-Number: 35654
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset


[M] Change in osmo-bts[master]: osmo-bts-trx: add test VTY command to send arbitrary TRXC messages

2024-01-22 Thread Jenkins Builder
Jenkins Builder has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/35654?usp=email )

Change subject: osmo-bts-trx: add test VTY command to send arbitrary TRXC 
messages
..


Patch Set 1:

(1 comment)

File src/osmo-bts-trx/trx_vty.c:

Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13787):
https://gerrit.osmocom.org/c/osmo-bts/+/35654/comment/54cc0aaa_0671ae4d
PS1, Line 212:  vty_out(vty, "%% Cound not find TRX%s", VTY_NEWLINE);
'Cound' may be misspelled - perhaps 'Could'?



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iabc9b702e5f1513187e24f45d9ffe06ea940c3ec
Gerrit-Change-Number: 35654
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Mon, 22 Jan 2024 20:54:36 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmo-bts[master]: osmo-bts-trx: add test VTY command to send arbitrary TRXC messages

2024-01-22 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/35654?usp=email )


Change subject: osmo-bts-trx: add test VTY command to send arbitrary TRXC 
messages
..

osmo-bts-trx: add test VTY command to send arbitrary TRXC messages

Change-Id: Iabc9b702e5f1513187e24f45d9ffe06ea940c3ec
---
M src/osmo-bts-trx/trx_if.c
M src/osmo-bts-trx/trx_if.h
M src/osmo-bts-trx/trx_vty.c
3 files changed, 50 insertions(+), 3 deletions(-)



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

diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index 89078a3..b6b20e9 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -227,8 +227,8 @@
  *  The new command will be added to the end of the control command
  *  queue.
  */
-static int trx_ctrl_cmd_cb(struct trx_l1h *l1h, int critical, void *cb, const 
char *cmd,
-   const char *fmt, ...)
+int trx_ctrl_cmd_cb(struct trx_l1h *l1h, int critical, void *cb,
+   const char *cmd, const char *fmt, ...)
 {
struct trx_ctrl_msg *tcm;
struct trx_ctrl_msg *prev = NULL;
@@ -277,7 +277,6 @@

return 0;
 }
-#define trx_ctrl_cmd(l1h, critical, cmd, fmt, ...) trx_ctrl_cmd_cb(l1h, 
critical, NULL, cmd, fmt, ##__VA_ARGS__)

 /*! Send "POWEROFF" command to TRX */
 int trx_if_cmd_poweroff(struct trx_l1h *l1h, trx_if_cmd_poweronoff_cb *cb)
diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h
index b838b76..3a22a1b 100644
--- a/src/osmo-bts-trx/trx_if.h
+++ b/src/osmo-bts-trx/trx_if.h
@@ -48,3 +48,7 @@

 /* Format negotiation command */
 int trx_if_cmd_setformat(struct trx_l1h *l1h, uint8_t ver, 
trx_if_cmd_generic_cb *cb);
+
+int trx_ctrl_cmd_cb(struct trx_l1h *l1h, int critical, void *cb,
+   const char *cmd, const char *fmt, ...);
+#define trx_ctrl_cmd(l1h, critical, cmd, fmt, ...) trx_ctrl_cmd_cb(l1h, 
critical, NULL, cmd, fmt, ##__VA_ARGS__)
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index 998e9cb..f132937 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -194,6 +194,39 @@
return CMD_SUCCESS;
 }

+DEFUN_HIDDEN(test_send_trxc,
+test_send_trxc_cmd,
+"test send-trxc-cmd <0-255> CMD [.ARGS]",
+"Various testing commands\n"
+"Send an arbitrary TRX command\n"
+"Transceiver number\n"
+"TRXC command\n" "TRXC command arguments\n")
+{
+   const struct gsm_bts_trx *trx;
+   const struct phy_instance *pinst;
+   struct trx_l1h *l1h;
+   int rc;
+
+   trx = gsm_bts_trx_num(g_bts, atoi(argv[0]));
+   if (trx == NULL) {
+   vty_out(vty, "%% Cound not find TRX%s", VTY_NEWLINE);
+   return CMD_WARNING;
+   }
+
+   pinst = trx_phy_instance(trx);
+   l1h = pinst->u.osmotrx.hdl;
+
+   if (argc > 2) {
+   char *cmd_args = argv_concat(argv, argc, 2);
+   rc = trx_ctrl_cmd(l1h, 0, argv[1], "%s", cmd_args);
+   talloc_free(cmd_args);
+   } else {
+   rc = trx_ctrl_cmd(l1h, 0, argv[1], "");
+   }
+
+   return (rc == 0) ? CMD_SUCCESS : CMD_WARNING;
+}
+
 DEFUN_USRATTR(cfg_trx_nominal_power, cfg_trx_nominal_power_cmd,
  X(BTS_VTY_TRX_POWERCYCLE),
  "nominal-tx-power <-10-100>",
@@ -630,6 +663,8 @@
install_element_ve(_transceiver_cmd);
install_element_ve(_phy_cmd);
 
+   install_element(ENABLE_NODE, _send_trxc_cmd);
+
install_element(TRX_NODE, _trx_nominal_power_cmd);
install_element(TRX_NODE, _trx_no_nominal_power_cmd);


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iabc9b702e5f1513187e24f45d9ffe06ea940c3ec
Gerrit-Change-Number: 35654
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange