Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/11956


Change subject: bsc: trx_count_free_ts: Fix counting of GSM_PCHAN_PDCH
......................................................................

bsc: trx_count_free_ts: Fix counting of GSM_PCHAN_PDCH

PDCH were not counted since ts_for_each_lchan translates to
ts_as_pchan_for_each_lchan(GSM_PCHAN_PDCH), and then pchan_subslots()
returns 0 through subslots_per_pchan.

Change-Id: I7a785b70fd0a34a52504e9a46b4b27889463f67e
---
M src/osmo-bsc/gsm_data.c
1 file changed, 9 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/56/11956/1

diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 6d39642..f9cdd4f 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -1616,7 +1616,11 @@
                        continue;

                if (ts->pchan_is == GSM_PCHAN_PDCH) {
-                       /* Dynamic timeslots in PDCH mode will become TCH if 
needed. */
+                       /* PDCH TS don't appear in ts_for_each_lchan */
+                       if (pchan == GSM_PCHAN_PDCH && lchan_state_is(lchan, 
LCHAN_ST_UNUSED))
+                               count++;
+                       /* Dynamic timeslots in PDCH mode will become TCH if 
needed,
+                          and since now pchan is PDCH, we now they are unused. 
*/
                        switch (ts->pchan_on_init) {
                        case GSM_PCHAN_TCH_F_PDCH:
                                if (pchan == GSM_PCHAN_TCH_F)
@@ -1630,9 +1634,11 @@
                                        count += 2;
                                continue;

-                       default:
-                               /* Not dynamic, not applicable. */
+                       case GSM_PCHAN_PDCH:
+                               /* PDCH Already counted before switch statement 
*/
                                continue;
+                       default:
+                               OSMO_ASSERT(false);
                        }
                }


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7a785b70fd0a34a52504e9a46b4b27889463f67e
Gerrit-Change-Number: 11956
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <[email protected]>

Reply via email to