From patchwork Sun Mar 16 13:27:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Freyther X-Patchwork-Id: 330692 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 11A652C0089 for ; Mon, 17 Mar 2014 00:28:57 +1100 (EST) Received: from localhost ([127.0.0.1] helo=ganesha.gnumonks.org) by ganesha.gnumonks.org with esmtp (Exim 4.72) (envelope-from ) id 1WPB7O-0007K2-Be; Sun, 16 Mar 2014 14:28:46 +0100 Received: from mail.sysmocom.de ([144.76.43.93]) by ganesha.gnumonks.org with esmtp (Exim 4.72) (envelope-from ) id 1WPB71-0007Jo-Hs for openbsc@lists.osmocom.org; Sun, 16 Mar 2014 14:28:25 +0100 Received: from sangmingze-mail.local (91-66-230-156-dynip.superkabel.de [91.66.230.156]) by mail.sysmocom.de (Postfix) with ESMTPSA id 2A9FA4C94A; Sun, 16 Mar 2014 13:28:23 +0000 (UTC) Received: from localhost.lan ([127.0.0.1] helo=xiaoyu.lan) by sangmingze-mail.local with esmtp (Exim 4.82) (envelope-from ) id 1WPB6x-0004G9-PE; Sun, 16 Mar 2014 14:28:19 +0100 From: Holger Hans Peter Freyther To: openbsc@lists.osmocom.org Subject: [PATCH] sysmobts: Add a magic number to the hLayer2 to differentiate it Date: Sun, 16 Mar 2014 14:27:38 +0100 Message-Id: <1394976458-16342-1-git-send-email-holger@freyther.de> X-Mailer: git-send-email 1.9.0 X-Spam-Score: 0.1 (/) X-Spam-Report: SpamASsassin versoin 3.3.1 on ganesha.gnumonks.org summary: Content analysis details: (0.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.1 TW_TR BODY: Odd Letter Triples with TR Cc: laforge@gnumonks.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 From: Holger Hans Peter Freyther The DSP/FPGA appears to report bogus PhDataInd with hlayer2 == 0. Currently this would match the TRX==0,TS==0 and SS=0 and then we report bad measurement reports. Add a magic number to the lower eight bit of the hLayer2 to differentiate valid numbers. Addresses: <0004> measurement.c:97 (bts=0,trx=0,ts=0,ss=0) measurement during state: NONE <0004> measurement.c:102 (bts=0,trx=0,ts=0,ss=0) no space for uplink measurement --- src/osmo-bts-sysmo/oml.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 596680f..7fcd4c6 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -704,17 +704,24 @@ err: uint32_t l1if_lchan_to_hLayer(struct gsm_lchan *lchan) { - return (lchan->nr << 8) | (lchan->ts->nr << 16) | (lchan->ts->trx->nr << 24); + return 0xBB + | (lchan->nr << 8) + | (lchan->ts->nr << 16) + | (lchan->ts->trx->nr << 24); } /* obtain a ptr to the lapdm_channel for a given hLayer */ struct gsm_lchan * l1if_hLayer_to_lchan(struct gsm_bts_trx *trx, uint32_t hLayer2) { + uint8_t magic = hLayer2 & 0xff; uint8_t ts_nr = (hLayer2 >> 16) & 0xff; uint8_t lchan_nr = (hLayer2 >> 8)& 0xff; struct gsm_bts_trx_ts *ts; + if (magic != 0xBB) + return NULL; + /* FIXME: if we actually run on the BTS, the 32bit field is large * enough to simply put a pointer inside. */ if (ts_nr >= ARRAY_SIZE(trx->ts))