aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/measurement.c
AgeCommit message (Collapse)AuthorFilesLines
2018-02-27measurement: Keep average of high-accurate ToA value in lchanHarald Welte1-0/+1
At the end of a measurement processing window, we currently compute the ToA / timing offset at 1/256th symbol accuracy, but we only print it to the log. Let's store the value in the lchan to make it usable by other code in follow-up patches. Change-Id: I5f00a16ac966b627d9452a98b8fa70984bed684a
2018-02-27measurement.c: higher-precision TA/TOA mathHarald Welte1-5/+5
Change-Id: I0dc8e78545465dfc5c93691a49b86b6b8b56b432
2018-02-26measurement.c: Don't silently copy "FULL" measurements to "SUB"Harald Welte1-2/+5
The existing code contained an ugly hack that if we didn't have any "SUB" measurements we would simply use the "FULL" values. That's wrong as TS 45.008 contains quite detailed rules on how the "SUB" values are to be computed. In some cases, they are identical to "FULL", but in most they are not. Let's remove the hack and replace it with an ERROR message, as clearly something is wrong if we ever encounter a measurement period end in which no single "SUB" measurement was received. The only situation in which this can occur is if the related uplink burst/block was missing, so let's set BER to 100% and level to lowest possible. Change-Id: I358f7b97fd4ea19264a77eff7abef13da7d5fbcd
2018-02-26measurement: Compute RX{LEV,QUAL}-SUB for SDCCH and non-AMR TCHHarald Welte1-3/+99
The rules on how to compute RX{LEV,QUAL}-SUB are rather convoluted, and depend on the detailed channel type and mode. For SDCCH and TCH/H in signalling mode, it's easy: No DTX is allowed, and all measurements are used in SUB. For non-AMR (TCH/F and TCH/H in non-signalling mode), we need to count the SACCH block measurements, as well as any SID/SID_UPDATE/L3_FILL/DUMMY blocks received in the blocks of table 8.3 of TS 45.008. Only AMR (TCH/AFS + TCH/AHS) are more difficult, as there are no fixed blocks/bursts/frames that always contain uplink messages, but the L1 will have to determine if a valid SID_UPDATE was received or not. This patch implements the above rules (except AMR related) in the common part of OsmoBTS. The AMR specific bits will have to follow as a later patch, likely in a BTS specific way, i.e. separate changes to sysmo/lc15/octphy/trx code. Related: OS#2978 Change-Id: I16eb3747a1c23df935a4c50dafe46abce512a474
2018-02-26measurement.c: Fix sdcch4_meas_rep_fn102 / sdcch8_meas_rep_fn102Harald Welte1-15/+14
Since Change-Id: I23fba50f48415314da40cf5bf86fce2ed3e66af6 we were not reporting measurements for SDCCH channel types due to the wrong encoding of the sdcch{4,8}_meas_rep_fn102 table. Let's fix the table by encoding the needed information: "What is the modulo-102 remainder of the first burst of the last block before fn%102 reaches 37?" (SDCCH/4) "What is the modulo-102 remainder of the first burst of the last block before fn%102 reaches 12?" (SDCCH/8) The TS 45.002 Clause 7 tables have to be consulted carefully to determine this information. Change-Id: Icf02354872670126ab3297b787b216981ca6c309 Related: OS#2965
2018-02-23measurement.c: Hand Frame Number into measurement computationHarald Welte1-4/+4
This is currently only used for logging, but will be needed for proper RX{LEV,QUAL}-SUB reporting in upcoming patches. Related: OS#2978 Change-Id: I07fd06e8a379cab7c0c2eb111c3f5600037d3c9e
2018-02-23Revert "measurement: fix measurement computation"Harald Welte1-47/+0
This reverts commit d5fdcfe6d95f52fb76c4f4201969347a062fc9fd, which introduces a new function lchan_meas_update_ordered_TA whose functionality I still haven't yet managed to fully understand. It appears to be adjusting the requested timing advance (lchan->rqd_ta) but outside osmo-bts-trx/loops.c code. This is odd, as rqd_ta is a state variable of that loops.c code. So for one part, it is a failure of encapsulation. The TA loop code should be self-contained, particularly as it is only used for omso-bts-trx, and not for the other BTS models. The new lchan_meas_update_ordered_TA() function is used from common code, applicable to all BTS models. The resulting interaction between loops.c code and this new (now reverted) function cause the TA value to only ever grow, despite the MS never moving at all. Change-Id: I5a5adac6f18f94a5b51758a5ace8ef6ddfd23e80 Related: OS#2989
2017-12-02measurment.c: Introduce INFO category for DMEAS loggingHarald Welte1-2/+2
There's no point in either having full verbosity in DEBUG level and not logging any measurement related information in INFO. Let's at least print the results at the end of each measurement period in INFO level. Change-Id: I2c870531478c05ce31cc1015597a068a4a76cf99
2017-12-02measurement.c: Fix various typos in commentsHarald Welte1-8/+8
Change-Id: Ief208045664769406cd60a92a12c4b44988a98b4
2017-07-10measurement: fix measurment reportPhilipp Maier1-24/+65
The end of the measurement reporting period is not aligned with the SACCH block where the results are reported. The tables that are used to detect the end of the measurement period are therefore wrong. The frame number of the SACCH block must be used and not the TDMA frame number (modulo 104) of the measurement reporing interval. The tables are oriented to the frame number of the first SACCH block, at the beginning of an interval. However, when a SACCH block is received it will always contain the result of the recently passed measurement reporting period. To match the tables, introduce another lookup table to remap each SACCH block that ends to the matching beginning block number. Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924
2017-06-26measurement: improve log outputPhilipp Maier1-4/+7
The code that receives the uplink measurement data from L1 does not print the number of already received uplink measurements. Since this is a valuable information when debugging the log output will now print this information as well. (Patch by Octasic Inc.) Change-Id: I79926f25de088571fcc2c14388c72fc968c2d382
2017-06-24measurement: Remove dead codeHarald Welte1-37/+0
We used to have trx_meas_check_compute() and call that from the bts-specific code in order to iterate over all timeslots and all lchans in the timeslots if we have to send measurement reports. This was executed once per frame, and created unequal CPU load over time, which in turn might increase different per-ts jitter. Since 2f028c4e2c29f63df9926435466aa35377947767 in April 2017 we have lchan_meas_check_compute(), which performs this on a per-lchan basis, and hence CPU load is distributed over all active timeslots. Change-Id: I6308cefe4a51e55719ea4ed4d613d3782b805c08
2017-06-13measurement: Improve log outputPhilipp Maier1-10/+22
The debug log does not print much information about the measured rxlev and rxqual values. This commit adds debug output to make measurement debugging simpler Change-Id: Ic871eed6dcbc7d10aca6cd11dbc803b3e6da449f
2017-06-09cosmetic: remove unused variablePhilipp Maier1-1/+0
Tha variable ms_timing_offset in lchan_meas_check_compute is not used anymore. Change-Id: I40c393f6864fe72b88a70da265b7775da8fb469c
2017-06-09Revert "measurement: exclude idle channels from uplink measurement"Philipp Maier1-29/+24
The offsets used in the lookup tables may be phy dependand. So we will have to do the alignment in the layer 1 interface of the phy dependand code before we report the frame number up to the higher layers. This reverts commit e0fb3ae52d747b26b6487ec67c79eceaf37a125c. Change-Id: I8acab50cc1bb1cb133831c6a145f4d790e99176c
2017-06-09measurement: fix measurement computationPhilipp Maier1-0/+51
Timing advance is currently not taken into account when computing the measurement results, this commit fixes that Change-Id: I2e0dfd13b53e8aa2822985f12bf2985e683ab553
2017-05-24measurement: exclude idle channels from uplink measurementPhilipp Maier1-24/+29
The DATA-IND, received from the physical layer does not only include the actual uplink data. It also includes the frames which are received when the channel is idle (which is just noise). This would falsify the measurement results. Depending on the BTS model, the phy may also filter the idle frames and not send a DATA-IND at all, when the channel is idle. If this is the case, the measurement period end can not be detected properly. The idle frames are located at the very end of each measurement period. In order to fix the issue, the measurement perioud has to end early. For TCH/F and TCH/H 1, one frame has to be skipped. For TCH/H 0 two frames are skipped. Example: For a TCH/F in TS0, the Measurement perioud would end at frame number 103. However, 103 is reserverd as idle frame. So we need to detect the end of the measurement period at frame number 103 (-1). Change-Id: I471a767c7974bdacadc3233d0c3e7b7965f6eafa
2017-05-17measurement: make lchan_meas_check_compute() available to l1sap.cPhilipp Maier1-1/+1
lchan_meas_check_compute() is a static function measurement.c. In order to distribute the measurement result calculation events, we need to be able to call lchan_meas_check_compute() from l1sap.c Change-Id: Ideffe896613e0feda443bc13dac59dcdbbc605aa
2017-05-17measurement: fix measurement reporting periodPhilipp Maier1-3/+35
The measurement reporting for the MS on a SDCCH lacks some of the periods, defined in 3GPP TS 45.008, section 8.4.2. This adds the missing conditions by adding complete lookup tables. Change-Id: I23fba50f48415314da40cf5bf86fce2ed3e66af6
2017-05-17measurement/cosmetic: Fixup source code commentPhilipp Maier1-1/+15
the function is_meas_complete() uses the *_meas_rep_fn104[] lookup tables, defined at the beginning of the source file. These lookup tabels contain a lot of magic numbers. This commit adds a more elaborated comment with a reference to the specification/section in order make the values understandable. Change-Id: Ic6e4037f965772e6b851c67662d5e7bf64cc04eb
2017-05-17measurement/cosmetic: Fixup source code commentPhilipp Maier1-1/+14
the function ber10k_to_rxqual() has only a very brief comment with the spec reference. This commit adds a more explainatory comment that makes it easier to understand from where the ber10k constants are taken. Change-Id: I3d3488c97d0bffa7d449d3675afcc75b2a6a2703
2017-01-06fix: dyn ts: uplink measurement reportNeels Hofmeyr1-1/+1
Fix pchan value used for uplink measurement decisions for dynamic channels in TCH mode. Fixes this error log message flooding the osmo-bts log when a dyn ts is serving a voice call: <0004> ../../../src/common/measurement.c:104 (bts=0,trx=0,ts=3,ss=0) no space for uplink measurement Change-Id: Id19316701fd8de6f295eeae0272eea0c315ab1b7
2016-08-30dyn TS: measurement: use correct nr of subslots, rm code dupNeels Hofmeyr1-15/+1
In measurement.c, fix the number of sublots for TCH/F_TCH/H_PDCH, by using ts_subslots() from gsm_data_shared.c. The local dup of subslots_per_pchan[] is no longer needed. (depends on recent commit to openbsc.git for ts_sublots()) Change-Id: I9d9df470c49487bffd56dde42c7bec0da2f50642
2016-08-10dyn TS: measurement.c: replace fixme with commentNeels Hofmeyr1-1/+1
Change-Id: I04668f6f01a48157a98c6326a9ee48982a09ee62
2016-05-31Use libosmocore function for uplink measurementsMax1-11/+0
Related: OS#1563 Change-Id: Ide47e8e69e0d2d5859c5249b22f4bad22c18aa57 Reviewed-on: https://gerrit.osmocom.org/108 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
2014-12-30Initial CBCH supportHarald Welte1-0/+4
This should handle OML channel combinations with CBCH and activate the CBCH SAPI towards the DSP correspondingly. What is still missing is sending any actual information over the CBCH in respons to the PH-RTS.ind coming up from L1.
2014-08-25make use of libosmocore 'gsm_meas_rep_unidir'Harald Welte1-8/+10
Back in March 2013, some structures and defines related to decoded measurement reports have been moved from openbsc to libosmocore (libosmocore e128f4663104ed64e33e362cff2566f36d65e658) so that they can be used also from osmo-bts. This finally follows up on that. You need openbsc 7ff4f0e0fc692bfab829da50edb104e58b271e7e or later.
2013-12-28measurement: Speculative performance changeHolger Hans Peter Freyther1-1/+14
Most timeslots do not have eight lchan. Use the subslots_per_lchan map to reduce the number of iterations. Looking at the ARM assembly showed that no loop-unrolling was done so this could be a speed up.
2013-05-04measurement: Mark the internal functions as internalHolger Hans Peter Freyther1-2/+2
In terms of assembly code this only removes the ".global FN" from the code. GCC does not attempt to inline it right now.
2013-03-24measurement: Add debug helper when we have a report for an inactive channelHolger Hans Peter Freyther1-0/+5
2012-07-08PCU: Add PCU socket interface to BTS.Andreas Eversberg1-0/+1
A special command line option "-P" is used to enable socket interface and signal available GPRS MO object to BSC.
2011-07-02measurement: fix missing \n at end of log outputHarald Welte1-1/+1
2011-07-01fix various compiler warningsHarald Welte1-1/+1
2011-06-30measurements: avoid division by zeroHarald Welte1-2/+5
2011-06-29implement baseic uplink measurement processing + reportingHarald Welte1-0/+235
* gather measurements from each PH-DATA.ind * check every TDMA frame about meas period expiration * compute averages after period expired * put MS DL MEAS REP into RSL MEAS RES messages, include UL meas bugs: * L3 INFO content seems to have some offset * is_sub is not set anywhere * measurement periods might have up/downlink offset