pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/33645 )

Change subject: ctrl: Add getting si2quater earfcn neighbor list
......................................................................

ctrl: Add getting si2quater earfcn neighbor list

Change-Id: Ib942bfa95aca2b514ac68f602545b9e7cbed097a
---
M src/osmo-bsc/bts_ctrl.c
1 file changed, 49 insertions(+), 0 deletions(-)

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




diff --git a/src/osmo-bsc/bts_ctrl.c b/src/osmo-bsc/bts_ctrl.c
index 2589668..9415b89 100644
--- a/src/osmo-bsc/bts_ctrl.c
+++ b/src/osmo-bsc/bts_ctrl.c
@@ -36,6 +36,8 @@
 #include <osmocom/bsc/neighbor_ident.h>
 #include <osmocom/bsc/system_information.h>

+#include <osmocom/gsm/sysinfo.h>
+
 static int location_equal(struct bts_location *a, struct bts_location *b)
 {
        return ((a->tstamp == b->tstamp) && (a->valid == b->valid) && (a->lat 
== b->lat) &&
@@ -1148,6 +1150,43 @@

 CTRL_CMD_DEFINE_RO(bts_neighbor_list_si2quater_uarfcn, "neighbor-list 
si2quater uarfcns");

+/* Return space concatenated set of tuples 
<EARFCN>,<thresh-hi>,<thresh-lo>,<prio>,<qrxlv>,<meas> */
+static int get_bts_neighbor_list_si2quater_earfcn(struct ctrl_cmd *cmd, void 
*data)
+{
+       int i;
+       bool first_earfcn = true;
+       const struct gsm_bts *bts = cmd->node;
+       const struct osmo_earfcn_si2q *neighbors = 
&bts->si_common.si2quater_neigh_list;
+
+       cmd->reply = talloc_strdup(cmd, "");
+       if (!cmd->reply) {
+               cmd->reply = "OOM";
+               return CTRL_CMD_ERROR;
+       }
+
+       for (i = 0; i < MAX_EARFCN_LIST; i++) {
+               if (neighbors->arfcn[i] == OSMO_EARFCN_INVALID)
+                       continue;
+               cmd->reply = talloc_asprintf_append(cmd->reply,
+                                       first_earfcn ? "%u,%u,%u,%u,%u,%u" : " 
%u,%u,%u,%u,%u,%u",
+                                       neighbors->arfcn[i],
+                                       neighbors->thresh_hi,
+                                       neighbors->thresh_lo_valid ? 
neighbors->thresh_lo : 32,
+                                       neighbors->prio_valid ? neighbors->prio 
: 8,
+                                       neighbors->qrxlm_valid ? 
neighbors->qrxlm : 32,
+                                       (neighbors->meas_bw[i] != 
OSMO_EARFCN_MEAS_INVALID) ? neighbors->meas_bw[i] : 8);
+               if (!cmd->reply) {
+                       cmd->reply = "OOM";
+                       return CTRL_CMD_ERROR;
+               }
+               first_earfcn = false;
+       }
+
+       return CTRL_CMD_REPLY;
+}
+
+CTRL_CMD_DEFINE_RO(bts_neighbor_list_si2quater_earfcn, "neighbor-list 
si2quater earfcns");
+
 int bsc_bts_ctrl_cmds_install(void)
 {
        int rc = 0;
@@ -1184,6 +1223,7 @@
        rc |= ctrl_cmd_install(CTRL_NODE_BTS, 
&cmd_bts_rach_access_control_class_bar);
        rc |= ctrl_cmd_install(CTRL_NODE_BTS, 
&cmd_bts_rach_access_control_class_allow);
        rc |= ctrl_cmd_install(CTRL_NODE_BTS, 
&cmd_bts_neighbor_list_si2quater_uarfcn);
+       rc |= ctrl_cmd_install(CTRL_NODE_BTS, 
&cmd_bts_neighbor_list_si2quater_earfcn);

        rc |= neighbor_ident_ctrl_init();


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib942bfa95aca2b514ac68f602545b9e7cbed097a
Gerrit-Change-Number: 33645
Gerrit-PatchSet: 3
Gerrit-Owner: matanp <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to