From patchwork Wed Jul 2 15:58:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Willmann X-Patchwork-Id: 366415 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ganesha.gnumonks.org (ganesha.gnumonks.org [IPv6:2001:780:45:1d:225:90ff:fe52:c662]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E638B14009E for ; Thu, 3 Jul 2014 02:11:48 +1000 (EST) Received: from localhost ([127.0.0.1] helo=ganesha.gnumonks.org) by ganesha.gnumonks.org with esmtp (Exim 4.72) (envelope-from ) id 1X2N8C-0000hO-9A; Wed, 02 Jul 2014 18:11:36 +0200 Received: from isonoe.totalueberwachung.de ([2a01:198:210:100::1]) by ganesha.gnumonks.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1X2MvQ-0007P3-Fk; Wed, 02 Jul 2014 17:58:26 +0200 Received: from adrastea.totalueberwachung.de (91-65-194-134-dynip.superkabel.de [91.65.194.134]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by isonoe.totalueberwachung.de (Postfix) with ESMTPSA id CB7096005B; Wed, 2 Jul 2014 17:58:23 +0200 (CEST) Received: by adrastea.totalueberwachung.de (Postfix, from userid 1000) id 7585322092; Wed, 2 Jul 2014 17:58:22 +0200 (CEST) From: Daniel Willmann To: OpenBSC Mailing List , Osmocom net ML Subject: [osmo-pcu 3/3] bts: Split tbf_by_poll_fn into separate dl and ul functions Date: Wed, 2 Jul 2014 17:58:16 +0200 Message-Id: X-Mailer: git-send-email 1.8.4.2 In-Reply-To: References: In-Reply-To: References: X-Spam-Score: 0.1 (/) X-Spam-Report: SpamASsassin versoin 3.3.1 on ganesha.gnumonks.org summary: Content analysis details: (0.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.1 TW_TR BODY: Odd Letter Triples with TR Cc: Daniel Willmann X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Development of the OpenBSC GSM base station controller List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openbsc-bounces@lists.osmocom.org Errors-To: openbsc-bounces@lists.osmocom.org rcv_control_dl_ack_nack is only meaningful for dl tbf while rcv_control_ack can be sent in response to a dl or ul tbf. So rcv_control_ack still needs to check for ul and dl tbfs. Ticket: SYS#389 Sponsored-by: On-Waves ehf --- src/bts.cpp | 21 ++++++++++++++++----- src/bts.h | 3 ++- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/bts.cpp b/src/bts.cpp index 52960cf..08baee0 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -248,20 +248,28 @@ gprs_rlcmac_tbf *BTS::tbf_by_tlli(uint32_t tlli, enum gprs_rlcmac_tbf_direction return NULL; } -gprs_rlcmac_tbf *BTS::tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) +gprs_rlcmac_tbf *BTS::dl_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) { struct gprs_rlcmac_tbf *tbf; /* only one TBF can poll on specific TS/FN, because scheduler can only * schedule one downlink control block (with polling) at a FN per TS */ - llist_for_each_entry(tbf, &m_bts.ul_tbfs, list) { + llist_for_each_entry(tbf, &m_bts.dl_tbfs, list) { if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED && tbf->poll_fn == fn && tbf->trx->trx_no == trx && tbf->control_ts == ts) return tbf; } - llist_for_each_entry(tbf, &m_bts.dl_tbfs, list) { + return NULL; +} +gprs_rlcmac_tbf *BTS::ul_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) +{ + struct gprs_rlcmac_tbf *tbf; + + /* only one TBF can poll on specific TS/FN, because scheduler can only + * schedule one downlink control block (with polling) at a FN per TS */ + llist_for_each_entry(tbf, &m_bts.ul_tbfs, list) { if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED && tbf->poll_fn == fn && tbf->trx->trx_no == trx @@ -718,7 +726,10 @@ void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, uint32_t tlli = 0; tlli = packet->TLLI; - tbf = bts()->tbf_by_poll_fn(fn, trx_no(), ts_no); + tbf = bts()->ul_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " "unknown FN=%u TLLI=0x%08x (TRX %d TS %d)\n", @@ -804,7 +815,7 @@ void gprs_rlcmac_pdch::rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *ack_n int rc; tfi = ack_nack->DOWNLINK_TFI; - tbf = bts()->tbf_by_poll_fn(fn, trx_no(), ts_no); + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " "unknown FN=%u TFI=%d (TRX %d TS %d)\n", diff --git a/src/bts.h b/src/bts.h index a67f215..621bcba 100644 --- a/src/bts.h +++ b/src/bts.h @@ -194,7 +194,8 @@ public: gprs_rlcmac_tbf *dl_tbf_by_tlli(uint32_t tlli); gprs_rlcmac_tbf *ul_tbf_by_tlli(uint32_t tlli); - gprs_rlcmac_tbf *tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts); + gprs_rlcmac_tbf *dl_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts); + gprs_rlcmac_tbf *ul_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts); gprs_rlcmac_tbf *dl_tbf_by_tfi(uint8_t tfi, uint8_t trx); gprs_rlcmac_tbf *ul_tbf_by_tfi(uint8_t tfi, uint8_t trx);