From patchwork Wed Aug 27 21:54:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Welte X-Patchwork-Id: 383595 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 2723614010F for ; Thu, 28 Aug 2014 08:14:47 +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 1XMlUF-00071J-73; Thu, 28 Aug 2014 00:14:39 +0200 Received: from uucp by ganesha.gnumonks.org with local-bsmtp (Exim 4.72) (envelope-from ) id 1XMlCD-0004Nt-T1; Wed, 27 Aug 2014 23:56:02 +0200 Received: from laforge by localhost.localdomain with local (Exim 4.84) (envelope-from ) id 1XMlBH-0003WD-Rx; Wed, 27 Aug 2014 23:55:03 +0200 From: Harald Welte To: openbsc@lists.osmocom.org Subject: [PATCH 18/33] Relace bts_model_get_time() by get_time() at common part Date: Wed, 27 Aug 2014 23:54:37 +0200 Message-Id: <1409176492-13269-19-git-send-email-laforge@gnumonks.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1409176492-13269-1-git-send-email-laforge@gnumonks.org> References: <1409176492-13269-1-git-send-email-laforge@gnumonks.org> Cc: Andreas Eversberg 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 From: Andreas Eversberg --- include/osmo-bts/bts.h | 2 ++ include/osmo-bts/bts_model.h | 2 -- include/osmo-bts/rsl.h | 2 +- src/common/bts.c | 8 ++++++++ src/common/rsl.c | 3 ++- src/osmo-bts-sysmo/oml.c | 11 +---------- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index e489973..db30eb4 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -39,5 +39,7 @@ void load_timer_start(struct gsm_bts *bts); void bts_update_status(enum bts_global_status which, int on); +struct gsm_time *get_time(struct gsm_bts *bts); + #endif /* _BTS_H */ diff --git a/include/osmo-bts/bts_model.h b/include/osmo-bts/bts_model.h index f9b3f0b..64161d2 100644 --- a/include/osmo-bts/bts_model.h +++ b/include/osmo-bts/bts_model.h @@ -12,8 +12,6 @@ int bts_model_init(struct gsm_bts *bts); -struct gsm_time *bts_model_get_time(struct gsm_bts *bts); - int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type, struct tlv_parsed *old_attr, struct tlv_parsed *new_attr, void *obj); diff --git a/include/osmo-bts/rsl.h b/include/osmo-bts/rsl.h index 6e8122f..42ea6ef 100644 --- a/include/osmo-bts/rsl.h +++ b/include/osmo-bts/rsl.h @@ -17,7 +17,7 @@ int rsl_tx_chan_rqd(struct gsm_bts_trx *trx, struct gsm_time *gtime, uint8_t ra, uint8_t acc_delay); int rsl_tx_est_ind(struct gsm_lchan *lchan, uint8_t link_id, uint8_t *data, int len); -int rsl_tx_chan_act_ack(struct gsm_lchan *lchan, struct gsm_time *gtime); +int rsl_tx_chan_act_ack(struct gsm_lchan *lchan); int rsl_tx_chan_act_nack(struct gsm_lchan *lchan, uint8_t cause); int rsl_tx_conn_fail(struct gsm_lchan *lchan, uint8_t cause); int rsl_tx_rf_rel_ack(struct gsm_lchan *lchan); diff --git a/src/common/bts.c b/src/common/bts.c index 6cbafd1..74b5144 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -601,3 +601,11 @@ int bts_supports_cipher(struct gsm_bts_role_bts *bts, int rsl_cipher) sup = (1 << (rsl_cipher - 2)) & bts->support.ciphers; return sup > 0; } + +struct gsm_time *get_time(struct gsm_bts *bts) +{ + struct gsm_bts_role_bts *btsb = bts->role; + + return &btsb->gsm_time; +} + diff --git a/src/common/rsl.c b/src/common/rsl.c index 11c7c71..b2e5622 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -520,8 +520,9 @@ int rsl_tx_rf_rel_ack(struct gsm_lchan *lchan) } /* 8.4.2 sending CHANnel ACTIVation ACKnowledge */ -int rsl_tx_chan_act_ack(struct gsm_lchan *lchan, struct gsm_time *gtime) +int rsl_tx_chan_act_ack(struct gsm_lchan *lchan) { + struct gsm_time *gtime = get_time(lchan->ts->trx->bts); struct msgb *msg; uint8_t chan_nr = gsm_lchan2chan_nr(lchan); uint8_t ie[2]; diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index b590eff..853cb43 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -960,10 +960,8 @@ static int sapi_activate_cb(struct gsm_lchan *lchan, int status) if (lchan->state != LCHAN_S_ACT_REQ) return 0; - struct gsm_time *time; lchan_set_state(lchan, LCHAN_S_ACTIVE); - time = bts_model_get_time(lchan->ts->trx->bts); - rsl_tx_chan_act_ack(lchan, time); + rsl_tx_chan_act_ack(lchan); /* set the initial ciphering parameters for both directions */ l1if_set_ciphering(fl1h, lchan, 0); @@ -1518,13 +1516,6 @@ static int lchan_deactivate_sacch(struct gsm_lchan *lchan) return 0; } -struct gsm_time *bts_model_get_time(struct gsm_bts *bts) -{ - struct femtol1_hdl *fl1h = trx_femtol1_hdl(bts->c0); - - return &fl1h->gsm_time; -} - /* callback from OML */ int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type, struct tlv_parsed *old_attr, struct tlv_parsed *new_attr,