<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/10871">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ts,lchan_fsm: do not attempt to allocate CBCH subslots<br><br>In case a given channel combination contains a CBCH, it replaces sub-slot 2<br>with a CBCH, i.e. we must not attempt to allocate the same for SDCCH.<br><br>On timeslot initialization, immediately place such an lchan FSM into new state<br>LCHAN_ST_CBCH, so that it never appears unused and never is picked during<br>lchan_select(). Also set lchan->type = GSM_LCHAN_CBCH.<br><br>Verified by configuring CBCH timeslots and watching 'show lchan summary'.<br><br>Immediately after RSL and OML are up, these pchan types show lchan 2 in state<br>CBCH:<br><br>  BTS 0, TRX 0, Timeslot 0 CCCH+SDCCH4+CBCH, Lchan 2, Type CBCH, State CBCH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm<br>  BTS 0, TRX 0, Timeslot 1 SDCCH8+CBCH, Lchan 2, Type CBCH, State CBCH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm<br><br>With a 'phys_chan_config ccch+sdcch4+cbch' and three phones simultaneously<br>requesting USSD, I see:<br><br>  BTS 0, TRX 0, Timeslot 0 CCCH+SDCCH4+CBCH, Lchan 0, Type SDCCH, State ESTABLISHED - L1 MS Power: 14 dBm RXL-FULL-dl:  -53 dBm RXL-FULL-ul:  -47 dBm<br>  BTS 0, TRX 0, Timeslot 0 CCCH+SDCCH4+CBCH, Lchan 1, Type SDCCH, State ESTABLISHED - L1 MS Power: 30 dBm RXL-FULL-dl:  -47 dBm RXL-FULL-ul:  -47 dBm<br>  BTS 0, TRX 0, Timeslot 0 CCCH+SDCCH4+CBCH, Lchan 2, Type CBCH, State CBCH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm<br>  BTS 0, TRX 0, Timeslot 0 CCCH+SDCCH4+CBCH, Lchan 3, Type SDCCH, State ESTABLISHED - L1 MS Power: 16 dBm RXL-FULL-dl:  -47 dBm RXL-FULL-ul:  -47 dBm<br><br>With 'phys_chan_config SDCCH8+CBCH' and three phones simultaneously attaching,<br>I see:<br><br>  BTS 0, TRX 0, Timeslot 1 SDCCH8+CBCH, Lchan 0, Type SDCCH, State WAIT_RLL_RTP_ESTABLISH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm<br>  BTS 0, TRX 0, Timeslot 1 SDCCH8+CBCH, Lchan 1, Type SDCCH, State WAIT_RLL_RTP_ESTABLISH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm<br>  BTS 0, TRX 0, Timeslot 1 SDCCH8+CBCH, Lchan 2, Type CBCH, State CBCH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm<br>  BTS 0, TRX 0, Timeslot 1 SDCCH8+CBCH, Lchan 3, Type SDCCH, State WAIT_RLL_RTP_ESTABLISH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm<br><br>i.e. in all cases the CBCH lchan remains occupied and is not allocated as<br>SDCCH.<br><br>Detaching and re-attaching the BTS reliably brings back the CBCH state. Also<br>verified that changing the osmo-bsc config from telnet vty and dropping oml<br>followed by the BTS re-attaching brings back the CBCH state.<br><br>Change-Id: I2bafc5f696e818e38f8907ad0c8f38494df0623d<br>---<br>M include/osmocom/bsc/lchan_fsm.h<br>M src/osmo-bsc/lchan_fsm.c<br>M src/osmo-bsc/timeslot_fsm.c<br>3 files changed, 17 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/bsc/lchan_fsm.h b/include/osmocom/bsc/lchan_fsm.h</span><br><span>index 35b8847..9fbf9b3 100644</span><br><span>--- a/include/osmocom/bsc/lchan_fsm.h</span><br><span>+++ b/include/osmocom/bsc/lchan_fsm.h</span><br><span>@@ -14,6 +14,7 @@</span><br><span> </span><br><span> enum lchan_fsm_state {</span><br><span>    LCHAN_ST_UNUSED,</span><br><span style="color: hsl(120, 100%, 40%);">+      LCHAN_ST_CBCH, /*< Blocked by CBCH channel combination, not usable as SDCCH. */</span><br><span>   LCHAN_ST_WAIT_TS_READY,</span><br><span>      LCHAN_ST_WAIT_ACTIV_ACK, /*< After RSL Chan Act Ack, lchan is active but RTP not configured. */</span><br><span>   LCHAN_ST_WAIT_RLL_RTP_ESTABLISH,</span><br><span>diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c</span><br><span>index 1ef7869..c80d8a1 100644</span><br><span>--- a/src/osmo-bsc/lchan_fsm.c</span><br><span>+++ b/src/osmo-bsc/lchan_fsm.c</span><br><span>@@ -1035,6 +1035,13 @@</span><br><span>                       ,</span><br><span>            .out_state_mask = 0</span><br><span>                  | S(LCHAN_ST_WAIT_TS_READY)</span><br><span style="color: hsl(120, 100%, 40%);">+                   | S(LCHAN_ST_CBCH)</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%);">+    [LCHAN_ST_CBCH] = {</span><br><span style="color: hsl(120, 100%, 40%);">+           .name = "CBCH",</span><br><span style="color: hsl(120, 100%, 40%);">+             .out_state_mask = 0</span><br><span style="color: hsl(120, 100%, 40%);">+                   | S(LCHAN_ST_UNUSED)</span><br><span>                         ,</span><br><span>    },</span><br><span>   [LCHAN_ST_WAIT_TS_READY] = {</span><br><span>diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c</span><br><span>index 56b3357..fc25460 100644</span><br><span>--- a/src/osmo-bsc/timeslot_fsm.c</span><br><span>+++ b/src/osmo-bsc/timeslot_fsm.c</span><br><span>@@ -295,6 +295,15 @@</span><br><span>                                         T_CHAN_ACT_DEACT);</span><br><span>           break;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+    case GSM_PCHAN_CCCH_SDCCH4_CBCH:</span><br><span style="color: hsl(120, 100%, 40%);">+      case GSM_PCHAN_SDCCH8_SACCH8C_CBCH:</span><br><span style="color: hsl(120, 100%, 40%);">+           /* For any pchans containing a CBCH, lchan[2] is reserved for CBCH and cannot be</span><br><span style="color: hsl(120, 100%, 40%);">+               * allocated for SDCCH. */</span><br><span style="color: hsl(120, 100%, 40%);">+            OSMO_ASSERT(ts->lchan[2].fi);</span><br><span style="color: hsl(120, 100%, 40%);">+              ts->lchan[2].type = GSM_LCHAN_CBCH;</span><br><span style="color: hsl(120, 100%, 40%);">+                osmo_fsm_inst_state_chg(ts->lchan[2].fi, LCHAN_ST_CBCH, 0, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+             break;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>     default:</span><br><span>             /* nothing to do */</span><br><span>          break;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10871">change 10871</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/10871"/><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-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I2bafc5f696e818e38f8907ad0c8f38494df0623d </div>
<div style="display:none"> Gerrit-Change-Number: 10871 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>