<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/21164">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bts: add repeated acch mode flags + vty config<br><br>To be able to control the FACCH/SACCH repetition behavior inside the<br>BTS a one byte flag is sent to the BTS together with the<br>RSL_IE_OSMO_REP_ACCH_CAP IE. This patch adds the necessary VTY commands.<br>The sending of the flag is implemented in a follow-up patch.<br><br>See also: I39ae439d05562b35b2e47774dc92f8789fea1a57<br><br>Related: SYS#5114, OS#4796, OS#4794, OS#4795<br>Depends: libosmocore I6dda239e9cd7033297bed1deb5eb1d9f87b8433f<br>Change-Id: I083eaa2c30478912426e9c24a506f0b88836e190<br>---<br>M include/osmocom/bsc/bts.h<br>M src/osmo-bsc/bsc_vty.c<br>M src/osmo-bsc/bts.c<br>3 files changed, 164 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h</span><br><span>index fd2ac32..22839d6 100644</span><br><span>--- a/include/osmocom/bsc/bts.h</span><br><span>+++ b/include/osmocom/bsc/bts.h</span><br><span>@@ -480,6 +480,10 @@</span><br><span> </span><br><span>      struct llist_head oml_fail_rep;</span><br><span>      struct llist_head chan_rqd_queue;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* osmocom specific FACCH/SACCH repetition mode flags set by VTY to</span><br><span style="color: hsl(120, 100%, 40%);">+    * enable/disable certain ACCH repeation features individually */</span><br><span style="color: hsl(120, 100%, 40%);">+     struct abis_rsl_osmo_rep_acch_cap repeated_acch_policy;</span><br><span> };</span><br><span> </span><br><span> #define GSM_BTS_SI2Q(bts, i)   (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater][i])</span><br><span>diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c</span><br><span>index d8e9682..846339d 100644</span><br><span>--- a/src/osmo-bsc/bsc_vty.c</span><br><span>+++ b/src/osmo-bsc/bsc_vty.c</span><br><span>@@ -1115,6 +1115,19 @@</span><br><span> </span><br><span>    ho_vty_write_bts(vty, bts);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+       if (bts->repeated_acch_policy.dl_facch_all)</span><br><span style="color: hsl(120, 100%, 40%);">+                vty_out(vty, "  repeat dl-facch all%s", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+       else if (bts->repeated_acch_policy.dl_facch_cmd)</span><br><span style="color: hsl(120, 100%, 40%);">+           vty_out(vty, "  repeat dl-facch command%s", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+   if (bts->repeated_acch_policy.dl_sacch)</span><br><span style="color: hsl(120, 100%, 40%);">+            vty_out(vty, "  repeat dl-sacch%s", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+   if (bts->repeated_acch_policy.ul_sacch)</span><br><span style="color: hsl(120, 100%, 40%);">+            vty_out(vty, "  repeat ul-sacch%s", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+   if (bts->repeated_acch_policy.ul_sacch</span><br><span style="color: hsl(120, 100%, 40%);">+         || bts->repeated_acch_policy.dl_facch_cmd</span><br><span style="color: hsl(120, 100%, 40%);">+          || bts->repeated_acch_policy.dl_facch_cmd)</span><br><span style="color: hsl(120, 100%, 40%);">+             vty_out(vty, "  repeat rxqual %u%s", bts->repeated_acch_policy.rxqual, VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  config_write_bts_model(vty, bts);</span><br><span> }</span><br><span> </span><br><span>@@ -2621,6 +2634,142 @@</span><br><span>         return CMD_SUCCESS;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+#define REP_ACCH_STR "FACCH/SACCH repetition\n"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+DEFUN_ATTR(cfg_bts_rep_dl_facch,</span><br><span style="color: hsl(120, 100%, 40%);">+      cfg_bts_rep_dl_facch_cmd,</span><br><span style="color: hsl(120, 100%, 40%);">+     "repeat dl-facch (command|all)",</span><br><span style="color: hsl(120, 100%, 40%);">+    REP_ACCH_STR</span><br><span style="color: hsl(120, 100%, 40%);">+          "Enable DL-FACCH repetition for this BTS\n"</span><br><span style="color: hsl(120, 100%, 40%);">+         "command LAPDm frames only\n"</span><br><span style="color: hsl(120, 100%, 40%);">+       "all LAPDm frames\n", CMD_ATTR_IMMEDIATE)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     struct gsm_bts *bts = vty->index;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        if (bts->model->type != GSM_BTS_TYPE_OSMOBTS) {</span><br><span style="color: hsl(120, 100%, 40%);">+         vty_out(vty, "%% repeated ACCH not supported by BTS %u%s",</span><br><span style="color: hsl(120, 100%, 40%);">+                  bts->nr, VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+             return CMD_WARNING;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   if (!strcmp(argv[1], "command")) {</span><br><span style="color: hsl(120, 100%, 40%);">+          bts->repeated_acch_policy.dl_facch_cmd = true;</span><br><span style="color: hsl(120, 100%, 40%);">+             bts->repeated_acch_policy.dl_facch_all = false;</span><br><span style="color: hsl(120, 100%, 40%);">+    } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              bts->repeated_acch_policy.dl_facch_cmd = true;</span><br><span style="color: hsl(120, 100%, 40%);">+             bts->repeated_acch_policy.dl_facch_all = true;</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+     return CMD_SUCCESS;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+DEFUN_ATTR(cfg_bts_rep_no_dl_facch,</span><br><span style="color: hsl(120, 100%, 40%);">+    cfg_bts_rep_no_dl_facch_cmd,</span><br><span style="color: hsl(120, 100%, 40%);">+          "no repeat dl-facch",</span><br><span style="color: hsl(120, 100%, 40%);">+       NO_STR REP_ACCH_STR</span><br><span style="color: hsl(120, 100%, 40%);">+           "Disable DL-FACCH repetition for this BTS\n", CMD_ATTR_IMMEDIATE)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     struct gsm_bts *bts = vty->index;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bts->repeated_acch_policy.dl_facch_cmd = false;</span><br><span style="color: hsl(120, 100%, 40%);">+    bts->repeated_acch_policy.dl_facch_all = false;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  return CMD_SUCCESS;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+DEFUN_ATTR(cfg_bts_rep_dl_sacch,</span><br><span style="color: hsl(120, 100%, 40%);">+       cfg_bts_rep_dl_sacch_cmd,</span><br><span style="color: hsl(120, 100%, 40%);">+     "repeat dl-sacch",</span><br><span style="color: hsl(120, 100%, 40%);">+          REP_ACCH_STR</span><br><span style="color: hsl(120, 100%, 40%);">+          "Enable DL-SACCH repetition for this BTS\n", CMD_ATTR_IMMEDIATE)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      struct gsm_bts *bts = vty->index;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        if (bts->model->type != GSM_BTS_TYPE_OSMOBTS) {</span><br><span style="color: hsl(120, 100%, 40%);">+         vty_out(vty, "%% repeated ACCH not supported by BTS %u%s",</span><br><span style="color: hsl(120, 100%, 40%);">+                  bts->nr, VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+             return CMD_WARNING;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   bts->repeated_acch_policy.dl_sacch = true;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       return CMD_SUCCESS;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+DEFUN_ATTR(cfg_bts_rep_no_dl_sacch,</span><br><span style="color: hsl(120, 100%, 40%);">+    cfg_bts_rep_no_dl_sacch_cmd,</span><br><span style="color: hsl(120, 100%, 40%);">+          "no repeat dl-sacch",</span><br><span style="color: hsl(120, 100%, 40%);">+       NO_STR REP_ACCH_STR</span><br><span style="color: hsl(120, 100%, 40%);">+           "Disable DL-SACCH repetition for this BTS\n", CMD_ATTR_IMMEDIATE)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     struct gsm_bts *bts = vty->index;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bts->repeated_acch_policy.dl_sacch = false;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      return CMD_SUCCESS;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+DEFUN_ATTR(cfg_bts_rep_ul_sacch,</span><br><span style="color: hsl(120, 100%, 40%);">+       cfg_bts_rep_ul_sacch_cmd,</span><br><span style="color: hsl(120, 100%, 40%);">+     "repeat ul-sacch",</span><br><span style="color: hsl(120, 100%, 40%);">+          REP_ACCH_STR</span><br><span style="color: hsl(120, 100%, 40%);">+          "Enable UL-SACCH repetition for this BTS\n", CMD_ATTR_IMMEDIATE)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      struct gsm_bts *bts = vty->index;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        if (bts->model->type != GSM_BTS_TYPE_OSMOBTS) {</span><br><span style="color: hsl(120, 100%, 40%);">+         vty_out(vty, "%% repeated ACCH not supported by BTS %u%s",</span><br><span style="color: hsl(120, 100%, 40%);">+                  bts->nr, VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+             return CMD_WARNING;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   bts->repeated_acch_policy.ul_sacch = true;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       return CMD_SUCCESS;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+DEFUN_ATTR(cfg_bts_rep_no_ul_sacch,</span><br><span style="color: hsl(120, 100%, 40%);">+    cfg_bts_rep_no_ul_sacch_cmd,</span><br><span style="color: hsl(120, 100%, 40%);">+          "no repeat ul-sacch",</span><br><span style="color: hsl(120, 100%, 40%);">+       NO_STR REP_ACCH_STR</span><br><span style="color: hsl(120, 100%, 40%);">+           "Disable UL-SACCH repetition for this BTS\n", CMD_ATTR_IMMEDIATE)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     struct gsm_bts *bts = vty->index;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bts->repeated_acch_policy.ul_sacch = false;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      return CMD_SUCCESS;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+DEFUN_ATTR(cfg_bts_rep_rxqual,</span><br><span style="color: hsl(120, 100%, 40%);">+         cfg_bts_rep_rxqual_cmd,</span><br><span style="color: hsl(120, 100%, 40%);">+       "repeat rxqual (0|1|2|3|4|5|6|7)",</span><br><span style="color: hsl(120, 100%, 40%);">+          REP_ACCH_STR</span><br><span style="color: hsl(120, 100%, 40%);">+          "Set UL-SACCH/DL-FACCH rxqual threshold-ber\n"</span><br><span style="color: hsl(120, 100%, 40%);">+      "0 disabled (always on)\n"</span><br><span style="color: hsl(120, 100%, 40%);">+          "1 0.26% to 0.30% BER\n"</span><br><span style="color: hsl(120, 100%, 40%);">+    "2 0.51% to 0.64% BER\n"</span><br><span style="color: hsl(120, 100%, 40%);">+    "3 1.0% to 1.3% BER\n"</span><br><span style="color: hsl(120, 100%, 40%);">+      "4 1.9% to 2.7% BER\n"</span><br><span style="color: hsl(120, 100%, 40%);">+      "5 3.8% to 5.4% BER\n"</span><br><span style="color: hsl(120, 100%, 40%);">+      "6 7.6% to 11.0% BER\n"</span><br><span style="color: hsl(120, 100%, 40%);">+     "7 Greater than 15.0% BER\n",</span><br><span style="color: hsl(120, 100%, 40%);">+       CMD_ATTR_IMMEDIATE)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     struct gsm_bts *bts = vty->index;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        if (bts->model->type != GSM_BTS_TYPE_OSMOBTS) {</span><br><span style="color: hsl(120, 100%, 40%);">+         vty_out(vty, "%% repeated ACCH not supported by BTS %u%s",</span><br><span style="color: hsl(120, 100%, 40%);">+                  bts->nr, VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+             return CMD_WARNING;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* See also: GSM 05.08, section 8.2.4 */</span><br><span style="color: hsl(120, 100%, 40%);">+      bts->repeated_acch_policy.rxqual = atoi(argv[0]);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        return CMD_SUCCESS;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> #define CD_STR "Channel Description\n"</span><br><span> </span><br><span> DEFUN_USRATTR(cfg_bts_chan_desc_att,</span><br><span>@@ -2989,7 +3138,7 @@</span><br><span>   struct gsm_bts *bts = vty->index;</span><br><span> </span><br><span>     if (bts->type != GSM_BTS_TYPE_OSMOBTS) {</span><br><span style="color: hsl(0, 100%, 40%);">-             vty_out(vty, "%% infinite radio link timeout not supported by this BTS%s", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+            vty_out(vty, "%% infinite radio link timeout not supported by BTS %u%s", bts->nr, VTY_NEWLINE);</span><br><span>                 return CMD_WARNING;</span><br><span>  }</span><br><span> </span><br><span>@@ -7033,6 +7182,14 @@</span><br><span>       install_element(BTS_NODE, &cfg_bts_acc_ramping_chan_load_cmd);</span><br><span>   install_element(BTS_NODE, &cfg_bts_t3113_dynamic_cmd);</span><br><span>   install_element(BTS_NODE, &cfg_bts_no_t3113_dynamic_cmd);</span><br><span style="color: hsl(120, 100%, 40%);">+ install_element(BTS_NODE, &cfg_bts_rep_dl_facch_cmd);</span><br><span style="color: hsl(120, 100%, 40%);">+     install_element(BTS_NODE, &cfg_bts_rep_no_dl_facch_cmd);</span><br><span style="color: hsl(120, 100%, 40%);">+  install_element(BTS_NODE, &cfg_bts_rep_dl_sacch_cmd);</span><br><span style="color: hsl(120, 100%, 40%);">+     install_element(BTS_NODE, &cfg_bts_rep_no_dl_sacch_cmd);</span><br><span style="color: hsl(120, 100%, 40%);">+  install_element(BTS_NODE, &cfg_bts_rep_ul_sacch_cmd);</span><br><span style="color: hsl(120, 100%, 40%);">+     install_element(BTS_NODE, &cfg_bts_rep_no_ul_sacch_cmd);</span><br><span style="color: hsl(120, 100%, 40%);">+  install_element(BTS_NODE, &cfg_bts_rep_rxqual_cmd);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>    neighbor_ident_vty_init(network, network->neighbor_bss_cells);</span><br><span>    /* See also handover commands added on bts level from handover_vty.c */</span><br><span> </span><br><span>diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c</span><br><span>index aa7ba1d..065b8ab 100644</span><br><span>--- a/src/osmo-bsc/bts.c</span><br><span>+++ b/src/osmo-bsc/bts.c</span><br><span>@@ -356,6 +356,8 @@</span><br><span>       acc_mgr_init(&bts->acc_mgr, bts);</span><br><span>     acc_ramp_init(&bts->acc_ramp, bts);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+        bts->repeated_acch_policy.rxqual = 4;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>   return bts;</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/21164">change 21164</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bsc/+/21164"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I083eaa2c30478912426e9c24a506f0b88836e190 </div>
<div style="display:none"> Gerrit-Change-Number: 21164 </div>
<div style="display:none"> Gerrit-PatchSet: 9 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>