From patchwork Thu Jun 2 11:51:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gerrit-no-reply@lists.osmocom.org X-Patchwork-Id: 629194 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (lists.osmocom.org [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id 3rL5Cl4kMqz9t3g for ; Thu, 2 Jun 2016 21:51:15 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id 51FEF22F10; Thu, 2 Jun 2016 11:51:09 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from 127.0.1.12 (unknown [127.0.1.12]) by lists.osmocom.org (Postfix) with ESMTPA id 3441122EA8; Thu, 2 Jun 2016 11:51:00 +0000 (UTC) Date: Thu, 2 Jun 2016 11:51:00 +0000 From: Neels Hofmeyr Message-ID: X-Gerrit-MessageType: newchange Subject: [PATCH] openbsc[master]: dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots X-Gerrit-Change-Id: Iddd575873a2fe819fc182a6b3d4186caea1997e5 X-Gerrit-ChangeURL: X-Gerrit-Commit: cb230b90216f6c8ff09f7cd667c0457426796e0d MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/2.12.2-31-gb331dbd-dirty X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Development of OpenBSC, OsmoBSC, OsmoNITB, OsmoCSCN" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: nhofmeyr@sysmocom.de Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" Review at https://gerrit.osmocom.org/180 dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots See comment added in the code. Original patch by jolly, but split in two, added comment and flipped the if() logic for readability by nhofmeyr. Change-Id: Iddd575873a2fe819fc182a6b3d4186caea1997e5 --- M openbsc/src/libbsc/chan_alloc.c 1 file changed, 10 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/80/180/1 diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index 8600846..cd25bd9 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -96,14 +96,16 @@ ts = &trx->ts[j]; if (!ts_is_usable(ts)) continue; - /* ip.access dynamic TCH/F + PDCH combination */ - if (ts->pchan == GSM_PCHAN_TCH_F_PDCH && - pchan == GSM_PCHAN_TCH_F) { - /* we can only consider such a dynamic channel - * if the PDCH is currently inactive */ - if (ts->flags & TS_F_PDCH_MODE) - continue; - } else if (ts->pchan != pchan) + /* + * pchan must match; but when looking for TCH/F, allow a match + * with TCH/F_PDCH, to return dynamic TCH/F_PDCH slots to the + * channel allocator. Thus the channel allocator can pick a + * TCH/F_PDCH time slot and disable its PDCH later on (no need + * to check whether PDCH mode is currently active here). + */ + if (!(ts->pchan == pchan + || (ts->pchan == GSM_PCHAN_TCH_F_PDCH + && pchan == GSM_PCHAN_TCH_F))) continue; /* check if all sub-slots are allocated yet */ for (ss = 0; ss < subslots_per_pchan[pchan]; ss++) {