From patchwork Wed Jul 16 20:24:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Willmann X-Patchwork-Id: 370867 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 8A5F41400B6 for ; Thu, 17 Jul 2014 06:25:31 +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 1X7VlK-0001y7-Tj; Wed, 16 Jul 2014 22:25:15 +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 1X7Vkv-0001xv-Iz; Wed, 16 Jul 2014 22:24:51 +0200 Received: from adrastea.totalueberwachung.de (brln-4db90619.pool.mediaWays.net [77.185.6.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by isonoe.totalueberwachung.de (Postfix) with ESMTPSA id DB7936004E; Wed, 16 Jul 2014 22:24:48 +0200 (CEST) Received: by adrastea.totalueberwachung.de (Postfix, from userid 1000) id 3DB7241E3E; Wed, 16 Jul 2014 22:24:48 +0200 (CEST) From: Daniel Willmann To: OpenBSC Mailing List , Osmocom net ML Subject: [osmo-pcu v2 1/1] bts: Return the special type for {ul, dl}_tbf_by_* functions Date: Wed, 16 Jul 2014 22:24:34 +0200 Message-Id: X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <20140716192337.GL24972@xiaoyu.lan> References: <20140716192337.GL24972@xiaoyu.lan> 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 Start returning the special type instead of the base gprs_rlcmac_tbf when retrieving a TBF. Ticket: SYS#389 Sponsored-by: On-Waves ehf --- src/bts.cpp | 36 ++++++++++++++++++------------------ src/bts.h | 16 ++++++++-------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/bts.cpp b/src/bts.cpp index f614dab..79cae4c 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -217,15 +217,15 @@ int BTS::add_paging(uint8_t chan_needed, uint8_t *identity_lv) } /* search for active downlink tbf */ -gprs_rlcmac_tbf *BTS::dl_tbf_by_tlli(uint32_t tlli) +gprs_rlcmac_dl_tbf *BTS::dl_tbf_by_tlli(uint32_t tlli) { - return tbf_by_tlli(tlli, GPRS_RLCMAC_DL_TBF); + return static_cast(tbf_by_tlli(tlli, GPRS_RLCMAC_DL_TBF)); } /* search for active uplink tbf */ -gprs_rlcmac_tbf *BTS::ul_tbf_by_tlli(uint32_t tlli) +gprs_rlcmac_ul_tbf *BTS::ul_tbf_by_tlli(uint32_t tlli) { - return tbf_by_tlli(tlli, GPRS_RLCMAC_UL_TBF); + return static_cast(tbf_by_tlli(tlli, GPRS_RLCMAC_UL_TBF)); } /* search for active downlink or uplink tbf */ @@ -250,9 +250,9 @@ gprs_rlcmac_tbf *BTS::tbf_by_tlli(uint32_t tlli, enum gprs_rlcmac_tbf_direction return NULL; } -gprs_rlcmac_tbf *BTS::dl_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) +gprs_rlcmac_dl_tbf *BTS::dl_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) { - struct gprs_rlcmac_tbf *tbf; + struct gprs_rlcmac_dl_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 */ @@ -262,14 +262,14 @@ gprs_rlcmac_tbf *BTS::dl_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) && tbf->poll_fn == fn && tbf->trx->trx_no == trx && tbf->control_ts == ts) { OSMO_ASSERT(tbf->direction == GPRS_RLCMAC_DL_TBF); - return tbf; + return static_cast(tbf); } } return NULL; } -gprs_rlcmac_tbf *BTS::ul_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) +gprs_rlcmac_ul_tbf *BTS::ul_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) { - struct gprs_rlcmac_tbf *tbf; + struct gprs_rlcmac_ul_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 */ @@ -279,22 +279,22 @@ gprs_rlcmac_tbf *BTS::ul_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) && tbf->poll_fn == fn && tbf->trx->trx_no == trx && tbf->control_ts == ts) { OSMO_ASSERT(tbf->direction == GPRS_RLCMAC_UL_TBF); - return tbf; + return static_cast(tbf); } } return NULL; } /* lookup downlink TBF Entity (by TFI) */ -gprs_rlcmac_tbf *BTS::dl_tbf_by_tfi(uint8_t tfi, uint8_t trx) +gprs_rlcmac_dl_tbf *BTS::dl_tbf_by_tfi(uint8_t tfi, uint8_t trx) { - return tbf_by_tfi(tfi, trx, GPRS_RLCMAC_DL_TBF); + return static_cast(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) +gprs_rlcmac_ul_tbf *BTS::ul_tbf_by_tfi(uint8_t tfi, uint8_t trx) { - return tbf_by_tfi(tfi, trx, GPRS_RLCMAC_UL_TBF); + return static_cast(tbf_by_tfi(tfi, trx, GPRS_RLCMAC_UL_TBF)); } /* lookup TBF Entity (by TFI) */ @@ -1047,12 +1047,12 @@ gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_from_list_by_tfi(struct llist_head *tbf_l return NULL; } -gprs_rlcmac_tbf *gprs_rlcmac_pdch::ul_tbf_by_tfi(uint8_t tfi) +gprs_rlcmac_ul_tbf *gprs_rlcmac_pdch::ul_tbf_by_tfi(uint8_t tfi) { - return tbf_from_list_by_tfi(&bts_data()->ul_tbfs, tfi, GPRS_RLCMAC_UL_TBF); + return static_cast(tbf_from_list_by_tfi(&bts_data()->ul_tbfs, tfi, GPRS_RLCMAC_UL_TBF)); } -gprs_rlcmac_tbf *gprs_rlcmac_pdch::dl_tbf_by_tfi(uint8_t tfi) +gprs_rlcmac_dl_tbf *gprs_rlcmac_pdch::dl_tbf_by_tfi(uint8_t tfi) { - return tbf_from_list_by_tfi(&bts_data()->dl_tbfs, tfi, GPRS_RLCMAC_DL_TBF); + return static_cast(tbf_from_list_by_tfi(&bts_data()->dl_tbfs, tfi, GPRS_RLCMAC_DL_TBF)); } diff --git a/src/bts.h b/src/bts.h index a0b808e..8f99942 100644 --- a/src/bts.h +++ b/src/bts.h @@ -62,8 +62,8 @@ struct gprs_rlcmac_pdch { BTS *bts() const; uint8_t trx_no() const; - struct gprs_rlcmac_tbf *ul_tbf_by_tfi(uint8_t tfi); - struct gprs_rlcmac_tbf *dl_tbf_by_tfi(uint8_t tfi); + struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); + struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); #endif uint8_t m_is_enabled; /* TS is enabled */ @@ -193,12 +193,12 @@ public: /** add paging to paging queue(s) */ int add_paging(uint8_t chan_needed, uint8_t *identity_lv); - gprs_rlcmac_tbf *dl_tbf_by_tlli(uint32_t tlli); - gprs_rlcmac_tbf *ul_tbf_by_tlli(uint32_t tlli); - 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); + gprs_rlcmac_dl_tbf *dl_tbf_by_tlli(uint32_t tlli); + gprs_rlcmac_ul_tbf *ul_tbf_by_tlli(uint32_t tlli); + gprs_rlcmac_dl_tbf *dl_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts); + gprs_rlcmac_ul_tbf *ul_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts); + gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi, uint8_t trx); + gprs_rlcmac_ul_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);