From patchwork Thu Aug 28 13:19:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Welte X-Patchwork-Id: 383836 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 B572914012D for ; Thu, 28 Aug 2014 23:22:25 +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 1XMzeR-0001Cr-UV; Thu, 28 Aug 2014 15:22:08 +0200 Received: from uucp by ganesha.gnumonks.org with local-bsmtp (Exim 4.72) (envelope-from ) id 1XMzdy-0001Ci-8p; Thu, 28 Aug 2014 15:21:38 +0200 Received: from laforge by localhost.localdomain with local (Exim 4.84) (envelope-from ) id 1XMzcG-00020z-Uh; Thu, 28 Aug 2014 15:19:52 +0200 Date: Thu, 28 Aug 2014 15:19:52 +0200 From: Harald Welte To: Holger Hans Peter Freyther Subject: Re: [PATCH 27/33] Add MEAS (MPH_INFO) IND message to PH-/MPH-/TCH-SAP interface Message-ID: <20140828131952.GA12087@nataraja> References: <1409176492-13269-1-git-send-email-laforge@gnumonks.org> <1409176492-13269-28-git-send-email-laforge@gnumonks.org> <20140828120130.GC3508@xiaoyu.lan> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140828120130.GC3508@xiaoyu.lan> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Andreas Eversberg , openbsc@lists.osmocom.org 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 Hi Holger, On Thu, Aug 28, 2014 at 02:01:30PM +0200, Holger Hans Peter Freyther wrote: > > - lchan->ciph_state = LCHAN_CIPH_TXRX_REQ; > > this looks to belong to a different patch?! Indeed, I accidentially squashed two wrong commits. I've fixed it. The two affected patcheas are patch 26 and 27 of the series, new commits are: 69eba91fdc97f042f72049a754f0162c9c289f45 and 0fa6dc976b41757c95c587989185b5bb55d17fdf attached for your reference (rather than spamming the list with the entire series again). From 0fa6dc976b41757c95c587989185b5bb55d17fdf Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sat, 31 Aug 2013 20:30:40 +0200 Subject: [PATCH 2/8] Add MEAS (MPH_INFO) IND message to PH-/MPH-/TCH-SAP interface This part moves processing of measurement infos from osmo-bts-sysmo to common part. --- src/common/l1sap.c | 32 ++++++++++++++++++++++++++++++++ src/osmo-bts-sysmo/l1_if.c | 26 +++++++++++++------------- 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 9c7a9c6..c1e9f9f 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -155,6 +155,35 @@ static int l1sap_info_time_ind(struct gsm_bts_trx *trx, return 0; } +/* measurement information received from bts model */ +static int l1sap_info_meas_ind(struct gsm_bts_trx *trx, + struct osmo_phsap_prim *l1sap, + struct info_meas_ind_param *info_meas_ind) +{ + struct bts_ul_meas ulm; + struct gsm_lchan *lchan; + + DEBUGP(DL1P, "MPH_INFO meas ind chan_nr=%02x\n", + info_meas_ind->chan_nr); + + lchan = &trx->ts[L1SAP_CHAN2TS(info_meas_ind->chan_nr)] + .lchan[l1sap_chan2ss(info_meas_ind->chan_nr)]; + + /* in the GPRS case we are not interested in measurement + * processing. The PCU will take care of it */ + if (lchan->type == GSM_LCHAN_PDTCH) + return 0; + + memset(&ulm, 0, sizeof(ulm)); + ulm.ta_offs_qbits = info_meas_ind->ta_offs_qbits; + ulm.ber10k = info_meas_ind->ber10k; + ulm.inv_rssi = info_meas_ind->inv_rssi; + + lchan_new_ul_meas(lchan, &ulm); + + return 0; +} + /* any L1 MPH_INFO indication prim recevied from bts model */ static int l1sap_mph_info_ind(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap, struct mph_info_param *info) @@ -165,6 +194,9 @@ static int l1sap_mph_info_ind(struct gsm_bts_trx *trx, case PRIM_INFO_TIME: rc = l1sap_info_time_ind(trx, l1sap, &info->u.time_ind); break; + case PRIM_INFO_MEAS: + rc = l1sap_info_meas_ind(trx, l1sap, &info->u.meas_ind); + break; default: LOGP(DL1P, LOGL_NOTICE, "unknown MPH_INFO ind type %d\n", info->type); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 14efc2c..38daa97 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -891,20 +891,20 @@ static void dump_meas_res(int ll, GsmL1_MeasParam_t *m) m->fBer, m->i16BurstTiming); } -static int process_meas_res(struct gsm_lchan *lchan, GsmL1_MeasParam_t *m) +static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, + GsmL1_MeasParam_t *m) { - struct bts_ul_meas ulm; - - /* in the GPRS case we are not interested in measurement - * processing. The PCU will take care of it */ - if (lchan->type == GSM_LCHAN_PDTCH) - return 0; - - ulm.ta_offs_qbits = m->i16BurstTiming; - ulm.ber10k = (unsigned int) (m->fBer * 100); - ulm.inv_rssi = (uint8_t) (m->fRssi * -1); + struct osmo_phsap_prim l1sap; + memset(&l1sap, 0, sizeof(l1sap)); + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, + PRIM_OP_INDICATION, NULL); + l1sap.u.info.type = PRIM_INFO_MEAS; + l1sap.u.info.u.meas_ind.chan_nr = chan_nr; + l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming; + l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 100); + l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1); - return lchan_new_ul_meas(lchan, &ulm); + return l1sap_up(trx, &l1sap); } static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_ind, @@ -940,7 +940,7 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? 0x40 : 0x00; - process_meas_res(lchan, &data_ind->measParam); + process_meas_res(trx, chan_nr, &data_ind->measParam); if (data_ind->measParam.fLinkQuality < fl1->min_qual_norm && data_ind->msgUnitParam.u8Size != 0) { -- 2.1.0