From patchwork Tue May 31 11:58:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gerrit-no-reply@lists.osmocom.org X-Patchwork-Id: 628193 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 3rJsSg1MKCz9t4b for ; Tue, 31 May 2016 21:58:11 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id ADC0922BC1; Tue, 31 May 2016 11:58:09 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from 127.0.1.12 (unknown [127.0.1.12]) by lists.osmocom.org (Postfix) with ESMTPA id 4209722BB2; Tue, 31 May 2016 11:58:09 +0000 (UTC) Date: Tue, 31 May 2016 11:58:09 +0000 From: Harald Welte To: Max , Harald Welte X-Gerrit-MessageType: merged Subject: [MERGED] osmo-bts[master]: Use libosmocore function for uplink measurements X-Gerrit-Change-Id: Ide47e8e69e0d2d5859c5249b22f4bad22c18aa57 X-Gerrit-ChangeURL: X-Gerrit-Commit: 201b424b73ebd4da49d2fbad85d66a7068a9a28f In-Reply-To: References: MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/2.12.2-31-gb331dbd-dirty X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Development of OpenBSC, OsmoBSC, OsmoNITB, OsmoCSCN" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: laforge@gnumonks.org Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" Message-Id: <20160531115809.ADC0922BC1@lists.osmocom.org> Harald Welte has submitted this change and it was merged. Change subject: Use libosmocore function for uplink measurements ...................................................................... Use libosmocore function for uplink measurements Related: OS#1563 Change-Id: Ide47e8e69e0d2d5859c5249b22f4bad22c18aa57 Reviewed-on: https://gerrit.osmocom.org/108 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M include/osmo-bts/measurement.h M src/common/measurement.c M src/common/rsl.c 3 files changed, 9 insertions(+), 18 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/measurement.h b/include/osmo-bts/measurement.h index 493b6ff..2037ff6 100644 --- a/include/osmo-bts/measurement.h +++ b/include/osmo-bts/measurement.h @@ -5,7 +5,4 @@ int trx_meas_check_compute(struct gsm_bts_trx *trx, uint32_t fn); -/* build the 3 byte RSL uplinke measurement IE content */ -int lchan_build_rsl_ul_meas(struct gsm_lchan *, uint8_t *buf); - #endif diff --git a/src/common/measurement.c b/src/common/measurement.c index 41a0170..b0906d4 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -200,17 +200,6 @@ return 1; } -/* build the 3 byte RSL uplinke measurement IE content */ -int lchan_build_rsl_ul_meas(struct gsm_lchan *lchan, uint8_t *buf) -{ - struct gsm_meas_rep_unidir *mru = &lchan->meas.ul_res; - buf[0] = (mru->full.rx_lev & 0x3f); /* FIXME: DTXu support */ - buf[1] = (mru->sub.rx_lev & 0x3f); - buf[2] = ((mru->full.rx_qual & 7) << 3) | (mru->sub.rx_qual & 7); - - return 3; -} - /* Copied from OpenBSC and enlarged to _GSM_PCHAN_MAX */ static const uint8_t subslots_per_pchan[_GSM_PCHAN_MAX] = { [GSM_PCHAN_NONE] = 0, diff --git a/src/common/rsl.c b/src/common/rsl.c index ecf570c..e13d48c 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -31,6 +32,7 @@ #include #include #include +#include #include #include @@ -1692,7 +1694,8 @@ } /* 8.4.8 MEASUREMENT RESult */ -static int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len) +static int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len, + bool dtxd_used) { struct msgb *msg; uint8_t meas_res[16]; @@ -1710,7 +1713,8 @@ return -ENOMEM; msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, lchan->meas.res_nr++); - int ie_len = lchan_build_rsl_ul_meas(lchan, meas_res); + size_t ie_len = gsm0858_rsl_ul_meas_enc(&lchan->meas.ul_res, dtxd_used, + meas_res); if (ie_len >= 3) { msgb_tlv_put(msg, RSL_IE_UPLINK_MEAS, ie_len, meas_res); lchan->meas.flags &= ~LC_UL_M_F_RES_VALID; @@ -1751,8 +1755,9 @@ LOGP(DRSL, LOGL_INFO, "%s Handing RLL msg %s from LAPDm to MEAS REP\n", gsm_lchan_name(lchan), rsl_msg_name(rh->msg_type)); - - rc = rsl_tx_meas_res(lchan, msgb_l3(msg), msgb_l3len(msg)); + /* FIXME: add dtx downlink support */ + rc = rsl_tx_meas_res(lchan, msgb_l3(msg), msgb_l3len(msg), + false); msgb_free(msg); return rc; } else {