From patchwork Wed Feb 3 18:24:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Welte X-Patchwork-Id: 578282 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 EDBB91402EC for ; Thu, 4 Feb 2016 05:24:57 +1100 (AEDT) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id 92C1A1417A; Wed, 3 Feb 2016 18:24:51 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from ganesha.gnumonks.org (ganesha.gnumonks.org [213.95.27.120]) by lists.osmocom.org (Postfix) with ESMTP id 59E7D14114 for ; Wed, 3 Feb 2016 18:24:40 +0000 (UTC) Received: from uucp by ganesha.gnumonks.org with local-bsmtp (Exim 4.72) (envelope-from ) id 1aR26Y-0004BE-V2; Wed, 03 Feb 2016 19:24:39 +0100 Received: from laforge by localhost.localdomain with local (Exim 4.86) (envelope-from ) id 1aR268-0003PH-7u; Wed, 03 Feb 2016 19:24:12 +0100 From: laforge@gnumonks.org To: openbsc@lists.osmocom.org Subject: [PATCH 6/7] TRX: scheduler: Remove dependency to trx_if.[ch] Date: Wed, 3 Feb 2016 19:24:05 +0100 Message-Id: <1454523846-13022-6-git-send-email-laforge@gnumonks.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1454523846-13022-1-git-send-email-laforge@gnumonks.org> References: <1454523846-13022-1-git-send-email-laforge@gnumonks.org> X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Development of the OpenBSC GSM base station controller List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" From: Harald Welte --- src/osmo-bts-trx/scheduler.c | 14 +++----------- src/osmo-bts-trx/scheduler_backend.h | 1 + src/osmo-bts-trx/scheduler_trx.c | 10 ++++++++++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/osmo-bts-trx/scheduler.c b/src/osmo-bts-trx/scheduler.c index 10f8972..dee46ed 100644 --- a/src/osmo-bts-trx/scheduler.c +++ b/src/osmo-bts-trx/scheduler.c @@ -38,7 +38,6 @@ #include "scheduler.h" #include "scheduler_backend.h" -//#include "trx_if.h" extern void *tall_bts_ctx; @@ -1325,10 +1324,8 @@ int trx_sched_set_lchan(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t link_i } /* disable handover detection (on deactivation) */ - if (!active) { - struct trx_l1h *l1h = trx_l1h_hdl(l1t->trx); - trx_if_cmd_nohandover(l1h, tn, ss); - } + if (!active) + _sched_act_rach_det(l1t, tn, ss, 0); return rc; } @@ -1340,7 +1337,6 @@ int trx_sched_set_mode(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t rsl_cmo { uint8_t tn = L1SAP_CHAN2TS(chan_nr); struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); - struct trx_l1h *l1h = trx_l1h_hdl(l1t->trx); uint8_t ss = l1sap_chan2ss(chan_nr); int i; int rc = -EINVAL; @@ -1385,11 +1381,7 @@ int trx_sched_set_mode(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t rsl_cmo * of transceiver link). * disable handover, if state is still set, since we might not know * the actual state of transceiver (due to loss of link) */ - if (handover) { - trx_if_cmd_handover(l1h, tn, ss); - } else { - trx_if_cmd_nohandover(l1h, tn, ss); - } + _sched_act_rach_det(l1t, tn, ss, handover); return rc; } diff --git a/src/osmo-bts-trx/scheduler_backend.h b/src/osmo-bts-trx/scheduler_backend.h index b808455..9f663cd 100644 --- a/src/osmo-bts-trx/scheduler_backend.h +++ b/src/osmo-bts-trx/scheduler_backend.h @@ -79,3 +79,4 @@ int rx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, const ubit_t *_sched_dl_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn); int _sched_rts(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn); +void _sched_act_rach_det(struct l1sched_trx *l1t, uint8_t tn, uint8_t ss, int activate); diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 0aeb835..5629a64 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -1458,3 +1458,13 @@ new_clock: return 0; } + +void _sched_act_rach_det(struct l1sched_trx *l1t, uint8_t tn, uint8_t ss, int activate) +{ + struct trx_l1h *l1h = trx_l1h_hdl(l1t->trx); + + if (activate) + trx_if_cmd_handover(l1h, tn, ss); + else + trx_if_cmd_nohandover(l1h, tn, ss); +}