Pau Espin Pedrol has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11954 )

Change subject: bsc: timeslot_fsm: Fix ts_is_lchan_waiting_for_pchan
......................................................................

bsc: timeslot_fsm: Fix ts_is_lchan_waiting_for_pchan

If ts_is_lchan_waiting_for_pchan() wasn't accounting for TCH lchans
waiting for TS to deactive PDCH in order to setup the TS as TCH.

Since now TCH lchan is catched by ts_is_lchan_waiting_for_pchan() when
TS state is TS_ST_WAIT_PDCH_DEACT, there's no need to check for that
case in caller ts_is_pchan_switching(), since it will never hit because
the callee returns true in that case now.

See osmo-bsc I9cedb77d6578597f1febab36c54b2ee427c7a4a2 for similar
extensive explanation.

Change-Id: Ib03e5a91438a5b74a04e69f81fab565842b02b66
---
M src/osmo-bsc/timeslot_fsm.c
1 file changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c
index 1450491..269fcd5 100644
--- a/src/osmo-bsc/timeslot_fsm.c
+++ b/src/osmo-bsc/timeslot_fsm.c
@@ -857,7 +857,7 @@
 bool ts_is_lchan_waiting_for_pchan(struct gsm_bts_trx_ts *ts, enum 
gsm_phys_chan_config *target_pchan)
 {
        struct gsm_lchan *lchan;
-       ts_for_each_lchan(lchan, ts) {
+       ts_for_each_potential_lchan(lchan, ts) {
                if (lchan->fi->state == LCHAN_ST_WAIT_TS_READY) {
                        if (target_pchan)
                                *target_pchan = 
gsm_pchan_by_lchan_type(lchan->type);
@@ -887,13 +887,15 @@

        switch (ts->fi->state) {
        case TS_ST_WAIT_PDCH_ACT:
+               /* When switching to PDCH, there are no lchans and we are
+                * telling the PCU to take over the timeslot. */
                if (target_pchan)
                        *target_pchan = GSM_PCHAN_PDCH;
                return true;

        case TS_ST_WAIT_PDCH_DEACT:
-               /* If we were switching to a specific pchan kind, an lchan 
would be waiting. So this must
-                * be NONE then. */
+               /* If lchan started a PDCH deact but got somehow released while
+                * waiting for PDCH DEACT (N)ACK */
                if (target_pchan)
                        *target_pchan = GSM_PCHAN_NONE;
                return true;

--
To view, visit https://gerrit.osmocom.org/11954
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib03e5a91438a5b74a04e69f81fab565842b02b66
Gerrit-Change-Number: 11954
Gerrit-PatchSet: 9
Gerrit-Owner: Pau Espin Pedrol <[email protected]>
Gerrit-Assignee: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: Pau Espin Pedrol <[email protected]>
Gerrit-CC: Harald Welte <[email protected]>
Gerrit-CC: Vadim Yanitskiy <[email protected]>

Reply via email to