<p>neels has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25450">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fixup comments for 'rf_states' CTRL command<br><br>Completely describe the 'rf_states' string elements (in one place), and<br>fix the missing <rsl_status> item in bsc_ctrl_commands.c comments.<br><br>Related: SYS#5542<br>Change-Id: Ifc3610c344b3e270111e2f6c5155a6fb90d8f2ac<br>---<br>M src/osmo-bsc/bsc_ctrl_commands.c<br>M src/osmo-bsc/bsc_rf_ctrl.c<br>2 files changed, 24 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/50/25450/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/bsc_ctrl_commands.c b/src/osmo-bsc/bsc_ctrl_commands.c</span><br><span>index c7547b0..a94baae 100644</span><br><span>--- a/src/osmo-bsc/bsc_ctrl_commands.c</span><br><span>+++ b/src/osmo-bsc/bsc_ctrl_commands.c</span><br><span>@@ -420,8 +420,9 @@</span><br><span> }</span><br><span> CTRL_CMD_DEFINE_RO(bts_rf_state, "rf_state");</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/* Return a list of the states of each TRX for a given BTS:</span><br><span style="color: hsl(0, 100%, 40%);">- * <bts_nr>,<trx_nr>,<opstate>,<adminstate>,<rf_policy>;<bts_nr>,<trx_nr>,...</span><br><span style="color: hsl(120, 100%, 40%);">+/* Return a list of the states of each TRX for a given BTS.</span><br><span style="color: hsl(120, 100%, 40%);">+ * <bts_nr>,<trx_nr>,<opstate>,<adminstate>,<rf_policy>,<rsl_status>;<bts_nr>,<trx_nr>,...;...;</span><br><span style="color: hsl(120, 100%, 40%);">+ * For details on the string, see bsc_rf_states_c();</span><br><span>  */</span><br><span> static int get_bts_rf_states(struct ctrl_cmd *cmd, void *data)</span><br><span> {</span><br><span>@@ -443,7 +444,8 @@</span><br><span> CTRL_CMD_DEFINE_RO(bts_rf_states, "rf_states");</span><br><span> </span><br><span> /* Return a list of the states of each TRX for all BTS:</span><br><span style="color: hsl(0, 100%, 40%);">- * <bts_nr>,<trx_nr>,<opstate>,<adminstate>,<rf_policy>;<bts_nr>,<trx_nr>,...</span><br><span style="color: hsl(120, 100%, 40%);">+ * <bts_nr>,<trx_nr>,<opstate>,<adminstate>,<rf_policy>,<rsl_status>;<bts_nr>,<trx_nr>,...;...;</span><br><span style="color: hsl(120, 100%, 40%);">+ * For details on the string, see bsc_rf_states_c();</span><br><span>  */</span><br><span> static int get_net_rf_states(struct ctrl_cmd *cmd, void *data)</span><br><span> {</span><br><span>diff --git a/src/osmo-bsc/bsc_rf_ctrl.c b/src/osmo-bsc/bsc_rf_ctrl.c</span><br><span>index 7040da4..749d2eb 100644</span><br><span>--- a/src/osmo-bsc/bsc_rf_ctrl.c</span><br><span>+++ b/src/osmo-bsc/bsc_rf_ctrl.c</span><br><span>@@ -139,8 +139,7 @@</span><br><span> }</span><br><span> </span><br><span> /* Return a string listing the state of the given TRX.</span><br><span style="color: hsl(0, 100%, 40%);">- * The string has the form:</span><br><span style="color: hsl(0, 100%, 40%);">- *  <bts_nr>,<trx_nr>,<opstate>,<adminstate>,<rf_policy>,<rsl_status>;</span><br><span style="color: hsl(120, 100%, 40%);">+ * For details, see bsc_rf_states_c().</span><br><span>  */</span><br><span> static int bsc_rf_state_of_trx_buf(char *buf, size_t buflen, struct gsm_bts_trx *trx)</span><br><span> {</span><br><span>@@ -154,6 +153,9 @@</span><br><span>        return sb.chars_needed;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Same as bsc_rf_states_of_bts_c() but return result in a fixed-size buffer.</span><br><span style="color: hsl(120, 100%, 40%);">+ * For details, see bsc_rf_states_c().</span><br><span style="color: hsl(120, 100%, 40%);">+ * Return the amount of characters that would be written to the buffer if it is large enough, like snprintf(). */</span><br><span> static int bsc_rf_states_of_bts_buf(char *buf, size_t buflen, struct gsm_bts *bts)</span><br><span> {</span><br><span>        struct gsm_bts_trx *trx;</span><br><span>@@ -166,8 +168,8 @@</span><br><span> }</span><br><span> </span><br><span> /* Return a string listing the states of each TRX for the given BTS.</span><br><span style="color: hsl(0, 100%, 40%);">- * The string has the form:</span><br><span style="color: hsl(0, 100%, 40%);">- * <bts_nr>,<trx_nr>,<opstate>,<adminstate>,<rf_policy>,<rsl_status>;<bts_nr>,<trx_nr>,...;...;</span><br><span style="color: hsl(120, 100%, 40%);">+ * For details, see bsc_rf_states_c().</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span>  * \param ctx  Talloc context to allocate the returned string from.</span><br><span>  * \param bts  BTS of which to list the TRX states.</span><br><span>  * \return talloc allocated string.</span><br><span>@@ -177,6 +179,9 @@</span><br><span>     OSMO_NAME_C_IMPL(ctx, 256, "ERROR", bsc_rf_states_of_bts_buf, bts);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Same as bsc_rf_states_c() but return result in a fixed-size buffer.</span><br><span style="color: hsl(120, 100%, 40%);">+ * For details, see bsc_rf_states_c().</span><br><span style="color: hsl(120, 100%, 40%);">+ * Return the amount of characters that would be written to the buffer if it is large enough, like snprintf(). */</span><br><span> static int bsc_rf_states_buf(char *buf, size_t buflen)</span><br><span> {</span><br><span>     struct gsm_bts *bts;</span><br><span>@@ -191,8 +196,17 @@</span><br><span> /* Return a string listing the states of all TRX of all BTS.</span><br><span>  * The string has the form:</span><br><span>  * <bts_nr>,<trx_nr>,<opstate>,<adminstate>,<rf_policy>,<rsl_status>;<bts_nr>,<trx_nr>,...;...;</span><br><span style="color: hsl(120, 100%, 40%);">+ * (always terminates in a semicolon).</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Meaning of the elements:</span><br><span style="color: hsl(120, 100%, 40%);">+ * - bts_nr: 0..255  -- BTS index.</span><br><span style="color: hsl(120, 100%, 40%);">+ * - trx_nr: 0..255  -- TRX index.</span><br><span style="color: hsl(120, 100%, 40%);">+ * - opstate: inoperational|operational  -- whether RF is active.</span><br><span style="color: hsl(120, 100%, 40%);">+ * - adminstate: unlocked|locked -- whether the TRX is configured as RF-locked.</span><br><span style="color: hsl(120, 100%, 40%);">+ * - rf_policy: off|on|grace|unknown -- which state RF should be in according to user rf_lock requests.</span><br><span style="color: hsl(120, 100%, 40%);">+ * - rsl_status: rsl-up|rsl-down -- 'rsl-up' if an RSL link to the TRX is currently present.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span>  * \param ctx  Talloc context to allocate the returned string from.</span><br><span style="color: hsl(0, 100%, 40%);">- * \param bts  BTS of which to list the TRX states, or NULL to list all TRX of all BTS.</span><br><span>  * \return talloc allocated string.</span><br><span>  */</span><br><span> char *bsc_rf_states_c(void *ctx)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25450">change 25450</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/+/25450"/><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: Ifc3610c344b3e270111e2f6c5155a6fb90d8f2ac </div>
<div style="display:none"> Gerrit-Change-Number: 25450 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>