laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34615?usp=email )

Change subject: ASCI: Add VTY command to display group call neighbor cells
......................................................................

ASCI: Add VTY command to display group call neighbor cells

Related: OS#5782
Change-Id: Ie84221507bdf247c1563b829d6cf0adb53ce161f
---
M src/host/layer23/include/osmocom/bb/common/sysinfo.h
M src/host/layer23/src/common/sysinfo.c
M src/host/layer23/src/mobile/vty_interface.c
3 files changed, 70 insertions(+), 2 deletions(-)

Approvals:
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/src/host/layer23/include/osmocom/bb/common/sysinfo.h 
b/src/host/layer23/include/osmocom/bb/common/sysinfo.h
index 7b118ca..89d38ac 100644
--- a/src/host/layer23/include/osmocom/bb/common/sysinfo.h
+++ b/src/host/layer23/include/osmocom/bb/common/sysinfo.h
@@ -185,6 +185,7 @@
 int gsm48_sysinfo_dump(const struct gsm48_sysinfo *s, uint16_t arfcn,
                       void (*print)(void *, const char *, ...),
                       void *priv, uint8_t *freq_map);
+int gsm48_si10_dump(const struct gsm48_sysinfo *s, void (*print)(void *, const 
char *, ...), void *priv);
 int gsm48_decode_lai(struct gsm48_loc_area_id *lai, uint16_t *mcc,
        uint16_t *mnc, uint16_t *lac);
 int gsm48_decode_chan_h0(const struct gsm48_chan_desc *cd,
diff --git a/src/host/layer23/src/common/sysinfo.c 
b/src/host/layer23/src/common/sysinfo.c
index a728eb4..356f8eb 100644
--- a/src/host/layer23/src/common/sysinfo.c
+++ b/src/host/layer23/src/common/sysinfo.c
@@ -311,6 +311,48 @@
        return 0;
 }

+int gsm48_si10_dump(const struct gsm48_sysinfo *s, void (*print)(void *, const 
char *, ...), void *priv)
+{
+       const struct si10_cell_info *c;
+       int i;
+
+       if (!s || !s->si10) {
+               print(priv, "No group channel neighbor information 
available.\n");
+               return 0;
+       }
+
+       if (!s->si10_cell_num) {
+               print(priv, "No group channel neighbors exist.\n");
+               return 0;
+       }
+
+       /* Group call neighbor cells. */
+       print(priv, "Group channel neighbor cells (current or last call):\n");
+       for (i = 0; i < s->si10_cell_num; i++) {
+               c = &s->si10_cell[i];
+               print(priv, " index = %d", c->index);
+               if (c->arfcn >= 0)
+                       print(priv, " ARFCN = %d", c->arfcn);
+               else
+                       print(priv, " ARFCN = not in SI5*");
+               print(priv, "  BSIC = %d,%d", c->bsic >> 3, c->bsic & 0x7);
+               if (c->barred) {
+                       print(priv, "  barred");
+                       continue;
+               }
+               if (c->la_different)
+                       print(priv, "  CRH = %d", c->cell_resel_hyst_db);
+               print(priv, "  MS_TXPWR_MAX_CCCH = %d\n", c->ms_txpwr_max_cch);
+               print(priv, "  RXLEV_MIN = %d", c->rxlev_acc_min_db);
+               print(priv, "  CRO = %d", c->cell_resel_offset);
+               print(priv, "  TEMP_OFFSET = %d", c->temp_offset);
+               print(priv, "  PENALTY_TIME = %d", c->penalty_time);
+       }
+       print(priv, "\n");
+
+       return 0;
+}
+
 /*
  * decoding
  */
diff --git a/src/host/layer23/src/mobile/vty_interface.c 
b/src/host/layer23/src/mobile/vty_interface.c
index a4b97bc..2a09608 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -373,10 +373,10 @@
        return CMD_SUCCESS;
 }

-#define ASCI_STR SHOW_STR "Display information about ASCI items\nName of MS 
(see \"show ms\")\n"
+#define SHOW_ASCI_STR SHOW_STR "Display information about ASCI items\nName of 
MS (see \"show ms\")\n"

 DEFUN(show_asci_calls, show_asci_calls_cmd, "show asci MS_NAME calls",
-       ASCI_STR "Display ongoing ASCI calls")
+       SHOW_ASCI_STR "Display ongoing ASCI calls")
 {
        struct osmocom_ms *ms;

@@ -389,6 +389,20 @@
        return CMD_SUCCESS;
 }

+DEFUN(show_asci_neighbors, show_asci_neighbors_cmd, "show asci MS_NAME 
neighbors",
+       SHOW_ASCI_STR "Display neigbor cells of ongoing or last ASCI call")
+{
+       struct osmocom_ms *ms;
+
+       ms = l23_vty_get_ms(argv[0], vty);
+       if (!ms)
+               return CMD_WARNING;
+
+       gsm48_si10_dump(ms->cellsel.si, l23_vty_printf, vty);
+
+       return CMD_SUCCESS;
+}
+
 DEFUN(monitor_network, monitor_network_cmd, "monitor network MS_NAME",
        "Monitor...\nMonitor network information\nName of MS (see \"show ms\")")
 {
@@ -2484,6 +2498,7 @@
        install_element_ve(&show_forb_la_cmd);
        install_element_ve(&show_forb_plmn_cmd);
        install_element_ve(&show_asci_calls_cmd);
+       install_element_ve(&show_asci_neighbors_cmd);
        install_element_ve(&monitor_network_cmd);
        install_element_ve(&no_monitor_network_cmd);
        install_element(ENABLE_NODE, &off_cmd);

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ie84221507bdf247c1563b829d6cf0adb53ce161f
Gerrit-Change-Number: 34615
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <andr...@eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to