From patchwork Wed Aug 27 21:54:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Welte X-Patchwork-Id: 383592 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 798271400B2 for ; Thu, 28 Aug 2014 08:12:23 +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 1XMlRu-0006tn-8H; Thu, 28 Aug 2014 00:12:14 +0200 Received: from uucp by ganesha.gnumonks.org with local-bsmtp (Exim 4.72) (envelope-from ) id 1XMlC3-0004N2-1Z; Wed, 27 Aug 2014 23:55:51 +0200 Received: from laforge by localhost.localdomain with local (Exim 4.84) (envelope-from ) id 1XMlBI-0003Wf-1Y; Wed, 27 Aug 2014 23:55:04 +0200 From: Harald Welte To: openbsc@lists.osmocom.org Subject: [PATCH 22/33] l1sap: Use {data, empty}_req_from_l1sap() and avoid code duplication Date: Wed, 27 Aug 2014 23:54:41 +0200 Message-Id: <1409176492-13269-23-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: Harald Welte 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 --- src/osmo-bts-sysmo/l1_if.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 5f7b8cf..3b5e823 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -586,29 +586,12 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg, /* if we provide data, or if data is already in nmsg */ if (l1p->u.phDataReq.msgUnitParam.u8Size) { /* data request */ - GsmL1_PhDataReq_t *data_req = &l1p->u.phDataReq; - - l1p->id = GsmL1_PrimId_PhDataReq; - - data_req->hLayer1 = fl1->hLayer1; - data_req->u8Tn = u8Tn; - data_req->u32Fn = u32Fn; - data_req->sapi = sapi; - data_req->subCh = subCh; - data_req->u8BlockNbr = u8BlockNbr; + data_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, + u8BlockNbr, + l1p->u.phDataReq.msgUnitParam.u8Size); } else { /* empty frame */ - GsmL1_PhEmptyFrameReq_t *empty_req = - &l1p->u.phEmptyFrameReq; - - l1p->id = GsmL1_PrimId_PhEmptyFrameReq; - - empty_req->hLayer1 = fl1->hLayer1; - empty_req->u8Tn = u8Tn; - empty_req->u32Fn = u32Fn; - empty_req->sapi = sapi; - empty_req->subCh = subCh; - empty_req->u8BlockNbr = u8BlockNbr; + empty_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr); } /* send message to DSP's queue */ osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], nmsg);