From patchwork Wed Jul 2 15:58:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Willmann X-Patchwork-Id: 366416 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 AD38914009E for ; Thu, 3 Jul 2014 02:15:15 +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 1X2NBZ-0000oS-Nq; Wed, 02 Jul 2014 18:15:05 +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-0007P2-GH; Wed, 02 Jul 2014 17:58:28 +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 D0D4F6005E; Wed, 2 Jul 2014 17:58:23 +0200 (CEST) Received: by adrastea.totalueberwachung.de (Postfix, from userid 1000) id AB19C220F7; Wed, 2 Jul 2014 17:58:21 +0200 (CEST) From: Daniel Willmann To: OpenBSC Mailing List , Osmocom net ML Subject: [osmo-pcu 2/3] bts: Separate functions for dl/ul tbf_by_tfi lookup Date: Wed, 2 Jul 2014 17:58:15 +0200 Message-Id: X-Mailer: git-send-email 1.8.4.2 In-Reply-To: References: In-Reply-To: References: X-Spam-Score: -0.0 (/) 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 Ticket: SYS#389 Sponsored-by: On-Waves ehf --- src/bts.cpp | 18 +++++++++++++++--- src/bts.h | 4 +++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/bts.cpp b/src/bts.cpp index 51be2d9..52960cf 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -271,6 +271,18 @@ gprs_rlcmac_tbf *BTS::tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) return NULL; } +/* lookup downlink TBF Entity (by TFI) */ +gprs_rlcmac_tbf *BTS::dl_tbf_by_tfi(uint8_t tfi, uint8_t trx) +{ + return tbf_by_tfi(tfi, trx, GPRS_RLCMAC_DL_TBF); +} + +/* lookup uplink TBF Entity (by TFI) */ +gprs_rlcmac_tbf *BTS::ul_tbf_by_tfi(uint8_t tfi, uint8_t trx) +{ + return tbf_by_tfi(tfi, trx, GPRS_RLCMAC_UL_TBF); +} + /* lookup TBF Entity (by TFI) */ gprs_rlcmac_tbf *BTS::tbf_by_tfi(uint8_t tfi, uint8_t trx, enum gprs_rlcmac_tbf_direction dir) @@ -690,7 +702,7 @@ int gprs_rlcmac_pdch::rcv_data_block_acknowledged(uint8_t *data, uint8_t len, in } /* find TBF inst from given TFI */ - tbf = bts()->tbf_by_tfi(rh->tfi, trx_no(), GPRS_RLCMAC_UL_TBF); + tbf = bts()->ul_tbf_by_tfi(rh->tfi, trx_no()); if (!tbf) { LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA unknown TFI=%d\n", rh->tfi); @@ -900,14 +912,14 @@ void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, if (request->ID.u.Global_TFI.UnionType) { int8_t tfi = request->ID.u.Global_TFI.u.DOWNLINK_TFI; - tbf = bts()->tbf_by_tfi(tfi, trx_no(), GPRS_RLCMAC_DL_TBF); + tbf = bts()->dl_tbf_by_tfi(tfi, trx_no()); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown downlink TFI=%d\n", tfi); return; } } else { int8_t tfi = request->ID.u.Global_TFI.u.UPLINK_TFI; - tbf = bts()->tbf_by_tfi(tfi, trx_no(), GPRS_RLCMAC_UL_TBF); + tbf = bts()->ul_tbf_by_tfi(tfi, trx_no()); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown uplink TFI=%d\n", tfi); return; diff --git a/src/bts.h b/src/bts.h index c83bb18..a67f215 100644 --- a/src/bts.h +++ b/src/bts.h @@ -195,7 +195,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 *tbf_by_tfi(uint8_t tfi, uint8_t trx, enum gprs_rlcmac_tbf_direction dir); + 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); int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); @@ -240,6 +241,7 @@ private: TimingAdvance m_ta; struct rate_ctr_group *m_ratectrs; gprs_rlcmac_tbf *tbf_by_tlli(uint32_t tlli, enum gprs_rlcmac_tbf_direction dir); + gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi, uint8_t trx, enum gprs_rlcmac_tbf_direction dir); private: /* disable copying to avoid slicing */